@abtnode/blocklet-services 1.16.38 → 1.16.39-beta-20250209-032436-5ceca2cb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/libs/connect/session.js +2 -0
- package/dist/assets/{Add-CrR2-l93.js → Add-BKkOI8kr.js} +1 -1
- package/dist/assets/{ArrowDropDown-07MyjGcH.js → ArrowDropDown-Cj_5MpNL.js} +1 -1
- package/dist/assets/{CheckCircle-DqKi1HwM.js → CheckCircle-Dc8yF4jd.js} +1 -1
- package/dist/assets/{ChevronLeft-C5W5Bu-x.js → ChevronLeft-BKCFH_7s.js} +1 -1
- package/dist/assets/{ChevronRight-BRuYlsCv.js → ChevronRight-mqM60WjL.js} +1 -1
- package/dist/assets/{DeleteOutline-B7UAscKQ.js → DeleteOutline-D6WRSywd.js} +1 -1
- package/dist/assets/{Done-CAaQcK94.js → Done-B19I_hTo.js} +1 -1
- package/dist/assets/{Download-CgsaBDQs.js → Download-D8gClHbi.js} +1 -1
- package/dist/assets/{EditIcon-BGaX97FF.js → EditIcon-BOr0kf6I.js} +1 -1
- package/dist/assets/{Error-BqH6uMx2.js → Error-C036vLpd.js} +1 -1
- package/dist/assets/{Google-BwDpBduY.js → Google-BDjjtixD.js} +1 -1
- package/dist/assets/{InfoOutlined-BtVOjnjf.js → InfoOutlined-CJxRYyjF.js} +1 -1
- package/dist/assets/{Launch-Nfnrff9u.js → Launch-ChAa9OLi.js} +1 -1
- package/dist/assets/{LaunchOutlined-DLaccPTY.js → LaunchOutlined-CJ2Mgn9y.js} +1 -1
- package/dist/assets/{LockIcon-BHLM_myO.js → LockIcon-D-W4Rph6.js} +1 -1
- package/dist/assets/{Loop-CXQySzyE.js → Loop-0uHSVzVg.js} +1 -1
- package/dist/assets/{MoreHoriz-CSDih_9z.js → MoreHoriz-D_AgpVtE.js} +1 -1
- package/dist/assets/{PlayArrow-CMCMFiNW.js → PlayArrow-DjBGNK_J.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-BDO28oyM.js → QuestionMarkCircle-BvUTckGB.js} +1 -1
- package/dist/assets/{ServerLogo-D3ppBqIq.js → ServerLogo-BDEZRDcg.js} +1 -1
- package/dist/assets/{ViewList-PraULcbm.js → ViewList-C6uTrCwG.js} +1 -1
- package/dist/assets/{access-control-C2teJfVU.js → access-control-C2T3sxUP.js} +1 -1
- package/dist/assets/{actions-BpL3xa6h.js → actions-caLBBlX_.js} +1 -1
- package/dist/assets/{add-component-core-CPpsD6J6.js → add-component-core-jBUQht_3.js} +1 -1
- package/dist/assets/{add-resource-B58xirKn.js → add-resource-5eij1EQ2.js} +1 -1
- package/dist/assets/{addon-KRSz6l5N.js → addon-BKFsk9qg.js} +1 -1
- package/dist/assets/{analytics-DSLmgPH4.js → analytics-CxElQEQc.js} +1 -1
- package/dist/assets/api-K65cLqol.js +1 -0
- package/dist/assets/ar-BJD4HTM3.js +3 -0
- package/dist/assets/audit-logs-W6E8clAj.js +18 -0
- package/dist/assets/{base32-DyB0Khvd.js → base32-BTrVqdDB.js} +1 -1
- package/dist/assets/{branding-DJHfQEXa.js → branding-CNHSPWmv.js} +2 -2
- package/dist/assets/{bundle-avatar-CECNsBx1.js → bundle-avatar-DsrUOZA3.js} +1 -1
- package/dist/assets/button-muv2pKA-.js +1 -0
- package/dist/assets/{click-to-copy-_wMF7Hxj.js → click-to-copy-GbkBj9-M.js} +1 -1
- package/dist/assets/{cloneDeep-CFoL8R1_.js → cloneDeep-BRiLvZjr.js} +1 -1
- package/dist/assets/{complete-GB_L0bqz.js → complete-3tT09UKh.js} +4 -4
- package/dist/assets/{component-owdd0AfX.js → component-BNZa9Xug.js} +1 -1
- package/dist/assets/{config-Dmbn0gGh.js → config-BBPB9jNr.js} +1 -1
- package/dist/assets/{config-CunsUiG1.js → config-CK54nGqg.js} +1 -1
- package/dist/assets/{config-navigation-DxWI0_TS.js → config-navigation-CXoO_ww-.js} +3 -3
- package/dist/assets/{config-space-DmsFFfS9.js → config-space-CKZD0O9k.js} +1 -1
- package/dist/assets/{confirm-jlCvNwef.js → confirm-Cg9hPCJr.js} +1 -1
- package/dist/assets/connect-BzODMkFA.js +1 -0
- package/dist/assets/{connect-DhYtxWZo.js → connect-DgEXpEwR.js} +1 -1
- package/dist/assets/{connect-to-wXj-G4Dj.js → connect-to-DBKq6Esd.js} +1 -1
- package/dist/assets/{content-layout-DRV8Bqu8.js → content-layout-cWwRTmIc.js} +1 -1
- package/dist/assets/{dashboard-CzN7IzAG.js → dashboard-BI-BX7tJ.js} +10 -10
- package/dist/assets/de-CaPBInxb.js +3 -0
- package/dist/assets/{did-address-BeZtAuTI.js → did-address-BwvGS0Z4.js} +1 -1
- package/dist/assets/{domain-BX3MKy2a.js → domain-BigaYRFA.js} +2 -2
- package/dist/assets/{domain-list-BBs3Mtre.js → domain-list-Caw2busb.js} +2 -2
- package/dist/assets/{email-DwDKTVpX.js → email-BXwnQPgX.js} +2 -2
- package/dist/assets/es-hhXhgxGX.js +3 -0
- package/dist/assets/{exchange-passport-FlFKd1mh.js → exchange-passport-BBh5j_bb.js} +1 -1
- package/dist/assets/{form-text-input-BNhpSDlL.js → form-text-input-DGmQTvTb.js} +2 -2
- package/dist/assets/fr-BwQvAhhM.js +3 -0
- package/dist/assets/{fuel--Zn-NVMs.js → fuel-D3Pm6S5_.js} +1 -1
- package/dist/assets/{fullpage-BBve1S6N.js → fullpage-DCmKoQcJ.js} +1 -1
- package/dist/assets/{get-safe-url-BxuI5dYj.js → get-safe-url-1p-YuOdC.js} +1 -1
- package/dist/assets/{get-safe-url-By50yLX3.js → get-safe-url-BF6AgHuB.js} +1 -1
- package/dist/assets/hi-CRWmR5oy.js +1 -0
- package/dist/assets/{home-sPmWNLZQ.js → home-CmZzWlw6.js} +1 -1
- package/dist/assets/id-Dlr6Q1sk.js +3 -0
- package/dist/assets/{iframe-CTCwG7du.js → iframe-U1FevMj-.js} +1 -1
- package/dist/assets/{index-pz6VFmbg.js → index-BJ8kDugj.js} +1 -1
- package/dist/assets/{index-Dkh2u649.js → index-BMlnr8ok.js} +1 -1
- package/dist/assets/{index-x6YOGrxB.js → index-BQQG2pi0.js} +3 -3
- package/dist/assets/{index-BoVwrnPM.js → index-BzJecSS8.js} +1 -1
- package/dist/assets/{index-D4b-IulH.js → index-C-D-nCB1.js} +1 -1
- package/dist/assets/{index-eLQ9nSt_.js → index-C2fPoxDR.js} +1 -1
- package/dist/assets/{index-DGE6IUiK.js → index-CHFvfli7.js} +1 -1
- package/dist/assets/index-CIZ-6weB.js +104 -0
- package/dist/assets/{index-bP1urf9D.js → index-CJHEwaI7.js} +1 -1
- package/dist/assets/{index-Ce8JlRjK.js → index-COUN--i8.js} +3 -3
- package/dist/assets/{index-Cgl9CJKn.js → index-CPUZHn0F.js} +4 -4
- package/dist/assets/{index-4q215i88.js → index-CVFyE6Sl.js} +1 -1
- package/dist/assets/{index-CeDgfE-R.js → index-ChSPqVLh.js} +1 -1
- package/dist/assets/{index-Du43_MKm.js → index-D3M3VZra.js} +1 -1
- package/dist/assets/{index-CFEJrtrO.js → index-DEq8S4-I.js} +1 -1
- package/dist/assets/{index-BMTuDbff.js → index-DUWG1KqB.js} +1 -1
- package/dist/assets/{index-B8Nio2ig.js → index-DmOpbC_Q.js} +1 -1
- package/dist/assets/{index-BzpSavwm.js → index-DtwN19zv.js} +1 -1
- package/dist/assets/{index-CVj2sp_g.js → index-DvZ_TLdU.js} +1 -1
- package/dist/assets/index-NO9AJ1dn.js +1 -0
- package/dist/assets/{invitation-BZFpUcSJ.js → invitation-BaO_F6sL.js} +3 -3
- package/dist/assets/{invite-BU3Ccpga.js → invite-Vyg0B--e.js} +1 -1
- package/dist/assets/{issue-passport-CYRMlQJ5.js → issue-passport-Bj7JTsXA.js} +1 -1
- package/dist/assets/{item-Cxj4TDMq.js → item-BZcF6J-s.js} +1 -1
- package/dist/assets/ja-CmKylH6K.js +3 -0
- package/dist/assets/ko-Blp8936a.js +3 -0
- package/dist/assets/{launch-result-message-0WH2fKJs.js → launch-result-message-keU5grqY.js} +1 -1
- package/dist/assets/{layout-Dtb_WFTA.js → layout-WoEg-ZDx.js} +1 -1
- package/dist/assets/{list-CASrxNBR.js → list-D8KZ_085.js} +1 -1
- package/dist/assets/{list-header-B4J0CzaY.js → list-header-DfHbQVcL.js} +1 -1
- package/dist/assets/localization-DqiVqCQK.js +1 -0
- package/dist/assets/{log-COTeJeZn.js → log-q8WOeeqF.js} +1 -1
- package/dist/assets/login-BgJ9dTuh.js +1 -0
- package/dist/assets/{login-oauth-callback-qcC243Kl.js → login-oauth-callback-BnRQTkBq.js} +1 -1
- package/dist/assets/{logo-uploader-BEXp6PuR.js → logo-uploader-BgvRj-1f.js} +3 -3
- package/dist/assets/{lost-passport-DEKSH9FW.js → lost-passport-D9QUmr6L.js} +3 -3
- package/dist/assets/{open-window-DFz1kWMV.js → open-window-Dw5QIWq6.js} +1 -1
- package/dist/assets/{overview-4648jAce.js → overview-DsBm8pO-.js} +1 -1
- package/dist/assets/{page-header-78QbhtuN.js → page-header-BR1xofie.js} +1 -1
- package/dist/assets/{permission-DHQhhxoY.js → permission-DLT57IZZ.js} +1 -1
- package/dist/assets/{preferences-DLxWbOW4.js → preferences-DzQwzTc-.js} +1 -1
- package/dist/assets/pt-BbwAvpfn.js +1 -0
- package/dist/assets/publish-resource-CE-sYI4f.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-DJF6O4rR.js → react-beautiful-dnd.esm-BtA3JVog.js} +1 -1
- package/dist/assets/{relative-time-D0PKnQr3.js → relative-time-yqjvLxNC.js} +1 -1
- package/dist/assets/ru-DgfLeWul.js +1 -0
- package/dist/assets/sdk-CpE7sbD_.js +1 -0
- package/dist/assets/session-D-F-iijZ.js +1 -0
- package/dist/assets/{setup-CVG5jVIU.js → setup-TRiUB1Px.js} +3 -3
- package/dist/assets/{shorten-label-BPVcqm_d.js → shorten-label-J69eHfMN.js} +1 -1
- package/dist/assets/{simple-select-Bly6GilY.js → simple-select-D06JmA0a.js} +1 -1
- package/dist/assets/{slicedToArray--pkkXr1E.js → slicedToArray-CXBLQZX4.js} +2 -2
- package/dist/assets/{start-1BJlmDvU.js → start-ROppIq-j.js} +1 -1
- package/dist/assets/{step-actions-CCkY0hVg.js → step-actions-BfPRhdBV.js} +1 -1
- package/dist/assets/{studio-CPSkJvej.js → studio-TADgck-O.js} +1 -1
- package/dist/assets/switch-control--0xPf_7K.js +18 -0
- package/dist/assets/th-DXRi_ppC.js +1 -0
- package/dist/assets/{traffic-BE5KpYHp.js → traffic-Bfk2lmR-.js} +3 -3
- package/dist/assets/{transfer-DKKPtRUT.js → transfer-DizfAsbo.js} +1 -1
- package/dist/assets/{unsubscribe-BsAmTGTC.js → unsubscribe-elexh-kW.js} +1 -1
- package/dist/assets/{use-mobile-CtFE3PKN.js → use-mobile-DnWfrhc7.js} +1 -1
- package/dist/assets/{useAsync-C_D9UUDU.js → useAsync-Ua5iss51.js} +1 -1
- package/dist/assets/{useAsyncRetry-C2tIkwnA.js → useAsyncRetry-Bmo6a1Zp.js} +1 -1
- package/dist/assets/{useLocalStorage-PjdUbJMx.js → useLocalStorage-DnlK9tHz.js} +1 -1
- package/dist/assets/{user-center-BeBWy2q4.js → user-center-m1aTOIEE.js} +1 -1
- package/dist/assets/{util-CKwESf7z.js → util-B9yvyJKW.js} +1 -1
- package/dist/assets/{util-DS5jlfDf.js → util-eME8uaMf.js} +1 -1
- package/dist/assets/vendor-arcblock-DbrmIue2.js +3506 -0
- package/dist/assets/{vendor-hooks-Dk0Sjyu7.js → vendor-hooks-BKxTDk_P.js} +1 -1
- package/dist/assets/vendor-mui-core-xF5F4eT7.js +266 -0
- package/dist/assets/{vendor-mui-x-BcCkWIwf.js → vendor-mui-x-CSUdon8K.js} +1 -1
- package/dist/assets/vendor-utils-5TjOM6td.js +11 -0
- package/dist/assets/vi-nO7JrO24.js +1 -0
- package/dist/assets/wrap-locale-fB5m4Aoq.js +1 -0
- package/dist/assets/zh-CEvYioAt.js +4 -0
- package/dist/assets/zh-tw-BjfRYnXu.js +3 -0
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +21 -21
- package/dist/assets/api-CxVpA84W.js +0 -1
- package/dist/assets/ar-C89hW7LF.js +0 -3
- package/dist/assets/audit-logs-B4q_aJjT.js +0 -58
- package/dist/assets/button-Db0MREM0.js +0 -1
- package/dist/assets/connect-DawMsOck.js +0 -1
- package/dist/assets/de-BScxb0zD.js +0 -3
- package/dist/assets/es-B9f-yiTL.js +0 -3
- package/dist/assets/fr-BguXQaFu.js +0 -3
- package/dist/assets/hi-7nPwxLb7.js +0 -1
- package/dist/assets/id-gU7ysJNs.js +0 -3
- package/dist/assets/index-D6GAN2o7.js +0 -1
- package/dist/assets/index-DIOGsNFt.js +0 -104
- package/dist/assets/ja-C4BURK37.js +0 -3
- package/dist/assets/ko-CeKzLbt8.js +0 -3
- package/dist/assets/localization-BORM8l0X.js +0 -1
- package/dist/assets/login-DVyUiJRp.js +0 -1
- package/dist/assets/pt-o1EeyLhb.js +0 -1
- package/dist/assets/publish-resource-DFVCzFSH.js +0 -1
- package/dist/assets/ru-BlfgKyTj.js +0 -1
- package/dist/assets/sdk-CYU1RQGr.js +0 -1
- package/dist/assets/session-UyvM3XBK.js +0 -1
- package/dist/assets/switch-control-BZ1WnnHj.js +0 -13
- package/dist/assets/th-BHBtH1Zl.js +0 -1
- package/dist/assets/vendor-arcblock-B6bsNHwS.js +0 -3506
- package/dist/assets/vendor-mui-core-DHnPlNQK.js +0 -267
- package/dist/assets/vendor-utils-f0cH60Lr.js +0 -11
- package/dist/assets/vi-CuGQRG8r.js +0 -1
- package/dist/assets/wrap-locale-DCwm7-9w.js +0 -1
- package/dist/assets/zh-DfOtp2w7.js +0 -4
- package/dist/assets/zh-tw-DFpaHA6Z.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as T,j as K,aM as J}from"./vendor-mui-core-DHnPlNQK.js";import{x as O}from"./vendor-utils-f0cH60Lr.js";import{y as ee,h as _,R as te,O as ne,T as se,D as re,U as oe}from"./index-DIOGsNFt.js";import{g as W,r as ae}from"./vendor-react-D-afvo_7.js";import{n as ie}from"./vendor-arcblock-B6bsNHwS.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,aM as J}from"./vendor-mui-core-xF5F4eT7.js";import{x as O}from"./vendor-utils-5TjOM6td.js";import{y as ee,h as _,R as te,O as ne,T as se,D as re,U as oe}from"./index-CIZ-6weB.js";import{g as W,r as ae}from"./vendor-react-D-afvo_7.js";import{n as ie}from"./vendor-arcblock-DbrmIue2.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,4 +1,4 @@
|
|
|
1
|
-
import{r as h}from"./vendor-react-D-afvo_7.js";import{j as e,a1 as Te,E as y,a4 as qe,T as M,a3 as w,aa as ue,a2 as pe,ah as Me,aj as Ne,x as Re,R as Ue,bH as De,bI as $e,aP as Ve,al as Se,V as He,co as Ge,cm as Je,aN as Qe,bL as Xe,A as Ie}from"./vendor-mui-core-DHnPlNQK.js";import{b as se,z as Ye,A as Ze,ap as re}from"./vendor-utils-f0cH60Lr.js";import{b as U,j as Q,_ as Ae,aB as V,e as ne,a5 as et,al as tt,B as Ee,bi as st,aT as nt,bx as at}from"./vendor-arcblock-B6bsNHwS.js";import{y as it,F as B,m as ot,H as ye}from"./index-DIOGsNFt.js";import{d as J,a as rt}from"./vendor-hooks-Dk0Sjyu7.js";import{b as he}from"./dashboard-CzN7IzAG.js";import{p as lt}from"./util-CKwESf7z.js";import{W as ke}from"./did-address-BeZtAuTI.js";import{S as te}from"./shorten-label-BPVcqm_d.js";import{I as je}from"./index-CVj2sp_g.js";import{c as ve}from"./index-DoZ2YM4T.js";import{S as ct,a as dt}from"./list-CASrxNBR.js";import{R as Le}from"./relative-time-D0PKnQr3.js";import{D as ut,g as pt}from"./traffic-BE5KpYHp.js";import{B as Oe}from"./bundle-avatar-CECNsBx1.js";import{B as ft}from"./index-bP1urf9D.js";import"./useLocalStorage-PjdUbJMx.js";import"./confirm-jlCvNwef.js";import"./format-error-C0Ke3VXF.js";import"./PlayArrow-CMCMFiNW.js";import"./get-safe-url-BxuI5dYj.js";import"./session-UyvM3XBK.js";import"./useAsyncRetry-C2tIkwnA.js";import"./useAsync-C_D9UUDU.js";import"./InfoOutlined-BtVOjnjf.js";import"./useSetState-Crt4S51m.js";import"./index-DGE6IUiK.js";import"./iframe-CTCwG7du.js";import"./LaunchOutlined-DLaccPTY.js";import"./ChevronLeft-C5W5Bu-x.js";import"./ChevronRight-BRuYlsCv.js";import"./index-D4b-IulH.js";import"./vendor-mui-x-BcCkWIwf.js";const Pe=h.createContext({}),{Provider:mt,Consumer:Ss}=Pe;function ht({children:t,blocklet:i=""}){const{api:a,inService:f,ws:{useSubscription:m}}=it(),[u,c]=h.useState([]),[j,A]=h.useState({total:0,pageSize:20,pageCount:0,page:1}),[N,_]=h.useState(!1),E=J(()=>{var R;return(R=i.meta)==null?void 0:R.did},[i]),[K,Y]=h.useState({}),[O,H]=h.useState([]),F=async({page:R=1,pageSize:L=20,...C}={})=>{if(!(N||!E))try{_(!0);const I={paging:{page:R,pageSize:L},...C,userName:C.searchText||"",teamDid:E,dateRange:C.dateRange?[B(C.dateRange[0]).toISOString(),B(C.dateRange[1]).toISOString()]:void 0},{dids:W,...Z}=I;let G="";W.includes("system")&&(G="system");const q=W.filter(z=>z!=="system"),ee=await a.getNotificationSendLog({input:{...Z,source:G,componentDids:q}});Y(I);const ae=ee.list.map(z=>({...z,receiverUser:{...z.receiverUser,avatar:lt(z.receiverUser.avatar,E,f)}}));c(ae),A(ee.paging),_(!1)}catch(I){Q.error(I.message),_(!1)}},g=async()=>{const R=await a.getNotificationComponents({input:{teamDid:E}});H(R.componentDids)},D=h.useCallback(R=>{const L=i.children.find(C=>{var I;return((I=C.meta)==null?void 0:I.did)===R});if(L)return L.ancestors=[i],L},[i]),k=async({notificationReceiverIds:R,channels:L,...C})=>{await a.resendNotification({input:{teamDid:E,notificationReceiverIds:R,channels:L.map(I=>I==="wallet"?U.NOTIFICATION_SEND_CHANNEL.WALLET:I==="pushKit"?U.NOTIFICATION_SEND_CHANNEL.PUSH:I),...C}})},$=h.useCallback(async R=>(await a.getUser({input:{teamDid:E,user:{did:R}}})).user,[a,E]);m(`${U.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,R=>{R&&(F(K),g())},[K]),h.useEffect(()=>{E&&g()},[E]);const S={loading:N,fetch:F,data:u,paging:j,blocklet:i,getComponent:D,resendNotification:k,getUser:$,componentDids:O};return e.jsx(mt,{value:{notificationRecords:S},children:t})}function Fe(){const{notificationRecords:t}=h.useContext(Pe);return t}var xe={},gt=Te;Object.defineProperty(xe,"__esModule",{value:!0});var ze=xe.default=void 0,xt=gt(Ae()),bt=e;ze=xe.default=(0,xt.default)((0,bt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var be={},St=Te;Object.defineProperty(be,"__esModule",{value:!0});var Be=be.default=void 0,yt=St(Ae()),jt=e;Be=be.default=(0,yt.default)((0,jt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");const vt=(t,i,a="")=>{if(!a||!i)return"";switch(a){case U.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:i});case U.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:i});case U.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:i});case U.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return a}};function de(t,i,a={}){const{status:f,updatedAt:m,reason:u="",channel:c="wallet"}=a,j=m?t("notification.sendStatus.sentTime",{date:ot(m,i)}):"",A=vt(t,c,u);return f===U.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:j,reason:A}:f===U.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:j}:{status:"pending",title:t("notification.sendStatus.pending"),reason:A,sentTime:j}}const we={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ge=["wallet","pushKit","email"],wt=(t,i)=>{var m,u;const{settings:a}=t,f=se(i,"extra.notifications.email",!0);return{available:(u=(m=a==null?void 0:a.notification)==null?void 0:m.email)==null?void 0:u.enabled,enabled:f}},Ct=(t,i)=>{var m,u;const{settings:a}=t,f=se(i,"extra.notifications.push",!0);return{available:(u=(m=a==null?void 0:a.notification)==null?void 0:m.pushKit)==null?void 0:u.enabled,enabled:f}},Tt=t=>({enabled:se(t,"extra.notifications.wallet",!0)}),Nt=t=>({enabled:se(t,"extra.webhooks",[]).length>0}),Ce=(t=3e3)=>new Promise(i=>{setTimeout(()=>{i()},t)}),Rt=(t,i)=>i==="wallet"||i==="webhook"?[{channel:i,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:i}),fail:t("notification.sendStatus.reason.disabled",{channel:i})}]:i==="pushKit"||i==="email"?[{channel:i,type:"available",pass:t("notification.sendStatus.reason.available",{channel:i}),fail:t("notification.sendStatus.reason.unavailable",{channel:i})},{channel:i,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:i}),fail:t("notification.sendStatus.reason.disabled",{channel:i})}]:[],Dt=t=>{const i={},a=B().startOf("day");ge.forEach(u=>{const c=`${u}SendRecord`,A=se(t,c,[]).filter(N=>B(N.sendAt).isSame(a,"day")).length;i[u]=A});const f=se(t,"webhook",{}),m=Object.keys(f??{})??[];return m.length>0&&m.forEach(u=>{const j=(f[u]??[]).filter(A=>B(A.sendAt).isSame(a,"day")).length;i[u]=j}),i};function X({config:t,enableTooltip:i=!0,showTitle:a=!1}){const{status:f,title:m="",sentTime:u="",reason:c=""}=t,j=[m,c].filter(Boolean).join(", ");return e.jsx(qe,{title:i?e.jsxs(e.Fragment,{children:[e.jsx(M,{color:"inherit",sx:{fontSize:12},children:j}),e.jsx("span",{children:u})]}):null,arrow:!0,placement:"top",children:e.jsxs(w,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1},children:[e.jsxs(w,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(w,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:we[f],style:{opacity:.15}}),e.jsx(w,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:we[f]})]}),a?e.jsx(M,{color:"inherit",sx:{fontSize:12},children:m}):null]})})}X.propTypes={config:y.object.isRequired,enableTooltip:y.bool,showTitle:y.bool};X.defaultProps={enableTooltip:!0,showTitle:!1};_e.propTypes={notification:y.object.isRequired,onCancel:y.func,blocklet:y.object.isRequired,resendChannel:y.string,refresh:y.func,tab:y.string};function _e({notification:t,onCancel:i=()=>{},blocklet:a,resendChannel:f="",refresh:m=()=>{},tab:u="info"}){const{t:c,locale:j}=ne(),{getComponent:A,resendNotification:N,getUser:_}=Fe(),[E,K]=h.useState([]),[Y,O]=h.useState([]),[H,F]=h.useState(null),[g,D]=h.useState(null),k=h.useRef({}),$=J(()=>A(t.componentDid)||a,[a,t.componentDid]),S=J(()=>{var s;return(s=t==null?void 0:t.receivers)==null?void 0:s[0]},[t.receivers]),R=J(()=>S==null?void 0:S.receiver,[S]),L=J(()=>S==null?void 0:S.receiverUser,[S]),C=rt({tab:u||"info"}),I=J(()=>Dt(S),[S]),W=h.useCallback(async s=>{const{receiver:l}=S??{};if(!l)return!1;const p=await _(l);return p?s==="wallet"?Tt(p):s==="email"?wt(a,p):s==="pushKit"?Ct(a,p):s==="webhook"?Nt(p):!0:!1},[S,_,a]);h.useEffect(()=>{if(!S)K([]);else{const s=ge.map(p=>{const b=S[`${p}SendStatus`],v=S[`${p}SendAt`],P=S[`${p}SendFailedReason`],We=de(c,j,{status:b,updatedAt:v,reason:P,channel:p});return{type:p==="pushKit"?"Push Kit":p,extra:We}});K(s);const l=(S==null?void 0:S.webhook)||{};O(Object.entries(l))}},[S,j,c]);const Z=h.useCallback(async(s,l="")=>{const{id:p}=S??{};if(p)try{await N({notificationReceiverIds:[p],channels:[s],...s==="webhook"&&l?{webhookUrls:[l]}:{}}),Q.success("Message has been sent!"),s!=="webhook"&&(await Ce(1e3),F(null))}catch(b){console.error("handleResend error",{error:b}),Q.error(b.response?b.response.statusText:b.message)}},[N,S]),G=async(s,l)=>{if(l==null||l.stopPropagation(),I[s.type]>=4){Q.warning(c("notification.resendLimit"));return}if(l&&F(l==null?void 0:l.currentTarget),D({channel:s.type}),!(!s||s.checking)){K(b=>b.map(v=>s.type===v.type?{...v,checking:!0}:v));try{const b=await W(s.type);await Ce(),D({channel:s.type,result:b}),(typeof b=="boolean"&&b||Ye(b)&&Object.values(b).every(v=>!!v))&&(await Z(s.type),m()),K(v=>v.map(P=>s.type===P.type?{...P,checking:!1}:P))}catch(b){console.error("handleResend error",{error:b})}}},q=async(s,l=null)=>{if(l==null||l.stopPropagation(),I[s]>=4){Q.warning(c("notification.resendLimit"));return}O(b=>b.map(v=>s===v[0]?[...v.slice(0,2),!0]:v));try{await Z("webhook",s),O(b=>b.map(v=>s===v[0]?[...v.slice(0,2),!0]:v)),m()}catch(b){console.error("handleResend error",{error:b})}};h.useEffect(()=>{f&&(C.tab="status",setTimeout(()=>{const s=k.current[f];s&&(ge.includes(f)?(F(s),G({type:f})):q(f))},500))},[f]);const ee=()=>{F(null)},ae=h.useCallback(s=>Rt(c,s),[c]),z=!!H,o=z?"check-resend-popover":void 0;function n(){return[{name:c("notification.from"),value:e.jsx(ct,{size:32,blocklet:$,showName:!0,hideDot:!0})},{name:c("notification.to"),value:e.jsx(w,{children:L?e.jsxs(w,{"data-cy":`member-name-${L.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(Ee,{src:`${L.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:R,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(te,{children:L.fullName})]},R):e.jsx(ke,{size:14,responsive:!1,compact:!0,copyable:!1,did:R})})},{name:c("notification.notificationTitle"),value:e.jsx(te,{maxLength:50,children:t.title})},{name:c("notification.body"),value:e.jsx(dt,{notification:t,rows:0})},{name:c("notification.createdAt"),value:e.jsx(Le,{value:t.createdAt,locale:j,shouldUpdate:!0})}].map(l=>e.jsx(je,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:l.name,children:l.value},l.name))}const r={info:{label:c("common.basicInfo"),value:"info",component:n},status:{label:c("notification.status"),value:"status"}},d=Object.values(r).map(({label:s,value:l})=>({label:s,value:l})),x=r[C.tab]||r.info,T=s=>{C.tab=s};return e.jsx(et,{title:c("notification.notificationDetails"),onClose:()=>{C.tab="info",F(null),i()},open:!0,PaperProps:{style:{maxWidth:832,maxHeight:"80vh"}},sx:{"& .MuiDialogContent-root":{paddingTop:0}},fullWidth:!0,actionsPosition:"left",children:e.jsxs(It,{children:[e.jsx(w,{mx:3,className:"tabs",children:e.jsx(tt,{tabs:d,current:C.tab,onChange:T,scrollButtons:"auto"})}),e.jsx("div",{className:"body",children:C.tab==="info"?e.jsx(x.component,{}):e.jsxs(w,{children:[E.map(s=>e.jsx(je,{valueComponent:"div",nameWidth:120,name:s.type,children:e.jsxs(w,{className:"channel-item",display:"flex",alignItems:"center",sx:{gap:"4px",fontSize:14},children:[e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(X,{config:s.extra,showTitle:!0})}),s.extra.status!=="success"&&e.jsxs(M,{ref:l=>{k.current[s.type]=l},component:"span",display:"flex",alignItems:"center",sx:{color:V.primary.main,fontSize:14},className:ve("resend-btn",{disabled:s.checking||I[s.type]>=4}),onClick:l=>G(s,l),children:[s.checking?e.jsx(pe,{size:12,sx:{color:V.primary.main}}):e.jsx(he,{}),e.jsx("span",{style:{marginLeft:4},children:c("notification.resend")})]})]})},s.type)),e.jsx(Me,{textAlign:"left",sx:{mt:1,mb:1},children:"Webhook"}),e.jsx(w,{className:"notification-resend-section",display:"flex",flexDirection:"column",gap:1,style:{paddingLeft:0},children:Y.map(([s,l,p])=>{const b=l[0],v=de(c,j,{...b,updatedAt:b.sendAt,reason:b.failedReason,channel:"webhook"});return e.jsxs(w,{className:"channel-item",display:"flex",alignItems:"center",sx:{gap:"4px",fontSize:12},children:[e.jsx(te,{maxLength:30,children:s}),e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(X,{config:v,showTitle:!0})}),v.status!=="success"&&e.jsxs(M,{ref:P=>{k.current[s]=P},component:"span",sx:{color:V.primary.main},className:ve("resend-btn",{disabled:p||I[s]>=4}),onClick:P=>q(s,P),children:[p?e.jsx(pe,{size:12,sx:{color:V.primary.main}}):e.jsx(he,{}),e.jsx("span",{style:{marginLeft:4},children:c("notification.resend")})]})]},s)})})]})}),e.jsx(Ne,{id:o,open:z,anchorEl:H,onClose:ee,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(At,{children:[e.jsxs(M,{variant:"body1",component:"div",className:"check-title",children:[g==null?void 0:g.channel," Checking"]}),e.jsx(w,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:ae(g==null?void 0:g.channel).map(s=>{var v,P;const{type:l,pass:p,fail:b}=s;return!(g!=null&&g.result)||(v=g==null?void 0:g.result)!=null&&v[l]?e.jsxs(M,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(P=g==null?void 0:g.result)!=null&&P[l]?V.success.main:"inherit"},children:[g!=null&&g.result?e.jsx(Be,{}):e.jsx(pe,{size:12,sx:{color:V.primary.main}}),e.jsx("span",{children:p})]},l):e.jsxs(M,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:V.error.main},children:[e.jsx(ze,{}),e.jsx("span",{children:b})]},l)})})]})})]})})}const It=ue.div`
|
|
1
|
+
import{r as h}from"./vendor-react-D-afvo_7.js";import{j as e,a1 as Ne,E as y,a4 as qe,T as U,a3 as w,aa as ue,a2 as pe,ah as Ue,aj as Re,x as Te,R as Me,bH as De,bI as $e,aP as Ve,al as Se,V as He,cn as Ge,cm as Je,aN as Qe,bL as Xe,A as Ie}from"./vendor-mui-core-xF5F4eT7.js";import{b as se,z as Ye,A as Ze,ap as re}from"./vendor-utils-5TjOM6td.js";import{b as M,j as Q,$ as Ae,aC as V,e as ne,a6 as et,am as tt,B as Ee,bj as st,aU as nt,bA as at}from"./vendor-arcblock-DbrmIue2.js";import{y as it,F as B,m as ot,H as ye}from"./index-CIZ-6weB.js";import{d as J,a as rt}from"./vendor-hooks-BKxTDk_P.js";import{b as he}from"./dashboard-BI-BX7tJ.js";import{p as lt}from"./util-B9yvyJKW.js";import{W as ke}from"./did-address-BwvGS0Z4.js";import{S as te}from"./shorten-label-J69eHfMN.js";import{I as je}from"./index-DvZ_TLdU.js";import{c as ve}from"./index-DoZ2YM4T.js";import{S as ct,a as dt}from"./list-D8KZ_085.js";import{R as Le}from"./relative-time-yqjvLxNC.js";import{D as ut,g as pt}from"./traffic-Bfk2lmR-.js";import{B as Oe}from"./bundle-avatar-DsrUOZA3.js";import{B as ft}from"./index-CJHEwaI7.js";import"./useLocalStorage-DnlK9tHz.js";import"./confirm-Cg9hPCJr.js";import"./format-error-C0Ke3VXF.js";import"./PlayArrow-DjBGNK_J.js";import"./get-safe-url-1p-YuOdC.js";import"./session-D-F-iijZ.js";import"./useAsyncRetry-Bmo6a1Zp.js";import"./useAsync-Ua5iss51.js";import"./InfoOutlined-CJxRYyjF.js";import"./useSetState-Crt4S51m.js";import"./index-CHFvfli7.js";import"./iframe-U1FevMj-.js";import"./LaunchOutlined-CJ2Mgn9y.js";import"./ChevronLeft-BKCFH_7s.js";import"./ChevronRight-mqM60WjL.js";import"./index-C-D-nCB1.js";import"./vendor-mui-x-CSUdon8K.js";const Pe=h.createContext({}),{Provider:mt,Consumer:Ss}=Pe;function ht({children:t,blocklet:i=""}){const{api:a,inService:f,ws:{useSubscription:m}}=it(),[u,c]=h.useState([]),[j,A]=h.useState({total:0,pageSize:20,pageCount:0,page:1}),[R,_]=h.useState(!1),E=J(()=>{var T;return(T=i.meta)==null?void 0:T.did},[i]),[K,Y]=h.useState({}),[O,H]=h.useState([]),F=async({page:T=1,pageSize:L=20,...C}={})=>{if(!(R||!E))try{_(!0);const I={paging:{page:T,pageSize:L},...C,userName:C.searchText||"",teamDid:E,dateRange:C.dateRange?[B(C.dateRange[0]).toISOString(),B(C.dateRange[1]).toISOString()]:void 0},{dids:W,...Z}=I;let G="";W.includes("system")&&(G="system");const q=W.filter(z=>z!=="system"),ee=await a.getNotificationSendLog({input:{...Z,source:G,componentDids:q}});Y(I);const ae=ee.list.map(z=>({...z,receiverUser:{...z.receiverUser,avatar:lt(z.receiverUser.avatar,E,f)}}));c(ae),A(ee.paging),_(!1)}catch(I){Q.error(I.message),_(!1)}},g=async()=>{const T=await a.getNotificationComponents({input:{teamDid:E}});H(T.componentDids)},D=h.useCallback(T=>{const L=i.children.find(C=>{var I;return((I=C.meta)==null?void 0:I.did)===T});if(L)return L.ancestors=[i],L},[i]),k=async({notificationReceiverIds:T,channels:L,...C})=>{await a.resendNotification({input:{teamDid:E,notificationReceiverIds:T,channels:L.map(I=>I==="wallet"?M.NOTIFICATION_SEND_CHANNEL.WALLET:I==="pushKit"?M.NOTIFICATION_SEND_CHANNEL.PUSH:I),...C}})},$=h.useCallback(async T=>(await a.getUser({input:{teamDid:E,user:{did:T}}})).user,[a,E]);m(`${M.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,T=>{T&&(F(K),g())},[K]),h.useEffect(()=>{E&&g()},[E]);const S={loading:R,fetch:F,data:u,paging:j,blocklet:i,getComponent:D,resendNotification:k,getUser:$,componentDids:O};return e.jsx(mt,{value:{notificationRecords:S},children:t})}function Fe(){const{notificationRecords:t}=h.useContext(Pe);return t}var xe={},gt=Ne;Object.defineProperty(xe,"__esModule",{value:!0});var ze=xe.default=void 0,xt=gt(Ae()),bt=e;ze=xe.default=(0,xt.default)((0,bt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var be={},St=Ne;Object.defineProperty(be,"__esModule",{value:!0});var Be=be.default=void 0,yt=St(Ae()),jt=e;Be=be.default=(0,yt.default)((0,jt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");const vt=(t,i,a="")=>{if(!a||!i)return"";switch(a){case M.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:i});case M.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:i});case M.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:i});case M.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return a}};function de(t,i,a={}){const{status:f,updatedAt:m,reason:u="",channel:c="wallet"}=a,j=m?t("notification.sendStatus.sentTime",{date:ot(m,i)}):"",A=vt(t,c,u);return f===M.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:j,reason:A}:f===M.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:j}:{status:"pending",title:t("notification.sendStatus.pending"),reason:A,sentTime:j}}const we={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ge=["wallet","pushKit","email"],wt=(t,i)=>{var m,u;const{settings:a}=t,f=se(i,"extra.notifications.email",!0);return{available:(u=(m=a==null?void 0:a.notification)==null?void 0:m.email)==null?void 0:u.enabled,enabled:f}},Ct=(t,i)=>{var m,u;const{settings:a}=t,f=se(i,"extra.notifications.push",!0);return{available:(u=(m=a==null?void 0:a.notification)==null?void 0:m.pushKit)==null?void 0:u.enabled,enabled:f}},Nt=t=>({enabled:se(t,"extra.notifications.wallet",!0)}),Rt=t=>({enabled:se(t,"extra.webhooks",[]).length>0}),Ce=(t=3e3)=>new Promise(i=>{setTimeout(()=>{i()},t)}),Tt=(t,i)=>i==="wallet"||i==="webhook"?[{channel:i,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:i}),fail:t("notification.sendStatus.reason.disabled",{channel:i})}]:i==="pushKit"||i==="email"?[{channel:i,type:"available",pass:t("notification.sendStatus.reason.available",{channel:i}),fail:t("notification.sendStatus.reason.unavailable",{channel:i})},{channel:i,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:i}),fail:t("notification.sendStatus.reason.disabled",{channel:i})}]:[],Dt=t=>{const i={},a=B().startOf("day");ge.forEach(u=>{const c=`${u}SendRecord`,A=se(t,c,[]).filter(R=>B(R.sendAt).isSame(a,"day")).length;i[u]=A});const f=se(t,"webhook",{}),m=Object.keys(f??{})??[];return m.length>0&&m.forEach(u=>{const j=(f[u]??[]).filter(A=>B(A.sendAt).isSame(a,"day")).length;i[u]=j}),i};function X({config:t,enableTooltip:i=!0,showTitle:a=!1}){const{status:f,title:m="",sentTime:u="",reason:c=""}=t,j=[m,c].filter(Boolean).join(", ");return e.jsx(qe,{title:i?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:j}),e.jsx("span",{children:u})]}):null,arrow:!0,placement:"top",children:e.jsxs(w,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1},children:[e.jsxs(w,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(w,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:we[f],style:{opacity:.15}}),e.jsx(w,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:we[f]})]}),a?e.jsx(U,{color:"inherit",sx:{fontSize:12},children:m}):null]})})}X.propTypes={config:y.object.isRequired,enableTooltip:y.bool,showTitle:y.bool};X.defaultProps={enableTooltip:!0,showTitle:!1};_e.propTypes={notification:y.object.isRequired,onCancel:y.func,blocklet:y.object.isRequired,resendChannel:y.string,refresh:y.func,tab:y.string};function _e({notification:t,onCancel:i=()=>{},blocklet:a,resendChannel:f="",refresh:m=()=>{},tab:u="info"}){const{t:c,locale:j}=ne(),{getComponent:A,resendNotification:R,getUser:_}=Fe(),[E,K]=h.useState([]),[Y,O]=h.useState([]),[H,F]=h.useState(null),[g,D]=h.useState(null),k=h.useRef({}),$=J(()=>A(t.componentDid)||a,[a,t.componentDid]),S=J(()=>{var s;return(s=t==null?void 0:t.receivers)==null?void 0:s[0]},[t.receivers]),T=J(()=>S==null?void 0:S.receiver,[S]),L=J(()=>S==null?void 0:S.receiverUser,[S]),C=rt({tab:u||"info"}),I=J(()=>Dt(S),[S]),W=h.useCallback(async s=>{const{receiver:l}=S??{};if(!l)return!1;const p=await _(l);return p?s==="wallet"?Nt(p):s==="email"?wt(a,p):s==="pushKit"?Ct(a,p):s==="webhook"?Rt(p):!0:!1},[S,_,a]);h.useEffect(()=>{if(!S)K([]);else{const s=ge.map(p=>{const b=S[`${p}SendStatus`],v=S[`${p}SendAt`],P=S[`${p}SendFailedReason`],We=de(c,j,{status:b,updatedAt:v,reason:P,channel:p});return{type:p==="pushKit"?"Push Kit":p,extra:We}});K(s);const l=(S==null?void 0:S.webhook)||{};O(Object.entries(l))}},[S,j,c]);const Z=h.useCallback(async(s,l="")=>{const{id:p}=S??{};if(p)try{await R({notificationReceiverIds:[p],channels:[s],...s==="webhook"&&l?{webhookUrls:[l]}:{}}),Q.success("Message has been sent!"),s!=="webhook"&&(await Ce(1e3),F(null))}catch(b){console.error("handleResend error",{error:b}),Q.error(b.response?b.response.statusText:b.message)}},[R,S]),G=async(s,l)=>{if(l==null||l.stopPropagation(),I[s.type]>=4){Q.warning(c("notification.resendLimit"));return}if(l&&F(l==null?void 0:l.currentTarget),D({channel:s.type}),!(!s||s.checking)){K(b=>b.map(v=>s.type===v.type?{...v,checking:!0}:v));try{const b=await W(s.type);await Ce(),D({channel:s.type,result:b}),(typeof b=="boolean"&&b||Ye(b)&&Object.values(b).every(v=>!!v))&&(await Z(s.type),m()),K(v=>v.map(P=>s.type===P.type?{...P,checking:!1}:P))}catch(b){console.error("handleResend error",{error:b})}}},q=async(s,l=null)=>{if(l==null||l.stopPropagation(),I[s]>=4){Q.warning(c("notification.resendLimit"));return}O(b=>b.map(v=>s===v[0]?[...v.slice(0,2),!0]:v));try{await Z("webhook",s),O(b=>b.map(v=>s===v[0]?[...v.slice(0,2),!0]:v)),m()}catch(b){console.error("handleResend error",{error:b})}};h.useEffect(()=>{f&&(C.tab="status",setTimeout(()=>{const s=k.current[f];s&&(ge.includes(f)?(F(s),G({type:f})):q(f))},500))},[f]);const ee=()=>{F(null)},ae=h.useCallback(s=>Tt(c,s),[c]),z=!!H,o=z?"check-resend-popover":void 0;function n(){return[{name:c("notification.from"),value:e.jsx(ct,{size:32,blocklet:$,showName:!0,hideDot:!0})},{name:c("notification.to"),value:e.jsx(w,{children:L?e.jsxs(w,{"data-cy":`member-name-${L.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(Ee,{src:`${L.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:T,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(te,{children:L.fullName})]},T):e.jsx(ke,{size:14,responsive:!1,compact:!0,copyable:!1,did:T})})},{name:c("notification.notificationTitle"),value:e.jsx(te,{maxLength:50,children:t.title})},{name:c("notification.body"),value:e.jsx(dt,{notification:t,rows:0})},{name:c("notification.createdAt"),value:e.jsx(Le,{value:t.createdAt,locale:j,shouldUpdate:!0})}].map(l=>e.jsx(je,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:l.name,children:l.value},l.name))}const r={info:{label:c("common.basicInfo"),value:"info",component:n},status:{label:c("notification.status"),value:"status"}},d=Object.values(r).map(({label:s,value:l})=>({label:s,value:l})),x=r[C.tab]||r.info,N=s=>{C.tab=s};return e.jsx(et,{title:c("notification.notificationDetails"),onClose:()=>{C.tab="info",F(null),i()},open:!0,PaperProps:{style:{maxWidth:832,maxHeight:"80vh"}},sx:{"& .MuiDialogContent-root":{paddingTop:0}},fullWidth:!0,actionsPosition:"left",children:e.jsxs(It,{children:[e.jsx(w,{mx:3,className:"tabs",children:e.jsx(tt,{tabs:d,current:C.tab,onChange:N,scrollButtons:"auto"})}),e.jsx("div",{className:"body",children:C.tab==="info"?e.jsx(x.component,{}):e.jsxs(w,{children:[E.map(s=>e.jsx(je,{valueComponent:"div",nameWidth:120,name:s.type,children:e.jsxs(w,{className:"channel-item",display:"flex",alignItems:"center",sx:{gap:"4px",fontSize:14},children:[e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(X,{config:s.extra,showTitle:!0})}),s.extra.status!=="success"&&e.jsxs(U,{ref:l=>{k.current[s.type]=l},component:"span",display:"flex",alignItems:"center",sx:{color:V.primary.main,fontSize:14},className:ve("resend-btn",{disabled:s.checking||I[s.type]>=4}),onClick:l=>G(s,l),children:[s.checking?e.jsx(pe,{size:12,sx:{color:V.primary.main}}):e.jsx(he,{}),e.jsx("span",{style:{marginLeft:4},children:c("notification.resend")})]})]})},s.type)),e.jsx(Ue,{textAlign:"left",sx:{mt:1,mb:1},children:"Webhook"}),e.jsx(w,{className:"notification-resend-section",display:"flex",flexDirection:"column",gap:1,style:{paddingLeft:0},children:Y.map(([s,l,p])=>{const b=l[0],v=de(c,j,{...b,updatedAt:b.sendAt,reason:b.failedReason,channel:"webhook"});return e.jsxs(w,{className:"channel-item",display:"flex",alignItems:"center",sx:{gap:"4px",fontSize:12},children:[e.jsx(te,{maxLength:30,children:s}),e.jsx(w,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(X,{config:v,showTitle:!0})}),v.status!=="success"&&e.jsxs(U,{ref:P=>{k.current[s]=P},component:"span",sx:{color:V.primary.main},className:ve("resend-btn",{disabled:p||I[s]>=4}),onClick:P=>q(s,P),children:[p?e.jsx(pe,{size:12,sx:{color:V.primary.main}}):e.jsx(he,{}),e.jsx("span",{style:{marginLeft:4},children:c("notification.resend")})]})]},s)})})]})}),e.jsx(Re,{id:o,open:z,anchorEl:H,onClose:ee,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(At,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[g==null?void 0:g.channel," Checking"]}),e.jsx(w,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:ae(g==null?void 0:g.channel).map(s=>{var v,P;const{type:l,pass:p,fail:b}=s;return!(g!=null&&g.result)||(v=g==null?void 0:g.result)!=null&&v[l]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(P=g==null?void 0:g.result)!=null&&P[l]?V.success.main:"inherit"},children:[g!=null&&g.result?e.jsx(Be,{}):e.jsx(pe,{size:12,sx:{color:V.primary.main}}),e.jsx("span",{children:p})]},l):e.jsxs(U,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:V.error.main},children:[e.jsx(ze,{}),e.jsx("span",{children:b})]},l)})})]})})]})})}const It=ue.div`
|
|
2
2
|
& > .notification-row {
|
|
3
3
|
padding: 0;
|
|
4
4
|
}
|
|
@@ -48,7 +48,7 @@ import{r as h}from"./vendor-react-D-afvo_7.js";import{j as e,a1 as Te,E as y,a4
|
|
|
48
48
|
}
|
|
49
49
|
font-size: 12px;
|
|
50
50
|
}
|
|
51
|
-
`;Ke.propTypes={value:y.array.isRequired,onChange:y.func};function Ke({value:t,onChange:i}){const{locale:a}=ne(),f=B().toDate(),[m,u]=h.useState(null),c=h.useCallback(
|
|
51
|
+
`;Ke.propTypes={value:y.array.isRequired,onChange:y.func};function Ke({value:t,onChange:i}){const{locale:a}=ne(),f=B().toDate(),[m,u]=h.useState(null),c=h.useCallback(R=>{u(m?null:R.currentTarget)},[m]),j=!!m,A=h.useCallback(R=>{if(!R.startDate||!R.endDate){Q.error("Please select a date range");return}if(B(R.startDate).isAfter(R.endDate)||!B(R.startDate).isValid()||!B(R.endDate).isValid()){Q.error("Invalid date range");return}i([R.startDate,R.endDate]),u(null)},[i]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Te,{onClick:c,variant:"outlined",size:"small",color:"inherit",children:[ye(t[0],a)," - ",ye(t[1],a)]})}),e.jsx(Re,{open:j,anchorEl:m,onClose:()=>{u(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(ut,{open:!0,maxDate:f,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:c,definedRanges:pt(f),onChange:A})})]})}oe.propTypes={blocklet:y.object,label:y.string};oe.defaultProps={blocklet:null,label:""};const Et=ue.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
justify-items: flex-start;
|
|
54
54
|
align-items: center;
|
|
@@ -60,7 +60,7 @@ import{r as h}from"./vendor-react-D-afvo_7.js";import{j as e,a1 as Te,E as y,a4
|
|
|
60
60
|
overflow: hidden;
|
|
61
61
|
text-overflow: ellipsis;
|
|
62
62
|
}
|
|
63
|
-
`;function oe({blocklet:t,label:i}){var a;return e.jsx(Et,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(Oe,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((a=t.meta)==null?void 0:a.title)})]}):e.jsx("span",{className:"name",children:i})})}const kt=["receiver","data","createdAt","walletSendStatus","pushKitSendStatus","emailSendStatus"],Lt=()=>Ue({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}}),fe=(t,i,a)=>(t[a].splice(i,1),t),me=(t,i)=>i.length?!i.includes(t):!1;function Ot({label:t,onDelete:i,index:a}){return e.jsx(Ie,{label:t,variant:"outlined",...a===1?{onDelete:i}:{}})}function Pt(t){var f;const{t:i}=ne();return!((f=t==null?void 0:t.filterList)!=null&&f.filter(m=>m.length).length)?null:e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:i("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(at.TableFilterList,{...t,ItemComponent:Ot})})]})}ie.propTypes={status:y.number.isRequired,updatedAt:y.string.isRequired,reason:y.string,channel:y.string,onResend:y.func};function ie({status:t,updatedAt:i,reason:a="",channel:f="wallet",onResend:m}){const{t:u,locale:c}=ne(),j=de(u,c,{status:t,updatedAt:i,reason:a,channel:f});return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(X,{config:j,showTitle:!0}),j.status!=="success"&&e.jsx(Re,{className:"resend-btn",size:"small",startIcon:e.jsx(he,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2rpx"}},onClick:m,children:u("notification.resend")})]})}le.propTypes={filterList:y.array.isRequired,onChange:y.func.isRequired,index:y.number.isRequired,column:y.object.isRequired,statusFilterValues:y.array.isRequired,label:y.string.isRequired};function le({filterList:t,onChange:i,index:a,column:f,statusFilterValues:m,label:u}){return e.jsxs(De,{className:"filter-container",children:[e.jsx(Ge,{component:"legend",children:u}),e.jsx(Je,{row:!0,children:m.map(c=>{const j={status:c.status};return e.jsx(Qe,{control:e.jsx(Xe,{checked:t[a].indexOf(c.value)>-1,onChange:A=>{A.target.checked?t[a].push(c.value):t[a]=t[a].filter(N=>N!==c.value),i(t[a],a,f)},name:c.value}),label:e.jsxs("span",{style:{display:"flex",alignItems:"center"},children:[e.jsx(X,{enableTooltip:!1,config:j}),c.label]})},c.value)})})]})}ce.propTypes={list:y.array.isRequired,label:y.string.isRequired,onDelete:y.func.isRequired};function ce({list:t,label:i,onDelete:a}){const{t:f,locale:m}=ne();return e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(M,{children:[i,": "]}),t.map(u=>{const c=de(f,m,{status:u});return e.jsx(Ie,{size:"small",label:e.jsxs(w,{display:"flex",alignItems:"center",sx:{gap:"4rpx"},children:[e.jsx(X,{config:c,enableTooltip:!1}),e.jsx("span",{children:c.title})]}),onDelete:j=>a(j,u)},u)})]})}function Ft(){var z;const{t,locale:i}=ne(),{data:a,paging:f,loading:m,blocklet:u,fetch:c,getComponent:j,componentDids:A}=Fe(),N=h.useRef(null),[_,E]=h.useState(null),[K,Y]=h.useState(""),[O,H]=h.useState(kt),F=`notification-records-${(z=u.meta)==null?void 0:z.did}`,g=st(F),[D,k]=h.useState({searchText:g.searchText||"",pageSize:g.rowsPerPage||10,page:g.page?g.page+1:1,dids:g.dids||[],walletSendStatus:g.walletSendStatus||[],pushKitSendStatus:g.pushKitSendStatus||[],emailSendStatus:g.emailSendStatus||[],dateRange:g.dateRange||[B().subtract(1,"month").startOf("day").toDate(),B().endOf("day").toDate()]}),$=J(()=>{if(!u.children||!u.children.length)return[];const o=[];return u.children.forEach(n=>{var d;const r=n.did||((d=n.meta)==null?void 0:d.did);A.includes(r)&&(n.ancestors=[u],o.push(n))}),o},[A,u]),S=h.useCallback(o=>{const{notification:n}=o,r=Ze(o,"notification");return r.read=!0,n.receivers=[r],n},[]),R=h.useCallback(o=>{const n=S(o);E(n)},[S]);h.useEffect(()=>{c(D)},[D]),h.useEffect(()=>{E(o=>{if(!o)return null;const n=a.find(r=>r.notification.id===o.id);return n?R(n):o})},[a,R]);const L=({page:o,rowsPerPage:n,searchText:r,filterList:d})=>{const[,x=[],T=[],s=[],l=[]]=d;D.pageSize!==n?k(p=>({...p,pageSize:n,page:1})):D.page!==o+1?k(p=>({...p,page:o+1})):D.searchText!==r?k(p=>({...p,searchText:r,page:1})):re(D.walletSendStatus,T)?re(D.pushKitSendStatus,s)?re(D.emailSendStatus,l)?re(D.dids,x)||k(p=>({...p,dids:x,page:1})):k(p=>({...p,emailSendStatus:l,page:1})):k(p=>({...p,pushKitSendStatus:s,page:1})):k(p=>({...p,walletSendStatus:T,page:1}))},C=[{label:t("notification.sendStatus.pending"),value:0,status:"pending"},{label:t("notification.sendStatus.success"),value:1,status:"success"},{label:t("notification.sendStatus.failed"),value:2,status:"failed"}],I=(o,n,r,d)=>{o.stopPropagation();const x=r.filter(T=>T!==n);k(T=>({...T,[d]:x,page:1}))},W=(o,n,r)=>{o.stopPropagation();const d=S(n);E(d),Y(r)},Z=()=>{E(null),Y("")},G=h.useCallback(()=>{c(D)},[c,D]),q=[{label:t("notification.receiver"),name:"receiver",width:200,options:{filter:!1,display:O.includes("receiver"),customBodyRenderLite:o=>{const{receiverUser:n,receiver:r}=a[o];return n?e.jsxs(w,{"data-cy":`member-name-${n.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(Ee,{src:`${n.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:r,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(te,{children:n.fullName})]},r):e.jsx(ke,{size:14,responsive:!1,compact:!0,copyable:!1,did:r})}}},{label:t("notification.notificationPreview"),name:"data",width:300,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:o=>o.map((n,r)=>{var x;if(n==="system")return e.jsx("span",{children:t("notification.system")},`system-${r}`);const d=$.find(T=>{var l;return(T.did||((l=T.meta)==null?void 0:l.did))===n});return e.jsx(oe,{blocklet:d,label:(d==null?void 0:d.title)||((x=d==null?void 0:d.meta)==null?void 0:x.title)},n)}),update:(o,n,r)=>(o[r].splice(n,1),o)},filterOptions:{names:$,logic:(o,n)=>n.length?!n.includes(o):!1,display:(o,n,r,d)=>e.jsxs(De,{style:{width:"380px"},children:[e.jsx($e,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Ve,{multiple:!0,value:o[r],renderValue:x=>e.jsx(w,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:x.map(T=>{var l;if(T==="system")return e.jsx("span",{children:t("notification.system")},T);const s=$.find(p=>{var v;return(p.did||((v=p.meta)==null?void 0:v.did))===T});return e.jsx(oe,{blocklet:s,label:(s==null?void 0:s.title)||((l=s==null?void 0:s.meta)==null?void 0:l.title)},T)})}),onChange:x=>{o[r]=x.target.value,n(o[r],r,d)},children:[e.jsx(Se,{value:"system",children:t("notification.system")}),$.map(x=>{var s,l;const T=x.did||((s=x.meta)==null?void 0:s.did);return e.jsx(Se,{value:T,children:e.jsx(oe,{blocklet:x,label:x.title||((l=x.meta)==null?void 0:l.title)})},T)})]})]})},display:O.includes("data"),customBodyRenderLite:o=>{const n=a[o],{notification:r}=n,d=j(r.componentDid);return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,onClick:x=>{x.stopPropagation(),R(n)},children:[d?e.jsx(Oe,{size:32,blocklet:d,ancestors:d.ancestors??[]}):e.jsx(ft,{blocklet:u,size:32}),e.jsx(te,{maxLength:50,children:r.title})]})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{display:O.includes("walletSendStatus"),setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:D.walletSendStatus??[],customFilterListOptions:{render:o=>e.jsx(ce,{list:o,label:"Wallet",onDelete:(n,r)=>{n.stopPropagation(),I(n,r,q[2].options.filterList,"walletSendStatus")}}),update:fe},filterOptions:{names:C,fullWidth:!0,logic:me,display:(o,n,r,d)=>e.jsx(le,{label:"Wallet",filterList:o,onChange:n,index:r,column:d,statusFilterValues:C})},customBodyRenderLite:o=>{const{walletSendStatus:n,walletSendAt:r,walletSendFailedReason:d}=a[o];return e.jsx(ie,{status:n,updatedAt:r,reason:d,channel:"wallet",onResend:x=>W(x,a[o],"wallet")})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{display:O.includes("pushKitSendStatus"),setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{pushKitSendStatus:n,pushKitSendAt:r,pushKitSendFailedReason:d}=a[o];return e.jsx(ie,{status:n,updatedAt:r,reason:d,channel:"pushkit",onResend:x=>W(x,a[o],"pushKit")})},filter:!0,filterType:"custom",filterList:D.pushKitSendStatus??[],customFilterListOptions:{render:o=>e.jsx(ce,{list:o,label:"Push Kit",onDelete:(n,r)=>{n.stopPropagation(),I(n,r,q[3].options.filterList,"pushKitSendStatus")}}),update:fe},filterOptions:{names:C,fullWidth:!0,logic:me,display:(o,n,r,d)=>e.jsx(le,{label:"Push Kit",filterList:o,onChange:n,index:r,column:d,statusFilterValues:C})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),display:O.includes("emailSendStatus"),customBodyRenderLite:o=>{const{emailSendStatus:n,emailSendAt:r,emailSendFailedReason:d}=a[o];return e.jsx(ie,{status:n,updatedAt:r,reason:d,channel:"email",onResend:x=>W(x,a[o],"email")})},filter:!0,filterType:"custom",filterList:D.emailSendStatus??[],customFilterListOptions:{render:o=>e.jsx(ce,{list:o,label:"Email",onDelete:(n,r)=>{n.stopPropagation(),I(n,r,q[4].options.filterList,"emailSendStatus")}}),update:fe},filterOptions:{names:C,fullWidth:!0,logic:me,display:(o,n,r,d)=>e.jsx(le,{label:"Email",filterList:o,onChange:n,index:r,column:d,statusFilterValues:C})}}},{label:"Webhook",name:"webhook",width:200,options:{display:O.includes("webhook"),filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{webhook:n}=a[o];if(!n)return null;const r=Object.entries(n)[0];if(!r)return null;const[d,x]=r,T=x[0];return e.jsx(w,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(w,{className:"webhook-item",fontSize:12,children:[e.jsx(te,{maxLength:30,children:d},d),e.jsx(ie,{status:T.status,updatedAt:T.sendAt,reason:T.failedReason,channel:"webhook",onResend:s=>W(s,a[o],d)})]},d)})}}},{label:t("common.createdAt"),name:"createdAt",width:200,options:{filter:!1,display:O.includes("createdAt"),customBodyRenderLite:o=>{const{createdAt:n}=a[o];return e.jsx(Le,{value:n,locale:i,shouldUpdate:!0})}}}],ee=o=>{k(n=>({...n,dateRange:o,page:1}))},ae=[e.jsx(Ke,{value:D.dateRange,onChange:ee})];return e.jsxs(w,{ref:N,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(zt,{children:e.jsx(He,{theme:Lt(),children:e.jsx(nt,{className:"main-data",verticalKeyWidth:100,loading:m,locale:i,columns:q,data:a,durable:F,onChange:L,options:{sort:!1,download:!1,print:!1,expandableRowsOnClick:!0,searchPlaceholder:t("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:f.page-1,rowsPerPage:f.pageSize,count:f.total,...g,searchText:D.searchText,onViewColumnsChange:(o,n)=>{H(n==="add"?r=>[...r,o]:r=>r.filter(d=>d!==o))}},customButtons:ae,components:{TableFilterList:Pt}})})}),_&&e.jsx(_e,{refresh:G,onCancel:Z,notification:_,blocklet:u,resendChannel:K})]})}const zt=ue.div`
|
|
63
|
+
`;function oe({blocklet:t,label:i}){var a;return e.jsx(Et,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(Oe,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((a=t.meta)==null?void 0:a.title)})]}):e.jsx("span",{className:"name",children:i})})}const kt=["receiver","data","createdAt","walletSendStatus","pushKitSendStatus","emailSendStatus"],Lt=()=>Me({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}}),fe=(t,i,a)=>(t[a].splice(i,1),t),me=(t,i)=>i.length?!i.includes(t):!1;function Ot({label:t,onDelete:i,index:a}){return e.jsx(Ie,{label:t,variant:"outlined",...a===1?{onDelete:i}:{}})}function Pt(t){var f;const{t:i}=ne();return!((f=t==null?void 0:t.filterList)!=null&&f.filter(m=>m.length).length)?null:e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:i("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(at.TableFilterList,{...t,ItemComponent:Ot})})]})}ie.propTypes={status:y.number.isRequired,updatedAt:y.string.isRequired,reason:y.string,channel:y.string,onResend:y.func};function ie({status:t,updatedAt:i,reason:a="",channel:f="wallet",onResend:m}){const{t:u,locale:c}=ne(),j=de(u,c,{status:t,updatedAt:i,reason:a,channel:f});return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(X,{config:j,showTitle:!0}),j.status!=="success"&&e.jsx(Te,{className:"resend-btn",size:"small",startIcon:e.jsx(he,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2rpx"}},onClick:m,children:u("notification.resend")})]})}le.propTypes={filterList:y.array.isRequired,onChange:y.func.isRequired,index:y.number.isRequired,column:y.object.isRequired,statusFilterValues:y.array.isRequired,label:y.string.isRequired};function le({filterList:t,onChange:i,index:a,column:f,statusFilterValues:m,label:u}){return e.jsxs(De,{className:"filter-container",children:[e.jsx(Ge,{component:"legend",children:u}),e.jsx(Je,{row:!0,children:m.map(c=>{const j={status:c.status};return e.jsx(Qe,{control:e.jsx(Xe,{checked:t[a].indexOf(c.value)>-1,onChange:A=>{A.target.checked?t[a].push(c.value):t[a]=t[a].filter(R=>R!==c.value),i(t[a],a,f)},name:c.value}),label:e.jsxs("span",{style:{display:"flex",alignItems:"center"},children:[e.jsx(X,{enableTooltip:!1,config:j}),c.label]})},c.value)})})]})}ce.propTypes={list:y.array.isRequired,label:y.string.isRequired,onDelete:y.func.isRequired};function ce({list:t,label:i,onDelete:a}){const{t:f,locale:m}=ne();return e.jsxs(w,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(U,{children:[i,": "]}),t.map(u=>{const c=de(f,m,{status:u});return e.jsx(Ie,{size:"small",label:e.jsxs(w,{display:"flex",alignItems:"center",sx:{gap:"4rpx"},children:[e.jsx(X,{config:c,enableTooltip:!1}),e.jsx("span",{children:c.title})]}),onDelete:j=>a(j,u)},u)})]})}function Ft(){var z;const{t,locale:i}=ne(),{data:a,paging:f,loading:m,blocklet:u,fetch:c,getComponent:j,componentDids:A}=Fe(),R=h.useRef(null),[_,E]=h.useState(null),[K,Y]=h.useState(""),[O,H]=h.useState(kt),F=`notification-records-${(z=u.meta)==null?void 0:z.did}`,g=st(F),[D,k]=h.useState({searchText:g.searchText||"",pageSize:g.rowsPerPage||10,page:g.page?g.page+1:1,dids:g.dids||[],walletSendStatus:g.walletSendStatus||[],pushKitSendStatus:g.pushKitSendStatus||[],emailSendStatus:g.emailSendStatus||[],dateRange:g.dateRange||[B().subtract(1,"month").startOf("day").toDate(),B().endOf("day").toDate()]}),$=J(()=>{if(!u.children||!u.children.length)return[];const o=[];return u.children.forEach(n=>{var d;const r=n.did||((d=n.meta)==null?void 0:d.did);A.includes(r)&&(n.ancestors=[u],o.push(n))}),o},[A,u]),S=h.useCallback(o=>{const{notification:n}=o,r=Ze(o,"notification");return r.read=!0,n.receivers=[r],n},[]),T=h.useCallback(o=>{const n=S(o);E(n)},[S]);h.useEffect(()=>{c(D)},[D]),h.useEffect(()=>{E(o=>{if(!o)return null;const n=a.find(r=>r.notification.id===o.id);return n?T(n):o})},[a,T]);const L=({page:o,rowsPerPage:n,searchText:r,filterList:d})=>{const[,x=[],N=[],s=[],l=[]]=d;D.pageSize!==n?k(p=>({...p,pageSize:n,page:1})):D.page!==o+1?k(p=>({...p,page:o+1})):D.searchText!==r?k(p=>({...p,searchText:r,page:1})):re(D.walletSendStatus,N)?re(D.pushKitSendStatus,s)?re(D.emailSendStatus,l)?re(D.dids,x)||k(p=>({...p,dids:x,page:1})):k(p=>({...p,emailSendStatus:l,page:1})):k(p=>({...p,pushKitSendStatus:s,page:1})):k(p=>({...p,walletSendStatus:N,page:1}))},C=[{label:t("notification.sendStatus.pending"),value:0,status:"pending"},{label:t("notification.sendStatus.success"),value:1,status:"success"},{label:t("notification.sendStatus.failed"),value:2,status:"failed"}],I=(o,n,r,d)=>{o.stopPropagation();const x=r.filter(N=>N!==n);k(N=>({...N,[d]:x,page:1}))},W=(o,n,r)=>{o.stopPropagation();const d=S(n);E(d),Y(r)},Z=()=>{E(null),Y("")},G=h.useCallback(()=>{c(D)},[c,D]),q=[{label:t("notification.receiver"),name:"receiver",width:200,options:{filter:!1,display:O.includes("receiver"),customBodyRenderLite:o=>{const{receiverUser:n,receiver:r}=a[o];return n?e.jsxs(w,{"data-cy":`member-name-${n.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(Ee,{src:`${n.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:r,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(te,{children:n.fullName})]},r):e.jsx(ke,{size:14,responsive:!1,compact:!0,copyable:!1,did:r})}}},{label:t("notification.notificationPreview"),name:"data",width:300,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:o=>o.map((n,r)=>{var x;if(n==="system")return e.jsx("span",{children:t("notification.system")},`system-${r}`);const d=$.find(N=>{var l;return(N.did||((l=N.meta)==null?void 0:l.did))===n});return e.jsx(oe,{blocklet:d,label:(d==null?void 0:d.title)||((x=d==null?void 0:d.meta)==null?void 0:x.title)},n)}),update:(o,n,r)=>(o[r].splice(n,1),o)},filterOptions:{names:$,logic:(o,n)=>n.length?!n.includes(o):!1,display:(o,n,r,d)=>e.jsxs(De,{style:{width:"380px"},children:[e.jsx($e,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Ve,{multiple:!0,value:o[r],renderValue:x=>e.jsx(w,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:x.map(N=>{var l;if(N==="system")return e.jsx("span",{children:t("notification.system")},N);const s=$.find(p=>{var v;return(p.did||((v=p.meta)==null?void 0:v.did))===N});return e.jsx(oe,{blocklet:s,label:(s==null?void 0:s.title)||((l=s==null?void 0:s.meta)==null?void 0:l.title)},N)})}),onChange:x=>{o[r]=x.target.value,n(o[r],r,d)},children:[e.jsx(Se,{value:"system",children:t("notification.system")}),$.map(x=>{var s,l;const N=x.did||((s=x.meta)==null?void 0:s.did);return e.jsx(Se,{value:N,children:e.jsx(oe,{blocklet:x,label:x.title||((l=x.meta)==null?void 0:l.title)})},N)})]})]})},display:O.includes("data"),customBodyRenderLite:o=>{const n=a[o],{notification:r}=n,d=j(r.componentDid);return e.jsxs(w,{display:"flex",alignItems:"center",gap:1,onClick:x=>{x.stopPropagation(),T(n)},children:[d?e.jsx(Oe,{size:32,blocklet:d,ancestors:d.ancestors??[]}):e.jsx(ft,{blocklet:u,size:32}),e.jsx(te,{maxLength:50,children:r.title})]})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{display:O.includes("walletSendStatus"),setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:D.walletSendStatus??[],customFilterListOptions:{render:o=>e.jsx(ce,{list:o,label:"Wallet",onDelete:(n,r)=>{n.stopPropagation(),I(n,r,q[2].options.filterList,"walletSendStatus")}}),update:fe},filterOptions:{names:C,fullWidth:!0,logic:me,display:(o,n,r,d)=>e.jsx(le,{label:"Wallet",filterList:o,onChange:n,index:r,column:d,statusFilterValues:C})},customBodyRenderLite:o=>{const{walletSendStatus:n,walletSendAt:r,walletSendFailedReason:d}=a[o];return e.jsx(ie,{status:n,updatedAt:r,reason:d,channel:"wallet",onResend:x=>W(x,a[o],"wallet")})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{display:O.includes("pushKitSendStatus"),setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{pushKitSendStatus:n,pushKitSendAt:r,pushKitSendFailedReason:d}=a[o];return e.jsx(ie,{status:n,updatedAt:r,reason:d,channel:"pushkit",onResend:x=>W(x,a[o],"pushKit")})},filter:!0,filterType:"custom",filterList:D.pushKitSendStatus??[],customFilterListOptions:{render:o=>e.jsx(ce,{list:o,label:"Push Kit",onDelete:(n,r)=>{n.stopPropagation(),I(n,r,q[3].options.filterList,"pushKitSendStatus")}}),update:fe},filterOptions:{names:C,fullWidth:!0,logic:me,display:(o,n,r,d)=>e.jsx(le,{label:"Push Kit",filterList:o,onChange:n,index:r,column:d,statusFilterValues:C})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),display:O.includes("emailSendStatus"),customBodyRenderLite:o=>{const{emailSendStatus:n,emailSendAt:r,emailSendFailedReason:d}=a[o];return e.jsx(ie,{status:n,updatedAt:r,reason:d,channel:"email",onResend:x=>W(x,a[o],"email")})},filter:!0,filterType:"custom",filterList:D.emailSendStatus??[],customFilterListOptions:{render:o=>e.jsx(ce,{list:o,label:"Email",onDelete:(n,r)=>{n.stopPropagation(),I(n,r,q[4].options.filterList,"emailSendStatus")}}),update:fe},filterOptions:{names:C,fullWidth:!0,logic:me,display:(o,n,r,d)=>e.jsx(le,{label:"Email",filterList:o,onChange:n,index:r,column:d,statusFilterValues:C})}}},{label:"Webhook",name:"webhook",width:200,options:{display:O.includes("webhook"),filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:o=>{const{webhook:n}=a[o];if(!n)return null;const r=Object.entries(n)[0];if(!r)return null;const[d,x]=r,N=x[0];return e.jsx(w,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(w,{className:"webhook-item",fontSize:12,children:[e.jsx(te,{maxLength:30,children:d},d),e.jsx(ie,{status:N.status,updatedAt:N.sendAt,reason:N.failedReason,channel:"webhook",onResend:s=>W(s,a[o],d)})]},d)})}}},{label:t("common.createdAt"),name:"createdAt",width:200,options:{filter:!1,display:O.includes("createdAt"),customBodyRenderLite:o=>{const{createdAt:n}=a[o];return e.jsx(Le,{value:n,locale:i,shouldUpdate:!0})}}}],ee=o=>{k(n=>({...n,dateRange:o,page:1}))},ae=[e.jsx(Ke,{value:D.dateRange,onChange:ee})];return e.jsxs(w,{ref:R,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(zt,{children:e.jsx(He,{theme:Lt(),children:e.jsx(nt,{className:"main-data",verticalKeyWidth:100,loading:m,locale:i,columns:q,data:a,durable:F,onChange:L,options:{sort:!1,download:!1,print:!1,expandableRowsOnClick:!0,searchPlaceholder:t("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:f.page-1,rowsPerPage:f.pageSize,count:f.total,...g,searchText:D.searchText,onViewColumnsChange:(o,n)=>{H(n==="add"?r=>[...r,o]:r=>r.filter(d=>d!==o))}},customButtons:ae,components:{TableFilterList:Pt}})})}),_&&e.jsx(_e,{refresh:G,onCancel:Z,notification:_,blocklet:u,resendChannel:K})]})}const zt=ue.div`
|
|
64
64
|
td.MuiTableCell-footer {
|
|
65
65
|
border: none !important;
|
|
66
66
|
}
|