1import{d as T,z as j,o as w,C as I,E as P,h as s,j as u,i as l,Q as D,l as c,F as O,W as U,k as V,m as f,_ as R,r,I as C,T as $,t as a,a8 as z}from"./Bek2-9gr.js";import{u as x,P as G}from"./w8qQDtx-.js";import _ from"./6C6sWmd-.js";import"./DWnc86o8.js";import"./CR6ctf_l.js";import"./Bk8vocE_.js";import"./B_Votc0X.js";import"./Uqmivsi6.js";import"./b4Z8ExeI.js";import"./Bc1X7hlz.js";import"./DNNzIjMz.js";import"./ChUrucZG.js";import"./JkUzTYGi.js";import"./x8L4wEMG.js";const H=["id"],M={key:0,id:"personSelectionLabel",class:"col-span-2 text-primary text-sm font-medium"},Q={key:1,class:"col-span-2 lg:col-span-1 spacing-bottom-outer-m"},W={class:"flex flex-row spacing-gap-xxs items-start"},J={key:2,class:"col-span-2 lg:col-span-1 spacing-bottom-outer-m"},K={class:"col-span-2 lg:col-span-1"},X={class:"col-span-2 flex justify-center"},Y=T({__name:"TariffCalculatorCommodity",props:{blok:{type:Object,required:!0}},setup(t){const n=t,b=j(),d=r(0),m=r(0),v=r(null),k=r(),S=C(()=>n.blok.productCategory==="Gas"),g=r(0),y=C(()=>n.blok.productCategory==="Electricity"),p=r(!1);w(()=>{p.value=!0});const h=async()=>await k.value?.validate(),B=e=>x().calculate(e,h,m.value,n.blok.productCategory,v.value),F=e=>{e&&(m.value=e)},A=e=>{e&&(g.value=e)};return I(()=>g.value,e=>{if(!e||e===0)return;const o=x().calcConsumptionBasedOnLivingArea(e);n.blok.livingAreaInSqmInputField&&n.blok.livingAreaInSqmInputField.length>0&&b.emit(n.blok.livingAreaInSqmInputField[0].fieldName,"update:dependingInput",o)}),I(()=>d.value,e=>{!e||isNaN(e)||b.emit(n.blok.personSelectFieldname??null,"update:dependingInput",e)}),(e,o)=>{const q=R,E=$("editable");return P((a(),s("div",null,[u("form",{id:`${t.blok._uid}`,ref_key:"formElement",ref:v,class:"grid-with-2-cols border rounded border-blue-100 spacing-inner-m form-element",method:"post",novalidate:"",onSubmit:B},[l(y)?(a(),s("label",M,D(t.blok.personSelectionLabel),1)):c("",!0),l(y)?(a(),s("div",Q,[u("div",W,[(a(!0),s(O,null,U(t.blok.personSelects,(i,L)=>(a(),s("div",{key:i._uid,class:"flex-1"},[f(G,{"person-select":i,idx:L,"yearly-consumption":l(m),"init-data":l(p),"person-select-fieldname":t.blok.personSelectFieldname,"model-value":l(d),onUpdateValue:o[0]||(o[0]=N=>d.value=N)},null,8,["person-select","idx","yearly-consumption","init-data","person-select-fieldname","model-value"])]))),128))])])):c("",!0),l(S)?(a(),s("div",J,[t.blok.livingAreaInSqmInputField?.[0]?(a(),V(_,{key:0,blok:t.blok.livingAreaInSqmInputField[0],onUpdateValue:o[1]||(o[1]=i=>A(i))},null,8,["blok"])):c("",!0)])):c("",!0),u("div",K,[f(_,{ref_key:"inputRef",ref:k,blok:t.blok.consumptionInputField[0],"enable-prefilling-always":!0,onUpdateValue:o[2]||(o[2]=i=>F(i))},null,8,["blok"])]),u("div",X,[f(q,{id:"calculateButton",type:"submit",form:`${t.blok._uid}`,label:t.blok.submitButtonText,disabled:!l(p)},null,8,["form","label","disabled"])])],40,H)])),[[E,t.blok]])}}}),pe=Object.assign(z(Y,[["__scopeId","data-v-3b958777"]]),{__name:"TariffCalculatorCommodity"});export{pe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.