@abtnode/blocklet-services 1.16.45-beta-20250702-072658-6f6c82be → 1.16.45

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.
Files changed (44) hide show
  1. package/dist/assets/access-control-5WGT2JfR.js +1 -1
  2. package/dist/assets/add-component-core-DehB4lvu.js +1 -1
  3. package/dist/assets/add-resource-DfqBSLDk.js +1 -1
  4. package/dist/assets/advanced-CJz1c7Eh.js +1 -1
  5. package/dist/assets/appearance-DsoglxbB.js +1 -1
  6. package/dist/assets/audit-logs-DKiQkfse.js +1 -1
  7. package/dist/assets/complete-Bi_BaBBl.js +1 -1
  8. package/dist/assets/component-CiFJ1vhL.js +1 -1
  9. package/dist/assets/config-JUGJKWP_.js +1 -1
  10. package/dist/assets/config-navigation-DZ54_nVv.js +1 -1
  11. package/dist/assets/connect-DhuiCF4g.js +1 -1
  12. package/dist/assets/dashboard-t9EszOna.js +2 -2
  13. package/dist/assets/domain-BaMcm6r6.js +1 -1
  14. package/dist/assets/email-0b_MYxBQ.js +1 -1
  15. package/dist/assets/exchange-passport-BnmyuwIs.js +1 -1
  16. package/dist/assets/fuel-DEqW116b.js +1 -1
  17. package/dist/assets/index-6I6juqjg.js +1 -1
  18. package/dist/assets/index-B4fH-l5R.js +1 -1
  19. package/dist/assets/index-B70kYOfj.js +1 -1
  20. package/dist/assets/index-B874LN5A.js +1 -1
  21. package/dist/assets/index-CD07vq9d.js +1 -1
  22. package/dist/assets/index-CkwXRCmN.js +1 -1
  23. package/dist/assets/index-CwUT0vPy.js +1 -1
  24. package/dist/assets/index-Dq1Rmjwf.js +1 -1
  25. package/dist/assets/index-I1i2Mc1k.js +1 -1
  26. package/dist/assets/index-YaLWfp9D.js +1 -1
  27. package/dist/assets/index-ZcD1N43m.js +1 -1
  28. package/dist/assets/invite-jaOwIvW9.js +1 -1
  29. package/dist/assets/issue-passport-DpSBB2L8.js +1 -1
  30. package/dist/assets/item-D-39k2FC.js +1 -1
  31. package/dist/assets/list-ZFC0mCy0.js +1 -1
  32. package/dist/assets/login-DbSs2lO2.js +1 -1
  33. package/dist/assets/lost-passport-Ce_WXcnR.js +1 -1
  34. package/dist/assets/open-window-hpzKFxn5.js +1 -1
  35. package/dist/assets/overview-C3aIT8Ro.js +1 -1
  36. package/dist/assets/publish-resource-CAZrBTdz.js +1 -1
  37. package/dist/assets/runtime-Drmh1-cb.js +1 -1
  38. package/dist/assets/security-BPd4v9z4.js +1 -1
  39. package/dist/assets/setup-Bo10IVJ4.js +2 -2
  40. package/dist/assets/start-C9Hvgbcz.js +1 -1
  41. package/dist/assets/step-actions-BNbc1l8F.js +1 -1
  42. package/dist/assets/table-tips-BzPqsKYQ.js +1 -1
  43. package/dist/assets/use-server-logo-UTr-CyJD.js +1 -1
  44. package/package.json +23 -23
