@abtnode/webapp 1.17.4 → 1.17.5-beta-20251208-123021-e8c53f96
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-AIDIzsfb.js → AdapterDayjs-D92-n47b.js} +1 -1
- package/dist/assets/{Add-l7OvfXrD.js → Add-Dv85KL5N.js} +1 -1
- package/dist/assets/ArrowDropDown-CPeg07nO.js +1 -0
- package/dist/assets/{Autocomplete-Bme-ElpV.js → Autocomplete-DVV2RD2A.js} +1 -1
- package/dist/assets/{Breadcrumbs-Bf0qzrkp.js → Breadcrumbs-C7NX6NEA.js} +1 -1
- package/dist/assets/{ButtonGroup-CMlvIctd.js → ButtonGroup-C6xSllEr.js} +1 -1
- package/dist/assets/{CSSTransition-Cf_KzaPo.js → CSSTransition-BnYuNWzI.js} +1 -1
- package/dist/assets/{CallMerge-DaaiIZ0e.js → CallMerge-DYEM4wZM.js} +1 -1
- package/dist/assets/{CardContent-gyrk9EIw.js → CardContent-cV0ZtLFb.js} +1 -1
- package/dist/assets/{ChevronLeft-OivB2aTv.js → ChevronLeft-DaNTS9Ry.js} +1 -1
- package/dist/assets/{ChevronRight-CV3PmYHH.js → ChevronRight-DMRng8w4.js} +1 -1
- package/dist/assets/{Clear-Cz6Yzx0g.js → Clear-DYWNGGPP.js} +1 -1
- package/dist/assets/{DeleteOutline-DmEDUBgP.js → DeleteOutline-C9hdvFLW.js} +1 -1
- package/dist/assets/{Done-BuJjZzMV.js → Done-CEq9fQ91.js} +1 -1
- package/dist/assets/{Edit-HxzEBQ9h.js → Edit-T_ynXw3J.js} +1 -1
- package/dist/assets/{ErrorOutline-CUOja7My.js → ErrorOutline-CQZdYJL-.js} +1 -1
- package/dist/assets/{FilterList-xUYmSJ-Y.js → FilterList-C0g86vDh.js} +1 -1
- package/dist/assets/{Google-cG0hx3oK.js → Google-sh3pICro.js} +1 -1
- package/dist/assets/{HelpOutline-DapRasSH.js → HelpOutline-CDfUVKlB.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-9mIUY7eq.js → KeyboardArrowDown-BCCwKNMP.js} +1 -1
- package/dist/assets/{Launch-DITLracb.js → Launch-Cy-Ri5E0.js} +1 -1
- package/dist/assets/{Link-DGt16osR.js → Link-LRqXezP_.js} +1 -1
- package/dist/assets/{ListItemButton-Cs40YHcx.js → ListItemButton-D_BFfEfg.js} +1 -1
- package/dist/assets/{ListSubheader-l4UAKUMT.js → ListSubheader-DVUYAhXC.js} +1 -1
- package/dist/assets/{LoadingButton-D6uT1qbm.js → LoadingButton--tsix-yw.js} +1 -1
- package/dist/assets/{MoreVert-BUlWqUnK.js → MoreVert-D2cSYolp.js} +1 -1
- package/dist/assets/{OpenInNew-CCi7ydva.js → OpenInNew-KWw6IL4k.js} +1 -1
- package/dist/assets/{Refresh-CGgBW-me.js → Refresh-DWTzO6Zf.js} +1 -1
- package/dist/assets/{Search-3L2yy5pr.js → Search-soT1P5WL.js} +1 -1
- package/dist/assets/{Stepper-D4Zig93k.js → Stepper-CO2wnCjY.js} +1 -1
- package/dist/assets/{Switch-B-AVsYNw.js → Switch-CYCG_kxE.js} +1 -1
- package/dist/assets/{TableSearch-CAaRXXpO.js → TableSearch-BJJrOkE2.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-uvIn6Jyh.js → ToggleButtonGroup-Dl-zl-V4.js} +1 -1
- package/dist/assets/{UnfoldMore-DcBVcc2h.js → UnfoldMore-XLA7xpTo.js} +1 -1
- package/dist/assets/{Verified-BpzZH8QJ.js → Verified-Blm2AEgo.js} +1 -1
- package/dist/assets/{VerifiedUser-B-ONuNVC.js → VerifiedUser-DitkeanA.js} +1 -1
- package/dist/assets/{ViewList-CvnWfuPG.js → ViewList-dS2IrLuW.js} +1 -1
- package/dist/assets/{_createAggregator-CqUOxBsA.js → _createAggregator-CQmKIqh9.js} +1 -1
- package/dist/assets/{actions-Dv4j7XcE.js → actions-C_YtyiJN.js} +1 -1
- package/dist/assets/{actions-DVOuh-Fv.js → actions-CqTr_UpD.js} +1 -1
- package/dist/assets/{agreement-ttzsGTtZ.js → agreement-CB8zAClF.js} +1 -1
- package/dist/assets/api-gDzILycU.js +1 -0
- package/dist/assets/{appearance-BoEskUU3.js → appearance-CvBqnNxC.js} +1 -1
- package/dist/assets/{audit-logs-BjJ1_rVq.js → audit-logs-DG20CWcK.js} +1 -1
- package/dist/assets/{base-chart-AQkuFrPC.js → base-chart-hRqEcUf1.js} +1 -1
- package/dist/assets/{blocklet-D2MB-zOx.js → blocklet-4xcBoALi.js} +1 -1
- package/dist/assets/{chain-l1zX37z1.js → chain-4NohS0Y9.js} +1 -1
- package/dist/assets/{click-to-copy-D16LYOaz.js → click-to-copy-Xg1hTHwq.js} +1 -1
- package/dist/assets/cloneDeep-o7Kp18y-.js +1 -0
- package/dist/assets/{collapse-DjVUQHBf.js → collapse-CvIW0hIW.js} +1 -1
- package/dist/assets/{config-navigation-D5cL0ut2.js → config-navigation-BHLHrDuf.js} +3 -3
- package/dist/assets/{connect-to-MJFTP0S_.js → connect-to-BzOsNzCo.js} +1 -1
- package/dist/assets/{cssMode-Fsxj3561.js → cssMode-CtAuRBnQ.js} +1 -1
- package/dist/assets/{delete-confirm-xUATcCih.js → delete-confirm-CmK028cX.js} +1 -1
- package/dist/assets/{depsEqual-BNz3Z5UN.js → depsEqual-D4SkOvpW.js} +1 -1
- package/dist/assets/{detail-cazmKFj_.js → detail-39U2ZB1M.js} +3 -3
- package/dist/assets/{domains-vCwCURM3.js → domains-D2j6_7aU.js} +1 -1
- package/dist/assets/{download-O9kMYIC6.js → download-fdrmqknu.js} +1 -1
- package/dist/assets/{edit.svg-B0aHUSZw.js → edit.svg-BCm3ag4u.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-B1_0wYNC.js +1 -0
- package/dist/assets/engine-D2zNg6-2.js +1 -0
- package/dist/assets/{freemarker2-DajhvZDQ.js → freemarker2-CTfgMDhs.js} +1 -1
- package/dist/assets/{get-safe-url-B_yWzv49.js → get-safe-url-nXPF2sGJ.js} +1 -1
- package/dist/assets/getValidReactChildren-CIqQKAkN.js +1 -0
- package/dist/assets/{graphqlMode-DQTpyvXV.js → graphqlMode-B6W6zwCs.js} +2 -2
- package/dist/assets/{handlebars-CFycpwy_.js → handlebars-DOdON862.js} +1 -1
- package/dist/assets/{html-fOaqMnCB.js → html-DEp9zO-t.js} +1 -1
- package/dist/assets/{html-title-xzTyg8m0.js → html-title-D-skaBwb.js} +1 -1
- package/dist/assets/{htmlMode-DwojGB9N.js → htmlMode-BsvwfKqY.js} +1 -1
- package/dist/assets/{iframe-DhbAf7eB.js → iframe-DyfK1MII.js} +1 -1
- package/dist/assets/{index-Bvn9twlG.js → index-3WfGtOlv.js} +1 -1
- package/dist/assets/{index-XgkYfld7.js → index-AqKhw9Wu.js} +3 -3
- package/dist/assets/{index-CEPQQlo6.js → index-B1omHpBR.js} +1 -1
- package/dist/assets/{index-DvBW_mZc.js → index-B9vFJyc6.js} +1 -1
- package/dist/assets/{index-yORTeDE5.js → index-BAeHHGc5.js} +1 -1
- package/dist/assets/{index-Cacyj92F.js → index-BFwfrWj_.js} +1 -1
- package/dist/assets/{index-kFk_mggT.js → index-BHRDAZr5.js} +1 -1
- package/dist/assets/{index-CprJrzzj.js → index-BKYNnQgG.js} +1 -1
- package/dist/assets/{index-jIRER_d6.js → index-BR2CcckZ.js} +1 -1
- package/dist/assets/{index-CBrQ9aZ7.js → index-Beqyq0Xy.js} +1 -1
- package/dist/assets/{index-CGtaecKe.js → index-Bmeli3vt.js} +1 -1
- package/dist/assets/{index-DBOqxRpP.js → index-BoBukMl6.js} +1 -1
- package/dist/assets/{index-B-V1EiVF.js → index-Boc_ElPU.js} +1 -1
- package/dist/assets/{index-DcXoiIcd.js → index-Bpl7ZPdw.js} +1 -1
- package/dist/assets/{index-BCEB7zAW.js → index-BqOHFDpP.js} +1 -1
- package/dist/assets/{index-BACYRg7R.js → index-BsFiddFP.js} +9 -9
- package/dist/assets/{index-KR6tqxjN.js → index-Bzt3kp1o.js} +1 -1
- package/dist/assets/{index-BhmdgQ6h.js → index-C1FfiSCs.js} +1 -1
- package/dist/assets/{index-iLcm3xJO.js → index-C3owZL72.js} +1 -1
- package/dist/assets/{index-BlnAC-LC.js → index-C9N-dK-U.js} +1 -1
- package/dist/assets/{index-BzMgQhvT.js → index-CAfX9jEw.js} +1 -1
- package/dist/assets/{index-DkBdKcP-.js → index-CB9i2iit.js} +1 -1
- package/dist/assets/{index-BI2RNyn2.js → index-CEA-JNUf.js} +1 -1
- package/dist/assets/{index-BbWPK5o6.js → index-CFPB3xkO.js} +1 -1
- package/dist/assets/{index-BsntE0No.js → index-CJ-WZj-1.js} +1 -1
- package/dist/assets/{index-Cl5G4tna.js → index-CO1fNIoe.js} +3 -3
- package/dist/assets/{index-i28M3WTw.js → index-CSmLj9hN.js} +1 -1
- package/dist/assets/{index-4yUut_bV.js → index-CVvQ2yKp.js} +1 -1
- package/dist/assets/index-CpC6KyFR.js +1 -0
- package/dist/assets/{index-CO0vAndr.js → index-D0Nij003.js} +1 -1
- package/dist/assets/{index-CPLXcmCK.js → index-D9OyVcfq.js} +3 -3
- package/dist/assets/{index-BFqAcspj.js → index-DCo3tzgk.js} +2 -2
- package/dist/assets/{index-hu34K3US.js → index-DIdPY5JS.js} +1 -1
- package/dist/assets/{index-BZw-IddS.js → index-DLm3d5Lz.js} +1 -1
- package/dist/assets/{index-CCv_8omK.js → index-DaEjX2SO.js} +5 -5
- package/dist/assets/{index-DeYmBhXX.js → index-DeOpdMmq.js} +1 -1
- package/dist/assets/{index-BddlETK4.js → index-DfJQllIT.js} +1 -1
- package/dist/assets/{index-B_8MhQGp.js → index-DikEqQbY.js} +3 -3
- package/dist/assets/{index-BftkyDmu.js → index-DrkFgZdM.js} +1 -1
- package/dist/assets/{index-g_RqxcM4.js → index-DyCZ__uc.js} +1 -1
- package/dist/assets/{index-BEOeUot7.js → index-JD_f3m8u.js} +1 -1
- package/dist/assets/{index-COT6fHf0.js → index-RqR7C4_G.js} +1 -1
- package/dist/assets/{index-aZqjDrOh.js → index-T2sa7QI9.js} +1 -1
- package/dist/assets/{index-4-FW3N_0.js → index-Uf4kWlzq.js} +1 -1
- package/dist/assets/{index-gqKcev8E.js → index-ZtBV9VDq.js} +1 -1
- package/dist/assets/{index-0EXUatvL.js → index-xhxy4seW.js} +1 -1
- package/dist/assets/{index.esm-Bsyk9Gld.js → index.esm-Di7pxRR7.js} +1 -1
- package/dist/assets/{install-from-url-4VtQ9_35.js → install-from-url-BYJQqH88.js} +1 -1
- package/dist/assets/{invitation-B5QYli1h.js → invitation-DhpFShM_.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-RoIvuAJE.js → is-path-prefix-equal-jo7g0Qmd.js} +1 -1
- package/dist/assets/{item-CjFxs-Zt.js → item-D6K3xZvf.js} +1 -1
- package/dist/assets/{javascript-luLw15rJ.js → javascript-DcFlp6iK.js} +1 -1
- package/dist/assets/{jsonMode-Cxdqt0IL.js → jsonMode-RPWtRIbN.js} +1 -1
- package/dist/assets/{liquid-D1qp1ZF3.js → liquid-Dd2yvvP7.js} +1 -1
- package/dist/assets/{list-header-D-U957cP.js → list-header-BEqD50lj.js} +1 -1
- package/dist/assets/{lock.svg-Dz9J-uBq.js → lock.svg-CqbkAjfs.js} +1 -1
- package/dist/assets/{log--2ZY9nHz.js → log-CJyQvDex.js} +1 -1
- package/dist/assets/{lottie-react.esm-C6caiayN.js → lottie-react.esm-CkMUkUNW.js} +1 -1
- package/dist/assets/{mdx-Dzy-X9qt.js → mdx-BD-ePdgm.js} +1 -1
- package/dist/assets/{memory-r4Kexlry.js → memory-C2g1lVx4.js} +1 -1
- package/dist/assets/{metric-BTKuNvY9.js → metric-Ce6h_fps.js} +1 -1
- package/dist/assets/omit-dFmEevUc.js +1 -0
- package/dist/assets/{overview-CFHOUNfH.js → overview-DIJq7smI.js} +1 -1
- package/dist/assets/{permission-RtK6f5af.js → permission-DHDlX-2p.js} +1 -1
- package/dist/assets/{preference-C7Ge_XOi.js → preference-BFNujwfR.js} +3 -3
- package/dist/assets/{python-hpNfnPxJ.js → python-CSfuDNWh.js} +1 -1
- package/dist/assets/{raf-schd.esm-rR8pKw9W.js → raf-schd.esm-C7cnOwIv.js} +1 -1
- package/dist/assets/{razor-BI0kEBq5.js → razor-PrxsK0Yf.js} +1 -1
- package/dist/assets/{rotate-session-key-B6NXbgEc.js → rotate-session-key-DlCO0JRQ.js} +1 -1
- package/dist/assets/{runtime-CVAdQ8wh.js → runtime-DGTHh6A9.js} +1 -1
- package/dist/assets/schema-CEPuPgwv.js +1 -0
- package/dist/assets/sdk-D8tCPukn.js +1 -0
- package/dist/assets/{service-Cy6pWzv_.js → service-Bh0rr8zW.js} +1 -1
- package/dist/assets/{shorten-label-CvhqR616.js → shorten-label-BS4FNgmI.js} +1 -1
- package/dist/assets/{simple-select-Dqs9YolY.js → simple-select-Dkbl-a1m.js} +1 -1
- package/dist/assets/{spaces-Dif7Qa2a.js → spaces-BTKqW9YY.js} +1 -1
- package/dist/assets/{status-DIqT0--1.js → status-DTDPbaoZ.js} +1 -1
- package/dist/assets/{status-Dcx3B-gc.js → status-Dgr7tZJl.js} +1 -1
- package/dist/assets/{switch-control-BLvkR0UT.js → switch-control-bRPrVj4O.js} +1 -1
- package/dist/assets/{table-icons-DHCKcouf.js → table-icons-DaKDKKxZ.js} +1 -1
- package/dist/assets/{team-BV9bl_r7.js → team-DdhNY9E2.js} +1 -1
- package/dist/assets/{toLower-CL0ukT8_.js → toLower-DC-Tk5Hb.js} +1 -1
- package/dist/assets/toUpper-DglD32bj.js +1 -0
- package/dist/assets/{traffic-DrN7qkrg.js → traffic-9tAQAbVA.js} +1 -1
- package/dist/assets/{tsMode-Bqd_EuMj.js → tsMode-B19hnwr8.js} +1 -1
- package/dist/assets/{typescript-BVOjm5kD.js → typescript-C9cjacUF.js} +1 -1
- package/dist/assets/{url-evaluation-B5iexDQo.js → url-evaluation-Dm_mNoMs.js} +1 -1
- package/dist/assets/{url-join-DGMfgD17.js → url-join-BgacTiZS.js} +1 -1
- package/dist/assets/{use-mobile-DvM8SqYH.js → use-mobile-CWB6Jtv1.js} +1 -1
- package/dist/assets/{use-mobile-DyKd7giP.js → use-mobile-D6E5km4P.js} +1 -1
- package/dist/assets/{useAsync-DRXRxEMN.js → useAsync-CyivJzD4.js} +1 -1
- package/dist/assets/{useAsyncRetry-l2Si2r3C.js → useAsyncRetry-BDLoOcvn.js} +1 -1
- package/dist/assets/{useLocalStorage-CbBU4OS9.js → useLocalStorage-Df3_jlsm.js} +1 -1
- package/dist/assets/{useThemeProps-CRd6upHX.js → useThemeProps-R3T9xrvH.js} +1 -1
- package/dist/assets/{util-CziUIk8v.js → util-BDvErAjW.js} +1 -1
- package/dist/assets/{wait-container-CCe_xsZw.js → wait-container-B1wIefva.js} +1 -1
- package/dist/assets/{without-wallet-DcI5W8cf.js → without-wallet-DQfnDo2u.js} +1 -1
- package/dist/assets/wrap-locale-l_P1jXYo.js +1 -0
- package/dist/assets/{xml-86YzaLiM.js → xml-a8bUYHho.js} +1 -1
- package/dist/assets/{yaml-hqPmcqsD.js → yaml-Cp0Ib5KC.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-Br_oPfQI.js +0 -1
- package/dist/assets/api-CWyPHkC_.js +0 -1
- package/dist/assets/cloneDeep-BOd1J0Sv.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-CdT-VIlA.js +0 -1
- package/dist/assets/engine-7ix2eBzw.js +0 -1
- package/dist/assets/getValidReactChildren-BQH98pcn.js +0 -1
- package/dist/assets/index-BiAAgnpw.js +0 -1
- package/dist/assets/omit-BwCXmJ0x.js +0 -1
- package/dist/assets/schema-Dsc1QRMh.js +0 -1
- package/dist/assets/sdk-BJ8ul4G_.js +0 -1
- package/dist/assets/toUpper-CcZcHFDe.js +0 -1
- package/dist/assets/wrap-locale-B1uKF2jP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as g,bn as v,u as y,j as r,P as f,S as x,R as h}from"./index-
|
|
1
|
+
import{A as g,bn as v,u as y,j as r,P as f,S as x,R as h}from"./index-DaEjX2SO.js";import{L as S,D as j}from"./download-fdrmqknu.js";import{u as L}from"./useLocalStorage-Df3_jlsm.js";import"./ButtonGroup-C6xSllEr.js";import"./getValidReactChildren-CIqQKAkN.js";function I(){const c=g(),[s,i]=L("server-logs-filter",{name:"abtnode",type:{abtnode:"error"}}),{name:t=s.name}=v(),{info:l}=y(),n=l.routing.provider,a=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(n){const e=`Service Gateway(${n})`;a.push({id:`service-gateway-${n}`,name:e,types:["error","access","security"]})}const d=e=>{i({...s,name:e.target.value}),c(`/logs/${e.target.value}`)},m=r.jsx(f,{sx:{minWidth:240},children:r.jsx(x,{value:t,onChange:d,size:"small",children:a.map(e=>r.jsx(h,{value:e.id,children:e.name},e.id))})}),o=a.find(e=>e.id===t)||a[0],p=o.types.indexOf(s.type[t]||"error"),u=e=>{i({name:t,type:{...s.type,[t]:e}})};return r.jsx(S,{name:o.name,logId:o.id,types:o.types,prepend:m,postpend:r.jsx(j,{id:l.did,name:"blocklet-server"}),defaultTypeIndex:p,onTypeChange:u},o.id)}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ct as u,r as o,p as x,cu as r,B as g,j as s,K as m,cv as d}from"./index-
|
|
1
|
+
import{ct as u,r as o,p as x,cu as r,B as g,j as s,K as m,cv as d}from"./index-DaEjX2SO.js";function P(){const i=u(),{blocklets:c,refresh:l}=i,{t:p}=o.useContext(x),y=r.generateKey(),[a]=g();return o.useEffect(()=>{const n=r.getNotificationQueryParams(y)??{},t=a.get("entityId"),e=a.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:p("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:i,filterType:"entity",type:"server"})]})}export{P as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as je,j as e,u as Q,r as h,e as $e,aG as Wr,aH as _,aI as ln,aJ as Vn,aK as qr,aL as cn,aM as rt,V as M,ad as le,s as re,aN as dn,o as f,aO as Hr,aP as un,aQ as Gr,H as te,M as mn,T as L,t as H,O as fe,aR as Ae,C as K,X as be,v as Z,aS as Xn,Y as pe,K as W,p as mt,aT as Kr,R as V,aE as Ie,a9 as et,N as it,aU as Yr,d as Ht,aV as Oe,aW as me,aa as Vr,aX as Xr,aY as Qr,y as Zr,A as Qn,W as fn,g as pn,h as ne,aZ as Gt,a as At,b as ft,a_ as Zn,a$ as Jn,U as er,a4 as It,b0 as Jr,b1 as ei,b2 as ti,b3 as ni,b4 as ot,i as gn,b5 as ri,b6 as ii,a6 as kt,b7 as oi,a7 as Lt,L as Kt,I as ai,b8 as si,b9 as tr,a8 as li,ba as nr,bb as De,bc as Re,bd as ci,be as Yt,bf as di,$ as rr,D as Ot,f as ir,bg as ui,bh as hn,ak as mi,bi as fi,bj as ee,bk as pi,S as xn,l as yn,m as bn,bl as gi,bm as hi,bn as xi}from"./index-
|
|
1
|
+
import{aF as je,j as e,u as Q,r as h,e as $e,aG as Wr,aH as _,aI as ln,aJ as Vn,aK as qr,aL as cn,aM as rt,V as M,ad as le,s as re,aN as dn,o as f,aO as Hr,aP as un,aQ as Gr,H as te,M as mn,T as L,t as H,O as fe,aR as Ae,C as K,X as be,v as Z,aS as Xn,Y as pe,K as W,p as mt,aT as Kr,R as V,aE as Ie,a9 as et,N as it,aU as Yr,d as Ht,aV as Oe,aW as me,aa as Vr,aX as Xr,aY as Qr,y as Zr,A as Qn,W as fn,g as pn,h as ne,aZ as Gt,a as At,b as ft,a_ as Zn,a$ as Jn,U as er,a4 as It,b0 as Jr,b1 as ei,b2 as ti,b3 as ni,b4 as ot,i as gn,b5 as ri,b6 as ii,a6 as kt,b7 as oi,a7 as Lt,L as Kt,I as ai,b8 as si,b9 as tr,a8 as li,ba as nr,bb as De,bc as Re,bd as ci,be as Yt,bf as di,$ as rr,D as Ot,f as ir,bg as ui,bh as hn,ak as mi,bi as fi,bj as ee,bk as pi,S as xn,l as yn,m as bn,bl as gi,bm as hi,bn as xi}from"./index-DaEjX2SO.js";import{u as yi,T as bi}from"./html-title-D-skaBwb.js";import{A as vi}from"./ArrowDropDown-CPeg07nO.js";import{u as Vt,C as B,a as vn}from"./index.esm-Di7pxRR7.js";import{S as se}from"./switch-control-bRPrVj4O.js";import{P as ie}from"./permission-DHDlX-2p.js";import{H as or,g as ji}from"./index-Uf4kWlzq.js";import{A as ar}from"./Link-LRqXezP_.js";import{A as wi}from"./actions-C_YtyiJN.js";import{S as Ci}from"./Switch-CYCG_kxE.js";import{D as ve,R as sr,a as Ft,b as Si}from"./url-evaluation-Dm_mNoMs.js";import{D as pt}from"./delete-confirm-CmK028cX.js";import{v as at}from"./index-BqOHFDpP.js";import{s as ki}from"./logo-BKA11TRi.js";import{u as Di}from"./useLocalStorage-Df3_jlsm.js";import{R as Ri}from"./Refresh-DWTzO6Zf.js";import{L as Ti}from"./LoadingButton--tsix-yw.js";import{C as Ei,R as Pi,P as lr,S as _i}from"./rotate-session-key-DlCO0JRQ.js";import{A as Fe}from"./Add-Dv85KL5N.js";import{B as cr,D as jn,W as Ke}from"./status-Dgr7tZJl.js";import{i as Ai}from"./is-path-prefix-equal-jo7g0Qmd.js";import{N as Ii}from"./ChevronRight-DMRng8w4.js";import{I as Li}from"./MoreVert-D2cSYolp.js";import{E as dr}from"./Edit-T_ynXw3J.js";import{A as Oi}from"./CallMerge-DYEM4wZM.js";import{C as Fi}from"./CardContent-cV0ZtLFb.js";import"./FilterList-C0g86vDh.js";import"./CSSTransition-BnYuNWzI.js";import"./emotion-cache.browser.esm-B1_0wYNC.js";import"./index-DIdPY5JS.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-D4SkOvpW.js";import"./index-CB9i2iit.js";import"./TableSearch-BJJrOkE2.js";import"./Search-soT1P5WL.js";import"./Clear-DYWNGGPP.js";import"./click-to-copy-Xg1hTHwq.js";import"./visuallyHidden-Dan1xhjv.js";const Ni=je(e.jsx("path",{d:"m7 14 5-5 5 5z"})),$i=je(e.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"})),Ui=je(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),ur=je(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),zi=je(e.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),Mi=je(e.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),Bi=je(e.jsx("path",{d:"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z"})),ye="Dashboard",mr=h.createContext({}),{Provider:Wi,Consumer:fs}=mr,wn=[ye,_.DOMAIN_FOR_IP_SITE,_.DOMAIN_FOR_IP_SITE_REGEXP],qi=(t,r)=>{if(t.name===_.DOMAIN_FOR_DEFAULT_SITE)return-1;if(r.name===_.DOMAIN_FOR_DEFAULT_SITE)return 1;const n=wn.includes(t.name),i=wn.includes(r.name);return n&&i?cn(t.name,r.name):n?-1:i?1:cn(t.name,r.name)},Cn=({sites:t,nodePort:r})=>{const n=window.location.hostname,a=(t||[]).map(o=>{const{id:s,rules:d=[],corsAllowedOrigins:m=[]}=o;let{domain:c,domainAliases:u}=o;u=u||[],[_.DOMAIN_FOR_IP_SITE,_.DOMAIN_FOR_IP_SITE_REGEXP].includes(c)&&(c=ye,u.find(y=>y.value===n)||u.unshift({protected:!1,value:n}));const j={id:s,name:c,type:"domain",items:[],domainAliases:u,isProtected:o.isProtected,corsAllowedOrigins:m};return(d||[]).forEach(y=>{const{id:x,isProtected:D,from:{pathPrefix:b},to:k}=y;if(k.type===_.ROUTING_RULE_TYPES.BLOCKLET){let S="";Number.parseInt(k.port,10)===Number.parseInt(r,10)?(S="Blocklet Server Dashboard",k.type=_.ROUTING_RULE_TYPES.DAEMON):S=k.did,j.items.push({id:x,name:ln(b||"/"),title:S,type:"rule",isProtected:D,pathPrefix:b,to:k})}else j.items.push({id:x,pathPrefix:b,name:ln(b||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:D,to:k})}),j.items=Vn(j.items,y=>y.name),j}).sort(qi),l=a.reduce((o,s)=>{let{name:d}=s;return d.endsWith(_.BLOCKLET_SITE_GROUP_SUFFIX)&&([d]=d.split(".")),o[d]={...s,rules:s.items},o},{});return{sites:a,siteMap:l}},Hi=({did:t,domain:r,mountPoint:n,siteMap:i,params:a}={})=>{if(!i)return null;const l=i[t];if(!l)return null;const o=r||(l.domainAliases||[])[0];if(!o)return null;let s=n;if(!s){const d=l.rules.filter(m=>!m.name.startsWith(_.WELLKNOWN_PATH_PREFIX))[0];s=d?d.name:"/"}return rt(o.value,s,a)},Gi=({did:t,mountPoint:r,siteMap:n,params:i}={})=>{if(!n)return[];const a=n[t];if(!a)return[];const l=a.domainAliases||[];if(!l.length)return[];let o=r;if(!o){const s=a.rules.filter(d=>!d.name.startsWith(_.WELLKNOWN_PATH_PREFIX))[0];o=s?s.name:"/"}return l.map(s=>rt(s.value,o,i))},Ki=t=>{const r=t.map(i=>i.domain).filter(i=>![_.DOMAIN_FOR_IP_SITE_REGEXP,_.DOMAIN_FOR_DEFAULT_SITE].includes(i));let n=[];return t.forEach(i=>n.push(...i.domainAliases||[])),n=n.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:r,domainsAliases:n}};function Sn({children:t}){const{api:r,info:n}=Q(),[i,a]=h.useState([]),[l,o]=h.useState([]),[s,d]=h.useState([]),m=$e(async()=>{const{sites:P}=await r.getRoutingSites({input:{snapshotHash:""}}),g=P||[];await Promise.all(g.map(async C=>(C.domainAliases=await Wr(C.domainAliases,{getIP:qr}),C)));const p=Ki(g);a(g),o(p.domains);const v=Cn({sites:g,nodePort:n.port});d((v?.sites||[]).map(C=>C.domainAliases.map(F=>F.value)).filter(C=>C.length))},[n]),c=(P,g)=>{a(p=>p.map(v=>v.id===P?g.domain?g:{...g,domain:v.domain}:v))},u=P=>r.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),j=async P=>{const g=await r.addRoutingSite({input:P});a(i.concat(g.site))},y=async(P,g)=>{const p=await r.updateRoutingSite({input:{id:P,...g}});if(p.site&&p.site.id){const v=i.findIndex(C=>C.id===p.site.id);v!==-1&&(i.splice(v,1,p.site),a([].concat(i)))}},x=async P=>{await r.deleteRoutingSite({input:{id:P}}),a(i.filter(g=>g.id!==P))},D=async(P,g,p)=>{const v=await r.addDomainAlias({input:{id:P,domainAlias:g,force:p}});c(P,v.site)},b=async(P,g)=>{const p=await r.deleteDomainAlias({input:{id:P,domainAlias:g}});c(P,p.site)},k=async(P,g)=>{const{site:p}=await r.addRoutingRule({input:{id:P,rule:g}});c(P,p)},S=async(P,g)=>{const{site:p}=await r.updateRoutingRule({input:{id:P,rule:g}});c(P,p)},T=async(P,g)=>{const{site:p}=await r.deleteRoutingRule({input:{id:P,ruleId:g}});c(P,p)},w={loading:m.loading,error:m.error,refresh:m.retry,api:r,actions:{addSite:j,updateSite:y,deleteSite:x,addDomainAlias:D,deleteDomainAlias:b,takeSnapshot:u,addRule:k,updateRule:S,deleteRule:T}},{sites:R,siteMap:E}=Cn({sites:i,nodePort:n.port});return w.sites=R,w.siteMap=E,w.domains=l,w.allDomains=s,w.getBlockletUrl=({did:P,domain:g,mountPoint:p,params:v})=>Hi({did:P,domain:g,mountPoint:p,siteMap:w.siteMap,params:v}),w.getBlockletUrls=({did:P,mountPoint:g,params:p})=>Gi({did:P,mountPoint:g,siteMap:w.siteMap,params:p}),e.jsx(Wi,{value:{routing:w},children:t})}function de(){const{routing:t}=h.useContext(mr);return t}function Xt(t){const r=[_.DOMAIN_FOR_IP_SITE_REGEXP,_.DOMAIN_FOR_DEFAULT_SITE,_.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&r.push(window.location.hostname),r.includes(t)}function Yi(){return null}function fr({confirm:t=null}){const[r,n]=h.useState(null),{t:i}=M(),a=()=>{n(null)},l=async s=>{if(s){let d=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";d==="/"?dn.push(`${s.pathname}`):(d.endsWith("/")&&(d=d.substring(0,d.length-1)),dn.push(`${d}${s.pathname}`)),window.location.reload()}},o=(s,...d)=>{let m=typeof t=="function"?t(s,...d):t;return m?(typeof m=="string"&&(m={description:m}),n({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>l(s),onCancel:()=>a(),...m}),!1):!0};return e.jsxs(Vi,{children:[e.jsx(Yi,{message:o}),r&&e.jsx(le,{title:r.title,description:r.description,confirm:r.confirm,cancel:r.cancel,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}fr.propTypes={confirm:f.oneOfType([f.object,f.string,f.func])};const Vi=re.div`
|
|
2
2
|
margin-bottom: 24px;
|
|
3
3
|
.top-btns-alert {
|
|
4
4
|
@media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as P,fK as cl,c6 as _o,fL as ul,ft as Mo,fM as fl,cW as Lo,aF as ur,j as i,fN as dl,fO as pl,aT as Tt,fP as or,ez as Je,fQ as Qs,fR as ml,fS as hl,fT as gl,fU as bl,fV as yl,fW as Js,fX as xl,fY as to,fZ as vl,f_ as wl,f$ as Cl,g0 as Sl,eA as ro,g1 as ei,eB as jl,cJ as qn,eC as El,dF as Tl,g2 as Il,g3 as kl,V as Ie,bo as Be,aP as ut,g4 as ti,H as Me,Y as Ue,o as b,f as no,eO as ri,f5 as ni,n as xt,K as U,bZ as Pl,dL as Rl,bz as Dl,av as ft,g5 as oi,S as jr,bl as Er,g6 as si,a$ as Ol,$ as et,t as lt,b2 as Al,bB as qe,aV as Nt,E as oo,fe as _l,g7 as Ml,g8 as Ll,g9 as Nl,D as Lr,T as Pe,bh as so,a4 as rr,ga as Fl,X as Et,c0 as Vt,c1 as zt,cl as ii,dO as rt,e_ as ce,c3 as Bl,b9 as _e,de as Tr,d8 as ai,c4 as dt,c5 as Rt,R as kt,dK as li,db as Ul,gb as Nr,gc as ci,bE as it,bg as Ve,P as sr,bq as ui,Q as $n,at as fi,dH as ql,gd as Ir,bt as $l,au as ir,v as ze,C as bt,ge as Vl,h as Vn,aX as zl,w as Wl,x as Kl,s as He,p as fr,ad as dr,bF as Bt,gf as Hl,dG as Yl,dn as Gl,aH as gt,O as yt,dy as Zl,gg as Xl,eD as Ql,gh as di,gi as kr,gj as Jl,dI as ar,b as Se,W as io,dJ as ec,cw as pi,z as tc,bv as ao,bw as mi,bx as lo,dq as hr,aD as rc,fJ as hi,N as lr,aS as nc,gk as gi,aE as oc,a9 as sc,gl as ic,c_ as bi,gm as ac,bA as No,y as lc,gn as cc,bH as uc,U as fc,M as dc}from"./index-CCv_8omK.js";import{A as Ut}from"./Add-l7OvfXrD.js";import{V as pc}from"./ViewList-CvnWfuPG.js";import{c as mc,H as co,g as hc}from"./index-4-FW3N_0.js";import{v as Fo}from"./index-DcXoiIcd.js";import{u as Ye}from"./team-BV9bl_r7.js";import{u as yi}from"./blocklet-D2MB-zOx.js";import{S as xi}from"./Search-3L2yy5pr.js";import{y as Fr}from"./index-DkBdKcP-.js";import{u as gc,C as Zt}from"./index.esm-Bsyk9Gld.js";import{S as bc}from"./Google-cG0hx3oK.js";import{A as yc,a as gr}from"./Autocomplete-Bme-ElpV.js";import{U as xc}from"./UnfoldMore-DcBVcc2h.js";import{P as Pt}from"./permission-RtK6f5af.js";import{C as Br}from"./click-to-copy-D16LYOaz.js";import{s as vt,g as vc,S as wc,u as mt,a as vi,b as pr,c as wi,d as Ur,e as Ci,f as uo,P as Si,D as ji,h as Pr,M as tr,i as Ei,j as Bo,k as nr,v as Cc,l as Sc,m as Uo,n as jc,o as Ec,p as Tc,q as Ic,C as kc,r as Pc,t as Rr,w as Lt,x as Dr,y as qo,z as $o,A as Rc,T as Dc,B as fo,E as Oc,F as Ac,G as _c,H as Mc,I as Lc,J as Nc,K as Fc,L as br,N as Ft,O as Ti,Q as Bc,V as zn,R as Ii,U as Uc,W as Vo,X as qc,Y as $c,Z as Vc,_ as zc,$ as Wc,a0 as Kc}from"./AdapterDayjs-AIDIzsfb.js";import{u as nt}from"./useThemeProps-CRd6upHX.js";import{a as zo,b as Hc,t as Yc,T as Gc}from"./html-title-xzTyg8m0.js";import{v as Ge}from"./index-BCEB7zAW.js";import{V as Zc}from"./Verified-BpzZH8QJ.js";import{D as Xc}from"./DeleteOutline-DmEDUBgP.js";import{E as Wo}from"./ErrorOutline-CUOja7My.js";import{N as Qc}from"./index-g_RqxcM4.js";import{R as ki,a as Sr,D as Jc}from"./url-evaluation-B5iexDQo.js";import{b as Wn}from"./sdk-BJ8ul4G_.js";import{u as eu}from"./index-BZw-IddS.js";import{u as Pi}from"./use-mobile-DvM8SqYH.js";import{A as tu}from"./actions-Dv4j7XcE.js";import{S as ru}from"./shorten-label-CvhqR616.js";import{U as Gr}from"./ua-parser-DP5omx3I.js";const nu=mc(P.useLayoutEffect);var Ko={},Ho;function ou(){return Ho||(Ho=1,function(){if(typeof window!="object")return;if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype){"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});return}function e(d){try{return d.defaultView&&d.defaultView.frameElement||null}catch{return null}}var t=function(d){for(var p=d,y=e(p);y;)p=y.ownerDocument,y=e(p);return p}(window.document),r=[],n=null,o=null;function c(d){this.time=d.time,this.target=d.target,this.rootBounds=S(d.rootBounds),this.boundingClientRect=S(d.boundingClientRect),this.intersectionRect=S(d.intersectionRect||w()),this.isIntersecting=!!d.intersectionRect;var p=this.boundingClientRect,y=p.width*p.height,E=this.intersectionRect,C=E.width*E.height;y?this.intersectionRatio=Number((C/y).toFixed(4)):this.intersectionRatio=this.isIntersecting?1:0}function s(d,p){var y=p||{};if(typeof d!="function")throw new Error("callback must be a function");if(y.root&&y.root.nodeType!=1&&y.root.nodeType!=9)throw new Error("root must be a Document or Element");this._checkForIntersections=a(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=d,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(y.rootMargin),this.thresholds=this._initThresholds(y.threshold),this.root=y.root||null,this.rootMargin=this._rootMarginValues.map(function(E){return E.value+E.unit}).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}s.prototype.THROTTLE_TIMEOUT=100,s.prototype.POLL_INTERVAL=null,s.prototype.USE_MUTATION_OBSERVER=!0,s._setupCrossOriginUpdater=function(){return n||(n=function(d,p){!d||!p?o=w():o=j(d,p),r.forEach(function(y){y._checkForIntersections()})}),n},s._resetCrossOriginUpdater=function(){n=null,o=null},s.prototype.observe=function(d){var p=this._observationTargets.some(function(y){return y.element==d});if(!p){if(!(d&&d.nodeType==1))throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:d,entry:null}),this._monitorIntersections(d.ownerDocument),this._checkForIntersections()}},s.prototype.unobserve=function(d){this._observationTargets=this._observationTargets.filter(function(p){return p.element!=d}),this._unmonitorIntersections(d.ownerDocument),this._observationTargets.length==0&&this._unregisterInstance()},s.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},s.prototype.takeRecords=function(){var d=this._queuedEntries.slice();return this._queuedEntries=[],d},s.prototype._initThresholds=function(d){var p=d||[0];return Array.isArray(p)||(p=[p]),p.sort().filter(function(y,E,C){if(typeof y!="number"||isNaN(y)||y<0||y>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return y!==C[E-1]})},s.prototype._parseRootMargin=function(d){var p=d||"0px",y=p.split(/\s+/).map(function(E){var C=/^(-?\d*\.?\d+)(px|%)$/.exec(E);if(!C)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(C[1]),unit:C[2]}});return y[1]=y[1]||y[0],y[2]=y[2]||y[0],y[3]=y[3]||y[1],y},s.prototype._monitorIntersections=function(d){var p=d.defaultView;if(p&&this._monitoringDocuments.indexOf(d)==-1){var y=this._checkForIntersections,E=null,C=null;this.POLL_INTERVAL?E=p.setInterval(y,this.POLL_INTERVAL):(u(p,"resize",y,!0),u(d,"scroll",y,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in p&&(C=new p.MutationObserver(y),C.observe(d,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))),this._monitoringDocuments.push(d),this._monitoringUnsubscribes.push(function(){var D=d.defaultView;D&&(E&&D.clearInterval(E),f(D,"resize",y,!0)),f(d,"scroll",y,!0),C&&C.disconnect()});var T=this.root&&(this.root.ownerDocument||this.root)||t;if(d!=T){var I=e(d);I&&this._monitorIntersections(I.ownerDocument)}}},s.prototype._unmonitorIntersections=function(d){var p=this._monitoringDocuments.indexOf(d);if(p!=-1){var y=this.root&&(this.root.ownerDocument||this.root)||t,E=this._observationTargets.some(function(I){var D=I.element.ownerDocument;if(D==d)return!0;for(;D&&D!=y;){var N=e(D);if(D=N&&N.ownerDocument,D==d)return!0}return!1});if(!E){var C=this._monitoringUnsubscribes[p];if(this._monitoringDocuments.splice(p,1),this._monitoringUnsubscribes.splice(p,1),C(),d!=y){var T=e(d);T&&this._unmonitorIntersections(T.ownerDocument)}}}},s.prototype._unmonitorAllIntersections=function(){var d=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var p=0;p<d.length;p++)d[p]()},s.prototype._checkForIntersections=function(){if(!(!this.root&&n&&!o)){var d=this._rootIsInDom(),p=d?this._getRootRect():w();this._observationTargets.forEach(function(y){var E=y.element,C=v(E),T=this._rootContainsTarget(E),I=y.entry,D=d&&T&&this._computeTargetAndRootIntersection(E,C,p),N=null;this._rootContainsTarget(E)?(!n||this.root)&&(N=p):N=w();var B=y.entry=new c({time:l(),target:E,boundingClientRect:C,rootBounds:N,intersectionRect:D});I?d&&T?this._hasCrossedThreshold(I,B)&&this._queuedEntries.push(B):I&&I.isIntersecting&&this._queuedEntries.push(B):this._queuedEntries.push(B)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},s.prototype._computeTargetAndRootIntersection=function(d,p,y){if(window.getComputedStyle(d).display!="none"){for(var E=p,C=m(d),T=!1;!T&&C;){var I=null,D=C.nodeType==1?window.getComputedStyle(C):{};if(D.display=="none")return null;if(C==this.root||C.nodeType==9)if(T=!0,C==this.root||C==t)n&&!this.root?!o||o.width==0&&o.height==0?(C=null,I=null,E=null):I=o:I=y;else{var N=m(C),B=N&&v(N),W=N&&this._computeTargetAndRootIntersection(N,B,y);B&&W?(C=N,I=j(B,W)):(C=null,E=null)}else{var ne=C.ownerDocument;C!=ne.body&&C!=ne.documentElement&&D.overflow!="visible"&&(I=v(C))}if(I&&(E=h(I,E)),!E)break;C=C&&m(C)}return E}},s.prototype._getRootRect=function(){var d;if(this.root&&!g(this.root))d=v(this.root);else{var p=g(this.root)?this.root:t,y=p.documentElement,E=p.body;d={top:0,left:0,right:y.clientWidth||E.clientWidth,width:y.clientWidth||E.clientWidth,bottom:y.clientHeight||E.clientHeight,height:y.clientHeight||E.clientHeight}}return this._expandRectByRootMargin(d)},s.prototype._expandRectByRootMargin=function(d){var p=this._rootMarginValues.map(function(E,C){return E.unit=="px"?E.value:E.value*(C%2?d.width:d.height)/100}),y={top:d.top-p[0],right:d.right+p[1],bottom:d.bottom+p[2],left:d.left-p[3]};return y.width=y.right-y.left,y.height=y.bottom-y.top,y},s.prototype._hasCrossedThreshold=function(d,p){var y=d&&d.isIntersecting?d.intersectionRatio||0:-1,E=p.isIntersecting?p.intersectionRatio||0:-1;if(y!==E)for(var C=0;C<this.thresholds.length;C++){var T=this.thresholds[C];if(T==y||T==E||T<y!=T<E)return!0}},s.prototype._rootIsInDom=function(){return!this.root||x(t,this.root)},s.prototype._rootContainsTarget=function(d){var p=this.root&&(this.root.ownerDocument||this.root)||t;return x(p,d)&&(!this.root||p==d.ownerDocument)},s.prototype._registerInstance=function(){r.indexOf(this)<0&&r.push(this)},s.prototype._unregisterInstance=function(){var d=r.indexOf(this);d!=-1&&r.splice(d,1)};function l(){return window.performance&&performance.now&&performance.now()}function a(d,p){var y=null;return function(){y||(y=setTimeout(function(){d(),y=null},p))}}function u(d,p,y,E){typeof d.addEventListener=="function"?d.addEventListener(p,y,E):typeof d.attachEvent=="function"&&d.attachEvent("on"+p,y)}function f(d,p,y,E){typeof d.removeEventListener=="function"?d.removeEventListener(p,y,E):typeof d.detachEvent=="function"&&d.detachEvent("on"+p,y)}function h(d,p){var y=Math.max(d.top,p.top),E=Math.min(d.bottom,p.bottom),C=Math.max(d.left,p.left),T=Math.min(d.right,p.right),I=T-C,D=E-y;return I>=0&&D>=0&&{top:y,bottom:E,left:C,right:T,width:I,height:D}||null}function v(d){var p;try{p=d.getBoundingClientRect()}catch{}return p?(p.width&&p.height||(p={top:p.top,right:p.right,bottom:p.bottom,left:p.left,width:p.right-p.left,height:p.bottom-p.top}),p):w()}function w(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function S(d){return!d||"x"in d?d:{top:d.top,y:d.top,bottom:d.bottom,left:d.left,x:d.left,right:d.right,width:d.width,height:d.height}}function j(d,p){var y=p.top-d.top,E=p.left-d.left;return{top:y,left:E,height:p.height,width:p.width,bottom:y+p.height,right:E+p.width}}function x(d,p){for(var y=p;y;){if(y==d)return!0;y=m(y)}return!1}function m(d){var p=d.parentNode;return d.nodeType==9&&d!=t?e(d):(p&&p.assignedSlot&&(p=p.assignedSlot.parentNode),p&&p.nodeType==11&&p.host?p.host:p)}function g(d){return d&&d.nodeType===9}window.IntersectionObserver=s,window.IntersectionObserverEntry=c}()),Ko}ou();function su(e,t){var r={},n=r.callback,o=cl(r,["callback"]),c=_o(P.useState(),2),s=c[0],l=c[1],a=_o(P.useState(),2),u=a[0],f=a[1];return ul(function(){var h=Array.isArray(e)?e:[e],v=h.map(function(S){return Mo(S)}).filter(Boolean);if(v.length){var w=new IntersectionObserver(function(S){var j,x;try{for(var m=fl(S),g=m.next();!g.done;g=m.next()){var d=g.value;f(d.intersectionRatio),l(d.isIntersecting),n?.(d)}}catch(p){j={error:p}}finally{try{g&&!g.done&&(x=m.return)&&x.call(m)}finally{if(j)throw j.error}}},Lo(Lo({},o),{root:Mo(void 0)}));return v.forEach(function(S){return w.observe(S)}),function(){w.disconnect()}}},[void 0,void 0,n],e),[s,u]}const iu=ur(i.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),au=ur(i.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),qr=ur([i.jsx("path",{d:"m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42M13 20.01 4 11V4h7v-.01l9 9z"},"0"),i.jsx("circle",{cx:"6.5",cy:"6.5",r:"1.5"},"1")]),lu=ur(i.jsx("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"})),cu=ur(i.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"})),Ri=e=>P.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),P.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375}),P.createElement("rect",{x:15.3125,y:14.0625,width:7.5,height:1.875,rx:.9375,transform:"rotate(-90 15.3125 14.0625)"})),Di=e=>P.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})),Oi=e=>P.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),P.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375})),uu=e=>P.createElement("svg",{width:18,height:19,viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("g",{clipPath:"url(#clip0)"},P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})),P.createElement("defs",null,P.createElement("clipPath",{id:"clip0"},P.createElement("rect",{width:18,height:18,transform:"translate(0 0.5)"})))),Ai=e=>P.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10C3.25 6.27208 6.27208 3.25 10 3.25C13.7279 3.25 16.75 6.27208 16.75 10C16.75 13.7279 13.7279 16.75 10 16.75C6.27208 16.75 3.25 13.7279 3.25 10ZM10 1.75C5.44365 1.75 1.75 5.44365 1.75 10C1.75 14.5564 5.44365 18.25 10 18.25C14.5563 18.25 18.25 14.5564 18.25 10C18.25 5.44365 14.5563 1.75 10 1.75ZM8.03033 6.96967C7.73744 6.67678 7.26256 6.67678 6.96967 6.96967C6.67678 7.26256 6.67678 7.73744 6.96967 8.03033L11.9697 13.0303C12.2626 13.3232 12.7374 13.3232 13.0303 13.0303C13.3232 12.7374 13.3232 12.2626 13.0303 11.9697L8.03033 6.96967Z"}));var Zr={},Xr,Yo;function fu(){return Yo||(Yo=1,Xr=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),Xr}var Qr,Go;function du(){if(Go)return Qr;Go=1;var e="%[a-f0-9]{2}",t=new RegExp("("+e+")|([^%]+?)","gi"),r=new RegExp("("+e+")+","gi");function n(s,l){try{return[decodeURIComponent(s.join(""))]}catch{}if(s.length===1)return s;l=l||1;var a=s.slice(0,l),u=s.slice(l);return Array.prototype.concat.call([],n(a),n(u))}function o(s){try{return decodeURIComponent(s)}catch{for(var l=s.match(t)||[],a=1;a<l.length;a++)s=n(l,a).join(""),l=s.match(t)||[];return s}}function c(s){for(var l={"%FE%FF":"��","%FF%FE":"��"},a=r.exec(s);a;){try{l[a[0]]=decodeURIComponent(a[0])}catch{var u=o(a[0]);u!==a[0]&&(l[a[0]]=u)}a=r.exec(s)}l["%C2"]="�";for(var f=Object.keys(l),h=0;h<f.length;h++){var v=f[h];s=s.replace(new RegExp(v,"g"),l[v])}return s}return Qr=function(s){if(typeof s!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof s+"`");try{return s=s.replace(/\+/g," "),decodeURIComponent(s)}catch{return c(s)}},Qr}var Jr,Zo;function pu(){return Zo||(Zo=1,Jr=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]}),Jr}var en,Xo;function mu(){return Xo||(Xo=1,en=function(e,t){for(var r={},n=Object.keys(e),o=Array.isArray(t),c=0;c<n.length;c++){var s=n[c],l=e[s];(o?t.indexOf(s)!==-1:t(s,l,e))&&(r[s]=l)}return r}),en}var Qo;function hu(){return Qo||(Qo=1,function(e){const t=fu(),r=du(),n=pu(),o=mu(),c=m=>m==null;function s(m){switch(m.arrayFormat){case"index":return g=>(d,p)=>{const y=d.length;return p===void 0||m.skipNull&&p===null||m.skipEmptyString&&p===""?d:p===null?[...d,[u(g,m),"[",y,"]"].join("")]:[...d,[u(g,m),"[",u(y,m),"]=",u(p,m)].join("")]};case"bracket":return g=>(d,p)=>p===void 0||m.skipNull&&p===null||m.skipEmptyString&&p===""?d:p===null?[...d,[u(g,m),"[]"].join("")]:[...d,[u(g,m),"[]=",u(p,m)].join("")];case"comma":case"separator":return g=>(d,p)=>p==null||p.length===0?d:d.length===0?[[u(g,m),"=",u(p,m)].join("")]:[[d,u(p,m)].join(m.arrayFormatSeparator)];default:return g=>(d,p)=>p===void 0||m.skipNull&&p===null||m.skipEmptyString&&p===""?d:p===null?[...d,u(g,m)]:[...d,[u(g,m),"=",u(p,m)].join("")]}}function l(m){let g;switch(m.arrayFormat){case"index":return(d,p,y)=>{if(g=/\[(\d*)\]$/.exec(d),d=d.replace(/\[\d*\]$/,""),!g){y[d]=p;return}y[d]===void 0&&(y[d]={}),y[d][g[1]]=p};case"bracket":return(d,p,y)=>{if(g=/(\[\])$/.exec(d),d=d.replace(/\[\]$/,""),!g){y[d]=p;return}if(y[d]===void 0){y[d]=[p];return}y[d]=[].concat(y[d],p)};case"comma":case"separator":return(d,p,y)=>{const E=typeof p=="string"&&p.includes(m.arrayFormatSeparator),C=typeof p=="string"&&!E&&f(p,m).includes(m.arrayFormatSeparator);p=C?f(p,m):p;const T=E||C?p.split(m.arrayFormatSeparator).map(I=>f(I,m)):p===null?p:f(p,m);y[d]=T};default:return(d,p,y)=>{if(y[d]===void 0){y[d]=p;return}y[d]=[].concat(y[d],p)}}}function a(m){if(typeof m!="string"||m.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(m,g){return g.encode?g.strict?t(m):encodeURIComponent(m):m}function f(m,g){return g.decode?r(m):m}function h(m){return Array.isArray(m)?m.sort():typeof m=="object"?h(Object.keys(m)).sort((g,d)=>Number(g)-Number(d)).map(g=>m[g]):m}function v(m){const g=m.indexOf("#");return g!==-1&&(m=m.slice(0,g)),m}function w(m){let g="";const d=m.indexOf("#");return d!==-1&&(g=m.slice(d)),g}function S(m){m=v(m);const g=m.indexOf("?");return g===-1?"":m.slice(g+1)}function j(m,g){return g.parseNumbers&&!Number.isNaN(Number(m))&&typeof m=="string"&&m.trim()!==""?m=Number(m):g.parseBooleans&&m!==null&&(m.toLowerCase()==="true"||m.toLowerCase()==="false")&&(m=m.toLowerCase()==="true"),m}function x(m,g){g=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},g),a(g.arrayFormatSeparator);const d=l(g),p=Object.create(null);if(typeof m!="string"||(m=m.trim().replace(/^[?#&]/,""),!m))return p;for(const y of m.split("&")){if(y==="")continue;let[E,C]=n(g.decode?y.replace(/\+/g," "):y,"=");C=C===void 0?null:["comma","separator"].includes(g.arrayFormat)?C:f(C,g),d(f(E,g),C,p)}for(const y of Object.keys(p)){const E=p[y];if(typeof E=="object"&&E!==null)for(const C of Object.keys(E))E[C]=j(E[C],g);else p[y]=j(E,g)}return g.sort===!1?p:(g.sort===!0?Object.keys(p).sort():Object.keys(p).sort(g.sort)).reduce((y,E)=>{const C=p[E];return C&&typeof C=="object"&&!Array.isArray(C)?y[E]=h(C):y[E]=C,y},Object.create(null))}e.extract=S,e.parse=x,e.stringify=(m,g)=>{if(!m)return"";g=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},g),a(g.arrayFormatSeparator);const d=C=>g.skipNull&&c(m[C])||g.skipEmptyString&&m[C]==="",p=s(g),y={};for(const C of Object.keys(m))d(C)||(y[C]=m[C]);const E=Object.keys(y);return g.sort!==!1&&E.sort(g.sort),E.map(C=>{const T=m[C];return T===void 0?"":T===null?u(C,g):Array.isArray(T)?T.reduce(p(C),[]).join("&"):u(C,g)+"="+u(T,g)}).filter(C=>C.length>0).join("&")},e.parseUrl=(m,g)=>{g=Object.assign({decode:!0},g);const[d,p]=n(m,"#");return Object.assign({url:d.split("?")[0]||"",query:x(S(m),g)},g&&g.parseFragmentIdentifier&&p?{fragmentIdentifier:f(p,g)}:{})},e.stringifyUrl=(m,g)=>{g=Object.assign({encode:!0,strict:!0},g);const d=v(m.url).split("?")[0]||"",p=e.extract(m.url),y=e.parse(p,{sort:!1}),E=Object.assign(y,m.query);let C=e.stringify(E,g);C&&(C=`?${C}`);let T=w(m.url);return m.fragmentIdentifier&&(T=`#${u(m.fragmentIdentifier,g)}`),`${d}${C}${T}`},e.pick=(m,g,d)=>{d=Object.assign({parseFragmentIdentifier:!0},d);const{url:p,query:y,fragmentIdentifier:E}=e.parseUrl(m,d);return e.stringifyUrl({url:p,query:o(y,g),fragmentIdentifier:E},d)},e.exclude=(m,g,d)=>{const p=Array.isArray(g)?y=>!g.includes(y):(y,E)=>!g(y,E);return e.pick(m,p,d)}}(Zr)),Zr}var tn=hu();const Xt=dl,gu={parseNumbers:!1,parseBooleans:!1},bu={skipNull:!1,skipEmptyString:!1},yu=(e,t)=>{var r,n;const{navigateMode:o="push",parseOptions:c,stringifyOptions:s}={},l=Object.assign(Object.assign({},gu),c),a=Object.assign(Object.assign({},bu),s),u=Xt.useLocation(),f=(r=Xt.useHistory)===null||r===void 0?void 0:r.call(Xt),h=(n=Xt.useNavigate)===null||n===void 0?void 0:n.call(Xt),v=pl(),w=P.useRef(typeof e=="function"?e():e||{}),S=P.useMemo(()=>tn.parse(u.search,l),[u.search]),j=P.useMemo(()=>Object.assign(Object.assign({},w.current),S),[S]);return[j,Tt(m=>{const g=typeof m=="function"?m(j):m;v(),f&&f[o]({hash:u.hash,search:tn.stringify(Object.assign(Object.assign({},S),g),a)||"?"},u.state),h&&h({hash:u.hash,search:tn.stringify(Object.assign(Object.assign({},S),g),a)||"?"},{replace:o==="replace",state:u.state})})]};var jt={},Qt={},rn={exports:{}},nn={},Jo;function _i(){if(Jo)return nn;Jo=1;function e(g){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},e(g)}function t(g,d,p){return Object.defineProperty(g,"prototype",{writable:!1}),g}function r(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}function n(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(d&&d.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),d&&o(g,d)}function o(g,d){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,E){return y.__proto__=E,y},o(g,d)}function c(g){var d=a();return function(){var y=u(g),E;if(d){var C=u(this).constructor;E=Reflect.construct(y,arguments,C)}else E=y.apply(this,arguments);return s(this,E)}}function s(g,d){if(d&&(e(d)==="object"||typeof d=="function"))return d;if(d!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l(g)}function l(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function a(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u(g){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},u(g)}var f={},h,v;function w(g,d,p){p||(p=Error);function y(C,T,I){return typeof d=="string"?d:d(C,T,I)}var E=function(C){n(I,C);var T=c(I);function I(D,N,B){var W;return r(this,I),W=T.call(this,y(D,N,B)),W.code=g,W}return t(I)}(p);f[g]=E}function S(g,d){if(Array.isArray(g)){var p=g.length;return g=g.map(function(y){return String(y)}),p>2?"one of ".concat(d," ").concat(g.slice(0,p-1).join(", "),", or ")+g[p-1]:p===2?"one of ".concat(d," ").concat(g[0]," or ").concat(g[1]):"of ".concat(d," ").concat(g[0])}else return"of ".concat(d," ").concat(String(g))}function j(g,d,p){return g.substr(0,d.length)===d}function x(g,d,p){return(p===void 0||p>g.length)&&(p=g.length),g.substring(p-d.length,p)===d}function m(g,d,p){return typeof p!="number"&&(p=0),p+d.length>g.length?!1:g.indexOf(d,p)!==-1}return w("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),w("ERR_INVALID_ARG_TYPE",function(g,d,p){h===void 0&&(h=Kn()),h(typeof g=="string","'name' must be a string");var y;typeof d=="string"&&j(d,"not ")?(y="must not be",d=d.replace(/^not /,"")):y="must be";var E;if(x(g," argument"))E="The ".concat(g," ").concat(y," ").concat(S(d,"type"));else{var C=m(g,".")?"property":"argument";E='The "'.concat(g,'" ').concat(C," ").concat(y," ").concat(S(d,"type"))}return E+=". Received type ".concat(e(p)),E},TypeError),w("ERR_INVALID_ARG_VALUE",function(g,d){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";v===void 0&&(v=or());var y=v.inspect(d);return y.length>128&&(y="".concat(y.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(p,". Received ").concat(y)},TypeError),w("ERR_INVALID_RETURN_VALUE",function(g,d,p){var y;return p&&p.constructor&&p.constructor.name?y="instance of ".concat(p.constructor.name):y="type ".concat(e(p)),"Expected ".concat(g,' to be returned from the "').concat(d,'"')+" function but got ".concat(y,".")},TypeError),w("ERR_MISSING_ARGS",function(){for(var g=arguments.length,d=new Array(g),p=0;p<g;p++)d[p]=arguments[p];h===void 0&&(h=Kn()),h(d.length>0,"At least one arg needs to be specified");var y="The ",E=d.length;switch(d=d.map(function(C){return'"'.concat(C,'"')}),E){case 1:y+="".concat(d[0]," argument");break;case 2:y+="".concat(d[0]," and ").concat(d[1]," arguments");break;default:y+=d.slice(0,E-1).join(", "),y+=", and ".concat(d[E-1]," arguments");break}return"".concat(y," must be specified")},TypeError),nn.codes=f,nn}var on,es;function xu(){if(es)return on;es=1;function e(_,F){var G=Object.keys(_);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(_);F&&(H=H.filter(function(Q){return Object.getOwnPropertyDescriptor(_,Q).enumerable})),G.push.apply(G,H)}return G}function t(_){for(var F=1;F<arguments.length;F++){var G=arguments[F]!=null?arguments[F]:{};F%2?e(Object(G),!0).forEach(function(H){r(_,H,G[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(G)):e(Object(G)).forEach(function(H){Object.defineProperty(_,H,Object.getOwnPropertyDescriptor(G,H))})}return _}function r(_,F,G){return F=s(F),F in _?Object.defineProperty(_,F,{value:G,enumerable:!0,configurable:!0,writable:!0}):_[F]=G,_}function n(_,F){if(!(_ instanceof F))throw new TypeError("Cannot call a class as a function")}function o(_,F){for(var G=0;G<F.length;G++){var H=F[G];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(_,s(H.key),H)}}function c(_,F,G){return F&&o(_.prototype,F),Object.defineProperty(_,"prototype",{writable:!1}),_}function s(_){var F=l(_,"string");return g(F)==="symbol"?F:String(F)}function l(_,F){if(g(_)!=="object"||_===null)return _;var G=_[Symbol.toPrimitive];if(G!==void 0){var H=G.call(_,F);if(g(H)!=="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(_)}function a(_,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(F&&F.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),Object.defineProperty(_,"prototype",{writable:!1}),F&&x(_,F)}function u(_){var F=S();return function(){var H=m(_),Q;if(F){var A=m(this).constructor;Q=Reflect.construct(H,arguments,A)}else Q=H.apply(this,arguments);return f(this,Q)}}function f(_,F){if(F&&(g(F)==="object"||typeof F=="function"))return F;if(F!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h(_)}function h(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function v(_){var F=typeof Map=="function"?new Map:void 0;return v=function(H){if(H===null||!j(H))return H;if(typeof H!="function")throw new TypeError("Super expression must either be null or a function");if(typeof F<"u"){if(F.has(H))return F.get(H);F.set(H,Q)}function Q(){return w(H,arguments,m(this).constructor)}return Q.prototype=Object.create(H.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}}),x(Q,H)},v(_)}function w(_,F,G){return S()?w=Reflect.construct.bind():w=function(Q,A,R){var M=[null];M.push.apply(M,A);var z=Function.bind.apply(Q,M),L=new z;return R&&x(L,R.prototype),L},w.apply(null,arguments)}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function j(_){return Function.toString.call(_).indexOf("[native code]")!==-1}function x(_,F){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(H,Q){return H.__proto__=Q,H},x(_,F)}function m(_){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(G){return G.__proto__||Object.getPrototypeOf(G)},m(_)}function g(_){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},g(_)}var d=or(),p=d.inspect,y=_i(),E=y.codes.ERR_INVALID_ARG_TYPE;function C(_,F,G){return(G===void 0||G>_.length)&&(G=_.length),_.substring(G-F.length,G)===F}function T(_,F){if(F=Math.floor(F),_.length==0||F==0)return"";var G=_.length*F;for(F=Math.floor(Math.log(F)/Math.log(2));F;)_+=_,F--;return _+=_.substring(0,G-_.length),_}var I="",D="",N="",B="",W={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},ne=10;function te(_){var F=Object.keys(_),G=Object.create(Object.getPrototypeOf(_));return F.forEach(function(H){G[H]=_[H]}),Object.defineProperty(G,"message",{value:_.message}),G}function ge(_){return p(_,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Ce(_,F,G){var H="",Q="",A=0,R="",M=!1,z=ge(_),L=z.split(`
|
|
1
|
+
import{r as P,fK as cl,c6 as _o,fL as ul,ft as Mo,fM as fl,cW as Lo,aF as ur,j as i,fN as dl,fO as pl,aT as Tt,fP as or,ez as Je,fQ as Qs,fR as ml,fS as hl,fT as gl,fU as bl,fV as yl,fW as Js,fX as xl,fY as to,fZ as vl,f_ as wl,f$ as Cl,g0 as Sl,eA as ro,g1 as ei,eB as jl,cJ as qn,eC as El,dF as Tl,g2 as Il,g3 as kl,V as Ie,bo as Be,aP as ut,g4 as ti,H as Me,Y as Ue,o as b,f as no,eO as ri,f5 as ni,n as xt,K as U,bZ as Pl,dL as Rl,bz as Dl,av as ft,g5 as oi,S as jr,bl as Er,g6 as si,a$ as Ol,$ as et,t as lt,b2 as Al,bB as qe,aV as Nt,E as oo,fe as _l,g7 as Ml,g8 as Ll,g9 as Nl,D as Lr,T as Pe,bh as so,a4 as rr,ga as Fl,X as Et,c0 as Vt,c1 as zt,cl as ii,dO as rt,e_ as ce,c3 as Bl,b9 as _e,de as Tr,d8 as ai,c4 as dt,c5 as Rt,R as kt,dK as li,db as Ul,gb as Nr,gc as ci,bE as it,bg as Ve,P as sr,bq as ui,Q as $n,at as fi,dH as ql,gd as Ir,bt as $l,au as ir,v as ze,C as bt,ge as Vl,h as Vn,aX as zl,w as Wl,x as Kl,s as He,p as fr,ad as dr,bF as Bt,gf as Hl,dG as Yl,dn as Gl,aH as gt,O as yt,dy as Zl,gg as Xl,eD as Ql,gh as di,gi as kr,gj as Jl,dI as ar,b as Se,W as io,dJ as ec,cw as pi,z as tc,bv as ao,bw as mi,bx as lo,dq as hr,aD as rc,fJ as hi,N as lr,aS as nc,gk as gi,aE as oc,a9 as sc,gl as ic,c_ as bi,gm as ac,bA as No,y as lc,gn as cc,bH as uc,U as fc,M as dc}from"./index-DaEjX2SO.js";import{A as Ut}from"./Add-Dv85KL5N.js";import{V as pc}from"./ViewList-dS2IrLuW.js";import{c as mc,H as co,g as hc}from"./index-Uf4kWlzq.js";import{v as Fo}from"./index-Bpl7ZPdw.js";import{u as Ye}from"./team-DdhNY9E2.js";import{u as yi}from"./blocklet-4xcBoALi.js";import{S as xi}from"./Search-soT1P5WL.js";import{y as Fr}from"./index-CB9i2iit.js";import{u as gc,C as Zt}from"./index.esm-Di7pxRR7.js";import{S as bc}from"./Google-sh3pICro.js";import{A as yc,a as gr}from"./Autocomplete-DVV2RD2A.js";import{U as xc}from"./UnfoldMore-XLA7xpTo.js";import{P as Pt}from"./permission-DHDlX-2p.js";import{C as Br}from"./click-to-copy-Xg1hTHwq.js";import{s as vt,g as vc,S as wc,u as mt,a as vi,b as pr,c as wi,d as Ur,e as Ci,f as uo,P as Si,D as ji,h as Pr,M as tr,i as Ei,j as Bo,k as nr,v as Cc,l as Sc,m as Uo,n as jc,o as Ec,p as Tc,q as Ic,C as kc,r as Pc,t as Rr,w as Lt,x as Dr,y as qo,z as $o,A as Rc,T as Dc,B as fo,E as Oc,F as Ac,G as _c,H as Mc,I as Lc,J as Nc,K as Fc,L as br,N as Ft,O as Ti,Q as Bc,V as zn,R as Ii,U as Uc,W as Vo,X as qc,Y as $c,Z as Vc,_ as zc,$ as Wc,a0 as Kc}from"./AdapterDayjs-D92-n47b.js";import{u as nt}from"./useThemeProps-R3T9xrvH.js";import{a as zo,b as Hc,t as Yc,T as Gc}from"./html-title-D-skaBwb.js";import{v as Ge}from"./index-BqOHFDpP.js";import{V as Zc}from"./Verified-Blm2AEgo.js";import{D as Xc}from"./DeleteOutline-C9hdvFLW.js";import{E as Wo}from"./ErrorOutline-CQZdYJL-.js";import{N as Qc}from"./index-DyCZ__uc.js";import{R as ki,a as Sr,D as Jc}from"./url-evaluation-Dm_mNoMs.js";import{b as Wn}from"./sdk-D8tCPukn.js";import{u as eu}from"./index-DLm3d5Lz.js";import{u as Pi}from"./use-mobile-CWB6Jtv1.js";import{A as tu}from"./actions-C_YtyiJN.js";import{S as ru}from"./shorten-label-BS4FNgmI.js";import{U as Gr}from"./ua-parser-DP5omx3I.js";const nu=mc(P.useLayoutEffect);var Ko={},Ho;function ou(){return Ho||(Ho=1,function(){if(typeof window!="object")return;if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype){"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});return}function e(d){try{return d.defaultView&&d.defaultView.frameElement||null}catch{return null}}var t=function(d){for(var p=d,y=e(p);y;)p=y.ownerDocument,y=e(p);return p}(window.document),r=[],n=null,o=null;function c(d){this.time=d.time,this.target=d.target,this.rootBounds=S(d.rootBounds),this.boundingClientRect=S(d.boundingClientRect),this.intersectionRect=S(d.intersectionRect||w()),this.isIntersecting=!!d.intersectionRect;var p=this.boundingClientRect,y=p.width*p.height,E=this.intersectionRect,C=E.width*E.height;y?this.intersectionRatio=Number((C/y).toFixed(4)):this.intersectionRatio=this.isIntersecting?1:0}function s(d,p){var y=p||{};if(typeof d!="function")throw new Error("callback must be a function");if(y.root&&y.root.nodeType!=1&&y.root.nodeType!=9)throw new Error("root must be a Document or Element");this._checkForIntersections=a(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=d,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(y.rootMargin),this.thresholds=this._initThresholds(y.threshold),this.root=y.root||null,this.rootMargin=this._rootMarginValues.map(function(E){return E.value+E.unit}).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}s.prototype.THROTTLE_TIMEOUT=100,s.prototype.POLL_INTERVAL=null,s.prototype.USE_MUTATION_OBSERVER=!0,s._setupCrossOriginUpdater=function(){return n||(n=function(d,p){!d||!p?o=w():o=j(d,p),r.forEach(function(y){y._checkForIntersections()})}),n},s._resetCrossOriginUpdater=function(){n=null,o=null},s.prototype.observe=function(d){var p=this._observationTargets.some(function(y){return y.element==d});if(!p){if(!(d&&d.nodeType==1))throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:d,entry:null}),this._monitorIntersections(d.ownerDocument),this._checkForIntersections()}},s.prototype.unobserve=function(d){this._observationTargets=this._observationTargets.filter(function(p){return p.element!=d}),this._unmonitorIntersections(d.ownerDocument),this._observationTargets.length==0&&this._unregisterInstance()},s.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},s.prototype.takeRecords=function(){var d=this._queuedEntries.slice();return this._queuedEntries=[],d},s.prototype._initThresholds=function(d){var p=d||[0];return Array.isArray(p)||(p=[p]),p.sort().filter(function(y,E,C){if(typeof y!="number"||isNaN(y)||y<0||y>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return y!==C[E-1]})},s.prototype._parseRootMargin=function(d){var p=d||"0px",y=p.split(/\s+/).map(function(E){var C=/^(-?\d*\.?\d+)(px|%)$/.exec(E);if(!C)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(C[1]),unit:C[2]}});return y[1]=y[1]||y[0],y[2]=y[2]||y[0],y[3]=y[3]||y[1],y},s.prototype._monitorIntersections=function(d){var p=d.defaultView;if(p&&this._monitoringDocuments.indexOf(d)==-1){var y=this._checkForIntersections,E=null,C=null;this.POLL_INTERVAL?E=p.setInterval(y,this.POLL_INTERVAL):(u(p,"resize",y,!0),u(d,"scroll",y,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in p&&(C=new p.MutationObserver(y),C.observe(d,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))),this._monitoringDocuments.push(d),this._monitoringUnsubscribes.push(function(){var D=d.defaultView;D&&(E&&D.clearInterval(E),f(D,"resize",y,!0)),f(d,"scroll",y,!0),C&&C.disconnect()});var T=this.root&&(this.root.ownerDocument||this.root)||t;if(d!=T){var I=e(d);I&&this._monitorIntersections(I.ownerDocument)}}},s.prototype._unmonitorIntersections=function(d){var p=this._monitoringDocuments.indexOf(d);if(p!=-1){var y=this.root&&(this.root.ownerDocument||this.root)||t,E=this._observationTargets.some(function(I){var D=I.element.ownerDocument;if(D==d)return!0;for(;D&&D!=y;){var N=e(D);if(D=N&&N.ownerDocument,D==d)return!0}return!1});if(!E){var C=this._monitoringUnsubscribes[p];if(this._monitoringDocuments.splice(p,1),this._monitoringUnsubscribes.splice(p,1),C(),d!=y){var T=e(d);T&&this._unmonitorIntersections(T.ownerDocument)}}}},s.prototype._unmonitorAllIntersections=function(){var d=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var p=0;p<d.length;p++)d[p]()},s.prototype._checkForIntersections=function(){if(!(!this.root&&n&&!o)){var d=this._rootIsInDom(),p=d?this._getRootRect():w();this._observationTargets.forEach(function(y){var E=y.element,C=v(E),T=this._rootContainsTarget(E),I=y.entry,D=d&&T&&this._computeTargetAndRootIntersection(E,C,p),N=null;this._rootContainsTarget(E)?(!n||this.root)&&(N=p):N=w();var B=y.entry=new c({time:l(),target:E,boundingClientRect:C,rootBounds:N,intersectionRect:D});I?d&&T?this._hasCrossedThreshold(I,B)&&this._queuedEntries.push(B):I&&I.isIntersecting&&this._queuedEntries.push(B):this._queuedEntries.push(B)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},s.prototype._computeTargetAndRootIntersection=function(d,p,y){if(window.getComputedStyle(d).display!="none"){for(var E=p,C=m(d),T=!1;!T&&C;){var I=null,D=C.nodeType==1?window.getComputedStyle(C):{};if(D.display=="none")return null;if(C==this.root||C.nodeType==9)if(T=!0,C==this.root||C==t)n&&!this.root?!o||o.width==0&&o.height==0?(C=null,I=null,E=null):I=o:I=y;else{var N=m(C),B=N&&v(N),W=N&&this._computeTargetAndRootIntersection(N,B,y);B&&W?(C=N,I=j(B,W)):(C=null,E=null)}else{var ne=C.ownerDocument;C!=ne.body&&C!=ne.documentElement&&D.overflow!="visible"&&(I=v(C))}if(I&&(E=h(I,E)),!E)break;C=C&&m(C)}return E}},s.prototype._getRootRect=function(){var d;if(this.root&&!g(this.root))d=v(this.root);else{var p=g(this.root)?this.root:t,y=p.documentElement,E=p.body;d={top:0,left:0,right:y.clientWidth||E.clientWidth,width:y.clientWidth||E.clientWidth,bottom:y.clientHeight||E.clientHeight,height:y.clientHeight||E.clientHeight}}return this._expandRectByRootMargin(d)},s.prototype._expandRectByRootMargin=function(d){var p=this._rootMarginValues.map(function(E,C){return E.unit=="px"?E.value:E.value*(C%2?d.width:d.height)/100}),y={top:d.top-p[0],right:d.right+p[1],bottom:d.bottom+p[2],left:d.left-p[3]};return y.width=y.right-y.left,y.height=y.bottom-y.top,y},s.prototype._hasCrossedThreshold=function(d,p){var y=d&&d.isIntersecting?d.intersectionRatio||0:-1,E=p.isIntersecting?p.intersectionRatio||0:-1;if(y!==E)for(var C=0;C<this.thresholds.length;C++){var T=this.thresholds[C];if(T==y||T==E||T<y!=T<E)return!0}},s.prototype._rootIsInDom=function(){return!this.root||x(t,this.root)},s.prototype._rootContainsTarget=function(d){var p=this.root&&(this.root.ownerDocument||this.root)||t;return x(p,d)&&(!this.root||p==d.ownerDocument)},s.prototype._registerInstance=function(){r.indexOf(this)<0&&r.push(this)},s.prototype._unregisterInstance=function(){var d=r.indexOf(this);d!=-1&&r.splice(d,1)};function l(){return window.performance&&performance.now&&performance.now()}function a(d,p){var y=null;return function(){y||(y=setTimeout(function(){d(),y=null},p))}}function u(d,p,y,E){typeof d.addEventListener=="function"?d.addEventListener(p,y,E):typeof d.attachEvent=="function"&&d.attachEvent("on"+p,y)}function f(d,p,y,E){typeof d.removeEventListener=="function"?d.removeEventListener(p,y,E):typeof d.detachEvent=="function"&&d.detachEvent("on"+p,y)}function h(d,p){var y=Math.max(d.top,p.top),E=Math.min(d.bottom,p.bottom),C=Math.max(d.left,p.left),T=Math.min(d.right,p.right),I=T-C,D=E-y;return I>=0&&D>=0&&{top:y,bottom:E,left:C,right:T,width:I,height:D}||null}function v(d){var p;try{p=d.getBoundingClientRect()}catch{}return p?(p.width&&p.height||(p={top:p.top,right:p.right,bottom:p.bottom,left:p.left,width:p.right-p.left,height:p.bottom-p.top}),p):w()}function w(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function S(d){return!d||"x"in d?d:{top:d.top,y:d.top,bottom:d.bottom,left:d.left,x:d.left,right:d.right,width:d.width,height:d.height}}function j(d,p){var y=p.top-d.top,E=p.left-d.left;return{top:y,left:E,height:p.height,width:p.width,bottom:y+p.height,right:E+p.width}}function x(d,p){for(var y=p;y;){if(y==d)return!0;y=m(y)}return!1}function m(d){var p=d.parentNode;return d.nodeType==9&&d!=t?e(d):(p&&p.assignedSlot&&(p=p.assignedSlot.parentNode),p&&p.nodeType==11&&p.host?p.host:p)}function g(d){return d&&d.nodeType===9}window.IntersectionObserver=s,window.IntersectionObserverEntry=c}()),Ko}ou();function su(e,t){var r={},n=r.callback,o=cl(r,["callback"]),c=_o(P.useState(),2),s=c[0],l=c[1],a=_o(P.useState(),2),u=a[0],f=a[1];return ul(function(){var h=Array.isArray(e)?e:[e],v=h.map(function(S){return Mo(S)}).filter(Boolean);if(v.length){var w=new IntersectionObserver(function(S){var j,x;try{for(var m=fl(S),g=m.next();!g.done;g=m.next()){var d=g.value;f(d.intersectionRatio),l(d.isIntersecting),n?.(d)}}catch(p){j={error:p}}finally{try{g&&!g.done&&(x=m.return)&&x.call(m)}finally{if(j)throw j.error}}},Lo(Lo({},o),{root:Mo(void 0)}));return v.forEach(function(S){return w.observe(S)}),function(){w.disconnect()}}},[void 0,void 0,n],e),[s,u]}const iu=ur(i.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),au=ur(i.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),qr=ur([i.jsx("path",{d:"m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42M13 20.01 4 11V4h7v-.01l9 9z"},"0"),i.jsx("circle",{cx:"6.5",cy:"6.5",r:"1.5"},"1")]),lu=ur(i.jsx("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"})),cu=ur(i.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"})),Ri=e=>P.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),P.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375}),P.createElement("rect",{x:15.3125,y:14.0625,width:7.5,height:1.875,rx:.9375,transform:"rotate(-90 15.3125 14.0625)"})),Di=e=>P.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})),Oi=e=>P.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.88619 1.875C5.0541 1.875 4.24071 2.12174 3.54885 2.58402C2.857 3.0463 2.31777 3.70336 1.99934 4.47211C1.68092 5.24085 1.5976 6.08676 1.75994 6.90285C1.92227 7.71895 2.32295 8.46858 2.91133 9.05695C3.4997 9.64532 4.24933 10.046 5.06543 10.2083C5.88152 10.3707 6.72743 10.2874 7.49617 9.96893C8.26492 9.65051 8.92198 9.11128 9.38426 8.41942C9.84654 7.72757 10.0933 6.91417 10.0933 6.08209C10.0933 4.9663 9.65003 3.89621 8.86105 3.10723C8.07207 2.31825 7.00198 1.875 5.88619 1.875ZM4.11182 4.30773C4.58242 3.83714 5.22067 3.57276 5.88619 3.57276C6.38249 3.57276 6.86764 3.71993 7.2803 3.99566C7.69295 4.27139 8.01458 4.66329 8.20451 5.12181C8.39443 5.58033 8.44413 6.08487 8.3473 6.57164C8.25048 7.0584 8.01149 7.50552 7.66055 7.85645C7.30962 8.20739 6.8625 8.44638 6.37574 8.5432C5.88897 8.64003 5.38443 8.59033 4.92591 8.40041C4.46739 8.21048 4.07549 7.88885 3.79976 7.4762C3.52403 7.06354 3.37686 6.57839 3.37686 6.08209C3.37686 5.41657 3.64123 4.77832 4.11182 4.30773ZM4.20709 10.8302C3.0913 10.8302 2.02121 11.2735 1.23223 12.0624C0.443246 12.8514 0 13.9215 0 15.0373V17.8358C0 17.9955 0.12947 18.125 0.289179 18.125H1.40858C1.56829 18.125 1.69776 17.9955 1.69776 17.8358V15.0373C1.69776 14.3718 1.96214 13.7335 2.43273 13.2629C2.90332 12.7924 3.54157 12.528 4.20709 12.528H7.5653C7.89483 12.528 8.22113 12.5929 8.52558 12.719C8.83002 12.8451 9.10665 13.0299 9.33966 13.2629C9.57267 13.496 9.75751 13.7726 9.88361 14.077C10.0097 14.3815 10.0746 14.7078 10.0746 15.0373V17.8358C10.0746 17.9955 10.2041 18.125 10.3638 18.125H11.4832C11.6429 18.125 11.7724 17.9955 11.7724 17.8358V15.0373C11.7724 13.9215 11.3291 12.8514 10.5402 12.0624C9.75118 11.2735 8.68109 10.8302 7.5653 10.8302H4.20709Z"}),P.createElement("rect",{x:12.5,y:9.375,width:7.5,height:1.875,rx:.9375})),uu=e=>P.createElement("svg",{width:18,height:19,viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("g",{clipPath:"url(#clip0)"},P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})),P.createElement("defs",null,P.createElement("clipPath",{id:"clip0"},P.createElement("rect",{width:18,height:18,transform:"translate(0 0.5)"})))),Ai=e=>P.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e},P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 10C3.25 6.27208 6.27208 3.25 10 3.25C13.7279 3.25 16.75 6.27208 16.75 10C16.75 13.7279 13.7279 16.75 10 16.75C6.27208 16.75 3.25 13.7279 3.25 10ZM10 1.75C5.44365 1.75 1.75 5.44365 1.75 10C1.75 14.5564 5.44365 18.25 10 18.25C14.5563 18.25 18.25 14.5564 18.25 10C18.25 5.44365 14.5563 1.75 10 1.75ZM8.03033 6.96967C7.73744 6.67678 7.26256 6.67678 6.96967 6.96967C6.67678 7.26256 6.67678 7.73744 6.96967 8.03033L11.9697 13.0303C12.2626 13.3232 12.7374 13.3232 13.0303 13.0303C13.3232 12.7374 13.3232 12.2626 13.0303 11.9697L8.03033 6.96967Z"}));var Zr={},Xr,Yo;function fu(){return Yo||(Yo=1,Xr=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),Xr}var Qr,Go;function du(){if(Go)return Qr;Go=1;var e="%[a-f0-9]{2}",t=new RegExp("("+e+")|([^%]+?)","gi"),r=new RegExp("("+e+")+","gi");function n(s,l){try{return[decodeURIComponent(s.join(""))]}catch{}if(s.length===1)return s;l=l||1;var a=s.slice(0,l),u=s.slice(l);return Array.prototype.concat.call([],n(a),n(u))}function o(s){try{return decodeURIComponent(s)}catch{for(var l=s.match(t)||[],a=1;a<l.length;a++)s=n(l,a).join(""),l=s.match(t)||[];return s}}function c(s){for(var l={"%FE%FF":"��","%FF%FE":"��"},a=r.exec(s);a;){try{l[a[0]]=decodeURIComponent(a[0])}catch{var u=o(a[0]);u!==a[0]&&(l[a[0]]=u)}a=r.exec(s)}l["%C2"]="�";for(var f=Object.keys(l),h=0;h<f.length;h++){var v=f[h];s=s.replace(new RegExp(v,"g"),l[v])}return s}return Qr=function(s){if(typeof s!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof s+"`");try{return s=s.replace(/\+/g," "),decodeURIComponent(s)}catch{return c(s)}},Qr}var Jr,Zo;function pu(){return Zo||(Zo=1,Jr=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]}),Jr}var en,Xo;function mu(){return Xo||(Xo=1,en=function(e,t){for(var r={},n=Object.keys(e),o=Array.isArray(t),c=0;c<n.length;c++){var s=n[c],l=e[s];(o?t.indexOf(s)!==-1:t(s,l,e))&&(r[s]=l)}return r}),en}var Qo;function hu(){return Qo||(Qo=1,function(e){const t=fu(),r=du(),n=pu(),o=mu(),c=m=>m==null;function s(m){switch(m.arrayFormat){case"index":return g=>(d,p)=>{const y=d.length;return p===void 0||m.skipNull&&p===null||m.skipEmptyString&&p===""?d:p===null?[...d,[u(g,m),"[",y,"]"].join("")]:[...d,[u(g,m),"[",u(y,m),"]=",u(p,m)].join("")]};case"bracket":return g=>(d,p)=>p===void 0||m.skipNull&&p===null||m.skipEmptyString&&p===""?d:p===null?[...d,[u(g,m),"[]"].join("")]:[...d,[u(g,m),"[]=",u(p,m)].join("")];case"comma":case"separator":return g=>(d,p)=>p==null||p.length===0?d:d.length===0?[[u(g,m),"=",u(p,m)].join("")]:[[d,u(p,m)].join(m.arrayFormatSeparator)];default:return g=>(d,p)=>p===void 0||m.skipNull&&p===null||m.skipEmptyString&&p===""?d:p===null?[...d,u(g,m)]:[...d,[u(g,m),"=",u(p,m)].join("")]}}function l(m){let g;switch(m.arrayFormat){case"index":return(d,p,y)=>{if(g=/\[(\d*)\]$/.exec(d),d=d.replace(/\[\d*\]$/,""),!g){y[d]=p;return}y[d]===void 0&&(y[d]={}),y[d][g[1]]=p};case"bracket":return(d,p,y)=>{if(g=/(\[\])$/.exec(d),d=d.replace(/\[\]$/,""),!g){y[d]=p;return}if(y[d]===void 0){y[d]=[p];return}y[d]=[].concat(y[d],p)};case"comma":case"separator":return(d,p,y)=>{const E=typeof p=="string"&&p.includes(m.arrayFormatSeparator),C=typeof p=="string"&&!E&&f(p,m).includes(m.arrayFormatSeparator);p=C?f(p,m):p;const T=E||C?p.split(m.arrayFormatSeparator).map(I=>f(I,m)):p===null?p:f(p,m);y[d]=T};default:return(d,p,y)=>{if(y[d]===void 0){y[d]=p;return}y[d]=[].concat(y[d],p)}}}function a(m){if(typeof m!="string"||m.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(m,g){return g.encode?g.strict?t(m):encodeURIComponent(m):m}function f(m,g){return g.decode?r(m):m}function h(m){return Array.isArray(m)?m.sort():typeof m=="object"?h(Object.keys(m)).sort((g,d)=>Number(g)-Number(d)).map(g=>m[g]):m}function v(m){const g=m.indexOf("#");return g!==-1&&(m=m.slice(0,g)),m}function w(m){let g="";const d=m.indexOf("#");return d!==-1&&(g=m.slice(d)),g}function S(m){m=v(m);const g=m.indexOf("?");return g===-1?"":m.slice(g+1)}function j(m,g){return g.parseNumbers&&!Number.isNaN(Number(m))&&typeof m=="string"&&m.trim()!==""?m=Number(m):g.parseBooleans&&m!==null&&(m.toLowerCase()==="true"||m.toLowerCase()==="false")&&(m=m.toLowerCase()==="true"),m}function x(m,g){g=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},g),a(g.arrayFormatSeparator);const d=l(g),p=Object.create(null);if(typeof m!="string"||(m=m.trim().replace(/^[?#&]/,""),!m))return p;for(const y of m.split("&")){if(y==="")continue;let[E,C]=n(g.decode?y.replace(/\+/g," "):y,"=");C=C===void 0?null:["comma","separator"].includes(g.arrayFormat)?C:f(C,g),d(f(E,g),C,p)}for(const y of Object.keys(p)){const E=p[y];if(typeof E=="object"&&E!==null)for(const C of Object.keys(E))E[C]=j(E[C],g);else p[y]=j(E,g)}return g.sort===!1?p:(g.sort===!0?Object.keys(p).sort():Object.keys(p).sort(g.sort)).reduce((y,E)=>{const C=p[E];return C&&typeof C=="object"&&!Array.isArray(C)?y[E]=h(C):y[E]=C,y},Object.create(null))}e.extract=S,e.parse=x,e.stringify=(m,g)=>{if(!m)return"";g=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},g),a(g.arrayFormatSeparator);const d=C=>g.skipNull&&c(m[C])||g.skipEmptyString&&m[C]==="",p=s(g),y={};for(const C of Object.keys(m))d(C)||(y[C]=m[C]);const E=Object.keys(y);return g.sort!==!1&&E.sort(g.sort),E.map(C=>{const T=m[C];return T===void 0?"":T===null?u(C,g):Array.isArray(T)?T.reduce(p(C),[]).join("&"):u(C,g)+"="+u(T,g)}).filter(C=>C.length>0).join("&")},e.parseUrl=(m,g)=>{g=Object.assign({decode:!0},g);const[d,p]=n(m,"#");return Object.assign({url:d.split("?")[0]||"",query:x(S(m),g)},g&&g.parseFragmentIdentifier&&p?{fragmentIdentifier:f(p,g)}:{})},e.stringifyUrl=(m,g)=>{g=Object.assign({encode:!0,strict:!0},g);const d=v(m.url).split("?")[0]||"",p=e.extract(m.url),y=e.parse(p,{sort:!1}),E=Object.assign(y,m.query);let C=e.stringify(E,g);C&&(C=`?${C}`);let T=w(m.url);return m.fragmentIdentifier&&(T=`#${u(m.fragmentIdentifier,g)}`),`${d}${C}${T}`},e.pick=(m,g,d)=>{d=Object.assign({parseFragmentIdentifier:!0},d);const{url:p,query:y,fragmentIdentifier:E}=e.parseUrl(m,d);return e.stringifyUrl({url:p,query:o(y,g),fragmentIdentifier:E},d)},e.exclude=(m,g,d)=>{const p=Array.isArray(g)?y=>!g.includes(y):(y,E)=>!g(y,E);return e.pick(m,p,d)}}(Zr)),Zr}var tn=hu();const Xt=dl,gu={parseNumbers:!1,parseBooleans:!1},bu={skipNull:!1,skipEmptyString:!1},yu=(e,t)=>{var r,n;const{navigateMode:o="push",parseOptions:c,stringifyOptions:s}={},l=Object.assign(Object.assign({},gu),c),a=Object.assign(Object.assign({},bu),s),u=Xt.useLocation(),f=(r=Xt.useHistory)===null||r===void 0?void 0:r.call(Xt),h=(n=Xt.useNavigate)===null||n===void 0?void 0:n.call(Xt),v=pl(),w=P.useRef(typeof e=="function"?e():e||{}),S=P.useMemo(()=>tn.parse(u.search,l),[u.search]),j=P.useMemo(()=>Object.assign(Object.assign({},w.current),S),[S]);return[j,Tt(m=>{const g=typeof m=="function"?m(j):m;v(),f&&f[o]({hash:u.hash,search:tn.stringify(Object.assign(Object.assign({},S),g),a)||"?"},u.state),h&&h({hash:u.hash,search:tn.stringify(Object.assign(Object.assign({},S),g),a)||"?"},{replace:o==="replace",state:u.state})})]};var jt={},Qt={},rn={exports:{}},nn={},Jo;function _i(){if(Jo)return nn;Jo=1;function e(g){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},e(g)}function t(g,d,p){return Object.defineProperty(g,"prototype",{writable:!1}),g}function r(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}function n(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(d&&d.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),d&&o(g,d)}function o(g,d){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,E){return y.__proto__=E,y},o(g,d)}function c(g){var d=a();return function(){var y=u(g),E;if(d){var C=u(this).constructor;E=Reflect.construct(y,arguments,C)}else E=y.apply(this,arguments);return s(this,E)}}function s(g,d){if(d&&(e(d)==="object"||typeof d=="function"))return d;if(d!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l(g)}function l(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function a(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u(g){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},u(g)}var f={},h,v;function w(g,d,p){p||(p=Error);function y(C,T,I){return typeof d=="string"?d:d(C,T,I)}var E=function(C){n(I,C);var T=c(I);function I(D,N,B){var W;return r(this,I),W=T.call(this,y(D,N,B)),W.code=g,W}return t(I)}(p);f[g]=E}function S(g,d){if(Array.isArray(g)){var p=g.length;return g=g.map(function(y){return String(y)}),p>2?"one of ".concat(d," ").concat(g.slice(0,p-1).join(", "),", or ")+g[p-1]:p===2?"one of ".concat(d," ").concat(g[0]," or ").concat(g[1]):"of ".concat(d," ").concat(g[0])}else return"of ".concat(d," ").concat(String(g))}function j(g,d,p){return g.substr(0,d.length)===d}function x(g,d,p){return(p===void 0||p>g.length)&&(p=g.length),g.substring(p-d.length,p)===d}function m(g,d,p){return typeof p!="number"&&(p=0),p+d.length>g.length?!1:g.indexOf(d,p)!==-1}return w("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),w("ERR_INVALID_ARG_TYPE",function(g,d,p){h===void 0&&(h=Kn()),h(typeof g=="string","'name' must be a string");var y;typeof d=="string"&&j(d,"not ")?(y="must not be",d=d.replace(/^not /,"")):y="must be";var E;if(x(g," argument"))E="The ".concat(g," ").concat(y," ").concat(S(d,"type"));else{var C=m(g,".")?"property":"argument";E='The "'.concat(g,'" ').concat(C," ").concat(y," ").concat(S(d,"type"))}return E+=". Received type ".concat(e(p)),E},TypeError),w("ERR_INVALID_ARG_VALUE",function(g,d){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";v===void 0&&(v=or());var y=v.inspect(d);return y.length>128&&(y="".concat(y.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(p,". Received ").concat(y)},TypeError),w("ERR_INVALID_RETURN_VALUE",function(g,d,p){var y;return p&&p.constructor&&p.constructor.name?y="instance of ".concat(p.constructor.name):y="type ".concat(e(p)),"Expected ".concat(g,' to be returned from the "').concat(d,'"')+" function but got ".concat(y,".")},TypeError),w("ERR_MISSING_ARGS",function(){for(var g=arguments.length,d=new Array(g),p=0;p<g;p++)d[p]=arguments[p];h===void 0&&(h=Kn()),h(d.length>0,"At least one arg needs to be specified");var y="The ",E=d.length;switch(d=d.map(function(C){return'"'.concat(C,'"')}),E){case 1:y+="".concat(d[0]," argument");break;case 2:y+="".concat(d[0]," and ").concat(d[1]," arguments");break;default:y+=d.slice(0,E-1).join(", "),y+=", and ".concat(d[E-1]," arguments");break}return"".concat(y," must be specified")},TypeError),nn.codes=f,nn}var on,es;function xu(){if(es)return on;es=1;function e(_,F){var G=Object.keys(_);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(_);F&&(H=H.filter(function(Q){return Object.getOwnPropertyDescriptor(_,Q).enumerable})),G.push.apply(G,H)}return G}function t(_){for(var F=1;F<arguments.length;F++){var G=arguments[F]!=null?arguments[F]:{};F%2?e(Object(G),!0).forEach(function(H){r(_,H,G[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(G)):e(Object(G)).forEach(function(H){Object.defineProperty(_,H,Object.getOwnPropertyDescriptor(G,H))})}return _}function r(_,F,G){return F=s(F),F in _?Object.defineProperty(_,F,{value:G,enumerable:!0,configurable:!0,writable:!0}):_[F]=G,_}function n(_,F){if(!(_ instanceof F))throw new TypeError("Cannot call a class as a function")}function o(_,F){for(var G=0;G<F.length;G++){var H=F[G];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(_,s(H.key),H)}}function c(_,F,G){return F&&o(_.prototype,F),Object.defineProperty(_,"prototype",{writable:!1}),_}function s(_){var F=l(_,"string");return g(F)==="symbol"?F:String(F)}function l(_,F){if(g(_)!=="object"||_===null)return _;var G=_[Symbol.toPrimitive];if(G!==void 0){var H=G.call(_,F);if(g(H)!=="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(_)}function a(_,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(F&&F.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),Object.defineProperty(_,"prototype",{writable:!1}),F&&x(_,F)}function u(_){var F=S();return function(){var H=m(_),Q;if(F){var A=m(this).constructor;Q=Reflect.construct(H,arguments,A)}else Q=H.apply(this,arguments);return f(this,Q)}}function f(_,F){if(F&&(g(F)==="object"||typeof F=="function"))return F;if(F!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h(_)}function h(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function v(_){var F=typeof Map=="function"?new Map:void 0;return v=function(H){if(H===null||!j(H))return H;if(typeof H!="function")throw new TypeError("Super expression must either be null or a function");if(typeof F<"u"){if(F.has(H))return F.get(H);F.set(H,Q)}function Q(){return w(H,arguments,m(this).constructor)}return Q.prototype=Object.create(H.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}}),x(Q,H)},v(_)}function w(_,F,G){return S()?w=Reflect.construct.bind():w=function(Q,A,R){var M=[null];M.push.apply(M,A);var z=Function.bind.apply(Q,M),L=new z;return R&&x(L,R.prototype),L},w.apply(null,arguments)}function S(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function j(_){return Function.toString.call(_).indexOf("[native code]")!==-1}function x(_,F){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(H,Q){return H.__proto__=Q,H},x(_,F)}function m(_){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(G){return G.__proto__||Object.getPrototypeOf(G)},m(_)}function g(_){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},g(_)}var d=or(),p=d.inspect,y=_i(),E=y.codes.ERR_INVALID_ARG_TYPE;function C(_,F,G){return(G===void 0||G>_.length)&&(G=_.length),_.substring(G-F.length,G)===F}function T(_,F){if(F=Math.floor(F),_.length==0||F==0)return"";var G=_.length*F;for(F=Math.floor(Math.log(F)/Math.log(2));F;)_+=_,F--;return _+=_.substring(0,G-_.length),_}var I="",D="",N="",B="",W={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},ne=10;function te(_){var F=Object.keys(_),G=Object.create(Object.getPrototypeOf(_));return F.forEach(function(H){G[H]=_[H]}),Object.defineProperty(G,"message",{value:_.message}),G}function ge(_){return p(_,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Ce(_,F,G){var H="",Q="",A=0,R="",M=!1,z=ge(_),L=z.split(`
|
|
2
2
|
`),q=ge(F).split(`
|
|
3
3
|
`),Z=0,oe="";if(G==="strictEqual"&&g(_)==="object"&&g(F)==="object"&&_!==null&&F!==null&&(G="strictEqualObject"),L.length===1&&q.length===1&&L[0]!==q[0]){var pe=L[0].length+q[0].length;if(pe<=ne){if((g(_)!=="object"||_===null)&&(g(F)!=="object"||F===null)&&(_!==0||F!==0))return"".concat(W[G],`
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as H,u as W,r as i,a as R,b as $,j as e,o as y,d as Q,e as Y,p as F,f as X,W as D,L as J,g as j,h as K,i as z,k,T as h,G as v,l as Z,m as B,s as q,C as ee}from"./index-
|
|
1
|
+
import{c as H,u as W,r as i,a as R,b as $,j as e,o as y,d as Q,e as Y,p as F,f as X,W as D,L as J,g as j,h as K,i as z,k,T as h,G as v,l as Z,m as B,s as q,C as ee}from"./index-DaEjX2SO.js";import{f as ne}from"./index-BojVbZw0.js";import{v as U}from"./index-BqOHFDpP.js";import{M as V}from"./metric-Ce6h_fps.js";import{C as M}from"./click-to-copy-Xg1hTHwq.js";var se=H(function(a,d,r){return a+(r?" ":"")+d.toLowerCase()});const L=i.createContext({}),{Provider:ae,Consumer:he}=L;function te({children:a}){const{api:d,info:r}=W(),[u,l]=i.useState(null),[c,t]=i.useState(!1),[s,p]=i.useState([]),_=4,f=async({silent:o=!0,retries:m=_}={})=>{o||t(!0);try{l(null);const{users:x}=await d.getUsers({input:{teamDid:r.did,paging:{pageSize:100}}});t(!1),p(x)}catch(x){m>0?setTimeout(()=>f({silent:o,retries:m-1}),1e3):(t(!1),l(x))}};i.useEffect(()=>{f({silent:!1})},[]),R($.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),R($.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(N=>N.did!==m))}),R($.TeamEvents.userUpdated,({teamDid:o})=>{o===r.did&&f()});const b={loading:c,error:u,users:s,refresh:f};return e.jsx(ae,{value:{users:b},children:a})}function re(){const{users:a}=i.useContext(L);return a}const g={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},oe=(a,d)=>{const[r,u]=i.useState(0),l=s=>s>=g.oneDay?g.oneDay:s>=g.oneHour?g.oneHour:s>=g.oneMin?g.oneMin:g.oneSecond,[c,t]=i.useState(l(a/1e3));return i.useEffect(()=>{const s=setInterval(()=>{u(r+c);const p=l(a/1e3+r+c);c!==p&&t(p)},c*1e3);return()=>clearInterval(s)},[c,r]),i.useEffect(()=>{u(0),t(l(a/1e3))},[a]),d(a+r*1e3)};y.number.isRequired,y.func;const ie=async a=>{const d=await a.getNodeEnv();return Object.assign({},d.info||{})};y.number.isRequired;y.string.isRequired,y.string.isRequired,y.string.isRequired;function le(){const{info:a,api:d,loading:r}=W(),{data:u,externalData:l}=Q(),{users:c}=re(),t=Y(()=>ie(d)),{t:s,locale:p}=i.useContext(F),_=X(),f=oe(+new Date-a.startAt,o=>{const m={compact:!0,verbose:!0,locale:B(p)};return Z(o,m)});let b=null;if(r)b=e.jsx(ee,{});else{const o=[{name:s("dashboard.nodeDid"),value:e.jsx(D,{did:a.did,showQrcode:!0})}];a.nodeOwner&&o.push({name:s("dashboard.ownerDid"),value:e.jsx(D,{did:a.nodeOwner.did,showQrcode:!0})});let m=[];a.launcher&&(m=[{name:s("common.did"),value:e.jsx(D,{did:a.launcher.did,showQrcode:!0})},{name:s("common.type"),value:a.launcher.type},{name:s("launcher.provider"),value:a.launcher.provider},{name:s("launcher.adminUrl"),value:e.jsx(J,{target:"_blank",href:a.launcher.url,underline:"hover",children:a.launcher.url})}]);const x=(n,w)=>!n&&!w?"-":n==="-"?n:!w||w==="-"?e.jsxs(h,{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}):e.jsxs(h,{component:"ul",children:[e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}),e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV6"}),e.jsx(M,{children:w})]})]}),N=()=>{const n=[{name:`${s("common.internalIp")}`,value:x(t.value.ip.internalV4,t.value.ip.internalV6)},{name:`${s("common.externalIp")}`,value:x(t.value.ip.externalV4,t.value.ip.externalV6)}];return t.value.docker?[]:n},T=t.value?[{name:`${s("common.version")}`,value:a.version},...N(),{name:`${s("common.os")}`,value:t.value.os},t.value.docker?{name:`${s("common.docker")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null,t.value.gitpod?{name:`${s("common.gitpod")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null].filter(Boolean):[];Array.isArray(K(t,"value.blockletEngines",null))&&t.value.blockletEngines.filter(n=>n.visible&&n.available).forEach(n=>{T.push({name:n.displayName,value:e.jsx(j,{type:"success",children:`${n.version}`||"N/A"})})});const G=c.length,A=c.filter(n=>n.approved).length;let P=G;A&&(P+=`<small><strong>${se(s("common.approved"))} ${A}</strong></small>`);let S=0,C=0;u&&(S=u.length,C=u.filter(n=>z.isBlockletRunning(n)).length),Array.isArray(l)&&(S+=l.length,C+=l.filter(n=>z.isBlockletRunning(n)).length);let I=S;C&&(I+=`<small>${s("common.running")} ${C}</small>`);const O=[{name:s("common.blocklets"),value:I},{name:s("common.members"),value:P},{name:s("common.uptime"),value:f},{name:s("common.created"),value:ne(new Date(a.createdAt).getTime(),B(p))}];let E=[];t.value&&t.value.disk&&Object.values(t.value.disk).some(n=>n>0)&&(E=[{name:s("common.blockletsStorage"),value:k(t.value.disk.blocklets||0).toUpperCase()},{name:s("common.dataStorage"),value:k(t.value.disk.data||0).toUpperCase()},{name:s("common.logStorage"),value:k(t.value.disk.log||0).toUpperCase()},{name:s("common.cacheStorage"),value:k(t.value.disk.cache||0).toUpperCase()},{name:s("common.coreStorage"),value:k(t.value.disk.app||0).toUpperCase()}]),b=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.overview")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:O.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),E.length>0&&e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.storage")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:E.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.meta")}),e.jsxs(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:[e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.dAddress")}),o.map(n=>e.jsx(U,{nameWidth:150,name:n.name,children:n.value},n.name)),m.length>0&&e.jsxs("div",{style:{marginTop:_.spacing(8)},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.launcher")}),m.map(n=>e.jsx(U,{nameWidth:150,name:n.name,children:n.value},n.name))]})]},"address"),e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.env")}),T.map(n=>e.jsx(U,{valueComponent:"div",nameWidth:150,name:n.name,children:n.value},n.name))]},"environment")]})]})]})}return e.jsx(ce,{children:b})}const ce=q.main`
|
|
2
2
|
.page-header {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as t,K as o,bs as c,o as n}from"./index-
|
|
1
|
+
import{r as i,j as t,K as o,bs as c,o as n}from"./index-DaEjX2SO.js";const h=e=>i.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})),a=c(o)`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c1 as Ke,c0 as Fe,r as h,c2 as Ge,j as e,b9 as ee,c4 as Ye,ch as J,c5 as $e,b_ as He,cj as qe,aF as he,M as q,bo as A,cw as Ce,H as B,Y as V,bg as E,fD as we,aQ as Be,b as N,iP as Ve,V as D,gD as Qe,o as f,x as Xe,ax as De,y as fe,al as Ze,p as Je,C as L,T as j,k as et,s as tt,f as ot,iQ as X,h_ as Z,iR as st,K as S,aW as K,aH as T,L as nt,g as H,dm as at,O as Se,R as G,aE as Y,a9 as $,a5 as rt,bB as it,fu as ct,b0 as lt,v as pe,w as dt,G as be,Z as Ee,bE as xe,B as pt}from"./index-CCv_8omK.js";import{T as ut}from"./html-title-xzTyg8m0.js";import{u as U}from"./blocklet-D2MB-zOx.js";import{u as mt}from"./use-mobile-DvM8SqYH.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-MJFTP0S_.js";import"./index-DcXoiIcd.js";import"./index-BojVbZw0.js";import"./api-CWyPHkC_.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-Dif7Qa2a.js";import{v as Rt}from"./index-BCEB7zAW.js";import{E as zt}from"./index-CEPQQlo6.js";import{H as vt}from"./HelpOutline-DapRasSH.js";import{H as Pt}from"./index-4-FW3N_0.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Lt}from"./actions-DVOuh-Fv.js";import{D as Ut}from"./DeleteOutline-DmEDUBgP.js";import{g as ke}from"./get-safe-url-B_yWzv49.js";import{S as Ot}from"./switch-control-BLvkR0UT.js";import{L as je}from"./list-header-D-U957cP.js";import"./OpenInNew-CCi7ydva.js";import"./ButtonGroup-CMlvIctd.js";import"./getValidReactChildren-BQH98pcn.js";import"./FilterList-xUYmSJ-Y.js";import"./CSSTransition-Cf_KzaPo.js";import"./emotion-cache.browser.esm-CdT-VIlA.js";import"./index-hu34K3US.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BNz3Z5UN.js";import"./index-DkBdKcP-.js";import"./TableSearch-CAaRXXpO.js";import"./Search-3L2yy5pr.js";import"./Clear-Cz6Yzx0g.js";import"./MoreVert-BUlWqUnK.js";import"./useLocalStorage-CbBU4OS9.js";import"./url-evaluation-B5iexDQo.js";import"./permission-RtK6f5af.js";import"./Switch-B-AVsYNw.js";function Mt(t){return Ke("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:o,fontSize:n,classes:s}=t,r={root:["root",o!=="inherit"&&`color${J(o)}`,`fontSize${J(n)}`]};return $e(r,Mt,s)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[o.root,n.color!=="inherit"&&o[`color${J(n.color)}`],o[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([o])=>({props:{color:o},style:{color:(t.vars||t).palette[o].main}}))]}))),ye=h.forwardRef(function(o,n){const s=Ge({props:o,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=s,p={...s,baseClassName:r,color:c,component:i,fontSize:d},u=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",u.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Kt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Gt({blockletDid:t,nodeApi:o,spaceGateways:n}){let s=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>o.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:o}=U(),n=o?.meta?.did,{api:s}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:o,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=U(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(o(!0),!s){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{o(!1)}},1e3);return Be(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:o}=Te(),[n,s]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),h.useEffect(()=>{if(o?.length&&Ve(o[0]?.status)){const[c]=o;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[o]),n}function Ht({deps:t=[],setLoading:o=()=>{}}={}){const{blocklet:n}=U(),[s,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{o(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}}),p=Array.isArray(l)?l.map(u=>({...u,successCount:+u.successCount,errorCount:+u.errorCount})):[];r(p)}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{o(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:s}}const Re=h.createContext({}),{Provider:qt,Consumer:Ho}=Re;function ze({children:t}){const{t:o}=D(),{api:n}=A(),{blocklet:s}=U(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),u=Qe(d),x=$t({appDid:s?.appDid}),m=h.useMemo(()=>wt(s?.environments),[s?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[oe,se]=h.useState(0),{backupSummary:ne}=Ht({deps:[oe]}),[_,M]=h.useState(d?.find(g=>g.endpoint===m)),I=s?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{se(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:s.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:g}}),m!==P&&await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===m&&(await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:g.did},spaceGateway:g}}),m!==g.endpoint&&n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===m;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:m,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:f.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:o}=U(),{info:n}=A(),{t:s}=D(),r=Ie({blocklet:o}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:o.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:u,name:x,did:m})=>{const k=await Bt(u);if(!await Dt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===u)){B.error(s("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:m,url:k,endpoint:u},u)},p=async({spaceGateway:u})=>{try{await l(u)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:o}=U(),{data:n,loading:s}=Ce(()=>t.getBlocklet({input:{did:o?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!o?.meta?.did,refreshDeps:[o?.meta?.did]});return{blocklet:n?.blocklet??null,loading:s}}function Pe({...t}){const{t:o}=h.useContext(Je),{blocklet:n,loading:s}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:o("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:o("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:o("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:o("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(L,{}):e.jsx(j,{children:o("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:o,backupSummary:n}=O(),s=xt({key:"lg"}),r=h.useRef(null),a=ot(),c=h.useCallback(l=>{o(l)},[o]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),u=new Map(n.map(m=>[m.date,{date:m.date,successCount:m.successCount,errorCount:m.errorCount}])),x=[];for(let m=p.clone();E(m).isBefore(l);m=m.add(1,"day")){const k=m.format("YYYY-MM-DD");x.push(u.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
1
|
+
import{c1 as Ke,c0 as Fe,r as h,c2 as Ge,j as e,b9 as ee,c4 as Ye,ch as J,c5 as $e,b_ as He,cj as qe,aF as he,M as q,bo as A,cw as Ce,H as B,Y as V,bg as E,fD as we,aQ as Be,b as N,iP as Ve,V as D,gD as Qe,o as f,x as Xe,ax as De,y as fe,al as Ze,p as Je,C as L,T as j,k as et,s as tt,f as ot,iQ as X,h_ as Z,iR as st,K as S,aW as K,aH as T,L as nt,g as H,dm as at,O as Se,R as G,aE as Y,a9 as $,a5 as rt,bB as it,fu as ct,b0 as lt,v as pe,w as dt,G as be,Z as Ee,bE as xe,B as pt}from"./index-DaEjX2SO.js";import{T as ut}from"./html-title-D-skaBwb.js";import{u as U}from"./blocklet-4xcBoALi.js";import{u as mt}from"./use-mobile-CWB6Jtv1.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-BzOsNzCo.js";import"./index-Bpl7ZPdw.js";import"./index-BojVbZw0.js";import"./api-gDzILycU.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-BTKqW9YY.js";import{v as Rt}from"./index-BqOHFDpP.js";import{E as zt}from"./index-B1omHpBR.js";import{H as vt}from"./HelpOutline-CDfUVKlB.js";import{H as Pt}from"./index-Uf4kWlzq.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Lt}from"./actions-CqTr_UpD.js";import{D as Ut}from"./DeleteOutline-C9hdvFLW.js";import{g as ke}from"./get-safe-url-nXPF2sGJ.js";import{S as Ot}from"./switch-control-bRPrVj4O.js";import{L as je}from"./list-header-BEqD50lj.js";import"./OpenInNew-KWw6IL4k.js";import"./ButtonGroup-C6xSllEr.js";import"./getValidReactChildren-CIqQKAkN.js";import"./FilterList-C0g86vDh.js";import"./CSSTransition-BnYuNWzI.js";import"./emotion-cache.browser.esm-B1_0wYNC.js";import"./index-DIdPY5JS.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-D4SkOvpW.js";import"./index-CB9i2iit.js";import"./TableSearch-BJJrOkE2.js";import"./Search-soT1P5WL.js";import"./Clear-DYWNGGPP.js";import"./MoreVert-D2cSYolp.js";import"./useLocalStorage-Df3_jlsm.js";import"./url-evaluation-Dm_mNoMs.js";import"./permission-DHDlX-2p.js";import"./Switch-CYCG_kxE.js";function Mt(t){return Ke("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:o,fontSize:n,classes:s}=t,r={root:["root",o!=="inherit"&&`color${J(o)}`,`fontSize${J(n)}`]};return $e(r,Mt,s)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[o.root,n.color!=="inherit"&&o[`color${J(n.color)}`],o[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([o])=>({props:{color:o},style:{color:(t.vars||t).palette[o].main}}))]}))),ye=h.forwardRef(function(o,n){const s=Ge({props:o,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=s,p={...s,baseClassName:r,color:c,component:i,fontSize:d},u=Nt(p);return e.jsx(_t,{as:i,className:Ye(r,"notranslate",u.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Kt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Gt({blockletDid:t,nodeApi:o,spaceGateways:n}){let s=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>o.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function Yt({refresh:t}={}){const{blocklet:o}=U(),n=o?.meta?.did,{api:s}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:o,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=U(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(o(!0),!s){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{o(!1)}},1e3);return Be(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function $t({appDid:t}){const{backups:o}=Te(),[n,s]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),h.useEffect(()=>{if(o?.length&&Ve(o[0]?.status)){const[c]=o;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[o]),n}function Ht({deps:t=[],setLoading:o=()=>{}}={}){const{blocklet:n}=U(),[s,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{o(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}}),p=Array.isArray(l)?l.map(u=>({...u,successCount:+u.successCount,errorCount:+u.errorCount})):[];r(p)}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{o(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:s}}const Re=h.createContext({}),{Provider:qt,Consumer:Ho}=Re;function ze({children:t}){const{t:o}=D(),{api:n}=A(),{blocklet:s}=U(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=Yt({refresh:c}),u=Qe(d),x=$t({appDid:s?.appDid}),m=h.useMemo(()=>wt(s?.environments),[s?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[oe,se]=h.useState(0),{backupSummary:ne}=Ht({deps:[oe]}),[_,M]=h.useState(d?.find(g=>g.endpoint===m)),I=s?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{se(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:s.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:g}}),m!==P&&await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===m&&(await n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:g.did},spaceGateway:g}}),m!==g.endpoint&&n.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===m;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:u,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:m,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:f.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:o}=U(),{info:n}=A(),{t:s}=D(),r=Ie({blocklet:o}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:o.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:u,name:x,did:m})=>{const k=await Bt(u);if(!await Dt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===u)){B.error(s("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:m,url:k,endpoint:u},u)},p=async({spaceGateway:u})=>{try{await l(u)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:o}=U(),{data:n,loading:s}=Ce(()=>t.getBlocklet({input:{did:o?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!o?.meta?.did,refreshDeps:[o?.meta?.did]});return{blocklet:n?.blocklet??null,loading:s}}function Pe({...t}){const{t:o}=h.useContext(Je),{blocklet:n,loading:s}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:o("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:o("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:o("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:o("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(L,{}):e.jsx(j,{children:o("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:o,backupSummary:n}=O(),s=xt({key:"lg"}),r=h.useRef(null),a=ot(),c=h.useCallback(l=>{o(l)},[o]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),u=new Map(n.map(m=>[m.date,{date:m.date,successCount:m.successCount,errorCount:m.errorCount}])),x=[];for(let m=p.clone();E(m).isBefore(l);m=m.add(1,"day")){const k=m.format("YYYY-MM-DD");x.push(u.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
|
|
2
2
|
`)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:st[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2},children:e.jsxs(K,{direction:s?"column":"row",spacing:s?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center"},children:[e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...o})=>e.jsx(Se,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Le({status:t,message:o="",createdAt:n}){const{t:s}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&s("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):i?e.jsx(H,{type:"success",children:s("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:s("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:o||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Le.propTypes={status:f.string.isRequired,message:f.string,createdAt:f.string.isRequired};function Ue({metadata:t={}}){const{t:o}=D();if(q(t))return e.jsx(H,{type:"success",children:o("common.succeeded")});const n=t.count||0,s=t.size||0,r=At(s,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[o("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[o("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:o("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Ue.propTypes={metadata:f.object};function Oe(){const{t,locale:o}=D(),{spaceGateways:n,backups:s,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:u}=s[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,m=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return m?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(H,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=s?.[i]??{},{status:l,message:p,createdAt:u,metadata:x}=d,m=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(u,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!m,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!m;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(L,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Ue,{metadata:x}):e.jsx(Le,{status:l,message:p,createdAt:u})}}}],[s,n,t]),c=h.useMemo(()=>!s?.length,[s]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:s,columns:a,emptyNode:t("storage.spaces.record.emptyData",o),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Zt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Ae,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Me({spaceGateway:t,onConfirm:o=()=>{},onCancel:n=()=>{}}){const{t:s}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(u,x)=>{u?.preventDefault(),u?.stopPropagation(),a(x)},l=async u=>{try{u?.stopPropagation(),i(!0),await o?.(t),a(!1)}catch(x){console.error(x),B.error(`${s("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=u=>{d(u,!1),n?.(u)};return e.jsxs(e.Fragment,{children:[e.jsxs(G,{color:"red",onClick:u=>d(u,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(rt,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool}).isRequired,onConfirm:f.func,onCancel:f.func};function Ne({spaceGateway:t,selected:o,onDelete:n=()=>{},onConnect:s=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[u,x]=h.useState(!1),m=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),m(y,!1),await s(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),m(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[u||t?.loading?e.jsx(L,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>m(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>m(y,!1),children:[e.jsxs(G,{onClick:y=>{m(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx($,{children:p("common.open")})]}),e.jsxs(G,{onClick:y=>{m(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!o&&r&&e.jsxs(G,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Kt,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(G,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx($,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:f.shape({name:f.string.isRequired,url:f.string.isRequired,protected:f.bool,endpoint:f.string.isRequired,loading:f.bool}).isRequired,selected:f.bool.isRequired,enableSwitchToSpace:f.bool,onDelete:f.func,onConnect:f.func,backupInProgress:f.bool};const Jt=ee(({className:t,...o})=>e.jsx(Se,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:o,selected:n,onConnected:s=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=U(),{api:l,info:{did:p}}=A(),{appDid:u,appName:x,appDescription:m,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:oe,refreshBackupSummary:se,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&o===ue.DISCONNECTED,re=n&&!_&&!t.loading&&o===ue.CONNECTED,F=n&&_&&o===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s?.(null,t);return}}catch(C){console.error(C),s?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:u,appName:x,appDescription:m,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),s?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),s?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await oe(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),se(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Jt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(L,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:f.shape({did:f.string.isRequired,name:f.string.isRequired,url:f.string.isRequired,endpoint:f.string.isRequired,protected:f.bool,loading:f.bool}).isRequired,spaceStatus:f.string.isRequired,selected:f.bool.isRequired,onConnected:f.func,onDeleted:f.func,onBackedUp:f.func};function eo({...t}){const{t:o}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:o("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function to({...t}){const{t:o}=D(),{autoBackup:n,updateAutoBackup:s}=O(),r=async()=>{try{const a=!n?.enabled;await s({enabled:a}),B.success(o(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:o("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function oo(){const{t}=D(),{spaceGateways:o,spaceGatewaysLoading:n,spaceGatewayIsSelected:s}=O(),r=n&&!o?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(to,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(L,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:o.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:c.endpoint,selected:s(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(eo,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function so(){const{spaceGatewaysFirstLoading:t,spaceGateways:o}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):q(o)?e.jsx(Zt,{}):e.jsx(oo,{})}function no(){return e.jsx(ze,{children:e.jsx(so,{})})}function ao(){const{spaceGateway:t,settingStorageEndpoint:o,updateSpaceGateway:n,hasStorageEndpoint:s,loading:r,storageEndpoint:a}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(L,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:o}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function ro(){const{t}=D();return e.jsxs(St,{children:[e.jsxs(K,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(ao,{})]})}function io({navOrientation:t="vertical",...o}){const{t:n,locale:s}=D(),{blocklet:r}=U(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[s,l]),x=xe(()=>({backup:e.jsx(no,{}),storage:e.jsx(ro,{})}))[d],m=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:m,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...o,children:e.jsxs(K,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...o,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}io.propTypes={navOrientation:f.oneOf(["vertical","horizontal"])};const me=ee(S)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ak as ee,A as T,r as f,a as te,b as se,V as S,u as j,x as re,aw as A,i as F,j as t,w as q,ax as oe,T as C,y as k,$,o as m,ay as ne,O as ae,v as _,C as N,az as ie,H as W,Y as O,aA as le,aB as ce,K as E,aC as ue,L as de,aD as pe,aa as he,s as M,a7 as fe,a8 as me,aE as ge,a9 as xe}from"./index-
|
|
1
|
+
import{ak as ee,A as T,r as f,a as te,b as se,V as S,u as j,x as re,aw as A,i as F,j as t,w as q,ax as oe,T as C,y as k,$,o as m,ay as ne,O as ae,v as _,C as N,az as ie,H as W,Y as O,aA as le,aB as ce,K as E,aC as ue,L as de,aD as pe,aa as he,s as M,a7 as fe,a8 as me,aE as ge,a9 as xe}from"./index-DaEjX2SO.js";import{u as L}from"./useLocalStorage-Df3_jlsm.js";import{C as be,c as ke,e as ye,_ as Se,a as je,d as we,s as ve,S as V,b as Pe,A as Ce}from"./item-D6K3xZvf.js";import{e as D}from"./engine-D2zNg6-2.js";import{g as U}from"./get-safe-url-nXPF2sGJ.js";import{P as z}from"./permission-DHDlX-2p.js";import{A as Re}from"./ArrowDropDown-CPeg07nO.js";import{B as Le}from"./Breadcrumbs-C7NX6NEA.js";import"./index-DLm3d5Lz.js";import"./KeyboardArrowDown-BCCwKNMP.js";import"./ChevronLeft-DaNTS9Ry.js";import"./ChevronRight-DMRng8w4.js";import"./Search-soT1P5WL.js";import"./index-CB9i2iit.js";import"./blocklet-4xcBoALi.js";import"./Autocomplete-DVV2RD2A.js";import"./ListSubheader-DVUYAhXC.js";import"./Verified-Blm2AEgo.js";import"./VerifiedUser-DitkeanA.js";import"./Add-Dv85KL5N.js";import"./Launch-Cy-Ri5E0.js";import"./Done-CEq9fQ91.js";import"./DeleteOutline-C9hdvFLW.js";import"./delete-confirm-CmK028cX.js";import"./click-to-copy-Xg1hTHwq.js";import"./MoreVert-D2cSYolp.js";import"./ButtonGroup-C6xSllEr.js";import"./getValidReactChildren-CIqQKAkN.js";function Be(e){const r=ee(),c=T(),[s,o]=L(`sid:blocklet:purchase:${e}`),[l,u]=f.useState(!1),[d,a]=f.useState(null),p=()=>{const{pathname:n,searchParams:b}=new URL(window.location.href),g=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";b.get("sid")&&(o(""),c(n.replace(g,"/"),{replace:!0}))},i=!!(r.get("assetDid")&&s&&r.get("sid")===s);return te(se.BlockletEvents.purchaseChange,n=>{n.did===e&&(a(n.session),["declined","confirmed","error"].includes(n.session.status)&&(u(!0),setTimeout(p,2e3)))}),f.useEffect(()=>{d&&d.id!==s&&o(d.id)},[d]),{hasCompleted:l,hasPurchased:i,session:d,setSession:a,doRedirect:p}}function De(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function K({meta:e,onCancel:r,handlePaySuccess:c=De,storeUrl:s}){const{t:o}=S(),{info:l}=j(),[u,d]=f.useState("both"),[a,p]=f.useState(1),i=re(l),n=A(e,l,s),b=P=>{P!==u&&d(P)},g=()=>{u&&(p(2),u==="verify"&&(window.location.href=U(n)))},w=(P,B)=>{B!=="backdropClick"&&r()},x=()=>{c(n)},h=F.getDisplayName({meta:e});if(u==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:oe.create({baseURL:k(s,"/store")}).get,onSuccess:x,onClose:r,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:i,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:h}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(C,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(C,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:o("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(be,{action:u,onNext:g,onSelect:b})})})}K.propTypes={...ke,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function H({meta:e,buttonText:r,storeUrl:c,isResource:s=!1}){const{t:o}=S(),l=T(),{info:u}=j(),{api:d}=ne(),a=F.isFreeBlocklet(e)===!1,[p,i]=f.useState(!1),{hasPurchased:n}=Be(e.did),[b,g]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[x,h]=f.useState(!1),v=f.useMemo(()=>p?o(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[p,o,a]),P=f.useMemo(()=>s?o("blocklet.status.resource"):a?r.purchase:r.launch,[a,r,s]),B=y=>{y.preventDefault(),y.stopPropagation();try{if(i(!0),a){g(!0);return}if(w){h(!0);return}if(!a){const R=A(e,u,c);window.location.href=U(R)}}catch(R){W.error(O(R),{autoHideDuration:5e3}),console.error("Blocklet installed failed",R)}finally{i(!1)}},J=()=>{i(!1),g(!1)},X=y=>{i(!1),h(!1),l(`/blocklets/${y.appDid}/components`)},Z=()=>{i(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(ye,{children:t.jsx(z,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:B,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(n||b)&&t.jsx(K,{method:"launch",meta:e,mode:"both",onCancel:J,storeUrl:c}),x&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:d.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Z})]})}H.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ee=(e,r,c)=>{const s=he(r);return k(c,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:r,value:c})=>e._formatted?e._formatted[r]:c,Ue=(e,r)=>{if(!e||!r)return"";try{return k(r,e)}catch(c){return console.warn("Failed to construct avatar URL:",c),""}};function G({blocklet:e,endpoint:r="",serverVersion:c=""}){const{t:s}=S(),o=j();let l=k(o.imgPrefix,"blocklet.png");const u=r;if(u.startsWith("http")&&e.logo)l=k(u,ue(e.did,e.logo,e.version));else{let n=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");n&&(n=`/${n}`),l=k(n,`/blocklet/logo/${e.did}`)}try{const i=new URL(l);i.searchParams.set("v",e.version||+new Date),l=i.href}catch{}const d=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),a={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:u},p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(je,{serverVersion:c,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(H,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...a})})});return t.jsx(de,{href:Ee(e,o.info,r),style:{color:"initial",textDecoration:"none"},onClick:d,target:"_blank",children:t.jsx(Ie,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?l:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(E,{sx:{display:"flex",color:"primary.main"},children:t.jsx(pe,{icon:we})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ue(e.owner.avatar,r),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:r=null,extraFilter:c=void 0,...s}){const{locale:o}=S(),l=j(),[u,d]=f.useState({}),a=n=>{d(n)},p=e,i=l?.info?.version;return f.useEffect(()=>{d({})},[p]),t.jsx(le,{FallbackComponent:ce,resetKeys:[p],children:t.jsx(E,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(Se,{layout:{showExplore:!1,showTitle:!0},blockletRender:n=>t.jsx(G,{...n,endpoint:p}),baseSearch:!0,endpoint:p,locale:o,onFilterChange:a,onSearchSelect:r,filters:u,extraFilter:c,serverVersion:i})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Ie=M(ve)`
|
|
2
2
|
.ms-highlight {
|
|
3
3
|
color: ${e=>e.theme.palette.primary.main};
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as le,j as e,hw as ce,be as ue,bo as Z,V as G,gk as ee,f9 as te,aP as re,aT as u,H as E,hx as M,K as R,t as x,hy as V,aV as H,P as p,O as de,v as W,s as ie,aW as ne,z as me,y as fe,aH as he,r as B,p as xe,bE as pe}from"./index-CCv_8omK.js";import{T as ve}from"./html-title-xzTyg8m0.js";import{u as se,C as m}from"./index.esm-Bsyk9Gld.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-DjVUQHBf.js";import{u as ae}from"./blocklet-D2MB-zOx.js";import{S as $}from"./Switch-B-AVsYNw.js";const Re=le(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function ke(){return J||(J=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(d){return d==null}c.exports=s.default,c.exports.default=s.default}(z,z.exports)),z.exports}var Q;function we(){return Q||(Q=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=S;var t=b(ce()),d=b(ke());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function S(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,a=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&a&&C}c.exports=s.default,c.exports.default=s.default}(O,O.exports)),O.exports}var X;function Te(){return X||(X=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=b;var t=d(we());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=s.default,c.exports.default=s.default}(K,K.exports)),K.exports}var Ee=Te();const Se=ue(Ee),D={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...D},s?.settings?.notification?.email||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(D))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(r,g,T=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...D},y?.settings?.notification?.email||{});q(oe),T&&E.success(t("oauth.saveSuccess"))}catch(y){if(T)E.error(y.message||t("oauth.saveFailed"));else throw y}}),N=u(async(r,g,T)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),E.success(t("notification.email.testSuccess"))}catch(y){E.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:T=>{l.testReceiver=T.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(T){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!M(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await N(r,g,y),T()}})}),F=u(r=>{const g=r?.trim();return g?M(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Se(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),k=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),w=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!M(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:a?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:a?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:a?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:a?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:a?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:a?w:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:a?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(W,{variant:"outlined",color:"warning",onClick:S(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(W,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,U={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...U},s?.settings?.notification?.pushKit||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(U))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(o,k,v=!0)=>{try{const{blocklet:w}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...U},w?.settings?.notification?.pushKit||{});q(I),v&&E.success(t("oauth.saveSuccess"))}catch(w){if(v)E.error(w.message||t("oauth.saveFailed"));else throw w}}),N=u(async(o,k)=>{try{i.isDirty&&await C(o,k,!1);const v=(s?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,w=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:w}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),E.success(t("notification.pushKit.testSuccess"))}catch(v){E.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,k)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await N(o,k),v()}})}),F=u(o=>{const k=o?.trim();return k?V(k)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:a?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(W,{variant:"outlined",color:"warning",onClick:S(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(W,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,Y=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,s]=B.useState(Y[0].value),{locale:t}=B.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=B.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:Y,current:c,onChange:s}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|
|
1
|
+
import{aF as le,j as e,hw as ce,be as ue,bo as Z,V as G,gk as ee,f9 as te,aP as re,aT as u,H as E,hx as M,K as R,t as x,hy as V,aV as H,P as p,O as de,v as W,s as ie,aW as ne,z as me,y as fe,aH as he,r as B,p as xe,bE as pe}from"./index-DaEjX2SO.js";import{T as ve}from"./html-title-D-skaBwb.js";import{u as se,C as m}from"./index.esm-Di7pxRR7.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-CvIW0hIW.js";import{u as ae}from"./blocklet-4xcBoALi.js";import{S as $}from"./Switch-CYCG_kxE.js";const Re=le(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function ke(){return J||(J=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(d){return d==null}c.exports=s.default,c.exports.default=s.default}(z,z.exports)),z.exports}var Q;function we(){return Q||(Q=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=S;var t=b(ce()),d=b(ke());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function S(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,a=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&a&&C}c.exports=s.default,c.exports.default=s.default}(O,O.exports)),O.exports}var X;function Te(){return X||(X=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=b;var t=d(we());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=s.default,c.exports.default=s.default}(K,K.exports)),K.exports}var Ee=Te();const Se=ue(Ee),D={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...D},s?.settings?.notification?.email||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(D))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(r,g,T=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...D},y?.settings?.notification?.email||{});q(oe),T&&E.success(t("oauth.saveSuccess"))}catch(y){if(T)E.error(y.message||t("oauth.saveFailed"));else throw y}}),N=u(async(r,g,T)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),E.success(t("notification.email.testSuccess"))}catch(y){E.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:T=>{l.testReceiver=T.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(T){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!M(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await N(r,g,y),T()}})}),F=u(r=>{const g=r?.trim();return g?M(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Se(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),k=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),w=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!M(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:a?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:a?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:a?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:a?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:a?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:a?w:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:a?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(W,{variant:"outlined",color:"warning",onClick:S(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(W,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,U={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...U},s?.settings?.notification?.pushKit||{}),{handleSubmit:S,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(U))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(o,k,v=!0)=>{try{const{blocklet:w}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...U},w?.settings?.notification?.pushKit||{});q(I),v&&E.success(t("oauth.saveSuccess"))}catch(w){if(v)E.error(w.message||t("oauth.saveFailed"));else throw w}}),N=u(async(o,k)=>{try{i.isDirty&&await C(o,k,!1);const v=(s?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,w=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:w}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),E.success(t("notification.pushKit.testSuccess"))}catch(v){E.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,k)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await N(o,k),v()}})}),F=u(o=>{const k=o?.trim();return k?V(k)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:S(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:a?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(W,{variant:"outlined",color:"warning",onClick:S(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(W,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,Y=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,s]=B.useState(Y[0].value),{locale:t}=B.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=B.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:Y,current:c,onChange:s}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|