most-box 0.1.3 → 0.1.5

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.
Files changed (205) hide show
  1. package/README.md +7 -4
  2. package/electron/main.js +31 -10
  3. package/out/404/index.html +2 -2
  4. package/out/404.html +2 -2
  5. package/out/__next.__PAGE__.txt +6 -6
  6. package/out/__next._full.txt +15 -15
  7. package/out/__next._head.txt +3 -3
  8. package/out/__next._index.txt +7 -7
  9. package/out/__next._tree.txt +4 -4
  10. package/out/_next/static/chunks/{0hpev4am9jpmu.css → 0.4ov9319fecg.css} +1 -1
  11. package/out/_next/static/chunks/0._8s6pbfw.xk.js +1 -0
  12. package/out/_next/static/chunks/02jvyg27pp0mz.js +1 -0
  13. package/out/_next/static/chunks/02zzxfop_k6tl.css +1 -0
  14. package/out/_next/static/chunks/06lttvu7563zo.css +1 -0
  15. package/out/_next/static/chunks/{0pt.5cg1t09qs.js → 08qqf0rsi3oot.js} +1 -1
  16. package/out/_next/static/chunks/{0adx~d-j05c9d.css → 09h7l4i38xc7q.css} +1 -1
  17. package/out/_next/static/chunks/09hqx79-jkvm_.css +1 -0
  18. package/out/_next/static/chunks/09vcm1ku9k7o8.js +1 -0
  19. package/out/_next/static/chunks/0c6e_d2jq179x.js +1 -0
  20. package/out/_next/static/chunks/0ccalho416.d7.js +1 -0
  21. package/out/_next/static/chunks/0exj_tg.ew-t3.js +1 -0
  22. package/out/_next/static/chunks/0f-wz5d~tv-r4.js +1 -0
  23. package/out/_next/static/chunks/0f0jhsujtf-61.js +1 -0
  24. package/out/_next/static/chunks/0hyds~bp.auvh.js +1 -0
  25. package/out/_next/static/chunks/0ig8a4sazk3~2.css +1 -0
  26. package/out/_next/static/chunks/0iq1h7g4dudg8.js +1 -0
  27. package/out/_next/static/chunks/0knnzo9aih48r.js +1 -0
  28. package/out/_next/static/chunks/0nzyk~sg_tn._.js +1 -0
  29. package/out/_next/static/chunks/{12nr19.nnn6s3.js → 0t_3xxx4zkerp.js} +2 -2
  30. package/out/_next/static/chunks/0w~2fjq86t7c7.css +1 -0
  31. package/out/_next/static/chunks/0xrqerhosrp9~.js +1 -0
  32. package/out/_next/static/chunks/0xx_10jns1.s7.css +1 -0
  33. package/out/_next/static/chunks/14-fm9r_mom81.js +1 -0
  34. package/out/_next/static/chunks/14jhy~xia8lh8.js +1 -0
  35. package/out/_next/static/chunks/{turbopack-0xta0kqwzkf28.js → turbopack-05qngmxam3ar~.js} +1 -1
  36. package/out/_not-found/__next._full.txt +12 -12
  37. package/out/_not-found/__next._head.txt +3 -3
  38. package/out/_not-found/__next._index.txt +7 -7
  39. package/out/_not-found/__next._not-found.__PAGE__.txt +4 -4
  40. package/out/_not-found/__next._not-found.txt +3 -3
  41. package/out/_not-found/__next._tree.txt +2 -2
  42. package/out/_not-found/index.html +2 -2
  43. package/out/_not-found/index.txt +12 -12
  44. package/out/admin/__next._full.txt +14 -14
  45. package/out/admin/__next._head.txt +3 -3
  46. package/out/admin/__next._index.txt +7 -7
  47. package/out/admin/__next._tree.txt +3 -3
  48. package/out/admin/__next.admin.__PAGE__.txt +4 -4
  49. package/out/admin/__next.admin.txt +4 -4
  50. package/out/admin/index.html +2 -2
  51. package/out/admin/index.txt +14 -14
  52. package/out/app/__next._full.txt +13 -13
  53. package/out/app/__next._head.txt +3 -3
  54. package/out/app/__next._index.txt +7 -7
  55. package/out/app/__next._tree.txt +2 -2
  56. package/out/app/__next.app.__PAGE__.txt +4 -4
  57. package/out/app/__next.app.txt +3 -3
  58. package/out/app/index.html +2 -2
  59. package/out/app/index.txt +13 -13
  60. package/out/chat/__next._full.txt +14 -14
  61. package/out/chat/__next._head.txt +3 -3
  62. package/out/chat/__next._index.txt +7 -7
  63. package/out/chat/__next._tree.txt +3 -3
  64. package/out/chat/__next.chat.__PAGE__.txt +4 -4
  65. package/out/chat/__next.chat.txt +4 -4
  66. package/out/chat/index.html +2 -2
  67. package/out/chat/index.txt +14 -14
  68. package/out/chat/join/__next._full.txt +14 -14
  69. package/out/chat/join/__next._head.txt +3 -3
  70. package/out/chat/join/__next._index.txt +7 -7
  71. package/out/chat/join/__next._tree.txt +3 -3
  72. package/out/chat/join/__next.chat.join.__PAGE__.txt +4 -4
  73. package/out/chat/join/__next.chat.join.txt +3 -3
  74. package/out/chat/join/__next.chat.txt +4 -4
  75. package/out/chat/join/index.html +2 -2
  76. package/out/chat/join/index.txt +14 -14
  77. package/out/download/__next._full.txt +34 -36
  78. package/out/download/__next._head.txt +3 -3
  79. package/out/download/__next._index.txt +7 -7
  80. package/out/download/__next._tree.txt +4 -4
  81. package/out/download/__next.download.__PAGE__.txt +7 -7
  82. package/out/download/__next.download.txt +3 -3
  83. package/out/download/index.html +2 -2
  84. package/out/download/index.txt +34 -36
  85. package/out/favicon.ico +0 -0
  86. package/out/game/__next._full.txt +20 -0
  87. package/out/game/__next._head.txt +5 -0
  88. package/out/game/__next._index.txt +9 -0
  89. package/out/game/__next._tree.txt +5 -0
  90. package/out/game/__next.game.__PAGE__.txt +6 -0
  91. package/out/game/__next.game.txt +5 -0
  92. package/out/game/gandengyan/__next._full.txt +26 -0
  93. package/out/game/gandengyan/__next._head.txt +5 -0
  94. package/out/game/gandengyan/__next._index.txt +9 -0
  95. package/out/game/gandengyan/__next._tree.txt +6 -0
  96. package/out/game/gandengyan/__next.game.gandengyan.__PAGE__.txt +10 -0
  97. package/out/game/gandengyan/__next.game.gandengyan.txt +5 -0
  98. package/out/game/gandengyan/__next.game.txt +5 -0
  99. package/out/game/gandengyan/index.html +15 -0
  100. package/out/game/gandengyan/index.txt +26 -0
  101. package/out/game/index.html +1 -0
  102. package/out/game/index.txt +20 -0
  103. package/out/game/zhajinhua/__next._full.txt +25 -0
  104. package/out/game/zhajinhua/__next._head.txt +5 -0
  105. package/out/game/zhajinhua/__next._index.txt +9 -0
  106. package/out/game/zhajinhua/__next._tree.txt +5 -0
  107. package/out/game/zhajinhua/__next.game.txt +5 -0
  108. package/out/game/zhajinhua/__next.game.zhajinhua.__PAGE__.txt +9 -0
  109. package/out/game/zhajinhua/__next.game.zhajinhua.txt +5 -0
  110. package/out/game/zhajinhua/index.html +15 -0
  111. package/out/game/zhajinhua/index.txt +25 -0
  112. package/out/index.html +2 -2
  113. package/out/index.txt +15 -15
  114. package/out/logo-512.png +0 -0
  115. package/out/logo.ico +0 -0
  116. package/out/logo.svg +12 -0
  117. package/out/note/__next._full.txt +13 -13
  118. package/out/note/__next._head.txt +3 -3
  119. package/out/note/__next._index.txt +7 -7
  120. package/out/note/__next._tree.txt +2 -2
  121. package/out/note/__next.note.__PAGE__.txt +4 -4
  122. package/out/note/__next.note.txt +3 -3
  123. package/out/note/index.html +2 -2
  124. package/out/note/index.txt +13 -13
  125. package/out/ping/__next._full.txt +14 -14
  126. package/out/ping/__next._head.txt +3 -3
  127. package/out/ping/__next._index.txt +7 -7
  128. package/out/ping/__next._tree.txt +3 -3
  129. package/out/ping/__next.ping.__PAGE__.txt +5 -5
  130. package/out/ping/__next.ping.txt +3 -3
  131. package/out/ping/index.html +2 -2
  132. package/out/ping/index.txt +14 -14
  133. package/out/web3/__next._full.txt +13 -13
  134. package/out/web3/__next._head.txt +3 -3
  135. package/out/web3/__next._index.txt +7 -7
  136. package/out/web3/__next._tree.txt +2 -2
  137. package/out/web3/__next.web3.__PAGE__.txt +4 -4
  138. package/out/web3/__next.web3.txt +3 -3
  139. package/out/web3/ed25519/__next._full.txt +11 -11
  140. package/out/web3/ed25519/__next._head.txt +3 -3
  141. package/out/web3/ed25519/__next._index.txt +7 -7
  142. package/out/web3/ed25519/__next._tree.txt +2 -2
  143. package/out/web3/ed25519/__next.web3.ed25519.__PAGE__.txt +2 -2
  144. package/out/web3/ed25519/__next.web3.ed25519.txt +3 -3
  145. package/out/web3/ed25519/__next.web3.txt +3 -3
  146. package/out/web3/ed25519/index.html +1 -1
  147. package/out/web3/ed25519/index.txt +11 -11
  148. package/out/web3/index.html +2 -2
  149. package/out/web3/index.txt +13 -13
  150. package/out/web3/tools/__next._full.txt +11 -11
  151. package/out/web3/tools/__next._head.txt +3 -3
  152. package/out/web3/tools/__next._index.txt +7 -7
  153. package/out/web3/tools/__next._tree.txt +2 -2
  154. package/out/web3/tools/__next.web3.tools.__PAGE__.txt +2 -2
  155. package/out/web3/tools/__next.web3.tools.txt +3 -3
  156. package/out/web3/tools/__next.web3.txt +3 -3
  157. package/out/web3/tools/index.html +1 -1
  158. package/out/web3/tools/index.txt +11 -11
  159. package/package.json +6 -5
  160. package/public/favicon.ico +0 -0
  161. package/public/logo-512.png +0 -0
  162. package/public/logo.ico +0 -0
  163. package/public/logo.svg +12 -0
  164. package/server/index.js +0 -8
  165. package/server/src/config.js +1 -1
  166. package/server/src/core/gameRoom.js +222 -0
  167. package/server/src/core/zhajinhua.js +563 -0
  168. package/server/src/games/gandengyan.js +354 -413
  169. package/server/src/http/app.js +22 -14
  170. package/server/src/http/uploads.js +1 -0
  171. package/server/src/index.js +275 -90
  172. package/server/src/utils/avatar.js +3 -2
  173. package/out/_next/static/chunks/04mo7rr..0_1q.js +0 -1
  174. package/out/_next/static/chunks/06rf3qq5ggs6v.js +0 -1
  175. package/out/_next/static/chunks/07td.jq7xff84.css +0 -1
  176. package/out/_next/static/chunks/0_0oph_z1az14.js +0 -1
  177. package/out/_next/static/chunks/0ao1lbi4b.sfa.js +0 -1
  178. package/out/_next/static/chunks/0cl7d~7abnk_p.css +0 -1
  179. package/out/_next/static/chunks/0d306t1wvjpdx.js +0 -1
  180. package/out/_next/static/chunks/0g_a~e050bgzg.css +0 -1
  181. package/out/_next/static/chunks/0m_5nb6x8qy._.js +0 -1
  182. package/out/_next/static/chunks/0n.ayxmsar6e5.js +0 -1
  183. package/out/_next/static/chunks/0olqjomda37-e.js +0 -1
  184. package/out/_next/static/chunks/0qgx9t4jx16ua.css +0 -1
  185. package/out/_next/static/chunks/0s~g.l~x049o2.js +0 -1
  186. package/out/_next/static/chunks/0voe1.ttrh84k.css +0 -1
  187. package/out/_next/static/chunks/0wtf0xsiicxx6.js +0 -1
  188. package/out/_next/static/chunks/0x.ky97owcxxs.js +0 -1
  189. package/out/_next/static/chunks/0ysj5b94vu4ri.js +0 -1
  190. package/out/_next/static/chunks/153-sz7s.qml2.js +0 -1
  191. package/out/_next/static/chunks/17cwkb2yn_akx.js +0 -1
  192. package/out/_next/static/chunks/184hxsuf-5c84.js +0 -1
  193. package/out/gandengyan/__next._full.txt +0 -25
  194. package/out/gandengyan/__next._head.txt +0 -5
  195. package/out/gandengyan/__next._index.txt +0 -9
  196. package/out/gandengyan/__next._tree.txt +0 -5
  197. package/out/gandengyan/__next.gandengyan.__PAGE__.txt +0 -10
  198. package/out/gandengyan/__next.gandengyan.txt +0 -5
  199. package/out/gandengyan/index.html +0 -15
  200. package/out/gandengyan/index.txt +0 -25
  201. /package/out/_next/static/{aPEZ4zaaR5W3WpSZ0dFsa → 2smv1H9Y4Z2Ri-SL-UFgR}/_buildManifest.js +0 -0
  202. /package/out/_next/static/{aPEZ4zaaR5W3WpSZ0dFsa → 2smv1H9Y4Z2Ri-SL-UFgR}/_clientMiddlewareManifest.js +0 -0
  203. /package/out/_next/static/{aPEZ4zaaR5W3WpSZ0dFsa → 2smv1H9Y4Z2Ri-SL-UFgR}/_ssgManifest.js +0 -0
  204. /package/out/{pwa-512x512.png → avatar.png} +0 -0
  205. /package/public/{pwa-512x512.png → avatar.png} +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95057,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return o}};for(var r in n)Object.defineProperty(a,r,{enumerable:!0,get:n[r]});let s=e.r(90809)._(e.r(98183)),l=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:a}=e,n=e.protocol||"",r=e.pathname||"",i=e.hash||"",o=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:a&&(u=t+(~a.indexOf(":")?`[${a}]`:a),e.port&&(u+=":"+e.port)),o&&"object"==typeof o&&(o=String(s.urlQueryToSearchParams(o)));let d=e.search||o&&`?${o}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==u?(u="//"+(u||""),r&&"/"!==r[0]&&(r="/"+r)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),d&&"?"!==d[0]&&(d="?"+d),r=r.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${n}${u}${r}${d}${i}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},18581,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"useMergedRef",{enumerable:!0,get:function(){return r}});let n=e.r(71645);function r(e,t){let a=(0,n.useRef)(null),r=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=a.current;e&&(a.current=null,e());let t=r.current;t&&(r.current=null,t())}else e&&(a.current=s(e,n)),t&&(r.current=s(t,n))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let a=e(t);return"function"==typeof a?a:()=>e(null)}}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},73668,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"isLocalURL",{enumerable:!0,get:function(){return s}});let n=e.r(18967),r=e.r(52817);function s(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),a=new URL(e,t);return a.origin===t&&(0,r.hasBasePath)(a.pathname)}catch(e){return!1}}},84508,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return v}};for(var r in n)Object.defineProperty(a,r,{enumerable:!0,get:n[r]});let s=e.r(90809),l=e.r(18050),i=s._(e.r(71645)),o=e.r(95057),u=e.r(8372),d=e.r(18581),c=e.r(18967),p=e.r(5550);e.r(33525);let f=e.r(88540),h=e.r(91949),m=e.r(73668),g=e.r(9396);function b(t){var a,n;let r,s,b,[v,_]=(0,i.useOptimistic)(h.IDLE_LINK_STATUS),S=(0,i.useRef)(null),{href:j,as:x,children:C,prefetch:k=null,passHref:w,replace:N,shallow:M,scroll:A,onClick:R,onMouseEnter:$,onTouchStart:O,legacyBehavior:G=!1,onNavigate:P,transitionTypes:E,ref:H,unstable_dynamicOnHover:I,...B}=t;r=C,G&&("string"==typeof r||"number"==typeof r)&&(r=(0,l.jsx)("a",{children:r}));let L=i.default.useContext(u.AppRouterContext),T=!1!==k,U=!1!==k?null===(n=k)||"auto"===n?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,W="string"==typeof(a=x||j)?a:(0,o.formatUrl)(a);if(G){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});s=i.default.Children.only(r)}let z=G?s&&"object"==typeof s&&s.ref:H,J=i.default.useCallback(e=>(null!==L&&(S.current=(0,h.mountLinkInstance)(e,W,L,U,T,_)),()=>{S.current&&((0,h.unmountLinkForCurrentNavigation)(S.current),S.current=null),(0,h.unmountPrefetchableInstance)(e)}),[T,W,L,U,_]),q={ref:(0,d.useMergedRef)(J,z),onClick(t){G||"function"!=typeof R||R(t),G&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!L||t.defaultPrevented||function(t,a,n,r,s,l,o){if("u">typeof window){let u,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(a)){r&&(t.preventDefault(),location.replace(a));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:c}=e.r(99781);i.default.startTransition(()=>{c(a,r?"replace":"push",!1===s?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,n.current,o)})}}(t,W,S,N,A,P,E)},onMouseEnter(e){G||"function"!=typeof $||$(e),G&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),L&&T&&(0,h.onNavigationIntent)(e.currentTarget,!0===I)},onTouchStart:function(e){G||"function"!=typeof O||O(e),G&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),L&&T&&(0,h.onNavigationIntent)(e.currentTarget,!0===I)}};return(0,c.isAbsoluteUrl)(W)?q.href=W:G&&!w&&("a"!==s.type||"href"in s.props)||(q.href=(0,p.addBasePath)(W)),b=G?i.default.cloneElement(s,q):(0,l.jsx)("a",{...B,...q,children:r}),(0,l.jsx)(y.Provider,{value:v,children:b})}e.r(84508);let y=(0,i.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,i.useContext)(y);("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},8734,e=>{"use strict";let t=(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,t],8734)},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)},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)},11241,e=>{"use strict";let t=(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,t],11241)},59665,5142,e=>{"use strict";var t=e.i(18050),a=e.i(71645);let n=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);function r(e=!1,t={}){let[n,s]=(0,a.useState)(e),l=(0,a.useCallback)(()=>{s(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),i=(0,a.useCallback)(()=>{s(e=>e?(t.onClose?.(),!1):e)},[t.onClose]);return[n,{open:l,close:i,toggle:(0,a.useCallback)(()=>{n?i():l()},[i,l,n]),set:s}]}e.s(["useDisclosure",0,r],5142);let s=(0,a.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:l,headerRight:i,children:o}){let[u,d]=r(!1),[c,p]=(0,a.useState)(!1),f=function(e,{getInitialValueInEffect:t}={getInitialValueInEffect:!0}){let[n,r]=(0,a.useState)(t?void 0:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches);return(0,a.useEffect)(()=>{try{if("matchMedia"in window){let t=window.matchMedia(e);r(t.matches);let a=e=>r(e.matches);return t.addEventListener("change",a),()=>{t.removeEventListener("change",a)}}}catch(e){return}},[e]),n||!1}("(max-width: 768px)"),h=()=>{f?d.open():p(!1)};return(0,t.jsx)(s.Provider,{value:{closeSidebar:d.close,openSidebar:h,isSidebarVisible:f?u:!c},children:(0,t.jsxs)("div",{className:"app-layout",children:[(0,t.jsx)("div",{className:`sidebar-overlay ${u?"visible":""}`,onClick:()=>d.close()}),(0,t.jsx)("div",{className:`sidebar ${u?"open":""} ${c?"collapsed":""}`,children:e({closeSidebar:d.close,openSidebar:h})}),(0,t.jsxs)("div",{className:"main-content",children:[(0,t.jsxs)("header",{className:"app-header",children:[(0,t.jsxs)("div",{className:"header-left",children:[(0,t.jsx)("button",{onClick:()=>{f?d.toggle():p(!c)},className:"btn btn-icon sidebar-toggle-btn","aria-label":f?"打开菜单":c?"展开侧边栏":"收起侧边栏",children:(0,t.jsx)(n,{size:16})}),l]}),(0,t.jsx)("div",{className:"header-right",children:i})]}),o]})]})})},"useAppShell",0,function(){let e=(0,a.useContext)(s);if(!e)throw Error("useAppShell must be used within AppShell");return e}],59665)},27648,e=>{"use strict";var t=e.i(18050),a=e.i(93957),n=e.i(71192);e.s(["default",0,function({className:e=""}){let r=(0,n.useUserStore)(e=>e.identity),s=(0,n.useUserStore)(e=>e.openLoginModal),l=(0,n.useUserStore)(e=>e.logoutUser);return(0,t.jsxs)("div",{className:`chat-sidebar-footer sidebar-account ${e}`,children:[(0,t.jsxs)("div",{className:"user-info",children:[(0,t.jsx)("img",{className:"user-avatar-img",src:(0,a.generateAvatar)(r?.address,r?.avatar),alt:"avatar"}),(0,t.jsx)("span",{className:"user-name",title:r?.address,children:r?.displayName||"未登录"})]}),r?(0,t.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:l,children:"退出"}):(0,t.jsx)("button",{className:"btn btn-primary login-btn",onClick:s,children:"登录"})]})}])},87884,e=>{"use strict";var t=e.i(26913);e.s(["channelApi",0,{getChannels(e={}){let a=new URLSearchParams;e.type&&a.set("type",e.type),e.excludeType&&a.set("excludeType",e.excludeType);let n=a.toString();return t.api.get(n?`/api/channels?${n}`:"/api/channels").json()},createChannel:(e,a="personal")=>t.api.post("/api/channels",{json:{name:e,type:a}}).json(),leaveChannel:e=>t.api.delete(`/api/channels/${encodeURIComponent(e)}`).json(),getChannelMessages:(e,a=100,n=0)=>t.api.get(`/api/channels/${encodeURIComponent(e)}/messages?limit=${a}&offset=${n}`).json(),sendChannelMessage:({channelName:e,content:a,author:n,authorName:r,attachment:s})=>t.api.post(`/api/channels/${encodeURIComponent(e)}/messages`,{json:s?{content:a,author:n,authorName:r,attachment:s}:{content:a,author:n,authorName:r}}).json(),getChannelPeers:e=>t.api.get(`/api/channels/${encodeURIComponent(e)}/peers`).json(),setChannelRemark:(e,a)=>t.api.put(`/api/channels/${encodeURIComponent(e)}/remark`,{json:{remark:a}}).json()}])},23952,e=>{"use strict";var t=e.i(71645),a=e.i(87884),n=e.i(26913);function r(e){return String(e.id||`${e.author||""}-${e.timestamp||""}-${e.content||""}`)}e.s(["useChannelMessages",0,function({isReady:e,enabled:s=!0,channelName:l="",peerId:i="",waitForPeerId:o=!1,limit:u=100,reconnectBaseDelay:d=2500,acceptMessage:c,getMessageKey:p=r,onSyncError:f,onSocketEvent:h}){let[m,g]=(0,t.useState)([]),[b,y]=(0,t.useState)(!1),v=(0,t.useRef)(null),_=(0,t.useRef)(l),S=(0,t.useRef)(null),j=(0,t.useRef)(0),x=(0,t.useRef)(c),C=(0,t.useRef)(p),k=(0,t.useRef)(h),w=(0,t.useRef)(f),N=(0,t.useRef)(i);(0,t.useEffect)(()=>{x.current=c},[c]),(0,t.useEffect)(()=>{C.current=p},[p]),(0,t.useEffect)(()=>{k.current=h},[h]),(0,t.useEffect)(()=>{w.current=f},[f]);let M=(0,t.useCallback)(e=>{let t=x.current;return t?e.filter(t):e},[]),A=(0,t.useCallback)((e,t,a=!0)=>{let n=[...e];for(let e of M(t)){let t=C.current(e);if(a){let a=n.findIndex(t=>t.pending&&t.author?.toLowerCase()===e.author?.toLowerCase()&&t.content===e.content);if(-1!==a){n[a]={...e,id:e.id||t};continue}}n.some(e=>C.current(e)===t)||n.push({...e,id:e.id||t})}return n},[M]),R=(0,t.useCallback)((e,t)=>{v.current?.readyState===WebSocket.OPEN&&v.current.send(JSON.stringify({event:e,data:t}))},[]),$=(0,t.useCallback)(e=>{e&&R("channel:subscribe",{channel:e})},[R]),O=(0,t.useCallback)(e=>{e&&R("channel:unsubscribe",{channel:e})},[R]),G=(0,t.useCallback)(async(t=_.current,n={})=>{if(!t||!e)return[];try{let e=M(await a.channelApi.getChannelMessages(t,u));return g(t=>n.replace?e:A(t,e,!1)),e}catch(e){return n.replace&&g([]),await w.current?.(e),[]}},[M,e,u,A]);(0,t.useEffect)(()=>{N.current=i,i&&(R("register",{peerId:i}),o&&_.current&&($(_.current),G(_.current,{replace:!0})))},[i,$,G,o,R]);let P=(0,t.useCallback)(()=>{g([])},[]),E=(0,t.useCallback)(async({channelName:e=_.current,content:t,author:n,authorName:r,attachment:s,optimisticId:l})=>{let i=t.trim();if(!e||!i)return null;let o={id:l||`${n}-${Date.now()}-${Math.random().toString(36).slice(2)}`,author:n,authorName:r,content:i,timestamp:Date.now(),pending:!0,attachment:s};g(e=>[...e,o]);try{let t=await a.channelApi.sendChannelMessage({channelName:e,content:i,author:n,authorName:r,attachment:s});return g(e=>e.map(e=>e.id===o.id?{...t.message,id:t.message.id||C.current(t.message)}:e)),t.message}catch(e){throw g(e=>e.filter(e=>e.id!==o.id)),e}},[]);return(0,t.useEffect)(()=>{let t=_.current;if(_.current=l,t&&t!==l&&O(t),l&&e&&s)return G(l,{replace:!0}),(!o||N.current)&&$(l),()=>O(l)},[l,s,e,$,G,O,o]),(0,t.useEffect)(()=>{if(!e||!s)return void y(!1);let t=!1;async function a(){let e=new WebSocket(await (0,n.getAuthenticatedWebSocketUrl)("/ws"));t?e.close():(e.onopen=()=>{y(!0),j.current=0,N.current&&e.send(JSON.stringify({event:"register",data:{peerId:N.current}})),_.current&&(!o||N.current)&&($(_.current),G(_.current,{replace:!0}))},e.onmessage=e=>{try{let t=JSON.parse(e.data);k.current?.(t.event,t.data),"channel:message"===t.event&&t.data?.channel===_.current&&t.data?.message&&g(e=>A(e,[t.data.message]))}catch{}},e.onclose=()=>{if(y(!1),t)return;let e=j.current;if(e>=20)return;let n=Math.min(d*Math.pow(2,e),3e4);j.current=e+1,S.current=setTimeout(a,n)},e.onerror=()=>e.close(),v.current=e)}return j.current=0,a(),()=>{t=!0,S.current&&clearTimeout(S.current),v.current?.close(),v.current=null}},[s,e,A,d,$,G,o]),{clearMessages:P,connected:b,messages:m,sendMessage:E,setMessages:g,syncMessages:G}}])},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)},53881,53751,99591,34471,e=>{"use strict";var t=e.i(18050),a=e.i(22016),n=e.i(11241),r=e.i(56420);let s=(0,r.default)("spade",[["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"M2 14.499a5.5 5.5 0 0 0 9.591 3.675.6.6 0 0 1 .818.001A5.5 5.5 0 0 0 22 14.5c0-2.29-1.5-4-3-5.5l-5.492-5.312a2 2 0 0 0-3-.02L5 8.999c-1.5 1.5-3 3.2-3 5.5",key:"1aw2pz"}]]);e.s(["Spade",0,s],53751);let l=(0,r.default)("swords",[["polyline",{points:"14.5 17.5 3 6 3 3 6 3 17.5 14.5",key:"1hfsw2"}],["line",{x1:"13",x2:"19",y1:"19",y2:"13",key:"1vrmhu"}],["line",{x1:"16",x2:"20",y1:"16",y2:"20",key:"1bron3"}],["line",{x1:"19",x2:"21",y1:"21",y2:"19",key:"13pww6"}],["polyline",{points:"14.5 6.5 18 3 21 3 21 6 17.5 9.5",key:"hbey2j"}],["line",{x1:"5",x2:"9",y1:"14",y2:"18",key:"1hf58s"}],["line",{x1:"7",x2:"4",y1:"17",y2:"20",key:"pidxm4"}],["line",{x1:"3",x2:"5",y1:"19",y2:"21",key:"1pehsh"}]]);var i=e.i(27648);let o=[{id:"gandengyan",label:"干瞪眼",href:"/game/gandengyan/",icon:(0,t.jsx)(l,{size:16})},{id:"zhajinhua",label:"炸金花",href:"/game/zhajinhua/",icon:(0,t.jsx)(s,{size:16})}];e.s(["default",0,function({activeGame:e,closeSidebar:r}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:"/",className:"sidebar-header sidebar-header-link",children:[(0,t.jsx)(n.ArrowLeft,{size:18}),(0,t.jsx)("h1",{children:"MOST PEOPLE"})]}),(0,t.jsx)("nav",{className:"sidebar-nav",children:o.map(n=>(0,t.jsxs)(a.default,{href:n.href,className:`sidebar-nav-btn ${e===n.id?"active":""}`,onClick:r,children:[n.icon,(0,t.jsx)("span",{children:n.label})]},n.id))}),(0,t.jsx)(i.default,{})]})}],53881);var u=e.i(71645);let d="game",c="mostbox.game.event",p=["gandengyan","zhajinhua"],f="ABCDEFGHJKLMNPQRSTUVWXYZ23456789";function h(e){let t=String(e||"").trim().toLowerCase();return p.includes(t)?t:""}function m(e){return String(e||"").trim().toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,8)}function g(e){return/^[A-Z0-9]{4,8}$/.test(String(e||""))}function b(){let e="";for(let t=0;t<6;t++)e+=f[function(e){if(globalThis.crypto?.getRandomValues){let t=new Uint32Array(1);return globalThis.crypto.getRandomValues(t),t[0]%e}return Math.floor(Math.random()*e)}(f.length)];return e}function y(e,t){let a=h(e),n=m(t);return a&&g(n)?`game-${a}-${n.toLowerCase()}`:""}function v({gameId:e,roomCode:t,event:a,payload:n}){var r;let s=h(e);return{kind:c,version:1,gameId:s,roomCode:m(t),event:String(a||""),eventId:(r=s||"game",`${r}_${Date.now()}_${function(){let e=new Uint8Array(4);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(e);else for(let t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random());return[...e].map(e=>e.toString(16).padStart(2,"0")).join("")}()}`),payload:n||{}}}function _(e,t={}){try{let a=JSON.parse(String(e||""));if(!a||a.kind!==c||1!==a.version||"string"!=typeof a.event||"string"!=typeof a.eventId)return null;let n=h(a.gameId),r=m(a.roomCode);if(!n||!g(r)||t.gameId&&n!==h(t.gameId)||t.roomCode&&r!==m(t.roomCode))return null;return{...a,gameId:n,roomCode:r,payload:a.payload&&"object"==typeof a.payload?a.payload:{}}}catch{return null}}function S(e,t){var a;if(!e||"object"!=typeof e)return null;let n=j(e.address||t);if(!n||j(t)!==n)return null;let r=String(e.name||"").trim().slice(0,50)||((a=n)?`${a.slice(0,6)}...${a.slice(-4)}`:"");return{address:n,name:r,publicKey:String(e.publicKey||"").trim(),joinedAt:Number(e.joinedAt||Date.now())}}function j(e){let t=String(e||"").trim();return/^0x[a-fA-F0-9]{40}$/.test(t)?t.toLowerCase():""}function x(e,t,a){let n=t.get(a.address);n?Object.assign(n,a):(e.push(a),t.set(a.address,a))}function C(e){return[...e].sort((e,t)=>Number(e.timestamp||0)-Number(t.timestamp||0))}e.s(["GAME_CHANNEL_TYPE",0,d,"createGameEvent",0,v,"createGameRoomCode",0,b,"deriveGameRoomLobby",0,function(e=[],t={}){let a=[],n=new Map,r="";for(let s of C(e)){let e=_(s.content,t);if(e){if("room:create"===e.event){let t=S(e.payload?.player,s.author);if(!t)continue;r||(r=t.address),x(a,n,t);continue}if("player:join"===e.event){let t=S(e.payload?.player,s.author);t&&x(a,n,t)}}}return{gameId:h(t.gameId),roomCode:m(t.roomCode),hostAddress:r,players:a}},"gameRoomCodeToChannelName",0,y,"getLatestGameState",0,function(e=[],t={}){let a=null;for(let n of C(e)){let e=_(n.content,t);if(!e||"room:state"!==e.event)continue;let r=Number(e.payload?.seq||0);(!a||r>=Number(a.payload?.seq||0))&&(a=e)}return a},"normalizeGameRoomCode",0,m,"parseGameEvent",0,_],99591);var k=e.i(87884),w=e.i(23952),N=e.i(26913),M=e.i(3593),A=e.i(71192);async function R(e,t,a,n,r,s){let l=v({gameId:a,roomCode:n,event:r,payload:s});await k.channelApi.sendChannelMessage({channelName:e,content:JSON.stringify(l),author:t.address,authorName:$(t)})}function $(e){return e.displayName||e.username}e.s(["useGameRoom",0,function({gameId:e,onError:t,getPlayerPayload:a}){let n=(0,M.useAppStore)(e=>e.hasBackend),r=(0,M.useAppStore)(e=>e.checkBackend),s=(0,M.useAppStore)(e=>e.openConnectModal),l=(0,A.useUserStore)(e=>e.identity),i=(0,A.useUserStore)(e=>e.openLoginModal),[o,c]=(0,u.useState)(""),[p,f]=(0,u.useState)(""),[h,g]=(0,u.useState)(!1),S=!0===n,j=(0,u.useCallback)(async(e,a)=>{let n=await (0,N.getApiErrorMessage)(e,a);t&&t(n)},[t]),x=(0,u.useCallback)(t=>!!_(t.content,{gameId:e,roomCode:o}),[e,o]),C=(0,u.useCallback)(t=>{let a=_(t.content,{gameId:e,roomCode:o});return a?`${t.author}-${a.eventId}`:`${t.author}-${t.timestamp}-${t.content}`},[e,o]),{clearMessages:O,connected:G,messages:P,sendMessage:E,syncMessages:H}=(0,w.useChannelMessages)({isReady:S,enabled:!!l,channelName:p,limit:500,acceptMessage:x,getMessageKey:C,onSyncError:e=>j(e,"无法读取房间记录")}),I=(0,u.useMemo)(()=>P.map(t=>({message:t,event:_(t.content,{gameId:e,roomCode:o})})).filter(e=>e.event),[e,P,o]),B=(0,u.useCallback)(()=>l?!!S||(s(),!1):(i(),!1),[S,s,i,l]);(0,u.useEffect)(()=>{null===n&&r()},[r,n]);let L=(0,u.useCallback)(async(n,r=!1)=>{if(!B()||!l)return!1;let s=r?b():m(n),i=y(e,s);if(!i)return t&&t("请输入 4-8 位房间码"),!1;g(!0);try{var o;return await k.channelApi.createChannel(i,d),await R(i,l,e,s,r?"room:create":"player:join",{player:a?a(l):{address:(o=l).address,name:$(o),publicKey:"",joinedAt:Date.now()}}),c(s),f(i),O(),!0}catch(e){return await j(e,r?"创建房间失败":"进入房间失败"),!1}finally{g(!1)}},[B,e,a,t,j,O,l]),T=(0,u.useCallback)(()=>L("",!0),[L]),U=(0,u.useCallback)(e=>L(e),[L]),W=(0,u.useCallback)(async(t,a={})=>{if(!B()||!l||!p||!o)return!1;let n=v({gameId:e,roomCode:o,event:t,payload:a}),r=JSON.stringify(n);try{return await E({channelName:p,content:r,author:l.address,authorName:$(l),optimisticId:`${l.address}-${n.eventId}`}),!0}catch(e){return await j(e,"发送房间事件失败"),!1}},[p,B,e,j,o,E,l]);return{channelName:p,connected:G,createRoom:T,ensureReady:B,isBackendReady:S,joinRoom:U,joining:h,messages:P,roomCode:o,roomEvents:I,sendRoomEvent:W,setRoomCode:c,syncMessages:H,userIdentity:l}}],34471)},45309,e=>{e.v({accountLine:"page-module__bH9uOG__accountLine",actions:"page-module__bH9uOG__actions",active:"page-module__bH9uOG__active",avatar:"page-module__bH9uOG__avatar",badges:"page-module__bH9uOG__badges",black:"page-module__bH9uOG__black",card:"page-module__bH9uOG__card",cardButton:"page-module__bH9uOG__cardButton",cardMark:"page-module__bH9uOG__cardMark",centerTable:"page-module__bH9uOG__centerTable",dangerBadge:"page-module__bH9uOG__dangerBadge",deckBox:"page-module__bH9uOG__deckBox",entry:"page-module__bH9uOG__entry",entryBrand:"page-module__bH9uOG__entryBrand",entryPanel:"page-module__bH9uOG__entryPanel",gameGrid:"page-module__bH9uOG__gameGrid",hand:"page-module__bH9uOG__hand",handPanel:"page-module__bH9uOG__handPanel",headerActions:"page-module__bH9uOG__headerActions",joinForm:"page-module__bH9uOG__joinForm",logPanel:"page-module__bH9uOG__logPanel",notice:"page-module__bH9uOG__notice",page:"page-module__bH9uOG__page",panel:"page-module__bH9uOG__panel",picked:"page-module__bH9uOG__picked",playedBox:"page-module__bH9uOG__playedBox",playedCards:"page-module__bH9uOG__playedCards",player:"page-module__bH9uOG__player",preview:"page-module__bH9uOG__preview",red:"page-module__bH9uOG__red",roomBar:"page-module__bH9uOG__roomBar",scoreMeta:"page-module__bH9uOG__scoreMeta",scoreRow:"page-module__bH9uOG__scoreRow",seats:"page-module__bH9uOG__seats",sidePanel:"page-module__bH9uOG__sidePanel",small:"page-module__bH9uOG__small",status:"page-module__bH9uOG__status",tablePanel:"page-module__bH9uOG__tablePanel",valid:"page-module__bH9uOG__valid",winner:"page-module__bH9uOG__winner"})},31678,e=>{"use strict";var t=e.i(18050),a=e.i(71645),n=e.i(8734),r=e.i(96699),s=e.i(21357);let l=(0,e.i(56420).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 i=e.i(30274),o=e.i(35965),u=e.i(59665),d=e.i(53881),c=e.i(34471),p=e.i(3593),f=e.i(71192);let h=["S","H","C","D"],m=["3","4","5","6","7","8","9","10","J","Q","K","A","2"],g=m.filter(e=>"2"!==e),b=new Map(m.map((e,t)=>[e,t+3]));function y(e){return e?{id:e.id,ownerAddress:e.ownerAddress,status:e.status,seq:Number(e.seq||1),deckCount:e.deck?.length||Number(e.deckCount||0),discardCount:e.discard?.length||Number(e.discardCount||0),currentSeat:Number(e.currentSeat||0),lastWinnerSeat:null===e.lastWinnerSeat||void 0===e.lastWinnerSeat?null:Number(e.lastWinnerSeat),previousWinnerSeat:null===e.previousWinnerSeat||void 0===e.previousWinnerSeat?null:Number(e.previousWinnerSeat),baseScore:Number(e.baseScore||1),bombCount:Number(e.bombCount||0),diceRolls:Array.isArray(e.diceRolls)?e.diceRolls:[],roundResult:e.roundResult||null,table:e.table?{...e.table,cards:e.table.cards.map(E)}:null,passSeats:Array.isArray(e.passSeats)?e.passSeats:[],winnerSeat:null===e.winnerSeat||void 0===e.winnerSeat?null:Number(e.winnerSeat),log:Array.isArray(e.log)?e.log.slice(0,18):[],players:M(e).map(e=>({address:e.address,name:e.name,seat:e.seat,handCount:e.hand?.length??e.handCount??0,score:Number(e.score??1e3),playedCards:Number(e.playedCards||0),hand:Array.isArray(e.hand)?e.hand.map(E):[]}))}:null}function v(e){return e&&"object"==typeof e?{id:String(e.id||"").toUpperCase(),ownerAddress:T(e.ownerAddress),status:"playing"===e.status||"finished"===e.status?e.status:"lobby",seq:Number(e.seq||1),players:Array.isArray(e.players)?e.players.map(x).filter(Boolean):[],deck:Array.isArray(e.deck)?e.deck.map(C).filter(Boolean):[],discard:Array.isArray(e.discard)?e.discard.map(C).filter(Boolean):[],table:e.table&&"object"==typeof e.table?{...e.table,cards:Array.isArray(e.table.cards)?e.table.cards.map(C).filter(Boolean):[]}:null,currentSeat:Number(e.currentSeat||0),lastWinnerSeat:null===e.lastWinnerSeat||void 0===e.lastWinnerSeat?null:Number(e.lastWinnerSeat),previousWinnerSeat:null===e.previousWinnerSeat||void 0===e.previousWinnerSeat?null:Number(e.previousWinnerSeat),passSeats:Array.isArray(e.passSeats)?e.passSeats.map(Number):[],baseScore:Number(e.baseScore||1),bombCount:Number(e.bombCount||0),diceRolls:Array.isArray(e.diceRolls)?e.diceRolls:[],roundResult:e.roundResult||null,log:Array.isArray(e.log)?e.log.map(String):[],winnerSeat:null===e.winnerSeat||void 0===e.winnerSeat?null:Number(e.winnerSeat)}:null}function _(e){if(!e?.length)return null;let t=e.filter(G).length,a=e.filter(e=>!G(e));if(0===a.length)return null;let n=function(e,t,a){if(e.length<3||!R(t,a))return null;let n=function(e){return O(e[0])}(t);return S("bomb",n,e.length,Array(e.length).fill(n),0===a)}(e,a,t);if(n)return n;if(1===e.length&&0===t)return S("single",O(e[0]),1,[O(e[0])]);if(2===e.length&&R(a,t)){let e=O(a[0]);return S("pair",e,2,[e,e])}return function(e){if(e.length<3)return null;for(let t=0;t<=g.length-e.length;t+=1){let a=g.slice(t,t+e.length).map(e=>b.get(e));if(e.every((e,t)=>G(e)||O(e)===a[t]))return S("straight",a.at(-1),e.length,a)}return null}(e)||function(e){if(e.length<4||e.length%2!=0)return null;let t=e.length/2;for(let a=0;a<=g.length-t;a+=1){let n=g.slice(a,a+t).map(e=>b.get(e)),r=n.flatMap(e=>[e,e]);if(e.every((e,t)=>G(e)||O(e)===r[t]))return S("pairStraight",n.at(-1),e.length,r)}return null}(e)}function S(e,t,a,n,r=!0){var s;let l;return{type:e,value:t,length:a,resolvedValues:n,pure:r,label:(s={type:e,value:t,length:a,resolvedValues:n,pure:r},l=s.resolvedValues?.length?`(${s.resolvedValues.map(B).join(" ")})`:"",`${({single:"单张",pair:"对子",straight:"顺子",pairStraight:"连对",bomb:s.pure?"纯炸弹":"带王炸弹"})[s.type]}${l}`)}}function j(e){let t=new Set;return e.map(e=>({address:T(e.address),name:U(e.name),publicKey:String(e.publicKey||"")})).filter(e=>!(!e.address||t.has(e.address))&&(t.add(e.address),!0))}function x(e){let t=T(e.address);return t?{address:t,name:U(e.name),seat:Number(e.seat||0),hand:Array.isArray(e.hand)?e.hand.map(C).filter(Boolean):[],handCount:Number(e.handCount||0),score:Number(e.score??1e3),playedCards:Number(e.playedCards||0)}:null}function C(e){if(!e||"object"!=typeof e)return null;let t=String(e.rank||""),a=String(e.suit||"");return(b.has(t)||"SJ"===t||"BJ"===t)&&(h.includes(a)||"Joker"===a)?{id:String(e.id||`${a}-${t}`),suit:a,rank:t,label:e.label||H({suit:a,rank:t}),color:e.color||I({suit:a,rank:t})}:null}function k(e,t){return e.deck.splice(0,t)}function w(e){return e.players.find(t=>t.seat===e.currentSeat)}function N(e){return M(e).filter(e=>e.hand.length>0)}function M(e){return[...e?.players||[]].sort((e,t)=>e.seat-t.seat)}function A(e){let t=N(e).map(e=>e.seat),a=t.indexOf(e.currentSeat);e.currentSeat=t[(a+1)%t.length]}function R(e,t=0){if(0===e.length)return!1;let a=e[0].rank;return e.every(e=>e.rank===a)&&e.length+t>=2}function $(e,t){return O(e)-O(t)||P(e.suit)-P(t.suit)}function O(e){return b.get(e.rank)||99}function G(e){return"SJ"===e.rank||"BJ"===e.rank}function P(e){return({D:0,C:1,H:2,S:3,Joker:4})[e]||0}function E(e){return{id:e.id,suit:e.suit,rank:e.rank,label:H(e),color:I(e)}}function H(e){return"SJ"===e.rank?"小王":"BJ"===e.rank?"大王":`${({S:"♠",H:"♥",C:"♣",D:"♦"})[e.suit]||""}${e.rank}`}function I(e){return"H"===e.suit||"D"===e.suit||"BJ"===e.rank?"red":"black"}function B(e){return m.find(t=>b.get(t)===e)||String(e)}function L(e){let t=m.findIndex(t=>b.get(t)===e);return -1===t||t>=m.length-1?null:b.get(m[t+1])}function T(e){let t=String(e||"").trim();return/^0x[a-fA-F0-9]{40}$/.test(t)?t.toLowerCase():""}function U(e){return String(e||"玩家").trim().slice(0,16)||"玩家"}var W=e.i(99591),z=e.i(45309);let J="gandengyan";function q(...e){return e.filter(Boolean).join(" ")}function D(e,t){return String(e||"").toLowerCase()===String(t||"").toLowerCase()}function K({player:e,active:a,winner:n,relation:r=""}){return e?(0,t.jsxs)("div",{className:q(z.default.player,a&&z.default.active,n&&z.default.winner),children:[(0,t.jsx)("div",{className:z.default.avatar,children:e.name.slice(0,1)}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:e.name}),(0,t.jsxs)("span",{children:[r,r?" · ":"",e.handCount," 张"]})]})]}):null}function F({card:e,small:a=!1}){return(0,t.jsxs)("div",{className:q(z.default.card,z.default[e.color],a&&z.default.small),children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("i",{children:"Joker"===e.suit?"*":e.label.slice(0,1)})]})}e.s(["default",0,function(){let e=(0,p.useAppStore)(e=>e.isDarkMode),g=(0,p.useAppStore)(e=>e.setIsDarkMode),S=(0,p.useAppStore)(e=>e.addToast),x=(0,f.useUserStore)(e=>e.initializeUser),[C,R]=(0,a.useState)(""),[O,G]=(0,a.useState)([]),[P,I]=(0,a.useState)(!1),B=(0,c.useGameRoom)({gameId:J,onError:e=>S(e,"error")});(0,a.useEffect)(()=>{x()},[x]),(0,a.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get("room")?.toUpperCase();e&&R(e)},[]),(0,a.useEffect)(()=>{if(!B.roomCode)return;let e=`/game/gandengyan?room=${B.roomCode}`;`${window.location.pathname}${window.location.search}`!==e&&window.history.replaceState(null,"",e)},[B.roomCode]);let V=(0,a.useMemo)(()=>(0,W.deriveGameRoomLobby)(B.messages,B.roomCode?{gameId:J,roomCode:B.roomCode}:{gameId:J}),[B.messages,B.roomCode]),Q=(0,a.useMemo)(()=>(0,W.getLatestGameState)(B.messages,{gameId:J,roomCode:B.roomCode}),[B.messages,B.roomCode]),X=Q?.payload?.state,Z=X?.players.find(e=>D(e.address,B.userIdentity?.address)),Y=D(X?.ownerAddress||V.hostAddress,B.userIdentity?.address),ee=X?.status==="playing"&&X.currentSeat===Z?.seat,et=(0,a.useMemo)(()=>O.map(e=>Z?.hand.find(t=>t.id===e)).filter(Boolean),[O,Z]),ea=(0,a.useMemo)(()=>_(et),[et]),en=B.roomCode&&1?`${window.location.origin}/game/gandengyan?room=${B.roomCode}`:"",er=!!(X&&"playing"===X.status&&X.deckCount<3);async function es(){await B.createRoom()&&S("房间已创建","success")}async function el(e){e.preventDefault(),await B.joinRoom(C)&&S("已进入房间","success")}async function ei(){en&&(await navigator.clipboard.writeText(en),I(!0),setTimeout(()=>I(!1),1400))}async function eo(e){await B.sendRoomEvent("room:state",{state:e,seq:e.seq})}async function eu(){if(X&&Y)try{await eo(function(e,t=Math.random){let a=v(e);if(!a||a.players.length<2)throw Error("至少需要 2 名玩家");for(let e of(a.deck=function(e,t){let a=[...e];for(let e=a.length-1;e>0;e-=1){let n=Math.floor(t()*(e+1));[a[e],a[n]]=[a[n],a[e]]}return a}(function(){let e=[];for(let t of h)for(let a of m)e.push({id:`${t}-${a}`,suit:t,rank:a});return e.push({id:"SJ",suit:"Joker",rank:"SJ"}),e.push({id:"BJ",suit:"Joker",rank:"BJ"}),e.map(E)}(),t),a.discard=[],a.table=null,a.passSeats=[],a.winnerSeat=null,a.roundResult=null,a.baseScore=1,a.bombCount=0,a.status="playing",M(a)))e.hand=k(a,5),e.handCount=e.hand.length,e.playedCards=0,e.hand.sort($);let n=function(e,t){if(null!==e.previousWinnerSeat)return e.diceRolls=[],M(e).find(t=>t.seat===e.previousWinnerSeat)||M(e)[0];let a=M(e),n=[];for(;a.length>1;){let r=Math.max(...(n=a.map(e=>{var a;return{seat:e.seat,name:e.name,value:(a=t,Math.floor(6*a())+1)}})).map(e=>e.value)),s=n.filter(e=>e.value===r);if(1===s.length)return e.diceRolls=n,a.find(e=>e.seat===s[0].seat);a=a.filter(e=>s.some(t=>t.seat===e.seat))}return e.diceRolls=n,a[0]}(a,t);return a.currentSeat=n.seat,a.lastWinnerSeat=null,a.log=[`新一局开始,${n.name} 先出牌`],a.diceRolls.length>0&&a.log.unshift(`骰子结果:${a.diceRolls.map(e=>`${e.name} ${e.value}`).join(",")}`),a.seq+=1,y(a)}(X))}catch(e){S(e instanceof Error?e.message:"开局失败","error")}}async function ed(){await eu()}async function ec(){if(!X||!B.userIdentity)return;let e=function(e,t,a){var n,r;let s=v(e),l=w(s),i=T(t);if(!l||l.address!==i)return{ok:!1,error:"还没轮到你",state:y(s)};let o=a.map(e=>l.hand.find(t=>t.id===e));if(0===o.length||o.some(e=>!e))return{ok:!1,error:"手牌不存在",state:y(s)};let u=_(o);return u?(n=u,r=s.table?.combo,n&&(!r||"bomb"===n.type&&"bomb"!==r.type||n.type===r.type&&("bomb"===n.type?n.length!==r.length?n.length>r.length:n.value!==r.value?n.value>r.value:n.pure&&!r.pure:n.length===r.length&&("single"===n.type||"pair"===n.type?n.value===L(r.value)||n.value===b.get("2")&&r.value!==b.get("2"):n.value===L(r.value)))))?(l.hand=l.hand.filter(e=>!a.includes(e.id)),l.handCount=l.hand.length,l.playedCards+=o.length,s.discard.push(...o),s.table={seat:l.seat,playerName:l.name,cards:o,combo:u},s.passSeats=[],s.lastWinnerSeat=l.seat,"bomb"===u.type&&(s.bombCount+=1,s.baseScore*=2),s.log.unshift(`${l.name} 出 ${u.label} ${o.map(H).join(" ")}${"bomb"===u.type?`,底分 ${s.baseScore}`:""}`),0===l.hand.length?function(e,t){e.status="finished",e.winnerSeat=t.seat,e.previousWinnerSeat=t.seat;let a=[],n=0;for(let r of M(e)){if(r.seat===t.seat)continue;let s=0===r.playedCards,l=s?15:r.hand.length*e.baseScore;r.score-=l,n+=l,a.push({seat:r.seat,name:r.name,loss:l,sealed:s,cardsLeft:r.hand.length})}t.score+=n,e.roundResult={winnerSeat:t.seat,winnerName:t.name,winnerGain:n,baseScore:e.baseScore,bombCount:e.bombCount,losers:a},e.log.unshift(`${t.name} 获胜,赢 ${n} 分`)}(s,l):A(s),s.seq+=1,{ok:!0,state:y(s)}):{ok:!1,error:"出的牌压不过上一手",state:y(s)}:{ok:!1,error:"这个牌型不合法",state:y(s)}}(X,B.userIdentity.address,O);e.ok?await eo(e.state):S(e.error||"出牌失败","error")}async function ep(){var e;let t,a,n;if(!X||!B.userIdentity)return;let r=(e=B.userIdentity.address,a=w(t=v(X)),n=T(e),a&&a.address===n?t.table?(t.passSeats.includes(a.seat)||t.passSeats.push(a.seat),t.log.unshift(`${a.name} 不要`),N(t).map(e=>e.seat).filter(e=>e!==t.lastWinnerSeat).every(e=>t.passSeats.includes(e))?(function(e){for(let t of N(e)){if(0===e.deck.length)break;t.hand.push(...k(e,1)),t.handCount=t.hand.length,t.hand.sort($)}}(t),t.currentSeat=t.lastWinnerSeat,t.table=null,t.passSeats=[],t.log.unshift("本轮结束,所有玩家各补 1 张,重新领出")):A(t),t.seq+=1,{ok:!0,state:y(t)}):{ok:!1,error:"领出时不能不要",state:y(t)}:{ok:!1,error:"还没轮到你",state:y(t)});r.ok?await eo(r.state):S(r.error||"操作失败","error")}return(0,a.useEffect)(()=>{G([])},[X?.seq]),(0,a.useEffect)(()=>{if(!Y||!B.roomCode||!B.userIdentity||Q||0===V.players.length)return;let e=function({roomCode:e,ownerAddress:t,ownerName:a,players:n=[],random:r=Math.random}){let s=j(n);return s.some(e=>e.address===T(t))||s.unshift({address:T(t),name:U(a)}),y({id:String(e||"").toUpperCase(),ownerAddress:T(t),status:"lobby",seq:1,players:s.slice(0,6).map((e,t)=>({address:e.address,name:U(e.name),seat:t,hand:[],handCount:0,score:1e3,playedCards:0})),deck:[],discard:[],table:null,currentSeat:0,lastWinnerSeat:null,previousWinnerSeat:null,passSeats:[],baseScore:1,bombCount:0,diceRolls:[],roundResult:null,log:["房间已创建"],winnerSeat:null,random:r})}({roomCode:B.roomCode,ownerAddress:B.userIdentity.address,ownerName:B.userIdentity.displayName||B.userIdentity.username,players:V.players});B.sendRoomEvent("room:state",{state:e,seq:e.seq})},[B,Y,Q,V.players]),(0,a.useEffect)(()=>{if(!X||!Y||"lobby"!==X.status)return;let e=function(e,t=[]){let a=v(e);if(!a||"lobby"!==a.status)return a;let n=new Map(a.players.map(e=>[e.address,e.score]));return a.players=j(t).slice(0,6).map((e,t)=>({address:e.address,name:U(e.name),seat:t,hand:[],handCount:0,score:n.get(e.address)??1e3,playedCards:0})),a.seq+=1,y(a)}(X,V.players);e&&e.players.length!==X.players.length&&B.sendRoomEvent("room:state",{state:e,seq:e.seq})},[B,Y,V.players,X]),(0,t.jsx)(u.default,{sidebar:({closeSidebar:e})=>(0,t.jsx)(d.default,{activeGame:"gandengyan",closeSidebar:e}),headerTitle:(0,t.jsx)("h2",{className:"header-title",children:"游戏 · 干瞪眼"}),headerRight:(0,t.jsxs)("div",{className:z.default.headerActions,children:[X&&(0,t.jsxs)("button",{className:"btn btn-sm",onClick:ei,children:[(0,t.jsx)(n.Copy,{size:14}),P?"已复制":"分享房间"]}),(0,t.jsx)("button",{className:"btn btn-icon",onClick:()=>g(!e),title:"切换主题",children:e?(0,t.jsx)(o.Sun,{size:16}):(0,t.jsx)(r.Moon,{size:16})})]}),children:(0,t.jsx)("main",{className:z.default.page,children:X?(0,t.jsxs)("section",{className:z.default.gameGrid,children:[(0,t.jsxs)("div",{className:z.default.tablePanel,children:[(0,t.jsxs)("div",{className:z.default.roomBar,children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("strong",{children:["房间 ",X.id]}),(0,t.jsx)("span",{children:"lobby"===X.status?"等待开局":"finished"===X.status?"本局结束":"进行中"})]}),(0,t.jsxs)("div",{className:z.default.badges,children:[er&&(0,t.jsx)("span",{className:z.default.dangerBadge,children:"牌堆不足 3 张"}),(0,t.jsx)("span",{children:B.connected?"在线":"离线"})]})]}),(0,t.jsx)("div",{className:z.default.seats,children:X.players.map(e=>(0,t.jsx)(K,{player:e,active:X.currentSeat===e.seat,winner:X.winnerSeat===e.seat,relation:function(e,t,a){if(!e)return`座位 ${t.seat+1}`;let n=(t.seat-e.seat+a)%a;return 0===n?"我":2===a?"对手位":3===a?1===n?"下家/对手位":"上家/对手位":4===a?1===n?"下家/对手位":2===n?"对家/队友位":"上家/对手位":n%2==0?`座位 ${t.seat+1}/队友位`:`座位 ${t.seat+1}/对手位`}(Z,e,X.players.length)},e.seat))}),(0,t.jsxs)("div",{className:z.default.centerTable,children:[(0,t.jsxs)("div",{className:z.default.deckBox,children:[(0,t.jsx)("span",{children:"牌堆"}),(0,t.jsx)("strong",{children:X.deckCount})]}),(0,t.jsx)("div",{className:z.default.playedBox,children:X.table?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("strong",{children:[X.table.playerName," 出 ",X.table.combo?.label||"牌"]}),(0,t.jsx)("div",{className:z.default.playedCards,children:X.table.cards.map(e=>(0,t.jsx)(F,{card:e,small:!0},e.id))})]}):(0,t.jsx)("span",{children:"等待领出"})}),(0,t.jsxs)("div",{className:z.default.deckBox,children:[(0,t.jsx)("span",{children:"底分"}),(0,t.jsx)("strong",{children:X.baseScore})]})]}),(0,t.jsx)("div",{className:z.default.notice,children:"finished"===X.status?`${X.players.find(e=>e.seat===X.winnerSeat)?.name} 获胜`:ee?"轮到你出牌":`等待 ${X.players.find(e=>e.seat===X.currentSeat)?.name||"玩家"}`})]}),(0,t.jsxs)("aside",{className:z.default.sidePanel,children:[(0,t.jsxs)("section",{className:z.default.panel,children:[(0,t.jsx)("h3",{children:"牌局"}),Y&&"lobby"===X.status&&(0,t.jsxs)("button",{className:"btn btn-primary",disabled:X.players.length<2,onClick:eu,children:[(0,t.jsx)(s.Play,{size:16}),"开始游戏"]}),Y&&"finished"===X.status&&(0,t.jsxs)("button",{className:"btn btn-primary",onClick:ed,children:[(0,t.jsx)(l,{size:16}),"再来一局"]}),!Y&&(0,t.jsx)("p",{className:z.default.status,children:"等待房主操作。"})]}),(0,t.jsxs)("section",{className:z.default.panel,children:[(0,t.jsx)("h3",{children:"分数"}),(0,t.jsxs)("div",{className:z.default.scoreMeta,children:[(0,t.jsxs)("span",{children:["炸弹 ",X.bombCount," 次"]}),(0,t.jsxs)("span",{children:["弃牌 ",X.discardCount," 张"]})]}),X.players.map(e=>(0,t.jsxs)("div",{className:z.default.scoreRow,children:[(0,t.jsx)("span",{children:e.name}),(0,t.jsx)("strong",{children:e.score})]},e.seat))]}),(0,t.jsxs)("section",{className:q(z.default.panel,z.default.logPanel),children:[(0,t.jsx)("h3",{children:"牌局记录"}),X.log.map((e,a)=>(0,t.jsx)("p",{children:e},`${e}-${a}`))]})]}),(0,t.jsxs)("div",{className:z.default.handPanel,children:[(0,t.jsx)(K,{player:Z,active:ee,winner:X.winnerSeat===Z?.seat}),(0,t.jsx)("div",{className:z.default.hand,children:Z?.hand.map(e=>(0,t.jsx)("button",{className:q(z.default.cardButton,O.includes(e.id)&&z.default.picked),onClick:()=>{var t;return t=e.id,void G(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},children:(0,t.jsx)(F,{card:e})},e.id))}),(0,t.jsxs)("div",{className:z.default.actions,children:[(0,t.jsxs)("div",{className:q(z.default.preview,ea&&z.default.valid),children:[(0,t.jsx)("strong",{children:ea?ea.label:O.length?"牌型不合法":"先选牌"}),(0,t.jsx)("span",{children:et.map(e=>e.label).join(" ")||"按选择顺序解释大小王"})]}),(0,t.jsxs)("button",{className:"btn btn-primary",disabled:!ee||0===O.length||!ea,onClick:ec,children:[(0,t.jsx)(i.Send,{size:16}),"出牌"]}),(0,t.jsx)("button",{className:"btn",disabled:!ee||!X.table,onClick:ep,children:"不要"})]})]})]}):(0,t.jsxs)("section",{className:z.default.entry,children:[(0,t.jsxs)("div",{className:z.default.entryBrand,children:[(0,t.jsx)("div",{className:z.default.cardMark,children:"干"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{children:"干瞪眼牌桌"}),(0,t.jsx)("p",{children:"创建房间码邀请朋友加入,房间状态通过 MostBox P2P 频道同步。"})]})]}),(0,t.jsxs)("div",{className:z.default.entryPanel,children:[(0,t.jsxs)("div",{className:z.default.accountLine,children:[(0,t.jsx)("span",{children:"当前账号"}),(0,t.jsx)("strong",{children:B.userIdentity?.displayName||"未登录"})]}),(0,t.jsxs)("button",{className:"btn btn-primary",disabled:B.joining,onClick:es,children:[(0,t.jsx)(s.Play,{size:16}),"创建房间"]}),(0,t.jsxs)("form",{onSubmit:el,className:z.default.joinForm,children:[(0,t.jsxs)("label",{children:["房间号",(0,t.jsx)("input",{value:C,maxLength:8,onChange:e=>R(e.target.value.toUpperCase()),placeholder:"输入房间号"})]}),(0,t.jsx)("button",{className:"btn",disabled:B.joining||!C,children:"加入房间"})]}),(0,t.jsx)("p",{className:z.default.status,children:B.isBackendReady?"节点已连接":"正在连接节点..."})]})]})})})}],31678)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95057,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return o},formatWithValidation:function(){return c},urlObjectKeys:function(){return s}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let a=e.r(90809)._(e.r(98183)),l=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:n}=e,r=e.protocol||"",i=e.pathname||"",o=e.hash||"",s=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),s&&"object"==typeof s&&(s=String(a.urlQueryToSearchParams(s)));let u=e.search||s&&`?${s}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||l.test(r))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),o&&"#"!==o[0]&&(o="#"+o),u&&"?"!==u[0]&&(u="?"+u),i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${r}${c}${i}${u}${o}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return o(e)}},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return i}});let r=e.r(71645);function i(e,t){let n=(0,r.useRef)(null),i=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(n.current=a(e,r)),t&&(i.current=a(t,r))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("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)},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return a}});let r=e.r(18967),i=e.r(52817);function a(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,i.hasBasePath)(n.pathname)}catch(e){return!1}}},84508,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},22016,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return y},useLinkStatus:function(){return x}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let a=e.r(90809),l=e.r(18050),o=a._(e.r(71645)),s=e.r(95057),c=e.r(8372),u=e.r(18581),f=e.r(18967),d=e.r(5550);e.r(33525);let h=e.r(88540),p=e.r(91949),g=e.r(73668),m=e.r(9396);function y(t){var n,r;let i,a,y,[x,k]=(0,o.useOptimistic)(p.IDLE_LINK_STATUS),v=(0,o.useRef)(null),{href:j,as:w,children:M,prefetch:S=null,passHref:E,replace:O,shallow:T,scroll:N,onClick:C,onMouseEnter:z,onTouchStart:P,legacyBehavior:_=!1,onNavigate:L,transitionTypes:I,ref:A,unstable_dynamicOnHover:F,...R}=t;i=M,_&&("string"==typeof i||"number"==typeof i)&&(i=(0,l.jsx)("a",{children:i}));let $=o.default.useContext(c.AppRouterContext),U=!1!==S,D=!1!==S?null===(r=S)||"auto"===r?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,H="string"==typeof(n=w||j)?n:(0,s.formatUrl)(n);if(_){if(i?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=o.default.Children.only(i)}let q=_?a&&"object"==typeof a&&a.ref:A,V=o.default.useCallback(e=>(null!==$&&(v.current=(0,p.mountLinkInstance)(e,H,$,D,U,k)),()=>{v.current&&((0,p.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,p.unmountPrefetchableInstance)(e)}),[U,H,$,D,k]),B={ref:(0,u.useMergedRef)(V,q),onClick(t){_||"function"!=typeof C||C(t),_&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!$||t.defaultPrevented||function(t,n,r,i,a,l,s){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(n)){i&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);o.default.startTransition(()=>{f(n,i?"replace":"push",!1===a?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,r.current,s)})}}(t,H,v,O,N,L,I)},onMouseEnter(e){_||"function"!=typeof z||z(e),_&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),$&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===F)},onTouchStart:function(e){_||"function"!=typeof P||P(e),_&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),$&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===F)}};return(0,f.isAbsoluteUrl)(H)?B.href=H:_&&!E&&("a"!==a.type||"href"in a.props)||(B.href=(0,d.addBasePath)(H)),y=_?o.default.cloneElement(a,B):(0,l.jsx)("a",{...R,...B,children:i}),(0,l.jsx)(b.Provider,{value:x,children:y})}e.r(84508);let b=(0,o.createContext)(p.IDLE_LINK_STATUS),x=()=>(0,o.useContext)(b);("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)},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)},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)},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)},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)},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)},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)},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),r=e.i(22016),i=e.i(62368),a=e.i(96699),l=e.i(35965);function o({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)(r.default,{href:"/",className:"mkt-nav-logo",children:[(0,t.jsx)(o,{}),"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)(l.Sun,{size:16}):(0,t.jsx)(a.Moon,{size:16})}),(0,t.jsxs)(r.default,{href:"/download/",className:"btn btn-secondary mkt-nav-preview",children:[(0,t.jsx)(i.Download,{size:16}),"下载客户端"]}),(0,t.jsx)(r.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 u(){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)(r.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)(u,{})]})}],40983)},23449,e=>{"use strict";let t;var n,r=e.i(18050),i=e.i(71645);let a=Object.freeze({left:0,top:0,width:16,height:16}),l=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),o=Object.freeze({...a,...l}),s=Object.freeze({...o,body:"",hidden:!1});function c(e,t){let n,r,i=(n={},!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0),(r=((e.rotate||0)+(t.rotate||0))%4)&&(n.rotate=r),n);for(let n in s)n in l?n in e&&!(n in i)&&(i[n]=l[n]):n in t?i[n]=t[n]:n in e&&(i[n]=e[n]);return i}function u(e,t){let n,r,i,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,r=e.aliases||Object.create(null),i=Object.create(null),Object.keys(n).concat(Object.keys(r)).forEach(function e(t){if(n[t])return i[t]=[];if(!(t in i)){i[t]=null;let n=r[t]&&r[t].parent,a=n&&e(n);a&&(i[t]=[n].concat(a))}return i[t]}),i);for(let n in l){let r=l[n];r&&(t(n,function(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function l(e){a=c(r[e]||i[e],a)}return l(t),n.forEach(l),c(e,a)}(e,n,r)),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,s))return null}let n=e.aliases||Object.create(null);for(let e in n){let r=n[e],i=r.parent;if(!e||"string"!=typeof i||!t[i]&&!n[i]||!d(r,s))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]+)*$/,b=(e,t,n,r="")=>{let i=e.split(":");if("@"===e.slice(0,1)){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!x(a)?null:a}let a=i[0],l=a.split("-");if(l.length>1){let e={provider:r,prefix:l.shift(),name:l.join("-")};return t&&!x(e)?null:e}if(n&&""===r){let e={provider:r,prefix:"",name:a};return t&&!x(e,n)?null:e}return null},x=(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?b(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}),S=/(-?[0-9.]*[0-9]+[0-9.]*)/g,E=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function O(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 r=e.split(S);if(null===r||!r.length)return e;let i=[],a=r.shift(),l=E.test(a);for(;;){if(l){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(void 0===(a=r.shift()))return i.join("");l=!l}}let T=/\sid="(\S+)"/g,N="IconifyId"+Date.now().toString(16)+(0x1000000*Math.random()|0).toString(16),C=0,z=Object.create(null);function P(e){return z[e]||z[""]}function _(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 L=Object.create(null),I=["https://api.simplesvg.com","https://api.unisvg.com"],A=[];for(;I.length>0;)1===I.length||Math.random()>.5?A.push(I.shift()):A.push(I.pop());L[""]=_({resources:["https://api.iconify.design"].concat(A)});let F=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();function R(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}let $=0,U={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function D(e){let t={...U,...e},n=[];function r(){n=n.filter(e=>"pending"===e().status)}return{query:function(e,i,a){let l=function(e,t,n,r){let i,a,l=e.resources.length,o=e.random?Math.floor(Math.random()*l):e.index;if(e.random){let t=e.resources.slice(0);for(i=[];t.length>1;){let e=Math.floor(Math.random()*t.length);i.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}i=i.concat(t)}else i=e.resources.slice(o).concat(e.resources.slice(0,o));let s=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 b(){d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}return"function"==typeof r&&h.push(r),setTimeout(function r(){if("pending"!==c)return;p();let l=i.shift();if(void 0===l){if(d.length){f=setTimeout(()=>{p(),"pending"===c&&(b(),y())},e.timeout);return}y();return}let o={status:"pending",resource:l,callback:(t,n)=>{!function(t,n,l){let o="success"!==n;switch(d=d.filter(e=>e!==t),c){case"pending":break;case"failed":if(o||!e.dataAfterTimeout)return;break;default:return}if("abort"===n){a=l,y();return}if(o){a=l,d.length||(i.length?r():y());return}if(p(),b(),!e.random){let n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}c="completed",h.forEach(e=>{e(l)})}(o,t,n)}};d.push(o),u++,f=setTimeout(r,e.rotate),n(l,t,o.callback)}),function(){return{startTime:s,payload:t,status:c,queriesSent:u,queriesPending:d.length,subscribe:m,abort:g}}}(t,e,i,(e,t)=>{r(),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:r}}let H=Object.create(null);function q(){}function V(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&"object"==typeof n)try{if(!m(e,n).length)return void r()}catch(e){console.error(e)}r(),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,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,l=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let l=t.name;if(e.icons[l])a.loaded.push({provider:r,prefix:i,name:l});else{if(!e.missing.has(l))return n=!0,!0;a.missing.push({provider:r,prefix:i,name:l})}return!1}),a.pending.length!==l&&(n||R([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 K=/[\s,]+/,W={...M,inline:!1},G={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Q={display:"inline-block"},X={backgroundColor:"currentColor"},J={backgroundColor:"transparent"},Y={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Z={WebkitMask:X,mask:X,background:J};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 r=[],i=function(e,t){let n,r=L[e];if(!r)return 0;if(r.maxURL){let e=0;r.resources.forEach(t=>{e=Math.max(e,t.length)}),n=r.maxURL-e-r.path.length-(t+".json?icons=").length}else n=0;return n}(e,t),a="icons",l={type:a,provider:e,prefix:t,icons:[]},o=0;return n.forEach((n,s)=>{(o+=n.length+1)>=i&&s>0&&(r.push(l),l={type:a,provider:e,prefix:t,icons:[]},o=n.length),l.icons.push(n)}),r.push(l),r},send:(e,t,n)=>{if(!F)return void n("abort",424);let r=function(e){if("string"==typeof e){let t=L[e];if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":r+=t.prefix+".json?"+new URLSearchParams({icons:t.icons.join(",")}).toString();break;case"custom":{let e=t.uri;r+="/"===e.slice(0,1)?e.slice(1):e;break}default:n("abort",400);return}let i=503;F(e+r).then(e=>{let t=e.status;return 200!==t?void setTimeout(()=>{n(404===t?"abort":"next",t)}):(i=501,e.json())}).then(e=>{"object"!=typeof e||null===e?setTimeout(()=>{404===e?n("abort",e):n("next",i)}):setTimeout(()=>{n("success",e)})}).catch(()=>{n("next",i)})}},z[""]=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=b(e,!0,k);if(!n)return!1;let r=g(n.provider,n.prefix);if(!t)return r.missing.add(n.name),!0;var i=n.name;try{if("string"==typeof t.body)return r.icons[i]={...t},!0}catch(e){}return!1})(e,n)&&(t=!0)})),t}let n=e.prefix;return!!x({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 r=t[e];if("object"!=typeof r||!r||void 0===r.resources)continue;!function(e,t){let n=_(t);return null!==n&&(L[e]=n,!0)}(e,r)&&console.error(n)}catch(e){console.error(n)}}}}function en(e){let[n,r]=(0,i.useState)(!!e.ssr),[a,l]=(0,i.useState)({}),[s,c]=(0,i.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(s)!==JSON.stringify(e))return u(),c(e),!0}(0,i.useEffect)(()=>(r(!0),u),[]),(0,i.useEffect)(()=>{n&&function t(){var n;let r=e.icon;if("object"==typeof r)return void f({name:"",data:r});let i=j(r);f({name:r,data:i})&&(void 0===i?l({callback:((e,t)=>{var n;let r,i,a,l,o,s=(n=function(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i="string"==typeof e?b(e,t,n):e;i&&r.push(i)}),r}(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)),o={provider:"",prefix:"",name:""},n.forEach(e=>{if(o.name===e.name&&o.prefix===e.prefix&&o.provider===e.provider)return;o=e;let t=e.provider,n=e.prefix,r=e.name,i=l[t]||(l[t]=Object.create(null)),s=i[n]||(i[n]=g(t,n));(r in s.icons?a.loaded:""===n||s.missing.has(r)?a.missing:a.pending).push({provider:t,prefix:n,name:r})}),a);if(!s.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(s.loaded,s.missing,s.pending,q)}),()=>{e=!1}}let c=Object.create(null),u=[];return s.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===i&&t===r)return;r=t,i=n,u.push(g(t,n));let a=c[t]||(c[t]=Object.create(null));a[n]||(a[n]=[])}),s.pending.forEach(e=>{let{provider:t,prefix:n,name:r}=e,i=g(t,n),a=i.pendingIcons||(i.pendingIcons=new Set);a.has(r)||(a.add(r),c[t][n].push(r))}),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:r,prefix:i}=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,i,r),t=>{V(e,a,t)});if(l)return void a.forEach(t=>{B(l(t,i,r),n=>{let r=n?{prefix:i,icons:{[t]:n}}:null;V(e,[t],r)})});let{valid:o,invalid:s}=(t=[],n=[],a.forEach(e=>{(e.match(y)?t:n).push(e)}),{valid:t,invalid:n});if(s.length&&V(e,s,null),!o.length)return;let c=i.match(y)?P(r):null;c?c.prepare(r,i,o).forEach(t=>{!function(e,t,n){let r,i;if("string"==typeof e){let t=P(e);if(!t)return n(void 0,424);i=t.send;let a=function(e){if(!H[e]){let t=L[e];if(!t)return;let n=D(t);H[e]={config:t,redundancy:n}}return H[e]}(e);a&&(r=a.redundancy)}else{let t=_(e);if(t){r=D(t);let n=P(e.resources?e.resources[0]:"");n&&(i=n.send)}}r&&i?r.query(t,i,n)().abort:n(void 0,424)}(r,t,n=>{V(e,t.icons,n)})}):V(e,o,null)})))}),t?function(e,t,n){let r=$++,i=R.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(a)}),i}(t,s,u):q})([r],t)}):i&&(null==(n=e.onLoad)||n.call(e,r)))}()},[e.icon,n]);let{name:d,data:h}=s;return h?((e,n,r)=>{var a;let l,s,c,u,f,d,h,p,g,m,y,x,k,v=n.inline?ee:W,j=function(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in w?(null===r||r&&("string"===i||"number"===i))&&(n[e]=r):i===typeof n[e]&&(n[e]="rotate"===e?r%4:r)}return n}(v,n),S=n.mode||"svg",E={},z=n.style||{},P={..."svg"===S?G:{}};if(r){let e=b(r,!1,!0);if(e){let t=["iconify"];for(let n of["provider","prefix"])e[n]&&t.push("iconify--"+e[n]);P.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":P.ref=t;break;case"className":P[e]=(P[e]?P[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(K).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}(j,t);break;case"color":E.color=t;break;case"rotate":"string"==typeof t?j[e]=function(e,t=0){let n=e.replace(/^-?[0-9.]*/,"");function r(e){for(;e<0;)e+=4;return e%4}if(""===n){let t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t)%1==0?r(i):0}}return t}(t):"number"==typeof t&&(j[e]=t);break;case"ariaHidden":case"aria-hidden":!0!==t&&"true"!==t&&delete P["aria-hidden"];break;default:void 0===v[e]&&(P[e]=t)}}let _=(c={...o,...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,r,i;let a,l,o=[],s=e.hFlip,c=e.vFlip,u=e.rotate;switch(s?c?u+=2:(o.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),o.push("scale(-1 1)"),f.top=f.left=0):c&&(o.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),o.push("scale(1 -1)"),f.top=f.left=0),u<0&&(u-=4*Math.floor(u/4)),u%=4){case 1:o.unshift("rotate(90 "+(a=f.height/2+f.top).toString()+" "+a.toString()+")");break;case 2:o.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:o.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)),o.length&&(t=d,n='<g transform="'+o.join(" ")+'">',r=(l=function(e,t="defs"){let n="",r=e.indexOf("<"+t);for(;r>=0;){let i=e.indexOf(">",r),a=e.indexOf("</"+t);if(-1===i||-1===a)break;let l=e.indexOf(">",a);if(-1===l)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(l+1)}return{defs:n,content:e}}(t)).defs,i=n+l.content+"</g>",d=r?"<defs>"+r+"</defs>"+i:i)}),h=u.width,p=u.height,g=f.width,m=f.height,null===h?l=O(s=null===p?"1em":"auto"===p?m:p,g/m):(l="auto"===h?g:h,s=null===p?O(l,m/g):"auto"===p?m:p),y={},(x=(e,t)=>{"unset"!==t&&"undefined"!==t&&"none"!==t&&(y[e]=t.toString())})("width",l),x("height",s),y.viewBox=(k=[f.left,f.top,g,m]).join(" "),{attributes:y,viewBox:k,body:d}),L=_.attributes;if(j.inline&&(E.verticalAlign="-0.125em"),"svg"===S){P.style={...E,...z},Object.assign(P,L);let e=0,r=n.id;return"string"==typeof r&&(r=r.replace(/-/g,"_")),P.dangerouslySetInnerHTML={__html:(a=function(e,t=N){let n,r=[];for(;n=T.exec(e);)r.push(n[1]);if(!r.length)return e;let i="suffix"+(0x1000000*Math.random()|Date.now()).toString(16);return r.forEach(n=>{let r="function"==typeof t?t(n):t+(C++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")}),e=e.replace(RegExp(i,"g"),"")}(_.body,r?()=>r+"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,i.createElement)("svg",P)}let{body:I,width:A,height:F}=e,R="mask"===S||"bg"!==S&&-1!==I.indexOf("currentColor"),$=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>"}(I,{...L,width:A+"",height:F+""});return P.style={...E,"--svg":'url("data:image/svg+xml,'+$.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")+'")',width:et(L.width),height:et(L.height),...Q,...R?X:J,...z},(0,i.createElement)("span",P)})({...o,...h},e,d):e.children?e.children:e.fallback?e.fallback:(0,i.createElement)("span",{})}let er=(0,i.forwardRef)((e,t)=>en({...e,_ref:t}));(0,i.forwardRef)((e,t)=>en({inline:!0,...e,_ref:t}));var ei=e.i(66595),ea=e.i(31214),el=e.i(21357),eo=e.i(56420);let es=(0,eo.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),ec=(0,eo.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"}]]),eu=(0,eo.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,eo.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,eo.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,eo.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,eo.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 eb=(0,eo.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"}]]),ex=(0,eo.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,eo.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,r.jsx)(ei.Search,{size:20})},{name:"Cloudflare",host:"cloudflare.com",icon:"simple-icons:cloudflare",fallback:(0,r.jsx)(ea.Cloud,{size:20})},{name:"YouTube",host:"youtube.com",icon:"simple-icons:youtube",fallback:(0,r.jsx)(el.Play,{size:20})},{name:"GitHub",host:"github.com",icon:"simple-icons:github",fallback:(0,r.jsx)(es,{size:20})},{name:"ChatGPT",host:"chatgpt.com",icon:"simple-icons:openai",fallback:(0,r.jsx)(ec,{size:20})},{name:"X",host:"x.com",icon:"simple-icons:x",fallback:(0,r.jsx)(eu,{size:20})},{name:"Instagram",host:"instagram.com",icon:"simple-icons:instagram",fallback:(0,r.jsx)(ef,{size:20})},{name:"Reddit",host:"reddit.com",icon:"simple-icons:reddit",fallback:(0,r.jsx)(ed.MessageSquare,{size:20})},{name:"Wikipedia",host:"wikipedia.org",icon:"simple-icons:wikipedia",fallback:(0,r.jsx)(eh,{size:20})},{name:"Apple",host:"apple.com",icon:"simple-icons:apple",fallback:(0,r.jsx)(ep,{size:20})},{name:"Telegram",host:"telegram.org",icon:"simple-icons:telegram",fallback:(0,r.jsx)(eg.Send,{size:20})},{name:"Discord",host:"discord.com",icon:"simple-icons:discord",fallback:(0,r.jsx)(em,{size:20})},{name:"TikTok",host:"tiktok.com",icon:"simple-icons:tiktok",fallback:(0,r.jsx)(ey.Music,{size:20})},{name:"npm",host:"npmjs.com",icon:"simple-icons:npm",fallback:(0,r.jsx)(eb,{size:20})},{name:"Vercel",host:"vercel.com",icon:"simple-icons:vercel",fallback:(0,r.jsx)(ex,{size:20})}];function ew({icon:e,fallback:t}){let[n,a]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let t=new Image;t.onload=()=>a(!0),t.onerror=()=>a(!1),t.src=`https://api.iconify.design/${e.replace(":","/")}.svg`},[e]),(0,r.jsxs)("span",{className:"brand-icon-wrap",children:[(0,r.jsx)("span",{className:`brand-icon-fallback ${n?"hidden":""}`,children:t}),(0,r.jsx)("span",{className:`brand-icon-real ${n?"visible":""}`,children:(0,r.jsx)(er,{icon:e,width:20,height:20})})]})}function eM(){let[e,t]=(0,i.useState)(new Map),[n,a]=(0,i.useState)(!1),l=(0,i.useRef)(new Map),o=(0,i.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 r=performance.now(),i=(n,r)=>{t(t=>{let i=new Map(t);return i.set(e,{status:n,latency:r}),i})},a=setTimeout(()=>{n.abort()},5e3);fetch(`https://${e}/`,{method:"HEAD",mode:"no-cors",cache:"no-store",signal:n.signal}).then(()=>{clearTimeout(a),i("ok",Math.round(performance.now()-r))}).catch(()=>{clearTimeout(a),i("timeout",0)})},[]),s=(0,i.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 r=new AbortController;l.current.set(e.host,r);let i=performance.now(),o=(r,i)=>{n.has(e.host)&&(n.delete(e.host),t(t=>{let n=new Map(t);return n.set(e.host,{status:r,latency:i}),n}),0===n.size&&a(!1))},s=setTimeout(()=>{r.abort()},5e3);fetch(`https://${e.host}/`,{method:"HEAD",mode:"no-cors",cache:"no-store",signal:r.signal}).then(()=>{clearTimeout(s),o("ok",Math.round(performance.now()-i))}).catch(()=>{clearTimeout(s),o("timeout",0)})})},[]);return(0,i.useEffect)(()=>(s(),()=>{l.current.forEach(e=>e.abort()),l.current.clear()}),[s]),(0,r.jsxs)("div",{className:"ping-page",children:[(0,r.jsxs)("div",{className:"ping-header",children:[(0,r.jsxs)("div",{className:"ping-title-wrap",children:[(0,r.jsx)(ev.Wifi,{size:28,className:"ping-title-icon"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"ping-title",children:"网络连通性"}),(0,r.jsx)("p",{className:"ping-subtitle",children:"通过向对应网站发送请求进行测试,延迟值仅供参考。"})]})]}),(0,r.jsx)("button",{className:"btn btn-icon",onClick:s,disabled:n,"aria-label":"重新测试全部",title:"重新测试全部",children:(0,r.jsx)(ek,{size:18,className:n?"ping-spin":""})})]}),(0,r.jsx)("div",{className:"ping-grid",children:ej.map(t=>{let n=e.get(t.host),i=!n||"pending"===n.status,a=n?.status==="timeout";return(0,r.jsxs)("div",{className:`ping-card ${i?"pending":""}`,children:[(0,r.jsxs)("div",{className:"ping-card-top",children:[(0,r.jsx)("span",{className:"ping-card-icon",children:(0,r.jsx)(ew,{icon:t.icon,fallback:t.fallback})}),(0,r.jsx)("a",{href:`https://${t.host}`,target:"_blank",rel:"noreferrer",className:"ping-card-name",children:t.name}),(0,r.jsx)("button",{className:"ping-card-refresh",onClick:()=>o(t.host),disabled:i,"aria-label":`重新测试 ${t.name}`,title:"重新测试",children:(0,r.jsx)(ek,{size:13,className:i?"ping-spin":""})})]}),(0,r.jsxs)("div",{className:"ping-card-bottom",children:[i?(0,r.jsx)("span",{className:"ping-pulse-dot"}):(0,r.jsx)("span",{className:`ping-status-label ${a?"is-error":"is-success"}`,children:a?"不可用":"可用"}),(0,r.jsx)("span",{className:`ping-latency ${i?"is-muted":a?"is-error":"is-success"}`,children:i?"--":a?"超时":`${n.latency} ms`})]})]},t.host)})})]})}var eS=e.i(40983);e.s(["default",0,function(){return(0,r.jsx)(eS.MarketingLayout,{children:(0,r.jsx)(eM,{})})}],23449)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95057,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r={formatUrl:function(){return i},formatWithValidation:function(){return o},urlObjectKeys:function(){return c}};for(var s in r)Object.defineProperty(a,s,{enumerable:!0,get:r[s]});let n=e.r(90809)._(e.r(98183)),l=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:a}=e,r=e.protocol||"",s=e.pathname||"",i=e.hash||"",c=e.query||"",o=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?o=t+e.host:a&&(o=t+(~a.indexOf(":")?`[${a}]`:a),e.port&&(o+=":"+e.port)),c&&"object"==typeof c&&(c=String(n.urlQueryToSearchParams(c)));let d=e.search||c&&`?${c}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||l.test(r))&&!1!==o?(o="//"+(o||""),s&&"/"!==s[0]&&(s="/"+s)):o||(o=""),i&&"#"!==i[0]&&(i="#"+i),d&&"?"!==d[0]&&(d="?"+d),s=s.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${r}${o}${s}${d}${i}`}let c=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function o(e){return i(e)}},18581,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"useMergedRef",{enumerable:!0,get:function(){return s}});let r=e.r(71645);function s(e,t){let a=(0,r.useRef)(null),s=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=a.current;e&&(a.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(a.current=n(e,r)),t&&(s.current=n(t,r))},[e,t])}function n(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let a=e(t);return"function"==typeof a?a:()=>e(null)}}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},73668,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"isLocalURL",{enumerable:!0,get:function(){return n}});let r=e.r(18967),s=e.r(52817);function n(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),a=new URL(e,t);return a.origin===t&&(0,s.hasBasePath)(a.pathname)}catch(e){return!1}}},84508,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},22016,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r={default:function(){return y},useLinkStatus:function(){return j}};for(var s in r)Object.defineProperty(a,s,{enumerable:!0,get:r[s]});let n=e.r(90809),l=e.r(18050),i=n._(e.r(71645)),c=e.r(95057),o=e.r(8372),d=e.r(18581),u=e.r(18967),h=e.r(5550);e.r(33525);let p=e.r(88540),f=e.r(91949),m=e.r(73668),x=e.r(9396);function y(t){var a,r;let s,n,y,[j,v]=(0,i.useOptimistic)(f.IDLE_LINK_STATUS),b=(0,i.useRef)(null),{href:g,as:M,children:P,prefetch:N=null,passHref:w,replace:S,shallow:E,scroll:O,onClick:_,onMouseEnter:C,onTouchStart:z,legacyBehavior:T=!1,onNavigate:L,transitionTypes:B,ref:q,unstable_dynamicOnHover:A,...I}=t;s=P,T&&("string"==typeof s||"number"==typeof s)&&(s=(0,l.jsx)("a",{children:s}));let R=i.default.useContext(o.AppRouterContext),H=!1!==N,D=!1!==N?null===(r=N)||"auto"===r?x.FetchStrategy.PPR:x.FetchStrategy.Full:x.FetchStrategy.PPR,W="string"==typeof(a=M||g)?a:(0,c.formatUrl)(a);if(T){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});n=i.default.Children.only(s)}let U=T?n&&"object"==typeof n&&n.ref:q,F=i.default.useCallback(e=>(null!==R&&(b.current=(0,f.mountLinkInstance)(e,W,R,D,H,v)),()=>{b.current&&((0,f.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,f.unmountPrefetchableInstance)(e)}),[H,W,R,D,v]),$={ref:(0,d.useMergedRef)(F,U),onClick(t){T||"function"!=typeof _||_(t),T&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(t),!R||t.defaultPrevented||function(t,a,r,s,n,l,c){if("u">typeof window){let o,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((o=t.currentTarget.getAttribute("target"))&&"_self"!==o||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(a)){s&&(t.preventDefault(),location.replace(a));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);i.default.startTransition(()=>{u(a,s?"replace":"push",!1===n?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,r.current,c)})}}(t,W,b,S,O,L,B)},onMouseEnter(e){T||"function"!=typeof C||C(e),T&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),R&&H&&(0,f.onNavigationIntent)(e.currentTarget,!0===A)},onTouchStart:function(e){T||"function"!=typeof z||z(e),T&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),R&&H&&(0,f.onNavigationIntent)(e.currentTarget,!0===A)}};return(0,u.isAbsoluteUrl)(W)?$.href=W:T&&!w&&("a"!==n.type||"href"in n.props)||($.href=(0,h.addBasePath)(W)),y=T?i.default.cloneElement(n,$):(0,l.jsx)("a",{...I,...$,children:s}),(0,l.jsx)(k.Provider,{value:j,children:y})}e.r(84508);let k=(0,i.createContext)(f.IDLE_LINK_STATUS),j=()=>(0,i.useContext)(k);("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},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)},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)},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)},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)},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)},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)},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)},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),r=e.i(22016),s=e.i(62368),n=e.i(96699),l=e.i(35965);function i({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 c(){let[e,c]=(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)&&c(!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)(r.default,{href:"/",className:"mkt-nav-logo",children:[(0,t.jsx)(i,{}),"MOST PEOPLE"]}),(0,t.jsxs)("div",{className:"mkt-nav-cta",children:[(0,t.jsx)("button",{className:"mkt-theme-toggle",onClick:()=>c(!e),"aria-label":"切换主题",children:e?(0,t.jsx)(l.Sun,{size:16}):(0,t.jsx)(n.Moon,{size:16})}),(0,t.jsxs)(r.default,{href:"/download/",className:"btn btn-secondary mkt-nav-preview",children:[(0,t.jsx)(s.Download,{size:16}),"下载客户端"]}),(0,t.jsx)(r.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 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:o.map(e=>(0,t.jsx)(r.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)(c,{}),(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),r=e.i(22016),s=e.i(56420);let n=(0,s.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 l=e.i(68590),i=e.i(10566),c=e.i(70904);let o=(0,s.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),d=(0,s.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var u=e.i(89664),h=e.i(82022),p=e.i(62368),f=e.i(41220),m=e.i(50285);let x=(0,s.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 y=e.i(3593);let k=[{id:"app",title:"MostBox",subtitle:"P2P 文件分享",icon:(0,t.jsx)(n,{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)(l.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)(i.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:"game",title:"游戏",subtitle:"P2P 牌桌",icon:(0,t.jsx)(x,{size:28}),path:"/game/gandengyan/",requiresBackend:!0,hero:"常驻节点里的 P2P 牌桌",desc:"默认进入干瞪眼,侧边栏可切换炸金花,统一复用 MostBox 频道消息和 WebSocket 订阅能力。",features:["使用 MostBox 本地账号进入房间","统一房间码和 P2P 频道同步","不新增独立服务端口","房间链接可分享给朋友","只保留 MVP 所需牌桌闭环"],steps:[{num:"1",title:"进入牌桌",desc:"默认打开干瞪眼,也可从侧边栏切换炸金花。"},{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 j(){let e=(0,y.useAppStore)(e=>e.hasBackend),s=(0,y.useAppStore)(e=>e.openConnectModal),[n,l]=(0,a.useState)("app"),i=k.find(e=>e.id===n)||k[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:k.map(a=>{let s=n===a.id,i=a.requiresBackend,c=i?!0===e?"connected":!1===e?"disconnected":"checking":"none";return(0,t.jsxs)("button",{className:`portal-card ${s?"active":""}`,onClick:()=>l(a.id),children:[(0,t.jsx)(r.default,{href:a.path,className:"btn btn-icon portal-card-open-btn",onClick:e=>e.stopPropagation(),title:`打开${a.title}`,children:(0,t.jsx)(d,{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}),i?(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:s,className:"btn btn-secondary",children:[(0,t.jsx)(f.Server,{size:16}),"连接节点"]}),(0,t.jsxs)(r.default,{href:"/download",className:"btn btn-primary",children:[(0,t.jsx)(p.Download,{size:16}),"下载客户端"]}),(0,t.jsxs)(r.default,{href:"/admin",className:"btn btn-secondary",children:[(0,t.jsx)(m.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:i.hero}),(0,t.jsx)("p",{children:i.desc})]}),(0,t.jsx)("div",{className:"portal-marketing-features",children:i.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)(u.Check,{size:14,strokeWidth:3})}),(0,t.jsx)("span",{children:e})]},a))}),(0,t.jsx)("div",{className:"portal-marketing-steps",children:i.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)(h.ExternalLink,{size:12})]})})]})]},e.num))}),(0,t.jsxs)("div",{className:"portal-actions",children:[(0,t.jsxs)(r.default,{href:i.path,className:"btn btn-primary",children:["进入 ",i.title,(0,t.jsx)(o,{size:16})]}),i.requiresBackend&&!1===e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:s,className:"btn btn-secondary",children:[(0,t.jsx)(f.Server,{size:16}),"连接节点"]}),(0,t.jsxs)(r.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)(j,{})})}],31713)}]);
@@ -1,5 +1,5 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17173,e=>{"use strict";let t,s;var a,r,l,n,i,o=e.i(18050),c=e.i(71645),d=Object.defineProperty,h=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,x=(e,t,s)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,p=(e,t)=>{for(var s in t||(t={}))u.call(t,s)&&x(e,s,t[s]);if(h)for(var s of h(t))m.call(t,s)&&x(e,s,t[s]);return e},f=(e,t)=>{var s={};for(var a in e)u.call(e,a)&&0>t.indexOf(a)&&(s[a]=e[a]);if(null!=e&&h)for(var a of h(e))0>t.indexOf(a)&&m.call(e,a)&&(s[a]=e[a]);return s};(e=>{let t=class t{constructor(e,s,a,l){if(this.version=e,this.errorCorrectionLevel=s,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError("Version value out of range");if(l<-1||l>7)throw RangeError("Mask value out of range");this.size=4*e+17;let n=[];for(let e=0;e<this.size;e++)n.push(!1);for(let e=0;e<this.size;e++)this.modules.push(n.slice()),this.isFunction.push(n.slice());this.drawFunctionPatterns();const i=this.addEccAndInterleave(a);if(this.drawCodewords(i),-1==l){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const s=this.getPenaltyScore();s<e&&(l=t,e=s),this.applyMask(t)}}r(0<=l&&l<=7),this.mask=l,this.applyMask(l),this.drawFormatBits(l),this.isFunction=[]}static encodeText(s,a){let r=e.QrSegment.makeSegments(s);return t.encodeSegments(r,a)}static encodeBinary(s,a){let r=e.QrSegment.makeBytes(s);return t.encodeSegments([r],a)}static encodeSegments(e,a,l=1,i=40,o=-1,c=!0){let d,h;if(!(t.MIN_VERSION<=l&&l<=i&&i<=t.MAX_VERSION)||o<-1||o>7)throw RangeError("Invalid value");for(d=l;;d++){let s=8*t.getNumDataCodewords(d,a),r=n.getTotalBits(e,d);if(r<=s){h=r;break}if(d>=i)throw RangeError("Data too long")}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])c&&h<=8*t.getNumDataCodewords(d,e)&&(a=e);let u=[];for(let t of e)for(let e of(s(t.mode.modeBits,4,u),s(t.numChars,t.mode.numCharCountBits(d),u),t.getData()))u.push(e);r(u.length==h);let m=8*t.getNumDataCodewords(d,a);r(u.length<=m),s(0,Math.min(4,m-u.length),u),s(0,(8-u.length%8)%8,u),r(u.length%8==0);for(let e=236;u.length<m;e^=253)s(e,8,u);let x=[];for(;8*x.length<u.length;)x.push(0);return u.forEach((e,t)=>x[t>>>3]|=e<<7-(7&t)),new t(d,a,x,o)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let s=0;s<t;s++)for(let a=0;a<t;a++)(0!=s||0!=a)&&(0!=s||a!=t-1)&&(s!=t-1||0!=a)&&this.drawAlignmentPattern(e[s],e[a]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,s=t;for(let e=0;e<10;e++)s=s<<1^(s>>>9)*1335;let l=(t<<10|s)^21522;r(l>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,a(l,e));this.setFunctionModule(8,7,a(l,6)),this.setFunctionModule(8,8,a(l,7)),this.setFunctionModule(7,8,a(l,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,a(l,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,a(l,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,a(l,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;r(t>>>18==0);for(let e=0;e<18;e++){let s=a(t,e),r=this.size-11+e%3,l=Math.floor(e/3);this.setFunctionModule(r,l,s),this.setFunctionModule(l,r,s)}}drawFinderPattern(e,t){for(let s=-4;s<=4;s++)for(let a=-4;a<=4;a++){let r=Math.max(Math.abs(a),Math.abs(s)),l=e+a,n=t+s;0<=l&&l<this.size&&0<=n&&n<this.size&&this.setFunctionModule(l,n,2!=r&&4!=r)}}drawAlignmentPattern(e,t){for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)this.setFunctionModule(e+a,t+s,1!=Math.max(Math.abs(a),Math.abs(s)))}setFunctionModule(e,t,s){this.modules[t][e]=s,this.isFunction[t][e]=!0}addEccAndInterleave(e){let s=this.version,a=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(s,a))throw RangeError("Invalid argument");let l=t.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][s],n=t.ECC_CODEWORDS_PER_BLOCK[a.ordinal][s],i=Math.floor(t.getNumRawDataModules(s)/8),o=l-i%l,c=Math.floor(i/l),d=[],h=t.reedSolomonComputeDivisor(n);for(let s=0,a=0;s<l;s++){let r=e.slice(a,a+c-n+(s<o?0:1));a+=r.length;let l=t.reedSolomonComputeRemainder(r,h);s<o&&r.push(0),d.push(r.concat(l))}let u=[];for(let e=0;e<d[0].length;e++)d.forEach((t,s)=>{(e!=c-n||s>=o)&&u.push(t[e])});return r(u.length==i),u}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError("Invalid argument");let s=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let l=0;l<2;l++){let n=t-l,i=(t+1&2)==0?this.size-1-r:r;!this.isFunction[i][n]&&s<8*e.length&&(this.modules[i][n]=a(e[s>>>3],7-(7&s)),s++)}}r(s==8*e.length)}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let s=0;s<this.size;s++){let a;switch(e){case 0:a=(s+t)%2==0;break;case 1:a=t%2==0;break;case 2:a=s%3==0;break;case 3:a=(s+t)%3==0;break;case 4:a=(Math.floor(s/3)+Math.floor(t/2))%2==0;break;case 5:a=s*t%2+s*t%3==0;break;case 6:a=(s*t%2+s*t%3)%2==0;break;case 7:a=((s+t)%2+s*t%3)%2==0;break;default:throw Error("Unreachable")}!this.isFunction[t][s]&&a&&(this.modules[t][s]=!this.modules[t][s])}}getPenaltyScore(){let e=0;for(let s=0;s<this.size;s++){let a=!1,r=0,l=[0,0,0,0,0,0,0];for(let n=0;n<this.size;n++)this.modules[s][n]==a?5==++r?e+=t.PENALTY_N1:r>5&&e++:(this.finderPenaltyAddHistory(r,l),a||(e+=this.finderPenaltyCountPatterns(l)*t.PENALTY_N3),a=this.modules[s][n],r=1);e+=this.finderPenaltyTerminateAndCount(a,r,l)*t.PENALTY_N3}for(let s=0;s<this.size;s++){let a=!1,r=0,l=[0,0,0,0,0,0,0];for(let n=0;n<this.size;n++)this.modules[n][s]==a?5==++r?e+=t.PENALTY_N1:r>5&&e++:(this.finderPenaltyAddHistory(r,l),a||(e+=this.finderPenaltyCountPatterns(l)*t.PENALTY_N3),a=this.modules[n][s],r=1);e+=this.finderPenaltyTerminateAndCount(a,r,l)*t.PENALTY_N3}for(let s=0;s<this.size-1;s++)for(let a=0;a<this.size-1;a++){let r=this.modules[s][a];r==this.modules[s][a+1]&&r==this.modules[s+1][a]&&r==this.modules[s+1][a+1]&&(e+=t.PENALTY_N2)}let s=0;for(let e of this.modules)s=e.reduce((e,t)=>e+ +!!t,s);let a=this.size*this.size,l=Math.ceil(Math.abs(20*s-10*a)/a)-1;return r(0<=l&&l<=9),r(0<=(e+=l*t.PENALTY_N4)&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{let e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),s=[6];for(let a=this.size-7;s.length<e;a-=t)s.splice(1,0,a);return s}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError("Version number out of range");let s=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;s-=(25*t-10)*t-55,e>=7&&(s-=36)}return r(208<=s&&s<=29648),s}static getNumDataCodewords(e,s){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError("Degree out of range");let s=[];for(let t=0;t<e-1;t++)s.push(0);s.push(1);let a=1;for(let r=0;r<e;r++){for(let e=0;e<s.length;e++)s[e]=t.reedSolomonMultiply(s[e],a),e+1<s.length&&(s[e]^=s[e+1]);a=t.reedSolomonMultiply(a,2)}return s}static reedSolomonComputeRemainder(e,s){let a=s.map(e=>0);for(let r of e){let e=r^a.shift();a.push(0),s.forEach((s,r)=>a[r]^=t.reedSolomonMultiply(s,e))}return a}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw RangeError("Byte out of range");let s=0;for(let a=7;a>=0;a--)s=s<<1^(s>>>7)*285^(t>>>a&1)*e;return r(s>>>8==0),s}finderPenaltyCountPatterns(e){let t=e[1];r(t<=3*this.size);let s=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(s&&e[0]>=4*t&&e[6]>=t?1:0)+(s&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,s){return e&&(this.finderPenaltyAddHistory(t,s),t=0),t+=this.size,this.finderPenaltyAddHistory(t,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};function s(e,t,s){if(t<0||t>31||e>>>t!=0)throw RangeError("Value out of range");for(let a=t-1;a>=0;a--)s.push(e>>>a&1)}function a(e,t){return(e>>>t&1)!=0}function r(e){if(!e)throw Error("Assertion error")}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;let l=class e{constructor(e,t,s){if(this.mode=e,this.numChars=t,this.bitData=s,t<0)throw RangeError("Invalid argument");this.bitData=s.slice()}static makeBytes(t){let a=[];for(let e of t)s(e,8,a);return new e(e.Mode.BYTE,t.length,a)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError("String contains non-numeric characters");let a=[];for(let e=0;e<t.length;){let r=Math.min(t.length-e,3);s(parseInt(t.substring(e,e+r),10),3*r+1,a),e+=r}return new e(e.Mode.NUMERIC,t.length,a)}static makeAlphanumeric(t){let a;if(!e.isAlphanumeric(t))throw RangeError("String contains unencodable characters in alphanumeric mode");let r=[];for(a=0;a+2<=t.length;a+=2){let l=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a));s(l+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a+1)),11,r)}return a<t.length&&s(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let a=[];if(t<0)throw RangeError("ECI assignment value out of range");if(t<128)s(t,8,a);else if(t<16384)s(2,2,a),s(t,14,a);else if(t<1e6)s(6,3,a),s(t,21,a);else throw RangeError("ECI assignment value out of range");return new e(e.Mode.ECI,0,a)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let s=0;for(let a of e){let e=a.mode.numCharCountBits(t);if(a.numChars>=1<<e)return 1/0;s+=4+e+a.bitData.length}return s}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let s=0;s<e.length;s++)"%"!=e.charAt(s)?t.push(e.charCodeAt(s)):(t.push(parseInt(e.substring(s+1,s+3),16)),s+=2);return t}};l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let n=l;e.QrSegment=l})(i||(i={})),r=(a=i||(i={})).QrCode||(a.QrCode={}),(t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}}).LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),r.Ecc=t,n=(l=i||(i={})).QrSegment||(l.QrSegment={}),(s=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}}).NUMERIC=new s(1,[10,12,14]),s.ALPHANUMERIC=new s(2,[9,11,13]),s.BYTE=new s(4,[8,16,16]),s.KANJI=new s(8,[8,10,12]),s.ECI=new s(7,[0,0,0]),n.Mode=s;var b=i,g={L:b.QrCode.Ecc.LOW,M:b.QrCode.Ecc.MEDIUM,Q:b.QrCode.Ecc.QUARTILE,H:b.QrCode.Ecc.HIGH},j="#FFFFFF",w="#000000";function y(e,t=0){let s=[];return e.forEach(function(e,a){let r=null;e.forEach(function(l,n){if(!l&&null!==r){s.push(`M${r+t} ${a+t}h${n-r}v1H${r+t}z`),r=null;return}if(n===e.length-1){if(!l)return;null===r?s.push(`M${n+t},${a+t} h1v1H${n+t}z`):s.push(`M${r+t},${a+t} h${n+1-r}v1H${r+t}z`);return}l&&null===r&&(r=n)})}),s.join("")}function v(e,t){return e.slice().map((e,s)=>s<t.y||s>=t.y+t.h?e:e.map((e,s)=>(s<t.x||s>=t.x+t.w)&&e))}function N({value:e,level:t,minVersion:s,includeMargin:a,marginSize:r,imageSettings:l,size:n,boostLevel:i}){let o=c.default.useMemo(()=>{let a=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...b.QrSegment.makeSegments(t)),e),[]);return b.QrCode.encodeSegments(a,g[t],s,void 0,void 0,i)},[e,t,s,i]),{cells:d,margin:h,numCells:u,calculatedImageSettings:m}=c.default.useMemo(()=>{let e=o.getModules(),t=null!=r?Math.max(Math.floor(r),0):4*!!a,s=e.length+2*t,i=function(e,t,s,a){if(null==a)return null;let r=e.length+2*s,l=Math.floor(.1*t),n=r/t,i=(a.width||l)*n,o=(a.height||l)*n,c=null==a.x?e.length/2-i/2:a.x*n,d=null==a.y?e.length/2-o/2:a.y*n,h=null==a.opacity?1:a.opacity,u=null;if(a.excavate){let e=Math.floor(c),t=Math.floor(d),s=Math.ceil(i+c-e),a=Math.ceil(o+d-t);u={x:e,y:t,w:s,h:a}}return{x:c,y:d,h:o,w:i,excavation:u,opacity:h,crossOrigin:a.crossOrigin}}(e,n,t,l);return{cells:e,margin:t,numCells:s,calculatedImageSettings:i}},[o,n,l,a,r]);return{qrcode:o,margin:h,cells:d,numCells:u,calculatedImageSettings:m}}var C=function(){try{new Path2D().addPath(new Path2D)}catch(e){return!1}return!0}();c.default.forwardRef(function(e,t){let{value:s,size:a=128,level:r="L",bgColor:l=j,fgColor:n=w,includeMargin:i=!1,minVersion:o=1,boostLevel:d,marginSize:h,imageSettings:u}=e,m=f(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:x}=m,b=f(m,["style"]),g=null==u?void 0:u.src,E=c.default.useRef(null),M=c.default.useRef(null),k=c.default.useCallback(e=>{E.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]),[A,S]=c.default.useState(!1),{margin:R,cells:z,numCells:P,calculatedImageSettings:L}=N({value:s,level:r,minVersion:o,boostLevel:d,includeMargin:i,marginSize:h,imageSettings:u,size:a});c.default.useEffect(()=>{if(null!=E.current){let e=E.current,t=e.getContext("2d");if(!t)return;let s=z,r=M.current,i=null!=L&&null!==r&&r.complete&&0!==r.naturalHeight&&0!==r.naturalWidth;i&&null!=L.excavation&&(s=v(z,L.excavation));let o=window.devicePixelRatio||1;e.height=e.width=a*o;let c=a/P*o;t.scale(c,c),t.fillStyle=l,t.fillRect(0,0,P,P),t.fillStyle=n,C?t.fill(new Path2D(y(s,R))):z.forEach(function(e,s){e.forEach(function(e,a){e&&t.fillRect(a+R,s+R,1,1)})}),L&&(t.globalAlpha=L.opacity),i&&t.drawImage(r,L.x+R,L.y+R,L.w,L.h)}}),c.default.useEffect(()=>{S(!1)},[g]);let O=p({height:a,width:a},x),I=null;return null!=g&&(I=c.default.createElement("img",{src:g,key:g,style:{display:"none"},onLoad:()=>{S(!0)},ref:M,crossOrigin:null==L?void 0:L.crossOrigin})),c.default.createElement(c.default.Fragment,null,c.default.createElement("canvas",p({style:O,height:a,width:a,ref:k,role:"img"},b)),I)}).displayName="QRCodeCanvas";var E=c.default.forwardRef(function(e,t){let{value:s,size:a=128,level:r="L",bgColor:l=j,fgColor:n=w,includeMargin:i=!1,minVersion:o=1,boostLevel:d,title:h,marginSize:u,imageSettings:m}=e,x=f(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:b,cells:g,numCells:C,calculatedImageSettings:E}=N({value:s,level:r,minVersion:o,boostLevel:d,includeMargin:i,marginSize:u,imageSettings:m,size:a}),M=g,k=null;null!=m&&null!=E&&(null!=E.excavation&&(M=v(g,E.excavation)),k=c.default.createElement("image",{href:m.src,height:E.h,width:E.w,x:E.x+b,y:E.y+b,preserveAspectRatio:"none",opacity:E.opacity,crossOrigin:E.crossOrigin}));let A=y(M,b);return c.default.createElement("svg",p({height:a,width:a,viewBox:`0 0 ${C} ${C}`,ref:t,role:"img"},x),!!h&&c.default.createElement("title",null,h),c.default.createElement("path",{fill:l,d:`M0,0 h${C}v${C}H0z`,shapeRendering:"crispEdges"}),c.default.createElement("path",{fill:n,d:A,shapeRendering:"crispEdges"}),k)});E.displayName="QRCodeSVG";var M=e.i(8515),k=e.i(72382),A=e.i(80860),S=e.i(8734),R=e.i(89664),z=e.i(82022),P=e.i(58925),L=e.i(56420);let O=(0,L.default)("fingerprint-pattern",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]),I=(0,L.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),T=(0,L.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var B=e.i(35965),_=e.i(96699);let U=(0,L.default)("qr-code",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]),D=(0,L.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var F=e.i(16327);let K=(0,L.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var $=e.i(62368);let H=(0,L.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var Q=e.i(6537),V=e.i(70904),Y=e.i(11241),W=e.i(59665),G=e.i(3593),X=e.i(71192),q=e.i(128),J=e.i(15882),Z=e.i(96510),ee=e.i(93957);e.i(77816);let et=(e,t)=>{let s=t.slice(2),a=new Uint8Array((0,J.getBytes)(e+s));return Z.default.sign.keyPair.fromSecretKey(a)};function es({text:e}){let[t,s]=(0,c.useState)(!1),a=async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return(0,o.jsx)("button",{className:"btn btn-icon",onClick:a,title:t?"已复制":"复制",children:t?(0,o.jsx)(R.Check,{size:14}):(0,o.jsx)(S.Copy,{size:14})})}function ea({title:e,icon:t,children:s,accent:a=!1}){return(0,o.jsxs)("div",{className:`web3-key-card ${a?"accent":""}`,children:[(0,o.jsxs)("div",{className:"web3-key-card-header",children:[(0,o.jsx)("span",{className:"web3-key-card-icon",children:t}),(0,o.jsx)("span",{className:"web3-key-card-title",children:e})]}),(0,o.jsx)("div",{className:"web3-key-card-body",children:s})]})}function er({icon:e,message:t}){return(0,o.jsxs)("div",{className:"empty-state glass",children:[(0,o.jsx)("div",{className:"empty-state-icon",children:e}),(0,o.jsx)("p",{children:t})]})}function el({title:e,username:t,password:s,showPassword:a,showPrivateKey:r,account:l,onUsernameChange:n,onPasswordChange:i,onTogglePassword:c,onTogglePrivateKey:d,onGenerate:h}){var u;return(0,o.jsxs)("div",{className:"web3-box-account",children:[(0,o.jsx)("div",{className:"web3-box-account-header",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{children:e}),(0,o.jsx)("p",{children:"用户名和密码会确定性生成 x25519 密钥对。"})]})}),(0,o.jsxs)("div",{className:"web3-box-login",children:[(0,o.jsx)("input",{type:"text",placeholder:"用户名",value:t,onChange:e=>n(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsx)("input",{type:a?"text":"password",placeholder:"密码(可选)",value:s,onChange:e=>i(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("button",{className:"input-eye",onClick:c,type:"button",children:a?(0,o.jsx)(A.EyeOff,{size:16}):(0,o.jsx)(k.Eye,{size:16})})]}),(0,o.jsxs)("button",{className:"btn btn-primary btn-full",onClick:h,disabled:!t.trim(),type:"button",children:[(0,o.jsx)(P.KeyRound,{size:16}),"生成账号"]})]}),l?(0,o.jsxs)("div",{className:"web3-box-key-list",children:[(0,o.jsxs)("div",{className:"web3-box-key-row",children:[(0,o.jsx)("span",{children:"地址"}),(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:l.address.toLowerCase()}),(0,o.jsx)(es,{text:l.address.toLowerCase()})]})]}),(0,o.jsxs)("div",{className:"web3-box-key-row",children:[(0,o.jsx)("span",{children:"x25519 公钥"}),(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:l.publicKey}),(0,o.jsx)(es,{text:l.publicKey})]})]}),(0,o.jsxs)("div",{className:"web3-box-key-row",children:[(0,o.jsx)("span",{children:"x25519 私钥"}),(0,o.jsxs)("div",{className:"mono-row danger",children:[(0,o.jsx)("code",{className:"mono",children:r?l.privateKey:(u=l.privateKey)?"•".repeat(Math.min(u.length,32)):"-"}),(0,o.jsx)("button",{className:"btn btn-icon",onClick:d,title:r?"隐藏私钥":"显示私钥",type:"button",children:r?(0,o.jsx)(k.Eye,{size:14}):(0,o.jsx)(A.EyeOff,{size:14})})]})]})]}):null]})}function en({title:e,description:t,message:s,cipherText:a,decryptedText:r,error:l,encryptLabel:n,decryptLabel:i,messagePlaceholder:c,cipherPlaceholder:d,onMessageChange:h,onCipherTextChange:u,onEncrypt:m,onDecrypt:x}){var p;let f=`box-message-${e.replaceAll(/\s+/g,"-")}`,b=(0,q.parseMostBoxToken)(a);return(0,o.jsxs)("section",{className:"web3-box-flow",children:[(0,o.jsx)("div",{className:"web3-box-flow-header",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{children:e}),(0,o.jsx)("p",{children:t})]})}),(0,o.jsx)("label",{className:"web3-box-label",htmlFor:f,children:"明文"}),(0,o.jsx)("textarea",{id:f,className:"textarea",value:s,onChange:e=>h(e.target.value),rows:4,placeholder:c}),(0,o.jsxs)("div",{className:"web3-box-actions",children:[(0,o.jsxs)("button",{className:"btn btn-primary",onClick:m,type:"button",children:[(0,o.jsx)(Q.Lock,{size:16}),n]}),(0,o.jsxs)("button",{className:"btn btn-secondary",onClick:x,type:"button",children:[(0,o.jsx)(P.KeyRound,{size:16}),i]})]}),l&&(0,o.jsx)("p",{className:"web3-tools-danger",children:l}),(0,o.jsxs)("div",{className:"web3-box-result-grid",children:[(0,o.jsxs)("div",{className:"web3-box-result",children:[(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"密文"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:a,onChange:e=>u(e.target.value),rows:5,placeholder:d})]}),(0,o.jsxs)("div",{className:"web3-box-result",children:[(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"解密结果"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:r,readOnly:!0,rows:5,placeholder:"解密成功后显示明文"})]})]}),b&&(0,o.jsxs)("div",{className:"web3-box-token-meta",children:[(0,o.jsxs)("div",{className:"web3-box-token-meta-row",children:[(0,o.jsx)("span",{children:"时间戳"}),(0,o.jsx)("code",{children:Number.isFinite(p=b.timestampMs)?`${new Date(p).toLocaleString()}`:"-"})]}),(0,o.jsxs)("div",{className:"web3-box-token-meta-row",children:[(0,o.jsx)("span",{children:"随机数"}),(0,o.jsx)("code",{children:b.nonce})]})]})]})}ee.generateAvatar;let ei=e=>btoa(String.fromCharCode(...e));function eo({label:e,pem:t,filename:s}){let[a,r]=(0,c.useState)(!1),l=async()=>{try{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return(0,o.jsxs)("div",{className:"web3-pem-block",children:[(0,o.jsxs)("div",{className:"web3-pem-header",children:[(0,o.jsx)("span",{className:"web3-pem-label",children:e}),(0,o.jsxs)("div",{className:"web3-pem-actions",children:[(0,o.jsxs)("button",{className:"btn btn-sm",onClick:l,title:a?"已复制":"复制",children:[(0,o.jsx)(S.Copy,{size:14}),a?"已复制":"复制"]}),(0,o.jsxs)("button",{className:"btn btn-sm btn-primary",onClick:()=>{let e=new Blob([t],{type:"text/plain"}),a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=s,r.click(),URL.revokeObjectURL(a)},title:"下载",children:[(0,o.jsx)($.Download,{size:14}),"下载"]})]})]}),(0,o.jsx)("textarea",{className:"textarea mono",value:t,readOnly:!0,rows:6})]})}e.s(["default",0,function(){let e,t=(0,G.useAppStore)(e=>e.isDarkMode),s=(0,G.useAppStore)(e=>e.setIsDarkMode),a=(0,G.useAppStore)(e=>e.addToast),r=(0,X.useUserStore)(e=>e.setUserIdentity),l=["wallet","pem","export","EA"],[n,i]=(0,c.useState)("wallet");(0,c.useEffect)(()=>{let e=()=>{let e=window.location.hash.replace("#","");return l.includes(e)?e:"wallet"};i(e());let t=()=>i(e());return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)},[]);let[d,h]=(0,c.useState)(""),[u,m]=(0,c.useState)(""),[x,p]=(0,c.useState)(!1),[f,b]=(0,c.useState)(null),[g,j]=(0,c.useState)(null),[w,y]=(0,c.useState)(""),[v,N]=(0,c.useState)(""),[C,S]=(0,c.useState)(""),[R,L]=(0,c.useState)(""),[$,J]=(0,c.useState)([]),[Z,ec]=(0,c.useState)(0),[ed,eh]=(0,c.useState)(!0),[eu,em]=(0,c.useState)(!0),[ex,ep]=(0,c.useState)(!1),[ef,eb]=(0,c.useState)(!1),[eg,ej]=(0,c.useState)(!1),[ew,ey]=(0,c.useState)(!1),[ev,eN]=(0,c.useState)(!1),[eC,eE]=(0,c.useState)(!1),[eM,ek]=(0,c.useState)(""),[eA,eS]=(0,c.useState)(""),[eR,ez]=(0,c.useState)(!1),[eP,eL]=(0,c.useState)(!1),[eO,eI]=(0,c.useState)(null),[eT,eB]=(0,c.useState)(""),[e_,eU]=(0,c.useState)(""),[eD,eF]=(0,c.useState)(!1),[eK,e$]=(0,c.useState)(!1),[eH,eQ]=(0,c.useState)(null),[eV,eY]=(0,c.useState)("你好,B。这是来自 A 的加密消息。"),[eW,eG]=(0,c.useState)(""),[eX,eq]=(0,c.useState)(""),[eJ,eZ]=(0,c.useState)(""),[e0,e1]=(0,c.useState)("你好,A。这是来自 B 的加密消息。"),[e2,e3]=(0,c.useState)(""),[e8,e4]=(0,c.useState)(""),[e5,e6]=(0,c.useState)(""),[e7,e9]=(0,c.useState)(""),[te,tt]=(0,c.useState)(""),[ts,ta]=(0,c.useState)(""),[tr,tl]=(0,c.useState)(""),[tn,ti]=(0,c.useState)(""),[to,tc]=(0,c.useState)(!1),[td,th]=(0,c.useState)(""),[tu,tm]=(0,c.useState)(""),[tx,tp]=(0,c.useState)(""),[tf,tb]=(0,c.useState)(""),[tg,tj]=(0,c.useState)(""),[tw,ty]=(0,c.useState)(!1),tv=(0,c.useCallback)(async()=>{var e,t,s;let l,n,i,o,c,h,m,x,p,f,g,w,v,C,E,M,k,A,R;if(!d.trim())return;eE(!0),await new Promise(e=>setTimeout(e,0));let z=(0,q.mostWallet)(d.trim(),u),P=`${z.username}#${z.address.slice(-4).toUpperCase()}`;b(z),r({...z,displayName:P}),a(`已登录 ${z.username}`,"success"),L((0,q.mostMnemonic)(z.danger));let O=(0,q.most25519)(z.danger);j(O),y((l=new Uint8Array([8,1,18,...(e=>{let t=[];for(;e>=128;)t.push(127&e|128),e>>=7;return t.push(e),t})((e=et(O.private_key,O.ed_public_key).publicKey).length)]),(n=new Uint8Array(l.length+e.length)).set(l,0),n.set(e,l.length),(o=new Uint8Array(2+(i=n).length))[0]=0,o[1]=36,o.set(i,2),c=new Uint8Array([1,114]),(h=new Uint8Array(c.length+o.length)).set(c,0),h.set(o,c.length),"k"+((e,t)=>{if(0===e.length)return"";let s=t.length,a=0;for(;a<e.length&&0===e[a];)a++;let r=[0];for(let t=a;t<e.length;t++){let a=e[t];for(let e=0;e<r.length;e++){let t=256*r[e]+a;r[e]=t%s,a=Math.floor(t/s)}for(;a>0;)r.push(a%s),a=Math.floor(a/s)}let l="";for(let e=0;e<a;e++)l+=t[0];for(let e=r.length-1;e>=0;e--)l+=t[r[e]];return l})(h,"0123456789abcdefghijklmnopqrstuvwxyz")));let I=et(O.private_key,O.ed_public_key);N((t=I.secretKey,m=new Uint8Array([48,5,6,3,43,101,112]),x=new Uint8Array([4,34,4,32,...t.slice(0,32)]),f=(p=new Uint8Array([2,1,0])).length+m.length+x.length,(g=new Uint8Array(2+f))[0]=48,g[1]=f,w=2,g.set(p,w),w+=p.length,g.set(m,w),w+=m.length,g.set(x,w),v=ei(g),`-----BEGIN PRIVATE KEY-----
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17173,e=>{"use strict";let t,s;var a,r,l,n,i,o=e.i(18050),c=e.i(71645),d=Object.defineProperty,h=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,x=(e,t,s)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,p=(e,t)=>{for(var s in t||(t={}))u.call(t,s)&&x(e,s,t[s]);if(h)for(var s of h(t))m.call(t,s)&&x(e,s,t[s]);return e},f=(e,t)=>{var s={};for(var a in e)u.call(e,a)&&0>t.indexOf(a)&&(s[a]=e[a]);if(null!=e&&h)for(var a of h(e))0>t.indexOf(a)&&m.call(e,a)&&(s[a]=e[a]);return s};(e=>{let t=class t{constructor(e,s,a,l){if(this.version=e,this.errorCorrectionLevel=s,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError("Version value out of range");if(l<-1||l>7)throw RangeError("Mask value out of range");this.size=4*e+17;let n=[];for(let e=0;e<this.size;e++)n.push(!1);for(let e=0;e<this.size;e++)this.modules.push(n.slice()),this.isFunction.push(n.slice());this.drawFunctionPatterns();const i=this.addEccAndInterleave(a);if(this.drawCodewords(i),-1==l){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const s=this.getPenaltyScore();s<e&&(l=t,e=s),this.applyMask(t)}}r(0<=l&&l<=7),this.mask=l,this.applyMask(l),this.drawFormatBits(l),this.isFunction=[]}static encodeText(s,a){let r=e.QrSegment.makeSegments(s);return t.encodeSegments(r,a)}static encodeBinary(s,a){let r=e.QrSegment.makeBytes(s);return t.encodeSegments([r],a)}static encodeSegments(e,a,l=1,i=40,o=-1,c=!0){let d,h;if(!(t.MIN_VERSION<=l&&l<=i&&i<=t.MAX_VERSION)||o<-1||o>7)throw RangeError("Invalid value");for(d=l;;d++){let s=8*t.getNumDataCodewords(d,a),r=n.getTotalBits(e,d);if(r<=s){h=r;break}if(d>=i)throw RangeError("Data too long")}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])c&&h<=8*t.getNumDataCodewords(d,e)&&(a=e);let u=[];for(let t of e)for(let e of(s(t.mode.modeBits,4,u),s(t.numChars,t.mode.numCharCountBits(d),u),t.getData()))u.push(e);r(u.length==h);let m=8*t.getNumDataCodewords(d,a);r(u.length<=m),s(0,Math.min(4,m-u.length),u),s(0,(8-u.length%8)%8,u),r(u.length%8==0);for(let e=236;u.length<m;e^=253)s(e,8,u);let x=[];for(;8*x.length<u.length;)x.push(0);return u.forEach((e,t)=>x[t>>>3]|=e<<7-(7&t)),new t(d,a,x,o)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let s=0;s<t;s++)for(let a=0;a<t;a++)(0!=s||0!=a)&&(0!=s||a!=t-1)&&(s!=t-1||0!=a)&&this.drawAlignmentPattern(e[s],e[a]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,s=t;for(let e=0;e<10;e++)s=s<<1^(s>>>9)*1335;let l=(t<<10|s)^21522;r(l>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,a(l,e));this.setFunctionModule(8,7,a(l,6)),this.setFunctionModule(8,8,a(l,7)),this.setFunctionModule(7,8,a(l,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,a(l,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,a(l,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,a(l,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;r(t>>>18==0);for(let e=0;e<18;e++){let s=a(t,e),r=this.size-11+e%3,l=Math.floor(e/3);this.setFunctionModule(r,l,s),this.setFunctionModule(l,r,s)}}drawFinderPattern(e,t){for(let s=-4;s<=4;s++)for(let a=-4;a<=4;a++){let r=Math.max(Math.abs(a),Math.abs(s)),l=e+a,n=t+s;0<=l&&l<this.size&&0<=n&&n<this.size&&this.setFunctionModule(l,n,2!=r&&4!=r)}}drawAlignmentPattern(e,t){for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)this.setFunctionModule(e+a,t+s,1!=Math.max(Math.abs(a),Math.abs(s)))}setFunctionModule(e,t,s){this.modules[t][e]=s,this.isFunction[t][e]=!0}addEccAndInterleave(e){let s=this.version,a=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(s,a))throw RangeError("Invalid argument");let l=t.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][s],n=t.ECC_CODEWORDS_PER_BLOCK[a.ordinal][s],i=Math.floor(t.getNumRawDataModules(s)/8),o=l-i%l,c=Math.floor(i/l),d=[],h=t.reedSolomonComputeDivisor(n);for(let s=0,a=0;s<l;s++){let r=e.slice(a,a+c-n+(s<o?0:1));a+=r.length;let l=t.reedSolomonComputeRemainder(r,h);s<o&&r.push(0),d.push(r.concat(l))}let u=[];for(let e=0;e<d[0].length;e++)d.forEach((t,s)=>{(e!=c-n||s>=o)&&u.push(t[e])});return r(u.length==i),u}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError("Invalid argument");let s=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let l=0;l<2;l++){let n=t-l,i=(t+1&2)==0?this.size-1-r:r;!this.isFunction[i][n]&&s<8*e.length&&(this.modules[i][n]=a(e[s>>>3],7-(7&s)),s++)}}r(s==8*e.length)}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let s=0;s<this.size;s++){let a;switch(e){case 0:a=(s+t)%2==0;break;case 1:a=t%2==0;break;case 2:a=s%3==0;break;case 3:a=(s+t)%3==0;break;case 4:a=(Math.floor(s/3)+Math.floor(t/2))%2==0;break;case 5:a=s*t%2+s*t%3==0;break;case 6:a=(s*t%2+s*t%3)%2==0;break;case 7:a=((s+t)%2+s*t%3)%2==0;break;default:throw Error("Unreachable")}!this.isFunction[t][s]&&a&&(this.modules[t][s]=!this.modules[t][s])}}getPenaltyScore(){let e=0;for(let s=0;s<this.size;s++){let a=!1,r=0,l=[0,0,0,0,0,0,0];for(let n=0;n<this.size;n++)this.modules[s][n]==a?5==++r?e+=t.PENALTY_N1:r>5&&e++:(this.finderPenaltyAddHistory(r,l),a||(e+=this.finderPenaltyCountPatterns(l)*t.PENALTY_N3),a=this.modules[s][n],r=1);e+=this.finderPenaltyTerminateAndCount(a,r,l)*t.PENALTY_N3}for(let s=0;s<this.size;s++){let a=!1,r=0,l=[0,0,0,0,0,0,0];for(let n=0;n<this.size;n++)this.modules[n][s]==a?5==++r?e+=t.PENALTY_N1:r>5&&e++:(this.finderPenaltyAddHistory(r,l),a||(e+=this.finderPenaltyCountPatterns(l)*t.PENALTY_N3),a=this.modules[n][s],r=1);e+=this.finderPenaltyTerminateAndCount(a,r,l)*t.PENALTY_N3}for(let s=0;s<this.size-1;s++)for(let a=0;a<this.size-1;a++){let r=this.modules[s][a];r==this.modules[s][a+1]&&r==this.modules[s+1][a]&&r==this.modules[s+1][a+1]&&(e+=t.PENALTY_N2)}let s=0;for(let e of this.modules)s=e.reduce((e,t)=>e+ +!!t,s);let a=this.size*this.size,l=Math.ceil(Math.abs(20*s-10*a)/a)-1;return r(0<=l&&l<=9),r(0<=(e+=l*t.PENALTY_N4)&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{let e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),s=[6];for(let a=this.size-7;s.length<e;a-=t)s.splice(1,0,a);return s}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError("Version number out of range");let s=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;s-=(25*t-10)*t-55,e>=7&&(s-=36)}return r(208<=s&&s<=29648),s}static getNumDataCodewords(e,s){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError("Degree out of range");let s=[];for(let t=0;t<e-1;t++)s.push(0);s.push(1);let a=1;for(let r=0;r<e;r++){for(let e=0;e<s.length;e++)s[e]=t.reedSolomonMultiply(s[e],a),e+1<s.length&&(s[e]^=s[e+1]);a=t.reedSolomonMultiply(a,2)}return s}static reedSolomonComputeRemainder(e,s){let a=s.map(e=>0);for(let r of e){let e=r^a.shift();a.push(0),s.forEach((s,r)=>a[r]^=t.reedSolomonMultiply(s,e))}return a}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw RangeError("Byte out of range");let s=0;for(let a=7;a>=0;a--)s=s<<1^(s>>>7)*285^(t>>>a&1)*e;return r(s>>>8==0),s}finderPenaltyCountPatterns(e){let t=e[1];r(t<=3*this.size);let s=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(s&&e[0]>=4*t&&e[6]>=t?1:0)+(s&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,s){return e&&(this.finderPenaltyAddHistory(t,s),t=0),t+=this.size,this.finderPenaltyAddHistory(t,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};function s(e,t,s){if(t<0||t>31||e>>>t!=0)throw RangeError("Value out of range");for(let a=t-1;a>=0;a--)s.push(e>>>a&1)}function a(e,t){return(e>>>t&1)!=0}function r(e){if(!e)throw Error("Assertion error")}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;let l=class e{constructor(e,t,s){if(this.mode=e,this.numChars=t,this.bitData=s,t<0)throw RangeError("Invalid argument");this.bitData=s.slice()}static makeBytes(t){let a=[];for(let e of t)s(e,8,a);return new e(e.Mode.BYTE,t.length,a)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError("String contains non-numeric characters");let a=[];for(let e=0;e<t.length;){let r=Math.min(t.length-e,3);s(parseInt(t.substring(e,e+r),10),3*r+1,a),e+=r}return new e(e.Mode.NUMERIC,t.length,a)}static makeAlphanumeric(t){let a;if(!e.isAlphanumeric(t))throw RangeError("String contains unencodable characters in alphanumeric mode");let r=[];for(a=0;a+2<=t.length;a+=2){let l=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a));s(l+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a+1)),11,r)}return a<t.length&&s(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let a=[];if(t<0)throw RangeError("ECI assignment value out of range");if(t<128)s(t,8,a);else if(t<16384)s(2,2,a),s(t,14,a);else if(t<1e6)s(6,3,a),s(t,21,a);else throw RangeError("ECI assignment value out of range");return new e(e.Mode.ECI,0,a)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let s=0;for(let a of e){let e=a.mode.numCharCountBits(t);if(a.numChars>=1<<e)return 1/0;s+=4+e+a.bitData.length}return s}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let s=0;s<e.length;s++)"%"!=e.charAt(s)?t.push(e.charCodeAt(s)):(t.push(parseInt(e.substring(s+1,s+3),16)),s+=2);return t}};l.NUMERIC_REGEX=/^[0-9]*$/,l.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,l.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let n=l;e.QrSegment=l})(i||(i={})),r=(a=i||(i={})).QrCode||(a.QrCode={}),(t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}}).LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),r.Ecc=t,n=(l=i||(i={})).QrSegment||(l.QrSegment={}),(s=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}}).NUMERIC=new s(1,[10,12,14]),s.ALPHANUMERIC=new s(2,[9,11,13]),s.BYTE=new s(4,[8,16,16]),s.KANJI=new s(8,[8,10,12]),s.ECI=new s(7,[0,0,0]),n.Mode=s;var b=i,g={L:b.QrCode.Ecc.LOW,M:b.QrCode.Ecc.MEDIUM,Q:b.QrCode.Ecc.QUARTILE,H:b.QrCode.Ecc.HIGH},j="#FFFFFF",w="#000000";function y(e,t=0){let s=[];return e.forEach(function(e,a){let r=null;e.forEach(function(l,n){if(!l&&null!==r){s.push(`M${r+t} ${a+t}h${n-r}v1H${r+t}z`),r=null;return}if(n===e.length-1){if(!l)return;null===r?s.push(`M${n+t},${a+t} h1v1H${n+t}z`):s.push(`M${r+t},${a+t} h${n+1-r}v1H${r+t}z`);return}l&&null===r&&(r=n)})}),s.join("")}function v(e,t){return e.slice().map((e,s)=>s<t.y||s>=t.y+t.h?e:e.map((e,s)=>(s<t.x||s>=t.x+t.w)&&e))}function N({value:e,level:t,minVersion:s,includeMargin:a,marginSize:r,imageSettings:l,size:n,boostLevel:i}){let o=c.default.useMemo(()=>{let a=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...b.QrSegment.makeSegments(t)),e),[]);return b.QrCode.encodeSegments(a,g[t],s,void 0,void 0,i)},[e,t,s,i]),{cells:d,margin:h,numCells:u,calculatedImageSettings:m}=c.default.useMemo(()=>{let e=o.getModules(),t=null!=r?Math.max(Math.floor(r),0):4*!!a,s=e.length+2*t,i=function(e,t,s,a){if(null==a)return null;let r=e.length+2*s,l=Math.floor(.1*t),n=r/t,i=(a.width||l)*n,o=(a.height||l)*n,c=null==a.x?e.length/2-i/2:a.x*n,d=null==a.y?e.length/2-o/2:a.y*n,h=null==a.opacity?1:a.opacity,u=null;if(a.excavate){let e=Math.floor(c),t=Math.floor(d),s=Math.ceil(i+c-e),a=Math.ceil(o+d-t);u={x:e,y:t,w:s,h:a}}return{x:c,y:d,h:o,w:i,excavation:u,opacity:h,crossOrigin:a.crossOrigin}}(e,n,t,l);return{cells:e,margin:t,numCells:s,calculatedImageSettings:i}},[o,n,l,a,r]);return{qrcode:o,margin:h,cells:d,numCells:u,calculatedImageSettings:m}}var C=function(){try{new Path2D().addPath(new Path2D)}catch(e){return!1}return!0}();c.default.forwardRef(function(e,t){let{value:s,size:a=128,level:r="L",bgColor:l=j,fgColor:n=w,includeMargin:i=!1,minVersion:o=1,boostLevel:d,marginSize:h,imageSettings:u}=e,m=f(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:x}=m,b=f(m,["style"]),g=null==u?void 0:u.src,E=c.default.useRef(null),M=c.default.useRef(null),k=c.default.useCallback(e=>{E.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]),[A,S]=c.default.useState(!1),{margin:R,cells:z,numCells:P,calculatedImageSettings:L}=N({value:s,level:r,minVersion:o,boostLevel:d,includeMargin:i,marginSize:h,imageSettings:u,size:a});c.default.useEffect(()=>{if(null!=E.current){let e=E.current,t=e.getContext("2d");if(!t)return;let s=z,r=M.current,i=null!=L&&null!==r&&r.complete&&0!==r.naturalHeight&&0!==r.naturalWidth;i&&null!=L.excavation&&(s=v(z,L.excavation));let o=window.devicePixelRatio||1;e.height=e.width=a*o;let c=a/P*o;t.scale(c,c),t.fillStyle=l,t.fillRect(0,0,P,P),t.fillStyle=n,C?t.fill(new Path2D(y(s,R))):z.forEach(function(e,s){e.forEach(function(e,a){e&&t.fillRect(a+R,s+R,1,1)})}),L&&(t.globalAlpha=L.opacity),i&&t.drawImage(r,L.x+R,L.y+R,L.w,L.h)}}),c.default.useEffect(()=>{S(!1)},[g]);let O=p({height:a,width:a},x),I=null;return null!=g&&(I=c.default.createElement("img",{src:g,key:g,style:{display:"none"},onLoad:()=>{S(!0)},ref:M,crossOrigin:null==L?void 0:L.crossOrigin})),c.default.createElement(c.default.Fragment,null,c.default.createElement("canvas",p({style:O,height:a,width:a,ref:k,role:"img"},b)),I)}).displayName="QRCodeCanvas";var E=c.default.forwardRef(function(e,t){let{value:s,size:a=128,level:r="L",bgColor:l=j,fgColor:n=w,includeMargin:i=!1,minVersion:o=1,boostLevel:d,title:h,marginSize:u,imageSettings:m}=e,x=f(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:b,cells:g,numCells:C,calculatedImageSettings:E}=N({value:s,level:r,minVersion:o,boostLevel:d,includeMargin:i,marginSize:u,imageSettings:m,size:a}),M=g,k=null;null!=m&&null!=E&&(null!=E.excavation&&(M=v(g,E.excavation)),k=c.default.createElement("image",{href:m.src,height:E.h,width:E.w,x:E.x+b,y:E.y+b,preserveAspectRatio:"none",opacity:E.opacity,crossOrigin:E.crossOrigin}));let A=y(M,b);return c.default.createElement("svg",p({height:a,width:a,viewBox:`0 0 ${C} ${C}`,ref:t,role:"img"},x),!!h&&c.default.createElement("title",null,h),c.default.createElement("path",{fill:l,d:`M0,0 h${C}v${C}H0z`,shapeRendering:"crispEdges"}),c.default.createElement("path",{fill:n,d:A,shapeRendering:"crispEdges"}),k)});E.displayName="QRCodeSVG";var M=e.i(8515),k=e.i(72382),A=e.i(80860),S=e.i(8734),R=e.i(89664),z=e.i(82022),P=e.i(58925),L=e.i(56420);let O=(0,L.default)("fingerprint-pattern",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]),I=(0,L.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),T=(0,L.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var B=e.i(35965),_=e.i(96699);let U=(0,L.default)("qr-code",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]),D=(0,L.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var F=e.i(16327);let K=(0,L.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var $=e.i(62368);let H=(0,L.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var Q=e.i(6537),V=e.i(70904),Y=e.i(11241),W=e.i(59665),G=e.i(3593),X=e.i(71192),q=e.i(66112),J=e.i(15882),Z=e.i(96510),ee=e.i(93957);e.i(77816);let et=(e,t)=>{let s=t.slice(2),a=new Uint8Array((0,J.getBytes)(e+s));return Z.default.sign.keyPair.fromSecretKey(a)};function es({text:e}){let[t,s]=(0,c.useState)(!1),a=async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return(0,o.jsx)("button",{className:"btn btn-icon",onClick:a,title:t?"已复制":"复制",children:t?(0,o.jsx)(R.Check,{size:14}):(0,o.jsx)(S.Copy,{size:14})})}function ea({title:e,icon:t,children:s,accent:a=!1}){return(0,o.jsxs)("div",{className:`web3-key-card ${a?"accent":""}`,children:[(0,o.jsxs)("div",{className:"web3-key-card-header",children:[(0,o.jsx)("span",{className:"web3-key-card-icon",children:t}),(0,o.jsx)("span",{className:"web3-key-card-title",children:e})]}),(0,o.jsx)("div",{className:"web3-key-card-body",children:s})]})}function er({icon:e,message:t}){return(0,o.jsxs)("div",{className:"empty-state glass",children:[(0,o.jsx)("div",{className:"empty-state-icon",children:e}),(0,o.jsx)("p",{children:t})]})}function el({title:e,username:t,password:s,showPassword:a,showPrivateKey:r,account:l,onUsernameChange:n,onPasswordChange:i,onTogglePassword:c,onTogglePrivateKey:d,onGenerate:h}){var u;return(0,o.jsxs)("div",{className:"web3-box-account",children:[(0,o.jsx)("div",{className:"web3-box-account-header",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{children:e}),(0,o.jsx)("p",{children:"用户名和密码会确定性生成 x25519 密钥对。"})]})}),(0,o.jsxs)("div",{className:"web3-box-login",children:[(0,o.jsx)("input",{type:"text",placeholder:"用户名",value:t,onChange:e=>n(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsx)("input",{type:a?"text":"password",placeholder:"密码(可选)",value:s,onChange:e=>i(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("button",{className:"input-eye",onClick:c,type:"button",children:a?(0,o.jsx)(A.EyeOff,{size:16}):(0,o.jsx)(k.Eye,{size:16})})]}),(0,o.jsxs)("button",{className:"btn btn-primary btn-full",onClick:h,disabled:!t.trim(),type:"button",children:[(0,o.jsx)(P.KeyRound,{size:16}),"生成账号"]})]}),l?(0,o.jsxs)("div",{className:"web3-box-key-list",children:[(0,o.jsxs)("div",{className:"web3-box-key-row",children:[(0,o.jsx)("span",{children:"地址"}),(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:l.address.toLowerCase()}),(0,o.jsx)(es,{text:l.address.toLowerCase()})]})]}),(0,o.jsxs)("div",{className:"web3-box-key-row",children:[(0,o.jsx)("span",{children:"x25519 公钥"}),(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:l.publicKey}),(0,o.jsx)(es,{text:l.publicKey})]})]}),(0,o.jsxs)("div",{className:"web3-box-key-row",children:[(0,o.jsx)("span",{children:"x25519 私钥"}),(0,o.jsxs)("div",{className:"mono-row danger",children:[(0,o.jsx)("code",{className:"mono",children:r?l.privateKey:(u=l.privateKey)?"•".repeat(Math.min(u.length,32)):"-"}),(0,o.jsx)("button",{className:"btn btn-icon",onClick:d,title:r?"隐藏私钥":"显示私钥",type:"button",children:r?(0,o.jsx)(k.Eye,{size:14}):(0,o.jsx)(A.EyeOff,{size:14})})]})]})]}):null]})}function en({title:e,description:t,message:s,cipherText:a,decryptedText:r,error:l,encryptLabel:n,decryptLabel:i,messagePlaceholder:c,cipherPlaceholder:d,onMessageChange:h,onCipherTextChange:u,onEncrypt:m,onDecrypt:x}){var p;let f=`box-message-${e.replaceAll(/\s+/g,"-")}`,b=(0,q.parseMostBoxToken)(a);return(0,o.jsxs)("section",{className:"web3-box-flow",children:[(0,o.jsx)("div",{className:"web3-box-flow-header",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{children:e}),(0,o.jsx)("p",{children:t})]})}),(0,o.jsx)("label",{className:"web3-box-label",htmlFor:f,children:"明文"}),(0,o.jsx)("textarea",{id:f,className:"textarea",value:s,onChange:e=>h(e.target.value),rows:4,placeholder:c}),(0,o.jsxs)("div",{className:"web3-box-actions",children:[(0,o.jsxs)("button",{className:"btn btn-primary",onClick:m,type:"button",children:[(0,o.jsx)(Q.Lock,{size:16}),n]}),(0,o.jsxs)("button",{className:"btn btn-secondary",onClick:x,type:"button",children:[(0,o.jsx)(P.KeyRound,{size:16}),i]})]}),l&&(0,o.jsx)("p",{className:"web3-tools-danger",children:l}),(0,o.jsxs)("div",{className:"web3-box-result-grid",children:[(0,o.jsxs)("div",{className:"web3-box-result",children:[(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"密文"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:a,onChange:e=>u(e.target.value),rows:5,placeholder:d})]}),(0,o.jsxs)("div",{className:"web3-box-result",children:[(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"解密结果"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:r,readOnly:!0,rows:5,placeholder:"解密成功后显示明文"})]})]}),b&&(0,o.jsxs)("div",{className:"web3-box-token-meta",children:[(0,o.jsxs)("div",{className:"web3-box-token-meta-row",children:[(0,o.jsx)("span",{children:"时间戳"}),(0,o.jsx)("code",{children:Number.isFinite(p=b.timestampMs)?`${new Date(p).toLocaleString()}`:"-"})]}),(0,o.jsxs)("div",{className:"web3-box-token-meta-row",children:[(0,o.jsx)("span",{children:"随机数"}),(0,o.jsx)("code",{children:b.nonce})]})]})]})}ee.generateAvatar;let ei=e=>btoa(String.fromCharCode(...e));function eo({label:e,pem:t,filename:s}){let[a,r]=(0,c.useState)(!1),l=async()=>{try{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return(0,o.jsxs)("div",{className:"web3-pem-block",children:[(0,o.jsxs)("div",{className:"web3-pem-header",children:[(0,o.jsx)("span",{className:"web3-pem-label",children:e}),(0,o.jsxs)("div",{className:"web3-pem-actions",children:[(0,o.jsxs)("button",{className:"btn btn-sm",onClick:l,title:a?"已复制":"复制",children:[(0,o.jsx)(S.Copy,{size:14}),a?"已复制":"复制"]}),(0,o.jsxs)("button",{className:"btn btn-sm btn-primary",onClick:()=>{let e=new Blob([t],{type:"text/plain"}),a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=s,r.click(),URL.revokeObjectURL(a)},title:"下载",children:[(0,o.jsx)($.Download,{size:14}),"下载"]})]})]}),(0,o.jsx)("textarea",{className:"textarea mono",value:t,readOnly:!0,rows:6})]})}e.s(["default",0,function(){let e,t=(0,G.useAppStore)(e=>e.isDarkMode),s=(0,G.useAppStore)(e=>e.setIsDarkMode),a=(0,G.useAppStore)(e=>e.addToast),r=(0,X.useUserStore)(e=>e.setUserIdentity),l=["wallet","pem","export","EA"],[n,i]=(0,c.useState)("wallet");(0,c.useEffect)(()=>{let e=()=>{let e=window.location.hash.replace("#","");return l.includes(e)?e:"wallet"};i(e());let t=()=>i(e());return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)},[]);let[d,h]=(0,c.useState)(""),[u,m]=(0,c.useState)(""),[x,p]=(0,c.useState)(!1),[f,b]=(0,c.useState)(null),[g,j]=(0,c.useState)(null),[w,y]=(0,c.useState)(""),[v,N]=(0,c.useState)(""),[C,S]=(0,c.useState)(""),[R,L]=(0,c.useState)(""),[$,J]=(0,c.useState)([]),[Z,ec]=(0,c.useState)(0),[ed,eh]=(0,c.useState)(!0),[eu,em]=(0,c.useState)(!0),[ex,ep]=(0,c.useState)(!1),[ef,eb]=(0,c.useState)(!1),[eg,ej]=(0,c.useState)(!1),[ew,ey]=(0,c.useState)(!1),[ev,eN]=(0,c.useState)(!1),[eC,eE]=(0,c.useState)(!1),[eM,ek]=(0,c.useState)(""),[eA,eS]=(0,c.useState)(""),[eR,ez]=(0,c.useState)(!1),[eP,eL]=(0,c.useState)(!1),[eO,eI]=(0,c.useState)(null),[eT,eB]=(0,c.useState)(""),[e_,eU]=(0,c.useState)(""),[eD,eF]=(0,c.useState)(!1),[eK,e$]=(0,c.useState)(!1),[eH,eQ]=(0,c.useState)(null),[eV,eY]=(0,c.useState)("你好,B。这是来自 A 的加密消息。"),[eW,eG]=(0,c.useState)(""),[eX,eq]=(0,c.useState)(""),[eJ,eZ]=(0,c.useState)(""),[e0,e1]=(0,c.useState)("你好,A。这是来自 B 的加密消息。"),[e2,e3]=(0,c.useState)(""),[e8,e4]=(0,c.useState)(""),[e6,e5]=(0,c.useState)(""),[e7,e9]=(0,c.useState)(""),[te,tt]=(0,c.useState)(""),[ts,ta]=(0,c.useState)(""),[tr,tl]=(0,c.useState)(""),[tn,ti]=(0,c.useState)(""),[to,tc]=(0,c.useState)(!1),[td,th]=(0,c.useState)(""),[tu,tm]=(0,c.useState)(""),[tx,tp]=(0,c.useState)(""),[tf,tb]=(0,c.useState)(""),[tg,tj]=(0,c.useState)(""),[tw,ty]=(0,c.useState)(!1),tv=(0,c.useCallback)(async()=>{var e,t,s;let l,n,i,o,c,h,m,x,p,f,g,w,v,C,E,M,k,A,R;if(!d.trim())return;eE(!0),await new Promise(e=>setTimeout(e,0));let z=(0,q.mostWallet)(d.trim(),u),P=`${z.username}#${z.address.slice(-4).toUpperCase()}`;b(z),r({...z,displayName:P}),a(`已登录 ${z.username}`,"success"),L((0,q.mostMnemonic)(z.danger));let O=(0,q.most25519)(z.danger);j(O),y((l=new Uint8Array([8,1,18,...(e=>{let t=[];for(;e>=128;)t.push(127&e|128),e>>=7;return t.push(e),t})((e=et(O.private_key,O.ed_public_key).publicKey).length)]),(n=new Uint8Array(l.length+e.length)).set(l,0),n.set(e,l.length),(o=new Uint8Array(2+(i=n).length))[0]=0,o[1]=36,o.set(i,2),c=new Uint8Array([1,114]),(h=new Uint8Array(c.length+o.length)).set(c,0),h.set(o,c.length),"k"+((e,t)=>{if(0===e.length)return"";let s=t.length,a=0;for(;a<e.length&&0===e[a];)a++;let r=[0];for(let t=a;t<e.length;t++){let a=e[t];for(let e=0;e<r.length;e++){let t=256*r[e]+a;r[e]=t%s,a=Math.floor(t/s)}for(;a>0;)r.push(a%s),a=Math.floor(a/s)}let l="";for(let e=0;e<a;e++)l+=t[0];for(let e=r.length-1;e>=0;e--)l+=t[r[e]];return l})(h,"0123456789abcdefghijklmnopqrstuvwxyz")));let I=et(O.private_key,O.ed_public_key);N((t=I.secretKey,m=new Uint8Array([48,5,6,3,43,101,112]),x=new Uint8Array([4,34,4,32,...t.slice(0,32)]),f=(p=new Uint8Array([2,1,0])).length+m.length+x.length,(g=new Uint8Array(2+f))[0]=48,g[1]=f,w=2,g.set(p,w),w+=p.length,g.set(m,w),w+=m.length,g.set(x,w),v=ei(g),`-----BEGIN PRIVATE KEY-----
2
2
  ${v.match(/.{1,64}/g)?.join("\n")}
3
3
  -----END PRIVATE KEY-----`)),S((s=I.publicKey,C=new Uint8Array([48,5,6,3,43,101,112]),E=new Uint8Array([3,33,0,...s]),(k=new Uint8Array(2+(M=C.length+E.length)))[0]=48,k[1]=M,A=2,k.set(C,A),A+=C.length,k.set(E,A),R=ei(k),`-----BEGIN PUBLIC KEY-----
4
4
  ${R.match(/.{1,64}/g)?.join("\n")}
5
- -----END PUBLIC KEY-----`)),J([]),ec(0),eb(!1),ej(!1),ey(!1),eN(!1),eE(!1)},[a,u,r,d]);function tN(e,t,s,r){let l=t.trim();if(!l)return;let n=(0,q.mostWallet)(l,s),i=(0,q.most25519)(n.danger);r({username:n.username,address:n.address,publicKey:i.public_key,privateKey:i.private_key}),eq(""),eZ(""),e4(""),e6(""),a("账号已生成","success")}function tC({senderAccount:e,recipientAccount:t,message:s,setCipherText:a,setDecryptedText:r,setError:l}){e&&t?s.trim()?(a((0,q.mostBoxEncrypt)(s,{senderPrivateKey:e.privateKey,recipientPublicKey:t.publicKey})),r(""),l("")):l("请输入要加密的消息"):l("请先生成 A 和 B 两个账号")}function tE({senderAccount:e,recipientAccount:t,cipherText:s,setDecryptedText:a,setError:r}){if(!e||!t)return void r("请先生成 A 和 B 两个账号");if(!s.trim())return void r("请先生成或粘贴密文");let l=(0,q.mostBoxDecrypt)(s,{senderPublicKey:e.publicKey,recipientPrivateKey:t.privateKey});if(!l){r("解密失败,请确认发送方公钥、接收方私钥和密文匹配"),a("");return}a(l),r("")}let tM=!!f,tk=f?.address||"",tA=(0,ee.generateAvatar)(tk||void 0),tS=[{id:"wallet",icon:(0,o.jsx)(H,{size:16}),label:"Web3"},{id:"pem",icon:(0,o.jsx)(Q.Lock,{size:16}),label:"PEM 导出"},{id:"export",icon:(0,o.jsx)(V.Wallet,{size:16}),label:"Wallet 导出"},{id:"EA",icon:(0,o.jsx)(P.KeyRound,{size:16}),label:"非对称加密"}];return(0,o.jsx)(W.default,{sidebar:({closeSidebar:e})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>window.location.href="/",children:[(0,o.jsx)(Y.ArrowLeft,{size:18}),(0,o.jsx)("h1",{children:"MOST PEOPLE"})]}),(0,o.jsx)("nav",{className:"sidebar-nav",children:tS.map(t=>(0,o.jsxs)("button",{onClick:()=>{var s;i(s=t.id),window.location.hash=s,e()},className:`sidebar-nav-btn ${n===t.id?"active":""}`,children:[t.icon,(0,o.jsx)("span",{children:t.label})]},t.id))})]}),headerTitle:(0,o.jsx)("h2",{className:"header-title",children:"wallet"===n?"Web3":"pem"===n?"PEM 导出":"EA"===n?"非对称加密":"Wallet 导出"}),headerRight:(0,o.jsx)("button",{className:"btn btn-icon",onClick:()=>s(!t),title:"切换主题",children:t?(0,o.jsx)(B.Sun,{size:16}):(0,o.jsx)(_.Moon,{size:16})}),children:(0,o.jsx)("div",{className:"web3-page",children:(0,o.jsxs)("div",{className:`web3-container ${"EA"===n?"wide":""}`,children:["EA"!==n&&(0,o.jsxs)("div",{className:"input-panel",children:[(0,o.jsxs)("div",{className:"web3-tools-inputs",children:[(0,o.jsx)("input",{type:"text",placeholder:"用户名",value:d,onChange:e=>h(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsx)("input",{type:x?"text":"password",placeholder:"密码(可选)",value:u,onChange:e=>m(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("button",{className:"input-eye",onClick:()=>p(!x),type:"button",children:x?(0,o.jsx)(A.EyeOff,{size:16}):(0,o.jsx)(k.Eye,{size:16})})]})]}),(0,o.jsx)("button",{className:"btn btn-primary btn-full",onClick:tv,disabled:!d.trim()||eC,type:"button",children:eC?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"spinner"}),"生成中..."]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(V.Wallet,{size:16}),"生成并登录"]})})]}),"wallet"===n&&(0,o.jsx)(o.Fragment,{children:tM&&tk?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"web3-identity-card",children:[(0,o.jsx)("img",{src:tA,alt:"avatar",className:"web3-identity-avatar"}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"web3-identity-name",children:f?.username||"未登录"}),(0,o.jsxs)("div",{className:"web3-identity-address",children:[(0,o.jsx)("code",{children:tk.toLowerCase()}),(0,o.jsx)(es,{text:tk.toLowerCase()}),(0,o.jsxs)("a",{href:`https://debank.com/profile/${tk}`,target:"_blank",rel:"noopener noreferrer",className:"link",children:[(0,o.jsx)(z.ExternalLink,{size:14}),"查看"]})]})]})]}),g&&(0,o.jsxs)("div",{className:"web3-key-grid",children:[(0,o.jsx)(ea,{title:"Ed25519 公钥",icon:(0,o.jsx)(O,{size:18}),children:(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:g.ed_public_key}),(0,o.jsx)(es,{text:g.ed_public_key})]})}),(0,o.jsx)(ea,{title:"x25519 公钥",icon:(0,o.jsx)(P.KeyRound,{size:18}),children:(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:g.public_key}),(0,o.jsx)(es,{text:g.public_key})]})}),(0,o.jsx)(ea,{title:"x25519 & Ed25519 私钥",icon:(0,o.jsx)(I,{size:18}),accent:!0,children:(0,o.jsxs)("div",{className:"mono-row danger",children:[(0,o.jsx)("code",{className:"mono",children:ev?g.private_key:(e=g.private_key)?"•".repeat(Math.min(e.length,32)):"-"}),(0,o.jsx)("button",{className:"btn btn-icon",onClick:()=>eN(!ev),title:ev?"隐藏私钥":"显示私钥",type:"button",children:ev?(0,o.jsx)(k.Eye,{size:14}):(0,o.jsx)(A.EyeOff,{size:14})})]})}),(0,o.jsx)(ea,{title:"IPNS ID",icon:(0,o.jsx)(T,{size:18}),children:(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:w}),(0,o.jsx)(es,{text:w})]})})]})]}):(0,o.jsx)(er,{icon:(0,o.jsx)(H,{size:36}),message:"请输入用户名和密码以查看身份信息"})}),"pem"===n&&(0,o.jsx)(o.Fragment,{children:C&&v?(0,o.jsxs)("div",{className:"web3-pem-list",children:[(0,o.jsx)(eo,{label:`${f?.username||"wallet"}.pub`,pem:C,filename:`${f?.username||"wallet"}.pub`}),(0,o.jsx)(eo,{label:`${f?.username||"wallet"}.pem`,pem:v,filename:`${f?.username||"wallet"}.pem`})]}):(0,o.jsx)(er,{icon:(0,o.jsx)(Q.Lock,{size:36}),message:"请输入用户名和密码以生成 PEM 密钥"})}),"export"===n&&(0,o.jsx)(o.Fragment,{children:tM&&tk?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"web3-tools-section",children:[(0,o.jsxs)("button",{className:"web3-tools-toggle",onClick:()=>eb(!ef),children:[(0,o.jsx)(U,{size:14}),ef?"隐藏地址二维码":"显示地址二维码",ef?(0,o.jsx)(K,{size:14}):(0,o.jsx)(F.ChevronDown,{size:14})]}),ef&&(0,o.jsxs)("div",{className:"web3-mnemonic-reveal",children:[(0,o.jsxs)("div",{className:"web3-mnemonic-card",children:[(0,o.jsx)("p",{className:"web3-mnemonic-text",children:tk}),(0,o.jsx)(es,{text:tk})]}),(0,o.jsx)("div",{className:"qr-wrap",children:(0,o.jsx)(E,{value:tk,size:200})})]})]}),R&&(0,o.jsxs)("div",{className:"web3-tools-section",children:[(0,o.jsxs)("button",{className:"web3-tools-toggle",onClick:()=>ej(!eg),children:[(0,o.jsx)(P.KeyRound,{size:14}),eg?"隐藏助记词":"显示助记词",eg?(0,o.jsx)(K,{size:14}):(0,o.jsx)(F.ChevronDown,{size:14})]}),eg&&(0,o.jsxs)("div",{className:"web3-mnemonic-reveal",children:[(0,o.jsxs)("div",{className:"web3-mnemonic-card",children:[(0,o.jsx)("p",{className:"web3-mnemonic-text",children:R}),(0,o.jsx)(es,{text:R})]}),(0,o.jsxs)("p",{className:"web3-tools-danger",children:[(0,o.jsx)(D,{size:14}),"任何拥有您助记词的人都可以窃取您账户中的任何资产,切勿泄露!!!"]}),(0,o.jsx)("button",{className:"web3-tools-toggle",onClick:()=>ey(!ew),children:ew?"隐藏助记词二维码":"显示助记词二维码"}),ew&&(0,o.jsx)("div",{className:"qr-wrap",children:(0,o.jsx)(E,{value:R,size:260})})]})]}),R&&(0,o.jsxs)("div",{className:"web3-mnemonic-reveal",children:[(0,o.jsx)("div",{children:(0,o.jsxs)("button",{className:"btn btn-primary",onClick:()=>{if(!R)return;let e=[];for(let t=Z;t<Z+10;t++){let s=`m/44'/60'/0'/0/${t}`,a=M.HDNodeWallet.fromPhrase(R,void 0,s);e.push({index:t,address:a.address,privateKey:a.privateKey})}J(t=>[...t,...e]),ec(e=>e+10)},children:["派生 ",10," 个地址"]})}),(0,o.jsxs)("p",{className:"web3-tools-danger",children:[(0,o.jsx)(D,{size:14}),"任何拥有您私钥的人都可以窃取您地址中的任何资产,切勿泄露!!!"]}),$.length>0&&(0,o.jsx)("div",{className:"web3-derive-table-wrap",children:(0,o.jsxs)("table",{className:"web3-derive-table",children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{onClick:()=>eh(!ed),className:"web3-derive-th",children:"账户"}),(0,o.jsx)("th",{onClick:()=>em(!eu),className:"web3-derive-th",children:"地址"}),(0,o.jsxs)("th",{onClick:()=>ep(!ex),className:"web3-derive-th danger",children:["私钥(点击",ex?"隐藏":"显示",")"]})]})}),(0,o.jsx)("tbody",{children:$.map(e=>(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{children:ed?e.index+1:""}),(0,o.jsx)("td",{children:eu?e.address:""}),(0,o.jsx)("td",{className:"danger",children:ex?e.privateKey:""})]},e.index))})]})})]})]}):(0,o.jsx)(er,{icon:(0,o.jsx)(V.Wallet,{size:36}),message:"请输入用户名和密码以使用钱包工具"})}),"EA"===n&&(0,o.jsxs)("div",{className:"web3-box-workspace",children:[(0,o.jsxs)("div",{className:"web3-box-grid",children:[(0,o.jsx)(el,{title:"A 账号",username:eM,password:eA,showPassword:eR,showPrivateKey:eP,account:eO,onUsernameChange:ek,onPasswordChange:eS,onTogglePassword:()=>ez(!eR),onTogglePrivateKey:()=>eL(!eP),onGenerate:()=>tN("A",eM,eA,eI)}),(0,o.jsx)(el,{title:"B 账号",username:eT,password:e_,showPassword:eD,showPrivateKey:eK,account:eH,onUsernameChange:eB,onPasswordChange:eU,onTogglePassword:()=>eF(!eD),onTogglePrivateKey:()=>e$(!eK),onGenerate:()=>tN("B",eT,e_,eQ)})]}),(0,o.jsxs)("div",{className:"web3-box-flow-grid",children:[(0,o.jsx)(en,{title:"A → B",description:"加密使用 A 私钥 + B 公钥;解密使用 A 公钥 + B 私钥。",message:eV,cipherText:eW,decryptedText:eX,error:eJ,encryptLabel:"用 A 私钥 + B 公钥加密",decryptLabel:"用 A 公钥 + B 私钥解密",messagePlaceholder:"输入要从 A 发给 B 的消息",cipherPlaceholder:"加密后生成密文,或粘贴已有密文",onMessageChange:eY,onCipherTextChange:eG,onEncrypt:()=>tC({senderAccount:eO,recipientAccount:eH,message:eV,setCipherText:eG,setDecryptedText:eq,setError:eZ}),onDecrypt:()=>tE({senderAccount:eO,recipientAccount:eH,cipherText:eW,setDecryptedText:eq,setError:eZ})}),(0,o.jsx)(en,{title:"B → A",description:"加密使用 B 私钥 + A 公钥;解密使用 B 公钥 + A 私钥。",message:e0,cipherText:e2,decryptedText:e8,error:e5,encryptLabel:"用 B 私钥 + A 公钥加密",decryptLabel:"用 B 公钥 + A 私钥解密",messagePlaceholder:"输入要从 B 发给 A 的消息",cipherPlaceholder:"加密后生成密文,或粘贴已有密文",onMessageChange:e1,onCipherTextChange:e3,onEncrypt:()=>tC({senderAccount:eH,recipientAccount:eO,message:e0,setCipherText:e3,setDecryptedText:e4,setError:e6}),onDecrypt:()=>tE({senderAccount:eH,recipientAccount:eO,cipherText:e2,setDecryptedText:e4,setError:e6})})]}),(0,o.jsxs)("div",{className:"web3-box-flow-grid",children:[(0,o.jsxs)("section",{className:"web3-box-flow",children:[(0,o.jsx)("div",{className:"web3-box-flow-header",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{children:"加密"}),(0,o.jsx)("p",{children:"只输入发送方私钥和接收方公钥即可加密,无需生成完整账号。"})]})}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"发送方"})}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsx)("input",{type:tw?"text":"password",placeholder:"发送方 x25519 私钥",value:td,onChange:e=>th(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("button",{className:"input-eye",onClick:()=>ty(!tw),type:"button",children:tw?(0,o.jsx)(A.EyeOff,{size:16}):(0,o.jsx)(k.Eye,{size:16})})]}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"接收方"})}),(0,o.jsx)("input",{type:"text",placeholder:"接收方 x25519 公钥",value:tu,onChange:e=>tm(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"明文"})}),(0,o.jsx)("textarea",{className:"textarea",value:tx,onChange:e=>tp(e.target.value),rows:4,placeholder:"输入要加密的消息"}),(0,o.jsx)("div",{className:"web3-box-actions",children:(0,o.jsxs)("button",{className:"btn btn-primary",onClick:function(){td.trim()?tu.trim()?tx.trim()?(tb((0,q.mostBoxEncrypt)(tx,{senderPrivateKey:td.trim(),recipientPublicKey:tu.trim()})),tj("")):tj("请输入要加密的消息"):tj("请输入接收方公钥"):tj("请输入发送方私钥")},type:"button",children:[(0,o.jsx)(Q.Lock,{size:16}),"加密"]})}),tg&&(0,o.jsx)("p",{className:"web3-tools-danger",children:tg}),(0,o.jsxs)("div",{className:"web3-box-result",children:[(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"密文"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:tf,readOnly:!0,rows:5,placeholder:"加密成功后显示密文"})]})]}),(0,o.jsxs)("section",{className:"web3-box-flow",children:[(0,o.jsx)("div",{className:"web3-box-flow-header",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{children:"解密"}),(0,o.jsx)("p",{children:"只输入发送方公钥和接收方私钥即可解密,无需生成完整账号。"})]})}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"发送方"})}),(0,o.jsx)("input",{type:"text",placeholder:"发送方 x25519 公钥",value:e7,onChange:e=>e9(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"接收方"})}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsx)("input",{type:to?"text":"password",placeholder:"接收方 x25519 私钥",value:te,onChange:e=>tt(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("button",{className:"input-eye",onClick:()=>tc(!to),type:"button",children:to?(0,o.jsx)(A.EyeOff,{size:16}):(0,o.jsx)(k.Eye,{size:16})})]}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"密文"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:ts,onChange:e=>ta(e.target.value),rows:5,placeholder:"粘贴要解密的密文"}),(0,o.jsx)("div",{className:"web3-box-actions",children:(0,o.jsxs)("button",{className:"btn btn-secondary",onClick:function(){if(!e7.trim())return void ti("请输入发送方公钥");if(!te.trim())return void ti("请输入接收方私钥");if(!ts.trim())return void ti("请粘贴密文");let e=(0,q.mostBoxDecrypt)(ts,{senderPublicKey:e7.trim(),recipientPrivateKey:te.trim()});if(!e){ti("解密失败,请确认发送方公钥、接收方私钥和密文匹配"),tl("");return}tl(e),ti("")},type:"button",children:[(0,o.jsx)(P.KeyRound,{size:16}),"解密"]})}),tn&&(0,o.jsx)("p",{className:"web3-tools-danger",children:tn}),(0,o.jsxs)("div",{className:"web3-box-result",children:[(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"解密结果"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:tr,readOnly:!0,rows:5,placeholder:"解密成功后显示明文"})]})]})]})]})]})})})}],17173)}]);
5
+ -----END PUBLIC KEY-----`)),J([]),ec(0),eb(!1),ej(!1),ey(!1),eN(!1),eE(!1)},[a,u,r,d]);function tN(e,t,s,r){let l=t.trim();if(!l)return;let n=(0,q.mostWallet)(l,s),i=(0,q.most25519)(n.danger);r({username:n.username,address:n.address,publicKey:i.public_key,privateKey:i.private_key}),eq(""),eZ(""),e4(""),e5(""),a("账号已生成","success")}function tC({senderAccount:e,recipientAccount:t,message:s,setCipherText:a,setDecryptedText:r,setError:l}){e&&t?s.trim()?(a((0,q.mostBoxEncrypt)(s,{senderPrivateKey:e.privateKey,recipientPublicKey:t.publicKey})),r(""),l("")):l("请输入要加密的消息"):l("请先生成 A 和 B 两个账号")}function tE({senderAccount:e,recipientAccount:t,cipherText:s,setDecryptedText:a,setError:r}){if(!e||!t)return void r("请先生成 A 和 B 两个账号");if(!s.trim())return void r("请先生成或粘贴密文");let l=(0,q.mostBoxDecrypt)(s,{senderPublicKey:e.publicKey,recipientPrivateKey:t.privateKey});if(!l){r("解密失败,请确认发送方公钥、接收方私钥和密文匹配"),a("");return}a(l),r("")}let tM=!!f,tk=f?.address||"",tA=(0,ee.generateAvatar)(tk||void 0),tS=[{id:"wallet",icon:(0,o.jsx)(H,{size:16}),label:"Web3"},{id:"pem",icon:(0,o.jsx)(Q.Lock,{size:16}),label:"PEM 导出"},{id:"export",icon:(0,o.jsx)(V.Wallet,{size:16}),label:"Wallet 导出"},{id:"EA",icon:(0,o.jsx)(P.KeyRound,{size:16}),label:"非对称加密"}];return(0,o.jsx)(W.default,{sidebar:({closeSidebar:e})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>window.location.href="/",children:[(0,o.jsx)(Y.ArrowLeft,{size:18}),(0,o.jsx)("h1",{children:"MOST PEOPLE"})]}),(0,o.jsx)("nav",{className:"sidebar-nav",children:tS.map(t=>(0,o.jsxs)("button",{onClick:()=>{var s;i(s=t.id),window.location.hash=s,e()},className:`sidebar-nav-btn ${n===t.id?"active":""}`,children:[t.icon,(0,o.jsx)("span",{children:t.label})]},t.id))})]}),headerTitle:(0,o.jsx)("h2",{className:"header-title",children:"wallet"===n?"Web3":"pem"===n?"PEM 导出":"EA"===n?"非对称加密":"Wallet 导出"}),headerRight:(0,o.jsx)("button",{className:"btn btn-icon",onClick:()=>s(!t),title:"切换主题",children:t?(0,o.jsx)(B.Sun,{size:16}):(0,o.jsx)(_.Moon,{size:16})}),children:(0,o.jsx)("div",{className:"web3-page",children:(0,o.jsxs)("div",{className:`web3-container ${"EA"===n?"wide":""}`,children:["EA"!==n&&(0,o.jsxs)("div",{className:"input-panel",children:[(0,o.jsxs)("div",{className:"web3-tools-inputs",children:[(0,o.jsx)("input",{type:"text",placeholder:"用户名",value:d,onChange:e=>h(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsx)("input",{type:x?"text":"password",placeholder:"密码(可选)",value:u,onChange:e=>m(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("button",{className:"input-eye",onClick:()=>p(!x),type:"button",children:x?(0,o.jsx)(A.EyeOff,{size:16}):(0,o.jsx)(k.Eye,{size:16})})]})]}),(0,o.jsx)("button",{className:"btn btn-primary btn-full",onClick:tv,disabled:!d.trim()||eC,type:"button",children:eC?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"spinner"}),"生成中..."]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(V.Wallet,{size:16}),"生成并登录"]})})]}),"wallet"===n&&(0,o.jsx)(o.Fragment,{children:tM&&tk?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"web3-identity-card",children:[(0,o.jsx)("img",{src:tA,alt:"avatar",className:"web3-identity-avatar"}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"web3-identity-name",children:f?.username||"未登录"}),(0,o.jsxs)("div",{className:"web3-identity-address",children:[(0,o.jsx)("code",{children:tk.toLowerCase()}),(0,o.jsx)(es,{text:tk.toLowerCase()}),(0,o.jsxs)("a",{href:`https://debank.com/profile/${tk}`,target:"_blank",rel:"noopener noreferrer",className:"link",children:[(0,o.jsx)(z.ExternalLink,{size:14}),"查看"]})]})]})]}),g&&(0,o.jsxs)("div",{className:"web3-key-grid",children:[(0,o.jsx)(ea,{title:"Ed25519 公钥",icon:(0,o.jsx)(O,{size:18}),children:(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:g.ed_public_key}),(0,o.jsx)(es,{text:g.ed_public_key})]})}),(0,o.jsx)(ea,{title:"x25519 公钥",icon:(0,o.jsx)(P.KeyRound,{size:18}),children:(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:g.public_key}),(0,o.jsx)(es,{text:g.public_key})]})}),(0,o.jsx)(ea,{title:"x25519 & Ed25519 私钥",icon:(0,o.jsx)(I,{size:18}),accent:!0,children:(0,o.jsxs)("div",{className:"mono-row danger",children:[(0,o.jsx)("code",{className:"mono",children:ev?g.private_key:(e=g.private_key)?"•".repeat(Math.min(e.length,32)):"-"}),(0,o.jsx)("button",{className:"btn btn-icon",onClick:()=>eN(!ev),title:ev?"隐藏私钥":"显示私钥",type:"button",children:ev?(0,o.jsx)(k.Eye,{size:14}):(0,o.jsx)(A.EyeOff,{size:14})})]})}),(0,o.jsx)(ea,{title:"IPNS ID",icon:(0,o.jsx)(T,{size:18}),children:(0,o.jsxs)("div",{className:"mono-row",children:[(0,o.jsx)("code",{className:"mono",children:w}),(0,o.jsx)(es,{text:w})]})})]})]}):(0,o.jsx)(er,{icon:(0,o.jsx)(H,{size:36}),message:"请输入用户名和密码以查看身份信息"})}),"pem"===n&&(0,o.jsx)(o.Fragment,{children:C&&v?(0,o.jsxs)("div",{className:"web3-pem-list",children:[(0,o.jsx)(eo,{label:`${f?.username||"wallet"}.pub`,pem:C,filename:`${f?.username||"wallet"}.pub`}),(0,o.jsx)(eo,{label:`${f?.username||"wallet"}.pem`,pem:v,filename:`${f?.username||"wallet"}.pem`})]}):(0,o.jsx)(er,{icon:(0,o.jsx)(Q.Lock,{size:36}),message:"请输入用户名和密码以生成 PEM 密钥"})}),"export"===n&&(0,o.jsx)(o.Fragment,{children:tM&&tk?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"web3-tools-section",children:[(0,o.jsxs)("button",{className:"web3-tools-toggle",onClick:()=>eb(!ef),children:[(0,o.jsx)(U,{size:14}),ef?"隐藏地址二维码":"显示地址二维码",ef?(0,o.jsx)(K,{size:14}):(0,o.jsx)(F.ChevronDown,{size:14})]}),ef&&(0,o.jsxs)("div",{className:"web3-mnemonic-reveal",children:[(0,o.jsxs)("div",{className:"web3-mnemonic-card",children:[(0,o.jsx)("p",{className:"web3-mnemonic-text",children:tk}),(0,o.jsx)(es,{text:tk})]}),(0,o.jsx)("div",{className:"qr-wrap",children:(0,o.jsx)(E,{value:tk,size:200})})]})]}),R&&(0,o.jsxs)("div",{className:"web3-tools-section",children:[(0,o.jsxs)("button",{className:"web3-tools-toggle",onClick:()=>ej(!eg),children:[(0,o.jsx)(P.KeyRound,{size:14}),eg?"隐藏助记词":"显示助记词",eg?(0,o.jsx)(K,{size:14}):(0,o.jsx)(F.ChevronDown,{size:14})]}),eg&&(0,o.jsxs)("div",{className:"web3-mnemonic-reveal",children:[(0,o.jsxs)("div",{className:"web3-mnemonic-card",children:[(0,o.jsx)("p",{className:"web3-mnemonic-text",children:R}),(0,o.jsx)(es,{text:R})]}),(0,o.jsxs)("p",{className:"web3-tools-danger",children:[(0,o.jsx)(D,{size:14}),"任何拥有您助记词的人都可以窃取您账户中的任何资产,切勿泄露!!!"]}),(0,o.jsx)("button",{className:"web3-tools-toggle",onClick:()=>ey(!ew),children:ew?"隐藏助记词二维码":"显示助记词二维码"}),ew&&(0,o.jsx)("div",{className:"qr-wrap",children:(0,o.jsx)(E,{value:R,size:260})})]})]}),R&&(0,o.jsxs)("div",{className:"web3-mnemonic-reveal",children:[(0,o.jsx)("div",{children:(0,o.jsxs)("button",{className:"btn btn-primary",onClick:()=>{if(!R)return;let e=[];for(let t=Z;t<Z+10;t++){let s=`m/44'/60'/0'/0/${t}`,a=M.HDNodeWallet.fromPhrase(R,void 0,s);e.push({index:t,address:a.address,privateKey:a.privateKey})}J(t=>[...t,...e]),ec(e=>e+10)},children:["派生 ",10," 个地址"]})}),(0,o.jsxs)("p",{className:"web3-tools-danger",children:[(0,o.jsx)(D,{size:14}),"任何拥有您私钥的人都可以窃取您地址中的任何资产,切勿泄露!!!"]}),$.length>0&&(0,o.jsx)("div",{className:"web3-derive-table-wrap",children:(0,o.jsxs)("table",{className:"web3-derive-table",children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{onClick:()=>eh(!ed),className:"web3-derive-th",children:"账户"}),(0,o.jsx)("th",{onClick:()=>em(!eu),className:"web3-derive-th",children:"地址"}),(0,o.jsxs)("th",{onClick:()=>ep(!ex),className:"web3-derive-th danger",children:["私钥(点击",ex?"隐藏":"显示",")"]})]})}),(0,o.jsx)("tbody",{children:$.map(e=>(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{children:ed?e.index+1:""}),(0,o.jsx)("td",{children:eu?e.address:""}),(0,o.jsx)("td",{className:"danger",children:ex?e.privateKey:""})]},e.index))})]})})]})]}):(0,o.jsx)(er,{icon:(0,o.jsx)(V.Wallet,{size:36}),message:"请输入用户名和密码以使用钱包工具"})}),"EA"===n&&(0,o.jsxs)("div",{className:"web3-box-workspace",children:[(0,o.jsxs)("div",{className:"web3-box-grid",children:[(0,o.jsx)(el,{title:"A 账号",username:eM,password:eA,showPassword:eR,showPrivateKey:eP,account:eO,onUsernameChange:ek,onPasswordChange:eS,onTogglePassword:()=>ez(!eR),onTogglePrivateKey:()=>eL(!eP),onGenerate:()=>tN("A",eM,eA,eI)}),(0,o.jsx)(el,{title:"B 账号",username:eT,password:e_,showPassword:eD,showPrivateKey:eK,account:eH,onUsernameChange:eB,onPasswordChange:eU,onTogglePassword:()=>eF(!eD),onTogglePrivateKey:()=>e$(!eK),onGenerate:()=>tN("B",eT,e_,eQ)})]}),(0,o.jsxs)("div",{className:"web3-box-flow-grid",children:[(0,o.jsx)(en,{title:"A → B",description:"加密使用 A 私钥 + B 公钥;解密使用 A 公钥 + B 私钥。",message:eV,cipherText:eW,decryptedText:eX,error:eJ,encryptLabel:"用 A 私钥 + B 公钥加密",decryptLabel:"用 A 公钥 + B 私钥解密",messagePlaceholder:"输入要从 A 发给 B 的消息",cipherPlaceholder:"加密后生成密文,或粘贴已有密文",onMessageChange:eY,onCipherTextChange:eG,onEncrypt:()=>tC({senderAccount:eO,recipientAccount:eH,message:eV,setCipherText:eG,setDecryptedText:eq,setError:eZ}),onDecrypt:()=>tE({senderAccount:eO,recipientAccount:eH,cipherText:eW,setDecryptedText:eq,setError:eZ})}),(0,o.jsx)(en,{title:"B → A",description:"加密使用 B 私钥 + A 公钥;解密使用 B 公钥 + A 私钥。",message:e0,cipherText:e2,decryptedText:e8,error:e6,encryptLabel:"用 B 私钥 + A 公钥加密",decryptLabel:"用 B 公钥 + A 私钥解密",messagePlaceholder:"输入要从 B 发给 A 的消息",cipherPlaceholder:"加密后生成密文,或粘贴已有密文",onMessageChange:e1,onCipherTextChange:e3,onEncrypt:()=>tC({senderAccount:eH,recipientAccount:eO,message:e0,setCipherText:e3,setDecryptedText:e4,setError:e5}),onDecrypt:()=>tE({senderAccount:eH,recipientAccount:eO,cipherText:e2,setDecryptedText:e4,setError:e5})})]}),(0,o.jsxs)("div",{className:"web3-box-flow-grid",children:[(0,o.jsxs)("section",{className:"web3-box-flow",children:[(0,o.jsx)("div",{className:"web3-box-flow-header",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{children:"加密"}),(0,o.jsx)("p",{children:"只输入发送方私钥和接收方公钥即可加密,无需生成完整账号。"})]})}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"发送方"})}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsx)("input",{type:tw?"text":"password",placeholder:"发送方 x25519 私钥",value:td,onChange:e=>th(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("button",{className:"input-eye",onClick:()=>ty(!tw),type:"button",children:tw?(0,o.jsx)(A.EyeOff,{size:16}):(0,o.jsx)(k.Eye,{size:16})})]}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"接收方"})}),(0,o.jsx)("input",{type:"text",placeholder:"接收方 x25519 公钥",value:tu,onChange:e=>tm(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"明文"})}),(0,o.jsx)("textarea",{className:"textarea",value:tx,onChange:e=>tp(e.target.value),rows:4,placeholder:"输入要加密的消息"}),(0,o.jsx)("div",{className:"web3-box-actions",children:(0,o.jsxs)("button",{className:"btn btn-primary",onClick:function(){td.trim()?tu.trim()?tx.trim()?(tb((0,q.mostBoxEncrypt)(tx,{senderPrivateKey:td.trim(),recipientPublicKey:tu.trim()})),tj("")):tj("请输入要加密的消息"):tj("请输入接收方公钥"):tj("请输入发送方私钥")},type:"button",children:[(0,o.jsx)(Q.Lock,{size:16}),"加密"]})}),tg&&(0,o.jsx)("p",{className:"web3-tools-danger",children:tg}),(0,o.jsxs)("div",{className:"web3-box-result",children:[(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"密文"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:tf,readOnly:!0,rows:5,placeholder:"加密成功后显示密文"})]})]}),(0,o.jsxs)("section",{className:"web3-box-flow",children:[(0,o.jsx)("div",{className:"web3-box-flow-header",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{children:"解密"}),(0,o.jsx)("p",{children:"只输入发送方公钥和接收方私钥即可解密,无需生成完整账号。"})]})}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"发送方"})}),(0,o.jsx)("input",{type:"text",placeholder:"发送方 x25519 公钥",value:e7,onChange:e=>e9(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"接收方"})}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsx)("input",{type:to?"text":"password",placeholder:"接收方 x25519 私钥",value:te,onChange:e=>tt(e.target.value),className:"input",autoCapitalize:"off",autoCorrect:"off",spellCheck:"false"}),(0,o.jsx)("button",{className:"input-eye",onClick:()=>tc(!to),type:"button",children:to?(0,o.jsx)(A.EyeOff,{size:16}):(0,o.jsx)(k.Eye,{size:16})})]}),(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"密文"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:ts,onChange:e=>ta(e.target.value),rows:5,placeholder:"粘贴要解密的密文"}),(0,o.jsx)("div",{className:"web3-box-actions",children:(0,o.jsxs)("button",{className:"btn btn-secondary",onClick:function(){if(!e7.trim())return void ti("请输入发送方公钥");if(!te.trim())return void ti("请输入接收方私钥");if(!ts.trim())return void ti("请粘贴密文");let e=(0,q.mostBoxDecrypt)(ts,{senderPublicKey:e7.trim(),recipientPrivateKey:te.trim()});if(!e){ti("解密失败,请确认发送方公钥、接收方私钥和密文匹配"),tl("");return}tl(e),ti("")},type:"button",children:[(0,o.jsx)(P.KeyRound,{size:16}),"解密"]})}),tn&&(0,o.jsx)("p",{className:"web3-tools-danger",children:tn}),(0,o.jsxs)("div",{className:"web3-box-result",children:[(0,o.jsx)("label",{className:"web3-box-result-header",children:(0,o.jsx)("span",{children:"解密结果"})}),(0,o.jsx)("textarea",{className:"textarea mono",value:tr,readOnly:!0,rows:5,placeholder:"解密成功后显示明文"})]})]})]})]})]})})})}],17173)}]);
@@ -0,0 +1 @@
1
+ .mkt-layout{flex-direction:column;min-height:100dvh;display:flex}.mkt-layout-main{flex:1}.mkt-container{width:100%;max-width:960px;padding-inline:var(--space-6);margin-inline:auto}@media (max-width:768px){.mkt-container{padding-inline:var(--space-4)}}.mkt-nav{z-index:100;border-bottom:1px solid var(--glass-border);background:var(--glass-bg-heavy);height:64px;-webkit-backdrop-filter:var(--blur-xl);align-items:center;display:flex;position:sticky;top:0}.mkt-nav-inner{width:100%;max-width:960px;padding-inline:var(--space-6);justify-content:space-between;align-items:center;margin-inline:auto;display:flex}.mkt-nav-logo{align-items:center;gap:var(--space-2);font-size:var(--font-size-lg,1.125rem);color:var(--text-primary);font-weight:700;text-decoration:none;display:flex}.mkt-nav-logo:hover{color:var(--text-primary)}.mkt-nav-cta{align-items:center;gap:var(--space-3);flex-wrap:wrap;justify-content:flex-end;display:flex}.mkt-nav-preview{color:var(--text-secondary)}.mkt-theme-toggle{border-radius:var(--radius-sm,8px);width:32px;height:32px;color:var(--text-secondary);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;transition:all .15s;display:flex}.mkt-theme-toggle:hover{color:var(--text-primary);background:var(--glass-bg-subtle)}.mkt-footer{border-top:1px solid var(--glass-border);padding-block:var(--space-8);background:var(--glass-bg-subtle)}.mkt-footer-inner{justify-content:center;align-items:center;gap:var(--space-4);flex-wrap:wrap;display:flex}.mkt-footer-links{gap:var(--space-6);display:flex}.mkt-footer-links a{font-size:var(--font-size-xs,.75rem);color:var(--text-muted)}.mkt-footer-links a:hover{color:var(--text-primary)}.mkt-footer-copy{font-size:var(--font-size-xs,.75rem);color:var(--text-muted)}@media (max-width:768px){.mkt-nav-inner{padding-inline:var(--space-4)}.mkt-nav-logo{font-size:14px}.mkt-nav-cta{gap:var(--space-2)}.mkt-nav-preview{display:none}.mkt-footer-inner{flex-direction:column;align-items:flex-start}}.mkt-landing{font-family:var(--font-sans)}.mkt-hero{text-align:center;padding:80px 24px 48px}.mkt-hero-badge{border-radius:var(--radius-full);background:var(--glass-bg-subtle);color:var(--text-secondary);border:1px solid var(--glass-border);margin-bottom:24px;padding:4px 12px;font-size:12px;font-weight:500;display:inline-block}.mkt-hero-title{letter-spacing:0;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:60px;font-weight:700;line-height:1.05}.mkt-hero-desc{color:var(--text-secondary);max-width:36ch;margin:0 auto 32px;font-size:18px;line-height:1.6}.mkt-hero-cta{justify-content:center;gap:12px;margin-top:24px;display:flex}.mkt-screenshot-placeholder{background:var(--glass-bg-subtle);border:1px dashed var(--glass-border);border-radius:var(--radius-lg);aspect-ratio:16/9;color:var(--text-muted);justify-content:center;align-items:center;margin-bottom:48px;font-size:13px;display:flex}.mkt-section-desc{color:var(--text-secondary);max-width:65ch;margin-bottom:32px;font-size:18px;line-height:1.7}.mkt-features{flex-direction:column;gap:20px;display:flex}.mkt-feature{align-items:flex-start;gap:12px;display:flex}.mkt-feature .mkt-feature-icon{color:var(--accent);flex-shrink:0;margin-top:2px}.mkt-feature strong{color:var(--text-primary);font-weight:600;display:block}.mkt-feature span{color:var(--text-secondary);font-size:13px}.mkt-link{color:var(--accent);margin-top:32px;font-size:13px;text-decoration:none;display:inline-block}.mkt-link:hover{text-decoration:underline}.mkt-section-alt{background:var(--glass-bg-subtle);border-top:1px solid var(--glass-border);border-bottom:1px solid var(--glass-border)}.mkt-steps{flex-direction:column;gap:24px;margin-bottom:32px;display:flex}.mkt-step{align-items:flex-start;gap:16px;display:flex}.mkt-step-num{border-radius:var(--radius-full);background:var(--accent);color:#fff;flex-shrink:0;justify-content:center;align-items:center;width:36px;height:36px;font-size:13px;font-weight:700;display:flex}.mkt-step-content{flex:1}.mkt-step-content h4{color:var(--text-primary);margin-bottom:8px;font-size:15px;font-weight:600}.mkt-step-content p{color:var(--text-secondary);font-size:13px}.mkt-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:12px 16px;display:block}.mkt-step-link{margin-top:8px}.mkt-step-link a{color:var(--accent);font-size:13px}.mkt-remote-grid{grid-template-columns:repeat(2,1fr);gap:16px;margin-bottom:24px;display:grid}.mkt-remote-card{background:var(--glass-bg-subtle);-webkit-backdrop-filter:var(--blur-sm);border:1px solid var(--glass-border);border-radius:var(--radius-lg);transition:all var(--transition);padding:20px}.mkt-remote-card:hover{background:var(--glass-bg);box-shadow:var(--glass-shadow);transform:translateY(-2px)}.mkt-remote-card h4{color:var(--text-primary);margin-bottom:4px;font-size:15px;font-weight:600}.mkt-remote-card p{color:var(--text-secondary);font-size:13px;line-height:1.5}.mkt-tag{color:var(--accent);background:var(--accent-soft);border-radius:var(--radius-sm);margin-top:8px;padding:4px 8px;font-size:11px;font-weight:500;display:inline-block}.mkt-cta{text-align:center}.mkt-cta-desc{color:var(--text-secondary);max-width:40ch;margin:0 auto 32px;font-size:18px;line-height:1.6}.mkt-cta-install{max-width:520px;margin:0 auto}@media (max-width:768px){.mkt-hero-title{font-size:40px}.mkt-hero-desc{font-size:16px}.mkt-remote-grid{grid-template-columns:1fr}.mkt-hero-cta{flex-direction:column;align-items:center}}.page-loading{flex-direction:column;justify-content:center;align-items:center;min-height:calc(100dvh - 144px);display:flex}.page-loading-logo{opacity:.5;background:linear-gradient(135deg, var(--accent) 25%, transparent 25%) 0 0 / 50% 50% no-repeat, linear-gradient(135deg, var(--accent) 25%, transparent 25%) 50% 0 / 50% 50% no-repeat, linear-gradient(135deg, var(--accent) 25%, transparent 25%) 0 50% / 50% 50% no-repeat, linear-gradient(135deg, var(--accent) 25%, transparent 25%) 50% 50% / 50% 50% no-repeat;background-color:var(--accent);border-radius:4px;width:48px;height:48px;animation:1.5s ease-in-out infinite pulse;-webkit-mask:url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='2' y='2' width='8' height='8' rx='2' fill='black' opacity='0.4'/%3E%3Crect x='14' y='2' width='8' height='8' rx='2' fill='black' opacity='0.7'/%3E%3Crect x='2' y='14' width='8' height='8' rx='2' fill='black' opacity='0.7'/%3E%3Crect x='14' y='14' width='8' height='8' rx='2' fill='black'/%3E%3C/svg%3E") 50%/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='2' y='2' width='8' height='8' rx='2' fill='black' opacity='0.4'/%3E%3Crect x='14' y='2' width='8' height='8' rx='2' fill='black' opacity='0.7'/%3E%3Crect x='2' y='14' width='8' height='8' rx='2' fill='black' opacity='0.7'/%3E%3Crect x='14' y='14' width='8' height='8' rx='2' fill='black'/%3E%3C/svg%3E") 50%/contain no-repeat}@keyframes pulse{0%,to{opacity:.3;transform:scale(.95)}50%{opacity:.7;transform:scale(1)}}.mkt-nav-settings-btn{border-radius:var(--radius-sm,8px);width:32px;height:32px;color:var(--text-secondary);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;transition:all .15s;display:flex}.mkt-nav-settings-btn:hover{color:var(--text-primary);background:var(--glass-bg-subtle)}.mkt-settings-overlay{z-index:200;-webkit-backdrop-filter:var(--blur-xl);background:#0006;justify-content:center;align-items:center;animation:.2s ease-out fadeIn;display:flex;position:fixed;inset:0}.mkt-settings-modal{background:var(--glass-bg-heavy);-webkit-backdrop-filter:var(--blur-2xl);border:1px solid var(--glass-border);border-radius:var(--radius-xl);padding:var(--space-8);width:90%;max-width:420px;box-shadow:var(--glass-shadow-lg);animation:.25s ease-out scaleIn}.mkt-settings-modal h3{margin-bottom:var(--space-2);font-size:18px;font-weight:600}.mkt-settings-desc{color:var(--text-secondary);margin-bottom:var(--space-5);font-size:13px;line-height:1.5}.mkt-settings-actions{gap:var(--space-3);display:flex}.mkt-settings-status{margin-top:var(--space-3);text-align:center;font-size:13px}.mkt-settings-status.success{color:var(--success)}.mkt-settings-status.error{color:var(--danger)}