import{B as M,r as u,E as F,m as e,w as t,K as N,t as i,q as f,M as _,H as r,I as l,J as o,$ as a,G as h,R as v}from"./index-Cp3-A7ao.js";import{b as V,V as y,f as p,e as C}from"./VCard-D5wKeDng.js";import{V as q}from"./VTextField-D20FHtqI.js";import{n as x}from"./transition-BAtvBeuS.js";import{a as k}from"./VBtn-DJBHxlTa.js";import"./VImg-tOz2PgiP.js";import"./index-DkrqsE6v.js";import"./VInput-BVhPJyoq.js";import"./forwardRefs-o1fhiqtU.js";import"./VProgressCircular-DvjORuMu.js";import"./resizeObserver-BoHHG32A.js";const A={class:"my-2"},P=M({__name:"Forecast",setup(D){const c=u(!1),m=u(!1),n=u(""),d=u(10),w=async function(){c.value=!0;try{const s=await v.createModel(d.value);n.value=a("settings.forecast_r2score")+" "+s.data.r2.toFixed(2)}catch{n.value=a("settings.forecast_create_model_error")}finally{c.value=!1}},B=[s=>!!s||a("settings.forecast_field_required"),s=>!!s&&s>2||a("settings.forecast_value_too_small")],T=async()=>{m.value=!0,await v.tuneModel(),m.value=!1};return(s,g)=>(i(),F(N,null,[e(V,{class:"elevation-2 ma-4 max-w-sm"},{default:t(()=>[e(y,null,{default:t(()=>[r(l(o(a)("settings.forecast_create_model")),1)]),_:1}),e(p,null,{default:t(()=>[h("div",A,l(o(a)("settings.forecast_create_model_text")),1),e(q,{modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=b=>d.value=b),label:"Anzahl Tage","single-line":"",type:"number",rules:B},null,8,["modelValue"]),c.value?(i(),f(x,{key:0,indeterminate:"",class:"ma-2"})):_("",!0)]),_:1}),n.value!=""?(i(),f(p,{key:0},{default:t(()=>[r(l(n.value),1)]),_:1})):_("",!0),e(C,null,{default:t(()=>[e(k,{class:"ma-2",onClick:w},{default:t(()=>[r(l(o(a)("settings.forecast_create")),1)]),_:1})]),_:1})]),_:1}),e(V,{class:"elevation-2 ma-4 max-w-sm"},{default:t(()=>[e(y,null,{default:t(()=>[r(l(o(a)("settings.forecast_tune_model")),1)]),_:1}),e(p,null,{default:t(()=>[r(l(o(a)("settings.forecast_tune_model_text"))+" ",1),m.value?(i(),f(x,{key:0,indeterminate:"",class:"ma-2"})):_("",!0)]),_:1}),e(C,null,{default:t(()=>[e(k,{class:"ma-2",onClick:T},{default:t(()=>[r(l(o(a)("settings.forecast_tune")),1)]),_:1})]),_:1})]),_:1})],64))}});export{P as default};
