import{r as c}from"./request-CEvu378m.js";import{ax as h,r as m,c as p,w as d,j as x,X as V,B as T,z as K,D as o,u as f,W as j}from"./vue-BJk78QHK.js";import{_ as B}from"./index-M_JNBppB.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const O={id:"wrapper"},k={id:"termometer"},w=["data-value"],I=Object.assign({name:"Temperature"},{__name:"Temperature",props:{propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})}},setup(v){const e=v,l=h(),a=m(null),g=m(null),t=p(()=>e.propValue.config),_=p(()=>t.value?`${(t.value.value-t.value.minTemp)/(t.value.maxTemp-t.value.minTemp)*100}%`:"0%"),b=p(()=>t.value?t.value.value+t.value.units[t.value.unit]:"");return d(()=>e.propValue,()=>{setTimeout(()=>{},100)},{deep:!0}),x(()=>{var s,r;e.request&&(a.value=c(e.request,e.propValue.config,"value")),((r=(s=e.request)==null?void 0:s.global)==null?void 0:r.length)>0&&d(()=>l.state.globalKey,()=>{e.request.global.forEach(y=>{const n=l.state.globalKey.findIndex(u=>u.globalKey===y);if(n>-1){const u=[l.state.globalKey[n].globalKey,l.state.globalKey[n].globalValue],i=e.request.data.findIndex(q=>q[0]===u[0]);i>-1?e.request.data[i][1]=u[1]:e.request.data.push(u)}}),a.value&&a.value(),a.value=c(e.request,e.propValue.config,"value")},{deep:!0})}),V(()=>{e.request&&a.value&&a.value()}),(s,r)=>(K(),T("div",null,[o("div",O,[o("div",k,[o("div",{id:"temperature",ref_key:"temperature",ref:g,style:j({"--my-color":"#fff",height:f(_)}),"data-value":f(b)},null,12,w),r[0]||(r[0]=o("div",{id:"graduations"},null,-1))])])]))}}),N=B(I,[["__scopeId","data-v-ee68b72c"]]);export{N as default};
