import{E as e,N as t,O as n,Q as r,Rt as i,S as a,T as o,_t as s,b as c,dt as l,ft as u,kt as d,n as f,q as p,x as m,y as h}from"./vue-i18n-Bp4YYb-2.js";import{Br as g,C as _,F as v,Lt as y,Pi as b,br as x,ca as S,ir as C,sr as w,ya as T}from"./index-BOiiIZox.js";import{t as E}from"./NewFunction-CVNaFWi_.js";var D={class:`flex flex-col justify-between min-w-96 w-[40vw] min-h-max h-[40vh]`},O={class:`flex flex-col gap-y-4`},k={class:`text-xl text-center underline`},A={class:`w-full text-lg`},j={class:`font-bold`},M={class:`flex flex-row justify-between mt-4`},N=n({__name:`Summary`,props:{newFunction:{}},emits:[`nextStep`,`close`],setup(n,{emit:d}){let m=n,b=d,E=t(`emitter`),{t:N}=f(),P=y(),F=C(),I=w(),L=T(),R=()=>{let e=F.functions.findIndex(e=>e.uid===m.newFunction.uid);if(e===-1){console.error(`Function not found for removal: `+m.newFunction.name);return}m.newFunction.uid!==`0`&&F.functions.splice(e,1)},z=async()=>{if(F.functions.push(m.newFunction),await F.saveFunction(m.newFunction.uid))E.emit(`function-add-menu`,{functionUID:m.newFunction.uid});else{R(),console.error(`Function could not be saved.`);return}I.add({severity:`success`,summary:N(`common.success`),detail:N(`views.functions.createFunction`),life:3e3}),b(`close`),await L.push({name:`functions`,params:{functionUID:m.newFunction.uid},query:{key:S()}})};return(t,n)=>{let d=r(`tooltip`);return p(),a(`div`,D,[h(`div`,O,[h(`span`,k,s(i(N)(`components.wizards.fanControl.summary`)),1),h(`div`,A,[h(`p`,null,[o(s(i(N)(`views.functions.newFunction`))+`: `,1),h(`span`,j,s(m.newFunction.name),1),n[1]||(n[1]=h(`br`,null,null,-1)),o(` `+s(i(N)(`components.wizards.profile.willCreated`)),1)])])]),h(`div`,M,[e(i(v),{class:`w-24 bg-bg-one`,label:`Back`,onClick:n[0]||(n[0]=e=>b(`nextStep`,11))},{default:l(()=>[e(i(_),{class:`outline-0`,type:`mdi`,path:i(x),size:i(P).getREMSize(1.5)},null,8,[`path`,`size`])]),_:1}),u((p(),c(i(v),{class:`bg-accent/80 hover:!bg-accent w-32`,label:i(N)(`common.apply`),onClick:z},{default:l(()=>[e(i(_),{class:`outline-0`,type:`mdi`,path:i(g),size:i(P).getREMSize(1.5)},null,8,[`path`,`size`])]),_:1},8,[`label`])),[[d,i(N)(`views.speed.applySetting`),void 0,{top:!0}]])])])}}}),P=n({__name:`Wizard`,setup(e){let n=t(`dialogRef`),r=()=>{n.value.close()},a=d(11),o=d();return(e,t)=>a.value===11?(p(),c(E,{key:0,onNextStep:t[0]||(t[0]=e=>a.value=e),onNewFunction:t[1]||(t[1]=e=>o.value=e),onClose:r,"function-name":``,"new-function":o.value},null,8,[`new-function`])):a.value===13?(p(),c(N,{key:1,onNextStep:t[2]||(t[2]=e=>a.value=e),onClose:r,"new-function":o.value??i(b).createDefault()},null,8,[`new-function`])):m(``,!0)}});export{P as default};