most-box 0.3.7 → 0.3.8
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/README.md +1 -1
- package/out/about/index.html +6 -5
- package/out/admin/index.html +0 -0
- package/out/app/index.html +0 -0
- package/out/assets/AccountMenu-C3wvcWtn.js +1 -0
- package/out/assets/{AppShell-CKP_dglR.js → AppShell-BN1uaxn1.js} +1 -1
- package/out/assets/{AppTop-C03PsDr_.js → AppTop-iPNi3cv5.js} +1 -1
- package/out/assets/{CopyButton-ClwBN6Iy.js → CopyButton-BfQ-TOoR.js} +1 -1
- package/out/assets/{MarketingHeader-ChTIIzXG.js → MarketingHeader-Bh6LcQOj.js} +1 -1
- package/out/assets/{MarketingLayout-hkPAtieL.js → MarketingLayout-9X-D6xx4.js} +1 -1
- package/out/assets/{MilkdownEditor-X9MUH_0q.js → MilkdownEditor-4FuwE6Td.js} +1 -1
- package/out/assets/{OpenSidebarButton-CXBAjjCE.js → OpenSidebarButton-09yeNDLa.js} +1 -1
- package/out/assets/arrow-right-DcTPIyLV.js +1 -0
- package/out/assets/{arrow-up-down-DvLSz6Ma.js → arrow-up-down-gcWLrYup.js} +1 -1
- package/out/assets/{channelApi-C5eHetoJ.js → channelApi-DA2GY-k4.js} +1 -1
- package/out/assets/{chatNoteDraft-DTy6In5R.js → chatNoteDraft-D6FEmSXK.js} +1 -1
- package/out/assets/{circle-alert-DXVkx8p8.js → circle-alert-Dg9cBJgj.js} +1 -1
- package/out/assets/{copy-OwXDsstV.js → copy-BofKiKH_.js} +1 -1
- package/out/assets/{download-Cy2BlfKM.js → download-nQ9X-v0q.js} +1 -1
- package/out/assets/{downloadValidation-Dd43i9_9.js → downloadValidation-C0PecvKC.js} +1 -1
- package/out/assets/{external-link-D_AQSgxW.js → external-link-LcGMVTLE.js} +1 -1
- package/out/assets/{file-text-zvTER2mN.js → file-text-f1ij7Al1.js} +1 -1
- package/out/assets/{fingerprint-pattern-BT73ASEB.js → fingerprint-pattern-Z6NfIcxC.js} +1 -1
- package/out/assets/{folder-6pYYnS2-.js → folder-DGTODlX0.js} +1 -1
- package/out/assets/{folder-open-DOJ4bB58.js → folder-open-BKTeAP5z.js} +1 -1
- package/out/assets/{gamepad-2-BYqNgCQr.js → gamepad-2-q3ssU_CE.js} +1 -1
- package/out/assets/{hard-drive-DL1KJHmG.js → hard-drive-CMNAmPI5.js} +1 -1
- package/out/assets/{index-DJzLHA0V.js → index-CCU5Z4K-.js} +7 -6
- package/out/assets/{index.lazy-BQ_Dyw5C.js → index.lazy-1YPf8Ys8.js} +1 -1
- package/out/assets/{index.lazy-b811JgFg.js → index.lazy-7EjTGodD.js} +1 -1
- package/out/assets/{index.lazy-CT5TGyGl.js → index.lazy-B2-v2OGR.js} +1 -1
- package/out/assets/{index.lazy-CnpeKB4C.js → index.lazy-BBsa7aDt.js} +1 -1
- package/out/assets/{index.lazy-DYhpVW5B.js → index.lazy-BJh0zxMI.js} +1 -1
- package/out/assets/{index.lazy-C8luNCxY.js → index.lazy-BMh0Oy3C.js} +1 -1
- package/out/assets/{index.lazy-Cy249kq1.js → index.lazy-Bi5tHgok.js} +1 -1
- package/out/assets/{index.lazy-DA98XQ0Q.js → index.lazy-CbtY_wql.js} +1 -1
- package/out/assets/{index.lazy-psYKmxdW.js → index.lazy-CsgZmOLX.js} +1 -1
- package/out/assets/{index.lazy-Cgrv1NmQ.js → index.lazy-D9zm7DgW.js} +1 -1
- package/out/assets/{index.lazy-B8ud1tpC.js → index.lazy-DH1bcYry.js} +1 -1
- package/out/assets/{index.lazy-BEDWJZPP.js → index.lazy-DQA4yE6c.js} +1 -1
- package/out/assets/{index.lazy-CTLlLPjy.js → index.lazy-DhhSG0Me.js} +1 -1
- package/out/assets/{index.lazy-C0L9TDqK.js → index.lazy-Dl8LX4dH.js} +1 -1
- package/out/assets/{index.lazy-CwAN1t6l.js → index.lazy-Q-Lr-abQ.js} +2 -2
- package/out/assets/{loader-C4pED_QP.js → loader-DAMqAKH7.js} +1 -1
- package/out/assets/{lock-yG7M7GkB.js → lock-Cigqt_VP.js} +1 -1
- package/out/assets/{message-square-CfApq8Ou.js → message-square-0kQmuMcd.js} +1 -1
- package/out/assets/{mp-cEQteKUC.js → mp-CFhRibX9.js} +1 -1
- package/out/assets/{music-Br2x8TKX.js → music-U7NZcQ6S.js} +1 -1
- package/out/assets/{notebook-pen-Bcd3MrtD.js → notebook-pen-CMRWy6ni.js} +1 -1
- package/out/assets/play-B6IGTGxm.js +1 -0
- package/out/assets/{refresh-cw-CfkUlTK9.js → refresh-cw-Bxmcm8cn.js} +1 -1
- package/out/assets/{save-CfYzXcxH.js → save-CQyJvrmI.js} +1 -1
- package/out/assets/{saveLocalFile-DTgdBgO9.js → saveLocalFile-DkrpR5WS.js} +1 -1
- package/out/assets/search-CURHlVZZ.js +1 -0
- package/out/assets/{send-Bie9hgHI.js → send-yxXCy-t8.js} +1 -1
- package/out/assets/{shield-check-2-h_eEXp.js → shield-check-Cq1PKT30.js} +1 -1
- package/out/assets/{smartphone-CrsocYJo.js → smartphone-D9j5h2Pg.js} +1 -1
- package/out/assets/{trash-2-B9gno5q6.js → trash-2-DQI0V0Rl.js} +1 -1
- package/out/assets/{triangle-alert-BhNtjKm2.js → triangle-alert-D8P4Ikwc.js} +1 -1
- package/out/assets/{upload-BmufnMFu.js → upload-PpzkqJnf.js} +1 -1
- package/out/assets/{useAppStore-DNhyhD20.js → useAppStore-Pjif7nCR.js} +1 -1
- package/out/assets/{useChannelMessages-BrqZa2SG.js → useChannelMessages-Ea1I0HsF.js} +1 -1
- package/out/assets/{useGameRoom-B3wvUICl.js → useGameRoom-CqeouPP_.js} +1 -1
- package/out/assets/{wallet-D6HZocla.js → wallet-Ts6jdQzi.js} +1 -1
- package/out/assets/{wifi-CILQyKk0.js → wifi-B1v_i_dr.js} +1 -1
- package/out/chat/index.html +0 -0
- package/out/chat/join/demo/index.html +0 -0
- package/out/chat/join/index.html +0 -0
- package/out/download/index.html +6 -5
- package/out/game/gandengyan/index.html +0 -0
- package/out/game/index.html +0 -0
- package/out/game/zhajinhua/index.html +0 -0
- package/out/index.html +6 -5
- package/out/note/index.html +0 -0
- package/out/ping/index.html +6 -5
- package/out/profile/index.html +0 -0
- package/out/web3/index.html +0 -0
- package/package.json +1 -1
- package/out/assets/AccountMenu-D_rcXDZr.js +0 -1
- package/out/assets/arrow-right-BsHzC0ZL.js +0 -1
- package/out/assets/play-DSHtNcOe.js +0 -1
- package/out/assets/search-DLBOUfny.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-Bt-cYkS5.js";import{B as t,H as n,W as r}from"./useAppStore-
|
|
1
|
+
import{t as e}from"./jsx-runtime-Bt-cYkS5.js";import{B as t,H as n,W as r}from"./useAppStore-Pjif7nCR.js";import{a as i}from"./i18n-DKsg67mH.js";import{t as a}from"./fingerprint-pattern-Z6NfIcxC.js";import{a as o}from"./AccountMenu-C3wvcWtn.js";import{t as s}from"./arrow-right-DcTPIyLV.js";import{t as c}from"./download-nQ9X-v0q.js";import{t as l}from"./gamepad-2-q3ssU_CE.js";import{t as u}from"./message-square-0kQmuMcd.js";import{t as d}from"./notebook-pen-CMRWy6ni.js";import{t as f}from"./wallet-Ts6jdQzi.js";import{t as p}from"./AppTop-iPNi3cv5.js";import{t as m}from"./MarketingLayout-9X-D6xx4.js";var h=t(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),g=t(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),_=e(),v=[`about.summary.cid`,`about.summary.seed`,`about.summary.toolbox`,`about.summary.opensource`],y=[{icon:(0,_.jsx)(a,{size:22}),titleKey:`about.section.identity.title`,bodyKey:`about.section.identity.body`,bulletKeys:[`about.section.identity.bullet.filename`,`about.section.identity.bullet.verify`,`about.section.identity.bullet.local`]},{icon:(0,_.jsx)(g,{size:22}),titleKey:`about.section.spread.title`,bodyKey:`about.section.spread.body`,bulletKeys:[`about.section.spread.bullet.seedAfterDownload`,`about.section.spread.bullet.restart`,`about.section.spread.bullet.status`]},{icon:(0,_.jsx)(h,{size:22}),titleKey:`about.section.boundary.title`,bodyKey:`about.section.boundary.body`,bulletKeys:[`about.section.boundary.bullet.keepData`,`about.section.boundary.bullet.noMarket`,`about.section.boundary.bullet.availability`]},{icon:(0,_.jsx)(u,{size:22}),titleKey:`about.section.chat.title`,bodyKey:`about.section.chat.body`,bulletKeys:[`about.section.chat.bullet.room`,`about.section.chat.bullet.voice`,`about.section.chat.bullet.attachments`]},{icon:(0,_.jsx)(d,{size:22}),titleKey:`about.section.note.title`,bodyKey:`about.section.note.body`,bulletKeys:[`about.section.note.bullet.markdown`,`about.section.note.bullet.fromChat`,`about.section.note.bullet.backup`]},{icon:(0,_.jsx)(l,{size:22}),titleKey:`about.section.game.title`,bodyKey:`about.section.game.body`,bulletKeys:[`about.section.game.bullet.channel`,`about.section.game.bullet.rooms`,`about.section.game.bullet.lightweight`]},{icon:(0,_.jsx)(f,{size:22}),titleKey:`about.section.web3.title`,bodyKey:`about.section.web3.body`,bulletKeys:[`about.section.web3.bullet.accounts`,`about.section.web3.bullet.integrate`,`about.section.web3.bullet.export`,`about.section.web3.bullet.separate`],featured:!0}];function b(){let{t:e}=i();return(0,_.jsx)(m,{header:(0,_.jsx)(x,{}),children:(0,_.jsxs)(`div`,{className:`about-page`,children:[(0,_.jsx)(`section`,{className:`about-hero`,children:(0,_.jsxs)(`div`,{className:`mkt-container`,children:[(0,_.jsx)(`p`,{className:`about-kicker`,children:e(`about.hero.kicker`)}),(0,_.jsx)(`h1`,{className:`about-title`,children:e(`about.hero.title`)}),(0,_.jsx)(`p`,{className:`about-lede`,children:e(`about.hero.desc`)}),(0,_.jsx)(`code`,{className:`about-link-example`,translate:`no`,children:e(`about.link.example`)}),(0,_.jsx)(`ul`,{className:`about-summary`,children:v.map(t=>(0,_.jsxs)(`li`,{className:`about-summary-item`,children:[(0,_.jsx)(`span`,{className:`about-summary-icon`,children:(0,_.jsx)(o,{size:15,strokeWidth:3})}),(0,_.jsx)(`span`,{children:e(t)})]},t))})]})}),(0,_.jsx)(`section`,{className:`about-section-band`,children:(0,_.jsxs)(`div`,{className:`mkt-container`,children:[(0,_.jsx)(`div`,{className:`about-section-grid`,children:y.map(t=>(0,_.jsxs)(`article`,{className:t.featured?`about-topic featured`:`about-topic`,children:[(0,_.jsx)(`div`,{className:`about-topic-icon`,children:t.icon}),(0,_.jsx)(`h2`,{children:e(t.titleKey)}),(0,_.jsx)(`p`,{children:e(t.bodyKey)}),(0,_.jsx)(`ul`,{children:t.bulletKeys.map(t=>(0,_.jsxs)(`li`,{children:[(0,_.jsx)(o,{size:14,strokeWidth:3}),(0,_.jsx)(`span`,{children:e(t)})]},t))})]},t.titleKey))}),(0,_.jsxs)(`div`,{className:`about-actions`,children:[(0,_.jsxs)(r,{to:`/chat/`,className:`btn btn-primary`,children:[e(`about.cta.chat`),(0,_.jsx)(s,{size:16})]}),(0,_.jsxs)(r,{to:`/download/`,className:`btn btn-secondary`,children:[(0,_.jsx)(c,{size:16}),e(`about.cta.download`)]})]})]})})]})})}function x(){return(0,_.jsx)(`header`,{className:`about-app-header`,children:(0,_.jsx)(`div`,{className:`mkt-container`,children:(0,_.jsx)(p,{})})})}var S=n(`/about/`)({component:b});export{S as Route};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,H as i}from"./useAppStore-DNhyhD20.js";import{a}from"./i18n-DKsg67mH.js";import{n as o,t as s}from"./smartphone-CrsocYJo.js";import{t as c}from"./message-square-CfApq8Ou.js";import{t as l}from"./music-Br2x8TKX.js";import{t as u}from"./play-DSHtNcOe.js";import{t as d}from"./search-DLBOUfny.js";import{t as f}from"./send-Bie9hgHI.js";import{t as p}from"./wifi-CILQyKk0.js";import{t as m}from"./MarketingLayout-hkPAtieL.js";var h=r(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),g=r(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),_=r(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),v=r(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),y=r(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),b=r(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),x=r(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),ee=r(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),te=r(`triangle`,[[`path`,{d:`M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z`,key:`14u9p9`}]]),S=t(e(),1);function ne(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var re=Object.freeze({left:0,top:0,width:16,height:16}),C=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),w=Object.freeze({...re,...C}),T=Object.freeze({...w,body:``,hidden:!1});function ie(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function E(e,t){let n=ie(e,t);for(let r in T)r in C?r in e&&!(r in n)&&(n[r]=C[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ae(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=E(r[e]||i[e],a)}return o(t),n.forEach(o),E(e,a)}function oe(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=ne(e);for(let i in r){let a=r[i];a&&(t(i,ae(e,i,a)),n.push(i))}return n}var se={provider:``,aliases:{},not_found:{},...re};function D(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function O(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!D(e,se))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!D(t,T))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!D(t,T))return null}return t}var k=Object.create(null);function ce(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function A(e,t){let n=k[e]||(k[e]=Object.create(null));return n[t]||(n[t]=ce(e,t))}function le(e,t){return O(t)?oe(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function ue(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var de=/^[a-z0-9]+(-[a-z0-9]+)*$/,j=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!M(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!M(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!M(e,n)?null:e}return null},M=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,N=!1;function P(e){return typeof e==`boolean`&&(N=e),N}function F(e){let t=typeof e==`string`?j(e,!0,N):e;if(t){let e=A(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function fe(e,t){let n=j(e,!0,N);if(!n)return!1;let r=A(n.provider,n.prefix);return t?ue(r,n.name,t):(r.missing.add(n.name),!0)}function pe(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),N&&!t&&!e.prefix){let t=!1;return O(e)&&(e.prefix=``,oe(e,(e,n)=>{fe(e,n)&&(t=!0)})),t}let n=e.prefix;return M({prefix:n,name:`a`})?!!le(A(t,n),e):!1}var I=Object.freeze({width:null,height:null}),L=Object.freeze({...I,...C}),me=/(-?[0-9.]*[0-9]+[0-9.]*)/g,he=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function R(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(me);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=he.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function ge(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function _e(e,t){return e?`<defs>`+e+`</defs>`+t:t}function ve(e,t,n){let r=ge(e);return _e(r.defs,t+r.content+n)}var ye=e=>e===`unset`||e===`undefined`||e===`none`;function be(e,t){let n={...w,...e},r={...L,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=ve(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=R(d,c/l)):(u=o===`auto`?c:o,d=s===null?R(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{ye(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var xe=/\sid="(\S+)"/g,Se=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Ce=0;function we(e,t=Se){let n=[],r;for(;r=xe.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Ce++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var z=Object.create(null);function Te(e,t){z[e]=t}function B(e){return z[e]||z[``]}function V(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var H=Object.create(null),U=[`https://api.simplesvg.com`,`https://api.unisvg.com`],W=[];U.length>0;)U.length===1||Math.random()>.5?W.push(U.shift()):W.push(U.pop());H[``]=V({resources:[`https://api.iconify.design`].concat(W)});function Ee(e,t){let n=V(t);return n===null?!1:(H[e]=n,!0)}function G(e){return H[e]}var K=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function De(e,t){let n=G(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function Oe(e){return e===404}var ke=(e,t,n)=>{let r=[],i=De(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Ae(e){if(typeof e==`string`){let t=G(e);if(t)return t.path}return`/`}var je={prepare:ke,send:(e,t,n)=>{if(!K){n(`abort`,424);return}let r=Ae(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;K(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(Oe(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function q(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Me(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||q([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Ne=0;function Pe(e,t,n){let r=Ne++,i=q.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function Fe(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=A(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function Ie(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?j(e,t,n):e;i&&r.push(i)}),r}var Le={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Re(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function ze(e){let t={...Le,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Re(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Be(){}var J=Object.create(null);function Ve(e){if(!J[e]){let t=G(e);if(!t)return;J[e]={config:t,redundancy:ze(t)}}return J[e]}function He(e,t,n){let r,i;if(typeof e==`string`){let t=B(e);if(!t)return n(void 0,424),Be;i=t.send;let a=Ve(e);a&&(r=a.redundancy)}else{let t=V(e);if(t){r=ze(t);let n=B(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Be):r.query(t,i,n)().abort}function Ue(){}function We(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Me(e)}))}function Ge(e){let t=[],n=[];return e.forEach(e=>{(e.match(de)?t:n).push(e)}),{valid:t,invalid:n}}function Y(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!le(e,n).length){r();return}}catch(e){console.error(e)}r(),We(e)}function Ke(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function qe(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){Ke(e.loadIcons(r,n,t),t=>{Y(e,r,t)});return}if(i){r.forEach(r=>{Ke(i(r,n,t),t=>{Y(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Ge(r);if(o.length&&Y(e,o,null),!a.length)return;let s=n.match(de)?B(t):null;if(!s){Y(e,a,null);return}s.prepare(t,n,a).forEach(n=>{He(t,n,t=>{Y(e,n.icons,t)})})}))}var Je=(e,t)=>{let n=Fe(Ie(e,!0,P()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Ue)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(A(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=A(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&qe(e,t)}),t?Pe(t,n,i):Ue};function Ye(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in I?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Xe=/[\s,]+/;function Ze(e,t){t.split(Xe).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function Qe(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function $e(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function et(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function tt(e){return`data:image/svg+xml,`+et(e)}function nt(e){return`url("`+tt(e)+`")`}var X;function rt(){try{X=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{X=null}}function it(e){return X===void 0&&rt(),X?X.createHTML(e):e}var at={...L,inline:!1},ot={xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},st={display:`inline-block`},Z={backgroundColor:`currentColor`},ct={backgroundColor:`transparent`},lt={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},ut={WebkitMask:Z,mask:Z,background:ct};for(let e in ut){let t=ut[e];for(let n in lt)t[e+n]=lt[n]}var dt={...at,inline:!0};function ft(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var pt=(e,t,n)=>{let r=t.inline?dt:at,i=Ye(r,t),a=t.mode||`svg`,o={},s=t.style||{},c={...a===`svg`?ot:{}};if(n){let e=j(n,!1,!0);if(e){let t=[`iconify`];for(let n of[`provider`,`prefix`])e[n]&&t.push(`iconify--`+e[n]);c.className=t.join(` `)}}for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`children`:case`onLoad`:case`mode`:case`ssr`:case`fallback`:break;case`_ref`:c.ref=n;break;case`className`:c[e]=(c[e]?c[e]+` `:``)+n;break;case`inline`:case`hFlip`:case`vFlip`:i[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&Ze(i,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?i[e]=Qe(n):typeof n==`number`&&(i[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete c[`aria-hidden`];break;default:r[e]===void 0&&(c[e]=n)}}let l=be(e,i),u=l.attributes;if(i.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){c.style={...o,...s},Object.assign(c,u);let e=0,n=t.id;return typeof n==`string`&&(n=n.replace(/-/g,`_`)),c.dangerouslySetInnerHTML={__html:it(we(l.body,n?()=>n+`ID`+e++:`iconifyReact`))},(0,S.createElement)(`svg`,c)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=$e(d,{...u,width:f+``,height:p+``});return c.style={...o,"--svg":nt(h),width:ft(u.width),height:ft(u.height),...st,...m?Z:ct,...s},(0,S.createElement)(`span`,c)};if(P(!0),Te(``,je),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!pe(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Ee(e,r)||console.error(n)}catch{console.error(n)}}}}function mt(e){let[t,n]=(0,S.useState)(!!e.ssr),[r,i]=(0,S.useState)({});function a(t){if(t){let t=e.icon;if(typeof t==`object`)return{name:``,data:t};let n=F(t);if(n)return{name:t,data:n}}return{name:``}}let[o,s]=(0,S.useState)(a(!!e.ssr));function c(){let e=r.callback;e&&(e(),i({}))}function l(e){if(JSON.stringify(o)!==JSON.stringify(e))return c(),s(e),!0}function u(){var t;let n=e.icon;if(typeof n==`object`){l({name:``,data:n});return}let r=F(n);l({name:n,data:r})&&(r===void 0?i({callback:Je([n],u)}):r&&((t=e.onLoad)==null||t.call(e,n)))}(0,S.useEffect)(()=>(n(!0),c),[]),(0,S.useEffect)(()=>{t&&u()},[e.icon,t]);let{name:d,data:f}=o;return f?pt({...w,...f},e,d):e.children?e.children:e.fallback?e.fallback:(0,S.createElement)(`span`,{})}var ht=(0,S.forwardRef)((e,t)=>mt({...e,_ref:t}));(0,S.forwardRef)((e,t)=>mt({inline:!0,...e,_ref:t}));var Q=n(),$=[{name:`Google`,host:`google.com`,icon:`simple-icons:google`,fallback:(0,Q.jsx)(d,{size:20})},{name:`Cloudflare`,host:`cloudflare.com`,icon:`simple-icons:cloudflare`,fallback:(0,Q.jsx)(o,{size:20})},{name:`YouTube`,host:`youtube.com`,icon:`simple-icons:youtube`,fallback:(0,Q.jsx)(u,{size:20})},{name:`GitHub`,host:`github.com`,icon:`simple-icons:github`,fallback:(0,Q.jsx)(ee,{size:20})},{name:`ChatGPT`,host:`chatgpt.com`,icon:`simple-icons:openai`,fallback:(0,Q.jsx)(_,{size:20})},{name:`X`,host:`x.com`,icon:`simple-icons:x`,fallback:(0,Q.jsx)(h,{size:20})},{name:`Instagram`,host:`instagram.com`,icon:`simple-icons:instagram`,fallback:(0,Q.jsx)(v,{size:20})},{name:`Reddit`,host:`reddit.com`,icon:`simple-icons:reddit`,fallback:(0,Q.jsx)(c,{size:20})},{name:`Wikipedia`,host:`wikipedia.org`,icon:`simple-icons:wikipedia`,fallback:(0,Q.jsx)(g,{size:20})},{name:`Apple`,host:`apple.com`,icon:`simple-icons:apple`,fallback:(0,Q.jsx)(s,{size:20})},{name:`Telegram`,host:`telegram.org`,icon:`simple-icons:telegram`,fallback:(0,Q.jsx)(f,{size:20})},{name:`Discord`,host:`discord.com`,icon:`simple-icons:discord`,fallback:(0,Q.jsx)(y,{size:20})},{name:`TikTok`,host:`tiktok.com`,icon:`simple-icons:tiktok`,fallback:(0,Q.jsx)(l,{size:20})},{name:`npm`,host:`npmjs.com`,icon:`simple-icons:npm`,fallback:(0,Q.jsx)(b,{size:20})},{name:`Vercel`,host:`vercel.com`,icon:`simple-icons:vercel`,fallback:(0,Q.jsx)(te,{size:20})}],gt=5e3;function _t({icon:e,fallback:t}){let[n,r]=(0,S.useState)(!1);return(0,S.useEffect)(()=>{let t=new Image;t.onload=()=>r(!0),t.onerror=()=>r(!1),t.src=`https://api.iconify.design/${e.replace(`:`,`/`)}.svg`},[e]),(0,Q.jsxs)(`span`,{className:`brand-icon-wrap`,children:[(0,Q.jsx)(`span`,{className:`brand-icon-fallback ${n?`hidden`:``}`,children:t}),(0,Q.jsx)(`span`,{className:`brand-icon-real ${n?`visible`:``}`,children:(0,Q.jsx)(ht,{icon:e,width:20,height:20})})]})}function vt(){let{t:e,formatNumber:t}=a(),[n,r]=(0,S.useState)(new Map),[i,o]=(0,S.useState)(!1),s=(0,S.useRef)(new Map);(0,S.useEffect)(()=>{document.title=e(`ping.meta.title`)},[e]);let c=(0,S.useCallback)(e=>{r(t=>{let n=new Map(t);return n.set(e,{status:`pending`,latency:0}),n});let t=new AbortController;s.current.set(e,t);let n=performance.now(),i=(t,n)=>{r(r=>{let i=new Map(r);return i.set(e,{status:t,latency:n}),i})},a=setTimeout(()=>{t.abort()},gt);fetch(`https://${e}/`,{method:`HEAD`,mode:`no-cors`,cache:`no-store`,signal:t.signal}).then(()=>{clearTimeout(a),i(`ok`,Math.round(performance.now()-n))}).catch(()=>{clearTimeout(a),i(`timeout`,0)})},[]),l=(0,S.useCallback)(()=>{o(!0);let e=new Map;$.forEach(t=>{e.set(t.host,{status:`pending`,latency:0})}),r(e);let t=new Set($.map(e=>e.host));$.forEach(e=>{let n=new AbortController;s.current.set(e.host,n);let i=performance.now(),a=(n,i)=>{t.has(e.host)&&(t.delete(e.host),r(t=>{let r=new Map(t);return r.set(e.host,{status:n,latency:i}),r}),t.size===0&&o(!1))},c=setTimeout(()=>{n.abort()},gt);fetch(`https://${e.host}/`,{method:`HEAD`,mode:`no-cors`,cache:`no-store`,signal:n.signal}).then(()=>{clearTimeout(c),a(`ok`,Math.round(performance.now()-i))}).catch(()=>{clearTimeout(c),a(`timeout`,0)})})},[]);return(0,S.useEffect)(()=>(l(),()=>{s.current.forEach(e=>e.abort()),s.current.clear()}),[l]),(0,Q.jsxs)(`div`,{className:`ping-page`,children:[(0,Q.jsxs)(`div`,{className:`ping-header`,children:[(0,Q.jsxs)(`div`,{className:`ping-title-wrap`,children:[(0,Q.jsx)(p,{size:28,className:`ping-title-icon`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`ping-title`,children:e(`ping.title`)}),(0,Q.jsx)(`p`,{className:`ping-subtitle`,children:e(`ping.subtitle`)})]})]}),(0,Q.jsx)(`button`,{className:`btn btn-icon`,onClick:l,disabled:i,"aria-label":e(`ping.retryAll`),title:e(`ping.retryAll`),children:(0,Q.jsx)(x,{size:18,className:i?`ping-spin`:``})})]}),(0,Q.jsx)(`div`,{className:`ping-grid`,children:$.map(r=>{let i=n.get(r.host),a=!i||i.status===`pending`,o=i?.status===`timeout`;return(0,Q.jsxs)(`div`,{className:`ping-card ${a?`pending`:``}`,children:[(0,Q.jsxs)(`div`,{className:`ping-card-top`,children:[(0,Q.jsx)(`span`,{className:`ping-card-icon`,children:(0,Q.jsx)(_t,{icon:r.icon,fallback:r.fallback})}),(0,Q.jsx)(`a`,{href:`https://${r.host}`,target:`_blank`,rel:`noreferrer`,className:`ping-card-name`,children:r.name}),(0,Q.jsx)(`button`,{className:`ping-card-refresh`,onClick:()=>c(r.host),disabled:a,"aria-label":e(`ping.retryOne`,{name:r.name}),title:e(`ping.retry`),children:(0,Q.jsx)(x,{size:13,className:a?`ping-spin`:``})})]}),(0,Q.jsxs)(`div`,{className:`ping-card-bottom`,children:[a?(0,Q.jsx)(`span`,{className:`ping-pulse-dot`}):(0,Q.jsx)(`span`,{className:`ping-status-label ${o?`is-error`:`is-success`}`,children:e(o?`ping.unavailable`:`ping.available`)}),(0,Q.jsx)(`span`,{className:`ping-latency ${a?`is-muted`:o?`is-error`:`is-success`}`,children:a?`--`:o?e(`ping.timeout`):`${t(i.latency)} ms`})]})]},r.host)})})]})}function yt(){return(0,Q.jsx)(m,{children:(0,Q.jsx)(vt,{})})}var bt=i(`/ping/`)({component:yt});export{bt as Route};
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,H as i}from"./useAppStore-Pjif7nCR.js";import{a}from"./i18n-DKsg67mH.js";import{n as o,t as s}from"./smartphone-D9j5h2Pg.js";import{t as c}from"./message-square-0kQmuMcd.js";import{t as l}from"./music-U7NZcQ6S.js";import{t as u}from"./play-B6IGTGxm.js";import{t as d}from"./search-CURHlVZZ.js";import{t as f}from"./send-yxXCy-t8.js";import{t as p}from"./wifi-B1v_i_dr.js";import{t as m}from"./MarketingLayout-9X-D6xx4.js";var h=r(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),g=r(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),_=r(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),v=r(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),y=r(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),b=r(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),x=r(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),ee=r(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),te=r(`triangle`,[[`path`,{d:`M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z`,key:`14u9p9`}]]),S=t(e(),1);function ne(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var re=Object.freeze({left:0,top:0,width:16,height:16}),C=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),w=Object.freeze({...re,...C}),T=Object.freeze({...w,body:``,hidden:!1});function ie(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function E(e,t){let n=ie(e,t);for(let r in T)r in C?r in e&&!(r in n)&&(n[r]=C[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ae(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=E(r[e]||i[e],a)}return o(t),n.forEach(o),E(e,a)}function oe(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=ne(e);for(let i in r){let a=r[i];a&&(t(i,ae(e,i,a)),n.push(i))}return n}var se={provider:``,aliases:{},not_found:{},...re};function D(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function O(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!D(e,se))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!D(t,T))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!D(t,T))return null}return t}var k=Object.create(null);function ce(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function A(e,t){let n=k[e]||(k[e]=Object.create(null));return n[t]||(n[t]=ce(e,t))}function le(e,t){return O(t)?oe(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function ue(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var de=/^[a-z0-9]+(-[a-z0-9]+)*$/,j=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!M(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!M(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!M(e,n)?null:e}return null},M=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,N=!1;function P(e){return typeof e==`boolean`&&(N=e),N}function F(e){let t=typeof e==`string`?j(e,!0,N):e;if(t){let e=A(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function fe(e,t){let n=j(e,!0,N);if(!n)return!1;let r=A(n.provider,n.prefix);return t?ue(r,n.name,t):(r.missing.add(n.name),!0)}function pe(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),N&&!t&&!e.prefix){let t=!1;return O(e)&&(e.prefix=``,oe(e,(e,n)=>{fe(e,n)&&(t=!0)})),t}let n=e.prefix;return M({prefix:n,name:`a`})?!!le(A(t,n),e):!1}var I=Object.freeze({width:null,height:null}),L=Object.freeze({...I,...C}),me=/(-?[0-9.]*[0-9]+[0-9.]*)/g,he=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function R(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(me);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=he.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function ge(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function _e(e,t){return e?`<defs>`+e+`</defs>`+t:t}function ve(e,t,n){let r=ge(e);return _e(r.defs,t+r.content+n)}var ye=e=>e===`unset`||e===`undefined`||e===`none`;function be(e,t){let n={...w,...e},r={...L,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=ve(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=R(d,c/l)):(u=o===`auto`?c:o,d=s===null?R(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{ye(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var xe=/\sid="(\S+)"/g,Se=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Ce=0;function we(e,t=Se){let n=[],r;for(;r=xe.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Ce++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var z=Object.create(null);function Te(e,t){z[e]=t}function B(e){return z[e]||z[``]}function V(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var H=Object.create(null),U=[`https://api.simplesvg.com`,`https://api.unisvg.com`],W=[];U.length>0;)U.length===1||Math.random()>.5?W.push(U.shift()):W.push(U.pop());H[``]=V({resources:[`https://api.iconify.design`].concat(W)});function Ee(e,t){let n=V(t);return n===null?!1:(H[e]=n,!0)}function G(e){return H[e]}var K=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function De(e,t){let n=G(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function Oe(e){return e===404}var ke=(e,t,n)=>{let r=[],i=De(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Ae(e){if(typeof e==`string`){let t=G(e);if(t)return t.path}return`/`}var je={prepare:ke,send:(e,t,n)=>{if(!K){n(`abort`,424);return}let r=Ae(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;K(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(Oe(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function q(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Me(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||q([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Ne=0;function Pe(e,t,n){let r=Ne++,i=q.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function Fe(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=A(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function Ie(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?j(e,t,n):e;i&&r.push(i)}),r}var Le={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Re(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function ze(e){let t={...Le,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Re(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Be(){}var J=Object.create(null);function Ve(e){if(!J[e]){let t=G(e);if(!t)return;J[e]={config:t,redundancy:ze(t)}}return J[e]}function He(e,t,n){let r,i;if(typeof e==`string`){let t=B(e);if(!t)return n(void 0,424),Be;i=t.send;let a=Ve(e);a&&(r=a.redundancy)}else{let t=V(e);if(t){r=ze(t);let n=B(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Be):r.query(t,i,n)().abort}function Ue(){}function We(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Me(e)}))}function Ge(e){let t=[],n=[];return e.forEach(e=>{(e.match(de)?t:n).push(e)}),{valid:t,invalid:n}}function Y(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!le(e,n).length){r();return}}catch(e){console.error(e)}r(),We(e)}function Ke(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function qe(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){Ke(e.loadIcons(r,n,t),t=>{Y(e,r,t)});return}if(i){r.forEach(r=>{Ke(i(r,n,t),t=>{Y(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Ge(r);if(o.length&&Y(e,o,null),!a.length)return;let s=n.match(de)?B(t):null;if(!s){Y(e,a,null);return}s.prepare(t,n,a).forEach(n=>{He(t,n,t=>{Y(e,n.icons,t)})})}))}var Je=(e,t)=>{let n=Fe(Ie(e,!0,P()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Ue)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(A(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=A(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&qe(e,t)}),t?Pe(t,n,i):Ue};function Ye(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in I?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Xe=/[\s,]+/;function Ze(e,t){t.split(Xe).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function Qe(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function $e(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function et(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function tt(e){return`data:image/svg+xml,`+et(e)}function nt(e){return`url("`+tt(e)+`")`}var X;function rt(){try{X=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{X=null}}function it(e){return X===void 0&&rt(),X?X.createHTML(e):e}var at={...L,inline:!1},ot={xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},st={display:`inline-block`},Z={backgroundColor:`currentColor`},ct={backgroundColor:`transparent`},lt={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},ut={WebkitMask:Z,mask:Z,background:ct};for(let e in ut){let t=ut[e];for(let n in lt)t[e+n]=lt[n]}var dt={...at,inline:!0};function ft(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var pt=(e,t,n)=>{let r=t.inline?dt:at,i=Ye(r,t),a=t.mode||`svg`,o={},s=t.style||{},c={...a===`svg`?ot:{}};if(n){let e=j(n,!1,!0);if(e){let t=[`iconify`];for(let n of[`provider`,`prefix`])e[n]&&t.push(`iconify--`+e[n]);c.className=t.join(` `)}}for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`children`:case`onLoad`:case`mode`:case`ssr`:case`fallback`:break;case`_ref`:c.ref=n;break;case`className`:c[e]=(c[e]?c[e]+` `:``)+n;break;case`inline`:case`hFlip`:case`vFlip`:i[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&Ze(i,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?i[e]=Qe(n):typeof n==`number`&&(i[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete c[`aria-hidden`];break;default:r[e]===void 0&&(c[e]=n)}}let l=be(e,i),u=l.attributes;if(i.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){c.style={...o,...s},Object.assign(c,u);let e=0,n=t.id;return typeof n==`string`&&(n=n.replace(/-/g,`_`)),c.dangerouslySetInnerHTML={__html:it(we(l.body,n?()=>n+`ID`+e++:`iconifyReact`))},(0,S.createElement)(`svg`,c)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=$e(d,{...u,width:f+``,height:p+``});return c.style={...o,"--svg":nt(h),width:ft(u.width),height:ft(u.height),...st,...m?Z:ct,...s},(0,S.createElement)(`span`,c)};if(P(!0),Te(``,je),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!pe(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Ee(e,r)||console.error(n)}catch{console.error(n)}}}}function mt(e){let[t,n]=(0,S.useState)(!!e.ssr),[r,i]=(0,S.useState)({});function a(t){if(t){let t=e.icon;if(typeof t==`object`)return{name:``,data:t};let n=F(t);if(n)return{name:t,data:n}}return{name:``}}let[o,s]=(0,S.useState)(a(!!e.ssr));function c(){let e=r.callback;e&&(e(),i({}))}function l(e){if(JSON.stringify(o)!==JSON.stringify(e))return c(),s(e),!0}function u(){var t;let n=e.icon;if(typeof n==`object`){l({name:``,data:n});return}let r=F(n);l({name:n,data:r})&&(r===void 0?i({callback:Je([n],u)}):r&&((t=e.onLoad)==null||t.call(e,n)))}(0,S.useEffect)(()=>(n(!0),c),[]),(0,S.useEffect)(()=>{t&&u()},[e.icon,t]);let{name:d,data:f}=o;return f?pt({...w,...f},e,d):e.children?e.children:e.fallback?e.fallback:(0,S.createElement)(`span`,{})}var ht=(0,S.forwardRef)((e,t)=>mt({...e,_ref:t}));(0,S.forwardRef)((e,t)=>mt({inline:!0,...e,_ref:t}));var Q=n(),$=[{name:`Google`,host:`google.com`,icon:`simple-icons:google`,fallback:(0,Q.jsx)(d,{size:20})},{name:`Cloudflare`,host:`cloudflare.com`,icon:`simple-icons:cloudflare`,fallback:(0,Q.jsx)(o,{size:20})},{name:`YouTube`,host:`youtube.com`,icon:`simple-icons:youtube`,fallback:(0,Q.jsx)(u,{size:20})},{name:`GitHub`,host:`github.com`,icon:`simple-icons:github`,fallback:(0,Q.jsx)(ee,{size:20})},{name:`ChatGPT`,host:`chatgpt.com`,icon:`simple-icons:openai`,fallback:(0,Q.jsx)(_,{size:20})},{name:`X`,host:`x.com`,icon:`simple-icons:x`,fallback:(0,Q.jsx)(h,{size:20})},{name:`Instagram`,host:`instagram.com`,icon:`simple-icons:instagram`,fallback:(0,Q.jsx)(v,{size:20})},{name:`Reddit`,host:`reddit.com`,icon:`simple-icons:reddit`,fallback:(0,Q.jsx)(c,{size:20})},{name:`Wikipedia`,host:`wikipedia.org`,icon:`simple-icons:wikipedia`,fallback:(0,Q.jsx)(g,{size:20})},{name:`Apple`,host:`apple.com`,icon:`simple-icons:apple`,fallback:(0,Q.jsx)(s,{size:20})},{name:`Telegram`,host:`telegram.org`,icon:`simple-icons:telegram`,fallback:(0,Q.jsx)(f,{size:20})},{name:`Discord`,host:`discord.com`,icon:`simple-icons:discord`,fallback:(0,Q.jsx)(y,{size:20})},{name:`TikTok`,host:`tiktok.com`,icon:`simple-icons:tiktok`,fallback:(0,Q.jsx)(l,{size:20})},{name:`npm`,host:`npmjs.com`,icon:`simple-icons:npm`,fallback:(0,Q.jsx)(b,{size:20})},{name:`Vercel`,host:`vercel.com`,icon:`simple-icons:vercel`,fallback:(0,Q.jsx)(te,{size:20})}],gt=5e3;function _t({icon:e,fallback:t}){let[n,r]=(0,S.useState)(!1);return(0,S.useEffect)(()=>{let t=new Image;t.onload=()=>r(!0),t.onerror=()=>r(!1),t.src=`https://api.iconify.design/${e.replace(`:`,`/`)}.svg`},[e]),(0,Q.jsxs)(`span`,{className:`brand-icon-wrap`,children:[(0,Q.jsx)(`span`,{className:`brand-icon-fallback ${n?`hidden`:``}`,children:t}),(0,Q.jsx)(`span`,{className:`brand-icon-real ${n?`visible`:``}`,children:(0,Q.jsx)(ht,{icon:e,width:20,height:20})})]})}function vt(){let{t:e,formatNumber:t}=a(),[n,r]=(0,S.useState)(new Map),[i,o]=(0,S.useState)(!1),s=(0,S.useRef)(new Map);(0,S.useEffect)(()=>{document.title=e(`ping.meta.title`)},[e]);let c=(0,S.useCallback)(e=>{r(t=>{let n=new Map(t);return n.set(e,{status:`pending`,latency:0}),n});let t=new AbortController;s.current.set(e,t);let n=performance.now(),i=(t,n)=>{r(r=>{let i=new Map(r);return i.set(e,{status:t,latency:n}),i})},a=setTimeout(()=>{t.abort()},gt);fetch(`https://${e}/`,{method:`HEAD`,mode:`no-cors`,cache:`no-store`,signal:t.signal}).then(()=>{clearTimeout(a),i(`ok`,Math.round(performance.now()-n))}).catch(()=>{clearTimeout(a),i(`timeout`,0)})},[]),l=(0,S.useCallback)(()=>{o(!0);let e=new Map;$.forEach(t=>{e.set(t.host,{status:`pending`,latency:0})}),r(e);let t=new Set($.map(e=>e.host));$.forEach(e=>{let n=new AbortController;s.current.set(e.host,n);let i=performance.now(),a=(n,i)=>{t.has(e.host)&&(t.delete(e.host),r(t=>{let r=new Map(t);return r.set(e.host,{status:n,latency:i}),r}),t.size===0&&o(!1))},c=setTimeout(()=>{n.abort()},gt);fetch(`https://${e.host}/`,{method:`HEAD`,mode:`no-cors`,cache:`no-store`,signal:n.signal}).then(()=>{clearTimeout(c),a(`ok`,Math.round(performance.now()-i))}).catch(()=>{clearTimeout(c),a(`timeout`,0)})})},[]);return(0,S.useEffect)(()=>(l(),()=>{s.current.forEach(e=>e.abort()),s.current.clear()}),[l]),(0,Q.jsxs)(`div`,{className:`ping-page`,children:[(0,Q.jsxs)(`div`,{className:`ping-header`,children:[(0,Q.jsxs)(`div`,{className:`ping-title-wrap`,children:[(0,Q.jsx)(p,{size:28,className:`ping-title-icon`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`ping-title`,children:e(`ping.title`)}),(0,Q.jsx)(`p`,{className:`ping-subtitle`,children:e(`ping.subtitle`)})]})]}),(0,Q.jsx)(`button`,{className:`btn btn-icon`,onClick:l,disabled:i,"aria-label":e(`ping.retryAll`),title:e(`ping.retryAll`),children:(0,Q.jsx)(x,{size:18,className:i?`ping-spin`:``})})]}),(0,Q.jsx)(`div`,{className:`ping-grid`,children:$.map(r=>{let i=n.get(r.host),a=!i||i.status===`pending`,o=i?.status===`timeout`;return(0,Q.jsxs)(`div`,{className:`ping-card ${a?`pending`:``}`,children:[(0,Q.jsxs)(`div`,{className:`ping-card-top`,children:[(0,Q.jsx)(`span`,{className:`ping-card-icon`,children:(0,Q.jsx)(_t,{icon:r.icon,fallback:r.fallback})}),(0,Q.jsx)(`a`,{href:`https://${r.host}`,target:`_blank`,rel:`noreferrer`,className:`ping-card-name`,children:r.name}),(0,Q.jsx)(`button`,{className:`ping-card-refresh`,onClick:()=>c(r.host),disabled:a,"aria-label":e(`ping.retryOne`,{name:r.name}),title:e(`ping.retry`),children:(0,Q.jsx)(x,{size:13,className:a?`ping-spin`:``})})]}),(0,Q.jsxs)(`div`,{className:`ping-card-bottom`,children:[a?(0,Q.jsx)(`span`,{className:`ping-pulse-dot`}):(0,Q.jsx)(`span`,{className:`ping-status-label ${o?`is-error`:`is-success`}`,children:e(o?`ping.unavailable`:`ping.available`)}),(0,Q.jsx)(`span`,{className:`ping-latency ${a?`is-muted`:o?`is-error`:`is-success`}`,children:a?`--`:o?e(`ping.timeout`):`${t(i.latency)} ms`})]})]},r.host)})})]})}function yt(){return(0,Q.jsx)(m,{children:(0,Q.jsx)(vt,{})})}var bt=i(`/ping/`)({component:yt});export{bt as Route};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{A as r,B as i,E as a,F as o,H as s,I as c,N as l,O as u,R as d,k as f,t as p}from"./useAppStore-DNhyhD20.js";import{a as m}from"./i18n-DKsg67mH.js";import{t as h}from"./fingerprint-pattern-BT73ASEB.js";import{i as g}from"./AccountMenu-D_rcXDZr.js";import{t as _}from"./download-Cy2BlfKM.js";import{t as v}from"./external-link-D_AQSgxW.js";import{n as y,t as b}from"./CopyButton-ClwBN6Iy.js";import{t as x}from"./lock-yG7M7GkB.js";import{t as S}from"./AppShell-CKP_dglR.js";import{t as C}from"./wallet-D6HZocla.js";import{M as w,N as T,P as E,g as ee}from"./index-DJzLHA0V.js";import{t as te}from"./AppTop-C03PsDr_.js";import{n as ne,t as re}from"./mp-cEQteKUC.js";var ie=i(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ae=i(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),oe=i(`qr-code`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),se=i(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),ce=i(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),D=t(e()),O=n();function le(e){return e?`•`.repeat(Math.min(e.length,32)):`-`}function k({title:e,username:t,password:n,showPassword:r,showPrivateKey:i,account:a,onUsernameChange:o,onPasswordChange:s,onTogglePassword:c,onTogglePrivateKey:l,onGenerate:u}){let{t:d}=m();return(0,O.jsxs)(`div`,{className:`web3-box-account`,children:[(0,O.jsx)(`div`,{className:`web3-box-account-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:e}),(0,O.jsx)(`p`,{children:d(`web3.box.account.desc`)})]})}),(0,O.jsxs)(`div`,{className:`web3-box-login`,children:[(0,O.jsx)(`input`,{type:`text`,placeholder:d(`login.username.placeholder`),value:t,onChange:e=>o(e.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsxs)(`div`,{className:`input-wrap`,children:[(0,O.jsx)(`input`,{type:r?`text`:`password`,placeholder:d(`web3.login.passwordOptional`),value:n,onChange:e=>s(e.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`button`,{className:`input-eye`,onClick:c,type:`button`,children:r?(0,O.jsx)(T,{size:16}):(0,O.jsx)(w,{size:16})})]}),(0,O.jsxs)(`button`,{className:`btn btn-primary btn-full`,onClick:u,disabled:!t.trim(),type:`button`,children:[(0,O.jsx)(y,{size:16}),d(`web3.box.account.generate`)]})]}),a?(0,O.jsxs)(`div`,{className:`web3-box-key-list`,children:[(0,O.jsxs)(`div`,{className:`web3-box-key-row`,children:[(0,O.jsx)(`span`,{children:d(`web3.label.address`)}),(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:a.address.toLowerCase()}),(0,O.jsx)(b,{text:a.address.toLowerCase()})]})]}),(0,O.jsxs)(`div`,{className:`web3-box-key-row`,children:[(0,O.jsx)(`span`,{children:d(`web3.label.x25519Public`)}),(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:a.publicKey}),(0,O.jsx)(b,{text:a.publicKey})]})]}),(0,O.jsxs)(`div`,{className:`web3-box-key-row`,children:[(0,O.jsx)(`span`,{children:d(`web3.label.x25519Private`)}),(0,O.jsxs)(`div`,{className:`mono-row danger`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:i?a.privateKey:le(a.privateKey)}),(0,O.jsx)(`button`,{className:`btn btn-icon`,onClick:l,title:d(i?`web3.action.hidePrivateKey`:`web3.action.showPrivateKey`),type:`button`,children:i?(0,O.jsx)(w,{size:14}):(0,O.jsx)(T,{size:14})})]})]})]}):null]})}function ue(e,t){return Number.isFinite(e)?t(e):`-`}function A({title:e,description:t,message:n,cipherText:r,decryptedText:i,error:a,encryptLabel:o,decryptLabel:s,messagePlaceholder:l,cipherPlaceholder:u,onMessageChange:d,onCipherTextChange:f,onEncrypt:p,onDecrypt:h}){let{t:g,formatDateTime:_}=m(),v=`box-message-${e.replaceAll(/\s+/g,`-`)}`,b=c(r);return(0,O.jsxs)(`section`,{className:`web3-box-flow`,children:[(0,O.jsx)(`div`,{className:`web3-box-flow-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:e}),(0,O.jsx)(`p`,{children:t})]})}),(0,O.jsx)(`label`,{className:`web3-box-label`,htmlFor:v,children:g(`web3.box.plaintext`)}),(0,O.jsx)(`textarea`,{id:v,className:`textarea`,value:n,onChange:e=>d(e.target.value),rows:4,placeholder:l,translate:`no`}),(0,O.jsxs)(`div`,{className:`web3-box-actions`,children:[(0,O.jsxs)(`button`,{className:`btn btn-primary`,onClick:p,type:`button`,children:[(0,O.jsx)(x,{size:16}),o]}),(0,O.jsxs)(`button`,{className:`btn btn-secondary`,onClick:h,type:`button`,children:[(0,O.jsx)(y,{size:16}),s]})]}),a&&(0,O.jsx)(`p`,{className:`web3-tools-danger`,children:a}),(0,O.jsxs)(`div`,{className:`web3-box-result-grid`,children:[(0,O.jsxs)(`div`,{className:`web3-box-result`,children:[(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:g(`web3.box.ciphertext`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:r,onChange:e=>f(e.target.value),rows:5,placeholder:u,translate:`no`})]}),(0,O.jsxs)(`div`,{className:`web3-box-result`,children:[(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:g(`web3.box.decryptResult`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:i,readOnly:!0,rows:5,placeholder:g(`web3.box.decryptResultPlaceholder`),translate:`no`})]})]}),b&&(0,O.jsxs)(`div`,{className:`web3-box-token-meta`,children:[(0,O.jsxs)(`div`,{className:`web3-box-token-meta-row`,children:[(0,O.jsx)(`span`,{children:g(`web3.box.timestamp`)}),(0,O.jsx)(`code`,{translate:`no`,children:ue(b.timestampMs,_)})]}),(0,O.jsxs)(`div`,{className:`web3-box-token-meta-row`,children:[(0,O.jsx)(`span`,{children:g(`web3.box.nonce`)}),(0,O.jsx)(`code`,{translate:`no`,children:b.nonce})]})]})]})}function de(e){let{t}=m();return(0,O.jsxs)(`div`,{className:`web3-box-workspace`,children:[(0,O.jsxs)(`div`,{className:`web3-box-grid`,children:[(0,O.jsx)(k,{title:t(`web3.box.accountA`),username:e.boxAUsername,password:e.boxAPassword,showPassword:e.boxAShowPassword,showPrivateKey:e.boxAShowPrivateKey,account:e.boxAAccount,onUsernameChange:e.onBoxAUsernameChange,onPasswordChange:e.onBoxAPasswordChange,onTogglePassword:e.onBoxAShowPasswordToggle,onTogglePrivateKey:e.onBoxAShowPrivateKeyToggle,onGenerate:e.onGenerateBoxA}),(0,O.jsx)(k,{title:t(`web3.box.accountB`),username:e.boxBUsername,password:e.boxBPassword,showPassword:e.boxBShowPassword,showPrivateKey:e.boxBShowPrivateKey,account:e.boxBAccount,onUsernameChange:e.onBoxBUsernameChange,onPasswordChange:e.onBoxBPasswordChange,onTogglePassword:e.onBoxBShowPasswordToggle,onTogglePrivateKey:e.onBoxBShowPrivateKeyToggle,onGenerate:e.onGenerateBoxB})]}),(0,O.jsxs)(`div`,{className:`web3-box-flow-grid`,children:[(0,O.jsx)(A,{title:`A → B`,description:t(`web3.box.flowAB.desc`),message:e.boxABMessage,cipherText:e.boxABCipherText,decryptedText:e.boxABDecryptedText,error:e.boxABError,encryptLabel:t(`web3.box.flowAB.encrypt`),decryptLabel:t(`web3.box.flowAB.decrypt`),messagePlaceholder:t(`web3.box.flowAB.messagePlaceholder`),cipherPlaceholder:t(`web3.box.cipherPlaceholder`),onMessageChange:e.onBoxABMessageChange,onCipherTextChange:e.onBoxABCipherTextChange,onEncrypt:e.onEncryptBoxAB,onDecrypt:e.onDecryptBoxAB}),(0,O.jsx)(A,{title:`B → A`,description:t(`web3.box.flowBA.desc`),message:e.boxBAMessage,cipherText:e.boxBACipherText,decryptedText:e.boxBADecryptedText,error:e.boxBAError,encryptLabel:t(`web3.box.flowBA.encrypt`),decryptLabel:t(`web3.box.flowBA.decrypt`),messagePlaceholder:t(`web3.box.flowBA.messagePlaceholder`),cipherPlaceholder:t(`web3.box.cipherPlaceholder`),onMessageChange:e.onBoxBAMessageChange,onCipherTextChange:e.onBoxBACipherTextChange,onEncrypt:e.onEncryptBoxBA,onDecrypt:e.onDecryptBoxBA})]}),(0,O.jsxs)(`div`,{className:`web3-box-flow-grid`,children:[(0,O.jsxs)(`section`,{className:`web3-box-flow`,children:[(0,O.jsx)(`div`,{className:`web3-box-flow-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`web3.box.encryptTitle`)}),(0,O.jsx)(`p`,{children:t(`web3.box.encryptDesc`)})]})}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.sender`)})}),(0,O.jsxs)(`div`,{className:`input-wrap`,children:[(0,O.jsx)(`input`,{type:e.boxEncryptShowPrivateKey?`text`:`password`,placeholder:t(`web3.box.senderPrivatePlaceholder`),value:e.boxEncryptSenderPrivateKey,onChange:t=>e.onBoxEncryptSenderPrivateKeyChange(t.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`button`,{className:`input-eye`,onClick:e.onBoxEncryptShowPrivateKeyToggle,type:`button`,children:e.boxEncryptShowPrivateKey?(0,O.jsx)(T,{size:16}):(0,O.jsx)(w,{size:16})})]}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.recipient`)})}),(0,O.jsx)(`input`,{type:`text`,placeholder:t(`web3.box.recipientPublicPlaceholder`),value:e.boxEncryptRecipientPublicKey,onChange:t=>e.onBoxEncryptRecipientPublicKeyChange(t.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.plaintext`)})}),(0,O.jsx)(`textarea`,{className:`textarea`,value:e.boxEncryptMessage,onChange:t=>e.onBoxEncryptMessageChange(t.target.value),rows:4,placeholder:t(`web3.box.messagePlaceholder`),translate:`no`}),(0,O.jsx)(`div`,{className:`web3-box-actions`,children:(0,O.jsxs)(`button`,{className:`btn btn-primary`,onClick:e.onEncryptOnly,type:`button`,children:[(0,O.jsx)(x,{size:16}),t(`web3.box.encryptTitle`)]})}),e.boxEncryptError&&(0,O.jsx)(`p`,{className:`web3-tools-danger`,children:e.boxEncryptError}),(0,O.jsxs)(`div`,{className:`web3-box-result`,children:[(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.ciphertext`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:e.boxEncryptCipherText,readOnly:!0,rows:5,placeholder:t(`web3.box.encryptResultPlaceholder`),translate:`no`})]})]}),(0,O.jsxs)(`section`,{className:`web3-box-flow`,children:[(0,O.jsx)(`div`,{className:`web3-box-flow-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`web3.box.decryptTitle`)}),(0,O.jsx)(`p`,{children:t(`web3.box.decryptDesc`)})]})}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.sender`)})}),(0,O.jsx)(`input`,{type:`text`,placeholder:t(`web3.box.senderPublicPlaceholder`),value:e.boxDecryptSenderPublicKey,onChange:t=>e.onBoxDecryptSenderPublicKeyChange(t.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.recipient`)})}),(0,O.jsxs)(`div`,{className:`input-wrap`,children:[(0,O.jsx)(`input`,{type:e.boxDecryptShowPrivateKey?`text`:`password`,placeholder:t(`web3.box.recipientPrivatePlaceholder`),value:e.boxDecryptRecipientPrivateKey,onChange:t=>e.onBoxDecryptRecipientPrivateKeyChange(t.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`button`,{className:`input-eye`,onClick:e.onBoxDecryptShowPrivateKeyToggle,type:`button`,children:e.boxDecryptShowPrivateKey?(0,O.jsx)(T,{size:16}):(0,O.jsx)(w,{size:16})})]}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.ciphertext`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:e.boxDecryptCipherText,onChange:t=>e.onBoxDecryptCipherTextChange(t.target.value),rows:5,placeholder:t(`web3.box.cipherDecryptPlaceholder`),translate:`no`}),(0,O.jsx)(`div`,{className:`web3-box-actions`,children:(0,O.jsxs)(`button`,{className:`btn btn-secondary`,onClick:e.onDecryptOnly,type:`button`,children:[(0,O.jsx)(y,{size:16}),t(`web3.box.decryptTitle`)]})}),e.boxDecryptError&&(0,O.jsx)(`p`,{className:`web3-tools-danger`,children:e.boxDecryptError}),(0,O.jsxs)(`div`,{className:`web3-box-result`,children:[(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.decryptResult`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:e.boxDecryptResult,readOnly:!0,rows:5,placeholder:t(`web3.box.decryptResultPlaceholder`),translate:`no`})]})]})]})]})}function j({icon:e,message:t,className:n=`empty-state glass`}){return(0,O.jsxs)(`div`,{className:n,children:[(0,O.jsx)(`div`,{className:`empty-state-icon`,children:e}),(0,O.jsx)(`p`,{children:t})]})}function fe({label:e,pem:t,filename:n}){let{t:r}=m();function i(){let e=new Blob([t],{type:`text/plain`}),r=URL.createObjectURL(e),i=document.createElement(`a`);i.href=r,i.download=n,i.click(),URL.revokeObjectURL(r)}return(0,O.jsxs)(`div`,{className:`web3-pem-block`,children:[(0,O.jsxs)(`div`,{className:`web3-pem-header`,children:[(0,O.jsx)(`span`,{className:`web3-pem-label`,children:e}),(0,O.jsxs)(`div`,{className:`web3-pem-actions`,children:[(0,O.jsx)(b,{text:t,label:r(`common.copy`),className:`btn btn-sm`,iconSize:14}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,onClick:i,title:r(`common.download`),children:[(0,O.jsx)(_,{size:14}),r(`common.download`)]})]})]}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:t,readOnly:!0,rows:6,translate:`no`})]})}function pe({walletResult:e,publicPem:t,privatePem:n}){let{t:r}=m();if(!t||!n)return(0,O.jsx)(j,{icon:(0,O.jsx)(x,{size:36}),message:r(`web3.empty.pem`)});let i=e?.username||`wallet`;return(0,O.jsxs)(`div`,{className:`web3-pem-list`,children:[(0,O.jsx)(fe,{label:`${i}.pub`,pem:t,filename:`${i}.pub`}),(0,O.jsx)(fe,{label:`${i}.pem`,pem:n,filename:`${i}.pem`})]})}var me=Object.defineProperty,M=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,he=(e,t,n)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F=(e,t)=>{for(var n in t||={})N.call(t,n)&&he(e,n,t[n]);if(M)for(var n of M(t))P.call(t,n)&&he(e,n,t[n]);return e},I=(e,t)=>{var n={};for(var r in e)N.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&M)for(var r of M(e))t.indexOf(r)<0&&P.call(e,r)&&(n[r]=e[r]);return n},L;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(L||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(L||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(L||={});var R=L,ge={L:R.QrCode.Ecc.LOW,M:R.QrCode.Ecc.MEDIUM,Q:R.QrCode.Ecc.QUARTILE,H:R.QrCode.Ecc.HIGH},z=128,B=`L`,V=`#FFFFFF`,H=`#000000`,U=!1,W=1,_e=4,ve=0,G=.1;function K(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function ye(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function be(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*G),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function xe(e,t){return t==null?e?_e:ve:Math.max(Math.floor(t),0)}function q({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=D.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...R.QrSegment.makeSegments(t)),e),[]);return R.QrCode.encodeSegments(r,ge[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=D.useMemo(()=>{let e=c.getModules(),t=xe(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:be(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var Se=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Ce=D.forwardRef(function(e,t){let n=e,{value:r,size:i=z,level:a=B,bgColor:o=V,fgColor:s=H,includeMargin:c=U,minVersion:l=W,boostLevel:u,marginSize:d,imageSettings:f}=n,p=I(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:m}=p,h=I(p,[`style`]),g=f?.src,_=D.useRef(null),v=D.useRef(null),y=D.useCallback(e=>{_.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[b,x]=D.useState(!1),{margin:S,cells:C,numCells:w,calculatedImageSettings:T}=q({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:f,size:i});D.useEffect(()=>{if(_.current!=null){let e=_.current,t=e.getContext(`2d`);if(!t)return;let n=C,r=v.current,a=T!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&T.excavation!=null&&(n=ye(C,T.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/w*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,w,w),t.fillStyle=s,Se?t.fill(new Path2D(K(n,S))):C.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+S,n+S,1,1)})}),T&&(t.globalAlpha=T.opacity),a&&t.drawImage(r,T.x+S,T.y+S,T.w,T.h)}}),D.useEffect(()=>{x(!1)},[g]);let E=F({height:i,width:i},m),ee=null;return g!=null&&(ee=D.createElement(`img`,{src:g,key:g,style:{display:`none`},onLoad:()=>{x(!0)},ref:v,crossOrigin:T?.crossOrigin})),D.createElement(D.Fragment,null,D.createElement(`canvas`,F({style:E,height:i,width:i,ref:y,role:`img`},h)),ee)});Ce.displayName=`QRCodeCanvas`;var J=D.forwardRef(function(e,t){let n=e,{value:r,size:i=z,level:a=B,bgColor:o=V,fgColor:s=H,includeMargin:c=U,minVersion:l=W,boostLevel:u,title:d,marginSize:f,imageSettings:p}=n,m=I(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:h,cells:g,numCells:_,calculatedImageSettings:v}=q({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:f,imageSettings:p,size:i}),y=g,b=null;p!=null&&v!=null&&(v.excavation!=null&&(y=ye(g,v.excavation)),b=D.createElement(`image`,{href:p.src,height:v.h,width:v.w,x:v.x+h,y:v.y+h,preserveAspectRatio:`none`,opacity:v.opacity,crossOrigin:v.crossOrigin}));let x=K(y,h);return D.createElement(`svg`,F({height:i,width:i,viewBox:`0 0 ${_} ${_}`,ref:t,role:`img`},m),!!d&&D.createElement(`title`,null,d),D.createElement(`path`,{fill:o,d:`M0,0 h${_}v${_}H0z`,shapeRendering:`crispEdges`}),D.createElement(`path`,{fill:s,d:x,shapeRendering:`crispEdges`}),b)});J.displayName=`QRCodeSVG`;function we({walletResult:e,mnemonicPhrase:t,deriveBatch:n,deriveList:r,deriveShowIndex:i,deriveShowAddress:a,deriveShowPrivateKey:o,showAddressQr:s,showMnemonicReveal:c,showMnemonicQr:l,onToggleAddressQr:u,onToggleMnemonicReveal:d,onToggleMnemonicQr:f,onToggleDeriveIndex:p,onToggleDeriveAddress:h,onToggleDerivePrivateKey:g,onDerive:_}){let{t:v}=m(),x=e?.address||``;return!e||!x?(0,O.jsx)(j,{icon:(0,O.jsx)(C,{size:36}),message:v(`web3.empty.walletTools`)}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`web3-tools-section`,children:[(0,O.jsxs)(`button`,{className:`web3-tools-toggle`,onClick:u,children:[(0,O.jsx)(oe,{size:14}),v(s?`web3.action.hideAddressQr`:`web3.action.showAddressQr`),s?(0,O.jsx)(ie,{size:14}):(0,O.jsx)(E,{size:14})]}),s&&(0,O.jsxs)(`div`,{className:`web3-mnemonic-reveal`,children:[(0,O.jsxs)(`div`,{className:`web3-mnemonic-card`,children:[(0,O.jsx)(`p`,{className:`web3-mnemonic-text`,translate:`no`,children:x}),(0,O.jsx)(b,{text:x})]}),(0,O.jsx)(`div`,{className:`qr-wrap`,children:(0,O.jsx)(J,{value:x,size:200})})]})]}),t&&(0,O.jsxs)(`div`,{className:`web3-tools-section`,children:[(0,O.jsxs)(`button`,{className:`web3-tools-toggle`,onClick:d,children:[(0,O.jsx)(y,{size:14}),v(c?`web3.action.hideMnemonic`:`web3.action.showMnemonic`),c?(0,O.jsx)(ie,{size:14}):(0,O.jsx)(E,{size:14})]}),c&&(0,O.jsxs)(`div`,{className:`web3-mnemonic-reveal`,children:[(0,O.jsxs)(`div`,{className:`web3-mnemonic-card`,children:[(0,O.jsx)(`p`,{className:`web3-mnemonic-text`,translate:`no`,children:t}),(0,O.jsx)(b,{text:t})]}),(0,O.jsxs)(`p`,{className:`web3-tools-danger`,children:[(0,O.jsx)(se,{size:14}),v(`web3.warning.mnemonic`)]}),(0,O.jsx)(`button`,{className:`web3-tools-toggle`,onClick:f,children:v(l?`web3.action.hideMnemonicQr`:`web3.action.showMnemonicQr`)}),l&&(0,O.jsx)(`div`,{className:`qr-wrap`,children:(0,O.jsx)(J,{value:t,size:260})})]})]}),t&&(0,O.jsxs)(`div`,{className:`web3-mnemonic-reveal`,children:[(0,O.jsx)(`div`,{children:(0,O.jsx)(`button`,{className:`btn btn-primary`,onClick:_,children:v(`web3.action.deriveAddresses`,{count:n})})}),(0,O.jsxs)(`p`,{className:`web3-tools-danger`,children:[(0,O.jsx)(se,{size:14}),v(`web3.warning.privateKey`)]}),r.length>0&&(0,O.jsx)(`div`,{className:`web3-derive-table-wrap`,children:(0,O.jsxs)(`table`,{className:`web3-derive-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{onClick:p,className:`web3-derive-th`,children:v(`web3.label.account`)}),(0,O.jsx)(`th`,{onClick:h,className:`web3-derive-th`,children:v(`web3.label.address`)}),(0,O.jsx)(`th`,{onClick:g,className:`web3-derive-th danger`,children:v(`web3.label.privateKeyToggle`,{action:v(o?`web3.action.hide`:`web3.action.show`)})})]})}),(0,O.jsx)(`tbody`,{children:r.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:i?e.index+1:``}),(0,O.jsx)(`td`,{translate:`no`,children:a?e.address:``}),(0,O.jsx)(`td`,{className:`danger`,children:(0,O.jsx)(`span`,{translate:`no`,children:o?e.privateKey:``})})]},e.index))})]})})]})]})}function Y({title:e,icon:t,children:n,accent:r=!1}){return(0,O.jsxs)(`div`,{className:`web3-key-card ${r?`accent`:``}`,children:[(0,O.jsxs)(`div`,{className:`web3-key-card-header`,children:[(0,O.jsx)(`span`,{className:`web3-key-card-icon`,children:t}),(0,O.jsx)(`span`,{className:`web3-key-card-title`,children:e})]}),(0,O.jsx)(`div`,{className:`web3-key-card-body`,translate:`no`,children:n})]})}function Te(e){return e?`•`.repeat(Math.min(e.length,32)):`-`}function Ee({walletResult:e,keys:t,ipns:n,avatarSrc:r,showPrivateKey:i,onTogglePrivateKey:a}){let{t:o}=m(),s=e?.address||``;return!e||!s?(0,O.jsx)(j,{icon:(0,O.jsx)(g,{size:36}),message:o(`web3.empty.identity`)}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`web3-identity-card`,children:[(0,O.jsx)(`img`,{src:r,alt:`avatar`,className:`web3-identity-avatar`}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h1`,{className:`web3-identity-name`,children:e.username||o(`web3.notSignedIn`)}),(0,O.jsxs)(`div`,{className:`web3-identity-address`,children:[(0,O.jsx)(`code`,{translate:`no`,children:s.toLowerCase()}),(0,O.jsx)(b,{text:s.toLowerCase()}),(0,O.jsxs)(`a`,{href:`https://debank.com/profile/${s}`,target:`_blank`,rel:`noopener noreferrer`,className:`link`,children:[(0,O.jsx)(v,{size:14}),o(`web3.action.view`)]})]})]})]}),t&&(0,O.jsxs)(`div`,{className:`web3-key-grid`,children:[(0,O.jsx)(Y,{title:o(`web3.label.ed25519Public`),icon:(0,O.jsx)(h,{size:18}),children:(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:t.ed_public_key}),(0,O.jsx)(b,{text:t.ed_public_key})]})}),(0,O.jsx)(Y,{title:o(`web3.label.x25519Public`),icon:(0,O.jsx)(y,{size:18}),children:(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:t.public_key}),(0,O.jsx)(b,{text:t.public_key})]})}),(0,O.jsx)(Y,{title:o(`web3.label.combinedPrivate`),icon:(0,O.jsx)(ce,{size:18}),accent:!0,children:(0,O.jsxs)(`div`,{className:`mono-row danger`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:i?t.private_key:Te(t.private_key)}),(0,O.jsx)(`button`,{className:`btn btn-icon`,onClick:a,title:o(i?`web3.action.hidePrivateKey`:`web3.action.showPrivateKey`),type:`button`,children:i?(0,O.jsx)(w,{size:14}):(0,O.jsx)(T,{size:14})})]})}),(0,O.jsx)(Y,{title:`IPNS ID`,icon:(0,O.jsx)(ae,{size:18}),children:(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:n}),(0,O.jsx)(b,{text:n})]})})]})]})}function De({username:e,password:t,showPassword:n,generating:r,onUsernameChange:i,onPasswordChange:a,onTogglePassword:o,onGenerate:s}){let{t:c}=m();return(0,O.jsxs)(`div`,{className:`input-panel`,children:[(0,O.jsxs)(`div`,{className:`web3-tools-inputs`,children:[(0,O.jsx)(`input`,{type:`text`,placeholder:c(`login.username.placeholder`),value:e,onChange:e=>i(e.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsxs)(`div`,{className:`input-wrap`,children:[(0,O.jsx)(`input`,{type:n?`text`:`password`,placeholder:c(`web3.login.passwordOptional`),value:t,onChange:e=>a(e.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`button`,{className:`input-eye`,onClick:o,type:`button`,children:n?(0,O.jsx)(T,{size:16}):(0,O.jsx)(w,{size:16})})]})]}),(0,O.jsx)(`button`,{className:`btn btn-primary btn-full`,onClick:s,disabled:!e.trim()||r,type:`button`,children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`spinner`}),c(`web3.login.generating`)]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(C,{size:16}),c(`web3.login.generateAndSignIn`)]})})]})}var X=e=>btoa(String.fromCharCode(...e)),Oe=e=>{let t=new Uint8Array([48,5,6,3,43,101,112]),n=new Uint8Array([4,34,4,32,...e.slice(0,32)]),r=new Uint8Array([2,1,0]),i=r.length+t.length+n.length,a=new Uint8Array(2+i);a[0]=48,a[1]=i;let o=2;return a.set(r,o),o+=r.length,a.set(t,o),o+=t.length,a.set(n,o),`-----BEGIN PRIVATE KEY-----\n${X(a).match(/.{1,64}/g)?.join(`
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{A as r,B as i,E as a,F as o,H as s,I as c,N as l,O as u,R as d,k as f,t as p}from"./useAppStore-Pjif7nCR.js";import{a as m}from"./i18n-DKsg67mH.js";import{t as h}from"./fingerprint-pattern-Z6NfIcxC.js";import{i as g}from"./AccountMenu-C3wvcWtn.js";import{t as _}from"./download-nQ9X-v0q.js";import{t as v}from"./external-link-LcGMVTLE.js";import{n as y,t as b}from"./CopyButton-BfQ-TOoR.js";import{t as x}from"./lock-Cigqt_VP.js";import{t as S}from"./AppShell-BN1uaxn1.js";import{t as C}from"./wallet-Ts6jdQzi.js";import{M as w,N as T,P as E,g as ee}from"./index-CCU5Z4K-.js";import{t as te}from"./AppTop-iPNi3cv5.js";import{n as ne,t as re}from"./mp-CFhRibX9.js";var ie=i(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ae=i(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),oe=i(`qr-code`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),se=i(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),ce=i(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),D=t(e()),O=n();function le(e){return e?`•`.repeat(Math.min(e.length,32)):`-`}function k({title:e,username:t,password:n,showPassword:r,showPrivateKey:i,account:a,onUsernameChange:o,onPasswordChange:s,onTogglePassword:c,onTogglePrivateKey:l,onGenerate:u}){let{t:d}=m();return(0,O.jsxs)(`div`,{className:`web3-box-account`,children:[(0,O.jsx)(`div`,{className:`web3-box-account-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:e}),(0,O.jsx)(`p`,{children:d(`web3.box.account.desc`)})]})}),(0,O.jsxs)(`div`,{className:`web3-box-login`,children:[(0,O.jsx)(`input`,{type:`text`,placeholder:d(`login.username.placeholder`),value:t,onChange:e=>o(e.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsxs)(`div`,{className:`input-wrap`,children:[(0,O.jsx)(`input`,{type:r?`text`:`password`,placeholder:d(`web3.login.passwordOptional`),value:n,onChange:e=>s(e.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`button`,{className:`input-eye`,onClick:c,type:`button`,children:r?(0,O.jsx)(T,{size:16}):(0,O.jsx)(w,{size:16})})]}),(0,O.jsxs)(`button`,{className:`btn btn-primary btn-full`,onClick:u,disabled:!t.trim(),type:`button`,children:[(0,O.jsx)(y,{size:16}),d(`web3.box.account.generate`)]})]}),a?(0,O.jsxs)(`div`,{className:`web3-box-key-list`,children:[(0,O.jsxs)(`div`,{className:`web3-box-key-row`,children:[(0,O.jsx)(`span`,{children:d(`web3.label.address`)}),(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:a.address.toLowerCase()}),(0,O.jsx)(b,{text:a.address.toLowerCase()})]})]}),(0,O.jsxs)(`div`,{className:`web3-box-key-row`,children:[(0,O.jsx)(`span`,{children:d(`web3.label.x25519Public`)}),(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:a.publicKey}),(0,O.jsx)(b,{text:a.publicKey})]})]}),(0,O.jsxs)(`div`,{className:`web3-box-key-row`,children:[(0,O.jsx)(`span`,{children:d(`web3.label.x25519Private`)}),(0,O.jsxs)(`div`,{className:`mono-row danger`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:i?a.privateKey:le(a.privateKey)}),(0,O.jsx)(`button`,{className:`btn btn-icon`,onClick:l,title:d(i?`web3.action.hidePrivateKey`:`web3.action.showPrivateKey`),type:`button`,children:i?(0,O.jsx)(w,{size:14}):(0,O.jsx)(T,{size:14})})]})]})]}):null]})}function ue(e,t){return Number.isFinite(e)?t(e):`-`}function A({title:e,description:t,message:n,cipherText:r,decryptedText:i,error:a,encryptLabel:o,decryptLabel:s,messagePlaceholder:l,cipherPlaceholder:u,onMessageChange:d,onCipherTextChange:f,onEncrypt:p,onDecrypt:h}){let{t:g,formatDateTime:_}=m(),v=`box-message-${e.replaceAll(/\s+/g,`-`)}`,b=c(r);return(0,O.jsxs)(`section`,{className:`web3-box-flow`,children:[(0,O.jsx)(`div`,{className:`web3-box-flow-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:e}),(0,O.jsx)(`p`,{children:t})]})}),(0,O.jsx)(`label`,{className:`web3-box-label`,htmlFor:v,children:g(`web3.box.plaintext`)}),(0,O.jsx)(`textarea`,{id:v,className:`textarea`,value:n,onChange:e=>d(e.target.value),rows:4,placeholder:l,translate:`no`}),(0,O.jsxs)(`div`,{className:`web3-box-actions`,children:[(0,O.jsxs)(`button`,{className:`btn btn-primary`,onClick:p,type:`button`,children:[(0,O.jsx)(x,{size:16}),o]}),(0,O.jsxs)(`button`,{className:`btn btn-secondary`,onClick:h,type:`button`,children:[(0,O.jsx)(y,{size:16}),s]})]}),a&&(0,O.jsx)(`p`,{className:`web3-tools-danger`,children:a}),(0,O.jsxs)(`div`,{className:`web3-box-result-grid`,children:[(0,O.jsxs)(`div`,{className:`web3-box-result`,children:[(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:g(`web3.box.ciphertext`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:r,onChange:e=>f(e.target.value),rows:5,placeholder:u,translate:`no`})]}),(0,O.jsxs)(`div`,{className:`web3-box-result`,children:[(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:g(`web3.box.decryptResult`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:i,readOnly:!0,rows:5,placeholder:g(`web3.box.decryptResultPlaceholder`),translate:`no`})]})]}),b&&(0,O.jsxs)(`div`,{className:`web3-box-token-meta`,children:[(0,O.jsxs)(`div`,{className:`web3-box-token-meta-row`,children:[(0,O.jsx)(`span`,{children:g(`web3.box.timestamp`)}),(0,O.jsx)(`code`,{translate:`no`,children:ue(b.timestampMs,_)})]}),(0,O.jsxs)(`div`,{className:`web3-box-token-meta-row`,children:[(0,O.jsx)(`span`,{children:g(`web3.box.nonce`)}),(0,O.jsx)(`code`,{translate:`no`,children:b.nonce})]})]})]})}function de(e){let{t}=m();return(0,O.jsxs)(`div`,{className:`web3-box-workspace`,children:[(0,O.jsxs)(`div`,{className:`web3-box-grid`,children:[(0,O.jsx)(k,{title:t(`web3.box.accountA`),username:e.boxAUsername,password:e.boxAPassword,showPassword:e.boxAShowPassword,showPrivateKey:e.boxAShowPrivateKey,account:e.boxAAccount,onUsernameChange:e.onBoxAUsernameChange,onPasswordChange:e.onBoxAPasswordChange,onTogglePassword:e.onBoxAShowPasswordToggle,onTogglePrivateKey:e.onBoxAShowPrivateKeyToggle,onGenerate:e.onGenerateBoxA}),(0,O.jsx)(k,{title:t(`web3.box.accountB`),username:e.boxBUsername,password:e.boxBPassword,showPassword:e.boxBShowPassword,showPrivateKey:e.boxBShowPrivateKey,account:e.boxBAccount,onUsernameChange:e.onBoxBUsernameChange,onPasswordChange:e.onBoxBPasswordChange,onTogglePassword:e.onBoxBShowPasswordToggle,onTogglePrivateKey:e.onBoxBShowPrivateKeyToggle,onGenerate:e.onGenerateBoxB})]}),(0,O.jsxs)(`div`,{className:`web3-box-flow-grid`,children:[(0,O.jsx)(A,{title:`A → B`,description:t(`web3.box.flowAB.desc`),message:e.boxABMessage,cipherText:e.boxABCipherText,decryptedText:e.boxABDecryptedText,error:e.boxABError,encryptLabel:t(`web3.box.flowAB.encrypt`),decryptLabel:t(`web3.box.flowAB.decrypt`),messagePlaceholder:t(`web3.box.flowAB.messagePlaceholder`),cipherPlaceholder:t(`web3.box.cipherPlaceholder`),onMessageChange:e.onBoxABMessageChange,onCipherTextChange:e.onBoxABCipherTextChange,onEncrypt:e.onEncryptBoxAB,onDecrypt:e.onDecryptBoxAB}),(0,O.jsx)(A,{title:`B → A`,description:t(`web3.box.flowBA.desc`),message:e.boxBAMessage,cipherText:e.boxBACipherText,decryptedText:e.boxBADecryptedText,error:e.boxBAError,encryptLabel:t(`web3.box.flowBA.encrypt`),decryptLabel:t(`web3.box.flowBA.decrypt`),messagePlaceholder:t(`web3.box.flowBA.messagePlaceholder`),cipherPlaceholder:t(`web3.box.cipherPlaceholder`),onMessageChange:e.onBoxBAMessageChange,onCipherTextChange:e.onBoxBACipherTextChange,onEncrypt:e.onEncryptBoxBA,onDecrypt:e.onDecryptBoxBA})]}),(0,O.jsxs)(`div`,{className:`web3-box-flow-grid`,children:[(0,O.jsxs)(`section`,{className:`web3-box-flow`,children:[(0,O.jsx)(`div`,{className:`web3-box-flow-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`web3.box.encryptTitle`)}),(0,O.jsx)(`p`,{children:t(`web3.box.encryptDesc`)})]})}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.sender`)})}),(0,O.jsxs)(`div`,{className:`input-wrap`,children:[(0,O.jsx)(`input`,{type:e.boxEncryptShowPrivateKey?`text`:`password`,placeholder:t(`web3.box.senderPrivatePlaceholder`),value:e.boxEncryptSenderPrivateKey,onChange:t=>e.onBoxEncryptSenderPrivateKeyChange(t.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`button`,{className:`input-eye`,onClick:e.onBoxEncryptShowPrivateKeyToggle,type:`button`,children:e.boxEncryptShowPrivateKey?(0,O.jsx)(T,{size:16}):(0,O.jsx)(w,{size:16})})]}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.recipient`)})}),(0,O.jsx)(`input`,{type:`text`,placeholder:t(`web3.box.recipientPublicPlaceholder`),value:e.boxEncryptRecipientPublicKey,onChange:t=>e.onBoxEncryptRecipientPublicKeyChange(t.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.plaintext`)})}),(0,O.jsx)(`textarea`,{className:`textarea`,value:e.boxEncryptMessage,onChange:t=>e.onBoxEncryptMessageChange(t.target.value),rows:4,placeholder:t(`web3.box.messagePlaceholder`),translate:`no`}),(0,O.jsx)(`div`,{className:`web3-box-actions`,children:(0,O.jsxs)(`button`,{className:`btn btn-primary`,onClick:e.onEncryptOnly,type:`button`,children:[(0,O.jsx)(x,{size:16}),t(`web3.box.encryptTitle`)]})}),e.boxEncryptError&&(0,O.jsx)(`p`,{className:`web3-tools-danger`,children:e.boxEncryptError}),(0,O.jsxs)(`div`,{className:`web3-box-result`,children:[(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.ciphertext`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:e.boxEncryptCipherText,readOnly:!0,rows:5,placeholder:t(`web3.box.encryptResultPlaceholder`),translate:`no`})]})]}),(0,O.jsxs)(`section`,{className:`web3-box-flow`,children:[(0,O.jsx)(`div`,{className:`web3-box-flow-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`web3.box.decryptTitle`)}),(0,O.jsx)(`p`,{children:t(`web3.box.decryptDesc`)})]})}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.sender`)})}),(0,O.jsx)(`input`,{type:`text`,placeholder:t(`web3.box.senderPublicPlaceholder`),value:e.boxDecryptSenderPublicKey,onChange:t=>e.onBoxDecryptSenderPublicKeyChange(t.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.recipient`)})}),(0,O.jsxs)(`div`,{className:`input-wrap`,children:[(0,O.jsx)(`input`,{type:e.boxDecryptShowPrivateKey?`text`:`password`,placeholder:t(`web3.box.recipientPrivatePlaceholder`),value:e.boxDecryptRecipientPrivateKey,onChange:t=>e.onBoxDecryptRecipientPrivateKeyChange(t.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`button`,{className:`input-eye`,onClick:e.onBoxDecryptShowPrivateKeyToggle,type:`button`,children:e.boxDecryptShowPrivateKey?(0,O.jsx)(T,{size:16}):(0,O.jsx)(w,{size:16})})]}),(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.ciphertext`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:e.boxDecryptCipherText,onChange:t=>e.onBoxDecryptCipherTextChange(t.target.value),rows:5,placeholder:t(`web3.box.cipherDecryptPlaceholder`),translate:`no`}),(0,O.jsx)(`div`,{className:`web3-box-actions`,children:(0,O.jsxs)(`button`,{className:`btn btn-secondary`,onClick:e.onDecryptOnly,type:`button`,children:[(0,O.jsx)(y,{size:16}),t(`web3.box.decryptTitle`)]})}),e.boxDecryptError&&(0,O.jsx)(`p`,{className:`web3-tools-danger`,children:e.boxDecryptError}),(0,O.jsxs)(`div`,{className:`web3-box-result`,children:[(0,O.jsx)(`label`,{className:`web3-box-result-header`,children:(0,O.jsx)(`span`,{children:t(`web3.box.decryptResult`)})}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:e.boxDecryptResult,readOnly:!0,rows:5,placeholder:t(`web3.box.decryptResultPlaceholder`),translate:`no`})]})]})]})]})}function j({icon:e,message:t,className:n=`empty-state glass`}){return(0,O.jsxs)(`div`,{className:n,children:[(0,O.jsx)(`div`,{className:`empty-state-icon`,children:e}),(0,O.jsx)(`p`,{children:t})]})}function fe({label:e,pem:t,filename:n}){let{t:r}=m();function i(){let e=new Blob([t],{type:`text/plain`}),r=URL.createObjectURL(e),i=document.createElement(`a`);i.href=r,i.download=n,i.click(),URL.revokeObjectURL(r)}return(0,O.jsxs)(`div`,{className:`web3-pem-block`,children:[(0,O.jsxs)(`div`,{className:`web3-pem-header`,children:[(0,O.jsx)(`span`,{className:`web3-pem-label`,children:e}),(0,O.jsxs)(`div`,{className:`web3-pem-actions`,children:[(0,O.jsx)(b,{text:t,label:r(`common.copy`),className:`btn btn-sm`,iconSize:14}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,onClick:i,title:r(`common.download`),children:[(0,O.jsx)(_,{size:14}),r(`common.download`)]})]})]}),(0,O.jsx)(`textarea`,{className:`textarea mono`,value:t,readOnly:!0,rows:6,translate:`no`})]})}function pe({walletResult:e,publicPem:t,privatePem:n}){let{t:r}=m();if(!t||!n)return(0,O.jsx)(j,{icon:(0,O.jsx)(x,{size:36}),message:r(`web3.empty.pem`)});let i=e?.username||`wallet`;return(0,O.jsxs)(`div`,{className:`web3-pem-list`,children:[(0,O.jsx)(fe,{label:`${i}.pub`,pem:t,filename:`${i}.pub`}),(0,O.jsx)(fe,{label:`${i}.pem`,pem:n,filename:`${i}.pem`})]})}var me=Object.defineProperty,M=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,he=(e,t,n)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F=(e,t)=>{for(var n in t||={})N.call(t,n)&&he(e,n,t[n]);if(M)for(var n of M(t))P.call(t,n)&&he(e,n,t[n]);return e},I=(e,t)=>{var n={};for(var r in e)N.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&M)for(var r of M(e))t.indexOf(r)<0&&P.call(e,r)&&(n[r]=e[r]);return n},L;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(L||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(L||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(L||={});var R=L,ge={L:R.QrCode.Ecc.LOW,M:R.QrCode.Ecc.MEDIUM,Q:R.QrCode.Ecc.QUARTILE,H:R.QrCode.Ecc.HIGH},z=128,B=`L`,V=`#FFFFFF`,H=`#000000`,U=!1,W=1,_e=4,ve=0,G=.1;function K(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function ye(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function be(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*G),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function xe(e,t){return t==null?e?_e:ve:Math.max(Math.floor(t),0)}function q({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=D.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...R.QrSegment.makeSegments(t)),e),[]);return R.QrCode.encodeSegments(r,ge[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=D.useMemo(()=>{let e=c.getModules(),t=xe(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:be(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var Se=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Ce=D.forwardRef(function(e,t){let n=e,{value:r,size:i=z,level:a=B,bgColor:o=V,fgColor:s=H,includeMargin:c=U,minVersion:l=W,boostLevel:u,marginSize:d,imageSettings:f}=n,p=I(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:m}=p,h=I(p,[`style`]),g=f?.src,_=D.useRef(null),v=D.useRef(null),y=D.useCallback(e=>{_.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[b,x]=D.useState(!1),{margin:S,cells:C,numCells:w,calculatedImageSettings:T}=q({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:f,size:i});D.useEffect(()=>{if(_.current!=null){let e=_.current,t=e.getContext(`2d`);if(!t)return;let n=C,r=v.current,a=T!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&T.excavation!=null&&(n=ye(C,T.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/w*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,w,w),t.fillStyle=s,Se?t.fill(new Path2D(K(n,S))):C.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+S,n+S,1,1)})}),T&&(t.globalAlpha=T.opacity),a&&t.drawImage(r,T.x+S,T.y+S,T.w,T.h)}}),D.useEffect(()=>{x(!1)},[g]);let E=F({height:i,width:i},m),ee=null;return g!=null&&(ee=D.createElement(`img`,{src:g,key:g,style:{display:`none`},onLoad:()=>{x(!0)},ref:v,crossOrigin:T?.crossOrigin})),D.createElement(D.Fragment,null,D.createElement(`canvas`,F({style:E,height:i,width:i,ref:y,role:`img`},h)),ee)});Ce.displayName=`QRCodeCanvas`;var J=D.forwardRef(function(e,t){let n=e,{value:r,size:i=z,level:a=B,bgColor:o=V,fgColor:s=H,includeMargin:c=U,minVersion:l=W,boostLevel:u,title:d,marginSize:f,imageSettings:p}=n,m=I(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:h,cells:g,numCells:_,calculatedImageSettings:v}=q({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:f,imageSettings:p,size:i}),y=g,b=null;p!=null&&v!=null&&(v.excavation!=null&&(y=ye(g,v.excavation)),b=D.createElement(`image`,{href:p.src,height:v.h,width:v.w,x:v.x+h,y:v.y+h,preserveAspectRatio:`none`,opacity:v.opacity,crossOrigin:v.crossOrigin}));let x=K(y,h);return D.createElement(`svg`,F({height:i,width:i,viewBox:`0 0 ${_} ${_}`,ref:t,role:`img`},m),!!d&&D.createElement(`title`,null,d),D.createElement(`path`,{fill:o,d:`M0,0 h${_}v${_}H0z`,shapeRendering:`crispEdges`}),D.createElement(`path`,{fill:s,d:x,shapeRendering:`crispEdges`}),b)});J.displayName=`QRCodeSVG`;function we({walletResult:e,mnemonicPhrase:t,deriveBatch:n,deriveList:r,deriveShowIndex:i,deriveShowAddress:a,deriveShowPrivateKey:o,showAddressQr:s,showMnemonicReveal:c,showMnemonicQr:l,onToggleAddressQr:u,onToggleMnemonicReveal:d,onToggleMnemonicQr:f,onToggleDeriveIndex:p,onToggleDeriveAddress:h,onToggleDerivePrivateKey:g,onDerive:_}){let{t:v}=m(),x=e?.address||``;return!e||!x?(0,O.jsx)(j,{icon:(0,O.jsx)(C,{size:36}),message:v(`web3.empty.walletTools`)}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`web3-tools-section`,children:[(0,O.jsxs)(`button`,{className:`web3-tools-toggle`,onClick:u,children:[(0,O.jsx)(oe,{size:14}),v(s?`web3.action.hideAddressQr`:`web3.action.showAddressQr`),s?(0,O.jsx)(ie,{size:14}):(0,O.jsx)(E,{size:14})]}),s&&(0,O.jsxs)(`div`,{className:`web3-mnemonic-reveal`,children:[(0,O.jsxs)(`div`,{className:`web3-mnemonic-card`,children:[(0,O.jsx)(`p`,{className:`web3-mnemonic-text`,translate:`no`,children:x}),(0,O.jsx)(b,{text:x})]}),(0,O.jsx)(`div`,{className:`qr-wrap`,children:(0,O.jsx)(J,{value:x,size:200})})]})]}),t&&(0,O.jsxs)(`div`,{className:`web3-tools-section`,children:[(0,O.jsxs)(`button`,{className:`web3-tools-toggle`,onClick:d,children:[(0,O.jsx)(y,{size:14}),v(c?`web3.action.hideMnemonic`:`web3.action.showMnemonic`),c?(0,O.jsx)(ie,{size:14}):(0,O.jsx)(E,{size:14})]}),c&&(0,O.jsxs)(`div`,{className:`web3-mnemonic-reveal`,children:[(0,O.jsxs)(`div`,{className:`web3-mnemonic-card`,children:[(0,O.jsx)(`p`,{className:`web3-mnemonic-text`,translate:`no`,children:t}),(0,O.jsx)(b,{text:t})]}),(0,O.jsxs)(`p`,{className:`web3-tools-danger`,children:[(0,O.jsx)(se,{size:14}),v(`web3.warning.mnemonic`)]}),(0,O.jsx)(`button`,{className:`web3-tools-toggle`,onClick:f,children:v(l?`web3.action.hideMnemonicQr`:`web3.action.showMnemonicQr`)}),l&&(0,O.jsx)(`div`,{className:`qr-wrap`,children:(0,O.jsx)(J,{value:t,size:260})})]})]}),t&&(0,O.jsxs)(`div`,{className:`web3-mnemonic-reveal`,children:[(0,O.jsx)(`div`,{children:(0,O.jsx)(`button`,{className:`btn btn-primary`,onClick:_,children:v(`web3.action.deriveAddresses`,{count:n})})}),(0,O.jsxs)(`p`,{className:`web3-tools-danger`,children:[(0,O.jsx)(se,{size:14}),v(`web3.warning.privateKey`)]}),r.length>0&&(0,O.jsx)(`div`,{className:`web3-derive-table-wrap`,children:(0,O.jsxs)(`table`,{className:`web3-derive-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{onClick:p,className:`web3-derive-th`,children:v(`web3.label.account`)}),(0,O.jsx)(`th`,{onClick:h,className:`web3-derive-th`,children:v(`web3.label.address`)}),(0,O.jsx)(`th`,{onClick:g,className:`web3-derive-th danger`,children:v(`web3.label.privateKeyToggle`,{action:v(o?`web3.action.hide`:`web3.action.show`)})})]})}),(0,O.jsx)(`tbody`,{children:r.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:i?e.index+1:``}),(0,O.jsx)(`td`,{translate:`no`,children:a?e.address:``}),(0,O.jsx)(`td`,{className:`danger`,children:(0,O.jsx)(`span`,{translate:`no`,children:o?e.privateKey:``})})]},e.index))})]})})]})]})}function Y({title:e,icon:t,children:n,accent:r=!1}){return(0,O.jsxs)(`div`,{className:`web3-key-card ${r?`accent`:``}`,children:[(0,O.jsxs)(`div`,{className:`web3-key-card-header`,children:[(0,O.jsx)(`span`,{className:`web3-key-card-icon`,children:t}),(0,O.jsx)(`span`,{className:`web3-key-card-title`,children:e})]}),(0,O.jsx)(`div`,{className:`web3-key-card-body`,translate:`no`,children:n})]})}function Te(e){return e?`•`.repeat(Math.min(e.length,32)):`-`}function Ee({walletResult:e,keys:t,ipns:n,avatarSrc:r,showPrivateKey:i,onTogglePrivateKey:a}){let{t:o}=m(),s=e?.address||``;return!e||!s?(0,O.jsx)(j,{icon:(0,O.jsx)(g,{size:36}),message:o(`web3.empty.identity`)}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`web3-identity-card`,children:[(0,O.jsx)(`img`,{src:r,alt:`avatar`,className:`web3-identity-avatar`}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h1`,{className:`web3-identity-name`,children:e.username||o(`web3.notSignedIn`)}),(0,O.jsxs)(`div`,{className:`web3-identity-address`,children:[(0,O.jsx)(`code`,{translate:`no`,children:s.toLowerCase()}),(0,O.jsx)(b,{text:s.toLowerCase()}),(0,O.jsxs)(`a`,{href:`https://debank.com/profile/${s}`,target:`_blank`,rel:`noopener noreferrer`,className:`link`,children:[(0,O.jsx)(v,{size:14}),o(`web3.action.view`)]})]})]})]}),t&&(0,O.jsxs)(`div`,{className:`web3-key-grid`,children:[(0,O.jsx)(Y,{title:o(`web3.label.ed25519Public`),icon:(0,O.jsx)(h,{size:18}),children:(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:t.ed_public_key}),(0,O.jsx)(b,{text:t.ed_public_key})]})}),(0,O.jsx)(Y,{title:o(`web3.label.x25519Public`),icon:(0,O.jsx)(y,{size:18}),children:(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:t.public_key}),(0,O.jsx)(b,{text:t.public_key})]})}),(0,O.jsx)(Y,{title:o(`web3.label.combinedPrivate`),icon:(0,O.jsx)(ce,{size:18}),accent:!0,children:(0,O.jsxs)(`div`,{className:`mono-row danger`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:i?t.private_key:Te(t.private_key)}),(0,O.jsx)(`button`,{className:`btn btn-icon`,onClick:a,title:o(i?`web3.action.hidePrivateKey`:`web3.action.showPrivateKey`),type:`button`,children:i?(0,O.jsx)(w,{size:14}):(0,O.jsx)(T,{size:14})})]})}),(0,O.jsx)(Y,{title:`IPNS ID`,icon:(0,O.jsx)(ae,{size:18}),children:(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:n}),(0,O.jsx)(b,{text:n})]})})]})]})}function De({username:e,password:t,showPassword:n,generating:r,onUsernameChange:i,onPasswordChange:a,onTogglePassword:o,onGenerate:s}){let{t:c}=m();return(0,O.jsxs)(`div`,{className:`input-panel`,children:[(0,O.jsxs)(`div`,{className:`web3-tools-inputs`,children:[(0,O.jsx)(`input`,{type:`text`,placeholder:c(`login.username.placeholder`),value:e,onChange:e=>i(e.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsxs)(`div`,{className:`input-wrap`,children:[(0,O.jsx)(`input`,{type:n?`text`:`password`,placeholder:c(`web3.login.passwordOptional`),value:t,onChange:e=>a(e.target.value),className:`input`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`}),(0,O.jsx)(`button`,{className:`input-eye`,onClick:o,type:`button`,children:n?(0,O.jsx)(T,{size:16}):(0,O.jsx)(w,{size:16})})]})]}),(0,O.jsx)(`button`,{className:`btn btn-primary btn-full`,onClick:s,disabled:!e.trim()||r,type:`button`,children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`spinner`}),c(`web3.login.generating`)]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(C,{size:16}),c(`web3.login.generateAndSignIn`)]})})]})}var X=e=>btoa(String.fromCharCode(...e)),Oe=e=>{let t=new Uint8Array([48,5,6,3,43,101,112]),n=new Uint8Array([4,34,4,32,...e.slice(0,32)]),r=new Uint8Array([2,1,0]),i=r.length+t.length+n.length,a=new Uint8Array(2+i);a[0]=48,a[1]=i;let o=2;return a.set(r,o),o+=r.length,a.set(t,o),o+=t.length,a.set(n,o),`-----BEGIN PRIVATE KEY-----\n${X(a).match(/.{1,64}/g)?.join(`
|
|
2
2
|
`)}\n-----END PRIVATE KEY-----`},ke=e=>{let t=new Uint8Array([48,5,6,3,43,101,112]),n=new Uint8Array([3,33,0,...e]),r=t.length+n.length,i=new Uint8Array(2+r);i[0]=48,i[1]=r;let a=2;return i.set(t,a),a+=t.length,i.set(n,a),`-----BEGIN PUBLIC KEY-----\n${X(i).match(/.{1,64}/g)?.join(`
|
|
3
3
|
`)}\n-----END PUBLIC KEY-----`},Ae=[`wallet`,`pem`,`export`,`EA`];function je(){let e=window.location.hash.replace(`#`,``);return Ae.includes(e)?e:`wallet`}function Me(){let{t:e}=m(),t=p(e=>e.addToast),n=a(e=>e.setUserIdentity),[i,s]=(0,D.useState)(`wallet`),[c,h]=(0,D.useState)(``),[_,v]=(0,D.useState)(``),[b,w]=(0,D.useState)(!1),[T,E]=(0,D.useState)(null),[ie,ae]=(0,D.useState)(null),[oe,se]=(0,D.useState)(``),[ce,le]=(0,D.useState)(``),[k,ue]=(0,D.useState)(``),[A,j]=(0,D.useState)(``),[fe,me]=(0,D.useState)([]),[M,N]=(0,D.useState)(0),[P,he]=(0,D.useState)(!0),[F,I]=(0,D.useState)(!0),[L,R]=(0,D.useState)(!1),[ge,z]=(0,D.useState)(!1),[B,V]=(0,D.useState)(!1),[H,U]=(0,D.useState)(!1),[W,_e]=(0,D.useState)(!1),[ve,G]=(0,D.useState)(!1),[K,ye]=(0,D.useState)(``),[be,xe]=(0,D.useState)(``),[q,Se]=(0,D.useState)(!1),[Ce,J]=(0,D.useState)(!1),[Y,Te]=(0,D.useState)(null),[X,Ae]=(0,D.useState)(``),[Me,Ne]=(0,D.useState)(``),[Pe,Fe]=(0,D.useState)(!1),[Ie,Le]=(0,D.useState)(!1),[Z,Re]=(0,D.useState)(null),[ze,Be]=(0,D.useState)(`Hello B. This is from A.`),[Ve,He]=(0,D.useState)(``),[Ue,We]=(0,D.useState)(``),[Ge,Ke]=(0,D.useState)(``),[qe,Je]=(0,D.useState)(`Hello A. This is from B.`),[Ye,Xe]=(0,D.useState)(``),[Ze,Qe]=(0,D.useState)(``),[$e,et]=(0,D.useState)(``),[tt,nt]=(0,D.useState)(``),[rt,it]=(0,D.useState)(``),[at,ot]=(0,D.useState)(``),[st,ct]=(0,D.useState)(``),[lt,Q]=(0,D.useState)(``),[ut,dt]=(0,D.useState)(!1),[ft,pt]=(0,D.useState)(``),[mt,ht]=(0,D.useState)(``),[gt,_t]=(0,D.useState)(``),[vt,yt]=(0,D.useState)(``),[bt,$]=(0,D.useState)(``),[xt,St]=(0,D.useState)(!1);(0,D.useEffect)(()=>{s(je());let e=()=>s(je());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let Ct=e=>{s(e),window.location.hash=e},wt=(0,D.useCallback)(async()=>{if(!c.trim())return;G(!0),await new Promise(e=>setTimeout(e,0));let r=o(c.trim(),_),i=`${r.username}#${r.address.slice(-4).toUpperCase()}`;E(r),n({...r,displayName:i}),t(e(`login.toast.signedIn`,{username:r.username}),`success`),j(l(r.danger));let a=u(r.danger);ae(a),se(ne(a.private_key,a.ed_public_key));let s=re(a.private_key,a.ed_public_key);le(Oe(s.secretKey)),ue(ke(s.publicKey)),me([]),N(0),z(!1),V(!1),U(!1),_e(!1),G(!1)},[t,_,n,e,c]);function Tt(n,r,i){let a=n.trim();if(!a)return;let s=o(a,r),c=u(s.danger);i({username:s.username,address:s.address,publicKey:c.public_key,privateKey:c.private_key}),We(``),Ke(``),Qe(``),et(``),t(e(`web3.toast.accountGenerated`),`success`)}function Et({senderAccount:t,recipientAccount:n,message:i,setCipherText:a,setDecryptedText:o,setError:s}){if(!t||!n){s(e(`web3.error.accountsRequired`));return}if(!i.trim()){s(e(`web3.error.messageRequired`));return}a(r(i,{senderPrivateKey:t.privateKey,recipientPublicKey:n.publicKey})),o(``),s(``)}function Dt({senderAccount:t,recipientAccount:n,cipherText:r,setDecryptedText:i,setError:a}){if(!t||!n){a(e(`web3.error.accountsRequired`));return}if(!r.trim()){a(e(`web3.error.cipherRequired`));return}let o=f(r,{senderPublicKey:t.publicKey,recipientPrivateKey:n.privateKey});if(!o){a(e(`web3.error.decryptFailed`)),i(``);return}i(o),a(``)}function Ot(){if(!tt.trim()){Q(e(`web3.error.senderPublicRequired`));return}if(!rt.trim()){Q(e(`web3.error.recipientPrivateRequired`));return}if(!at.trim()){Q(e(`web3.error.cipherRequired`));return}let t=f(at,{senderPublicKey:tt.trim(),recipientPrivateKey:rt.trim()});if(!t){Q(e(`web3.error.decryptFailed`)),ct(``);return}ct(t),Q(``)}function kt(){if(!ft.trim()){$(e(`web3.error.senderPrivateRequired`));return}if(!mt.trim()){$(e(`web3.error.recipientPublicRequired`));return}if(!gt.trim()){$(e(`web3.error.messageRequired`));return}yt(r(gt,{senderPrivateKey:ft.trim(),recipientPublicKey:mt.trim()})),$(``)}let At=()=>{if(!A)return;let e=[];for(let t=M;t<M+10;t++){let n=`m/44'/60'/0'/0/${t}`,r=d.fromPhrase(A,void 0,n);e.push({index:t,address:r.address,privateKey:r.privateKey})}me(t=>[...t,...e]),N(e=>e+10)},jt=ee(T?.address||void 0),Mt=i===`wallet`?`web3.view.wallet`:i===`pem`?`web3.view.pem`:i===`EA`?`web3.view.asymmetric`:`web3.view.export`,Nt=[{id:`wallet`,icon:(0,O.jsx)(g,{size:16}),labelKey:`web3.view.wallet`},{id:`pem`,icon:(0,O.jsx)(x,{size:16}),labelKey:`web3.view.pem`},{id:`export`,icon:(0,O.jsx)(C,{size:16}),labelKey:`web3.view.export`},{id:`EA`,icon:(0,O.jsx)(y,{size:16}),labelKey:`web3.view.asymmetric`}],Pt=i!==`EA`;return(0,O.jsx)(S,{sidebar:({closeSidebar:t})=>(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(te,{onNavigate:t}),(0,O.jsx)(`nav`,{className:`sidebar-nav`,children:Nt.map(n=>(0,O.jsxs)(`button`,{onClick:()=>{Ct(n.id),t()},className:`sidebar-nav-btn ${i===n.id?`active`:``}`,children:[n.icon,(0,O.jsx)(`span`,{children:e(n.labelKey)})]},n.id))})]}),headerTitle:(0,O.jsx)(`h2`,{className:`header-title`,children:e(Mt)}),children:(0,O.jsx)(`div`,{className:`web3-page`,children:(0,O.jsxs)(`div`,{className:`web3-container ${i===`EA`?`wide`:``}`,children:[Pt&&(0,O.jsx)(De,{username:c,password:_,showPassword:b,generating:ve,onUsernameChange:h,onPasswordChange:v,onTogglePassword:()=>w(!b),onGenerate:wt}),i===`wallet`&&(0,O.jsx)(Ee,{walletResult:T,keys:ie,ipns:oe,avatarSrc:jt,showPrivateKey:W,onTogglePrivateKey:()=>_e(!W)}),i===`pem`&&(0,O.jsx)(pe,{walletResult:T,publicPem:k,privatePem:ce}),i===`export`&&(0,O.jsx)(we,{walletResult:T,mnemonicPhrase:A,deriveBatch:10,deriveList:fe,deriveShowIndex:P,deriveShowAddress:F,deriveShowPrivateKey:L,showAddressQr:ge,showMnemonicReveal:B,showMnemonicQr:H,onToggleAddressQr:()=>z(!ge),onToggleMnemonicReveal:()=>V(!B),onToggleMnemonicQr:()=>U(!H),onToggleDeriveIndex:()=>he(!P),onToggleDeriveAddress:()=>I(!F),onToggleDerivePrivateKey:()=>R(!L),onDerive:At}),i===`EA`&&(0,O.jsx)(de,{boxAUsername:K,boxAPassword:be,boxAShowPassword:q,boxAShowPrivateKey:Ce,boxAAccount:Y,boxBUsername:X,boxBPassword:Me,boxBShowPassword:Pe,boxBShowPrivateKey:Ie,boxBAccount:Z,boxABMessage:ze,boxABCipherText:Ve,boxABDecryptedText:Ue,boxABError:Ge,boxBAMessage:qe,boxBACipherText:Ye,boxBADecryptedText:Ze,boxBAError:$e,boxEncryptSenderPrivateKey:ft,boxEncryptRecipientPublicKey:mt,boxEncryptMessage:gt,boxEncryptCipherText:vt,boxEncryptError:bt,boxEncryptShowPrivateKey:xt,boxDecryptSenderPublicKey:tt,boxDecryptRecipientPrivateKey:rt,boxDecryptCipherText:at,boxDecryptResult:st,boxDecryptError:lt,boxDecryptShowPrivateKey:ut,onBoxAUsernameChange:ye,onBoxAPasswordChange:xe,onBoxAShowPasswordToggle:()=>Se(!q),onBoxAShowPrivateKeyToggle:()=>J(!Ce),onGenerateBoxA:()=>Tt(K,be,Te),onBoxBUsernameChange:Ae,onBoxBPasswordChange:Ne,onBoxBShowPasswordToggle:()=>Fe(!Pe),onBoxBShowPrivateKeyToggle:()=>Le(!Ie),onGenerateBoxB:()=>Tt(X,Me,Re),onBoxABMessageChange:Be,onBoxABCipherTextChange:He,onEncryptBoxAB:()=>Et({senderAccount:Y,recipientAccount:Z,message:ze,setCipherText:He,setDecryptedText:We,setError:Ke}),onDecryptBoxAB:()=>Dt({senderAccount:Y,recipientAccount:Z,cipherText:Ve,setDecryptedText:We,setError:Ke}),onBoxBAMessageChange:Je,onBoxBACipherTextChange:Xe,onEncryptBoxBA:()=>Et({senderAccount:Z,recipientAccount:Y,message:qe,setCipherText:Xe,setDecryptedText:Qe,setError:et}),onDecryptBoxBA:()=>Dt({senderAccount:Z,recipientAccount:Y,cipherText:Ye,setDecryptedText:Qe,setError:et}),onBoxEncryptSenderPrivateKeyChange:pt,onBoxEncryptRecipientPublicKeyChange:ht,onBoxEncryptMessageChange:_t,onBoxEncryptShowPrivateKeyToggle:()=>St(!xt),onEncryptOnly:kt,onBoxDecryptSenderPublicKeyChange:nt,onBoxDecryptRecipientPrivateKeyChange:it,onBoxDecryptCipherTextChange:ot,onBoxDecryptShowPrivateKeyToggle:()=>dt(!ut),onDecryptOnly:Ot})]})})})}var Ne=s(`/web3/`)({component:Me});export{Ne as Route};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,H as i,W as a,t as o}from"./useAppStore-
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,H as i,W as a,t as o}from"./useAppStore-Pjif7nCR.js";import{a as s}from"./i18n-DKsg67mH.js";import{a as c}from"./AccountMenu-C3wvcWtn.js";import{t as l}from"./arrow-right-DcTPIyLV.js";import{t as u}from"./download-nQ9X-v0q.js";import{t as d}from"./external-link-LcGMVTLE.js";import{t as f}from"./folder-open-BKTeAP5z.js";import{t as p}from"./gamepad-2-q3ssU_CE.js";import{t as m}from"./hard-drive-CMNAmPI5.js";import{t as h}from"./message-square-0kQmuMcd.js";import{t as g}from"./notebook-pen-CMRWy6ni.js";import{t as _}from"./wallet-Ts6jdQzi.js";import{E as v,k as y}from"./index-CCU5Z4K-.js";import{t as b}from"./MarketingLayout-9X-D6xx4.js";var x=r(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),S=t(e(),1),C=n(),w=[{id:`app`,titleKey:`portal.feature.app.title`,subtitleKey:`portal.feature.app.subtitle`,icon:(0,C.jsx)(f,{size:28}),path:`/app/`,requiresBackend:!0,heroKey:`portal.feature.app.hero`,descKey:`portal.feature.app.desc`,featureKeys:[`portal.feature.app.bullet.localIdentity`,`portal.feature.app.bullet.hyperswarm`,`portal.feature.app.bullet.largeFiles`,`portal.feature.app.bullet.cid`,`portal.feature.app.bullet.seedAfterDownload`,`portal.feature.app.bullet.noCloud`,`portal.feature.app.bullet.desktop`,`portal.feature.app.bullet.openSource`],steps:[{num:`1`,titleKey:`portal.feature.app.step.download.title`,descKey:`portal.feature.app.step.download.desc`,link:`/download/`,linkTextKey:`portal.feature.app.step.download.link`,hideInDesktopClient:!0},{num:`2`,titleKey:`portal.feature.app.step.install.title`,descKey:`portal.feature.app.step.install.desc`,hideInDesktopClient:!0},{num:`3`,titleKey:`portal.feature.app.step.share.title`,descKey:`portal.feature.app.step.share.desc`}]},{id:`chat`,titleKey:`portal.feature.chat.title`,subtitleKey:`portal.feature.chat.subtitle`,icon:(0,C.jsx)(h,{size:28}),path:`/chat/`,requiresBackend:!0,heroKey:`portal.feature.chat.hero`,descKey:`portal.feature.chat.desc`,featureKeys:[`portal.feature.chat.bullet.encrypted`,`portal.feature.chat.bullet.identity`,`portal.feature.chat.bullet.sync`,`portal.feature.chat.bullet.offline`,`portal.feature.chat.bullet.noAccount`],steps:[{num:`1`,titleKey:`portal.feature.chat.step.download.title`,descKey:`portal.feature.chat.step.download.desc`,link:`/download/`,linkTextKey:`portal.feature.chat.step.download.link`,hideInDesktopClient:!0},{num:`2`,titleKey:`portal.feature.chat.step.create.title`,descKey:`portal.feature.chat.step.create.desc`},{num:`3`,titleKey:`portal.feature.chat.step.send.title`,descKey:`portal.feature.chat.step.send.desc`}]},{id:`note`,titleKey:`portal.feature.note.title`,subtitleKey:`portal.feature.note.subtitle`,icon:(0,C.jsx)(g,{size:28}),path:`/note/`,requiresBackend:!1,heroKey:`portal.feature.note.hero`,descKey:`portal.feature.note.desc`,featureKeys:[`portal.feature.note.bullet.markdown`,`portal.feature.note.bullet.privacy`,`portal.feature.note.bullet.folders`,`portal.feature.note.bullet.web3`,`portal.feature.note.bullet.backup`,`portal.feature.note.bullet.independent`],steps:[{num:`1`,titleKey:`portal.feature.note.step.account.title`,descKey:`portal.feature.note.step.account.desc`},{num:`2`,titleKey:`portal.feature.note.step.create.title`,descKey:`portal.feature.note.step.create.desc`},{num:`3`,titleKey:`portal.feature.note.step.backup.title`,descKey:`portal.feature.note.step.backup.desc`}]},{id:`gandengyan`,titleKey:`portal.feature.game.title`,subtitleKey:`portal.feature.game.subtitle`,icon:(0,C.jsx)(p,{size:28}),path:`/game/gandengyan/`,requiresBackend:!0,heroKey:`portal.feature.game.hero`,descKey:`portal.feature.game.desc`,featureKeys:[`portal.feature.game.bullet.account`,`portal.feature.game.bullet.channel`,`portal.feature.game.bullet.link`,`portal.feature.game.bullet.rules`,`portal.feature.game.bullet.maintain`],steps:[{num:`1`,titleKey:`portal.feature.game.step.login.title`,descKey:`portal.feature.game.step.login.desc`},{num:`2`,titleKey:`portal.feature.game.step.create.title`,descKey:`portal.feature.game.step.create.desc`},{num:`3`,titleKey:`portal.feature.game.step.test.title`,descKey:`portal.feature.game.step.test.desc`}]},{id:`web3`,titleKey:`portal.feature.web3.title`,subtitleKey:`portal.feature.web3.subtitle`,icon:(0,C.jsx)(_,{size:28}),path:`/web3/`,requiresBackend:!1,heroKey:`portal.feature.web3.hero`,descKey:`portal.feature.web3.desc`,featureKeys:[`portal.feature.web3.bullet.frontend`,`portal.feature.web3.bullet.keys`,`portal.feature.web3.bullet.mnemonic`,`portal.feature.web3.bullet.eth`,`portal.feature.web3.bullet.pem`,`portal.feature.web3.bullet.qr`],steps:[{num:`1`,titleKey:`portal.feature.web3.step.username.title`,descKey:`portal.feature.web3.step.username.desc`},{num:`2`,titleKey:`portal.feature.web3.step.keys.title`,descKey:`portal.feature.web3.step.keys.desc`},{num:`3`,titleKey:`portal.feature.web3.step.export.title`,descKey:`portal.feature.web3.step.export.desc`}]}],T=[`chat`,`app`,`note`,`gandengyan`,`web3`];function E(){let e=o(e=>e.hasBackend),t=o(e=>e.openConnectModal),[n,r]=(0,S.useState)(`chat`),{t:i}=s(),f=v(),p=T.map(e=>w.find(t=>t.id===e)).filter(e=>!!e),h=p.find(e=>e.id===n)||p[0],g=i(h.titleKey),_=h.steps.filter(e=>!(f&&e.hideInDesktopClient));return(0,C.jsxs)(`div`,{className:`portal-page`,children:[(0,C.jsx)(`section`,{className:`portal-hero`,children:(0,C.jsxs)(`div`,{className:`mkt-container`,children:[(0,C.jsx)(`h1`,{className:`portal-hero-title`,children:i(`common.brand`)}),(0,C.jsx)(`p`,{className:`portal-hero-subtitle`,children:i(`portal.hero.subtitle`)})]})}),(0,C.jsx)(`section`,{className:`portal-cards-section`,children:(0,C.jsxs)(`div`,{className:`mkt-container`,children:[(0,C.jsx)(`div`,{className:`portal-cards`,children:p.map(t=>{let o=n===t.id,s=t.requiresBackend,c=s?e===!0?`connected`:e===!1?`disconnected`:`checking`:`none`,l=i(t.titleKey);return(0,C.jsxs)(`button`,{className:`portal-card ${o?`active`:``}`,onClick:()=>r(t.id),children:[(0,C.jsx)(a,{to:t.path,className:`btn btn-icon portal-card-open-btn`,onClick:e=>e.stopPropagation(),title:i(`portal.openFeature`,{title:l}),children:(0,C.jsx)(x,{size:16})}),(0,C.jsx)(`div`,{className:`portal-card-icon`,children:t.icon}),(0,C.jsx)(`div`,{className:`portal-card-title`,children:l}),(0,C.jsx)(`div`,{className:`portal-card-subtitle`,children:i(t.subtitleKey)}),s?(0,C.jsxs)(`div`,{className:`ui-badge portal-card-status ${c}`,children:[c===`checking`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot checking`}),i(`common.status.checking`)]}),c===`connected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot connected`}),i(`common.status.connected`)]}),c===`disconnected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot disconnected`}),i(`common.status.needsConnection`)]})]}):(0,C.jsxs)(`div`,{className:`ui-badge portal-card-status ready`,children:[(0,C.jsx)(`span`,{className:`status-dot ready`}),i(`common.status.ready`)]})]},t.id)})}),(0,C.jsxs)(`div`,{className:`portal-node-actions`,"aria-label":i(`portal.nodeEntry`),children:[(0,C.jsxs)(`button`,{onClick:t,className:`btn btn-secondary`,children:[(0,C.jsx)(y,{size:16}),i(`portal.webConnectNode`)]}),(0,C.jsxs)(a,{to:`/admin/`,className:`btn btn-secondary`,children:[(0,C.jsx)(m,{size:16}),i(`portal.nodeAdmin`)]})]})]})}),(0,C.jsx)(`section`,{className:`portal-marketing`,children:(0,C.jsx)(`div`,{className:`mkt-container`,children:(0,C.jsxs)(`div`,{className:`portal-marketing-inner`,children:[(0,C.jsxs)(`div`,{className:`portal-marketing-header`,children:[(0,C.jsx)(`h2`,{children:i(h.heroKey)}),(0,C.jsx)(`p`,{children:i(h.descKey)})]}),(0,C.jsx)(`div`,{className:`portal-marketing-features`,children:h.featureKeys.map(e=>(0,C.jsxs)(`div`,{className:`portal-feature-item`,children:[(0,C.jsx)(`span`,{className:`portal-feature-icon`,children:(0,C.jsx)(c,{size:14,strokeWidth:3})}),(0,C.jsx)(`span`,{children:i(e)})]},e))}),(0,C.jsx)(`div`,{className:`portal-marketing-steps`,children:_.map((e,t)=>(0,C.jsxs)(`div`,{className:`portal-step`,children:[(0,C.jsx)(`span`,{className:`portal-step-num`,children:t+1}),(0,C.jsxs)(`div`,{className:`portal-step-content`,children:[(0,C.jsx)(`strong`,{children:i(e.titleKey)}),(0,C.jsx)(`p`,{children:i(e.descKey)}),e.code&&(0,C.jsx)(`code`,{className:`portal-step-code`,translate:`no`,children:e.code}),e.link&&e.linkTextKey&&(0,C.jsx)(`p`,{className:`portal-step-link`,children:(0,C.jsxs)(a,{to:e.link,children:[i(e.linkTextKey),` `,(0,C.jsx)(d,{size:12})]})})]})]},e.num))}),(0,C.jsxs)(`div`,{className:`portal-actions`,children:[(0,C.jsxs)(a,{to:h.path,className:`btn btn-primary`,children:[i(`portal.enterFeature`,{title:g}),(0,C.jsx)(l,{size:16})]}),h.requiresBackend&&e===!1&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`button`,{onClick:t,className:`btn btn-secondary`,children:[(0,C.jsx)(y,{size:16}),i(`portal.webConnectNode`)]}),!f&&(0,C.jsxs)(a,{to:`/download/`,className:`btn btn-secondary`,children:[(0,C.jsx)(u,{size:16}),i(`nav.downloadClient`)]})]})]})]})})})]})}function D(){return(0,C.jsx)(b,{children:(0,C.jsx)(E,{})})}var O=i(`/`)({component:D});export{O as Route};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,E as i,H as a,c as o,n as s,o as c,t as l}from"./useAppStore-DNhyhD20.js";import{a as u}from"./i18n-DKsg67mH.js";import{t as d}from"./circle-alert-DXVkx8p8.js";import{a as ee,o as f,r as p,t as te}from"./chatNoteDraft-DTy6In5R.js";import{t as ne}from"./OpenSidebarButton-CXBAjjCE.js";import{a as m,i as h,n as re,o as ie,r as ae,t as oe}from"./saveLocalFile-DTgdBgO9.js";import{t as g}from"./arrow-right-BsHzC0ZL.js";import{n as se,t as _}from"./trash-2-B9gno5q6.js";import{t as v}from"./download-Cy2BlfKM.js";import{t as ce}from"./external-link-D_AQSgxW.js";import{t as le}from"./file-text-zvTER2mN.js";import{t as y}from"./loader-C4pED_QP.js";import{r as ue,t as de}from"./AppShell-CKP_dglR.js";import{t as fe}from"./message-square-CfApq8Ou.js";import{t as pe}from"./music-Br2x8TKX.js";import{t as me}from"./search-DLBOUfny.js";import{A as he,C as ge,M as _e,O as ve,S as b,T as ye,g as be,j as xe,n as Se,r as Ce,w as we}from"./index-DJzLHA0V.js";import{t as Te}from"./AppTop-C03PsDr_.js";import{t as Ee}from"./LogoIcon-B2fFe0l1.js";import{t as De}from"./format-CAKfypjK.js";import{a as Oe,i as ke,n as x,o as Ae,t as je}from"./downloadValidation-Dd43i9_9.js";import{t as S}from"./channelApi-C5eHetoJ.js";import{n as Me,t as Ne}from"./useChannelMessages-BrqZa2SG.js";import{t as Pe}from"./ChatRestoringIndicator-CLV78gNW.js";var Fe=r(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Ie=r(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Le=r(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),Re=r(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),ze=r(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),C=t(e(),1),w=n();function Be(e){return String(e||``).split(`/`).pop()||e}function Ve(e){return e===`image`?(0,w.jsx)(h,{size:20}):e===`video`?(0,w.jsx)(m,{size:20}):e===`audio`?(0,w.jsx)(pe,{size:20}):(0,w.jsx)(le,{size:20})}function He({attachment:e,status:t=`idle`,message:n,pending:r=!1,onOpen:i}){let{t:a}=u(),o=t===`checking`,s=t===`downloading`,c=r||o||s,l=`ui-file-action chat-attachment-action ${t===`error`?`error`:t===`available`?`available`:``}`.trim(),ee=Number.isFinite(e.size)&&e.size>0?De(e.size):a(`chat.mostboxFile`),f=r?a(`chat.sending`):n||ee,p=a(r?`chat.sending`:o?`chat.checking`:s?`chat.attachment.downloading`:t===`available`?`chat.attachment.preview`:t===`error`?`chat.attachment.retry`:`chat.attachment.download`);return(0,w.jsxs)(`button`,{type:`button`,className:`ui-file-card chat-attachment-card`,onClick:()=>i?.(e),disabled:c,title:e.link,translate:`no`,children:[(0,w.jsx)(`span`,{className:`ui-file-icon chat-attachment-icon ${e.kind}`,children:c?(0,w.jsx)(y,{size:20,className:`ui-spinner chat-attachment-spinner`}):Ve(e.kind)}),(0,w.jsxs)(`span`,{className:`ui-file-info chat-attachment-info`,children:[(0,w.jsx)(`span`,{className:`ui-file-name chat-attachment-name`,translate:`no`,children:Be(e.fileName)}),(0,w.jsx)(`span`,{className:`ui-file-meta chat-attachment-meta`,translate:`yes`,children:f})]}),(0,w.jsxs)(`span`,{className:l,translate:`yes`,children:[c?(0,w.jsx)(y,{size:15,className:`ui-spinner chat-attachment-spinner`}):t===`available`?(0,w.jsx)(_e,{size:16}):t===`error`?(0,w.jsx)(d,{size:17}):(0,w.jsx)(v,{size:16}),(0,w.jsx)(`span`,{className:`chat-attachment-action-label`,children:p})]})]})}var T=[{key:`image`,labelKey:`chat.attachment.image`,accept:`image/*`,icon:h},{key:`video`,labelKey:`chat.attachment.video`,accept:`video/*`,icon:m},{key:`file`,labelKey:`chat.attachment.file`,accept:``,icon:le}],Ue={key:`voice`,labelKey:`chat.voice.menu`,icon:xe},We=T.map(e=>e.accept).join(`,`);function Ge({children:e}){return(0,w.jsx)(`div`,{className:`message-bubble`,translate:`no`,children:e})}function Ke({children:e}){return(0,w.jsx)(`div`,{className:`message-bubble has-attachment`,children:e})}function qe({children:e}){return(0,w.jsx)(`div`,{className:`chat-system-message`,children:e})}function Je({variant:e,pending:t=!1,avatarSrc:n,isOnline:r=!1,author:i,time:a,children:o}){return(0,w.jsxs)(`div`,{className:[`chat-message`,e,t?`pending`:``].filter(Boolean).join(` `),children:[(0,w.jsxs)(`span`,{className:`chat-avatar-wrap`,children:[(0,w.jsx)(`img`,{className:`msg-avatar`,src:n,alt:`avatar`}),r&&(0,w.jsx)(`span`,{className:`chat-online-dot`,"aria-hidden":`true`})]}),(0,w.jsxs)(`div`,{className:`msg-content`,children:[(0,w.jsx)(`span`,{className:`message-header`,children:(0,w.jsx)(`span`,{className:`message-author`,translate:`no`,children:i})}),o,(0,w.jsx)(`span`,{className:`message-time`,children:a})]})]})}function Ye({active:e=!1,pinned:t=!1,unread:n=!1,title:r,menuClassName:i,onSelect:a,onTogglePin:o,onRename:s,onLeave:c}){let{t:l}=u(),d=!!(o||s||c);return(0,w.jsxs)(`div`,{className:[`sidebar-nav-btn`,e?`active`:``,t?`pinned`:``,n?`unread`:``].filter(Boolean).join(` `),onClick:a,role:`button`,tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&e.key===`Enter`&&a?.()},children:[(0,w.jsxs)(`span`,{className:`chat-channel-icon-wrap`,children:[(0,w.jsx)(fe,{size:16}),n&&(0,w.jsx)(`span`,{className:`chat-channel-unread-dot`,title:l(`chat.unread`),"aria-hidden":`true`})]}),(0,w.jsx)(`span`,{className:`chat-channel-title`,children:(0,w.jsx)(`span`,{className:`chat-channel-title-text`,translate:`no`,children:r})}),d&&(0,w.jsx)(b,{ariaLabel:l(`chat.channelActions`),className:`channel-actions-anchor`,menuClassName:i,placement:`bottom-end`,items:[{key:`pin`,label:l(t?`chat.unpin`:`chat.pin`),icon:t?(0,w.jsx)(Le,{size:16}):(0,w.jsx)(Re,{size:16}),onSelect:()=>o?.()},{key:`rename`,label:l(`chat.rename`),icon:(0,w.jsx)(ie,{size:16}),onSelect:()=>s?.()},{key:`delete`,label:l(`chat.delete`),icon:(0,w.jsx)(_,{size:16}),onSelect:()=>c?.()}],renderTrigger:e=>(0,w.jsx)(`button`,{...e,className:`leave-channel-btn channel-actions-trigger`,title:l(`common.moreActions`),"aria-label":l(`common.moreActions`),children:(0,w.jsx)(f,{size:16})})})]})}function Xe({members:e}){let{t}=u();return e.length===0?(0,w.jsx)(`div`,{className:`ui-empty-inline channel-members-empty`,children:t(`chat.noMembers`)}):(0,w.jsx)(`div`,{className:`channel-members-grid`,children:e.map(e=>(0,w.jsxs)(`div`,{className:`channel-member`,children:[(0,w.jsxs)(`span`,{className:`channel-member-avatar-wrap`,children:[(0,w.jsx)(`img`,{className:`channel-member-avatar`,src:e.avatarSrc,alt:`avatar`}),e.online&&(0,w.jsx)(`span`,{className:`chat-online-dot`,"aria-hidden":`true`})]}),(0,w.jsx)(`span`,{className:`channel-member-name`,translate:`no`,children:e.name})]},e.id))})}function Ze({message:e,placeholder:t,disabled:n=!1,isPublishingAttachment:r=!1,attachmentButtonTitle:i,attachmentInputRef:a,attachmentMenuClassName:o,showVoiceRoom:s=!0,onMessageChange:c,onSend:l,onOpenVoiceRoom:d,onSelectAttachmentFiles:f}){let{t:p}=u(),te=n||r,ne=n||!e.trim(),m=i||p(`chat.attachment.add`);function h(e,t){let n=e.currentTarget.files?Array.from(e.currentTarget.files):null;t?.(n),e.currentTarget.value=``}function re(t){t.key===`Enter`&&(t.shiftKey||t.nativeEvent.isComposing||(t.preventDefault(),e.trim()&&l()))}function ie(e){if(te)return;let t=a?.current;t&&(t.accept=e,t.click())}return(0,w.jsxs)(`div`,{className:`chat-input-area`,children:[(0,w.jsx)(`input`,{ref:a,type:`file`,accept:We,className:`chat-file-input`,onChange:e=>h(e,f)}),(0,w.jsx)(b,{ariaLabel:p(`chat.attachmentType`),placement:`top-start`,disabled:te,menuClassName:o,items:[...T.map(e=>{let t=e.icon;return{key:e.key,label:p(e.labelKey),icon:(0,w.jsx)(t,{size:16}),onSelect:()=>ie(e.accept)}}),...s?[{key:Ue.key,label:p(Ue.labelKey),icon:(0,w.jsx)(xe,{size:16}),onSelect:()=>d?.()}]:[]],renderTrigger:e=>(0,w.jsx)(`button`,{...e,className:`btn btn-circle chat-tool-btn`,"aria-label":m,children:r?(0,w.jsx)(y,{size:18,className:`ui-spinner chat-attachment-spinner`}):(0,w.jsx)(ee,{size:18})})}),(0,w.jsx)(`textarea`,{className:`textarea chat-composer-input`,placeholder:t,value:e,disabled:n,rows:1,onChange:e=>c(e.target.value),onKeyDown:re}),(0,w.jsx)(`button`,{type:`button`,className:`btn btn-circle btn-primary send-btn`,onClick:l,disabled:ne,title:p(`chat.sendMessage`),children:(0,w.jsx)(g,{size:18})})]})}var Qe=`mostbox.chat.lastReadAt`;function E(e){return Date.parse(e?.lastMessageAt||``)||Date.parse(e?.createdAt||``)||0}function $e(e){let t=String(e||``).trim().toLowerCase();return t?`${Qe}:${t}`:``}function et(e,t=Date.now()){let n=Number(e);return Math.max(0,Math.floor(Number.isFinite(n)&&n>0?n:t))}function tt(e,t=D()){if(!e||!t)return{};try{let n=t.getItem(e);if(!n)return{};let r=JSON.parse(n);return!r||typeof r!=`object`?{}:Object.entries(r).reduce((e,[t,n])=>{let r=Number(n);return t&&Number.isFinite(r)&&r>=0&&(e[t]=r),e},{})}catch{return{}}}function nt(e,t,n=D()){if(!(!e||!n))try{n.setItem(e,JSON.stringify(t))}catch{}}function rt(e,t,n=Date.now(),r=Date.now()){if(!t)return{changed:!1,value:e};let i=et(n,r);return(e[t]||0)>=i?{changed:!1,value:e}:{changed:!0,value:{...e,[t]:i}}}function it(e,t,n=Date.now()){let r=!1,i={...e};for(let e of t){let t=e?.channelKey||e?.name;!t||i[t]!==void 0||(i[t]=et(E(e),n),r=!0)}return{changed:r,value:r?i:e}}function at(e,{channelName:t,messageTime:n,activeChannelName:r=``,messageAuthor:i=``,userAddress:a=``,now:o=Date.now()}){if(!t)return{changed:!1,notify:!1,value:e};let s=et(n,o),c=t===r;if(String(i||``).toLowerCase()===String(a||``).toLowerCase())return{...rt(e,t,s,o),notify:!1};if(c)return{...rt(e,t,s,o),notify:!0};let l=e[t]||0;if(l<s)return{changed:!1,notify:!0,value:e};let u=Math.max(0,s-1);return l===u?{changed:!1,notify:!0,value:e}:{changed:!0,notify:!0,value:{...e,[t]:u}}}function ot(e,t){let n=e?.channelKey||e?.name;return E(e)>(t[n]||0)}function D(){if(!(typeof window>`u`))return window.localStorage}var st=3,ct=30,lt=/^[a-zA-Z0-9_-]+$/,ut=1e4,dt=12e3,ft=1200,pt=800;function O(e){return e?.channelKey||e?.name||``}function k(e){return e?.channelId||e?.name||``}function A(e){return e&&typeof e==`object`?e:{}}function mt(e){let t=A(e),n=new Set,r=e=>{let t=String(e||``).trim();t&&n.add(t)};return r(t.channelKey),r(t.channel),Array.isArray(t.channels)&&t.channels.forEach(e=>{let t=A(e);r(t.channelKey),r(t.channel),r(t.name)}),[...n]}function j(e){return e?.remark||k(e)}function ht(){return typeof window>`u`?``:(new URLSearchParams(window.location.search).get(`channel`)||``).trim()}function gt(e){let t=new Date(e||Date.now());return Number.isNaN(t.getTime())?String(Date.now()):t.toISOString().slice(0,16).replace(`T`,` `).replace(`:`,`-`)}function _t(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`)}function vt(e,t){return`[${_t(e)}](<${t.replace(/>/g,`%3E`)}>)`}function yt(e){let t=String(e||``).trim().split(/\r?\n/);return t.length>0?t.map(e=>`> ${e}`).join(`
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,E as i,H as a,c as o,n as s,o as c,t as l}from"./useAppStore-Pjif7nCR.js";import{a as u}from"./i18n-DKsg67mH.js";import{t as d}from"./circle-alert-Dg9cBJgj.js";import{a as ee,o as f,r as p,t as te}from"./chatNoteDraft-D6FEmSXK.js";import{t as ne}from"./OpenSidebarButton-09yeNDLa.js";import{a as m,i as h,n as re,o as ie,r as ae,t as oe}from"./saveLocalFile-DkrpR5WS.js";import{t as g}from"./arrow-right-DcTPIyLV.js";import{n as se,t as _}from"./trash-2-DQI0V0Rl.js";import{t as v}from"./download-nQ9X-v0q.js";import{t as ce}from"./external-link-LcGMVTLE.js";import{t as le}from"./file-text-f1ij7Al1.js";import{t as y}from"./loader-DAMqAKH7.js";import{r as ue,t as de}from"./AppShell-BN1uaxn1.js";import{t as fe}from"./message-square-0kQmuMcd.js";import{t as pe}from"./music-U7NZcQ6S.js";import{t as me}from"./search-CURHlVZZ.js";import{A as he,C as ge,M as _e,O as ve,S as b,T as ye,g as be,j as xe,n as Se,r as Ce,w as we}from"./index-CCU5Z4K-.js";import{t as Te}from"./AppTop-iPNi3cv5.js";import{t as Ee}from"./LogoIcon-B2fFe0l1.js";import{t as De}from"./format-CAKfypjK.js";import{a as Oe,i as ke,n as x,o as Ae,t as je}from"./downloadValidation-C0PecvKC.js";import{t as S}from"./channelApi-DA2GY-k4.js";import{n as Me,t as Ne}from"./useChannelMessages-Ea1I0HsF.js";import{t as Pe}from"./ChatRestoringIndicator-CLV78gNW.js";var Fe=r(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Ie=r(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Le=r(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),Re=r(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),ze=r(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),C=t(e(),1),w=n();function Be(e){return String(e||``).split(`/`).pop()||e}function Ve(e){return e===`image`?(0,w.jsx)(h,{size:20}):e===`video`?(0,w.jsx)(m,{size:20}):e===`audio`?(0,w.jsx)(pe,{size:20}):(0,w.jsx)(le,{size:20})}function He({attachment:e,status:t=`idle`,message:n,pending:r=!1,onOpen:i}){let{t:a}=u(),o=t===`checking`,s=t===`downloading`,c=r||o||s,l=`ui-file-action chat-attachment-action ${t===`error`?`error`:t===`available`?`available`:``}`.trim(),ee=Number.isFinite(e.size)&&e.size>0?De(e.size):a(`chat.mostboxFile`),f=r?a(`chat.sending`):n||ee,p=a(r?`chat.sending`:o?`chat.checking`:s?`chat.attachment.downloading`:t===`available`?`chat.attachment.preview`:t===`error`?`chat.attachment.retry`:`chat.attachment.download`);return(0,w.jsxs)(`button`,{type:`button`,className:`ui-file-card chat-attachment-card`,onClick:()=>i?.(e),disabled:c,title:e.link,translate:`no`,children:[(0,w.jsx)(`span`,{className:`ui-file-icon chat-attachment-icon ${e.kind}`,children:c?(0,w.jsx)(y,{size:20,className:`ui-spinner chat-attachment-spinner`}):Ve(e.kind)}),(0,w.jsxs)(`span`,{className:`ui-file-info chat-attachment-info`,children:[(0,w.jsx)(`span`,{className:`ui-file-name chat-attachment-name`,translate:`no`,children:Be(e.fileName)}),(0,w.jsx)(`span`,{className:`ui-file-meta chat-attachment-meta`,translate:`yes`,children:f})]}),(0,w.jsxs)(`span`,{className:l,translate:`yes`,children:[c?(0,w.jsx)(y,{size:15,className:`ui-spinner chat-attachment-spinner`}):t===`available`?(0,w.jsx)(_e,{size:16}):t===`error`?(0,w.jsx)(d,{size:17}):(0,w.jsx)(v,{size:16}),(0,w.jsx)(`span`,{className:`chat-attachment-action-label`,children:p})]})]})}var T=[{key:`image`,labelKey:`chat.attachment.image`,accept:`image/*`,icon:h},{key:`video`,labelKey:`chat.attachment.video`,accept:`video/*`,icon:m},{key:`file`,labelKey:`chat.attachment.file`,accept:``,icon:le}],Ue={key:`voice`,labelKey:`chat.voice.menu`,icon:xe},We=T.map(e=>e.accept).join(`,`);function Ge({children:e}){return(0,w.jsx)(`div`,{className:`message-bubble`,translate:`no`,children:e})}function Ke({children:e}){return(0,w.jsx)(`div`,{className:`message-bubble has-attachment`,children:e})}function qe({children:e}){return(0,w.jsx)(`div`,{className:`chat-system-message`,children:e})}function Je({variant:e,pending:t=!1,avatarSrc:n,isOnline:r=!1,author:i,time:a,children:o}){return(0,w.jsxs)(`div`,{className:[`chat-message`,e,t?`pending`:``].filter(Boolean).join(` `),children:[(0,w.jsxs)(`span`,{className:`chat-avatar-wrap`,children:[(0,w.jsx)(`img`,{className:`msg-avatar`,src:n,alt:`avatar`}),r&&(0,w.jsx)(`span`,{className:`chat-online-dot`,"aria-hidden":`true`})]}),(0,w.jsxs)(`div`,{className:`msg-content`,children:[(0,w.jsx)(`span`,{className:`message-header`,children:(0,w.jsx)(`span`,{className:`message-author`,translate:`no`,children:i})}),o,(0,w.jsx)(`span`,{className:`message-time`,children:a})]})]})}function Ye({active:e=!1,pinned:t=!1,unread:n=!1,title:r,menuClassName:i,onSelect:a,onTogglePin:o,onRename:s,onLeave:c}){let{t:l}=u(),d=!!(o||s||c);return(0,w.jsxs)(`div`,{className:[`sidebar-nav-btn`,e?`active`:``,t?`pinned`:``,n?`unread`:``].filter(Boolean).join(` `),onClick:a,role:`button`,tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&e.key===`Enter`&&a?.()},children:[(0,w.jsxs)(`span`,{className:`chat-channel-icon-wrap`,children:[(0,w.jsx)(fe,{size:16}),n&&(0,w.jsx)(`span`,{className:`chat-channel-unread-dot`,title:l(`chat.unread`),"aria-hidden":`true`})]}),(0,w.jsx)(`span`,{className:`chat-channel-title`,children:(0,w.jsx)(`span`,{className:`chat-channel-title-text`,translate:`no`,children:r})}),d&&(0,w.jsx)(b,{ariaLabel:l(`chat.channelActions`),className:`channel-actions-anchor`,menuClassName:i,placement:`bottom-end`,items:[{key:`pin`,label:l(t?`chat.unpin`:`chat.pin`),icon:t?(0,w.jsx)(Le,{size:16}):(0,w.jsx)(Re,{size:16}),onSelect:()=>o?.()},{key:`rename`,label:l(`chat.rename`),icon:(0,w.jsx)(ie,{size:16}),onSelect:()=>s?.()},{key:`delete`,label:l(`chat.delete`),icon:(0,w.jsx)(_,{size:16}),onSelect:()=>c?.()}],renderTrigger:e=>(0,w.jsx)(`button`,{...e,className:`leave-channel-btn channel-actions-trigger`,title:l(`common.moreActions`),"aria-label":l(`common.moreActions`),children:(0,w.jsx)(f,{size:16})})})]})}function Xe({members:e}){let{t}=u();return e.length===0?(0,w.jsx)(`div`,{className:`ui-empty-inline channel-members-empty`,children:t(`chat.noMembers`)}):(0,w.jsx)(`div`,{className:`channel-members-grid`,children:e.map(e=>(0,w.jsxs)(`div`,{className:`channel-member`,children:[(0,w.jsxs)(`span`,{className:`channel-member-avatar-wrap`,children:[(0,w.jsx)(`img`,{className:`channel-member-avatar`,src:e.avatarSrc,alt:`avatar`}),e.online&&(0,w.jsx)(`span`,{className:`chat-online-dot`,"aria-hidden":`true`})]}),(0,w.jsx)(`span`,{className:`channel-member-name`,translate:`no`,children:e.name})]},e.id))})}function Ze({message:e,placeholder:t,disabled:n=!1,isPublishingAttachment:r=!1,attachmentButtonTitle:i,attachmentInputRef:a,attachmentMenuClassName:o,showVoiceRoom:s=!0,onMessageChange:c,onSend:l,onOpenVoiceRoom:d,onSelectAttachmentFiles:f}){let{t:p}=u(),te=n||r,ne=n||!e.trim(),m=i||p(`chat.attachment.add`);function h(e,t){let n=e.currentTarget.files?Array.from(e.currentTarget.files):null;t?.(n),e.currentTarget.value=``}function re(t){t.key===`Enter`&&(t.shiftKey||t.nativeEvent.isComposing||(t.preventDefault(),e.trim()&&l()))}function ie(e){if(te)return;let t=a?.current;t&&(t.accept=e,t.click())}return(0,w.jsxs)(`div`,{className:`chat-input-area`,children:[(0,w.jsx)(`input`,{ref:a,type:`file`,accept:We,className:`chat-file-input`,onChange:e=>h(e,f)}),(0,w.jsx)(b,{ariaLabel:p(`chat.attachmentType`),placement:`top-start`,disabled:te,menuClassName:o,items:[...T.map(e=>{let t=e.icon;return{key:e.key,label:p(e.labelKey),icon:(0,w.jsx)(t,{size:16}),onSelect:()=>ie(e.accept)}}),...s?[{key:Ue.key,label:p(Ue.labelKey),icon:(0,w.jsx)(xe,{size:16}),onSelect:()=>d?.()}]:[]],renderTrigger:e=>(0,w.jsx)(`button`,{...e,className:`btn btn-circle chat-tool-btn`,"aria-label":m,children:r?(0,w.jsx)(y,{size:18,className:`ui-spinner chat-attachment-spinner`}):(0,w.jsx)(ee,{size:18})})}),(0,w.jsx)(`textarea`,{className:`textarea chat-composer-input`,placeholder:t,value:e,disabled:n,rows:1,onChange:e=>c(e.target.value),onKeyDown:re}),(0,w.jsx)(`button`,{type:`button`,className:`btn btn-circle btn-primary send-btn`,onClick:l,disabled:ne,title:p(`chat.sendMessage`),children:(0,w.jsx)(g,{size:18})})]})}var Qe=`mostbox.chat.lastReadAt`;function E(e){return Date.parse(e?.lastMessageAt||``)||Date.parse(e?.createdAt||``)||0}function $e(e){let t=String(e||``).trim().toLowerCase();return t?`${Qe}:${t}`:``}function et(e,t=Date.now()){let n=Number(e);return Math.max(0,Math.floor(Number.isFinite(n)&&n>0?n:t))}function tt(e,t=D()){if(!e||!t)return{};try{let n=t.getItem(e);if(!n)return{};let r=JSON.parse(n);return!r||typeof r!=`object`?{}:Object.entries(r).reduce((e,[t,n])=>{let r=Number(n);return t&&Number.isFinite(r)&&r>=0&&(e[t]=r),e},{})}catch{return{}}}function nt(e,t,n=D()){if(!(!e||!n))try{n.setItem(e,JSON.stringify(t))}catch{}}function rt(e,t,n=Date.now(),r=Date.now()){if(!t)return{changed:!1,value:e};let i=et(n,r);return(e[t]||0)>=i?{changed:!1,value:e}:{changed:!0,value:{...e,[t]:i}}}function it(e,t,n=Date.now()){let r=!1,i={...e};for(let e of t){let t=e?.channelKey||e?.name;!t||i[t]!==void 0||(i[t]=et(E(e),n),r=!0)}return{changed:r,value:r?i:e}}function at(e,{channelName:t,messageTime:n,activeChannelName:r=``,messageAuthor:i=``,userAddress:a=``,now:o=Date.now()}){if(!t)return{changed:!1,notify:!1,value:e};let s=et(n,o),c=t===r;if(String(i||``).toLowerCase()===String(a||``).toLowerCase())return{...rt(e,t,s,o),notify:!1};if(c)return{...rt(e,t,s,o),notify:!0};let l=e[t]||0;if(l<s)return{changed:!1,notify:!0,value:e};let u=Math.max(0,s-1);return l===u?{changed:!1,notify:!0,value:e}:{changed:!0,notify:!0,value:{...e,[t]:u}}}function ot(e,t){let n=e?.channelKey||e?.name;return E(e)>(t[n]||0)}function D(){if(!(typeof window>`u`))return window.localStorage}var st=3,ct=30,lt=/^[a-zA-Z0-9_-]+$/,ut=1e4,dt=12e3,ft=1200,pt=800;function O(e){return e?.channelKey||e?.name||``}function k(e){return e?.channelId||e?.name||``}function A(e){return e&&typeof e==`object`?e:{}}function mt(e){let t=A(e),n=new Set,r=e=>{let t=String(e||``).trim();t&&n.add(t)};return r(t.channelKey),r(t.channel),Array.isArray(t.channels)&&t.channels.forEach(e=>{let t=A(e);r(t.channelKey),r(t.channel),r(t.name)}),[...n]}function j(e){return e?.remark||k(e)}function ht(){return typeof window>`u`?``:(new URLSearchParams(window.location.search).get(`channel`)||``).trim()}function gt(e){let t=new Date(e||Date.now());return Number.isNaN(t.getTime())?String(Date.now()):t.toISOString().slice(0,16).replace(`T`,` `).replace(`:`,`-`)}function _t(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`)}function vt(e,t){return`[${_t(e)}](<${t.replace(/>/g,`%3E`)}>)`}function yt(e){let t=String(e||``).trim().split(/\r?\n/);return t.length>0?t.map(e=>`> ${e}`).join(`
|
|
2
2
|
`):`> `}var bt=`chat-file`;function xt(e,t){return e.type.startsWith(`image/`)?`image`:e.type.startsWith(`video/`)?`video`:e.type.startsWith(`audio/`)?`audio`:e.type.startsWith(`text/`)?`text`:ae(t)}function St(e){return e?`${e.slice(0,6)}...${e.slice(-4)}`:`Unknown`}function Ct(e){return/#[a-fA-F0-9]{4}$/.test(String(e||``).trim())}function M(e){return String(e||``).trim().toLowerCase()}function wt(){if(typeof window>`u`)return;let e=window;return e.AudioContext||e.webkitAudioContext}function Tt(){let e=l(e=>e.hasBackend),t=l(e=>e.isDarkMode),n=l(e=>e.addToast),r=l(e=>e.openConnectModal),a=i(e=>e.identity),d=i(e=>e.openLoginModal),[f,m]=(0,C.useState)([]),[h,g]=(0,C.useState)(null),[_,v]=(0,C.useState)(``),[le,y]=(0,C.useState)(!1),[pe,_e]=(0,C.useState)(``),[b,xe]=(0,C.useState)(``),[De,Le]=ue(!1),[Re,Ve]=(0,C.useState)(``),[T,Ue]=(0,C.useState)(!1),[We,Qe]=(0,C.useState)(!1),[et,D]=ue(!1),[A,_t]=(0,C.useState)(null),[Tt,Et]=(0,C.useState)(null),[Dt,N]=(0,C.useState)(!1),[Ot,kt]=(0,C.useState)(``),[At,jt]=(0,C.useState)(!1),[Mt,Nt]=(0,C.useState)(null),[Pt,Ft]=(0,C.useState)(!1),[It,P]=(0,C.useState)({}),[Lt,F]=(0,C.useState)(null),[Rt,zt]=(0,C.useState)(!1),[Bt,Vt]=(0,C.useState)(!1),[Ht,Ut]=(0,C.useState)(!1),[Wt,I]=(0,C.useState)({}),[Gt,Kt]=(0,C.useState)([]),L=a?.theme===`sparkbit`,qt=L&&a?.data?a.data:``,Jt=L&&a?.logo||``,Yt=L&&t&&a?.logo_dark||``,Xt=Yt||Jt,Zt=Yt&&Jt&&Yt!==Jt?Jt:``,Qt=Xt&&!Bt?Xt:Zt&&!Ht?Zt:``,$t=(0,C.useRef)(null),en=(0,C.useRef)(null),R=(0,C.useRef)(``),tn=(0,C.useRef)(new Set),nn=(0,C.useRef)(new Set),z=(0,C.useRef)(null),rn=(0,C.useRef)(!1),an=(0,C.useRef)(0),on=(0,C.useRef)(async()=>[]),sn=(0,C.useRef)(new Map),B=(0,C.useRef)(new Map),V=(0,C.useRef)(new Set),H=e===!0,{t:U,compareStrings:cn,formatDate:ln,formatTime:un}=u(),W=Se(),G=(0,C.useCallback)(async(e,t)=>{n(await c(e,t),`error`)},[n]),K=(0,C.useMemo)(()=>$e(a?.address),[a?.address]),dn=(0,C.useCallback)((e,t=Date.now())=>{e&&I(n=>{let r=rt(n,e,t);return r.changed?(nt(K,r.value),r.value):n})},[K]),q=(0,C.useCallback)(()=>{if(rn.current||typeof window>`u`)return;let e=wt();if(e)try{let t=z.current||new e;z.current=t,t.state===`suspended`&&t.resume().catch(()=>{}),rn.current=!0}catch{}},[]),fn=(0,C.useCallback)(()=>{if(!rn.current)return;let e=Date.now();if(e-an.current<ft)return;an.current=e;let t=wt();if(t)try{let e=z.current||new t;if(z.current=e,e.state===`suspended`){e.resume().catch(()=>{});return}let n=e.createGain();n.gain.setValueAtTime(1e-4,e.currentTime),n.gain.exponentialRampToValueAtTime(.08,e.currentTime+.015),n.gain.exponentialRampToValueAtTime(1e-4,e.currentTime+.18),n.connect(e.destination),[740,980].forEach((t,r)=>{let i=e.createOscillator();i.type=`sine`,i.frequency.setValueAtTime(t,e.currentTime),i.connect(n),i.start(e.currentTime+r*.035),i.stop(e.currentTime+.16+r*.035)})}catch{}},[]),pn=(0,C.useCallback)(async(e=h)=>{let t=O(e);if(!t||!H){Kt([]);return}try{let e=await S.getChannelPresence(t);if(R.current!==t)return;Kt(e)}catch(e){console.warn(`[Chat] Failed to fetch channel presence:`,e instanceof Error?e.message:e)}},[h,H]),mn=(0,C.useCallback)((e=``)=>{let t=R.current;if(!e||e!==t||!H)return;let n=sn.current,r=n.get(e);r&&window.clearTimeout(r);let i=window.setTimeout(()=>{n.delete(e),on.current(e)},pt);n.set(e,i)},[H]);function hn(e,t){switch(e){case`channel:message`:{let e=t?.channelKey||t?.channel,n=t?.message,r=Number(n?.timestamp)||Date.now();if(e){m(t=>t.map(t=>O(t)===e?{...t,lastMessageAt:new Date(r).toISOString()}:t));let t=e===R.current;I(i=>{let o=at(i,{channelName:e,messageTime:r,activeChannelName:t?e:``,messageAuthor:n?.author,userAddress:a?.address});return o.changed&&nt(K,o.value),o.notify&&fn(),o.changed?o.value:i})}break}case`channel:peer:online`:case`channel:sync:available`:{let e=mt(t),n=R.current;$(),e.includes(n)&&(mn(n),h&&pn(h));break}case`channel:presence`:{let e=t?.channelKey||t?.channel;h&&(!e||e===O(h))&&pn(h);break}case`channel:joined`:case`channel:left`:$();break;case`user:metadata:updated`:t?.scope===`channels`&&$();break;case`download:success`:{let e=B.current.get(t.taskId);e&&(B.current.delete(t.taskId),V.current.delete(e.cid),P(t=>({...t,[e.cid]:{status:`available`,message:U(`chat.attachment.previewAvailable`)}})),n(U(`chat.attachment.downloadCompleted`,{fileName:t.fileName||Be(e.fileName)}),`success`),On(e,t.fileName||e.fileName));break}case`download:error`:case`download:cancelled`:{let r=B.current.get(t.taskId);r&&(B.current.delete(t.taskId),V.current.delete(r.cid),P(n=>({...n,[r.cid]:{status:`error`,message:e===`download:cancelled`?U(`chat.attachment.downloadCancelled`):t.error||U(`chat.attachment.downloadFailed`)}})),n(e===`download:cancelled`?U(`chat.attachment.downloadCancelled`):t.error||U(`chat.attachment.downloadFailed`),`error`));break}}}let gn=(0,C.useMemo)(()=>f.map(e=>O(e)),[f]),J=O(h),_n=(0,C.useMemo)(()=>a?{...Ce(a),profileUpdatedAt:a.profileUpdatedAt}:{},[a?.avatar,a?.displayName,a?.profileUpdatedAt,a?.username]),Y=(0,C.useMemo)(()=>!h||!J?null:{channelName:J,title:j(h)},[h,J]),{clearMessages:vn,messages:X,sendMessage:yn,syncedChannelName:bn,syncMessages:xn}=Ne({isReady:H,enabled:!!a,channelName:J,extraSubscribedChannelNames:gn,peerId:Re,waitForPeerId:!0,onSyncError:e=>G(e,U(`chat.error.messages`)),onSocketEvent:hn,onReconnect:()=>{$(),h&&pn(h)},presenceEnabled:!!(h&&a),presenceProfile:_n});(0,C.useEffect)(()=>{on.current=xn},[xn]),(0,C.useEffect)(()=>{let e=sn.current;return()=>{for(let t of e.values())window.clearTimeout(t);e.clear()}},[]);let Sn=(0,C.useMemo)(()=>{let e=new Map;return X.forEach((t,n)=>{let r=String(t.author||``).trim();if(!r)return;let i=r.toLowerCase(),a=Number(t.timestamp)||0,o=String(t.authorName||``).trim(),s=String(t.avatar||``).trim(),c=e.get(i);if(!c){e.set(i,{address:r,displayName:o,...s?{avatar:s}:{},firstSeenAt:a,lastSeenAt:a,index:n});return}a>=c.lastSeenAt&&(c.lastSeenAt=a,o&&(c.displayName=o),s&&(c.avatar=s))}),[...e.values()].sort((e,t)=>e.firstSeenAt-t.firstSeenAt||e.index-t.index)},[X]),Cn=(0,C.useMemo)(()=>new Map(Sn.map(e=>[M(e.address),e])),[Sn]),wn=(0,C.useMemo)(()=>{let e=new Map;return Gt.forEach(t=>{let n=M(t.address);!n||!t.online||e.set(n,t)}),e},[Gt]),Tn=(0,C.useMemo)(()=>{let e=new Map(Cn);return Gt.forEach((t,n)=>{let r=M(t.address);!r||e.has(r)||e.set(r,{address:t.address,displayName:t.displayName||``,...t.avatar?{avatar:t.avatar}:{},firstSeenAt:t.lastSeen||Date.now(),lastSeenAt:t.lastSeen||Date.now(),index:Sn.length+n})}),[...e.values()]},[Sn,Gt,Cn]),En=(0,C.useMemo)(()=>new Set(wn.keys()),[wn]);function Z(){return H?!0:(r(),!1)}function Q(){return a?!0:(d(),!1)}(0,C.useEffect)(()=>{let e=()=>{v(ht())};return e(),window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,C.useEffect)(()=>{a&&v(ht())},[a?.address]),(0,C.useEffect)(()=>{Vt(!1),Ut(!1)},[Xt,Zt]),(0,C.useEffect)(()=>{R.current=O(h)},[h]),(0,C.useEffect)(()=>(W.setPreviewRoom(a&&Y?Y:null),()=>{W.setPreviewRoom(null)}),[Y,a,W.setPreviewRoom]),(0,C.useEffect)(()=>{I(tt(K))},[K]),(0,C.useEffect)(()=>{!K||f.length===0||I(e=>{let t=it(e,f);return t.changed&&nt(K,t.value),t.changed?t.value:e})},[K,f]),(0,C.useEffect)(()=>(window.addEventListener(`pointerdown`,q,{passive:!0}),window.addEventListener(`keydown`,q),()=>{window.removeEventListener(`pointerdown`,q),window.removeEventListener(`keydown`,q)}),[q]),(0,C.useEffect)(()=>()=>{z.current?.close().catch(()=>{}),z.current=null,rn.current=!1},[]),(0,C.useEffect)(()=>{$t.current?.scrollIntoView({behavior:`smooth`})},[X]),(0,C.useEffect)(()=>{if(!H){Ve(``);return}s.get(`/api/node-id`).json().then(e=>Ve(e.id)).catch(e=>{console.warn(`[Chat] Failed to fetch node ID:`,e.message),G(e,U(`chat.error.nodeId`))})},[H,G,U]),(0,C.useEffect)(()=>{H&&a?(y(!1),$()):y(!1)},[e,H,a?.address]),(0,C.useEffect)(()=>{if(h){if(H){let e=O(h);Kt([]),xn(e,{replace:!0}),pn(h)}}else Kt([])},[h,H,pn,xn]),(0,C.useEffect)(()=>{if(!_)return;if(!a){nn.current.has(_)||(nn.current.add(_),d());return}if(!H||!le)return;let e=f.find(e=>O(e)===_)||f.find(e=>k(e)===_);if(e&&(!h||O(h)!==O(e))){Nn(e);return}if(e&&h&&O(h)===O(e)&&(h.createdAt!==e.createdAt||h.coreKey!==e.coreKey||h.lastMessageAt!==e.lastMessageAt||h.pinned!==e.pinned||h.remark!==e.remark||h.type!==e.type)){g(e);return}if(e)return;let t=`${a.address}:${_}`;if(tn.current.has(t)||T)return;let r=Dn(_);if(tn.current.add(t),r){n(r,`error`);return}In(_)},[f,h,_,le,H,T,a?.address]),(0,C.useEffect)(()=>{a||(m([]),y(!1),g(null),v(ht()),Et(null),vn(),xe(``),Ve(``),N(!1),Nt(null),P({}),I({}),V.current.clear(),B.current.clear())},[vn,a?.address]);function Dn(e){return e.length<st?U(`chat.validation.nameMin`,{count:st}):e.length>ct?U(`chat.validation.nameMax`,{count:ct}):e.includes(`.`)?U(`chat.validation.dotReserved`):lt.test(e)?``:U(`chat.validation.allowedChars`)}async function $(){if(!H){y(!1);return}try{m(await S.getChannels()),y(!0)}catch(e){m([]),y(!1),await G(e,U(`chat.error.channelList`))}}function On(e,t=e.fileName){let n=ae(t);Nt({cid:e.cid,fileName:t,subtype:n===`file`?e.kind:n})}async function kn(e){if(Q()&&Z())try{n((await oe({cid:e.cid,fileName:e.fileName,getFileDownloadUrl:x.getFileDownloadUrl,getRequestHeaders:o,loadFailedMessage:U(`app.toast.getFileFailed`)})).method===`picker`?U(`app.toast.fileSaved`):U(`app.toast.fileDownloaded`),`success`)}catch(e){e.name!==`AbortError`&&n(U(`app.saveFailedWithError`,{error:e.message}),`error`)}}async function An(e){let t=je(e.link,U);if(t)return P(n=>({...n,[e.cid]:{status:`error`,message:t}})),!1;try{P(t=>({...t,[e.cid]:{status:`checking`}}));let t=await x.checkDownload(e.link,{timeout:ut,requestTimeout:dt});return P(n=>({...n,[e.cid]:{status:t.alreadyExists?`available`:`ready`,message:t.alreadyExists?U(`chat.attachment.localAvailable`):U(`chat.attachment.downloadAvailable`)}})),!0}catch{return P(t=>({...t,[e.cid]:{status:`error`,message:U(`chat.attachment.noSeedsTitle`)}})),!1}}async function jn(e){F(null),await An(e)&&await Mn(e)}async function Mn(e){if(!V.current.has(e.cid)){V.current.add(e.cid),P(t=>({...t,[e.cid]:{status:`downloading`,message:U(`chat.attachment.downloading`)}}));try{let t=await x.downloadFile(e.link);if(t.alreadyExists||t.fileName){V.current.delete(e.cid),P(t=>({...t,[e.cid]:{status:`available`,message:U(`chat.attachment.previewAvailable`)}})),On({...e,fileName:t.fileName||e.fileName},t.fileName||e.fileName);return}t.taskId&&(B.current.set(t.taskId,e),n(U(`chat.attachment.downloadStarted`),`success`))}catch{V.current.delete(e.cid),P(t=>({...t,[e.cid]:{status:`error`,message:U(`chat.attachment.noSeedsTitle`)}}))}}}async function Nn(e){if(!Q()||!Z())return;let t=O(e);dn(t,Math.max(E(e),Date.now())),g(e),v(t),window.history.pushState({},``,`?channel=${encodeURIComponent(t)}`)}async function Pn(e,t){if(t&&t.stopPropagation(),Q()&&Z()&&!We){Qe(!0);try{if(await S.leaveChannel(e),O(h)===e){g(null),v(``),vn();let e=new URL(window.location.href);e.searchParams.delete(`channel`),window.history.pushState({},``,e.pathname)}$(),D.close(),_t(null)}catch(e){await G(e,U(`chat.error.leave`))}finally{Qe(!1)}}}async function Fn(e){if(!Q()||!Z())return;let t=!e.pinned,n=O(e);try{let e=await S.setChannelPinned(n,t);m(t=>t.map(t=>O(t)===n?{...t,pinned:e.pinned}:t)),g(t=>t&&O(t)===n?{...t,pinned:e.pinned}:t)}catch(e){await G(e,U(t?`chat.error.pin`:`chat.error.unpin`))}}async function In(e){let t=e.trim();if(!t||T)return;let r=Dn(t);if(r){n(r,`error`);return}if(Q()&&Z()){Ue(!0);try{let e=await S.createChannel(t,`public`,Ce(a)),n=e.channelKey||e.key||e.name||t,r=f.find(e=>O(e)===n),i={...r,name:e.name||t,channelId:e.channelId||e.name||t,channelKey:e.channelKey||e.key||r?.channelKey,type:e.type||r?.type||`public`,createdAt:e.createdAt||r?.createdAt,coreKey:e.coreKey||e.key||r?.coreKey,localWriterCoreKey:e.localWriterCoreKey||r?.localWriterCoreKey,writerCoreKeys:e.writerCoreKeys||r?.writerCoreKeys,remark:e.remark||r?.remark},o=O(i);m(e=>e.some(e=>O(e)===o)?e.map(e=>O(e)===o?{...e,...i}:e):[...e,i]),Le.close(),await Nn(i),$()}catch(e){await G(e,U(`chat.error.join`))}finally{Ue(!1)}}}async function Ln(e,t){if(!e.trim()||!h||!Q()||!Z())return!1;let n=e.trim(),r=O(h);try{let e=await yn({channelName:r,content:n,attachment:t});return m(t=>t.map(t=>O(t)===r?{...t,lastMessageAt:new Date(Number(e?.timestamp)||Date.now()).toISOString()}:t)),e&&dn(r,Number(e.timestamp)||Date.now()),!0}catch(e){return await G(e,U(`chat.error.send`)),!1}}async function Rn(){if(!b.trim())return;let e=b.trim();xe(``),await Ln(e)}function zn(e,t){return`${bt}/${e}/${t}`}async function Bn(e){if(!e||e.length===0||!h||!Q()||!Z()||Pt)return;Ft(!0);let t=``;try{let r=await x.getNodePolicy().catch(()=>null);for(let i of Array.from(e)){t=i.name;let e=Oe(i,r,U);if(e){n(e,`error`);continue}let a=zn(k(h),i.name),o=await x.publishFile(i,a),s=o.fileName||a,c=o.link||Ae(o.cid,s);await Ln(c,{kind:xt(i,s),cid:o.cid,fileName:s,link:c,mimeType:i.type||void 0,size:i.size})}}catch(e){n(await ke(e,U(`chat.error.attachmentSend`),U,t),`error`)}finally{Ft(!1)}}async function Vn(e){if(!Q()||!Z())return;let t=It[e.cid];if(!(t?.status===`checking`||t?.status===`downloading`)){if(t?.status===`error`){F(e);return}if(t?.status===`ready`||t?.status===`available`){await Mn(e);return}if(!t){await An(e)&&await Mn(e);return}}}function Hn(e){let t=M(e.author),n=wn.get(t),r=Cn.get(t);return Zn(n?.displayName||r?.displayName||e.authorName,e.author)}function Un(e){return e.type!==`system`&&!e.pending&&(!!e.attachment||!!e.content.trim())}function Wn(e,t){let n=Hn(t),r=`${ln(t.timestamp)} ${un(t.timestamp)}`,i=t.content.trim();e.push(`## ${r} ${n}`,``),i&&(!t.attachment||i!==t.attachment.link)&&e.push(yt(i),``),t.attachment&&e.push(`**${U(`chat.noteDraft.attachment`)}**`,``,`- ${U(`chat.noteDraft.file`)}: ${vt(Be(t.attachment.fileName),t.attachment.link)}`,`- CID: \`${t.attachment.cid}\``,``)}function Gn(e){let t=h?j(h):``,n=`${ln(Date.now())} ${un(Date.now())}`,r=[`# ${U(`chat.noteDraft.heading`)}`,``,`- ${U(`chat.noteDraft.room`)}: ${t}`,`- ${U(`chat.noteDraft.exportedAt`)}: ${n}`,`- ${U(`chat.noteDraft.messageCount`)}: ${e.length}`,``];return e.forEach(e=>Wn(r,e)),`${r.join(`
|
|
3
3
|
`).trimEnd()}\n`}function Kn(){let e=X.filter(Un);if(e.length===0){n(U(`chat.noteDraft.empty`),`warning`);return}let t=te({title:U(`chat.noteDraft.historyTitle`,{room:h?j(h):U(`chat.title`),time:gt()}),content:Gn(e)});if(!t){n(U(`chat.noteDraft.saveFailed`),`error`);return}N(!1),window.location.assign(p(t.id))}async function qn(e,t){if(!Q()||!Z())return;let n=O(e),r=await S.setChannelRemark(n,t);return m(e=>e.map(e=>O(e)===n?{...e,remark:r.remark}:e)),g(e=>e&&O(e)===n?{...e,remark:r.remark}:e),r.remark}async function Jn(){if(h)try{await qn(h,Ot)}catch(e){await G(e,U(`chat.error.remark`))}}async function Yn(e){if(!(!Tt||At)){jt(!0);try{await qn(Tt,e),Et(null)}catch(e){await G(e,U(`chat.error.rename`))}finally{jt(!1)}}}function Xn(e){if(!e.attachment)return(0,w.jsx)(Ge,{children:e.content});let t=e.attachment,n=It[t.cid],r=n?.status;return(0,w.jsx)(Ke,{children:(0,w.jsx)(He,{attachment:t,status:r,message:n?.message,pending:e.pending,onOpen:Vn})})}function Zn(e,t){let n=String(e||``).trim();return n?Rt?Ct(n)?n:t?`${n}#${t.slice(-4).toUpperCase()}`:n:n.replace(/#[a-fA-F0-9]{4}$/,``):St(t)}function Qn(){return(0,w.jsx)(Xe,{members:Tn.map(e=>{let t=wn.get(M(e.address)),n=t?.displayName||e.displayName,r=t?.avatar||e.avatar;return{id:e.address,name:Zn(n,e.address),avatarSrc:be(e.address,r),online:En.has(M(e.address))}})})}let $n=L&&!!_&&(!h||!!(J&&J!==bn)),er=[`chat-app-layout`,L?`sparkbit-chat-layout`:``].filter(Boolean).join(` `),tr=L?`sparkbit-chat-action-menu`:void 0,nr=h?(0,w.jsx)(`h2`,{className:`header-title`,translate:`no`,children:j(h)}):(0,w.jsx)(`h2`,{className:`header-title`,children:U(`chat.title`)}),rr=!!(Y&&W.room?.channelName===Y.channelName),ir=W.participants.filter(e=>!e.local).length,ar=W.joined?ir:W.participants.length,or=!L&&rr&&(W.joined||W.participants.length>0),sr=W.joined?U(`chat.voice.bannerJoined`,{count:ar}):U(`chat.voice.bannerActive`,{count:ar});function cr(){Y&&W.openRoom(Y)}let lr=pe.trim().toLowerCase(),ur=(0,C.useMemo)(()=>[...f].sort((e,t)=>{let n=Number(!!t.pinned)-Number(!!e.pinned);if(n!==0)return n;let r=E(t)-E(e);return r===0?cn(j(e),j(t)):r}),[f,cn]),dr=lr?ur.filter(e=>[j(e),k(e),O(e)].some(e=>e.toLowerCase().includes(lr))):ur;return(0,w.jsxs)(de,{className:er,defaultHide:L,hideAccountMenu:L,languageTheme:L?`sparkbit`:void 0,sidebar:({closeSidebar:e})=>(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Te,{onNavigate:e}),(0,w.jsx)(`div`,{className:`chat-channel-search`,children:(0,w.jsxs)(`div`,{className:`ui-input-control`,children:[(0,w.jsx)(me,{className:`ui-input-icon`,size:15}),(0,w.jsx)(`input`,{type:`search`,className:`input input-compact`,placeholder:U(`chat.search.placeholder`),value:pe,onChange:e=>_e(e.target.value),"aria-label":U(`chat.search.placeholder`)})]})}),(0,w.jsx)(`nav`,{className:`sidebar-nav`,children:f.length===0?(0,w.jsx)(`div`,{className:`sidebar-empty-state`,children:(0,w.jsx)(`p`,{children:U(`chat.empty.noChannels`)})}):dr.length===0?(0,w.jsx)(`div`,{className:`sidebar-empty-state`,children:(0,w.jsx)(`p`,{children:U(`chat.empty.noMatches`)})}):dr.map(t=>(0,w.jsx)(Ye,{active:O(h)===O(t),pinned:!!t.pinned,unread:ot(t,Wt),title:j(t),menuClassName:tr,onSelect:()=>{Nn(t),e()},onTogglePin:()=>void Fn(t),onRename:()=>Et(t),onLeave:()=>{_t(t),D.open()}},O(t)))}),(0,w.jsxs)(`button`,{className:`ui-action-dashed create-channel-btn`,onClick:()=>{!Q()||!Z()||Le.open()},children:[(0,w.jsx)(ee,{size:16}),U(`chat.joinChannel`)]})]}),headerTitle:nr,sidebarToggleReplacement:L?(0,w.jsx)(`span`,{className:`sidebar-toggle-static-logo`,"aria-hidden":`true`,children:Qt?(0,w.jsx)(`img`,{className:`sidebar-toggle-static-logo-img`,src:Qt,alt:``,onError:()=>{if(Qt===Zt){Ut(!0);return}Vt(!0)}}):(0,w.jsx)(Ee,{size:18})}):void 0,headerRight:(0,w.jsx)(`div`,{className:`header-right-actions`,children:h&&(0,w.jsx)(`button`,{className:`btn btn-icon`,onClick:()=>N(!0),title:U(`chat.channelSettings`),children:(0,w.jsx)(ze,{size:16})})}),children:[$n?(0,w.jsx)(Pe,{}):h?(0,w.jsxs)(w.Fragment,{children:[or&&(0,w.jsxs)(`button`,{type:`button`,className:`chat-voice-banner`,onClick:cr,title:U(`chat.voice.expand`),children:[(0,w.jsx)(`span`,{className:`chat-voice-banner-icon`,children:(0,w.jsx)(he,{size:18})}),(0,w.jsx)(`span`,{className:`chat-voice-banner-label`,children:sr}),(0,w.jsx)(se,{size:18})]}),(0,w.jsxs)(`div`,{className:`chat-messages`,children:[X.length===0?(0,w.jsxs)(`div`,{className:`ui-empty-state chat-messages-empty`,children:[(0,w.jsx)(`div`,{className:`ui-empty-icon empty-icon`,children:(0,w.jsx)(fe,{size:28})}),(0,w.jsx)(`p`,{children:U(`chat.empty.noMessages`)})]}):X.map(e=>{if(Me(e))return(0,w.jsx)(qe,{children:U(`chat.system.memberJoined`,{name:Hn(e)})},e.id||`${e.author}-${e.timestamp}`);let t=e.author?.toLowerCase()===a?.address.toLowerCase(),n=wn.get(M(e.author)),r=Cn.get(M(e.author)),i=En.has(M(e.author)),o=n?.avatar||r?.avatar||e.avatar||(t?a.avatar:void 0),s=Hn(e);return(0,w.jsx)(Je,{variant:t?`self`:`other`,pending:e.pending,isOnline:i,avatarSrc:be(e.author,o),author:s,time:un(e.timestamp),children:Xn(e)},e.id||`${e.author}-${e.timestamp}`)}),(0,w.jsx)(`div`,{ref:$t})]}),(0,w.jsx)(Ze,{message:b,placeholder:U(a?`chat.composer.placeholder`:`chat.composer.signInPlaceholder`),disabled:!a,isPublishingAttachment:Pt,attachmentInputRef:en,attachmentMenuClassName:tr,showVoiceRoom:!L,onMessageChange:xe,onSend:Rn,onOpenVoiceRoom:cr,onSelectAttachmentFiles:e=>{Bn(e)}})]}):(0,w.jsx)(w.Fragment,{children:(0,w.jsxs)(`div`,{className:`ui-empty-state chat-welcome`,children:[(0,w.jsx)(`div`,{className:`ui-empty-icon ui-empty-icon-lg welcome-icon`,children:(0,w.jsx)(fe,{size:36})}),(0,w.jsx)(`h2`,{className:`ui-empty-title`,children:U(`chat.select.title`)}),(0,w.jsx)(`p`,{className:`ui-empty-desc`,children:U(`chat.select.desc`)}),(0,w.jsx)(ne,{label:U(`chat.openChannelList`)})]})}),De&&(0,w.jsx)(ge,{title:U(`chat.joinChannel`),placeholder:U(`chat.join.placeholder`),confirmText:U(`chat.join.confirm`),validate:Dn,onConfirm:In,onClose:()=>Le.close(),isLoading:T,loadingText:U(`chat.join.joining`)}),Tt&&(0,w.jsx)(ge,{title:U(`chat.renameChannel`),placeholder:U(`chat.remark.placeholder`),defaultValue:Tt.remark||``,confirmText:U(`chat.remark.save`),onConfirm:Yn,onClose:()=>{At||Et(null)},isLoading:At,loadingText:U(`chat.remark.saving`),allowEmpty:!0,validate:e=>e.length>50?U(`chat.remark.tooLong`):``}),et&&A&&(0,w.jsx)(we,{title:U(`chat.leaveChannel`),message:U(`chat.leaveConfirm`,{channel:j(A)}),confirmText:U(We?`chat.leaving`:`chat.leaveChannel`),onConfirm:()=>Pn(O(A),void 0),danger:!0,onClose:()=>{D.close(),_t(null)}}),Lt&&(0,w.jsx)(ye,{onClose:()=>F(null),children:(0,w.jsxs)(`div`,{className:`confirm-modal`,onClick:e=>e.stopPropagation(),children:[(0,w.jsxs)(`div`,{className:`modal-header`,children:[(0,w.jsx)(`h3`,{children:U(`chat.attachment.noSeedsTitle`)}),(0,w.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:()=>F(null),"aria-label":U(`common.close`),children:(0,w.jsx)(ve,{size:18})})]}),(0,w.jsx)(`p`,{children:U(`chat.attachment.noSeedsFallback`)}),(0,w.jsxs)(`div`,{className:`modal-actions`,children:[(0,w.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:()=>F(null),children:U(`common.cancel`)}),(0,w.jsx)(`button`,{type:`button`,className:`btn btn-primary`,onClick:()=>jn(Lt),disabled:It[Lt.cid]?.status===`checking`,children:It[Lt.cid]?.status===`checking`?U(`app.checking`):U(`chat.attachment.retryCheck`)})]})]})}),Mt&&(0,w.jsx)(re,{item:Mt,isBackendReady:H,getFileDownloadUrl:x.getFileDownloadUrl,onSaveAs:kn,onClose:()=>Nt(null)}),Dt&&h&&(0,w.jsx)(`div`,{className:`channel-detail-overlay`,onClick:()=>N(!1),children:(0,w.jsxs)(`div`,{className:`channel-detail-drawer`,onClick:e=>e.stopPropagation(),children:[(0,w.jsxs)(`div`,{className:`channel-detail-header`,children:[(0,w.jsx)(`h3`,{children:U(`chat.details.title`)}),(0,w.jsx)(`button`,{className:`btn btn-icon`,onClick:()=>N(!1),children:(0,w.jsx)(ve,{size:18})})]}),(0,w.jsxs)(`div`,{className:`channel-detail-body`,children:[(0,w.jsxs)(`div`,{className:`channel-detail-section channel-members-section`,children:[(0,w.jsx)(`div`,{className:`channel-detail-label`,children:(0,w.jsx)(`span`,{children:U(`chat.details.members`,{count:Tn.length})})}),Qn()]}),qt&&(0,w.jsx)(`div`,{className:`channel-detail-section`,children:(0,w.jsxs)(`a`,{className:`btn btn-primary btn-block`,href:qt,target:`_blank`,rel:`noreferrer`,children:[(0,w.jsx)(ce,{size:16}),U(`chat.ticket.create`)]})}),!L&&(0,w.jsx)(`div`,{className:`channel-detail-section`,children:(0,w.jsxs)(`label`,{className:`setting-switch`,children:[(0,w.jsx)(`span`,{children:U(`chat.details.showAddressSuffix`)}),(0,w.jsx)(`input`,{type:`checkbox`,checked:Rt,onChange:e=>zt(e.target.checked)})]})}),!L&&(0,w.jsxs)(`div`,{className:`channel-detail-section`,children:[(0,w.jsxs)(`div`,{className:`channel-detail-label`,children:[(0,w.jsx)(Ie,{size:14}),(0,w.jsx)(`span`,{children:U(`chat.details.channelId`)})]}),(0,w.jsx)(`div`,{className:`ui-meta-box channel-detail-value channel-detail-mono`,translate:`no`,children:k(h)})]}),!L&&(0,w.jsxs)(`div`,{className:`channel-detail-section`,children:[(0,w.jsxs)(`div`,{className:`channel-detail-label`,children:[(0,w.jsx)(ie,{size:14}),(0,w.jsx)(`span`,{children:U(`chat.remark.placeholder`)})]}),(0,w.jsx)(`input`,{type:`text`,className:`input input-compact`,placeholder:U(`chat.remark.placeholder`),value:Ot,onChange:e=>kt(e.target.value),onFocus:()=>kt(h.remark||``),onBlur:()=>Jn(),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},maxLength:50})]}),(0,w.jsxs)(`div`,{className:`channel-detail-section`,children:[(0,w.jsxs)(`div`,{className:`channel-detail-label`,children:[(0,w.jsx)(Fe,{size:14}),(0,w.jsx)(`span`,{children:U(`chat.channel.createdAt`)})]}),(0,w.jsx)(`div`,{className:`ui-meta-box channel-detail-value`,children:h.createdAt?ln(h.createdAt):`-`})]}),!L&&(0,w.jsxs)(`div`,{className:`channel-detail-section`,children:[(0,w.jsx)(`div`,{className:`channel-detail-label`,children:(0,w.jsx)(`span`,{children:U(`chat.noteDraft.settingsTitle`)})}),(0,w.jsx)(`p`,{className:`channel-detail-hint`,children:U(`chat.noteDraft.saveAllDesc`)}),(0,w.jsx)(`button`,{className:`btn btn-secondary btn-block`,onClick:Kn,children:U(`chat.noteDraft.saveAll`)})]})]}),!L&&(0,w.jsx)(`div`,{className:`channel-detail-footer`,children:(0,w.jsx)(`button`,{className:`btn btn-secondary btn-block`,onClick:()=>{N(!1),_t(h),D.open()},children:U(`chat.leaveChannel`)})})]})})]})}var Et=a(`/chat/`)({component:Tt});export{Et as Route};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,H as i,W as a}from"./useAppStore-DNhyhD20.js";import{a as o}from"./i18n-DKsg67mH.js";import{n as s,t as c}from"./smartphone-CrsocYJo.js";import{t as l}from"./download-Cy2BlfKM.js";import{I as u}from"./index-DJzLHA0V.js";import{t as d}from"./MarketingHeader-ChTIIzXG.js";import{n as f}from"./format-CAKfypjK.js";var p=r(`apple`,[[`path`,{d:`M12 6.528V3a1 1 0 0 1 1-1h0`,key:`11qiee`}],[`path`,{d:`M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21`,key:`110c12`}]]),m=r(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),h=r(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),g=r(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),_=r(`tablet-smartphone`,[[`rect`,{width:`10`,height:`14`,x:`3`,y:`8`,rx:`2`,key:`1vrsiq`}],[`path`,{d:`M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4`,key:`1j4zmg`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]),v=t(e(),1),y=[`windows`,`macos`,`linux`,`android`],b=[`x64`,`arm64`,`universal`],x=[`installer`],S=Object.freeze([{platform:`windows`,arch:`x64`},{platform:`windows`,arch:`arm64`},{platform:`macos`,arch:`x64`},{platform:`macos`,arch:`arm64`},{platform:`linux`,arch:`x64`},{platform:`linux`,arch:`arm64`},{platform:`android`,arch:`universal`}]);function C(e){return`${e.platform}:${e.arch}`}var w=new Set(y),T=new Set(b),E=new Set(x),D=new Set(S.map(C));function O(e){return typeof e==`object`&&!!e}function k(e){return typeof e==`string`&&e.trim().length>0}function A(e){return Number.isFinite(e)&&e>0}function j(e){return e===void 0||k(e)}function M(e){return O(e)?w.has(e.platform)&&T.has(e.arch)&&D.has(C(e))&&E.has(e.kind)&&k(e.filename)&&A(e.size)&&k(e.cid)&&k(e.githubUrl)&&j(e.r2Url):!1}function N(e){return!O(e)||!k(e.version)||!k(e.publishedAt)||!Array.isArray(e.assets)?!1:e.assets.every(M)}function P(e){return C(e)}function F(e){return N(e)?e.assets.filter(e=>e.kind===`installer`):[]}function I(e){return Array.isArray(e)?e.some(e=>O(e)&&k(e.r2Url)):!1}function L(e,t=`r2`){return t===`r2`&&O(e)&&k(e.r2Url)?{source:`r2`,url:e.r2Url}:{source:`github`,url:O(e)&&k(e.githubUrl)?e.githubUrl:``}}var R=`https://github.com/most-people/most/releases/latest`,z=[{platform:`windows`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`windows`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`macos`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`macos`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`linux`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`linux`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`android`,arch:`universal`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R}];function B(e){return e.VITE_RELEASE_MANIFEST_URL||`${(e.VITE_R2_PUBLIC_BASE_URL||`https://download.most.box`).replace(/\/+$/,``)}/releases/latest.json`}function V({manifest:e,currentKey:t,requestedSource:n}){let r=e?F(e):[],i=r.length?r:z,a=I(i),o=n===`r2`&&a?`r2`:`github`,s=i.find(e=>P(e)===t)||null;return{assets:i,currentAsset:s,otherAssets:s?i.filter(e=>P(e)!==t):i,hasR2Assets:a,activeSource:o,currentDownload:s?L(s,o):null}}function H(e,t){return L(e,t)}var U=n(),W=B({VITE_RELEASE_MANIFEST_URL:void 0,VITE_R2_PUBLIC_BASE_URL:void 0}),G={windows:{name:`Windows`,ext:`.exe`,descKey:`download.platform.windows.desc`,icon:g},macos:{name:`macOS`,ext:`.dmg`,descKey:`download.platform.macos.desc`,icon:p},linux:{name:`Linux`,ext:`.AppImage`,descKey:`download.platform.linux.desc`,icon:h},android:{name:`Android`,ext:`.apk`,descKey:`download.platform.android.desc`,icon:_}},K=[{key:`ios`,nameKey:`download.platform.ios.name`,descKey:`download.platform.ios.desc`,icon:c}],q=`android:universal`;function J(){return[navigator.userAgentData?.platform,navigator.platform,navigator.userAgent].filter(Boolean).join(` `).toLowerCase()}function Y(){if(typeof navigator>`u`)return`windows:x64`;let e=J(),t=/arm|aarch64/.test(e)?`arm64`:`x64`;return/android/.test(e)?q:/mac|darwin/.test(e)?`macos:${t}`:/linux/.test(e)?`linux:${t}`:`windows:${t}`}function X(){let{t:e}=o(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(W?`loading`:`fallback`),[a,c]=(0,v.useState)(`windows:x64`),[d,p]=(0,v.useState)(`r2`);(0,v.useEffect)(()=>{c(Y())},[]),(0,v.useEffect)(()=>{if(!W)return;let e=new AbortController;return fetch(W,{cache:`no-store`,signal:e.signal}).then(e=>{if(!e.ok)throw Error(`Manifest request failed: ${e.status}`);return e.json()}).then(e=>{if(!N(e))throw Error(`Invalid download manifest`);n(e),i(`ready`)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||(n(null),i(`fallback`))}),()=>e.abort()},[]),(0,v.useEffect)(()=>{r===`fallback`&&p(`github`)},[r]);let{currentAsset:h,otherAssets:g,hasR2Assets:_,activeSource:y}=V({manifest:t,currentKey:a,requestedSource:d}),b=t=>H(t,y).source===`r2`?e(`download.source.r2Mirror`):`GitHub Releases`,x=e=>H(e,y).url,S=t=>{let n=G[t.platform],r=n.icon;return(0,U.jsxs)(`article`,{className:`download-current-card`,children:[(0,U.jsxs)(`div`,{className:`download-current-main`,children:[(0,U.jsx)(`div`,{className:`download-current-icon`,children:(0,U.jsx)(r,{size:34})}),(0,U.jsxs)(`div`,{className:`download-current-copy`,children:[(0,U.jsxs)(`div`,{className:`download-current-labels`,children:[(0,U.jsxs)(`span`,{className:`download-current-kicker`,children:[(0,U.jsx)(u,{size:14}),e(`download.platform.currentSystem`)]}),(0,U.jsx)(`span`,{className:`download-current-recommended`,children:e(`download.platform.recommended`)})]}),(0,U.jsxs)(`div`,{className:`download-current-heading`,children:[(0,U.jsx)(`h3`,{children:n.name}),(0,U.jsx)(`span`,{children:t.arch})]}),(0,U.jsx)(`p`,{children:e(n.descKey)}),(0,U.jsxs)(`dl`,{className:`download-current-meta`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,U.jsx)(`dd`,{children:b(t)})]}),t.size?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,U.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:`CID`}),(0,U.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]})]})]}),(0,U.jsxs)(`div`,{className:`download-current-actions`,children:[(0,U.jsx)(`span`,{children:e(`download.platform.matchedSystem`)}),(0,U.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,U.jsx)(l,{size:17}),e(`download.platform.action`,{ext:n.ext})]}),(0,U.jsx)(`p`,{children:b(t)})]})]})},C=t=>{let n=G[t.platform],r=n.icon,i=P(t),o=i===a;return(0,U.jsxs)(`article`,{className:[`download-platform-card`,o?`is-recommended`:``].filter(Boolean).join(` `),children:[(0,U.jsx)(`div`,{className:`download-platform-icon`,children:(0,U.jsx)(r,{size:32})}),(0,U.jsxs)(`div`,{className:`download-platform-content`,children:[(0,U.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,U.jsx)(`h3`,{children:n.name}),(0,U.jsx)(`span`,{children:t.arch})]}),(0,U.jsx)(`p`,{children:e(n.descKey)}),(0,U.jsxs)(`dl`,{className:`download-platform-meta`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,U.jsx)(`dd`,{children:b(t)})]}),t.size?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,U.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:`CID`}),(0,U.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]}),(0,U.jsx)(`div`,{className:`download-platform-actions`,children:(0,U.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,U.jsx)(l,{size:16}),e(`download.platform.action`,{ext:n.ext})]})})]}),o?(0,U.jsx)(`span`,{className:`download-recommended-badge`,children:e(`download.platform.current`)}):null]},i)},w=t=>{let n=t.icon;return(0,U.jsxs)(`article`,{className:`download-coming-soon-card`,children:[(0,U.jsx)(`div`,{className:`download-platform-icon download-coming-soon-icon`,children:(0,U.jsx)(n,{size:32})}),(0,U.jsxs)(`div`,{className:`download-platform-content`,children:[(0,U.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,U.jsx)(`h3`,{children:e(t.nameKey)}),(0,U.jsx)(`span`,{children:e(`download.platform.comingSoon`)})]}),(0,U.jsx)(`p`,{children:e(t.descKey)})]})]},t.key)};return(0,U.jsxs)(`div`,{className:`download-options`,children:[(0,U.jsxs)(`div`,{className:`ui-segmented-control download-source-tabs`,role:`tablist`,"aria-label":e(`download.source.label`),children:[(0,U.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`r2`,disabled:!_,className:y===`r2`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`r2`),children:[(0,U.jsx)(s,{size:15}),`Cloudflare R2`]}),(0,U.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`github`,className:y===`github`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`github`),children:[(0,U.jsx)(m,{size:15}),`GitHub Releases`]})]}),(0,U.jsx)(`p`,{className:`download-source-note`,children:r===`loading`?e(`download.source.loading`):r===`ready`&&t?e(`download.source.ready`,{version:t.version}):e(`download.source.fallback`)}),h?(0,U.jsx)(`div`,{className:`download-current-platform`,"aria-label":e(`download.platform.currentSystem`),children:S(h)}):null,g.length?(0,U.jsxs)(`div`,{className:`download-other-platforms`,children:[(0,U.jsx)(`p`,{className:`download-other-platforms-title`,children:e(`download.platform.otherPlatforms`)}),(0,U.jsx)(`div`,{className:`download-platform-grid`,children:g.map(e=>C(e))}),(0,U.jsxs)(`div`,{className:`download-coming-soon`,children:[(0,U.jsx)(`p`,{className:`download-coming-soon-title`,children:e(`download.platform.mobilePlatforms`)}),(0,U.jsx)(`div`,{className:`download-coming-soon-grid`,children:K.map(e=>w(e))})]})]}):null]})}var Z=[{featureKey:`download.comparison.node`,webKey:`download.comparison.webConnectsNode`,desktopKey:`download.comparison.desktopBuiltinNode`},{featureKey:`download.comparison.fileSharing`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.verification`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.seeding`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopDefaultOn`},{featureKey:`download.comparison.largeFiles`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktop10gb`}];function Q(){let{t:e}=o();return(0,v.useEffect)(()=>{document.title=e(`download.meta.title`)},[e]),(0,U.jsxs)(`div`,{className:`download-page`,children:[(0,U.jsx)(d,{}),(0,U.jsx)(`section`,{className:`download-hero`,children:(0,U.jsxs)(`div`,{className:`mkt-container`,children:[(0,U.jsx)(`div`,{className:`download-hero-icon`,children:(0,U.jsx)(l,{size:40})}),(0,U.jsx)(`h1`,{className:`download-hero-title`,children:e(`download.hero.title`)}),(0,U.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.hero.desc`)})]})}),(0,U.jsx)(`section`,{className:`download-platforms`,children:(0,U.jsxs)(`div`,{className:`mkt-container`,children:[(0,U.jsx)(`h2`,{className:`download-section-title`,children:e(`download.platforms.title`)}),(0,U.jsx)(X,{})]})}),(0,U.jsx)(`section`,{className:`download-comparison`,children:(0,U.jsxs)(`div`,{className:`mkt-container`,children:[(0,U.jsx)(`h2`,{className:`download-section-title`,children:e(`download.comparison.title`)}),(0,U.jsx)(`div`,{className:`download-table-wrap`,children:(0,U.jsxs)(`table`,{className:`download-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:e(`download.comparison.feature`)}),(0,U.jsx)(`th`,{children:e(`download.comparison.web`)}),(0,U.jsx)(`th`,{children:e(`download.comparison.desktop`)})]})}),(0,U.jsx)(`tbody`,{children:Z.map(t=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e(t.featureKey)}),(0,U.jsx)(`td`,{className:`col-web`,children:e(t.webKey)}),(0,U.jsx)(`td`,{className:`col-desktop`,children:e(t.desktopKey)})]},t.featureKey))})]})})]})}),(0,U.jsx)(`section`,{className:`download-cta`,children:(0,U.jsx)(`div`,{className:`mkt-container`,children:(0,U.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.npmNote`)})})}),(0,U.jsx)(`section`,{className:`download-cta`,children:(0,U.jsx)(`div`,{className:`mkt-container`,children:(0,U.jsx)(a,{to:`/`,className:`btn btn-primary`,children:e(`common.backHome`)})})}),(0,U.jsx)(`footer`,{className:`mkt-footer`,children:(0,U.jsx)(`div`,{className:`mkt-container`,children:(0,U.jsx)(`div`,{className:`mkt-footer-inner`,children:(0,U.jsx)(`p`,{className:`mkt-footer-copy`,children:`MostBox`})})})})]})}var $=i(`/download/`)({component:Q});export{$ as Route};
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,H as i,W as a}from"./useAppStore-Pjif7nCR.js";import{a as o}from"./i18n-DKsg67mH.js";import{n as s,t as c}from"./smartphone-D9j5h2Pg.js";import{t as l}from"./download-nQ9X-v0q.js";import{I as u}from"./index-CCU5Z4K-.js";import{t as d}from"./MarketingHeader-Bh6LcQOj.js";import{n as f}from"./format-CAKfypjK.js";var p=r(`apple`,[[`path`,{d:`M12 6.528V3a1 1 0 0 1 1-1h0`,key:`11qiee`}],[`path`,{d:`M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21`,key:`110c12`}]]),m=r(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),h=r(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),g=r(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),_=r(`tablet-smartphone`,[[`rect`,{width:`10`,height:`14`,x:`3`,y:`8`,rx:`2`,key:`1vrsiq`}],[`path`,{d:`M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4`,key:`1j4zmg`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]),v=t(e(),1),y=[`windows`,`macos`,`linux`,`android`],b=[`x64`,`arm64`,`universal`],x=[`installer`],S=Object.freeze([{platform:`windows`,arch:`x64`},{platform:`windows`,arch:`arm64`},{platform:`macos`,arch:`x64`},{platform:`macos`,arch:`arm64`},{platform:`linux`,arch:`x64`},{platform:`linux`,arch:`arm64`},{platform:`android`,arch:`universal`}]);function C(e){return`${e.platform}:${e.arch}`}var w=new Set(y),T=new Set(b),E=new Set(x),D=new Set(S.map(C));function O(e){return typeof e==`object`&&!!e}function k(e){return typeof e==`string`&&e.trim().length>0}function A(e){return Number.isFinite(e)&&e>0}function j(e){return e===void 0||k(e)}function M(e){return O(e)?w.has(e.platform)&&T.has(e.arch)&&D.has(C(e))&&E.has(e.kind)&&k(e.filename)&&A(e.size)&&k(e.cid)&&k(e.githubUrl)&&j(e.r2Url):!1}function N(e){return!O(e)||!k(e.version)||!k(e.publishedAt)||!Array.isArray(e.assets)?!1:e.assets.every(M)}function P(e){return C(e)}function F(e){return N(e)?e.assets.filter(e=>e.kind===`installer`):[]}function I(e){return Array.isArray(e)?e.some(e=>O(e)&&k(e.r2Url)):!1}function L(e,t=`r2`){return t===`r2`&&O(e)&&k(e.r2Url)?{source:`r2`,url:e.r2Url}:{source:`github`,url:O(e)&&k(e.githubUrl)?e.githubUrl:``}}var R=`https://github.com/most-people/most/releases/latest`,z=[{platform:`windows`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`windows`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`macos`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`macos`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`linux`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`linux`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R},{platform:`android`,arch:`universal`,kind:`installer`,filename:`GitHub Releases`,githubUrl:R}];function B(e){return e.VITE_RELEASE_MANIFEST_URL||`${(e.VITE_R2_PUBLIC_BASE_URL||`https://download.most.box`).replace(/\/+$/,``)}/releases/latest.json`}function V({manifest:e,currentKey:t,requestedSource:n}){let r=e?F(e):[],i=r.length?r:z,a=I(i),o=n===`r2`&&a?`r2`:`github`,s=i.find(e=>P(e)===t)||null;return{assets:i,currentAsset:s,otherAssets:s?i.filter(e=>P(e)!==t):i,hasR2Assets:a,activeSource:o,currentDownload:s?L(s,o):null}}function H(e,t){return L(e,t)}var U=n(),W=B({VITE_RELEASE_MANIFEST_URL:void 0,VITE_R2_PUBLIC_BASE_URL:void 0}),G={windows:{name:`Windows`,ext:`.exe`,descKey:`download.platform.windows.desc`,icon:g},macos:{name:`macOS`,ext:`.dmg`,descKey:`download.platform.macos.desc`,icon:p},linux:{name:`Linux`,ext:`.AppImage`,descKey:`download.platform.linux.desc`,icon:h},android:{name:`Android`,ext:`.apk`,descKey:`download.platform.android.desc`,icon:_}},K=[{key:`ios`,nameKey:`download.platform.ios.name`,descKey:`download.platform.ios.desc`,icon:c}],q=`android:universal`;function J(){return[navigator.userAgentData?.platform,navigator.platform,navigator.userAgent].filter(Boolean).join(` `).toLowerCase()}function Y(){if(typeof navigator>`u`)return`windows:x64`;let e=J(),t=/arm|aarch64/.test(e)?`arm64`:`x64`;return/android/.test(e)?q:/mac|darwin/.test(e)?`macos:${t}`:/linux/.test(e)?`linux:${t}`:`windows:${t}`}function X(){let{t:e}=o(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(W?`loading`:`fallback`),[a,c]=(0,v.useState)(`windows:x64`),[d,p]=(0,v.useState)(`r2`);(0,v.useEffect)(()=>{c(Y())},[]),(0,v.useEffect)(()=>{if(!W)return;let e=new AbortController;return fetch(W,{cache:`no-store`,signal:e.signal}).then(e=>{if(!e.ok)throw Error(`Manifest request failed: ${e.status}`);return e.json()}).then(e=>{if(!N(e))throw Error(`Invalid download manifest`);n(e),i(`ready`)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||(n(null),i(`fallback`))}),()=>e.abort()},[]),(0,v.useEffect)(()=>{r===`fallback`&&p(`github`)},[r]);let{currentAsset:h,otherAssets:g,hasR2Assets:_,activeSource:y}=V({manifest:t,currentKey:a,requestedSource:d}),b=t=>H(t,y).source===`r2`?e(`download.source.r2Mirror`):`GitHub Releases`,x=e=>H(e,y).url,S=t=>{let n=G[t.platform],r=n.icon;return(0,U.jsxs)(`article`,{className:`download-current-card`,children:[(0,U.jsxs)(`div`,{className:`download-current-main`,children:[(0,U.jsx)(`div`,{className:`download-current-icon`,children:(0,U.jsx)(r,{size:34})}),(0,U.jsxs)(`div`,{className:`download-current-copy`,children:[(0,U.jsxs)(`div`,{className:`download-current-labels`,children:[(0,U.jsxs)(`span`,{className:`download-current-kicker`,children:[(0,U.jsx)(u,{size:14}),e(`download.platform.currentSystem`)]}),(0,U.jsx)(`span`,{className:`download-current-recommended`,children:e(`download.platform.recommended`)})]}),(0,U.jsxs)(`div`,{className:`download-current-heading`,children:[(0,U.jsx)(`h3`,{children:n.name}),(0,U.jsx)(`span`,{children:t.arch})]}),(0,U.jsx)(`p`,{children:e(n.descKey)}),(0,U.jsxs)(`dl`,{className:`download-current-meta`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,U.jsx)(`dd`,{children:b(t)})]}),t.size?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,U.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:`CID`}),(0,U.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]})]})]}),(0,U.jsxs)(`div`,{className:`download-current-actions`,children:[(0,U.jsx)(`span`,{children:e(`download.platform.matchedSystem`)}),(0,U.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,U.jsx)(l,{size:17}),e(`download.platform.action`,{ext:n.ext})]}),(0,U.jsx)(`p`,{children:b(t)})]})]})},C=t=>{let n=G[t.platform],r=n.icon,i=P(t),o=i===a;return(0,U.jsxs)(`article`,{className:[`download-platform-card`,o?`is-recommended`:``].filter(Boolean).join(` `),children:[(0,U.jsx)(`div`,{className:`download-platform-icon`,children:(0,U.jsx)(r,{size:32})}),(0,U.jsxs)(`div`,{className:`download-platform-content`,children:[(0,U.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,U.jsx)(`h3`,{children:n.name}),(0,U.jsx)(`span`,{children:t.arch})]}),(0,U.jsx)(`p`,{children:e(n.descKey)}),(0,U.jsxs)(`dl`,{className:`download-platform-meta`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,U.jsx)(`dd`,{children:b(t)})]}),t.size?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,U.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:`CID`}),(0,U.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]}),(0,U.jsx)(`div`,{className:`download-platform-actions`,children:(0,U.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,U.jsx)(l,{size:16}),e(`download.platform.action`,{ext:n.ext})]})})]}),o?(0,U.jsx)(`span`,{className:`download-recommended-badge`,children:e(`download.platform.current`)}):null]},i)},w=t=>{let n=t.icon;return(0,U.jsxs)(`article`,{className:`download-coming-soon-card`,children:[(0,U.jsx)(`div`,{className:`download-platform-icon download-coming-soon-icon`,children:(0,U.jsx)(n,{size:32})}),(0,U.jsxs)(`div`,{className:`download-platform-content`,children:[(0,U.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,U.jsx)(`h3`,{children:e(t.nameKey)}),(0,U.jsx)(`span`,{children:e(`download.platform.comingSoon`)})]}),(0,U.jsx)(`p`,{children:e(t.descKey)})]})]},t.key)};return(0,U.jsxs)(`div`,{className:`download-options`,children:[(0,U.jsxs)(`div`,{className:`ui-segmented-control download-source-tabs`,role:`tablist`,"aria-label":e(`download.source.label`),children:[(0,U.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`r2`,disabled:!_,className:y===`r2`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`r2`),children:[(0,U.jsx)(s,{size:15}),`Cloudflare R2`]}),(0,U.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`github`,className:y===`github`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`github`),children:[(0,U.jsx)(m,{size:15}),`GitHub Releases`]})]}),(0,U.jsx)(`p`,{className:`download-source-note`,children:r===`loading`?e(`download.source.loading`):r===`ready`&&t?e(`download.source.ready`,{version:t.version}):e(`download.source.fallback`)}),h?(0,U.jsx)(`div`,{className:`download-current-platform`,"aria-label":e(`download.platform.currentSystem`),children:S(h)}):null,g.length?(0,U.jsxs)(`div`,{className:`download-other-platforms`,children:[(0,U.jsx)(`p`,{className:`download-other-platforms-title`,children:e(`download.platform.otherPlatforms`)}),(0,U.jsx)(`div`,{className:`download-platform-grid`,children:g.map(e=>C(e))}),(0,U.jsxs)(`div`,{className:`download-coming-soon`,children:[(0,U.jsx)(`p`,{className:`download-coming-soon-title`,children:e(`download.platform.mobilePlatforms`)}),(0,U.jsx)(`div`,{className:`download-coming-soon-grid`,children:K.map(e=>w(e))})]})]}):null]})}var Z=[{featureKey:`download.comparison.node`,webKey:`download.comparison.webConnectsNode`,desktopKey:`download.comparison.desktopBuiltinNode`},{featureKey:`download.comparison.fileSharing`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.verification`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.seeding`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopDefaultOn`},{featureKey:`download.comparison.largeFiles`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktop10gb`}];function Q(){let{t:e}=o();return(0,v.useEffect)(()=>{document.title=e(`download.meta.title`)},[e]),(0,U.jsxs)(`div`,{className:`download-page`,children:[(0,U.jsx)(d,{}),(0,U.jsx)(`section`,{className:`download-hero`,children:(0,U.jsxs)(`div`,{className:`mkt-container`,children:[(0,U.jsx)(`div`,{className:`download-hero-icon`,children:(0,U.jsx)(l,{size:40})}),(0,U.jsx)(`h1`,{className:`download-hero-title`,children:e(`download.hero.title`)}),(0,U.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.hero.desc`)})]})}),(0,U.jsx)(`section`,{className:`download-platforms`,children:(0,U.jsxs)(`div`,{className:`mkt-container`,children:[(0,U.jsx)(`h2`,{className:`download-section-title`,children:e(`download.platforms.title`)}),(0,U.jsx)(X,{})]})}),(0,U.jsx)(`section`,{className:`download-comparison`,children:(0,U.jsxs)(`div`,{className:`mkt-container`,children:[(0,U.jsx)(`h2`,{className:`download-section-title`,children:e(`download.comparison.title`)}),(0,U.jsx)(`div`,{className:`download-table-wrap`,children:(0,U.jsxs)(`table`,{className:`download-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:e(`download.comparison.feature`)}),(0,U.jsx)(`th`,{children:e(`download.comparison.web`)}),(0,U.jsx)(`th`,{children:e(`download.comparison.desktop`)})]})}),(0,U.jsx)(`tbody`,{children:Z.map(t=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e(t.featureKey)}),(0,U.jsx)(`td`,{className:`col-web`,children:e(t.webKey)}),(0,U.jsx)(`td`,{className:`col-desktop`,children:e(t.desktopKey)})]},t.featureKey))})]})})]})}),(0,U.jsx)(`section`,{className:`download-cta`,children:(0,U.jsx)(`div`,{className:`mkt-container`,children:(0,U.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.npmNote`)})})}),(0,U.jsx)(`section`,{className:`download-cta`,children:(0,U.jsx)(`div`,{className:`mkt-container`,children:(0,U.jsx)(a,{to:`/`,className:`btn btn-primary`,children:e(`common.backHome`)})})}),(0,U.jsx)(`footer`,{className:`mkt-footer`,children:(0,U.jsx)(`div`,{className:`mkt-container`,children:(0,U.jsx)(`div`,{className:`mkt-footer-inner`,children:(0,U.jsx)(`p`,{className:`mkt-footer-copy`,children:`MostBox`})})})})]})}var $=i(`/download/`)({component:Q});export{$ as Route};
|