most-box 0.1.3 → 0.1.4
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/out/404/index.html +2 -2
- package/out/404.html +2 -2
- package/out/__next.__PAGE__.txt +5 -5
- package/out/__next._full.txt +13 -13
- package/out/__next._head.txt +3 -3
- package/out/__next._index.txt +6 -6
- package/out/__next._tree.txt +2 -2
- package/out/_next/static/chunks/02zzxfop_k6tl.css +1 -0
- package/out/_next/static/chunks/03gsbg0fr00ey.js +1 -0
- package/out/_next/static/chunks/06lttvu7563zo.css +1 -0
- package/out/_next/static/chunks/0fo9-h4knidcz.js +1 -0
- package/out/_next/static/chunks/0hyds~bp.auvh.js +1 -0
- package/out/_next/static/chunks/0i9sfdypwuw8~.js +1 -0
- package/out/_next/static/chunks/{0_0oph_z1az14.js → 0puk.7e.tr2zy.js} +1 -1
- package/out/_next/static/chunks/0s1k6rlwy02c2.js +1 -0
- package/out/_next/static/chunks/0sgltmtk_9s8p.css +1 -0
- package/out/_next/static/chunks/0snehvtvu1n4q.js +1 -0
- package/out/_next/static/chunks/{12nr19.nnn6s3.js → 0t_3xxx4zkerp.js} +2 -2
- package/out/_next/static/chunks/0u38kke9vhobe.js +1 -0
- package/out/_next/static/chunks/0vd4_a5x-wpdh.js +1 -0
- package/out/_next/static/chunks/0xx_10jns1.s7.css +1 -0
- package/out/_next/static/chunks/{0m_5nb6x8qy._.js → 10f-t2n4y1zx8.js} +1 -1
- package/out/_next/static/chunks/13jdyag9a-~kk.js +1 -0
- package/out/_not-found/__next._full.txt +11 -11
- package/out/_not-found/__next._head.txt +3 -3
- package/out/_not-found/__next._index.txt +6 -6
- package/out/_not-found/__next._not-found.__PAGE__.txt +4 -4
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +1 -1
- package/out/_not-found/index.html +2 -2
- package/out/_not-found/index.txt +11 -11
- package/out/admin/__next._full.txt +12 -12
- package/out/admin/__next._head.txt +3 -3
- package/out/admin/__next._index.txt +6 -6
- package/out/admin/__next._tree.txt +1 -1
- package/out/admin/__next.admin.__PAGE__.txt +4 -4
- package/out/admin/__next.admin.txt +3 -3
- package/out/admin/index.html +2 -2
- package/out/admin/index.txt +12 -12
- package/out/app/__next._full.txt +12 -12
- package/out/app/__next._head.txt +3 -3
- package/out/app/__next._index.txt +6 -6
- package/out/app/__next._tree.txt +1 -1
- package/out/app/__next.app.__PAGE__.txt +4 -4
- package/out/app/__next.app.txt +3 -3
- package/out/app/index.html +2 -2
- package/out/app/index.txt +12 -12
- package/out/chat/__next._full.txt +12 -12
- package/out/chat/__next._head.txt +3 -3
- package/out/chat/__next._index.txt +6 -6
- package/out/chat/__next._tree.txt +1 -1
- package/out/chat/__next.chat.__PAGE__.txt +4 -4
- package/out/chat/__next.chat.txt +3 -3
- package/out/chat/index.html +2 -2
- package/out/chat/index.txt +12 -12
- package/out/chat/join/__next._full.txt +12 -12
- package/out/chat/join/__next._head.txt +3 -3
- package/out/chat/join/__next._index.txt +6 -6
- package/out/chat/join/__next._tree.txt +1 -1
- package/out/chat/join/__next.chat.join.__PAGE__.txt +4 -4
- package/out/chat/join/__next.chat.join.txt +3 -3
- package/out/chat/join/__next.chat.txt +3 -3
- package/out/chat/join/index.html +2 -2
- package/out/chat/join/index.txt +12 -12
- package/out/download/__next._full.txt +16 -16
- package/out/download/__next._head.txt +3 -3
- package/out/download/__next._index.txt +6 -6
- package/out/download/__next._tree.txt +2 -2
- package/out/download/__next.download.__PAGE__.txt +6 -6
- package/out/download/__next.download.txt +3 -3
- package/out/download/index.html +2 -2
- package/out/download/index.txt +16 -16
- package/out/game/__next._full.txt +20 -0
- package/out/game/__next._head.txt +5 -0
- package/out/{gandengyan → game}/__next._index.txt +6 -6
- package/out/game/__next._tree.txt +5 -0
- package/out/game/__next.game.__PAGE__.txt +6 -0
- package/out/game/__next.game.txt +5 -0
- package/out/game/gandengyan/__next._full.txt +26 -0
- package/out/game/gandengyan/__next._head.txt +5 -0
- package/out/game/gandengyan/__next._index.txt +9 -0
- package/out/game/gandengyan/__next._tree.txt +6 -0
- package/out/game/gandengyan/__next.game.gandengyan.__PAGE__.txt +10 -0
- package/out/game/gandengyan/__next.game.gandengyan.txt +5 -0
- package/out/game/gandengyan/__next.game.txt +5 -0
- package/out/game/gandengyan/index.html +15 -0
- package/out/game/gandengyan/index.txt +26 -0
- package/out/game/index.html +1 -0
- package/out/game/index.txt +20 -0
- package/out/game/zhajinhua/__next._full.txt +25 -0
- package/out/game/zhajinhua/__next._head.txt +5 -0
- package/out/game/zhajinhua/__next._index.txt +9 -0
- package/out/game/zhajinhua/__next._tree.txt +5 -0
- package/out/game/zhajinhua/__next.game.txt +5 -0
- package/out/game/zhajinhua/__next.game.zhajinhua.__PAGE__.txt +9 -0
- package/out/game/zhajinhua/__next.game.zhajinhua.txt +5 -0
- package/out/game/zhajinhua/index.html +15 -0
- package/out/game/zhajinhua/index.txt +25 -0
- package/out/index.html +2 -2
- package/out/index.txt +13 -13
- package/out/note/__next._full.txt +12 -12
- package/out/note/__next._head.txt +3 -3
- package/out/note/__next._index.txt +6 -6
- package/out/note/__next._tree.txt +1 -1
- package/out/note/__next.note.__PAGE__.txt +4 -4
- package/out/note/__next.note.txt +3 -3
- package/out/note/index.html +2 -2
- package/out/note/index.txt +12 -12
- package/out/ping/__next._full.txt +12 -12
- package/out/ping/__next._head.txt +3 -3
- package/out/ping/__next._index.txt +6 -6
- package/out/ping/__next._tree.txt +1 -1
- package/out/ping/__next.ping.__PAGE__.txt +4 -4
- package/out/ping/__next.ping.txt +3 -3
- package/out/ping/index.html +2 -2
- package/out/ping/index.txt +12 -12
- package/out/web3/__next._full.txt +12 -12
- package/out/web3/__next._head.txt +3 -3
- package/out/web3/__next._index.txt +6 -6
- package/out/web3/__next._tree.txt +1 -1
- package/out/web3/__next.web3.__PAGE__.txt +4 -4
- package/out/web3/__next.web3.txt +3 -3
- package/out/web3/ed25519/__next._full.txt +10 -10
- package/out/web3/ed25519/__next._head.txt +3 -3
- package/out/web3/ed25519/__next._index.txt +6 -6
- package/out/web3/ed25519/__next._tree.txt +1 -1
- package/out/web3/ed25519/__next.web3.ed25519.__PAGE__.txt +2 -2
- package/out/web3/ed25519/__next.web3.ed25519.txt +3 -3
- package/out/web3/ed25519/__next.web3.txt +3 -3
- package/out/web3/ed25519/index.html +1 -1
- package/out/web3/ed25519/index.txt +10 -10
- package/out/web3/index.html +2 -2
- package/out/web3/index.txt +12 -12
- package/out/web3/tools/__next._full.txt +10 -10
- package/out/web3/tools/__next._head.txt +3 -3
- package/out/web3/tools/__next._index.txt +6 -6
- package/out/web3/tools/__next._tree.txt +1 -1
- package/out/web3/tools/__next.web3.tools.__PAGE__.txt +2 -2
- package/out/web3/tools/__next.web3.tools.txt +3 -3
- package/out/web3/tools/__next.web3.txt +3 -3
- package/out/web3/tools/index.html +1 -1
- package/out/web3/tools/index.txt +10 -10
- package/package.json +2 -1
- package/server/index.js +0 -8
- package/server/src/config.js +1 -1
- package/server/src/core/gameRoom.js +222 -0
- package/server/src/core/zhajinhua.js +563 -0
- package/server/src/games/gandengyan.js +348 -411
- package/server/src/http/app.js +7 -1
- package/server/src/index.js +9 -1
- package/out/_next/static/chunks/04mo7rr..0_1q.js +0 -1
- package/out/_next/static/chunks/06rf3qq5ggs6v.js +0 -1
- package/out/_next/static/chunks/07td.jq7xff84.css +0 -1
- package/out/_next/static/chunks/0cl7d~7abnk_p.css +0 -1
- package/out/_next/static/chunks/0d306t1wvjpdx.js +0 -1
- package/out/_next/static/chunks/0n.ayxmsar6e5.js +0 -1
- package/out/_next/static/chunks/0voe1.ttrh84k.css +0 -1
- package/out/_next/static/chunks/0wtf0xsiicxx6.js +0 -1
- package/out/_next/static/chunks/0x.ky97owcxxs.js +0 -1
- package/out/_next/static/chunks/0ysj5b94vu4ri.js +0 -1
- package/out/_next/static/chunks/184hxsuf-5c84.js +0 -1
- package/out/gandengyan/__next._full.txt +0 -25
- package/out/gandengyan/__next._head.txt +0 -5
- package/out/gandengyan/__next._tree.txt +0 -5
- package/out/gandengyan/__next.gandengyan.__PAGE__.txt +0 -10
- package/out/gandengyan/__next.gandengyan.txt +0 -5
- package/out/gandengyan/index.html +0 -15
- package/out/gandengyan/index.txt +0 -25
- /package/out/_next/static/{aPEZ4zaaR5W3WpSZ0dFsa → sSvbBrwXZY-4lBmcHshga}/_buildManifest.js +0 -0
- /package/out/_next/static/{aPEZ4zaaR5W3WpSZ0dFsa → sSvbBrwXZY-4lBmcHshga}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{aPEZ4zaaR5W3WpSZ0dFsa → sSvbBrwXZY-4lBmcHshga}/_ssgManifest.js +0 -0
package/server/src/http/app.js
CHANGED
|
@@ -959,7 +959,13 @@ export function createApp(engine, options = {}) {
|
|
|
959
959
|
})
|
|
960
960
|
|
|
961
961
|
app.get('/api/channels', c => {
|
|
962
|
-
return c.json(
|
|
962
|
+
return c.json(
|
|
963
|
+
engine.listChannels({
|
|
964
|
+
ownerAddress: c.get('userAddress'),
|
|
965
|
+
type: c.req.query('type'),
|
|
966
|
+
excludeType: c.req.query('excludeType'),
|
|
967
|
+
})
|
|
968
|
+
)
|
|
963
969
|
})
|
|
964
970
|
|
|
965
971
|
app.delete('/api/channels/:name', async c => {
|
package/server/src/index.js
CHANGED
|
@@ -1834,6 +1834,7 @@ export class MostBoxEngine extends EventEmitter {
|
|
|
1834
1834
|
async createChannel(name, type = 'personal', options = {}) {
|
|
1835
1835
|
this.#ensureInitialized()
|
|
1836
1836
|
const ownerAddress = normalizeOwnerAddress(options.ownerAddress)
|
|
1837
|
+
const channelType = String(type || 'personal').trim() || 'personal'
|
|
1837
1838
|
|
|
1838
1839
|
if (!CHANNEL_NAME_REGEX.test(name)) {
|
|
1839
1840
|
throw new Error('频道名只能包含字母、数字、下划线和连字符')
|
|
@@ -1879,7 +1880,7 @@ export class MostBoxEngine extends EventEmitter {
|
|
|
1879
1880
|
discoveryKey: b4a.toString(discoveryKey, 'hex'),
|
|
1880
1881
|
coreKey: b4a.toString(core.key, 'hex'),
|
|
1881
1882
|
createdAt: new Date().toISOString(),
|
|
1882
|
-
type,
|
|
1883
|
+
type: channelType,
|
|
1883
1884
|
ownerAddress,
|
|
1884
1885
|
members: ownerAddress ? [ownerAddress] : [],
|
|
1885
1886
|
remoteCoreKeys: [],
|
|
@@ -2105,12 +2106,19 @@ export class MostBoxEngine extends EventEmitter {
|
|
|
2105
2106
|
listChannels(options = {}) {
|
|
2106
2107
|
this.#ensureInitialized()
|
|
2107
2108
|
const ownerAddress = normalizeOwnerAddress(options.ownerAddress)
|
|
2109
|
+
const type = String(options.type || '').trim()
|
|
2110
|
+
const excludeType = String(options.excludeType || '').trim()
|
|
2108
2111
|
|
|
2109
2112
|
return this.#channels
|
|
2110
2113
|
.filter(c => {
|
|
2111
2114
|
if (!ownerAddress) return true
|
|
2112
2115
|
return Array.isArray(c.members) && c.members.includes(ownerAddress)
|
|
2113
2116
|
})
|
|
2117
|
+
.filter(c => {
|
|
2118
|
+
if (type) return c.type === type
|
|
2119
|
+
if (excludeType) return c.type !== excludeType
|
|
2120
|
+
return true
|
|
2121
|
+
})
|
|
2114
2122
|
.map(c => ({
|
|
2115
2123
|
name: c.name,
|
|
2116
2124
|
coreKey: c.coreKey,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96699,e=>{"use strict";let t=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,t],96699)},35965,e=>{"use strict";let t=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,t],35965)},51921,e=>{"use strict";let t=(0,e.i(56420).default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",0,t],51921)},66627,e=>{"use strict";let t=(0,e.i(56420).default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);e.s(["Wifi",0,t],66627)},66595,e=>{"use strict";let t=(0,e.i(56420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],66595)},31214,e=>{"use strict";let t=(0,e.i(56420).default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);e.s(["Cloud",0,t],31214)},30274,e=>{"use strict";let t=(0,e.i(56420).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,t],30274)},21357,e=>{"use strict";let t=(0,e.i(56420).default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",0,t],21357)},71567,e=>{"use strict";let t=(0,e.i(56420).default)("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"}]]);e.s(["Bot",0,t],71567)},68590,e=>{"use strict";let t=(0,e.i(56420).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],68590)},40983,e=>{"use strict";var t=e.i(18050),n=e.i(71645),i=e.i(22016),r=e.i(96699),a=e.i(35965);function l({size:e=24}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.4"}),(0,t.jsx)("rect",{x:"14",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)"})]})}function s(){let[e,s]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;("dark"===e||!e&&t)&&s(!0)},[]),(0,n.useEffect)(()=>{document.documentElement.setAttribute("data-theme",e?"dark":"light"),localStorage.setItem("theme",e?"dark":"light")},[e]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("nav",{className:"mkt-nav",children:(0,t.jsxs)("div",{className:"mkt-nav-inner",children:[(0,t.jsxs)(i.default,{href:"/",className:"mkt-nav-logo",children:[(0,t.jsx)(l,{}),"MOST PEOPLE"]}),(0,t.jsxs)("div",{className:"mkt-nav-cta",children:[(0,t.jsx)("button",{className:"mkt-theme-toggle",onClick:()=>s(!e),"aria-label":"切换主题",children:e?(0,t.jsx)(a.Sun,{size:16}):(0,t.jsx)(r.Moon,{size:16})}),(0,t.jsx)(i.default,{href:"/app/",className:"btn btn-primary",children:"开始使用"})]})]})})})}let o=[{href:"/",label:"关于"},{href:"/ping/",label:"网络"},{href:"https://github.com/most-people/most",label:"GitHub",external:!0}];function c(){return(0,t.jsx)("footer",{className:"mkt-footer",children:(0,t.jsx)("div",{className:"mkt-container",children:(0,t.jsxs)("div",{className:"mkt-footer-inner",children:[(0,t.jsx)("div",{className:"mkt-footer-links",children:o.map(e=>(0,t.jsx)(i.default,{href:e.href,...e.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e.label},e.href))}),(0,t.jsxs)("span",{className:"mkt-footer-copy",children:["© ",new Date().getFullYear()," MOST PEOPLE · MIT License"]})]})})})}e.s(["MarketingLayout",0,function({children:e}){return(0,t.jsxs)("div",{className:"mkt-layout",children:[(0,t.jsx)(s,{}),(0,t.jsx)("main",{className:"mkt-layout-main",children:e}),(0,t.jsx)(c,{})]})}],40983)},23449,e=>{"use strict";let t;var n,i=e.i(18050),r=e.i(71645);let a=Object.freeze({left:0,top:0,width:16,height:16}),l=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),s=Object.freeze({...a,...l}),o=Object.freeze({...s,body:"",hidden:!1});function c(e,t){let n,i,r=(n={},!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0),(i=((e.rotate||0)+(t.rotate||0))%4)&&(n.rotate=i),n);for(let n in o)n in l?n in e&&!(n in r)&&(r[n]=l[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}function u(e,t){let n,i,r,a=[];if("object"!=typeof e||"object"!=typeof e.icons)return a;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),a.push(e)});let l=(n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null),Object.keys(n).concat(Object.keys(i)).forEach(function e(t){if(n[t])return r[t]=[];if(!(t in r)){r[t]=null;let n=i[t]&&i[t].parent,a=n&&e(n);a&&(r[t]=[n].concat(a))}return r[t]}),r);for(let n in l){let i=l[n];i&&(t(n,function(e,t,n){let i=e.icons,r=e.aliases||Object.create(null),a={};function l(e){a=c(i[e]||r[e],a)}return l(t),n.forEach(l),c(e,a)}(e,n,i)),a.push(n))}return a}let f={provider:"",aliases:{},not_found:{},...a};function d(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function h(e){if("object"!=typeof e||null===e||"string"!=typeof e.prefix||!e.icons||"object"!=typeof e.icons||!d(e,f))return null;let t=e.icons;for(let e in t){let n=t[e];if(!e||"string"!=typeof n.body||!d(n,o))return null}let n=e.aliases||Object.create(null);for(let e in n){let i=n[e],r=i.parent;if(!e||"string"!=typeof r||!t[r]&&!n[r]||!d(i,o))return null}return e}let p=Object.create(null);function g(e,t){let n=p[e]||(p[e]=Object.create(null));return n[t]||(n[t]={provider:e,prefix:t,icons:Object.create(null),missing:new Set})}function m(e,t){return h(t)?u(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}let y=/^[a-z0-9]+(-[a-z0-9]+)*$/,x=(e,t,n,i="")=>{let r=e.split(":");if("@"===e.slice(0,1)){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){let e=r.pop(),n=r.pop(),a={provider:r.length>0?r[0]:i,prefix:n,name:e};return t&&!b(a)?null:a}let a=r[0],l=a.split("-");if(l.length>1){let e={provider:i,prefix:l.shift(),name:l.join("-")};return t&&!b(e)?null:e}if(n&&""===i){let e={provider:i,prefix:"",name:a};return t&&!b(e,n)?null:e}return null},b=(e,t)=>!!e&&!!((t&&""===e.prefix||e.prefix)&&e.name),k=!1;function v(e){return"boolean"==typeof e&&(k=e),k}function j(e){let t="string"==typeof e?x(e,!0,k):e;if(t){let e=g(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}let w=Object.freeze({width:null,height:null}),M=Object.freeze({...w,...l}),E=/(-?[0-9.]*[0-9]+[0-9.]*)/g,N=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function S(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;let i=e.split(E);if(null===i||!i.length)return e;let r=[],a=i.shift(),l=N.test(a);for(;;){if(l){let e=parseFloat(a);isNaN(e)?r.push(a):r.push(Math.ceil(e*t*n)/n)}else r.push(a);if(void 0===(a=i.shift()))return r.join("");l=!l}}let z=/\sid="(\S+)"/g,T="IconifyId"+Date.now().toString(16)+(0x1000000*Math.random()|0).toString(16),O=0,C=Object.create(null);function F(e){return C[e]||C[""]}function A(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(!((t=e.resources)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:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}let I=Object.create(null),L=["https://api.simplesvg.com","https://api.unisvg.com"],P=[];for(;L.length>0;)1===L.length||Math.random()>.5?P.push(L.shift()):P.push(L.pop());I[""]=A({resources:["https://api.iconify.design"].concat(P)});let $=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();function H(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}let R=0,q={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function _(e){let t={...q,...e},n=[];function i(){n=n.filter(e=>"pending"===e().status)}return{query:function(e,r,a){let l=function(e,t,n,i){let r,a,l=e.resources.length,s=e.random?Math.floor(Math.random()*l):e.index;if(e.random){let t=e.resources.slice(0);for(r=[];t.length>1;){let e=Math.floor(Math.random()*t.length);r.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}r=r.concat(t)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));let o=Date.now(),c="pending",u=0,f=null,d=[],h=[];function p(){f&&(clearTimeout(f),f=null)}function g(){"pending"===c&&(c="aborted"),p(),d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}function m(e,t){t&&(h=[]),"function"==typeof e&&h.push(e)}function y(){c="failed",h.forEach(e=>{e(void 0,a)})}function x(){d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}return"function"==typeof i&&h.push(i),setTimeout(function i(){if("pending"!==c)return;p();let l=r.shift();if(void 0===l){if(d.length){f=setTimeout(()=>{p(),"pending"===c&&(x(),y())},e.timeout);return}y();return}let s={status:"pending",resource:l,callback:(t,n)=>{!function(t,n,l){let s="success"!==n;switch(d=d.filter(e=>e!==t),c){case"pending":break;case"failed":if(s||!e.dataAfterTimeout)return;break;default:return}if("abort"===n){a=l,y();return}if(s){a=l,d.length||(r.length?i():y());return}if(p(),x(),!e.random){let n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}c="completed",h.forEach(e=>{e(l)})}(s,t,n)}};d.push(s),u++,f=setTimeout(i,e.rotate),n(l,t,s.callback)}),function(){return{startTime:o,payload:t,status:c,queriesSent:u,queriesPending:d.length,subscribe:m,abort:g}}}(t,e,r,(e,t)=>{i(),a&&a(e,t)});return n.push(l),l},find:function(e){return n.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:i}}let V=Object.create(null);function D(){}function U(e,t,n){function i(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&"object"==typeof n)try{if(!m(e,n).length)return void i()}catch(e){console.error(e)}i(),e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,i=e.provider,r=e.prefix;t.forEach(t=>{let a=t.icons,l=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==r)return!0;let l=t.name;if(e.icons[l])a.loaded.push({provider:i,prefix:r,name:l});else{if(!e.missing.has(l))return n=!0,!0;a.missing.push({provider:i,prefix:r,name:l})}return!1}),a.pending.length!==l&&(n||H([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}))}function B(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}let G=/[\s,]+/,W={...M,inline:!1},Q={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},J={display:"inline-block"},K={backgroundColor:"currentColor"},X={backgroundColor:"transparent"},Y={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Z={WebkitMask:K,mask:K,background:X};for(let e in Z){let t=Z[e];for(let n in Y)t[e+n]=Y[n]}let ee={...W,inline:!0};function et(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}if(v(!0),n={prepare:(e,t,n)=>{let i=[],r=function(e,t){let n,i=I[e];if(!i)return 0;if(i.maxURL){let e=0;i.resources.forEach(t=>{e=Math.max(e,t.length)}),n=i.maxURL-e-i.path.length-(t+".json?icons=").length}else n=0;return n}(e,t),a="icons",l={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,o)=>{(s+=n.length+1)>=r&&o>0&&(i.push(l),l={type:a,provider:e,prefix:t,icons:[]},s=n.length),l.icons.push(n)}),i.push(l),i},send:(e,t,n)=>{if(!$)return void n("abort",424);let i=function(e){if("string"==typeof e){let t=I[e];if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":i+=t.prefix+".json?"+new URLSearchParams({icons:t.icons.join(",")}).toString();break;case"custom":{let e=t.uri;i+="/"===e.slice(0,1)?e.slice(1):e;break}default:n("abort",400);return}let r=503;$(e+i).then(e=>{let t=e.status;return 200!==t?void setTimeout(()=>{n(404===t?"abort":"next",t)}):(r=501,e.json())}).then(e=>{"object"!=typeof e||null===e?setTimeout(()=>{404===e?n("abort",e):n("next",r)}):setTimeout(()=>{n("success",e)})}).catch(()=>{n("next",r)})}},C[""]=n,"u">typeof document&&"u">typeof window){let e=window;if(void 0!==e.IconifyPreload){let t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),k&&!t&&!e.prefix){let t=!1;return h(e)&&(e.prefix="",u(e,(e,n)=>{(function(e,t){let n=x(e,!0,k);if(!n)return!1;let i=g(n.provider,n.prefix);if(!t)return i.missing.add(n.name),!0;var r=n.name;try{if("string"==typeof t.body)return i.icons[r]={...t},!0}catch(e){}return!1})(e,n)&&(t=!0)})),t}let n=e.prefix;return!!b({prefix:n,name:"a"})&&!!m(g(t,n),e)}(e))&&console.error(n)}catch(e){console.error(n)}})}if(void 0!==e.IconifyProviders){let t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){let n="IconifyProviders["+e+"] is invalid.";try{let i=t[e];if("object"!=typeof i||!i||void 0===i.resources)continue;!function(e,t){let n=A(t);return null!==n&&(I[e]=n,!0)}(e,i)&&console.error(n)}catch(e){console.error(n)}}}}function en(e){let[n,i]=(0,r.useState)(!!e.ssr),[a,l]=(0,r.useState)({}),[o,c]=(0,r.useState)(function(t){if(t){let t=e.icon;if("object"==typeof t)return{name:"",data:t};let n=j(t);if(n)return{name:t,data:n}}return{name:""}}(!!e.ssr));function u(){let e=a.callback;e&&(e(),l({}))}function f(e){if(JSON.stringify(o)!==JSON.stringify(e))return u(),c(e),!0}(0,r.useEffect)(()=>(i(!0),u),[]),(0,r.useEffect)(()=>{n&&function t(){var n;let i=e.icon;if("object"==typeof i)return void f({name:"",data:i});let r=j(i);f({name:i,data:r})&&(void 0===r?l({callback:((e,t)=>{var n;let i,r,a,l,s,o=(n=function(e,t=!0,n=!1){let i=[];return e.forEach(e=>{let r="string"==typeof e?x(e,t,n):e;r&&i.push(r)}),i}(e,!0,v()),a={loaded:[],missing:[],pending:[]},l=Object.create(null),n.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name)),s={provider:"",prefix:"",name:""},n.forEach(e=>{if(s.name===e.name&&s.prefix===e.prefix&&s.provider===e.provider)return;s=e;let t=e.provider,n=e.prefix,i=e.name,r=l[t]||(l[t]=Object.create(null)),o=r[n]||(r[n]=g(t,n));(i in o.icons?a.loaded:""===n||o.missing.has(i)?a.missing:a.pending).push({provider:t,prefix:n,name:i})}),a);if(!o.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(o.loaded,o.missing,o.pending,D)}),()=>{e=!1}}let c=Object.create(null),u=[];return o.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===r&&t===i)return;i=t,r=n,u.push(g(t,n));let a=c[t]||(c[t]=Object.create(null));a[n]||(a[n]=[])}),o.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,r=g(t,n),a=r.pendingIcons||(r.pendingIcons=new Set);a.has(i)||(a.add(i),c[t][n].push(i))}),u.forEach(e=>{let t=c[e.provider][e.prefix];t.length&&(e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{let t,n;e.iconsQueueFlag=!1;let{provider:i,prefix:r}=e,a=e.iconsToLoad;if(delete e.iconsToLoad,!a||!a.length)return;let l=e.loadIcon;if(e.loadIcons&&(a.length>1||!l))return void B(e.loadIcons(a,r,i),t=>{U(e,a,t)});if(l)return void a.forEach(t=>{B(l(t,r,i),n=>{let i=n?{prefix:r,icons:{[t]:n}}:null;U(e,[t],i)})});let{valid:s,invalid:o}=(t=[],n=[],a.forEach(e=>{(e.match(y)?t:n).push(e)}),{valid:t,invalid:n});if(o.length&&U(e,o,null),!s.length)return;let c=r.match(y)?F(i):null;c?c.prepare(i,r,s).forEach(t=>{!function(e,t,n){let i,r;if("string"==typeof e){let t=F(e);if(!t)return n(void 0,424);r=t.send;let a=function(e){if(!V[e]){let t=I[e];if(!t)return;let n=_(t);V[e]={config:t,redundancy:n}}return V[e]}(e);a&&(i=a.redundancy)}else{let t=A(e);if(t){i=_(t);let n=F(e.resources?e.resources[0]:"");n&&(r=n.send)}}i&&r?i.query(t,r,n)().abort:n(void 0,424)}(i,t,n=>{U(e,t.icons,n)})}):U(e,s,null)})))}),t?function(e,t,n){let i=R++,r=H.bind(null,n,i);if(!t.pending.length)return r;let a={id:i,icons:t,callback:e,abort:r};return n.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(a)}),r}(t,o,u):D})([i],t)}):r&&(null==(n=e.onLoad)||n.call(e,i)))}()},[e.icon,n]);let{name:d,data:h}=o;return h?((e,n,i)=>{var a;let l,o,c,u,f,d,h,p,g,m,y,b,k,v=n.inline?ee:W,j=function(e,t){let n={...e};for(let e in t){let i=t[e],r=typeof i;e in w?(null===i||i&&("string"===r||"number"===r))&&(n[e]=i):r===typeof n[e]&&(n[e]="rotate"===e?i%4:i)}return n}(v,n),E=n.mode||"svg",N={},C=n.style||{},F={..."svg"===E?Q:{}};if(i){let e=x(i,!1,!0);if(e){let t=["iconify"];for(let n of["provider","prefix"])e[n]&&t.push("iconify--"+e[n]);F.className=t.join(" ")}}for(let e in n){let t=n[e];if(void 0!==t)switch(e){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":F.ref=t;break;case"className":F[e]=(F[e]?F[e]+" ":"")+t;break;case"inline":case"hFlip":case"vFlip":j[e]=!0===t||"true"===t||1===t;break;case"flip":"string"==typeof t&&function(e,t){t.split(G).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}(j,t);break;case"color":N.color=t;break;case"rotate":"string"==typeof t?j[e]=function(e,t=0){let n=e.replace(/^-?[0-9.]*/,"");function i(e){for(;e<0;)e+=4;return e%4}if(""===n){let t=parseInt(e);return isNaN(t)?0:i(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let r=parseFloat(e.slice(0,e.length-n.length));return isNaN(r)?0:(r/=t)%1==0?i(r):0}}return t}(t):"number"==typeof t&&(j[e]=t);break;case"ariaHidden":case"aria-hidden":!0!==t&&"true"!==t&&delete F["aria-hidden"];break;default:void 0===v[e]&&(F[e]=t)}}let A=(c={...s,...e},u={...M,...j},f={left:c.left,top:c.top,width:c.width,height:c.height},d=c.body,[c,u].forEach(e=>{var t,n,i,r;let a,l,s=[],o=e.hFlip,c=e.vFlip,u=e.rotate;switch(o?c?u+=2:(s.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),s.push("scale(-1 1)"),f.top=f.left=0):c&&(s.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),s.push("scale(1 -1)"),f.top=f.left=0),u<0&&(u-=4*Math.floor(u/4)),u%=4){case 1:s.unshift("rotate(90 "+(a=f.height/2+f.top).toString()+" "+a.toString()+")");break;case 2:s.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:s.unshift("rotate(-90 "+(a=f.width/2+f.left).toString()+" "+a.toString()+")")}u%2==1&&(f.left!==f.top&&(a=f.left,f.left=f.top,f.top=a),f.width!==f.height&&(a=f.width,f.width=f.height,f.height=a)),s.length&&(t=d,n='<g transform="'+s.join(" ")+'">',i=(l=function(e,t="defs"){let n="",i=e.indexOf("<"+t);for(;i>=0;){let r=e.indexOf(">",i),a=e.indexOf("</"+t);if(-1===r||-1===a)break;let l=e.indexOf(">",a);if(-1===l)break;n+=e.slice(r+1,a).trim(),e=e.slice(0,i).trim()+e.slice(l+1)}return{defs:n,content:e}}(t)).defs,r=n+l.content+"</g>",d=i?"<defs>"+i+"</defs>"+r:r)}),h=u.width,p=u.height,g=f.width,m=f.height,null===h?l=S(o=null===p?"1em":"auto"===p?m:p,g/m):(l="auto"===h?g:h,o=null===p?S(l,m/g):"auto"===p?m:p),y={},(b=(e,t)=>{"unset"!==t&&"undefined"!==t&&"none"!==t&&(y[e]=t.toString())})("width",l),b("height",o),y.viewBox=(k=[f.left,f.top,g,m]).join(" "),{attributes:y,viewBox:k,body:d}),I=A.attributes;if(j.inline&&(N.verticalAlign="-0.125em"),"svg"===E){F.style={...N,...C},Object.assign(F,I);let e=0,i=n.id;return"string"==typeof i&&(i=i.replace(/-/g,"_")),F.dangerouslySetInnerHTML={__html:(a=function(e,t=T){let n,i=[];for(;n=z.exec(e);)i.push(n[1]);if(!i.length)return e;let r="suffix"+(0x1000000*Math.random()|Date.now()).toString(16);return i.forEach(n=>{let i="function"==typeof t?t(n):t+(O++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+i+r+"$3")}),e=e.replace(RegExp(r,"g"),"")}(A.body,i?()=>i+"ID"+e++:"iconifyReact"),void 0===t&&function(){try{t=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){t=null}}(),t?t.createHTML(a):a)},(0,r.createElement)("svg",F)}let{body:L,width:P,height:$}=e,H="mask"===E||"bg"!==E&&-1!==L.indexOf("currentColor"),R=function(e,t){let n=-1===e.indexOf("xlink:")?"":' 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>"}(L,{...I,width:P+"",height:$+""});return F.style={...N,"--svg":'url("data:image/svg+xml,'+R.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")+'")',width:et(I.width),height:et(I.height),...J,...H?K:X,...C},(0,r.createElement)("span",F)})({...s,...h},e,d):e.children?e.children:e.fallback?e.fallback:(0,r.createElement)("span",{})}let ei=(0,r.forwardRef)((e,t)=>en({...e,_ref:t}));(0,r.forwardRef)((e,t)=>en({inline:!0,...e,_ref:t}));var er=e.i(66595),ea=e.i(31214),el=e.i(21357),es=e.i(56420);let eo=(0,es.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);var ec=e.i(71567);let eu=(0,es.default)("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"}]]),ef=(0,es.default)("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"}]]);var ed=e.i(68590);let eh=(0,es.default)("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"}]]),ep=(0,es.default)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);var eg=e.i(30274);let em=(0,es.default)("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"}]]);var ey=e.i(51921);let ex=(0,es.default)("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"}]]),eb=(0,es.default)("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"}]]),ek=(0,es.default)("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"}]]);var ev=e.i(66627);let ej=[{name:"Google",host:"google.com",icon:"simple-icons:google",fallback:(0,i.jsx)(er.Search,{size:20})},{name:"Cloudflare",host:"cloudflare.com",icon:"simple-icons:cloudflare",fallback:(0,i.jsx)(ea.Cloud,{size:20})},{name:"YouTube",host:"youtube.com",icon:"simple-icons:youtube",fallback:(0,i.jsx)(el.Play,{size:20})},{name:"GitHub",host:"github.com",icon:"simple-icons:github",fallback:(0,i.jsx)(eo,{size:20})},{name:"ChatGPT",host:"chatgpt.com",icon:"simple-icons:openai",fallback:(0,i.jsx)(ec.Bot,{size:20})},{name:"X",host:"x.com",icon:"simple-icons:x",fallback:(0,i.jsx)(eu,{size:20})},{name:"Instagram",host:"instagram.com",icon:"simple-icons:instagram",fallback:(0,i.jsx)(ef,{size:20})},{name:"Reddit",host:"reddit.com",icon:"simple-icons:reddit",fallback:(0,i.jsx)(ed.MessageSquare,{size:20})},{name:"Wikipedia",host:"wikipedia.org",icon:"simple-icons:wikipedia",fallback:(0,i.jsx)(eh,{size:20})},{name:"Apple",host:"apple.com",icon:"simple-icons:apple",fallback:(0,i.jsx)(ep,{size:20})},{name:"Telegram",host:"telegram.org",icon:"simple-icons:telegram",fallback:(0,i.jsx)(eg.Send,{size:20})},{name:"Discord",host:"discord.com",icon:"simple-icons:discord",fallback:(0,i.jsx)(em,{size:20})},{name:"TikTok",host:"tiktok.com",icon:"simple-icons:tiktok",fallback:(0,i.jsx)(ey.Music,{size:20})},{name:"npm",host:"npmjs.com",icon:"simple-icons:npm",fallback:(0,i.jsx)(ex,{size:20})},{name:"Vercel",host:"vercel.com",icon:"simple-icons:vercel",fallback:(0,i.jsx)(eb,{size:20})}];function ew({icon:e,fallback:t}){let[n,a]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let t=new Image;t.onload=()=>a(!0),t.onerror=()=>a(!1),t.src=`https://api.iconify.design/${e.replace(":","/")}.svg`},[e]),(0,i.jsxs)("span",{className:"brand-icon-wrap",children:[(0,i.jsx)("span",{className:`brand-icon-fallback ${n?"hidden":""}`,children:t}),(0,i.jsx)("span",{className:`brand-icon-real ${n?"visible":""}`,children:(0,i.jsx)(ei,{icon:e,width:20,height:20})})]})}function eM(){let[e,t]=(0,r.useState)(new Map),[n,a]=(0,r.useState)(!1),l=(0,r.useRef)(new Map),s=(0,r.useCallback)(e=>{t(t=>{let n=new Map(t);return n.set(e,{status:"pending",latency:0}),n});let n=new AbortController;l.current.set(e,n);let i=performance.now(),r=(n,i)=>{t(t=>{let r=new Map(t);return r.set(e,{status:n,latency:i}),r})},a=setTimeout(()=>{n.abort()},5e3);fetch(`https://${e}/`,{method:"HEAD",mode:"no-cors",cache:"no-store",signal:n.signal}).then(()=>{clearTimeout(a),r("ok",Math.round(performance.now()-i))}).catch(()=>{clearTimeout(a),r("timeout",0)})},[]),o=(0,r.useCallback)(()=>{a(!0);let e=new Map;ej.forEach(t=>{e.set(t.host,{status:"pending",latency:0})}),t(e);let n=new Set(ej.map(e=>e.host));ej.forEach(e=>{let i=new AbortController;l.current.set(e.host,i);let r=performance.now(),s=(i,r)=>{n.has(e.host)&&(n.delete(e.host),t(t=>{let n=new Map(t);return n.set(e.host,{status:i,latency:r}),n}),0===n.size&&a(!1))},o=setTimeout(()=>{i.abort()},5e3);fetch(`https://${e.host}/`,{method:"HEAD",mode:"no-cors",cache:"no-store",signal:i.signal}).then(()=>{clearTimeout(o),s("ok",Math.round(performance.now()-r))}).catch(()=>{clearTimeout(o),s("timeout",0)})})},[]);return(0,r.useEffect)(()=>(o(),()=>{l.current.forEach(e=>e.abort()),l.current.clear()}),[o]),(0,i.jsxs)("div",{className:"ping-page",children:[(0,i.jsxs)("div",{className:"ping-header",children:[(0,i.jsxs)("div",{className:"ping-title-wrap",children:[(0,i.jsx)(ev.Wifi,{size:28,className:"ping-title-icon"}),(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{className:"ping-title",children:"网络连通性"}),(0,i.jsx)("p",{className:"ping-subtitle",children:"通过向对应网站发送请求进行测试,延迟值仅供参考。"})]})]}),(0,i.jsx)("button",{className:"btn btn-icon",onClick:o,disabled:n,"aria-label":"重新测试全部",title:"重新测试全部",children:(0,i.jsx)(ek,{size:18,className:n?"ping-spin":""})})]}),(0,i.jsx)("div",{className:"ping-grid",children:ej.map(t=>{let n=e.get(t.host),r=!n||"pending"===n.status,a=n?.status==="timeout";return(0,i.jsxs)("div",{className:`ping-card ${r?"pending":""}`,children:[(0,i.jsxs)("div",{className:"ping-card-top",children:[(0,i.jsx)("span",{className:"ping-card-icon",children:(0,i.jsx)(ew,{icon:t.icon,fallback:t.fallback})}),(0,i.jsx)("a",{href:`https://${t.host}`,target:"_blank",rel:"noreferrer",className:"ping-card-name",children:t.name}),(0,i.jsx)("button",{className:"ping-card-refresh",onClick:()=>s(t.host),disabled:r,"aria-label":`重新测试 ${t.name}`,title:"重新测试",children:(0,i.jsx)(ek,{size:13,className:r?"ping-spin":""})})]}),(0,i.jsxs)("div",{className:"ping-card-bottom",children:[r?(0,i.jsx)("span",{className:"ping-pulse-dot"}):(0,i.jsx)("span",{className:`ping-status-label ${a?"is-error":"is-success"}`,children:a?"不可用":"可用"}),(0,i.jsx)("span",{className:`ping-latency ${r?"is-muted":a?"is-error":"is-success"}`,children:r?"--":a?"超时":`${n.latency} ms`})]})]},t.host)})})]})}var eE=e.i(40983);e.s(["default",0,function(){return(0,i.jsx)(eE.MarketingLayout,{children:(0,i.jsx)(eM,{})})}],23449)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96699,e=>{"use strict";let t=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,t],96699)},35965,e=>{"use strict";let t=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,t],35965)},89664,e=>{"use strict";let t=(0,e.i(56420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],89664)},50285,e=>{"use strict";let t=(0,e.i(56420).default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);e.s(["HardDrive",0,t],50285)},10566,e=>{"use strict";let t=(0,e.i(56420).default)("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);e.s(["NotebookPen",0,t],10566)},82022,e=>{"use strict";let t=(0,e.i(56420).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],82022)},70904,e=>{"use strict";let t=(0,e.i(56420).default)("wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);e.s(["Wallet",0,t],70904)},68590,e=>{"use strict";let t=(0,e.i(56420).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],68590)},40983,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(22016),l=e.i(96699),i=e.i(35965);function n({size:e=24}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.4"}),(0,t.jsx)("rect",{x:"14",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)"})]})}function r(){let[e,r]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;("dark"===e||!e&&t)&&r(!0)},[]),(0,a.useEffect)(()=>{document.documentElement.setAttribute("data-theme",e?"dark":"light"),localStorage.setItem("theme",e?"dark":"light")},[e]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("nav",{className:"mkt-nav",children:(0,t.jsxs)("div",{className:"mkt-nav-inner",children:[(0,t.jsxs)(s.default,{href:"/",className:"mkt-nav-logo",children:[(0,t.jsx)(n,{}),"MOST PEOPLE"]}),(0,t.jsxs)("div",{className:"mkt-nav-cta",children:[(0,t.jsx)("button",{className:"mkt-theme-toggle",onClick:()=>r(!e),"aria-label":"切换主题",children:e?(0,t.jsx)(i.Sun,{size:16}):(0,t.jsx)(l.Moon,{size:16})}),(0,t.jsx)(s.default,{href:"/app/",className:"btn btn-primary",children:"开始使用"})]})]})})})}let c=[{href:"/",label:"关于"},{href:"/ping/",label:"网络"},{href:"https://github.com/most-people/most",label:"GitHub",external:!0}];function d(){return(0,t.jsx)("footer",{className:"mkt-footer",children:(0,t.jsx)("div",{className:"mkt-container",children:(0,t.jsxs)("div",{className:"mkt-footer-inner",children:[(0,t.jsx)("div",{className:"mkt-footer-links",children:c.map(e=>(0,t.jsx)(s.default,{href:e.href,...e.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e.label},e.href))}),(0,t.jsxs)("span",{className:"mkt-footer-copy",children:["© ",new Date().getFullYear()," MOST PEOPLE · MIT License"]})]})})})}e.s(["MarketingLayout",0,function({children:e}){return(0,t.jsxs)("div",{className:"mkt-layout",children:[(0,t.jsx)(r,{}),(0,t.jsx)("main",{className:"mkt-layout-main",children:e}),(0,t.jsx)(d,{})]})}],40983)},31713,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(22016),l=e.i(56420);let i=(0,l.default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);var n=e.i(68590),r=e.i(10566),c=e.i(70904);let d=(0,l.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),o=(0,l.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var h=e.i(89664),m=e.i(82022),p=e.i(62368),u=e.i(41220),x=e.i(50285);let k=(0,l.default)("gamepad-2",[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]]);var j=e.i(3593);let y=[{id:"app",title:"MostBox",subtitle:"P2P 文件分享",icon:(0,t.jsx)(i,{size:28}),path:"/app/",requiresBackend:!0,hero:"P2P 文件分享,无需注册",desc:"基于 Hyperswarm 的去中心化文件传输,让文件分享回归点对点。MostBox 不是云盘;链接来自 CID,可用性来自当前在线种子。",features:["无需注册,打开浏览器即用","Hyperswarm P2P 直连传输","GB 级大文件流式处理","相同文件 = 相同 CID,链接可反复校验","下载完成后默认继续做种","相比微信、QQ 或网盘,不依赖中心化账号和云端托管","Web 端负责展示,完整发布、下载和持续做种依赖桌面客户端","MIT 开源,自托管,数据完全自主掌控"],steps:[{num:"1",title:"下载桌面客户端",desc:"支持 Windows、macOS 和 Linux,桌面端提供完整的 P2P 能力。",link:"/download",linkText:"前往下载页"},{num:"2",title:"安装并运行",desc:"安装后打开应用,即可使用。"},{num:"3",title:"开始分享",desc:"发布文件生成 most:// 链接,朋友下载校验通过后也会成为新的种子。"}]},{id:"chat",title:"P2P 聊天",subtitle:"频道加密通讯",icon:(0,t.jsx)(n.MessageSquare,{size:28}),path:"/chat/",requiresBackend:!0,hero:"去中心化频道聊天",desc:"基于 Hypercore 的 P2P 加密即时通讯。创建频道,邀请朋友,端到端加密,无需服务器中转。",features:["P2P 加密频道消息","本地登录身份保护消息署名","消息通过 Hyperswarm 网络同步","离线消息自动同步","无需中心化账号注册"],steps:[{num:"1",title:"下载桌面客户端",desc:"支持 Windows、macOS 和 Linux。",link:"/download",linkText:"前往下载页"},{num:"2",title:"创建频道",desc:"输入任意频道名即可加入或创建。"},{num:"3",title:"开始聊天",desc:"发送消息,P2P 网络自动同步给所有在线节点。"}]},{id:"note",title:"笔记",subtitle:"加密云备份",icon:(0,t.jsx)(r.NotebookPen,{size:28}),path:"/note/",requiresBackend:!1,hero:"Web3 加密笔记",desc:"使用本地 Web3 密钥加密 Markdown 笔记,可在浏览器本地保存并按需同步到云端备份。",features:["Markdown 块编辑器","公开 / 私密笔记切换","文件夹、搜索和移动","Web3 登录态加密","云端备份与恢复","独立于 P2P 文件分享"],steps:[{num:"1",title:"生成 Web3 账号",desc:"用用户名和密码派生本地密钥。"},{num:"2",title:"创建笔记",desc:"写 Markdown,按需切换为私密内容。"},{num:"3",title:"备份恢复",desc:"登录后可把加密笔记同步到云端。"}]},{id:"gandengyan",title:"干瞪眼",subtitle:"P2P 牌桌",icon:(0,t.jsx)(k,{size:28}),path:"/gandengyan/",requiresBackend:!0,hero:"常驻节点里的在线牌桌",desc:"把干瞪眼作为 MostBox 的独立页面接入,复用现有节点连接、Web3 登录身份和桌面端常驻入口。",features:["使用 MostBox 本地账号进入房间","复用现有节点 WebSocket,不新增独立服务端口","房间链接可直接分享给朋友","支持 1-2 副牌、2-6 人和人机陪测","游戏规则、服务端事件和页面样式拆分维护"],steps:[{num:"1",title:"登录账号",desc:"使用现有 MostBox Web3 本地账号作为牌桌身份。"},{num:"2",title:"创建房间",desc:"创建房间后复制链接,发给朋友加入。"},{num:"3",title:"开始调试",desc:"可先用人机补位测试出牌、计分和房间同步。"}]},{id:"web3",title:"Web3",subtitle:"账户工具箱",icon:(0,t.jsx)(c.Wallet,{size:28}),path:"/web3/",requiresBackend:!1,hero:"确定性密钥派生工具箱",desc:"纯前端运行的 Web3 账户工具。输入用户名和密码,即可生成 Ed25519 / x25519 密钥对、助记词、以太坊地址,支持 PEM 导出和地址派生。",features:["纯前端运行,无需后端","Ed25519 / x25519 密钥对生成","BIP-39 助记词派生","以太坊地址与私钥导出","PEM 格式密钥导出","二维码展示地址与助记词"],steps:[{num:"1",title:"输入用户名",desc:"用户名 + 密码(可选)作为种子。"},{num:"2",title:"查看密钥",desc:"即时生成 Ed25519、x25519 公钥与 IPNS ID。"},{num:"3",title:"导出使用",desc:"复制地址、导出 PEM、派生子地址。"}]}];function f(){let e=(0,j.useAppStore)(e=>e.hasBackend),l=(0,j.useAppStore)(e=>e.openConnectModal),[i,n]=(0,a.useState)("app"),r=y.find(e=>e.id===i)||y[0];return(0,t.jsxs)("div",{className:"portal-page",children:[(0,t.jsx)("section",{className:"portal-hero",children:(0,t.jsxs)("div",{className:"mkt-container",children:[(0,t.jsx)("h1",{className:"portal-hero-title",children:"MOST PEOPLE"}),(0,t.jsx)("p",{className:"portal-hero-subtitle",children:"去中心化 P2P 工具箱"})]})}),(0,t.jsx)("section",{className:"portal-cards-section",children:(0,t.jsxs)("div",{className:"mkt-container",children:[(0,t.jsx)("div",{className:"portal-cards",children:y.map(a=>{let l=i===a.id,r=a.requiresBackend,c=r?!0===e?"connected":!1===e?"disconnected":"checking":"none";return(0,t.jsxs)("button",{className:`portal-card ${l?"active":""}`,onClick:()=>n(a.id),children:[(0,t.jsx)(s.default,{href:a.path,className:"btn btn-icon portal-card-open-btn",onClick:e=>e.stopPropagation(),title:`打开${a.title}`,children:(0,t.jsx)(o,{size:16})}),(0,t.jsx)("div",{className:"portal-card-icon",children:a.icon}),(0,t.jsx)("div",{className:"portal-card-title",children:a.title}),(0,t.jsx)("div",{className:"portal-card-subtitle",children:a.subtitle}),r?(0,t.jsxs)("div",{className:`portal-card-status ${c}`,children:["checking"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"status-dot checking"}),"检测中"]}),"connected"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"status-dot connected"}),"已连接"]}),"disconnected"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"status-dot disconnected"}),"需连接"]})]}):(0,t.jsxs)("div",{className:"portal-card-status ready",children:[(0,t.jsx)("span",{className:"status-dot ready"}),"已就绪"]})]},a.id)})}),(0,t.jsxs)("div",{className:"portal-node-actions","aria-label":"节点入口",children:[(0,t.jsxs)("button",{onClick:l,className:"btn btn-secondary",children:[(0,t.jsx)(u.Server,{size:16}),"连接节点"]}),(0,t.jsxs)(s.default,{href:"/admin",className:"btn btn-secondary",children:[(0,t.jsx)(x.HardDrive,{size:16}),"节点管理"]})]})]})}),(0,t.jsx)("section",{className:"portal-marketing",children:(0,t.jsx)("div",{className:"mkt-container",children:(0,t.jsx)("div",{className:"portal-marketing-inner",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"portal-marketing-header",children:[(0,t.jsx)("h2",{children:r.hero}),(0,t.jsx)("p",{children:r.desc})]}),(0,t.jsx)("div",{className:"portal-marketing-features",children:r.features.map((e,a)=>(0,t.jsxs)("div",{className:"portal-feature-item",children:[(0,t.jsx)("span",{className:"portal-feature-icon",children:(0,t.jsx)(h.Check,{size:14,strokeWidth:3})}),(0,t.jsx)("span",{children:e})]},a))}),(0,t.jsx)("div",{className:"portal-marketing-steps",children:r.steps.map(e=>(0,t.jsxs)("div",{className:"portal-step",children:[(0,t.jsx)("span",{className:"portal-step-num",children:e.num}),(0,t.jsxs)("div",{className:"portal-step-content",children:[(0,t.jsx)("strong",{children:e.title}),(0,t.jsx)("p",{children:e.desc}),e.code&&(0,t.jsx)("code",{className:"portal-step-code",children:e.code}),e.link&&(0,t.jsx)("p",{className:"portal-step-link",children:(0,t.jsxs)("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",children:[e.linkText," ",(0,t.jsx)(m.ExternalLink,{size:12})]})})]})]},e.num))}),(0,t.jsxs)("div",{className:"portal-actions",children:[(0,t.jsxs)(s.default,{href:r.path,className:"btn btn-primary",children:["进入 ",r.title,(0,t.jsx)(d,{size:16})]}),r.requiresBackend&&!1===e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:l,className:"btn btn-secondary",children:[(0,t.jsx)(u.Server,{size:16}),"连接节点"]}),(0,t.jsxs)(s.default,{href:"/download",className:"btn btn-secondary",children:[(0,t.jsx)(p.Download,{size:16}),"下载桌面客户端"]})]})]})]})})})})]})}var v=e.i(40983);e.s(["default",0,function(){return(0,t.jsx)(v.MarketingLayout,{children:(0,t.jsx)(f,{})})}],31713)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.portal-page{min-height:calc(100dvh - 144px)}.portal-hero{text-align:center;padding:64px 24px 32px}.portal-hero-title{letter-spacing:-.03em;background:linear-gradient(135deg, var(--text-primary), var(--accent));-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;margin-bottom:8px;font-size:48px;font-weight:700;line-height:1.1}.portal-hero-subtitle{color:var(--text-secondary);font-size:18px}@media (max-width:768px){.portal-hero{padding:40px 24px 24px}.portal-hero-title{font-size:36px}.portal-hero-subtitle{font-size:16px}}.portal-cards-section{padding-bottom:32px}.portal-cards{grid-template-columns:repeat(3,1fr);gap:16px;display:grid}@media (max-width:768px){.portal-cards{grid-template-columns:1fr}}.portal-card{text-align:center;background:var(--glass-bg-subtle);-webkit-backdrop-filter:var(--blur-sm);border:1px solid var(--glass-border);border-radius:var(--radius-lg);cursor:pointer;transition:all var(--transition);border:2px solid #0000;flex-direction:column;align-items:center;gap:6px;padding:28px 20px;display:flex;position:relative}.portal-card:hover{background:var(--glass-bg);box-shadow:var(--glass-shadow);transform:translateY(-2px)}.portal-card.active{background:var(--glass-bg);border-color:var(--accent);box-shadow:0 4px 24px #5e6ad226}.portal-card-open-btn{opacity:.5;position:absolute;top:12px;right:12px}.portal-card:hover .portal-card-open-btn,.portal-card.active .portal-card-open-btn{opacity:1}.portal-card-icon{color:var(--accent);margin-bottom:4px}.portal-card-title{color:var(--text-primary);font-size:17px;font-weight:600}.portal-card-subtitle{color:var(--text-secondary);font-size:13px}.portal-node-actions{flex-wrap:wrap;justify-content:center;gap:12px;margin-top:18px;display:flex}.portal-node-actions .btn{min-width:128px}.portal-card-status{border-radius:var(--radius-full);background:var(--glass-bg-subtle);border:1px solid var(--glass-border);align-items:center;gap:5px;margin-top:6px;padding:3px 10px;font-size:11px;font-weight:500;display:inline-flex}.status-dot{border-radius:50%;width:7px;height:7px;display:inline-block}.status-dot.checking{background:var(--warning);animation:1.2s ease-in-out infinite pulse-dot}.status-dot.connected{background:var(--success)}.status-dot.disconnected{background:var(--danger)}.status-dot.ready{background:var(--info)}@keyframes pulse-dot{0%,to{opacity:.4;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.portal-marketing{padding-bottom:64px}.portal-marketing-inner{background:var(--glass-bg-subtle);-webkit-backdrop-filter:var(--blur-sm);border:1px solid var(--glass-border);border-radius:var(--radius-lg);padding:40px;animation:.3s ease-out fadeInUp}@media (max-width:768px){.portal-marketing-inner{padding:24px}}.portal-marketing-header h2{margin-bottom:12px;font-size:28px;font-weight:600}.portal-marketing-header p{color:var(--text-secondary);max-width:60ch;font-size:16px;line-height:1.7}@media (max-width:768px){.portal-marketing-header h2{font-size:22px}.portal-marketing-header p{font-size:14px}}.portal-marketing-features{grid-template-columns:repeat(2,1fr);gap:12px;margin-top:28px;display:grid}@media (max-width:768px){.portal-marketing-features{grid-template-columns:1fr}}.portal-feature-item{color:var(--text-secondary);align-items:flex-start;gap:10px;font-size:14px;line-height:1.5;display:flex}.portal-feature-icon{color:var(--accent);flex-shrink:0;margin-top:1px}.portal-marketing-steps{border-top:1px solid var(--glass-border);flex-direction:column;gap:16px;margin-top:32px;padding-top:32px;display:flex}.portal-step{align-items:flex-start;gap:14px;display:flex}.portal-step-num{background:var(--accent);color:#fff;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;font-size:13px;font-weight:700;display:flex}.portal-step-content strong{color:var(--text-primary);font-size:15px;font-weight:600}.portal-step-content p{color:var(--text-secondary);margin-top:2px;font-size:13px}.portal-step-code{background:var(--glass-bg-subtle);border:1px solid var(--glass-border);border-radius:var(--radius-sm);font-size:13px;font-family:var(--font-mono);color:var(--text-primary);margin-top:8px;padding:10px 14px;display:block}.portal-step-link{margin-top:6px}.portal-step-link a{color:var(--accent);align-items:center;gap:4px;font-size:13px;display:inline-flex}.portal-actions{border-top:1px solid var(--glass-border);flex-wrap:wrap;gap:12px;margin-top:32px;padding-top:32px;display:flex}.portal-actions .mkt-btn-primary,.portal-actions .mkt-btn-secondary{align-items:center;gap:6px;display:inline-flex}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.download-page{flex-direction:column;min-height:100dvh;display:flex}.download-hero{text-align:center;padding:64px 24px 48px}.download-hero-icon{border-radius:var(--radius-lg);background:var(--accent-soft);width:72px;height:72px;color:var(--accent);justify-content:center;align-items:center;margin-bottom:24px;display:inline-flex}.download-hero-title{letter-spacing:-.02px;background:linear-gradient(135deg, var(--text-primary), var(--accent));-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;margin-bottom:16px;font-size:40px;font-weight:700;line-height:1.1}.download-hero-desc{color:var(--text-secondary);max-width:48ch;margin:0 auto;font-size:16px;line-height:1.6}.download-platforms{padding:48px 24px}.download-section-title{text-align:center;color:var(--text-primary);margin-bottom:32px;font-size:24px;font-weight:600}.download-options{gap:20px;display:grid}.download-source-note{text-align:center;color:var(--text-secondary);margin:0;font-size:14px}.download-platform-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;display:grid}.download-platform-card{background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-md);border:1px solid var(--glass-border);border-radius:var(--radius-lg);color:var(--text-primary);transition:all var(--transition);align-items:flex-start;gap:18px;padding:32px 24px;display:flex;position:relative}.download-platform-card:hover{background:var(--glass-bg-heavy);box-shadow:var(--glass-shadow);border-color:var(--accent);transform:translateY(-2px)}.download-platform-icon{color:var(--accent);border-radius:var(--radius-md);background:var(--accent-soft);flex-shrink:0;justify-content:center;align-items:center;width:48px;height:48px;display:inline-flex}.download-platform-content{flex:1;gap:12px;min-width:0;display:grid}.download-platform-heading{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.download-platform-heading h3{margin:0;font-size:18px;font-weight:600}.download-platform-heading span,.download-recommended-badge{border-radius:var(--radius-sm);background:var(--glass-bg-heavy);border:1px solid var(--glass-border);min-height:24px;color:var(--text-secondary);align-items:center;padding:0 10px;font-size:12px;font-weight:600;display:inline-flex}.download-platform-card p{color:var(--text-secondary);margin:0;font-size:13px;line-height:1.5}.download-platform-meta{gap:8px;margin:0;display:grid}.download-platform-meta div{grid-template-columns:56px minmax(0,1fr);align-items:center;gap:8px;display:grid}.download-platform-meta dt,.download-platform-meta dd{margin:0;font-size:12px;line-height:1.4}.download-platform-meta dt{color:var(--text-muted)}.download-platform-meta dd{color:var(--text-secondary);overflow-wrap:anywhere}.download-platform-actions{flex-wrap:wrap;align-items:center;gap:12px;margin-top:4px;display:flex}.download-platform-actions .btn{gap:8px}.download-platform-fallback{color:var(--text-secondary);align-items:center;gap:6px;font-size:13px;text-decoration:none;display:inline-flex}.download-platform-fallback:hover{color:var(--accent)}.download-recommended-badge{background:var(--accent-soft);color:var(--accent);border-color:var(--accent);position:absolute;top:16px;right:16px}.download-platform-card.is-recommended{border-color:var(--accent)}.download-comparison{background:var(--glass-bg-subtle);border-top:1px solid var(--glass-border);border-bottom:1px solid var(--glass-border);padding:48px 24px}.download-table-wrap{overflow-x:auto}.download-table{border-collapse:collapse;width:100%;max-width:600px;margin:0 auto}.download-table th,.download-table td{text-align:left;border-bottom:1px solid var(--glass-border);padding:14px 20px}.download-table th{color:var(--text-primary);font-size:14px;font-weight:600}.download-table td{color:var(--text-secondary);font-size:14px}.download-table td.col-web{color:var(--warning)}.download-table td.col-desktop{color:var(--success);font-weight:500}.download-cta{text-align:center;padding:64px 24px}.download-cta-desc{color:var(--text-secondary);margin-bottom:24px;font-size:16px;line-height:1.6}@media (max-width:768px){.download-hero-title{font-size:32px}.download-platform-grid{grid-template-columns:1fr;gap:16px}.download-platform-card{gap:16px;padding:20px}.download-platform-icon{flex-shrink:0;margin-bottom:0}.download-recommended-badge{align-self:flex-start;position:static}.download-platform-meta div{grid-template-columns:48px minmax(0,1fr)}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96699,e=>{"use strict";let a=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,a],96699)},35965,e=>{"use strict";let a=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,a],35965)},11241,e=>{"use strict";let a=(0,e.i(56420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,a],11241)},59665,e=>{"use strict";var a=e.i(18050),s=e.i(71645),t=e.i(67228);let l=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);e.i(22183);var n=e.i(5142);let r=(0,s.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:d,headerRight:i,children:c}){let[o,u]=(0,n.useDisclosure)(!1),[h,m]=(0,s.useState)(!1),p=(0,t.useMediaQuery)("(max-width: 768px)"),g=()=>{p?u.open():m(!1)};return(0,a.jsx)(r.Provider,{value:{closeSidebar:u.close,openSidebar:g,isSidebarVisible:p?o:!h},children:(0,a.jsxs)("div",{className:"app-layout",children:[(0,a.jsx)("div",{className:`sidebar-overlay ${o?"visible":""}`,onClick:()=>u.close()}),(0,a.jsx)("div",{className:`sidebar ${o?"open":""} ${h?"collapsed":""}`,children:e({closeSidebar:u.close,openSidebar:g})}),(0,a.jsxs)("div",{className:"main-content",children:[(0,a.jsxs)("header",{className:"app-header",children:[(0,a.jsxs)("div",{className:"header-left",children:[(0,a.jsx)("button",{onClick:()=>{p?u.toggle():m(!h)},className:"btn btn-icon sidebar-toggle-btn","aria-label":p?"打开菜单":h?"展开侧边栏":"收起侧边栏",children:(0,a.jsx)(l,{size:16})}),d]}),(0,a.jsx)("div",{className:"header-right",children:i})]}),c]})]})})},"useAppShell",0,function(){let e=(0,s.useContext)(r);if(!e)throw Error("useAppShell must be used within AppShell");return e}],59665)},27648,e=>{"use strict";var a=e.i(18050),s=e.i(93957),t=e.i(71192);e.s(["default",0,function({className:e=""}){let l=(0,t.useUserStore)(e=>e.identity),n=(0,t.useUserStore)(e=>e.openLoginModal),r=(0,t.useUserStore)(e=>e.logoutUser);return(0,a.jsxs)("div",{className:`chat-sidebar-footer sidebar-account ${e}`,children:[(0,a.jsxs)("div",{className:"user-info",children:[(0,a.jsx)("img",{className:"user-avatar-img",src:(0,s.generateAvatar)(l?.address),alt:"avatar"}),(0,a.jsx)("span",{className:"user-name",title:l?.address,children:l?.displayName||"未登录"})]}),l?(0,a.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:r,children:"退出"}):(0,a.jsx)("button",{className:"btn btn-primary login-btn",onClick:n,children:"登录"})]})}])},8734,e=>{"use strict";let a=(0,e.i(56420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,a],8734)},30274,e=>{"use strict";let a=(0,e.i(56420).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,a],30274)},71567,e=>{"use strict";let a=(0,e.i(56420).default)("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"}]]);e.s(["Bot",0,a],71567)},21357,e=>{"use strict";let a=(0,e.i(56420).default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",0,a],21357)},93884,e=>{e.v({accountLine:"page-module__CrU-Oa__accountLine",actions:"page-module__CrU-Oa__actions",active:"page-module__CrU-Oa__active",avatar:"page-module__CrU-Oa__avatar",badges:"page-module__CrU-Oa__badges",black:"page-module__CrU-Oa__black",card:"page-module__CrU-Oa__card",cardButton:"page-module__CrU-Oa__cardButton",cardMark:"page-module__CrU-Oa__cardMark",centerTable:"page-module__CrU-Oa__centerTable",dangerBadge:"page-module__CrU-Oa__dangerBadge",deckBox:"page-module__CrU-Oa__deckBox",entry:"page-module__CrU-Oa__entry",entryBrand:"page-module__CrU-Oa__entryBrand",entryPanel:"page-module__CrU-Oa__entryPanel",error:"page-module__CrU-Oa__error",gameGrid:"page-module__CrU-Oa__gameGrid",hand:"page-module__CrU-Oa__hand",handPanel:"page-module__CrU-Oa__handPanel",headerActions:"page-module__CrU-Oa__headerActions",joinForm:"page-module__CrU-Oa__joinForm",logPanel:"page-module__CrU-Oa__logPanel",notice:"page-module__CrU-Oa__notice",page:"page-module__CrU-Oa__page",panel:"page-module__CrU-Oa__panel",picked:"page-module__CrU-Oa__picked",playedBox:"page-module__CrU-Oa__playedBox",playedCards:"page-module__CrU-Oa__playedCards",player:"page-module__CrU-Oa__player",preview:"page-module__CrU-Oa__preview",rangeLine:"page-module__CrU-Oa__rangeLine",red:"page-module__CrU-Oa__red",roomBar:"page-module__CrU-Oa__roomBar",scoreMeta:"page-module__CrU-Oa__scoreMeta",scoreRow:"page-module__CrU-Oa__scoreRow",seats:"page-module__CrU-Oa__seats",segmented:"page-module__CrU-Oa__segmented",selected:"page-module__CrU-Oa__selected",sidePanel:"page-module__CrU-Oa__sidePanel",small:"page-module__CrU-Oa__small",status:"page-module__CrU-Oa__status",tablePanel:"page-module__CrU-Oa__tablePanel",valid:"page-module__CrU-Oa__valid",winner:"page-module__CrU-Oa__winner"})},47938,e=>{"use strict";var a=e.i(18050),s=e.i(71645),t=e.i(22016),l=e.i(11241),n=e.i(71567),r=e.i(8734),d=e.i(96699),i=e.i(21357),c=e.i(56420);let o=(0,c.default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var u=e.i(30274);let h=(0,c.default)("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);var m=e.i(35965);let p=(0,c.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var g=e.i(59665),_=e.i(27648),x=e.i(26913),f=e.i(3593),j=e.i(71192),y=e.i(93884);let b=["3","4","5","6","7","8","9","10","J","Q","K","A","2"],v=b.filter(e=>"2"!==e),k=new Map(b.map((e,a)=>[e,a+3]));function C(...e){return e.filter(Boolean).join(" ")}function N({player:e,active:s,winner:t,relation:l=""}){return e?(0,a.jsxs)("div",{className:C(y.default.player,s&&y.default.active,t&&y.default.winner),children:[(0,a.jsx)("div",{className:y.default.avatar,children:e.bot?"AI":e.name.slice(0,1)}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:e.name}),(0,a.jsxs)("span",{children:[l,l?" · ":"",e.handCount," 张",e.connected?"":" · 掉线"]})]})]}):null}function U({card:e,small:s=!1}){return(0,a.jsxs)("div",{className:C(y.default.card,y.default[e.color],s&&y.default.small),children:[(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("i",{children:"Joker"===e.suit?"★":e.label.slice(0,1)})]})}function O(e,a){return{label:`${e}(${a.map(P).join(" ")})`}}function w(e){if(!e)return;let a=`/gandengyan?room=${e}`;`${window.location.pathname}${window.location.search}`!==a&&window.history.replaceState(null,"",a)}function S(e){return e.length>0&&e.every(a=>a.rank===e[0].rank)}function M(e){return"SJ"===e.rank||"BJ"===e.rank}function B(e){return k.get(e.rank)||99}function P(e){return b.find(a=>k.get(a)===e)||String(e)}e.s(["default",0,function(){let e=(0,s.useRef)(null),[c,b]=(0,s.useState)(!1),[P,z]=(0,s.useState)(""),[$,A]=(0,s.useState)(null),[L,T]=(0,s.useState)(""),[R,E]=(0,s.useState)([]),[q,I]=(0,s.useState)(""),[J,F]=(0,s.useState)(!1),{isDarkMode:G,setIsDarkMode:H}=(0,f.useAppStore)(),{identity:K,initializeUser:V,openLoginModal:W}=(0,j.useUserStore)();(0,s.useEffect)(()=>{V()},[V]),(0,s.useEffect)(()=>{let a=!1,s=null;return async function(){let t=await (0,x.getAuthenticatedWebSocketUrl)("/ws");a||(e.current=s=new WebSocket(t),s.addEventListener("open",()=>b(!0)),s.addEventListener("close",()=>b(!1)),s.addEventListener("message",e=>{let a=JSON.parse(e.data);"gandengyan:hello"===a.event&&z(a.data.playerId),"gandengyan:roomCreated"===a.event&&(T(a.data.roomId),w(a.data.roomId)),"gandengyan:state"===a.event&&(A(a.data),w(a.data.id),E([]),I("")),"gandengyan:error"===a.event&&I(a.data.message)}))}(),()=>{a=!0,s?.close()}},[]),(0,s.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get("room")?.toUpperCase();e&&T(e)},[]);let D=(0,s.useMemo)(()=>$?.players.find(e=>e.id===P)||null,[$,P]),Q=$?.ownerId===P,X=$?.status==="playing"&&$.currentSeat===D?.seat,Y=(0,s.useMemo)(()=>R.map(e=>D?.hand.find(a=>a.id===e)).filter(Boolean),[R,D]),Z=(0,s.useMemo)(()=>(function(e){if(!e.length)return null;let a=e.filter(M).length,s=e.filter(e=>!M(e));if(0===s.length)return null;let t=function(e,a,s){if(e.length<3||!S(a))return null;let t=B(a[0]);return O(0===s?"纯炸弹":"带王炸弹",Array(e.length).fill(t))}(e,s,a);if(t)return t;if(1===e.length&&0===a)return O("单张",[B(e[0])]);if(2===e.length&&S(s)){let e=B(s[0]);return O("对子",[e,e])}return function(e){if(e.length<3)return null;for(let a=0;a<=v.length-e.length;a+=1){let s=v.slice(a,a+e.length).map(e=>k.get(e));if(e.every((e,a)=>M(e)||B(e)===s[a]))return O("顺子",s)}return null}(e)||function(e){if(e.length<4||e.length%2!=0)return null;let a=e.length/2;for(let s=0;s<=v.length-a;s+=1){let t=v.slice(s,s+a).map(e=>k.get(e)).flatMap(e=>[e,e]);if(e.every((e,a)=>M(e)||B(e)===t[a]))return O("连对",t)}return null}(e)})(Y),[Y]),ee=$&&1?`${window.location.origin}/gandengyan?room=${$.id}`:"",ea=!!($&&"playing"===$.status&&$.deckCount<3);function es(a,s={}){K?(I(""),e.current?.send(JSON.stringify({event:a,data:{...s,identity:K}}))):W()}function et(e,a){$&&es("gandengyan:settings",{settings:{...$.settings,[e]:a}})}return(0,a.jsx)(g.default,{sidebar:({closeSidebar:e})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.default,{href:"/",className:"sidebar-header sidebar-header-link",children:[(0,a.jsx)(l.ArrowLeft,{size:18}),(0,a.jsx)("h1",{children:"MOST PEOPLE"})]}),(0,a.jsxs)("nav",{className:"sidebar-nav",children:[(0,a.jsxs)(t.default,{href:"/app/",className:"sidebar-nav-btn",onClick:e,children:[(0,a.jsx)(h,{size:16}),(0,a.jsx)("span",{children:"文件"})]}),(0,a.jsxs)(t.default,{href:"/chat/",className:"sidebar-nav-btn",onClick:e,children:[(0,a.jsx)(p,{size:16}),(0,a.jsx)("span",{children:"频道"})]}),(0,a.jsxs)(t.default,{href:"/gandengyan/",className:"sidebar-nav-btn active",onClick:e,children:[(0,a.jsx)(n.Bot,{size:16}),(0,a.jsx)("span",{children:"干瞪眼"})]})]}),(0,a.jsx)(_.default,{})]}),headerTitle:(0,a.jsx)("h2",{className:"header-title",children:"干瞪眼"}),headerRight:(0,a.jsxs)("div",{className:y.default.headerActions,children:[$&&(0,a.jsxs)("button",{className:"btn btn-sm",onClick:function(){navigator.clipboard.writeText(ee),F(!0),setTimeout(()=>F(!1),1400)},children:[(0,a.jsx)(r.Copy,{size:14}),J?"已复制":"分享房间"]}),(0,a.jsx)("button",{className:"btn btn-icon",onClick:()=>H(!G),title:"切换主题",children:G?(0,a.jsx)(m.Sun,{size:16}):(0,a.jsx)(d.Moon,{size:16})})]}),children:(0,a.jsx)("main",{className:y.default.page,children:$?(0,a.jsxs)("section",{className:y.default.gameGrid,children:[(0,a.jsxs)("div",{className:y.default.tablePanel,children:[(0,a.jsxs)("div",{className:y.default.roomBar,children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("strong",{children:["房间 ",$.id]}),(0,a.jsx)("span",{children:"lobby"===$.status?"等待开局":"finished"===$.status?"本局结束":"进行中"})]}),(0,a.jsxs)("div",{className:y.default.badges,children:[ea&&(0,a.jsx)("span",{className:y.default.dangerBadge,children:"牌堆不足 3 张"}),(0,a.jsx)("span",{children:c?"在线":"离线"})]})]}),(0,a.jsx)("div",{className:y.default.seats,children:$.players.map(e=>(0,a.jsx)(N,{player:e,active:$.currentSeat===e.seat,winner:$.winnerSeat===e.seat,relation:function(e,a,s){if(!e)return`座位 ${a.seat+1}`;let t=(a.seat-e.seat+s)%s;return 0===t?"我":2===s?"对手位":3===s?1===t?"下家/对手位":"上家/对手位":4===s?1===t?"下家/对手位":2===t?"对家/队友位":"上家/对手位":t%2==0?`座位 ${a.seat+1}/队友位`:`座位 ${a.seat+1}/对手位`}(D,e,$.players.length)},e.seat))}),(0,a.jsxs)("div",{className:y.default.centerTable,children:[(0,a.jsxs)("div",{className:y.default.deckBox,children:[(0,a.jsx)("span",{children:"牌堆"}),(0,a.jsx)("strong",{children:$.deckCount})]}),(0,a.jsx)("div",{className:y.default.playedBox,children:$.table?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("strong",{children:[$.table.playerName," 出 ",$.table.combo?.label||"牌"]}),(0,a.jsx)("div",{className:y.default.playedCards,children:$.table.cards.map(e=>(0,a.jsx)(U,{card:e,small:!0},e.id))})]}):(0,a.jsx)("span",{children:"等待领出"})}),(0,a.jsxs)("div",{className:y.default.deckBox,children:[(0,a.jsx)("span",{children:"底分"}),(0,a.jsx)("strong",{children:$.baseScore})]})]}),(0,a.jsx)("div",{className:y.default.notice,children:"finished"===$.status?`${$.players.find(e=>e.seat===$.winnerSeat)?.name} 获胜`:X?"轮到你出牌":`等待 ${$.players.find(e=>e.seat===$.currentSeat)?.name||"玩家"}`})]}),(0,a.jsxs)("aside",{className:y.default.sidePanel,children:[(0,a.jsxs)("section",{className:y.default.panel,children:[(0,a.jsx)("h3",{children:"开局设置"}),(0,a.jsx)("div",{className:y.default.segmented,children:[1,2].map(e=>(0,a.jsxs)("button",{className:$.settings.decks===e?y.default.selected:"",disabled:!Q||"lobby"!==$.status,onClick:()=>et("decks",e),children:[e," 副牌"]},e))}),(0,a.jsx)("div",{className:y.default.segmented,children:[2,3,4,5,6].map(e=>(0,a.jsxs)("button",{className:$.settings.seats===e?y.default.selected:"",disabled:!Q||"lobby"!==$.status,onClick:()=>et("seats",e),children:[e," 人"]},e))}),(0,a.jsxs)("label",{className:y.default.rangeLine,children:["人机数量",(0,a.jsx)("input",{type:"range",min:"0",max:Math.max(0,$.settings.seats-1),value:$.settings.bots,disabled:!Q||"lobby"!==$.status,onChange:e=>et("bots",Number(e.target.value))}),(0,a.jsx)("b",{children:$.settings.bots})]}),Q&&"lobby"===$.status&&(0,a.jsxs)("button",{className:"btn btn-primary",onClick:()=>es("gandengyan:start"),children:[(0,a.jsx)(i.Play,{size:16}),"开始游戏"]}),Q&&"finished"===$.status&&(0,a.jsxs)("button",{className:"btn btn-primary",onClick:()=>es("gandengyan:restart"),children:[(0,a.jsx)(o,{size:16}),"再来一局"]})]}),(0,a.jsxs)("section",{className:y.default.panel,children:[(0,a.jsx)("h3",{children:"分数"}),(0,a.jsxs)("div",{className:y.default.scoreMeta,children:[(0,a.jsxs)("span",{children:["炸弹 ",$.bombCount," 次"]}),(0,a.jsxs)("span",{children:["弃牌 ",$.discardCount," 张"]})]}),$.players.map(e=>(0,a.jsxs)("div",{className:y.default.scoreRow,children:[(0,a.jsx)("span",{children:e.name}),(0,a.jsx)("strong",{children:e.score>0?`+${e.score}`:e.score})]},e.seat))]}),(0,a.jsxs)("section",{className:C(y.default.panel,y.default.logPanel),children:[(0,a.jsx)("h3",{children:"牌局记录"}),$.log.map((e,s)=>(0,a.jsx)("p",{children:e},`${e}-${s}`))]})]}),(0,a.jsxs)("div",{className:y.default.handPanel,children:[(0,a.jsx)(N,{player:D,active:X,winner:$.winnerSeat===D?.seat}),(0,a.jsx)("div",{className:y.default.hand,children:D?.hand.map(e=>(0,a.jsx)("button",{className:C(y.default.cardButton,R.includes(e.id)&&y.default.picked),onClick:()=>{var a;return a=e.id,void E(e=>e.includes(a)?e.filter(e=>e!==a):[...e,a])},children:(0,a.jsx)(U,{card:e})},e.id))}),(0,a.jsxs)("div",{className:y.default.actions,children:[(0,a.jsxs)("div",{className:C(y.default.preview,Z&&y.default.valid),children:[(0,a.jsx)("strong",{children:Z?Z.label:R.length?"牌型不合法":"先选牌"}),(0,a.jsx)("span",{children:Y.map(e=>e.label).join(" ")||"按选择顺序解释大小王"})]}),(0,a.jsxs)("button",{className:"btn btn-primary",disabled:!X||0===R.length||!Z,onClick:()=>es("gandengyan:play",{cardIds:R}),children:[(0,a.jsx)(u.Send,{size:16}),"出牌"]}),(0,a.jsx)("button",{className:"btn",disabled:!X||!$.table,onClick:()=>es("gandengyan:pass"),children:"不要"}),q&&(0,a.jsx)("span",{className:y.default.error,children:q})]})]})]}):(0,a.jsxs)("section",{className:y.default.entry,children:[(0,a.jsxs)("div",{className:y.default.entryBrand,children:[(0,a.jsx)("div",{className:y.default.cardMark,children:"干"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{children:"干瞪眼牌桌"}),(0,a.jsx)("p",{children:"使用 MostBox 账号进入房间,牌桌通信复用当前节点的 WebSocket 连接。"})]})]}),(0,a.jsxs)("div",{className:y.default.entryPanel,children:[(0,a.jsxs)("div",{className:y.default.accountLine,children:[(0,a.jsx)("span",{children:"当前账号"}),(0,a.jsx)("strong",{children:K?.displayName||"未登录"})]}),(0,a.jsxs)("button",{className:"btn btn-primary",disabled:!c,onClick:()=>es("gandengyan:createRoom"),children:[(0,a.jsx)(i.Play,{size:16}),"创建房间"]}),(0,a.jsxs)("form",{onSubmit:function(e){e.preventDefault(),es("gandengyan:joinRoom",{roomId:L})},className:y.default.joinForm,children:[(0,a.jsxs)("label",{children:["房间号",(0,a.jsx)("input",{value:L,maxLength:8,onChange:e=>T(e.target.value.toUpperCase()),placeholder:"输入房间号"})]}),(0,a.jsx)("button",{className:"btn",disabled:!c||!L,children:"加入房间"})]}),(0,a.jsx)("p",{className:y.default.status,children:c?"节点已连接":"正在连接节点..."}),q&&(0,a.jsx)("p",{className:y.default.error,children:q})]})]})})})}],47938)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82022,e=>{"use strict";let a=(0,e.i(56420).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,a],82022)},66344,e=>{"use strict";var a=e.i(47167),l=e.i(18050),t=e.i(71645),s=e.i(36162),n=e.i(62368),r=e.i(82022),i=e.i(26158),o=e.i(46513);let d="https://github.com/most-people/most/releases/latest",c=a.default.env.NEXT_PUBLIC_RELEASE_MANIFEST_URL||`${(a.default.env.NEXT_PUBLIC_R2_PUBLIC_BASE_URL||"https://download.most.box").replace(/\/+$/,"")}/releases/latest.json`,u=[{platform:"windows",arch:"x64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"windows",arch:"arm64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"macos",arch:"x64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"macos",arch:"arm64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"linux",arch:"x64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"linux",arch:"arm64",kind:"installer",filename:"GitHub Releases",githubUrl:d}],m={windows:{name:"Windows",ext:".exe",desc:"Windows 10 或更高版本",icon:o.Monitor},macos:{name:"macOS",ext:".dmg",desc:"macOS 12 Monterey 或更高版本",icon:s.Apple},linux:{name:"Linux",ext:".AppImage",desc:"Ubuntu 20.04+ / Debian 11+ / 其他主流发行版",icon:i.Laptop}};function h(e){return"object"==typeof e&&null!==e}function f(e){return!!h(e)&&["windows","macos","linux"].includes(String(e.platform))&&["x64","arm64"].includes(String(e.arch))&&"installer"===e.kind&&"string"==typeof e.filename&&"string"==typeof e.githubUrl&&("string"==typeof e.r2Url||void 0===e.r2Url)}e.s(["default",0,function(){let[e,a]=(0,t.useState)(null),[s,i]=(0,t.useState)("loading"),[o,d]=(0,t.useState)("windows:x64");(0,t.useEffect)(()=>{d(function(){let e;if("u"<typeof navigator)return"windows:x64";let a=(e=navigator,[e.userAgentData?.platform,navigator.platform,navigator.userAgent].filter(Boolean).join(" ").toLowerCase()),l=/arm|aarch64/.test(a)?"arm64":"x64";return/mac|darwin/.test(a)?`macos:${l}`:/linux/.test(a)?`linux:${l}`:`windows:${l}`}())},[]),(0,t.useEffect)(()=>{let e=new AbortController;return fetch(c,{cache:"no-store",signal:e.signal}).then(e=>{if(!e.ok)throw Error(`Manifest request failed: ${e.status}`);return e.json()}).then(e=>{if(!(h(e)&&"string"==typeof e.version&&"string"==typeof e.publishedAt&&Array.isArray(e.assets)&&e.assets.every(f)))throw Error("Invalid download manifest");a(e),i("ready")}).catch(e=>{e instanceof DOMException&&"AbortError"===e.name||(a(null),i("fallback"))}),()=>e.abort()},[]);let p=e?.assets.length?e.assets:u;return(0,l.jsxs)("div",{className:"download-options",children:[(0,l.jsx)("p",{className:"download-source-note",children:"ready"===s&&e?`优先使用高速镜像,当前版本 ${e.version}。`:"暂时使用 GitHub Releases 备用下载。"}),(0,l.jsx)("div",{className:"download-platform-grid",children:p.map(e=>{let a=m[e.platform],t=a.icon,s=`${e.platform}:${e.arch}`,i=e.r2Url||e.githubUrl,d=s===o;return(0,l.jsxs)("article",{className:d?"download-platform-card is-recommended":"download-platform-card",children:[(0,l.jsx)("div",{className:"download-platform-icon",children:(0,l.jsx)(t,{size:32})}),(0,l.jsxs)("div",{className:"download-platform-content",children:[(0,l.jsxs)("div",{className:"download-platform-heading",children:[(0,l.jsx)("h3",{children:a.name}),(0,l.jsx)("span",{children:e.arch})]}),(0,l.jsx)("p",{children:a.desc}),(0,l.jsxs)("dl",{className:"download-platform-meta",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("dt",{children:"来源"}),(0,l.jsx)("dd",{children:e.r2Url?"Cloudflare R2 高速镜像":"GitHub Releases"})]}),e.size?(0,l.jsxs)("div",{children:[(0,l.jsx)("dt",{children:"大小"}),(0,l.jsx)("dd",{children:function(e){if(!e)return"";let a=e/1024/1024;return`${a.toFixed(a>=100?0:1)} MB`}(e.size)})]}):null,e.sha256?(0,l.jsxs)("div",{children:[(0,l.jsx)("dt",{children:"SHA256"}),(0,l.jsx)("dd",{children:e.sha256.slice(0,12)})]}):null]}),(0,l.jsxs)("div",{className:"download-platform-actions",children:[(0,l.jsxs)("a",{href:i,className:"btn btn-primary",children:[(0,l.jsx)(n.Download,{size:16}),"下载 ",a.ext]}),e.r2Url&&e.githubUrl?(0,l.jsxs)("a",{href:e.githubUrl,className:"download-platform-fallback",children:[(0,l.jsx)(r.ExternalLink,{size:14}),"GitHub 备用"]}):null]})]}),d?(0,l.jsx)("span",{className:"download-recommended-badge",children:"推荐"}):null]},s)})})]})}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.page-module__CrU-Oa__page{background:var(--bg,#f6f7f3);min-height:calc(100vh - 64px);padding:18px}.page-module__CrU-Oa__headerActions{align-items:center;gap:8px;display:flex}.page-module__CrU-Oa__entry{grid-template-columns:minmax(0,1fr) 360px;align-items:center;gap:48px;max-width:1040px;min-height:calc(100vh - 116px);margin:0 auto;display:grid}.page-module__CrU-Oa__entryBrand{align-items:center;gap:22px;display:flex}.page-module__CrU-Oa__cardMark{color:#fff;background:#c93d32;border:8px solid #fff;border-radius:8px;flex:0 0 112px;place-items:center;width:112px;height:152px;font-size:70px;font-weight:900;display:grid;box-shadow:0 22px 60px #24362d29}.page-module__CrU-Oa__entryBrand h1{color:var(--text,#17211b);margin:0;font-size:clamp(42px,8vw,92px);line-height:.95}.page-module__CrU-Oa__entryBrand p{max-width:520px;color:var(--muted,#667168);margin:18px 0 0;font-size:18px;line-height:1.7}.page-module__CrU-Oa__entryPanel,.page-module__CrU-Oa__panel{border:1px solid var(--border,#d7ded3);background:var(--panel,#ffffffdb);border-radius:8px;box-shadow:0 18px 50px #23372b1a}.page-module__CrU-Oa__entryPanel{gap:16px;padding:22px;display:grid}.page-module__CrU-Oa__accountLine,.page-module__CrU-Oa__scoreMeta,.page-module__CrU-Oa__roomBar,.page-module__CrU-Oa__badges,.page-module__CrU-Oa__actions{align-items:center;gap:10px;display:flex}.page-module__CrU-Oa__accountLine{color:var(--muted,#667168);justify-content:space-between;font-size:14px}.page-module__CrU-Oa__accountLine strong{max-width:190px;color:var(--text,#17211b);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.page-module__CrU-Oa__joinForm,.page-module__CrU-Oa__joinForm label{gap:8px;display:grid}.page-module__CrU-Oa__joinForm label,.page-module__CrU-Oa__rangeLine{color:var(--muted,#667168);font-size:14px}.page-module__CrU-Oa__joinForm input{border:1px solid var(--border,#c4cec5);background:var(--panel,#fff);width:100%;min-height:40px;color:var(--text,#17211b);border-radius:8px;padding:0 12px}.page-module__CrU-Oa__status,.page-module__CrU-Oa__error{margin:0;font-size:14px}.page-module__CrU-Oa__error{color:#c73228}.page-module__CrU-Oa__gameGrid{grid-template:"table side"minmax(360px,1fr)"hand side"/minmax(0,1fr) 320px;gap:14px;min-height:calc(100vh - 104px);display:grid}.page-module__CrU-Oa__tablePanel{color:#fff;background:radial-gradient(circle,#ffffff2e,#0000 46%),#247658;border-radius:8px;grid-area:table;grid-template-rows:auto auto 1fr auto;gap:14px;min-height:360px;padding:16px;display:grid}.page-module__CrU-Oa__roomBar{justify-content:space-between}.page-module__CrU-Oa__roomBar div:first-child{gap:2px;display:grid}.page-module__CrU-Oa__roomBar span,.page-module__CrU-Oa__badges span{color:#ffffffc7;font-size:13px}.page-module__CrU-Oa__badges{flex-wrap:wrap;justify-content:flex-end}.page-module__CrU-Oa__dangerBadge{background:#c5312a47;border:1px solid #ffcd4794;border-radius:999px;padding:4px 9px;font-weight:800;color:#ffd66b!important}.page-module__CrU-Oa__seats{grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:10px;display:grid}.page-module__CrU-Oa__player{color:#17211b;background:#ffffffeb;border:1px solid #17211b1f;border-radius:8px;align-items:center;gap:10px;min-width:0;padding:8px;display:flex}.page-module__CrU-Oa__tablePanel .page-module__CrU-Oa__player{color:#fff;background:#ffffff2e}.page-module__CrU-Oa__active{outline:3px solid #f3cf5a}.page-module__CrU-Oa__winner{outline:3px solid #7be39e}.page-module__CrU-Oa__avatar{color:#fff;background:#17211b;border-radius:50%;flex:0 0 40px;place-items:center;width:40px;height:40px;font-size:13px;font-weight:900;display:grid}.page-module__CrU-Oa__player strong,.page-module__CrU-Oa__player span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.page-module__CrU-Oa__player span{opacity:.76;max-width:190px;font-size:12px}.page-module__CrU-Oa__centerTable{grid-template-columns:120px minmax(0,1fr) 120px;align-items:center;gap:14px;display:grid}.page-module__CrU-Oa__deckBox,.page-module__CrU-Oa__playedBox{text-align:center;background:#0b221942;border-radius:8px}.page-module__CrU-Oa__deckBox{gap:6px;padding:18px 8px;display:grid}.page-module__CrU-Oa__deckBox span{opacity:.75;font-size:13px}.page-module__CrU-Oa__deckBox strong{font-size:30px}.page-module__CrU-Oa__playedBox{place-items:center;min-height:150px;padding:16px;display:grid}.page-module__CrU-Oa__playedCards{flex-wrap:wrap;justify-content:center;gap:8px;margin-top:10px;display:flex}.page-module__CrU-Oa__notice{text-align:center;background:#0000002e;border-radius:8px;padding:10px 12px;font-weight:800}.page-module__CrU-Oa__sidePanel{grid-area:side;align-content:start;gap:12px;display:grid}.page-module__CrU-Oa__panel{gap:12px;padding:14px;display:grid}.page-module__CrU-Oa__panel h3{color:var(--text,#17211b);margin:0;font-size:15px}.page-module__CrU-Oa__segmented{grid-template-columns:repeat(auto-fit,minmax(68px,1fr));gap:6px;display:grid}.page-module__CrU-Oa__segmented button{border:1px solid var(--border,#c4cec5);background:var(--panel,#fff);min-height:36px;color:var(--text,#17211b);border-radius:8px}.page-module__CrU-Oa__segmented .page-module__CrU-Oa__selected{color:#fff;background:#176b4d;border-color:#176b4d;font-weight:800}.page-module__CrU-Oa__rangeLine{grid-template-columns:auto minmax(0,1fr) 24px;align-items:center;gap:8px;display:grid}.page-module__CrU-Oa__scoreMeta{color:var(--muted,#667168);justify-content:space-between;font-size:13px}.page-module__CrU-Oa__scoreRow{border-top:1px solid var(--border,#e3e8df);color:var(--text,#17211b);justify-content:space-between;padding-top:8px;display:flex}.page-module__CrU-Oa__logPanel{max-height:280px;overflow:auto}.page-module__CrU-Oa__logPanel p{color:var(--muted,#667168);margin:0;font-size:13px;line-height:1.5}.page-module__CrU-Oa__handPanel{border:1px solid var(--border,#d7ded3);background:var(--panel,#ffffffe6);border-radius:8px;grid-area:hand;gap:12px;padding:12px;display:grid}.page-module__CrU-Oa__hand{gap:8px;min-height:118px;padding:4px 2px 10px;display:flex;overflow-x:auto}.page-module__CrU-Oa__cardButton{background:0 0;border:0;border-radius:8px;flex:none;min-height:auto;padding:0;transition:transform .16s}.page-module__CrU-Oa__picked{transform:translateY(-14px)}.page-module__CrU-Oa__card{color:#17211b;text-align:left;background:#fff;border:1px solid #dbe1dc;border-radius:8px;grid-template-rows:auto 1fr;width:62px;height:92px;padding:7px;display:grid;box-shadow:0 8px 18px #0e16111f}.page-module__CrU-Oa__card span{font-size:15px;font-weight:900}.page-module__CrU-Oa__card i{place-self:end;font-size:22px;font-style:normal;font-weight:900}.page-module__CrU-Oa__red{color:#c93d32}.page-module__CrU-Oa__black{color:#17211b}.page-module__CrU-Oa__small{width:46px;height:66px;padding:5px}.page-module__CrU-Oa__small span{font-size:12px}.page-module__CrU-Oa__small i{font-size:15px}.page-module__CrU-Oa__actions{flex-wrap:wrap}.page-module__CrU-Oa__preview{border:1px solid var(--border,#d7ded3);background:var(--bg,#f6f7f3);min-height:46px;color:var(--muted,#667168);border-radius:8px;flex:260px;padding:7px 10px;display:grid}.page-module__CrU-Oa__preview strong{color:var(--text,#17211b);font-size:14px}.page-module__CrU-Oa__preview span{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.page-module__CrU-Oa__valid{border-color:#176b4d70}@media (max-width:980px){.page-module__CrU-Oa__entry{grid-template-columns:1fr;align-content:center}.page-module__CrU-Oa__gameGrid{grid-template-columns:1fr;grid-template-areas:"table""hand""side"}}@media (max-width:640px){.page-module__CrU-Oa__page{padding:10px}.page-module__CrU-Oa__entryBrand{flex-direction:column;align-items:flex-start}.page-module__CrU-Oa__cardMark{border-width:6px;flex-basis:100px;width:74px;height:100px;font-size:46px}.page-module__CrU-Oa__centerTable{grid-template-columns:1fr}.page-module__CrU-Oa__actions>button{flex:110px}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67585,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let s=e.r(32061);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new s.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,n)=>{"use strict";function s(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return s}})},52157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return o}});let s=e.r(18050),a=e.r(74080),r=e.r(63599),i=e.r(9885),l=e.r(43369);function o({moduleIds:e}){if("u">typeof window)return null;let t=r.workAsyncStorage.getStore();if(void 0===t)return null;let n=[];if(t.reactLoadableManifest&&e){let s=t.reactLoadableManifest;for(let t of e){if(!s[t])continue;let e=s[t].files;n.push(...e)}}if(0===n.length)return null;let c=(0,l.getAssetTokenQuery)();return(0,s.jsx)(s.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,s.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return c}});let s=e.r(18050),a=e.r(71645),r=e.r(67585),i=e.r(52157);function l(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},c=function(e){let t={...o,...e},n=(0,a.lazy)(()=>t.loader().then(l)),c=t.loading;function d(e){let l=c?(0,s.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,d=o?a.Suspense:a.Fragment,u=t.ssr?(0,s.jsxs)(s.Fragment,{children:["u"<typeof window?(0,s.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,s.jsx)(n,{...e})]}):(0,s.jsx)(r.BailoutToCSR,{reason:"next/dynamic",children:(0,s.jsx)(n,{...e})});return(0,s.jsx)(d,{...o?{fallback:l}:{},children:u})}return d.displayName="LoadableComponent",d}},70703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});let s=e.r(55682)._(e.r(69093));function a(e,t){let n={};"function"==typeof e&&(n.loader=e);let a={...n,...t};return(0,s.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},58559,e=>{"use strict";var t=e.i(18050),n=e.i(71645),s=e.i(70703),a=e.i(18566),r=e.i(16327),i=e.i(67927),l=e.i(56420);let o=(0,l.default)("pencil-ruler",[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);var c=e.i(72382),d=e.i(26091),u=e.i(26067);let h=(0,l.default)("move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);var p=e.i(6537),m=e.i(96699),f=e.i(10566),x=e.i(77071),j=e.i(56522),b=e.i(66595),y=e.i(35965),g=e.i(73474),N=e.i(63676),v=e.i(59665),w=e.i(39626);e.i(4121);var S=e.i(88361),k=e.i(47910),C=e.i(57667),P=e.i(3593),z=e.i(71192),M=e.i(128),$=e.i(77816),E=e.i(3789),T=e.i(53138),A=e.i(51757),R=e.i(31214),O=e.i(62368);let L=(0,l.default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var U=e.i(25981);function _({sync:e}){let s=(0,n.useRef)(null),[a,r]=(0,n.useState)(!1),i=(0,z.useUserStore)(e=>e.wallet),l=null!==e.action;async function o(e){r(!1),await e()}return(0,n.useEffect)(()=>{if(a)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){s.current?.contains(e.target)||r(!1)}},[a]),(0,t.jsxs)("div",{className:"note-more",ref:s,children:[(0,t.jsx)("button",{className:"btn btn-icon note-more-trigger",onClick:()=>r(e=>!e),title:"更多","aria-label":"更多",children:(0,t.jsx)(L,{size:16})}),a&&(0,t.jsxs)("div",{className:"note-more-menu",children:[(0,t.jsxs)("div",{className:`note-sync-status ${e.hasConflict?"conflict":""}`,children:[(0,t.jsx)("span",{className:"note-sync-status-icon",children:e.hasConflict?(0,t.jsx)(T.AlertTriangle,{size:16}):"synced"===e.status?(0,t.jsx)(A.CheckCircle2,{size:16}):(0,t.jsx)(R.Cloud,{size:16})}),(0,t.jsxs)("span",{children:[(0,t.jsx)("strong",{children:"云同步"}),(0,t.jsx)("small",{children:e.statusLabel})]})]}),(0,t.jsxs)("button",{className:"note-more-item",onClick:()=>o(e.exportLocalBackup),disabled:!i||l,children:[(0,t.jsx)(U.Upload,{size:16}),"本地导出"]}),(0,t.jsxs)("button",{className:"note-more-item",onClick:()=>o(e.importLocalBackup),disabled:!i||l,children:[(0,t.jsx)(O.Download,{size:16}),"本地导入"]})]})]})}var D=e.i(11241),F=e.i(27648);function B({children:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>{window.location.href="/"},children:[(0,t.jsx)(D.ArrowLeft,{size:18}),(0,t.jsx)("h1",{children:"MOST PEOPLE"})]}),e,(0,t.jsx)(F.default,{})]})}let W="https://api.most.box/auth/backup";async function I(e,t){let n=await e.clone().json().catch(()=>null);return n?.error||t}function G(e,t){return(0,M.mostEncode)(JSON.stringify({notes:e||[]}),t)}function J(e,t){if(!String(e||"").startsWith("mp://1"))throw Error("无效的备份数据格式");let n=(0,M.mostDecode)(e,t);if(!n)throw Error("解密失败,请确认当前 Web3 登录账号正确");let s=JSON.parse(n);if(!Array.isArray(s.notes))throw Error("备份数据缺少 notes");return s}async function K(e){return(0,E.calculateNoteCid)(JSON.stringify({notes:e||[]}))}async function X(e,t,n=W){let s=Date.now().toString(),a=new URL(n).pathname,r=`${s}:${String(t).toUpperCase()}:${a}`,{address:i,signature:l}=await (0,M.mostSignMessage)(e.danger,r);return{Authorization:`${i},${s},${l}`}}async function V(e,t){let n=JSON.stringify({notes:t||[]}),s=await (0,E.calculateNoteCid)(n);return{cid:s,body:G(t,e.danger),headers:{"Content-Type":"text/plain","x-backup-cid":s,...await X(e,"PUT",W)}}}async function q(e,t,n=W){let s=await V(e,t),a=await fetch(n,{method:"PUT",headers:s.headers,body:s.body});if(!a.ok)throw Error(await I(a,"云备份失败"));return{cid:s.cid}}async function Q(e,t=W){let n=await fetch(t,{method:"GET",headers:await X(e,"GET",t)});if(404===n.status)return{found:!1,cid:"",time:0,notes:[]};if(!n.ok)throw Error(await I(n,"云端恢复失败"));let s=await n.text();if(!s)throw Error("云端无备份数据");let a=J(s,e.danger);return{found:!0,cid:n.headers.get("x-backup-cid")||"",time:Number(n.headers.get("x-backup-time")||0),notes:a.notes}}let H=!1,Y="",Z="";function ee(e,t){return e instanceof Error?e.message:t}let et=(0,s.default)(()=>e.A(71504).then(e=>e.MilkdownEditor),{loadableGenerated:{modules:[36975]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"note-editor-loading",children:"加载编辑器..."})});function en(e,t){return e instanceof Error?e.message:t}function es(e){return"directory"===e.type?(0,E.normalizeNotePath)(e.path?`${e.path}/${e.name}`:e.name):(0,E.getNoteFullPath)(e)}function ea(){let e=(0,a.useRouter)(),s=(0,a.useSearchParams)(),r=(0,n.useRef)(null),i=function(){let e=(0,z.useUserStore)(e=>e.wallet),t=(0,z.useUserStore)(e=>e.openLoginModal),s=(0,P.useAppStore)(e=>e.addToast),a=(0,P.useAppStore)(e=>e.notes),r=(0,P.useAppStore)(e=>e.importNotes),i=(0,P.useAppStore)(e=>e.localDataReady),[l,o]=(0,n.useState)(null),[c,d]=(0,n.useState)(e?"idle":"disabled"),[u,h]=(0,n.useState)(H),[p,m]=(0,n.useState)(!1),f=(0,n.useRef)(0),x=(0,n.useCallback)(e=>{H=e,h(e)},[]),j=(0,n.useCallback)((e=!1)=>{let n=z.useUserStore.getState().wallet;return n||(e||t(),null)},[s,t]),b=(0,n.useCallback)(async(e={})=>{let{silent:t=!1,confirmConflict:n=!0}=e,a=j(t);if(!a)return d("disabled"),!1;if(H&&n&&!window.confirm("本地数据与云端不一致,本地修改将会覆盖云端数据,是否继续?"))return t||s("已取消同步","info"),d("conflict"),!1;o("save"),d("uploading");try{let e=P.useAppStore.getState().notes;return Y=(await q(a,e)).cid,Z=a.address,x(!1),d("synced"),t||s("云端备份已更新","success"),!0}catch(e){return d("error"),t?console.info(ee(e,"云备份失败")):s(ee(e,"云备份失败"),"error"),!1}finally{o(null)}},[s,j,x]),y=(0,n.useCallback)(async(e={})=>{let{manual:t=!1,uploadWhenMissing:n=!1}=e,a=j(!t);if(!a)return d("disabled"),!1;o(t?"restore":"sync"),d(t?"restoring":"checking");try{let e=await Q(a),i=P.useAppStore.getState().notes;if(!e.found){if(x(!1),Z=a.address,n&&i.length>0)return o(null),b({silent:!0,confirmConflict:!1});return d(i.length>0?"idle":"synced"),t&&s("云端暂无备份","info"),!1}let l=e.notes||[],c=await K(i),u=e.cid||await K(l);if(i.length>0&&c!==u&&!window.confirm("云端备份与本地笔记不一致。恢复会覆盖本地笔记,是否继续?"))return x(!0),d("conflict"),t&&s("已取消恢复","info"),!1;return c!==u&&r(l),Y=u,Z=a.address,x(!1),d("synced"),t&&s("已从云端恢复","success"),!0}catch(e){return d("error"),t?s(ee(e,"云端恢复失败"),"error"):console.info(ee(e,"云端恢复失败")),!1}finally{o(null)}},[s,r,j,x,b]),g=(0,n.useCallback)(()=>{let e=j(!1);if(e)try{let t=P.useAppStore.getState().notes,n=G(t,e.danger),a=new Blob([n],{type:"text/plain"}),r=URL.createObjectURL(a),i=document.createElement("a");i.href=r,i.download=`${e.address.slice(-4)}-most-notes-${new Date().toISOString().slice(0,10)}.txt`,i.click(),URL.revokeObjectURL(r),s("笔记已导出到本地","success")}catch(e){s(ee(e,"导出失败"),"error")}},[s,j]),N=(0,n.useCallback)(()=>{let e=j(!1);if(!e)return;let t=document.createElement("input");t.type="file",t.accept=".txt",t.onchange=t=>{let n=t.target.files?.[0];if(!n)return;let a=new FileReader;a.onload=async()=>{try{let t=a.result,n=J(t,e.danger);if(P.useAppStore.getState().notes.length>0&&!window.confirm("恢复将覆盖当前本地笔记,是否继续?"))return void s("已取消恢复","info");r(n.notes),s("已从本地恢复笔记","success"),await b({silent:!0})}catch(e){s(ee(e,"导入失败"),"error")}},a.readAsText(n)},t.click()},[s,r,j,b]);(0,n.useEffect)(()=>{if(!i)return;if(!e){Z="",Y="",m(!1),x(!1),d("disabled");return}if(Z===e.address){m(!0),d(H?"conflict":"synced");return}let t=!1;return m(!1),y({manual:!1,uploadWhenMissing:!0}).finally(()=>{t||m(!0)}),()=>{t=!0}},[i,y,x,e]),(0,n.useEffect)(()=>{if(!e||!i||!p||(f.current+=1,f.current<=1))return;let t=window.setTimeout(async()=>{let e=P.useAppStore.getState().notes;await K(e)!==Y&&await b({silent:!0})},900);return()=>window.clearTimeout(t)},[p,i,a,b,e]);let v=(0,n.useMemo)(()=>(function(e){switch(e){case"disabled":return"未登录";case"checking":return"检查中";case"uploading":return"同步中";case"restoring":return"恢复中";case"synced":return"已同步";case"conflict":return"有冲突";case"error":return"同步失败";default:return"待同步"}})(c),[c]);return{action:l,status:c,statusLabel:v,hasConflict:u,uploadNow:b,restoreFromCloud:y,exportLocalBackup:g,importLocalBackup:N}}(),l=(0,P.useAppStore)(e=>e.addToast),C=(0,P.useAppStore)(e=>e.isDarkMode),T=(0,P.useAppStore)(e=>e.setIsDarkMode),A=(0,z.useUserStore)(e=>e.wallet),R=(0,z.useUserStore)(e=>e.openLoginModal),O=(0,P.useAppStore)(e=>e.notes),L=(0,P.useAppStore)(e=>e.notesPath),U=(0,P.useAppStore)(e=>e.setNotesPath),D=(0,P.useAppStore)(e=>e.saveNote),F=(0,P.useAppStore)(e=>e.deleteNote),W=(0,P.useAppStore)(e=>e.renameNote),I=(0,P.useAppStore)(e=>e.localDataReady),X=s.get("cid")||"",V=O.find(e=>e.cid===X),ea=!!X,ei=ea&&"edit"===s.get("mode"),[el,eo]=(0,n.useState)(""),[ec,ed]=(0,n.useState)(null),[eu,eh]=(0,n.useState)(null),[ep,em]=(0,n.useState)(null),[ef,ex]=(0,n.useState)(""),[ej,eb]=(0,n.useState)(""),[ey,eg]=(0,n.useState)(""),[eN,ev]=(0,n.useState)(""),[ew,eS]=(0,n.useState)(""),[ek,eC]=(0,n.useState)(""),[eP,ez]=(0,n.useState)(!1),[eM,e$]=(0,n.useState)(""),[eE,eT]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!X){ex(""),eb("");return}if(!V){ex(""),eb(I?"笔记不存在":"");return}if(V.content.startsWith("mp://1")){if(!A){ex(""),eb("请先登录 Web3 账号以解密此笔记");return}let e=(0,M.mostDecode)(V.content,A.danger);if(!e){ex(""),eb("无法解密,请确认当前 Web3 账号正确");return}ex(e),eb("");return}ex(V.content||""),eb("")},[X,I,V,A]),(0,n.useEffect)(()=>{if(!ei)return void eT(!1);if(!X||!V){ev(""),eS(""),eC(""),ez(!1),e$(I?"笔记不存在":"");return}if(ev(V.name),eS(V.path||""),ez(!0===V.isSecret||V.content.startsWith("mp://1")),V.content.startsWith("mp://1")){if(!A){eC(""),e$("请先登录 Web3 账号以解密此笔记");return}let e=(0,M.mostDecode)(V.content,A.danger);if(!e){eC(""),e$("无法解密,请确认当前 Web3 账号正确");return}eC(e),e$("");return}eC(V.content||""),e$("")},[X,ei,I,V,A]),(0,n.useEffect)(()=>{eg(V?.name||"")},[V?.cid,V?.name]);let eA=(0,n.useMemo)(()=>(0,E.filterNotesByPath)(O,L,el),[O,L,el]),eR=eA.filter(e=>"file"===e.type).length,eO=V?.isSecret===!0||V?.content.startsWith("mp://1")===!0,eL=(0,n.useMemo)(()=>{let e=L.split("/").filter(Boolean);return[{label:"全部笔记",path:""},...e.map((t,n)=>({label:t,path:e.slice(0,n+1).join("/")}))]},[L]),eU=(0,n.useMemo)(()=>(function(e){let t=new Set;for(let n of e){let e=(0,E.normalizeNotePath)(n.path).split("/").filter(Boolean);for(let n=0;n<e.length;n+=1)t.add(e.slice(0,n+1).join("/"))}return Array.from(t).sort((e,t)=>e.localeCompare(t,"zh-CN")).map(e=>{let t=e.split("/");return{path:e,name:t[t.length-1]||e,parentPath:t.slice(0,-1).join("/"),depth:Math.max(t.length-1,0)}})})(O),[O]);function e_(){return!!A||(R(),!1)}async function eD(){if(e_()){if(!V)return void l("笔记不存在","error");if(!eN.trim())return void l("请输入笔记名称","warning");eT(!0);try{let t=r.current?.getMarkdown()??ek,n=eP?(0,M.mostEncode)(t,A.danger):t,s=await D({cid:V.cid,name:eN,path:ew,content:n,isSecret:eP});eC(t),l("笔记已保存","success"),await i.uploadNow({silent:!0}),e.replace(`/note/?cid=${encodeURIComponent(s)}`)}catch(e){l(en(e,"保存失败"),"error")}finally{eT(!1)}}}async function eF(){if(!e_()||!V)return;let e=ey.trim();if(!e){eg(V.name),l("请输入笔记名称","warning");return}if(e!==V.name)try{W((0,E.getNoteFullPath)(V),V.path,e),l("已重命名","success"),await i.uploadNow({silent:!0})}catch(e){eg(V.name),l(en(e,"重命名失败"),"error")}}async function eB(e){if(ep)try{W(es(ep),e,ep.name),em(null),l("已移动","success"),await i.uploadNow({silent:!0})}catch(e){l(en(e,"移动失败"),"error")}}let eW=(0,t.jsxs)("div",{className:"note-header-title",children:[(0,t.jsx)("h2",{className:"header-title",children:"笔记"}),(0,t.jsxs)("span",{children:[O.length," 篇"]})]}),eI=(0,t.jsxs)("div",{className:"note-theme-wrap",children:[(0,t.jsx)("button",{className:"btn btn-icon",onClick:()=>T(!C),title:"切换主题","aria-label":"切换主题",children:C?(0,t.jsx)(y.Sun,{size:16}):(0,t.jsx)(m.Moon,{size:16})}),(0,t.jsx)(_,{sync:i})]}),eG=(0,t.jsxs)("section",{className:"note-list-panel note-sidebar-list","aria-label":"笔记列表",children:[(0,t.jsxs)("div",{className:"note-list-header",children:[(0,t.jsx)("div",{className:"note-current-location",children:(0,t.jsx)("div",{className:"note-breadcrumbs",children:eL.map((e,s)=>(0,t.jsxs)(n.default.Fragment,{children:[s>0&&(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("button",{onClick:()=>U(e.path),children:e.label})]},e.path||"root"))})}),(0,t.jsxs)("span",{className:"note-count",children:[eR," 篇"]})]}),(0,t.jsxs)("div",{className:"note-search",children:[(0,t.jsx)(b.Search,{size:16}),(0,t.jsx)("input",{className:"input input-flex",value:el,onChange:e=>eo(e.target.value),placeholder:"搜索笔记"})]}),0===eA.length?(0,t.jsxs)("div",{className:"note-empty-state",children:[(0,t.jsx)(f.NotebookPen,{size:32}),(0,t.jsx)("p",{children:el?"未找到笔记":"还没有笔记"})]}):(0,t.jsx)("div",{className:"note-list",children:eA.map(n=>(0,t.jsx)("article",{className:`note-list-item ${"file"===n.type&&n.cid===X?"active":""}`,children:(0,t.jsxs)("button",{className:`note-list-item-main ${"directory"===n.type?"folder":""}`,onClick:()=>{if("directory"===n.type)U((0,E.normalizeNotePath)(n.path?`${n.path}/${n.name}`:n.name));else e.push(`/note/?cid=${encodeURIComponent(n.cid)}`)},children:[(0,t.jsx)("span",{className:"note-list-icon",children:"directory"===n.type?(0,t.jsx)(u.Folder,{size:18}):n.isSecret?(0,t.jsx)(p.Lock,{size:18}):(0,t.jsx)(d.FileText,{size:18})}),(0,t.jsxs)("span",{className:"note-list-copy",children:[(0,t.jsx)("span",{className:"note-list-name",children:n.name}),"file"===n.type?(0,t.jsx)("span",{className:"note-list-preview",children:n.isSecret||n.content.startsWith("mp://1")?"私密内容已加密":String(n.content||"").replace(/```[\s\S]*?```/g," ").replace(/!\[[^\]]*]\([^)]*\)/g," ").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/[#>*_`~|-]/g," ").replace(/\s+/g," ").trim()||"空白笔记"}):(0,t.jsx)("span",{className:"note-list-preview",children:"文件夹"})]}),"file"===n.type&&(0,t.jsx)("span",{className:"note-list-date",children:(0,$.formatDate)(n.updated_at)})]})},`${n.cid}:${n.path}:${n.name}`))}),(0,t.jsx)("div",{className:"note-create-btn",children:(0,t.jsxs)("button",{className:"btn",onClick:function(){e_()&&ed({title:"新建笔记",placeholder:"笔记名称",confirmText:"创建",onConfirm:async t=>{if(e_())try{let n=await D({name:t,path:L,content:"",isSecret:!1});ed(null),l("笔记已创建","success"),await i.uploadNow({silent:!0}),e.push(`/note/?cid=${encodeURIComponent(n)}&mode=edit`)}catch(e){l(en(e,"创建失败"),"error")}}})},children:[(0,t.jsx)(x.Plus,{size:16}),"新笔记"]})})]});return(0,t.jsxs)(v.default,{sidebar:()=>(0,t.jsx)(B,{children:eG}),headerTitle:eW,headerRight:eI,children:[(0,t.jsx)("main",{className:`note-page note-browser-page ${ea?"has-editor":""}`,children:(0,t.jsx)("section",{className:"note-workspace",children:(0,t.jsx)("section",{className:"note-editor-panel","aria-label":ei?"笔记编辑器":"笔记阅读器",children:ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"note-editor-panel-header",children:[(0,t.jsxs)("div",{className:"note-editor-title-area",children:[ei?(0,t.jsx)("input",{className:"note-title-input",value:eN,onChange:e=>ev(e.target.value),placeholder:"笔记名称",disabled:!V}):V?(0,t.jsx)("input",{className:"note-title-input",value:ey,onBlur:eF,onChange:e=>eg(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(eg(V.name),e.currentTarget.blur())},placeholder:"笔记名称",title:"重命名"}):(0,t.jsx)("h3",{children:"未命名笔记"}),V&&(0,t.jsxs)("div",{className:"note-editor-info",children:[(0,t.jsx)("span",{children:ei?"编辑模式":"阅读模式"}),(0,t.jsx)("span",{children:ei?eP?"私密":"公开":eO?"私密":"公开"}),(0,t.jsx)("span",{children:(0,$.formatDate)(V.updated_at)})]})]}),(0,t.jsxs)("div",{className:"note-editor-actions",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-icon",onClick:ei?function(){e.push(V?`/note/?cid=${encodeURIComponent(V.cid)}`:"/note/")}:()=>e.push("/note/"),title:ei?"取消":"关闭","aria-label":ei?"取消":"关闭",children:(0,t.jsx)(N.X,{size:16})}),ei?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{className:`btn btn-sm ${eP?"btn-warning":"btn-secondary"}`,onClick:()=>ez(!eP),disabled:!V,children:[eP?(0,t.jsx)(p.Lock,{size:16}):(0,t.jsx)(c.Eye,{size:16}),eP?"私密":"公开"]}),(0,t.jsxs)("button",{className:"btn btn-sm btn-primary",onClick:eD,disabled:eE||!!eM||!V,children:[(0,t.jsx)(j.Save,{size:16}),eE?"保存中":"保存"]})]}):V&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"btn btn-icon",onClick:()=>{e_()&&em(V)},title:"移动","aria-label":"移动",children:(0,t.jsx)(h,{size:16})}),(0,t.jsx)("button",{type:"button",className:"btn btn-icon note-editor-action-danger",onClick:()=>(function(t){if(!e_())return;let n="directory"===t.type;eh({title:n?"删除文件夹":"删除笔记",message:`确定要删除「${t.name}」吗?此操作不可撤销。`,confirmText:"删除",onConfirm:async()=>{F(n?void 0:t.cid,t.path,t.name),eh(null),l("已删除","success"),await i.uploadNow({silent:!0}),"file"===t.type&&t.cid===X&&e.push("/note/")}})})(V),title:"删除","aria-label":"删除",children:(0,t.jsx)(g.Trash2,{size:16})}),(0,t.jsxs)("button",{type:"button",className:"btn btn-sm btn-primary",onClick:()=>{e.push(`/note/?cid=${encodeURIComponent(V.cid)}&mode=edit`)},disabled:!!ej,title:"编辑","aria-label":"编辑",children:[(0,t.jsx)(o,{size:16}),"编辑"]})]})]})]}),ei?eM?(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(p.Lock,{size:36}),(0,t.jsx)("p",{children:eM})]}):V?(0,t.jsx)("div",{className:"note-editor-frame editing",children:(0,t.jsx)(et,{ref:r,content:ek,onChange:eC,className:"milkdown-editor"})}):(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(f.NotebookPen,{size:36}),(0,t.jsx)("p",{children:I?"笔记不存在":"加载中..."})]}):ej?(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(p.Lock,{size:36}),(0,t.jsx)("p",{children:ej})]}):V?(0,t.jsx)("div",{className:"note-editor-frame reading",children:(0,t.jsx)(et,{content:ef,readOnly:!0,className:"milkdown-editor"})}):(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(f.NotebookPen,{size:36}),(0,t.jsx)("p",{children:I?"笔记不存在":"加载中..."})]})]}):(0,t.jsxs)("div",{className:"note-editor-empty",children:[(0,t.jsx)("div",{className:"note-editor-empty-icon",children:(0,t.jsx)(f.NotebookPen,{size:32})}),(0,t.jsx)("h3",{children:"没有打开的笔记"}),(0,t.jsx)("p",{children:O.length>0?"选择一篇笔记继续":"创建第一篇笔记"}),(0,t.jsx)(w.default,{label:"打开笔记列表",variant:"default"})]})})})}),ec&&(0,t.jsx)(k.InputModal,{title:ec.title,placeholder:ec.placeholder,defaultValue:ec.defaultValue,confirmText:ec.confirmText,onConfirm:ec.onConfirm,onClose:()=>ed(null)}),eu&&(0,t.jsx)(S.ConfirmModal,{title:eu.title,message:eu.message,confirmText:eu.confirmText,danger:!0,onConfirm:eu.onConfirm,onClose:()=>eh(null)}),ep&&(0,t.jsx)(er,{target:ep,directories:eU,onMove:eB,onClose:()=>em(null)})]})}function er({target:e,directories:s,onMove:a,onClose:l}){let o=(0,E.normalizeNotePath)(e.path||""),c=es(e),d=s.filter(t=>"directory"!==e.type||t.path!==c&&!t.path.startsWith(`${c}/`)),[h,p]=(0,n.useState)(o),[m,f]=(0,n.useState)(""),[x,j]=(0,n.useState)(new Set),b=(0,E.normalizeNotePath)(m),y=m.trim()?b:h,g=(0,E.normalizeNotePath)(y)===o,v=new Map;for(let e of d){let t=v.get(e.parentPath)||[];t.push(e),v.set(e.parentPath,t)}let w=d.filter(e=>{if(!e.parentPath)return!0;let t=e.parentPath.split("/").filter(Boolean);return t.every((e,n)=>x.has(t.slice(0,n+1).join("/")))}),S=[{label:"全部笔记",path:""},...h.split("/").filter(Boolean).map((e,t,n)=>({label:e,path:n.slice(0,t+1).join("/")}))];function k(e){p((0,E.normalizeNotePath)(e)),f("")}return(0,t.jsx)(C.ModalOverlay,{onClose:l,children:(0,t.jsxs)("div",{className:"note-move-modal",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"modal-header",children:[(0,t.jsx)("h3",{children:"移动笔记"}),(0,t.jsx)("button",{className:"btn btn-icon",onClick:l,children:(0,t.jsx)(N.X,{size:18})})]}),(0,t.jsxs)("div",{className:"note-move-target",children:[(0,t.jsx)("span",{children:"正在移动"}),(0,t.jsx)("strong",{children:e.name})]}),(0,t.jsx)("div",{className:"note-move-path",children:S.map((e,s)=>(0,t.jsxs)(n.default.Fragment,{children:[s>0&&(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("button",{type:"button",onClick:()=>k(e.path),children:e.label})]},e.path||"root"))}),(0,t.jsxs)("div",{className:"note-move-folder-list",children:[(0,t.jsxs)("button",{type:"button",className:`note-move-folder-item ${""===h?"selected":""}`,onClick:()=>k(""),children:[(0,t.jsx)("span",{className:"note-move-folder-spacer"}),(0,t.jsx)(u.Folder,{className:"note-move-folder-icon",size:16}),(0,t.jsx)("span",{children:"全部笔记"})]}),0===d.length?(0,t.jsx)("p",{className:"note-move-empty",children:"还没有可选文件夹"}):w.map(e=>{let n=v.has(e.path),s=x.has(e.path);return(0,t.jsxs)("button",{type:"button",className:`note-move-folder-item note-move-depth-${Math.min(e.depth,4)} ${h===e.path?"selected":""}`,onClick:()=>{var t;k(t=e.path),v.has(t)&&j(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},children:[n?s?(0,t.jsx)(r.ChevronDown,{className:"note-move-expander",size:14}):(0,t.jsx)(i.ChevronRight,{className:"note-move-expander",size:14}):(0,t.jsx)("span",{className:"note-move-folder-spacer"}),(0,t.jsx)(u.Folder,{className:"note-move-folder-icon",size:16}),(0,t.jsx)("span",{children:e.name}),e.parentPath&&(0,t.jsx)("small",{children:e.parentPath})]},e.path)})]}),(0,t.jsx)("input",{className:"input input-compact",value:m,onChange:e=>f(e.target.value),placeholder:"或输入新目录路径,如 文章/摘录"}),(0,t.jsxs)("div",{className:"note-move-destination",children:["目标位置:",y||"全部笔记"]}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"btn btn-secondary",onClick:l,children:"取消"}),(0,t.jsx)("button",{className:"btn btn-primary",onClick:function(){g||a(y)},disabled:g,children:"移动"})]})]})})}e.s(["default",0,function(){return(0,t.jsx)(n.Suspense,{fallback:(0,t.jsx)("div",{className:"note-editor-loading",children:"加载中..."}),children:(0,t.jsx)(ea,{})})}],58559)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68590,e=>{"use strict";let a=(0,e.i(56420).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,a],68590)},30274,e=>{"use strict";let a=(0,e.i(56420).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,a],30274)},35965,e=>{"use strict";let a=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,a],35965)},96699,e=>{"use strict";let a=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,a],96699)},11241,e=>{"use strict";let a=(0,e.i(56420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,a],11241)},59665,e=>{"use strict";var a=e.i(18050),t=e.i(71645),s=e.i(67228);let i=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);e.i(22183);var n=e.i(5142);let l=(0,t.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:r,headerRight:c,children:d}){let[o,h]=(0,n.useDisclosure)(!1),[u,m]=(0,t.useState)(!1),p=(0,s.useMediaQuery)("(max-width: 768px)"),f=()=>{p?h.open():m(!1)};return(0,a.jsx)(l.Provider,{value:{closeSidebar:h.close,openSidebar:f,isSidebarVisible:p?o:!u},children:(0,a.jsxs)("div",{className:"app-layout",children:[(0,a.jsx)("div",{className:`sidebar-overlay ${o?"visible":""}`,onClick:()=>h.close()}),(0,a.jsx)("div",{className:`sidebar ${o?"open":""} ${u?"collapsed":""}`,children:e({closeSidebar:h.close,openSidebar:f})}),(0,a.jsxs)("div",{className:"main-content",children:[(0,a.jsxs)("header",{className:"app-header",children:[(0,a.jsxs)("div",{className:"header-left",children:[(0,a.jsx)("button",{onClick:()=>{p?h.toggle():m(!u)},className:"btn btn-icon sidebar-toggle-btn","aria-label":p?"打开菜单":u?"展开侧边栏":"收起侧边栏",children:(0,a.jsx)(i,{size:16})}),r]}),(0,a.jsx)("div",{className:"header-right",children:c})]}),d]})]})})},"useAppShell",0,function(){let e=(0,t.useContext)(l);if(!e)throw Error("useAppShell must be used within AppShell");return e}],59665)},27648,e=>{"use strict";var a=e.i(18050),t=e.i(93957),s=e.i(71192);e.s(["default",0,function({className:e=""}){let i=(0,s.useUserStore)(e=>e.identity),n=(0,s.useUserStore)(e=>e.openLoginModal),l=(0,s.useUserStore)(e=>e.logoutUser);return(0,a.jsxs)("div",{className:`chat-sidebar-footer sidebar-account ${e}`,children:[(0,a.jsxs)("div",{className:"user-info",children:[(0,a.jsx)("img",{className:"user-avatar-img",src:(0,t.generateAvatar)(i?.address),alt:"avatar"}),(0,a.jsx)("span",{className:"user-name",title:i?.address,children:i?.displayName||"未登录"})]}),i?(0,a.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:l,children:"退出"}):(0,a.jsx)("button",{className:"btn btn-primary login-btn",onClick:n,children:"登录"})]})}])},26091,e=>{"use strict";let a=(0,e.i(56420).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,a],26091)},39626,e=>{"use strict";var a=e.i(18050);let t=(0,e.i(56420).default)("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);var s=e.i(59665);e.s(["default",0,function({label:e="打开侧边栏",className:i="",variant:n="primary"}){let{isSidebarVisible:l,openSidebar:r}=(0,s.useAppShell)();return l?null:(0,a.jsxs)("button",{type:"button",className:`btn ${"primary"===n?"btn-primary":""} sidebar-open-hint ${i}`.trim(),onClick:r,children:[(0,a.jsx)(t,{size:16}),e]})}],39626)},77071,e=>{"use strict";let a=(0,e.i(56420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,a],77071)},51921,e=>{"use strict";let a=(0,e.i(56420).default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",0,a],51921)},79490,e=>{"use strict";let a=(0,e.i(56420).default)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);e.s(["Edit2",0,a],79490)},15170,80796,e=>{"use strict";var a=e.i(56420);let t=(0,a.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["Image",0,t],15170);let s=(0,a.default)("film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);e.s(["Film",0,s],80796)},12796,11028,6933,e=>{"use strict";let a=(0,e.i(56420).default)("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);e.s(["Loader",0,a],12796);var t=e.i(18050),s=e.i(71645),i=e.i(26091),n=e.i(51921),l=e.i(63676),r=e.i(26913);e.s(["default",0,function({item:e,isBackendReady:c,getFileDownloadUrl:d,onClose:o}){let[h,u]=(0,s.useState)(""),[m,p]=(0,s.useState)(!1),[f,x]=(0,s.useState)(""),[g,j]=(0,s.useState)("");return(0,s.useEffect)(()=>{if("text"!==e.subtype)return;let a=!1;return(u(""),j(""),c)?(p(!0),(async()=>{try{let t=await fetch(d(e.cid),{headers:{...await (0,r.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`),Range:"bytes=0-9999"}});if(!t.ok)throw Error("加载失败");let s=await t.text();a||u(s||"(文件为空)")}catch{a||u("加载失败")}finally{a||p(!1)}})(),()=>{a=!0}):void u("加载失败")},[d,c,e.cid,e.subtype]),(0,s.useEffect)(()=>{var a;if("image"!==(a=e.subtype)&&"video"!==a&&"audio"!==a)return void x("");if(x(""),j(""),!c)return void j("加载失败");let t="",s=!1;return(async()=>{try{let a=await fetch(d(e.cid),{headers:await (0,r.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`)});if(!a.ok)throw Error("加载失败");let i=URL.createObjectURL(await a.blob());t=i,s||x(i)}catch{s||j("加载失败")}})(),()=>{s=!0,t&&URL.revokeObjectURL(t)}},[d,c,e.cid,e.subtype]),(0,t.jsxs)("div",{className:"preview-overlay",onClick:o,children:[(0,t.jsx)("button",{type:"button",className:"preview-close",onClick:o,"aria-label":"关闭预览",children:(0,t.jsx)(l.X,{size:20})}),(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),children:["image"===e.subtype&&(0,t.jsx)("div",{className:"preview-media-wrapper",children:f?(0,t.jsx)("img",{src:f,alt:e.fileName}):g?(0,t.jsxs)("div",{className:"preview-unsupported",children:[(0,t.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,t.jsx)("p",{children:e.fileName}),(0,t.jsx)("p",{className:"preview-unsupported-hint",children:g})]}):(0,t.jsx)("div",{className:"preview-loading",children:(0,t.jsx)("div",{className:"preview-loading-spinner"})})}),"video"===e.subtype&&(0,t.jsx)("div",{className:"preview-media-wrapper",children:f?(0,t.jsx)("video",{src:f,controls:!0}):g?(0,t.jsxs)("div",{className:"preview-unsupported",children:[(0,t.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,t.jsx)("p",{children:e.fileName}),(0,t.jsx)("p",{className:"preview-unsupported-hint",children:g})]}):(0,t.jsx)("div",{className:"preview-loading",children:(0,t.jsx)("div",{className:"preview-loading-spinner"})})}),"audio"===e.subtype&&(0,t.jsxs)("div",{className:"preview-audio",children:[(0,t.jsx)("div",{className:"preview-audio-icon",children:(0,t.jsx)(n.Music,{size:36,color:"var(--accent)"})}),(0,t.jsx)("p",{className:"preview-audio-filename",children:e.fileName}),f?(0,t.jsx)("audio",{className:"preview-audio-player",src:f,controls:!0}):(0,t.jsx)("div",{className:"preview-text-loading",children:g?(0,t.jsx)("p",{children:g}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{size:24,className:"preview-text-spinner"}),(0,t.jsx)("p",{children:"正在加载音频预览..."})]})})]}),"file"===e.subtype&&(0,t.jsxs)("div",{className:"preview-unsupported",children:[(0,t.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,t.jsx)("p",{children:e.fileName}),(0,t.jsx)("p",{className:"preview-unsupported-hint",children:"无法预览"})]}),"text"===e.subtype&&(0,t.jsxs)("div",{className:"preview-text-container",children:[(0,t.jsx)("div",{className:"preview-text-header",children:(0,t.jsx)("span",{children:e.fileName})}),m?(0,t.jsxs)("div",{className:"preview-text-loading",children:[(0,t.jsx)(a,{size:24,className:"preview-text-spinner"}),(0,t.jsx)("p",{children:"正在加载文本预览..."}),(0,t.jsx)("p",{className:"preview-text-loading-hint",children:"如果是初次预览,可能需要等待 P2P 网络同步"})]}):(0,t.jsx)("pre",{className:"preview-text",children:h||"(文件为空)"})]})]})]})}],11028),e.s(["getFileSubtype",0,function(e){let a=String(e||"").split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","heic","heif"].includes(a)?"image":["mp4","webm","mov","avi","mkv","flv","wmv","m4v","mpeg","3gp"].includes(a)?"video":["mp3","wav","ogg","flac","aac","m4a","wma","opus"].includes(a)?"audio":["txt","md","js","ts","jsx","tsx","css","scss","less","json","xml","html","htm","yaml","yml","toml","ini","cfg","conf","log","sh","bash","py","rb","go","rs","java","c","cpp","h","hpp","cs","php","sql","graphql","env","gitignore","dockerfile","readme"].includes(a)?"text":"file"}],6933)},41222,e=>{"use strict";var a=e.i(18050),t=e.i(71645),s=e.i(68590),i=e.i(30274),n=e.i(77071),l=e.i(35965),r=e.i(96699),c=e.i(63676),d=e.i(11241),o=e.i(79490),h=e.i(56420);let u=(0,h.default)("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"}]]),m=(0,h.default)("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"}]]),p=(0,h.default)("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"}]]);var f=e.i(15170),x=e.i(80796),g=e.i(26091),j=e.i(62368),y=e.i(12796),v=e.i(51921);let b=(0,h.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);var k=e.i(59665),w=e.i(11028);e.i(4121);var N=e.i(47910),C=e.i(88361),S=e.i(39626),M=e.i(26913),z=e.i(93957),$=e.i(3593),R=e.i(71192);e.i(22183);var F=e.i(5142),E=e.i(27648),A=e.i(6933);let I=/^[a-zA-Z0-9_-]+$/,U={getChannels:()=>M.api.get("/api/channels").json(),createChannel:(e,a)=>M.api.post("/api/channels",{json:{name:e,type:a}}).json(),leaveChannel:e=>M.api.delete(`/api/channels/${encodeURIComponent(e)}`).json(),getChannelMessages:(e,a=100,t=0)=>M.api.get(`/api/channels/${encodeURIComponent(e)}/messages?limit=${a}&offset=${t}`).json(),sendChannelMessage:(e,a,t,s,i)=>M.api.post(`/api/channels/${encodeURIComponent(e)}/messages`,{json:i?{content:a,author:t,authorName:s,attachment:i}:{content:a,author:t,authorName:s}}).json(),async publishFile(e,a){let t=new FormData;t.append("file",e,a);let s=await M.api.post("/api/publish",{body:t});if(!s.ok)throw Error((await s.json().catch(()=>({error:s.statusText}))).error||"Request failed");return s.json()},listPublishedFiles:()=>M.api.get("/api/files").json(),downloadFile:e=>M.api.post("/api/download",{json:{link:e}}).json(),getFileDownloadUrl:e=>(0,M.getApiUrl)(`/api/files/${e}/download`),getChannelPeers:e=>M.api.get(`/api/channels/${encodeURIComponent(e)}/peers`).json(),setChannelRemark:(e,a)=>M.api.put(`/api/channels/${encodeURIComponent(e)}/remark`,{json:{remark:a}}).json()};function T(e){let a=String(e||"").split("/");return a[a.length-1]||e}e.s(["default",0,function(){let e=(0,$.useAppStore)(e=>e.isDarkMode),h=(0,$.useAppStore)(e=>e.setIsDarkMode),P=(0,$.useAppStore)(e=>e.hasBackend),D=(0,$.useAppStore)(e=>e.addToast),L=(0,$.useAppStore)(e=>e.openConnectModal),q=(0,R.useUserStore)(e=>e.identity),B=(0,R.useUserStore)(e=>e.openLoginModal),[O,W]=(0,t.useState)([]),[H,K]=(0,t.useState)(null),[V,G]=(0,t.useState)([]),[J,X]=(0,t.useState)(""),[_,Q]=(0,F.useDisclosure)(!1),[Z,Y]=(0,t.useState)(""),[ee,ea]=(0,t.useState)(!1),[et,es]=(0,t.useState)(!1),[ei,en]=(0,F.useDisclosure)(!1),[el,er]=(0,t.useState)(null),[ec,ed]=(0,t.useState)(!1),[eo,eh]=(0,t.useState)(""),[eu,em]=(0,t.useState)(null),[ep,ef]=(0,t.useState)(!1),[ex,eg]=(0,t.useState)({}),ej=(0,t.useRef)(null),ey=(0,t.useRef)(null),ev=(0,t.useRef)(null),eb=(0,t.useRef)(null),ek=(0,t.useRef)(0),ew=(0,t.useRef)(!1),eN=(0,t.useRef)(null),eC=(0,t.useRef)(null),eS=(0,t.useRef)(null),eM=(0,t.useRef)(new Map),ez=!0===P;function e$(){return!!ez||(L(),!1)}function eR(){return!!q||(B(),!1)}(0,t.useEffect)(()=>{ev.current=H},[H]),(0,t.useEffect)(()=>{ey.current?.scrollIntoView({behavior:"smooth"})},[V]),(0,t.useEffect)(()=>{ez?M.api.get("/api/node-id").json().then(e=>Y(e.id)).catch(e=>{console.warn("[Chat] Failed to fetch node ID:",e.message),eI(e,"无法读取节点 ID")}):Y("")},[ez]);let eF=(0,t.useRef)(null),eE=(0,t.useRef)(!0);async function eA(e){if(ez)try{let a=await U.getChannelMessages(e);G(e=>{let t=a.filter(a=>{let t=a.id||`${a.author}-${a.timestamp}`;return!e.some(e=>(e.id||`${e.author}-${e.timestamp}`)===t)});return 0===t.length?e:[...e,...t]}),await U.getChannelPeers(e)}catch{}}async function eI(e,a){D(await (0,M.getApiErrorMessage)(e,a),"error")}function eU(e){return e.length<3?"频道名至少 3 个字符":e.length>20?"频道名最多 20 个字符":I.test(e)?"":"频道名只能包含字母、数字、下划线和连字符"}async function eT(){if(ez)try{let e=await U.getChannels();W(e)}catch(e){W([]),await eI(e,"无法读取频道列表")}}function eP(e,a){ej.current&&ej.current.readyState===WebSocket.OPEN&&ej.current.send(JSON.stringify({event:e,data:a}))}function eD(e){if(!Z){eF.current=e;return}eP("channel:subscribe",{channel:e})}function eL(e){eP("channel:unsubscribe",{channel:e})}function eq(e,a=e.fileName){let t=(0,A.getFileSubtype)(a);em({cid:e.cid,fileName:a,subtype:"file"===t?e.kind:t})}function eB(e){eg(a=>{let t={...a};return delete t[e],t})}async function eO(e){!eR()||e$()&&(ev.current&&eL(ev.current.name),K(e),eD(e.name),window.history.pushState({},"",`?channel=${encodeURIComponent(e.name)}`))}async function eW(e,a){if((a&&a.stopPropagation(),eR()&&e$())&&!et){es(!0),eL(e);try{if(await U.leaveChannel(e),H?.name===e){K(null),G([]);let e=new URL(window.location.href);e.searchParams.delete("channel"),window.history.pushState({},"",e.pathname)}eT(),en.close(),er(null)}catch(e){await eI(e,"退出频道失败")}finally{es(!1)}}}async function eH(e){let a=e.trim();if(!a||ee)return;let t=eU(a);if(t)return void D(t,"error");if(eR()&&e$()){ea(!0);try{await U.createChannel(a,"public");let e=O.find(e=>e.name===a)||{name:a,type:"public"};W(t=>t.some(e=>e.name===a)?t:[...t,e]),Q.close(),await eO(e),eT()}catch(e){await eI(e,"加入频道失败")}finally{ea(!1)}}}async function eK(e,a){if(!e.trim()||!H||!eR()||!e$())return!1;let t=e.trim(),s=`${q.address}-${Date.now()}-${Math.random().toString(36).slice(2)}`,i={id:s,author:q.address,authorName:q.displayName,content:t,timestamp:Date.now(),pending:!0,attachment:a};G(e=>[...e,i]);try{let e=await U.sendChannelMessage(H.name,t,q.address,q.displayName,a);return G(a=>a.map(a=>a.id===s?{...e.message,id:e.message.id||e.message.timestamp}:a)),!0}catch(e){return G(e=>e.filter(e=>e.id!==s)),await eI(e,"发送失败"),!1}}async function eV(){if(!J.trim())return;let e=J.trim();X(""),await eK(e)}async function eG(e){if(e&&0!==e.length&&H&&eR()&&e$()&&!ep){ef(!0);try{for(let s of Array.from(e)){var a,t;let e=(a=H.name,t=s.name,`chat-file/${a}/${t}`),i=await U.publishFile(s,e),n=i.fileName||e,l=i.link||`most://${i.cid}?filename=${encodeURIComponent(n)}`,r={kind:s.type.startsWith("image/")?"image":s.type.startsWith("video/")?"video":s.type.startsWith("audio/")?"audio":s.type.startsWith("text/")?"text":(0,A.getFileSubtype)(n),cid:i.cid,fileName:n,link:l,mimeType:s.type||void 0,size:s.size};await eK(l,r)&&D(`${T(n)} 已发布`,"success")}}catch(e){await eI(e,"附件发送失败")}finally{ef(!1)}}}async function eJ(e){if(eR()&&e$()&&!ex[e.cid])try{let a=(await U.listPublishedFiles()).find(a=>a.cid===e.cid);if(a)return void eq({...e,fileName:a.fileName},a.fileName);eg(a=>({...a,[e.cid]:"downloading"}));let t=await U.downloadFile(e.link);if(t.alreadyExists||t.fileName){eB(e.cid),eq({...e,fileName:t.fileName||e.fileName},t.fileName||e.fileName);return}t.taskId&&(eM.current.set(t.taskId,e),D("开始下载附件","success"))}catch(a){eB(e.cid),await eI(a,"附件下载失败")}}async function eX(){if(H&&eR()&&e$())try{let e=await U.setChannelRemark(H.name,eo);W(a=>a.map(a=>a.name===H.name?{...a,remark:e.remark}:a)),K(a=>a?{...a,remark:e.remark}:null)}catch(e){await eI(e,"设置备注失败")}}(0,t.useEffect)(()=>(eE.current=!0,()=>{eE.current=!1}),[]),(0,t.useEffect)(()=>{if(Z&&eF.current){let e=eF.current;eF.current=null,eD(e)}},[Z]),(0,t.useEffect)(()=>{if(ez&&q)return ek.current=0,e(),()=>{eb.current&&clearTimeout(eb.current),ej.current&&ej.current.close()};async function e(){let a=new WebSocket(await (0,M.getAuthenticatedWebSocketUrl)("/ws"));a.onopen=()=>{ew.current=!0,ek.current=0,Z&&1===a.readyState&&a.send(JSON.stringify({event:"register",data:{peerId:Z}})),ev.current&&(eD(ev.current.name),eA(ev.current.name))},a.onmessage=e=>{try{let{event:s,data:i}=JSON.parse(e.data);var a=s,t=i;let n=ev.current;switch(a){case"channel:message":n&&t.channel===n.name&&(G(e=>{let a=t.message.id||`${t.message.author}-${t.message.timestamp}`,s=e.findIndex(e=>e.pending&&e.content===t.message.content&&e.author===t.message.author);if(-1!==s){let i=[...e];return i[s]={...t.message,id:a},i}return e.some(e=>e.id===a||e.timestamp===t.message.timestamp&&e.content===t.message.content&&e.author===t.message.author)?e:[...e,{...t.message,id:a}]}),ez&&U.getChannelPeers(n.name).catch(e=>{console.warn("[Chat] Failed to fetch peers:",e.message)}));break;case"channel:peer:online":case"channel:peer:offline":n&&ez&&U.getChannelPeers(n.name).catch(e=>{console.warn("[Chat] Failed to fetch peers on event:",e.message)});break;case"channel:joined":case"channel:left":eT();break;case"download:success":{let e=eM.current.get(t.taskId);e&&(eM.current.delete(t.taskId),eB(e.cid),D(`${t.fileName||T(e.fileName)} 下载完成`,"success"),eq(e,t.fileName||e.fileName));break}case"download:error":case"download:cancelled":{let e=eM.current.get(t.taskId);e&&(eM.current.delete(t.taskId),eB(e.cid),D("download:cancelled"===a?"附件下载已取消":t.error||"附件下载失败","error"))}}}catch(e){console.warn("[Chat WS] Failed to parse message:",e.message)}},a.onclose=()=>{if(ew.current=!1,!eE.current)return;let a=ek.current;if(a>=20)return;let t=Math.min(3e3*Math.pow(2,a),3e4);ek.current=a+1,eb.current=setTimeout(e,t)},a.onerror=()=>{a.close()},ej.current=a}},[ez,q?.address]),(0,t.useEffect)(()=>{Z&&eP("register",{peerId:Z})},[Z]),(0,t.useEffect)(()=>{ez&&q&&eT()},[P,ez,q?.address]),(0,t.useEffect)(()=>{H&&ez&&(U.getChannelMessages(H.name).then(G).catch(e=>{G([]),eI(e,"无法读取频道消息")}),U.getChannelPeers(H.name).catch(()=>{}))},[H,P,ez]),(0,t.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get("channel");if(e&&O.length>0){let a=O.find(a=>a.name===e);a&&(!H||H.name!==a.name)&&eO(a)}},[O,H]),(0,t.useEffect)(()=>{q||(W([]),K(null),G([]),X(""),Y(""),ed(!1),em(null),eg({}),eM.current.clear())},[q?.address]);let e_=H?(0,a.jsx)("h2",{className:"header-title",children:H.remark||H.name}):(0,a.jsx)("h2",{className:"header-title",children:"聊天"});return(0,a.jsxs)(k.default,{sidebar:({closeSidebar:e})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>window.location.href="/",children:[(0,a.jsx)(d.ArrowLeft,{size:18}),(0,a.jsx)("h1",{children:"MOST PEOPLE"})]}),(0,a.jsx)("nav",{className:"sidebar-nav",children:0===O.length?(0,a.jsx)("div",{className:"sidebar-empty-state",children:(0,a.jsx)("p",{children:"暂无频道"})}):O.map(t=>(0,a.jsxs)("div",{className:`sidebar-nav-btn ${H?.name===t.name?"active":""}`,onClick:()=>{eO(t),e()},role:"button",tabIndex:0,onKeyDown:a=>{"Enter"===a.key&&(eO(t),e())},children:[(0,a.jsx)(s.MessageSquare,{size:16}),(0,a.jsx)("span",{children:t.remark||t.name}),(0,a.jsx)("button",{className:"leave-channel-btn",onClick:e=>{e.stopPropagation(),er(t),en.open()},title:"退出频道",children:(0,a.jsx)(c.X,{size:14})})]},t.name))}),(0,a.jsxs)("button",{className:"create-channel-btn",onClick:()=>{eR()&&e$()&&Q.open()},children:[(0,a.jsx)(n.Plus,{size:16}),"加入频道"]}),(0,a.jsx)(E.default,{})]}),headerTitle:e_,headerRight:(0,a.jsxs)("div",{className:"header-right-actions",children:[(0,a.jsx)("button",{className:"btn btn-icon",onClick:()=>h(!e),title:"切换主题",children:e?(0,a.jsx)(l.Sun,{size:16}):(0,a.jsx)(r.Moon,{size:16})}),H&&(0,a.jsx)("button",{className:"btn btn-icon",onClick:()=>ed(!0),title:"频道设置",children:(0,a.jsx)(p,{size:16})})]}),children:[H?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"chat-messages",children:[0===V.length?(0,a.jsxs)("div",{className:"chat-messages-empty",children:[(0,a.jsx)("div",{className:"empty-icon",children:(0,a.jsx)(s.MessageSquare,{size:28})}),(0,a.jsx)("p",{children:"暂无消息,开始聊天吧!"})]}):V.map(e=>(0,a.jsxs)("div",{className:`chat-message ${e.author===q?.address?"self":"other"} ${e.pending?"pending":""}`,children:[(0,a.jsx)("img",{className:"msg-avatar",src:(0,z.generateAvatar)(e.author),alt:"avatar"}),(0,a.jsxs)("div",{className:"msg-content",children:[(0,a.jsx)("span",{className:"message-author",children:e.authorName||e.author?.slice(0,8)||"Unknown"}),function(e){var t,s;if(!e.attachment)return(0,a.jsx)("div",{className:"message-bubble",children:e.content});let i=e.attachment,n=ex[i.cid],l=((t=i.size)&&!(t<=0)?t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:t<0x40000000?`${(t/1048576).toFixed(1)} MB`:`${(t/0x40000000).toFixed(2)} GB`:"")||"MostBox 文件";return(0,a.jsx)("div",{className:"message-bubble has-attachment",children:(0,a.jsxs)("button",{type:"button",className:"chat-attachment-card",onClick:()=>eJ(i),disabled:!!(e.pending||n),title:i.link,children:[(0,a.jsx)("span",{className:`chat-attachment-icon ${i.kind}`,children:n?(0,a.jsx)(y.Loader,{size:20,className:"chat-attachment-spinner"}):"image"===(s=i.kind)?(0,a.jsx)(f.Image,{size:20}):"video"===s?(0,a.jsx)(x.Film,{size:20}):"audio"===s?(0,a.jsx)(v.Music,{size:20}):(0,a.jsx)(g.FileText,{size:20})}),(0,a.jsxs)("span",{className:"chat-attachment-info",children:[(0,a.jsx)("span",{className:"chat-attachment-name",children:T(i.fileName)}),(0,a.jsx)("span",{className:"chat-attachment-meta",children:e.pending?"发送中...":l})]}),(0,a.jsx)("span",{className:"chat-attachment-action",children:n?"下载中":(0,a.jsx)(j.Download,{size:16})})]})})}(e),(0,a.jsx)("span",{className:"message-time",children:new Date(e.timestamp).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})})]})]},e.id||`${e.author}-${e.timestamp}`)),(0,a.jsx)("div",{ref:ey})]}),(0,a.jsxs)("div",{className:"chat-input-area",children:[(0,a.jsx)("input",{ref:eN,type:"file",accept:"image/*",className:"chat-file-input",onChange:e=>{eG(e.target.files),e.currentTarget.value=""}}),(0,a.jsx)("input",{ref:eC,type:"file",accept:"video/*",className:"chat-file-input",onChange:e=>{eG(e.target.files),e.currentTarget.value=""}}),(0,a.jsx)("input",{ref:eS,type:"file",className:"chat-file-input",onChange:e=>{eG(e.target.files),e.currentTarget.value=""}}),(0,a.jsx)("button",{type:"button",className:"chat-tool-btn",onClick:()=>eN.current?.click(),disabled:!q||ep,title:"发送图片",children:(0,a.jsx)(f.Image,{size:18})}),(0,a.jsx)("button",{type:"button",className:"chat-tool-btn",onClick:()=>eC.current?.click(),disabled:!q||ep,title:"发送视频",children:(0,a.jsx)(x.Film,{size:18})}),(0,a.jsx)("button",{type:"button",className:"chat-tool-btn",onClick:()=>eS.current?.click(),disabled:!q||ep,title:"发送文件",children:ep?(0,a.jsx)(y.Loader,{size:18,className:"chat-attachment-spinner"}):(0,a.jsx)(b,{size:18})}),(0,a.jsx)("input",{type:"text",className:"input input-pill",placeholder:q?"输入消息...":"请先登录后发言",value:J,disabled:!q,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key&&J.trim()&&eV()}}),(0,a.jsx)("button",{className:"send-btn",onClick:eV,disabled:!q||!J.trim(),children:(0,a.jsx)(i.Send,{size:18})})]})]}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"chat-welcome",children:[(0,a.jsx)("div",{className:"welcome-icon",children:(0,a.jsx)(s.MessageSquare,{size:36})}),(0,a.jsx)("h2",{children:"选择频道"}),(0,a.jsx)("p",{children:"从左侧边栏选择一个频道开始聊天,或创建一个新频道"}),(0,a.jsx)(S.default,{label:"打开频道列表"})]})}),_&&(0,a.jsx)(N.InputModal,{title:"加入频道",placeholder:"频道ID:3-20 位字母、数字、_ 或 -",confirmText:"加入",validate:eU,onConfirm:eH,onClose:()=>Q.close(),isLoading:ee,loadingText:"加入中..."}),ei&&el&&(0,a.jsx)(C.ConfirmModal,{title:"退出频道",message:`确定要退出频道 "${el.name}" 吗?`,confirmText:et?"退出中...":"退出",onConfirm:()=>eW(el.name,void 0),onClose:()=>{en.close(),er(null)},danger:!0}),eu&&(0,a.jsx)(w.default,{item:eu,isBackendReady:ez,getFileDownloadUrl:U.getFileDownloadUrl,onClose:()=>em(null)}),ec&&H&&(0,a.jsx)("div",{className:"channel-detail-overlay",onClick:()=>ed(!1),children:(0,a.jsxs)("div",{className:"channel-detail-drawer",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"channel-detail-header",children:[(0,a.jsx)("h3",{children:"频道详情"}),(0,a.jsx)("button",{className:"btn btn-icon",onClick:()=>ed(!1),children:(0,a.jsx)(c.X,{size:18})})]}),(0,a.jsxs)("div",{className:"channel-detail-body",children:[(0,a.jsxs)("div",{className:"channel-detail-section",children:[(0,a.jsxs)("div",{className:"channel-detail-label",children:[(0,a.jsx)(m,{size:14}),(0,a.jsx)("span",{children:"频道 ID"})]}),(0,a.jsx)("div",{className:"channel-detail-value channel-detail-mono",children:H.name})]}),(0,a.jsxs)("div",{className:"channel-detail-section",children:[(0,a.jsxs)("div",{className:"channel-detail-label",children:[(0,a.jsx)(o.Edit2,{size:14}),(0,a.jsx)("span",{children:"备注名称"})]}),(0,a.jsx)("input",{type:"text",className:"input input-compact",placeholder:"输入备注名称",value:eo,onChange:e=>eh(e.target.value),onFocus:()=>eh(H.remark||""),onBlur:()=>eX(),onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur()},maxLength:50})]}),(0,a.jsxs)("div",{className:"channel-detail-section",children:[(0,a.jsxs)("div",{className:"channel-detail-label",children:[(0,a.jsx)(u,{size:14}),(0,a.jsx)("span",{children:"创建时间"})]}),(0,a.jsx)("div",{className:"channel-detail-value",children:H.createdAt?new Date(H.createdAt).toLocaleDateString("zh-CN"):"-"})]})]}),(0,a.jsx)("div",{className:"channel-detail-footer",children:(0,a.jsx)("button",{className:"btn btn-danger btn-block",onClick:()=>{ed(!1),er(H),en.open()},children:"退出频道"})})]})})]})}],41222)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96661,5014,e=>{"use strict";let t=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();e.s(["mergeClasses",0,t],96661);var r=e.i(71645),l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,r.createContext)({}),a=(0,r.forwardRef)(({color:e,size:a,strokeWidth:n,absoluteStrokeWidth:o,className:s="",children:c,iconNode:d,...u},h)=>{let{size:f=24,strokeWidth:m=2,absoluteStrokeWidth:g=!1,color:p="currentColor",className:y=""}=(0,r.useContext)(i)??{},w=o??g?24*Number(n??m)/Number(a??f):n??m;return(0,r.createElement)("svg",{ref:h,...l,width:a??f??l.width,height:a??f??l.height,stroke:e??p,strokeWidth:w,className:t("lucide",y,s),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(u)&&{"aria-hidden":"true"},...u},[...d.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(c)?c:[c]])});e.s(["default",0,a],5014)},56420,e=>{"use strict";var t=e.i(71645),r=e.i(96661);let l=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var i=e.i(5014);e.s(["default",0,(e,a)=>{let n=(0,t.forwardRef)(({className:n,...o},s)=>(0,t.createElement)(i.default,{ref:s,iconNode:a,className:(0,r.mergeClasses)(`lucide-${l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...o}));return n.displayName=l(e),n}],56420)},62368,e=>{"use strict";let t=(0,e.i(56420).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["Download",0,t],62368)},71192,e=>{"use strict";var t=e.i(68834),r=e.i(128);function l(e,t){let{address:l,danger:i}=(0,r.mostWallet)(e,t);return{username:e,address:l,danger:i,displayName:`${e}#${l.slice(-4).toUpperCase()}`}}function i(e){"u">typeof localStorage&&localStorage.setItem("mostbox_identity",JSON.stringify(e))}function a(){"u">typeof localStorage&&(localStorage.removeItem("mostbox_identity"),localStorage.removeItem("mostbox_guest_identity"))}function n(e){return e&&"object"==typeof e&&e.username&&e.address&&e.danger&&"匿名"!==e.username?{username:e.username,address:e.address,danger:e.danger,displayName:e.displayName?e.displayName:`${e.username}#${e.address.slice(-4).toUpperCase()}`}:null}function o(){return{loginUsername:"",loginPassword:"",showPassword:!1,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginLoading:!1,loginError:""}}let s=(0,t.create)((e,t)=>({identity:null,wallet:void 0,showLoginModal:!1,loginUsername:"",loginPassword:"",showPassword:!1,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginLoading:!1,loginError:"",initializeUser:()=>{let t=n(function(){if("u"<typeof localStorage)return null;try{let e=localStorage.getItem("mostbox_identity");if(!e)return null;return JSON.parse(e)}catch{return null}}());t||a(),e({identity:t,wallet:t||void 0})},openLoginModal:()=>{e({showLoginModal:!0,loginError:""})},closeLoginModal:()=>{e({showLoginModal:!1,...o()})},setLoginUsername:t=>{e({loginUsername:t,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginError:""})},setLoginPassword:t=>{e({loginPassword:t,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginError:""})},togglePassword:()=>{e(e=>({showPassword:!e.showPassword}))},previewLoginIdentity:()=>{let{loginUsername:r,loginPassword:i}=t();if(!r.trim()||!i.trim())return e({loginError:"请输入用户名和密码"}),null;let a=l(r.trim(),i);return e({loginPreviewAddress:a.address,hasPreviewedAvatar:!0,loginError:""}),a},loginUser:()=>{let{loginUsername:r,loginPassword:a,hasPreviewedAvatar:n}=t();if(!r.trim()||!a.trim())return e({loginError:"请输入用户名和密码"}),null;if(!n)return e({loginError:"请先预览并确认头像"}),null;e({loginLoading:!0,loginError:""});try{let t=l(r.trim(),a);return i(t),e({identity:t,wallet:t,showLoginModal:!1,...o()}),t}catch(t){return e({loginLoading:!1,loginError:t instanceof Error?t.message:"登录失败"}),null}},setUserIdentity:t=>{let r=n(t);r&&(i(r),e({identity:r,wallet:r}))},logoutUser:()=>{a(),e({identity:null,wallet:void 0})}}));e.s(["useUserStore",0,s],71192)},67228,7881,49401,5142,40924,81317,8382,11239,e=>{"use strict";var t=e.i(71645);function r(e,r,l){let i=(0,t.useEffectEvent)(r);(0,t.useEffect)(()=>(window.addEventListener(e,i,l),()=>window.removeEventListener(e,i,l)),[e])}e.s(["useMediaQuery",0,function(e,r,{getInitialValueInEffect:l}={getInitialValueInEffect:!0}){let[i,a]=(0,t.useState)(l?r:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches);return(0,t.useEffect)(()=>{try{if("matchMedia"in window){let t=window.matchMedia(e);a(t.matches);let r=e=>a(e.matches);return t.addEventListener("change",r),()=>{t.removeEventListener("change",r)}}}catch(e){return}},[e]),i||!1}],67228),e.s(["useWindowEvent",0,r],7881);let l={passive:!0};function i(e){try{return e&&JSON.parse(e)}catch{return e}}function a(e){return{getItem:t=>{try{return window[e].getItem(t)}catch(e){return console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked"),null}},setItem:(t,r)=>{try{window[e].setItem(t,r)}catch(e){console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}},removeItem:t=>{try{window[e].removeItem(t)}catch(e){console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}}}}e.s(["useViewportSize",0,function(){let[e,i]=(0,t.useState)({width:0,height:0}),a=(0,t.useCallback)(()=>{i({width:window.innerWidth||0,height:window.innerHeight||0})},[]);return r("resize",a,l),r("orientationchange",a,l),(0,t.useEffect)(a,[]),e}],49401),e.s(["useDisclosure",0,function(e=!1,r={}){let[l,i]=(0,t.useState)(e),a=(0,t.useCallback)(()=>{i(e=>e||(r.onOpen?.(),!0))},[r.onOpen]),n=(0,t.useCallback)(()=>{i(e=>e?(r.onClose?.(),!1):e)},[r.onClose]);return[l,{open:a,close:n,toggle:(0,t.useCallback)(()=>{l?n():a()},[n,a,l]),set:i}]}],5142),!function(e){let{getItem:t}=a(e)}("localStorage"),e.s(["useLocalStorage",0,function(e){return(function(e,l){let n="localStorage"===e?"mantine-local-storage":"mantine-session-storage",{getItem:o,setItem:s,removeItem:c}=a(e);return function({key:a,defaultValue:d,getInitialValueInEffect:u=!0,sync:h=!0,deserialize:f=i,serialize:m=e=>(function(e,t="use-local-storage"){try{return JSON.stringify(e)}catch(e){throw Error(`@mantine/hooks ${t}: Failed to serialize the value`)}})(e,l)}){let g=(0,t.useCallback)(t=>{let r;try{r="u"<typeof window||!(e in window)||null===window[e]||!!t}catch(e){r=!0}if(r)return d;let l=o(a);return null!==l?f(l):d},[a,d]),[p,y]=(0,t.useState)(g(u)),w=(0,t.useCallback)(e=>{e instanceof Function?y(t=>{let r=e(t);return s(a,m(r)),queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(n,{detail:{key:a,value:r}}))}),r}):(s(a,m(e)),window.dispatchEvent(new CustomEvent(n,{detail:{key:a,value:e}})),y(e))},[a]),v=(0,t.useCallback)(()=>{c(a),y(d),window.dispatchEvent(new CustomEvent(n,{detail:{key:a,value:d}}))},[a,d]);return r("storage",t=>{h&&t.storageArea===window[e]&&t.key===a&&y(f(t.newValue??void 0))}),r(n,e=>{h&&e.detail.key===a&&y(e.detail.value)}),(0,t.useEffect)(()=>{void 0!==d&&void 0===p&&w(d)},[d,p,w]),(0,t.useEffect)(()=>{let e=g();void 0!==e&&w(e)},[a]),[void 0===p?d:p,w,v]}})("localStorage","use-local-storage")(e)}],40924),e.s(["useClipboard",0,function(e={}){let r=e.timeout??2e3,[l,i]=(0,t.useState)(null),[a,n]=(0,t.useState)(!1),o=(0,t.useRef)(null);return(0,t.useEffect)(()=>()=>{window.clearTimeout(o.current)},[]),{copy:e=>{"clipboard"in navigator?navigator.clipboard.writeText(e).then(()=>{i(null),window.clearTimeout(o.current),o.current=window.setTimeout(()=>n(!1),r),n(!0)}).catch(e=>i(e)):i(Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{n(!1),i(null),window.clearTimeout(o.current)},error:l,copied:a}}],81317);let n={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"escape",Esc:"escape",esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function o(e){let t=e.replace("Key","").toLowerCase();return n[e]||t}e.s(["useHotkeys",0,function(e,r=["INPUT","TEXTAREA","SELECT"],l=!1){let i=(0,t.useEffectEvent)(t=>{e.forEach(([e,i,a={preventDefault:!0,usePhysicalKeys:!1}])=>{var n;(n=a.usePhysicalKeys,t=>{let r,l,i,a;return function(e,t,r){let{alt:l,ctrl:i,meta:a,mod:n,shift:s,key:c}=e,{altKey:d,ctrlKey:u,metaKey:h,shiftKey:f,key:m,code:g}=t;if(l!==d)return!1;if(n){if(!u&&!h)return!1}else if(i!==u||a!==h)return!1;return s===f&&!!c&&(r?o(g)===o(c):o(m??g)===o(c))}((l={alt:(r=e.toLowerCase().split("+").map(e=>e.trim())).includes("alt"),ctrl:r.includes("ctrl"),meta:r.includes("meta"),mod:r.includes("mod"),shift:r.includes("shift")},i=["alt","ctrl","meta","shift","mod"],a=r.find(e=>!i.includes(e)),{...l,key:"[plus]"===a?"+":a}),t,n)})(t)&&function(e,t,r=!1){return!(e.target instanceof HTMLElement)||(r?!t.includes(e.target.tagName):!e.target.isContentEditable&&!t.includes(e.target.tagName))}(t,r,l)&&(a.preventDefault&&t.preventDefault(),i(t))})});(0,t.useEffect)(()=>(document.documentElement.addEventListener("keydown",i),()=>document.documentElement.removeEventListener("keydown",i)),[])}],8382),e.s(["useToggle",0,function(e=[!1,!0]){let[[r],l]=(0,t.useReducer)((e,t)=>{let r=t instanceof Function?t(e[0]):t,l=Math.abs(e.indexOf(r));return e.slice(l).concat(e.slice(0,l))},e);return[r,l]}],11239)},22183,e=>{"use strict";e.i(67228),e.i(49401),e.i(5142),e.i(40924),e.i(81317),e.i(8382),e.i(11239),e.i(7881),e.i(71645),e.i(3593),e.i(71192),e.s([],22183)},93957,e=>{"use strict";function t(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function r(e){return e^=e<<13,e^=e>>17,e^=e<<5}function l(e=""){let t=function(e){let t=0;for(let l=0;l<e.length;l++)t=r(t=(t<<5)-t+e.charCodeAt(l)|0);return t}(e=e.toString().slice(0,1024))||1,i=()=>t=r(t),a=(e,t)=>Math.floor((i()- -0x80000000)/0xffffffff*(t+1-e)+e);return{seed:e,next:i,bool:(e=50)=>a(1,100)<=e,integer:(e,t)=>a(e,t),pick(e,t){var r;return 0===e.length?(i(),t):null!=(r=e[a(0,e.length-1)])?r:t},shuffle(e){let t=l(i().toString()),r=[...e];for(let e=r.length-1;e>0;e--){let l=t.integer(0,e);[r[e],r[l]]=[r[l],r[e]]}return r},string(e,t="abcdefghijklmnopqrstuvwxyz1234567890"){let r=l(i().toString()),a="";for(let l=0;l<e;l++)a+=t[r.integer(0,t.length-1)];return a}}}function i(e){let t=e.attributes.viewBox.split(" "),r=parseInt(t[0]),l=parseInt(t[1]);return{x:r,y:l,width:parseInt(t[2]),height:parseInt(t[3])}}let a={type:"object",$schema:"http://json-schema.org/draft-07/schema#",properties:{seed:{type:"string"},flip:{type:"boolean",default:!1},rotate:{type:"integer",minimum:0,maximum:360,default:0},scale:{type:"integer",minimum:0,maximum:200,default:100},radius:{type:"integer",minimum:0,maximum:50,default:0},size:{type:"integer",minimum:1},backgroundColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"}},backgroundType:{type:"array",items:{type:"string",enum:["solid","gradientLinear"]},default:["solid"]},backgroundRotation:{type:"array",items:{type:"integer",minimum:-360,maximum:360},default:[0,360]},translateX:{type:"integer",minimum:-100,maximum:100,default:0},translateY:{type:"integer",minimum:-100,maximum:100,default:0},clip:{type:"boolean",default:!0},randomizeIds:{type:"boolean",default:!1}}};function n(e){var t;let r={},l=null!=(t=e.properties)?t:{};return Object.keys(l).forEach(e=>{let t=l[e];"object"==typeof t&&void 0!==t.default&&(Array.isArray(t.default)?r[e]=[...t.default]:"object"==typeof t.default?r[e]={...t.default}:r[e]=t.default)}),r}function o(e){return"transparent"===e?e:`#${e}`}e.s([],95706),e.i(95706),e.s(["eyes",0,{bulging:(e,t)=>'<circle cx="28" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="74" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="28" cy="24" r="15" fill="#F1EEDA"/><circle cx="74" cy="24" r="15" fill="#F1EEDA"/><rect x="26" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="74" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>',dizzy:(e,t)=>'<path d="m25 27.2 5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L28.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L25 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5ZM79 27.2l5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L82.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L79 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5Z" fill="#000" fill-opacity=".8"/>',eva:(e,t)=>'<g fill-rule="evenodd" clip-rule="evenodd"><path d="M53 0c34.75 0 49 17.47 49 31 0 13.53-19.59 17-49 17-29.05 0-51-3.47-51-17S17.11 0 53 0Z" fill="#000" fill-opacity=".8"/><path d="M28.82 34.65c-6.53-1.35-11.24-6.34-10.52-11.14.72-4.79 6.6-7.58 13.12-6.23 6.53 1.36 11.24 6.35 10.52 11.15-.72 4.8-6.6 7.59-13.12 6.23ZM75.42 34.65c-6.52 1.36-12.4-1.43-13.12-6.23-.72-4.8 4-9.8 10.52-11.15 6.52-1.35 12.4 1.44 13.12 6.24.72 4.81-4 9.8-10.52 11.15Z" fill="#25A6F5"/></g>',frame1:(e,t)=>'<rect y="4" width="104" height="42" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><rect x="66" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M21 4h8L12 46H4L21 4Z" fill="#fff" fill-opacity=".4"/>',frame2:(e,t)=>'<rect x="8" y="10" width="88" height="36" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><rect x="66" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><path fill-rule="evenodd" clip-rule="evenodd" d="M83 10h5L76 46h-5l12-36Z" fill="#fff" fill-opacity=".4"/>',glow:(e,t)=>'<g fill="#fff"><circle cx="21" cy="30" r="15" fill-opacity=".1"/><circle cx="83" cy="30" r="15" fill-opacity=".1"/><circle cx="21" cy="30" r="12" fill-opacity=".1"/><circle cx="83" cy="30" r="12" fill-opacity=".1"/><circle cx="21" cy="30" r="6" fill-opacity=".8"/><circle cx="83" cy="30" r="6" fill-opacity=".8"/><circle cx="21" cy="30" r="3" fill-opacity=".8"/><circle cx="83" cy="30" r="3" fill-opacity=".8"/></g>',happy:(e,t)=>'<path d="m18 19 12-2M20 31c0-3.31 2.9-6 7-6 3.1 0 6 2.69 6 6M86 20l-12-3M84 31c0-3.31-2.9-6-6-6-4.1 0-7 2.69-7 6" stroke="#000" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>',hearts:(e,t)=>'<path d="M29.27 9.68c-2.55.13-4.96 2.24-6.25 4.15-1.48-1.76-4.1-3.6-6.65-3.47-5.48.28-8.85 3.8-8.63 8.1.3 5.72 4.88 8.89 9.7 12.24 1.71 1.15 5 4.15 5.42 4.82.42.67 2.14.6 2.58-.13a37.8 37.8 0 0 1 4.9-5.36c4.43-3.84 8.66-7.47 8.36-13.2-.23-4.3-3.95-7.44-9.43-7.15ZM87.63 10.36c-2.55-.14-5.17 1.7-6.65 3.47-1.3-1.9-3.7-4.02-6.25-4.15-5.48-.29-9.2 2.86-9.43 7.16-.3 5.72 3.93 9.35 8.36 13.19 1.6 1.32 4.55 4.64 4.9 5.36.35.7 2.06.82 2.58.13.51-.7 3.7-3.67 5.42-4.82 4.81-3.35 9.4-6.52 9.7-12.24.22-4.3-3.15-7.82-8.63-8.1Z" fill="#FF5353" fill-opacity=".8"/>',robocop:(e,t)=>'<rect x="7" y="16" width="91" height="16" rx="4" fill="#000" fill-opacity=".8"/><mask id="eyesRobocop-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="16" width="91" height="16"><rect x="7" y="16" width="91" height="16" rx="4" fill="#fff"/></mask><g mask="url(#eyesRobocop-a)" fill-rule="evenodd" clip-rule="evenodd" fill="#fff" fill-opacity=".8"><path d="M76 7h18L82 37H64L76 7ZM52 7h9L49 37h-9L52 7Z"/></g>',round:(e,t)=>'<g fill="#fff"><circle cx="24" cy="30" r="6"/><circle cx="80" cy="30" r="6"/></g>',roundFrame01:(e,t)=>'<rect y="12" width="104" height="32" rx="16" fill="#000" fill-opacity=".8"/><rect x="24" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/><rect x="70" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/>',roundFrame02:(e,t)=>'<rect y="11" width="104" height="34" rx="17" fill="#000" fill-opacity=".8"/><circle cx="29" cy="28" r="13" fill="#F1EEDA"/><circle cx="75" cy="28" r="13" fill="#F1EEDA"/><rect x="24" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="70" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>',sensor:(e,t)=>'<path d="M28 44a20 20 0 0 0 19.9-18h41.52a5 5 0 1 0 0-4H47.9A20 20 0 1 0 28 44Z" fill="#000" fill-opacity=".2"/><circle cx="94" cy="24" r="2" fill="#fff"/><circle cx="28" cy="24" r="16" fill="#000" fill-opacity=".6"/><circle cx="34" cy="16" r="3" fill="#fff"/>',shade01:(e,t)=>'<path d="M96 2H8c-4.5 0-8 3.5-8 8.03V28c0 4.5 3.5 8 8 8h13c8 0 11 8 18 8h27c7 0 9-8 17-8h13c4.5 0 8-3.5 8-8V10c0-4.5-3.5-8-8-8Z" fill="#000" fill-opacity=".8"/><path d="M87 14H17c-3.5 0-5 3-5 5v2c0 2 1.5 5 5 5h12c6 0 11.62 8 17 8h14c5.38 0 9-8 15-8h12c3.5 0 5-3 5-5v-2c0-2-1.5-5-5-5Z" fill="#FF3D3D"/><path d="M22.44 36.09 37.26 2h11L31.4 40.78l-.76-.58c-2.38-1.82-4.83-3.69-8.2-4.11ZM11.48 36 26.26 2h4L15.48 36h-4Z" fill="#fff" fill-opacity=".2"/>'},"mouth",0,{bite:(e,t)=>'<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#000" fill-opacity=".6"/><path fill-rule="evenodd" clip-rule="evenodd" d="m20 17 6-8H14l6 8ZM32 17l6-8H26l6 8ZM44 17l6-8H38l6 8ZM56 17l6-8H50l6 8Z" fill="#E1E6E8"/>',diagram:(e,t)=>'<rect x="4" y="4" width="68" height="24" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="8" width="60" height="16" rx="2" fill="#000" fill-opacity=".8"/><path d="M9 17h11l2-4 3 7 4-8 2 9 3-11 3 10 3-3h15l3-4 2 7 3-3h4" stroke="#4EFAC9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',grill01:(e,t)=>'<g fill="#000" fill-opacity=".6"><rect x="12" y="12" width="4" height="8" rx="2"/><rect x="36" y="12" width="4" height="8" rx="2"/><rect x="24" y="12" width="4" height="8" rx="2"/><rect x="48" y="12" width="4" height="8" rx="2"/><rect x="60" y="12" width="4" height="8" rx="2"/></g>',grill02:(e,t)=>'<g fill="#000" fill-opacity=".6"><rect x="28" y="10" width="6" height="14" rx="2"/><rect x="14" y="10" width="6" height="14" rx="2"/><rect x="42" y="10" width="6" height="14" rx="2"/><rect x="56" y="10" width="6" height="14" rx="2"/></g>',grill03:(e,t)=>'<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#fff"/><path fill="#000" fill-opacity=".1" d="M18 9h4v14h-4zM42 9h4v14h-4zM30 9h4v14h-4zM54 9h4v14h-4z"/>',smile01:(e,t)=>'<path d="M27.05 8.44a2 2 0 1 1 3.9-.88C31.72 10.96 34.4 13 38 13c3.6 0 6.28-2.04 7.05-5.44a2 2 0 1 1 3.9.88C47.75 13.7 43.43 17 38 17s-9.76-3.3-10.95-8.56Z" fill="#000" fill-opacity=".6"/>',smile02:(e,t)=>'<path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#000" fill-opacity=".8"/><mask id="mouthSmile02-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="18" y="8" width="40" height="20"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#fff"/></mask><g mask="url(#mouthSmile02-a)"><rect x="30" y="2" width="16" height="14" rx="2" fill="#fff"/></g>',square01:(e,t)=>'<rect x="24" y="6" width="27" height="8" rx="4" fill="#000" fill-opacity=".8"/>',square02:(e,t)=>'<rect x="16" y="8" width="44" height="4" rx="2" fill="#000" fill-opacity=".8"/>'}],23855);var s=e.i(23855);function c({prng:e,group:t,values:r=[]}){let l=e.pick(r);return l&&s[t][l]?{name:l,value:s[t][l]}:void 0}let d={title:"Bottts",creator:"Pablo Stanley",source:"https://bottts.com/",homepage:"https://twitter.com/pablostanley",license:{name:"Free for personal and commercial use",url:"https://bottts.com/"}},u=({prng:e,options:t})=>{var r,l,i,a;let n=function({prng:e,options:t}){return{mouth:c({prng:e,group:"mouth",values:t.mouth}),eyes:c({prng:e,group:"eyes",values:t.eyes})}}({prng:e,options:t}),o=function({prng:e,options:t}){return{}}({prng:e,options:t});return{attributes:{viewBox:"0 0 120 120",fill:"none","shape-rendering":"auto"},body:`<g transform="translate(22 68)">${null!=(l=null==(r=n.mouth)?void 0:r.value(n,o))?l:""}</g><g transform="translate(8 20)">${null!=(a=null==(i=n.eyes)?void 0:i.value(n,o))?a:""}</g>`,extra:()=>({...Object.entries(n).reduce((e,[t,r])=>(e[t]=null==r?void 0:r.name,e),{}),...Object.entries(o).reduce((e,[t,r])=>(e[`${t}Color`]=r,e),{})})}};e.s(["create",0,u,"meta",0,d],17022),e.i(17022),e.s(["create",0,u,"meta",0,d,"schema",0,{$schema:"http://json-schema.org/draft-07/schema#",properties:{backgroundColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["ffb300","1e88e5","546e7a","6d4c41","00acc1","f4511e","5e35b1","43a047","757575","3949ab","039be5","7cb342","c0ca33","fb8c00","d81b60","8e24aa","e53935","00897b","fdd835"]},eyes:{type:"array",items:{type:"string",enum:["bulging","dizzy","eva","frame1","frame2","glow","happy","hearts","robocop","round","roundFrame01","roundFrame02","sensor","shade01"]},default:["bulging","dizzy","eva","frame1","frame2","glow","happy","hearts","robocop","round","roundFrame01","roundFrame02","sensor","shade01"]},mouth:{type:"array",items:{type:"string",enum:["bite","diagram","grill01","grill02","grill03","smile01","smile02","square01","square02"]},default:["bite","diagram","grill01","grill02","grill03","smile01","smile02","square01","square02"]}}}],13161);var h=e.i(13161),h=h;e.s(["generateAvatar",0,function(e){return e?(function(e,r={}){var s,c,d,u,h,f,m,g,p,y,w,v,x,b,k,E,$,M,C,L,S,j,F,A,N,P,z,U,D,I,T,Z,O,R;let H,B,q,W,X,_,J,V,K,Y,G,Q,ee,et,er,el,ei;f=r;let ea=l((r=JSON.parse(JSON.stringify({...n(a),...n(null!=(m=e.schema)?m:{}),...f}))).seed),en=e.create({prng:ea,options:r}),eo=ea.pick(null!=(s=r.backgroundType)?s:[],"solid"),{primary:es,secondary:ec}=(g=null!=(c=r.backgroundColor)?c:[],(H=ea.shuffle(g)).length<=1||2==g.length&&"gradientLinear"==eo?(H=g,ea.next()):H=ea.shuffle(g),0===H.length&&(H=["transparent"]),B=H[0],q=null!=(p=H[1])?p:H[0],{primary:o(B),secondary:o(q)}),ed=ea.integer((null==(d=r.backgroundRotation)?void 0:d.length)?Math.min(...r.backgroundRotation):0,(null==(u=r.backgroundRotation)?void 0:u.length)?Math.max(...r.backgroundRotation):0);r.size&&(en.attributes.width=r.size.toString(),en.attributes.height=r.size.toString()),void 0!==r.scale&&100!==r.scale&&(en.body=function(e,t){let{width:r,height:l,x:a,y:n}=i(e),o=t?(t-100)/100:0;return`<g transform="translate(${-((r/2+a)*o*1)} ${-((l/2+n)*o*1)}) scale(${t/100})">${e.body}</g>`}(en,r.scale)),r.flip&&(en.body=function(e){let{width:t,x:r}=i(e);return`<g transform="scale(-1 1) translate(${-1*t-2*r} 0)">${e.body}</g>`}(en)),r.rotate&&(en.body=function(e,t){let{width:r,height:l,x:a,y:n}=i(e);return`<g transform="rotate(${t}, ${r/2+a}, ${l/2+n})">${e.body}</g>`}(en,r.rotate)),(r.translateX||r.translateY)&&(y=r.translateX,w=r.translateY,X=((W=i(en)).width+2*W.x)*((null!=y?y:0)/100),_=(W.height+2*W.y)*((null!=w?w:0)/100),en.body=`<g transform="translate(${X} ${_})">${en.body}</g>`),"transparent"!==es&&"transparent"!==ec&&(en.body=function(e,r,l,a,n){let{width:o,height:s,x:c,y:d}=i(e),u=`<rect fill="${t(r)}" width="${o}" height="${s}" x="${c}" y="${d}" />`;switch(a){case"solid":return u+e.body;case"gradientLinear":return`<rect fill="url(#backgroundLinear)" width="${o}" height="${s}" x="${c}" y="${d}" /><defs><linearGradient id="backgroundLinear" gradientTransform="rotate(${n} 0.5 0.5)"><stop stop-color="${t(r)}"/><stop offset="1" stop-color="${t(l)}"/></linearGradient></defs>`+e.body}}(en,es,ec,eo,ed)),(r.radius||r.clip)&&(en.body=function(e,t){let{width:r,height:l,x:a,y:n}=i(e);return`<mask id="viewboxMask"><rect width="${r}" height="${l}" rx="${t?r*t/100:0}" ry="${t?l*t/100:0}" x="${a}" y="${n}" fill="#fff" /></mask><g mask="url(#viewboxMask)">${e.body}</g>`}(en,null!=(h=r.radius)?h:0)),r.randomizeIds&&(J=l(Math.random().toString()),V={},en.body=en.body.replace(/(id="|url\(#)([a-z0-9-_]+)([")])/gi,(e,t,r,l)=>(V[r]=V[r]||J.string(8),`${t}${V[r]}${l}`)));let eu=Object.keys(K={xmlns:"http://www.w3.org/2000/svg",...en.attributes}).map(e=>`${t(e)}="${t(K[e])}"`).join(" "),eh=(Y=null==(v=e.meta)?void 0:v.title,G=null==(x=e.meta)?void 0:x.creator,Q=null==(b=e.meta)?void 0:b.source,ee=null==(E=null==(k=e.meta)?void 0:k.license)?void 0:E.url,er=(null==(L=(C=e).meta)?void 0:L.title)?`„${null==(S=C.meta)?void 0:S.title}”`:"Design",el=`„${null!=(F=null==(j=C.meta)?void 0:j.creator)?F:"Unknown"}”`,(null==(A=C.meta)?void 0:A.source)&&(er+=` (${C.meta.source})`),ei="",(null==(P=null==(N=C.meta)?void 0:N.license)?void 0:P.name)!=="MIT"&&(null==(z=C.meta)?void 0:z.creator)!=="DiceBear"&&(null==(U=C.meta)?void 0:U.title)&&(ei+="Remix of "),ei+=`${er} by ${el}`,(null==(I=null==(D=C.meta)?void 0:D.license)?void 0:I.name)&&(ei+=`, licensed under „${null==(Z=null==(T=C.meta)?void 0:T.license)?void 0:Z.name}”`,(null==(R=null==(O=C.meta)?void 0:O.license)?void 0:R.url)&&(ei+=` (${C.meta.license.url})`)),et=ei,Y||G||Q||ee||et?'<metadata xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"><rdf:RDF><rdf:Description>'+(Y?`<dc:title>${t(Y)}</dc:title>`:"")+(G?`<dc:creator>${t(G)}</dc:creator>`:"")+(Q?`<dc:source xsi:type="dcterms:URI">${t(null!=(M=null==($=e.meta)?void 0:$.source)?M:"")}</dc:source>`:"")+(ee?`<dcterms:license xsi:type="dcterms:URI">${t(ee)}</dcterms:license>`:"")+(et?`<dc:rights>${t(et)}</dc:rights>`:"")+"</rdf:Description></rdf:RDF></metadata>":""),ef=`<svg ${eu}>${eh}${en.body}</svg>`;return{toString:()=>ef,toJson:()=>{var e;return{svg:ef,extra:{primaryBackgroundColor:es,secondaryBackgroundColor:ec,backgroundType:eo,backgroundRotation:ed,...null==(e=en.extra)?void 0:e.call(en)}}},toDataUri:()=>`data:image/svg+xml;utf8,${encodeURIComponent(ef)}`}})(h,{seed:"most.box@"+e,flip:!0,backgroundType:["gradientLinear"]}).toDataUri():"/pwa-512x512.png"}],93957)},57667,80809,e=>{"use strict";var t=e.i(18050),r=e.i(71645);e.i(22183);var l=e.i(8382);e.s(["ModalOverlay",0,function({children:e,onClose:i,closeOnOverlayClick:a=!1}){return(0,l.useHotkeys)(i?[["Escape",i]]:[]),(0,r.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=()=>{document.documentElement.style.setProperty("--modal-visual-height",`${e.height}px`),document.documentElement.style.setProperty("--modal-visual-top",`${e.offsetTop}px`)};return t(),e.addEventListener("resize",t),e.addEventListener("scroll",t),()=>{e.removeEventListener("resize",t),e.removeEventListener("scroll",t),document.documentElement.style.removeProperty("--modal-visual-height"),document.documentElement.style.removeProperty("--modal-visual-top")}},[]),(0,t.jsxs)("div",{className:"modal-overlay",onClick:e=>{a&&e.target===e.currentTarget&&i?.()},children:[(0,t.jsx)("div",{className:"modal-overlay-backdrop"}),(0,t.jsx)("div",{className:"modal-glass",children:e})]})}],57667),e.s(["Toast",0,function({message:e,type:l,onDone:i,index:a}){(0,r.useEffect)(()=>{let e=setTimeout(i,3e3);return()=>clearTimeout(e)},[]);let n=Math.min(Math.max(a,0),5);return(0,t.jsx)("div",{className:`toast ${l} toast-stack-${n}`,children:e})}],80809)},63676,e=>{"use strict";let t=(0,e.i(56420).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],63676)},4121,88361,47910,e=>{"use strict";var t=e.i(57667);e.i(80809);var r=e.i(18050),l=e.i(63676);e.s(["ConfirmModal",0,function({title:e,message:i,confirmText:a,onConfirm:n,onClose:o,danger:s,closeOnOverlayClick:c}){return(0,r.jsx)(t.ModalOverlay,{onClose:o,closeOnOverlayClick:c,children:(0,r.jsxs)("div",{className:"confirm-modal",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h3",{children:e}),(0,r.jsx)("button",{onClick:o,className:"btn btn-icon",children:(0,r.jsx)(l.X,{size:18})})]}),(0,r.jsx)("p",{children:i}),(0,r.jsxs)("div",{className:"modal-actions",children:[(0,r.jsx)("button",{onClick:o,className:"btn btn-secondary",children:"取消"}),(0,r.jsx)("button",{onClick:n,className:`btn ${s?"btn-danger":"btn-primary"}`,children:a})]})]})})}],88361);var i=e.i(71645);e.s(["InputModal",0,function({title:e,placeholder:a,defaultValue:n,confirmText:o,onConfirm:s,onClose:c,isLoading:d,loadingText:u,validate:h}){let[f,m]=(0,i.useState)(n||""),g=f.trim(),p=g&&h?h(g):"",y=!!g&&!p&&!d;function w(){y&&s(g)}return(0,r.jsx)(t.ModalOverlay,{onClose:c,children:(0,r.jsxs)("div",{className:"input-modal",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h3",{children:e}),(0,r.jsx)("button",{onClick:c,className:"btn btn-icon",children:(0,r.jsx)(l.X,{size:18})})]}),(0,r.jsx)("input",{type:"text",value:f,onChange:e=>m(e.target.value),placeholder:a,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&w()},className:"input input-compact","aria-invalid":!!p,"aria-describedby":p?"input-modal-error":void 0}),p&&(0,r.jsx)("p",{className:"input-modal-error",id:"input-modal-error",children:p}),(0,r.jsxs)("div",{className:"modal-actions",children:[(0,r.jsx)("button",{onClick:c,disabled:d,className:"btn btn-secondary",children:"取消"}),(0,r.jsx)("button",{onClick:w,disabled:!y,className:`btn btn-primary ${d?"btn-loading":""}`,children:d?u||"处理中...":o})]})]})})}],47910),e.s([],4121)}]);
|