import{q as Q,s as Y,t as Z,L as v,S,$ as M,G as R,z as ee,y as te,F as ne,e as ie,ag as se,_ as ue}from"./index.006cd607.js";/* empty css *//* empty css *//* empty css *//* empty css */import{d as k,c as P,o as le,b as pe,f as fe,t as de,p as ye,r as ae,aI as d,aU as re,i as be,bP as me,bH as ge,bN as ve,C as N,D as T,aH as m,aK as _e,aJ as Oe,aE as B,G as L,u as z,aM as K,bI as je,bM as he,bQ as we,b7 as Pe,bi as Ce,bm as xe,bn as Ee}from"./arco.93f0afda.js";import{e as De,b as Se,g as Fe}from"./serial.bad97c4e.js";import{B as Ne}from"./index.a34685aa.js";import{i as A,P as ke}from"./index.71384a43.js";import{i as F}from"./index.f5d63095.js";import{C as Ae}from"./index.d0865e71.js";import"./chart.c383733a.js";import"./vue.ded74ca2.js";function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,a)}return n}function H(t){for(var e=1;et.size),{className:s,style:f}=Q(a),c=P(()=>["t-icon","t-icon-check-double",s.value]),r=P(()=>H(H({},f.value),n.style)),i=P(()=>({class:c.value,style:r.value,onClick:l=>{var o;return(o=t.onClick)===null||o===void 0?void 0:o.call(t,{e:l})}}));return()=>Y(Ie,i.value)}});const $e=Be;function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,a)}return n}function G(t){for(var e=1;et.size),{className:s,style:f}=Q(a),c=P(()=>["t-icon","t-icon-thumb-up",s.value]),r=P(()=>G(G({},f.value),n.style)),i=P(()=>({class:c.value,style:r.value,onClick:l=>{var o;return(o=t.onClick)===null||o===void 0?void 0:o.call(t,{e:l})}}));return()=>Y(Me,i.value)}});const Re=Le;/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */var Te={align:{type:String,default:"top",validator:function(e){return e?["start","end","center","stretch","baseline","top","middle","bottom"].includes(e):!0}},gutter:{type:[Number,Object,Array],default:0},justify:{type:String,default:"start",validator:function(e){return e?["start","end","center","space-around","space-between"].includes(e):!0}},tag:{type:String,default:"div"}};/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */var J=function(e){var n="xs";return e<768?n="xs":e>=768&&e<992?n="sm":e>=992&&e<1200?n="md":e>=1200&&e<1400?n="lg":e>=1400&&e<1880?n="xl":n="xxl",n};/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */function ze(t,e){le(function(){window.addEventListener(t,e)}),pe(function(){window.removeEventListener(t,e)})}/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */function q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,a)}return n}function $(t){for(var e=1;e=0),"".concat(t,"-").concat(o,"-offset-").concat(u.offset),parseInt(u.offset,10)>=0),"".concat(t,"-").concat(o,"-push-").concat(u.push),parseInt(u.push,10)>=0),"".concat(t,"-").concat(o,"-pull-").concat(u.pull),parseInt(u.pull,10)>=0))},{});return $(v(v(v(v(v(v({},"".concat(t),!0),"".concat(t,"-").concat(n),!A(n)),"".concat(t,"-order-").concat(a),a),"".concat(t,"-offset-").concat(s),s),"".concat(t,"-push-").concat(f),f),"".concat(t,"-pull-").concat(c),c),i)}/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,a)}return n}function Je(t){for(var e=1;e(xe("data-v-59e331d7"),t=t(),Ee(),t),nt={class:"container"},at=["title","src"],rt=ce(()=>L("div",{id:"canvasDiv",style:{zoom:"250%"}},null,-1)),ot=ce(()=>L("br",null,null,-1)),ct={name:"Backup"},it=k({...ct,setup(t){const e=ie(),n=ae({activeKey:1,binaryFile:void 0,loading:!1}),a=r=>{alert("\u56FE\u7247\u5DE5\u574A\u5373\u5C06\u63A8\u51FA")},s=r=>{const i=document.createElement("canvas");i.width=128,i.height=64;const l=i.cloneNode(),o=document.getElementById("canvasDiv");o.innerHTML="",o==null||o.append(i,l);const y=new Image;y.src=r.url,y.onload=()=>{const u=i.getContext("2d");u==null||u.drawImage(y,0,0,128,64);const _=u==null?void 0:u.getImageData(0,0,i.width,i.height).data;function w(g,h){const p=(h*128+g)*4;return _[p]+_[p+1]+_[p+2]>128*3?0:1}const x=l.getContext("2d"),C=x.getImageData(0,0,l.width,l.height);for(let g=0;g<64;g++)for(let h=0;h<128;h++){const p=(g*128+h)*4,O=!w(h,g);C.data[p]=O*255,C.data[p+1]=O*255,C.data[p+2]=O*255,C.data[p+3]=255}x.putImageData(C,0,0);const D=new Uint8Array(1024);let E=0;for(let g=0;g<64;g+=8)for(let h=0;h<128;h++){let b=0;for(let p=0;p<8;p++)b|=w(h,g+p)<{const r=document.createElement("input");r.type="file",r.onchange=async()=>{const i=new Blob([r.files[0]],{type:"application/octet-stream"}),l=URL.createObjectURL(i),o=document.createElement("canvas");o.width=128,o.height=64;const y=o.cloneNode(),u=document.getElementById("canvasDiv");u.innerHTML="",u==null||u.append(o,y);const _=new Image;_.src=l,_.onload=()=>{const w=o.getContext("2d");w==null||w.drawImage(_,0,0,128,64);const x=w==null?void 0:w.getImageData(0,0,o.width,o.height).data;function C(b,p){const j=(p*128+b)*4;return x[j]+x[j+1]+x[j+2]>128*3?0:1}const D=y.getContext("2d"),E=D.getImageData(0,0,y.width,y.height);for(let b=0;b<64;b++)for(let p=0;p<128;p++){const j=(b*128+p)*4,I=!C(p,b);E.data[j]=I*255,E.data[j+1]=I*255,E.data[j+2]=I*255,E.data[j+3]=255}D.putImageData(E,0,0);const g=new Uint8Array(1024);let h=0;for(let b=0;b<64;b+=8)for(let p=0;p<128;p++){let O=0;for(let j=0;j<8;j++)O|=C(p,b+j)<{var l,o,y,u;if(e.connectState!=!0){alert("\u8BF7\u5148\u8FDE\u63A5\u624B\u53F0\uFF01");return}if(((l=e.configuration)==null?void 0:l.uart)=="official"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(n.activeKey==2&&((o=e.configuration)==null?void 0:o.charset)!="gb2312"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(n.activeKey==1&&((y=e.configuration)==null?void 0:y.charset)!="losehu"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}n.loading=!0;let r=123728;n.activeKey==2&&(r=8320),await De(e.connectPort);const i=n.binaryFile;for(let _=r;_{const l=se,o=Ne,y=tt,u=et,_=Ae,w=je,x=he,C=ke,D=we,E=me,g=Pe,h=Ce,b=ge,p=ve;return N(),T("div",nt,[d(l,{items:["\u5C0F\u5DE5\u5177","\u5F00\u673A\u56FE\u7247"]}),d(x,{gutter:20,align:"stretch"},{default:m(()=>[d(w,{span:24},{default:m(()=>[d(p,{loading:n.loading,tip:"\u5199\u5165\u4E2D...",style:{width:"100%"}},{default:m(()=>[d(b,{class:"general-card",title:"\u5F00\u673A\u56FE\u7247\uFF08\u624B\u53F0\u5E94\u5728\u5F00\u673A\u72B6\u6001\u4E0B\uFF09"},{default:m(()=>[d(x,{gutter:20},{default:m(()=>[(N(!0),T(_e,null,Oe([{name:"\u7F57\u72EE\u864E",url:"/img1.png"},{name:"\u79BB\u7EBF\u5C0F\u6050\u9F99",url:"/img2.png"},{name:"\u4E0D\u5FD8\u521D\u5FC3\u7262\u8BB0\u4F7F\u547D",url:"/img3.png"},{name:"\u4E3A\u4EBA\u6C11\u670D\u52A1",url:"/img4.png"},{name:"\u4E25\u7981\u6536\u542C\u654C\u53F0\u5E7F\u64AD",url:"/img5.png"},{name:"\u7231\u56E0\u65AF\u5766",url:"/img6.png"}],O=>(N(),B(w,{span:4},{default:m(()=>[d(_,{style:{width:"100%"}},{cover:m(()=>[L("img",{title:O.name,src:O.url},null,8,at)]),footer:m(()=>[d(u,{align:"middle",justify:"center",style:{gap:"24px"}},{default:m(()=>[d(y,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:m(()=>[d(o,{variant:"text",shape:"square",onClick:j=>a(O)},{default:m(()=>[d(z(Re))]),_:2},1032,["onClick"])]),_:2},1024),d(y,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:m(()=>[d(o,{variant:"text",shape:"square",onClick:j=>s(O)},{default:m(()=>[d(z($e))]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),256))]),_:1}),d(C,{style:{margin:"10px"},total:6,showPageNumber:"",showPageSize:!1}),d(E,{"active-key":n.activeKey,onChange:i[0]||(i[0]=O=>{n.activeKey=O})},{default:m(()=>[(N(),B(D,{key:1,title:"LOSEHU 117"})),(N(),B(D,{key:2,title:"LOSEHU 118+"}))]),_:1},8,["active-key"]),rt,ot,d(h,null,{default:m(()=>[d(g,{onClick:f},{default:m(()=>[K("\u9009\u62E9\u56FE\u7247")]),_:1}),d(g,{type:"primary",disabled:!n.binaryFile,onClick:c},{default:m(()=>[K("\u5199\u5165")]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["loading"])]),_:1})]),_:1})])}}});const jt=ue(it,[["__scopeId","data-v-59e331d7"]]);export{jt as default};