import{v as V,ak as j,_ as B}from"./index.b6739c82.js";/* empty css *//* empty css *//* empty css */import{d as C,r as E,w as O,o as U,bT as $,bI as I,C as u,D as h,aI as r,aH as i,u as T,G as H,aM as f,aN as v,aK as x,aJ as y,aE as k,bU as J,a$ as R,bJ as F,bL as G}from"./arco.7f845a67.js";import{g as Y}from"./vue.0bef8fc5.js";import{u as q}from"./loading.1a4e75f4.js";import{L as A}from"./index.fd74ba5c.js";import{S as K}from"./index.959dad5e.js";import"./chart.95d38b48.js";import"./useConfig.5840ccf9.js";import"./useDisabled.86718829.js";import"./helper.20cd41f2.js";import"./slot.39309d60.js";const z={class:"container"},P={name:"DIY"},Q=C({...P,setup(W){const M=Y(),{t:S}=V.exports.useI18n(),N=()=>{M.push({path:"/tool/flash",query:{url:"https://k5.vicicode.com/diyapi/LOSEHU"+t.flag.join("")+".bin?v="+new Date().getTime()}})},t=E({versions:[],flag:[],disMatrix:[],disName:[],showSort:[]});O(()=>[...t.flag],()=>{w()});const w=()=>{t.flag.map((a,o)=>{t.disMatrix[o].forEach((l,n)=>{t.versions.indexOf("LOSEHU"+t.flag.join("").substring(0,o)+n+t.flag.join("").substring(o+1)+".bin")==-1?t.disMatrix[o].set(n,!0):t.disMatrix[o].set(n,!1)})})},{loading:L,setLoading:b}=q(!0);return U(async()=>{b(!0);let a=await(await fetch("https://k5.vicicode.com/diyapi/function.json?v="+new Date().getTime())).text();a=JSON.parse(a);let o=[],l=[];a.map(e=>{o[e[e.length-1]-1]=e,l.push(e[e.length-1]-1)}),a=o;let n=[],p=[];a.map(e=>{let _=new Map,c=new Map;for(let s=e[0]*2+1;s[r(s,{span:24},{default:i(()=>[r(c,{class:"general-card",title:a.$t("idea.diy"),loading:T(L)},{default:i(()=>[r(_,{direction:"vertical"},{default:i(()=>[H("div",null,[f(v(a.$t("oi")),1),r(n,{theme:"primary",href:"https://github.com/losehu/uv-k5-firmware-custom",target:"_blank"},{default:i(()=>[f("https://github.com/losehu/uv-k5-firmware-custom")]),_:1})]),(u(!0),h(x,null,y(t.showSort,m=>(u(),k(g,{modelValue:t.flag[m],"onUpdate:modelValue":d=>t.flag[m]=d,type:"button"},{default:i(()=>[(u(!0),h(x,null,y(t.disMatrix[m],d=>(u(),k(p,{value:d[0],disabled:d[1]},{default:i(()=>[f(v(t.disName[m].get(d[0])),1)]),_:2},1032,["value","disabled"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"]))),256)),r(e,{type:"primary",onClick:N},{default:i(()=>[f(v(a.$t("diy.generate")),1)]),_:1})]),_:1})]),_:1},8,["title","loading"])]),_:1})]),_:1})])}}});const pt=B(Q,[["__scopeId","data-v-9368fb4d"]]);export{pt as default};