@abtnode/blocklet-services 1.16.40-beta-20250310-113951-17556f90 → 1.16.40-beta-20250311-152346-f596c9a6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/routes/env.js +6 -1
- package/dist/assets/{ArrowDropDown-Cm4c8BlY.js → ArrowDropDown-DheqHCCF.js} +1 -1
- package/dist/assets/{CheckCircle-sJN5S1iC.js → CheckCircle-icyGVeS3.js} +1 -1
- package/dist/assets/{ChevronLeft-BeX0eKuU.js → ChevronLeft-bdr0IWyY.js} +1 -1
- package/dist/assets/{ChevronRight-BWxZ0GT9.js → ChevronRight-B6l1CEz4.js} +1 -1
- package/dist/assets/{DeleteOutline-DnZa0RcQ.js → DeleteOutline-L2iWFlT2.js} +1 -1
- package/dist/assets/{Done-CUONuiq7.js → Done-X-4W5E4Z.js} +1 -1
- package/dist/assets/{Download-BymJGiyd.js → Download-KssoHqH-.js} +1 -1
- package/dist/assets/{Error-B8-wyPeq.js → Error-DMPWKbSE.js} +1 -1
- package/dist/assets/{ExpandLess-1p_uqVHy.js → ExpandLess-AXYDWRn3.js} +1 -1
- package/dist/assets/{Google-CtwTVSPC.js → Google-CJwVSjNE.js} +1 -1
- package/dist/assets/{InfoOutlined-aPcuFKow.js → InfoOutlined-Ov0NeUHF.js} +1 -1
- package/dist/assets/{Launch-CNY19G4F.js → Launch-DUM2L1rB.js} +1 -1
- package/dist/assets/{LaunchOutlined-CBLNAogt.js → LaunchOutlined-BnDQc5Sb.js} +1 -1
- package/dist/assets/{MoreHoriz-BTnTEmyW.js → MoreHoriz-CP4-d2O8.js} +1 -1
- package/dist/assets/{PlayArrow-BWaTV7IU.js → PlayArrow-CetrL8A8.js} +1 -1
- package/dist/assets/{ViewList-gKXyJK1z.js → ViewList-DrzfpKe8.js} +1 -1
- package/dist/assets/{access-control-CRSnnV6w.js → access-control-BgkIaXxY.js} +1 -1
- package/dist/assets/{actions-D8Lw3xe3.js → actions-DZEOmM8C.js} +1 -1
- package/dist/assets/{add-component-core-BzFnxw8D.js → add-component-core-DmpERZx5.js} +1 -1
- package/dist/assets/{add-resource-C5MQEh_d.js → add-resource-RtUldQQB.js} +1 -1
- package/dist/assets/{addon-DThNrUvh.js → addon-CC_VQs_t.js} +1 -1
- package/dist/assets/{analytics-BEGoboDQ.js → analytics-CW4F70VX.js} +24 -24
- package/dist/assets/{audit-logs-BP-xi6Ls.js → audit-logs-C-zRLanq.js} +1 -1
- package/dist/assets/{base32-CkPppFg3.js → base32-CZKGH0iY.js} +1 -1
- package/dist/assets/{branding-D1FesAUj.js → branding-v20lJZ2s.js} +2 -2
- package/dist/assets/{bundle-avatar-Ne6xQFVO.js → bundle-avatar-BlPK_xIf.js} +1 -1
- package/dist/assets/{button-Bzt1WONY.js → button-C2RSw3-I.js} +1 -1
- package/dist/assets/{click-to-copy-Ds1jMEk3.js → click-to-copy-VzwunQar.js} +1 -1
- package/dist/assets/{complete-Cw_4hnLS.js → complete-gCWwSeJ8.js} +1 -1
- package/dist/assets/{component-InzHICwc.js → component-0u03MiuP.js} +1 -1
- package/dist/assets/{config-Chl1wmCe.js → config-Bk4gLExD.js} +1 -1
- package/dist/assets/{config-Dneb0aPp.js → config-T5SAjJgd.js} +1 -1
- package/dist/assets/{config-navigation-pBPU0Hd1.js → config-navigation-ChmAH362.js} +3 -3
- package/dist/assets/{config-space-DAxx03my.js → config-space-rNFeeNC_.js} +1 -1
- package/dist/assets/{confirm-twAiL-Pg.js → confirm-D0n5z1n8.js} +1 -1
- package/dist/assets/{connect-CcqhkXJt.js → connect-DCY4Jb8T.js} +1 -1
- package/dist/assets/{connect-CCL_tilR.js → connect-DEXuSIPd.js} +1 -1
- package/dist/assets/{connect-to-CdxZm7ze.js → connect-to-W1IhVAJI.js} +1 -1
- package/dist/assets/{dashboard-j9G-KyD0.js → dashboard-2_ANBDid.js} +3 -3
- package/dist/assets/{delete-confirm-B7RqZZsx.js → delete-confirm-BMxPgiOj.js} +1 -1
- package/dist/assets/{did-address-aMjKReYC.js → did-address-BZkQh8hP.js} +1 -1
- package/dist/assets/{domain-BoBqD6my.js → domain-BQKAtptg.js} +1 -1
- package/dist/assets/{domain-action-card-BK6VL21y.js → domain-action-card-CA7v5edx.js} +1 -1
- package/dist/assets/domains-BJrThc7T.js +1 -0
- package/dist/assets/{email-D62rIr3r.js → email-BqJ9_T6C.js} +1 -1
- package/dist/assets/{exchange-passport-C6QFYPcO.js → exchange-passport-B0wrsnl3.js} +1 -1
- package/dist/assets/{form-text-input-BeH6diu_.js → form-text-input-CWW9B7Sr.js} +1 -1
- package/dist/assets/{fuel-D-BDqeNn.js → fuel-iz1fZnmu.js} +1 -1
- package/dist/assets/{fullpage-CaydfTeK.js → fullpage-D5QTe_lH.js} +1 -1
- package/dist/assets/{get-safe-url-DmtG3OsE.js → get-safe-url-CH0HGyks.js} +1 -1
- package/dist/assets/{get-safe-url-DpCrXjD2.js → get-safe-url-kaD2Thuv.js} +1 -1
- package/dist/assets/{home-Cuc7_BZ5.js → home-DRHHxS-r.js} +1 -1
- package/dist/assets/{iframe-BDXgtf3V.js → iframe-Cgdpmo47.js} +1 -1
- package/dist/assets/{index-CVOcFexA.js → index-B5ybA0YM.js} +1 -1
- package/dist/assets/{index-HAqfkqId.js → index-BF3-XDCZ.js} +1 -1
- package/dist/assets/{index-BxEJpAM1.js → index-BK-dUwZM.js} +1 -1
- package/dist/assets/{index-CTjSo_AM.js → index-BzTnWASB.js} +1 -1
- package/dist/assets/{index-KCwqCBtZ.js → index-CW52563O.js} +1 -1
- package/dist/assets/{index-BJbC-Qjr.js → index-CXwy6oRm.js} +14 -14
- package/dist/assets/{index-Bcdz6ivm.js → index-CZUmIG8F.js} +1 -1
- package/dist/assets/{index--Cpu5zj7.js → index-C_FtwO8G.js} +1 -1
- package/dist/assets/{index-C0wrMJu_.js → index-CnmX1vWr.js} +1 -1
- package/dist/assets/{index-B17pt9EP.js → index-CoKtbLLl.js} +3 -3
- package/dist/assets/{index-CUYPBPCk.js → index-D4gpYyLc.js} +1 -1
- package/dist/assets/{index-CXzEtZ8-.js → index-DXBIUU3d.js} +1 -1
- package/dist/assets/{index-Y2eFnQMq.js → index-DtxIeDEh.js} +1 -1
- package/dist/assets/{index-DloKVD7k.js → index-HmJ9QMds.js} +1 -1
- package/dist/assets/{index-C1klzBZN.js → index-WMPymUEC.js} +1 -1
- package/dist/assets/{index-BkVeJ_e6.js → index-krul9I6i.js} +4 -4
- package/dist/assets/{invitation-CZiw6z3M.js → invitation-BNQvoyTR.js} +1 -1
- package/dist/assets/{invite-Dsc4lS8l.js → invite-B6hmysnT.js} +1 -1
- package/dist/assets/{issue-passport-RgE7dNyX.js → issue-passport-B7Yw5a4t.js} +1 -1
- package/dist/assets/{item-zC83d6Jc.js → item-DFGLmzrP.js} +1 -1
- package/dist/assets/{layout--BSYMlCG.js → layout-DyxhTYbC.js} +1 -1
- package/dist/assets/{list-DTzzPxLP.js → list-DsNBlXE-.js} +1 -1
- package/dist/assets/{list-header-Cb3sYAQH.js → list-header-IsGBJzos.js} +1 -1
- package/dist/assets/{localization-DFOGQYul.js → localization-DNaC8oQT.js} +1 -1
- package/dist/assets/{log-DyxPA0PM.js → log-C6JOSl-5.js} +1 -1
- package/dist/assets/{login-DPEenGU7.js → login-TRHawCKd.js} +1 -1
- package/dist/assets/{login-oauth-callback-B4CoyqBw.js → login-oauth-callback-D7oAD1At.js} +1 -1
- package/dist/assets/{logo-uploader-G4QDSsmU.js → logo-uploader-DDJYY3pX.js} +3 -3
- package/dist/assets/{lost-passport-CfqCVhZZ.js → lost-passport-lwSTGoh1.js} +1 -1
- package/dist/assets/{open-window-Ctz49LJV.js → open-window-Cho8q-Xo.js} +1 -1
- package/dist/assets/{overview-B32B6ff2.js → overview-Cwp7nCaA.js} +1 -1
- package/dist/assets/{page-header-CmCHR1mk.js → page-header-Cf3DzOs1.js} +1 -1
- package/dist/assets/{permission-BPUMaZy_.js → permission-CXzHZ1xb.js} +1 -1
- package/dist/assets/{preferences-BJxsqezy.js → preferences-C_k8X-gu.js} +1 -1
- package/dist/assets/{publish-resource-DosFKyd_.js → publish-resource-4aMbXQtM.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-BxnrNcYv.js → react-beautiful-dnd.esm-CGraSbOx.js} +1 -1
- package/dist/assets/{relative-time-BPP0lNWq.js → relative-time-CWG4feBZ.js} +1 -1
- package/dist/assets/sdk-B9_oaj3c.js +1 -0
- package/dist/assets/{session-BpknZId5.js → session-D4d96gMA.js} +1 -1
- package/dist/assets/{setup-B50yc7wk.js → setup-5xi9HrWL.js} +3 -3
- package/dist/assets/{start-N83AUhRn.js → start-EuZUsPa9.js} +1 -1
- package/dist/assets/{status-DCrcVds4.js → status-B9KX2z2U.js} +1 -1
- package/dist/assets/{step-actions-CQeRAM0V.js → step-actions-CecLll6l.js} +1 -1
- package/dist/assets/{studio-BKW7u_X7.js → studio-BpfS_Vne.js} +1 -1
- package/dist/assets/{switch-control-BF9Q5dT3.js → switch-control-CQ0cKV4J.js} +1 -1
- package/dist/assets/{traffic-DIZGb0Wa.js → traffic-CNWuNYq6.js} +1 -1
- package/dist/assets/{transfer-13oWu-Fn.js → transfer-DWIc8Xld.js} +1 -1
- package/dist/assets/{unsubscribe-BcN3c7Ba.js → unsubscribe-CsrOVT6b.js} +1 -1
- package/dist/assets/{useLocalStorage-BmgSZ9f3.js → useLocalStorage-BLFh8HxW.js} +1 -1
- package/dist/assets/{user-center-CI8PKX42.js → user-center-Bz87cfKZ.js} +1 -1
- package/dist/assets/{util-CmPA8v8L.js → util-CUMvan5P.js} +1 -1
- package/dist/assets/{util-LJfbsxXq.js → util-CWRewt_A.js} +1 -1
- package/dist/assets/{vendor-arcblock-BSReIGUe.js → vendor-arcblock-DAGgKol-.js} +51 -51
- package/dist/assets/{vendor-ux-did-connect-yBp5D51w.js → vendor-ux-did-connect-BzpeuxHd.js} +1 -1
- package/dist/assets/{wrap-locale-DyYbMONP.js → wrap-locale-BdiYwXFU.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/package.json +29 -29
- package/dist/assets/domains-CzuWJAXa.js +0 -1
- package/dist/assets/sdk-DT6U58At.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b3 as t,Q as o}from"./vendor-ux-did-connect-
|
|
1
|
+
import{b3 as t,Q as o}from"./vendor-ux-did-connect-BzpeuxHd.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b3 as t,Q as o}from"./vendor-ux-did-connect-
|
|
1
|
+
import{b3 as t,Q as o}from"./vendor-ux-did-connect-BzpeuxHd.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,ad as n}from"./vendor-mui-core-BGkzVIkr.js";import{L as r}from"./vendor-react-DoD83n6N.js";import{B as i,p as t}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as o,ad as n}from"./vendor-mui-core-BGkzVIkr.js";import{L as r}from"./vendor-react-DoD83n6N.js";import{B as i,p as t}from"./vendor-ux-did-connect-BzpeuxHd.js";import{S as e}from"./studio-BpfS_Vne.js";import"./vendor-utils-DDG_VdF0.js";import"./vendor-hooks-B7GuuzU5.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-DAGgKol-.js";function E(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",m:4,spacing:2,children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as x}from"./vendor-react-DoD83n6N.js";import{o as E}from"./vendor-arcblock-
|
|
1
|
+
import{b as x}from"./vendor-react-DoD83n6N.js";import{o as E}from"./vendor-arcblock-DAGgKol-.js";const L=({url:o,allowFullScreen:r,position:a,display:i,height:u,width:c,overflow:f,styles:y,onLoad:p,onMouseOver:m,onMouseOut:b,scrolling:w,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=E({src:$||o,target:v||null,style:{position:a||null,display:i||"initial",overflow:f||null},scrolling:w||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:y||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:u||null,onLoad:p||null,onMouseOver:m||null,onMouseOut:b||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(r)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),x.createElement("iframe",Object.assign({},l))},z=L;export{z as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as U,e as Pt,g as En,a as Xe,f as Ra}from"./vendor-react-DoD83n6N.js";import{a1 as X,j as f,E as H,a9 as Yt,P as Ma,b$ as hi,bN as Ca,M as Q,a3 as F,A as Ln,I as Je,a2 as bt,bO as ws,T as at,bk as ue,bM as Gt,bo as Sa,ac as ka,ad as dt,K as js,al as Br,bd as vt,bl as st,bi as ae,x as Ge,c0 as Oa,e as Xt,Z as Rs,a4 as Ve,c1 as $a,c2 as Pa,c3 as Ta,c4 as et,bT as ot,c5 as Ms,c6 as Nn,c7 as Bn,c8 as Aa,c9 as Cs,ca as Ia,cb as qa,a_ as ft,cc as Da,cd as Ea,ce as La,cf as Na,cg as Ba,ch as Fa,ci as za,cj as Wa,ck as Ha,cl as Ua,cm as Va,cn as Fr,bB as Ka,C as Ja,bK as Ga,bw as Ss,bx as ks}from"./vendor-mui-core-BGkzVIkr.js";import{I as Za}from"./iframe-
|
|
1
|
+
import{r as U,e as Pt,g as En,a as Xe,f as Ra}from"./vendor-react-DoD83n6N.js";import{a1 as X,j as f,E as H,a9 as Yt,P as Ma,b$ as hi,bN as Ca,M as Q,a3 as F,A as Ln,I as Je,a2 as bt,bO as ws,T as at,bk as ue,bM as Gt,bo as Sa,ac as ka,ad as dt,K as js,al as Br,bd as vt,bl as st,bi as ae,x as Ge,c0 as Oa,e as Xt,Z as Rs,a4 as Ve,c1 as $a,c2 as Pa,c3 as Ta,c4 as et,bT as ot,c5 as Ms,c6 as Nn,c7 as Bn,c8 as Aa,c9 as Cs,ca as Ia,cb as qa,a_ as ft,cc as Da,cd as Ea,ce as La,cf as Na,cg as Ba,ch as Fa,ci as za,cj as Wa,ck as Ha,cl as Ua,cm as Va,cn as Fr,bB as Ka,C as Ja,bK as Ga,bw as Ss,bx as ks}from"./vendor-mui-core-BGkzVIkr.js";import{I as Za}from"./iframe-Cgdpmo47.js";import{r as Ya,G as xt,w as Xa,x as Cr,$ as Qa,c as pi,A as Zt,n as Ye,ar as eo,y as to,N as zr,as as ro,at as mi,L as Os,F as yt,K as $s}from"./vendor-utils-DDG_VdF0.js";import{r as wt,f as gi,u as Ue,B as fe,Q as Z,p as de,ak as Ps,n as no,ai as jt,bA as io,a as so,ah as Jt,M as vi,aU as lt,$ as Qt,V as Ts,ao as Fn,bB as ao,bC as oo,j as Dr,i as be,bD as lo,bE as co,a6 as uo,a7 as fo,a5 as ho,aW as yi,bF as Pn,bG as po,bH as mo,a0 as Hr,Y as go}from"./vendor-ux-did-connect-BzpeuxHd.js";import{t as As,a as rt,u as z,f as _t,c as vo,l as Sr,k as Is}from"./vendor-hooks-B7GuuzU5.js";import{A as qs,d as bi}from"./config-Bk4gLExD.js";import{F as Ds,d as yo}from"./form-text-input-CWW9B7Sr.js";import{d as xi}from"./ChevronRight-B6l1CEz4.js";import{x as Es,y as bo,z as xo,B as _o,i as _i,g as wi,q as wo,m as ji}from"./vendor-arcblock-DAGgKol-.js";import{z as Ee,C as Ke,av as jo,f as Ls,aw as Ro,m as Mo,au as Co,v as Ri,h as De,O as So,Q as ko}from"./index-CXwy6oRm.js";import{B as Oo}from"./bundle-avatar-BlPK_xIf.js";import{u as $o,B as Po}from"./index-CW52563O.js";import{d as To}from"./Done-X-4W5E4Z.js";import{F as Ao,R as Io,L as Dt}from"./logo-uploader-DDJYY3pX.js";import{w as Ns,P as qo}from"./permission-CXzHZ1xb.js";import{C as Wr}from"./confirm-D0n5z1n8.js";import{f as kr}from"./format-error-LAoTjvJe.js";import{_ as Do}from"./useSetState-BL3ktMon.js";import{u as Bs}from"./session-D4d96gMA.js";import{C as Eo}from"./click-to-copy-VzwunQar.js";import{u as Ur,a as Lo}from"./dashboard-2_ANBDid.js";import{I as Fs}from"./index-WMPymUEC.js";import{W as No}from"./did-address-BZkQh8hP.js";import{V as Bo,K as Fo}from"./status-B9KX2z2U.js";import{u as ct,C as G,a as Mi}from"./index.esm-CWepf7I_.js";import{S as Vr}from"./switch-control-CQ0cKV4J.js";import{b as zo}from"./base32-CZKGH0iY.js";import{S as pn}from"./simple-select-B4jrDuc2.js";import"./lottie-web-B6s7dDoL.js";import"./EditIcon-ejHqaqyS.js";import"./ArrowDropDown-DheqHCCF.js";import"./index-tUQxVYYQ.js";import"./useLocalStorage-BLFh8HxW.js";import"./PlayArrow-CetrL8A8.js";import"./get-safe-url-CH0HGyks.js";import"./useAsyncRetry-Cbcg1dvJ.js";import"./useAsync-DOwDXG5n.js";import"./InfoOutlined-Ov0NeUHF.js";import"./omit-B4UQ3GvX.js";var zn={},Wo=X;Object.defineProperty(zn,"__esModule",{value:!0});var zs=zn.default=void 0,Ho=Wo(wt()),Uo=f;zs=zn.default=(0,Ho.default)((0,Uo.jsx)("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded");var Wn={},Vo=X;Object.defineProperty(Wn,"__esModule",{value:!0});var Ws=Wn.default=void 0,Ko=Vo(wt()),Jo=f;Ws=Wn.default=(0,Ko.default)((0,Jo.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"Key");var Hn={},Go=X;Object.defineProperty(Hn,"__esModule",{value:!0});var Hs=Hn.default=void 0,Zo=Go(wt()),Yo=f;Hs=Hn.default=(0,Zo.default)((0,Yo.jsx)("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"}),"Login");var Un={},Xo=X;Object.defineProperty(Un,"__esModule",{value:!0});var Us=Un.default=void 0,Qo=Xo(wt()),el=f;Us=Un.default=(0,Qo.default)((0,el.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");const tl={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'},rl=tl;var Vn={},nl=X;Object.defineProperty(Vn,"__esModule",{value:!0});var Vs=Vn.default=void 0,il=nl(wt()),sl=f;Vs=Vn.default=(0,il.default)((0,sl.jsx)("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}),"VolunteerActivismOutlined");var Kn={},al=X;Object.defineProperty(Kn,"__esModule",{value:!0});var Jn=Kn.default=void 0,ol=al(wt()),Ci=f;Jn=Kn.default=(0,ol.default)([(0,Ci.jsx)("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),(0,Ci.jsx)("circle",{cx:"16",cy:"12",r:"1.5"},"1")],"AccountBalanceWalletOutlined");function Gn({label:v,disabled:T,required:O,initialValue:S,onChange:$,style:u,onSubmit:R,triggers:t,options:g,formatterBeforeSubmit:p,helperText:h,placeholder:e,renderImage:n,renderLabel:a,filterKeys:s,noEmpty:i,...m}){const[o,r]=U.useState(!1),[c,y]=U.useState(!1),[x,C]=U.useState(""),M=U.useRef(null),[d,b]=U.useState(S),[_,A]=U.useState(d),B=U.useMemo(()=>{if(!g)return{};const D={};return g.forEach(L=>{D[L.code]=L}),D},[g]),P=()=>{if(!g)return[];if(!x)return g.map(L=>L.code);const D=new RegExp(x.toLowerCase());return g.filter(L=>{var N;for(let I=0;I<s.length;I++){const w=s[I];if(D.test((N=L[w])==null?void 0:N.toLowerCase()))return!0}return!1}).map(L=>L.code)},l=async()=>{y(!0);try{await R(typeof p=="function"?p(_):_)===!1?A(d):i&&!_.length?(A(S),b(S)):(A(_),b(_))}catch{A(d)}finally{y(!1),r(!1)}},j=(D,L)=>{if(!Array.isArray(L)){A([]),$([]);return}const N=L.filter(I=>B[I]);if(!N.length){A([]),$([]);return}A(N),$(N)},k=D=>{D.stopPropagation(),r(!0),setTimeout(()=>{if(M.current){const L=M.current.querySelector("input");L&&L.focus()}},500)},q=o?f.jsx(Ca,{ref:M,options:g,value:_,onChange:j,inputValue:x,onInputChange:(D,L)=>{C(L)},PopperComponent:cl,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:D=>{var L;return(L=B[D])==null?void 0:L.name},renderInput:D=>f.jsx(Q,{...D,label:"",placeholder:e}),renderOption:(D,L)=>{var I;const N=_.indexOf(L)!==-1;return U.createElement(ll,{component:"li",...D,key:L},n(B[L]||{}),f.jsx(F,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:a(L,B[L])||((I=B[L])==null?void 0:I.name)}),f.jsx(F,{component:gi,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...m}):f.jsx(F,{px:1,className:"form-item-input slot",onClick:k,style:{whiteSpace:"pre-wrap",cursor:"text"},children:_.filter(D=>g.some(L=>L.code===D)).map(D=>f.jsx(Ln,{label:g.find(L=>L.code===D).name,style:{marginRight:8},size:"small"},D))});return f.jsx(Ao,{className:"form",style:u,children:f.jsxs(F,{className:"form-item",children:[f.jsxs(F,{className:"form-item-label",children:[v,O&&f.jsx(Io,{})]}),f.jsxs(F,{className:"form-item-body",children:[f.jsx(F,{className:"form-item-input",children:q}),f.jsx(F,{className:"form-item-action",children:o?f.jsxs(f.Fragment,{children:[f.jsx(Je,{"data-cy":"schema-form-item-confirm",onClick:l,disabled:T||c,size:"large",children:c?f.jsx(bt,{size:24}):f.jsx(To,{})}),f.jsx(Je,{"data-cy":"schema-form-item-cancel",onClick:()=>{A(d),r(!1)},disabled:T||c,size:"large",children:f.jsx(gi,{})})]}):null})]}),o&&h&&f.jsx(ws,{children:h})]})})}Gn.propTypes={style:H.object,onSubmit:H.func,onChange:H.func,label:H.string,initialValue:H.string,required:H.bool,disabled:H.bool,triggers:H.array,options:H.array,helperText:H.string,formatterBeforeSubmit:H.func,placeholder:H.string,renderImage:H.func,filterKeys:H.arrayOf(H.string),noEmpty:H.bool,renderLabel:H.func};Gn.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:v=>v.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(v,T)=>"",noEmpty:!1};const ll=Yt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,a2 as h,a3 as c,E as d,a9 as g}from"./vendor-mui-core-BGkzVIkr.js";import{r as y}from"./vendor-react-DoD83n6N.js";import{aU as v,C as w,B as m}from"./vendor-ux-did-connect-
|
|
1
|
+
import{j as t,a2 as h,a3 as c,E as d,a9 as g}from"./vendor-mui-core-BGkzVIkr.js";import{r as y}from"./vendor-react-DoD83n6N.js";import{aU as v,C as w,B as m}from"./vendor-ux-did-connect-BzpeuxHd.js";import{P}from"./page-header-Cf3DzOs1.js";import{C as E}from"./index-CXwy6oRm.js";import{u as T}from"./config-space-rNFeeNC_.js";import{C as B,D,a as N}from"./connect-to-W1IhVAJI.js";import{S as u}from"./step-actions-CecLll6l.js";import{S as b}from"./layout-DyxhTYbC.js";import"./vendor-utils-DDG_VdF0.js";import"./vendor-hooks-B7GuuzU5.js";import"./lottie-web-B6s7dDoL.js";import"./vendor-arcblock-DAGgKol-.js";import"./api-Dia2_ulr.js";import"./DeleteOutline-L2iWFlT2.js";import"./format-error-LAoTjvJe.js";import"./content-layout-GiaabWKJ.js";function l({onNext:a,onPrevious:x}){var n,r,p;const{t:i}=y.useContext(v),{blocklet:e}=E(),{spaceGateway:f,settingStorageEndpoint:C,updateSpaceGateway:j,hasStorageEndpoint:S,loading:o,storageEndpoint:s}=T();return o?t.jsx(w,{relative:"parent",children:t.jsx(h,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(P,{title:i("setup.didSpace.title"),subTitle:i("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(B,{spaceGateway:f,settingStorageEndpoint:C}):t.jsx(D,{})}),((n=e==null?void 0:e.capabilities)==null?void 0:n.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(N,{onConnect:j,storageEndpoint:s})}),((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(m,{loading:o,variant:"contained",disabled:o||!s,onClick:()=>a(),children:i("setup.continue")})}),((p=e==null?void 0:e.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:e,onStartNow:()=>a("complete"),children:t.jsx(m,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>a(),children:i(s?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:d.func,onPrevious:d.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=g(b)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
`;export{l as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as He,r as S}from"./vendor-react-DoD83n6N.js";import{j as e,T as E,M as z,bY as we,bZ as Ie,b_ as Y,bI as Pe,bO as Fe,a2 as H,bo as We,ac as Me,E as b,a9 as q,bk as Oe,bM as qe,I as _,a3 as y,a1 as $e,aj as De,K as Ve,a4 as ee,t as Ge}from"./vendor-mui-core-BGkzVIkr.js";import{l as Ue,g as ce,w as X}from"./vendor-arcblock-
|
|
1
|
+
import{g as He,r as S}from"./vendor-react-DoD83n6N.js";import{j as e,T as E,M as z,bY as we,bZ as Ie,b_ as Y,bI as Pe,bO as Fe,a2 as H,bo as We,ac as Me,E as b,a9 as q,bk as Oe,bM as qe,I as _,a3 as y,a1 as $e,aj as De,K as Ve,a4 as ee,t as Ge}from"./vendor-mui-core-BGkzVIkr.js";import{l as Ue,g as ce,w as X}from"./vendor-arcblock-DAGgKol-.js";import{u as $,ai as V,B as A,Q as B,r as Ze,p as de,V as ue,ah as Ke,aY as Ye,aU as ke,bz as ve,b5 as Qe}from"./vendor-ux-did-connect-BzpeuxHd.js";import{E as te}from"./EditIcon-ejHqaqyS.js";import{L as Je}from"./LockIcon-BSkJrAvs.js";import{L as pe,S as me,E as Xe}from"./list-header-IsGBJzos.js";import{L as G,aq as Ce,H as et}from"./vendor-utils-DDG_VdF0.js";import{z as R,O as U,at as Le,C as tt,aa as st,f as rt,h as nt,b as J,au as at}from"./index-CXwy6oRm.js";import{u as Z}from"./dashboard-2_ANBDid.js";import{w as W,P as Se}from"./permission-CXzHZ1xb.js";import{C as fe}from"./confirm-D0n5z1n8.js";import{f as Q}from"./format-error-LAoTjvJe.js";import{C as ot}from"./Google-CJwVSjNE.js";import{W as Ae}from"./did-address-BZkQh8hP.js";import{_ as it}from"./useSetState-BL3ktMon.js";import"./vendor-hooks-B7GuuzU5.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BLFh8HxW.js";import"./PlayArrow-CetrL8A8.js";import"./get-safe-url-CH0HGyks.js";import"./index-CW52563O.js";import"./session-D4d96gMA.js";import"./useAsyncRetry-Cbcg1dvJ.js";import"./useAsync-DOwDXG5n.js";import"./InfoOutlined-Ov0NeUHF.js";import"./cloneDeep-B_ounxQq.js";var K=function(u){return e.jsx("svg",{...u,children:e.jsx("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})})};K.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};K.displayName="delete";var Be={exports:{}},Ne={exports:{}};(function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h={rotl:function(l,p){return l<<p|l>>>32-p},rotr:function(l,p){return l<<32-p|l>>>p},endian:function(l){if(l.constructor==Number)return h.rotl(l,8)&16711935|h.rotl(l,24)&4278255360;for(var p=0;p<l.length;p++)l[p]=h.endian(l[p]);return l},randomBytes:function(l){for(var p=[];l>0;l--)p.push(Math.floor(Math.random()*256));return p},bytesToWords:function(l){for(var p=[],d=0,i=0;d<l.length;d++,i+=8)p[i>>>5]|=l[d]<<24-i%32;return p},wordsToBytes:function(l){for(var p=[],d=0;d<l.length*32;d+=8)p.push(l[d>>>5]>>>24-d%32&255);return p},bytesToHex:function(l){for(var p=[],d=0;d<l.length;d++)p.push((l[d]>>>4).toString(16)),p.push((l[d]&15).toString(16));return p.join("")},hexToBytes:function(l){for(var p=[],d=0;d<l.length;d+=2)p.push(parseInt(l.substr(d,2),16));return p},bytesToBase64:function(l){for(var p=[],d=0;d<l.length;d+=3)for(var i=l[d]<<16|l[d+1]<<8|l[d+2],f=0;f<4;f++)d*8+f*6<=l.length*8?p.push(u.charAt(i>>>6*(3-f)&63)):p.push("=");return p.join("")},base64ToBytes:function(l){l=l.replace(/[^A-Z0-9+\/]/ig,"");for(var p=[],d=0,i=0;d<l.length;i=++d%4)i!=0&&p.push((u.indexOf(l.charAt(d-1))&Math.pow(2,-2*i+8)-1)<<i*2|u.indexOf(l.charAt(d))>>>6-i*2);return p}};Ne.exports=h})();var lt=Ne.exports,le={utf8:{stringToBytes:function(u){return le.bin.stringToBytes(unescape(encodeURIComponent(u)))},bytesToString:function(u){return decodeURIComponent(escape(le.bin.bytesToString(u)))}},bin:{stringToBytes:function(u){for(var h=[],l=0;l<u.length;l++)h.push(u.charCodeAt(l)&255);return h},bytesToString:function(u){for(var h=[],l=0;l<u.length;l++)h.push(String.fromCharCode(u[l]));return h.join("")}}},Te=le;/*!
|
|
2
2
|
* Determine if an object is a Buffer
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as A,Q as $,bG as F,V as me,a0 as be,by as fe}from"./vendor-ux-did-connect-yBp5D51w.js";import{w as ge,l as de,j as je}from"./vendor-hooks-B7GuuzU5.js";import{r as E,b as G}from"./vendor-react-DoD83n6N.js";import{d as J}from"./InfoOutlined-aPcuFKow.js";import{z as B,C as ye,G as we}from"./index-BJbC-Qjr.js";import{u as H}from"./dashboard-j9G-KyD0.js";import{E as o,j as e,D as ke,ab as ve,r as Ee,a3 as g,M as ie,T as S,a2 as N,ac as Q,y as Ce,x as q,bk as le,bM as U,a4 as W,L as V,z as Y,bg as Te,A as z,I as X,C as Se,bO as Re,ad as I,cG as Me,al as Ie,bd as _,bH as Pe,b0 as De,cH as $e,cI as We,b1 as ze,af as Oe,bR as Ae,s as ce,t as qe,cJ as Le,cK as Be,cL as He,cM as Ne,cN as Fe}from"./vendor-mui-core-BGkzVIkr.js";import{u as Ue,C as K}from"./index.esm-CWepf7I_.js";import{m as _e}from"./vendor-arcblock-BSReIGUe.js";import{d as Ke}from"./ExpandLess-1p_uqVHy.js";import{y as pe}from"./vendor-utils-DDG_VdF0.js";import{C as Ve}from"./confirm-twAiL-Pg.js";import{A as Ye}from"./actions-D8Lw3xe3.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BmgSZ9f3.js";import"./PlayArrow-BWaTV7IU.js";import"./get-safe-url-DmtG3OsE.js";import"./format-error-LAoTjvJe.js";import"./index-KCwqCBtZ.js";import"./session-BpknZId5.js";import"./useAsyncRetry-Cbcg1dvJ.js";import"./useAsync-DOwDXG5n.js";import"./useSetState-BL3ktMon.js";import"./MoreHoriz-BTnTEmyW.js";const Ge=t=>{var x,T;const[a,c]=E.useState(null),[l,m]=E.useState(!t),[R,r]=E.useState(null),{blocklet:d}=ye(),i=(T=(x=d==null?void 0:d.site)==null?void 0:x.domainAliases[0])==null?void 0:T.value,v=E.useMemo(()=>{const h={};return a&&(a.sources.forEach(n=>{h[n.did]={source:n,events:[],count:0}}),a.events.forEach(n=>{h[n.source]&&(h[n.source].events.push(n),h[n.source].count+=1)})),h},[a]),C=async()=>{try{if(m(!0),!i)return;const n=await(await fetch(`https://${i}/.well-known/service/openevent.json`)).json();c(n),r(null)}catch(h){r(h instanceof Error?h:new Error(String(h)))}finally{m(!1)}};return E.useEffect(()=>{C()},[i]),{openEvent:a,setOpenEvent:c,eventsBySource:v,loading:l,error:R,loadData:C}};function Z({eventsBySource:t,selectedEvents:a,setSelectedEvents:c,error:l}){const{t:m}=A(),[R,r]=E.useState({}),d=E.useMemo(()=>{const n={};return Object.entries(t).forEach(([y,{events:p}])=>{const k=p.filter(j=>a[`${j.type}-${j.source}`]).length;n[y]=k}),n},[t,a]),i=E.useMemo(()=>Object.values(d).reduce((n,y)=>n+y,0),[d]),v=E.useMemo(()=>Object.values(t).reduce((n,{events:y})=>n+y.length,0),[t]),C=(n,y)=>{y.stopPropagation(),r({...R,[n]:!R[n]})},x=n=>{const y=`${n.type}-${n.source}`;c(p=>({...p,[y]:!p[y]}))},T=(n,y)=>{const p={};n.forEach(k=>{const j=`${k.type}-${k.source}`;p[j]=!y}),c(k=>({...k,...p}))},h=n=>{const y={};Object.values(t).forEach(({events:p})=>{p.forEach(k=>{const j=`${k.type}-${k.source}`;y[j]=n.target.checked})}),c(y)};return e.jsxs(g,{sx:{width:"100%"},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(U,{onChange:h,checked:i>0&&i===v}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[m("webhookEndpoint.selectAllEvents"),e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:e.jsx(W,{title:m("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(J,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),i>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:m("webhookEndpoint.selectedEventsCount",{count:i})})]}),e.jsx(g,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(V,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([n,{source:y,events:p,count:k}],j)=>{const D=d[n]>0,u=d[n]===p.length&&p.length>0,b=R[n];return e.jsxs(G.Fragment,{children:[e.jsx(Y,{sx:{borderBottom:j<Object.keys(t).length-1?"1px solid #f0f0f0":"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(g,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||C(n,s)},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:p.length>0&&e.jsx(le,{control:e.jsx(U,{checked:u,indeterminate:D&&!u,onChange:s=>{s.stopPropagation(),T(p,u)}}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[y.logo&&e.jsx(Te,{src:y.logo,sx:{width:24,height:24}}),e.jsx(g,{children:y.title||n}),D&&e.jsx(z,{label:m("webhookEndpoint.selectedCount",{count:d[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:s=>`${s.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(g,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:m("webhookEndpoint.eventsCount",{count:k})}),p.length>0&&e.jsx(X,{size:"small",edge:"end",children:b?e.jsx(Ke,{}):e.jsx(_e,{})})]})]})}),p.length>0&&e.jsx(Se,{in:b,timeout:"auto",unmountOnExit:!0,children:e.jsx(V,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:p.map(s=>{const f=`${s.type}-${s.source}`,w=!!a[f];return e.jsx(Y,{dense:!0,sx:{py:.75},onClick:()=>x(s),children:e.jsxs(g,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(U,{checked:w,sx:{mr:1}}),e.jsxs(g,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:s.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:s.description})]})]})},f)})})})]},n)})})}),l&&e.jsx(Re,{error:!0,sx:{mt:1},children:l})]})}Z.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};Z.defaultProps={error:null};function ee({id:t,url:a,description:c,enabledEvents:l,onSubmit:m,onClose:R}){var s;const{t:r}=A(),[d,i]=E.useState({}),{teamDid:v}=H(),{api:C}=B(),{loading:x,error:T,eventsBySource:h}=Ge(),{control:n,handleSubmit:y,formState:{errors:p},reset:k,setValue:j,trigger:D}=Ue({defaultValues:{url:"",description:""}});E.useEffect(()=>{const f=Object.values(d).some(w=>w);j("selectedEvents",f?"valid":""),D("selectedEvents")},[d,j,D]);const u=()=>{i({}),k(),R()},b=async f=>{const w=Object.keys(d).filter(M=>d[M]),O={url:f.url,description:f.description,enabledEvents:w.map(M=>{const[se,re]=M.split("-");return!se||!re?null:{type:se,source:re}}).filter(Boolean)};try{if(t){const M=await C.updateWebhookEndpoint({input:{teamDid:v,id:t,data:O}});$.success(`${r("webhookEndpoint.updateWebhook")} ${r("webhookEndpoint.success")}`),m(M)}else{const M=await C.createWebhookEndpoint({input:{teamDid:v,input:O}});$.success(`${r("webhookEndpoint.createWebhook")} ${r("webhookEndpoint.success")}`),m(M)}}catch(M){$.error(M==null?void 0:M.message)}u()};return E.useEffect(()=>{k({url:a,description:c}),i(l.reduce((f,w)=>(f[`${w.type}-${w.source}`]=!0,f),{}))},[k,i,a,c,l]),e.jsx(ke,{open:!0,onClose:u,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:y(b),children:[e.jsx(ve,{children:r(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Ee,{children:e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(K,{name:"url",control:n,rules:{required:r("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:r("webhookEndpoint.validation.urlInvalid")}},render:({field:f})=>{var w;return e.jsx(ie,{...f,label:r("webhookEndpoint.url.label"),fullWidth:!0,error:!!p.url,helperText:(w=p.url)==null?void 0:w.message})}}),e.jsx(K,{name:"description",control:n,rules:{required:r("webhookEndpoint.validation.descriptionRequired")},render:({field:f})=>{var w;return e.jsx(ie,{...f,label:r("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!p.description,helperText:(w=p.description)==null?void 0:w.message})}}),e.jsx(K,{name:"selectedEvents",control:n,rules:{required:r("webhookEndpoint.validation.eventRequired")},render:({field:f})=>e.jsx("input",{type:"hidden",...f})}),!x&&h&&Object.keys(h).length>0&&e.jsx(Z,{eventsBySource:h,selectedEvents:d,setSelectedEvents:i,error:(s=p.selectedEvents)==null?void 0:s.message}),!x&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:r("webhookEndpoint.noAvailableEvents")}),x&&e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(N,{size:20})}),T&&e.jsx(Q,{severity:"error",children:r("webhookEndpoint.loadingError",{message:T==null?void 0:T.message})})]})}),e.jsxs(Ce,{sx:{p:"8px 24px 24px"},children:[e.jsx(q,{onClick:u,children:r("common.cancel")}),e.jsx(q,{type:"submit",variant:"contained",color:"primary",children:r(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}ee.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};ee.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function ue(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Je=(t="en")=>t==="tw"?"zh":t;function L(t,a="YYYY-MM-DD HH:mm:ss",c="en"){return t?we(t).locale(Je(c)).format(a):"-"}function Qe(t){return typeof t=="number"?!1:pe(t)}function Xe(t){return t>=200&&t<300}function P(t){const a=Qe(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(I,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(W,{title:t.tip,children:e.jsx(Me,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:a?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:a?"-":t.value})]}),t.divider&&e.jsx(Ie,{orientation:"vertical",flexItem:!0})]})}P.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};P.defaultProps={tip:"",divider:!1};function te(t){return e.jsxs(I,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}te.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};te.defaultProps={children:null,mb:1.5,mt:1.5};const Ze=t=>{const a={};return t.forEach(c=>{var m;const l=new Date(c.createdAt).toLocaleDateString();a[l]||(a[l]=[]),(m=a[l])==null||m.push(c)}),a};function oe({eventId:t,webhookEndpointId:a,event:c}){const{api:l}=B(),{t:m}=A(),{teamDid:R}=H(),{data:r,loadMore:d,loadingMore:i,loading:v}=ge(p=>{const j=p?Math.ceil(p.list.length/15)+1:1;return l.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:a},paging:{page:j,pageSize:15}}})},{reloadDeps:[t,a]}),C=(r==null?void 0:r.list)||[],[x,T]=E.useState(null),h=Ze(C);E.useEffect(()=>{!x&&(r!=null&&r.list.length)&&T(r.list[0])},[r==null?void 0:r.list.length,x]);const n=p=>{T(p)};if(v)return e.jsx(N,{});const y=r&&r.list.length<r.paging.total;return e.jsxs(_,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(_,{item:!0,xs:12,md:4,height:1,children:pe(Object.keys(h))?e.jsx(S,{color:"text.secondary",children:m("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(V,{sx:{maxHeight:"100%",py:0,overflowY:"auto"},children:Object.entries(h).map(([p,k])=>e.jsxs(G.Fragment,{children:[e.jsx(Pe,{children:p}),k.map(j=>e.jsxs(Y,{sx:{cursor:"pointer"},onClick:()=>n(j),selected:x===j,secondaryAction:e.jsx(S,{color:"text.secondary",children:L(j.createdAt,"HH:mm:ss")}),children:[e.jsx(De,{sx:{minWidth:0,mr:1.5},children:Xe(j.responseStatus)===!1?e.jsx($e,{color:"error"}):e.jsx(We,{color:"success"})}),e.jsx(ze,{primary:e.jsx(S,{color:"text.primary",children:j.event.type})})]},j.id))]},p))}),y&&e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(q,{variant:"text",type:"button",color:"inherit",onClick:d,disabled:i,sx:{color:p=>p.palette.text.disabled},children:m(i?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(_,{item:!0,xs:12,md:8,height:1,children:[x&&e.jsxs(I,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsx(S,{variant:"h6",children:t?x.endpoint.url:x.event.type}),e.jsxs(g,{children:[e.jsxs(S,{variant:"h6",children:[m("webhookEndpoint.response")," (",x.responseStatus,")"]}),e.jsx(F,{language:"json",children:JSON.stringify(x.responseBody,null,2)})]}),e.jsxs(g,{children:[e.jsx(I,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:m("webhookEndpoint.request")})}),e.jsx(F,{language:"json",sx:{margin:0},children:JSON.stringify(x.event,null,2)})]})]}),(r==null?void 0:r.list.length)===0&&c&&e.jsxs(g,{children:[e.jsx(I,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:m("webhookEndpoint.eventData")})}),e.jsx(F,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}oe.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};oe.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:a}){var v,C,x,T;const{t:c}=A(),{api:l}=B(),{teamDid:m}=H(),{loading:R,error:r,data:d}=de(()=>l.getWebhookEndpoint({input:{teamDid:m,id:t}})),i=d==null?void 0:d.data;return r?e.jsx(Q,{severity:"error",children:r.message}):R||!i?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(N,{})}):e.jsxs(et,{direction:"column",sx:{height:1},children:[e.jsxs(g,{children:[e.jsxs(I,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(I,{flex:1,width:0,children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:i.description}),e.jsx(W,{title:i.url,children:e.jsx(J,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(I,{direction:"row",alignItems:"center",children:e.jsx(X,{edge:"end",color:"inherit",onClick:a,children:e.jsx(Ae,{})})})]}),e.jsx(g,{mt:2,children:e.jsxs(I,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(P,{label:c("common.status"),value:e.jsx(z,{size:"small",variant:"filled",label:i.status,color:ue(i.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.listen"),value:e.jsx(W,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:i.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(z,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:i.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.version"),value:i.apiVersion,divider:!0}),e.jsx(P,{label:c("common.createdAt"),value:L(i.createdAt),divider:!0}),e.jsx(P,{label:c("common.updatedAt"),value:L(i.updatedAt),divider:!0}),e.jsx(P,{label:c("common.createdBy"),value:e.jsx(W,{arrow:!0,title:(v=i.createUser)==null?void 0:v.did,children:e.jsx(z,{size:"small",variant:"filled",label:(C=i.createUser)==null?void 0:C.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("common.updatedBy"),value:e.jsx(W,{arrow:!0,title:(x=i.updateUser)==null?void 0:x.did,children:e.jsx(z,{size:"small",variant:"filled",label:(T=i.updateUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(I,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(te,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(I,{height:0,flex:1,overflow:"hidden",children:e.jsx(oe,{webhookEndpointId:i.id})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const et=ce(I)``;function he({open:t,onClose:a,id:c}){return e.jsx(Oe,{anchor:"right",open:t,onClose:a,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(g,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:a})})})}he.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function ae(){return null}const ne=G.memo(({options:t,columns:a,toolbar:c=!0,footer:l=!0,hasRowLink:m=!1,emptyNodeText:R="",...r})=>{const{locale:d}=A(),i=qe(x=>x.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:i?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},C={};return c||(C.TableToolbar=ae),l||(C.TableFooter=ae),e.jsx(tt,{locale:d,options:{...v,...t},columns:(a||[]).map(x=>(x.options=x.options||{},x.options.filter=x.options.filter||!1,x.options.sort=x.options.sort||!1,x)),emptyNode:e.jsx(me,{children:R}),...r,components:C,hasRowLink:m,isMobile:i})});ne.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};ne.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const tt=ce(be)`
|
|
1
|
+
import{u as A,Q as $,bG as F,V as me,a0 as be,by as fe}from"./vendor-ux-did-connect-BzpeuxHd.js";import{w as ge,l as de,j as je}from"./vendor-hooks-B7GuuzU5.js";import{r as E,b as G}from"./vendor-react-DoD83n6N.js";import{d as J}from"./InfoOutlined-Ov0NeUHF.js";import{z as B,C as ye,G as we}from"./index-CXwy6oRm.js";import{u as H}from"./dashboard-2_ANBDid.js";import{E as o,j as e,D as ke,ab as ve,r as Ee,a3 as g,M as ie,T as S,a2 as N,ac as Q,y as Ce,x as q,bk as le,bM as U,a4 as W,L as V,z as Y,bg as Te,A as z,I as X,C as Se,bO as Re,ad as I,cG as Me,al as Ie,bd as _,bH as Pe,b0 as De,cH as $e,cI as We,b1 as ze,af as Oe,bR as Ae,s as ce,t as qe,cJ as Le,cK as Be,cL as He,cM as Ne,cN as Fe}from"./vendor-mui-core-BGkzVIkr.js";import{u as Ue,C as K}from"./index.esm-CWepf7I_.js";import{m as _e}from"./vendor-arcblock-DAGgKol-.js";import{d as Ke}from"./ExpandLess-AXYDWRn3.js";import{y as pe}from"./vendor-utils-DDG_VdF0.js";import{C as Ve}from"./confirm-D0n5z1n8.js";import{A as Ye}from"./actions-DZEOmM8C.js";import"./lottie-web-B6s7dDoL.js";import"./useLocalStorage-BLFh8HxW.js";import"./PlayArrow-CetrL8A8.js";import"./get-safe-url-CH0HGyks.js";import"./format-error-LAoTjvJe.js";import"./index-CW52563O.js";import"./session-D4d96gMA.js";import"./useAsyncRetry-Cbcg1dvJ.js";import"./useAsync-DOwDXG5n.js";import"./useSetState-BL3ktMon.js";import"./MoreHoriz-CP4-d2O8.js";const Ge=t=>{var x,T;const[a,c]=E.useState(null),[l,m]=E.useState(!t),[R,r]=E.useState(null),{blocklet:d}=ye(),i=(T=(x=d==null?void 0:d.site)==null?void 0:x.domainAliases[0])==null?void 0:T.value,v=E.useMemo(()=>{const h={};return a&&(a.sources.forEach(n=>{h[n.did]={source:n,events:[],count:0}}),a.events.forEach(n=>{h[n.source]&&(h[n.source].events.push(n),h[n.source].count+=1)})),h},[a]),C=async()=>{try{if(m(!0),!i)return;const n=await(await fetch(`https://${i}/.well-known/service/openevent.json`)).json();c(n),r(null)}catch(h){r(h instanceof Error?h:new Error(String(h)))}finally{m(!1)}};return E.useEffect(()=>{C()},[i]),{openEvent:a,setOpenEvent:c,eventsBySource:v,loading:l,error:R,loadData:C}};function Z({eventsBySource:t,selectedEvents:a,setSelectedEvents:c,error:l}){const{t:m}=A(),[R,r]=E.useState({}),d=E.useMemo(()=>{const n={};return Object.entries(t).forEach(([y,{events:p}])=>{const k=p.filter(j=>a[`${j.type}-${j.source}`]).length;n[y]=k}),n},[t,a]),i=E.useMemo(()=>Object.values(d).reduce((n,y)=>n+y,0),[d]),v=E.useMemo(()=>Object.values(t).reduce((n,{events:y})=>n+y.length,0),[t]),C=(n,y)=>{y.stopPropagation(),r({...R,[n]:!R[n]})},x=n=>{const y=`${n.type}-${n.source}`;c(p=>({...p,[y]:!p[y]}))},T=(n,y)=>{const p={};n.forEach(k=>{const j=`${k.type}-${k.source}`;p[j]=!y}),c(k=>({...k,...p}))},h=n=>{const y={};Object.values(t).forEach(({events:p})=>{p.forEach(k=>{const j=`${k.type}-${k.source}`;y[j]=n.target.checked})}),c(y)};return e.jsxs(g,{sx:{width:"100%"},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(U,{onChange:h,checked:i>0&&i===v}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[m("webhookEndpoint.selectAllEvents"),e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:e.jsx(W,{title:m("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(J,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),i>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:m("webhookEndpoint.selectedEventsCount",{count:i})})]}),e.jsx(g,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(V,{disablePadding:!0,sx:{border:"1px solid #e0e0e0",borderRadius:"4px"},children:Object.entries(t).map(([n,{source:y,events:p,count:k}],j)=>{const D=d[n]>0,u=d[n]===p.length&&p.length>0,b=R[n];return e.jsxs(G.Fragment,{children:[e.jsx(Y,{sx:{borderBottom:j<Object.keys(t).length-1?"1px solid #f0f0f0":"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(g,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:s=>{s.target.closest(".MuiFormControlLabel-root")||C(n,s)},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:p.length>0&&e.jsx(le,{control:e.jsx(U,{checked:u,indeterminate:D&&!u,onChange:s=>{s.stopPropagation(),T(p,u)}}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[y.logo&&e.jsx(Te,{src:y.logo,sx:{width:24,height:24}}),e.jsx(g,{children:y.title||n}),D&&e.jsx(z,{label:m("webhookEndpoint.selectedCount",{count:d[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:s=>`${s.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(g,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:m("webhookEndpoint.eventsCount",{count:k})}),p.length>0&&e.jsx(X,{size:"small",edge:"end",children:b?e.jsx(Ke,{}):e.jsx(_e,{})})]})]})}),p.length>0&&e.jsx(Se,{in:b,timeout:"auto",unmountOnExit:!0,children:e.jsx(V,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:p.map(s=>{const f=`${s.type}-${s.source}`,w=!!a[f];return e.jsx(Y,{dense:!0,sx:{py:.75},onClick:()=>x(s),children:e.jsxs(g,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(U,{checked:w,sx:{mr:1}}),e.jsxs(g,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:s.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:s.description})]})]})},f)})})})]},n)})})}),l&&e.jsx(Re,{error:!0,sx:{mt:1},children:l})]})}Z.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};Z.defaultProps={error:null};function ee({id:t,url:a,description:c,enabledEvents:l,onSubmit:m,onClose:R}){var s;const{t:r}=A(),[d,i]=E.useState({}),{teamDid:v}=H(),{api:C}=B(),{loading:x,error:T,eventsBySource:h}=Ge(),{control:n,handleSubmit:y,formState:{errors:p},reset:k,setValue:j,trigger:D}=Ue({defaultValues:{url:"",description:""}});E.useEffect(()=>{const f=Object.values(d).some(w=>w);j("selectedEvents",f?"valid":""),D("selectedEvents")},[d,j,D]);const u=()=>{i({}),k(),R()},b=async f=>{const w=Object.keys(d).filter(M=>d[M]),O={url:f.url,description:f.description,enabledEvents:w.map(M=>{const[se,re]=M.split("-");return!se||!re?null:{type:se,source:re}}).filter(Boolean)};try{if(t){const M=await C.updateWebhookEndpoint({input:{teamDid:v,id:t,data:O}});$.success(`${r("webhookEndpoint.updateWebhook")} ${r("webhookEndpoint.success")}`),m(M)}else{const M=await C.createWebhookEndpoint({input:{teamDid:v,input:O}});$.success(`${r("webhookEndpoint.createWebhook")} ${r("webhookEndpoint.success")}`),m(M)}}catch(M){$.error(M==null?void 0:M.message)}u()};return E.useEffect(()=>{k({url:a,description:c}),i(l.reduce((f,w)=>(f[`${w.type}-${w.source}`]=!0,f),{}))},[k,i,a,c,l]),e.jsx(ke,{open:!0,onClose:u,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:y(b),children:[e.jsx(ve,{children:r(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Ee,{children:e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(K,{name:"url",control:n,rules:{required:r("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:r("webhookEndpoint.validation.urlInvalid")}},render:({field:f})=>{var w;return e.jsx(ie,{...f,label:r("webhookEndpoint.url.label"),fullWidth:!0,error:!!p.url,helperText:(w=p.url)==null?void 0:w.message})}}),e.jsx(K,{name:"description",control:n,rules:{required:r("webhookEndpoint.validation.descriptionRequired")},render:({field:f})=>{var w;return e.jsx(ie,{...f,label:r("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!p.description,helperText:(w=p.description)==null?void 0:w.message})}}),e.jsx(K,{name:"selectedEvents",control:n,rules:{required:r("webhookEndpoint.validation.eventRequired")},render:({field:f})=>e.jsx("input",{type:"hidden",...f})}),!x&&h&&Object.keys(h).length>0&&e.jsx(Z,{eventsBySource:h,selectedEvents:d,setSelectedEvents:i,error:(s=p.selectedEvents)==null?void 0:s.message}),!x&&(!h||Object.keys(h).length===0)&&e.jsx(S,{color:"text.secondary",children:r("webhookEndpoint.noAvailableEvents")}),x&&e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(N,{size:20})}),T&&e.jsx(Q,{severity:"error",children:r("webhookEndpoint.loadingError",{message:T==null?void 0:T.message})})]})}),e.jsxs(Ce,{sx:{p:"8px 24px 24px"},children:[e.jsx(q,{onClick:u,children:r("common.cancel")}),e.jsx(q,{type:"submit",variant:"contained",color:"primary",children:r(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}ee.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};ee.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function ue(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const Je=(t="en")=>t==="tw"?"zh":t;function L(t,a="YYYY-MM-DD HH:mm:ss",c="en"){return t?we(t).locale(Je(c)).format(a):"-"}function Qe(t){return typeof t=="number"?!1:pe(t)}function Xe(t){return t>=200&&t<300}function P(t){const a=Qe(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(I,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(W,{title:t.tip,children:e.jsx(Me,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:a?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:a?"-":t.value})]}),t.divider&&e.jsx(Ie,{orientation:"vertical",flexItem:!0})]})}P.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};P.defaultProps={tip:"",divider:!1};function te(t){return e.jsxs(I,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}te.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};te.defaultProps={children:null,mb:1.5,mt:1.5};const Ze=t=>{const a={};return t.forEach(c=>{var m;const l=new Date(c.createdAt).toLocaleDateString();a[l]||(a[l]=[]),(m=a[l])==null||m.push(c)}),a};function oe({eventId:t,webhookEndpointId:a,event:c}){const{api:l}=B(),{t:m}=A(),{teamDid:R}=H(),{data:r,loadMore:d,loadingMore:i,loading:v}=ge(p=>{const j=p?Math.ceil(p.list.length/15)+1:1;return l.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:a},paging:{page:j,pageSize:15}}})},{reloadDeps:[t,a]}),C=(r==null?void 0:r.list)||[],[x,T]=E.useState(null),h=Ze(C);E.useEffect(()=>{!x&&(r!=null&&r.list.length)&&T(r.list[0])},[r==null?void 0:r.list.length,x]);const n=p=>{T(p)};if(v)return e.jsx(N,{});const y=r&&r.list.length<r.paging.total;return e.jsxs(_,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(_,{item:!0,xs:12,md:4,height:1,children:pe(Object.keys(h))?e.jsx(S,{color:"text.secondary",children:m("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(V,{sx:{maxHeight:"100%",py:0,overflowY:"auto"},children:Object.entries(h).map(([p,k])=>e.jsxs(G.Fragment,{children:[e.jsx(Pe,{children:p}),k.map(j=>e.jsxs(Y,{sx:{cursor:"pointer"},onClick:()=>n(j),selected:x===j,secondaryAction:e.jsx(S,{color:"text.secondary",children:L(j.createdAt,"HH:mm:ss")}),children:[e.jsx(De,{sx:{minWidth:0,mr:1.5},children:Xe(j.responseStatus)===!1?e.jsx($e,{color:"error"}):e.jsx(We,{color:"success"})}),e.jsx(ze,{primary:e.jsx(S,{color:"text.primary",children:j.event.type})})]},j.id))]},p))}),y&&e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(q,{variant:"text",type:"button",color:"inherit",onClick:d,disabled:i,sx:{color:p=>p.palette.text.disabled},children:m(i?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(_,{item:!0,xs:12,md:8,height:1,children:[x&&e.jsxs(I,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsx(S,{variant:"h6",children:t?x.endpoint.url:x.event.type}),e.jsxs(g,{children:[e.jsxs(S,{variant:"h6",children:[m("webhookEndpoint.response")," (",x.responseStatus,")"]}),e.jsx(F,{language:"json",children:JSON.stringify(x.responseBody,null,2)})]}),e.jsxs(g,{children:[e.jsx(I,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:m("webhookEndpoint.request")})}),e.jsx(F,{language:"json",sx:{margin:0},children:JSON.stringify(x.event,null,2)})]})]}),(r==null?void 0:r.list.length)===0&&c&&e.jsxs(g,{children:[e.jsx(I,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:m("webhookEndpoint.eventData")})}),e.jsx(F,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}oe.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};oe.defaultProps={eventId:"",webhookEndpointId:"",event:null};function xe({id:t,onClose:a}){var v,C,x,T;const{t:c}=A(),{api:l}=B(),{teamDid:m}=H(),{loading:R,error:r,data:d}=de(()=>l.getWebhookEndpoint({input:{teamDid:m,id:t}})),i=d==null?void 0:d.data;return r?e.jsx(Q,{severity:"error",children:r.message}):R||!i?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(N,{})}):e.jsxs(et,{direction:"column",sx:{height:1},children:[e.jsxs(g,{children:[e.jsxs(I,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(I,{flex:1,width:0,children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:i.description}),e.jsx(W,{title:i.url,children:e.jsx(J,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(I,{direction:"row",alignItems:"center",children:e.jsx(X,{edge:"end",color:"inherit",onClick:a,children:e.jsx(Ae,{})})})]}),e.jsx(g,{mt:2,children:e.jsxs(I,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(P,{label:c("common.status"),value:e.jsx(z,{size:"small",variant:"filled",label:i.status,color:ue(i.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.listen"),value:e.jsx(W,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:i.enabledEvents.map(h=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:h==null?void 0:h.type},h))}),children:e.jsx(z,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:i.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.version"),value:i.apiVersion,divider:!0}),e.jsx(P,{label:c("common.createdAt"),value:L(i.createdAt),divider:!0}),e.jsx(P,{label:c("common.updatedAt"),value:L(i.updatedAt),divider:!0}),e.jsx(P,{label:c("common.createdBy"),value:e.jsx(W,{arrow:!0,title:(v=i.createUser)==null?void 0:v.did,children:e.jsx(z,{size:"small",variant:"filled",label:(C=i.createUser)==null?void 0:C.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("common.updatedBy"),value:e.jsx(W,{arrow:!0,title:(x=i.updateUser)==null?void 0:x.did,children:e.jsx(z,{size:"small",variant:"filled",label:(T=i.updateUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(I,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(te,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(I,{height:0,flex:1,overflow:"hidden",children:e.jsx(oe,{webhookEndpointId:i.id})})]})]})}xe.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const et=ce(I)``;function he({open:t,onClose:a,id:c}){return e.jsx(Oe,{anchor:"right",open:t,onClose:a,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(g,{sx:{height:"100vh",p:3},children:e.jsx(xe,{id:c,onClose:a})})})}he.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function ae(){return null}const ne=G.memo(({options:t,columns:a,toolbar:c=!0,footer:l=!0,hasRowLink:m=!1,emptyNodeText:R="",...r})=>{const{locale:d}=A(),i=qe(x=>x.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:i?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},C={};return c||(C.TableToolbar=ae),l||(C.TableFooter=ae),e.jsx(tt,{locale:d,options:{...v,...t},columns:(a||[]).map(x=>(x.options=x.options||{},x.options.filter=x.options.filter||!1,x.options.sort=x.options.sort||!1,x)),emptyNode:e.jsx(me,{children:R}),...r,components:C,hasRowLink:m,isMobile:i})});ne.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};ne.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const tt=ce(be)`
|
|
2
2
|
.MuiPaper-root {
|
|
3
3
|
border-radius: 8px;
|
|
4
4
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as T,j as K,bg as J}from"./vendor-mui-core-BGkzVIkr.js";import{x as O}from"./vendor-utils-DDG_VdF0.js";import{z as ee,h as _,T as te,Q as ne,U as se,E as re,V as oe}from"./index-BJbC-Qjr.js";import{g as W,r as ae}from"./vendor-react-DoD83n6N.js";import{ah as ie}from"./vendor-ux-did-connect-yBp5D51w.js";const S=(e,t)=>{var n;let s="?v=";return t?s+=te(t):s+=`${(n=e==null?void 0:e.meta)==null?void 0:n.version}${ne(e==null?void 0:e.status)?"~":""}`,s};function ce({blocklet:e}){var L,x,N,C,B,F,j;const{inService:t}=ee(),s=(L=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:L.value,n=(x=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:x.value,r=(N=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:N.value,o=(C=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:C.value,i=(B=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:B.value,a=(F=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:F.value,c=((j=window.env)==null?void 0:j.apiPrefix)||"/",d=`${O(c,`/blocklet/logo/${t?"":e.meta.did}`)}${S(e,s)}`,l=`${O(c,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${S(e,n??s)}`,f=`${O(c,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${S(e,r??s)}`,p=`${O(c,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${S(e,o)}`,h=`${O(c,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${S(e,i)}`,u=`${O(c,`/blocklet/og-image/${t?"":e.meta.did}`)}${S(e,a)}`;return{logoUrl:d,rectLogoUrl:l,faviconUrl:f,splashPortraitUrl:p,splashLandscapeUrl:h,ogImageUrl:u}}function V({blocklet:e,style:t,size:s,...n}){const{logoUrl:r}=ce({blocklet:e}),{variant:o}=n;return K.jsx(J,{variant:o||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},t),...n,children:K.jsx("img",{src:r,alt:"",style:{width:s}})})}V.propTypes={blocklet:T.object.isRequired,style:T.object,size:T.oneOfType([T.number,T.string])};V.defaultProps={style:{},size:40};var le=ae;function de(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var w=de(le);function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},M.apply(this,arguments)}function ue(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,A(e,t)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},A(e,t)}function fe(e,t){if(e==null)return{};var s={},n=Object.keys(e),r,o;for(o=0;o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&(s[r]=e[r]);return s}var G={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},pe=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function me(e,t){if(!e||typeof e!="object")return e;var s={};return Object.keys(e).forEach(function(n){t.indexOf(n)>-1||(s[n]=e[n])}),s}var he=["component","className","unsafeHTML"];function Y(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var s=document.createDocumentFragment(),n;switch(t){case"words":n=e.textContent.split(/\b|(?=\W)/);break;case"letters":n=Array.from(e.textContent);break}n.forEach(function(a){s.appendChild(ge(a))}),e.parentNode.replaceChild(s,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var r=[].slice.call(e.childNodes),o=r.length,i=0;i<o;i++)Y(r[i],t)}function ge(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function z(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function q(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);q(e.parentNode,t)}}function Le(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function b(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var k={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Ee=Object.keys(k),Q=function(e){ue(t,e);function t(n){var r;return r=e.call(this,n)||this,r.state={html:n.unsafeHTML,clamped:!1},r.canvas=null,r.maxLine=0,r.nlUnits=[],r}var s=t.prototype;return s.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},s.componentDidUpdate=function(r){r.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==r&&this.reflow(this.props)},s.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},s.setState=function(r,o){return typeof r.clamped<"u"&&(this.clamped=r.clamped),e.prototype.setState.call(this,r,o)},s.initCanvas=function(){if(!this.canvas){var r=this.canvas=document.createElement("div");r.className="LinesEllipsis-canvas "+this.props.className,r.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(G).forEach(function(o){r.style[o]=G[o]}),document.body.appendChild(r)}},s.copyStyleToCanvas=function(){var r=this,o=window.getComputedStyle(this.target);pe.forEach(function(i){r.canvas.style[i]=o[i]})},s.reflow=function(r){this.maxLine=+r.maxLine||1,this.canvas.innerHTML=r.unsafeHTML;var o=r.basedOn||(/^[\x00-\x7F]+$/.test(r.unsafeHTML)?"words":"letters");Y(this.canvas,o);var i=this.putEllipsis(this.calcIndexes()),a={clamped:i,html:this.canvas.innerHTML};this.setState(a,r.onReflow.bind(this,a))},s.calcIndexes=function(){var r=[0],o=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),i=o.length;if(!o.length)return r;var a=o.find(b);if(!a)return r;for(var c=1,d=a.offsetTop,l=1;l<i&&!(b(o[l])&&o[l].offsetTop-d>1&&(c++,r.push(l),d=o[l].offsetTop,c>this.maxLine));l++);return r},s.putEllipsis=function(r){if(r.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,r[this.maxLine]);var o=this.nlUnits.pop(),i=this.makeEllipsisSpan();do q(o,this.canvas),Le(o).appendChild(i),o=this.nlUnits.pop();while(o&&(!b(o)||i.offsetHeight>o.offsetHeight||i.offsetTop>o.offsetTop));return o&&z(o),this.nlUnits.forEach(z),!0},s.makeEllipsisSpan=function(){var r=this.props,o=r.ellipsisHTML,i=r.ellipsis,a=document.createElement("span");a.appendChild(document.createElement("wbr"));var c=document.createElement("span");return c.className="LinesEllipsis-ellipsis",o?c.innerHTML=o:c.textContent=i,a.appendChild(c),a},s.isClamped=function(){return this.clamped},s.render=function(){var r=this,o=this.state,i=o.html,a=o.clamped,c=this.props,d=c.component,l=c.className,f=c.unsafeHTML,p=fe(c,he);return w.default.createElement(d,M({className:"LinesEllipsis "+(a?"LinesEllipsis--clamped":"")+" "+l,ref:function(u){return r.target=u}},me(p,Ee)),w.default.createElement("div",{dangerouslySetInnerHTML:{__html:a?i:f}}))},t}(w.default.Component);Q.defaultProps=k;var ve=Q;const qe=W(ve),{joinURL:g,withQuery:E}=se,{toTypeInfo:ye}=ie,{isEVMChain:xe,getExplorerUrl:Oe}=re,{arcChainConfig:_e}=oe,Se={ROLE_ACCOUNT:"number",ROLE_NODE:"number",ROLE_DEVICE:"number",ROLE_APPLICATION:"number",ROLE_SMART_CONTRACT:"number",ROLE_BOT:"number",ROLE_ASSET:"number",ROLE_STAKE:"number",ROLE_VALIDATOR:"number",ROLE_GROUP:"number",ROLE_TX:"number",ROLE_TETHER:"number",ROLE_SWAP:"number",ROLE_DELEGATION:"number",ROLE_VC:"number",ROLE_BLOCKLET:"number",ROLE_STORE:"number",ROLE_TOKEN:"number",ROLE_FACTORY:"number",ROLE_ROLLUP:"number",ROLE_STORAGE:"number",ROLE_PROFILE:"number",ROLE_ANY:"number"},v="https://explorer.abtnetwork.io/explorer/";var Ce=function({hash:t,asset:s,rollup:n,address:r,token:o,stake:i,chainId:a=""}){if(xe(a)){const f=Oe(a);return t?g(f,`tx/${t}`):s?g(f,`token/${s}`):g(f,`address/${r}`)}const c=_e[a],d=c==null?void 0:c.defaultRPC,l=d?`${d}`:void 0;return n&&ye(n).role===Se.ROLE_ROLLUP?t?E(g(v,`rollups/${n}/moves/${t}`),{host:l}):E(g(v,`rollups/${n}`),{host:l}):s?E(g(v,`assets/${s}`),{host:l}):t?E(g(v,`txs/${t}`),{host:l}):o?E(g(v,`tokens/${o}/tx`),{host:l}):i?E(g(v,`stakes/${i}`),{host:l}):E(g(v,`accounts/${r}`),{host:l})},Te={isSameAddr:(e,t)=>String(e).toLowerCase()===String(t).toLowerCase()};const $=Ce,{isSameAddr:y}=Te;class U{constructor({type:t,did:s,chainId:n,text:r}){this.text=r,this.did=s,this.type=t,this.chainId=n}}const D=e=>{const t=[];try{let s=0;const n=/<(.+?)\(?[tx|nft|token|stake|did|dapp|link]+[:](.+?)\)?>/gi,r=e.matchAll(n);for(const o of r){const i=/\([tx|nft|token|stake|did|dapp|link]+[:](.+?)\)/gi,a=o[0],c=o.index||s,d=c+a.length;if([...a.matchAll(i)].length>1)return[e];let f="";const p=i.exec(a);let h="";if(p){const C=p[0];f=a.replace(C,"").replace(/^</,"").replace(/(>)$/,""),h=C.replace(/\)$/,"").replace(/^\(/,"")}else h=a;const u=h.split(":"),L=(u[0]||"").replace(/^</,"").replace(/^\(/,"").toUpperCase(),x=(u[1]||"").replace(/>$/,"").replace(/\)$/,""),N=(u[u.length-1]||"").replace(/>$/,"").replace(/\)$/,"");t.push(e.substring(s,c)),t.push(new U({type:L,chainId:x,did:N,text:f||L})),s=d}return s<e.length&&t.push(e.substring(s)),t}catch(s){return console.error(s==null?void 0:s.message),[e]}},H=e=>{let t;const{type:s,chainId:n,did:r}=e;return y(s,"link")?t=`${n}:${r}`:y(s,"tx")?t=$({hash:r,chainId:n}):y(s,"stake")?t=$({stake:r,chainId:n}):y(s,"nft")?t=$({asset:r,chainId:n}):y(s,"token")?t=$({token:r,chainId:n}):y(s,"did")&&(t=$({address:r,chainId:n})),t},$e=(e,t=!0)=>D(e).map(n=>{if(n instanceof U){if(t){const r=H(n),{type:o,chainId:i,did:a}=n;return y(o,"dapp")?`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${i}" data-did="${a}">${n.text}</em>`:r?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${r}">${n.text}</a>`:`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${i}" data-did="${a}">${n.text}</em>`}return n.text}return n}).join(""),Re=e=>D(e).map(s=>s instanceof U?`<${H(s)}|${s.text}>`:s.replace(/:\n/g,": ")).join("");var ke={toClickableSpan:$e,toTextList:D,toSlackLink:Re,Link:U,getLink:H};const Ne=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ue=e=>{try{return new URL(e).host}catch{return e}};var Qe={getChainHost:Ne,getUrlHost:Ue},Xe={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}},we={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},be={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const P=new Map,Me=(e,t)=>{P.set(e,t)},Ae=(e="en_US")=>P.get(e)||P.get("en_US");var X={registerLang:Me,getLang:Ae},Pe=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const De=Pe,{getLang:R}=X,He=(e,t)=>t===1?e:`${e}s`,Ie=1e-7;var Be=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const s=R(t.locale),n=[],r=(a,c)=>{const d=Math.floor(a*10**c+Ie);return(Math.round(d)/10**c).toFixed(c)},o=(a,c,d)=>{if((n.length===0||!t.colonNotation)&&a===0&&!(t.colonNotation&&c==="minute"))return;const{long:l}=s[c]||R("en_US")[c],{short:f}=s[c]||R("en_US")[c];let p=(d||a||"0").toString(),h,u;if(t.colonNotation){h=n.length>0?":":"",u="";const L=p.includes(".")?p.split(".")[0].length:p.length,x=n.length>0?2:1;p="0".repeat(Math.max(0,x-L))+p}else h="",t.locale==="zh_CN"?Object.values(i).filter(L=>L>0).length>1?!i.days&&!i.hours&&i.minutes&&t.compact?u=l:u=f:i.minutes?u=l:u=f:u=t.verbose?` ${He(l,a)}`:f;n.push(h+p+u)},i=De(e);if(o(Math.trunc(i.days/365),"year"),o(i.days%365,"day"),o(i.hours,"hour"),o(i.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(o(i.seconds,"second"),t.formatSubMilliseconds)o(i.milliseconds,"millisecond"),o(i.microseconds,"microsecond"),o(i.nanoseconds,"nanosecond");else{const a=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,c=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,d=a>=1?Math.round(a):Math.ceil(a),l=c?a.toFixed(c):d;o(Number.parseFloat(l,10),"millisecond",l)}else{const a=e/1e3%60,c=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,d=r(a,c),l=t.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");o(Number.parseFloat(l,10),"second",l)}if(n.length===0){const a=(s.millisecond||R("en_US").millisecond).long,c=(s.millisecond||R("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${a}`:c}`:`0${t.verbose?` ${a}s`:c}`}if(t.compact)return n[0];if(typeof t.unitCount=="number"){const a=t.colonNotation?"":" ";return n.slice(0,Math.max(t.unitCount,1)).join(a)}return t.colonNotation?n.join(""):n.join(" ")};const Fe=we,je=be,{registerLang:I}=X,Z=Be;I("en_US",Fe);I("zh_CN",je);Z.registerLang=I;var Ke=Z;const Ze=W(Ke);export{V as B,qe as H,Qe as c,Te as f,ke as h,Ze as p,Xe as s,ce as u};
|
|
1
|
+
import{E as T,j as K,bg as J}from"./vendor-mui-core-BGkzVIkr.js";import{x as O}from"./vendor-utils-DDG_VdF0.js";import{z as ee,h as _,T as te,Q as ne,U as se,E as re,V as oe}from"./index-CXwy6oRm.js";import{g as W,r as ae}from"./vendor-react-DoD83n6N.js";import{ah as ie}from"./vendor-ux-did-connect-BzpeuxHd.js";const S=(e,t)=>{var n;let s="?v=";return t?s+=te(t):s+=`${(n=e==null?void 0:e.meta)==null?void 0:n.version}${ne(e==null?void 0:e.status)?"~":""}`,s};function ce({blocklet:e}){var L,x,N,C,B,F,j;const{inService:t}=ee(),s=(L=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:L.value,n=(x=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:x.value,r=(N=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:N.value,o=(C=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:C.value,i=(B=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:B.value,a=(F=((e==null?void 0:e.environments)||[]).find(m=>m.key===_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:F.value,c=((j=window.env)==null?void 0:j.apiPrefix)||"/",d=`${O(c,`/blocklet/logo/${t?"":e.meta.did}`)}${S(e,s)}`,l=`${O(c,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${S(e,n??s)}`,f=`${O(c,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${S(e,r??s)}`,p=`${O(c,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${S(e,o)}`,h=`${O(c,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${S(e,i)}`,u=`${O(c,`/blocklet/og-image/${t?"":e.meta.did}`)}${S(e,a)}`;return{logoUrl:d,rectLogoUrl:l,faviconUrl:f,splashPortraitUrl:p,splashLandscapeUrl:h,ogImageUrl:u}}function V({blocklet:e,style:t,size:s,...n}){const{logoUrl:r}=ce({blocklet:e}),{variant:o}=n;return K.jsx(J,{variant:o||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},t),...n,children:K.jsx("img",{src:r,alt:"",style:{width:s}})})}V.propTypes={blocklet:T.object.isRequired,style:T.object,size:T.oneOfType([T.number,T.string])};V.defaultProps={style:{},size:40};var le=ae;function de(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var w=de(le);function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},M.apply(this,arguments)}function ue(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,A(e,t)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},A(e,t)}function fe(e,t){if(e==null)return{};var s={},n=Object.keys(e),r,o;for(o=0;o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&(s[r]=e[r]);return s}var G={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},pe=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function me(e,t){if(!e||typeof e!="object")return e;var s={};return Object.keys(e).forEach(function(n){t.indexOf(n)>-1||(s[n]=e[n])}),s}var he=["component","className","unsafeHTML"];function Y(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var s=document.createDocumentFragment(),n;switch(t){case"words":n=e.textContent.split(/\b|(?=\W)/);break;case"letters":n=Array.from(e.textContent);break}n.forEach(function(a){s.appendChild(ge(a))}),e.parentNode.replaceChild(s,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var r=[].slice.call(e.childNodes),o=r.length,i=0;i<o;i++)Y(r[i],t)}function ge(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function z(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function q(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);q(e.parentNode,t)}}function Le(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function b(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var k={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Ee=Object.keys(k),Q=function(e){ue(t,e);function t(n){var r;return r=e.call(this,n)||this,r.state={html:n.unsafeHTML,clamped:!1},r.canvas=null,r.maxLine=0,r.nlUnits=[],r}var s=t.prototype;return s.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},s.componentDidUpdate=function(r){r.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==r&&this.reflow(this.props)},s.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},s.setState=function(r,o){return typeof r.clamped<"u"&&(this.clamped=r.clamped),e.prototype.setState.call(this,r,o)},s.initCanvas=function(){if(!this.canvas){var r=this.canvas=document.createElement("div");r.className="LinesEllipsis-canvas "+this.props.className,r.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(G).forEach(function(o){r.style[o]=G[o]}),document.body.appendChild(r)}},s.copyStyleToCanvas=function(){var r=this,o=window.getComputedStyle(this.target);pe.forEach(function(i){r.canvas.style[i]=o[i]})},s.reflow=function(r){this.maxLine=+r.maxLine||1,this.canvas.innerHTML=r.unsafeHTML;var o=r.basedOn||(/^[\x00-\x7F]+$/.test(r.unsafeHTML)?"words":"letters");Y(this.canvas,o);var i=this.putEllipsis(this.calcIndexes()),a={clamped:i,html:this.canvas.innerHTML};this.setState(a,r.onReflow.bind(this,a))},s.calcIndexes=function(){var r=[0],o=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),i=o.length;if(!o.length)return r;var a=o.find(b);if(!a)return r;for(var c=1,d=a.offsetTop,l=1;l<i&&!(b(o[l])&&o[l].offsetTop-d>1&&(c++,r.push(l),d=o[l].offsetTop,c>this.maxLine));l++);return r},s.putEllipsis=function(r){if(r.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,r[this.maxLine]);var o=this.nlUnits.pop(),i=this.makeEllipsisSpan();do q(o,this.canvas),Le(o).appendChild(i),o=this.nlUnits.pop();while(o&&(!b(o)||i.offsetHeight>o.offsetHeight||i.offsetTop>o.offsetTop));return o&&z(o),this.nlUnits.forEach(z),!0},s.makeEllipsisSpan=function(){var r=this.props,o=r.ellipsisHTML,i=r.ellipsis,a=document.createElement("span");a.appendChild(document.createElement("wbr"));var c=document.createElement("span");return c.className="LinesEllipsis-ellipsis",o?c.innerHTML=o:c.textContent=i,a.appendChild(c),a},s.isClamped=function(){return this.clamped},s.render=function(){var r=this,o=this.state,i=o.html,a=o.clamped,c=this.props,d=c.component,l=c.className,f=c.unsafeHTML,p=fe(c,he);return w.default.createElement(d,M({className:"LinesEllipsis "+(a?"LinesEllipsis--clamped":"")+" "+l,ref:function(u){return r.target=u}},me(p,Ee)),w.default.createElement("div",{dangerouslySetInnerHTML:{__html:a?i:f}}))},t}(w.default.Component);Q.defaultProps=k;var ve=Q;const qe=W(ve),{joinURL:g,withQuery:E}=se,{toTypeInfo:ye}=ie,{isEVMChain:xe,getExplorerUrl:Oe}=re,{arcChainConfig:_e}=oe,Se={ROLE_ACCOUNT:"number",ROLE_NODE:"number",ROLE_DEVICE:"number",ROLE_APPLICATION:"number",ROLE_SMART_CONTRACT:"number",ROLE_BOT:"number",ROLE_ASSET:"number",ROLE_STAKE:"number",ROLE_VALIDATOR:"number",ROLE_GROUP:"number",ROLE_TX:"number",ROLE_TETHER:"number",ROLE_SWAP:"number",ROLE_DELEGATION:"number",ROLE_VC:"number",ROLE_BLOCKLET:"number",ROLE_STORE:"number",ROLE_TOKEN:"number",ROLE_FACTORY:"number",ROLE_ROLLUP:"number",ROLE_STORAGE:"number",ROLE_PROFILE:"number",ROLE_ANY:"number"},v="https://explorer.abtnetwork.io/explorer/";var Ce=function({hash:t,asset:s,rollup:n,address:r,token:o,stake:i,chainId:a=""}){if(xe(a)){const f=Oe(a);return t?g(f,`tx/${t}`):s?g(f,`token/${s}`):g(f,`address/${r}`)}const c=_e[a],d=c==null?void 0:c.defaultRPC,l=d?`${d}`:void 0;return n&&ye(n).role===Se.ROLE_ROLLUP?t?E(g(v,`rollups/${n}/moves/${t}`),{host:l}):E(g(v,`rollups/${n}`),{host:l}):s?E(g(v,`assets/${s}`),{host:l}):t?E(g(v,`txs/${t}`),{host:l}):o?E(g(v,`tokens/${o}/tx`),{host:l}):i?E(g(v,`stakes/${i}`),{host:l}):E(g(v,`accounts/${r}`),{host:l})},Te={isSameAddr:(e,t)=>String(e).toLowerCase()===String(t).toLowerCase()};const $=Ce,{isSameAddr:y}=Te;class U{constructor({type:t,did:s,chainId:n,text:r}){this.text=r,this.did=s,this.type=t,this.chainId=n}}const D=e=>{const t=[];try{let s=0;const n=/<(.+?)\(?[tx|nft|token|stake|did|dapp|link]+[:](.+?)\)?>/gi,r=e.matchAll(n);for(const o of r){const i=/\([tx|nft|token|stake|did|dapp|link]+[:](.+?)\)/gi,a=o[0],c=o.index||s,d=c+a.length;if([...a.matchAll(i)].length>1)return[e];let f="";const p=i.exec(a);let h="";if(p){const C=p[0];f=a.replace(C,"").replace(/^</,"").replace(/(>)$/,""),h=C.replace(/\)$/,"").replace(/^\(/,"")}else h=a;const u=h.split(":"),L=(u[0]||"").replace(/^</,"").replace(/^\(/,"").toUpperCase(),x=(u[1]||"").replace(/>$/,"").replace(/\)$/,""),N=(u[u.length-1]||"").replace(/>$/,"").replace(/\)$/,"");t.push(e.substring(s,c)),t.push(new U({type:L,chainId:x,did:N,text:f||L})),s=d}return s<e.length&&t.push(e.substring(s)),t}catch(s){return console.error(s==null?void 0:s.message),[e]}},H=e=>{let t;const{type:s,chainId:n,did:r}=e;return y(s,"link")?t=`${n}:${r}`:y(s,"tx")?t=$({hash:r,chainId:n}):y(s,"stake")?t=$({stake:r,chainId:n}):y(s,"nft")?t=$({asset:r,chainId:n}):y(s,"token")?t=$({token:r,chainId:n}):y(s,"did")&&(t=$({address:r,chainId:n})),t},$e=(e,t=!0)=>D(e).map(n=>{if(n instanceof U){if(t){const r=H(n),{type:o,chainId:i,did:a}=n;return y(o,"dapp")?`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${i}" data-did="${a}">${n.text}</em>`:r?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${r}">${n.text}</a>`:`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${i}" data-did="${a}">${n.text}</em>`}return n.text}return n}).join(""),Re=e=>D(e).map(s=>s instanceof U?`<${H(s)}|${s.text}>`:s.replace(/:\n/g,": ")).join("");var ke={toClickableSpan:$e,toTextList:D,toSlackLink:Re,Link:U,getLink:H};const Ne=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ue=e=>{try{return new URL(e).host}catch{return e}};var Qe={getChainHost:Ne,getUrlHost:Ue},Xe={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}},we={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},be={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const P=new Map,Me=(e,t)=>{P.set(e,t)},Ae=(e="en_US")=>P.get(e)||P.get("en_US");var X={registerLang:Me,getLang:Ae},Pe=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const De=Pe,{getLang:R}=X,He=(e,t)=>t===1?e:`${e}s`,Ie=1e-7;var Be=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const s=R(t.locale),n=[],r=(a,c)=>{const d=Math.floor(a*10**c+Ie);return(Math.round(d)/10**c).toFixed(c)},o=(a,c,d)=>{if((n.length===0||!t.colonNotation)&&a===0&&!(t.colonNotation&&c==="minute"))return;const{long:l}=s[c]||R("en_US")[c],{short:f}=s[c]||R("en_US")[c];let p=(d||a||"0").toString(),h,u;if(t.colonNotation){h=n.length>0?":":"",u="";const L=p.includes(".")?p.split(".")[0].length:p.length,x=n.length>0?2:1;p="0".repeat(Math.max(0,x-L))+p}else h="",t.locale==="zh_CN"?Object.values(i).filter(L=>L>0).length>1?!i.days&&!i.hours&&i.minutes&&t.compact?u=l:u=f:i.minutes?u=l:u=f:u=t.verbose?` ${He(l,a)}`:f;n.push(h+p+u)},i=De(e);if(o(Math.trunc(i.days/365),"year"),o(i.days%365,"day"),o(i.hours,"hour"),o(i.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(o(i.seconds,"second"),t.formatSubMilliseconds)o(i.milliseconds,"millisecond"),o(i.microseconds,"microsecond"),o(i.nanoseconds,"nanosecond");else{const a=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,c=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,d=a>=1?Math.round(a):Math.ceil(a),l=c?a.toFixed(c):d;o(Number.parseFloat(l,10),"millisecond",l)}else{const a=e/1e3%60,c=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,d=r(a,c),l=t.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");o(Number.parseFloat(l,10),"second",l)}if(n.length===0){const a=(s.millisecond||R("en_US").millisecond).long,c=(s.millisecond||R("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${a}`:c}`:`0${t.verbose?` ${a}s`:c}`}if(t.compact)return n[0];if(typeof t.unitCount=="number"){const a=t.colonNotation?"":" ";return n.slice(0,Math.max(t.unitCount,1)).join(a)}return t.colonNotation?n.join(""):n.join(" ")};const Fe=we,je=be,{registerLang:I}=X,Z=Be;I("en_US",Fe);I("zh_CN",je);Z.registerLang=I;var Ke=Z;const Ze=W(Ke);export{V as B,qe as H,Qe as c,Te as f,ke as h,Ze as p,Xe as s,ce as u};
|