k5web/assets/index.93b45e0a.js
2024-10-11 17:19:39 +08:00

41 lines
21 KiB
JavaScript

import{m as ze,f as X,i as Ke,b as se,a3 as Le,k as te,a2 as Ue,g as ae,U as Xe,ar as Ye,e as He,c as Je,n as pe,l as We,w as ke,t as qe,ad as Ge,_ as Qe}from"./index.9d6da31d.js";/* empty css *//* empty css *//* empty css */import{j as $,c as N,d as ne,i as Ze,r as ce,a as et,aI as y,aV as Ne,n as tt,t as he,w as be,o as Me,b as at,p as nt,bI as rt,bS as ot,C as W,D as q,aH as z,G as Q,aK as ye,aJ as _e,F as lt,aM as G,aN as ee,b8 as it,bi as ut,bK as st,bO as ct,bm as vt,bn as dt}from"./arco.9755215d.js";import{f as ft}from"./vue.e23f7fca.js";import{e as mt,b as gt,g as pt}from"./serial.c6b76da8.js";import{T as ht,I as bt}from"./index.f3cc6098.js";import{l as we,b as yt}from"./index.3871c524.js";import"./chart.e5f26fc3.js";/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var _t={disabled:{type:Boolean,default:void 0},inputNumberProps:{type:[Boolean,Object],default:!1},label:{type:[String,Boolean,Function],default:!0},layout:{type:String,default:"horizontal",validator:function(e){return e?["vertical","horizontal"].includes(e):!0}},marks:{type:[Object,Array]},max:{type:Number,default:100},min:{type:Number,default:0},range:Boolean,showStep:Boolean,step:{type:Number,default:1},tooltipProps:{type:Object},value:{type:[Number,Array],default:void 0},modelValue:{type:[Number,Array],default:void 0},defaultValue:{type:[Number,Array],default:0},onChange:Function,onChangeEnd:Function};/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var ie=function(e,t){return t?{top:"calc(".concat(100-e,"% - 1px)")}:{left:"".concat(e,"%")}},Pe=function(e,t){return t==="first"?e instanceof Array?e[0]:e:e instanceof Array?e[1]:0},wt=function(e,t){if(Boolean(e)===!1)return String(t);if(ze(e)){var n=String(t);try{var O=/\${value}%/g,p=O.test(e);if(p)n=e.replace(O,String(t));else throw n=e,new Error}catch{console.warn("fail to parse label prop, please pass string such as '${value}%'")}return n}return e};/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/function Se(v,e){var t=Object.keys(v);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(v);e&&(n=n.filter(function(O){return Object.getOwnPropertyDescriptor(v,O).enumerable})),t.push.apply(t,n)}return t}function H(v){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Se(Object(t),!0).forEach(function(n){X(v,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(t)):Se(Object(t)).forEach(function(n){Object.defineProperty(v,n,Object.getOwnPropertyDescriptor(t,n))})}return v}var Pt={visible:!1,trigger:"hover",showArrow:!0,overlayInnerStyle:void 0,overlayClassName:void 0,attach:"body",theme:"default"},St=function(e){var t=$(),n=N({get:function(){return!!e.value.tooltipProps},set:function(M){return M}}),O=$(H({},Pt)),p=function(M){!n.value||(O.value.visible=M)},P=Ke(),S=N(function(){var _=e.value,M=_.vertical,l=_.tooltipProps,r=_.label,s=_.value,a=_.position,i=_.range,c=M?"right":"top",d=function(){return r===!0?String(s):typeof r=="string"?wt(r,s):P("label",{params:i?{value:s,position:a}:{value:s}})}();return l instanceof Object?(l!=null&&l.placement||(O.value.placement=c),l.content&&(d=l.content),H(H(H({},O.value),l),{},{content:d})):H(H({},O.value),{},{placement:c,content:d})});return{tooltipRef:t,tooltipProps:S,toggleTooltip:p,showTooltip:n}};/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var Ee=Symbol("sliderProps");/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var ue=ne({name:"TSliderButton",props:{value:{type:[Number],default:0},vertical:{type:Boolean,default:!1},tooltipProps:{type:[Boolean,Object],default:!0},label:{type:[String,Boolean,Function]},range:{type:Boolean,default:!1},position:{type:String}},emits:["input","mouseup"],setup:function(e,t){var n=se("slider__button"),O=N(function(){return e}),p=St(O),P=p.tooltipRef,S=p.tooltipProps,_=p.toggleTooltip,M=p.showTooltip,l=Ze(Ee),r=$(),s=$(!1),a=ce({dragging:!1,isClick:!1,startX:0,startY:0,startPos:0,newPos:null}),i=N(function(){return Number(l.max)-Number(l.min)}),c=N(function(){return"".concat((e.value-l.min)/i.value*100,"%")}),d=N(function(){return l.step}),u=N(function(){return e.vertical?{bottom:c.value}:{left:c.value}});et(function(){l.toggleDragging(a.dragging)});var b=function(j){var w=j;if(!(w===null||Number.isNaN(w))){w>100?w=100:w<0&&(w=0);var T=100*d.value/i.value,K=Math.round(w/T),I=K*T*i.value*.01;I+=l.min,I=Number(parseFloat("".concat(I)).toFixed(l.precision)),t.emit("input",I),tt(function(){var A,F;P.value&&((A=(F=P.value).updatePopper)===null||A===void 0||A.call(F))})}},C=function(){r.value.focus(),_(!0)},f=function(){a.dragging||_(!1)},m=function(j){a.dragging=!0,a.isClick=!0;var w=j.type,T=j.clientY,K=j.clientX;if(w==="touchstart"){var I=j.touches,A=[I[0].clientY,I[0].clientX];T=A[0],K=A[1]}e.vertical?a.startY=T:a.startX=K,a.startPos=parseFloat(c.value),a.newPos=a.startPos},D=function(j){var w=j;if(!!a.dragging){s.value=!0,a.isClick=!1,l!=null&&l.resetSize&&Le(l==null?void 0:l.resetSize)&&l.resetSize();var T=0,K=l.sliderSize;e.vertical?T=a.startY-w.clientY:T=w.clientX-a.startX,T=T/K*100,a.newPos=a.startPos+T,b(a.newPos)}},k=function(){a.dragging&&(setTimeout(function(){a.dragging=!1,_(!1),a.isClick||b(a.newPos),s.value&&t.emit("mouseup"),s.value=!1},0),window.removeEventListener("mousemove",D),window.removeEventListener("touchmove",D),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("contextmenu",k))};function L(E){l.disabled||(E.preventDefault(),m(E),window.addEventListener("mousemove",D),window.addEventListener("mouseup",k),window.addEventListener("touchmove",D),window.addEventListener("touchend",k),window.addEventListener("contextmenu",k))}var U=function(j){if(!l.disabled){var w=d.value/i.value*100;j==="sub"&&(w=-w),a.newPos=parseFloat(c.value)+w,b(a.newPos)}},re=function(j){var w=j.code;j.preventDefault(),(w==="ArrowDown"||w==="ArrowLeft")&&U("sub"),(w==="ArrowUp"||w==="ArrowRight")&&U("add")};return t.expose({setPosition:b}),function(){return y("div",{ref:r,class:"".concat(n.value,"-wrapper"),style:u.value,tabindex:"0","show-tooltip":M.value,disabled:l.disabled,onmouseenter:C,onmouseleave:f,onmousedown:L,onTouchstart:L,onfocus:C,onblur:f,onKeydown:re},[y(ht,Ne({ref:P,hideEmptyPopup:!0,disabled:!M.value},S.value),{default:function(){return[y("div",{class:[n.value,X({},"".concat(n.value,"--dragging"),a.dragging)]},null)]}})])}}});/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var xt=ne({name:"TSliderMark",props:{mark:{type:[Object,Array,String,Number]},point:{type:Number},onClickMarkPoint:{type:Function,default:function(){}}},setup:function(e){var t=se("slider__mark"),n=function(p){var P;p.stopPropagation(),e==null||(P=e.onClickMarkPoint)===null||P===void 0||P.call(e,e.point)};return function(){return y("div",{class:"".concat(t.value,"-text"),onClick:n},[e.mark])}}});/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var Ot=function(e){var t=e.value.prefixName,n=N(function(){var p=e.value;if(!p.marks)return[];var P=[];if(te(p.marks)){var S=Ue(p.marks).sort(function(l,r){return l-r}),_=Math.max.apply(Math,ae(S).concat([p.max])),M=Math.min.apply(Math,ae(S).concat([p.min]));M<p.min&&we.errorOnce("TSlider","marks min value should >= props min"),_>p.max&&we.errorOnce("TSlider","marks max value should <= props max"),S.forEach(function(l){P.push({point:l,position:(l-M)/(_-M)*100,mark:l})})}else Object.keys(p.marks).map(parseFloat).sort(function(l,r){return l-r}).filter(function(l){return l<=p.max&&l>=p.min}).forEach(function(l){var r={point:l,position:(l-p.min)*100/(p.max-p.min),mark:p.marks[l]};P.push(r)});return P}),O=function(P){return n.value.length?y("div",null,[y("div",{class:"".concat(t,"__stops")},[n.value.map(function(S,_){return S.position===0||S.position===100?null:y("div",{class:"".concat(t,"__stop ").concat(t,"__mark-stop"),style:ie(S.position,e.value.vertical),key:_},null)})]),y("div",{class:"".concat(t,"__mark")},[n.value.map(function(S,_){return y(xt,{mark:S.mark,point:S.point,key:_,style:ie(S.position,e.value.vertical),onClickMarkPoint:P},null)})])]):null};return O};/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/function xe(v,e){var t=Object.keys(v);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(v);e&&(n=n.filter(function(O){return Object.getOwnPropertyDescriptor(v,O).enumerable})),t.push.apply(t,n)}return t}function Oe(v){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xe(Object(t),!0).forEach(function(n){X(v,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(t)):xe(Object(t)).forEach(function(n){Object.defineProperty(v,n,Object.getOwnPropertyDescriptor(t,n))})}return v}var Ct=function(e){var t=e.value.prefixName,n=N(function(){var P,S={format:void 0,placeholder:"",theme:"column",decimalPlaces:((P=e.value.step.toString().split(".")[1])===null||P===void 0?void 0:P.length)||0},_=e.value;if(!Xe(_.inputNumberProps)){var M,l=(M=_.inputNumberProps)===null||M===void 0?void 0:M.theme;S=Oe(Oe({},S),Ye(_.inputNumberProps,"onChange")),["column","row","normal"].includes(l)&&(S.theme=l)}return S}),O=N(function(){return["".concat(t,"__input"),{"is-vertical":e.value.vertical}]}),p=function(S,_){var M=function(r,s){var a,i;r!==void 0&&!isNaN(r)&&_(r),(a=e.value)===null||a===void 0||(a=a.inputNumberProps)===null||a===void 0||(i=a.onChange)===null||i===void 0||i.call(a,r,s)};return y(bt,Ne(n.value,{class:O.value,value:S,step:e.value.step,onChange:M,disabled:e.value.disabled,min:e.value.min,max:e.value.max}),null)};return p};/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/function Ce(v,e){var t=Object.keys(v);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(v);e&&(n=n.filter(function(O){return Object.getOwnPropertyDescriptor(v,O).enumerable})),t.push.apply(t,n)}return t}function kt(v){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ce(Object(t),!0).forEach(function(n){X(v,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach(function(n){Object.defineProperty(v,n,Object.getOwnPropertyDescriptor(t,n))})}return v}var Nt=ne({name:"TSlider",model:{prop:"value",event:"change"},props:kt({},_t),setup:function(e){var t=He(),n=se("slider"),O=Je(),p=O.STATUS,P=he(e),S=P.value,_=P.modelValue,M=yt(S,_,e.defaultValue,e.onChange),l=pe(M,2),r=l[0],s=l[1],a=$(),i=$(),c=$(),d=$(),u=$(Pe(r.value,"first")),b=$(Pe(r.value,"second")),C=$(!1),f=$(1),m=N(function(){return e.layout==="vertical"}),D=N(function(){return["".concat(n.value,"__container"),{"is-vertical":m.value}]}),k=N(function(){return["".concat(n.value),X(X(X({"is-vertical":m.value},"".concat(n.value,"--with-input"),e.inputNumberProps),"".concat(n.value,"--vertical"),m.value),p.value.disabled,t.value)]}),L=N(function(){return["".concat(n.value,"__rail"),{"show-input":e.inputNumberProps,disabled:t.value}]}),U=N(function(){return m.value?{height:"100%"}:{}}),re=N(function(){var h=e.range?"".concat(100*(j.value-e.min)/E.value,"%"):"0%",o=e.range?w.value-j.value:u.value-e.min,g="".concat(100*o/E.value,"%");return m.value?{height:g,bottom:h}:{width:g,left:h}}),E=N(function(){return e.max-e.min}),j=N(function(){return Math.min(u.value,b.value)}),w=N(function(){return Math.max(u.value,b.value)}),T=N(function(){if(!e.showStep||e.min>e.max)return[];if(e.step===0)return console.warn("[Element Warn][Slider]step should not be 0."),[];for(var h=E.value/e.step,o=100*e.step/E.value,g=[],x=1;x<h;x++)g.push(x*o);if(e.range){var V=g.filter(function(R){return R<100*(j.value-e.min)/E.value||e.step>100*(w.value-e.max)/E.value});return V}return g.filter(function(R){return R>100*(u.value-e.min)/E.value})}),K=N(function(){var h=[e.min,e.max,e.step].map(function(o){var g="".concat(o).split(".");return g[1]?g[1].length:0});return Math.max.apply(null,h)}),I=function(o){var g=[e.min,e.max],x=g[0],V=g[1];if(x>V){console.warn("[Slider] max should be greater than min.");return}if(e.range&&te(o)){var R=[Math.min.apply(Math,ae(o)),Math.max.apply(Math,ae(o))],B=R[0],Y=R[1];B>V&&(B=u.value),B<x&&(B=x),Y<x&&(Y=b.value),Y>V&&(Y=V);var ge=[B,Y];return u.value=ge[0],b.value=ge[1],[B,Y]}var J=o;return J<x&&(J=x),J>V&&(J=V),J},A=function(o){var g=o;g===void 0&&(e.range?g=[u.value,b.value]:g=u.value);var x=I(g);s(x)},F=function(){i.value&&(f.value=i.value["client".concat(m.value?"Height":"Width")])},de=$(!1),fe=function(){var o;e.range?(te(r.value)?(u.value=Math.max(e.min||0,r.value[0]),b.value=Math.min(e.max||100,r.value[1])):(u.value=e.min||0,b.value=e.max||100),o="".concat(u.value,"-").concat(b.value)):(We(r.value)?u.value=Math.min(e.max,Math.max(e.min,r.value)):u.value=e.min,o=String(u.value)),a.value&&a.value.setAttribute("aria-valuetext",o),F(),window.addEventListener("resize",F)},oe=function(o){var g=o*E.value/100;if(g=e.min+g,!e.range&&c.value){c.value.setPosition(o);return}var x;Math.abs(j.value-g)<Math.abs(w.value-g)?x=u.value<b.value?"button1":"button2":x=u.value>b.value?"button1":"button2",x==="button1"&&c.value&&c.value.setPosition(o),x==="button2"&&d.value&&d.value.setPosition(o)},Z=function(){var o=e.range?[u.value,b.value]:u.value;return I(o)},je=function(o){var g;if(!(t.value||C.value)&&!!i.value){F();var x=0;if(m.value){var V=i.value.getBoundingClientRect().bottom;x=(V-o.clientY)/f.value*100,oe(x)}else{var R=i.value.getBoundingClientRect().left;x=(o.clientX-R)/f.value*100,oe(x)}var B=Z();(g=e.onChangeEnd)===null||g===void 0||g.call(e,B)}},De=function(o){var g;if(!(t.value||C.value)){F();var x=Number(o/E.value*100);oe(x),A(o);var V=Z();(g=e.onChangeEnd)===null||g===void 0||g.call(e,V)}};be(function(){return r.value},function(h){if(C.value!==!0)if(te(h)&&e.range){var o=pe(h,2);u.value=o[0],b.value=o[1]}else u.value=h}),be([u,b,C],function(h,o){h[0]!==o[0]&&(e.range?A([j.value,w.value]):A(u.value)),h[1]!==o[1]&&e.range&&A([j.value,w.value]),h[2]!==o[2]&&h[2]===!1&&fe()}),Me(function(){fe(),de.value=!0}),at(function(){window.removeEventListener("resize",F)});var Ie=N(function(){return{max:e.max,min:e.min,marks:e.marks,vertical:m.value,prefixName:n.value}}),Ve=Ot(Ie),Te=N(function(){return{max:e.max,min:e.min,inputNumberProps:e.inputNumberProps,step:e.step,prefixName:n.value,vertical:m.value,disabled:t.value}}),me=Ct(Te),$e=function(){var o=I(u.value),g=function(B){u.value=I(B)},x=I(b.value),V=function(B){b.value=I(B)};return y("div",{class:["".concat(n.value,"__input-container"),{"is-vertical":m.value}]},[me(o,g),e.range&&y("div",{class:"".concat(n.value,"__center-line")},null),e.range&&me(x,V)])},Be=function(o){C.value=o},le=he(e),Ae=le.min,Re=le.max,Fe=le.step;return nt(Ee,ce({min:Ae,max:Re,step:Fe,dragging:C,toggleDragging:Be,precision:K,disabled:t,resetSize:F,sliderSize:f})),function(){return y("div",{class:D.value,ref:a},[y("div",{class:k.value,role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-orientation":e.layout,"aria-disabled":t.value,"tooltip-props":e.tooltipProps},[y("div",{class:L.value,style:U.value,onClick:je,ref:i},[y("div",{class:"".concat(n.value,"__track"),style:re.value},null),y(ue,{vertical:m.value,value:u.value,ref:c,disabled:t.value,range:e.range,position:"start","tooltip-props":e.tooltipProps,label:e.label,onInput:function(o){u.value=o},onMouseup:function(){var o,g=Z();(o=e.onChangeEnd)===null||o===void 0||o.call(e,g)}},null),e.range&&y(ue,{vertical:m.value,value:b.value,ref:d,disabled:t.value,label:e.label,range:e.range,position:"end","tooltip-props":e.tooltipProps,onInput:function(o){b.value=o},onMouseup:function(){var o,g=Z();(o=e.onChangeEnd)===null||o===void 0||o.call(e,g)}},null),e.showStep&&y("div",{class:"".concat(n.value,"__stops")},[T.value.map(function(h,o){return h.position===0||h.position===100?null:y("div",{class:"".concat(n.value,"__stop"),key:o,style:ie(h,m.value)},null)})]),Ve(De)])]),de.value&&e.inputNumberProps&&$e()])}}});/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var Mt=ke(Nt);ke(ue);const ve=v=>(vt("data-v-dc47d6dc"),v=v(),dt(),v),Et={class:"container"},jt=ve(()=>Q("div",{id:"canvasDiv",style:{zoom:"250%",display:"none"}},null,-1)),Dt={style:{padding:"0",margin:"0","border-spacing":"0"}},It=["onMousedown","onMouseover"],Vt=ve(()=>Q("br",null,null,-1)),Tt=ve(()=>Q("br",null,null,-1)),$t={name:"Backup"},Bt=ne({...$t,setup(v){const e=qe(),t=ce({binaryFile:void 0,loading:!1,matrix:[],mousedown:!1,threshold:128,cache:void 0}),n=ft();Me(async()=>{if(n.query.url){const r=await fetch(n.query.url,{responseType:"blob"});P(window.URL.createObjectURL(await r.blob()))}});const O=()=>{const r=t.matrix;r.map((s,a)=>{s.map((i,c)=>{r[a][c]=i=="#fff"?"#000":"#fff"})}),t.matrix=r},p=(r,s)=>{if(t.mousedown){const a=t.matrix;a[s][r]=t.matrix[s][r]=="#fff"?"#000":"#fff",t.matrix=a}},P=r=>{const s=document.createElement("canvas");s.width=128,s.height=64;const a=s.cloneNode(),i=document.getElementById("canvasDiv");i.innerHTML="",i==null||i.append(s,a);const c=new Image;c.src=r,c.onload=()=>{const d=s.getContext("2d");d==null||d.drawImage(c,0,0,128,64);const u=d==null?void 0:d.getImageData(0,0,s.width,s.height).data;t.cache=u;function b(f,m){const k=(m*128+f)*4;return u[k]+u[k+1]+u[k+2]>t.threshold*3?0:1}const C=[];for(let f=0;f<64;f++){C.push([]),C[f]=[];for(let m=0;m<128;m++){const D=!b(m,f);C[f][m]=D?"#fff":"#000"}}t.matrix=C}},S=()=>{const r=document.createElement("input");r.type="file",r.onchange=async()=>{const s=new Blob([r.files[0]],{type:"application/octet-stream"}),a=URL.createObjectURL(s),i=document.createElement("canvas");i.width=128,i.height=64;const c=new Image;c.src=a,c.onload=()=>{const d=i.getContext("2d");d==null||d.drawImage(c,0,0,128,64);const u=d==null?void 0:d.getImageData(0,0,i.width,i.height).data;t.cache=u;function b(f,m){const k=(m*128+f)*4;return u[k]+u[k+1]+u[k+2]>t.threshold*3?0:1}const C=[];for(let f=0;f<64;f++){C.push([]),C[f]=[];for(let m=0;m<128;m++){const D=!b(m,f);C[f][m]=D?"#fff":"#000"}}t.matrix=C}},r.click()},_=async()=>{const r=t.matrix,s=document.createElement("canvas");s.width=128,s.height=64;const a=s.getContext("2d");a&&(a.fillStyle="#fff",a.fillRect(0,0,s.width,s.height),a.fillStyle="#000");for(let c=0;c<64;c++)for(let d=0;d<128;d++)r[c][d]=="#000"&&(a==null||a.beginPath(),a==null||a.rect(d,c,1,1),a==null||a.fill());const i=document.createElement("a");i.href=s.toDataURL("image/jpeg",1),i.download="image.jpg",i.click()},M=async()=>{var c,d,u,b,C;const r=new Uint8Array(1024);let s=0;for(let f=0;f<64;f+=8)for(let m=0;m<128;m++){let D=0;for(let k=0;k<8;k++)D|=(t.matrix[f+k][m]=="#000"?1:0)<<k;r[s++]=D}if(t.binaryFile=r,e.connectState!=!0){alert(sessionStorage.getItem("noticeConnectK5"));return}if(((c=e.configuration)==null?void 0:c.uart)=="official"){alert(sessionStorage.getItem("noticeVersionNoSupport"));return}if(((d=e.configuration)==null?void 0:d.charset)!="losehu"&&((u=e.configuration)==null?void 0:u.charset)!="gb2312"){alert(sessionStorage.getItem("noticeVersionNoSupport"));return}t.loading=!0;let a=123728;((b=e.configuration)==null?void 0:b.charset)=="gb2312"&&(a=8320),await mt(e.connectPort);const i=t.binaryFile;for(let f=a;f<i.length+a;f+=128)await gt(e.connectPort,f,i.slice(f-a,f-a+128),i.slice(f-a,f-a+128).length,(C=e.configuration)==null?void 0:C.uart);await pt(e.connectPort),t.loading=!1},l=()=>{const r=t.cache;function s(i,c){const u=(c*128+i)*4;return r[u]+r[u+1]+r[u+2]>t.threshold*3?0:1}const a=[];for(let i=0;i<64;i++){a.push([]),a[i]=[];for(let c=0;c<128;c++){const d=!s(c,i);a[i][c]=d?"#fff":"#000"}}t.matrix=a};return(r,s)=>{const a=Ge,i=Mt,c=it,d=ut,u=rt,b=ot,C=st,f=ct;return W(),q("div",Et,[y(a,{items:[r.$t("menu.list"),r.$t("menu.image")]},null,8,["items"]),y(f,{gutter:20,align:"stretch"},{default:z(()=>[y(C,{span:24},{default:z(()=>[y(b,{loading:t.loading,tip:"\u5199\u5165\u4E2D...",style:{width:"100%"}},{default:z(()=>[y(u,{class:"general-card",title:r.$t("menu.image")+r.$t("global.onStart")},{default:z(()=>[jt,Q("div",null,[Q("table",Dt,[(W(!0),q(ye,null,_e(t.matrix,(m,D)=>(W(),q("tr",null,[(W(!0),q(ye,null,_e(m,(k,L)=>(W(),q("td",{onMousedown:U=>{t.mousedown=!0,p(L,D)},onMouseup:s[0]||(s[0]=U=>{t.mousedown=!1}),onMouseover:U=>p(L,D),style:lt("background-color: "+k+"; height: 5px; width: 3.5px;")},null,44,It))),256))]))),256))])]),Vt,G(" \u8272\u5F69\u9608\u503C\uFF1A"),y(i,{modelValue:t.threshold,"onUpdate:modelValue":s[1]||(s[1]=m=>t.threshold=m),max:256,style:{width:"200px"},onChangeEnd:l},null,8,["modelValue"]),Tt,y(d,null,{default:z(()=>[y(c,{onClick:S},{default:z(()=>[G(ee(r.$t("tool.selectImage")),1)]),_:1}),y(c,{disabled:t.matrix.length<64,onClick:O},{default:z(()=>[G(ee(r.$t("image.negative")),1)]),_:1},8,["disabled"]),y(c,{disabled:t.matrix.length<64,onClick:_},{default:z(()=>[G(ee(r.$t("cps.save")),1)]),_:1},8,["disabled"]),y(c,{type:"primary",disabled:t.matrix.length<64,onClick:M},{default:z(()=>[G(ee(r.$t("tool.write")),1)]),_:1},8,["disabled"])]),_:1})]),_:1},8,["title"])]),_:1},8,["loading"])]),_:1})]),_:1})])}}});const Jt=Qe(Bt,[["__scopeId","data-v-dc47d6dc"]]);export{Jt as default};