sh2/d2ypp2/web-console/out/_next/static/chunks/653-15975e374f8e28da.js
eric 9888f1daad Harden YouTube unmanned live stack and hide advanced console panels.
Fix Pro config SSOT, event FSM, FFmpeg error tiers, relay heartbeat, and ingest auth while keeping relay snapshot, quality guard, and event hub hidden in the UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 06:31:31 -05:00

1 line
77 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[653],{5725:function(e,t,l){l.d(t,{Z:function(){return n}});var s=l(3890),a=l(8496);function r(e,t){return t?Math.min(100,Math.max(0,e/t*100)):0}function n(e){let{snapshot:t,theme:n,tr:i,compact:o=!1}=e,c=(0,a.useRef)(null),d=(0,a.useRef)(null),[h,m]=(0,a.useState)([]),x=(0,a.useMemo)(()=>{var e,l,s,a,n,i,o,c,d,h,m,x,u;if(!t)return null;let p=null!==(d=null===(e=t.cpu_load)||void 0===e?void 0:e["1m"])&&void 0!==d?d:0,b=null!==(h=null===(l=t.cpu_load)||void 0===l?void 0:l["5m"])&&void 0!==h?h:0,g=null!==(m=null===(s=t.cpu_load)||void 0===s?void 0:s["15m"])&&void 0!==m?m:0,f=(null===(a=t.memory)||void 0===a?void 0:a.total)||1,v=null!==(u=null!==(x=null===(n=t.memory)||void 0===n?void 0:n.available)&&void 0!==x?x:null===(i=t.memory)||void 0===i?void 0:i.free)&&void 0!==u?u:0,w=Math.max(0,f-v),j=(null===(o=t.disk)||void 0===o?void 0:o.total)||1,N=(null===(c=t.disk)||void 0===c?void 0:c.free)||0,y=Math.max(0,j-N);return{l1:p,l5:b,l15:g,memUsed:w,memAvail:v,memTotal:f,diskUsed:y,diskFree:N,diskTotal:j,memPct:r(w,f),diskPct:r(y,j)}},[t]);return((0,a.useEffect)(()=>{if(!x)return;let e=Date.now();m(t=>{let l=[...t,{t:e,cpu1m:x.l1,memPct:x.memPct,diskPct:x.diskPct}];return l.length>24?l.slice(-24):l})},[null==x?void 0:x.l1,null==x?void 0:x.memPct,null==x?void 0:x.diskPct,x]),(0,a.useEffect)(()=>{let e=c.current;if(!e||!x)return;let t=!1,s=null,a="light"===n?"#0f172a":"#f4f4f5",r="light"===n?"#64748b":"#a1a1aa",o="light"===n?"rgba(15,23,42,0.08)":"rgba(255,255,255,0.06)";l.e(214).then(l.bind(l,5214)).then(e=>{!t&&c.current&&(s=e.init(c.current,void 0,{renderer:"canvas"})).setOption({animationDurationUpdate:380,textStyle:{color:a,fontFamily:"ui-monospace, monospace"},tooltip:{trigger:"item",backgroundColor:"light"===n?"#fff":"#18181b",borderColor:o,textStyle:{color:a,fontSize:11}},series:[{type:"gauge",center:["18%","52%"],radius:"62%",min:0,max:Math.max(4,Math.ceil(1.4*x.l1)),splitNumber:4,axisLine:{lineStyle:{width:10,color:[[.45,"#22d3ee"],[.75,"#a78bfa"],[1,"#fb7185"]]}},pointer:{width:4,length:"58%",itemStyle:{color:a}},axisTick:{show:!1},splitLine:{length:8,lineStyle:{color:o}},axisLabel:{color:r,fontSize:9,distance:14},detail:{formatter:e=>"".concat(e.toFixed(2)),color:a,fontSize:14,fontWeight:700,offsetCenter:[0,"72%"]},title:{show:!0,offsetCenter:[0,"92%"],color:r,fontSize:10,text:i("CPU 1m","CPU 1m")},data:[{value:x.l1}]},{type:"pie",radius:["46%","62%"],center:["50%","52%"],label:{show:!1},data:[{value:x.memUsed,name:i("内存已用","RAM used"),itemStyle:{color:"#818cf8"}},{value:Math.max(0,x.memAvail),name:i("内存可用","RAM free"),itemStyle:{color:"light"===n?"#e2e8f0":"#27272a"}}]},{type:"pie",radius:["46%","62%"],center:["82%","52%"],label:{show:!1},data:[{value:x.diskUsed,name:i("磁盘已用","Disk used"),itemStyle:{color:"#34d399"}},{value:Math.max(0,x.diskFree),name:i("磁盘空闲","Disk free"),itemStyle:{color:"light"===n?"#e2e8f0":"#27272a"}}]}],graphic:[{type:"text",left:"center",top:"52%",style:{text:"".concat(x.memPct.toFixed(0),"%"),fill:a,font:"bold 13px ui-monospace",textAlign:"center"}},{type:"text",left:"74%",top:"52%",style:{text:"".concat(x.diskPct.toFixed(0),"%"),fill:a,font:"bold 13px ui-monospace",textAlign:"center"}},{type:"text",left:"42%",top:"78%",style:{text:i("内存","RAM"),fill:r,font:"10px sans-serif",textAlign:"center"}},{type:"text",left:"74%",top:"78%",style:{text:i("磁盘","Disk"),fill:r,font:"10px sans-serif",textAlign:"center"}}]})});let d=new ResizeObserver(()=>null==s?void 0:s.resize());return d.observe(e),()=>{t=!0,d.disconnect(),null==s||s.dispose()}},[x,n,i]),(0,a.useEffect)(()=>{let e=d.current;if(!e||h.length<2)return;let t=!1,s=null,a="light"===n?"#94a3b8":"#71717a",r="light"===n?"rgba(15,23,42,0.06)":"rgba(255,255,255,0.05)";l.e(214).then(l.bind(l,5214)).then(e=>{if(t||!d.current)return;s=e.init(d.current,void 0,{renderer:"canvas"});let l=h.map((e,t)=>String(t+1));s.setOption({animationDurationUpdate:300,grid:{left:36,right:12,top:18,bottom:22},tooltip:{trigger:"axis",textStyle:{fontSize:10}},legend:{top:0,right:0,textStyle:{color:a,fontSize:9},itemWidth:8,itemHeight:8},xAxis:{type:"category",data:l,show:!1},yAxis:{type:"value",splitLine:{lineStyle:{color:r}},axisLabel:{color:a,fontSize:9}},series:[{name:"CPU",type:"line",smooth:!0,symbol:"none",lineStyle:{width:2,color:"#22d3ee"},areaStyle:{color:"rgba(34,211,238,0.12)"},data:h.map(e=>e.cpu1m)},{name:i("内存%","RAM%"),type:"line",smooth:!0,symbol:"none",lineStyle:{width:2,color:"#a78bfa"},data:h.map(e=>Number(e.memPct.toFixed(1)))}]})});let o=new ResizeObserver(()=>null==s?void 0:s.resize());return o.observe(e),()=>{t=!0,o.disconnect(),null==s||s.dispose()}},[h,n,i]),t&&x)?(0,s.jsxs)("div",{className:"flex flex-col ".concat(o?"gap-2":"gap-3"),children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-2 px-1",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-semibold tracking-wide text-zinc-300",children:i("节点资源","Node resources")}),(0,s.jsxs)("p",{className:"mt-0.5 text-[10px] text-zinc-500",children:[i("负载","Load")," ",x.l1.toFixed(2)," / ",x.l5.toFixed(2)," / ",x.l15.toFixed(2)," \xb7"," ",i("内存","RAM")," ",x.memPct.toFixed(0),"% \xb7 ",i("磁盘","Disk")," ",x.diskPct.toFixed(0),"%"]})]}),o?null:(0,s.jsxs)("div",{className:"flex gap-3 font-mono text-[10px] text-zinc-500",children:[(0,s.jsxs)("span",{children:["5m ",x.l5.toFixed(2)]}),(0,s.jsxs)("span",{children:["15m ",x.l15.toFixed(2)]})]})]}),(0,s.jsx)("div",{ref:c,className:"chart-surface w-full shrink-0 rounded-2xl border border-white/[0.06] bg-black/10 ".concat(o?"h-[168px]":"h-52 md:h-56")}),!o&&h.length>=2?(0,s.jsx)("div",{ref:d,className:"chart-surface h-28 w-full shrink-0 rounded-xl border border-white/[0.05] bg-black/5"}):null]}):(0,s.jsx)("div",{className:"animate-pulse rounded-2xl border border-white/[0.06] bg-white/[0.03] ".concat(o?"h-48":"h-64")})}},5653:function(e,t,l){l.d(t,{d:function(){return S}});var s=l(3890),a=l(6060),r=l(8496),n=l(5725),i=l(7362),o=l(9625),c=l(776),d=l(735),h=l(8677),m=l(9916);function x(e){let{lang:t,rootId:l,filePath:a,fileContent:n,refreshKey:x,busy:u,fetchJson:p,notify:b,onChangeContent:g,onRefreshListing:f}=e,[v,w]=(0,r.useState)(null),[j,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1),[C,S]=(0,r.useState)(null),[_,D]=(0,r.useState)(null),E=(0,r.useCallback)((e,l)=>"zh"===t?e:l,[t]),A=(0,r.useCallback)(async()=>{if(!l||!a){w(null);return}N(!0);try{let e=new URLSearchParams({root:l,path:a}),t=await p("/config_insights?".concat(e.toString()));w(t)}catch(e){w(null),b(e.message)}finally{N(!1)}},[p,a,b,l]);(0,r.useEffect)(()=>{A()},[A,x]);let O=async()=>{if(l&&a){k(!0);try{let e=await p("/config_insights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:l,path:a,content:n})});w(e),b(E("已分析当前编辑内容","Analyzed current editor draft"))}catch(e){b(e.message)}finally{k(!1)}}},R=async e=>{if(l&&a){S(e);try{let t=await p("/config_optimize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:l,path:a,content:n,action:e})});"string"==typeof t.content&&g(t.content),t.insights&&w(e=>({...e,...t.insights,backups:(null==e?void 0:e.backups)||[]})),b(t.message||E("已应用优化","Optimization applied"))}catch(e){b(e.message)}finally{S(null)}}},P=async e=>{if(l&&a){D(e);try{let t=await p("/config_restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:l,path:a,backup_id:e})});"string"==typeof t.content&&g(t.content),await Promise.resolve(null==f?void 0:f()),await A(),b(t.message||E("已恢复历史版本","Backup restored"))}catch(e){b(e.message)}finally{D(null)}}};if(!a)return(0,s.jsx)("div",{className:"rounded-2xl border border-white/8 bg-black/20 p-4 text-sm text-slate-400",children:E("选择文件后显示诊断、回滚和一键优化。","Pick a file to see diagnostics, rollback, and one-click optimizations.")});let T=(null==v?void 0:v.issues)||[],U=(null==v?void 0:v.actions)||[],L=(null==v?void 0:v.backups)||[],M=(null==v?void 0:v.stats)||[];return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-cyan-500/15 bg-gradient-to-br from-cyan-500/[0.08] via-black/25 to-transparent p-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-white",children:[(0,s.jsx)(i.Z,{className:"h-4 w-4 text-cyan-300"}),(0,s.jsx)("h3",{className:"text-sm font-semibold",children:E("配置治理","Config governance")}),(null==v?void 0:v.source)?(0,s.jsx)("span",{className:"rounded-full border border-white/10 bg-black/25 px-2 py-0.5 text-[10px] uppercase tracking-wider text-slate-400",children:v.source}):null]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-400",children:(null==v?void 0:v.summary)||E("校验配置风险、查看历史快照,并将常见优化应用到编辑器。","Validate risks, inspect snapshots, and apply optimizations into the editor.")})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)("button",{type:"button",disabled:!!u||j,onClick:()=>void A(),className:"btn-focus inline-flex items-center gap-2 rounded-xl border border-white/10 bg-black/25 px-3 py-2 text-xs text-slate-100 disabled:opacity-40",children:[j?(0,s.jsx)(o.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(c.Z,{className:"h-3.5 w-3.5"}),E("刷新已保存状态","Refresh saved state")]}),(0,s.jsxs)("button",{type:"button",disabled:!!u||y,onClick:()=>void O(),className:"btn-focus inline-flex items-center gap-2 rounded-xl border border-cyan-500/30 bg-cyan-500/15 px-3 py-2 text-xs text-cyan-100 disabled:opacity-40",children:[y?(0,s.jsx)(o.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(d.Z,{className:"h-3.5 w-3.5"}),E("分析当前编辑器","Analyze editor draft")]})]})]}),(0,s.jsx)("div",{className:"mt-4 grid gap-2 sm:grid-cols-2 xl:grid-cols-4",children:M.slice(0,8).map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-white/8 bg-black/20 px-3 py-2.5",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-slate-500",children:e.label}),(0,s.jsx)("div",{className:"mt-1 truncate font-mono text-sm text-white",children:e.value})]},e.key))})]}),(0,s.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-white/8 bg-black/20 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-white",children:[(0,s.jsx)(d.Z,{className:"h-4 w-4 text-amber-300"}),(0,s.jsx)("h4",{className:"text-sm font-semibold",children:E("风险与建议","Risks & guidance")})]}),T.length?(0,s.jsx)("div",{className:"mt-3 space-y-2",children:T.map((e,t)=>{var l;return(0,s.jsxs)("div",{className:"rounded-xl border px-3 py-2 text-xs ".concat("error"===(l=e.level)?"border-rose-500/30 bg-rose-500/10 text-rose-100":"warning"===l?"border-amber-500/30 bg-amber-500/10 text-amber-100":"border-cyan-500/30 bg-cyan-500/10 text-cyan-100"),children:[(0,s.jsxs)("div",{className:"font-medium",children:[e.message,e.line?" (L".concat(e.line,")"):""]}),(0,s.jsx)("div",{className:"mt-1 font-mono opacity-70",children:e.code})]},"".concat(e.code,"-").concat(t))})}):(0,s.jsx)("p",{className:"mt-3 text-xs text-emerald-300/90",children:E("当前没有发现明显配置风险。","No obvious config risks were detected.")}),(0,s.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:U.length?U.map(e=>(0,s.jsx)("button",{type:"button",disabled:!!u||!!C,onClick:()=>void R(e.id),className:"btn-focus rounded-xl border border-violet-500/30 bg-violet-500/15 px-3 py-2 text-xs text-violet-100 disabled:opacity-40",title:e.description,children:C===e.id?E("处理中...","Working..."):e.label},e.id)):(0,s.jsx)("span",{className:"text-xs text-slate-500",children:E("当前文件没有可自动应用的预设。","No auto-applicable presets for this file.")})})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-white/8 bg-black/20 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-white",children:[(0,s.jsx)(h.Z,{className:"h-4 w-4 text-cyan-300"}),(0,s.jsx)("h4",{className:"text-sm font-semibold",children:E("历史快照","Backup snapshots")})]}),L.length?(0,s.jsx)("div",{className:"mt-3 space-y-2",children:L.slice(0,8).map(e=>(0,s.jsx)("div",{className:"rounded-xl border border-white/8 bg-black/25 px-3 py-2.5",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-xs text-white",children:new Date(e.created_at).toLocaleString("zh"===t?"zh-CN":"en-US",{hour12:!1})}),(0,s.jsxs)("div",{className:"mt-1 text-[11px] text-slate-500",children:[e.reason," \xb7 ",function(e){if(!e)return"0 B";let t=["B","KB","MB","GB"],l=e,s=0;for(;l>=1024&&s<t.length-1;)l/=1024,s+=1;return"".concat(l.toFixed(l>=10||0===s?0:1)," ").concat(t[s])}(e.size),"legacy"===e.source?" \xb7 ".concat(E("旧备份","legacy")):""]})]}),(0,s.jsxs)("button",{type:"button",disabled:!!u||!!_,onClick:()=>void P(e.id),className:"btn-focus inline-flex items-center gap-1 rounded-lg border border-white/10 bg-white/5 px-3 py-1.5 text-xs text-slate-100 disabled:opacity-40",children:[_===e.id?(0,s.jsx)(o.Z,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(m.Z,{className:"h-3.5 w-3.5"}),E("恢复","Restore")]})]})},e.id))}):(0,s.jsx)("p",{className:"mt-3 text-xs text-slate-500",children:E("当前文件还没有 Web 侧快照。保存、删除或恢复后会自动累积历史。","No Web snapshots yet. Saving, deleting, or restoring will accumulate history automatically.")})]})]})]})}var u=l(7169),p=l(2812),b=l(8755),g=l(2555);let f=["overview","business","modules","shellcrash","android","config"],v=new Set(["shellcrash-configs","shellcrash-yamls","shellcrash-jsons"]),w="LsRzcR3pHoA9.yaml",j="5d723acc-singbox_tuic3",N=()=>void 0!==g&&g.env.NEXT_PUBLIC_API_URL||"";function y(e){if(!e)return"0 B";let t=["B","KB","MB","GB","TB"],l=e,s=0;for(;l>=1024&&s<t.length-1;)l/=1024,s+=1;return"".concat(l.toFixed(l>=10||0===s?0:1)," ").concat(t[s])}function k(e){return"online"===e?"border-emerald-500/30 bg-emerald-500/10 text-emerald-200":"stopped"===e?"border-slate-500/30 bg-slate-500/10 text-slate-300":"configured"===e?"border-violet-500/30 bg-violet-500/10 text-violet-200":"unavailable"===e?"border-slate-700/30 bg-slate-800/50 text-slate-500":"error"===e?"border-rose-500/30 bg-rose-500/10 text-rose-200":"border-cyan-500/30 bg-cyan-500/10 text-cyan-200"}function C(e){let{children:t,className:l,disabled:a,onClick:r,title:n}=e;return(0,s.jsx)("button",{type:"button",className:"btn-focus rounded-xl px-3 py-2 text-xs font-semibold text-white disabled:cursor-not-allowed disabled:opacity-40 ".concat(l||""),disabled:a,onClick:r,title:n,children:t})}function S(e){var t,l,i,o,c,d,h,m,g,S,_,D,E,A,O,R;let{embeddedShellCrash:P=!1,portalLang:T}=e,U=N(),[L,M]=(0,r.useState)("zh"),[I,F]=(0,r.useState)("dark"),[z,B]=(0,r.useState)("overview"),W=(0,r.useCallback)((e,t)=>"zh"===L?e:t,[L]),[K,H]=(0,r.useState)(!0),[Y,J]=(0,r.useState)(null),[Z,V]=(0,r.useState)(null),[G,q]=(0,r.useState)(null),[Q,$]=(0,r.useState)(!0),X=(0,r.useRef)(null),[ee,et]=(0,r.useState)([]),[el,es]=(0,r.useState)(""),[ea,er]=(0,r.useState)("unknown"),[en,ei]=(0,r.useState)(""),[eo,ec]=(0,r.useState)(""),[ed,eh]=(0,r.useState)(null),[em,ex]=(0,r.useState)([]),[eu,ep]=(0,r.useState)(null),[eb,eg]=(0,r.useState)(null),[ef,ev]=(0,r.useState)([]),[ew,ej]=(0,r.useState)(""),[eN,ey]=(0,r.useState)([]),[ek,eC]=(0,r.useState)(""),[eS,e_]=(0,r.useState)(""),[eD,eE]=(0,r.useState)(!1),[eA,eO]=(0,r.useState)([]),[eR,eP]=(0,r.useState)(""),[eT,eU]=(0,r.useState)(null),[eL,eM]=(0,r.useState)([]),[eI,eF]=(0,r.useState)([]),[ez,eB]=(0,r.useState)(""),[eW,eK]=(0,r.useState)(""),[eH,eY]=(0,r.useState)("com.zhiliaoapp.musically"),[eJ,eZ]=(0,r.useState)("https://www.tiktok.com"),[eV,eG]=(0,r.useState)(""),[eq,eQ]=(0,r.useState)(""),[e$,eX]=(0,r.useState)(Date.now()),[e0,e2]=(0,r.useState)("tap"),[e1,e5]=(0,r.useState)(null),[e3,e4]=(0,r.useState)(0),[e8,e6]=(0,r.useState)(0),[e9,e7]=(0,r.useState)(null),[te,tt]=(0,r.useState)(null),[tl,ts]=(0,r.useState)(!1),ta=null!==(A=ef.find(e=>e.root_id===ew))&&void 0!==A?A:null,tr=ef.filter(e=>v.has(e.root_id)),tn=ef.filter(e=>!v.has(e.root_id)),ti=null!==(O=em.find(e=>"shellcrash"===e.service_id))&&void 0!==O?O:null,to=null!==(R=em.find(e=>"android_panel"===e.service_id))&&void 0!==R?R:null,tc=(0,r.useMemo)(()=>{var e;let t=null!==(e=null==ed?void 0:ed.quick_links)&&void 0!==e?e:{},l={};for(let[e,s]of Object.entries(t)){let t=String(s);l[e]=/^https?:\/\//i.test(t)?(0,b.p)(t):t}return l},[ed]),td=(0,r.useMemo)(()=>(0,p.O0)(tc),[tc]),th=(0,r.useMemo)(()=>(0,p.Tc)(td),[td]),tm=(0,r.useMemo)(()=>{let e=tc.ws_scrcpy||((null==to?void 0:to.host)&&to.port?"http://".concat(to.host,":").concat(to.port):(null==ed?void 0:ed.mdns_host)?"http://".concat(ed.mdns_host,":5000"):"");return e?(0,b.p)(e):""},[null==to?void 0:to.host,null==to?void 0:to.port,tc.ws_scrcpy,null==ed?void 0:ed.mdns_host]),tx=function(e){let t=null==e?void 0:e.match(/(\d+)x(\d+)/);return t?{width:Number(t[1]),height:Number(t[2])}:null}(null==eT?void 0:eT.resolution),tu=(0,r.useCallback)(e=>{V(e),null!=X.current&&window.clearTimeout(X.current),X.current=window.setTimeout(()=>{V(null),X.current=null},2500)},[]),tp=(0,r.useCallback)(async(e,t)=>(0,u.N)("".concat(U).concat(e),t),[U]),tb=(0,r.useCallback)((e,t)=>{let l=new URL(window.location.href);l.pathname="shellcrash"===e?"/shellcrash":"android"===e?"/android":"/console","/console"===l.pathname?l.searchParams.set("tab",e):l.searchParams.delete("tab"),l.searchParams.set("lang",t),window.history.replaceState(null,"",l.toString()),window.localStorage.setItem("live-console-lang",t)},[]),tg=(0,r.useCallback)(async()=>{if(!el)return;let e=await tp("/status?process=".concat(encodeURIComponent(el)));er(e.process_status||"unknown"),ei(e.recent_log||""),ec(e.recent_error||"")},[el,tp]),tf=(0,r.useCallback)(async()=>{let[e,t,l]=await Promise.all([tp("/stack/services"),tp("/system_snapshot"),tp("/hardware_profile")]);ex(e.services||[]),ep(t),eg(l)},[tp]),tv=(0,r.useCallback)(async(e,t)=>{if(!e)return;let l=(await tp("/managed_files?root=".concat(encodeURIComponent(e)))).files||[];ey(l);let s=t||ek;if(s&&l.some(e=>e.path===s))eC(s);else{var a;eC((null===(a=l[0])||void 0===a?void 0:a.path)||"")}},[tp,ek]),tw=(0,r.useCallback)(async()=>{var e;let t=await tp("/android/devices"),l=t.devices||[],s=eR&&l.some(e=>e.serial===eR)?eR:(null===(e=l[0])||void 0===e?void 0:e.serial)||"";return eE(!!t.available),eO(l),eP(s),s},[eR,tp]),tj=(0,r.useCallback)(async e=>{if(!e){eU(null);return}eU(await tp("/android/overview?serial=".concat(encodeURIComponent(e))))},[tp]),tN=(0,r.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ez;if(!e){eF([]);return}eF((await tp("/android/packages?serial=".concat(encodeURIComponent(e),"&query=").concat(encodeURIComponent(t),"&limit=60"))).packages||[])},[ez,tp]),ty=(0,r.useCallback)(async e=>{if(!e){eM([]);return}eM((await tp("/android/ui?serial=".concat(encodeURIComponent(e),"&limit=80"))).nodes||[])},[tp]),tk=(0,r.useCallback)(async(e,t)=>{ej(e),eC(t),await tv(e,t)},[tv]),tC=(0,r.useCallback)((e,t)=>{B("config"),window.setTimeout(()=>{tk(e,t)},0)},[tk]),tS=(0,r.useCallback)(async()=>{q("hardware:probe");try{let e=await tp("/hardware_profile?refresh=true");eg(e),tu(W("硬件探测已更新","Hardware profile refreshed"))}catch(e){tu(e.message)}finally{q(null)}},[tp,tu,W]),t_=(0,r.useCallback)(async()=>{H(!0),J(null);try{var e,t,l,s;let[a,r,n]=await Promise.all([tp("/process_monitor"),tp("/server_info"),tp("/managed_roots")]);et(a.entries||[]),es((null===(t=a.entries)||void 0===t?void 0:null===(e=t[0])||void 0===e?void 0:e.pm2)||""),eh(r.stack||null),ev(n.roots||[]),ej((null===(s=n.roots)||void 0===s?void 0:null===(l=s[0])||void 0===l?void 0:l.root_id)||""),await Promise.all([tf(),tw()])}catch(e){J(e.message)}finally{H(!1)}},[tp,tw,tf]);(0,r.useEffect)(()=>{if(P){if(B("shellcrash"),"zh"===T||"en"===T)M(T);else{let e=window.localStorage.getItem("live-hub-lang");("zh"===e||"en"===e)&&M(e)}return}let e=new URLSearchParams(window.location.search),t=function(e){let t=e.replace(/\/+$/,"")||"/";return"/shellcrash"===t?"shellcrash":"/android"===t?"android":null}(window.location.pathname),l=e.get("tab"),s=e.get("lang"),a=window.localStorage.getItem("live-console-lang");t?B(t):null!==l&&f.includes(l)&&B(l),"zh"===s||"en"===s?M(s):("zh"===a||"en"===a)&&M(a);let r=window.localStorage.getItem("live-console-theme");("light"===r||"dark"===r)&&F(r)},[P,T]),(0,r.useEffect)(()=>{P||(document.documentElement.setAttribute("data-theme",I),window.localStorage.setItem("live-console-theme",I))},[I,P]),(0,r.useEffect)(()=>{let e=()=>$("visible"===document.visibilityState);return e(),document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),(0,r.useEffect)(()=>()=>{null!=X.current&&window.clearTimeout(X.current)},[]),(0,r.useEffect)(()=>{P&&("zh"===T||"en"===T)&&M(T)},[P,T]),(0,r.useEffect)(()=>{P||tb(z,L)},[P,L,tb,z]),(0,r.useEffect)(()=>{t_()},[t_]),(0,r.useEffect)(()=>{if(!el||!Q)return;tg();let e=window.setInterval(()=>void tg(),1500);return()=>window.clearInterval(e)},[el,Q,tg]),(0,r.useEffect)(()=>{if(K||Y||!Q||"overview"!==z&&"modules"!==z&&"shellcrash"!==z)return;tf();let e=window.setInterval(()=>void tf(),1e4);return()=>clearInterval(e)},[K,Y,Q,tf,z]),(0,r.useEffect)(()=>{let e="shellcrash"===z?tr:"config"===z?tn:ef;e.length&&!e.some(e=>e.root_id===ew)&&(ej(e[0].root_id),eC(""))},[tn,ew,ef,tr,z]),(0,r.useEffect)(()=>{ew&&tv(ew)},[tv,ew]),(0,r.useEffect)(()=>{if(!ew||!ek){e_("");return}(async()=>{try{let e=await tp("/managed_file?root=".concat(encodeURIComponent(ew),"&path=").concat(encodeURIComponent(ek)));e_(e.content||"")}catch(e){tu(e.message)}})()},[tp,ek,tu,ew]),(0,r.useEffect)(()=>{"android"===z&&(async()=>{let e=await tw();e&&(await Promise.all([tj(e),ty(e),tN(e)]),eX(Date.now()))})()},[tw,tj,tN,ty,z]),(0,r.useEffect)(()=>{if("android"!==z||!eR||!Q)return;tj(eR),eX(Date.now());let e=window.setInterval(()=>{tj(eR),eX(Date.now())},5e3);return()=>window.clearInterval(e)},[eR,Q,tj,z]),(0,r.useEffect)(()=>{if(!eR){e7(e=>(e&&URL.revokeObjectURL(e),null)),tt(null),ts(!1);return}let e=new AbortController,t="".concat(U,"/android/screenshot?serial=").concat(encodeURIComponent(eR),"&ts=").concat(e$);return ts(!0),tt(null),fetch(t,{signal:e.signal}).then(async e=>{if(!e.ok)throw Error(await (0,u.e)(e));return e.blob()}).then(e=>{if(!e.type.startsWith("image/"))throw Error("Not an image");let t=URL.createObjectURL(e);e7(e=>(e&&URL.revokeObjectURL(e),t))}).catch(e=>{"AbortError"!==e.name&&(tt(e.message),e7(e=>(e&&URL.revokeObjectURL(e),null)))}).finally(()=>{e.signal.aborted||ts(!1)}),()=>{e.abort()}},[eR,e$,U]);let tD=async e=>{if(el){q("process:".concat(e));try{let t=await tp("/".concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({process:el})});tu(String(t.output||t.pm2_output||t.message||"OK")),await tg()}catch(e){tu(e.message)}finally{q(null)}}},tE=async(e,t)=>{q("".concat(e,":").concat(t));try{let l=await tp("/service_action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({service:e,action:t})});tu(l.message||"OK"),await tf()}catch(e){tu(e.message)}finally{q(null)}},tA=async e=>{let t=e||("shellcrash-yamls"===ew&&ek?ek:w);q("shellcrash:apply");try{"shellcrash-yamls"===ew&&ek===t&&await tp("/managed_file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:ew,path:ek,content:eS})});let e=await tp("/shellcrash/apply_profile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,target_node:j})}),l=e.selected?" | ".concat(e.selected):"";tu("".concat(e.message||W("ShellCrash 配置已应用","ShellCrash profile applied")).concat(l)),await Promise.all([tf(),tv("shellcrash-yamls","config.yaml")]),ej("shellcrash-yamls"),eC("config.yaml"),e6(e=>e+1)}catch(e){tu(e.message)}finally{q(null)}},tO=async()=>{let e=window.open("about:blank","_blank");q("shellcrash:web_panel");try{let t=await tp("/shellcrash/web_panel",{method:"POST"}),l=(0,b.p)(t.url||"http://".concat(window.location.hostname||"127.0.0.1",":").concat("9999","/ui/"));if(tu(t.message||W("ShellCrash web 面板已就绪","ShellCrash web panel is ready")),e){try{e.opener=null}catch(e){}e.location.href=l}else window.open(l,"_blank","noopener,noreferrer");await tf()}catch(t){null==e||e.close(),tu(t.message)}finally{q(null)}},tR=async()=>{if(ew&&ek){q("file:save");try{await tp("/managed_file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:ew,path:ek,content:eS})}),tu(W("文件已保存","File saved")),await tv(ew,ek),e6(e=>e+1)}catch(e){tu(e.message)}finally{q(null)}}},tP=async()=>{if(!(null==ta?void 0:ta.allow_create)){tu(W("当前目录不允许新建文件","The current root does not allow new files"));return}let e=window.prompt(W("请输入新的相对路径","Enter a new relative path"),ta.default_file||"");if(e){q("file:create");try{await tp("/managed_file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:ew,path:e,content:""})}),tu(W("文件已创建","File created")),await tv(ew,e),e6(e=>e+1)}catch(e){tu(e.message)}finally{q(null)}}},tT=async()=>{if(ew&&ek){if(!(null==ta?void 0:ta.allow_delete)){tu(W("当前目录不允许删除文件","The current root does not allow deletion"));return}if(window.confirm(W("确定删除该文件?","Delete this file?"))){q("file:delete");try{await tp("/managed_file?root=".concat(encodeURIComponent(ew),"&path=").concat(encodeURIComponent(ek)),{method:"DELETE"}),tu(W("文件已删除","File deleted")),await tv(ew),e6(e=>e+1)}catch(e){tu(e.message)}finally{q(null)}}}},tU=async e=>{var t;let l=null===(t=e.target.files)||void 0===t?void 0:t[0];if(e.target.value="",e4(e=>e+1),l&&ew){q("file:import");try{let e=await l.text();await tp("/managed_file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({root:ew,path:l.name,content:e})}),tu(W("导入完成,已替换同名文件","Import finished and replaced matching file")),eC(l.name),await tv(ew,l.name),e6(e=>e+1)}catch(e){tu(e.message)}finally{q(null)}}},tL=async(e,t)=>{if(!eR){tu(W("当前没有可用的 ADB 设备","No active ADB device"));return}q("android:".concat(e));try{let l=await tp("/android/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,serial:eR,payload:t||{}})});tu(l.message||"OK"),l.output&&eQ(l.output),eX(Date.now()),await tj(eR)}catch(e){tu(e.message)}finally{q(null)}},tM="tap"===e0?W("点击","Tap"):"double_tap"===e0?W("双击","Double Tap"):W("长按","Long Press"),tI=async e=>{if(!eR){tu(W("当前没有可用的 ADB 设备","No active ADB device"));return}let t=function(e,t,l){let s,a,r,n;let i=e.getBoundingClientRect(),o=e.naturalWidth,c=e.naturalHeight;if(!o||!c||!i.width||!i.height)return null;let d=i.width/i.height,h=o/c;h>d?(s=i.width,a=i.width/h,r=0,n=(i.height-a)/2):(a=i.height,s=i.height*h,r=(i.width-s)/2,n=0);let m=t-i.left-r,x=l-i.top-n;return m<0||x<0||m>s||x>a?null:{x:Math.max(0,Math.min(o-1,Math.round(m/s*o))),y:Math.max(0,Math.min(c-1,Math.round(x/a*c)))}}(e.currentTarget,e.clientX,e.clientY);if(!t){tu(W("请点击画面有效区域","Tap inside the visible frame"));return}let l=(null==tx?void 0:tx.width)||e.currentTarget.naturalWidth,s=(null==tx?void 0:tx.height)||e.currentTarget.naturalHeight,a=l>0?l/Math.max(1,e.currentTarget.naturalWidth):1,r=s>0?s/Math.max(1,e.currentTarget.naturalHeight):1,n=Math.max(0,Math.min(l||t.x,Math.round(t.x*a))),i=Math.max(0,Math.min(s||t.y,Math.round(t.y*r)));if(e5({x:n,y:i}),"long_press"===e0){await tL("long_press",{x:n,y:i,duration:750});return}await tL(e0,{x:n,y:i})},tF=e=>"shellcrash"===e.service_id&&(null==ed?void 0:ed.control_url)?"".concat(ed.control_url,"/shellcrash?lang=").concat(L):"android_panel"===e.service_id&&(null==ed?void 0:ed.control_url)?"".concat(ed.control_url,"/android?lang=").concat(L):e.url||"",tz=e=>({online:W("在线","Online"),stopped:W("已停止","Stopped"),configured:W("已配置","Configured"),unavailable:W("未安装","Unavailable")})[e]||e,tB="shellcrash"===z?tr:tn,tW={overview:"\uD83D\uDCCA",business:"\uD83C\uDFAC",modules:"\uD83E\uDDE9",shellcrash:"\uD83D\uDEE1️",android:"\uD83E\uDD16",config:"⚙️"};return(0,s.jsxs)(s.Fragment,{children:[P?null:(0,s.jsx)("div",{className:"border-b border-white/[0.08] bg-slate-950/80 backdrop-blur-md",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-2 px-4 py-2.5 text-xs sm:px-6 lg:px-10",children:[(0,s.jsxs)("a",{className:"font-medium text-amber-400/95 transition hover:text-amber-300",href:"/",children:["← ",W("返回门户首页","Back to portal")]}),(0,s.jsx)("span",{className:"text-slate-500",children:W("无人直播 \xb7 本页需与 API 同域(推荐 live.local:8001)","Unmanned live \xb7 same origin as API (live.local:8001)")})]})}),(0,s.jsxs)("main",{className:P?"mx-auto min-h-0 max-w-7xl px-1 pb-4 pt-1 sm:px-3":"safe-pb-nav mx-auto min-h-screen max-w-7xl px-4 pb-16 pt-6 sm:px-6 lg:px-10",children:[Z?(0,s.jsx)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"animate-toast-in fixed bottom-24 left-1/2 z-50 max-w-[min(92vw,28rem)] -translate-x-1/2 rounded-2xl border border-cyan-500/25 bg-slate-950/95 px-5 py-3 text-center text-sm text-cyan-50 shadow-lg md:bottom-6 [html[data-theme=light]_&]:border-cyan-600/25 [html[data-theme=light]_&]:bg-white/95 [html[data-theme=light]_&]:text-cyan-950",children:Z}):null,P?(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2 border-b border-white/[0.08] pb-3",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-[color:var(--text)]",children:"ShellCrash"}),(0,s.jsx)(C,{className:"border border-white/12 bg-black/20",onClick:()=>void t_(),children:W("刷新","Refresh")})]}):(0,s.jsxs)("header",{className:"mb-8 flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-cyan-400/90",children:W("控制平面 \xb7 ARM Linux 开发板","Control plane \xb7 ARM Linux SBC")}),(0,s.jsx)("h1",{className:"mt-2 text-3xl font-bold text-[color:var(--text)] sm:text-4xl",children:W("无人直播控制中心","Unmanned live control center")}),(0,s.jsx)("p",{className:"mt-3 max-w-3xl text-sm text-slate-400",children:W("ShellCrash 负责代理上网;本机 FFmpeg 处理推流或 HDMI;Neko(Docker Chromium)或本机 Chromium 负责浏览器侧;开发板通过 USB 双头线 ADB 控制 AOSP。各模块独立,可分别启停。","ShellCrash for egress; FFmpeg for stream or HDMI; Neko (Docker Chromium) or host Chromium for browser; USB ADB to AOSP. Modules are isolated.")})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("div",{className:"meta-chip max-w-full",children:((null==ed?void 0:ed.mdns_host)||"live.local")+" \xb7 "+((null==ed?void 0:ed.machine)||"unknown")+" \xb7 "+((null==ed?void 0:ed.kernel)||"unknown")}),(0,s.jsx)(C,{className:"zh"===L?"border border-cyan-400/50 bg-cyan-500/10":"border border-white/12 bg-black/20",onClick:()=>M("zh"),children:"中文"}),(0,s.jsx)(C,{className:"en"===L?"border border-cyan-400/50 bg-cyan-500/10":"border border-white/12 bg-black/20",onClick:()=>M("en"),children:"EN"}),(0,s.jsx)(C,{className:"light"===I?"border border-amber-400/50 bg-amber-500/15":"border border-white/12 bg-black/20",onClick:()=>F("light"),title:W("日间主题","Light theme"),children:W("☀️ 日间","☀️ Light")}),(0,s.jsx)(C,{className:"dark"===I?"border border-indigo-400/50 bg-indigo-500/15":"border border-white/12 bg-black/20",onClick:()=>F("dark"),title:W("夜间主题","Dark theme"),children:W("\uD83C\uDF19 夜间","\uD83C\uDF19 Dark")}),(0,s.jsx)(C,{className:"border border-white/12 bg-black/20",onClick:()=>void t_(),children:W("刷新","Refresh")})]})]}),(0,s.jsx)("nav",{className:"tab-strip","aria-label":W("主导航","Primary navigation"),children:f.map(e=>(0,s.jsx)("button",{type:"button",className:"tab-btn ".concat(z===e?"tab-btn-active":""),onClick:()=>B(e),children:{overview:W("总览","Overview"),business:W("直播业务","Live ops"),modules:W("系统服务","Services"),shellcrash:"ShellCrash",android:W("安卓设备","Android"),config:W("配置中心","Config")}[e]},e))})]}),K?(0,s.jsx)("div",{className:"glass rounded-3xl py-24 text-center text-slate-400",children:W("正在连接控制台...","Connecting to the control plane...")}):null,!K&&Y?(0,s.jsx)("div",{className:"glass rounded-3xl border border-rose-500/25 bg-rose-950/20 p-8 text-center text-rose-200",children:Y}):null,K||Y?null:(0,s.jsxs)("div",{className:"grid gap-6",children:["overview"===z?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"glass rounded-3xl border border-amber-500/20 bg-gradient-to-br from-amber-500/[0.07] to-transparent p-6",children:[(0,s.jsx)("h2",{className:"section-title",children:W("第一次用?按这条线理解整套板子","New here? Follow this mental model")}),(0,s.jsxs)("ol",{className:"mt-4 list-decimal space-y-2 pl-5 text-sm leading-relaxed text-slate-300",children:[(0,s.jsx)("li",{children:W("插电、接网线或连好 Wi‑Fi 后,用浏览器打开本页(验收域名一般为 http://live.local:8001/ ,门户在根路径 /,控制台在 /console)。","After power and Ethernet/Wi‑Fi, open this stack in a browser (often http://live.local:8001/ — portal at /, full console at /console).")}),(0,s.jsx)("li",{children:W("「直播业务」里启停 PM2 脚本(抖音→YouTube、HDMI 等);「系统服务」看 ShellCrash、SRS、ws-scrcpy、Neko 等是否在跑。","Use Live ops for PM2 scripts; Services for ShellCrash, SRS, ws-scrcpy, Neko, etc.")}),(0,s.jsx)("li",{children:W("「安卓设备」需要 USB 调试授权;截图预览 + ws-scrcpy 低延迟画面二选一或同用。TikTok 等场景常配合板载 AOSP。","Android tab needs USB debugging; use screenshot taps and/or ws-scrcpy. TikTok workflows often use on-board AOSP.")}),(0,s.jsx)("li",{children:W("深度指标点 Netdata;命令行点 WebTTY;代理规则与 YAML 在 ShellCrash 页。","Netdata for metrics; WebTTY for shell; ShellCrash tab for proxy rules and YAML.")})]})]}),(0,s.jsxs)("section",{className:"grid gap-6 xl:grid-cols-12",children:[(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-4",children:[(0,s.jsx)("h2",{className:"section-title",children:W("\uD83D\uDEF0️ 流媒体与桌面入口","Streaming & desktop")}),(0,s.jsx)("p",{className:"section-lead",children:W("ws-scrcpy:浏览器里控安卓;Chromium:本机+油猴+RemoteDebug;Neko:Docker 里跑 Chromium 桌面(非 Firefox 版)。","ws-scrcpy: browser ADB; Chromium: host+Tampermonkey+9222; Neko: Chromium desktop in Docker (not the Firefox image).")}),(0,s.jsxs)("div",{className:"mt-4 flex max-h-[28rem] flex-col gap-2 overflow-y-auto pr-1 log-scroll",children:[(null==ed?void 0:ed.dashboard_url)?(0,s.jsx)("a",{className:"link-tile",href:ed.dashboard_url,target:"_blank",rel:"noreferrer",children:"\uD83C\uDFE0 Homepage"}):null,(null==ed?void 0:ed.control_url)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("a",{className:"link-tile",href:"".concat(ed.control_url,"/console?tab=shellcrash&lang=").concat(L),target:"_blank",rel:"noreferrer",children:"\uD83D\uDEE1️ ShellCrash"}),(0,s.jsxs)("a",{className:"link-tile",href:"".concat(ed.control_url,"/console?tab=android&lang=").concat(L),target:"_blank",rel:"noreferrer",children:["\uD83E\uDD16 ",W("安卓中心 (含 ws-scrcpy)","Android hub + ws-scrcpy")]}),(0,s.jsxs)("a",{className:"link-tile",href:"".concat(ed.control_url,"/console?tab=config&lang=").concat(L),target:"_blank",rel:"noreferrer",children:["⚙️ ",W("配置中心","Config")]})]}):null,tc.ws_scrcpy?(0,s.jsxs)("a",{className:"link-tile link-tile-accent",href:tc.ws_scrcpy,target:"_blank",rel:"noreferrer",children:["\uD83D\uDCF1 ws-scrcpy (",W("原始流控制页","raw stream UI"),")"]}):null,tc.chromium_remote_debug?(0,s.jsxs)("a",{className:"link-tile",href:tc.chromium_remote_debug,target:"_blank",rel:"noreferrer",children:["\uD83E\uDDEA ",W("Chromium RemoteDebug (9222)","Chromium RemoteDebug")]}):null,td.map(e=>(0,s.jsxs)("a",{className:"link-tile link-tile-warn",href:e.url,target:"_blank",rel:"noreferrer",children:["\uD83D\uDC31 ",e.label," / ",W("Docker Chromium 桌面","Docker Chromium desktop")]},e.key)),tc.webtty?(0,s.jsx)("a",{className:"link-tile",href:tc.webtty,target:"_blank",rel:"noreferrer",children:"⌨️ WebTTY"}):null,tc.filebrowser?(0,s.jsx)("a",{className:"link-tile",href:tc.filebrowser,target:"_blank",rel:"noreferrer",children:"\uD83D\uDCC2 File Browser"}):null,tc.netdata?(0,s.jsx)("a",{className:"link-tile",href:tc.netdata,target:"_blank",rel:"noreferrer",children:"\uD83D\uDCC8 Netdata"}):null,tc.srs_http?(0,s.jsx)("a",{className:"link-tile",href:tc.srs_http,target:"_blank",rel:"noreferrer",children:"\uD83C\uDF9E️ SRS :8080"}):null,tc.srs_api?(0,s.jsx)("a",{className:"link-tile",href:tc.srs_api,target:"_blank",rel:"noreferrer",children:"\uD83C\uDF9E️ SRS API :1985"}):null]})]}),(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-4",children:[(0,s.jsx)("h2",{className:"section-title",children:W("节点状态","Node Status")}),(0,s.jsxs)("div",{className:"panel-inset mt-4",children:[(0,s.jsx)("p",{children:(null==ed?void 0:ed.mdns_host)||"live.local"}),(0,s.jsxs)("p",{className:"mt-2",children:["IP: ",((null==ed?void 0:ed.ips)||[]).join(" / ")||"-"]}),(0,s.jsx)("p",{className:"mt-2",children:(null==ed?void 0:ed.machine)||"-"}),(0,s.jsx)("p",{className:"mt-2",children:(null==ed?void 0:ed.kernel)||"-"})]})]}),(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-4",children:[(0,s.jsx)("h2",{className:"section-title",children:W("系统快照","System Snapshot")}),(0,s.jsx)("p",{className:"section-lead",children:W("总览页每 10 秒自动刷新服务与监控数据。","Overview auto-refreshes every 10s.")}),(0,s.jsxs)("div",{className:"panel-inset mt-4",children:[(0,s.jsxs)("p",{children:["CPU:"," ",[null==eu?void 0:null===(t=eu.cpu_load)||void 0===t?void 0:t["1m"],null==eu?void 0:null===(l=eu.cpu_load)||void 0===l?void 0:l["5m"],null==eu?void 0:null===(i=eu.cpu_load)||void 0===i?void 0:i["15m"]].map(e=>"number"==typeof e?e.toFixed(2):"0.00").join(" / ")]}),(0,s.jsxs)("p",{className:"mt-2",children:["RAM: ",y(null==eu?void 0:null===(o=eu.memory)||void 0===o?void 0:o.available)," / ",y(null==eu?void 0:null===(c=eu.memory)||void 0===c?void 0:c.total)]}),(0,s.jsxs)("p",{className:"mt-2",children:["Disk: ",y(null==eu?void 0:null===(d=eu.disk)||void 0===d?void 0:d.free)," / ",y(null==eu?void 0:null===(h=eu.disk)||void 0===h?void 0:h.total)]}),(0,s.jsxs)("p",{className:"mt-2",children:["Netdata: ",(null==eu?void 0:null===(m=eu.netdata)||void 0===m?void 0:m.available)?eu.netdata.version||"online":"offline"]})]}),(0,s.jsx)(n.Z,{snapshot:eu,theme:I,tr:W})]})]}),(0,s.jsxs)("section",{className:"glass rounded-3xl p-6",children:[(0,s.jsx)("h2",{className:"section-title",children:W("模块概况","Module Summary")}),(0,s.jsx)("div",{className:"mt-4 grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:em.map(e=>(0,s.jsxs)("div",{className:"service-card",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-white",children:e.label}),(0,s.jsx)("p",{className:"mt-1 text-xs text-slate-400",children:e.description})]}),(0,s.jsx)("span",{className:"rounded-full border px-2.5 py-1 text-xs ".concat(k(e.status)),children:tz(e.status)})]}),(0,s.jsx)("p",{className:"mt-3 min-h-[3rem] text-xs text-slate-500",children:e.detail||"-"}),tF(e)?(0,s.jsx)("a",{className:"btn-focus mt-3 inline-flex rounded-xl border border-white/12 px-3 py-2 text-xs text-slate-200",href:tF(e),target:"_blank",rel:"noreferrer",children:W("打开","Open")}):null]},e.service_id))})]})]}):null,"business"===z?(0,s.jsxs)("section",{className:"grid gap-6 xl:grid-cols-12",children:[(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-12",children:[(0,s.jsx)("h2",{className:"section-title",children:W("⚡ 快捷配置","Quick config")}),(0,s.jsx)("p",{className:"section-lead",children:W("跳转配置中心编辑推流与录制相关文件。","Jump to the config editor for stream keys and URLs.")}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,s.jsx)(C,{className:"border border-cyan-500/30 bg-cyan-600/80",onClick:()=>tC("app-config","youtube.ini"),children:"youtube.ini"}),(0,s.jsx)(C,{className:"border border-cyan-500/30 bg-cyan-600/80",onClick:()=>tC("app-config","URL_config.ini"),children:"URL_config.ini"}),(0,s.jsx)(C,{className:"border border-white/15 bg-black/30",onClick:()=>tC("app-config","config.ini"),children:"config.ini"}),(0,s.jsx)(C,{className:"border border-white/15 bg-black/30",onClick:()=>tC("stack-config","system-stack.env"),children:"system-stack.env"})]})]}),(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-4",children:[(0,s.jsx)("h2",{className:"section-title",children:W("业务运行时","Business Runtime")}),(0,s.jsx)("p",{className:"section-lead",children:W("这里只放业务脚本本身,Hub 基座可单独运行。","Only business processes live here.")}),ee.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("select",{className:"field-select mt-4",value:el,onChange:e=>es(e.target.value),children:ee.map(e=>(0,s.jsxs)("option",{value:e.pm2,children:[e.label," | ",e.script]},e.pm2))}),(0,s.jsxs)("div",{className:"mt-4 flex items-center justify-between rounded-2xl border border-white/8 bg-black/20 px-4 py-3",children:[(0,s.jsx)("span",{className:"rounded-full border px-3 py-1 text-xs ".concat(k(ea)),children:tz(ea)}),(0,s.jsx)(C,{className:"border border-white/12 bg-black/20",onClick:()=>void tg(),children:W("轮询","Poll")})]}),(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-2",children:[(0,s.jsx)(C,{className:"bg-emerald-600",disabled:"process:start"===G,onClick:()=>void tD("start"),children:"process:start"===G?W("启动中...","Starting..."):W("启动","Start")}),(0,s.jsx)(C,{className:"bg-amber-600",disabled:"process:restart"===G,onClick:()=>void tD("restart"),children:"process:restart"===G?W("重启中...","Restarting..."):W("重启","Restart")}),(0,s.jsx)(C,{className:"col-span-2 bg-rose-600",disabled:"process:stop"===G,onClick:()=>void tD("stop"),children:"process:stop"===G?W("停止中...","Stopping..."):W("停止","Stop")})]})]}):(0,s.jsx)("div",{className:"mt-4 rounded-2xl border border-dashed border-white/12 bg-black/20 p-4 text-sm text-slate-400",children:W("未发现业务进程。若只部署了 Hub 基座,这是正常状态。","No business process discovered.")})]}),(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-8",children:[(0,s.jsx)("h2",{className:"section-title",children:W("业务日志","Process Logs")}),(0,s.jsxs)("div",{className:"mt-4 grid gap-4 lg:grid-cols-2",children:[(0,s.jsx)("pre",{className:"log-scroll min-h-[22rem] rounded-2xl border border-emerald-500/15 bg-black/55 p-4 font-mono text-[11px] text-emerald-100/95",children:en||W("暂无输出","No stdout yet.")}),(0,s.jsx)("pre",{className:"log-scroll min-h-[22rem] rounded-2xl border border-rose-500/15 bg-black/55 p-4 font-mono text-[11px] text-rose-100/95",children:eo||W("暂无报错","No stderr yet.")})]})]})]}):null,"modules"===z?(0,s.jsxs)("section",{className:"grid gap-6 xl:grid-cols-12",children:[(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-8",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"section-title",children:W("系统模块","System Modules")}),(0,s.jsx)("p",{className:"section-lead",children:W("每个模块都独立启停和降级,避免一个服务异常拖垮整套业务。","Each module starts and degrades independently.")})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(C,{className:"border border-white/12 bg-black/20",onClick:()=>void tf(),children:W("刷新服务","Refresh Services")}),(0,s.jsx)(C,{className:"border border-violet-500/35 bg-violet-600/70",disabled:"hardware:probe"===G,onClick:()=>void tS(),children:"hardware:probe"===G?W("探测中…","Probing…"):W("重探测硬件","Re-probe HW")})]})]}),(0,s.jsx)("div",{className:"mt-4 grid gap-4 md:grid-cols-2",children:em.map(e=>(0,s.jsxs)("div",{className:"service-card",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-white",children:e.label}),(0,s.jsx)("p",{className:"mt-1 text-xs text-slate-400",children:e.description})]}),(0,s.jsx)("span",{className:"rounded-full border px-2.5 py-1 text-xs ".concat(k(e.status)),children:tz(e.status)})]}),(0,s.jsx)("p",{className:"mt-3 min-h-[3rem] text-xs text-slate-500",children:e.detail||"-"}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,s.jsx)(C,{className:"bg-emerald-600",disabled:!e.available||!!G,onClick:()=>void tE(e.service_id,"start"),children:W("启动","Start")}),(0,s.jsx)(C,{className:"bg-amber-600",disabled:!e.available||!!G,onClick:()=>void tE(e.service_id,"restart"),children:W("重启","Restart")}),(0,s.jsx)(C,{className:"bg-rose-600",disabled:!e.available||!!G,onClick:()=>void tE(e.service_id,"stop"),children:W("停止","Stop")}),tF(e)?(0,s.jsx)("a",{className:"btn-focus rounded-xl border border-white/12 px-3 py-2 text-xs text-slate-200",href:tF(e),target:"_blank",rel:"noreferrer",children:W("打开","Open")}):null]})]},e.service_id))})]}),(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-white",children:W("硬件与系统","Hardware and System")}),(0,s.jsxs)("div",{className:"mt-4 rounded-2xl border border-white/8 bg-black/20 p-4 text-xs text-slate-400",children:[(0,s.jsxs)("p",{children:["Arch: ",(null==eb?void 0:eb.arch)||"-"]}),(0,s.jsxs)("p",{className:"mt-2",children:["FFmpeg: ",((null==eb?void 0:eb.ffmpeg_hwaccels)||[]).join(", ")||"-"]}),(0,s.jsxs)("p",{className:"mt-2",children:["GPU: ",(null==eb?void 0:null===(g=eb.gpu)||void 0===g?void 0:g.present)?eb.gpu.driver||"present":"none"]}),(0,s.jsxs)("p",{className:"mt-2",children:["NPU: ",(null==eb?void 0:null===(S=eb.npu)||void 0===S?void 0:S.present)?(eb.npu.devices||[]).join(", "):"none"]}),(0,s.jsxs)("p",{className:"mt-2",children:["Decoder: ",(null==eb?void 0:null===(_=eb.recommendation)||void 0===_?void 0:_.video_decoder)||"cpu"]}),(0,s.jsxs)("p",{className:"mt-2",children:["HDMI: ",(null==eb?void 0:null===(D=eb.recommendation)||void 0===D?void 0:D.hdmi_player)||"cpu"]}),(0,s.jsxs)("p",{className:"mt-2",children:["Mode: ",(null==eb?void 0:null===(E=eb.recommendation)||void 0===E?void 0:E.stability_mode)||"safe"]})]})]})]}):null,"shellcrash"===z?(0,s.jsxs)("section",{className:"grid gap-6 xl:grid-cols-12",children:[(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-white",children:"ShellCrash"}),(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-400",children:W("这里不再依赖命令行菜单,直接做 YAML / JSON / CFG 编辑与服务控制。","Manage ShellCrash from the web instead of the shell menu.")}),ti?(0,s.jsxs)("div",{className:"mt-4 rounded-3xl border border-white/8 bg-black/20 p-5",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-white",children:ti.label}),(0,s.jsx)("p",{className:"mt-1 text-xs text-slate-400",children:ti.description})]}),(0,s.jsx)("span",{className:"rounded-full border px-2.5 py-1 text-xs ".concat(k(ti.status)),children:tz(ti.status)})]}),(0,s.jsx)("p",{className:"mt-3 text-xs text-slate-500",children:ti.detail||"-"}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,s.jsx)(C,{className:"bg-emerald-600",disabled:!ti.available||!!G,onClick:()=>void tE("shellcrash","start"),children:W("启动","Start")}),(0,s.jsx)(C,{className:"bg-amber-600",disabled:!ti.available||!!G,onClick:()=>void tE("shellcrash","restart"),children:W("重启","Restart")}),(0,s.jsx)(C,{className:"bg-rose-600",disabled:!ti.available||!!G,onClick:()=>void tE("shellcrash","stop"),children:W("停止","Stop")}),(0,s.jsx)(C,{className:"bg-sky-600",disabled:!ti.available||!!G,onClick:()=>void tA(w),children:"shellcrash:apply"===G?W("应用中...","Applying..."):W("应用默认配置","Apply Default")}),(0,s.jsx)(C,{className:"bg-cyan-600",disabled:!ti.available||!!G,onClick:()=>void tO(),children:"shellcrash:web_panel"===G?W("部署中...","Deploying..."):W("web面板","Web Panel")})]})]}):null,(0,s.jsxs)("div",{className:"mt-4 rounded-2xl border border-sky-400/20 bg-sky-500/10 p-4 text-xs text-sky-100",children:[(0,s.jsx)("p",{className:"font-semibold",children:W("默认代理节点","Default proxy node")}),(0,s.jsx)("p",{className:"mt-2 break-all font-mono text-[11px] text-sky-200",children:j}),(0,s.jsx)("p",{className:"mt-2 text-sky-100/80",children:W("应用后会写入 config.yaml、重启 ShellCrash,并把包含该节点的选择组切到此节点。","Applying writes config.yaml, restarts ShellCrash, and selects this node in matching groups.")})]}),(0,s.jsxs)("div",{className:"mt-4 rounded-2xl border border-white/8 bg-black/20 p-4 text-xs text-slate-400",children:[(0,s.jsx)("p",{className:"text-white",children:W("快捷文件","Quick Files")}),(0,s.jsxs)("div",{className:"mt-3 grid gap-2",children:[(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-left text-slate-200",onClick:()=>void tk("shellcrash-yamls",w),children:w}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-left text-slate-200",onClick:()=>void tk("shellcrash-yamls","config.yaml"),children:"config.yaml"}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-left text-slate-200",onClick:()=>void tk("shellcrash-configs","ShellCrash.cfg"),children:"ShellCrash.cfg"}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-left text-slate-200",onClick:()=>void tk("shellcrash-configs","servers.list"),children:"servers.list"}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-left text-slate-200",onClick:()=>void tk("shellcrash-configs","command.env"),children:"command.env"})]})]})]}),(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-white",children:W("ShellCrash 文件编辑器","ShellCrash Editor")}),(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-400",children:W("支持查看、修改、新建、删除,路径被限制在 ShellCrash 托管目录内。","View, edit, create and delete files inside managed ShellCrash roots.")})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)("label",{className:"btn-focus rounded-xl border border-white/12 px-3 py-2 text-xs text-slate-100 ".concat(G?"cursor-not-allowed opacity-40":""),children:["file:import"===G?W("导入中...","Importing..."):W("导入/替换","Import/Replace"),(0,s.jsx)("input",{className:"hidden",disabled:!!G,type:"file",accept:".yaml,.yml,.json,.cfg,.env,.list,.txt",onChange:e=>void tU(e)},e3)]}),(0,s.jsx)(C,{className:"bg-sky-600",disabled:"shellcrash-yamls"!==ew||!ek||!!G,onClick:()=>void tA(ek),children:"shellcrash:apply"===G?W("应用中...","Applying..."):W("应用当前 YAML","Apply YAML")}),(0,s.jsx)(C,{className:"bg-cyan-600",disabled:!ek||!!G,onClick:()=>void tR(),children:"file:save"===G?W("保存中...","Saving..."):W("保存","Save")})]})]}),(0,s.jsxs)("div",{className:"mt-4 grid gap-6 xl:grid-cols-[18rem,1fr]",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("select",{className:"w-full rounded-2xl border border-white/12 bg-slate-950/60 px-4 py-3 text-sm text-white",value:ew,onChange:e=>{ej(e.target.value),eC("")},children:tr.map(e=>(0,s.jsxs)("option",{value:e.root_id,children:[e.label," | ",e.file_count]},e.root_id))}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,s.jsx)(C,{className:"bg-cyan-600",disabled:!!G,onClick:()=>void tP(),children:W("新建","New")}),(0,s.jsx)(C,{className:"bg-rose-600",disabled:!ek||!!G,onClick:()=>void tT(),children:W("删除","Delete")})]}),(0,s.jsx)("div",{className:"mt-4 space-y-2",children:eN.map(e=>(0,s.jsxs)("button",{className:"btn-focus w-full rounded-2xl border px-4 py-3 text-left ".concat(ek===e.path?"border-cyan-500/40 bg-cyan-500/10":"border-white/8 bg-black/20"),onClick:()=>eC(e.path),children:[(0,s.jsx)("div",{className:"truncate text-sm text-white",children:e.path}),(0,s.jsx)("div",{className:"mt-1 text-[11px] text-slate-500",children:y(e.size)})]},e.path))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"rounded-2xl border border-white/8 bg-black/20 px-4 py-3 font-mono text-[11px] text-slate-500",children:ek?"".concat(ew," / ").concat(ek):W("请选择文件","Pick a file")}),(0,s.jsx)("textarea",{className:"log-scroll mt-4 min-h-[32rem] w-full resize-y rounded-2xl border border-white/10 bg-black/45 p-4 font-mono text-xs leading-relaxed text-slate-200",spellCheck:!1,value:eS,onChange:e=>e_(e.target.value)})]})]})]})]}):null,"android"===z?(0,s.jsxs)("section",{className:"grid gap-6 xl:grid-cols-12",children:[(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-white",children:W("安卓设备中心","Android Device Center")}),(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-400",children:W("把设备发现、截图预览、ADB 动作和原始 web-scrcpy 放到一个模块里。","Combine discovery, preview, ADB actions and raw web-scrcpy in one module.")})]}),(0,s.jsx)(C,{className:"border border-white/12 bg-black/20",onClick:()=>void(async()=>{let e=await tw();e&&await Promise.all([tj(e),ty(e),tN(e)]),eX(Date.now())})(),children:W("刷新设备","Refresh")})]}),(0,s.jsxs)("div",{className:"mt-4 rounded-2xl border border-white/8 bg-black/20 p-4",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-white",children:W("已连接设备","Devices")}),eD&&0!==eA.length?(0,s.jsx)("div",{className:"mt-3 space-y-2",children:eA.map(e=>(0,s.jsxs)("button",{className:"btn-focus w-full rounded-2xl border px-4 py-3 text-left ".concat(eR===e.serial?"border-cyan-500/40 bg-cyan-500/10":"border-white/8 bg-black/20"),onClick:()=>{eP(e.serial),Promise.all([tj(e.serial),ty(e.serial),tN(e.serial)]),eX(Date.now())},children:[(0,s.jsx)("div",{className:"text-sm text-white",children:e.model||e.device||e.serial}),(0,s.jsxs)("div",{className:"mt-1 text-[11px] text-slate-500",children:[e.serial," | ",e.state]})]},e.serial))}):(0,s.jsx)("p",{className:"mt-3 text-sm text-slate-400",children:W("当前没有可用的 ADB 设备。","No active ADB device.")})]}),(0,s.jsxs)("div",{className:"mt-4 rounded-2xl border border-white/8 bg-black/20 p-4 text-xs text-slate-400",children:[(0,s.jsx)("p",{className:"text-white",children:W("设备状态","Device Status")}),(0,s.jsxs)("p",{className:"mt-2",children:[(null==eT?void 0:eT.brand)||"-"," ",(null==eT?void 0:eT.model)||"-"]}),(0,s.jsxs)("p",{className:"mt-2",children:["Android ",(null==eT?void 0:eT.android_version)||"-"," / SDK ",(null==eT?void 0:eT.sdk)||"-"]}),(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap",children:(null==eT?void 0:eT.battery)||"-"}),(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap",children:(null==eT?void 0:eT.resolution)||"-"}),(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap",children:(null==eT?void 0:eT.focus)||"-"})]})]}),(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-white",children:W("屏幕预览与动作","Screen Preview and Actions")}),(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-400",children:W("预览图支持直接点按/双击/长按,配合 UI 节点和包管理形成更完整的安卓控制台。","The preview supports tap, double tap and long press, backed by UI nodes and package tools.")})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(C,{className:"border border-white/12 ".concat("tap"===e0?"bg-cyan-600":"bg-black/20"),disabled:!eR||!!G,onClick:()=>e2("tap"),children:W("点击","Tap")}),(0,s.jsx)(C,{className:"border border-white/12 ".concat("double_tap"===e0?"bg-cyan-600":"bg-black/20"),disabled:!eR||!!G,onClick:()=>e2("double_tap"),children:W("双击","Double Tap")}),(0,s.jsx)(C,{className:"border border-white/12 ".concat("long_press"===e0?"bg-cyan-600":"bg-black/20"),disabled:!eR||!!G,onClick:()=>e2("long_press"),children:W("长按","Long Press")}),(0,s.jsx)(C,{className:"border border-white/12 bg-black/20",disabled:!eR,onClick:()=>eX(Date.now()),children:W("刷新截图","Refresh Shot")})]})]}),(0,s.jsx)("div",{className:"mt-4 overflow-hidden rounded-3xl border border-white/8 bg-black/35 p-4",children:eR?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-3 text-xs text-slate-400",children:[(0,s.jsxs)("span",{children:[W("当前动作","Current action"),": ",tM]}),(0,s.jsxs)("span",{children:[W("分辨率","Resolution"),": ",(null==eT?void 0:eT.resolution)||"-"]}),(0,s.jsxs)("span",{children:[W("最近坐标","Last point"),": ",e1?"".concat(e1.x,", ").concat(e1.y):"-"]}),tl?(0,s.jsx)("span",{className:"text-cyan-400/90",children:W("截图刷新中…","Refreshing…")}):null]}),te?(0,s.jsxs)("div",{className:"mb-3 rounded-xl border border-rose-500/30 bg-rose-950/25 px-4 py-3 text-sm text-rose-100",children:[W("截图不可用:","Screenshot unavailable: "),te]}):null,e9?(0,s.jsx)(a.default,{alt:"Android preview",className:"max-h-[min(70vh,48rem)] min-h-[14rem] w-full cursor-crosshair rounded-2xl object-contain bg-black",onClick:e=>void tI(e),src:e9,unoptimized:!0,width:(null==tx?void 0:tx.width)||1080,height:(null==tx?void 0:tx.height)||1920}):te?null:(0,s.jsx)("div",{className:"flex min-h-[18rem] items-center justify-center rounded-2xl border border-dashed border-white/10 bg-black/30 text-sm text-slate-500",children:W("正在拉取截图…","Fetching screenshot…")})]}):(0,s.jsx)("div",{className:"flex min-h-[18rem] items-center justify-center rounded-2xl border border-dashed border-white/10 bg-black/20 text-sm text-slate-500",children:W("当前没有可用的 ADB 设备。","No active ADB device.")})}),(0,s.jsxs)("div",{className:"mt-6 grid gap-6 xl:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-3xl border border-white/8 bg-black/20 p-5",children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-white",children:W("快捷控制","Quick Controls")}),(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-3 gap-2",children:[[["HOME","KEYCODE_HOME"],["BACK","KEYCODE_BACK"],["RECENTS","KEYCODE_APP_SWITCH"],["POWER","KEYCODE_POWER"],["NOTIFY","KEYCODE_NOTIFICATION"],["VOL+","KEYCODE_VOLUME_UP"],["VOL-","KEYCODE_VOLUME_DOWN"]].map(e=>{let[t,l]=e;return(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 bg-slate-950/50 px-3 py-3 text-xs text-slate-100",disabled:!eR||!!G,onClick:()=>void tL("key",{keycode:l}),children:t},t)}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 bg-slate-950/50 px-3 py-3 text-xs text-slate-100",disabled:!eR||!!G,onClick:()=>void tL("wake"),children:"WAKE"}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 bg-slate-950/50 px-3 py-3 text-xs text-slate-100",disabled:!eR||!!G,onClick:()=>void tL("rotate",{rotation:"0"}),children:"Portrait"}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 bg-slate-950/50 px-3 py-3 text-xs text-slate-100",disabled:!eR||!!G,onClick:()=>void tL("rotate",{rotation:"1"}),children:"Landscape"})]}),(0,s.jsx)("div",{className:"mt-4 grid grid-cols-2 gap-2",children:["up","down","left","right"].map(e=>(0,s.jsxs)("button",{className:"btn-focus rounded-xl border border-white/10 bg-slate-950/50 px-3 py-3 text-xs uppercase text-slate-100",disabled:!eR||!!G,onClick:()=>void tL("swipe",{direction:e}),children:["Swipe ",e]},e))})]}),(0,s.jsxs)("div",{className:"rounded-3xl border border-white/8 bg-black/20 p-5",children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-white",children:W("输入与跳转","Input and Launch")}),(0,s.jsx)("textarea",{className:"mt-4 min-h-[6rem] w-full rounded-2xl border border-white/10 bg-black/45 p-4 text-sm text-slate-200",placeholder:W("输入要发送到安卓输入框的文字","Text to send to Android"),value:eW,onChange:e=>eK(e.target.value)}),(0,s.jsx)(C,{className:"mt-3 bg-cyan-600",disabled:!eW.trim()||!eR||!!G,onClick:()=>void tL("text",{text:eW}),children:W("发送文本","Send Text")}),(0,s.jsx)("input",{className:"mt-4 w-full rounded-2xl border border-white/10 bg-black/45 px-4 py-3 text-sm text-slate-200",placeholder:"com.zhiliaoapp.musically",value:eH,onChange:e=>eY(e.target.value)}),(0,s.jsxs)("div",{className:"mt-3 grid grid-cols-3 gap-2",children:[(0,s.jsx)(C,{className:"bg-emerald-600",disabled:!eH.trim()||!eR||!!G,onClick:()=>void tL("launch_package",{package:eH}),children:W("启动","Launch")}),(0,s.jsx)(C,{className:"bg-amber-600",disabled:!eH.trim()||!eR||!!G,onClick:()=>void tL("force_stop",{package:eH}),children:W("停应用","Stop App")}),(0,s.jsx)(C,{className:"bg-rose-600",disabled:!eH.trim()||!eR||!!G,onClick:()=>void tL("clear_app",{package:eH}),children:W("清数据","Clear Data")})]}),(0,s.jsx)("input",{className:"mt-4 w-full rounded-2xl border border-white/10 bg-black/45 px-4 py-3 text-sm text-slate-200",placeholder:"https://www.tiktok.com",value:eJ,onChange:e=>eZ(e.target.value)}),(0,s.jsx)(C,{className:"mt-3 bg-violet-600",disabled:!eJ.trim()||!eR||!!G,onClick:()=>void tL("open_url",{url:eJ}),children:W("打开链接","Open URL")})]}),(0,s.jsxs)("div",{className:"rounded-3xl border border-white/8 bg-black/20 p-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-white",children:W("应用工作台","App Workspace")}),(0,s.jsx)(C,{className:"border border-white/12 bg-black/20",disabled:!eR||!!G,onClick:()=>void ty(eR),children:W("刷新UI","Refresh UI")})]}),(0,s.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:[["TikTok","com.zhiliaoapp.musically"],["Chrome","com.android.chrome"],["Settings","com.android.settings"],["YouTube","com.google.android.youtube"],["Play","com.android.vending"]].map(e=>{let[t,l]=e;return(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 bg-slate-950/50 px-3 py-2 text-xs text-slate-100",disabled:!eR||!!G,onClick:()=>{eY(l),tL("launch_package",{package:l})},children:t},l)})}),(0,s.jsxs)("div",{className:"mt-4 flex gap-2",children:[(0,s.jsx)("input",{className:"w-full rounded-2xl border border-white/10 bg-black/45 px-4 py-3 text-sm text-slate-200",placeholder:W("搜索包名,例如 tiktok","Search package, e.g. tiktok"),value:ez,onChange:e=>eB(e.target.value)}),(0,s.jsx)(C,{className:"bg-cyan-600",disabled:!eR||!!G,onClick:()=>void tN(eR),children:W("搜索","Search")})]}),(0,s.jsx)("div",{className:"mt-4 space-y-2",children:0===eI.length?(0,s.jsx)("div",{className:"rounded-2xl border border-dashed border-white/10 px-4 py-6 text-sm text-slate-500",children:W("还没有查询结果。","No package results yet.")}):eI.slice(0,8).map(e=>(0,s.jsxs)("div",{className:"rounded-2xl border border-white/8 bg-slate-950/30 p-3",children:[(0,s.jsx)("div",{className:"text-sm text-white",children:e.label||e.package.split(".").pop()}),(0,s.jsx)("div",{className:"mt-1 truncate font-mono text-[11px] text-slate-500",children:e.package}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-xs text-slate-200",disabled:!eR||!!G,onClick:()=>{eY(e.package),tL("launch_package",{package:e.package})},children:W("启动","Launch")}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-xs text-slate-200",disabled:!eR||!!G,onClick:()=>{eY(e.package),tL("force_stop",{package:e.package})},children:W("停应用","Stop")}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-xs text-slate-200",disabled:!eR||!!G,onClick:()=>{eY(e.package),tL("clear_app",{package:e.package})},children:W("清数据","Clear")})]})]},e.package))})]})]}),(0,s.jsxs)("div",{className:"mt-6 grid gap-6 xl:grid-cols-[0.95fr,1.05fr]",children:[(0,s.jsxs)("div",{className:"rounded-3xl border border-white/8 bg-black/20 p-5",children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-white",children:"ADB Shell"}),(0,s.jsxs)("div",{className:"mt-4 flex flex-col gap-3 lg:flex-row",children:[(0,s.jsx)("input",{className:"w-full rounded-2xl border border-white/10 bg-black/45 px-4 py-3 text-sm text-slate-200",placeholder:"input keyevent KEYCODE_HOME",value:eV,onChange:e=>eG(e.target.value)}),(0,s.jsx)(C,{className:"bg-amber-600",disabled:!eV.trim()||!eR||!!G,onClick:()=>void tL("shell",{command:eV}),children:W("执行命令","Run Command")})]}),(0,s.jsx)("pre",{className:"log-scroll mt-4 min-h-[14rem] rounded-2xl border border-white/10 bg-black/45 p-4 font-mono text-[11px] text-slate-200",children:eq||W("动作结果会显示在这里。","Action output will appear here.")})]}),(0,s.jsxs)("div",{className:"rounded-3xl border border-white/8 bg-black/20 p-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-white",children:W("UI 节点","UI Nodes")}),(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-400",children:W("用 uiautomator 抓当前页面结构,快速定位可点击元素。","Inspect the current UI hierarchy and act on clickable nodes.")})]}),(0,s.jsx)(C,{className:"border border-white/12 bg-black/20",disabled:!eR||!!G,onClick:()=>void ty(eR),children:W("刷新节点","Refresh Nodes")})]}),(0,s.jsx)("div",{className:"mt-4 space-y-3",children:0===eL.length?(0,s.jsx)("div",{className:"rounded-2xl border border-dashed border-white/10 px-4 py-6 text-sm text-slate-500",children:W("还没有抓到 UI 节点。","No UI nodes yet.")}):eL.slice(0,12).map((e,t)=>(0,s.jsxs)("div",{className:"rounded-2xl border border-white/8 bg-slate-950/30 p-3",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-white",children:e.label||e.resource_id||e.class_name||"node"}),(0,s.jsx)("div",{className:"mt-1 text-[11px] text-slate-500",children:e.resource_id||e.class_name||"-"}),(0,s.jsxs)("div",{className:"mt-1 text-[11px] text-slate-500",children:[e.bounds," | ",e.center_x,",",e.center_y]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-xs text-slate-200",disabled:!eR||!!G,onClick:()=>void tL("tap",{x:e.center_x,y:e.center_y}),children:W("点击","Tap")}),(0,s.jsx)("button",{className:"btn-focus rounded-xl border border-white/10 px-3 py-2 text-xs text-slate-200",disabled:!eR||!!G,onClick:()=>void tL("long_press",{x:e.center_x,y:e.center_y,duration:750}),children:W("长按","Long Press")})]})]}),e.text||e.content_desc?(0,s.jsx)("div",{className:"mt-2 whitespace-pre-wrap text-xs text-slate-400",children:e.text||e.content_desc}):null]},"".concat(e.resource_id||e.label,"-").concat(t)))})]})]}),tm?(0,s.jsxs)("div",{className:"mt-6 rounded-3xl border border-white/8 bg-black/20 p-5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-white",children:"ws-scrcpy"}),(0,s.jsx)("a",{className:"btn-focus rounded-xl border border-white/12 px-3 py-2 text-xs text-slate-200",href:tm,target:"_blank",rel:"noreferrer",children:W("新标签全屏打开","Open full tab")})]}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-slate-500",children:W(th?"内嵌若黑屏:多为 WebSocket 未连上或服务未启动。请先确认「系统服务」里 android_panel 在线,并尝试新标签打开;Neko(Chromium)实例通常为 ".concat(th,"。"):"内嵌若黑屏:多为 WebSocket 未连上或服务未启动。请先确认「系统服务」里 android_panel 在线,并尝试新标签打开;Neko(Chromium)在 ENABLE_NEKO=1 且容器运行后一般为 9200 端口。",th?"Black iframe: often WebSocket or service down. Check android_panel in Services, try opening in a new tab; Neko Chromium instances are usually on ".concat(th,"."):"Black iframe: often WebSocket or service down. Check android_panel in Services, try opening in a new tab; Neko Chromium is often :9200 when ENABLE_NEKO=1 and the container is up.")}),(0,s.jsx)("iframe",{className:"mt-4 h-[30rem] w-full rounded-2xl border border-white/10 bg-black",src:tm,title:"ws-scrcpy"})]}):null]})]}):null,"config"===z?(0,s.jsxs)("section",{className:"grid gap-6 xl:grid-cols-12",children:[(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-white",children:W("配置中心","Config Center")}),(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-400",children:W("系统级与业务级配置文件分目录托管,避免大杂烩。","System and business configs are isolated by managed roots.")})]}),(0,s.jsx)(C,{className:"border border-white/12 bg-black/20",onClick:()=>void tv(ew),children:W("刷新","Refresh")})]}),(0,s.jsx)("select",{className:"mt-4 w-full rounded-2xl border border-white/12 bg-slate-950/60 px-4 py-3 text-sm text-white",value:ew,onChange:e=>{ej(e.target.value),eC("")},children:tB.map(e=>(0,s.jsxs)("option",{value:e.root_id,children:[e.label," | ",e.file_count]},e.root_id))}),ta?(0,s.jsxs)("div",{className:"mt-4 rounded-2xl border border-white/8 bg-black/20 p-4 text-xs text-slate-400",children:[(0,s.jsx)("p",{className:"text-white",children:ta.label}),(0,s.jsx)("p",{className:"mt-2",children:ta.description}),(0,s.jsx)("p",{className:"mt-2 font-mono text-[11px] text-slate-500",children:ta.path})]}):null,(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,s.jsx)(C,{className:"bg-cyan-600",disabled:!!G,onClick:()=>void tP(),children:W("新建","New")}),(0,s.jsx)(C,{className:"bg-rose-600",disabled:!ek||!!G,onClick:()=>void tT(),children:W("删除","Delete")})]}),(0,s.jsx)("div",{className:"mt-4 space-y-2",children:eN.map(e=>(0,s.jsxs)("button",{className:"btn-focus w-full rounded-2xl border px-4 py-3 text-left ".concat(ek===e.path?"border-cyan-500/40 bg-cyan-500/10":"border-white/8 bg-black/20"),onClick:()=>eC(e.path),children:[(0,s.jsx)("div",{className:"truncate text-sm text-white",children:e.path}),(0,s.jsxs)("div",{className:"mt-1 text-[11px] text-slate-500",children:[y(e.size)," | ",new Date(1e3*e.mtime).toLocaleString("zh"===L?"zh-CN":"en-US",{hour12:!1})]})]},e.path))})]}),(0,s.jsxs)("article",{className:"glass rounded-3xl p-6 xl:col-span-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-white",children:W("文件编辑器","Config Editor")}),(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-400",children:W("仅允许编辑受管目录中的配置文件。","Only approved config roots are editable.")})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)("label",{className:"btn-focus rounded-xl border border-white/12 px-3 py-2 text-xs text-slate-100 ".concat(G?"cursor-not-allowed opacity-40":""),children:["file:import"===G?W("导入中...","Importing..."):W("导入/替换","Import/Replace"),(0,s.jsx)("input",{className:"hidden",disabled:!!G,type:"file",accept:".yaml,.yml,.json,.cfg,.env,.list,.txt,.ini",onChange:e=>void tU(e)},"config-".concat(e3))]}),(0,s.jsx)(C,{className:"bg-cyan-600",disabled:!ek||!!G,onClick:()=>void tR(),children:"file:save"===G?W("保存中...","Saving..."):W("保存","Save")})]})]}),(0,s.jsx)("div",{className:"mt-4 rounded-2xl border border-white/8 bg-black/20 px-4 py-3 font-mono text-[11px] text-slate-500",children:ek?"".concat(ew," / ").concat(ek):W("请选择文件","Pick a file")}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(x,{lang:L,rootId:ew,filePath:ek,fileContent:eS,refreshKey:e8,busy:G,fetchJson:tp,notify:tu,onChangeContent:e_,onRefreshListing:()=>tv(ew,ek)})}),(0,s.jsx)("textarea",{className:"log-scroll mt-4 min-h-[32rem] w-full resize-y rounded-2xl border border-white/10 bg-black/45 p-4 font-mono text-xs leading-relaxed text-slate-200",spellCheck:!1,value:eS,onChange:e=>e_(e.target.value)})]})]}):null]})]}),P?null:(0,s.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 z-40 flex justify-around border-t border-white/15 bg-black/75 py-1.5 backdrop-blur-lg [html[data-theme=light]_&]:border-slate-200/60 [html[data-theme=light]_&]:bg-white/90 md:hidden",style:{paddingBottom:"max(0.35rem, env(safe-area-inset-bottom))"},"aria-label":W("主导航","Main nav"),children:f.map(e=>(0,s.jsxs)("button",{type:"button",className:"btn-focus flex min-w-0 flex-1 flex-col items-center gap-0.5 rounded-xl px-1 py-1 text-[10px] font-medium ".concat(z===e?"text-cyan-300 [html[data-theme=light]_&]:text-cyan-700":"text-slate-400 [html[data-theme=light]_&]:text-slate-600"),onClick:()=>B(e),children:[(0,s.jsx)("span",{className:"text-lg leading-none","aria-hidden":!0,children:tW[e]}),(0,s.jsx)("span",{className:"truncate",children:{overview:W("总览","Home"),business:W("业务","Biz"),modules:W("模块","Mods"),shellcrash:"SC",android:W("安卓","Droid"),config:W("配置","Cfg")}[e]})]},e))})]})}},7169:function(e,t,l){function s(e){let t=e.replace(/\s+/g," ").trim();return t?t.length<=240?t:"".concat(t.slice(0,237),"..."):""}function a(e,t,l){return"string"==typeof(null==l?void 0:l.error)&&l.error.trim()||"string"==typeof(null==l?void 0:l.message)&&l.message.trim()||function(e){if("string"==typeof e)return e.trim();if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return e.trim();if(e&&"object"==typeof e&&"msg"in e){var t;return String(null!==(t=e.msg)&&void 0!==t?t:"").trim()}return""}).filter(Boolean).join("; ");if(e&&"object"==typeof e)try{return s(JSON.stringify(e))}catch(e){}return""}(null==l?void 0:l.detail)||s(t)||function(e){var t;let l=(null===(t=e.statusText)||void 0===t?void 0:t.trim())?" ".concat(e.statusText.trim()):"";return"HTTP ".concat(e.status).concat(l)}(e)}async function r(e,t){let l;try{l=await fetch(e,{cache:"no-store",...t})}catch(l){let t=l instanceof Error&&l.message.trim()?l.message:"Network request failed";throw Error("Failed to fetch ".concat(e,": ").concat(t))}let s=(await l.text()).trim(),r=null;if(s)try{r=JSON.parse(s)}catch(t){if(!l.ok)throw Error(a(l,s,null));throw Error("Invalid JSON response from ".concat(e))}if(!l.ok)throw Error(a(l,s,r));return null!==r?r:{}}async function n(e){let t="";try{t=(await e.text()).trim()}catch(e){t=""}let l=null;if(t)try{l=JSON.parse(t)}catch(e){l=null}return a(e,t,l)}l.d(t,{N:function(){return r},e:function(){return n}})},2812:function(e,t,l){l.d(t,{O0:function(){return r},Tc:function(){return i},U_:function(){return n}});let s=/^neko_browser(?:(?:_(lan|wireguard|nat1to1|public))?(?:_(\d+))?)?$/i,a={wireguard:80,public:70,nat1to1:60,lan:50,direct:40};function r(e){let t=new Map;for(let[n,i]of Object.entries(null!=e?e:{})){var l,r;let e=n.match(s),o=i.trim();if(!e||!o)continue;let c=(e[1]||("neko_browser"===n||/^neko_browser_\d+$/i.test(n)?"direct":"lan")).toLowerCase(),d="neko_browser"===n?1:Number(e[2]||1),h={id:d,key:n,label:"Neko ".concat(d),url:o,port:function(e){try{return new URL(e,"http://127.0.0.1").port||""}catch(e){return""}}(o),accessKind:c,accessLabel:"wireguard"===c?"WireGuard":"public"===c?"Public":"nat1to1"===c?"NAT1TO1":"lan"===c?"LAN":"Direct",host:function(e){try{return new URL(e,"http://127.0.0.1").hostname||""}catch(e){return""}}(o)},m=t.get(d),x=m?null!==(l=a[m.accessKind])&&void 0!==l?l:0:-1,u=null!==(r=a[c])&&void 0!==r?r:0,p=!m||u>x||u===x&&"neko_browser"!==n;(!m||p)&&t.set(d,h)}return Array.from(t.values()).sort((e,t)=>e.id-t.id)}function n(e,t){return e.length?!Number.isInteger(t)||t<0?{link:e[0],fallback:!1}:t<e.length?{link:e[t],fallback:!1}:{link:e[0],fallback:!0}:{link:null,fallback:!1}}function i(e){let t=Array.from(new Set(e.map(e=>e.port).filter(Boolean)));return t.length?t.map(e=>":".concat(e)).join(" / "):""}},8755:function(e,t,l){l.d(t,{p:function(){return s}});function s(e){let t=e.trim();if(!t)return t;try{let e=new URL(t,window.location.origin),l=e.hostname,s=window.location.hostname;if("0.0.0.0"===l||"::"===l||"[::]"===l)return e.hostname=s||l,e.toString();if(("127.0.0.1"===l||"localhost"===l)&&s&&"127.0.0.1"!==s&&"localhost"!==s)return e.hostname=s,e.toString();if(l.endsWith(".local")&&"8001"===e.port)return"".concat(e.pathname||"/").concat(e.search).concat(e.hash);if(l.endsWith(".local")&&s&&s!==l)return e.hostname=s,e.toString();return t}catch(e){return t}}}}]);