@abtnode/blocklet-services 1.16.43-beta-20250427-132304-6da95c55 → 1.16.43-beta-20250427-232837-e671de06
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/access-control-B20P1UrY.js +1 -1
- package/dist/assets/add-component-core-DG9mQFsr.js +1 -1
- package/dist/assets/add-resource-BoS5YkVy.js +1 -1
- package/dist/assets/advanced-DTe2fs5L.js +1 -1
- package/dist/assets/audit-logs-CydL26ZC.js +1 -1
- package/dist/assets/branding-CAMtNLMU.js +1 -1
- package/dist/assets/complete-BzCBoyhn.js +1 -1
- package/dist/assets/component-5gjaNHCg.js +1 -1
- package/dist/assets/config-1xq1_d84.js +1 -1
- package/dist/assets/config-navigation-Dvjz9nAh.js +1 -1
- package/dist/assets/connect-Bbc2y5nS.js +1 -1
- package/dist/assets/dashboard-8QXGSoVu.js +2 -2
- package/dist/assets/domain-ag7_Ivc1.js +1 -1
- package/dist/assets/email-DKpgximx.js +1 -1
- package/dist/assets/exchange-passport-Izkf8qpM.js +1 -1
- package/dist/assets/fuel-CcBzY6Bt.js +1 -1
- package/dist/assets/index-BGgGfqEc.js +1 -1
- package/dist/assets/index-BnmeT4Bk.js +1 -1
- package/dist/assets/index-C8QMe2NL.js +1 -1
- package/dist/assets/index-DNG6b9sp.js +1 -1
- package/dist/assets/index-DO3_1y-L.js +1 -1
- package/dist/assets/index-DO4cSlUf.js +1 -1
- package/dist/assets/index-EnQ254k3.js +1 -1
- package/dist/assets/index-bb90BUf4.js +1 -1
- package/dist/assets/index-n0Q-fETi.js +1 -1
- package/dist/assets/index-slEV_y-C.js +1 -1
- package/dist/assets/invite-Cbz8B2uW.js +1 -1
- package/dist/assets/issue-passport-Dd_yyO08.js +1 -1
- package/dist/assets/item-nK3D7WH5.js +1 -1
- package/dist/assets/login-DjB23H9M.js +1 -1
- package/dist/assets/lost-passport-Do1Pl0xI.js +1 -1
- package/dist/assets/open-window-D8MZhu_7.js +1 -1
- package/dist/assets/overview-DLA9wj6a.js +1 -1
- package/dist/assets/publish-resource-BEc_A5mC.js +1 -1
- package/dist/assets/runtime-DXl0lfXF.js +1 -1
- package/dist/assets/security-BhkfG23R.js +1 -1
- package/dist/assets/setup-BmYxTt6Z.js +2 -2
- package/dist/assets/start-CVexuuAk.js +1 -1
- package/dist/assets/step-actions-D_1PFeFs.js +1 -1
- package/package.json +21 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as c,j as e,a9 as p,T as b,ac as V,y as X,aa as de}from"./vendor-mui-core-CQ38ohp2.js";import{d as pe,f as ue,u as fe,l as ge}from"./vendor-hooks-DftG_2gV.js";import{r as ee,f as me}from"./vendor-react-DEoibe3W.js";import{H as z}from"./vendor-arcblock-ScFEr-lj.js";import{y as E,b as R,x as he,H as we}from"./vendor-utils-BNHJB5U7.js";import{X as xe,W as ye,u as ne,a3 as $,o as Pe,aQ as ve,C as je,aR as Ie,j as W,ae as ke,ad as Ce,aS as be,Y as J,aT as Te,aU as _e,aV as Le,p as G}from"./vendor-ux-did-connect-BdkhddhO.js";import{u as Re}from"./use-passport-id-B-b-_oYF.js";import{g as Y}from"./get-safe-url-
|
|
1
|
+
import{H as c,j as e,a9 as p,T as b,ac as V,y as X,aa as de}from"./vendor-mui-core-CQ38ohp2.js";import{d as pe,f as ue,u as fe,l as ge}from"./vendor-hooks-DftG_2gV.js";import{r as ee,f as me}from"./vendor-react-DEoibe3W.js";import{H as z}from"./vendor-arcblock-ScFEr-lj.js";import{y as E,b as R,x as he,H as we}from"./vendor-utils-BNHJB5U7.js";import{X as xe,W as ye,u as ne,a3 as $,o as Pe,aQ as ve,C as je,aR as Ie,j as W,ae as ke,ad as Ce,aS as be,Y as J,aT as Te,aU as _e,aV as Le,p as G}from"./vendor-ux-did-connect-BdkhddhO.js";import{u as Re}from"./use-passport-id-B-b-_oYF.js";import{g as Y}from"./get-safe-url-DBsPGn--.js";import{u as We,s as Ae,a as Ee,b as Z}from"./index-DO3_1y-L.js";import{d as A}from"./logger-zix81YaM.js";import{d as Se}from"./LaunchOutlined-BV4_W1pb.js";import"./lottie-web-jYmAQWuC.js";function S({blocklet:s}){return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(xe,{variant:"rounded",shape:"square",did:s.appPid,src:s.appLogo,size:80}),e.jsx(b,{component:"h2",variant:"h6",children:s.appName}),e.jsx(ye,{did:s.appPid})]})}const Ue=ee.memo(S);S.propTypes={blocklet:c.shape({appName:c.string,appLogo:c.string,appPid:c.string})};S.defaultProps={blocklet:window.blocklet};const Ne=()=>{var r,i;const s=(i=(r=window.blocklet)==null?void 0:r.componentMountPoints)==null?void 0:i.find(m=>m.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk");return s==null?void 0:s.mountPoint};function U({children:s,cta:r,...i}){return e.jsxs(p,{...i,children:[s?e.jsx(p,{sx:{maxHeight:"50vh",overflow:"hidden",position:"relative",":after":{content:'""',position:"absolute",left:0,right:0,bottom:0,height:"80%",background:"linear-gradient(transparent, #fff 85%)"}},children:s}):null,r?e.jsx(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:r}):null]})}U.propTypes={children:c.node,cta:c.node};U.defaultProps={children:null,cta:null};function N({passports:s,onConnect:r,onClose:i,redirect:m,...T}){const{t:u}=ne(),x=Ne(),v=a=>{const g=a==null?void 0:a.payable;return x&&g?E(x,`/api/redirect/checkout/${g}?redirect=${m}`):null};return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",maxWidth:"400px",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsx(Ue,{}),e.jsx(U,{...T,cta:e.jsxs(e.Fragment,{children:[e.jsx(b,{variant:"h4",sx:{mx:2,textAlign:"center",fontWeight:"bold",color:"warning.main"},children:u("login.accessLimit.title")}),e.jsx(b,{variant:"body1",sx:{maxWidth:620,mt:2,mx:2,textAlign:"center",color:"gray"},children:u("login.accessLimit.description")}),e.jsx(p,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1,mt:5},children:s==null?void 0:s.map(a=>{const g=v(a);return g?e.jsx(V,{title:u("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx(X,{color:"primary",variant:"contained",endIcon:e.jsx(Se,{}),href:g,target:"_blank",children:a.title||a.name})},a.name):e.jsx(V,{title:u("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx(X,{color:"inherit",variant:"contained",onClick:r,children:a.title||a.name})},a.name)})}),e.jsxs(b,{variant:"body1",sx:{mt:2,color:"grey.400"},children:[e.jsx(p,{component:"span",sx:{display:"inline-block",mr:1},children:u("login.accessLimit.alreadyHavePassport")}),e.jsx(p,{component:"span",sx:{textDecoration:"underline",cursor:"pointer",color:"primary.main"},onClick:r,children:u("common.connect")})]})]})})]})}N.propTypes={passports:c.arrayOf(c.shape({name:c.string.isRequired,title:c.string,payable:c.string})),onConnect:c.func,onClose:c.func,redirect:c.string.isRequired};N.defaultProps={passports:[],onConnect:()=>{},onClose:()=>{}};function $e(){const s=ee.useRef(null),{session:r}=We(),{t:i,locale:m}=ne(),{getPassportId:T}=Re(),u=me(),x=$(),v=Pe(),{encryptKey:a,decrypt:g}=ve(),j=pe(r),{searchParams:t}=new URL(window.location.href),h={passportId:T()},D=t.get("componentId"),H=t.get("authenticated"),te=t.get("sessionToken"),oe=t.get("refreshToken"),ie=t.get("requiredRoles"),f=t.get("redirect"),d=t.get("forceConnected"),I=t.get("sourceAppPid"),_=t.get("origin"),q=t.get("autoConnectWebview"),F=t.get("popup"),K=t.get("showQuickConnect");let w=t.get("inviter");if(!w&&f)try{w=(f.startsWith("http")?new URL(f):new URL(f,window.location.origin)).searchParams.get("inviter")}catch{}w=w||localStorage.getItem("inviter"),D&&(h.componentId=D),x&&(h.visitorId=x),w&&(h.inviter=w),we(I)||(I==="null"?h.sourceAppPid=null:I!==null&&(h.sourceAppPid=I));let Q=[];try{Q=JSON.parse(ie)}catch{}const se=async n=>{const o=t.get("fromWallet");A("login page notifyWallet",{data:n,fromWallet:o,"browser.wallet":v.wallet}),n&&String(o)==="1"&&v.wallet&&await Promise.any([G.asyncCall("arcSetToken",n),Z(3e3)])},L=n=>t.get("encrypted")?g(n):n,B=async n=>{n&&await se(n),setTimeout(()=>{if(f){const o=decodeURIComponent(f);o.startsWith(W.WELLKNOWN_SERVICE_PATH_PREFIX)?u(o,{replace:!0}):window.location.replace(Y(o))}else window.location.replace(window.env.pathPrefix||"/")},50)},re=n=>{const o={did:n.user.did,host:window.location.host,appPid:window.blocklet.appPid,visitorId:$(),sourceAppPid:n.user.sourceAppPid,fullName:n.user.fullName};A("bridge callArc: onLogin",o),G.callArc("onLogin",o)},M=async(n,o)=>{const y=o(n.sessionToken),k=o(n.refreshToken),P=o(n.visitorId);A("login page onLogin",{result:n,decodeSessionToken:y,decodeRefreshToken:k,decodeVisitorId:P}),Ae(y),Ee(k),n.visitorId&&Te(P),await r.refresh(),await Z(100),re(j.current);const l={};t.get("saveConnect")?(l.connected_did=j.current.user.did,l.connected_pk=j.current.user.pk,l.connected_wallet_os=j.current.walletOS,l.connected_app=_e()):(l.connected_did=t.get("connected_did"),l.connected_pk=t.get("connected_pk"),l.connected_app=t.get("connected_app"),l.connected_wallet_os=t.get("connected_wallet_os")),Le(l,!0),B({sessionToken:y,refreshToken:k,visitorId:P})},ce=ue(()=>_==="switch-did"?d&&typeof d=="string"?{title:i("login.switchSpecifiedDid.title"),scan:i("login.switchSpecifiedDid.scan",{did:d}),confirm:i("login.switchSpecifiedDid.confirm"),success:i("login.switchSpecifiedDid.success")}:{title:i("login.switchDid.title"),scan:i("login.switchDid.scan"),confirm:i("login.switchDid.confirm"),success:i("login.switchDid.success")}:{title:i("login.connect.title"),scan:i("login.connect.scan"),confirm:i("login.connect.confirm"),success:i("login.connect.success")},[d,_,i]),O=fe(()=>{const n=window==null?void 0:window.blocklet,o={className:"connect",popup:!1,action:"login",passkeyBehavior:"both",onSuccess:M,onError:ae,locale:m,messages:ce,extraParams:h,baseUrl:window.location.origin,prefix:E(window.location.origin,W.WELLKNOWN_SERVICE_PATH_PREFIX,Ie)};d&&(o.forceConnected=d,o.extraParams.enableSwitchApp=!1,o.extraParams.forceConnected=d),o.options||(o.options={}),_==="switch-did"?o.options.showQuickConnect=!0:R(K)||([!1,"false"].includes(K)?o.options.showQuickConnect=!1:o.options.showQuickConnect=!0);const y=ke(),P=Ce()?y.appUrl:window.location.origin,l=E(P,W.WELLKNOWN_SERVICE_PATH_PREFIX,"connect"),C={params:be(encodeURIComponent(JSON.stringify(o))),appPid:n==null?void 0:n.appPid,appName:n==null?void 0:n.appName,locale:m,redirect:window.location.href,_ek_:a};R(q)||(C.autoConnectWebview=q),R(F)||(C.popup=F),C.disableClose=!0,window.location.href=Y(he(l,C),{allowDomains:null})});ge(()=>{if(t.get("sessionToken")){const n=t.get("visitorId");if(!n){J.error("Unexpected login response from server: visitorId is required");return}M({sessionToken:L(te),refreshToken:L(oe),visitorId:L(n)},o=>o)}else!r.user||d&&r.user.did!==d?O():!H&&!t.get("sessionToken")&&B()});const ae=n=>{J.error(n.message)},le=t.has("popup");if(r.loading||r.user){if(!H||t.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx(z,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(je,{children:le?null:e.jsx(de,{})})]});const n=f?new URL(f,window.location.origin).href:window.location.href;return e.jsx(N,{onConnect:O,passports:Q,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx(z,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(p,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:s})]})}export{$e as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CPE8Apzb.js","assets/vendor-react-DEoibe3W.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a8 as H,j as t,ag as M,H as v,v as U,a9 as d,bc as B,T as I,bF as X,bG as G,bH as q,ao as O,at as V}from"./vendor-mui-core-CQ38ohp2.js";import{a as J,_ as Q,H as K}from"./vendor-arcblock-ScFEr-lj.js";import{r as u}from"./vendor-react-DEoibe3W.js";import{d as Y}from"./CheckCircle-BNrN9mgy.js";import{d as Z}from"./ViewList-e3CoNi3K.js";import{r as ee,b2 as te,o as se,an as L,B as _,b1 as oe,u as ae}from"./vendor-ux-did-connect-BdkhddhO.js";import{d as ne}from"./Done-JLiLhELm.js";import{a as re,v as ie}from"./vendor-hooks-DftG_2gV.js";import{N as ce}from"./vendor-utils-BNHJB5U7.js";import{W as le}from"./did-address-DUThaBlf.js";import{w as pe}from"./wrap-locale-DMTYAE64.js";import{u as de}from"./use-passport-id-B-b-_oYF.js";import{i as $,S as ue,c as me,s as he,a as fe}from"./index-DO3_1y-L.js";import{g as xe}from"./get-safe-url-
|
|
2
|
+
import{a8 as H,j as t,ag as M,H as v,v as U,a9 as d,bc as B,T as I,bF as X,bG as G,bH as q,ao as O,at as V}from"./vendor-mui-core-CQ38ohp2.js";import{a as J,_ as Q,H as K}from"./vendor-arcblock-ScFEr-lj.js";import{r as u}from"./vendor-react-DEoibe3W.js";import{d as Y}from"./CheckCircle-BNrN9mgy.js";import{d as Z}from"./ViewList-e3CoNi3K.js";import{r as ee,b2 as te,o as se,an as L,B as _,b1 as oe,u as ae}from"./vendor-ux-did-connect-BdkhddhO.js";import{d as ne}from"./Done-JLiLhELm.js";import{a as re,v as ie}from"./vendor-hooks-DftG_2gV.js";import{N as ce}from"./vendor-utils-BNHJB5U7.js";import{W as le}from"./did-address-DUThaBlf.js";import{w as pe}from"./wrap-locale-DMTYAE64.js";import{u as de}from"./use-passport-id-B-b-_oYF.js";import{i as $,S as ue,c as me,s as he,a as fe}from"./index-DO3_1y-L.js";import{g as xe}from"./get-safe-url-Bq9SFfX6.js";import"./lottie-web-jYmAQWuC.js";var k={},ge=H;Object.defineProperty(k,"__esModule",{value:!0});var W=k.default=void 0,ve=ge(ee()),be=t;W=k.default=(0,ve.default)((0,be.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function P({list:s,width:c,height:m,cardSpace:l,onSelect:r,defaultIndex:h}){const[b,f]=u.useState(0),[o,x]=u.useState(0),w=u.useRef(null),g=n=>{if(n<0||n>s.length-1)return;f(n);const i=w.current.clientWidth;x(n*(c+l)-(i-c)/2+l*.5),r(n)};u.useEffect(()=>{g(h);const n=i=>i.preventDefault();w.current.addEventListener("touchmove",n,{passive:!1})},[]);let a;const j=n=>{a=n.touches[0].clientX},y=n=>{const i=n.changedTouches[0],S=a-i.clientX;Math.abs(S)>60&&(S>0?g(b+1):g(b-1))};return t.jsx(we,{ref:w,onTouchStart:j,onTouchEnd:y,children:t.jsx("div",{className:"card-container",style:{transform:`translate(${-o}px, 0)`},children:s.map((n,i)=>t.jsx("div",{className:`card-item ${i===b?"selected":""}`,style:{width:c,height:m,margin:l/2},onClick:()=>g(i),children:n.display?t.jsx("div",{className:"card-content",children:t.jsx(J,{data:n.display,style:{width:"100%",height:"100%"}})}):t.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const we=M.div`
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
|
|
5
5
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./vendor-mui-core-CQ38ohp2.js";import{r as t}from"./vendor-react-DEoibe3W.js";import{g as i}from"./get-safe-url-
|
|
1
|
+
import{j as c}from"./vendor-mui-core-CQ38ohp2.js";import{r as t}from"./vendor-react-DEoibe3W.js";import{g as i}from"./get-safe-url-DBsPGn--.js";import"./vendor-ux-did-connect-BdkhddhO.js";import"./vendor-utils-BNHJB5U7.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";function v(){const e=t.useRef(null),n=t.useRef(Date.now());return t.useEffect(()=>{const r=`open-window-url-${new URLSearchParams(window.location.search).get("key")}`;return e.current=setInterval(()=>{if(Date.now()-n.current>10*1e3){localStorage.removeItem(r),clearInterval(e.current);return}const o=localStorage.getItem(r);if(o)try{const{url:a,time:s}=JSON.parse(o);localStorage.removeItem(r),Date.now()-s<10*1e3&&(window.location.href=i(a,{allowDomains:null}))}catch{}},200),()=>clearInterval(e.current)},[]),c.jsx("div",{})}export{v as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,ao as re,a9 as i,H as h,ag as le,ac as k,T as A,bb as ae}from"./vendor-mui-core-CQ38ohp2.js";import{r as p,b as ve}from"./vendor-react-DEoibe3W.js";import{I as u,u as _,B as je,b6 as ye,j as I}from"./vendor-ux-did-connect-BdkhddhO.js";import{X as be,Y as z}from"./vendor-arcblock-ScFEr-lj.js";import{d as $}from"./InfoOutlined-CQB5qKm-.js";import{K as we}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{p as ke}from"./index-DcBUShKK.js";import{z as Se,C as Te,K as Ie,w as Ae,l as _e,ai as Ce,t as q}from"./index-DO3_1y-L.js";import{I as Me}from"./index-CGBZONPv.js";import{_ as Re}from"./dot-BE1YP292.js";import{y as $e}from"./vendor-utils-BNHJB5U7.js";import{u as Be}from"./dashboard-8QXGSoVu.js";import{W as g}from"./did-address-DUThaBlf.js";import{V as De}from"./status-CygZ0LuY.js";import{c as ze}from"./spaces-WkJCApHO.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./useAsync-CGW40D2-.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-
|
|
1
|
+
import{j as t,ao as re,a9 as i,H as h,ag as le,ac as k,T as A,bb as ae}from"./vendor-mui-core-CQ38ohp2.js";import{r as p,b as ve}from"./vendor-react-DEoibe3W.js";import{I as u,u as _,B as je,b6 as ye,j as I}from"./vendor-ux-did-connect-BdkhddhO.js";import{X as be,Y as z}from"./vendor-arcblock-ScFEr-lj.js";import{d as $}from"./InfoOutlined-CQB5qKm-.js";import{K as we}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{p as ke}from"./index-DcBUShKK.js";import{z as Se,C as Te,K as Ie,w as Ae,l as _e,ai as Ce,t as q}from"./index-DO3_1y-L.js";import{I as Me}from"./index-CGBZONPv.js";import{_ as Re}from"./dot-BE1YP292.js";import{y as $e}from"./vendor-utils-BNHJB5U7.js";import{u as Be}from"./dashboard-8QXGSoVu.js";import{W as g}from"./did-address-DUThaBlf.js";import{V as De}from"./status-CygZ0LuY.js";import{c as ze}from"./spaces-WkJCApHO.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./useAsync-CGW40D2-.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-Bq9SFfX6.js";import"./session-VIMbdc9j.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DlKplWTG.js";import"./omit-bLid3PKQ.js";import"./api-BrU7j0QA.js";const qe={width:24,height:24,body:'<path fill="currentColor" d="m12 10.8l-3.9 3.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L12 10.8Z"/>'},Ee=qe,Ne={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 17a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm12 0a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM6 15v-1a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1m-6-6v3"/>'},Pe=Ne,Ue={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7a4 4 0 1 0 8 0a4 4 0 1 0-8 0M3 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2m1-17.87a4 4 0 0 1 0 7.75M21 21v-2a4 4 0 0 0-3-3.85"/>'},He=Ue,Le={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M7 12h3v4H7z"/><path d="M10 6H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-6"/><path d="M10 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zm4 12h2m-2-4h4"/></g>'},Ke=Le,Ve={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M19.5 7A9 9 0 0 0 12 3a8.991 8.991 0 0 0-7.484 4"/><path d="M11.5 3a16.989 16.989 0 0 0-1.826 4M12.5 3a16.989 16.989 0 0 1 1.828 4M19.5 17a9 9 0 0 1-7.5 4a8.991 8.991 0 0 1-7.484-4"/><path d="M11.5 21a16.989 16.989 0 0 1-1.826-4m2.826 4a16.989 16.989 0 0 0 1.828-4M2 10l1 4l1.5-4L6 14l1-4m10 0l1 4l1.5-4l1.5 4l1-4M9.5 10l1 4l1.5-4l1.5 4l1-4"/></g>'},Oe=Ve,Qe={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0"/><path d="M12 7v5l3 3"/></g>'},ie=Qe,We={width:24,height:24,body:'<path fill="currentColor" d="M12 14q-.825 0-1.413-.588T10 12q0-.825.588-1.413T12 10q.825 0 1.413.588T14 12q0 .825-.588 1.413T12 14Zm0 7q-3.475 0-6.025-2.288T3.05 13H5.1q.35 2.6 2.313 4.3T12 19q2.925 0 4.963-2.038T19 12q0-2.925-2.038-4.963T12 5q-1.725 0-3.225.8T6.25 8H9v2H3V4h2v2.35q1.275-1.6 3.113-2.475T12 3q1.875 0 3.513.713t2.85 1.924q1.212 1.213 1.925 2.85T21 12q0 1.875-.713 3.513t-1.924 2.85q-1.213 1.212-2.85 1.925T12 21Z"/>'},Fe=We;function E({icon:e,value:a,name:o,url:l="",animated:c=!1,LinkComponent:d=re}){const y=()=>ve.isValidElement(e)?e:t.jsx(i,{component:u,icon:e,alt:typeof o=="string"?o:"",sx:{fontSize:30}}),m=t.jsxs(t.Fragment,{children:[t.jsx(i,{className:"metric__image",children:y()}),t.jsxs(i,{children:[p.isValidElement(a)?t.jsx(i,{className:`metric__number ${c?"metric__number--animated":""}`,children:a}):t.jsx(i,{className:`metric__number ${c?"metric__number--animated":""}`,dangerouslySetInnerHTML:{__html:a}}),t.jsx(i,{className:"metric__name",children:o})]})]});return t.jsx(Ge,{children:l?t.jsx(d,{href:l,sx:{textDecoration:"none"},children:m}):m})}E.propTypes={icon:h.string.isRequired,value:h.string.isRequired,name:h.string.isRequired,url:h.string,animated:h.bool,LinkComponent:h.elementType};E.defaultProps={url:"",animated:!1,LinkComponent:re};const Ge=le("div")`
|
|
2
2
|
border-left: 1px solid ${e=>e.theme.palette.divider};
|
|
3
3
|
padding: 10px 0 10px 16px;
|
|
4
4
|
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as n,j as i,a9 as l}from"./vendor-mui-core-CQ38ohp2.js";import{l as d,r as c}from"./vendor-react-DEoibe3W.js";import{u,al as h}from"./vendor-ux-did-connect-BdkhddhO.js";import g from"./index-DNG6b9sp.js";import"./vendor-utils-BNHJB5U7.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./index-DO3_1y-L.js";import"./vendor-arcblock-ScFEr-lj.js";import"./Error-CSFUqG0m.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./session-VIMbdc9j.js";import"./did-address-DUThaBlf.js";import"./empty-spinner-DmDm8XzF.js";import"./bundle-avatar-D0t7RLGx.js";import"./shorten-label-DFzv9EKX.js";import"./list-header-CgF1S4js.js";import"./Download-Ch4RfGRW.js";import"./click-to-copy-BGyXQL2i.js";import"./QuestionMarkCircle-p6m3avKp.js";import"./useSetState-CWq0AVWn.js";import"./index-DVQCgvFb.js";import"./index-DKhrYmrN.js";import"./api-BrU7j0QA.js";import"./ChevronRight-ZTqWK-Ga.js";import"./vendor-mui-x-B0hsmEJ3.js";import"./DeleteOutline-C2sY6hfm.js";import"./react-beautiful-dnd.esm-ByydTUk4.js";import"./raf-schd.esm-B3j6BePR.js";import"./item-nK3D7WH5.js";import"./Launch-fxgQvk19.js";import"./Done-JLiLhELm.js";import"./delete-confirm-_BzUlhv2.js";import"./get-safe-url-
|
|
1
|
+
import{v as n,j as i,a9 as l}from"./vendor-mui-core-CQ38ohp2.js";import{l as d,r as c}from"./vendor-react-DEoibe3W.js";import{u,al as h}from"./vendor-ux-did-connect-BdkhddhO.js";import g from"./index-DNG6b9sp.js";import"./vendor-utils-BNHJB5U7.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./index-DO3_1y-L.js";import"./vendor-arcblock-ScFEr-lj.js";import"./Error-CSFUqG0m.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./session-VIMbdc9j.js";import"./did-address-DUThaBlf.js";import"./empty-spinner-DmDm8XzF.js";import"./bundle-avatar-D0t7RLGx.js";import"./shorten-label-DFzv9EKX.js";import"./list-header-CgF1S4js.js";import"./Download-Ch4RfGRW.js";import"./click-to-copy-BGyXQL2i.js";import"./QuestionMarkCircle-p6m3avKp.js";import"./useSetState-CWq0AVWn.js";import"./index-DVQCgvFb.js";import"./index-DKhrYmrN.js";import"./api-BrU7j0QA.js";import"./ChevronRight-ZTqWK-Ga.js";import"./vendor-mui-x-B0hsmEJ3.js";import"./DeleteOutline-C2sY6hfm.js";import"./react-beautiful-dnd.esm-ByydTUk4.js";import"./raf-schd.esm-B3j6BePR.js";import"./item-nK3D7WH5.js";import"./Launch-fxgQvk19.js";import"./Done-JLiLhELm.js";import"./delete-confirm-_BzUlhv2.js";import"./get-safe-url-Bq9SFfX6.js";import"./ArrowDropDown-B0sLkJoY.js";import"./index-CHbpkZwO.js";import"./index-SDdS_qt8.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function to(){const{t:p}=u(),{componentDid:o}=d(),m=n(t=>t.breakpoints.down("md")),a=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:m?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:a,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{to as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x}from"./vendor-react-DEoibe3W.js";import{e as W,j as n,bL as G,T,a9 as w,H as l,bb as D,ag as F,ac as S,cm as Y,cn as Z}from"./vendor-mui-core-CQ38ohp2.js";import{p as H}from"./index-DcBUShKK.js";import{u as A,_ as v,I as tt,a5 as et}from"./vendor-ux-did-connect-BdkhddhO.js";import{as as O,ax as _,z as st,C as q,f as z,aF as nt}from"./index-DO3_1y-L.js";import{z as B,aK as at}from"./vendor-utils-BNHJB5U7.js";import{a4 as C}from"./vendor-arcblock-ScFEr-lj.js";import{R as K}from"./index-CYeIiQ6Q.js";import{B as it}from"./bundle-avatar-D0t7RLGx.js";import{B as rt}from"./dashboard-8QXGSoVu.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-DBsPGn--.js";import"./session-VIMbdc9j.js";import"./InfoOutlined-CQB5qKm-.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C_flBrm-.js";const J=a=>{const g=new Date(Math.min(...a)),r=(new Date(Math.max(...a))-g)/(1e3*60);return u=>{if(r<=10){const e=(a.length-a.length%r)/r;return u%e===0}const o=(a.length-a.length%6)/6;return u%o===0}},R=a=>`${a}%`;function U({title:a,cpus:g,currentLoad:c,history:d,empty:r,onHover:u,hoverIndex:i}){const{t:o,locale:b}=A(),e=W(),t=x.useRef(null),s=B(d)?[]:d.map(p=>O(p.date,"HH:mm",b)),j=`${a||o("common.cpu")} (${Math.floor(c||0)}%)`,L=x.useCallback(()=>{u==null||u(null)},[u]);if(x.useEffect(()=>{if(!t.current||(i==null?void 0:i.ref)===t)return;const p=t.current.getEchartsInstance(),E=i==null?void 0:i.seriesIndex,M=s.findIndex(y=>y===(i==null?void 0:i.dataValue));i&&M!==-1?p.dispatchAction({type:"showTip",seriesIndex:E,dataIndex:M}):(p.dispatchAction({type:"hideTip"}),p.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[i]),!B(d)){const M={tooltip:{trigger:"axis",formatter(y){const $=y[0].data,{seriesIndex:f,dataIndex:h}=y[0];return u==null||u({seriesIndex:f,dataIndex:h,dataValue:s[h],ref:(i==null?void 0:i.ref)||t}),`${y[0].name}: <b>${R($)}</b>`}},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:s,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:J(d.map(y=>new Date(y.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:100,interval:Math.ceil(50),axisLabel:{formatter:R}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:[{max:80,color:"#e9f8f9"},{min:80,max:100,color:e.palette.warning.light},{min:100,color:"#ff4d4f"}]},series:[{name:"CPU Usage",type:"line",smooth:!0,symbol:"none",lineStyle:{color:e.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:d.map(y=>y.value),markLine:{silent:!0,symbol:["none","none"],lineStyle:{color:"#ff4d4f",type:"dashed",width:1.5},label:{formatter:`${R(100)}`,position:"insideEndTop"},data:[{yAxis:100},{yAxis:80,lineStyle:{color:e.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${R(80)}`,position:"insideEndTop"}}]}}]};return n.jsxs(G,{sx:{p:1,position:"relative"},onMouseLeave:L,children:[n.jsx(T,{sx:{position:"absolute",top:8,left:16,zIndex:10},fontSize:"16px",fontWeight:"bold",color:"text.secondary",children:j}),n.jsx(K,{ref:t,option:M,style:{width:"100%",height:"200px"},onEvents:{globalout:L}}),n.jsxs(w,{sx:{ml:2,mt:1,fontSize:12},color:"text.secondary",children:[`${o("system.cores")}: ${(g==null?void 0:g.length)||0}`," "]})]})}return r}U.propTypes={title:l.string,cpus:l.array,currentLoad:l.number,history:l.array,empty:l.node,onHover:l.func,hoverIndex:l.number};U.defaultProps={title:"",cpus:[],currentLoad:0,history:[],empty:null,onHover:()=>{},hoverIndex:null};function N({instanceCount:a,title:g,total:c,used:d,history:r,empty:u,onHover:i,hoverIndex:o}){const{t:b,locale:e}=A(),t=W(),s=!!c,j=c-d,L=s?`(${_(d)}, ${Math.floor(d/c*100)}%)`:"",p=x.useRef(null),E=`${g||b("common.memory")} ${L}`,M=B(r)?[]:r.map(f=>O(f.date,"HH:mm",e));x.useEffect(()=>{if(!p.current||(o==null?void 0:o.ref)===p)return;const f=p.current.getEchartsInstance(),h=o==null?void 0:o.seriesIndex,k=M.findIndex(m=>m===(o==null?void 0:o.dataValue));o&&k!==-1?f.dispatchAction({type:"showTip",seriesIndex:h,dataIndex:k}):(f.dispatchAction({type:"hideTip"}),f.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[o==null?void 0:o.dataIndex]);const y=x.useCallback(()=>{i==null||i(null)},[i]);x.useEffect(()=>{if(p.current){const f=p.current.getEchartsInstance(),h=f.getDom(),k=m=>{y(m)};return h.addEventListener("mouseleave",k),()=>{h&&h.removeEventListener("mouseleave",k),f&&f.dispose()}}},[y]);const $=[];if(a&&$.push({title:b("system.instances"),metric:a}),s&&$.push({title:b("system.free"),metric:C(j,{short:!0,iec:!0})}),!B(r)){const f=Math.max(...r.map(m=>m.value),c,0),h=Math.ceil(c*.8),k={tooltip:{trigger:"axis",formatter(m){const P=m[0].data,Q=C(P,{short:!0,iec:!0}),{seriesIndex:X,dataIndex:I}=m[0];return i==null||i({seriesIndex:X,dataIndex:I,dataValue:M[I],ref:(o==null?void 0:o.ref)||p}),`${m[0].name}: <b>${Q}</b>`}},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:M,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:J(r.map(m=>new Date(m.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:f,interval:Math.ceil(f/2),axisLabel:{formatter:m=>C(m,{short:!0,iec:!0}),padding:[5,0,0,0]}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:[{max:h,color:"#e9f8f9"},{min:h,max:c,color:t.palette.warning.light},{min:c,color:"#ff4d4f"}]},series:[{name:"Memory Usage",type:"line",smooth:!0,symbol:"none",lineStyle:{color:t.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:r.map(m=>m.value),markLine:{silent:!0,symbol:["none","none"],data:[{yAxis:c,lineStyle:{color:"#ff4d4f",type:"dashed",width:1.5},label:{formatter:`${C(c,{short:!0,iec:!0})}`,position:"insideEndTop"}},{yAxis:h,lineStyle:{color:t.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${C(h,{short:!0,iec:!0})}`,position:"insideEndTop"}}]}}]};return n.jsxs(G,{sx:{p:1,position:"relative"},onMouseLeave:y,children:[n.jsx(T,{sx:{position:"absolute",top:8,left:16,zIndex:10},fontSize:"16px",fontWeight:"bold",color:"text.secondary",children:E}),n.jsx(K,{ref:p,option:k,style:{width:"100%",height:"200px"}}),n.jsx(w,{sx:{ml:2,mt:1,fontSize:12},color:"text.secondary",children:$.map((m,P)=>n.jsxs(w,{sx:{marginLeft:P===0?0:1,display:"inline-flex"},children:[m.title,": ",m.metric]},m.title))})]})}return u}N.propTypes={title:l.string,instanceCount:l.number,total:l.number,used:l.number,history:l.array,empty:l.node,onHover:l.func,hoverIndex:l.number};N.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[],empty:null,onHover:()=>{},hoverIndex:null};function V({blocklet:a,...g}){const{t:c}=A(),{info:d}=st(),{runtimeHistory:r}=q(),[u,i]=x.useState(null),o=x.useCallback(e=>a.status!=="running"?n.jsx(T,{children:c("blocklet.runtimeInfo.noRunning")}):e.length?null:n.jsx(v,{children:c("common.empty")}),[a.status,c]),b=x.useCallback(e=>{i(e)},[]);return r.length===0?n.jsx(T,{children:c("blocklet.runtimeInfo.noRunning")}):n.jsxs(ot,{component:"div",...g,children:[n.jsxs(D,{className:"page-metrics",container:!0,spacing:5,children:[n.jsx(D,{item:!0,xs:12,sx:{pt:"16px !important"},children:n.jsx(T,{fontSize:"16px",fontWeight:"bold",children:"CPU"})}),r==null?void 0:r.map(e=>{var t,s;return n.jsx(D,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:n.jsx(U,{title:`${e.name} CPU`,empty:o(e.cpu),currentLoad:((t=e.appRuntimeInfo)==null?void 0:t.cpuUsage)||0,cpus:((s=e.appRuntimeInfo)==null?void 0:s.cpus)||[],history:e.cpu,onHover:b,hoverIndex:u,style:{height:150}})},`${e.key}-cpu`)})]}),n.jsxs(D,{className:"page-metrics",container:!0,spacing:5,sx:{mt:1},children:[n.jsx(D,{item:!0,xs:12,sx:{pt:"16px !important"},children:n.jsx(T,{fontSize:"16px",fontWeight:"bold",children:"Memory"})}),r==null?void 0:r.map(e=>{var t,s,j;return n.jsx(D,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:n.jsx(N,{title:`${e.name} Memory`,empty:o(e.memory),total:(t=d.runtimeConfig)!=null&&t.blockletMaxMemoryLimit?C.parseSize(`${d.runtimeConfig.blockletMaxMemoryLimit*(e.key===((s=a==null?void 0:a.meta)==null?void 0:s.did)?r.length-1:1)}MiB`):0,used:((j=e.appRuntimeInfo)==null?void 0:j.memoryUsage)||0,history:e.memory,onHover:b,hoverIndex:u,style:{height:150}})},`${e.key}-memory`)})]})]})}V.propTypes={blocklet:l.object.isRequired,cpuHistory:l.arrayOf(l.shape({date:l.number,value:l.number})),memoryHistory:l.arrayOf(l.shape({date:l.number,value:l.number}))};V.defaultProps={cpuHistory:[],memoryHistory:[]};const ot=F(T)``;function lt(){const{t:a,locale:g}=A(),[c,d]=x.useState(6),{blocklet:r,actions:{refreshBlocklet:u}}=q(),i=x.useMemo(()=>{const e=[];return z.forEachBlockletSync(r,(t,{ancestors:s,id:j,level:L})=>{var p;(p=t==null?void 0:t.meta)!=null&&p.did&&t.meta.did!==r.meta.did&&e.push({type:"blocklet",groupId:r.meta.did,groupName:z.getDisplayName(r),id:j,name:z.getDisplayName(t,!0),blocklet:r,component:t,level:L-1>=0?L-1:0,runtimeInfo:t.runtimeInfo,ancestors:s})}),e},[r]);x.useEffect(()=>{u({hours:c});const e=setInterval(()=>{u({hours:c})},1e3*10);return()=>{clearInterval(e)}},[c]);const o=e=>H(Number(e||0),{locale:nt(g)}),b=[{label:a("common.name"),name:"name",options:{customBodyRenderLite(e){const{name:t,component:s,level:j,ancestors:L}=i[e];return n.jsxs(w,{display:"flex",alignItems:"center",pl:j*2,children:[n.jsx(it,{size:20,blocklet:s,ancestors:L}),n.jsx(w,{ml:1,children:t}),n.jsx(rt,{variant:"pin",style:{marginLeft:8},status:s.status,source:s.source,progress:s.progress})]})}}},{label:a("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):o(t==null?void 0:t.uptime)}}},{label:a("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):_((t==null?void 0:t.memoryUsage)||0)}}},{label:a("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):`${((t==null?void 0:t.cpuUsage)||0).toFixed(1)}%`}}},{label:a("analytics.runtime"),name:"runtimeInfo.runtime",options:{customBodyRenderLite(e){const{runtimeInfo:t}=i[e];return t!=null&&t.uptime?n.jsxs(w,{display:"flex",alignItems:"center",children:[n.jsx(tt,{icon:t!=null&&t.runningDocker?"catppuccin:docker-ignore":"logos:nodejs-icon"}),n.jsx(w,{ml:1,children:t!=null&&t.runningDocker?"Docker":"Nodejs"})]}):null}}},{label:a("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):t==null?void 0:t.pid}}},{label:a("blocklet.runtimeInfo.port"),name:"runtimeInfo.port",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):t==null?void 0:t.port}}}];return n.jsxs(ct,{component:"div",children:[n.jsxs(w,{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2,children:[n.jsx(T,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:a("analytics.trend")}),n.jsx(Y,{size:"small",exclusive:!0,value:c,onChange:(e,t)=>{at(t)&&d(t)},children:[1,3,6,12,24].map(e=>n.jsxs(Z,{value:e,children:[e,"H"]},e))})]}),n.jsx(w,{children:n.jsx(V,{blocklet:r})}),n.jsx(w,{mt:3,children:n.jsx(et,{title:a("analytics.detail"),className:"monitor-table",locale:g,data:i,columns:b,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]})}lt.propTypes={};const ct=F(T)``;export{lt as default};
|
|
1
|
+
import{r as x}from"./vendor-react-DEoibe3W.js";import{e as W,j as n,bL as G,T,a9 as w,H as l,bb as D,ag as F,ac as S,cm as Y,cn as Z}from"./vendor-mui-core-CQ38ohp2.js";import{p as H}from"./index-DcBUShKK.js";import{u as A,_ as v,I as tt,a5 as et}from"./vendor-ux-did-connect-BdkhddhO.js";import{as as O,ax as _,z as st,C as q,f as z,aF as nt}from"./index-DO3_1y-L.js";import{z as B,aK as at}from"./vendor-utils-BNHJB5U7.js";import{a4 as C}from"./vendor-arcblock-ScFEr-lj.js";import{R as K}from"./index-CYeIiQ6Q.js";import{B as it}from"./bundle-avatar-D0t7RLGx.js";import{B as rt}from"./dashboard-8QXGSoVu.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-Bq9SFfX6.js";import"./session-VIMbdc9j.js";import"./InfoOutlined-CQB5qKm-.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DlKplWTG.js";const J=a=>{const g=new Date(Math.min(...a)),r=(new Date(Math.max(...a))-g)/(1e3*60);return u=>{if(r<=10){const e=(a.length-a.length%r)/r;return u%e===0}const o=(a.length-a.length%6)/6;return u%o===0}},R=a=>`${a}%`;function U({title:a,cpus:g,currentLoad:c,history:d,empty:r,onHover:u,hoverIndex:i}){const{t:o,locale:b}=A(),e=W(),t=x.useRef(null),s=B(d)?[]:d.map(p=>O(p.date,"HH:mm",b)),j=`${a||o("common.cpu")} (${Math.floor(c||0)}%)`,L=x.useCallback(()=>{u==null||u(null)},[u]);if(x.useEffect(()=>{if(!t.current||(i==null?void 0:i.ref)===t)return;const p=t.current.getEchartsInstance(),E=i==null?void 0:i.seriesIndex,M=s.findIndex(y=>y===(i==null?void 0:i.dataValue));i&&M!==-1?p.dispatchAction({type:"showTip",seriesIndex:E,dataIndex:M}):(p.dispatchAction({type:"hideTip"}),p.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[i]),!B(d)){const M={tooltip:{trigger:"axis",formatter(y){const $=y[0].data,{seriesIndex:f,dataIndex:h}=y[0];return u==null||u({seriesIndex:f,dataIndex:h,dataValue:s[h],ref:(i==null?void 0:i.ref)||t}),`${y[0].name}: <b>${R($)}</b>`}},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:s,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:J(d.map(y=>new Date(y.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:100,interval:Math.ceil(50),axisLabel:{formatter:R}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:[{max:80,color:"#e9f8f9"},{min:80,max:100,color:e.palette.warning.light},{min:100,color:"#ff4d4f"}]},series:[{name:"CPU Usage",type:"line",smooth:!0,symbol:"none",lineStyle:{color:e.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:d.map(y=>y.value),markLine:{silent:!0,symbol:["none","none"],lineStyle:{color:"#ff4d4f",type:"dashed",width:1.5},label:{formatter:`${R(100)}`,position:"insideEndTop"},data:[{yAxis:100},{yAxis:80,lineStyle:{color:e.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${R(80)}`,position:"insideEndTop"}}]}}]};return n.jsxs(G,{sx:{p:1,position:"relative"},onMouseLeave:L,children:[n.jsx(T,{sx:{position:"absolute",top:8,left:16,zIndex:10},fontSize:"16px",fontWeight:"bold",color:"text.secondary",children:j}),n.jsx(K,{ref:t,option:M,style:{width:"100%",height:"200px"},onEvents:{globalout:L}}),n.jsxs(w,{sx:{ml:2,mt:1,fontSize:12},color:"text.secondary",children:[`${o("system.cores")}: ${(g==null?void 0:g.length)||0}`," "]})]})}return r}U.propTypes={title:l.string,cpus:l.array,currentLoad:l.number,history:l.array,empty:l.node,onHover:l.func,hoverIndex:l.number};U.defaultProps={title:"",cpus:[],currentLoad:0,history:[],empty:null,onHover:()=>{},hoverIndex:null};function N({instanceCount:a,title:g,total:c,used:d,history:r,empty:u,onHover:i,hoverIndex:o}){const{t:b,locale:e}=A(),t=W(),s=!!c,j=c-d,L=s?`(${_(d)}, ${Math.floor(d/c*100)}%)`:"",p=x.useRef(null),E=`${g||b("common.memory")} ${L}`,M=B(r)?[]:r.map(f=>O(f.date,"HH:mm",e));x.useEffect(()=>{if(!p.current||(o==null?void 0:o.ref)===p)return;const f=p.current.getEchartsInstance(),h=o==null?void 0:o.seriesIndex,k=M.findIndex(m=>m===(o==null?void 0:o.dataValue));o&&k!==-1?f.dispatchAction({type:"showTip",seriesIndex:h,dataIndex:k}):(f.dispatchAction({type:"hideTip"}),f.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[o==null?void 0:o.dataIndex]);const y=x.useCallback(()=>{i==null||i(null)},[i]);x.useEffect(()=>{if(p.current){const f=p.current.getEchartsInstance(),h=f.getDom(),k=m=>{y(m)};return h.addEventListener("mouseleave",k),()=>{h&&h.removeEventListener("mouseleave",k),f&&f.dispose()}}},[y]);const $=[];if(a&&$.push({title:b("system.instances"),metric:a}),s&&$.push({title:b("system.free"),metric:C(j,{short:!0,iec:!0})}),!B(r)){const f=Math.max(...r.map(m=>m.value),c,0),h=Math.ceil(c*.8),k={tooltip:{trigger:"axis",formatter(m){const P=m[0].data,Q=C(P,{short:!0,iec:!0}),{seriesIndex:X,dataIndex:I}=m[0];return i==null||i({seriesIndex:X,dataIndex:I,dataValue:M[I],ref:(o==null?void 0:o.ref)||p}),`${m[0].name}: <b>${Q}</b>`}},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:M,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:J(r.map(m=>new Date(m.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:f,interval:Math.ceil(f/2),axisLabel:{formatter:m=>C(m,{short:!0,iec:!0}),padding:[5,0,0,0]}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:[{max:h,color:"#e9f8f9"},{min:h,max:c,color:t.palette.warning.light},{min:c,color:"#ff4d4f"}]},series:[{name:"Memory Usage",type:"line",smooth:!0,symbol:"none",lineStyle:{color:t.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:r.map(m=>m.value),markLine:{silent:!0,symbol:["none","none"],data:[{yAxis:c,lineStyle:{color:"#ff4d4f",type:"dashed",width:1.5},label:{formatter:`${C(c,{short:!0,iec:!0})}`,position:"insideEndTop"}},{yAxis:h,lineStyle:{color:t.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${C(h,{short:!0,iec:!0})}`,position:"insideEndTop"}}]}}]};return n.jsxs(G,{sx:{p:1,position:"relative"},onMouseLeave:y,children:[n.jsx(T,{sx:{position:"absolute",top:8,left:16,zIndex:10},fontSize:"16px",fontWeight:"bold",color:"text.secondary",children:E}),n.jsx(K,{ref:p,option:k,style:{width:"100%",height:"200px"}}),n.jsx(w,{sx:{ml:2,mt:1,fontSize:12},color:"text.secondary",children:$.map((m,P)=>n.jsxs(w,{sx:{marginLeft:P===0?0:1,display:"inline-flex"},children:[m.title,": ",m.metric]},m.title))})]})}return u}N.propTypes={title:l.string,instanceCount:l.number,total:l.number,used:l.number,history:l.array,empty:l.node,onHover:l.func,hoverIndex:l.number};N.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[],empty:null,onHover:()=>{},hoverIndex:null};function V({blocklet:a,...g}){const{t:c}=A(),{info:d}=st(),{runtimeHistory:r}=q(),[u,i]=x.useState(null),o=x.useCallback(e=>a.status!=="running"?n.jsx(T,{children:c("blocklet.runtimeInfo.noRunning")}):e.length?null:n.jsx(v,{children:c("common.empty")}),[a.status,c]),b=x.useCallback(e=>{i(e)},[]);return r.length===0?n.jsx(T,{children:c("blocklet.runtimeInfo.noRunning")}):n.jsxs(ot,{component:"div",...g,children:[n.jsxs(D,{className:"page-metrics",container:!0,spacing:5,children:[n.jsx(D,{item:!0,xs:12,sx:{pt:"16px !important"},children:n.jsx(T,{fontSize:"16px",fontWeight:"bold",children:"CPU"})}),r==null?void 0:r.map(e=>{var t,s;return n.jsx(D,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:n.jsx(U,{title:`${e.name} CPU`,empty:o(e.cpu),currentLoad:((t=e.appRuntimeInfo)==null?void 0:t.cpuUsage)||0,cpus:((s=e.appRuntimeInfo)==null?void 0:s.cpus)||[],history:e.cpu,onHover:b,hoverIndex:u,style:{height:150}})},`${e.key}-cpu`)})]}),n.jsxs(D,{className:"page-metrics",container:!0,spacing:5,sx:{mt:1},children:[n.jsx(D,{item:!0,xs:12,sx:{pt:"16px !important"},children:n.jsx(T,{fontSize:"16px",fontWeight:"bold",children:"Memory"})}),r==null?void 0:r.map(e=>{var t,s,j;return n.jsx(D,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:n.jsx(N,{title:`${e.name} Memory`,empty:o(e.memory),total:(t=d.runtimeConfig)!=null&&t.blockletMaxMemoryLimit?C.parseSize(`${d.runtimeConfig.blockletMaxMemoryLimit*(e.key===((s=a==null?void 0:a.meta)==null?void 0:s.did)?r.length-1:1)}MiB`):0,used:((j=e.appRuntimeInfo)==null?void 0:j.memoryUsage)||0,history:e.memory,onHover:b,hoverIndex:u,style:{height:150}})},`${e.key}-memory`)})]})]})}V.propTypes={blocklet:l.object.isRequired,cpuHistory:l.arrayOf(l.shape({date:l.number,value:l.number})),memoryHistory:l.arrayOf(l.shape({date:l.number,value:l.number}))};V.defaultProps={cpuHistory:[],memoryHistory:[]};const ot=F(T)``;function lt(){const{t:a,locale:g}=A(),[c,d]=x.useState(6),{blocklet:r,actions:{refreshBlocklet:u}}=q(),i=x.useMemo(()=>{const e=[];return z.forEachBlockletSync(r,(t,{ancestors:s,id:j,level:L})=>{var p;(p=t==null?void 0:t.meta)!=null&&p.did&&t.meta.did!==r.meta.did&&e.push({type:"blocklet",groupId:r.meta.did,groupName:z.getDisplayName(r),id:j,name:z.getDisplayName(t,!0),blocklet:r,component:t,level:L-1>=0?L-1:0,runtimeInfo:t.runtimeInfo,ancestors:s})}),e},[r]);x.useEffect(()=>{u({hours:c});const e=setInterval(()=>{u({hours:c})},1e3*10);return()=>{clearInterval(e)}},[c]);const o=e=>H(Number(e||0),{locale:nt(g)}),b=[{label:a("common.name"),name:"name",options:{customBodyRenderLite(e){const{name:t,component:s,level:j,ancestors:L}=i[e];return n.jsxs(w,{display:"flex",alignItems:"center",pl:j*2,children:[n.jsx(it,{size:20,blocklet:s,ancestors:L}),n.jsx(w,{ml:1,children:t}),n.jsx(rt,{variant:"pin",style:{marginLeft:8},status:s.status,source:s.source,progress:s.progress})]})}}},{label:a("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):o(t==null?void 0:t.uptime)}}},{label:a("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):_((t==null?void 0:t.memoryUsage)||0)}}},{label:a("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):`${((t==null?void 0:t.cpuUsage)||0).toFixed(1)}%`}}},{label:a("analytics.runtime"),name:"runtimeInfo.runtime",options:{customBodyRenderLite(e){const{runtimeInfo:t}=i[e];return t!=null&&t.uptime?n.jsxs(w,{display:"flex",alignItems:"center",children:[n.jsx(tt,{icon:t!=null&&t.runningDocker?"catppuccin:docker-ignore":"logos:nodejs-icon"}),n.jsx(w,{ml:1,children:t!=null&&t.runningDocker?"Docker":"Nodejs"})]}):null}}},{label:a("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):t==null?void 0:t.pid}}},{label:a("blocklet.runtimeInfo.port"),name:"runtimeInfo.port",options:{customBodyRenderLite(e){const{runtimeInfo:t,component:s}=i[e];return!(s!=null&&s.status)||s.status!=="running"?n.jsx(S,{title:a("common.noData"),children:"--"}):t==null?void 0:t.port}}}];return n.jsxs(ct,{component:"div",children:[n.jsxs(w,{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2,children:[n.jsx(T,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:a("analytics.trend")}),n.jsx(Y,{size:"small",exclusive:!0,value:c,onChange:(e,t)=>{at(t)&&d(t)},children:[1,3,6,12,24].map(e=>n.jsxs(Z,{value:e,children:[e,"H"]},e))})]}),n.jsx(w,{children:n.jsx(V,{blocklet:r})}),n.jsx(w,{mt:3,children:n.jsx(et,{title:a("analytics.detail"),className:"monitor-table",locale:g,data:i,columns:b,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]})}lt.propTypes={};const ct=F(T)``;export{lt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as Ie,I as Y,b2 as It,j as N,Y as Q,al as Gt,B as Yt,a4 as Jt,a5 as Qt,r as io,ar as so}from"./vendor-ux-did-connect-BdkhddhO.js";import{a as Dt,m as jt,u as E,f as er,l as sn}from"./vendor-hooks-DftG_2gV.js";import{r as H,a as ee,g as lo}from"./vendor-react-DEoibe3W.js";import{H as D,j as a,a9 as $,ac as G,I as he,bt as Rt,e as kt,O as te,N as co,y as Ze,T as uo,a8 as B,cH as fo,cI as po,cJ as mo,cK as re,c3 as ue,cL as ln,cM as tr,cN as rr,cO as ho,cP as cn,cQ as vo,cR as yo,b2 as xe,cS as go,cT as bo,cU as xo,cV as _o,cW as Po,cX as Co,cY as jo,cZ as Ro,c_ as Oo,c$ as wo,d0 as To,bo as ge,bR as Mt,bs as be,bS as Pt,bq as qo,E as Mo,bL as So,C as Io,bX as Do,bu as un,bv as dn,ak as ko,ag as $o}from"./vendor-mui-core-CQ38ohp2.js";import{n as Se,O as St,aI as Wo,C as Ct,y as Ao,az as dr,L as fn,H as Ce,o as pn}from"./vendor-utils-BNHJB5U7.js";import{C as $t,z as Wt,E as nr,F as ce}from"./index-DO3_1y-L.js";import{S as Lt}from"./simple-select-DlrdVbaI.js";import{c as Bo,u as mn}from"./dashboard-8QXGSoVu.js";import{A as hn}from"./config-Bh19ZUJ-.js";import{u as Ho}from"./use-mobile-DlKplWTG.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-ScFEr-lj.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-DBsPGn--.js";import"./session-VIMbdc9j.js";import"./index-DcBUShKK.js";import"./InfoOutlined-CQB5qKm-.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C_flBrm-.js";const Lo={width:24,height:24,body:'<path fill="currentColor" d="M11 14.2V6q0-.425.288-.713T12 5q.425 0 .713.288T13 6v8.2l2.9-2.9q.275-.275.7-.275t.7.275q.275.275.275.7t-.275.7l-4.6 4.6q-.3.3-.7.3t-.7-.3l-4.6-4.6q-.275-.275-.275-.7t.275-.7q.275-.275.7-.275t.7.275l2.9 2.9Z"/>'},Eo={width:24,height:24,body:'<path fill="currentColor" d="m11 8.8l-2.9 2.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L13 8.8V17q0 .425-.288.713T12 18q-.425 0-.713-.288T11 17V8.8Z"/>'},or={width:24,height:24,body:'<path fill="currentColor" d="M7 21q-.825 0-1.413-.588T5 19V6q-.425 0-.713-.288T4 5q0-.425.288-.713T5 4h4q0-.425.288-.713T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6v13q0 .825-.588 1.413T17 21H7Zm2-4h2V8H9v9Zm4 0h2V8h-2v9Z"/>'},ar={width:24,height:24,body:'<path fill="currentColor" d="M4 21q-.425 0-.713-.288T3 20v-2.425q0-.4.15-.763t.425-.637L16.2 3.575q.3-.275.663-.425t.762-.15q.4 0 .775.15t.65.45L20.425 5q.3.275.437.65T21 6.4q0 .4-.138.763t-.437.662l-12.6 12.6q-.275.275-.638.425t-.762.15H4ZM17.6 7.8L19 6.4L17.6 5l-1.4 1.4l1.4 1.4Z"/>'};function vn({enabled:e,showUp:d=!0,showDown:o=!0,showSwitch:n=!0,showDelete:i=!0,showEdit:c=!0,disableEdit:m=!1,disableSwitch:t=!1,onClickUp:r=()=>{},onClickDown:s=()=>{},onClickSwitch:u=()=>{},onClickDelete:P=()=>{},onClickEdit:v=()=>{}}){const{t:x}=Ie();return a.jsxs($,{sx:{display:"flex",alignItems:"center",gap:0},onClick:w=>w.stopPropagation(),children:[c?a.jsx(G,{title:x("common.edit"),children:a.jsx(he,{size:"small",onClick:v,color:"success",disabled:m,children:a.jsx(Y,{icon:ar,fontSize:18})})}):null,i?a.jsx(G,{title:x("common.delete"),children:a.jsx(he,{size:"small",onClick:P,color:"error",children:a.jsx(Y,{icon:or,fontSize:18})})}):null,n?a.jsx(G,{title:x(e?"common.enabled":"common.disabled"),children:a.jsx(Rt,{size:"small",checked:e,onClick:u,disabled:t})}):null,d?a.jsx(G,{title:x("common.moveUp"),children:a.jsx(he,{size:"small",onClick:r,disabled:m,children:a.jsx(Y,{icon:Eo,fontSize:20})})}):null,o?a.jsx(G,{title:x("common.moveDown"),children:a.jsx(he,{size:"small",onClick:s,disabled:m,children:a.jsx(Y,{icon:Lo,fontSize:20})})}):null]})}vn.propTypes={enabled:D.bool.isRequired,showUp:D.bool,showDown:D.bool,showSwitch:D.bool,showDelete:D.bool,showEdit:D.bool,disableEdit:D.bool,disableSwitch:D.bool,onClickUp:D.func,onClickDown:D.func,onClickSwitch:D.func,onClickDelete:D.func,onClickEdit:D.func};const zo=H.forwardRef((e,d)=>{var O,q,A;const{t:o}=H.useContext(It),{blocklet:n}=$t(),{api:i}=Wt(),c=(O=n==null?void 0:n.meta)==null?void 0:O.did,m=kt(),t=((A=(q=m==null?void 0:m.transitions)==null?void 0:q.duration)==null?void 0:A.leavingScreen)||300,r=Dt({mode:"add",show:!1,isDefaultRule:!1,callback:Se,get dialogTitle(){return this.mode==="edit"?o("securityRule.edit"):this.mode==="view"?o("securityRule.view"):o("securityRule.add")}}),s=jt(async()=>{const{accessPolicies:M}=await i.getBlockletAccessPolicies({input:{did:c}});return St(M,T=>T.isProtected?1:0)},{manual:!0}),u=jt(async()=>{const{responseHeaderPolicies:M}=await i.getBlockletResponseHeaderPolicies({input:{did:c}});return St(M,T=>T.isProtected?1:0)},{manual:!0}),{handleSubmit:P,control:v,watch:x,setValue:w,getValues:S,reset:I,formState:{errors:R}}=nr({mode:"onChange",defaultValues:{componentDid:"",pathPattern:"",responseHeaderPolicyId:"",accessPolicyId:"",remark:""}}),p=E(()=>{I(),r.mode="add"}),C=E(()=>{r.show=!1,setTimeout(()=>{p()},t)}),y=E((M,T=null)=>{r.show=!0,T&&(r.isDefaultRule=T.id===N.SECURITY_RULE_DEFAULT_ID,r.mode="edit",w("componentDid",T.componentDid),w("pathPattern",T.pathPattern),w("responseHeaderPolicyId",T.responseHeaderPolicyId),w("accessPolicyId",T.accessPolicyId),w("remark",T.remark||"")),M?r.callback=M:r.mode="view",s.run(),u.run()});H.useImperativeHandle(d,()=>({open:y,close:C}),[y,C]);const f=E(()=>{const[M,T]=S(["accessPolicyId","responseHeaderPolicyId"]);return!M&&!T?o("securityRule.form.accessPolicyOrResponseHeaderPolicyRequired"):!0}),b=E(M=>{const T=f();T===!0?r.callback(M,C):Q.error(T)}),_=x("componentDid"),h=E(M=>{const T=M==null?void 0:M.trim();if(!T)return o("common.requiredErrorText",{name:o("securityRule.form.pathPattern")});if(_){if(T.startsWith("/"))return o("securityRule.form.pathPatternErrorText")}else if(!T.startsWith("/")&&T!=="*")return o("securityRule.form.pathPatternErrorText");return!0}),l=E(M=>(M==null?void 0:M.trim())?!0:o("common.requiredErrorText",{name:o("securityRule.form.accessPolicy")})),g=E(M=>(M==null?void 0:M.trim())?!0:o("common.requiredErrorText",{name:o("securityRule.form.responseHeaderPolicy")})),j=er(()=>{const T=((n==null?void 0:n.children)||[]).find(k=>k.meta.did===_);return T!=null&&T.mountPoint?Wo(T.mountPoint):null},[n,_]);return a.jsx(Gt,{open:r.show,title:r.dialogTitle,onClose:C,PaperProps:{style:{minHeight:"unset"}},actions:a.jsx(Yt,{color:"primary",autoFocus:!0,variant:"contained",onClick:P(b),children:o("common.confirm")}),children:a.jsxs("form",{noValidate:!0,autoComplete:"off",children:[r.isDefaultRule?null:a.jsx(ce,{name:"componentDid",control:v,render:({field:M})=>{var T,k;return a.jsx(Lt,{fullWidth:!0,margin:"dense",size:"small",label:o("securityRule.form.component"),placeholer:o("securityRule.form.componentPlaceholder"),options:n.children.map(L=>({title:L.meta.title,value:L.meta.did,description:L.mountPoint})),error:!!((T=R==null?void 0:R.componentDid)!=null&&T.message),helperText:((k=R==null?void 0:R.componentDid)==null?void 0:k.message)||"Choose belong to component",...Ct(M,"ref"),readOnly:r.mode==="view"})}}),a.jsx(ce,{name:"pathPattern",control:v,rules:{validate:h},render:({field:M})=>{var T,k;return a.jsx(te,{fullWidth:!0,required:!0,margin:"dense",size:"small",placeholder:o("securityRule.form.pathPatternPlaceholder"),label:o("securityRule.form.pathPattern"),error:!!((T=R==null?void 0:R.pathPattern)!=null&&T.message),helperText:((k=R==null?void 0:R.pathPattern)==null?void 0:k.message)||"/abc/bcd or /abc or /abc/*",InputProps:{startAdornment:j?a.jsx(co,{position:"start",children:j}):null},...M,disabled:r.isDefaultRule||r.mode==="view"})}}),a.jsx(ce,{name:"accessPolicyId",control:v,rules:{validate:r.isDefaultRule?l:Se},render:({field:M})=>{var T,k;return a.jsx(Lt,{fullWidth:!0,required:r.isDefaultRule,margin:"dense",size:"small",label:o("securityRule.form.accessPolicy"),placeholer:o("securityRule.form.accessPolicyPlaceholder"),options:(s.data||[]).map(L=>({value:L.id,title:L.name,description:L.description})),error:!!((T=R==null?void 0:R.accessPolicyId)!=null&&T.message),helperText:((k=R==null?void 0:R.accessPolicyId)==null?void 0:k.message)||o("securityRule.form.accessPolicyHelperText"),...Ct(M,"ref"),disabled:r.mode==="view"})}}),a.jsx(ce,{name:"responseHeaderPolicyId",control:v,rules:{validate:r.isDefaultRule?g:Se},render:({field:M})=>{var T,k;return a.jsx(Lt,{fullWidth:!0,required:r.isDefaultRule,margin:"dense",size:"small",label:o("securityRule.form.responseHeaderPolicy"),placeholer:o("securityRule.form.responseHeaderPolicyPlaceholder"),options:(u.data||[]).map(L=>({title:L.name,value:L.id,description:L.description})),error:!!((T=R==null?void 0:R.responseHeaderPolicyId)!=null&&T.message),helperText:((k=R==null?void 0:R.responseHeaderPolicyId)==null?void 0:k.message)||o("securityRule.form.responseHeaderPolicyHelperText"),...Ct(M,"ref"),disabled:r.mode==="view"})}}),a.jsx(ce,{name:"remark",control:v,render:({field:M})=>a.jsx(te,{fullWidth:!0,multiline:!0,minRows:3,maxRows:7,size:"small",margin:"dense",placeholder:o("securityRule.form.remarkPlaceholder"),label:o("securityRule.form.remark"),helperText:R==null?void 0:R.message,...M,disabled:r.mode==="view"})})]})})}),se=async(e,d="Failed to saved")=>{try{await e()}catch(o){Q.error((o==null?void 0:o.message)||d)}};function yn(){var h;const{t:e,locale:d}=Ie(),{blocklet:o}=$t(),{api:n}=Wt(),i=(h=o==null?void 0:o.meta)==null?void 0:h.did,c=kt(),m=H.useRef(null),t=H.useRef(null),{confirmApi:r,confirmHolder:s}=Jt(),u=jt(async()=>{const{securityRules:l}=await n.getBlockletSecurityRules({input:{did:i,includeDisabled:!0}});return l}),P=l=>l.id===N.SECURITY_RULE_DEFAULT_ID,v=E(l=>{var j;return(j=((o==null?void 0:o.children)||[]).find(O=>O.meta.did===l))==null?void 0:j.mountPoint}),x=(u.data||[]).map(l=>{if(l.componentDid){const g=v(l.componentDid);l._disabled=g===void 0}return l}),w=x.filter(l=>!P(l)),S=(l,g)=>{se(async()=>{const j=l.target.checked;await n.updateBlockletSecurityRule({input:{did:i,data:{id:g.id,enabled:j}}}),Q.success(e("common.succeeded")),u.run()})},I=(l,g,j)=>{se(async()=>{const O=j-1,q=x[O];await Promise.all([n.updateBlockletSecurityRule({input:{did:i,data:{id:g.id,priority:q.priority}}}),n.updateBlockletSecurityRule({input:{did:i,data:{id:q.id,priority:g.priority}}})]),Q.success(e("common.succeeded")),u.run()})},R=(l,g,j)=>{se(async()=>{const O=j+1,q=x[O];await Promise.all([n.updateBlockletSecurityRule({input:{did:i,data:{id:g.id,priority:q.priority}}}),n.updateBlockletSecurityRule({input:{did:i,data:{id:q.id,priority:g.priority}}})]),Q.success(e("common.succeeded")),u.run()})},p=()=>{m.current.open((l,g)=>{se(async()=>{await n.addBlockletSecurityRule({input:{did:i,data:l}}),Q.success(e("common.succeeded")),u.run(),g()})})},C=(l,g)=>{m.current.open((j,O)=>{se(async()=>{await n.updateBlockletSecurityRule({input:{did:i,data:{...j,id:g.id}}}),Q.success(e("common.succeeded")),u.run(),O()})},g)},y=(l,g)=>{r.open({title:e("securityRule.delete.title"),content:e("securityRule.delete.description"),confirmButtonText:e("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:e("common.cancel"),onConfirm(j){se(async()=>{await n.deleteBlockletSecurityRule({input:{did:i,id:g.id}}),Q.success(e("common.succeeded")),u.run(),j()})}})},f={sort:!1,download:!1,filter:!1,print:!1,search:!1,viewColumns:!1,expandableRowsOnClick:!0,searchDebounceTime:600,onRowClick(l,{dataIndex:g},j){var O;if((O=t.current)!=null&&O.contains(j.target)){const q=x[g];m.current.open(void 0,q)}},setRowProps:(l,g)=>x[g]._disabled?{title:e("securityRule.useless"),style:{backgroundColor:c.palette.action.disabledBackground,cursor:"default"}}:{}},b=[a.jsx(Ze,{size:"small",variant:"outlined",onClick:()=>{u.run()},sx:{mr:1},children:e("common.refresh")},"refresh"),a.jsx(Ze,{size:"small",variant:"contained",onClick:p,children:e("common.add")})],_=[{label:e("securityRule.form.pathPattern"),name:"pathPattern",options:{customBodyRenderLite(l){const g=x[l];return a.jsx($,{sx:{whiteSpace:"nowrap"},children:g.id===N.SECURITY_RULE_DEFAULT_ID?"Default":Ao(v(g.componentDid),g.pathPattern)})}}},{label:e("responseHeaderPolicy.title"),name:"responseHeaderPolicy",options:{customBodyRenderLite(l){var j;return(j=x[l].responseHeaderPolicy)==null?void 0:j.name}}},{label:e("accessPolicy.title"),name:"accessPolicyId",options:{customBodyRenderLite(l){var j;return(j=x[l].accessPolicy)==null?void 0:j.name}}},{label:e("securityRule.form.remark"),name:"remark"},{label:e("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite(l){const g=x[l],j=P(g);return a.jsx(vn,{disableEdit:g._disabled,disableSwitch:g._disabled,enabled:g.enabled,showSwitch:!j,showDelete:!j,showUp:l>0&&!j,showDown:l<w.length-1&&!j,onClickSwitch:O=>{S(O,g)},onClickUp:O=>{I(O,g,l)},onClickDown:O=>{R(O,g,l)},onClickEdit:O=>{C(O,g)},onClickDelete:O=>{y(O,g)}})}}}].filter(Boolean);return a.jsxs($,{sx:{display:"flex",flexDirection:"column",gap:2},ref:t,children:[a.jsx(Qt,{verticalKeyWidth:100,locale:d,title:a.jsxs($,{sx:{display:"flex",alignItems:"center",gap:1},children:[e("securityRule.title")," ",a.jsx(uo,{variant:"body2",children:e("securityRule.sortByDescription")})]}),data:x,columns:_,customButtons:b,options:f,loading:u.loading}),a.jsx(zo,{ref:m}),s]})}yn.propTypes={};const gn={width:24,height:24,body:'<path fill="currentColor" d="M5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.588 1.413T19 21H5Zm0-2h14V7H5v12Zm7-2q-2.05 0-3.663-1.113T6 13q.725-1.775 2.337-2.888T12 9q2.05 0 3.663 1.113T18 13q-.725 1.775-2.337 2.888T12 17Zm0-2.5q-.625 0-1.063-.438T10.5 13q0-.625.438-1.063T12 11.5q.625 0 1.063.438T13.5 13q0 .625-.438 1.063T12 14.5Zm0 1q1.05 0 1.775-.725T14.5 13q0-1.05-.725-1.775T12 10.5q-1.05 0-1.775.725T9.5 13q0 1.05.725 1.775T12 15.5Z"/>'},bn={width:24,height:24,body:'<path fill="currentColor" d="M6 22q-.825 0-1.413-.588T4 20V10q0-.825.588-1.413T6 8h1V6q0-2.075 1.463-3.538T12 1q2.075 0 3.538 1.463T17 6v2h1q.825 0 1.413.588T20 10v10q0 .825-.588 1.413T18 22H6Zm0-2h12V10H6v10Zm6-3q.825 0 1.413-.588T14 15q0-.825-.588-1.413T12 13q-.825 0-1.413.588T10 15q0 .825.588 1.413T12 17ZM9 8h6V6q0-1.25-.875-2.125T12 3q-1.25 0-2.125.875T9 6v2ZM6 20V10v10Z"/>'};var ir={},Fo=B;Object.defineProperty(ir,"__esModule",{value:!0});var xn=ir.default=void 0,No=Fo(io()),Vo=a;xn=ir.default=(0,No.default)((0,Vo.jsx)("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"}),"GroupRemove");var _n={},Te={};const je=ee(fo),Xe=ee(po);var Et={},Je={},Be={};const Re=ee(mo);var Tt={},fr;function Uo(){if(fr)return Tt;fr=1;var e=B;Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.default=o;var d=e(re);function o(n,i){return(0,d.default)({toolbar:{minHeight:56,[n.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[n.up("sm")]:{minHeight:64}}},i)}return Tt}var _e={},Qe={},pr;function Zo(){if(pr)return Qe;pr=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.default=void 0;const e={black:"#000",white:"#fff"};return Qe.default=e,Qe}var et={},mr;function Xo(){if(mr)return et;mr=1,Object.defineProperty(et,"__esModule",{value:!0}),et.default=void 0;const e={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};return et.default=e,et}var tt={},hr;function Ko(){if(hr)return tt;hr=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;const e={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"};return tt.default=e,tt}var rt={},vr;function Go(){if(vr)return rt;vr=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.default=void 0;const e={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};return rt.default=e,rt}var nt={},yr;function Yo(){if(yr)return nt;yr=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;const e={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};return nt.default=e,nt}var ot={},gr;function Jo(){if(gr)return ot;gr=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.default=void 0;const e={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"};return ot.default=e,ot}var at={},br;function Qo(){if(br)return at;br=1,Object.defineProperty(at,"__esModule",{value:!0}),at.default=void 0;const e={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"};return at.default=e,at}var it={},xr;function ea(){if(xr)return it;xr=1,Object.defineProperty(it,"__esModule",{value:!0}),it.default=void 0;const e={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};return it.default=e,it}var _r;function ta(){if(_r)return _e;_r=1;var e=B;Object.defineProperty(_e,"__esModule",{value:!0}),_e.dark=void 0,_e.default=h,_e.light=void 0;var d=e(re),o=e(ue()),n=e(ln),i=e(tr),c=rr,m=e(Zo()),t=e(Xo()),r=e(Ko()),s=e(Go()),u=e(Yo()),P=e(Jo()),v=e(Qo()),x=e(ea());const w=["mode","contrastThreshold","tonalOffset"],S=_e.light={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:m.default.white,default:m.default.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},I=_e.dark={text:{primary:m.default.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:m.default.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function R(l,g,j,O){const q=O.light||O,A=O.dark||O*1.5;l[g]||(l.hasOwnProperty(j)?l[g]=l[j]:g==="light"?l.light=(0,c.lighten)(l.main,q):g==="dark"&&(l.dark=(0,c.darken)(l.main,A)))}function p(l="light"){return l==="dark"?{main:P.default[200],light:P.default[50],dark:P.default[400]}:{main:P.default[700],light:P.default[400],dark:P.default[800]}}function C(l="light"){return l==="dark"?{main:r.default[200],light:r.default[50],dark:r.default[400]}:{main:r.default[500],light:r.default[300],dark:r.default[700]}}function y(l="light"){return l==="dark"?{main:s.default[500],light:s.default[300],dark:s.default[700]}:{main:s.default[700],light:s.default[400],dark:s.default[800]}}function f(l="light"){return l==="dark"?{main:v.default[400],light:v.default[300],dark:v.default[700]}:{main:v.default[700],light:v.default[500],dark:v.default[900]}}function b(l="light"){return l==="dark"?{main:x.default[400],light:x.default[300],dark:x.default[700]}:{main:x.default[800],light:x.default[500],dark:x.default[900]}}function _(l="light"){return l==="dark"?{main:u.default[400],light:u.default[300],dark:u.default[700]}:{main:"#ed6c02",light:u.default[500],dark:u.default[900]}}function h(l){const{mode:g="light",contrastThreshold:j=3,tonalOffset:O=.2}=l,q=(0,o.default)(l,w),A=l.primary||p(g),M=l.secondary||C(g),T=l.error||y(g),k=l.info||f(g),L=l.success||b(g),V=l.warning||_(g);function J(z){return(0,c.getContrastRatio)(z,I.text.primary)>=j?I.text.primary:S.text.primary}const U=({color:z,name:X,mainShade:de=500,lightShade:ne=300,darkShade:F=700})=>{if(z=(0,d.default)({},z),!z.main&&z[de]&&(z.main=z[de]),!z.hasOwnProperty("main"))throw new Error((0,n.default)(11,X?` (${X})`:"",de));if(typeof z.main!="string")throw new Error((0,n.default)(12,X?` (${X})`:"",JSON.stringify(z.main)));return R(z,"light",ne,O),R(z,"dark",F,O),z.contrastText||(z.contrastText=J(z.main)),z},Z={dark:I,light:S};return(0,i.default)((0,d.default)({common:(0,d.default)({},m.default),mode:g,primary:U({color:A,name:"primary"}),secondary:U({color:M,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:U({color:T,name:"error"}),warning:U({color:V,name:"warning"}),info:U({color:k,name:"info"}),success:U({color:L,name:"success"}),grey:t.default,contrastThreshold:j,getContrastText:J,augmentColor:U,tonalOffset:O},Z[g]),q)}return _e}var qt={},Pr;function ra(){if(Pr)return qt;Pr=1;var e=B;Object.defineProperty(qt,"__esModule",{value:!0}),qt.default=r;var d=e(re),o=e(ue()),n=e(tr);const i=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function c(s){return Math.round(s*1e5)/1e5}const m={textTransform:"uppercase"},t='"Roboto", "Helvetica", "Arial", sans-serif';function r(s,u){const P=typeof u=="function"?u(s):u,{fontFamily:v=t,fontSize:x=14,fontWeightLight:w=300,fontWeightRegular:S=400,fontWeightMedium:I=500,fontWeightBold:R=700,htmlFontSize:p=16,allVariants:C,pxToRem:y}=P,f=(0,o.default)(P,i),b=x/14,_=y||(g=>`${g/p*b}rem`),h=(g,j,O,q,A)=>(0,d.default)({fontFamily:v,fontWeight:g,fontSize:_(j),lineHeight:O},v===t?{letterSpacing:`${c(q/j)}em`}:{},A,C),l={h1:h(w,96,1.167,-1.5),h2:h(w,60,1.2,-.5),h3:h(S,48,1.167,0),h4:h(S,34,1.235,.25),h5:h(S,24,1.334,0),h6:h(I,20,1.6,.15),subtitle1:h(S,16,1.75,.15),subtitle2:h(I,14,1.57,.1),body1:h(S,16,1.5,.15),body2:h(S,14,1.43,.15),button:h(I,14,1.75,.4,m),caption:h(S,12,1.66,.4),overline:h(S,12,2.66,1,m),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,n.default)((0,d.default)({htmlFontSize:p,pxToRem:_,fontFamily:v,fontSize:x,fontWeightLight:w,fontWeightRegular:S,fontWeightMedium:I,fontWeightBold:R},l),f,{clone:!1})}return qt}var st={},Cr;function na(){if(Cr)return st;Cr=1,Object.defineProperty(st,"__esModule",{value:!0}),st.default=void 0;const e=.2,d=.14,o=.12;function n(...c){return[`${c[0]}px ${c[1]}px ${c[2]}px ${c[3]}px rgba(0,0,0,${e})`,`${c[4]}px ${c[5]}px ${c[6]}px ${c[7]}px rgba(0,0,0,${d})`,`${c[8]}px ${c[9]}px ${c[10]}px ${c[11]}px rgba(0,0,0,${o})`].join(",")}const i=["none",n(0,2,1,-1,0,1,1,0,0,1,3,0),n(0,3,1,-2,0,2,2,0,0,1,5,0),n(0,3,3,-2,0,3,4,0,0,1,8,0),n(0,2,4,-1,0,4,5,0,0,1,10,0),n(0,3,5,-1,0,5,8,0,0,1,14,0),n(0,3,5,-1,0,6,10,0,0,1,18,0),n(0,4,5,-2,0,7,10,1,0,2,16,1),n(0,5,5,-3,0,8,10,1,0,3,14,2),n(0,5,6,-3,0,9,12,1,0,3,16,2),n(0,6,6,-3,0,10,14,1,0,4,18,3),n(0,6,7,-4,0,11,15,1,0,4,20,3),n(0,7,8,-4,0,12,17,2,0,5,22,4),n(0,7,8,-4,0,13,19,2,0,5,24,4),n(0,7,9,-4,0,14,21,2,0,5,26,4),n(0,8,9,-5,0,15,22,2,0,6,28,5),n(0,8,10,-5,0,16,24,2,0,6,30,5),n(0,8,11,-5,0,17,26,2,0,6,32,5),n(0,9,11,-5,0,18,28,2,0,7,34,6),n(0,9,12,-6,0,19,29,2,0,7,36,6),n(0,10,13,-6,0,20,31,3,0,8,38,7),n(0,10,13,-6,0,21,33,3,0,8,40,7),n(0,10,14,-6,0,22,35,3,0,8,42,7),n(0,11,14,-7,0,23,36,3,0,9,44,8),n(0,11,15,-7,0,24,38,3,0,9,46,8)];return st.default=i,st}var Pe={},jr;function oa(){if(jr)return Pe;jr=1;var e=B;Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.default=r,Pe.easing=Pe.duration=void 0;var d=e(ue()),o=e(re);const n=["duration","easing","delay"],i=Pe.easing={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},c=Pe.duration={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function m(s){return`${Math.round(s)}ms`}function t(s){if(!s)return 0;const u=s/36;return Math.round((4+15*u**.25+u/5)*10)}function r(s){const u=(0,o.default)({},i,s.easing),P=(0,o.default)({},c,s.duration),v=(x=["all"],w={})=>{const{duration:S=P.standard,easing:I=u.easeInOut,delay:R=0}=w;return(0,d.default)(w,n),(Array.isArray(x)?x:[x]).map(p=>`${p} ${typeof S=="string"?S:m(S)} ${I} ${typeof R=="string"?R:m(R)}`).join(",")};return(0,o.default)({getAutoHeightDuration:t,create:v},s,{easing:u,duration:P})}return Pe}var lt={},Rr;function aa(){if(Rr)return lt;Rr=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.default=void 0;const e={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};return lt.default=e,lt}var Or;function ia(){if(Or)return Be;Or=1;var e=B;Object.defineProperty(Be,"__esModule",{value:!0}),Be.createMuiTheme=R,Be.default=void 0;var d=e(re),o=e(ue()),n=e(ln),i=e(tr),c=S(cn),m=e(ho);e(Re);var t=e(Uo()),r=e(ta()),s=e(ra()),u=e(na()),P=e(oa()),v=e(aa());const x=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function w(p){if(typeof WeakMap!="function")return null;var C=new WeakMap,y=new WeakMap;return(w=function(f){return f?y:C})(p)}function S(p,C){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var y=w(C);if(y&&y.has(p))return y.get(p);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in p)if(_!=="default"&&Object.prototype.hasOwnProperty.call(p,_)){var h=b?Object.getOwnPropertyDescriptor(p,_):null;h&&(h.get||h.set)?Object.defineProperty(f,_,h):f[_]=p[_]}return f.default=p,y&&y.set(p,f),f}function I(p={},...C){const{mixins:y={},palette:f={},transitions:b={},typography:_={}}=p,h=(0,o.default)(p,x);if(p.vars&&p.generateCssVars===void 0)throw new Error((0,n.default)(18));const l=(0,r.default)(f),g=(0,m.default)(p);let j=(0,i.default)(g,{mixins:(0,t.default)(g.breakpoints,y),palette:l,shadows:u.default.slice(),typography:(0,s.default)(l,_),transitions:(0,P.default)(b),zIndex:(0,d.default)({},v.default)});return j=(0,i.default)(j,h),j=C.reduce((O,q)=>(0,i.default)(O,q),j),j.unstable_sxConfig=(0,d.default)({},c.unstable_defaultSxConfig,h==null?void 0:h.unstable_sxConfig),j.unstable_sx=function(q){return(0,c.default)({sx:q,theme:this})},j}function R(...p){return I(...p)}return Be.default=I,Be}var wr;function sa(){if(wr)return Je;wr=1;var e=B;Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var d=e(ia());const o=(0,d.default)();return Je.default=o,Je}var ct={},Tr;function la(){return Tr||(Tr=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.default=void 0,ct.default="$$material"),ct}var ut={},dt={},qr;function Pn(){if(qr)return dt;qr=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.default=void 0;function e(d){return d!=="ownerState"&&d!=="theme"&&d!=="sx"&&d!=="as"}return dt.default=e,dt}var Mr;function ca(){if(Mr)return ut;Mr=1;var e=B;Object.defineProperty(ut,"__esModule",{value:!0}),ut.default=void 0;var d=e(Pn());const o=n=>(0,d.default)(n)&&n!=="classes";return ut.default=o,ut}var Sr;function De(){return Sr||(Sr=1,function(e){"use client";var d=B;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,Object.defineProperty(e,"rootShouldForwardProp",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"slotShouldForwardProp",{enumerable:!0,get:function(){return m.default}});var o=d(vo),n=d(sa()),i=d(la()),c=d(ca()),m=d(Pn());const t=(0,o.default)({themeId:i.default,defaultTheme:n.default,rootShouldForwardProp:c.default});e.default=t}(Et)),Et}var zt={},He={};const ua=ee(yo);var Ir;function da(){if(Ir)return He;Ir=1;var e=B;Object.defineProperty(He,"__esModule",{value:!0}),He.default=void 0,He.useDefaultProps=t;var d=e(re);c(H),e(xe);var o=c(ua),n=a;function i(r){if(typeof WeakMap!="function")return null;var s=new WeakMap,u=new WeakMap;return(i=function(P){return P?u:s})(r)}function c(r,s){if(r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var u=i(s);if(u&&u.has(r))return u.get(r);var P={__proto__:null},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in r)if(x!=="default"&&Object.prototype.hasOwnProperty.call(r,x)){var w=v?Object.getOwnPropertyDescriptor(r,x):null;w&&(w.get||w.set)?Object.defineProperty(P,x,w):P[x]=r[x]}return P.default=r,u&&u.set(r,P),P}function m(r){return(0,n.jsx)(o.default,(0,d.default)({},r))}He.default=m;function t(r){return(0,o.useDefaultProps)(r)}return He}var Dr;function ke(){return Dr||(Dr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"useDefaultProps",{enumerable:!0,get:function(){return d.useDefaultProps}});var d=n(da());function o(i){if(typeof WeakMap!="function")return null;var c=new WeakMap,m=new WeakMap;return(o=function(t){return t?m:c})(i)}function n(i,c){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var m=o(c);if(m&&m.has(i))return m.get(i);var t={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in i)if(s!=="default"&&Object.prototype.hasOwnProperty.call(i,s)){var u=r?Object.getOwnPropertyDescriptor(i,s):null;u&&(u.get||u.set)?Object.defineProperty(t,s,u):t[s]=i[s]}return t.default=i,m&&m.set(i,t),t}}(zt)),zt}var ft={},kr;function sr(){if(kr)return ft;kr=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.default=void 0;var e=o(H);function d(i){if(typeof WeakMap!="function")return null;var c=new WeakMap,m=new WeakMap;return(d=function(t){return t?m:c})(i)}function o(i,c){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var m=d(c);if(m&&m.has(i))return m.get(i);var t={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in i)if(s!=="default"&&Object.prototype.hasOwnProperty.call(i,s)){var u=r?Object.getOwnPropertyDescriptor(i,s):null;u&&(u.get||u.set)?Object.defineProperty(t,s,u):t[s]=i[s]}return t.default=i,m&&m.set(i,t),t}const n=e.createContext({});return ft.default=n,ft}var Ft={},qe={};const fa=ee(go),pa=ee(bo);var pt={};const ma=ee(xo);var $r;function Cn(){if($r)return pt;$r=1;var e=B;Object.defineProperty(pt,"__esModule",{value:!0}),pt.default=void 0;var d=e(ma);return pt.default=d.default,pt}var mt={};const ha=ee(_o);var Wr;function va(){if(Wr)return mt;Wr=1;var e=B;Object.defineProperty(mt,"__esModule",{value:!0}),mt.default=void 0;var d=e(ha);return mt.default=d.default,mt}var ht={};const ya=ee(Po);var Ar;function ga(){if(Ar)return ht;Ar=1;var e=B;Object.defineProperty(ht,"__esModule",{value:!0}),ht.default=void 0;var d=e(ya);return ht.default=d.default,ht}var le={};const ba=ee(Co),xa=ee(jo),_a=ee(Ro);var vt={},Br;function Pa(){if(Br)return vt;Br=1;var e=B;Object.defineProperty(vt,"__esModule",{value:!0}),vt.default=void 0;var d=c(H);e(xe);var o=e(je),n=a;function i(t){if(typeof WeakMap!="function")return null;var r=new WeakMap,s=new WeakMap;return(i=function(u){return u?s:r})(t)}function c(t,r){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var s=i(r);if(s&&s.has(t))return s.get(t);var u={__proto__:null},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in t)if(v!=="default"&&Object.prototype.hasOwnProperty.call(t,v)){var x=P?Object.getOwnPropertyDescriptor(t,v):null;x&&(x.get||x.set)?Object.defineProperty(u,v,x):u[v]=t[v]}return u.default=t,s&&s.set(t,u),u}function m(t){const{className:r,classes:s,pulsate:u=!1,rippleX:P,rippleY:v,rippleSize:x,in:w,onExited:S,timeout:I}=t,[R,p]=d.useState(!1),C=(0,o.default)(r,s.ripple,s.rippleVisible,u&&s.ripplePulsate),y={width:x,height:x,top:-(x/2)+v,left:-(x/2)+P},f=(0,o.default)(s.child,R&&s.childLeaving,u&&s.childPulsate);return!w&&!R&&p(!0),d.useEffect(()=>{if(!w&&S!=null){const b=setTimeout(S,I);return()=>{clearTimeout(b)}}},[S,w,I]),(0,n.jsx)("span",{className:C,style:y,children:(0,n.jsx)("span",{className:f})})}return vt.default=m,vt}var Le={};const $e=ee(Oo);var Hr;function jn(){if(Hr)return Le;Hr=1;var e=B;Object.defineProperty(Le,"__esModule",{value:!0}),Le.default=void 0,Le.getTouchRippleUtilityClass=n;var d=e($e),o=e(Re);function n(c){return(0,o.default)("MuiTouchRipple",c)}const i=(0,d.default)("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]);return Le.default=i,Le}var Lr;function Ca(){if(Lr)return le;Lr=1;var e=B;Object.defineProperty(le,"__esModule",{value:!0}),le.default=le.TouchRippleRoot=le.TouchRippleRipple=le.DELAY_RIPPLE=void 0;var d=e(re),o=e(ue()),n=S(H);e(xe);var i=ba,c=e(je),m=xa,t=e(_a),r=e(De()),s=ke(),u=e(Pa()),P=e(jn()),v=a;const x=["center","classes","className"];function w(h){if(typeof WeakMap!="function")return null;var l=new WeakMap,g=new WeakMap;return(w=function(j){return j?g:l})(h)}function S(h,l){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=w(l);if(g&&g.has(h))return g.get(h);var j={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var q in h)if(q!=="default"&&Object.prototype.hasOwnProperty.call(h,q)){var A=O?Object.getOwnPropertyDescriptor(h,q):null;A&&(A.get||A.set)?Object.defineProperty(j,q,A):j[q]=h[q]}return j.default=h,g&&g.set(h,j),j}const I=550,R=le.DELAY_RIPPLE=80,p=(0,m.keyframes)`
|
|
1
|
+
import{u as Ie,I as Y,b2 as It,j as N,Y as Q,al as Gt,B as Yt,a4 as Jt,a5 as Qt,r as io,ar as so}from"./vendor-ux-did-connect-BdkhddhO.js";import{a as Dt,m as jt,u as E,f as er,l as sn}from"./vendor-hooks-DftG_2gV.js";import{r as H,a as ee,g as lo}from"./vendor-react-DEoibe3W.js";import{H as D,j as a,a9 as $,ac as G,I as he,bt as Rt,e as kt,O as te,N as co,y as Ze,T as uo,a8 as B,cH as fo,cI as po,cJ as mo,cK as re,c3 as ue,cL as ln,cM as tr,cN as rr,cO as ho,cP as cn,cQ as vo,cR as yo,b2 as xe,cS as go,cT as bo,cU as xo,cV as _o,cW as Po,cX as Co,cY as jo,cZ as Ro,c_ as Oo,c$ as wo,d0 as To,bo as ge,bR as Mt,bs as be,bS as Pt,bq as qo,E as Mo,bL as So,C as Io,bX as Do,bu as un,bv as dn,ak as ko,ag as $o}from"./vendor-mui-core-CQ38ohp2.js";import{n as Se,O as St,aI as Wo,C as Ct,y as Ao,az as dr,L as fn,H as Ce,o as pn}from"./vendor-utils-BNHJB5U7.js";import{C as $t,z as Wt,E as nr,F as ce}from"./index-DO3_1y-L.js";import{S as Lt}from"./simple-select-DlrdVbaI.js";import{c as Bo,u as mn}from"./dashboard-8QXGSoVu.js";import{A as hn}from"./config-Bh19ZUJ-.js";import{u as Ho}from"./use-mobile-C_flBrm-.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-ScFEr-lj.js";import"./useLocalStorage-DldnaMbZ.js";import"./confirm-DqvNmeoz.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-DFH1Psjx.js";import"./get-safe-url-Bq9SFfX6.js";import"./session-VIMbdc9j.js";import"./index-DcBUShKK.js";import"./InfoOutlined-CQB5qKm-.js";import"./dot-BE1YP292.js";import"./useAsync-CGW40D2-.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DlKplWTG.js";const Lo={width:24,height:24,body:'<path fill="currentColor" d="M11 14.2V6q0-.425.288-.713T12 5q.425 0 .713.288T13 6v8.2l2.9-2.9q.275-.275.7-.275t.7.275q.275.275.275.7t-.275.7l-4.6 4.6q-.3.3-.7.3t-.7-.3l-4.6-4.6q-.275-.275-.275-.7t.275-.7q.275-.275.7-.275t.7.275l2.9 2.9Z"/>'},Eo={width:24,height:24,body:'<path fill="currentColor" d="m11 8.8l-2.9 2.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L13 8.8V17q0 .425-.288.713T12 18q-.425 0-.713-.288T11 17V8.8Z"/>'},or={width:24,height:24,body:'<path fill="currentColor" d="M7 21q-.825 0-1.413-.588T5 19V6q-.425 0-.713-.288T4 5q0-.425.288-.713T5 4h4q0-.425.288-.713T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6v13q0 .825-.588 1.413T17 21H7Zm2-4h2V8H9v9Zm4 0h2V8h-2v9Z"/>'},ar={width:24,height:24,body:'<path fill="currentColor" d="M4 21q-.425 0-.713-.288T3 20v-2.425q0-.4.15-.763t.425-.637L16.2 3.575q.3-.275.663-.425t.762-.15q.4 0 .775.15t.65.45L20.425 5q.3.275.437.65T21 6.4q0 .4-.138.763t-.437.662l-12.6 12.6q-.275.275-.638.425t-.762.15H4ZM17.6 7.8L19 6.4L17.6 5l-1.4 1.4l1.4 1.4Z"/>'};function vn({enabled:e,showUp:d=!0,showDown:o=!0,showSwitch:n=!0,showDelete:i=!0,showEdit:c=!0,disableEdit:m=!1,disableSwitch:t=!1,onClickUp:r=()=>{},onClickDown:s=()=>{},onClickSwitch:u=()=>{},onClickDelete:P=()=>{},onClickEdit:v=()=>{}}){const{t:x}=Ie();return a.jsxs($,{sx:{display:"flex",alignItems:"center",gap:0},onClick:w=>w.stopPropagation(),children:[c?a.jsx(G,{title:x("common.edit"),children:a.jsx(he,{size:"small",onClick:v,color:"success",disabled:m,children:a.jsx(Y,{icon:ar,fontSize:18})})}):null,i?a.jsx(G,{title:x("common.delete"),children:a.jsx(he,{size:"small",onClick:P,color:"error",children:a.jsx(Y,{icon:or,fontSize:18})})}):null,n?a.jsx(G,{title:x(e?"common.enabled":"common.disabled"),children:a.jsx(Rt,{size:"small",checked:e,onClick:u,disabled:t})}):null,d?a.jsx(G,{title:x("common.moveUp"),children:a.jsx(he,{size:"small",onClick:r,disabled:m,children:a.jsx(Y,{icon:Eo,fontSize:20})})}):null,o?a.jsx(G,{title:x("common.moveDown"),children:a.jsx(he,{size:"small",onClick:s,disabled:m,children:a.jsx(Y,{icon:Lo,fontSize:20})})}):null]})}vn.propTypes={enabled:D.bool.isRequired,showUp:D.bool,showDown:D.bool,showSwitch:D.bool,showDelete:D.bool,showEdit:D.bool,disableEdit:D.bool,disableSwitch:D.bool,onClickUp:D.func,onClickDown:D.func,onClickSwitch:D.func,onClickDelete:D.func,onClickEdit:D.func};const zo=H.forwardRef((e,d)=>{var O,q,A;const{t:o}=H.useContext(It),{blocklet:n}=$t(),{api:i}=Wt(),c=(O=n==null?void 0:n.meta)==null?void 0:O.did,m=kt(),t=((A=(q=m==null?void 0:m.transitions)==null?void 0:q.duration)==null?void 0:A.leavingScreen)||300,r=Dt({mode:"add",show:!1,isDefaultRule:!1,callback:Se,get dialogTitle(){return this.mode==="edit"?o("securityRule.edit"):this.mode==="view"?o("securityRule.view"):o("securityRule.add")}}),s=jt(async()=>{const{accessPolicies:M}=await i.getBlockletAccessPolicies({input:{did:c}});return St(M,T=>T.isProtected?1:0)},{manual:!0}),u=jt(async()=>{const{responseHeaderPolicies:M}=await i.getBlockletResponseHeaderPolicies({input:{did:c}});return St(M,T=>T.isProtected?1:0)},{manual:!0}),{handleSubmit:P,control:v,watch:x,setValue:w,getValues:S,reset:I,formState:{errors:R}}=nr({mode:"onChange",defaultValues:{componentDid:"",pathPattern:"",responseHeaderPolicyId:"",accessPolicyId:"",remark:""}}),p=E(()=>{I(),r.mode="add"}),C=E(()=>{r.show=!1,setTimeout(()=>{p()},t)}),y=E((M,T=null)=>{r.show=!0,T&&(r.isDefaultRule=T.id===N.SECURITY_RULE_DEFAULT_ID,r.mode="edit",w("componentDid",T.componentDid),w("pathPattern",T.pathPattern),w("responseHeaderPolicyId",T.responseHeaderPolicyId),w("accessPolicyId",T.accessPolicyId),w("remark",T.remark||"")),M?r.callback=M:r.mode="view",s.run(),u.run()});H.useImperativeHandle(d,()=>({open:y,close:C}),[y,C]);const f=E(()=>{const[M,T]=S(["accessPolicyId","responseHeaderPolicyId"]);return!M&&!T?o("securityRule.form.accessPolicyOrResponseHeaderPolicyRequired"):!0}),b=E(M=>{const T=f();T===!0?r.callback(M,C):Q.error(T)}),_=x("componentDid"),h=E(M=>{const T=M==null?void 0:M.trim();if(!T)return o("common.requiredErrorText",{name:o("securityRule.form.pathPattern")});if(_){if(T.startsWith("/"))return o("securityRule.form.pathPatternErrorText")}else if(!T.startsWith("/")&&T!=="*")return o("securityRule.form.pathPatternErrorText");return!0}),l=E(M=>(M==null?void 0:M.trim())?!0:o("common.requiredErrorText",{name:o("securityRule.form.accessPolicy")})),g=E(M=>(M==null?void 0:M.trim())?!0:o("common.requiredErrorText",{name:o("securityRule.form.responseHeaderPolicy")})),j=er(()=>{const T=((n==null?void 0:n.children)||[]).find(k=>k.meta.did===_);return T!=null&&T.mountPoint?Wo(T.mountPoint):null},[n,_]);return a.jsx(Gt,{open:r.show,title:r.dialogTitle,onClose:C,PaperProps:{style:{minHeight:"unset"}},actions:a.jsx(Yt,{color:"primary",autoFocus:!0,variant:"contained",onClick:P(b),children:o("common.confirm")}),children:a.jsxs("form",{noValidate:!0,autoComplete:"off",children:[r.isDefaultRule?null:a.jsx(ce,{name:"componentDid",control:v,render:({field:M})=>{var T,k;return a.jsx(Lt,{fullWidth:!0,margin:"dense",size:"small",label:o("securityRule.form.component"),placeholer:o("securityRule.form.componentPlaceholder"),options:n.children.map(L=>({title:L.meta.title,value:L.meta.did,description:L.mountPoint})),error:!!((T=R==null?void 0:R.componentDid)!=null&&T.message),helperText:((k=R==null?void 0:R.componentDid)==null?void 0:k.message)||"Choose belong to component",...Ct(M,"ref"),readOnly:r.mode==="view"})}}),a.jsx(ce,{name:"pathPattern",control:v,rules:{validate:h},render:({field:M})=>{var T,k;return a.jsx(te,{fullWidth:!0,required:!0,margin:"dense",size:"small",placeholder:o("securityRule.form.pathPatternPlaceholder"),label:o("securityRule.form.pathPattern"),error:!!((T=R==null?void 0:R.pathPattern)!=null&&T.message),helperText:((k=R==null?void 0:R.pathPattern)==null?void 0:k.message)||"/abc/bcd or /abc or /abc/*",InputProps:{startAdornment:j?a.jsx(co,{position:"start",children:j}):null},...M,disabled:r.isDefaultRule||r.mode==="view"})}}),a.jsx(ce,{name:"accessPolicyId",control:v,rules:{validate:r.isDefaultRule?l:Se},render:({field:M})=>{var T,k;return a.jsx(Lt,{fullWidth:!0,required:r.isDefaultRule,margin:"dense",size:"small",label:o("securityRule.form.accessPolicy"),placeholer:o("securityRule.form.accessPolicyPlaceholder"),options:(s.data||[]).map(L=>({value:L.id,title:L.name,description:L.description})),error:!!((T=R==null?void 0:R.accessPolicyId)!=null&&T.message),helperText:((k=R==null?void 0:R.accessPolicyId)==null?void 0:k.message)||o("securityRule.form.accessPolicyHelperText"),...Ct(M,"ref"),disabled:r.mode==="view"})}}),a.jsx(ce,{name:"responseHeaderPolicyId",control:v,rules:{validate:r.isDefaultRule?g:Se},render:({field:M})=>{var T,k;return a.jsx(Lt,{fullWidth:!0,required:r.isDefaultRule,margin:"dense",size:"small",label:o("securityRule.form.responseHeaderPolicy"),placeholer:o("securityRule.form.responseHeaderPolicyPlaceholder"),options:(u.data||[]).map(L=>({title:L.name,value:L.id,description:L.description})),error:!!((T=R==null?void 0:R.responseHeaderPolicyId)!=null&&T.message),helperText:((k=R==null?void 0:R.responseHeaderPolicyId)==null?void 0:k.message)||o("securityRule.form.responseHeaderPolicyHelperText"),...Ct(M,"ref"),disabled:r.mode==="view"})}}),a.jsx(ce,{name:"remark",control:v,render:({field:M})=>a.jsx(te,{fullWidth:!0,multiline:!0,minRows:3,maxRows:7,size:"small",margin:"dense",placeholder:o("securityRule.form.remarkPlaceholder"),label:o("securityRule.form.remark"),helperText:R==null?void 0:R.message,...M,disabled:r.mode==="view"})})]})})}),se=async(e,d="Failed to saved")=>{try{await e()}catch(o){Q.error((o==null?void 0:o.message)||d)}};function yn(){var h;const{t:e,locale:d}=Ie(),{blocklet:o}=$t(),{api:n}=Wt(),i=(h=o==null?void 0:o.meta)==null?void 0:h.did,c=kt(),m=H.useRef(null),t=H.useRef(null),{confirmApi:r,confirmHolder:s}=Jt(),u=jt(async()=>{const{securityRules:l}=await n.getBlockletSecurityRules({input:{did:i,includeDisabled:!0}});return l}),P=l=>l.id===N.SECURITY_RULE_DEFAULT_ID,v=E(l=>{var j;return(j=((o==null?void 0:o.children)||[]).find(O=>O.meta.did===l))==null?void 0:j.mountPoint}),x=(u.data||[]).map(l=>{if(l.componentDid){const g=v(l.componentDid);l._disabled=g===void 0}return l}),w=x.filter(l=>!P(l)),S=(l,g)=>{se(async()=>{const j=l.target.checked;await n.updateBlockletSecurityRule({input:{did:i,data:{id:g.id,enabled:j}}}),Q.success(e("common.succeeded")),u.run()})},I=(l,g,j)=>{se(async()=>{const O=j-1,q=x[O];await Promise.all([n.updateBlockletSecurityRule({input:{did:i,data:{id:g.id,priority:q.priority}}}),n.updateBlockletSecurityRule({input:{did:i,data:{id:q.id,priority:g.priority}}})]),Q.success(e("common.succeeded")),u.run()})},R=(l,g,j)=>{se(async()=>{const O=j+1,q=x[O];await Promise.all([n.updateBlockletSecurityRule({input:{did:i,data:{id:g.id,priority:q.priority}}}),n.updateBlockletSecurityRule({input:{did:i,data:{id:q.id,priority:g.priority}}})]),Q.success(e("common.succeeded")),u.run()})},p=()=>{m.current.open((l,g)=>{se(async()=>{await n.addBlockletSecurityRule({input:{did:i,data:l}}),Q.success(e("common.succeeded")),u.run(),g()})})},C=(l,g)=>{m.current.open((j,O)=>{se(async()=>{await n.updateBlockletSecurityRule({input:{did:i,data:{...j,id:g.id}}}),Q.success(e("common.succeeded")),u.run(),O()})},g)},y=(l,g)=>{r.open({title:e("securityRule.delete.title"),content:e("securityRule.delete.description"),confirmButtonText:e("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:e("common.cancel"),onConfirm(j){se(async()=>{await n.deleteBlockletSecurityRule({input:{did:i,id:g.id}}),Q.success(e("common.succeeded")),u.run(),j()})}})},f={sort:!1,download:!1,filter:!1,print:!1,search:!1,viewColumns:!1,expandableRowsOnClick:!0,searchDebounceTime:600,onRowClick(l,{dataIndex:g},j){var O;if((O=t.current)!=null&&O.contains(j.target)){const q=x[g];m.current.open(void 0,q)}},setRowProps:(l,g)=>x[g]._disabled?{title:e("securityRule.useless"),style:{backgroundColor:c.palette.action.disabledBackground,cursor:"default"}}:{}},b=[a.jsx(Ze,{size:"small",variant:"outlined",onClick:()=>{u.run()},sx:{mr:1},children:e("common.refresh")},"refresh"),a.jsx(Ze,{size:"small",variant:"contained",onClick:p,children:e("common.add")})],_=[{label:e("securityRule.form.pathPattern"),name:"pathPattern",options:{customBodyRenderLite(l){const g=x[l];return a.jsx($,{sx:{whiteSpace:"nowrap"},children:g.id===N.SECURITY_RULE_DEFAULT_ID?"Default":Ao(v(g.componentDid),g.pathPattern)})}}},{label:e("responseHeaderPolicy.title"),name:"responseHeaderPolicy",options:{customBodyRenderLite(l){var j;return(j=x[l].responseHeaderPolicy)==null?void 0:j.name}}},{label:e("accessPolicy.title"),name:"accessPolicyId",options:{customBodyRenderLite(l){var j;return(j=x[l].accessPolicy)==null?void 0:j.name}}},{label:e("securityRule.form.remark"),name:"remark"},{label:e("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite(l){const g=x[l],j=P(g);return a.jsx(vn,{disableEdit:g._disabled,disableSwitch:g._disabled,enabled:g.enabled,showSwitch:!j,showDelete:!j,showUp:l>0&&!j,showDown:l<w.length-1&&!j,onClickSwitch:O=>{S(O,g)},onClickUp:O=>{I(O,g,l)},onClickDown:O=>{R(O,g,l)},onClickEdit:O=>{C(O,g)},onClickDelete:O=>{y(O,g)}})}}}].filter(Boolean);return a.jsxs($,{sx:{display:"flex",flexDirection:"column",gap:2},ref:t,children:[a.jsx(Qt,{verticalKeyWidth:100,locale:d,title:a.jsxs($,{sx:{display:"flex",alignItems:"center",gap:1},children:[e("securityRule.title")," ",a.jsx(uo,{variant:"body2",children:e("securityRule.sortByDescription")})]}),data:x,columns:_,customButtons:b,options:f,loading:u.loading}),a.jsx(zo,{ref:m}),s]})}yn.propTypes={};const gn={width:24,height:24,body:'<path fill="currentColor" d="M5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.588 1.413T19 21H5Zm0-2h14V7H5v12Zm7-2q-2.05 0-3.663-1.113T6 13q.725-1.775 2.337-2.888T12 9q2.05 0 3.663 1.113T18 13q-.725 1.775-2.337 2.888T12 17Zm0-2.5q-.625 0-1.063-.438T10.5 13q0-.625.438-1.063T12 11.5q.625 0 1.063.438T13.5 13q0 .625-.438 1.063T12 14.5Zm0 1q1.05 0 1.775-.725T14.5 13q0-1.05-.725-1.775T12 10.5q-1.05 0-1.775.725T9.5 13q0 1.05.725 1.775T12 15.5Z"/>'},bn={width:24,height:24,body:'<path fill="currentColor" d="M6 22q-.825 0-1.413-.588T4 20V10q0-.825.588-1.413T6 8h1V6q0-2.075 1.463-3.538T12 1q2.075 0 3.538 1.463T17 6v2h1q.825 0 1.413.588T20 10v10q0 .825-.588 1.413T18 22H6Zm0-2h12V10H6v10Zm6-3q.825 0 1.413-.588T14 15q0-.825-.588-1.413T12 13q-.825 0-1.413.588T10 15q0 .825.588 1.413T12 17ZM9 8h6V6q0-1.25-.875-2.125T12 3q-1.25 0-2.125.875T9 6v2ZM6 20V10v10Z"/>'};var ir={},Fo=B;Object.defineProperty(ir,"__esModule",{value:!0});var xn=ir.default=void 0,No=Fo(io()),Vo=a;xn=ir.default=(0,No.default)((0,Vo.jsx)("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"}),"GroupRemove");var _n={},Te={};const je=ee(fo),Xe=ee(po);var Et={},Je={},Be={};const Re=ee(mo);var Tt={},fr;function Uo(){if(fr)return Tt;fr=1;var e=B;Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.default=o;var d=e(re);function o(n,i){return(0,d.default)({toolbar:{minHeight:56,[n.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[n.up("sm")]:{minHeight:64}}},i)}return Tt}var _e={},Qe={},pr;function Zo(){if(pr)return Qe;pr=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.default=void 0;const e={black:"#000",white:"#fff"};return Qe.default=e,Qe}var et={},mr;function Xo(){if(mr)return et;mr=1,Object.defineProperty(et,"__esModule",{value:!0}),et.default=void 0;const e={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};return et.default=e,et}var tt={},hr;function Ko(){if(hr)return tt;hr=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;const e={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"};return tt.default=e,tt}var rt={},vr;function Go(){if(vr)return rt;vr=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.default=void 0;const e={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};return rt.default=e,rt}var nt={},yr;function Yo(){if(yr)return nt;yr=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;const e={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"};return nt.default=e,nt}var ot={},gr;function Jo(){if(gr)return ot;gr=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.default=void 0;const e={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"};return ot.default=e,ot}var at={},br;function Qo(){if(br)return at;br=1,Object.defineProperty(at,"__esModule",{value:!0}),at.default=void 0;const e={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"};return at.default=e,at}var it={},xr;function ea(){if(xr)return it;xr=1,Object.defineProperty(it,"__esModule",{value:!0}),it.default=void 0;const e={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};return it.default=e,it}var _r;function ta(){if(_r)return _e;_r=1;var e=B;Object.defineProperty(_e,"__esModule",{value:!0}),_e.dark=void 0,_e.default=h,_e.light=void 0;var d=e(re),o=e(ue()),n=e(ln),i=e(tr),c=rr,m=e(Zo()),t=e(Xo()),r=e(Ko()),s=e(Go()),u=e(Yo()),P=e(Jo()),v=e(Qo()),x=e(ea());const w=["mode","contrastThreshold","tonalOffset"],S=_e.light={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:m.default.white,default:m.default.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},I=_e.dark={text:{primary:m.default.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:m.default.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function R(l,g,j,O){const q=O.light||O,A=O.dark||O*1.5;l[g]||(l.hasOwnProperty(j)?l[g]=l[j]:g==="light"?l.light=(0,c.lighten)(l.main,q):g==="dark"&&(l.dark=(0,c.darken)(l.main,A)))}function p(l="light"){return l==="dark"?{main:P.default[200],light:P.default[50],dark:P.default[400]}:{main:P.default[700],light:P.default[400],dark:P.default[800]}}function C(l="light"){return l==="dark"?{main:r.default[200],light:r.default[50],dark:r.default[400]}:{main:r.default[500],light:r.default[300],dark:r.default[700]}}function y(l="light"){return l==="dark"?{main:s.default[500],light:s.default[300],dark:s.default[700]}:{main:s.default[700],light:s.default[400],dark:s.default[800]}}function f(l="light"){return l==="dark"?{main:v.default[400],light:v.default[300],dark:v.default[700]}:{main:v.default[700],light:v.default[500],dark:v.default[900]}}function b(l="light"){return l==="dark"?{main:x.default[400],light:x.default[300],dark:x.default[700]}:{main:x.default[800],light:x.default[500],dark:x.default[900]}}function _(l="light"){return l==="dark"?{main:u.default[400],light:u.default[300],dark:u.default[700]}:{main:"#ed6c02",light:u.default[500],dark:u.default[900]}}function h(l){const{mode:g="light",contrastThreshold:j=3,tonalOffset:O=.2}=l,q=(0,o.default)(l,w),A=l.primary||p(g),M=l.secondary||C(g),T=l.error||y(g),k=l.info||f(g),L=l.success||b(g),V=l.warning||_(g);function J(z){return(0,c.getContrastRatio)(z,I.text.primary)>=j?I.text.primary:S.text.primary}const U=({color:z,name:X,mainShade:de=500,lightShade:ne=300,darkShade:F=700})=>{if(z=(0,d.default)({},z),!z.main&&z[de]&&(z.main=z[de]),!z.hasOwnProperty("main"))throw new Error((0,n.default)(11,X?` (${X})`:"",de));if(typeof z.main!="string")throw new Error((0,n.default)(12,X?` (${X})`:"",JSON.stringify(z.main)));return R(z,"light",ne,O),R(z,"dark",F,O),z.contrastText||(z.contrastText=J(z.main)),z},Z={dark:I,light:S};return(0,i.default)((0,d.default)({common:(0,d.default)({},m.default),mode:g,primary:U({color:A,name:"primary"}),secondary:U({color:M,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:U({color:T,name:"error"}),warning:U({color:V,name:"warning"}),info:U({color:k,name:"info"}),success:U({color:L,name:"success"}),grey:t.default,contrastThreshold:j,getContrastText:J,augmentColor:U,tonalOffset:O},Z[g]),q)}return _e}var qt={},Pr;function ra(){if(Pr)return qt;Pr=1;var e=B;Object.defineProperty(qt,"__esModule",{value:!0}),qt.default=r;var d=e(re),o=e(ue()),n=e(tr);const i=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function c(s){return Math.round(s*1e5)/1e5}const m={textTransform:"uppercase"},t='"Roboto", "Helvetica", "Arial", sans-serif';function r(s,u){const P=typeof u=="function"?u(s):u,{fontFamily:v=t,fontSize:x=14,fontWeightLight:w=300,fontWeightRegular:S=400,fontWeightMedium:I=500,fontWeightBold:R=700,htmlFontSize:p=16,allVariants:C,pxToRem:y}=P,f=(0,o.default)(P,i),b=x/14,_=y||(g=>`${g/p*b}rem`),h=(g,j,O,q,A)=>(0,d.default)({fontFamily:v,fontWeight:g,fontSize:_(j),lineHeight:O},v===t?{letterSpacing:`${c(q/j)}em`}:{},A,C),l={h1:h(w,96,1.167,-1.5),h2:h(w,60,1.2,-.5),h3:h(S,48,1.167,0),h4:h(S,34,1.235,.25),h5:h(S,24,1.334,0),h6:h(I,20,1.6,.15),subtitle1:h(S,16,1.75,.15),subtitle2:h(I,14,1.57,.1),body1:h(S,16,1.5,.15),body2:h(S,14,1.43,.15),button:h(I,14,1.75,.4,m),caption:h(S,12,1.66,.4),overline:h(S,12,2.66,1,m),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,n.default)((0,d.default)({htmlFontSize:p,pxToRem:_,fontFamily:v,fontSize:x,fontWeightLight:w,fontWeightRegular:S,fontWeightMedium:I,fontWeightBold:R},l),f,{clone:!1})}return qt}var st={},Cr;function na(){if(Cr)return st;Cr=1,Object.defineProperty(st,"__esModule",{value:!0}),st.default=void 0;const e=.2,d=.14,o=.12;function n(...c){return[`${c[0]}px ${c[1]}px ${c[2]}px ${c[3]}px rgba(0,0,0,${e})`,`${c[4]}px ${c[5]}px ${c[6]}px ${c[7]}px rgba(0,0,0,${d})`,`${c[8]}px ${c[9]}px ${c[10]}px ${c[11]}px rgba(0,0,0,${o})`].join(",")}const i=["none",n(0,2,1,-1,0,1,1,0,0,1,3,0),n(0,3,1,-2,0,2,2,0,0,1,5,0),n(0,3,3,-2,0,3,4,0,0,1,8,0),n(0,2,4,-1,0,4,5,0,0,1,10,0),n(0,3,5,-1,0,5,8,0,0,1,14,0),n(0,3,5,-1,0,6,10,0,0,1,18,0),n(0,4,5,-2,0,7,10,1,0,2,16,1),n(0,5,5,-3,0,8,10,1,0,3,14,2),n(0,5,6,-3,0,9,12,1,0,3,16,2),n(0,6,6,-3,0,10,14,1,0,4,18,3),n(0,6,7,-4,0,11,15,1,0,4,20,3),n(0,7,8,-4,0,12,17,2,0,5,22,4),n(0,7,8,-4,0,13,19,2,0,5,24,4),n(0,7,9,-4,0,14,21,2,0,5,26,4),n(0,8,9,-5,0,15,22,2,0,6,28,5),n(0,8,10,-5,0,16,24,2,0,6,30,5),n(0,8,11,-5,0,17,26,2,0,6,32,5),n(0,9,11,-5,0,18,28,2,0,7,34,6),n(0,9,12,-6,0,19,29,2,0,7,36,6),n(0,10,13,-6,0,20,31,3,0,8,38,7),n(0,10,13,-6,0,21,33,3,0,8,40,7),n(0,10,14,-6,0,22,35,3,0,8,42,7),n(0,11,14,-7,0,23,36,3,0,9,44,8),n(0,11,15,-7,0,24,38,3,0,9,46,8)];return st.default=i,st}var Pe={},jr;function oa(){if(jr)return Pe;jr=1;var e=B;Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.default=r,Pe.easing=Pe.duration=void 0;var d=e(ue()),o=e(re);const n=["duration","easing","delay"],i=Pe.easing={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},c=Pe.duration={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function m(s){return`${Math.round(s)}ms`}function t(s){if(!s)return 0;const u=s/36;return Math.round((4+15*u**.25+u/5)*10)}function r(s){const u=(0,o.default)({},i,s.easing),P=(0,o.default)({},c,s.duration),v=(x=["all"],w={})=>{const{duration:S=P.standard,easing:I=u.easeInOut,delay:R=0}=w;return(0,d.default)(w,n),(Array.isArray(x)?x:[x]).map(p=>`${p} ${typeof S=="string"?S:m(S)} ${I} ${typeof R=="string"?R:m(R)}`).join(",")};return(0,o.default)({getAutoHeightDuration:t,create:v},s,{easing:u,duration:P})}return Pe}var lt={},Rr;function aa(){if(Rr)return lt;Rr=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.default=void 0;const e={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};return lt.default=e,lt}var Or;function ia(){if(Or)return Be;Or=1;var e=B;Object.defineProperty(Be,"__esModule",{value:!0}),Be.createMuiTheme=R,Be.default=void 0;var d=e(re),o=e(ue()),n=e(ln),i=e(tr),c=S(cn),m=e(ho);e(Re);var t=e(Uo()),r=e(ta()),s=e(ra()),u=e(na()),P=e(oa()),v=e(aa());const x=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function w(p){if(typeof WeakMap!="function")return null;var C=new WeakMap,y=new WeakMap;return(w=function(f){return f?y:C})(p)}function S(p,C){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var y=w(C);if(y&&y.has(p))return y.get(p);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in p)if(_!=="default"&&Object.prototype.hasOwnProperty.call(p,_)){var h=b?Object.getOwnPropertyDescriptor(p,_):null;h&&(h.get||h.set)?Object.defineProperty(f,_,h):f[_]=p[_]}return f.default=p,y&&y.set(p,f),f}function I(p={},...C){const{mixins:y={},palette:f={},transitions:b={},typography:_={}}=p,h=(0,o.default)(p,x);if(p.vars&&p.generateCssVars===void 0)throw new Error((0,n.default)(18));const l=(0,r.default)(f),g=(0,m.default)(p);let j=(0,i.default)(g,{mixins:(0,t.default)(g.breakpoints,y),palette:l,shadows:u.default.slice(),typography:(0,s.default)(l,_),transitions:(0,P.default)(b),zIndex:(0,d.default)({},v.default)});return j=(0,i.default)(j,h),j=C.reduce((O,q)=>(0,i.default)(O,q),j),j.unstable_sxConfig=(0,d.default)({},c.unstable_defaultSxConfig,h==null?void 0:h.unstable_sxConfig),j.unstable_sx=function(q){return(0,c.default)({sx:q,theme:this})},j}function R(...p){return I(...p)}return Be.default=I,Be}var wr;function sa(){if(wr)return Je;wr=1;var e=B;Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var d=e(ia());const o=(0,d.default)();return Je.default=o,Je}var ct={},Tr;function la(){return Tr||(Tr=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.default=void 0,ct.default="$$material"),ct}var ut={},dt={},qr;function Pn(){if(qr)return dt;qr=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.default=void 0;function e(d){return d!=="ownerState"&&d!=="theme"&&d!=="sx"&&d!=="as"}return dt.default=e,dt}var Mr;function ca(){if(Mr)return ut;Mr=1;var e=B;Object.defineProperty(ut,"__esModule",{value:!0}),ut.default=void 0;var d=e(Pn());const o=n=>(0,d.default)(n)&&n!=="classes";return ut.default=o,ut}var Sr;function De(){return Sr||(Sr=1,function(e){"use client";var d=B;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,Object.defineProperty(e,"rootShouldForwardProp",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"slotShouldForwardProp",{enumerable:!0,get:function(){return m.default}});var o=d(vo),n=d(sa()),i=d(la()),c=d(ca()),m=d(Pn());const t=(0,o.default)({themeId:i.default,defaultTheme:n.default,rootShouldForwardProp:c.default});e.default=t}(Et)),Et}var zt={},He={};const ua=ee(yo);var Ir;function da(){if(Ir)return He;Ir=1;var e=B;Object.defineProperty(He,"__esModule",{value:!0}),He.default=void 0,He.useDefaultProps=t;var d=e(re);c(H),e(xe);var o=c(ua),n=a;function i(r){if(typeof WeakMap!="function")return null;var s=new WeakMap,u=new WeakMap;return(i=function(P){return P?u:s})(r)}function c(r,s){if(r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var u=i(s);if(u&&u.has(r))return u.get(r);var P={__proto__:null},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in r)if(x!=="default"&&Object.prototype.hasOwnProperty.call(r,x)){var w=v?Object.getOwnPropertyDescriptor(r,x):null;w&&(w.get||w.set)?Object.defineProperty(P,x,w):P[x]=r[x]}return P.default=r,u&&u.set(r,P),P}function m(r){return(0,n.jsx)(o.default,(0,d.default)({},r))}He.default=m;function t(r){return(0,o.useDefaultProps)(r)}return He}var Dr;function ke(){return Dr||(Dr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"useDefaultProps",{enumerable:!0,get:function(){return d.useDefaultProps}});var d=n(da());function o(i){if(typeof WeakMap!="function")return null;var c=new WeakMap,m=new WeakMap;return(o=function(t){return t?m:c})(i)}function n(i,c){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var m=o(c);if(m&&m.has(i))return m.get(i);var t={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in i)if(s!=="default"&&Object.prototype.hasOwnProperty.call(i,s)){var u=r?Object.getOwnPropertyDescriptor(i,s):null;u&&(u.get||u.set)?Object.defineProperty(t,s,u):t[s]=i[s]}return t.default=i,m&&m.set(i,t),t}}(zt)),zt}var ft={},kr;function sr(){if(kr)return ft;kr=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.default=void 0;var e=o(H);function d(i){if(typeof WeakMap!="function")return null;var c=new WeakMap,m=new WeakMap;return(d=function(t){return t?m:c})(i)}function o(i,c){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var m=d(c);if(m&&m.has(i))return m.get(i);var t={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in i)if(s!=="default"&&Object.prototype.hasOwnProperty.call(i,s)){var u=r?Object.getOwnPropertyDescriptor(i,s):null;u&&(u.get||u.set)?Object.defineProperty(t,s,u):t[s]=i[s]}return t.default=i,m&&m.set(i,t),t}const n=e.createContext({});return ft.default=n,ft}var Ft={},qe={};const fa=ee(go),pa=ee(bo);var pt={};const ma=ee(xo);var $r;function Cn(){if($r)return pt;$r=1;var e=B;Object.defineProperty(pt,"__esModule",{value:!0}),pt.default=void 0;var d=e(ma);return pt.default=d.default,pt}var mt={};const ha=ee(_o);var Wr;function va(){if(Wr)return mt;Wr=1;var e=B;Object.defineProperty(mt,"__esModule",{value:!0}),mt.default=void 0;var d=e(ha);return mt.default=d.default,mt}var ht={};const ya=ee(Po);var Ar;function ga(){if(Ar)return ht;Ar=1;var e=B;Object.defineProperty(ht,"__esModule",{value:!0}),ht.default=void 0;var d=e(ya);return ht.default=d.default,ht}var le={};const ba=ee(Co),xa=ee(jo),_a=ee(Ro);var vt={},Br;function Pa(){if(Br)return vt;Br=1;var e=B;Object.defineProperty(vt,"__esModule",{value:!0}),vt.default=void 0;var d=c(H);e(xe);var o=e(je),n=a;function i(t){if(typeof WeakMap!="function")return null;var r=new WeakMap,s=new WeakMap;return(i=function(u){return u?s:r})(t)}function c(t,r){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var s=i(r);if(s&&s.has(t))return s.get(t);var u={__proto__:null},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in t)if(v!=="default"&&Object.prototype.hasOwnProperty.call(t,v)){var x=P?Object.getOwnPropertyDescriptor(t,v):null;x&&(x.get||x.set)?Object.defineProperty(u,v,x):u[v]=t[v]}return u.default=t,s&&s.set(t,u),u}function m(t){const{className:r,classes:s,pulsate:u=!1,rippleX:P,rippleY:v,rippleSize:x,in:w,onExited:S,timeout:I}=t,[R,p]=d.useState(!1),C=(0,o.default)(r,s.ripple,s.rippleVisible,u&&s.ripplePulsate),y={width:x,height:x,top:-(x/2)+v,left:-(x/2)+P},f=(0,o.default)(s.child,R&&s.childLeaving,u&&s.childPulsate);return!w&&!R&&p(!0),d.useEffect(()=>{if(!w&&S!=null){const b=setTimeout(S,I);return()=>{clearTimeout(b)}}},[S,w,I]),(0,n.jsx)("span",{className:C,style:y,children:(0,n.jsx)("span",{className:f})})}return vt.default=m,vt}var Le={};const $e=ee(Oo);var Hr;function jn(){if(Hr)return Le;Hr=1;var e=B;Object.defineProperty(Le,"__esModule",{value:!0}),Le.default=void 0,Le.getTouchRippleUtilityClass=n;var d=e($e),o=e(Re);function n(c){return(0,o.default)("MuiTouchRipple",c)}const i=(0,d.default)("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]);return Le.default=i,Le}var Lr;function Ca(){if(Lr)return le;Lr=1;var e=B;Object.defineProperty(le,"__esModule",{value:!0}),le.default=le.TouchRippleRoot=le.TouchRippleRipple=le.DELAY_RIPPLE=void 0;var d=e(re),o=e(ue()),n=S(H);e(xe);var i=ba,c=e(je),m=xa,t=e(_a),r=e(De()),s=ke(),u=e(Pa()),P=e(jn()),v=a;const x=["center","classes","className"];function w(h){if(typeof WeakMap!="function")return null;var l=new WeakMap,g=new WeakMap;return(w=function(j){return j?g:l})(h)}function S(h,l){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=w(l);if(g&&g.has(h))return g.get(h);var j={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var q in h)if(q!=="default"&&Object.prototype.hasOwnProperty.call(h,q)){var A=O?Object.getOwnPropertyDescriptor(h,q):null;A&&(A.get||A.set)?Object.defineProperty(j,q,A):j[q]=h[q]}return j.default=h,g&&g.set(h,j),j}const I=550,R=le.DELAY_RIPPLE=80,p=(0,m.keyframes)`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
opacity: 0.1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-DM2xKEWk.js","assets/vendor-mui-core-CQ38ohp2.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-BNHJB5U7.js","assets/useAsync-CGW40D2-.js","assets/vendor-hooks-DftG_2gV.js","assets/vendor-ux-did-connect-BdkhddhO.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-DO3_1y-L.js","assets/vendor-arcblock-ScFEr-lj.js","assets/index-B1ljmpu4.css","assets/config-1xq1_d84.js","assets/index-Cjjg2_Xp.js","assets/Done-JLiLhELm.js","assets/Google-GOp5YvmZ.js","assets/cloneDeep-SfcdeqEN.js","assets/logo-uploader-CJrdpVcQ.js","assets/index-DVQCgvFb.js","assets/page-header-CWY8mxlT.js","assets/layout-Cw-hwCHs.js","assets/content-layout-BPaAeaMQ.js","assets/step-actions-D_1PFeFs.js","assets/use-mobile-
|
|
2
|
-
import{S as Q,_ as d,c as _,L as W}from"./vendor-arcblock-ScFEr-lj.js";import{j as e,ag as T,v as q,e as K,bD as G,a9 as X,aa as J,b6 as Y}from"./vendor-mui-core-CQ38ohp2.js";import{h as ee,f as te,r as i,i as se,j as c,k as oe}from"./vendor-react-DEoibe3W.js";import{y as o}from"./vendor-utils-BNHJB5U7.js";import{u as ae,aT as ne,j as V}from"./vendor-ux-did-connect-BdkhddhO.js";import{C as re}from"./config-space-CYg-72ab.js";import{H as ie}from"./addon-Bcc-Xwbf.js";import{S as le}from"./ServerLogo-Bssx1Eou.js";import{n as pe,u as ce,o as k,q as de,r as ue,P as A,N as Le,f as me,S as he}from"./index-DO3_1y-L.js";import{g as fe}from"./get-safe-url-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-DM2xKEWk.js","assets/vendor-mui-core-CQ38ohp2.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-BNHJB5U7.js","assets/useAsync-CGW40D2-.js","assets/vendor-hooks-DftG_2gV.js","assets/vendor-ux-did-connect-BdkhddhO.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-DO3_1y-L.js","assets/vendor-arcblock-ScFEr-lj.js","assets/index-B1ljmpu4.css","assets/config-1xq1_d84.js","assets/index-Cjjg2_Xp.js","assets/Done-JLiLhELm.js","assets/Google-GOp5YvmZ.js","assets/cloneDeep-SfcdeqEN.js","assets/logo-uploader-CJrdpVcQ.js","assets/index-DVQCgvFb.js","assets/page-header-CWY8mxlT.js","assets/layout-Cw-hwCHs.js","assets/content-layout-BPaAeaMQ.js","assets/step-actions-D_1PFeFs.js","assets/use-mobile-DlKplWTG.js","assets/button-BeZibzB9.js","assets/index-slEV_y-C.js","assets/config-space-CYg-72ab.js","assets/spaces-WkJCApHO.js","assets/api-BrU7j0QA.js","assets/connect-to-Ck5O2M1K.js","assets/DeleteOutline-C2sY6hfm.js","assets/format-error-BrmqJs5a.js","assets/domain-ag7_Ivc1.js","assets/domain-action-card-D3w6jyPR.js","assets/ExpandLess-BiMmSOBl.js","assets/permission-BGM09622.js","assets/session-VIMbdc9j.js","assets/dot-BE1YP292.js","assets/confirm-DqvNmeoz.js","assets/actions-DA-6s_nQ.js","assets/MoreHoriz-CX_pwfPT.js","assets/delete-confirm-_BzUlhv2.js","assets/click-to-copy-BGyXQL2i.js","assets/util-Bjy-tP7q.js","assets/useSetState-CWq0AVWn.js","assets/InfoOutlined-CQB5qKm-.js","assets/index-CGBZONPv.js","assets/CheckCircle-BNrN9mgy.js","assets/access-control-B20P1UrY.js","assets/config-Bh19ZUJ-.js","assets/fuel-CcBzY6Bt.js","assets/Launch-fxgQvk19.js","assets/did-address-DUThaBlf.js","assets/complete-BzCBoyhn.js","assets/launch-result-message-C9huWJUf.js","assets/get-safe-url-DBsPGn--.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{S as Q,_ as d,c as _,L as W}from"./vendor-arcblock-ScFEr-lj.js";import{j as e,ag as T,v as q,e as K,bD as G,a9 as X,aa as J,b6 as Y}from"./vendor-mui-core-CQ38ohp2.js";import{h as ee,f as te,r as i,i as se,j as c,k as oe}from"./vendor-react-DEoibe3W.js";import{y as o}from"./vendor-utils-BNHJB5U7.js";import{u as ae,aT as ne,j as V}from"./vendor-ux-did-connect-BdkhddhO.js";import{C as re}from"./config-space-CYg-72ab.js";import{H as ie}from"./addon-Bcc-Xwbf.js";import{S as le}from"./ServerLogo-Bssx1Eou.js";import{n as pe,u as ce,o as k,q as de,r as ue,P as A,N as Le,f as me,S as he}from"./index-DO3_1y-L.js";import{g as fe}from"./get-safe-url-DBsPGn--.js";import"./vendor-hooks-DftG_2gV.js";import"./lottie-web-jYmAQWuC.js";import"./spaces-WkJCApHO.js";import"./api-BrU7j0QA.js";import"./QuestionMarkCircle-p6m3avKp.js";var E=function(m){return e.jsxs("svg",{...m,children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z",fill:"url(#paint0_linear_615_426)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z",fill:"url(#paint1_linear_615_426)"}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"paint0_linear_615_426",x1:"31.72",y1:"95.7208",x2:"95.488",y2:"34.3249",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#0FA4B7"}),e.jsx("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),e.jsx("stop",{offset:"1",stopColor:"#2BE0D7"})]}),e.jsxs("linearGradient",{id:"paint1_linear_615_426",x1:"28.4374",y1:"99.2464",x2:"98.7613",y2:"44.9372",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#0FA4B7"}),e.jsx("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),e.jsx("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]})};E.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};E.displayName="server-logo-notext";const xe=E,_e=T.span`
|
|
3
3
|
color: ${m=>m.theme.palette.error.main};
|
|
4
4
|
&::before {
|
|
5
5
|
content: '*';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{v as $,j as t,aa as z,bD as D,a9 as l,H as m,ao as M,b6 as H,ag as j,w as O}from"./vendor-mui-core-CQ38ohp2.js";import{r as h,L as T}from"./vendor-react-DEoibe3W.js";import{w as F}from"./vendor-hooks-DftG_2gV.js";import{y as q}from"./vendor-utils-BNHJB5U7.js";import{d as K}from"./PlayArrow-DFH1Psjx.js";import{d as V}from"./Error-CSFUqG0m.js";import{u as U,Y as u,C as X,j as b,B as k,X as G,y as Q}from"./vendor-ux-did-connect-BdkhddhO.js";import{W as Y}from"./did-address-DUThaBlf.js";import{b as J,c as Z}from"./vendor-arcblock-ScFEr-lj.js";import{S as ee}from"./ServerLogo-Bssx1Eou.js";import{d as N,e as S,g as te,f as g,S as oe,h as ie,j as ne,k as re,l as R,m as ae}from"./index-DO3_1y-L.js";import{H as se}from"./addon-Bcc-Xwbf.js";import{g as I}from"./get-safe-url-
|
|
1
|
+
import{v as $,j as t,aa as z,bD as D,a9 as l,H as m,ao as M,b6 as H,ag as j,w as O}from"./vendor-mui-core-CQ38ohp2.js";import{r as h,L as T}from"./vendor-react-DEoibe3W.js";import{w as F}from"./vendor-hooks-DftG_2gV.js";import{y as q}from"./vendor-utils-BNHJB5U7.js";import{d as K}from"./PlayArrow-DFH1Psjx.js";import{d as V}from"./Error-CSFUqG0m.js";import{u as U,Y as u,C as X,j as b,B as k,X as G,y as Q}from"./vendor-ux-did-connect-BdkhddhO.js";import{W as Y}from"./did-address-DUThaBlf.js";import{b as J,c as Z}from"./vendor-arcblock-ScFEr-lj.js";import{S as ee}from"./ServerLogo-Bssx1Eou.js";import{d as N,e as S,g as te,f as g,S as oe,h as ie,j as ne,k as re,l as R,m as ae}from"./index-DO3_1y-L.js";import{H as se}from"./addon-Bcc-Xwbf.js";import{g as I}from"./get-safe-url-DBsPGn--.js";import"./lottie-web-jYmAQWuC.js";import"./QuestionMarkCircle-p6m3avKp.js";function A({appInfo:e,...r}){const[o,i]=h.useState(!1),s=$(d=>d.breakpoints.down("md"))?32:48;return o?t.jsx(G,{did:e.publisher,size:s}):t.jsx(Q,{src:e.icon,alt:e.title,width:s,height:s,...r,onError:()=>i(!0)})}A.propTypes={appInfo:m.object.isRequired};const C=(e,r)=>g.findComponentByIdV2(e,r)||e;function Ne(){var v,_,E,L;const{t:e,locale:r}=U(),[o,i]=F({blocklet:null,component:null,launcherSession:null,loading:!1,starting:!1,manageSubscriptionURL:""}),p=$(a=>a.breakpoints.down("md")),s=new URL(window.location.href),d=s.searchParams.get("componentId"),w=()=>{const a=s.searchParams.get("redirect")||"/";window.location.href=I(decodeURIComponent(a))},y=()=>{const a=setInterval(()=>{N.get("/blocklet/detail?nocache=1").then(({data:n})=>{const c=C(n,d);if(c.status==="running"){w();return}c.status!=="starting"&&(i({blocklet:n,starting:!1}),n!==c&&i({component:c}),clearInterval(a))}).catch(n=>{i({loading:!1}),u.error(n.message)})},3e3)};h.useEffect(()=>{i({loading:!0}),N.get("/blocklet/detail?nocache=1").then(({data:a})=>{const n=C(a,d);if(i({loading:!1}),n.status==="running"){w();return}i({blocklet:a}),a!==n&&i({component:n}),n.status==="starting"&&(i({starting:!0}),y())}).catch(a=>{i({loading:!1}),u.error(a.message)})},[]);const P=h.useCallback(()=>{var n;i({loading:!0,starting:!0});const a={did:(n=o.blocklet)==null?void 0:n.meta.did};o.component&&(a.componentDids=[o.component.meta.did]),S.startBlocklet({input:a}).then(()=>{y()}).catch(c=>{u.error(c.message),i({loading:!1,starting:!1})})},[o.component,o.blocklet]);if(h.useEffect(()=>{var a;(a=o.blocklet)!=null&&a.controller&&(te({launcherUrl:o.blocklet.controller.launcherUrl,launcherSessionId:o.blocklet.controller.launcherSessionId,locale:r}).then(n=>{i({manageSubscriptionURL:n})}).catch(n=>{console.error("get manage subscription url error",n)}),S.getLauncherSession({input:{launcherSessionId:o.blocklet.controller.launcherSessionId,launcherUrl:o.blocklet.controller.launcherUrl}}).then(n=>{i({launcherSession:n.launcherSession}).catch(c=>{console.error("get launcher session error",c)})}))},[(v=o.blocklet)==null?void 0:v.controller]),!o.blocklet)return t.jsx(X,{children:t.jsx(z,{})});const x={icon:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo`,title:g.getDisplayName(o.blocklet),publisher:o.blocklet.appDid},f=localStorage.getItem("blocklet-server-url"),W=()=>{f&&window.open(I(f,{allowDomains:null}))};return t.jsxs(de,{children:[t.jsx(D,{styles:le}),t.jsxs("header",{className:"root-header",children:[!p&&t.jsx("div",{className:"left",children:t.jsx(ee,{width:"128",height:"48",onClick:W,style:{cursor:f?"pointer":""}})}),t.jsx(J,{children:t.jsx(se,{SessionContext:oe})})]}),t.jsxs(ce,{elevation:0,children:[t.jsxs(pe,{children:[t.jsx(A,{appInfo:x}),t.jsxs("div",{className:"app-info_content",children:[t.jsx(l,{className:"app-info_name",children:x.title}),t.jsx(Y,{size:14,className:"app-info_did",did:x.publisher})]})]}),((L=(E=(_=o.blocklet)==null?void 0:_.controller)==null?void 0:E.status)==null?void 0:L.value)!==Z.BLOCKLET_CONTROLLER_STATUS.suspended&&t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(l,{className:"icon",children:t.jsx(K,{})}),t.jsx(l,{className:"title",children:e("blocklet.startApplication")})]}),t.jsx(l,{className:"sub-title",children:e("blocklet.startDescription",{name:o.component?g.getDisplayName(o.component,!0):g.getDisplayName(o.blocklet)})}),t.jsx(l,{mt:8,children:t.jsx(k,{style:{minWidth:200},disabled:o.loading||o.starting,variant:"contained",color:"primary",size:"large",loading:o.starting,onClick:()=>P(),children:o.starting?e("blocklet.starting"):e("blocklet.start")})})]}),ie(o.blocklet)&&t.jsx(B,{blocklet:o.blocklet,launcherSession:o.launcherSession,manageSubscriptionURL:o.manageSubscriptionURL}),t.jsx(l,{mt:5,children:t.jsx(T,{className:"footer-link",to:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/overview`,children:e("blocklet.dashboard")})})]})]})}function B({blocklet:e,launcherSession:r,manageSubscriptionURL:o}){const{t:i,locale:p}=U();if(!e||!r)return"";const s=ne(e,r),d=re(e,r);return!s&&!d?"":t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(V,{className:"icon-error"}),t.jsxs(l,{className:"title error",children:[s&&i("blocklet.suspended"),d&&i("blocklet.terminated")]})]}),t.jsxs(l,{className:"sub-title",children:[s&&i("blocklet.suspendedCausedByExpired",{deadline:R(r==null?void 0:r.reservedUntil,p)}),d&&i("blocklet.suspendedCausedByTerminated",{canceledAt:R(r==null?void 0:r.terminatedAt,p),deadline:ae(r==null?void 0:r.terminatedAt,p)})]}),t.jsxs(l,{mt:8,children:[s&&t.jsx(k,{component:M,style:{minWidth:200},variant:"contained",color:"primary",size:"large",target:"_blank",href:o||"#",children:i("blocklet.manageSubscription")}),d&&t.jsx(k,{component:T,to:q(b.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/did-spaces"),style:{minWidth:200},variant:"contained",color:"primary",size:"large",children:i("common.backup")})]})]})}B.propTypes={blocklet:m.object.isRequired,launcherSession:m.object.isRequired,manageSubscriptionURL:m.string.isRequired};const le=H`
|
|
2
2
|
html,
|
|
3
3
|
body,
|
|
4
4
|
#app,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,a9 as a,H as o,ag as p}from"./vendor-mui-core-CQ38ohp2.js";import{u as l}from"./use-mobile-
|
|
1
|
+
import{j as e,a9 as a,H as o,ag as p}from"./vendor-mui-core-CQ38ohp2.js";import{u as l}from"./use-mobile-DlKplWTG.js";import{ah as m}from"./index-DO3_1y-L.js";function r({blocklet:t,children:n}){const i=l();return!t||m(t.meta)?e.jsx(s,{isMobile:i,children:n}):e.jsx(s,{isMobile:i,children:e.jsx(a,{display:"flex",variant:"contained",color:"primary",alignItems:"center",marginLeft:"32px",children:n})})}r.propTypes={blocklet:o.object,children:o.any};r.defaultProps={blocklet:null,children:null};const s=p(a)`
|
|
2
2
|
padding-top: 24px;
|
|
3
3
|
margin-top: auto;
|
|
4
4
|
width: 100%;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.43-beta-20250427-
|
|
6
|
+
"version": "1.16.43-beta-20250427-232837-e671de06",
|
|
7
7
|
"description": "Provide unified services for every blocklet",
|
|
8
8
|
"main": "api/index.js",
|
|
9
9
|
"files": [
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
34
34
|
"license": "Apache-2.0",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@abtnode/analytics": "1.16.43-beta-20250427-
|
|
37
|
-
"@abtnode/auth": "1.16.43-beta-20250427-
|
|
38
|
-
"@abtnode/client": "1.16.43-beta-20250427-
|
|
39
|
-
"@abtnode/connect-storage": "1.16.43-beta-20250427-
|
|
40
|
-
"@abtnode/constant": "1.16.43-beta-20250427-
|
|
41
|
-
"@abtnode/core": "1.16.43-beta-20250427-
|
|
42
|
-
"@abtnode/cron": "1.16.43-beta-20250427-
|
|
43
|
-
"@abtnode/logger": "1.16.43-beta-20250427-
|
|
44
|
-
"@abtnode/models": "1.16.43-beta-20250427-
|
|
45
|
-
"@abtnode/router-templates": "1.16.43-beta-20250427-
|
|
46
|
-
"@abtnode/util": "1.16.43-beta-20250427-
|
|
36
|
+
"@abtnode/analytics": "1.16.43-beta-20250427-232837-e671de06",
|
|
37
|
+
"@abtnode/auth": "1.16.43-beta-20250427-232837-e671de06",
|
|
38
|
+
"@abtnode/client": "1.16.43-beta-20250427-232837-e671de06",
|
|
39
|
+
"@abtnode/connect-storage": "1.16.43-beta-20250427-232837-e671de06",
|
|
40
|
+
"@abtnode/constant": "1.16.43-beta-20250427-232837-e671de06",
|
|
41
|
+
"@abtnode/core": "1.16.43-beta-20250427-232837-e671de06",
|
|
42
|
+
"@abtnode/cron": "1.16.43-beta-20250427-232837-e671de06",
|
|
43
|
+
"@abtnode/logger": "1.16.43-beta-20250427-232837-e671de06",
|
|
44
|
+
"@abtnode/models": "1.16.43-beta-20250427-232837-e671de06",
|
|
45
|
+
"@abtnode/router-templates": "1.16.43-beta-20250427-232837-e671de06",
|
|
46
|
+
"@abtnode/util": "1.16.43-beta-20250427-232837-e671de06",
|
|
47
47
|
"@arcblock/did": "^1.20.2",
|
|
48
48
|
"@arcblock/did-auth": "1.20.2",
|
|
49
49
|
"@arcblock/did-ext": "^1.20.2",
|
|
@@ -53,17 +53,17 @@
|
|
|
53
53
|
"@arcblock/jwt": "1.20.2",
|
|
54
54
|
"@arcblock/validator": "^1.20.2",
|
|
55
55
|
"@arcblock/ws": "1.20.2",
|
|
56
|
-
"@blocklet/constant": "1.16.43-beta-20250427-
|
|
56
|
+
"@blocklet/constant": "1.16.43-beta-20250427-232837-e671de06",
|
|
57
57
|
"@blocklet/dbhub": "^0.2.9",
|
|
58
58
|
"@blocklet/did-space-js": "^1.0.48",
|
|
59
|
-
"@blocklet/env": "1.16.43-beta-20250427-
|
|
59
|
+
"@blocklet/env": "1.16.43-beta-20250427-232837-e671de06",
|
|
60
60
|
"@blocklet/form-builder": "^0.1.11",
|
|
61
61
|
"@blocklet/form-collector": "^0.1.8",
|
|
62
|
-
"@blocklet/images": "1.16.43-beta-20250427-
|
|
63
|
-
"@blocklet/js-sdk": "1.16.43-beta-20250427-
|
|
62
|
+
"@blocklet/images": "1.16.43-beta-20250427-232837-e671de06",
|
|
63
|
+
"@blocklet/js-sdk": "1.16.43-beta-20250427-232837-e671de06",
|
|
64
64
|
"@blocklet/mcp": "^1.10.2",
|
|
65
|
-
"@blocklet/meta": "1.16.43-beta-20250427-
|
|
66
|
-
"@blocklet/sdk": "1.16.43-beta-20250427-
|
|
65
|
+
"@blocklet/meta": "1.16.43-beta-20250427-232837-e671de06",
|
|
66
|
+
"@blocklet/sdk": "1.16.43-beta-20250427-232837-e671de06",
|
|
67
67
|
"@blocklet/theme": "^2.13.12",
|
|
68
68
|
"@blocklet/theme-builder": "^0.1.11",
|
|
69
69
|
"@blocklet/uploader-server": "^0.1.95",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"whatwg-url": "14.0.0"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@abtnode/ux": "1.16.43-beta-20250427-
|
|
122
|
+
"@abtnode/ux": "1.16.43-beta-20250427-232837-e671de06",
|
|
123
123
|
"@arcblock/bridge": "^2.13.12",
|
|
124
124
|
"@arcblock/did-connect": "^2.13.12",
|
|
125
125
|
"@arcblock/icons": "^2.13.12",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"@arcblock/ux": "^2.13.12",
|
|
128
128
|
"@blocklet/launcher-layout": "^2.13.12",
|
|
129
129
|
"@blocklet/payment-react": "^1.18.33",
|
|
130
|
-
"@blocklet/tracker": "1.16.43-beta-20250427-
|
|
130
|
+
"@blocklet/tracker": "1.16.43-beta-20250427-232837-e671de06",
|
|
131
131
|
"@blocklet/ui-react": "^2.13.12",
|
|
132
132
|
"@blocklet/uploader": "^0.1.83",
|
|
133
133
|
"@emotion/react": "^11.11.4",
|
|
@@ -205,5 +205,5 @@
|
|
|
205
205
|
"url": "https://github.com/ArcBlock/blocklet-server/issues",
|
|
206
206
|
"email": "shijun@arcblock.io"
|
|
207
207
|
},
|
|
208
|
-
"gitHead": "
|
|
208
|
+
"gitHead": "3644f271b67d5ebaa7a8b852173860a005f1d057"
|
|
209
209
|
}
|