import{_ as B,i as _,r as c,m as d,d as f,w as s,f as r,e as V,g as o,H as w,c as L,F as R,y as z,j as b,t as y,an as D,ao as G,K as g}from"./index-BV0H45HW.js";import"./index-BtHEBb5f.js";import{B as Z}from"./index-CBHeC2k-.js";import{C as j}from"./index-BRaRnE7I.js";import{C as q,a as E}from"./index-9VbXUHTy.js";import{C as H}from"./index-B7M1Z4gS.js";import"./index-mmkJMJwV.js";import{F as I}from"./index-DV1z_BeD.js";const K={class:"button-container"},T={__name:"index",setup(U){const l=_.global.t;let i=c([]),v=c(null),n=c([]),m=c(!1),p;async function x(){let e=(await D()).capabilities;i.value=e.map(t=>({name:t.name,labelZh:t.zhName})),n.value=e.filter(t=>t.enabled).map(t=>t.name)}async function h(){m.value=!0;let u=i.value.map(e=>({name:e.name,enabled:n.value.includes(e.name)}));try{await G({capabilities:u}),p=g({type:"success",message:l("factorySet.submitSuccess"),className:"bottom-notify",position:"bottom"})}catch{p=g({type:"danger",message:l("factorySet.submitFailed"),className:"bottom-notify",position:"bottom"})}m.value=!1}return x(),(u,e)=>{const t=E,k=H,C=q,S=j,N=Z,F=I;return f(),d(F,{ref_key:"formRef",ref:v},{default:s(()=>[r(S,{title:o(l)("factorySet.functionList"),inset:""},{default:s(()=>[r(C,{modelValue:o(n),"onUpdate:modelValue":e[0]||(e[0]=a=>w(n)?n.value=a:n=a),shape:"square"},{default:s(()=>[(f(!0),L(R,null,z(o(i),a=>(f(),d(k,{key:a.name},{default:s(()=>[r(t,{name:a.name},{default:s(()=>[b(y(o(_).global.locale==="zh_CN"?a.labelZh:a.name),1)]),_:2},1032,["name"])]),_:2},1024))),128))]),_:1},8,["modelValue"])]),_:1},8,["title"]),V("div",K,[r(N,{round:"",block:"",type:"primary","native-type":"submit",class:"confirm-button",onClick:h,loading:o(m),"loading-text":o(l)("factorySet.submitting")},{default:s(()=>[b(y(o(l)("factorySet.submit")),1)]),_:1},8,["loading","loading-text"])])]),_:1},512)}}},Y=B(T,[["__scopeId","data-v-dce97e42"]]);export{Y as default};