@@ -1,4 +1,4 @@
1
- import{a as se,a3 as U,cd as Me,ce as Ve,I as K,cb as $e,cc as Ne,ai as He,ah as Je,cf as Ke,bd as Ce,k as oe,r as Ae,bb as G,cg as xe,ar as ge,B as z,b$ as Ge,ab as Ze,ch as Xe,ac as Ye,a8 as Qe,a5 as et,ax as De}from"./vendor-ux-did-connect-pzpsrvqx.js";import{u as p,a as ae,b as te,c as tt}from"./vendor-hooks-DqdmWCmo.js";import{r as P}from"./vendor-react-DEoibe3W.js";import{j as e,aa as u,bs as _,bo as E,O,y as $,H,T as ne,I as ie,X as le,ah as Oe,al as V,cG as nt,a9 as Be,e as je,ab as fe,a7 as ze,ad as st,ap as at}from"./vendor-mui-core-Bq8gXTan.js";import{Z as rt,v as qe,B as ot,c as it}from"./vendor-arcblock-CwufDgLV.js";import{J as Y,a9 as lt,c as Fe,D as ct,n as X,aJ as dt,A as ut,b as mt}from"./vendor-utils-BfZ4tlod.js";import{D as J,G as N,aC as re,aD as I,aL as Re}from"./index-CwUT0vPy.js";import{S as ce}from"./switch-control-Brwb8ptk.js";import{S as C}from"./section-BDMQAX_r.js";import{K as pt}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{I as ht}from"./index-DPIWnhb5.js";import{b as xt}from"./base32-DUSifB4M.js";import{u as ft}from"./use-mobile-DwzRjjku.js";import"./lottie-web-jYmAQWuC.js";const de={enabled:!1,domain:"",clientId:"",clientSecret:""};function gt(){var v,S,i;const{api:j}=J(),{blocklet:o}=N(),{t:n}=se(),s=(v=o==null?void 0:o.meta)==null?void 0:v.did,w=Object.assign({...de},((i=(S=o==null?void 0:o.settings)==null?void 0:S.oauth)==null?void 0:i.auth0)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=re({defaultValues:Y(w,Object.keys(de))}),d=h("enabled"),k=p(async r=>{var L,a;try{const{blocklet:b}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({auth0:r})}}),m=Object.assign({...de},((a=(L=b==null?void 0:b.settings)==null?void 0:L.oauth)==null?void 0:a.auth0)||{});l(m),U.success(n("oauth.saveSuccess"))}catch(b){U.error(b.message||n("oauth.saveFailed"))}}),T=p(r=>r!=null&&r.trim()?!0:n("oauth.auth0.domainDescription")),x=p(r=>r!=null&&r.trim()?!0:n("oauth.auth0.clientIdDescription")),g=p(r=>r!=null&&r.trim()?!0:n("oauth.auth0.clientSecretDescription")),y=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.auth0.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:r})=>e.jsx(_,{control:e.jsx(ce,{sx:{ml:1},checked:r.value,...r})})})}),e.jsx(C,{title:n("oauth.auth0.domain"),children:e.jsx(I,{name:"domain",control:f,rules:{validate:d?T:y},render:({field:r})=>{var L;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...r,size:"small",label:n("oauth.auth0.domain"),error:!!c.errors[r.name],helperText:((L=c.errors[r.name])==null?void 0:L.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.auth0.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?x:y},render:({field:r})=>{var L;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...r,size:"small",label:n("oauth.auth0.clientId"),error:!!c.errors[r.name],helperText:((L=c.errors[r.name])==null?void 0:L.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.auth0.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?g:y},render:({field:r})=>{var L;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...r,size:"small",type:"password",label:n("oauth.auth0.clientSecret"),error:!!c.errors[r.name],helperText:((L=c.errors[r.name])==null?void 0:L.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const ue={enabled:!1,clientId:"",clientSecret:""};function jt(){var y,v,S;const{api:j}=J(),{blocklet:o}=N(),{t:n}=se(),s=(y=o==null?void 0:o.meta)==null?void 0:y.did,w=Object.assign({...ue},((S=(v=o==null?void 0:o.settings)==null?void 0:v.oauth)==null?void 0:S.github)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=re({defaultValues:Y(w,Object.keys(ue))}),d=h("enabled"),k=p(async i=>{var r,L;try{const{blocklet:a}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({github:i})}}),b=Object.assign({...ue},((L=(r=a==null?void 0:a.settings)==null?void 0:r.oauth)==null?void 0:L.github)||{});l(b),U.success(n("oauth.saveSuccess"))}catch(a){U.error(a.message||n("oauth.saveFailed"))}}),T=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientSecretDescription")),g=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.github.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:i})=>e.jsx(_,{control:e.jsx(ce,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(C,{title:n("oauth.github.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?T:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.github.clientId"),error:!!c.errors[i.name],helperText:((r=c.errors[i.name])==null?void 0:r.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.github.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.github.clientSecret"),error:!!c.errors[i.name],helperText:((r=c.errors[i.name])==null?void 0:r.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const me={enabled:!1,clientId:"",clientSecret:""};function bt(){var y,v,S;const{api:j}=J(),{blocklet:o}=N(),{t:n}=se(),s=(y=o==null?void 0:o.meta)==null?void 0:y.did,w=Object.assign({...me},((S=(v=o==null?void 0:o.settings)==null?void 0:v.oauth)==null?void 0:S.google)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=re({defaultValues:Y(w,Object.keys(me))}),d=h("enabled"),k=p(async i=>{var r,L;try{const{blocklet:a}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({google:i})}}),b=Object.assign({...me},((L=(r=a==null?void 0:a.settings)==null?void 0:r.oauth)==null?void 0:L.google)||{});l(b),U.success(n("oauth.saveSuccess"))}catch(a){U.error(a.message||n("oauth.saveFailed"))}}),T=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientSecretDescription")),g=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.google.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:i})=>e.jsx(_,{control:e.jsx(ce,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(C,{title:n("oauth.google.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?T:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.google.clientId"),error:!!c.errors[i.name],helperText:((r=c.errors[i.name])==null?void 0:r.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.google.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.google.clientSecret"),error:!!c.errors[i.name],helperText:((r=c.errors[i.name])==null?void 0:r.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const pe={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function vt(){var i,r,L;const{api:j}=J(),{blocklet:o}=N(),{t:n}=se(),s=(i=o==null?void 0:o.meta)==null?void 0:i.did,w=Object.assign({...pe},((L=(r=o==null?void 0:o.settings)==null?void 0:r.oauth)==null?void 0:L.apple)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=re({defaultValues:Y(w,Object.keys(pe))}),d=h("enabled"),k=p(async a=>{var b,m;try{const{blocklet:R}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({apple:a})}}),A=Object.assign({...pe},((m=(b=R==null?void 0:R.settings)==null?void 0:b.oauth)==null?void 0:m.apple)||{});l(A),U.success(n("oauth.saveSuccess"))}catch(R){U.error(R.message||n("oauth.saveFailed"))}}),T=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.teamIdDescription")),x=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.serviceIdDescription")),g=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.keyIdDescription")),y=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.authKeyDescription")),v=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.bundleIdDescription")),S=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.apple.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:a})=>e.jsx(_,{control:e.jsx(ce,{sx:{ml:1},checked:a.value,...a})})})}),e.jsx(C,{title:n("oauth.apple.teamId"),children:e.jsx(I,{name:"teamId",control:f,rules:{validate:d?T:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.teamId"),error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.bundleId"),children:e.jsx(I,{name:"bundleId",control:f,rules:{validate:d?v:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.bundleId"),error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.serviceId"),children:e.jsx(I,{name:"serviceId",control:f,rules:{validate:d?x:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.serviceId"),error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.keyId"),children:e.jsx(I,{name:"keyId",control:f,rules:{validate:d?g:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.keyId"),error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.authKey"),children:e.jsx(I,{name:"authKey",control:f,rules:{validate:d?y:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",type:"password",label:n("oauth.apple.authKey"),multiline:!0,rows:4,error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const yt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function be({title:j,id:o,children:n,index:s,onMove:w,defaultExpand:t,onEnd:f}){const[c,h]=P.useState(t),l=P.useRef(null),d=P.useRef(null),[{handlerId:k},T]=Me({accept:"dragItem",collect(S){return{handlerId:S.getHandlerId()}},hover(S,i){var M,Q;if(!l.current)return;const r=S.index,L=s;if(r===L)return;const a=(M=l.current)==null?void 0:M.getBoundingClientRect(),b=(Q=d.current)==null?void 0:Q.getBoundingClientRect(),m=(b.bottom-b.top)/2,A=i.getClientOffset().y-a.top;r<L&&A<m||r>L&&A>m||(w(r,L),S.index=L)}}),[{isDragging:x},g]=Ve({item:{index:s,type:"dragItem"},collect:S=>({isDragging:S.isDragging()}),end:f});g(d),T(l);const y=x?.5:1,v=p(S=>{S.preventDefault(),S.stopPropagation(),h(!c)});return e.jsxs(u,{ref:l,children:[e.jsxs(u,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:d,"data-handler-id":k,children:[e.jsxs(u,{sx:{py:2,px:1,opacity:y,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:v,children:[e.jsx(u,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(K,{fontSize:20,icon:yt})}),e.jsx(ne,{sx:{flex:1},children:j}),e.jsx(ie,{size:"small",sx:{pointerEvents:"auto",transform:c?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(K,{icon:pt,style:{transform:"scale(1.5)"}})})]}),e.jsx(le,{})]}),e.jsx(u,{sx:{pl:4,py:2.5,display:c?"block":"none"},children:n})]})}be.propTypes={title:H.string.isRequired,id:H.string.isRequired,children:H.node.isRequired,index:H.number.isRequired,onMove:H.func.isRequired,onEnd:H.func.isRequired,defaultExpand:H.bool};be.defaultProps={defaultExpand:!1};const St=[{name:"github",title:"GitHub",icon:e.jsx(K,{icon:rt}),component:e.jsx(jt,{})},{name:"google",title:"Google",icon:e.jsx(K,{icon:He}),component:e.jsx(bt,{})},{name:"apple",title:"Apple",icon:e.jsx(K,{icon:Je}),component:e.jsx(vt,{})},{name:"auth0",title:"Auth0",icon:e.jsx(K,{icon:Ke}),component:e.jsx(gt,{})}],wt=["github","google","apple","auth0"];function kt(){var k,T;const{api:j}=J(),{blocklet:o}=N(),n=(k=o==null?void 0:o.meta)==null?void 0:k.did,s=((T=o==null?void 0:o.settings)==null?void 0:T.oauth)||{},w=Object.keys(s).sort((x,g)=>{var y,v,S;return((y=s[x])==null?void 0:y.order)!==void 0&&((v=s[g])==null?void 0:v.order)!==void 0?s[x].order-s[g].order:((S=s[x])==null?void 0:S.order)!==void 0?-1:1});for(const x of wt)w.includes(x)||w.push(x);const t=ae(w.reduce((x,g,y)=>Object.assign(x,{[g]:y}),{})),f=te(()=>{const x=[...St];return x.sort((g,y)=>t[g.name]-t[y.name]),x},[t.auth0,t.github,t.google]),c={};typeof window<"u"&&(c.context=window);const h=p(async x=>{const g={};Object.keys(x).forEach(y=>{g[y]={order:x[y]}}),await j.configOAuth({input:{did:n,oauth:JSON.stringify(g)}})}),l=p((x,g)=>{const y=f[x],v=f[g];t[y.name]=g,t[v.name]=x}),d=p(async()=>{await h(t)});return e.jsx(u,{sx:{".section-left":{width:"160px"}},children:e.jsx($e,{backend:Ne,...c,children:f.map((x,g)=>e.jsx(be,{index:g,id:x.name,title:x.title,icon:x.icon,onMove:l,onEnd:d,defaultExpand:x.enabled,children:x.component},x.name))})})}const Z={ttl:oe.SESSION_TTL,cacheTtl:oe.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]}};function W(j){return e.jsx(ot,{...j,sx:{transform:"scale(0.75)"}})}function he(j,o=!1){const n=o?j.ttl*86400:j.ttl/86400;return{...j,ttl:n}}function Lt(){var a,b;const{api:j}=J(),{blocklet:o}=N(),n=(a=o==null?void 0:o.meta)==null?void 0:a.did,s=lt({},Z,((b=o==null?void 0:o.settings)==null?void 0:b.session)||{});Fe(s.ttl)&&(s.ttl=Z.ttl),Fe(s.cacheTtl)&&(s.cacheTtl=Z.cacheTtl),s.phone||(s.phone=Z.phone),s.email||(s.email=Z.email);const{handleSubmit:w,control:t,formState:f,reset:c,watch:h}=re({defaultValues:Y(he(s),["ttl","cacheTtl","email","phone"])}),{t:l}=se(),d=h("email.enabled"),k=h("phone.enabled"),T=h("email.enableDomainBlackList"),x=h("email.enableDomainWhiteList"),{fields:g,append:y,remove:v}=Re({control:t,name:"email.domainBlackList"}),{fields:S,append:i,remove:r}=Re({control:t,name:"email.domainWhiteList"}),L=p(async m=>{var R;try{const{blocklet:A}=await j.updateAppSessionConfig({input:{did:n,config:ct(he(m,!0),["phone"])}}),M=Object.assign({},Z,Y(((R=A==null?void 0:A.settings)==null?void 0:R.session)||{},["ttl","cacheTtl","email","phone"]));c(he(M)),U.success(l("common.configSuccess"))}catch(A){U.error(A.message)}});return e.jsx(Tt,{onSubmit:w(L),children:e.jsxs(V,{direction:"column",gap:6,children:[e.jsxs(u,{children:[e.jsxs(u,{children:[e.jsx(ne,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.profile")}),e.jsx(u,{component:le,my:3})]}),e.jsxs(V,{gap:2,children:[e.jsx(C,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(W,{disabled:!0,checked:!0})})}),e.jsx(C,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(W,{disabled:!0,checked:!0})})}),e.jsx(C,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enabled",control:t,render:({field:m})=>e.jsx(W,{...m,checked:m.value})})})}),d&&e.jsxs(V,{direction:"column",ml:2,children:[e.jsx(C,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireVerified",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireUnique",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.trustOauthProviders",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainBlackList",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),T&&e.jsxs(u,{children:[g.map((m,R)=>e.jsxs(V,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(I,{name:`email.domainBlackList.${R}`,control:t,render:A=>e.jsx(O,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ie,{onClick:()=>v(R),children:e.jsx(Ce,{})})]},m.id)),e.jsx($,{startIcon:e.jsx(qe,{}),onClick:()=>y(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(C,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainWhiteList",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),x&&e.jsxs(u,{children:[S.map((m,R)=>e.jsxs(V,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(I,{name:`email.domainWhiteList.${R}`,control:t,render:A=>e.jsx(O,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ie,{onClick:()=>r(R),children:e.jsx(Ce,{})})]},m.id)),e.jsx($,{startIcon:e.jsx(qe,{}),onClick:()=>i(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(u,{sx:{display:"none"},children:[e.jsx(C,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.enabled",control:t,disabled:!0,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),k&&e.jsxs(V,{direction:"column",ml:2,mt:1,children:[e.jsx(C,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireVerified",control:t,render:({field:m})=>e.jsx(_,{control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireUnique",control:t,render:({field:m})=>e.jsx(_,{control:e.jsx(W,{...m,checked:m.value})})})})})]})]})]})]}),e.jsxs(u,{children:[e.jsx(ne,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.period")}),e.jsx(u,{component:le,my:3}),e.jsx(V,{direction:"column",spacing:2,children:e.jsx(I,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:m})=>e.jsx(E,{fullWidth:!0,sx:{mb:2},children:e.jsx(C,{title:l("blocklet.config.session.ttl",{day:m.value}),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{width:"100%",maxWidth:500,px:1.5},children:e.jsx(nt,{...m,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsx(u,{children:e.jsx($,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("oauth.save")})})]})})}const Tt=Oe.form`
1
+ import{a as se,a3 as U,cd as Me,ce as Ve,I as K,cb as $e,cc as Ne,ai as He,ah as Je,cf as Ke,bd as Ce,k as oe,r as Ae,bb as G,cg as xe,ar as ge,B as z,b$ as Ge,ab as Ze,ch as Xe,ac as Ye,a8 as Qe,a5 as et,ax as De}from"./vendor-ux-did-connect-pzpsrvqx.js";import{u as p,a as ae,b as te,c as tt}from"./vendor-hooks-DqdmWCmo.js";import{r as P}from"./vendor-react-DEoibe3W.js";import{j as e,aa as u,bs as _,bo as E,O,y as $,H,T as ne,I as ie,X as le,ah as Oe,al as V,cG as nt,a9 as Be,e as je,ab as fe,a7 as ze,ad as st,ap as at}from"./vendor-mui-core-Bq8gXTan.js";import{Z as rt,v as qe,B as ot,c as it}from"./vendor-arcblock-CwufDgLV.js";import{J as Y,a9 as lt,c as Fe,D as ct,n as X,aJ as dt,A as ut,b as mt}from"./vendor-utils-BfZ4tlod.js";import{D as J,G as N,aC as re,aD as I,aL as Re}from"./index-CwUT0vPy.js";import{S as ce}from"./switch-control-Brwb8ptk.js";import{S as C}from"./section-BDMQAX_r.js";import{K as pt}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{I as ht}from"./index-DPIWnhb5.js";import{b as xt}from"./base32-DUSifB4M.js";import{u as ft}from"./use-mobile-CtTQsfXN.js";import"./lottie-web-jYmAQWuC.js";const de={enabled:!1,domain:"",clientId:"",clientSecret:""};function gt(){var v,S,i;const{api:j}=J(),{blocklet:o}=N(),{t:n}=se(),s=(v=o==null?void 0:o.meta)==null?void 0:v.did,w=Object.assign({...de},((i=(S=o==null?void 0:o.settings)==null?void 0:S.oauth)==null?void 0:i.auth0)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=re({defaultValues:Y(w,Object.keys(de))}),d=h("enabled"),k=p(async r=>{var L,a;try{const{blocklet:b}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({auth0:r})}}),m=Object.assign({...de},((a=(L=b==null?void 0:b.settings)==null?void 0:L.oauth)==null?void 0:a.auth0)||{});l(m),U.success(n("oauth.saveSuccess"))}catch(b){U.error(b.message||n("oauth.saveFailed"))}}),T=p(r=>r!=null&&r.trim()?!0:n("oauth.auth0.domainDescription")),x=p(r=>r!=null&&r.trim()?!0:n("oauth.auth0.clientIdDescription")),g=p(r=>r!=null&&r.trim()?!0:n("oauth.auth0.clientSecretDescription")),y=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.auth0.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:r})=>e.jsx(_,{control:e.jsx(ce,{sx:{ml:1},checked:r.value,...r})})})}),e.jsx(C,{title:n("oauth.auth0.domain"),children:e.jsx(I,{name:"domain",control:f,rules:{validate:d?T:y},render:({field:r})=>{var L;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...r,size:"small",label:n("oauth.auth0.domain"),error:!!c.errors[r.name],helperText:((L=c.errors[r.name])==null?void 0:L.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.auth0.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?x:y},render:({field:r})=>{var L;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...r,size:"small",label:n("oauth.auth0.clientId"),error:!!c.errors[r.name],helperText:((L=c.errors[r.name])==null?void 0:L.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.auth0.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?g:y},render:({field:r})=>{var L;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...r,size:"small",type:"password",label:n("oauth.auth0.clientSecret"),error:!!c.errors[r.name],helperText:((L=c.errors[r.name])==null?void 0:L.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const ue={enabled:!1,clientId:"",clientSecret:""};function jt(){var y,v,S;const{api:j}=J(),{blocklet:o}=N(),{t:n}=se(),s=(y=o==null?void 0:o.meta)==null?void 0:y.did,w=Object.assign({...ue},((S=(v=o==null?void 0:o.settings)==null?void 0:v.oauth)==null?void 0:S.github)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=re({defaultValues:Y(w,Object.keys(ue))}),d=h("enabled"),k=p(async i=>{var r,L;try{const{blocklet:a}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({github:i})}}),b=Object.assign({...ue},((L=(r=a==null?void 0:a.settings)==null?void 0:r.oauth)==null?void 0:L.github)||{});l(b),U.success(n("oauth.saveSuccess"))}catch(a){U.error(a.message||n("oauth.saveFailed"))}}),T=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.github.clientSecretDescription")),g=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.github.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:i})=>e.jsx(_,{control:e.jsx(ce,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(C,{title:n("oauth.github.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?T:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.github.clientId"),error:!!c.errors[i.name],helperText:((r=c.errors[i.name])==null?void 0:r.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.github.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.github.clientSecret"),error:!!c.errors[i.name],helperText:((r=c.errors[i.name])==null?void 0:r.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const me={enabled:!1,clientId:"",clientSecret:""};function bt(){var y,v,S;const{api:j}=J(),{blocklet:o}=N(),{t:n}=se(),s=(y=o==null?void 0:o.meta)==null?void 0:y.did,w=Object.assign({...me},((S=(v=o==null?void 0:o.settings)==null?void 0:v.oauth)==null?void 0:S.google)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=re({defaultValues:Y(w,Object.keys(me))}),d=h("enabled"),k=p(async i=>{var r,L;try{const{blocklet:a}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({google:i})}}),b=Object.assign({...me},((L=(r=a==null?void 0:a.settings)==null?void 0:r.oauth)==null?void 0:L.google)||{});l(b),U.success(n("oauth.saveSuccess"))}catch(a){U.error(a.message||n("oauth.saveFailed"))}}),T=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientIdDescription")),x=p(i=>i!=null&&i.trim()?!0:n("oauth.google.clientSecretDescription")),g=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.google.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:i})=>e.jsx(_,{control:e.jsx(ce,{sx:{ml:1},checked:i.value,...i})})})}),e.jsx(C,{title:n("oauth.google.clientId"),children:e.jsx(I,{name:"clientId",control:f,rules:{validate:d?T:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",label:n("oauth.google.clientId"),error:!!c.errors[i.name],helperText:((r=c.errors[i.name])==null?void 0:r.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.google.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:f,rules:{validate:d?x:g},render:({field:i})=>{var r;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...i,size:"small",type:"password",label:n("oauth.google.clientSecret"),error:!!c.errors[i.name],helperText:((r=c.errors[i.name])==null?void 0:r.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const pe={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function vt(){var i,r,L;const{api:j}=J(),{blocklet:o}=N(),{t:n}=se(),s=(i=o==null?void 0:o.meta)==null?void 0:i.did,w=Object.assign({...pe},((L=(r=o==null?void 0:o.settings)==null?void 0:r.oauth)==null?void 0:L.apple)||{}),{handleSubmit:t,control:f,formState:c,watch:h,reset:l}=re({defaultValues:Y(w,Object.keys(pe))}),d=h("enabled"),k=p(async a=>{var b,m;try{const{blocklet:R}=await j.configOAuth({input:{did:s,oauth:JSON.stringify({apple:a})}}),A=Object.assign({...pe},((m=(b=R==null?void 0:R.settings)==null?void 0:b.oauth)==null?void 0:m.apple)||{});l(A),U.success(n("oauth.saveSuccess"))}catch(R){U.error(R.message||n("oauth.saveFailed"))}}),T=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.teamIdDescription")),x=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.serviceIdDescription")),g=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.keyIdDescription")),y=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.authKeyDescription")),v=p(a=>a!=null&&a.trim()?!0:n("oauth.apple.bundleIdDescription")),S=p(()=>!0);return e.jsx(u,{children:e.jsxs("form",{onSubmit:t(k),disabled:!0,children:[e.jsx(C,{title:n("oauth.apple.enable"),mb:2.5,children:e.jsx(I,{name:"enabled",control:f,render:({field:a})=>e.jsx(_,{control:e.jsx(ce,{sx:{ml:1},checked:a.value,...a})})})}),e.jsx(C,{title:n("oauth.apple.teamId"),children:e.jsx(I,{name:"teamId",control:f,rules:{validate:d?T:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.teamId"),error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.bundleId"),children:e.jsx(I,{name:"bundleId",control:f,rules:{validate:d?v:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.bundleId"),error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.serviceId"),children:e.jsx(I,{name:"serviceId",control:f,rules:{validate:d?x:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.serviceId"),error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.keyId"),children:e.jsx(I,{name:"keyId",control:f,rules:{validate:d?g:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",label:n("oauth.apple.keyId"),error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx(C,{title:n("oauth.apple.authKey"),children:e.jsx(I,{name:"authKey",control:f,rules:{validate:d?y:S},render:({field:a})=>{var b;return e.jsx(E,{fullWidth:!0,children:e.jsx(O,{...a,size:"small",type:"password",label:n("oauth.apple.authKey"),multiline:!0,rows:4,error:!!c.errors[a.name],helperText:((b=c.errors[a.name])==null?void 0:b.message)||" ",disabled:!d})})}})}),e.jsx($,{type:"submit",variant:"contained",onSubmit:t(k),disabled:!c.isDirty,children:n("oauth.save")})]})})}const yt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function be({title:j,id:o,children:n,index:s,onMove:w,defaultExpand:t,onEnd:f}){const[c,h]=P.useState(t),l=P.useRef(null),d=P.useRef(null),[{handlerId:k},T]=Me({accept:"dragItem",collect(S){return{handlerId:S.getHandlerId()}},hover(S,i){var M,Q;if(!l.current)return;const r=S.index,L=s;if(r===L)return;const a=(M=l.current)==null?void 0:M.getBoundingClientRect(),b=(Q=d.current)==null?void 0:Q.getBoundingClientRect(),m=(b.bottom-b.top)/2,A=i.getClientOffset().y-a.top;r<L&&A<m||r>L&&A>m||(w(r,L),S.index=L)}}),[{isDragging:x},g]=Ve({item:{index:s,type:"dragItem"},collect:S=>({isDragging:S.isDragging()}),end:f});g(d),T(l);const y=x?.5:1,v=p(S=>{S.preventDefault(),S.stopPropagation(),h(!c)});return e.jsxs(u,{ref:l,children:[e.jsxs(u,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:d,"data-handler-id":k,children:[e.jsxs(u,{sx:{py:2,px:1,opacity:y,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:v,children:[e.jsx(u,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(K,{fontSize:20,icon:yt})}),e.jsx(ne,{sx:{flex:1},children:j}),e.jsx(ie,{size:"small",sx:{pointerEvents:"auto",transform:c?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(K,{icon:pt,style:{transform:"scale(1.5)"}})})]}),e.jsx(le,{})]}),e.jsx(u,{sx:{pl:4,py:2.5,display:c?"block":"none"},children:n})]})}be.propTypes={title:H.string.isRequired,id:H.string.isRequired,children:H.node.isRequired,index:H.number.isRequired,onMove:H.func.isRequired,onEnd:H.func.isRequired,defaultExpand:H.bool};be.defaultProps={defaultExpand:!1};const St=[{name:"github",title:"GitHub",icon:e.jsx(K,{icon:rt}),component:e.jsx(jt,{})},{name:"google",title:"Google",icon:e.jsx(K,{icon:He}),component:e.jsx(bt,{})},{name:"apple",title:"Apple",icon:e.jsx(K,{icon:Je}),component:e.jsx(vt,{})},{name:"auth0",title:"Auth0",icon:e.jsx(K,{icon:Ke}),component:e.jsx(gt,{})}],wt=["github","google","apple","auth0"];function kt(){var k,T;const{api:j}=J(),{blocklet:o}=N(),n=(k=o==null?void 0:o.meta)==null?void 0:k.did,s=((T=o==null?void 0:o.settings)==null?void 0:T.oauth)||{},w=Object.keys(s).sort((x,g)=>{var y,v,S;return((y=s[x])==null?void 0:y.order)!==void 0&&((v=s[g])==null?void 0:v.order)!==void 0?s[x].order-s[g].order:((S=s[x])==null?void 0:S.order)!==void 0?-1:1});for(const x of wt)w.includes(x)||w.push(x);const t=ae(w.reduce((x,g,y)=>Object.assign(x,{[g]:y}),{})),f=te(()=>{const x=[...St];return x.sort((g,y)=>t[g.name]-t[y.name]),x},[t.auth0,t.github,t.google]),c={};typeof window<"u"&&(c.context=window);const h=p(async x=>{const g={};Object.keys(x).forEach(y=>{g[y]={order:x[y]}}),await j.configOAuth({input:{did:n,oauth:JSON.stringify(g)}})}),l=p((x,g)=>{const y=f[x],v=f[g];t[y.name]=g,t[v.name]=x}),d=p(async()=>{await h(t)});return e.jsx(u,{sx:{".section-left":{width:"160px"}},children:e.jsx($e,{backend:Ne,...c,children:f.map((x,g)=>e.jsx(be,{index:g,id:x.name,title:x.title,icon:x.icon,onMove:l,onEnd:d,defaultExpand:x.enabled,children:x.component},x.name))})})}const Z={ttl:oe.SESSION_TTL,cacheTtl:oe.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]}};function W(j){return e.jsx(ot,{...j,sx:{transform:"scale(0.75)"}})}function he(j,o=!1){const n=o?j.ttl*86400:j.ttl/86400;return{...j,ttl:n}}function Lt(){var a,b;const{api:j}=J(),{blocklet:o}=N(),n=(a=o==null?void 0:o.meta)==null?void 0:a.did,s=lt({},Z,((b=o==null?void 0:o.settings)==null?void 0:b.session)||{});Fe(s.ttl)&&(s.ttl=Z.ttl),Fe(s.cacheTtl)&&(s.cacheTtl=Z.cacheTtl),s.phone||(s.phone=Z.phone),s.email||(s.email=Z.email);const{handleSubmit:w,control:t,formState:f,reset:c,watch:h}=re({defaultValues:Y(he(s),["ttl","cacheTtl","email","phone"])}),{t:l}=se(),d=h("email.enabled"),k=h("phone.enabled"),T=h("email.enableDomainBlackList"),x=h("email.enableDomainWhiteList"),{fields:g,append:y,remove:v}=Re({control:t,name:"email.domainBlackList"}),{fields:S,append:i,remove:r}=Re({control:t,name:"email.domainWhiteList"}),L=p(async m=>{var R;try{const{blocklet:A}=await j.updateAppSessionConfig({input:{did:n,config:ct(he(m,!0),["phone"])}}),M=Object.assign({},Z,Y(((R=A==null?void 0:A.settings)==null?void 0:R.session)||{},["ttl","cacheTtl","email","phone"]));c(he(M)),U.success(l("common.configSuccess"))}catch(A){U.error(A.message)}});return e.jsx(Tt,{onSubmit:w(L),children:e.jsxs(V,{direction:"column",gap:6,children:[e.jsxs(u,{children:[e.jsxs(u,{children:[e.jsx(ne,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.profile")}),e.jsx(u,{component:le,my:3})]}),e.jsxs(V,{gap:2,children:[e.jsx(C,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(W,{disabled:!0,checked:!0})})}),e.jsx(C,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(W,{disabled:!0,checked:!0})})}),e.jsx(C,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enabled",control:t,render:({field:m})=>e.jsx(W,{...m,checked:m.value})})})}),d&&e.jsxs(V,{direction:"column",ml:2,children:[e.jsx(C,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireVerified",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireUnique",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.trustOauthProviders",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainBlackList",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),T&&e.jsxs(u,{children:[g.map((m,R)=>e.jsxs(V,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(I,{name:`email.domainBlackList.${R}`,control:t,render:A=>e.jsx(O,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ie,{onClick:()=>v(R),children:e.jsx(Ce,{})})]},m.id)),e.jsx($,{startIcon:e.jsx(qe,{}),onClick:()=>y(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(C,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainWhiteList",control:t,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),x&&e.jsxs(u,{children:[S.map((m,R)=>e.jsxs(V,{direction:"row",alignItems:"center",my:1,maxWidth:"720px",children:[e.jsx(I,{name:`email.domainWhiteList.${R}`,control:t,render:A=>e.jsx(O,{...A.field,size:"small",fullWidth:!0})}),e.jsx(ie,{onClick:()=>r(R),children:e.jsx(Ce,{})})]},m.id)),e.jsx($,{startIcon:e.jsx(qe,{}),onClick:()=>i(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(u,{sx:{display:"none"},children:[e.jsx(C,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.enabled",control:t,disabled:!0,render:({field:m})=>e.jsx(_,{sx:{mt:1},control:e.jsx(W,{...m,checked:m.value})})})})}),k&&e.jsxs(V,{direction:"column",ml:2,mt:1,children:[e.jsx(C,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireVerified",control:t,render:({field:m})=>e.jsx(_,{control:e.jsx(W,{...m,checked:m.value})})})})}),e.jsx(C,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireUnique",control:t,render:({field:m})=>e.jsx(_,{control:e.jsx(W,{...m,checked:m.value})})})})})]})]})]})]}),e.jsxs(u,{children:[e.jsx(ne,{variant:"h6",fontWeight:600,children:l("blocklet.config.session.period")}),e.jsx(u,{component:le,my:3}),e.jsx(V,{direction:"column",spacing:2,children:e.jsx(I,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:m})=>e.jsx(E,{fullWidth:!0,sx:{mb:2},children:e.jsx(C,{title:l("blocklet.config.session.ttl",{day:m.value}),sectionLeftSx:{width:"600px"},children:e.jsx(u,{sx:{width:"100%",maxWidth:500,px:1.5},children:e.jsx(nt,{...m,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsx(u,{children:e.jsx($,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("oauth.save")})})]})})}const Tt=Oe.form`
2
2
  max-width: 1536px;
3
3
 
4
4
  .advanced-config {
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-2mYUqHxe.js","assets/vendor-ux-did-connect-pzpsrvqx.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-BfZ4tlod.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-hooks-DqdmWCmo.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-CwufDgLV.js","assets/index-BxJZWVOT.js","assets/index-CwUT0vPy.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{r as j,f as Et,l as ut,L as we,g as Hn,u as Jn,i as Gn,j as wt}from"./vendor-react-DEoibe3W.js";import{a9 as Ie,j as e,v as Ve,aa as c,aq as Lt,H as s,ad as ye,I as de,T as A,s as Xn,c5 as Jo,D as pt,ah as Re,aw as Yn,bR as ot,ak as ht,bs as nt,bw as st,y as ee,ab as Se,P as Go,G as Xo,w as qt,a8 as Yo,M as Zo,q as be,X as Zn,aj as Qo,t as Ko,bT as Qn,N as Ye,z as en,O as re,al as Ce,c6 as tn,L as on,A as Nt,b8 as nn,bJ as sn,bx as Kn,e as rn,at as es,bZ as ts,af as os,U as ln,W as rt,bE as ns,bF as ss,c7 as rs,c8 as ls,bn as It,bo as is,bq as cs,bu as as,bv as Rt}from"./vendor-mui-core-Bq8gXTan.js";import{D as ke,G as Te,ag as ds,a8 as us,f as Io,ah as To,ac as ps,ai as hs,aj as fs,ak as bs}from"./index-CwUT0vPy.js";import{r as $e,k as X,a as Q,bI as cn,i as ms,B as Le,bg as an,$ as dn,bd as un,at as xs,bJ as gs,ac as At,a3 as M,a8 as js,I as ue,bK as ks,bm as ys,_ as pn,b as Me,ar as ft,be as vs,ax as hn}from"./vendor-ux-did-connect-pzpsrvqx.js";import{v as bt,c as fe,i as ws,z as Rs,B as Ee,p as Cs}from"./vendor-arcblock-CwufDgLV.js";import{d as Ss}from"./Error-BAEKW7-e.js";import{C as mt}from"./confirm-RvA9mFot.js";import{u as Fe}from"./session-BGdAM8zS.js";import{W as Tt}from"./did-address-NnOD1W_A.js";import{E as Ze}from"./empty-spinner-BHwHZpq-.js";import{B as zt}from"./bundle-avatar-UIbxwQif.js";import{S as De}from"./shorten-label-BQvbtscf.js";import{L as Ot}from"./list-header-C7gle0n0.js";import{a0 as Ds,A as pe,J as Wt,E as fn}from"./vendor-utils-BfZ4tlod.js";import{d as Is}from"./Download-D4X39_9V.js";import{C as bn}from"./click-to-copy-By4fgGR7.js";import{Q as Ts}from"./QuestionMarkCircle-jbhclAfX.js";import{x as $s,u as Ps}from"./vendor-hooks-DqdmWCmo.js";import{_ as Xe}from"./useSetState-CWq0AVWn.js";import{c as Bt}from"./index-DVQCgvFb.js";import{d as Mt}from"./Launch-DFS3fgjy.js";import{E as Vt}from"./index-DEZojGsm.js";import"./api-C1S8LUld.js";import{d as _s}from"./ChevronRight-BU9I7WD4.js";import{T as Es,a as Ls}from"./vendor-mui-x-1nqAyytV.js";import{d as lt}from"./DeleteOutline-BKSMNwfT.js";import{D as $o,C as Po,P as _o}from"./react-beautiful-dnd.esm-02tdagHZ.js";import{c as qs,A as mn,u as xn,S as Ns,a as As,b as zs,e as Os,U as Ws,f as Ct,g as gn,n as Bs,h as Ms,i as Eo,k as Vs,l as Us}from"./item-D-39k2FC.js";import{d as Fs}from"./ArrowDropDown-DBJPIOl4.js";import{f as je}from"./index-8eXqqyHQ.js";import{d as jn}from"./Done-ASNftAOL.js";import{D as Hs}from"./delete-confirm-wTMDQFnr.js";import{g as kn}from"./get-safe-url-B0-S5PGZ.js";import{M as Js}from"./index-CTlzm-Mc.js";import{r as Gs}from"./index-Bv7OAPJU.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";var Ut={},Xs=Ie;Object.defineProperty(Ut,"__esModule",{value:!0});var yn=Ut.default=void 0,Ys=Xs($e()),Zs=e;yn=Ut.default=(0,Ys.default)((0,Zs.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var Ft={},Qs=Ie;Object.defineProperty(Ft,"__esModule",{value:!0});var vn=Ft.default=void 0,Ks=Qs($e()),er=e;vn=Ft.default=(0,Ks.default)((0,er.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var Ht={},tr=Ie;Object.defineProperty(Ht,"__esModule",{value:!0});var wn=Ht.default=void 0,or=tr($e()),nr=e;wn=Ht.default=(0,or.default)((0,nr.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Jt({did:t,projectId:o,title:n,logo:r,describe:i}){const l=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[u,d]=j.useState(!1),x=Ve(b=>b.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[e.jsx(Lt,{sx:{borderRadius:1},src:l}),e.jsxs(c,{children:[e.jsx(De,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:n||"/"}),e.jsx(De,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||u?"primary.main":"grey.700"},children:i||"/"})]})]})}Jt.propTypes={projectId:s.string.isRequired,did:s.string.isRequired,title:s.string.isRequired,logo:s.string.isRequired,describe:s.string.isRequired};function Gt({initUrl:t}){const o=Et(),n=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:r,locale:i}=Q(),{api:a}=ke(),{api:l}=Fe(),[u,d]=j.useState(!0),{blocklet:x}=Te(),[b,p]=j.useState(null),[h,m]=j.useState(!1),f=Ve(C=>C.breakpoints.down("xl")),y=Ve(C=>C.breakpoints.down("md")),{componentDid:v=""}=ut(),[g,k]=j.useState(null),S=`publish-${x.meta.did}`,R=cn(S),[T,D]=j.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),B=()=>{a.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:n}}).then(C=>{const _=(C==null?void 0:C.projects)||[];d(!1),k(_)}).catch(C=>{d(!1),M.error(C.message)})},$=()=>{o(`${X.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=C=>{p(C)},J=()=>{d(!1),m(!0)},U=()=>{m(!1),p(null)},w=C=>{M.error(C.message),m(!1),p(null)},I=C=>{if(!(C!=null&&C.deleted)){M.error("Delete project failed");return}B(),m(!1),p(null)};j.useEffect(()=>{B()},[]);const q=j.useMemo(()=>{var _;if(!T.searchText)return g;let C=(_=T.searchText)==null?void 0:_.trim();return C?(C=ms.toAddress(C).toLocaleLowerCase(),g.filter(G=>G.blockletTitle.toLowerCase().includes(C)||G.blockletDid.toLowerCase().includes(C))):g},[g,T.searchText]);if(!g&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Ze,{})});if(!g)return null;if(!g.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx(Le,{onClick:$,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const P=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:C=>{const _=g[C];return e.jsx(we,{to:`${_.id}`,children:e.jsx(Jt,{did:x.meta.did,projectId:_.id,logo:_.blockletLogo,title:_.blockletTitle,describe:_.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:C=>C?e.jsx(an,{type:"success",children:C}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:C=>C?e.jsx(Tt,{size:14,compact:!0,responsive:!1,did:C}):null}},f||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:C=>C?e.jsx(Tt,{onClick:()=>{o(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${C}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:C}):null}},f||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:C=>{const _=(x.children||[]).find(G=>G.meta.did===C);return _?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(zt,{size:14,blocklet:_,ancestors:[x]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:_.meta.title})]},C):""}}},f||n?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:C=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(De,{children:C})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:C=>e.jsx(dn,{value:Number(C),locale:i})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:C=>{const _=g[C];return e.jsxs(c,{display:"flex",children:[e.jsx(we,{to:`${_.id}/new-release/none/${_.lastReleaseId}`,children:e.jsx(ye,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(de,{color:"primary","aria-label":"create",children:e.jsx(yn,{style:{fontSize:18}})})})}),!!_.lastReleaseId&&e.jsx(ye,{title:r("blocklet.publish.viewLastRelease",{name:_.blockletTitle}),placement:"top",children:e.jsx(de,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${_.id}/view/${_.lastReleaseId}/${_.blockletVersion}`,children:e.jsx(vn,{sx:{fontSize:18}})})})}),e.jsx(ye,{title:r("blocklet.publish.delete",{name:_.blockletTitle}),placement:"top",children:e.jsx(de,{color:"primary","aria-label":"delete",onClick:()=>z(_),children:e.jsx(un,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),N=({page:C,rowsPerPage:_,searchText:G})=>{T.pageSize!==_?D(F=>({...F,searchText:"",pageSize:_,page:1})):T.page!==C+1?D(F=>({...F,searchText:"",page:C+1})):T.searchText!==G&&D(F=>({...F,searchText:G,page:1}))},H=h?e.jsx(xs,{open:!0,popup:!0,onClose:U,action:"check-has-project-id",locale:i,checkFn:l.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:I,onError:w,extraParams:{projectId:b.id,did:x.meta.did,name:b.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:b.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:b.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(sr,{children:[e.jsx(Ot,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),e.jsx(ye,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(wn,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(gs,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:y},search:T.searchText,searchText:T.searchText,searchTextUpdate:C=>D(_=>({..._,searchText:C})),searchClose:()=>D(C=>({...C,searchText:""})),onSearchOpen:()=>{}}),e.jsxs(Le,{onClick:$,variant:"contained",children:[e.jsx(bt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(At,{className:"main-table",locale:i,data:q,columns:P,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:S,onChange:N}),b&&e.jsx(mt,{title:`${r("common.delete")} ${b.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:J,onCancel:()=>p(null),children:e.jsx(c,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(C=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Ss,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",color:"text.secondary",children:C})]}))})}),H]})}const sr=Xn(c)`
2
+ import{r as j,f as Et,l as ut,L as we,g as Hn,u as Jn,i as Gn,j as wt}from"./vendor-react-DEoibe3W.js";import{a9 as Ie,j as e,v as Ve,aa as c,aq as Lt,H as s,ad as ye,I as de,T as A,s as Xn,c5 as Jo,D as pt,ah as Re,aw as Yn,bR as ot,ak as ht,bs as nt,bw as st,y as ee,ab as Se,P as Go,G as Xo,w as qt,a8 as Yo,M as Zo,q as be,X as Zn,aj as Qo,t as Ko,bT as Qn,N as Ye,z as en,O as re,al as Ce,c6 as tn,L as on,A as Nt,b8 as nn,bJ as sn,bx as Kn,e as rn,at as es,bZ as ts,af as os,U as ln,W as rt,bE as ns,bF as ss,c7 as rs,c8 as ls,bn as It,bo as is,bq as cs,bu as as,bv as Rt}from"./vendor-mui-core-Bq8gXTan.js";import{D as ke,G as Te,ag as ds,a8 as us,f as Io,ah as To,ac as ps,ai as hs,aj as fs,ak as bs}from"./index-CwUT0vPy.js";import{r as $e,k as X,a as Q,bI as cn,i as ms,B as Le,bg as an,$ as dn,bd as un,at as xs,bJ as gs,ac as At,a3 as M,a8 as js,I as ue,bK as ks,bm as ys,_ as pn,b as Me,ar as ft,be as vs,ax as hn}from"./vendor-ux-did-connect-pzpsrvqx.js";import{v as bt,c as fe,i as ws,z as Rs,B as Ee,p as Cs}from"./vendor-arcblock-CwufDgLV.js";import{d as Ss}from"./Error-BAEKW7-e.js";import{C as mt}from"./confirm-RvA9mFot.js";import{u as Fe}from"./session-BGdAM8zS.js";import{W as Tt}from"./did-address-NnOD1W_A.js";import{E as Ze}from"./empty-spinner-BHwHZpq-.js";import{B as zt}from"./bundle-avatar-UIbxwQif.js";import{S as De}from"./shorten-label-BQvbtscf.js";import{L as Ot}from"./list-header-C7gle0n0.js";import{a0 as Ds,A as pe,J as Wt,E as fn}from"./vendor-utils-BfZ4tlod.js";import{d as Is}from"./Download-D4X39_9V.js";import{C as bn}from"./click-to-copy-By4fgGR7.js";import{Q as Ts}from"./QuestionMarkCircle-jbhclAfX.js";import{x as $s,u as Ps}from"./vendor-hooks-DqdmWCmo.js";import{_ as Xe}from"./useSetState-CWq0AVWn.js";import{c as Bt}from"./index-DVQCgvFb.js";import{d as Mt}from"./Launch-DFS3fgjy.js";import{E as Vt}from"./index-DEZojGsm.js";import"./api-C1S8LUld.js";import{d as _s}from"./ChevronRight-BU9I7WD4.js";import{T as Es,a as Ls}from"./vendor-mui-x-1nqAyytV.js";import{d as lt}from"./DeleteOutline-BKSMNwfT.js";import{D as $o,C as Po,P as _o}from"./react-beautiful-dnd.esm-02tdagHZ.js";import{c as qs,A as mn,u as xn,S as Ns,a as As,b as zs,e as Os,U as Ws,f as Ct,g as gn,n as Bs,h as Ms,i as Eo,k as Vs,l as Us}from"./item-D-39k2FC.js";import{d as Fs}from"./ArrowDropDown-DBJPIOl4.js";import{f as je}from"./index-8eXqqyHQ.js";import{d as jn}from"./Done-ASNftAOL.js";import{D as Hs}from"./delete-confirm-wTMDQFnr.js";import{g as kn}from"./get-safe-url-D5KSEAKZ.js";import{M as Js}from"./index-CTlzm-Mc.js";import{r as Gs}from"./index-Bv7OAPJU.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";var Ut={},Xs=Ie;Object.defineProperty(Ut,"__esModule",{value:!0});var yn=Ut.default=void 0,Ys=Xs($e()),Zs=e;yn=Ut.default=(0,Ys.default)((0,Zs.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var Ft={},Qs=Ie;Object.defineProperty(Ft,"__esModule",{value:!0});var vn=Ft.default=void 0,Ks=Qs($e()),er=e;vn=Ft.default=(0,Ks.default)((0,er.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var Ht={},tr=Ie;Object.defineProperty(Ht,"__esModule",{value:!0});var wn=Ht.default=void 0,or=tr($e()),nr=e;wn=Ht.default=(0,or.default)((0,nr.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Jt({did:t,projectId:o,title:n,logo:r,describe:i}){const l=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[u,d]=j.useState(!1),x=Ve(b=>b.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[e.jsx(Lt,{sx:{borderRadius:1},src:l}),e.jsxs(c,{children:[e.jsx(De,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:n||"/"}),e.jsx(De,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||u?"primary.main":"grey.700"},children:i||"/"})]})]})}Jt.propTypes={projectId:s.string.isRequired,did:s.string.isRequired,title:s.string.isRequired,logo:s.string.isRequired,describe:s.string.isRequired};function Gt({initUrl:t}){const o=Et(),n=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:r,locale:i}=Q(),{api:a}=ke(),{api:l}=Fe(),[u,d]=j.useState(!0),{blocklet:x}=Te(),[b,p]=j.useState(null),[h,m]=j.useState(!1),f=Ve(C=>C.breakpoints.down("xl")),y=Ve(C=>C.breakpoints.down("md")),{componentDid:v=""}=ut(),[g,k]=j.useState(null),S=`publish-${x.meta.did}`,R=cn(S),[T,D]=j.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),B=()=>{a.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:n}}).then(C=>{const _=(C==null?void 0:C.projects)||[];d(!1),k(_)}).catch(C=>{d(!1),M.error(C.message)})},$=()=>{o(`${X.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=C=>{p(C)},J=()=>{d(!1),m(!0)},U=()=>{m(!1),p(null)},w=C=>{M.error(C.message),m(!1),p(null)},I=C=>{if(!(C!=null&&C.deleted)){M.error("Delete project failed");return}B(),m(!1),p(null)};j.useEffect(()=>{B()},[]);const q=j.useMemo(()=>{var _;if(!T.searchText)return g;let C=(_=T.searchText)==null?void 0:_.trim();return C?(C=ms.toAddress(C).toLocaleLowerCase(),g.filter(G=>G.blockletTitle.toLowerCase().includes(C)||G.blockletDid.toLowerCase().includes(C))):g},[g,T.searchText]);if(!g&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Ze,{})});if(!g)return null;if(!g.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx(Le,{onClick:$,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const P=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:C=>{const _=g[C];return e.jsx(we,{to:`${_.id}`,children:e.jsx(Jt,{did:x.meta.did,projectId:_.id,logo:_.blockletLogo,title:_.blockletTitle,describe:_.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:C=>C?e.jsx(an,{type:"success",children:C}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:C=>C?e.jsx(Tt,{size:14,compact:!0,responsive:!1,did:C}):null}},f||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:C=>C?e.jsx(Tt,{onClick:()=>{o(`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${C}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:C}):null}},f||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:C=>{const _=(x.children||[]).find(G=>G.meta.did===C);return _?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(zt,{size:14,blocklet:_,ancestors:[x]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:_.meta.title})]},C):""}}},f||n?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:C=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(De,{children:C})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:C=>e.jsx(dn,{value:Number(C),locale:i})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:C=>{const _=g[C];return e.jsxs(c,{display:"flex",children:[e.jsx(we,{to:`${_.id}/new-release/none/${_.lastReleaseId}`,children:e.jsx(ye,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(de,{color:"primary","aria-label":"create",children:e.jsx(yn,{style:{fontSize:18}})})})}),!!_.lastReleaseId&&e.jsx(ye,{title:r("blocklet.publish.viewLastRelease",{name:_.blockletTitle}),placement:"top",children:e.jsx(de,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${_.id}/view/${_.lastReleaseId}/${_.blockletVersion}`,children:e.jsx(vn,{sx:{fontSize:18}})})})}),e.jsx(ye,{title:r("blocklet.publish.delete",{name:_.blockletTitle}),placement:"top",children:e.jsx(de,{color:"primary","aria-label":"delete",onClick:()=>z(_),children:e.jsx(un,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),N=({page:C,rowsPerPage:_,searchText:G})=>{T.pageSize!==_?D(F=>({...F,searchText:"",pageSize:_,page:1})):T.page!==C+1?D(F=>({...F,searchText:"",page:C+1})):T.searchText!==G&&D(F=>({...F,searchText:G,page:1}))},H=h?e.jsx(xs,{open:!0,popup:!0,onClose:U,action:"check-has-project-id",locale:i,checkFn:l.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:I,onError:w,extraParams:{projectId:b.id,did:x.meta.did,name:b.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:b.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:b.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(sr,{children:[e.jsx(Ot,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),e.jsx(ye,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(wn,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(gs,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:y},search:T.searchText,searchText:T.searchText,searchTextUpdate:C=>D(_=>({..._,searchText:C})),searchClose:()=>D(C=>({...C,searchText:""})),onSearchOpen:()=>{}}),e.jsxs(Le,{onClick:$,variant:"contained",children:[e.jsx(bt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(At,{className:"main-table",locale:i,data:q,columns:P,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:S,onChange:N}),b&&e.jsx(mt,{title:`${r("common.delete")} ${b.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:J,onCancel:()=>p(null),children:e.jsx(c,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(C=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Ss,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",color:"text.secondary",children:C})]}))})}),H]})}const sr=Xn(c)`
3
3
  ${({theme:t})=>t.breakpoints.down("md")} {
4
4
  .MuiTableRow-root {
5
5
  border-color: ${({theme:t})=>t.palette.divider};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-ux-did-connect-pzpsrvqx.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-BfZ4tlod.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-hooks-DqdmWCmo.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/login-DbSs2lO2.js","assets/vendor-arcblock-CwufDgLV.js","assets/use-passport-id-B-b-_oYF.js","assets/get-safe-url-D5KSEAKZ.js","assets/logger-Dqm1UQym.js","assets/LaunchOutlined-C1x4Og4u.js","assets/login-oauth-callback-Cpai1yC1.js","assets/connect-DhuiCF4g.js","assets/exchange-passport-BnmyuwIs.js","assets/wrap-locale-ClbCNOs0.js","assets/get-safe-url-B0-S5PGZ.js","assets/issue-passport-DpSBB2L8.js","assets/invitation-B3B-J4fG.js","assets/session-BGdAM8zS.js","assets/sdk-BmeKtHic.js","assets/CheckCircle-DUJmWceY.js","assets/lost-passport-Ce_WXcnR.js","assets/ViewList-BOGcbymi.js","assets/Done-ASNftAOL.js","assets/did-address-NnOD1W_A.js","assets/start-C9Hvgbcz.js","assets/PlayArrow-BqVYRyLK.js","assets/Error-BAEKW7-e.js","assets/addon-DdjBFoHI.js","assets/QuestionMarkCircle-jbhclAfX.js","assets/use-server-logo-UTr-CyJD.js","assets/use-mobile-DwzRjjku.js","assets/starting-progress-CYgfPTsE.js","assets/setup-Bo10IVJ4.js","assets/config-space-D6ScnWdA.js","assets/spaces-DUkzPTBd.js","assets/api-C1S8LUld.js","assets/invite-jaOwIvW9.js","assets/transfer-m6229uxg.js","assets/dashboard-t9EszOna.js","assets/useLocalStorage-CaPDqrQ7.js","assets/index-8eXqqyHQ.js","assets/confirm-RvA9mFot.js","assets/use-blocklet-logo-4UB-MFD3.js","assets/InfoOutlined-BVWbftGI.js","assets/dot-4jhL56kz.js","assets/useAsync-C62uE2pS.js","assets/useSetState-CWq0AVWn.js","assets/use-mobile-CtTQsfXN.js","assets/user-center-CNdVbQx6.js","assets/list-DDNORnll.js","assets/index-DEZojGsm.js","assets/bundle-avatar-UIbxwQif.js","assets/util-BQAJqeb4.js","assets/base32-DUSifB4M.js","assets/ExpandLess-CcLTbsdW.js","assets/search-4YYphs0l.js","assets/profile-embed-BFjGm3Vt.js","assets/home-DfSu-4-a.js","assets/studio-I9lo0Itp.js","assets/TuneOutlined-CKzi_VZZ.js","assets/preferences-C3zaKjfI.js","assets/iframe-DFg8oeD0.js","assets/branding-B1o_K1XB.js","assets/empty-spinner-BHwHZpq-.js","assets/DeleteOutline-BKSMNwfT.js","assets/react-beautiful-dnd.esm-02tdagHZ.js","assets/raf-schd.esm-B3j6BePR.js","assets/localization-tyC-vHO5.js","assets/add-resource-DfqBSLDk.js","assets/add-component-core-DehB4lvu.js","assets/item-D-39k2FC.js","assets/Launch-DFS3fgjy.js","assets/delete-confirm-wTMDQFnr.js","assets/click-to-copy-By4fgGR7.js","assets/launch-result-message-AharZGq2.js","assets/page-header-DNvUdNpI.js","assets/logo-uploader-BPSmPaZd.js","assets/index-DVQCgvFb.js","assets/index-Cwq0Io0K.js","assets/collapse-DAaiuAEY.js","assets/Google-C28yeMZW.js","assets/cloneDeep-CDl5kZTY.js","assets/index-CTlzm-Mc.js","assets/index-C0Iiqot3.css","assets/index-BxJZWVOT.js","assets/index-DPIWnhb5.js","assets/util-BRPRFc9p.js","assets/content-layout-BC2QkTYi.js","assets/connect-to-CxoBjkcK.js","assets/ArrowDropDown-DBJPIOl4.js","assets/ChevronLeft-BBJJJhVi.js","assets/ChevronRight-BU9I7WD4.js","assets/add-component-core-D-IRi6XF.css","assets/publish-resource-CAZrBTdz.js","assets/index-CkwXRCmN.js","assets/shorten-label-BQvbtscf.js","assets/list-header-C7gle0n0.js","assets/Download-D4X39_9V.js","assets/vendor-mui-x-1nqAyytV.js","assets/index-Bv7OAPJU.js","assets/index-IeoAQOW8.js","assets/email-0b_MYxBQ.js","assets/authorize-IzqEi1HK.js","assets/Home-Dujcj083.js","assets/unsubscribe-BXKQU2c1.js","assets/open-window-hpzKFxn5.js","assets/gen-access-key-CVpZSjIw.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-ux-did-connect-pzpsrvqx.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-BfZ4tlod.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-hooks-DqdmWCmo.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/login-DbSs2lO2.js","assets/vendor-arcblock-CwufDgLV.js","assets/use-passport-id-B-b-_oYF.js","assets/get-safe-url-B0-S5PGZ.js","assets/logger-Dqm1UQym.js","assets/LaunchOutlined-C1x4Og4u.js","assets/login-oauth-callback-Cpai1yC1.js","assets/connect-DhuiCF4g.js","assets/exchange-passport-BnmyuwIs.js","assets/wrap-locale-ClbCNOs0.js","assets/get-safe-url-D5KSEAKZ.js","assets/issue-passport-DpSBB2L8.js","assets/invitation-B3B-J4fG.js","assets/session-BGdAM8zS.js","assets/sdk-BmeKtHic.js","assets/CheckCircle-DUJmWceY.js","assets/lost-passport-Ce_WXcnR.js","assets/ViewList-BOGcbymi.js","assets/Done-ASNftAOL.js","assets/did-address-NnOD1W_A.js","assets/start-C9Hvgbcz.js","assets/PlayArrow-BqVYRyLK.js","assets/Error-BAEKW7-e.js","assets/addon-DdjBFoHI.js","assets/QuestionMarkCircle-jbhclAfX.js","assets/use-server-logo-UTr-CyJD.js","assets/use-mobile-CtTQsfXN.js","assets/starting-progress-CYgfPTsE.js","assets/setup-Bo10IVJ4.js","assets/config-space-D6ScnWdA.js","assets/spaces-DUkzPTBd.js","assets/api-C1S8LUld.js","assets/invite-jaOwIvW9.js","assets/transfer-m6229uxg.js","assets/dashboard-t9EszOna.js","assets/useLocalStorage-CaPDqrQ7.js","assets/index-8eXqqyHQ.js","assets/confirm-RvA9mFot.js","assets/use-blocklet-logo-4UB-MFD3.js","assets/InfoOutlined-BVWbftGI.js","assets/dot-4jhL56kz.js","assets/useAsync-C62uE2pS.js","assets/useSetState-CWq0AVWn.js","assets/use-mobile-DwzRjjku.js","assets/user-center-CNdVbQx6.js","assets/list-DDNORnll.js","assets/index-DEZojGsm.js","assets/bundle-avatar-UIbxwQif.js","assets/util-BQAJqeb4.js","assets/base32-DUSifB4M.js","assets/ExpandLess-CcLTbsdW.js","assets/search-4YYphs0l.js","assets/profile-embed-BFjGm3Vt.js","assets/home-DfSu-4-a.js","assets/studio-I9lo0Itp.js","assets/TuneOutlined-CKzi_VZZ.js","assets/preferences-C3zaKjfI.js","assets/iframe-DFg8oeD0.js","assets/branding-B1o_K1XB.js","assets/empty-spinner-BHwHZpq-.js","assets/DeleteOutline-BKSMNwfT.js","assets/react-beautiful-dnd.esm-02tdagHZ.js","assets/raf-schd.esm-B3j6BePR.js","assets/localization-tyC-vHO5.js","assets/add-resource-DfqBSLDk.js","assets/add-component-core-DehB4lvu.js","assets/item-D-39k2FC.js","assets/Launch-DFS3fgjy.js","assets/delete-confirm-wTMDQFnr.js","assets/click-to-copy-By4fgGR7.js","assets/launch-result-message-AharZGq2.js","assets/page-header-DNvUdNpI.js","assets/logo-uploader-BPSmPaZd.js","assets/index-DVQCgvFb.js","assets/index-Cwq0Io0K.js","assets/collapse-DAaiuAEY.js","assets/Google-C28yeMZW.js","assets/cloneDeep-CDl5kZTY.js","assets/index-CTlzm-Mc.js","assets/index-C0Iiqot3.css","assets/index-BxJZWVOT.js","assets/index-DPIWnhb5.js","assets/util-BRPRFc9p.js","assets/content-layout-BC2QkTYi.js","assets/connect-to-CxoBjkcK.js","assets/ArrowDropDown-DBJPIOl4.js","assets/ChevronLeft-BBJJJhVi.js","assets/ChevronRight-BU9I7WD4.js","assets/add-component-core-D-IRi6XF.css","assets/publish-resource-CAZrBTdz.js","assets/index-CkwXRCmN.js","assets/shorten-label-BQvbtscf.js","assets/list-header-C7gle0n0.js","assets/Download-D4X39_9V.js","assets/vendor-mui-x-1nqAyytV.js","assets/index-Bv7OAPJU.js","assets/index-IeoAQOW8.js","assets/email-0b_MYxBQ.js","assets/authorize-IzqEi1HK.js","assets/Home-Dujcj083.js","assets/unsubscribe-BXKQU2c1.js","assets/open-window-hpzKFxn5.js","assets/gen-access-key-CVpZSjIw.js"])))=>i.map(i=>d[i]);
2
2
  var qd=Object.defineProperty;var Wd=(e,n,t)=>n in e?qd(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Xn=(e,n,t)=>Wd(e,typeof n!="symbol"?n+"":n,t);import{j as m,ak as la,aa as Ee,bz as jd,O as Or,N as Kd,T as be,e as _a,v as _r,a5 as Yd,q as Us,bn as zd,D as Xd,I as Pr,t as Qd,bA as Cn,ab as wl,y as cn,al as Tn,bB as Zd,s as Jr,E as ec,bt as nc,ad as Pa,af as tc,bC as lc,H as Nt,b9 as ic,bD as ac,ah as sc,aw as oc}from"./vendor-mui-core-Bq8gXTan.js";import{d as rc,e as ce,g as un,b as se,r as _,f as Vr,a as yt,u as Ur,h as uc,B as pc,i as Hs,j as De,k as Xt}from"./vendor-react-DEoibe3W.js";import{az as dc,aA as cc,aB as fc,aC as Hr,T as mc,av as yc,aD as He,_ as ie,aE as Tc,aF as Ac,aG as gc,aH as Dc,aI as an,ao as hc,aJ as wr,h as Ja,a as Rn,a3 as We,ar as Rc,aw as kc,a5 as Sc,ac as Cc,aK as Va,aL as Ec,k as X,aM as Ic,F as xr,q as $c,aN as Mr,aO as Gr,aP as Lc,aQ as Bc,i as Fc,aR as qr,aS as vc,aT as bc,aU as Nc,aV as Oc,aW as _c,a8 as ws,aX as Pc}from"./vendor-ux-did-connect-pzpsrvqx.js";import{L as Ua,a5 as Jc,a as Mn,A as ge,a6 as Vc,a7 as Wr,a8 as Uc,E as jr,e as hl,d as Ha,a9 as Me,aa as Hc,B as gn,v as ia,ab as aa,z as wc,ac as xc,ad as Mc,b as Gc,S as qc,ae as Wc,D as Rl,a1 as jc,O as Kr}from"./vendor-utils-BfZ4tlod.js";import{N as di,D as Qt,F as ci,R as Kc,d as Yc,c as we,r as zc,u as sa,H as Xc}from"./vendor-arcblock-CwufDgLV.js";import{j as Qc,l as wa,t as Zc,v as ef,b as xs,u as nf}from"./vendor-hooks-DqdmWCmo.js";import"./lottie-web-jYmAQWuC.js";function tf(e,n){for(var t=0;t<n.length;t++){const l=n[t];if(typeof l!="string"&&!Array.isArray(l)){for(const i in l)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(l,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>l[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))l(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&l(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function l(i){if(i.ep)return;i.ep=!0;const a=t(i);fetch(i.href,a)}})();(function(n){const t={};t.pageView=function(a){l("pv",a)},t.event=function(a){l("evt",a)};function l(i,a){if(typeof a!="string")return;const s=document.createElement("script");s.src=`/.well-known/analytics/${i}/${a.startsWith("/")?a.slice(1):a}`,s.defer=!0,s.async=!0,s.onload=function(){document.head.removeChild(s)},setTimeout(function(){document.head.appendChild(s)},200)}n.tracker=t,n.blocklet&&(n.blocklet.tracker=t)})(window);"serviceWorker"in navigator&&(navigator.serviceWorker.addEventListener("message",e=>{e.data&&e.data.type==="SW_DOCUMENT_UPDATED"&&window.location.reload()}),navigator.serviceWorker.ready.then(()=>{navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"CLIENT_UPDATE_READY"})}));var Yr,Ms=rc;Yr=Ms.createRoot,Ms.hydrateRoot;var zr={exports:{}};(function(e,n){(function(t,l){e.exports=l(Ua)})(ce,function(t){function l(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=l(t),a={name:"zh",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,o){return o==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,o){var u=100*s+o;return u<600?"凌晨":u<900?"早上":u<1100?"上午":u<1300?"中午":u<1800?"下午":"晚上"}};return i.default.locale(a,null,!0),a})})(zr);var Xr=zr.exports;const lf=un(Xr),af=tf({__proto__:null,default:lf},[Xr]);var Qr={exports:{}};(function(e,n){(function(t,l){e.exports=l()})(ce,function(){var t,l,i=1e3,a=6e4,s=36e5,o=864e5,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,r=31536e6,p=2628e6,d=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,f={years:r,months:p,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},T=function($){return $ instanceof b},D=function($,R,S){return new b($,S,R.$l)},E=function($){return l.p($)+"s"},v=function($){return $<0},k=function($){return v($)?Math.ceil($):Math.floor($)},h=function($){return Math.abs($)},L=function($,R){return $?v($)?{negative:!0,format:""+h($)+R}:{negative:!1,format:""+$+R}:{negative:!1,format:""}},b=function(){function $(S,U,J){var M=this;if(this.$d={},this.$l=J,S===void 0&&(this.$ms=0,this.parseFromMilliseconds()),U)return D(S*f[E(U)],this);if(typeof S=="number")return this.$ms=S,this.parseFromMilliseconds(),this;if(typeof S=="object")return Object.keys(S).forEach(function(V){M.$d[E(V)]=S[V]}),this.calMilliseconds(),this;if(typeof S=="string"){var B=S.match(d);if(B){var C=B.slice(2).map(function(V){return V!=null?Number(V):0});return this.$d.years=C[0],this.$d.months=C[1],this.$d.weeks=C[2],this.$d.days=C[3],this.$d.hours=C[4],this.$d.minutes=C[5],this.$d.seconds=C[6],this.calMilliseconds(),this}}return this}var R=$.prototype;return R.calMilliseconds=function(){var S=this;this.$ms=Object.keys(this.$d).reduce(function(U,J){return U+(S.$d[J]||0)*f[J]},0)},R.parseFromMilliseconds=function(){var S=this.$ms;this.$d.years=k(S/r),S%=r,this.$d.months=k(S/p),S%=p,this.$d.days=k(S/o),S%=o,this.$d.hours=k(S/s),S%=s,this.$d.minutes=k(S/a),S%=a,this.$d.seconds=k(S/i),S%=i,this.$d.milliseconds=S},R.toISOString=function(){var S=L(this.$d.years,"Y"),U=L(this.$d.months,"M"),J=+this.$d.days||0;this.$d.weeks&&(J+=7*this.$d.weeks);var M=L(J,"D"),B=L(this.$d.hours,"H"),C=L(this.$d.minutes,"M"),V=this.$d.seconds||0;this.$d.milliseconds&&(V+=this.$d.milliseconds/1e3,V=Math.round(1e3*V)/1e3);var W=L(V,"S"),j=S.negative||U.negative||M.negative||B.negative||C.negative||W.negative,ae=B.format||C.format||W.format?"T":"",G=(j?"-":"")+"P"+S.format+U.format+M.format+ae+B.format+C.format+W.format;return G==="P"||G==="-P"?"P0D":G},R.toJSON=function(){return this.toISOString()},R.format=function(S){var U=S||"YYYY-MM-DDTHH:mm:ss",J={Y:this.$d.years,YY:l.s(this.$d.years,2,"0"),YYYY:l.s(this.$d.years,4,"0"),M:this.$d.months,MM:l.s(this.$d.months,2,"0"),D:this.$d.days,DD:l.s(this.$d.days,2,"0"),H:this.$d.hours,HH:l.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:l.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:l.s(this.$d.seconds,2,"0"),SSS:l.s(this.$d.milliseconds,3,"0")};return U.replace(u,function(M,B){return B||String(J[M])})},R.as=function(S){return this.$ms/f[E(S)]},R.get=function(S){var U=this.$ms,J=E(S);return J==="milliseconds"?U%=1e3:U=J==="weeks"?k(U/f[J]):this.$d[J],U||0},R.add=function(S,U,J){var M;return M=U?S*f[E(U)]:T(S)?S.$ms:D(S,this).$ms,D(this.$ms+M*(J?-1:1),this)},R.subtract=function(S,U){return this.add(S,U,!0)},R.locale=function(S){var U=this.clone();return U.$l=S,U},R.clone=function(){return D(this.$ms,this)},R.humanize=function(S){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!S)},R.valueOf=function(){return this.asMilliseconds()},R.milliseconds=function(){return this.get("milliseconds")},R.asMilliseconds=function(){return this.as("milliseconds")},R.seconds=function(){return this.get("seconds")},R.asSeconds=function(){return this.as("seconds")},R.minutes=function(){return this.get("minutes")},R.asMinutes=function(){return this.as("minutes")},R.hours=function(){return this.get("hours")},R.asHours=function(){return this.as("hours")},R.days=function(){return this.get("days")},R.asDays=function(){return this.as("days")},R.weeks=function(){return this.get("weeks")},R.asWeeks=function(){return this.as("weeks")},R.months=function(){return this.get("months")},R.asMonths=function(){return this.as("months")},R.years=function(){return this.get("years")},R.asYears=function(){return this.as("years")},$}(),F=function($,R,S){return $.add(R.years()*S,"y").add(R.months()*S,"M").add(R.days()*S,"d").add(R.hours()*S,"h").add(R.minutes()*S,"m").add(R.seconds()*S,"s").add(R.milliseconds()*S,"ms")};return function($,R,S){t=S,l=S().$utils(),S.duration=function(M,B){var C=S.locale();return D(M,{$l:C},B)},S.isDuration=T;var U=R.prototype.add,J=R.prototype.subtract;R.prototype.add=function(M,B){return T(M)?F(this,M,1):U.bind(this)(M,B)},R.prototype.subtract=function(M,B){return T(M)?F(this,M,-1):J.bind(this)(M,B)}}})})(Qr);var Zr=Qr.exports;const sf=un(Zr),Tt=Ua,of=dc,rf=cc,uf=Zr,pf=fc,df=Hr;Tt.extend(of);Tt.extend(rf);Tt.extend(uf);Tt.extend(pf);Tt.extend(df);var cf=Tt;const Ut=un(cf);/*! js-cookie v3.0.5 | MIT */function Zt(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var l in t)e[l]=t[l]}return e}var ff={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function oa(e,n){function t(i,a,s){if(!(typeof document>"u")){s=Zt({},n,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var u in s)s[u]&&(o+="; "+u,s[u]!==!0&&(o+="="+s[u].split(";")[0]));return document.cookie=i+"="+e.write(a,i)+o}}function l(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],s={},o=0;o<a.length;o++){var u=a[o].split("="),r=u.slice(1).join("=");try{var p=decodeURIComponent(u[0]);if(s[p]=e.read(r,p),i===p)break}catch{}}return i?s[i]:s}}return Object.create({set:t,get:l,remove:function(i,a){t(i,"",Zt({},a,{expires:-1}))},withAttributes:function(i){return oa(this.converter,Zt({},this.attributes,i))},withConverter:function(i){return oa(Zt({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}var kl=oa(ff,{path:"/"});function mf({children:e,theme:n,injectFirst:t,darkSchemeClass:l,prefer:i,disableBlockletTheme:a=!1,enableColorScheme:s,locale:o,fallbackLocale:u,translations:r={},languages:p,onLoadingTranslation:d}){return m.jsx(mc,{theme:n,injectFirst:t,darkSchemeClass:l,prefer:i,disableBlockletTheme:a,enableColorScheme:s,children:m.jsx(yc,{locale:o,fallbackLocale:u,translations:r,onLoadingTranslation:d,languages:p,children:e})})}const yf={common:{invalid:"Invalid",about:"About",access:"Access",buy:"Buy",change:"Change",upload:"Upload",accessKey:"Access Keys",action:"Action",actions:"Actions",add:"Add",refresh:"Refresh",address:"Address",afterTime:"After {time}",allow:"Allow",alreadyExist:"already exists",approve:"Approve",approved:"approved",appUrl:"APP Url",auditLogs:"Audit Trail",auditLogsSearch:"Search by action or content",unrecordedUser:"Unrecorded name",unrecordedRole:"Unrecorded role",notificationRecords:"Notifications",author:"Author",avatar:"Avatar",back:"Back",basic:"Basic",basicInfo:"Basic Information",profile:"Profile",bind:"Bind",blocklet:"Blocklet",blocklets:"Blocklets",blockletsStorage:"Blocklets Storage",cacheStorage:"Cache Storage",cancel:"Cancel",certificate:"certificate",category:"Log Topic",click:"Click to copy",close:"Close",selectAll:"Select All",unselectAll:"Unselect All",collapseAll:"Collapse All",community:"Community URL",complete:"Complete",componentBasicInfo:"Component Basic Information",components:"Blocklets",config:"Configure",configuration:"Configuration",appearance:"Appearance",configNavigation:"Navigation",configSuccess:"Config successfully",confirm:"Confirm",connect:"Connect",console:"Console",continue:"Continue",continueWith:"Continue With",copiedTip:"Copied",optional:"Optional",copyAndClose:"Copy & Close",copyTip:"Click To Copy",coreStorage:"Core Storage",cpu:"CPU",create:"Create",createSuccess:"Create Access Key",created:"Created At",createdAt:"Created At",createdBy:"Created By",dAddress:"Decentralized Identifiers (DID)",dataStorage:"Storage on Local Disk",delConfirm:"Delete",delConfirmDescription:"Confirm delete {data}?",delete:"Delete",dependents:"Dependents",description:"Description",detail:"Detail",did:"DID",disk:"Disk",diskInfo:"Disk Info",docker:"IS Docker",documentation:"Documentation",domain:"Domain",downgradeTo:"Downgrade to",download:"Download",connectToStore:"Connect to Store",blockletStudio:"Studio",uploaded:"Uploaded",downloading:"Downloading",edit:"Edit",email:"Email",phone:"Phone",empty:"Empty",emptyData:"No results found",enable:"Enable",engine:"Engine",env:"Environment",environment:"Environment",expandAll:"Expand All",expired:"Expired",expires:"Expires",export:"Export",externalIp:"External IP",failed:"Failed",filter:"Log Filter",fingerprint:"Fingerprint",finish:"Finish",forbid:"Forbid",free:"Free",general:"General",gitpod:"IS Gitpod",goEULA:'Click to view "End User License Agreement"',group:"Group",image:"IS Image",install:"Install",installed:"Installed",installedAt:"Installed At",installSuccess:"Successfully installed",installing:"Installing",internalIp:"Internal IP",introduction:"Introduction",invite:"Invite",inviting:"Inviting",ip:"IP",isPublic:"Public",issue:"Issue",issuer:"Issuer",item:"Item",joined:"Joined",key:"Key",lastPublishedAt:"Published At",launcher:"Launcher Information",leavePageTip:"Are you sure to leave the page?",link:"Link",loading:"loading",log:"View Logs",logStorage:"Log Storage",login:"Login",logo:"Logo",logout:"Logout",logs:"Logs",manageTeam:"Manage Team",marketplace:"Marketplace",member:"Member",members:"Members",memory:"Memory",meta:"Meta Data",analytics:"Analytics",runtime:"Runtime",traffic:"Traffic",less:"Less",more:"More",mountPoint:"MountPoint",name:"Name",next:"Next",no:"No",noData:"No records to display",notice:"Unexpected bad things will happen if you don't read this!",noticeTitle:"Notice",notification:"Notification",open:"Open",visitStore:"Visit Store",visitTarget:"Visit {name}",management:"Management",os:"Operating System",overview:"Overview",owner:"Owner",page404:"404 Page",passport:"Passport",display:"Display",permission:"Permission",port:"Port",pre:"Previous",preferences:"Preferences",preview:"Preview",protected:"Protected",protocol:"Protocol",purchase:"Purchase",reconnect:"Reconnect",disconnect:"Disconnect",readMore:"More",redirect:"Redirect",redirectCode:"Redirect Code",redirectPermanently:"Permanent Redirect",redirectTemporary:"Temporary Redirect",redirectUrl:"Redirect URL",rewrite:"Rewrite",release:"Release",rewriteUrl:"Rewrite URL",reject:"Reject",reload:"Reload",remark:"Remark",remove:"Remove",removeSuccess:"Remove successfully",renew:"Renew",reportIssue:"Report an issue",required:"Required",requiredErrorText:"{name} is required",resource:"Resource",restart:"Restart",restore:"Restore",retry:"Retry",revoke:"Revoke",role:"Role",running:"running",runtimeInfo:"Runtime Info",save:"Save",saveChanges:"Save Changes",saveSuccess:"Saved successfully",scheduleFailed:"schedule failed",scheduleSuccess:"successfully scheduled",scope:"Scope",screenshot:"Screenshots",search:"Search",security:"Security",serverDid:"Server DID",serverVersion:"Server Version",setting:"Settings",start:"Start",status:"Status",stop:"Stop",storage:"Storage",backup:"Backup",store:"Store",succeeded:"Succeeded",subscription:"Subscription",support:"Support URL or Email",switch:"Switch",team:"Team",the:"The",timeAgo:"{time} ago",title:"Title",type:"Type",unavailable:"Unavailable",update:"Update",updateAvailable:"New version {version} available",updatedAt:"Updated At",updatedBy:"Updated By",upgrade:"Upgrade",upgradeServer:"Upgrade Server",upgradeTo:"Upgrade to",upgrading:"Upgrading",uptime:"Uptime",url:"URL",valid:"Valid",value:"Value",version:"Version",visit:"Visit",waiting:"Waiting",webhook:"Integrations",yes:"Yes",invalidParam:"Invalid Params",launch:"Launch",price:"Price",redirecting:"Redirecting",error:"Error",reminder:"Reminder",normal:"Normal",gateway:"Gateway",verifyNFT:"Verify NFT",errorMessage:"Error Message: ",slugifyHint:"The actual mount point will be: {value}",strategy:"Strategy",auto:"Auto",manual:"Manual",progress:"In progress",fileCount:"File Count",fileSize:"File Size",time:"Time",startTime:"Start time",endTime:"End time",selected:"Selected",timeoutError:"Timeout error",tags:"Tags",sourceApp:"Belong to App",requiredInputPlaceholder:"Please Enter {name}",moveUp:"Move Up",moveDown:"Move Down",enabled:"Enabled",disabled:"Disabled",homepage:"Home Page",homepageTip:"Home Page or Live Demo URL",repository:"Repository",view:"View",expand:"Expand",collapse:"Collapse",all:"All",bugOrConnectDomain:"Purchase or configure existing domain",bugOrConnectDomainTip:"A domain name is your website's unique address on the internet. You can purchase a new domain from DID Names or any domain registrar, or configure an existing domain you already own.",connectExistingDomain:"Configure existing domain",domains:"Domains",didDomains:"DID Domains",didDomainsDescription:"The following domains are automatically managed by the DID:Names service.",systemDomains:"Default Domains",systemDomainsDescription:"The following domains are automatically assigned by default. While they are accessible, they are not intended for production use and should not be shared with customers. These domains are primarily for development purposes.",manualDomains:"My Domains",manualDomainsDescription:"The following domains are managed by your domain provider and have been manually configured to point to here.",timeInfo:"Timing",operator:"Operator",inviter:"Inviter",minutes:"Minutes",hours:"Hours",hour:"Hour",days:"Days",day:"Day",weeks:"Weeks",months:"Months",custom:"Custom",clear:"Clear",ok:"OK",environments:"Environments",sites:"Sites",active:"Active",backupTime:"Backup Time",lastUsedAt:"Last Used At",expiredAt:"Expiration Date",createdVia:"Created Via",neverExpired:"Never",baseInfo:"Basic Information",otherInfo:"Other Information",lightMode:"Light Mode",darkMode:"Dark Mode",advancedConfig:"Advanced",document:"document",mcpServers:"MCP Servers",generate:"Generate",copy:"Copy",copied:"Copied"},setup:{connect:{title:"Setup Blocklet Server",scan:"Use the following methods to become the owner of this server",confirm:"Review this operation on your DID Wallet",success:"Your account is connected to this server"},keyPair:{title:"Derive KeyPair",scan:"Connect your DID Wallet to generate a key-pair for this app",confirm:"Review this operation on your DID Wallet",success:"Your key pair is securely stored"},verify:{title:"Ownership Credential Required",scan:"Connect your DID Wallet to provide ownership credentials",confirm:"Review this operation on your DID Wallet",success:"Your account is connected to this server"},accept:{title:"Accepting server require ownership certificates",scan:"Connect your DID Wallet to provide ownership credentials",confirm:"Review this operation on your DID Wallet",success:"Your account is connected to this server"},title:"Setup Blocklet Server",steps:{eula:"End User License Agreement",eulaFooter:"I have read and agreed to the terms of the EULA",connect:"Connect Owner DID Wallet",verify:"Verify Ownership",basicSettings:"Basic Settings",launchApp:"Launch Application",complete:"Complete"},congratulation:"Congratulations! Your Blocklet Server is secure and ready to use",redirectButton:"Take me to dashboard!"},login:{login:"Connect",termsOfUse:"Terms of Use",agreeTermsOfUse:"I acknowledge that I have read and agree to the applicable",loginTo:"Connect to",description:"Only server owner and approved members can access the dashboard",switchDid:{title:"Switch Account",scan:"Please use the following methods to add switch account",confirm:"Confirm switch in your DID Wallet",success:"Successfully switched"},switchSpecifiedDid:{title:"Switch Account",scan:"You need switch DID to {did} to complete the following actions",confirm:"Confirm switch in your DID Wallet",success:"Successfully switched"},connect:{title:"Connect",scan:"Only server owner and approved members can access the dashboard",confirm:"Confirm on your DID Wallet",success:"You are successfully connected"},verify:{title:"Verify Access",scan:"Connect your DID Wallet to present owner or admin passport",confirm:"Confirm on your DID Wallet",success:"Your access is verified",abort:"Access verification aborted",description:"You need to provide {roles} passport to perform this operation, you will only be asked to verify again after 1 hour of inactivity.",descriptionForDestroy:"You need to provide {roles} passport to perform this dangerous operation to ensure safety."}},acceptServer:{title:"Claim Server with Ownership NFT",tooltip:"If you received a server ownership nft, you can claim your owner passport with this link."},didConnect:{genKeyPair:{title:"Generate Blocklet DID",scan:"Use the following methods to generate a Blocklet DID",success:"Successfully generate Blocklet DID",successDesc:"The Blocklet DID has been generate successfully (Subsequent publications require the wallet that generated the DID to operate)"},common:{invalidSession:"Invalid Session",invalidSessionDesc:"Session does not exist or has expired",connectionError:"Failed to connect"}},exchangePassport:{title:"Get Passport with NFT",success:"You have successfully get your passport and logged in with the passport",login:"Login",tooltip1:"If you own NFT from collection, ",tooltip2:"you can exchange your passport with this link.",dialog:{title:"Get Passport with NFT",scan:"Connect your DID Wallet to present your NFT to get a passport",confirm:"Select NFT on your DID Wallet",success:"Passport has been successfully exchanged"}},payablePassport:{title:"Purchase passport with payment",tooltip:"If you do not have a passport, you can purchase a passport with this link."},sidebar:{dashboard:"Dashboard",blocklets:"Blocklets",console:"Console",settings:"Settings"},system:{total:"Total",used:"Used",free:"Free",cores:"Number of cores",instances:"Number of instances"},blocklet:{external:"External",usingDocker:"This Blocklet will run using docker",usingIsolation:"This Blocklet will run using network isolation",notFound:"Blocklet not found on this server, maybe it has been deleted",installFromMarket:"Install New Blocklets",installFromUrl:"Install From Url",installFromCreate:"Create Blocklet",titleValidationError:"Title length must be between 3 and 40 characters",descriptionValidationError:"Description length must be between 3 and 80 characters",installFromDiskBackup:"Restore from this server",dockerImage:"Support Docker",installedAt:"Installed At",internal:"Internal",startedAt:"Started At",stoppedAt:"Stopped At",urlEmptyTip:"No Access URL, ",goToAddRule:"Go To Add",services:"Exposed Services",upstreamPort:"Upstream Port",noService:"No Services",appId:"App DID",appPid:"Permanent DID",whyNeedAppPid:"If your application has been migrated, the permanent DID is the DID generated when this Blocklet was originally installed",alsoKnownAs:"Also Known As",skSource:"Owner Wallet",skSourceMigratedTip:"This app was launched with a server managed wallet, and have migrated to DID Wallet for better security.",skSourceManagedTip:"This app is running with a server managed wallet, please migrate to DID Wallet as soon as possible for better security.",mountPoint:{description1:"This change may break URLs containing the old mount point, which may further leads to:",case1:"Broken resource references between blocklets within this app",case2:"Broken URL if you have shared them publicly",description2:"You can setup a redirect from the old mount point to the new one to minimize possible breaking changes."},reloadSuccess:"Blocklet was reloaded successfully",statusTip:"Blocklet is {status}",initialUptime:"Less than 1m",dashboard:"Blocklet Dashboard",noComponent:"Application has no components and cannot be started",gotoVisitError:"Unable to access blocklet url, please try again later",fromUrl:{title:"Install Blocklet",label:"Blocklet Meta URL",description:"The URL should point to the Meta File of the Blocklet. If you need to refer to a local file, please add the file:// prefix, e.g. file:///Users/foo/blocklet.json.",confirm:"Install",step0:"Input URL",step1:"Confirm Meta Info",existTipPrefix:"Blocklet with the same DID already exists, the version is",existTipSuffix:", Please install a higher version."},action:{stopDescription:"Stopping the blocklet will make its public interfaces unaccessible, which may cause end user failures",stopComponentDescription:"Stopping the component will make its public interfaces unaccessible, which may cause end user failures",confirmStop:"Yes, Stop It",cancelDownloadDescription:"Cancel download {name} ?",removeApplicationDescription:"Removing the application will erase code and data generated by this application, which is not recoverable if you do not have any backups",removeApplicationAfterBackup:"Backup and remove the application. You can restore the application from this server if you need",removeApplicationComplete:"Remove both code and data for this application",removeComponentDescription:"Removing the component will erase code and data generated by this component, which is not recoverable if you do not have any backups",removeComponentKeepData:"Keep data for this component, only remove code",removeComponentComplete:"Remove both code and data for this component",confirmRemove:"Yes, Remove It",confirmComponentRemove:"Yes, Remove It",upgradeDescription:"Upgrading the blocklet will make it temporarily unavailable, are you sure to continue?",confirmUpgrade:"Yes, Upgrade It",confirmRestart:"Yes, Restart It",restartDescription:"Restarting the blocklet will temporarily suspended and may not start because of a configuration change"},dev:{modeTip:"Please switch Blocklet Server to DEBUG mode"},index:{tableTitle:"Manage Your Blocklets",noBlocklet:"No blocklets found in this Blocklet Server, install a blocklet from market place to start."},config:{baseInfo:"Basic Information",baseInfoDesc:"The basic information of the website can be set here.",logoSettings:"Visual Information",logoSettingsDesc:"Shape a unique brand image, enhance the website's recognition and visual appeal in various scenarios.",languagesDesc:"Used in: visitor language selection",changeImageTip:"Tip: If you want to change the picture, please click Preview Picture to change it.",name:"App Name",nameDesc:"Used in: DID Connect header, browser tab, website footer, SEO metadata and OpenGraph metadata",description:"App Description",descriptionDesc:"Used in: SEO metadata and OpenGraph metadata",logoSquare:"App Logo",logoSquareDesc:"Used in: user authentication dialog footer and <b>DID Wallet</b> app list",logoDesc:`
3
3
  Recommended Size: {width}* {height} pixels`,logoRect:"Website Logo",logoRectDesc:"Used in: website header and footer, will fallback to app logo if not configured",logoFavicon:"Favicon",logoFaviconDesc:"Used in: browser address bar and tab, will fallback to app logo if not configured",splashPortrait:"Splash Images",splashDesc:`ArcSphere APP launch screen (will be displayed in <b>ArcSphere</b> if configured)
4
4
 
@@ -1,4 +1,4 @@
1
- import{a as _,a3 as A,k as ve,r as se,br as Ee,bs as Ce,bt as Se,I as U,b_ as Q,b$ as X,a5 as Me,ac as Le,bI as _e}from"./vendor-ux-did-connect-pzpsrvqx.js";import{t as Be,l as Te,j as Fe}from"./vendor-hooks-DqdmWCmo.js";import{r as C,b as ie}from"./vendor-react-DEoibe3W.js";import{d as re}from"./InfoOutlined-BVWbftGI.js";import{i as He,v as Ne}from"./vendor-arcblock-CwufDgLV.js";import{D as V,aC as Ue,aD as Z,y as Ke,G as Ve}from"./index-CwUT0vPy.js";import{u as Y}from"./dashboard-t9EszOna.js";import{u as Ye}from"./use-mobile-DwzRjjku.js";import{H as o,j as e,D as Je,aj as Ge,t as Qe,aa as d,O as je,T as S,ab as H,ak as le,z as Xe,y as N,bs as ye,bR as ee,ad as q,L as te,A as oe,aq as Ze,E as M,I as F,C as et,bq as tt,al as D,cg as ot,X as Ie,a9 as ae,s as de,as as ne,bp as nt,b7 as st,b8 as it,an as rt,b$ as lt,v as at,ch as dt,ci as ct,cj as ut,ck as pt}from"./vendor-mui-core-Bq8gXTan.js";import{d as ht}from"./ExpandLess-CcLTbsdW.js";import{A as Re,b as De,z as xt}from"./vendor-utils-BfZ4tlod.js";import{C as mt}from"./confirm-RvA9mFot.js";import{A as ft}from"./actions-DnTVXQ_Z.js";import{T as we}from"./table-tips-BzPqsKYQ.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CaPDqrQ7.js";import"./index-8eXqqyHQ.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-B0-S5PGZ.js";import"./session-BGdAM8zS.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./dot-4jhL56kz.js";import"./useAsync-C62uE2pS.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-CtTQsfXN.js";import"./MoreHoriz-ChJ3K52h.js";const gt=n=>{var y;const[u,h]=C.useState(null),[v,l]=C.useState(!n),[w,p]=C.useState(null),g=(y=window.blocklet)==null?void 0:y.appUrl,s=C.useMemo(()=>{const c={};return u&&(u.sources.forEach(k=>{c[k.did]={source:k,events:[],count:0}}),u.events.forEach(k=>{c[k.source]&&(c[k.source].events.push(k),c[k.source].count+=1)})),c},[u]),j=async()=>{try{if(l(!0),!g)return;const k=await(await fetch(Re(g,ve.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();h(k),p(null)}catch(c){p(c instanceof Error?c:new Error(String(c)))}finally{l(!1)}};return C.useEffect(()=>{j()},[g]),{openEvent:u,setOpenEvent:h,eventsBySource:s,loading:v,error:w,loadData:j}};function ce({eventsBySource:n,selectedEvents:u,setSelectedEvents:h,error:v}){const{t:l}=_(),[w,p]=C.useState({}),g=C.useMemo(()=>{const i={};return Object.entries(n).forEach(([x,{events:m}])=>{const E=m.filter(I=>u[`${I.type}-${I.source}`]).length;i[x]=E}),i},[n,u]),s=C.useMemo(()=>Object.values(g).reduce((i,x)=>i+x,0),[g]),j=C.useMemo(()=>Object.values(n).reduce((i,{events:x})=>i+x.length,0),[n]),y=(i,x)=>{x.stopPropagation(),p({...w,[i]:!w[i]})},c=i=>{const x=`${i.type}-${i.source}`;h(m=>({...m,[x]:!m[x]}))},k=(i,x)=>{const m={};i.forEach(E=>{const I=`${E.type}-${E.source}`;m[I]=!x}),h(E=>({...E,...m}))},T=i=>{const x={};Object.values(n).forEach(({events:m})=>{m.forEach(E=>{const I=`${E.type}-${E.source}`;x[I]=i.target.checked})}),h(x)};return e.jsxs(d,{sx:{width:"100%"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ye,{control:e.jsx(ee,{onChange:T,checked:s>0&&s===j}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[l("webhookEndpoint.selectAllEvents"),e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:e.jsx(q,{title:l("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(re,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),s>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:l("webhookEndpoint.selectedEventsCount",{count:s})})]}),e.jsx(d,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(te,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(n).map(([i,{source:x,events:m,count:E}],I)=>{const O=g[i]>0,R=g[i]===m.length&&m.length>0,$=w[i];return e.jsxs(ie.Fragment,{children:[e.jsx(oe,{sx:{borderBottom:({palette:r})=>I<Object.keys(n).length-1?`1px solid ${r.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(d,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:r=>{r.target.closest(".MuiFormControlLabel-root")||y(i,r)},children:[e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ye,{control:e.jsx(ee,{checked:R,indeterminate:O&&!R,onChange:r=>{r.stopPropagation(),k(m,R)}}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[x.logo&&e.jsx(Ze,{src:x.logo,sx:{width:24,height:24}}),e.jsx(d,{children:x.title||i}),O&&e.jsx(M,{label:l("webhookEndpoint.selectedCount",{count:g[i]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:r=>`${r.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(d,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:l("webhookEndpoint.eventsCount",{count:E})}),m.length>0&&e.jsx(F,{size:"small",edge:"end",children:$?e.jsx(ht,{}):e.jsx(He,{})})]})]})}),m.length>0&&e.jsx(et,{in:$,timeout:"auto",unmountOnExit:!0,children:e.jsx(te,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(r=>{const a=`${r.type}-${r.source}`,t=!!u[a];return e.jsx(oe,{dense:!0,sx:{py:.75},onClick:()=>c(r),children:e.jsxs(d,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(ee,{checked:t,sx:{mr:1}}),e.jsxs(d,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:r.type}),e.jsx(S,{variant:"caption",color:"text.secondary",sx:{display:"block",cursor:"pointer"},children:r.description})]})]})},a)})})})]},i)})})}),v&&e.jsx(tt,{error:!0,sx:{mt:1},children:v})]})}ce.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};ce.defaultProps={error:null};function ue({id:n,url:u,description:h,enabledEvents:v,onSubmit:l,onClose:w}){var r;const{t:p}=_(),[g,s]=C.useState({}),{teamDid:j}=Y(),{api:y}=V(),{loading:c,error:k,eventsBySource:T}=gt(),{control:i,handleSubmit:x,formState:{errors:m},reset:E,setValue:I,trigger:O}=Ue({defaultValues:{url:"",description:""}});C.useEffect(()=>{const a=Object.values(g).some(t=>t);I("selectedEvents",a?"valid":""),O("selectedEvents")},[g,I,O]);const R=()=>{s({}),E(),w()},$=async a=>{const t=Object.keys(g).filter(f=>g[f]),b={url:a.url,description:a.description,enabledEvents:t.map(f=>{const[P,z]=f.split("-");return!P||!z?null:{type:P,source:z}}).filter(Boolean)};try{if(n){const f=await y.updateWebhookEndpoint({input:{teamDid:j,id:n,data:b}});A.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),l(f)}else{const f=await y.createWebhookEndpoint({input:{teamDid:j,input:b}});A.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),l(f)}}catch(f){A.error(f==null?void 0:f.message)}R()};return C.useEffect(()=>{E({url:u,description:h}),s(v.reduce((a,t)=>(a[`${t.type}-${t.source}`]=!0,a),{}))},[E,s,u,h,v]),e.jsx(Je,{open:!0,onClose:R,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:x($),children:[e.jsx(Ge,{children:p(n?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Qe,{children:e.jsxs(d,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(Z,{name:"url",control:i,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:a})=>{var t;return e.jsx(je,{...a,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:(t=m.url)==null?void 0:t.message})}}),e.jsx(Z,{name:"description",control:i,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:a})=>{var t;return e.jsx(je,{...a,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:(t=m.description)==null?void 0:t.message})}}),e.jsx(Z,{name:"selectedEvents",control:i,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:a})=>e.jsx("input",{type:"hidden",...a})}),!c&&T&&Object.keys(T).length>0&&e.jsx(ce,{eventsBySource:T,selectedEvents:g,setSelectedEvents:s,error:(r=m.selectedEvents)==null?void 0:r.message}),!c&&(!T||Object.keys(T).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),c&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(H,{size:20})}),k&&e.jsx(le,{severity:"error",children:p("webhookEndpoint.loadingError",{message:k==null?void 0:k.message})})]})}),e.jsxs(Xe,{sx:{p:"8px 24px 24px"},children:[e.jsx(N,{onClick:R,children:p("common.cancel")}),e.jsx(N,{type:"submit",variant:"contained",color:"primary",children:p(n?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}ue.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};ue.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function Pe(n){switch(n){case"enabled":return"success";case"disabled":default:return"default"}}const bt=(n="en")=>n==="tw"?"zh":n;function K(n,u="YYYY-MM-DD HH:mm:ss",h="en"){return n?Ke(n).locale(bt(h)).format(u):"-"}function jt(n){return typeof n=="number"?!1:De(n)}function yt(n){return n>=200&&n<300}function W(n){const u=jt(n.value);return e.jsxs(e.Fragment,{children:[e.jsxs(D,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[n.label,!!n.tip&&e.jsx(q,{title:n.tip,children:e.jsx(ot,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:u?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:u?"-":n.value})]}),n.divider&&e.jsx(Ie,{orientation:"vertical",flexItem:!0})]})}W.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};W.defaultProps={tip:"",divider:!1};function pe(n){return e.jsxs(D,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:n.mb,mt:n.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:n.title}),n.children]})}pe.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};pe.defaultProps={children:null,mb:1.5,mt:1.5};var he={},wt=ae;Object.defineProperty(he,"__esModule",{value:!0});var ze=he.default=void 0,kt=wt(se()),vt=e;ze=he.default=(0,kt.default)((0,vt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M7 13.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m5 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m5 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"Pending");var xe={},Et=ae;Object.defineProperty(xe,"__esModule",{value:!0});var Oe=xe.default=void 0,Ct=Et(se()),St=e;Oe=xe.default=(0,Ct.default)((0,St.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined");var me={},Tt=ae;Object.defineProperty(me,"__esModule",{value:!0});var We=me.default=void 0,It=Tt(se()),Rt=e;We=me.default=(0,It.default)((0,Rt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"ErrorOutlined");const Dt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},Pt=n=>{const u={};return n.forEach(h=>{var l;const v=new Date(h.createdAt).toLocaleDateString();u[v]||(u[v]=[]),(l=u[v])==null||l.push(h)}),u};function fe({eventId:n,webhookEndpointId:u,event:h}){const{api:v,ws:{useSubscription:l}}=V(),{t:w}=_(),{teamDid:p}=Y(),{blocklet:g}=Ve(),{data:s,loadMore:j,loadingMore:y,loading:c,mutate:k}=Be(t=>{const f=t?Math.ceil(t.list.length/15)+1:1;return v.getWebhookAttempts({input:{teamDid:p,input:{eventId:n,webhookId:u},paging:{page:f,pageSize:15}}})},{reloadDeps:[n,u]}),T=(s==null?void 0:s.list)||[],[i,x]=C.useState(null),[m,E]=C.useState(!1),I=Pt(T);if(C.useEffect(()=>{!i&&(s!=null&&s.list.length)&&x(s.list[0])},[s==null?void 0:s.list.length,i]),l(ve.EVENTS.WEBHOOK_ATTEMPT,t=>{k(b=>{var P,z;if(b.list.find(L=>L.id===t.id)){const L=b.list.map(B=>B.id===t.id?{...B,...t}:B);return{...b,list:L}}return t.endpoint=(P=b.list[0])==null?void 0:P.endpoint,t.event=(z=b.list[0])==null?void 0:z.event,{...b,list:[t,...b.list]}})},[]),c)return e.jsx(H,{});const O=s&&s.list.length<s.paging.total,R=async()=>{i&&(E(!0),await v.retryWebhookAttempt({input:{teamDid:p,eventId:i.event.id,webhookId:u,attemptId:i.id}}).finally(()=>{setTimeout(()=>{E(!1)},1e3)}))},$=t=>{var b,f,P,z,L;if(t.responseBody&&((b=t.responseBody)!=null&&b.sessionId)&&((f=t.responseBody)!=null&&f.projectId)&&((P=t.responseBody)!=null&&P.agentId)){const B=(L=(z=g==null?void 0:g.site)==null?void 0:z.domainAliases[0])==null?void 0:L.value,J=(g.children||[]).find(G=>{var be;return((be=G==null?void 0:G.meta)==null?void 0:be.name)==="ai-studio"}),Ae=xt(Re(`https://${B}`,(J==null?void 0:J.mountPoint)||"","projects",t.responseBody.projectId,"logs/main"),{sessionId:t.responseBody.sessionId,agentId:t.responseBody.agentId});return e.jsx(F,{sx:{fontSize:20},onClick:()=>window.open(Ae,"_blank"),children:e.jsx(d,{component:U,icon:Q})})}return null},r=t=>t.status==="pending"?e.jsx(ze,{color:"warning"}):yt(t.responseStatus)?e.jsx(Oe,{color:"success"}):e.jsx(We,{color:"error"}),a=(i==null?void 0:i.triggeredFrom)&&((s==null?void 0:s.list)||[]).find(t=>t.id===i.triggeredFrom);return e.jsxs(zt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ne,{item:!0,xs:12,md:4,height:1,children:De(Object.keys(I))?e.jsx(S,{color:"text.secondary",children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(te,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(I).map(([t,b])=>e.jsxs(ie.Fragment,{children:[e.jsx(nt,{sx:{p:0},children:t}),b.map(f=>e.jsxs(oe,{sx:{cursor:"pointer",px:1},onClick:()=>x(f),selected:i&&(i==null?void 0:i.id)===(f==null?void 0:f.id),secondaryAction:e.jsx(S,{color:"text.secondary",children:K(f.createdAt,"HH:mm:ss")}),children:[e.jsx(st,{sx:{minWidth:0,mr:1.5},children:r(f)}),e.jsx(it,{primary:e.jsx(S,{color:"text.primary",children:f.event.type})})]},f.id))]},t))}),O&&e.jsx(d,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(N,{variant:"text",type:"button",color:"inherit",onClick:j,disabled:y,sx:{color:t=>t.palette.text.disabled},children:w(y?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ne,{item:!0,xs:12,md:8,height:1,children:[i&&e.jsxs(D,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h4",children:w(`common.${i.status}`)}),e.jsx(d,{children:$(i)})]}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[a&&e.jsx(q,{componentsProps:{tooltip:{sx:{maxWidth:400}}},placement:"left",title:e.jsxs(D,{gap:1,sx:{cursor:"pointer",".did-address-text":{color:"common.white"}},onClick:()=>x(a),children:[e.jsx(Ee,{showDid:!0,did:i.triggeredBy,cardType:Ce.Detailed,infoType:Se.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(Ie,{}),e.jsxs(d,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(S,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"body2",children:i.id}),e.jsx(F,{onClick:()=>x(a),children:e.jsx(d,{component:U,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),children:e.jsx(F,{onClick:()=>x(a),children:e.jsx(d,{component:U,icon:Q,sx:{fontSize:16}})})}),e.jsxs(N,{variant:"outlined",color:"primary",size:"small",onClick:R,disabled:m,children:[e.jsx(d,{component:U,icon:Dt,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(d,{children:[e.jsxs(S,{variant:"h6",children:[w("webhookEndpoint.response")," (",i.responseStatus,")"]}),e.jsx(X,{language:"json",children:JSON.stringify(i.responseBody,null,2)})]}),e.jsxs(d,{children:[e.jsx(D,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(X,{language:"json",sx:{margin:0},children:JSON.stringify(i.event,null,2)})]})]}),(s==null?void 0:s.list.length)===0&&h&&e.jsxs(d,{children:[e.jsx(D,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(X,{language:"json",sx:{margin:0},children:JSON.stringify(h.data,null,2)})]})]})]})}fe.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};fe.defaultProps={eventId:"",webhookEndpointId:"",event:null};const zt=de(ne)`
1
+ import{a as _,a3 as A,k as ve,r as se,br as Ee,bs as Ce,bt as Se,I as U,b_ as Q,b$ as X,a5 as Me,ac as Le,bI as _e}from"./vendor-ux-did-connect-pzpsrvqx.js";import{t as Be,l as Te,j as Fe}from"./vendor-hooks-DqdmWCmo.js";import{r as C,b as ie}from"./vendor-react-DEoibe3W.js";import{d as re}from"./InfoOutlined-BVWbftGI.js";import{i as He,v as Ne}from"./vendor-arcblock-CwufDgLV.js";import{D as V,aC as Ue,aD as Z,y as Ke,G as Ve}from"./index-CwUT0vPy.js";import{u as Y}from"./dashboard-t9EszOna.js";import{u as Ye}from"./use-mobile-CtTQsfXN.js";import{H as o,j as e,D as Je,aj as Ge,t as Qe,aa as d,O as je,T as S,ab as H,ak as le,z as Xe,y as N,bs as ye,bR as ee,ad as q,L as te,A as oe,aq as Ze,E as M,I as F,C as et,bq as tt,al as D,cg as ot,X as Ie,a9 as ae,s as de,as as ne,bp as nt,b7 as st,b8 as it,an as rt,b$ as lt,v as at,ch as dt,ci as ct,cj as ut,ck as pt}from"./vendor-mui-core-Bq8gXTan.js";import{d as ht}from"./ExpandLess-CcLTbsdW.js";import{A as Re,b as De,z as xt}from"./vendor-utils-BfZ4tlod.js";import{C as mt}from"./confirm-RvA9mFot.js";import{A as ft}from"./actions-DnTVXQ_Z.js";import{T as we}from"./table-tips-BzPqsKYQ.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CaPDqrQ7.js";import"./index-8eXqqyHQ.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-D5KSEAKZ.js";import"./session-BGdAM8zS.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./dot-4jhL56kz.js";import"./useAsync-C62uE2pS.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";import"./MoreHoriz-ChJ3K52h.js";const gt=n=>{var y;const[u,h]=C.useState(null),[v,l]=C.useState(!n),[w,p]=C.useState(null),g=(y=window.blocklet)==null?void 0:y.appUrl,s=C.useMemo(()=>{const c={};return u&&(u.sources.forEach(k=>{c[k.did]={source:k,events:[],count:0}}),u.events.forEach(k=>{c[k.source]&&(c[k.source].events.push(k),c[k.source].count+=1)})),c},[u]),j=async()=>{try{if(l(!0),!g)return;const k=await(await fetch(Re(g,ve.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();h(k),p(null)}catch(c){p(c instanceof Error?c:new Error(String(c)))}finally{l(!1)}};return C.useEffect(()=>{j()},[g]),{openEvent:u,setOpenEvent:h,eventsBySource:s,loading:v,error:w,loadData:j}};function ce({eventsBySource:n,selectedEvents:u,setSelectedEvents:h,error:v}){const{t:l}=_(),[w,p]=C.useState({}),g=C.useMemo(()=>{const i={};return Object.entries(n).forEach(([x,{events:m}])=>{const E=m.filter(I=>u[`${I.type}-${I.source}`]).length;i[x]=E}),i},[n,u]),s=C.useMemo(()=>Object.values(g).reduce((i,x)=>i+x,0),[g]),j=C.useMemo(()=>Object.values(n).reduce((i,{events:x})=>i+x.length,0),[n]),y=(i,x)=>{x.stopPropagation(),p({...w,[i]:!w[i]})},c=i=>{const x=`${i.type}-${i.source}`;h(m=>({...m,[x]:!m[x]}))},k=(i,x)=>{const m={};i.forEach(E=>{const I=`${E.type}-${E.source}`;m[I]=!x}),h(E=>({...E,...m}))},T=i=>{const x={};Object.values(n).forEach(({events:m})=>{m.forEach(E=>{const I=`${E.type}-${E.source}`;x[I]=i.target.checked})}),h(x)};return e.jsxs(d,{sx:{width:"100%"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ye,{control:e.jsx(ee,{onChange:T,checked:s>0&&s===j}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[l("webhookEndpoint.selectAllEvents"),e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:e.jsx(q,{title:l("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(re,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),s>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:l("webhookEndpoint.selectedEventsCount",{count:s})})]}),e.jsx(d,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(te,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(n).map(([i,{source:x,events:m,count:E}],I)=>{const O=g[i]>0,R=g[i]===m.length&&m.length>0,$=w[i];return e.jsxs(ie.Fragment,{children:[e.jsx(oe,{sx:{borderBottom:({palette:r})=>I<Object.keys(n).length-1?`1px solid ${r.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(d,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:r=>{r.target.closest(".MuiFormControlLabel-root")||y(i,r)},children:[e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ye,{control:e.jsx(ee,{checked:R,indeterminate:O&&!R,onChange:r=>{r.stopPropagation(),k(m,R)}}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[x.logo&&e.jsx(Ze,{src:x.logo,sx:{width:24,height:24}}),e.jsx(d,{children:x.title||i}),O&&e.jsx(M,{label:l("webhookEndpoint.selectedCount",{count:g[i]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:r=>`${r.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(d,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:l("webhookEndpoint.eventsCount",{count:E})}),m.length>0&&e.jsx(F,{size:"small",edge:"end",children:$?e.jsx(ht,{}):e.jsx(He,{})})]})]})}),m.length>0&&e.jsx(et,{in:$,timeout:"auto",unmountOnExit:!0,children:e.jsx(te,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(r=>{const a=`${r.type}-${r.source}`,t=!!u[a];return e.jsx(oe,{dense:!0,sx:{py:.75},onClick:()=>c(r),children:e.jsxs(d,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(ee,{checked:t,sx:{mr:1}}),e.jsxs(d,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:r.type}),e.jsx(S,{variant:"caption",color:"text.secondary",sx:{display:"block",cursor:"pointer"},children:r.description})]})]})},a)})})})]},i)})})}),v&&e.jsx(tt,{error:!0,sx:{mt:1},children:v})]})}ce.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};ce.defaultProps={error:null};function ue({id:n,url:u,description:h,enabledEvents:v,onSubmit:l,onClose:w}){var r;const{t:p}=_(),[g,s]=C.useState({}),{teamDid:j}=Y(),{api:y}=V(),{loading:c,error:k,eventsBySource:T}=gt(),{control:i,handleSubmit:x,formState:{errors:m},reset:E,setValue:I,trigger:O}=Ue({defaultValues:{url:"",description:""}});C.useEffect(()=>{const a=Object.values(g).some(t=>t);I("selectedEvents",a?"valid":""),O("selectedEvents")},[g,I,O]);const R=()=>{s({}),E(),w()},$=async a=>{const t=Object.keys(g).filter(f=>g[f]),b={url:a.url,description:a.description,enabledEvents:t.map(f=>{const[P,z]=f.split("-");return!P||!z?null:{type:P,source:z}}).filter(Boolean)};try{if(n){const f=await y.updateWebhookEndpoint({input:{teamDid:j,id:n,data:b}});A.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),l(f)}else{const f=await y.createWebhookEndpoint({input:{teamDid:j,input:b}});A.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),l(f)}}catch(f){A.error(f==null?void 0:f.message)}R()};return C.useEffect(()=>{E({url:u,description:h}),s(v.reduce((a,t)=>(a[`${t.type}-${t.source}`]=!0,a),{}))},[E,s,u,h,v]),e.jsx(Je,{open:!0,onClose:R,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:x($),children:[e.jsx(Ge,{children:p(n?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Qe,{children:e.jsxs(d,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(Z,{name:"url",control:i,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:a})=>{var t;return e.jsx(je,{...a,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:(t=m.url)==null?void 0:t.message})}}),e.jsx(Z,{name:"description",control:i,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:a})=>{var t;return e.jsx(je,{...a,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:(t=m.description)==null?void 0:t.message})}}),e.jsx(Z,{name:"selectedEvents",control:i,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:a})=>e.jsx("input",{type:"hidden",...a})}),!c&&T&&Object.keys(T).length>0&&e.jsx(ce,{eventsBySource:T,selectedEvents:g,setSelectedEvents:s,error:(r=m.selectedEvents)==null?void 0:r.message}),!c&&(!T||Object.keys(T).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),c&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(H,{size:20})}),k&&e.jsx(le,{severity:"error",children:p("webhookEndpoint.loadingError",{message:k==null?void 0:k.message})})]})}),e.jsxs(Xe,{sx:{p:"8px 24px 24px"},children:[e.jsx(N,{onClick:R,children:p("common.cancel")}),e.jsx(N,{type:"submit",variant:"contained",color:"primary",children:p(n?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}ue.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};ue.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function Pe(n){switch(n){case"enabled":return"success";case"disabled":default:return"default"}}const bt=(n="en")=>n==="tw"?"zh":n;function K(n,u="YYYY-MM-DD HH:mm:ss",h="en"){return n?Ke(n).locale(bt(h)).format(u):"-"}function jt(n){return typeof n=="number"?!1:De(n)}function yt(n){return n>=200&&n<300}function W(n){const u=jt(n.value);return e.jsxs(e.Fragment,{children:[e.jsxs(D,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[n.label,!!n.tip&&e.jsx(q,{title:n.tip,children:e.jsx(ot,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:u?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:u?"-":n.value})]}),n.divider&&e.jsx(Ie,{orientation:"vertical",flexItem:!0})]})}W.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};W.defaultProps={tip:"",divider:!1};function pe(n){return e.jsxs(D,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:n.mb,mt:n.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:n.title}),n.children]})}pe.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};pe.defaultProps={children:null,mb:1.5,mt:1.5};var he={},wt=ae;Object.defineProperty(he,"__esModule",{value:!0});var ze=he.default=void 0,kt=wt(se()),vt=e;ze=he.default=(0,kt.default)((0,vt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M7 13.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m5 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m5 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"Pending");var xe={},Et=ae;Object.defineProperty(xe,"__esModule",{value:!0});var Oe=xe.default=void 0,Ct=Et(se()),St=e;Oe=xe.default=(0,Ct.default)((0,St.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined");var me={},Tt=ae;Object.defineProperty(me,"__esModule",{value:!0});var We=me.default=void 0,It=Tt(se()),Rt=e;We=me.default=(0,It.default)((0,Rt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"ErrorOutlined");const Dt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},Pt=n=>{const u={};return n.forEach(h=>{var l;const v=new Date(h.createdAt).toLocaleDateString();u[v]||(u[v]=[]),(l=u[v])==null||l.push(h)}),u};function fe({eventId:n,webhookEndpointId:u,event:h}){const{api:v,ws:{useSubscription:l}}=V(),{t:w}=_(),{teamDid:p}=Y(),{blocklet:g}=Ve(),{data:s,loadMore:j,loadingMore:y,loading:c,mutate:k}=Be(t=>{const f=t?Math.ceil(t.list.length/15)+1:1;return v.getWebhookAttempts({input:{teamDid:p,input:{eventId:n,webhookId:u},paging:{page:f,pageSize:15}}})},{reloadDeps:[n,u]}),T=(s==null?void 0:s.list)||[],[i,x]=C.useState(null),[m,E]=C.useState(!1),I=Pt(T);if(C.useEffect(()=>{!i&&(s!=null&&s.list.length)&&x(s.list[0])},[s==null?void 0:s.list.length,i]),l(ve.EVENTS.WEBHOOK_ATTEMPT,t=>{k(b=>{var P,z;if(b.list.find(L=>L.id===t.id)){const L=b.list.map(B=>B.id===t.id?{...B,...t}:B);return{...b,list:L}}return t.endpoint=(P=b.list[0])==null?void 0:P.endpoint,t.event=(z=b.list[0])==null?void 0:z.event,{...b,list:[t,...b.list]}})},[]),c)return e.jsx(H,{});const O=s&&s.list.length<s.paging.total,R=async()=>{i&&(E(!0),await v.retryWebhookAttempt({input:{teamDid:p,eventId:i.event.id,webhookId:u,attemptId:i.id}}).finally(()=>{setTimeout(()=>{E(!1)},1e3)}))},$=t=>{var b,f,P,z,L;if(t.responseBody&&((b=t.responseBody)!=null&&b.sessionId)&&((f=t.responseBody)!=null&&f.projectId)&&((P=t.responseBody)!=null&&P.agentId)){const B=(L=(z=g==null?void 0:g.site)==null?void 0:z.domainAliases[0])==null?void 0:L.value,J=(g.children||[]).find(G=>{var be;return((be=G==null?void 0:G.meta)==null?void 0:be.name)==="ai-studio"}),Ae=xt(Re(`https://${B}`,(J==null?void 0:J.mountPoint)||"","projects",t.responseBody.projectId,"logs/main"),{sessionId:t.responseBody.sessionId,agentId:t.responseBody.agentId});return e.jsx(F,{sx:{fontSize:20},onClick:()=>window.open(Ae,"_blank"),children:e.jsx(d,{component:U,icon:Q})})}return null},r=t=>t.status==="pending"?e.jsx(ze,{color:"warning"}):yt(t.responseStatus)?e.jsx(Oe,{color:"success"}):e.jsx(We,{color:"error"}),a=(i==null?void 0:i.triggeredFrom)&&((s==null?void 0:s.list)||[]).find(t=>t.id===i.triggeredFrom);return e.jsxs(zt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ne,{item:!0,xs:12,md:4,height:1,children:De(Object.keys(I))?e.jsx(S,{color:"text.secondary",children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(te,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(I).map(([t,b])=>e.jsxs(ie.Fragment,{children:[e.jsx(nt,{sx:{p:0},children:t}),b.map(f=>e.jsxs(oe,{sx:{cursor:"pointer",px:1},onClick:()=>x(f),selected:i&&(i==null?void 0:i.id)===(f==null?void 0:f.id),secondaryAction:e.jsx(S,{color:"text.secondary",children:K(f.createdAt,"HH:mm:ss")}),children:[e.jsx(st,{sx:{minWidth:0,mr:1.5},children:r(f)}),e.jsx(it,{primary:e.jsx(S,{color:"text.primary",children:f.event.type})})]},f.id))]},t))}),O&&e.jsx(d,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(N,{variant:"text",type:"button",color:"inherit",onClick:j,disabled:y,sx:{color:t=>t.palette.text.disabled},children:w(y?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ne,{item:!0,xs:12,md:8,height:1,children:[i&&e.jsxs(D,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h4",children:w(`common.${i.status}`)}),e.jsx(d,{children:$(i)})]}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[a&&e.jsx(q,{componentsProps:{tooltip:{sx:{maxWidth:400}}},placement:"left",title:e.jsxs(D,{gap:1,sx:{cursor:"pointer",".did-address-text":{color:"common.white"}},onClick:()=>x(a),children:[e.jsx(Ee,{showDid:!0,did:i.triggeredBy,cardType:Ce.Detailed,infoType:Se.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(Ie,{}),e.jsxs(d,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(S,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"body2",children:i.id}),e.jsx(F,{onClick:()=>x(a),children:e.jsx(d,{component:U,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),children:e.jsx(F,{onClick:()=>x(a),children:e.jsx(d,{component:U,icon:Q,sx:{fontSize:16}})})}),e.jsxs(N,{variant:"outlined",color:"primary",size:"small",onClick:R,disabled:m,children:[e.jsx(d,{component:U,icon:Dt,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(d,{children:[e.jsxs(S,{variant:"h6",children:[w("webhookEndpoint.response")," (",i.responseStatus,")"]}),e.jsx(X,{language:"json",children:JSON.stringify(i.responseBody,null,2)})]}),e.jsxs(d,{children:[e.jsx(D,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(X,{language:"json",sx:{margin:0},children:JSON.stringify(i.event,null,2)})]})]}),(s==null?void 0:s.list.length)===0&&h&&e.jsxs(d,{children:[e.jsx(D,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(X,{language:"json",sx:{margin:0},children:JSON.stringify(h.data,null,2)})]})]})]})}fe.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};fe.defaultProps={eventId:"",webhookEndpointId:"",event:null};const zt=de(ne)`
2
2
  @keyframes spin {
3
3
  to {
4
4
  transform: rotate(360deg);
@@ -1,4 +1,4 @@
1
- import{r as C}from"./vendor-react-DEoibe3W.js";import{a as I,$,k as W,B as F,bb as Te,ar as me,b$ as H,a3 as ve,aI as q,br as ue,bs as xe,bt as fe,bI as Ke,cg as we,bd as Ae,ac as Se,a5 as De}from"./vendor-ux-did-connect-pzpsrvqx.js";import{d as Ie}from"./Edit-CiTb-w5P.js";import{f as Re}from"./index-8eXqqyHQ.js";import{r as ye}from"./passport-item-B3XIp0U4.js";import{D as R,n as O,aN as $e,G as Be,f as Pe}from"./index-CwUT0vPy.js";import{u as N}from"./dashboard-t9EszOna.js";import{j as e,H as f,bo as X,br as Q,bn as J,q as Y,aa as g,al as Z,O as V,ab as _e,bs as Ne,bR as Ee,ah as E,T as P,ad as de,ak as Le}from"./vendor-mui-core-Bq8gXTan.js";import{v as We,K as Ue}from"./vendor-arcblock-CwufDgLV.js";import{T as he}from"./index-DrTNV3tX.js";import{C as ge}from"./confirm-RvA9mFot.js";import{a1 as qe,A as _}from"./vendor-utils-BfZ4tlod.js";import{C as G}from"./click-to-copy-By4fgGR7.js";import{D as ze}from"./delete-confirm-wTMDQFnr.js";import{P as Me}from"./permission-DQvXGutX.js";import{B as Fe}from"./bundle-avatar-UIbxwQif.js";import{W as He}from"./did-address-NnOD1W_A.js";import{A as Oe}from"./actions-DnTVXQ_Z.js";import{u as Ve}from"./use-mobile-DwzRjjku.js";import{T as pe}from"./table-tips-BzPqsKYQ.js";import{y as Ge}from"./vendor-hooks-DqdmWCmo.js";import"./lottie-web-jYmAQWuC.js";import"./util-BQAJqeb4.js";import"./base32-DUSifB4M.js";import"./useLocalStorage-CaPDqrQ7.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-B0-S5PGZ.js";import"./session-BGdAM8zS.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./InfoOutlined-BVWbftGI.js";import"./dot-4jhL56kz.js";import"./useAsync-C62uE2pS.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-CtTQsfXN.js";import"./vendor-mui-x-1nqAyytV.js";import"./AdapterDayjs-BRnJ9bMs.js";import"./MoreHoriz-ChJ3K52h.js";function ee({value:t}){const{t:s,locale:m}=I(),c=new Date;return new Date(t)<c?e.jsxs("span",{style:{color:"red"},children:[e.jsx($,{value:t,locale:m}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx($,{value:t,locale:m,type:"all"})}ee.propTypes={value:f.string.isRequired};function te({value:t,onChange:s,...m}){const{t:c}=I(),r=C.useMemo(()=>[{value:"signature",title:c("setting.accessKey.signature"),description:c("setting.accessKey.signatureDesc")},{value:"simple",title:c("setting.accessKey.simple"),description:c("setting.accessKey.simpleDesc")}],[c]);return e.jsxs(X,{style:{width:"100%"},variant:"outlined",...m,children:[e.jsx(Q,{children:c("setting.accessKey.authType")}),e.jsx(J,{value:t,onChange:s,fullWidth:!0,label:c("setting.accessKey.authType"),children:r.map(i=>e.jsx(Y,{value:i.value,children:e.jsxs(g,{children:[e.jsx("span",{children:i.title}),e.jsx(g,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:i.description})]})},i.value))})]})}te.propTypes={value:f.string.isRequired,onChange:f.func.isRequired};const U=()=>{const t=W.RBAC_CONFIG.roles.filter(r=>r.passport),{inService:s}=R(),{roles:m}=N(),c=[...t,...s?m:[]];return qe(c,"name").filter(r=>r.name!==W.ROLES.OWNER)};function se(t){const{remark:s,onCreate:m}=t,{api:c}=R(),{teamDid:r}=N(),{t:i}=I(),[b,j]=C.useState(!1),[y,k]=C.useState(null),d=U(),w=()=>{j(!1),k(null)},v=async n=>{const{remark:x,passport:h,authType:o}=n;j(!0);const l=await c.createAccessKey({input:{teamDid:r,remark:x.trim(),passport:h,expireAt:n.expireAt?new Date(n.expireAt).getTime():null,authType:o}}),{data:K}=l;m(K),k(null),j(!1)},u={title:`${i("common.create")} ${i("accessKey")}`,description:(n,x,h)=>e.jsxs(Z,{gap:3,children:[e.jsx(V,{label:i("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:n.remark,onChange:o=>{x({...n,remark:o.target.value,__disableConfirm:!n.passport||!o.target.value.trim()}),o.target.value.trim()?h(""):h(i("setting.accessKey.remarkInvalid"))}}),e.jsxs(X,{style:{width:"100%"},variant:"outlined",children:[e.jsx(Q,{children:i("setting.accessKey.passport")}),e.jsx(J,{"data-cy":"create-access-key-select-passport",value:n.passport,onChange:o=>{const l=o.target.value;h(null),x({...n,passport:l,__disableConfirm:!n.remark||!l})},fullWidth:!0,label:i("setting.accessKey.passport"),disabled:b,children:d.map(o=>e.jsx(Y,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(g,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(g,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:o.description})]})},o.name))})]}),e.jsx(te,{value:n.authType,onChange:o=>{x({...n,authType:o.target.value})}}),e.jsx(he,{placeholder:i("setting.accessKey.expireTime"),value:n.expireAt,onChange:o=>{x({...n,expireAt:o,__disableConfirm:!n.passport||!n.remark||!o})}})]}),confirm:i("common.confirm"),cancel:i("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:v,onCancel:w};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>k(u),className:"rule-action",children:[b?e.jsx(_e,{size:16}):e.jsx(We,{style:{fontSize:16}}),i("common.create")]}),y&&e.jsx(ge,{title:y.title,description:y.description,confirm:y.confirm,color:y.color,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}se.propTypes={remark:f.string,onCreate:f.func};se.defaultProps={onCreate:()=>{},remark:""};function ne(t){var h,o;const{onConfirm:s,accessKeyId:m,accessKeySecret:c,hideSecret:r}=t,{t:i}=C.useContext(Te),[b,j]=C.useState(!1),[y,k]=C.useState(()=>r),d=R(),w=()=>{k(!y)},v=l=>{j(l.target.checked)},u=_(window.location.origin,(o=(h=d==null?void 0:d.info)==null?void 0:h.routing)==null?void 0:o.adminPath),n=C.useMemo(()=>{var l,K,p,D;return r?`const Client = require('@abtnode/client');
1
+ import{r as C}from"./vendor-react-DEoibe3W.js";import{a as I,$,k as W,B as F,bb as Te,ar as me,b$ as H,a3 as ve,aI as q,br as ue,bs as xe,bt as fe,bI as Ke,cg as we,bd as Ae,ac as Se,a5 as De}from"./vendor-ux-did-connect-pzpsrvqx.js";import{d as Ie}from"./Edit-CiTb-w5P.js";import{f as Re}from"./index-8eXqqyHQ.js";import{r as ye}from"./passport-item-B3XIp0U4.js";import{D as R,n as O,aN as $e,G as Be,f as Pe}from"./index-CwUT0vPy.js";import{u as N}from"./dashboard-t9EszOna.js";import{j as e,H as f,bo as X,br as Q,bn as J,q as Y,aa as g,al as Z,O as V,ab as _e,bs as Ne,bR as Ee,ah as E,T as P,ad as de,ak as Le}from"./vendor-mui-core-Bq8gXTan.js";import{v as We,K as Ue}from"./vendor-arcblock-CwufDgLV.js";import{T as he}from"./index-DrTNV3tX.js";import{C as ge}from"./confirm-RvA9mFot.js";import{a1 as qe,A as _}from"./vendor-utils-BfZ4tlod.js";import{C as G}from"./click-to-copy-By4fgGR7.js";import{D as ze}from"./delete-confirm-wTMDQFnr.js";import{P as Me}from"./permission-DQvXGutX.js";import{B as Fe}from"./bundle-avatar-UIbxwQif.js";import{W as He}from"./did-address-NnOD1W_A.js";import{A as Oe}from"./actions-DnTVXQ_Z.js";import{u as Ve}from"./use-mobile-CtTQsfXN.js";import{T as pe}from"./table-tips-BzPqsKYQ.js";import{y as Ge}from"./vendor-hooks-DqdmWCmo.js";import"./lottie-web-jYmAQWuC.js";import"./util-BQAJqeb4.js";import"./base32-DUSifB4M.js";import"./useLocalStorage-CaPDqrQ7.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-D5KSEAKZ.js";import"./session-BGdAM8zS.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./InfoOutlined-BVWbftGI.js";import"./dot-4jhL56kz.js";import"./useAsync-C62uE2pS.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";import"./vendor-mui-x-1nqAyytV.js";import"./AdapterDayjs-BRnJ9bMs.js";import"./MoreHoriz-ChJ3K52h.js";function ee({value:t}){const{t:s,locale:m}=I(),c=new Date;return new Date(t)<c?e.jsxs("span",{style:{color:"red"},children:[e.jsx($,{value:t,locale:m}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx($,{value:t,locale:m,type:"all"})}ee.propTypes={value:f.string.isRequired};function te({value:t,onChange:s,...m}){const{t:c}=I(),r=C.useMemo(()=>[{value:"signature",title:c("setting.accessKey.signature"),description:c("setting.accessKey.signatureDesc")},{value:"simple",title:c("setting.accessKey.simple"),description:c("setting.accessKey.simpleDesc")}],[c]);return e.jsxs(X,{style:{width:"100%"},variant:"outlined",...m,children:[e.jsx(Q,{children:c("setting.accessKey.authType")}),e.jsx(J,{value:t,onChange:s,fullWidth:!0,label:c("setting.accessKey.authType"),children:r.map(i=>e.jsx(Y,{value:i.value,children:e.jsxs(g,{children:[e.jsx("span",{children:i.title}),e.jsx(g,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:i.description})]})},i.value))})]})}te.propTypes={value:f.string.isRequired,onChange:f.func.isRequired};const U=()=>{const t=W.RBAC_CONFIG.roles.filter(r=>r.passport),{inService:s}=R(),{roles:m}=N(),c=[...t,...s?m:[]];return qe(c,"name").filter(r=>r.name!==W.ROLES.OWNER)};function se(t){const{remark:s,onCreate:m}=t,{api:c}=R(),{teamDid:r}=N(),{t:i}=I(),[b,j]=C.useState(!1),[y,k]=C.useState(null),d=U(),w=()=>{j(!1),k(null)},v=async n=>{const{remark:x,passport:h,authType:o}=n;j(!0);const l=await c.createAccessKey({input:{teamDid:r,remark:x.trim(),passport:h,expireAt:n.expireAt?new Date(n.expireAt).getTime():null,authType:o}}),{data:K}=l;m(K),k(null),j(!1)},u={title:`${i("common.create")} ${i("accessKey")}`,description:(n,x,h)=>e.jsxs(Z,{gap:3,children:[e.jsx(V,{label:i("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:n.remark,onChange:o=>{x({...n,remark:o.target.value,__disableConfirm:!n.passport||!o.target.value.trim()}),o.target.value.trim()?h(""):h(i("setting.accessKey.remarkInvalid"))}}),e.jsxs(X,{style:{width:"100%"},variant:"outlined",children:[e.jsx(Q,{children:i("setting.accessKey.passport")}),e.jsx(J,{"data-cy":"create-access-key-select-passport",value:n.passport,onChange:o=>{const l=o.target.value;h(null),x({...n,passport:l,__disableConfirm:!n.remark||!l})},fullWidth:!0,label:i("setting.accessKey.passport"),disabled:b,children:d.map(o=>e.jsx(Y,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(g,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(g,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:o.description})]})},o.name))})]}),e.jsx(te,{value:n.authType,onChange:o=>{x({...n,authType:o.target.value})}}),e.jsx(he,{placeholder:i("setting.accessKey.expireTime"),value:n.expireAt,onChange:o=>{x({...n,expireAt:o,__disableConfirm:!n.passport||!n.remark||!o})}})]}),confirm:i("common.confirm"),cancel:i("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:v,onCancel:w};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>k(u),className:"rule-action",children:[b?e.jsx(_e,{size:16}):e.jsx(We,{style:{fontSize:16}}),i("common.create")]}),y&&e.jsx(ge,{title:y.title,description:y.description,confirm:y.confirm,color:y.color,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})]})}se.propTypes={remark:f.string,onCreate:f.func};se.defaultProps={onCreate:()=>{},remark:""};function ne(t){var h,o;const{onConfirm:s,accessKeyId:m,accessKeySecret:c,hideSecret:r}=t,{t:i}=C.useContext(Te),[b,j]=C.useState(!1),[y,k]=C.useState(()=>r),d=R(),w=()=>{k(!y)},v=l=>{j(l.target.checked)},u=_(window.location.origin,(o=(h=d==null?void 0:d.info)==null?void 0:h.routing)==null?void 0:o.adminPath),n=C.useMemo(()=>{var l,K,p,D;return r?`const Client = require('@abtnode/client');
2
2
  const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
3
  const { joinURL } = require('ufo');
4
4
 
@@ -1,4 +1,4 @@
1
- import{r as P,t as bn,g as Cn,e as wt,a as jn}from"./vendor-react-DEoibe3W.js";import{a9 as Ut,j as e,aa as O,bo as Be,br as Fe,bn as $e,q as je,T as G,O as me,ab as ie,bx as qe,ak as oe,H as v,ah as z,e as Sn,ad as ue,w as wn,y as _t,b7 as Pn,b8 as kn,I as In,bh as Tn,bs as Dn,bR as An}from"./vendor-mui-core-Bq8gXTan.js";import{B as Pt,e as We,a0 as Rn,ay as Ln,n as kt,A as En,b as On}from"./vendor-utils-BfZ4tlod.js";import{r as Bt,aR as Ft,bL as Nn,i as Un,a as K,a2 as _n,a1 as Bn,a3 as Y,ar as ne,B as W,f as Fn,at as $n,d as Wn,bb as fe,bC as zn,k as Q,a5 as $t,an as Mn,br as Wt,bs as zt,bt as qn,I as Hn,ax as Vn,$ as ze,bd as Kn,ac as Mt,ab as qt,bI as Zn}from"./vendor-ux-did-connect-pzpsrvqx.js";import{c as J,a as Yn,G as Ht,v as Se,n as Gn,I as Qn}from"./vendor-arcblock-CwufDgLV.js";import{d as Jn}from"./ViewList-BOGcbymi.js";import{a2 as Xn,f as es,D as H,ay as we,n as pe,a3 as ts,V as se,az as ns,G as Vt,aA as Kt,y as ss,b as rs,aB as os}from"./index-CwUT0vPy.js";import{k as is,u as He,a as Ve,c as as,m as ls,b as cs}from"./vendor-hooks-DqdmWCmo.js";import{l as ds}from"./index-BLfUtUpB.js";import{u as Z,d as It,W as Zt}from"./dashboard-t9EszOna.js";import{W as Ke}from"./did-address-NnOD1W_A.js";import{P as X}from"./permission-DQvXGutX.js";import{C as Te}from"./click-to-copy-By4fgGR7.js";import{T as Yt}from"./index-DrTNV3tX.js";import{f as ee}from"./index-8eXqqyHQ.js";import{_ as ms}from"./useAsync-C62uE2pS.js";import{I as q}from"./index-DPIWnhb5.js";import{d as us}from"./DeleteOutline-BKSMNwfT.js";import{C as ge}from"./confirm-RvA9mFot.js";import{u as he}from"./session-BGdAM8zS.js";import{i as Gt,a as Pe,p as Qt}from"./util-BQAJqeb4.js";import{b as ps}from"./sdk-BmeKtHic.js";import{A as fs}from"./actions-DnTVXQ_Z.js";import{S as gs}from"./shorten-label-BQvbtscf.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CaPDqrQ7.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-B0-S5PGZ.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./InfoOutlined-BVWbftGI.js";import"./dot-4jhL56kz.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-CtTQsfXN.js";import"./vendor-mui-x-1nqAyytV.js";import"./AdapterDayjs-BRnJ9bMs.js";import"./base32-DUSifB4M.js";import"./MoreHoriz-ChJ3K52h.js";var Ze={},hs=Ut;Object.defineProperty(Ze,"__esModule",{value:!0});var Jt=Ze.default=void 0,xs=hs(Bt()),ys=e;Jt=Ze.default=(0,xs.default)((0,ys.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var Ye=function(t){return e.jsxs("svg",{...t,children:[e.jsx("g",{clipPath:"url(#clip0)",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0",children:e.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};Ye.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};Ye.displayName="person";const vs=Ye;var Ge=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};Ge.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};Ge.displayName="external-issuer";const Xt=Ge;var Ce={},bs=t=>encodeURIComponent(t).replace(/[!'()*]/g,o=>`%${o.charCodeAt(0).toString(16).toUpperCase()}`),en="%[a-f0-9]{2}",Tt=new RegExp("("+en+")|([^%]+?)","gi"),Dt=new RegExp("("+en+")+","gi");function Me(t,o){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;o=o||1;var l=t.slice(0,o),p=t.slice(o);return Array.prototype.concat.call([],Me(l),Me(p))}function Cs(t){try{return decodeURIComponent(t)}catch{for(var o=t.match(Tt)||[],l=1;l<o.length;l++)t=Me(o,l).join(""),o=t.match(Tt)||[];return t}}function js(t){for(var o={"%FE%FF":"��","%FF%FE":"��"},l=Dt.exec(t);l;){try{o[l[0]]=decodeURIComponent(l[0])}catch{var p=Cs(l[0]);p!==l[0]&&(o[l[0]]=p)}l=Dt.exec(t)}o["%C2"]="�";for(var d=Object.keys(o),h=0;h<d.length;h++){var S=d[h];t=t.replace(new RegExp(S,"g"),o[S])}return t}var Ss=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return js(t)}},ws=(t,o)=>{if(!(typeof t=="string"&&typeof o=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(o==="")return[t];const l=t.indexOf(o);return l===-1?[t]:[t.slice(0,l),t.slice(l+o.length)]},Ps=function(t,o){for(var l={},p=Object.keys(t),d=Array.isArray(o),h=0;h<p.length;h++){var S=p[h],f=t[S];(d?o.indexOf(S)!==-1:o(S,f,t))&&(l[S]=f)}return l};(function(t){const o=bs,l=Ss,p=ws,d=Ps,h=n=>n==null;function S(n){switch(n.arrayFormat){case"index":return s=>(r,c)=>{const y=r.length;return c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,[g(s,n),"[",y,"]"].join("")]:[...r,[g(s,n),"[",g(y,n),"]=",g(c,n)].join("")]};case"bracket":return s=>(r,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,[g(s,n),"[]"].join("")]:[...r,[g(s,n),"[]=",g(c,n)].join("")];case"comma":case"separator":return s=>(r,c)=>c==null||c.length===0?r:r.length===0?[[g(s,n),"=",g(c,n)].join("")]:[[r,g(c,n)].join(n.arrayFormatSeparator)];default:return s=>(r,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,g(s,n)]:[...r,[g(s,n),"=",g(c,n)].join("")]}}function f(n){let s;switch(n.arrayFormat){case"index":return(r,c,y)=>{if(s=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),!s){y[r]=c;return}y[r]===void 0&&(y[r]={}),y[r][s[1]]=c};case"bracket":return(r,c,y)=>{if(s=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),!s){y[r]=c;return}if(y[r]===void 0){y[r]=[c];return}y[r]=[].concat(y[r],c)};case"comma":case"separator":return(r,c,y)=>{const x=typeof c=="string"&&c.includes(n.arrayFormatSeparator),w=typeof c=="string"&&!x&&i(c,n).includes(n.arrayFormatSeparator);c=w?i(c,n):c;const U=x||w?c.split(n.arrayFormatSeparator).map(F=>i(F,n)):c===null?c:i(c,n);y[r]=U};default:return(r,c,y)=>{if(y[r]===void 0){y[r]=c;return}y[r]=[].concat(y[r],c)}}}function b(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function g(n,s){return s.encode?s.strict?o(n):encodeURIComponent(n):n}function i(n,s){return s.decode?l(n):n}function T(n){return Array.isArray(n)?n.sort():typeof n=="object"?T(Object.keys(n)).sort((s,r)=>Number(s)-Number(r)).map(s=>n[s]):n}function C(n){const s=n.indexOf("#");return s!==-1&&(n=n.slice(0,s)),n}function k(n){let s="";const r=n.indexOf("#");return r!==-1&&(s=n.slice(r)),s}function a(n){n=C(n);const s=n.indexOf("?");return s===-1?"":n.slice(s+1)}function I(n,s){return s.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?n=Number(n):s.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")&&(n=n.toLowerCase()==="true"),n}function m(n,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),b(s.arrayFormatSeparator);const r=f(s),c=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n))return c;for(const y of n.split("&")){if(y==="")continue;let[x,w]=p(s.decode?y.replace(/\+/g," "):y,"=");w=w===void 0?null:["comma","separator"].includes(s.arrayFormat)?w:i(w,s),r(i(x,s),w,c)}for(const y of Object.keys(c)){const x=c[y];if(typeof x=="object"&&x!==null)for(const w of Object.keys(x))x[w]=I(x[w],s);else c[y]=I(x,s)}return s.sort===!1?c:(s.sort===!0?Object.keys(c).sort():Object.keys(c).sort(s.sort)).reduce((y,x)=>{const w=c[x];return w&&typeof w=="object"&&!Array.isArray(w)?y[x]=T(w):y[x]=w,y},Object.create(null))}t.extract=a,t.parse=m,t.stringify=(n,s)=>{if(!n)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),b(s.arrayFormatSeparator);const r=w=>s.skipNull&&h(n[w])||s.skipEmptyString&&n[w]==="",c=S(s),y={};for(const w of Object.keys(n))r(w)||(y[w]=n[w]);const x=Object.keys(y);return s.sort!==!1&&x.sort(s.sort),x.map(w=>{const U=n[w];return U===void 0?"":U===null?g(w,s):Array.isArray(U)?U.reduce(c(w),[]).join("&"):g(w,s)+"="+g(U,s)}).filter(w=>w.length>0).join("&")},t.parseUrl=(n,s)=>{s=Object.assign({decode:!0},s);const[r,c]=p(n,"#");return Object.assign({url:r.split("?")[0]||"",query:m(a(n),s)},s&&s.parseFragmentIdentifier&&c?{fragmentIdentifier:i(c,s)}:{})},t.stringifyUrl=(n,s)=>{s=Object.assign({encode:!0,strict:!0},s);const r=C(n.url).split("?")[0]||"",c=t.extract(n.url),y=t.parse(c,{sort:!1}),x=Object.assign(y,n.query);let w=t.stringify(x,s);w&&(w=`?${w}`);let U=k(n.url);return n.fragmentIdentifier&&(U=`#${g(n.fragmentIdentifier,s)}`),`${r}${w}${U}`},t.pick=(n,s,r)=>{r=Object.assign({parseFragmentIdentifier:!0},r);const{url:c,query:y,fragmentIdentifier:x}=t.parseUrl(n,r);return t.stringifyUrl({url:c,query:d(y,s),fragmentIdentifier:x},r)},t.exclude=(n,s,r)=>{const c=Array.isArray(s)?y=>!s.includes(y):(y,x)=>!s(y,x);return t.pick(n,c,r)}})(Ce);const le=bn,ks={parseNumbers:!1,parseBooleans:!1},Is={skipNull:!1,skipEmptyString:!1},Ts=(t,o)=>{var l,p;const{navigateMode:d="push",parseOptions:h,stringifyOptions:S}={},f=Object.assign(Object.assign({},ks),h),b=Object.assign(Object.assign({},Is),S),g=le.useLocation(),i=(l=le.useHistory)===null||l===void 0?void 0:l.call(le),T=(p=le.useNavigate)===null||p===void 0?void 0:p.call(le),C=is(),k=P.useRef(typeof t=="function"?t():t||{}),a=P.useMemo(()=>Ce.parse(g.search,f),[g.search]),I=P.useMemo(()=>Object.assign(Object.assign({},k.current),a),[a]);return[I,He(n=>{const s=typeof n=="function"?n(I):n;C(),i&&i[d]({hash:g.hash,search:Ce.stringify(Object.assign(Object.assign({},a),s),b)||"?"},g.state),T&&T({hash:g.hash,search:Ce.stringify(Object.assign(Object.assign({},a),s),b)||"?"},{replace:d==="replace",state:g.state})})]},Ds=Ts,As=Ft,Ne=Nn,Ue=Un,Rs=ds,At={role:As.types.RoleType.ROLE_APPLICATION},Ls=(t,o,l,p)=>{let d=l||At;const h=(0,Ue.isEthereumType)((0,Ue.DidType)(l));if(h?d=(0,Ne.WalletType)(l):d=(0,Ne.WalletType)(At),!(0,Ue.isValid)(t)){let S="";try{return h?S=t.slice(0,66):S=t,(0,Ne.fromSecretKey)(S,d)}catch(f){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${f.message}`)}}if(!o)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,Rs.fromAppDid)(t,o,d,p||0)};var Es=Ls,tn=wt&&wt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const ce=tn(Xn),Os=Ft,ve=tn(Es),Ns=es,Us=(t,o,{returnWallet:l=!0}={})=>{var F,A;if(!t||typeof t!="object"||!Array.isArray(t.environments)||!(0,ce.default)(t,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:p,configs:d=[]}=t,h=[...d,...p],S=h.find(D=>D.key==="BLOCKLET_APP_DESCRIPTION"),f=h.find(D=>D.key==="BLOCKLET_PASSPORT_COLOR"),b=h.find(D=>D.key==="BLOCKLET_APP_URL"),g=h.find(D=>D.key==="BLOCKLET_APP_TENANT_MODE"),{did:i,version:T}=t.meta,C=(0,Ns.getDisplayName)(t),k=(0,ce.default)(S,"value",t.meta.description),a=(0,ce.default)(f,"value","auto"),I=(0,ce.default)(b,"value",""),m=(0,ce.default)(g,"value","");if(!l)return{did:i,version:T,name:C,description:k,passportColor:a,appUrl:I,secret:"",wallet:null,permanentWallet:null,tenantMode:m};const n=h.find(D=>D.key==="BLOCKLET_APP_SK"),s=h.find(D=>D.key==="BLOCKLET_APP_CHAIN_TYPE")||h.find(D=>D.key==="BLOCKLET_WALLET_TYPE"),r=h.find(D=>D.key==="BLOCKLET_APP_PSK");let c;s&&(s.value==="ethereum"||s.value==="eth")&&(c=s.value);let y=null,x=null;if(n&&n.value)y=(0,ve.default)(n.value,void 0,c),r&&r.value&&r.value!==n.value&&(x=(0,ve.default)(r.value,void 0,c));else{if(!o||typeof o!="string")throw new Error("Node secret key must be a string");s?y=(0,ve.default)(t.meta.did,o,c):y=(0,ve.default)(t.meta.did,o)}const w=((A=(F=t.settings)==null?void 0:F.session)==null?void 0:A.salt)||"",U=Os.Hasher.SHA3.hash256(Pt.concat([y.secretKey,y.address,w].filter(Boolean).map(D=>Pt.from(D))));return{did:i,version:T,name:C,description:k,passportColor:a,appUrl:I,secret:U,wallet:y,permanentWallet:x||y,tenantMode:m}};var _s=Us;const Bs=Cn(_s);function Qe({teamDid:t,roles:o,apps:l,onCancel:p,onSuccess:d,onError:h,endpoint:S}){var I;const{api:f}=H(),{t:b,locale:g}=K(),i=Ve({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:l.length>0?l[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),T=async()=>{if(!i.role){i.error=b("team.member.error.passportEmpty");return}const m=i.remark.trim();i.error=null,i.loading=!0;try{let n=i.sourceAppPid??null;n===t&&(n=null);const s={teamDid:t,role:i.role,remark:m,sourceAppPid:n,passportExpireTime:i.passportExpireTime?i.passportExpireTime.toISOString():""};i.display&&(s.display={type:"url",content:i.display});const{inviteInfo:r}=await f.createMemberInvitation({input:s});i.inviteInfo=r,i.activeStep=1}catch(n){const s=ee(n);i.error=s,h(n)}finally{i.loading=!1}},C=o.find(m=>m.name===i.role),a=[{body:e.jsxs(O,{sx:{display:"flex",flexDirection:"column",gap:3},children:[l.length>1?e.jsxs(Be,{fullWidth:!0,children:[e.jsx(Fe,{children:b("common.sourceApp")}),e.jsx($e,{value:i.sourceAppPid,onChange:m=>{i.error=null,i.sourceAppPid=m.target.value},fullWidth:!0,label:b("common.passport"),disabled:i.loading,children:l.map(m=>e.jsx(je,{value:m.appPid,children:e.jsxs(O,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(_n,{did:m.appPid,size:28}),m.appName]}),e.jsx(Bn,{did:m.appPid,compact:!0,responsive:!1})]})},m.appPid))})]}):null,e.jsxs(Be,{fullWidth:!0,variant:"outlined",children:[e.jsx(Fe,{children:b("common.passport")}),e.jsx($e,{"data-cy":"invite-member-select-role",value:i.role,onChange:m=>{i.error=null,i.role=m.target.value},fullWidth:!0,label:b("common.passport"),disabled:i.loading,onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),T())},children:o.filter(m=>m.name!=="owner").map(m=>e.jsx(je,{value:m.name,"data-cy":`invite-member-select-option-${m.name}`,children:e.jsxs(O,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(G,{variant:"subtitle1",children:m.title||m.name}),e.jsx(G,{variant:"caption",sx:{opacity:.7},children:m.description})]})},m.name))})]}),((I=C==null?void 0:C.extra)==null?void 0:I.display)==="custom"&&e.jsx(me,{label:b("common.display"),type:"url",value:i.display,onChange:m=>{i.error=null,i.display=m.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(me,{label:b("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.remark,onChange:m=>{i.error=null,i.remark=m.target.value},disabled:i.loading,"data-cy":"invite-member-input-remark"}),e.jsx(Yt,{value:i.passportExpireTime,onChange:m=>{i.passportExpireTime=m}})]}),cancel:b("common.cancel"),confirm:b("team.member.inviteDialog.createInviteLink"),onCancel:p,onConfirm:T},{body:()=>{var n,s;const m=we({inviteId:(n=i.inviteInfo)==null?void 0:n.inviteId,endpoint:S});return e.jsxs("div",{children:[e.jsx(O,{sx:{fontSize:16,fontWeight:"bold"},children:b("team.member.inviteDialog.createSuccessTip",{expireDate:pe((s=i.inviteInfo)==null?void 0:s.expireDate,g)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Te,{children:m})]})},confirm:b("common.copy"),onConfirm:()=>{var n;const m=we({inviteId:(n=i.inviteInfo)==null?void 0:n.inviteId,endpoint:S});as(m),Y.success(b("common.copied")),d()},cancel:b("common.cancel"),onCancel:p}][i.activeStep];return e.jsxs(ne,{title:b("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[a.cancel&&e.jsx(W,{onClick:a.onCancel,color:"inherit",children:a.cancel}),e.jsxs(W,{onClick:a.onConfirm,color:"primary",disabled:i.loading||!i.role,variant:"contained",autoFocus:!0,children:[i.loading&&e.jsx(ie,{size:16}),a.confirm]})]}),children:[e.jsx(qe,{component:"div",children:typeof a.body=="function"?a.body():a.body}),!!i.error&&e.jsx(oe,{severity:"error",variant:"icon",children:i.error})]})}Qe.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,roles:v.array,apps:v.array,endpoint:v.string};Qe.defaultProps={onError:()=>{},roles:[],apps:[],endpoint:""};function Je({teamDid:t,onCancel:o,onSuccess:l,onError:p,endpoint:d}){const{api:h,info:S}=H(),{api:f}=P.useContext(Fn),[b,g]=P.useState(!1),{t:i,locale:T}=K(),[C,k]=P.useState(""),[a,I]=P.useState(!1),[m,n]=P.useState(0),[s,r]=P.useState(""),[c,y]=P.useState(""),x=!!We(S,"ownerNft.did"),w=ms(async()=>{if(x){const{state:R}=await h.getDelegationState();return R}return{delegated:!0}});if(w.loading)return e.jsx(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:o,children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ie,{})})});if(w.error)return e.jsx(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:o,children:e.jsx(oe,{severity:"error",variant:"icon",children:ee(w.error)})});const U=async()=>{k(null),g(!0);try{const{inviteInfo:R}=await h.createTransferInvitation({input:{teamDid:t,role:"owner",remark:c.trim()}});r(R),n(D.length-1)}catch(R){const V=ee(R);k(V),p(R)}finally{g(!1)}},F=()=>{I(!0),n(1)},A=()=>{I(!1),n(0)},D=[{body:e.jsxs(G,{component:"div",children:[e.jsxs(oe,{severity:"warning",children:[e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.progress")}),e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),e.jsx(oe,{severity:"warning",children:e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.revoke")})}),e.jsx("div",{style:{marginTop:20,marginBottom:10}}),e.jsx(me,{label:i("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:c,onChange:R=>{k(null),y(R.target.value)},disabled:b,"data-cy":"transfer-node-input-remark"}),e.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:i("common.cancel"),confirm:i("team.transferNode.inviteDialog.createInviteLink"),onCancel:o,onConfirm:x&&!We(w,"value.delegated")?F:U},{body:()=>e.jsx($n,{action:"delegate-transfer-nft",open:a,locale:T,checkFn:f.get,onClose:A,onSuccess:U,checkTimeout:5*60*1e3,webWalletUrl:ts(S),extraParams:{targetDID:S.did},messages:{title:i("team.transferNode.delegateDialog.title"),scan:i("team.transferNode.delegateDialog.scan"),confirm:i("team.transferNode.delegateDialog.confirm"),success:i("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const R=we({inviteId:s.inviteId,endpoint:d});return e.jsxs("div",{children:[e.jsx(Fs,{children:i("team.transferNode.inviteDialog.createSuccessTip",{expireDate:pe(s.expireDate,T)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Te,{children:R})]})},confirm:i("common.confirm"),onConfirm:l}],E=D[m];return e.jsxs(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[E.cancel&&e.jsx(W,{onClick:E.onCancel,color:"inherit",children:E.cancel}),e.jsxs(W,{onClick:E.onConfirm,color:"primary",disabled:b,variant:"contained",autoFocus:!0,children:[b&&e.jsx(ie,{size:16}),E.confirm]})]}),children:[e.jsx(qe,{component:"div",children:typeof E.body=="function"?E.body():E.body}),!!C&&e.jsx(oe,{severity:"error",variant:"icon",children:C})]})}Je.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,endpoint:v.string};Je.defaultProps={onError:()=>{},endpoint:""};const Fs=z.div`
1
+ import{r as P,t as bn,g as Cn,e as wt,a as jn}from"./vendor-react-DEoibe3W.js";import{a9 as Ut,j as e,aa as O,bo as Be,br as Fe,bn as $e,q as je,T as G,O as me,ab as ie,bx as qe,ak as oe,H as v,ah as z,e as Sn,ad as ue,w as wn,y as _t,b7 as Pn,b8 as kn,I as In,bh as Tn,bs as Dn,bR as An}from"./vendor-mui-core-Bq8gXTan.js";import{B as Pt,e as We,a0 as Rn,ay as Ln,n as kt,A as En,b as On}from"./vendor-utils-BfZ4tlod.js";import{r as Bt,aR as Ft,bL as Nn,i as Un,a as K,a2 as _n,a1 as Bn,a3 as Y,ar as ne,B as W,f as Fn,at as $n,d as Wn,bb as fe,bC as zn,k as Q,a5 as $t,an as Mn,br as Wt,bs as zt,bt as qn,I as Hn,ax as Vn,$ as ze,bd as Kn,ac as Mt,ab as qt,bI as Zn}from"./vendor-ux-did-connect-pzpsrvqx.js";import{c as J,a as Yn,G as Ht,v as Se,n as Gn,I as Qn}from"./vendor-arcblock-CwufDgLV.js";import{d as Jn}from"./ViewList-BOGcbymi.js";import{a2 as Xn,f as es,D as H,ay as we,n as pe,a3 as ts,V as se,az as ns,G as Vt,aA as Kt,y as ss,b as rs,aB as os}from"./index-CwUT0vPy.js";import{k as is,u as He,a as Ve,c as as,m as ls,b as cs}from"./vendor-hooks-DqdmWCmo.js";import{l as ds}from"./index-BLfUtUpB.js";import{u as Z,d as It,W as Zt}from"./dashboard-t9EszOna.js";import{W as Ke}from"./did-address-NnOD1W_A.js";import{P as X}from"./permission-DQvXGutX.js";import{C as Te}from"./click-to-copy-By4fgGR7.js";import{T as Yt}from"./index-DrTNV3tX.js";import{f as ee}from"./index-8eXqqyHQ.js";import{_ as ms}from"./useAsync-C62uE2pS.js";import{I as q}from"./index-DPIWnhb5.js";import{d as us}from"./DeleteOutline-BKSMNwfT.js";import{C as ge}from"./confirm-RvA9mFot.js";import{u as he}from"./session-BGdAM8zS.js";import{i as Gt,a as Pe,p as Qt}from"./util-BQAJqeb4.js";import{b as ps}from"./sdk-BmeKtHic.js";import{A as fs}from"./actions-DnTVXQ_Z.js";import{S as gs}from"./shorten-label-BQvbtscf.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CaPDqrQ7.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-D5KSEAKZ.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./InfoOutlined-BVWbftGI.js";import"./dot-4jhL56kz.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";import"./vendor-mui-x-1nqAyytV.js";import"./AdapterDayjs-BRnJ9bMs.js";import"./base32-DUSifB4M.js";import"./MoreHoriz-ChJ3K52h.js";var Ze={},hs=Ut;Object.defineProperty(Ze,"__esModule",{value:!0});var Jt=Ze.default=void 0,xs=hs(Bt()),ys=e;Jt=Ze.default=(0,xs.default)((0,ys.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var Ye=function(t){return e.jsxs("svg",{...t,children:[e.jsx("g",{clipPath:"url(#clip0)",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0",children:e.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};Ye.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};Ye.displayName="person";const vs=Ye;var Ge=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};Ge.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};Ge.displayName="external-issuer";const Xt=Ge;var Ce={},bs=t=>encodeURIComponent(t).replace(/[!'()*]/g,o=>`%${o.charCodeAt(0).toString(16).toUpperCase()}`),en="%[a-f0-9]{2}",Tt=new RegExp("("+en+")|([^%]+?)","gi"),Dt=new RegExp("("+en+")+","gi");function Me(t,o){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;o=o||1;var l=t.slice(0,o),p=t.slice(o);return Array.prototype.concat.call([],Me(l),Me(p))}function Cs(t){try{return decodeURIComponent(t)}catch{for(var o=t.match(Tt)||[],l=1;l<o.length;l++)t=Me(o,l).join(""),o=t.match(Tt)||[];return t}}function js(t){for(var o={"%FE%FF":"��","%FF%FE":"��"},l=Dt.exec(t);l;){try{o[l[0]]=decodeURIComponent(l[0])}catch{var p=Cs(l[0]);p!==l[0]&&(o[l[0]]=p)}l=Dt.exec(t)}o["%C2"]="�";for(var d=Object.keys(o),h=0;h<d.length;h++){var S=d[h];t=t.replace(new RegExp(S,"g"),o[S])}return t}var Ss=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return js(t)}},ws=(t,o)=>{if(!(typeof t=="string"&&typeof o=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(o==="")return[t];const l=t.indexOf(o);return l===-1?[t]:[t.slice(0,l),t.slice(l+o.length)]},Ps=function(t,o){for(var l={},p=Object.keys(t),d=Array.isArray(o),h=0;h<p.length;h++){var S=p[h],f=t[S];(d?o.indexOf(S)!==-1:o(S,f,t))&&(l[S]=f)}return l};(function(t){const o=bs,l=Ss,p=ws,d=Ps,h=n=>n==null;function S(n){switch(n.arrayFormat){case"index":return s=>(r,c)=>{const y=r.length;return c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,[g(s,n),"[",y,"]"].join("")]:[...r,[g(s,n),"[",g(y,n),"]=",g(c,n)].join("")]};case"bracket":return s=>(r,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,[g(s,n),"[]"].join("")]:[...r,[g(s,n),"[]=",g(c,n)].join("")];case"comma":case"separator":return s=>(r,c)=>c==null||c.length===0?r:r.length===0?[[g(s,n),"=",g(c,n)].join("")]:[[r,g(c,n)].join(n.arrayFormatSeparator)];default:return s=>(r,c)=>c===void 0||n.skipNull&&c===null||n.skipEmptyString&&c===""?r:c===null?[...r,g(s,n)]:[...r,[g(s,n),"=",g(c,n)].join("")]}}function f(n){let s;switch(n.arrayFormat){case"index":return(r,c,y)=>{if(s=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),!s){y[r]=c;return}y[r]===void 0&&(y[r]={}),y[r][s[1]]=c};case"bracket":return(r,c,y)=>{if(s=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),!s){y[r]=c;return}if(y[r]===void 0){y[r]=[c];return}y[r]=[].concat(y[r],c)};case"comma":case"separator":return(r,c,y)=>{const x=typeof c=="string"&&c.includes(n.arrayFormatSeparator),w=typeof c=="string"&&!x&&i(c,n).includes(n.arrayFormatSeparator);c=w?i(c,n):c;const U=x||w?c.split(n.arrayFormatSeparator).map(F=>i(F,n)):c===null?c:i(c,n);y[r]=U};default:return(r,c,y)=>{if(y[r]===void 0){y[r]=c;return}y[r]=[].concat(y[r],c)}}}function b(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function g(n,s){return s.encode?s.strict?o(n):encodeURIComponent(n):n}function i(n,s){return s.decode?l(n):n}function T(n){return Array.isArray(n)?n.sort():typeof n=="object"?T(Object.keys(n)).sort((s,r)=>Number(s)-Number(r)).map(s=>n[s]):n}function C(n){const s=n.indexOf("#");return s!==-1&&(n=n.slice(0,s)),n}function k(n){let s="";const r=n.indexOf("#");return r!==-1&&(s=n.slice(r)),s}function a(n){n=C(n);const s=n.indexOf("?");return s===-1?"":n.slice(s+1)}function I(n,s){return s.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?n=Number(n):s.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")&&(n=n.toLowerCase()==="true"),n}function m(n,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),b(s.arrayFormatSeparator);const r=f(s),c=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n))return c;for(const y of n.split("&")){if(y==="")continue;let[x,w]=p(s.decode?y.replace(/\+/g," "):y,"=");w=w===void 0?null:["comma","separator"].includes(s.arrayFormat)?w:i(w,s),r(i(x,s),w,c)}for(const y of Object.keys(c)){const x=c[y];if(typeof x=="object"&&x!==null)for(const w of Object.keys(x))x[w]=I(x[w],s);else c[y]=I(x,s)}return s.sort===!1?c:(s.sort===!0?Object.keys(c).sort():Object.keys(c).sort(s.sort)).reduce((y,x)=>{const w=c[x];return w&&typeof w=="object"&&!Array.isArray(w)?y[x]=T(w):y[x]=w,y},Object.create(null))}t.extract=a,t.parse=m,t.stringify=(n,s)=>{if(!n)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),b(s.arrayFormatSeparator);const r=w=>s.skipNull&&h(n[w])||s.skipEmptyString&&n[w]==="",c=S(s),y={};for(const w of Object.keys(n))r(w)||(y[w]=n[w]);const x=Object.keys(y);return s.sort!==!1&&x.sort(s.sort),x.map(w=>{const U=n[w];return U===void 0?"":U===null?g(w,s):Array.isArray(U)?U.reduce(c(w),[]).join("&"):g(w,s)+"="+g(U,s)}).filter(w=>w.length>0).join("&")},t.parseUrl=(n,s)=>{s=Object.assign({decode:!0},s);const[r,c]=p(n,"#");return Object.assign({url:r.split("?")[0]||"",query:m(a(n),s)},s&&s.parseFragmentIdentifier&&c?{fragmentIdentifier:i(c,s)}:{})},t.stringifyUrl=(n,s)=>{s=Object.assign({encode:!0,strict:!0},s);const r=C(n.url).split("?")[0]||"",c=t.extract(n.url),y=t.parse(c,{sort:!1}),x=Object.assign(y,n.query);let w=t.stringify(x,s);w&&(w=`?${w}`);let U=k(n.url);return n.fragmentIdentifier&&(U=`#${g(n.fragmentIdentifier,s)}`),`${r}${w}${U}`},t.pick=(n,s,r)=>{r=Object.assign({parseFragmentIdentifier:!0},r);const{url:c,query:y,fragmentIdentifier:x}=t.parseUrl(n,r);return t.stringifyUrl({url:c,query:d(y,s),fragmentIdentifier:x},r)},t.exclude=(n,s,r)=>{const c=Array.isArray(s)?y=>!s.includes(y):(y,x)=>!s(y,x);return t.pick(n,c,r)}})(Ce);const le=bn,ks={parseNumbers:!1,parseBooleans:!1},Is={skipNull:!1,skipEmptyString:!1},Ts=(t,o)=>{var l,p;const{navigateMode:d="push",parseOptions:h,stringifyOptions:S}={},f=Object.assign(Object.assign({},ks),h),b=Object.assign(Object.assign({},Is),S),g=le.useLocation(),i=(l=le.useHistory)===null||l===void 0?void 0:l.call(le),T=(p=le.useNavigate)===null||p===void 0?void 0:p.call(le),C=is(),k=P.useRef(typeof t=="function"?t():t||{}),a=P.useMemo(()=>Ce.parse(g.search,f),[g.search]),I=P.useMemo(()=>Object.assign(Object.assign({},k.current),a),[a]);return[I,He(n=>{const s=typeof n=="function"?n(I):n;C(),i&&i[d]({hash:g.hash,search:Ce.stringify(Object.assign(Object.assign({},a),s),b)||"?"},g.state),T&&T({hash:g.hash,search:Ce.stringify(Object.assign(Object.assign({},a),s),b)||"?"},{replace:d==="replace",state:g.state})})]},Ds=Ts,As=Ft,Ne=Nn,Ue=Un,Rs=ds,At={role:As.types.RoleType.ROLE_APPLICATION},Ls=(t,o,l,p)=>{let d=l||At;const h=(0,Ue.isEthereumType)((0,Ue.DidType)(l));if(h?d=(0,Ne.WalletType)(l):d=(0,Ne.WalletType)(At),!(0,Ue.isValid)(t)){let S="";try{return h?S=t.slice(0,66):S=t,(0,Ne.fromSecretKey)(S,d)}catch(f){throw new Error(`Cannot get blocklet wallet with invalid blocklet did or custom sk: ${f.message}`)}}if(!o)throw new Error("Cannot get blocklet wallet with empty node sk");return(0,Rs.fromAppDid)(t,o,d,p||0)};var Es=Ls,tn=wt&&wt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const ce=tn(Xn),Os=Ft,ve=tn(Es),Ns=es,Us=(t,o,{returnWallet:l=!0}={})=>{var F,A;if(!t||typeof t!="object"||!Array.isArray(t.environments)||!(0,ce.default)(t,"meta.did"))throw new Error("Blocklet state must be an object");const{environments:p,configs:d=[]}=t,h=[...d,...p],S=h.find(D=>D.key==="BLOCKLET_APP_DESCRIPTION"),f=h.find(D=>D.key==="BLOCKLET_PASSPORT_COLOR"),b=h.find(D=>D.key==="BLOCKLET_APP_URL"),g=h.find(D=>D.key==="BLOCKLET_APP_TENANT_MODE"),{did:i,version:T}=t.meta,C=(0,Ns.getDisplayName)(t),k=(0,ce.default)(S,"value",t.meta.description),a=(0,ce.default)(f,"value","auto"),I=(0,ce.default)(b,"value",""),m=(0,ce.default)(g,"value","");if(!l)return{did:i,version:T,name:C,description:k,passportColor:a,appUrl:I,secret:"",wallet:null,permanentWallet:null,tenantMode:m};const n=h.find(D=>D.key==="BLOCKLET_APP_SK"),s=h.find(D=>D.key==="BLOCKLET_APP_CHAIN_TYPE")||h.find(D=>D.key==="BLOCKLET_WALLET_TYPE"),r=h.find(D=>D.key==="BLOCKLET_APP_PSK");let c;s&&(s.value==="ethereum"||s.value==="eth")&&(c=s.value);let y=null,x=null;if(n&&n.value)y=(0,ve.default)(n.value,void 0,c),r&&r.value&&r.value!==n.value&&(x=(0,ve.default)(r.value,void 0,c));else{if(!o||typeof o!="string")throw new Error("Node secret key must be a string");s?y=(0,ve.default)(t.meta.did,o,c):y=(0,ve.default)(t.meta.did,o)}const w=((A=(F=t.settings)==null?void 0:F.session)==null?void 0:A.salt)||"",U=Os.Hasher.SHA3.hash256(Pt.concat([y.secretKey,y.address,w].filter(Boolean).map(D=>Pt.from(D))));return{did:i,version:T,name:C,description:k,passportColor:a,appUrl:I,secret:U,wallet:y,permanentWallet:x||y,tenantMode:m}};var _s=Us;const Bs=Cn(_s);function Qe({teamDid:t,roles:o,apps:l,onCancel:p,onSuccess:d,onError:h,endpoint:S}){var I;const{api:f}=H(),{t:b,locale:g}=K(),i=Ve({loading:!1,error:null,activeStep:0,inviteInfo:null,role:"",remark:"",sourceAppPid:l.length>0?l[0].appPid:null,display:null,passportExpireTime:null,showPicker:!1}),T=async()=>{if(!i.role){i.error=b("team.member.error.passportEmpty");return}const m=i.remark.trim();i.error=null,i.loading=!0;try{let n=i.sourceAppPid??null;n===t&&(n=null);const s={teamDid:t,role:i.role,remark:m,sourceAppPid:n,passportExpireTime:i.passportExpireTime?i.passportExpireTime.toISOString():""};i.display&&(s.display={type:"url",content:i.display});const{inviteInfo:r}=await f.createMemberInvitation({input:s});i.inviteInfo=r,i.activeStep=1}catch(n){const s=ee(n);i.error=s,h(n)}finally{i.loading=!1}},C=o.find(m=>m.name===i.role),a=[{body:e.jsxs(O,{sx:{display:"flex",flexDirection:"column",gap:3},children:[l.length>1?e.jsxs(Be,{fullWidth:!0,children:[e.jsx(Fe,{children:b("common.sourceApp")}),e.jsx($e,{value:i.sourceAppPid,onChange:m=>{i.error=null,i.sourceAppPid=m.target.value},fullWidth:!0,label:b("common.passport"),disabled:i.loading,children:l.map(m=>e.jsx(je,{value:m.appPid,children:e.jsxs(O,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[e.jsxs(O,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(_n,{did:m.appPid,size:28}),m.appName]}),e.jsx(Bn,{did:m.appPid,compact:!0,responsive:!1})]})},m.appPid))})]}):null,e.jsxs(Be,{fullWidth:!0,variant:"outlined",children:[e.jsx(Fe,{children:b("common.passport")}),e.jsx($e,{"data-cy":"invite-member-select-role",value:i.role,onChange:m=>{i.error=null,i.role=m.target.value},fullWidth:!0,label:b("common.passport"),disabled:i.loading,onKeyPress:m=>{m.key==="Enter"&&(m.preventDefault(),T())},children:o.filter(m=>m.name!=="owner").map(m=>e.jsx(je,{value:m.name,"data-cy":`invite-member-select-option-${m.name}`,children:e.jsxs(O,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(G,{variant:"subtitle1",children:m.title||m.name}),e.jsx(G,{variant:"caption",sx:{opacity:.7},children:m.description})]})},m.name))})]}),((I=C==null?void 0:C.extra)==null?void 0:I.display)==="custom"&&e.jsx(me,{label:b("common.display"),type:"url",value:i.display,onChange:m=>{i.error=null,i.display=m.target.value},fullWidth:!0,variant:"outlined",margin:"normal"}),e.jsx(me,{label:b("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.remark,onChange:m=>{i.error=null,i.remark=m.target.value},disabled:i.loading,"data-cy":"invite-member-input-remark"}),e.jsx(Yt,{value:i.passportExpireTime,onChange:m=>{i.passportExpireTime=m}})]}),cancel:b("common.cancel"),confirm:b("team.member.inviteDialog.createInviteLink"),onCancel:p,onConfirm:T},{body:()=>{var n,s;const m=we({inviteId:(n=i.inviteInfo)==null?void 0:n.inviteId,endpoint:S});return e.jsxs("div",{children:[e.jsx(O,{sx:{fontSize:16,fontWeight:"bold"},children:b("team.member.inviteDialog.createSuccessTip",{expireDate:pe((s=i.inviteInfo)==null?void 0:s.expireDate,g)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Te,{children:m})]})},confirm:b("common.copy"),onConfirm:()=>{var n;const m=we({inviteId:(n=i.inviteInfo)==null?void 0:n.inviteId,endpoint:S});as(m),Y.success(b("common.copied")),d()},cancel:b("common.cancel"),onCancel:p}][i.activeStep];return e.jsxs(ne,{title:b("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[a.cancel&&e.jsx(W,{onClick:a.onCancel,color:"inherit",children:a.cancel}),e.jsxs(W,{onClick:a.onConfirm,color:"primary",disabled:i.loading||!i.role,variant:"contained",autoFocus:!0,children:[i.loading&&e.jsx(ie,{size:16}),a.confirm]})]}),children:[e.jsx(qe,{component:"div",children:typeof a.body=="function"?a.body():a.body}),!!i.error&&e.jsx(oe,{severity:"error",variant:"icon",children:i.error})]})}Qe.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,roles:v.array,apps:v.array,endpoint:v.string};Qe.defaultProps={onError:()=>{},roles:[],apps:[],endpoint:""};function Je({teamDid:t,onCancel:o,onSuccess:l,onError:p,endpoint:d}){const{api:h,info:S}=H(),{api:f}=P.useContext(Fn),[b,g]=P.useState(!1),{t:i,locale:T}=K(),[C,k]=P.useState(""),[a,I]=P.useState(!1),[m,n]=P.useState(0),[s,r]=P.useState(""),[c,y]=P.useState(""),x=!!We(S,"ownerNft.did"),w=ms(async()=>{if(x){const{state:R}=await h.getDelegationState();return R}return{delegated:!0}});if(w.loading)return e.jsx(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:o,children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(ie,{})})});if(w.error)return e.jsx(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:o,children:e.jsx(oe,{severity:"error",variant:"icon",children:ee(w.error)})});const U=async()=>{k(null),g(!0);try{const{inviteInfo:R}=await h.createTransferInvitation({input:{teamDid:t,role:"owner",remark:c.trim()}});r(R),n(D.length-1)}catch(R){const V=ee(R);k(V),p(R)}finally{g(!1)}},F=()=>{I(!0),n(1)},A=()=>{I(!1),n(0)},D=[{body:e.jsxs(G,{component:"div",children:[e.jsxs(oe,{severity:"warning",children:[e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.progress")}),e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),e.jsx(oe,{severity:"warning",children:e.jsx(G,{children:i("team.transferNode.inviteDialog.tips.revoke")})}),e.jsx("div",{style:{marginTop:20,marginBottom:10}}),e.jsx(me,{label:i("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:c,onChange:R=>{k(null),y(R.target.value)},disabled:b,"data-cy":"transfer-node-input-remark"}),e.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:i("common.cancel"),confirm:i("team.transferNode.inviteDialog.createInviteLink"),onCancel:o,onConfirm:x&&!We(w,"value.delegated")?F:U},{body:()=>e.jsx($n,{action:"delegate-transfer-nft",open:a,locale:T,checkFn:f.get,onClose:A,onSuccess:U,checkTimeout:5*60*1e3,webWalletUrl:ts(S),extraParams:{targetDID:S.did},messages:{title:i("team.transferNode.delegateDialog.title"),scan:i("team.transferNode.delegateDialog.scan"),confirm:i("team.transferNode.delegateDialog.confirm"),success:i("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const R=we({inviteId:s.inviteId,endpoint:d});return e.jsxs("div",{children:[e.jsx(Fs,{children:i("team.transferNode.inviteDialog.createSuccessTip",{expireDate:pe(s.expireDate,T)})}),e.jsx("div",{style:{marginTop:"40px"}}),e.jsx(Te,{children:R})]})},confirm:i("common.confirm"),onConfirm:l}],E=D[m];return e.jsxs(ne,{title:i("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[E.cancel&&e.jsx(W,{onClick:E.onCancel,color:"inherit",children:E.cancel}),e.jsxs(W,{onClick:E.onConfirm,color:"primary",disabled:b,variant:"contained",autoFocus:!0,children:[b&&e.jsx(ie,{size:16}),E.confirm]})]}),children:[e.jsx(qe,{component:"div",children:typeof E.body=="function"?E.body():E.body}),!!C&&e.jsx(oe,{severity:"error",variant:"icon",children:C})]})}Je.propTypes={teamDid:v.string.isRequired,onCancel:v.func.isRequired,onSuccess:v.func.isRequired,onError:v.func,endpoint:v.string};Je.defaultProps={onError:()=>{},endpoint:""};const Fs=z.div`
2
2
  font-size: 16px;
3
3
  font-weight: bold;
4
4
  `;var Xe=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),e.jsx("rect",{x:"12.5",y:"9.375",width:"7.5",height:"1.875",rx:"0.9375"})]})};Xe.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};Xe.displayName="forbid-login";const nn=Xe;var et=function(t){return e.jsxs("svg",{...t,children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),e.jsx("rect",{x:"12.5",y:"9.375",width:"7.5",height:"1.875",rx:"0.9375"}),e.jsx("rect",{x:"15.3125",y:"14.0625",width:"7.5",height:"1.875",rx:"0.9375",transform:"rotate(-90 15.3125 14.0625)"})]})};et.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};et.displayName="allow-login";const sn=et;function ke(t){const{passport:o,onDelete:l,...p}=t;return e.jsxs($s,{...p,children:[o.title||o.name," ",!!l&&e.jsx(Wn,{"data-cy":"delete-issuance",className:"delete",onClick:l})]})}ke.propTypes={passport:v.object.isRequired,onDelete:v.func};ke.defaultProps={onDelete:null};const $s=z.span`