@abtnode/blocklet-services 1.17.8 → 1.17.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Google-CG1lv5ol.js → Google-BpkBLSiL.js} +1 -1
- package/dist/assets/{access-control-CWoVUHgh.js → access-control-BIhY5wfd.js} +1 -1
- package/dist/assets/{actions-rfPaFLCj.js → actions-Cqfaor6G.js} +1 -1
- package/dist/assets/{add-component-core-D0UktG5E.js → add-component-core-B8HzULLJ.js} +1 -1
- package/dist/assets/{add-resource-B7lRLkA_.js → add-resource-CEddRkJz.js} +1 -1
- package/dist/assets/{advanced-ymKehsrI.js → advanced-DkQUAOtW.js} +1 -1
- package/dist/assets/{aigne-yDpeUg7z.js → aigne-BXMpb7iF.js} +1 -1
- package/dist/assets/{appearance-CG-6r2py.js → appearance-xmocGS9K.js} +1 -1
- package/dist/assets/{audit-logs-C-OsN7ub.js → audit-logs-BJPoC3sp.js} +1 -1
- package/dist/assets/{authorize-DjikDURs.js → authorize-CeTEulz5.js} +1 -1
- package/dist/assets/{base32-BFSrw7-h.js → base32-Cx5Qjcq5.js} +1 -1
- package/dist/assets/{bind-account-BVdU9BOU.js → bind-account-Dpc4iwR3.js} +1 -1
- package/dist/assets/{branding-D6MicIet.js → branding-Bz1ajNEX.js} +1 -1
- package/dist/assets/{branding-C42_zeHW.js → branding-OeU_TRNz.js} +1 -1
- package/dist/assets/{branding-CqLoLW7D.js → branding-vz6onXUa.js} +1 -1
- package/dist/assets/{bundle-avatar-7Wt_FbiF.js → bundle-avatar-CQ5BcuIS.js} +1 -1
- package/dist/assets/{complete-ziHMeIgC.js → complete-RloCU6Dp.js} +1 -1
- package/dist/assets/{component-Djqgi00F.js → component-Cjmzo-fv.js} +2 -2
- package/dist/assets/{config-Bko_B6fT.js → config-Bb4cFHRC.js} +1 -1
- package/dist/assets/{config-BQiW0tZA.js → config-CJmL1lNg.js} +1 -1
- package/dist/assets/{config-navigation-BwAXHqA4.js → config-navigation-CV6BVvIo.js} +2 -2
- package/dist/assets/{config-DtX2hGRq.js → config-rELfdDu6.js} +1 -1
- package/dist/assets/{config-space-DMk4apM9.js → config-space-CjtdFXkd.js} +1 -1
- package/dist/assets/{confirm-BMWka5pp.js → confirm-DhDNorbd.js} +1 -1
- package/dist/assets/{connect-D7P92kCs.js → connect-DrvWw6WK.js} +1 -1
- package/dist/assets/{connect-BP5XU00d.js → connect-J76vh4nC.js} +1 -1
- package/dist/assets/{connect-CzwZd1QL.js → connect-pvi_9C1U.js} +1 -1
- package/dist/assets/{connect-to-D5tNZXTo.js → connect-to-BRIhV6_s.js} +1 -1
- package/dist/assets/{dashboard-BZs_YRr4.js → dashboard-OrVG8J2E.js} +2 -2
- package/dist/assets/{delete-confirm-CwOFci6r.js → delete-confirm-C0N4quT9.js} +1 -1
- package/dist/assets/{domain-CvkFdrHE.js → domain-DRBQmuep.js} +1 -1
- package/dist/assets/{domain-action-card-D9LF4Rpy.js → domain-action-card-BXg1GQv4.js} +1 -1
- package/dist/assets/{domains-BeQB_OAv.js → domains-ClxiW6KS.js} +1 -1
- package/dist/assets/{email-DmH_Ukt2.js → email-QHwvdq0F.js} +1 -1
- package/dist/assets/engine-BmJsBu5Z.js +1 -0
- package/dist/assets/{exchange-passport-CidDSOuv.js → exchange-passport-_nLFQuN2.js} +1 -1
- package/dist/assets/{federated-detail-dialog-CkIKuPwA.js → federated-detail-dialog-B3FXukx8.js} +1 -1
- package/dist/assets/{form-DwiizKm1.js → form-BEZi0to4.js} +1 -1
- package/dist/assets/{fuel-D1KEpJ7m.js → fuel-D3ouL-7h.js} +1 -1
- package/dist/assets/{gen-access-key-rsAO4mAP.js → gen-access-key-DDpUJQ6-.js} +1 -1
- package/dist/assets/{gen-simple-access-key-DGcsvu3t.js → gen-simple-access-key-BTB-PYVK.js} +1 -1
- package/dist/assets/{get-safe-url-C1Ml6qBb.js → get-safe-url-uxJSMQTF.js} +1 -1
- package/dist/assets/{home-DKIZCHrI.js → home-BuvlMo1H.js} +1 -1
- package/dist/assets/{iframe-eNnbtEC_.js → iframe-CVEnFycA.js} +1 -1
- package/dist/assets/{index-DliNbpRr.js → index--yN2lwQm.js} +1 -1
- package/dist/assets/{index-BDz_o8O7.js → index-8APBdkv_.js} +1 -1
- package/dist/assets/{index-BVgxwS3B.js → index-BLYrVxV3.js} +1 -1
- package/dist/assets/{index-3rd8tEjJ.js → index-BLi7-52u.js} +1 -1
- package/dist/assets/{index-CPwDD0Vr.js → index-BaK_cJO7.js} +1 -1
- package/dist/assets/{index-B4YwAnux.js → index-Bz8EYhmA.js} +1 -1
- package/dist/assets/{index-DtobDjZ_.js → index-C0ZPC8OS.js} +1 -1
- package/dist/assets/{index-BjD8juw_.js → index-C2_MQP4T.js} +1 -1
- package/dist/assets/{index-BKqykGJ0.js → index-C2jYGrXX.js} +1 -1
- package/dist/assets/{index-ChjBQq8c.js → index-C9rUhDwd.js} +1 -1
- package/dist/assets/{index-fulV4VYn.js → index-CBR-Vn-z.js} +1 -1
- package/dist/assets/{index-BqN4XYa3.js → index-CEH7q22l.js} +1 -1
- package/dist/assets/{index-QkGGubJA.js → index-CNX69Q5e.js} +1 -1
- package/dist/assets/{index-qy92cIq_.js → index-CUa0qHck.js} +1 -1
- package/dist/assets/{index-DPBkkhMC.js → index-CZWagtq4.js} +1 -1
- package/dist/assets/{index-C_8V6Zdm.js → index-C_LVs1QE.js} +1 -1
- package/dist/assets/{index-CRVOCdMR.js → index-CbgqxO1V.js} +1 -1
- package/dist/assets/{index-BgdIPmn8.js → index-CeSwZI3Q.js} +1 -1
- package/dist/assets/{index-DOtXGGiB.js → index-CeaSaqPE.js} +1 -1
- package/dist/assets/{index-DcM4ljaV.js → index-CgSpL7jz.js} +4 -4
- package/dist/assets/{index-dA_JPQDw.js → index-CiGaRVW9.js} +1 -1
- package/dist/assets/{index-6ovPLp0y.js → index-D0mTUcjJ.js} +2 -2
- package/dist/assets/{index-BtpVtm9d.js → index-DI80KOep.js} +1 -1
- package/dist/assets/{index-EZZK7Nyo.js → index-DwaBdfGv.js} +3 -3
- package/dist/assets/{index-CEsBpdP3.js → index-DzOChX1R.js} +1 -1
- package/dist/assets/{index-rwBbhEdR.js → index-WAnZs-pf.js} +1 -1
- package/dist/assets/{index-DjpY9R14.js → index-_llkmI7F.js} +1 -1
- package/dist/assets/{index-t0K-45aJ.js → index-k0OLPTEM.js} +1 -1
- package/dist/assets/{info-outline-rounded-CxbBCZbx.js → info-outline-rounded-CmLwPXzn.js} +1 -1
- package/dist/assets/{invitation-tRY9vnXE.js → invitation-CcqRXA0x.js} +1 -1
- package/dist/assets/{invitations-Db5hitbJ.js → invitations-Rtn4ZgkA.js} +1 -1
- package/dist/assets/{invite-FhylBBBB.js → invite-BVCWrw1u.js} +1 -1
- package/dist/assets/{issue-passport-BMFNH3nj.js → issue-passport-D9KC0G_A.js} +1 -1
- package/dist/assets/{item-CHfrpFLz.js → item-Cno3GsuG.js} +1 -1
- package/dist/assets/{layout-ej-JNJCP.js → layout-DkUZePxy.js} +1 -1
- package/dist/assets/{list-CIMWgr08.js → list-BaZEqvv_.js} +1 -1
- package/dist/assets/{list-DX9meaEq.js → list-qpUoyhan.js} +1 -1
- package/dist/assets/{localization-DJF_aQrB.js → localization-VWhLouBc.js} +1 -1
- package/dist/assets/{log-C-XJlJmX.js → log-CGsJ5N6b.js} +1 -1
- package/dist/assets/{login-WWa0obto.js → login-BUZAiJi7.js} +1 -1
- package/dist/assets/{login-oauth-callback-558tm7Kk.js → login-oauth-callback-D7IVWJCK.js} +1 -1
- package/dist/assets/{logo-uploader-C_AnxhNP.js → logo-uploader-CEZXDf8O.js} +1 -1
- package/dist/assets/{lost-passport-DauVMfLO.js → lost-passport-BShdkOY2.js} +1 -1
- package/dist/assets/{metadata-CbEG9b2n.js → metadata-iEUnwzkK.js} +1 -1
- package/dist/assets/{open-window-hkynwoL5.js → open-window-CKutfNqx.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-CPLJV5KG.js → over-due-invoice-payment-D6491JHf.js} +1 -1
- package/dist/assets/{overview-JVbZ7hCB.js → overview-ns7CHx6H.js} +1 -1
- package/dist/assets/{passport-bxIQRuHM.js → passport-2AVRJTQK.js} +1 -1
- package/dist/assets/{passport-item-C7svpOMT.js → passport-item-CeYGFFGn.js} +1 -1
- package/dist/assets/{permission-CiRkLVwn.js → permission-C2bdzuoM.js} +1 -1
- package/dist/assets/{preferences-DgvuFkNS.js → preferences-Bm3lpvWM.js} +1 -1
- package/dist/assets/{profile-embed-DyHkusY5.js → profile-embed-CBiaNgfm.js} +1 -1
- package/dist/assets/{publish-resource-DqQSmKCy.js → publish-resource-Cb8cFftb.js} +1 -1
- package/dist/assets/{runtime-OuwOSzER.js → runtime-W3sVCToB.js} +1 -1
- package/dist/assets/sdk-CuoW9qgj.js +1 -0
- package/dist/assets/{security-DwWYfqfY.js → security-FuAWjgqg.js} +1 -1
- package/dist/assets/{session-D6Z4R7oi.js → session-BEf_KK-i.js} +1 -1
- package/dist/assets/{setup-N7vDP87_.js → setup-BUrG-d2H.js} +1 -1
- package/dist/assets/{spaces-B8t2gKsu.js → spaces-DiyZ082O.js} +1 -1
- package/dist/assets/{start-D0WlW7li.js → start-Rwj2OQ5m.js} +1 -1
- package/dist/assets/{starting-progress--6NzzPU1.js → starting-progress-s-XqSluO.js} +1 -1
- package/dist/assets/{status-DI89bjlc.js → status-CTDbw135.js} +1 -1
- package/dist/assets/{step-actions-D0ooBDiZ.js → step-actions-Ezqn_AMv.js} +1 -1
- package/dist/assets/{studio-fGrv4L1C.js → studio-CYIn9aNz.js} +1 -1
- package/dist/assets/{team-sypU8pIA.js → team-Bso_Sjaa.js} +1 -1
- package/dist/assets/{traffic-CB937Mlw.js → traffic-BqxYiIWh.js} +1 -1
- package/dist/assets/{transfer-C29v213E.js → transfer-OPn3RlKK.js} +1 -1
- package/dist/assets/{unsubscribe-D4mqt-ru.js → unsubscribe-CdltWhMv.js} +1 -1
- package/dist/assets/{use-app-logo-Dt5Rf_oh.js → use-app-logo-DcBQK--f.js} +1 -1
- package/dist/assets/{user-center-BNVLcFuw.js → user-center-Bc5-qHT9.js} +2 -2
- package/dist/assets/{user-follower-BF8dghPj.js → user-follower-D8zGIprF.js} +1 -1
- package/dist/assets/{util-BKm61knf.js → util-CIgNPQhV.js} +1 -1
- package/dist/assets/{util-C7ejGMZd.js → util-Cz5-V-1E.js} +1 -1
- package/dist/assets/{utils-yU0z64Pf.js → utils-CWRBZd9l.js} +1 -1
- package/dist/assets/{wait-connect-B1z3SEpN.js → wait-connect-2CirehkG.js} +1 -1
- package/dist/assets/{wallet-hidden-topbar-SQtOXLKg.js → wallet-hidden-topbar-CZaZNW94.js} +1 -1
- package/dist/assets/{wizard-components-Dxf0c0dt.js → wizard-components-BwA5watz.js} +1 -1
- package/dist/assets/{wizard-DwUESHQa.js → wizard-xTNgKfB7.js} +1 -1
- package/dist/assets/{wrap-locale-Ck3xud_e.js → wrap-locale-AxlzuLIu.js} +1 -1
- package/dist/assets/{zh-oZCQbfAf.js → zh-BYHnQ2ca.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +23 -23
- package/dist/assets/engine-CvxZhwAf.js +0 -1
- package/dist/assets/sdk-BDbUPswI.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as C,a as ze,d as We,g as qe}from"./vendor-react-DX7tU9aY.js";import{j as n,bb as ae,X as m,s as le,T as P,al as k,R as Be,P as Ge,G as A,aT as z,L as W,a4 as ye,bX as be,an as Ve,b6 as Ke,bY as Qe,b2 as Ye,as as Xe}from"./vendor-mui-core-CDEc-eG6.js";import{a as _,b as ue}from"./vendor-hooks-Ca2cSNuD.js";import{W as te,ax as Je,ay as Ze,az as J,v as et,n as tt,F as Q,ag as ne,o as Y,aA as nt,aB as rt}from"./index-DcM4ljaV.js";import{a as F,F as ce,y as B,a9 as st,aa as it}from"./vendor-utils-_C9URqjS.js";import{u as ot}from"./session-D6Z4R7oi.js";import{ab as at,M as G,ac as de,bj as lt,aa as ve,a3 as ct}from"./vendor-ux-PO0jFgJf.js";import{p as dt}from"./purify.es-HRjpPm7y.js";import{h as Z,f as we}from"./wallet-hidden-topbar-SQtOXLKg.js";import{i as pt}from"./isURL-CpQHQuaa.js";import{M as ut}from"./use-blocklet-logo-nVOJALp0.js";import{u as ht}from"./use-app-logo-Dt5Rf_oh.js";const mt={dividerColor:"rgba(239, 241, 245, 1)"},on=e=>{if(!e||!e.length)return[];const t=[];let r=null,s=[];if(e.forEach(i=>{if(!i.activity||!i.activity.type||!r){r&&(s.length===1?t.push(s[0]):(r.items=s,t.push(r))),i.activity&&i.activity.type?(r=i,s=[i]):(t.push(i),r=null,s=[]);return}const p=s[0].activity,o=p.type,h=p.target?.type,x=p.target?.id,v=i.activity.type,g=i.activity.target?.type,T=i.activity.target?.id;if(o&&v&&o===v&&(!p.target&&!i.activity.target||p.target&&i.activity.target&&h===g&&x===T))s.push(i);else{if(s.length===1)t.push(s[0]);else{const b=Object.assign({},r,{items:s});t.push(b)}r=i,s=[i]}}),r)if(s.length===1)t.push(s[0]);else{const i=Object.assign({},r,{items:s});t.push(i)}return t},ft=e=>!F(e.activity)&&!!e.activity.type&&!!e.activity.actor,an=e=>ft(e)&&!!e.actorInfo&&!!e.actorInfo.did,je=e=>{if(!e)return null;const{meta:t,target:r,actor:s}=e||{};let i=r?.id;return r?.type==="user"&&(i=ce(B(te,"user"),{did:s})),{metaLink:t?.id,targetLink:i}},ke=e=>pt(e),H={COMMENT:"comment",LIKE:"like",FOLLOW:"follow",TIPS:"tips",MENTION:"mention",ASSIGN:"assign",UN_ASSIGN:"un_assign"},gt={[H.COMMENT]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["have left ",t," comments on ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["has commented on ",r?"your":"the"," ",e,":"]}),[H.LIKE]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["have liked ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["have liked ",r?"your":"the"," ",e,":"]}),[H.FOLLOW]:(e,t)=>t>1?n.jsx(n.Fragment,{children:"have followed you"}):n.jsx(n.Fragment,{children:"has followed you"}),[H.TIPS]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["left tips for ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["left a tip for ",r?"your":"the"," ",e,":"]}),[H.MENTION]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["have mentioned you in ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["mentioned you in ",r?"your":"the"," ",e,":"]}),[H.ASSIGN]:()=>n.jsx(n.Fragment,{children:"has assigned you a task: "}),[H.UN_ASSIGN]:()=>n.jsx(n.Fragment,{children:"has revoked your task assignment: "})},$=C.memo(function({user:t,color:r="text.secondary"}){const s=ce(B(te,"user"),{did:t.did});return n.jsx(ae,{href:s,color:r,target:"_blank",onClick:i=>{i.customPreventRedirect=!0},sx:{fontWeight:600,textDecoration:"none"},children:t.fullName||"System"})});$.propTypes={user:m.shape({did:m.string.isRequired,fullName:m.string.isRequired}).isRequired,color:m.string};$.displayName="UserLink";function ln({activity:e,users:t,actors:r,extra:s={},mountPoint:i=""}){const{session:p}=ot()||{},{type:o,target:h}=e||{},{type:x,author:v}=h||{},{linkColor:g="text.secondary"}=s||{},T=_(()=>v?(p?.user?.did||s?.userDid)===v:!0,[p,v]),L=_(()=>{if(!Array.isArray(t))return new Map;const y=new Map;return t.forEach(S=>{S?.did&&!y.has(S.did)&&y.set(S.did,S)}),y},[t]),b=_(()=>Array.isArray(r)?[...new Set(r)].map(S=>S?L.get(S)||{did:S,fullName:"System"}:null):[],[r,L]),R=ue(()=>{if(!Array.isArray(b)||b.length===0)return null;if(b.length===1)return n.jsx($,{user:b[0],color:g});const y=b.slice(0,-1),S=b[b.length-1];if(b.length===2)return n.jsxs(n.Fragment,{children:[n.jsx($,{user:y[0],color:g})," and ",n.jsx($,{user:S,color:g})]});const a=b.length>3,u=a?b.slice(0,2):y;return n.jsxs(n.Fragment,{children:[u.map((f,c)=>n.jsxs(ze.Fragment,{children:[n.jsx($,{user:f,color:g}),c<u.length-1?", ":""]},f.did)),a?`, and ${b.length-2} others`:n.jsxs(n.Fragment,{children:[", and ",n.jsx($,{user:S,color:g})]})]})}),M=ue(()=>{const y=gt[o];return y?y(x==="doc"?"document":x,t.length,T):null}),E=_(()=>{const y=R(),S=M();return!y||!S?null:n.jsxs(n.Fragment,{children:[y," ",S]})},[o,x,b,R,M]),w=_(()=>{if(!e)return null;const y=je(e);return y?.targetLink?ke(y?.targetLink)?y?.targetLink:B(i,y.targetLink):null},[e,i]);return!o||F(h)?null:n.jsxs(n.Fragment,{children:[E," ",n.jsx(ae,{href:w,color:"primary",target:"_blank",sx:{textDecoration:"none"},onClick:y=>{y.customPreventRedirect=!0},children:h.name||h.desc})]})}const xt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};Te.propTypes={meta:m.object.isRequired};const yt=le(Ge)(({theme:e})=>({maxWidth:320,display:"flex",flexDirection:"column",gap:e.spacing(1.5),padding:e.spacing(2),marginTop:e.spacing(1),borderRadius:e.spacing(1),border:`1px solid ${e.palette.divider}`,boxShadow:"none"})),bt=le(k)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),vt=le(k)({display:"flex",justifyContent:"space-between",alignItems:"center"});function Te({meta:e}){const{amount:t,symbol:r,chainId:s}=e,i=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return n.jsxs(yt,{children:[n.jsxs(bt,{children:[n.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),n.jsx(P,{variant:"h5",sx:{color:"text.primary"},children:"ArcBlock"})]}),n.jsxs(vt,{children:[n.jsxs(k,{sx:{display:"flex",alignItems:"baseline",gap:1},children:[n.jsxs(P,{component:"span",variant:"h5",sx:{color:"text.primary",fontWeight:"bold"},children:["+ ",t]}),n.jsx(P,{component:"span",variant:"subtitle2",sx:{color:"text.secondary"},children:r})]}),n.jsx(Be,{variant:"outlined",size:"small",color:"secondary",endIcon:n.jsx(at,{icon:xt}),onClick:i,sx:{borderRadius:4},children:"View on Chain"})]})]})}wt.propTypes={meta:m.object.isRequired,type:m.string.isRequired,hideTips:m.bool,sx:m.object};function wt({meta:e,type:t,hideTips:r=!1,sx:s={}}){return F(e)?null:t==="tips"&&!r?n.jsx(Te,{meta:e}):n.jsx(P,{variant:"subtitle2",component:"p",sx:[{fontSize:16,color:"text.secondary",wordBreak:"break-all"},...Array.isArray(s)?s:[s]],children:e.content})}var re,he;function jt(){if(he)return re;he=1;var e=We();function t(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var r=t(e);function s(){return s=Object.assign?Object.assign.bind():function(a){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var c in f)({}).hasOwnProperty.call(f,c)&&(a[c]=f[c])}return a},s.apply(null,arguments)}function i(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,o(a,u)}function p(a,u){if(a==null)return{};var f={};for(var c in a)if({}.hasOwnProperty.call(a,c)){if(u.indexOf(c)!==-1)continue;f[c]=a[c]}return f}function o(a,u){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,c){return f.__proto__=c,f},o(a,u)}var h={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},x=["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 v(a,u){if(!a||typeof a!="object")return a;var f={};return Object.keys(a).forEach(function(c){u.indexOf(c)>-1||(f[c]=a[c])}),f}var g=["component","className","unsafeHTML"];function T(a,u){if(u!=="letters"&&u!=="words")throw new Error("Unsupported options basedOn: "+u);if(a.nodeType===Node.TEXT_NODE){var f=document.createDocumentFragment(),c;switch(u){case"words":c=a.textContent.split(/\b|(?=\W)/);break;case"letters":c=Array.from(a.textContent);break}c.forEach(function(N){f.appendChild(L(N))}),a.parentNode.replaceChild(f,a)}else if(a.nodeType===Node.ELEMENT_NODE)for(var l=[].slice.call(a.childNodes),d=l.length,j=0;j<d;j++)T(l[j],u)}function L(a){var u=document.createElement("span");return u.className="LinesEllipsis-unit",u.textContent=a,u}function b(a){a.parentNode.replaceChild(document.createTextNode(a.textContent),a)}function R(a,u){if(!(!u.contains(a)||a===u)){for(;a.nextElementSibling;)a.parentNode.removeChild(a.nextElementSibling);R(a.parentNode,u)}}function M(a){for(var u=a;u=u.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(u.tagName.toLowerCase()))return u}function E(a){return!!(a.offsetHeight&&(a.offsetWidth||/\S/.test(a.textContent)))}var w={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},y=Object.keys(w),S=(function(a){function u(c){var l;return l=a.call(this,c)||this,l.state={html:c.unsafeHTML,clamped:!1},l.canvas=null,l.maxLine=0,l.nlUnits=[],l}i(u,a);var f=u.prototype;return f.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},f.componentDidUpdate=function(l){l.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==l&&this.reflow(this.props)},f.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},f.setState=function(l,d){return typeof l.clamped<"u"&&(this.clamped=l.clamped),a.prototype.setState.call(this,l,d)},f.initCanvas=function(){if(!this.canvas){var l=this.canvas=document.createElement("div");l.className="LinesEllipsis-canvas "+this.props.className,l.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(h).forEach(function(d){l.style[d]=h[d]}),document.body.appendChild(l)}},f.copyStyleToCanvas=function(){var l=this,d=window.getComputedStyle(this.target);x.forEach(function(j){l.canvas.style[j]=d[j]})},f.reflow=function(l){this.maxLine=+l.maxLine||1,this.canvas.innerHTML=l.unsafeHTML;var d=l.basedOn||(/^[\x00-\x7F]+$/.test(l.unsafeHTML)?"words":"letters");T(this.canvas,d);var j=this.putEllipsis(this.calcIndexes()),N={clamped:j,html:this.canvas.innerHTML};this.setState(N,l.onReflow.bind(this,N))},f.calcIndexes=function(){var l=[0],d=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),j=d.length;if(!d.length)return l;var N=d.find(E);if(!N)return l;for(var I=1,K=N.offsetTop,U=1;U<j&&!(E(d[U])&&d[U].offsetTop-K>1&&(I++,l.push(U),K=d[U].offsetTop,I>this.maxLine));U++);return l},f.putEllipsis=function(l){if(l.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,l[this.maxLine]);var d=this.nlUnits.pop(),j=this.makeEllipsisSpan();do R(d,this.canvas),M(d).appendChild(j),d=this.nlUnits.pop();while(d&&(!E(d)||j.offsetHeight>d.offsetHeight||j.offsetTop>d.offsetTop));return d&&b(d),this.nlUnits.forEach(b),!0},f.makeEllipsisSpan=function(){var l=this.props,d=l.ellipsisHTML,j=l.ellipsis,N=document.createElement("span");N.appendChild(document.createElement("wbr"));var I=document.createElement("span");return I.className="LinesEllipsis-ellipsis",d?I.innerHTML=d:I.textContent=j,N.appendChild(I),N},f.isClamped=function(){return this.clamped},f.render=function(){var l=this,d=this.state,j=d.html,N=d.clamped,I=this.props,K=I.component,U=I.className,$e=I.unsafeHTML,Fe=p(I,g);return r.default.createElement(K,s({className:"LinesEllipsis "+(N?"LinesEllipsis--clamped":"")+" "+U,ref:function(Oe){return l.target=Oe}},v(Fe,y)),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:N?j:$e}}))},u})(r.default.PureComponent);return S.defaultProps=w,re=S,re}var kt=jt();const Tt=qe(kt),St=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},Ct=e=>e.every(t=>t.type==="text"),Lt=e=>e.every(t=>t.type==="image"),Et=e=>st(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(r=>r?.data?.text?.trim?.())),Rt=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(r=>r.type===t)},Nt=(e,t)=>{try{const r=Je(e);if(!(r.role!==void 0&&r.role!==Ze.RoleType.ACCOUNT))return;const i=B(te,"user");return ce(i,{did:e,locale:t})}catch(r){console.error(r);return}},cn=(e,t)=>t?.componentMountPoints?.find(s=>s.did===e)?.mountPoint,dn=(e,t)=>{if(!e)return null;if(e.actions?.length===1)return e.actions[0].link||null;const r=je(e.activity),s=r?.metaLink||r?.targetLink;if(s)return ke(s)?s:B(t,s);if(e.attachments?.length===1){const i=e.attachments[0];if(i.type==="link")return i.data?.url||null}return null},me=e=>{const{receivers:t=[]}=e;return t.length?t.every(r=>r.read):!0};function It(e){const t=e.getBoundingClientRect(),r=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight,i=t.height,p=t.width;let o=0;t.top>=0&&t.bottom<=s?o=i:t.top<0&&t.bottom>0&&t.bottom<=s?o=t.bottom:t.top>=0&&t.top<s&&t.bottom>s?o=s-t.top:t.top<0&&t.bottom>s&&(o=s);let h=0;return t.left>=0&&t.right<=r?h=p:t.left<0&&t.right>0&&t.right<=r?h=t.right:t.left>=0&&t.left<r&&t.right>r?h=r-t.left:t.left<0&&t.right>r&&(h=r),o*h/(i*p)>=.5}const pn=e=>{if(!e)return[];const t=[],r=5,s=Array.from(e.querySelectorAll(".notification-row")),i=s.length;for(let p=0;p<i;p+=r){const o=s.slice(p,p+r);let h=!0;for(const x of o){const v=x.id;if(It(x))t.push(v);else{h=!1;break}}if(!h)break}return t},Pt=e=>{const t=[];return e&&(e.items?.length?e.items.forEach(r=>{me(r)||t.push(r)}):me(e)||t.push(e)),t},un=(e,t)=>{let r=[];return t.length&&t.forEach(s=>{const i=e.get(s);i&&(r=r.concat(Pt(i)))}),r},O=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}}),V=e=>{if(!e)return null;try{return new URL(e).protocol!=="https:"?(console.warn("Image URL must use HTTPS protocol:",e),null):`${te}/proxy?url=${encodeURIComponent(e)}`}catch(t){return console.warn("Invalid image URL format:",e,t),null}};function Se({attachment:e}){const{data:t}=e,r=A();let s="";try{s=new URL(t.url).host}catch{s=t.url}return n.jsxs(ae,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:i=>{i.customPreventRedirect=!0},children:[!!s&&n.jsx("span",{className:"url",children:s}),!!t.title&&n.jsx(k,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&n.jsx(k,{className:"description",style:{whiteSpace:"unset",color:r.palette.text.secondary},children:t.description}),!!t.image&&n.jsx(G,{src:J.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:V(J.getImagePath(t.image))})]})}Se.propTypes={attachment:m.object.isRequired};function Ce({attachment:e}){const{data:t}=e;return n.jsx(G,{src:J.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},sx:{".Img-root":{height:256}},fallback:V(J.getImagePath(t.url))})}Ce.propTypes={attachment:m.object.isRequired};function Le({attachment:e,...t}){const{data:r}=e,s=r.color?.toLowerCase()||t.color,i=r.size||t.size,p=r.fontWeight||t.fontWeight||400;let o="14px";return i==="small"?o="12px":i==="normal"?o="14px":i==="big"?o="16px":i==="large"&&(o="18px"),n.jsx(Mt,{className:"title",style:{fontSize:o,color:s,whiteSpace:"unset",fontWeight:p},children:r.text})}Le.propTypes={attachment:m.object.isRequired};const Mt=z.span`
|
|
1
|
+
import{r as C,a as ze,d as We,g as qe}from"./vendor-react-DX7tU9aY.js";import{j as n,bb as ae,X as m,s as le,T as P,al as k,R as Be,P as Ge,G as A,aT as z,L as W,a4 as ye,bX as be,an as Ve,b6 as Ke,bY as Qe,b2 as Ye,as as Xe}from"./vendor-mui-core-CDEc-eG6.js";import{a as _,b as ue}from"./vendor-hooks-Ca2cSNuD.js";import{W as te,ax as Je,ay as Ze,az as J,v as et,n as tt,F as Q,ag as ne,o as Y,aA as nt,aB as rt}from"./index-CgSpL7jz.js";import{a as F,F as ce,y as B,a9 as st,aa as it}from"./vendor-utils-_C9URqjS.js";import{u as ot}from"./session-BEf_KK-i.js";import{ab as at,M as G,ac as de,bj as lt,aa as ve,a3 as ct}from"./vendor-ux-PO0jFgJf.js";import{p as dt}from"./purify.es-HRjpPm7y.js";import{h as Z,f as we}from"./wallet-hidden-topbar-CZaZNW94.js";import{i as pt}from"./isURL-CpQHQuaa.js";import{M as ut}from"./use-blocklet-logo-nVOJALp0.js";import{u as ht}from"./use-app-logo-DcBQK--f.js";const mt={dividerColor:"rgba(239, 241, 245, 1)"},on=e=>{if(!e||!e.length)return[];const t=[];let r=null,s=[];if(e.forEach(i=>{if(!i.activity||!i.activity.type||!r){r&&(s.length===1?t.push(s[0]):(r.items=s,t.push(r))),i.activity&&i.activity.type?(r=i,s=[i]):(t.push(i),r=null,s=[]);return}const p=s[0].activity,o=p.type,h=p.target?.type,x=p.target?.id,v=i.activity.type,g=i.activity.target?.type,T=i.activity.target?.id;if(o&&v&&o===v&&(!p.target&&!i.activity.target||p.target&&i.activity.target&&h===g&&x===T))s.push(i);else{if(s.length===1)t.push(s[0]);else{const b=Object.assign({},r,{items:s});t.push(b)}r=i,s=[i]}}),r)if(s.length===1)t.push(s[0]);else{const i=Object.assign({},r,{items:s});t.push(i)}return t},ft=e=>!F(e.activity)&&!!e.activity.type&&!!e.activity.actor,an=e=>ft(e)&&!!e.actorInfo&&!!e.actorInfo.did,je=e=>{if(!e)return null;const{meta:t,target:r,actor:s}=e||{};let i=r?.id;return r?.type==="user"&&(i=ce(B(te,"user"),{did:s})),{metaLink:t?.id,targetLink:i}},ke=e=>pt(e),H={COMMENT:"comment",LIKE:"like",FOLLOW:"follow",TIPS:"tips",MENTION:"mention",ASSIGN:"assign",UN_ASSIGN:"un_assign"},gt={[H.COMMENT]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["have left ",t," comments on ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["has commented on ",r?"your":"the"," ",e,":"]}),[H.LIKE]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["have liked ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["have liked ",r?"your":"the"," ",e,":"]}),[H.FOLLOW]:(e,t)=>t>1?n.jsx(n.Fragment,{children:"have followed you"}):n.jsx(n.Fragment,{children:"has followed you"}),[H.TIPS]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["left tips for ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["left a tip for ",r?"your":"the"," ",e,":"]}),[H.MENTION]:(e,t,r)=>t>1?n.jsxs(n.Fragment,{children:["have mentioned you in ",r?"your":"the"," ",e,":"]}):n.jsxs(n.Fragment,{children:["mentioned you in ",r?"your":"the"," ",e,":"]}),[H.ASSIGN]:()=>n.jsx(n.Fragment,{children:"has assigned you a task: "}),[H.UN_ASSIGN]:()=>n.jsx(n.Fragment,{children:"has revoked your task assignment: "})},$=C.memo(function({user:t,color:r="text.secondary"}){const s=ce(B(te,"user"),{did:t.did});return n.jsx(ae,{href:s,color:r,target:"_blank",onClick:i=>{i.customPreventRedirect=!0},sx:{fontWeight:600,textDecoration:"none"},children:t.fullName||"System"})});$.propTypes={user:m.shape({did:m.string.isRequired,fullName:m.string.isRequired}).isRequired,color:m.string};$.displayName="UserLink";function ln({activity:e,users:t,actors:r,extra:s={},mountPoint:i=""}){const{session:p}=ot()||{},{type:o,target:h}=e||{},{type:x,author:v}=h||{},{linkColor:g="text.secondary"}=s||{},T=_(()=>v?(p?.user?.did||s?.userDid)===v:!0,[p,v]),L=_(()=>{if(!Array.isArray(t))return new Map;const y=new Map;return t.forEach(S=>{S?.did&&!y.has(S.did)&&y.set(S.did,S)}),y},[t]),b=_(()=>Array.isArray(r)?[...new Set(r)].map(S=>S?L.get(S)||{did:S,fullName:"System"}:null):[],[r,L]),R=ue(()=>{if(!Array.isArray(b)||b.length===0)return null;if(b.length===1)return n.jsx($,{user:b[0],color:g});const y=b.slice(0,-1),S=b[b.length-1];if(b.length===2)return n.jsxs(n.Fragment,{children:[n.jsx($,{user:y[0],color:g})," and ",n.jsx($,{user:S,color:g})]});const a=b.length>3,u=a?b.slice(0,2):y;return n.jsxs(n.Fragment,{children:[u.map((f,c)=>n.jsxs(ze.Fragment,{children:[n.jsx($,{user:f,color:g}),c<u.length-1?", ":""]},f.did)),a?`, and ${b.length-2} others`:n.jsxs(n.Fragment,{children:[", and ",n.jsx($,{user:S,color:g})]})]})}),M=ue(()=>{const y=gt[o];return y?y(x==="doc"?"document":x,t.length,T):null}),E=_(()=>{const y=R(),S=M();return!y||!S?null:n.jsxs(n.Fragment,{children:[y," ",S]})},[o,x,b,R,M]),w=_(()=>{if(!e)return null;const y=je(e);return y?.targetLink?ke(y?.targetLink)?y?.targetLink:B(i,y.targetLink):null},[e,i]);return!o||F(h)?null:n.jsxs(n.Fragment,{children:[E," ",n.jsx(ae,{href:w,color:"primary",target:"_blank",sx:{textDecoration:"none"},onClick:y=>{y.customPreventRedirect=!0},children:h.name||h.desc})]})}const xt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};Te.propTypes={meta:m.object.isRequired};const yt=le(Ge)(({theme:e})=>({maxWidth:320,display:"flex",flexDirection:"column",gap:e.spacing(1.5),padding:e.spacing(2),marginTop:e.spacing(1),borderRadius:e.spacing(1),border:`1px solid ${e.palette.divider}`,boxShadow:"none"})),bt=le(k)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),vt=le(k)({display:"flex",justifyContent:"space-between",alignItems:"center"});function Te({meta:e}){const{amount:t,symbol:r,chainId:s}=e,i=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return n.jsxs(yt,{children:[n.jsxs(bt,{children:[n.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),n.jsx(P,{variant:"h5",sx:{color:"text.primary"},children:"ArcBlock"})]}),n.jsxs(vt,{children:[n.jsxs(k,{sx:{display:"flex",alignItems:"baseline",gap:1},children:[n.jsxs(P,{component:"span",variant:"h5",sx:{color:"text.primary",fontWeight:"bold"},children:["+ ",t]}),n.jsx(P,{component:"span",variant:"subtitle2",sx:{color:"text.secondary"},children:r})]}),n.jsx(Be,{variant:"outlined",size:"small",color:"secondary",endIcon:n.jsx(at,{icon:xt}),onClick:i,sx:{borderRadius:4},children:"View on Chain"})]})]})}wt.propTypes={meta:m.object.isRequired,type:m.string.isRequired,hideTips:m.bool,sx:m.object};function wt({meta:e,type:t,hideTips:r=!1,sx:s={}}){return F(e)?null:t==="tips"&&!r?n.jsx(Te,{meta:e}):n.jsx(P,{variant:"subtitle2",component:"p",sx:[{fontSize:16,color:"text.secondary",wordBreak:"break-all"},...Array.isArray(s)?s:[s]],children:e.content})}var re,he;function jt(){if(he)return re;he=1;var e=We();function t(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var r=t(e);function s(){return s=Object.assign?Object.assign.bind():function(a){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var c in f)({}).hasOwnProperty.call(f,c)&&(a[c]=f[c])}return a},s.apply(null,arguments)}function i(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,o(a,u)}function p(a,u){if(a==null)return{};var f={};for(var c in a)if({}.hasOwnProperty.call(a,c)){if(u.indexOf(c)!==-1)continue;f[c]=a[c]}return f}function o(a,u){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,c){return f.__proto__=c,f},o(a,u)}var h={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},x=["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 v(a,u){if(!a||typeof a!="object")return a;var f={};return Object.keys(a).forEach(function(c){u.indexOf(c)>-1||(f[c]=a[c])}),f}var g=["component","className","unsafeHTML"];function T(a,u){if(u!=="letters"&&u!=="words")throw new Error("Unsupported options basedOn: "+u);if(a.nodeType===Node.TEXT_NODE){var f=document.createDocumentFragment(),c;switch(u){case"words":c=a.textContent.split(/\b|(?=\W)/);break;case"letters":c=Array.from(a.textContent);break}c.forEach(function(N){f.appendChild(L(N))}),a.parentNode.replaceChild(f,a)}else if(a.nodeType===Node.ELEMENT_NODE)for(var l=[].slice.call(a.childNodes),d=l.length,j=0;j<d;j++)T(l[j],u)}function L(a){var u=document.createElement("span");return u.className="LinesEllipsis-unit",u.textContent=a,u}function b(a){a.parentNode.replaceChild(document.createTextNode(a.textContent),a)}function R(a,u){if(!(!u.contains(a)||a===u)){for(;a.nextElementSibling;)a.parentNode.removeChild(a.nextElementSibling);R(a.parentNode,u)}}function M(a){for(var u=a;u=u.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(u.tagName.toLowerCase()))return u}function E(a){return!!(a.offsetHeight&&(a.offsetWidth||/\S/.test(a.textContent)))}var w={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},y=Object.keys(w),S=(function(a){function u(c){var l;return l=a.call(this,c)||this,l.state={html:c.unsafeHTML,clamped:!1},l.canvas=null,l.maxLine=0,l.nlUnits=[],l}i(u,a);var f=u.prototype;return f.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},f.componentDidUpdate=function(l){l.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==l&&this.reflow(this.props)},f.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},f.setState=function(l,d){return typeof l.clamped<"u"&&(this.clamped=l.clamped),a.prototype.setState.call(this,l,d)},f.initCanvas=function(){if(!this.canvas){var l=this.canvas=document.createElement("div");l.className="LinesEllipsis-canvas "+this.props.className,l.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(h).forEach(function(d){l.style[d]=h[d]}),document.body.appendChild(l)}},f.copyStyleToCanvas=function(){var l=this,d=window.getComputedStyle(this.target);x.forEach(function(j){l.canvas.style[j]=d[j]})},f.reflow=function(l){this.maxLine=+l.maxLine||1,this.canvas.innerHTML=l.unsafeHTML;var d=l.basedOn||(/^[\x00-\x7F]+$/.test(l.unsafeHTML)?"words":"letters");T(this.canvas,d);var j=this.putEllipsis(this.calcIndexes()),N={clamped:j,html:this.canvas.innerHTML};this.setState(N,l.onReflow.bind(this,N))},f.calcIndexes=function(){var l=[0],d=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),j=d.length;if(!d.length)return l;var N=d.find(E);if(!N)return l;for(var I=1,K=N.offsetTop,U=1;U<j&&!(E(d[U])&&d[U].offsetTop-K>1&&(I++,l.push(U),K=d[U].offsetTop,I>this.maxLine));U++);return l},f.putEllipsis=function(l){if(l.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,l[this.maxLine]);var d=this.nlUnits.pop(),j=this.makeEllipsisSpan();do R(d,this.canvas),M(d).appendChild(j),d=this.nlUnits.pop();while(d&&(!E(d)||j.offsetHeight>d.offsetHeight||j.offsetTop>d.offsetTop));return d&&b(d),this.nlUnits.forEach(b),!0},f.makeEllipsisSpan=function(){var l=this.props,d=l.ellipsisHTML,j=l.ellipsis,N=document.createElement("span");N.appendChild(document.createElement("wbr"));var I=document.createElement("span");return I.className="LinesEllipsis-ellipsis",d?I.innerHTML=d:I.textContent=j,N.appendChild(I),N},f.isClamped=function(){return this.clamped},f.render=function(){var l=this,d=this.state,j=d.html,N=d.clamped,I=this.props,K=I.component,U=I.className,$e=I.unsafeHTML,Fe=p(I,g);return r.default.createElement(K,s({className:"LinesEllipsis "+(N?"LinesEllipsis--clamped":"")+" "+U,ref:function(Oe){return l.target=Oe}},v(Fe,y)),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:N?j:$e}}))},u})(r.default.PureComponent);return S.defaultProps=w,re=S,re}var kt=jt();const Tt=qe(kt),St=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},Ct=e=>e.every(t=>t.type==="text"),Lt=e=>e.every(t=>t.type==="image"),Et=e=>st(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(r=>r?.data?.text?.trim?.())),Rt=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(r=>r.type===t)},Nt=(e,t)=>{try{const r=Je(e);if(!(r.role!==void 0&&r.role!==Ze.RoleType.ACCOUNT))return;const i=B(te,"user");return ce(i,{did:e,locale:t})}catch(r){console.error(r);return}},cn=(e,t)=>t?.componentMountPoints?.find(s=>s.did===e)?.mountPoint,dn=(e,t)=>{if(!e)return null;if(e.actions?.length===1)return e.actions[0].link||null;const r=je(e.activity),s=r?.metaLink||r?.targetLink;if(s)return ke(s)?s:B(t,s);if(e.attachments?.length===1){const i=e.attachments[0];if(i.type==="link")return i.data?.url||null}return null},me=e=>{const{receivers:t=[]}=e;return t.length?t.every(r=>r.read):!0};function It(e){const t=e.getBoundingClientRect(),r=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight,i=t.height,p=t.width;let o=0;t.top>=0&&t.bottom<=s?o=i:t.top<0&&t.bottom>0&&t.bottom<=s?o=t.bottom:t.top>=0&&t.top<s&&t.bottom>s?o=s-t.top:t.top<0&&t.bottom>s&&(o=s);let h=0;return t.left>=0&&t.right<=r?h=p:t.left<0&&t.right>0&&t.right<=r?h=t.right:t.left>=0&&t.left<r&&t.right>r?h=r-t.left:t.left<0&&t.right>r&&(h=r),o*h/(i*p)>=.5}const pn=e=>{if(!e)return[];const t=[],r=5,s=Array.from(e.querySelectorAll(".notification-row")),i=s.length;for(let p=0;p<i;p+=r){const o=s.slice(p,p+r);let h=!0;for(const x of o){const v=x.id;if(It(x))t.push(v);else{h=!1;break}}if(!h)break}return t},Pt=e=>{const t=[];return e&&(e.items?.length?e.items.forEach(r=>{me(r)||t.push(r)}):me(e)||t.push(e)),t},un=(e,t)=>{let r=[];return t.length&&t.forEach(s=>{const i=e.get(s);i&&(r=r.concat(Pt(i)))}),r},O=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}}),V=e=>{if(!e)return null;try{return new URL(e).protocol!=="https:"?(console.warn("Image URL must use HTTPS protocol:",e),null):`${te}/proxy?url=${encodeURIComponent(e)}`}catch(t){return console.warn("Invalid image URL format:",e,t),null}};function Se({attachment:e}){const{data:t}=e,r=A();let s="";try{s=new URL(t.url).host}catch{s=t.url}return n.jsxs(ae,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:i=>{i.customPreventRedirect=!0},children:[!!s&&n.jsx("span",{className:"url",children:s}),!!t.title&&n.jsx(k,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&n.jsx(k,{className:"description",style:{whiteSpace:"unset",color:r.palette.text.secondary},children:t.description}),!!t.image&&n.jsx(G,{src:J.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:V(J.getImagePath(t.image))})]})}Se.propTypes={attachment:m.object.isRequired};function Ce({attachment:e}){const{data:t}=e;return n.jsx(G,{src:J.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},sx:{".Img-root":{height:256}},fallback:V(J.getImagePath(t.url))})}Ce.propTypes={attachment:m.object.isRequired};function Le({attachment:e,...t}){const{data:r}=e,s=r.color?.toLowerCase()||t.color,i=r.size||t.size,p=r.fontWeight||t.fontWeight||400;let o="14px";return i==="small"?o="12px":i==="normal"?o="14px":i==="big"?o="16px":i==="large"&&(o="18px"),n.jsx(Mt,{className:"title",style:{fontSize:o,color:s,whiteSpace:"unset",fontWeight:p},children:r.text})}Le.propTypes={attachment:m.object.isRequired};const Mt=z.span`
|
|
2
2
|
width: 100%;
|
|
3
3
|
display: -webkit-box;
|
|
4
4
|
-webkit-box-orient: vertical;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,r as R}from"./vendor-react-DX7tU9aY.js";import{cI as Ne,M as j,X as Oe,ab as ue,W as Te,a3 as me}from"./index-DcM4ljaV.js";import{az as je,y as Ie}from"./vendor-utils-_C9URqjS.js";import{u as Pe}from"./useAsyncRetry-DOQg_SXs.js";import{I as Ye}from"./iframe-eNnbtEC_.js";import{al as $,P as Me,a_ as h,a4 as ne,T as Y,dO as Fe,W as Le,U as He,aN as _e,I as K,cS as We,z as fe,bN as he,M as pe,cR as Ae,dP as ze,n as ge,j as p,X as I,G as Ve,a7 as qe,b4 as Be,R as $e,aL as Ke,bf as Je}from"./vendor-mui-core-CDEc-eG6.js";import{r as ie,b as ye,G as T,z as re,M as W,L as A,A as P,e as z,K as V,J,I as U,C as F,B as w,E as De,Q as le,y as Ue,D as Ge,H as ce,d as Xe,P as se,F as _,R as Qe,S as Ze,N as et,U as tt,O as at}from"./index-DMv6sUCJ.js";import{cQ as be,aa as Re}from"./vendor-ux-PO0jFgJf.js";import{f as nt}from"./index-DBs9Ljax.js";import{B as rt}from"./base-chart-CeRp7fHy.js";import{L as st,a as ot}from"./vendor-mui-x-Bk3pxGrO.js";import{A as it}from"./AdapterDayjs-DtK6vYWP.js";function ke(e){ie(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(be(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(r){var s=ye(r);(a===void 0||a<s||isNaN(Number(s)))&&(a=s)}),a||new Date(NaN)}function Se(e){ie(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(be(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(r){var s=ye(r);(a===void 0||a>s||isNaN(s.getDate()))&&(a=s)}),a||new Date(NaN)}function lt(e){return ie(1,arguments),T(e,Date.now())}const ct=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(a,r)=>e.slice(r*t,r*t+t)),dt=(e,t)=>{const a=A(V(e),{locale:t}),r=W(z(e),{locale:t}),s=[];for(let o=a;_(o,r);)s.push(o),o=re(o,1);return s},ut=({startDate:e},t)=>e&&T(t,e),mt=({endDate:e},t)=>e&&T(t,e),ft=({startDate:e,endDate:t},a)=>e&&t&&(le(a,{start:e,end:t})||T(a,e)||T(a,t)),ht=({startDate:e,endDate:t})=>e&&t?T(e,t):!1,ve=(e,t)=>{if(e){const a=e instanceof Date?e:Ue(e);if(Ge(a))return a}return t},pt=(e,t,a)=>{const{startDate:r,endDate:s}=e;if(r&&s){const o=ke([r,t]),c=Se([s,a]);return[o,ce(o,c)?w(o,1):c]}return[r,s]},gt=(e,t)=>[{label:"Today",startDate:e,endDate:e},{label:"Yesterday",startDate:re(e,-1),endDate:re(e,-1)},{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(P(e,-1),{locale:t}),endDate:W(P(e,-1),{locale:t})},{label:"Last 7 Days",startDate:P(e,-1),endDate:e},{label:"This Month",startDate:V(e),endDate:z(e)},{label:"Last Month",startDate:V(w(e,-1)),endDate:z(w(e,-1))},{label:"This Year",startDate:U(e),endDate:J(e)},{label:"Last Year",startDate:U(F(e,-1)),endDate:J(F(e,-1))}],Dt=(e,t)=>{const a=Math.floor(t/2);return Array(t).fill(0).map((r,s)=>e.getFullYear()-a+s)},vt=({date:e,setDate:t,nextDisabled:a,prevDisabled:r,onClickNext:s,onClickPrevious:o,locale:c})=>{const m=typeof c<"u"?[...Array(12).keys()].map(l=>{var v;return(v=c.localize)===null||v===void 0?void 0:v.month(l,{width:"abbreviated",context:"standalone"})}):["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],g=l=>{t(tt(e,parseInt(l.target.value,10)))},d=l=>{t(at(e,parseInt(l.target.value,10)))};return n.createElement(h,{container:!0,justifyContent:"space-between",alignItems:"center"},n.createElement(h,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:r,onClick:o},n.createElement(We,{color:r?"disabled":"action"}))),n.createElement(h,{item:!0},n.createElement(fe,{variant:"standard"},n.createElement(he,{value:Ze(e),onChange:g,MenuProps:{disablePortal:!0}},m.map((l,v)=>n.createElement(pe,{key:l,value:v},l))))),n.createElement(h,{item:!0},n.createElement(fe,{variant:"standard"},n.createElement(he,{value:et(e),onChange:d,MenuProps:{disablePortal:!0}},Dt(e,30).map(l=>n.createElement(pe,{key:l,value:l},l))))),n.createElement(h,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:a,onClick:s},n.createElement(Ae,{color:a?"disabled":"action"}))))},xt=({startOfRange:e,endOfRange:t,disabled:a,highlighted:r,outlined:s,filled:o,onClick:c,onHover:m,value:g})=>n.createElement($,{sx:{display:"flex",borderRadius:e?"50% 0 0 50%":t?"0 50% 50% 0":void 0,backgroundColor:d=>!a&&r?d.palette.primary.light:void 0}},n.createElement(K,{sx:Object.assign({height:"36px",width:"36px",padding:0,border:d=>!a&&s?`1px solid ${d.palette.primary.dark}`:void 0},!a&&o?{"&:hover":{backgroundColor:d=>d.palette.primary.dark},backgroundColor:d=>d.palette.primary.dark}:{}),disabled:a,onClick:c,onMouseOver:m},n.createElement(Y,{sx:{lineHeight:1.6,color:d=>a?d.palette.text.secondary:o?d.palette.primary.contrastText:d.palette.text.primary},variant:"body2"},g)));var G;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(G||(G={}));const xe=e=>{var t;const{helpers:a,handlers:r,value:s,dateRange:o,marker:c,setValue:m,minDate:g,maxDate:d,locale:l}=e,v=((t=l?.options)===null||t===void 0?void 0:t.weekStartsOn)||0,C=typeof l<"u"?[...Array(7).keys()].map(D=>{var E;return(E=l.localize)===null||E===void 0?void 0:E.day((D+v)%7,{width:"short",context:"standalone"})}):["Su","Mo","Tu","We","Th","Fr","Sa"],[x,k]=e.navState;return n.createElement(Me,{square:!0,elevation:0,sx:{width:290}},n.createElement(h,{container:!0},n.createElement(vt,{date:s,setDate:m,nextDisabled:!k,prevDisabled:!x,onClickPrevious:()=>r.onMonthNavigate(c,G.Previous),onClickNext:()=>r.onMonthNavigate(c,G.Next),locale:l}),n.createElement(h,{item:!0,container:!0,direction:"row",justifyContent:"space-between",sx:{marginTop:"10px",paddingLeft:"30px",paddingRight:"30px"}},C.map((D,E)=>n.createElement(Y,{color:"textSecondary",key:E,variant:"caption"},D))),n.createElement(h,{item:!0,container:!0,direction:"column",justifyContent:"space-between",sx:{paddingLeft:"15px",paddingRight:"15px",marginTop:"15px",marginBottom:"20px"}},ct(dt(s,l),7).map((D,E)=>n.createElement(h,{key:E,container:!0,direction:"row",justifyContent:"center"},D.map(f=>{const N=ut(o,f),b=mt(o,f),S=ht(o),M=ft(o,f)||a.inHoverRange(f);return n.createElement(xt,{key:se(f,"dd-MM-yyyy"),filled:N||b,outlined:lt(f),highlighted:M&&!S,disabled:!ce(s,f)||!le(f,{start:g,end:d}),startOfRange:N&&!S,endOfRange:b&&!S,onClick:()=>r.onDayClick(f),onHover:()=>r.onDayHover(f),value:Qe(f)})}))))))},Ee=(e,t)=>{const{startDate:a,endDate:r}=e,{startDate:s,endDate:o}=t;return a&&s&&r&&o?T(a,s)&&T(r,o):!1},Et=({ranges:e,setRange:t,selectedRange:a})=>n.createElement(Le,null,e.map((r,s)=>n.createElement(He,{button:!0,key:s,onClick:()=>t(r),sx:[Ee(r,a)&&{backgroundColor:o=>o.palette.primary.dark,color:"primary.contrastText","&:hover":{color:"inherit"}}]},n.createElement(_e,{primaryTypographyProps:{variant:"body2",sx:{fontWeight:Ee(r,a)?"bold":"normal"}}},r.label)))),oe={FIRST_MONTH:Symbol("firstMonth"),SECOND_MONTH:Symbol("secondMonth")},Mt=e=>{const{ranges:t,dateRange:a,minDate:r,maxDate:s,firstMonth:o,setFirstMonth:c,secondMonth:m,setSecondMonth:g,setDateRange:d,helpers:l,handlers:v,locale:C}=e,{startDate:x,endDate:k}=a,D=Xe(m,o)>=2,E={dateRange:a,minDate:r,maxDate:s,helpers:l,handlers:v};return n.createElement(Me,{elevation:5,square:!0},n.createElement(h,{container:!0,direction:"row",wrap:"nowrap"},n.createElement(h,null,n.createElement(Et,{selectedRange:a,ranges:t,setRange:d})),n.createElement(ne,{orientation:"vertical",flexItem:!0}),n.createElement(h,null,n.createElement(h,{container:!0,sx:{padding:"20px 70px"},alignItems:"center"},n.createElement(h,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},x?se(x,"dd MMMM yyyy",{locale:C}):"Start Date")),n.createElement(h,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Fe,{color:"action"})),n.createElement(h,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},k?se(k,"dd MMMM yyyy",{locale:C}):"End Date"))),n.createElement(ne,null),n.createElement(h,{container:!0,direction:"row",justifyContent:"center",wrap:"nowrap"},n.createElement(xe,Object.assign({},E,{value:o,setValue:c,navState:[!0,D],marker:oe.FIRST_MONTH,locale:C})),n.createElement(ne,{orientation:"vertical",flexItem:!0}),n.createElement(xe,Object.assign({},E,{value:m,setValue:g,navState:[D,!0],marker:oe.SECOND_MONTH,locale:C}))))))},yt=e=>{const t=new Date,{open:a,onChange:r,initialDateRange:s,minDate:o,maxDate:c,definedRanges:m=gt(new Date,e.locale),locale:g}=e,d=ve(o,F(t,-10)),l=ve(c,F(t,10)),[v,C]=pt(s||{},d,l),[x,k]=R.useState(Object.assign({},s)),[D,E]=R.useState(),[f,N]=R.useState(v||t),[b,S]=R.useState(C||w(f,1)),{startDate:M,endDate:L}=x,q=u=>{_(u,b)&&N(u)},H=u=>{De(u,f)&&S(u)},X=u=>{let{startDate:i,endDate:y}=u;if(i&&y)u.startDate=i=ke([i,d]),u.endDate=y=Se([y,l]),k(u),r(u),N(i),S(ce(i,y)?w(i,1):y);else{const de={};k(de),r(de),N(t),S(w(f,1))}},B=u=>{if(M&&!L&&!_(u,M)){const i={startDate:M,endDate:u};r(i),k(i)}else k({startDate:u,endDate:void 0});E(u)},Q=(u,i)=>{if(u===oe.FIRST_MONTH){const y=w(f,i);_(y,b)&&N(y)}else{const y=w(b,i);_(f,y)&&S(y)}},Z=u=>{M&&!L&&(!D||!T(u,D))&&E(u)},te={inHoverRange:u=>M&&!L&&D&&De(D,M)&&le(u,{start:M,end:D})},ae={onDayClick:B,onDayHover:Z,onMonthNavigate:Q};return a?R.createElement(Mt,{dateRange:x,minDate:d,maxDate:l,ranges:m,firstMonth:f,secondMonth:b,setFirstMonth:q,setSecondMonth:H,setDateRange:X,helpers:te,handlers:ae,locale:g}):null},bt=e=>{const{closeOnClickOutside:t,wrapperClassName:a,toggle:r,open:s}=e,o=()=>{t!==!1&&r()},c=m=>m?.key==="Escape"&&o();return n.createElement($,{sx:{position:"relative"}},s&&n.createElement($,{sx:{position:"fixed",height:"100vh",width:"100vw",bottom:0,zIndex:0,right:0,left:0,top:0},onKeyPress:c,onClick:o}),n.createElement($,{sx:{position:"relative",zIndex:1},className:a},n.createElement(yt,Object.assign({},e))))},Rt=e=>n.createElement(bt,Object.assign({},e));function Ce({title:e="",total:t=0,hoverIndex:a=null,onHover:r=()=>{},history:s=[],valueFn:o=c=>c}){const c=ze(),{locale:m}=Re(),g=[{min:0,max:t,color:ge(c.palette.primary.main,c.palette.mode==="dark"?.15:.08)},{min:t,color:ge(c.palette.primary.main,c.palette.mode==="dark"?.15:.08)}];return p.jsx(rt,{title:e,total:t,history:s,valueFn:o,onHover:r,hoverIndex:a,xAxisFormat:d=>Ne(d,"MM-DD",m),visualMapPieces:g,markLineData:void 0,extraInfo:null})}Ce.propTypes={title:I.string,total:I.number,history:I.array,valueFn:I.func,hoverIndex:I.number,onHover:I.func};const O=je(0),we=(e,t)=>[{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(P(e,-1),{locale:t}),endDate:W(P(e,-1),{locale:t})},{label:"Last 7 Days",startDate:P(e,-1),endDate:e},{label:"This Month",startDate:V(e),endDate:z(e)},{label:"Last Month",startDate:V(w(e,-1)),endDate:z(w(e,-1))},{label:"This Year",startDate:U(e),endDate:J(e)},{label:"Last Year",startDate:U(F(e,-1)),endDate:J(F(e,-1))}],kt=Array.from({length:7},(e,t)=>({value:0,date:j().subtract(t,"day").format("YYYY-MM-DD")})).reverse();function St({client:e,did:t}){const a=j().subtract(1,"day").toDate(),{info:r,inService:s}=Oe(),{t:o,locale:c}=Re(),[m,g]=R.useState(null),[d,l]=R.useState(!1),[v,C]=R.useState(a),[x,k]=R.useState({startDate:j().subtract(30,"day").toDate(),endDate:a}),D=Ve(),[E,f]=R.useState(null),N=R.useCallback(i=>{f(i)},[]),b=Pe(async()=>(await e.getTrafficInsights({input:{did:t,startDate:j(x.startDate).format("YYYY-MM-DD"),endDate:j(x.endDate).format("YYYY-MM-DD")}})).list);R.useEffect(()=>{b.loading||x.startDate&&x.endDate&&b.retry()},[x]);const S=i=>{g(m?null:i.currentTarget)},M=b.value||[],{loading:L,error:q}=b;if(!M.length&&L)return p.jsx(qe,{});if(q)return p.jsx(Be,{severity:"error",children:nt(q)});const H={totalRequests:O,validRequests:O,failedRequests:O,uniqueVisitors:O,uniqueFiles:O,uniqueReferrers:O,uniqueNotFound:O,uniqueStaticFiles:O,logSize:ue,bandwidth:ue},X=Object.keys(H).map(i=>({id:`${i}_chart`,title:o(`analytics.traffic.${i}`),current:M.length?H[i](M[0][i]):0,data:M.length?M.map(y=>({date:y.date,value:y[i]})).reverse():kt,dateFn:O,valueFn:H[i],total:0})),B=!!m,Q=B?"date-range-picker-popover":void 0,Z=s?Te:r.routing.adminPath,ee=Ie(window.location.origin,Z,`/api/analytics/traffic?date=${j(v).format("YYYY-MM-DD")}&did=${t}&theme=${D.palette.mode}`),te=i=>{k(i),g(null)},ae=i=>{C(i.toDate()),l(!1)},u=()=>{window.open(ee)};return p.jsxs("div",{children:[p.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:2},children:[o("analytics.trend"),p.jsxs($e,{onClick:S,variant:"outlined",size:"small",color:"inherit",sx:{fontWeight:400},children:[me(x.startDate,c)," - ",me(x.endDate,c)]})]}),p.jsx(Ke,{id:Q,open:B,anchorEl:m,onClose:()=>g(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:p.jsx(Rt,{open:!0,toggle:S,maxDate:a,definedRanges:we(v),onChange:te})}),p.jsx(h,{container:!0,spacing:4,children:X.map(i=>p.jsx(h,{sx:{pt:"16px !important"},size:{lg:4,md:6,sm:6,xs:12},children:p.jsx(Ce,{title:`${i.title}`,total:i.total,empty:null,history:i.data,style:{height:150},valueFn:i.valueFn,hoverIndex:E,onHover:N})},i.id))}),p.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mt:4,mb:1},children:[o("analytics.detail"),p.jsxs("span",{children:[d&&p.jsx(K,{onClick:u,style:{marginRight:32},children:p.jsx(Je,{})}),p.jsx(st,{dateAdapter:it,children:p.jsx(ot,{disableFuture:!0,format:"ll",value:j(v),onChange:ae,slotProps:{textField:{size:"small"}}})})]})]}),p.jsx(Ye,{url:ee,width:"100%",height:"100%",frameBorder:0,onLoad:()=>l(!0),styles:{border:0,minHeight:"400vh"}})]})}const _t=Object.freeze(Object.defineProperty({__proto__:null,default:St,getDefaultRanges:we},Symbol.toStringTag,{value:"Module"}));export{Rt as D,we as g,_t as t};
|
|
1
|
+
import{a as n,r as R}from"./vendor-react-DX7tU9aY.js";import{cI as Ne,M as j,X as Oe,ab as ue,W as Te,a3 as me}from"./index-CgSpL7jz.js";import{az as je,y as Ie}from"./vendor-utils-_C9URqjS.js";import{u as Pe}from"./useAsyncRetry-DOQg_SXs.js";import{I as Ye}from"./iframe-CVEnFycA.js";import{al as $,P as Me,a_ as h,a4 as ne,T as Y,dO as Fe,W as Le,U as He,aN as _e,I as K,cS as We,z as fe,bN as he,M as pe,cR as Ae,dP as ze,n as ge,j as p,X as I,G as Ve,a7 as qe,b4 as Be,R as $e,aL as Ke,bf as Je}from"./vendor-mui-core-CDEc-eG6.js";import{r as ie,b as ye,G as T,z as re,M as W,L as A,A as P,e as z,K as V,J,I as U,C as F,B as w,E as De,Q as le,y as Ue,D as Ge,H as ce,d as Xe,P as se,F as _,R as Qe,S as Ze,N as et,U as tt,O as at}from"./index-DMv6sUCJ.js";import{cQ as be,aa as Re}from"./vendor-ux-PO0jFgJf.js";import{f as nt}from"./index-DBs9Ljax.js";import{B as rt}from"./base-chart-CeRp7fHy.js";import{L as st,a as ot}from"./vendor-mui-x-Bk3pxGrO.js";import{A as it}from"./AdapterDayjs-DtK6vYWP.js";function ke(e){ie(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(be(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(r){var s=ye(r);(a===void 0||a<s||isNaN(Number(s)))&&(a=s)}),a||new Date(NaN)}function Se(e){ie(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(be(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(r){var s=ye(r);(a===void 0||a>s||isNaN(s.getDate()))&&(a=s)}),a||new Date(NaN)}function lt(e){return ie(1,arguments),T(e,Date.now())}const ct=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(a,r)=>e.slice(r*t,r*t+t)),dt=(e,t)=>{const a=A(V(e),{locale:t}),r=W(z(e),{locale:t}),s=[];for(let o=a;_(o,r);)s.push(o),o=re(o,1);return s},ut=({startDate:e},t)=>e&&T(t,e),mt=({endDate:e},t)=>e&&T(t,e),ft=({startDate:e,endDate:t},a)=>e&&t&&(le(a,{start:e,end:t})||T(a,e)||T(a,t)),ht=({startDate:e,endDate:t})=>e&&t?T(e,t):!1,ve=(e,t)=>{if(e){const a=e instanceof Date?e:Ue(e);if(Ge(a))return a}return t},pt=(e,t,a)=>{const{startDate:r,endDate:s}=e;if(r&&s){const o=ke([r,t]),c=Se([s,a]);return[o,ce(o,c)?w(o,1):c]}return[r,s]},gt=(e,t)=>[{label:"Today",startDate:e,endDate:e},{label:"Yesterday",startDate:re(e,-1),endDate:re(e,-1)},{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(P(e,-1),{locale:t}),endDate:W(P(e,-1),{locale:t})},{label:"Last 7 Days",startDate:P(e,-1),endDate:e},{label:"This Month",startDate:V(e),endDate:z(e)},{label:"Last Month",startDate:V(w(e,-1)),endDate:z(w(e,-1))},{label:"This Year",startDate:U(e),endDate:J(e)},{label:"Last Year",startDate:U(F(e,-1)),endDate:J(F(e,-1))}],Dt=(e,t)=>{const a=Math.floor(t/2);return Array(t).fill(0).map((r,s)=>e.getFullYear()-a+s)},vt=({date:e,setDate:t,nextDisabled:a,prevDisabled:r,onClickNext:s,onClickPrevious:o,locale:c})=>{const m=typeof c<"u"?[...Array(12).keys()].map(l=>{var v;return(v=c.localize)===null||v===void 0?void 0:v.month(l,{width:"abbreviated",context:"standalone"})}):["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],g=l=>{t(tt(e,parseInt(l.target.value,10)))},d=l=>{t(at(e,parseInt(l.target.value,10)))};return n.createElement(h,{container:!0,justifyContent:"space-between",alignItems:"center"},n.createElement(h,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:r,onClick:o},n.createElement(We,{color:r?"disabled":"action"}))),n.createElement(h,{item:!0},n.createElement(fe,{variant:"standard"},n.createElement(he,{value:Ze(e),onChange:g,MenuProps:{disablePortal:!0}},m.map((l,v)=>n.createElement(pe,{key:l,value:v},l))))),n.createElement(h,{item:!0},n.createElement(fe,{variant:"standard"},n.createElement(he,{value:et(e),onChange:d,MenuProps:{disablePortal:!0}},Dt(e,30).map(l=>n.createElement(pe,{key:l,value:l},l))))),n.createElement(h,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:a,onClick:s},n.createElement(Ae,{color:a?"disabled":"action"}))))},xt=({startOfRange:e,endOfRange:t,disabled:a,highlighted:r,outlined:s,filled:o,onClick:c,onHover:m,value:g})=>n.createElement($,{sx:{display:"flex",borderRadius:e?"50% 0 0 50%":t?"0 50% 50% 0":void 0,backgroundColor:d=>!a&&r?d.palette.primary.light:void 0}},n.createElement(K,{sx:Object.assign({height:"36px",width:"36px",padding:0,border:d=>!a&&s?`1px solid ${d.palette.primary.dark}`:void 0},!a&&o?{"&:hover":{backgroundColor:d=>d.palette.primary.dark},backgroundColor:d=>d.palette.primary.dark}:{}),disabled:a,onClick:c,onMouseOver:m},n.createElement(Y,{sx:{lineHeight:1.6,color:d=>a?d.palette.text.secondary:o?d.palette.primary.contrastText:d.palette.text.primary},variant:"body2"},g)));var G;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(G||(G={}));const xe=e=>{var t;const{helpers:a,handlers:r,value:s,dateRange:o,marker:c,setValue:m,minDate:g,maxDate:d,locale:l}=e,v=((t=l?.options)===null||t===void 0?void 0:t.weekStartsOn)||0,C=typeof l<"u"?[...Array(7).keys()].map(D=>{var E;return(E=l.localize)===null||E===void 0?void 0:E.day((D+v)%7,{width:"short",context:"standalone"})}):["Su","Mo","Tu","We","Th","Fr","Sa"],[x,k]=e.navState;return n.createElement(Me,{square:!0,elevation:0,sx:{width:290}},n.createElement(h,{container:!0},n.createElement(vt,{date:s,setDate:m,nextDisabled:!k,prevDisabled:!x,onClickPrevious:()=>r.onMonthNavigate(c,G.Previous),onClickNext:()=>r.onMonthNavigate(c,G.Next),locale:l}),n.createElement(h,{item:!0,container:!0,direction:"row",justifyContent:"space-between",sx:{marginTop:"10px",paddingLeft:"30px",paddingRight:"30px"}},C.map((D,E)=>n.createElement(Y,{color:"textSecondary",key:E,variant:"caption"},D))),n.createElement(h,{item:!0,container:!0,direction:"column",justifyContent:"space-between",sx:{paddingLeft:"15px",paddingRight:"15px",marginTop:"15px",marginBottom:"20px"}},ct(dt(s,l),7).map((D,E)=>n.createElement(h,{key:E,container:!0,direction:"row",justifyContent:"center"},D.map(f=>{const N=ut(o,f),b=mt(o,f),S=ht(o),M=ft(o,f)||a.inHoverRange(f);return n.createElement(xt,{key:se(f,"dd-MM-yyyy"),filled:N||b,outlined:lt(f),highlighted:M&&!S,disabled:!ce(s,f)||!le(f,{start:g,end:d}),startOfRange:N&&!S,endOfRange:b&&!S,onClick:()=>r.onDayClick(f),onHover:()=>r.onDayHover(f),value:Qe(f)})}))))))},Ee=(e,t)=>{const{startDate:a,endDate:r}=e,{startDate:s,endDate:o}=t;return a&&s&&r&&o?T(a,s)&&T(r,o):!1},Et=({ranges:e,setRange:t,selectedRange:a})=>n.createElement(Le,null,e.map((r,s)=>n.createElement(He,{button:!0,key:s,onClick:()=>t(r),sx:[Ee(r,a)&&{backgroundColor:o=>o.palette.primary.dark,color:"primary.contrastText","&:hover":{color:"inherit"}}]},n.createElement(_e,{primaryTypographyProps:{variant:"body2",sx:{fontWeight:Ee(r,a)?"bold":"normal"}}},r.label)))),oe={FIRST_MONTH:Symbol("firstMonth"),SECOND_MONTH:Symbol("secondMonth")},Mt=e=>{const{ranges:t,dateRange:a,minDate:r,maxDate:s,firstMonth:o,setFirstMonth:c,secondMonth:m,setSecondMonth:g,setDateRange:d,helpers:l,handlers:v,locale:C}=e,{startDate:x,endDate:k}=a,D=Xe(m,o)>=2,E={dateRange:a,minDate:r,maxDate:s,helpers:l,handlers:v};return n.createElement(Me,{elevation:5,square:!0},n.createElement(h,{container:!0,direction:"row",wrap:"nowrap"},n.createElement(h,null,n.createElement(Et,{selectedRange:a,ranges:t,setRange:d})),n.createElement(ne,{orientation:"vertical",flexItem:!0}),n.createElement(h,null,n.createElement(h,{container:!0,sx:{padding:"20px 70px"},alignItems:"center"},n.createElement(h,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},x?se(x,"dd MMMM yyyy",{locale:C}):"Start Date")),n.createElement(h,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Fe,{color:"action"})),n.createElement(h,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},k?se(k,"dd MMMM yyyy",{locale:C}):"End Date"))),n.createElement(ne,null),n.createElement(h,{container:!0,direction:"row",justifyContent:"center",wrap:"nowrap"},n.createElement(xe,Object.assign({},E,{value:o,setValue:c,navState:[!0,D],marker:oe.FIRST_MONTH,locale:C})),n.createElement(ne,{orientation:"vertical",flexItem:!0}),n.createElement(xe,Object.assign({},E,{value:m,setValue:g,navState:[D,!0],marker:oe.SECOND_MONTH,locale:C}))))))},yt=e=>{const t=new Date,{open:a,onChange:r,initialDateRange:s,minDate:o,maxDate:c,definedRanges:m=gt(new Date,e.locale),locale:g}=e,d=ve(o,F(t,-10)),l=ve(c,F(t,10)),[v,C]=pt(s||{},d,l),[x,k]=R.useState(Object.assign({},s)),[D,E]=R.useState(),[f,N]=R.useState(v||t),[b,S]=R.useState(C||w(f,1)),{startDate:M,endDate:L}=x,q=u=>{_(u,b)&&N(u)},H=u=>{De(u,f)&&S(u)},X=u=>{let{startDate:i,endDate:y}=u;if(i&&y)u.startDate=i=ke([i,d]),u.endDate=y=Se([y,l]),k(u),r(u),N(i),S(ce(i,y)?w(i,1):y);else{const de={};k(de),r(de),N(t),S(w(f,1))}},B=u=>{if(M&&!L&&!_(u,M)){const i={startDate:M,endDate:u};r(i),k(i)}else k({startDate:u,endDate:void 0});E(u)},Q=(u,i)=>{if(u===oe.FIRST_MONTH){const y=w(f,i);_(y,b)&&N(y)}else{const y=w(b,i);_(f,y)&&S(y)}},Z=u=>{M&&!L&&(!D||!T(u,D))&&E(u)},te={inHoverRange:u=>M&&!L&&D&&De(D,M)&&le(u,{start:M,end:D})},ae={onDayClick:B,onDayHover:Z,onMonthNavigate:Q};return a?R.createElement(Mt,{dateRange:x,minDate:d,maxDate:l,ranges:m,firstMonth:f,secondMonth:b,setFirstMonth:q,setSecondMonth:H,setDateRange:X,helpers:te,handlers:ae,locale:g}):null},bt=e=>{const{closeOnClickOutside:t,wrapperClassName:a,toggle:r,open:s}=e,o=()=>{t!==!1&&r()},c=m=>m?.key==="Escape"&&o();return n.createElement($,{sx:{position:"relative"}},s&&n.createElement($,{sx:{position:"fixed",height:"100vh",width:"100vw",bottom:0,zIndex:0,right:0,left:0,top:0},onKeyPress:c,onClick:o}),n.createElement($,{sx:{position:"relative",zIndex:1},className:a},n.createElement(yt,Object.assign({},e))))},Rt=e=>n.createElement(bt,Object.assign({},e));function Ce({title:e="",total:t=0,hoverIndex:a=null,onHover:r=()=>{},history:s=[],valueFn:o=c=>c}){const c=ze(),{locale:m}=Re(),g=[{min:0,max:t,color:ge(c.palette.primary.main,c.palette.mode==="dark"?.15:.08)},{min:t,color:ge(c.palette.primary.main,c.palette.mode==="dark"?.15:.08)}];return p.jsx(rt,{title:e,total:t,history:s,valueFn:o,onHover:r,hoverIndex:a,xAxisFormat:d=>Ne(d,"MM-DD",m),visualMapPieces:g,markLineData:void 0,extraInfo:null})}Ce.propTypes={title:I.string,total:I.number,history:I.array,valueFn:I.func,hoverIndex:I.number,onHover:I.func};const O=je(0),we=(e,t)=>[{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(P(e,-1),{locale:t}),endDate:W(P(e,-1),{locale:t})},{label:"Last 7 Days",startDate:P(e,-1),endDate:e},{label:"This Month",startDate:V(e),endDate:z(e)},{label:"Last Month",startDate:V(w(e,-1)),endDate:z(w(e,-1))},{label:"This Year",startDate:U(e),endDate:J(e)},{label:"Last Year",startDate:U(F(e,-1)),endDate:J(F(e,-1))}],kt=Array.from({length:7},(e,t)=>({value:0,date:j().subtract(t,"day").format("YYYY-MM-DD")})).reverse();function St({client:e,did:t}){const a=j().subtract(1,"day").toDate(),{info:r,inService:s}=Oe(),{t:o,locale:c}=Re(),[m,g]=R.useState(null),[d,l]=R.useState(!1),[v,C]=R.useState(a),[x,k]=R.useState({startDate:j().subtract(30,"day").toDate(),endDate:a}),D=Ve(),[E,f]=R.useState(null),N=R.useCallback(i=>{f(i)},[]),b=Pe(async()=>(await e.getTrafficInsights({input:{did:t,startDate:j(x.startDate).format("YYYY-MM-DD"),endDate:j(x.endDate).format("YYYY-MM-DD")}})).list);R.useEffect(()=>{b.loading||x.startDate&&x.endDate&&b.retry()},[x]);const S=i=>{g(m?null:i.currentTarget)},M=b.value||[],{loading:L,error:q}=b;if(!M.length&&L)return p.jsx(qe,{});if(q)return p.jsx(Be,{severity:"error",children:nt(q)});const H={totalRequests:O,validRequests:O,failedRequests:O,uniqueVisitors:O,uniqueFiles:O,uniqueReferrers:O,uniqueNotFound:O,uniqueStaticFiles:O,logSize:ue,bandwidth:ue},X=Object.keys(H).map(i=>({id:`${i}_chart`,title:o(`analytics.traffic.${i}`),current:M.length?H[i](M[0][i]):0,data:M.length?M.map(y=>({date:y.date,value:y[i]})).reverse():kt,dateFn:O,valueFn:H[i],total:0})),B=!!m,Q=B?"date-range-picker-popover":void 0,Z=s?Te:r.routing.adminPath,ee=Ie(window.location.origin,Z,`/api/analytics/traffic?date=${j(v).format("YYYY-MM-DD")}&did=${t}&theme=${D.palette.mode}`),te=i=>{k(i),g(null)},ae=i=>{C(i.toDate()),l(!1)},u=()=>{window.open(ee)};return p.jsxs("div",{children:[p.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:2},children:[o("analytics.trend"),p.jsxs($e,{onClick:S,variant:"outlined",size:"small",color:"inherit",sx:{fontWeight:400},children:[me(x.startDate,c)," - ",me(x.endDate,c)]})]}),p.jsx(Ke,{id:Q,open:B,anchorEl:m,onClose:()=>g(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:p.jsx(Rt,{open:!0,toggle:S,maxDate:a,definedRanges:we(v),onChange:te})}),p.jsx(h,{container:!0,spacing:4,children:X.map(i=>p.jsx(h,{sx:{pt:"16px !important"},size:{lg:4,md:6,sm:6,xs:12},children:p.jsx(Ce,{title:`${i.title}`,total:i.total,empty:null,history:i.data,style:{height:150},valueFn:i.valueFn,hoverIndex:E,onHover:N})},i.id))}),p.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mt:4,mb:1},children:[o("analytics.detail"),p.jsxs("span",{children:[d&&p.jsx(K,{onClick:u,style:{marginRight:32},children:p.jsx(Je,{})}),p.jsx(st,{dateAdapter:it,children:p.jsx(ot,{disableFuture:!0,format:"ll",value:j(v),onChange:ae,slotProps:{textField:{size:"small"}}})})]})]}),p.jsx(Ye,{url:ee,width:"100%",height:"100%",frameBorder:0,onLoad:()=>l(!0),styles:{border:0,minHeight:"400vh"}})]})}const _t=Object.freeze(Object.defineProperty({__proto__:null,default:St,getDefaultRanges:we},Symbol.toStringTag,{value:"Module"}));export{Rt as D,we as g,_t as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,a7 as v,al as c,bg as w,T as C,aT as l}from"./vendor-mui-core-CDEc-eG6.js";import{u as S,m as y,b as T,d as b,U as A,k as D,W as R,w as E}from"./index-
|
|
1
|
+
import{j as e,a7 as v,al as c,bg as w,T as C,aT as l}from"./vendor-mui-core-CDEc-eG6.js";import{u as S,m as y,b as T,d as b,U as A,k as D,W as R,w as E}from"./index-CgSpL7jz.js";import{H as I}from"./addon-DIDUuqKP.js";import{K as P}from"./landing-page-BvgQ3gcP.js";import{aa as F,bk as W}from"./vendor-ux-PO0jFgJf.js";import{r as H}from"./vendor-hooks-Ca2cSNuD.js";import{r as o}from"./vendor-react-DX7tU9aY.js";import{s as L}from"./vendor-arcblock-BVQTtbN-.js";import"./vendor-utils-_C9URqjS.js";import"./theme-mode-toggle-WRMGhjzA.js";import"./question-mark-circle.svg-B0bcUgC5.js";import"./use-blocklet-logo-nVOJALp0.js";function Q(){const{t:s,locale:p}=F(),{api:f,session:d}=S(),{searchParams:m}=new URL(window.location.href),[u,x]=o.useState(!1),a=m.get("transferId"),h=window?.env?.appId,g=o.useCallback(async()=>{const{data:t}=await y.get("/blocklet/transfer",{params:{transferId:a}});return t},[a]),r=H(g),j=o.useCallback(async(t,i)=>{t&&(T(i(t.sessionToken)),b(i(t.refreshToken))),await d.refresh(),x(!0)},[]);if(r.loading)return e.jsx(v,{});if(r.error)return e.jsx(z,{children:e.jsx(A,{status:"404",title:r.error?.response?.data,description:""})});const k=r.data.status==="success";let n;return k||u?n=e.jsxs(e.Fragment,{children:[e.jsx(_,{children:e.jsx(I,{SessionContext:D})}),e.jsx(c,{sx:{pt:1,color:"success.main"},children:e.jsx(w,{style:{fontSize:80}})}),e.jsx(C,{variant:"h5",sx:{my:4},children:s("team.transferApp.successTitle")}),e.jsx("a",{href:`${R}/admin`,children:e.jsx(W,{variant:"contained",children:s("team.transferApp.visitDashboard")})})]}):n=e.jsx(E,{popup:!0,open:!0,action:"receive-transfer-app-owner",checkFn:f.get,forceConnected:!1,autoConnect:!1,checkTimeout:600*1e3,onSuccess:j,onClose:()=>{},locale:p,messages:{title:s("team.transferApp.receiveDialog.title"),scan:s("team.transferApp.receiveDialog.scan"),confirm:s("team.transferApp.receiveDialog.confirm"),success:s("team.transferApp.receiveDialog.success")},extraParams:{transferId:a,appDid:h},hideCloseButton:!0}),e.jsx(P,{did:window.blocklet?.appPid,children:e.jsx(c,{sx:{maxWidth:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:n})})}const _=l(L)`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 16px;
|
|
4
4
|
right: 16px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,al as r,bX as y,cj as j,ck as k,cl as w,T as C}from"./vendor-mui-core-CDEc-eG6.js";import{i as v,L as F}from"./vendor-react-DX7tU9aY.js";import{u as L,aS as R,W as c}from"./index-
|
|
1
|
+
import{j as e,al as r,bX as y,cj as j,ck as k,cl as w,T as C}from"./vendor-mui-core-CDEc-eG6.js";import{i as v,L as F}from"./vendor-react-DX7tU9aY.js";import{u as L,aS as R,W as c}from"./index-CgSpL7jz.js";import{i as S,b as l,j as E}from"./vendor-hooks-Ca2cSNuD.js";import{aa as P,a3 as t,bk as d}from"./vendor-ux-PO0jFgJf.js";import{y as u}from"./vendor-utils-_C9URqjS.js";import"./vendor-arcblock-BVQTtbN-.js";function _(){const{api:f}=L(),m=v(),{t:s}=P(),o=new URLSearchParams(m.search).get("token"),i=S({error:"",finished:!1,loading:!1}),b=l(()=>{window.close(),window.location.replace("/")}),h=l(async()=>{try{i.loading=!0;const{data:n}=await f.post("/api/user/notification/unsubscribe",{token:o});n.success===!0?(i.finished=!0,t.success(s("notification.unsubscribeSucceed"))):(i.finished=!1,t.error(s("notification.unsubscribeFailed")))}catch(n){i.finished=!1,t.error(n.message||s("notification.unsubscribeFailed"))}finally{i.loading=!1}});E(()=>{if(!o)i.error=s("notification.unsubscribeTokenRequired");else{const n=R(o);if(!n)i.error=s("notification.unsubscribeTokenInvalid");else{const{exp:g}=n;g*1e3<=Date.now()&&(i.error=s("notification.unsubscribeTokenExpired"))}}});const a=window?.blocklet?.copyright,p=a?.owner||window?.blocklet?.appName,x=a?.year||new Date().getFullYear();return e.jsx(r,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",backgroundColor:"background.default"},children:e.jsxs(r,{sx:{width:"450px",maxWidth:"90%"},children:[e.jsx(r,{sx:{width:"100%"},children:e.jsx("img",{style:{height:"40px"},src:u(c,"/blocklet/logo-rect?imageFilter=convert&f=png"),alt:"blocklet logo"})}),e.jsxs(y,{variant:"outlined",sx:{my:1},children:[e.jsx(j,{title:i.finished?s("notification.unsubscribeSucceed"):s("notification.email.unsubscribe")}),e.jsxs(k,{sx:{minHeight:"10em"},children:[i.error?i.error:null,!i.error&&!i.finished?s("notification.email.unsubscribeDescription"):null,!i.error&&i.finished?e.jsxs(e.Fragment,{children:[s("notification.email.subscribeDescription")," ",e.jsx(F,{to:u(c,"/user/settings"),color:"primary",children:s("notification.email.subscribe")})]}):null]}),e.jsxs(w,{sx:{justifyContent:"end!important"},children:[e.jsx(d,{size:"small",color:i.error?"error":"primary",variant:"outlined",onClick:b,children:s("common.close")}),i.error||i.finished?null:e.jsx(d,{size:"small",color:"primary",variant:"contained",onClick:h,loading:i.loading,children:s("notification.unsubscribe")})]})]}),e.jsxs(C,{variant:"body2",color:"gray",children:["Copyright © ",x," ",p]})]})})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as L}from"./vendor-utils-_C9URqjS.js";import{X as u,F as e,a$ as T,aa as R}from"./index-
|
|
1
|
+
import{y as L}from"./vendor-utils-_C9URqjS.js";import{X as u,F as e,a$ as T,aa as R}from"./index-CgSpL7jz.js";const t=(n,s)=>{let r="?v=";return s?r+=T(s):r+=`${n?.meta?.version}${R(n?.status)?"~":""}`,r};function f({blocklet:n}){const{inService:s}=u(),r=(n?.environments||[]).find(o=>o.key===e.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE)?.value,i=(n?.environments||[]).find(o=>o.key===e.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE_DARK)?.value,_=(n?.environments||[]).find(o=>o.key===e.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT)?.value,E=(n?.environments||[]).find(o=>o.key===e.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT_DARK)?.value,O=(n?.environments||[]).find(o=>o.key===e.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON)?.value,d=(n?.environments||[]).find(o=>o.key===e.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT)?.value,m=(n?.environments||[]).find(o=>o.key===e.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE)?.value,C=(n?.environments||[]).find(o=>o.key===e.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE)?.value,a=window.env?.apiPrefix||"/",A=`${L(a,`/blocklet/logo/${s?"":n.meta.did}`)}${t(n,r)}`,c=`${L(a,`/blocklet/logo-dark/${s?"":n.meta.did}`)}${t(n,i)}`,$=`${L(a,`/blocklet/logo-rect/${s?"":n.meta.did}`)}${t(n,_??r)}`,K=`${L(a,`/blocklet/logo-rect-dark/${s?"":n.meta.did}`)}${t(n,E??i)}`,B=`${L(a,`/blocklet/logo-favicon/${s?"":n.meta.did}`)}${t(n,O??r)}`,g=`${L(a,`/blocklet/splash/portrait/${s?"":n.meta.did}`)}${t(n,d)}`,v=`${L(a,`/blocklet/splash/landscape/${s?"":n.meta.did}`)}${t(n,m)}`,P=`${L(a,`/blocklet/og-image/${s?"":n.meta.did}`)}${t(n,C)}`;return{logoUrl:A,logoDarkUrl:c,rectLogoUrl:$,rectLogoDarkUrl:K,faviconUrl:B,splashPortraitUrl:g,splashLandscapeUrl:v,ogImageUrl:P}}export{f as u};
|