import{m as B,ak as E,_ as S}from"./index.84328ebd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as A,r as F,bT as R,bI as T,C as D,D as U,aI as o,aH as n,G as y,aN as f,aM as _,bg as k,bh as C,bU as V,a$ as H,ba as I,bG as P,bJ as M,bL as N,n as z}from"./arco.7f845a67.js";import{i as G,e as L,b as J,g as K}from"./serial.c6b76da8.js";import{C as O}from"./index.b649760d.js";import"./chart.95d38b48.js";import"./vue.0bef8fc5.js";import"./useConfig.c667f475.js";import"./index.fdc89ad5.js";import"./helper.895b8d7d.js";const j={class:"container"},q=["innerHTML"],Q={name:"Chi"},W=A({...Q,setup(X){const s=B(),r=F({status:"\u70B9\u51FB\u5199\u5165\u6309\u94AE\u5199\u5165\u5B57\u5E93\u5230\u8BBE\u5907

",eepromType:"",showHide:0,lang:"Simplified_Chinese"}),g=async(e=0,t)=>{var m;await L(s.connectPort);for(let u=e;u",z(()=>{const p=document==null?void 0:document.getElementById("statusArea");p&&(p.scrollTop=p==null?void 0:p.scrollHeight)});r.status=r.status+"\u5199\u5165\u8FDB\u5EA6\uFF1A100.0%
",await K(s.connectPort)},v=async(e=1)=>{var m,u,p,b,w,h;if(s.connectState!=!0){alert(sessionStorage.getItem("noticeConnectK5"));return}if(((m=s.configuration)==null?void 0:m.uart)=="official"){alert(sessionStorage.getItem("noticeVersionNoSupport"));return}r.status=r.status+"\u6B63\u5728\u4E0B\u8F7D\u5B57\u5E93...
";let t;if(e==4){(u=s.configuration)!=null&&u.newpinyin?t=await fetch("/pinyin_plus.bin"):t=await fetch("/pinyin.bin");const l=t.body.getReader(),a=[];for(;;){const{done:c,value:i}=await l.read();if(c)break;a.push(...i)}const d=new Uint8Array(a);await g(131072,d);return}if(e==5){const l=await G(s.connectPort,(p=s.configuration)==null?void 0:p.uart);if(l!=262144&&l!=524288){r.status=r.status+"\u53EA\u652F\u6301 2Mbit \u4EE5\u4E0A EEPROM \u5199\u5165
";return}t=await fetch("/ssb.bin");const a=t.body.getReader(),d=[];for(;;){const{done:i,value:$}=await a.read();if(i)break;d.push(...$)}const c=new Uint8Array(d);await g(246312,c);return}if(e==1){if(((b=s.configuration)==null?void 0:b.charset)=="losehu"){t=await fetch("/old_font.bin");const l=t.body.getReader(),a=[];for(;;){const{done:c,value:i}=await l.read();if(c)break;a.push(...i)}const d=new Uint8Array(a);await g(8192,d);return}if(((w=s.configuration)==null?void 0:w.charset)=="gb2312"){t=await fetch("/new_font_k.bin");const l=t.body.getReader(),a=[];for(;;){const{done:c,value:i}=await l.read();if(c)break;a.push(...i)}const d=new Uint8Array(a);await g(9344,d);return}}if(e==6)if(((h=s.configuration)==null?void 0:h.charset)=="gb2312"){t=await fetch("/new_font_k_f.bin");const l=t.body.getReader(),a=[];for(;;){const{done:c,value:i}=await l.read();if(c)break;a.push(...i)}const d=new Uint8Array(a);await g(9344,d);return}else alert("\u4E0D\u652F\u6301\u7684\u7248\u672C")};return(e,t)=>{const m=E,u=R,p=V,b=H,w=O,h=I,l=P,a=T,d=M,c=N;return D(),U("div",j,[o(m,{items:[e.$t("menu.list"),e.$t("menu.font")]},null,8,["items"]),o(c,{gutter:20,align:"stretch"},{default:n(()=>[o(d,{span:24},{default:n(()=>[o(a,{class:"general-card"},{title:n(()=>[y("span",{onClick:t[0]||(t[0]=()=>{r.showHide+=1})},f(e.$t("menu.font")+e.$t("global.onStart")),1)]),default:n(()=>[o(h,null,{default:n(()=>[o(w,{bordered:"",style:{width:"420px"}},{header:n(()=>[_(f(e.$t("tool.fontwrite"))+" ",1),y("div",null,[o(p,{type:"button",size:"mini",modelValue:r.lang,"onUpdate:modelValue":t[1]||(t[1]=i=>r.lang=i)},{default:n(()=>[o(u,{value:"Simplified_Chinese"},{default:n(()=>[_(f(e.$t("tool.Simplified_Chinese")),1)]),_:1}),o(u,{value:"Traditional_Chinese"},{default:n(()=>[_(f(e.$t("tool.Traditional_Chinese")),1)]),_:1})]),_:1},8,["modelValue"])])]),default:n(()=>[y("div",null,[k(o(b,{onClick:t[2]||(t[2]=i=>v(1))},{default:n(()=>[_(f(e.$t("tool.writefontwrite")),1)]),_:1},512),[[C,r.lang=="Simplified_Chinese"]]),k(o(b,{onClick:t[3]||(t[3]=i=>v(6))},{default:n(()=>[_(f(e.$t("tool.writefontwrite")),1)]),_:1},512),[[C,r.lang=="Traditional_Chinese"]])])]),_:1}),o(w,{bordered:""},{header:n(()=>[_(f(e.$t("tool.pinyinwrite")),1)]),default:n(()=>[o(h,null,{default:n(()=>[o(b,{onClick:t[4]||(t[4]=i=>v(4))},{default:n(()=>[_(f(e.$t("tool.writepinyin")),1)]),_:1})]),_:1})]),_:1}),o(w,{bordered:""},{header:n(()=>[_(f(e.$t("tool.ssbpatch")),1)]),default:n(()=>[o(h,null,{default:n(()=>[o(b,{onClick:t[5]||(t[5]=i=>v(5))},{default:n(()=>[_(f(e.$t("tool.writessbpatch")),1)]),_:1})]),_:1})]),_:1})]),_:1}),o(l),y("div",{id:"statusArea",style:{height:"20em","background-color":"azure",color:"silver",overflow:"auto",padding:"20px"},innerHTML:r.status},null,8,q)]),_:1})]),_:1})]),_:1})])}}});const ct=S(W,[["__scopeId","data-v-5b175fa0"]]);export{ct as default};