import{_ as x,r as c,l as o,d as a,g as i,f as t,t as u,F as g,h as w,p as v,a7 as V,a8 as N,j as b,k as _}from"./CbO2oY48.js";import{u as j}from"./Dsf1ir7F.js";const A={class:"poll"},B={key:0},C={class:"answer"},D=["onClick"],$={class:"answer-text"},F=["onUpdate:modelValue"],P={__name:"poll",props:["id"],setup(m){const f=m,r=c({}),d=c([]),l=c(!1),h=async()=>{const s=await _.getjson(`/api/NewApi/GetPoll?id=${f.id}`);r.value=s.poll,d.value=s.answers},y=async s=>{if(l.value)return;const n=await _.posttojson("/api/NewApi/votePoll",{poll:r.value.id,id:s}).then(e=>e,e=>{l.value=!0});d.value=n.answers,l.value=!0},{error:T,pending:k}=j(h,{lazy:!0},"$lapnui833k");return(s,n)=>(o(),a("div",A,[i(k)?v("",!0):(o(),a("div",B,[t("div",null,[t("h3",null,u(i(r).title),1)]),t("div",null,[(o(!0),a(g,null,w(i(d),e=>(o(),a("div",C,[i(l)?v("",!0):(o(),a("input",{key:0,type:"button",onClick:p=>y(e.id)},null,8,D)),t("div",$,[t("div",null,u(e.text),1),t("div",null,[V(t("input",{type:"range","onUpdate:modelValue":p=>e.voted=p,min:"0",max:"100",disabled:""},null,8,F),[[N,e.voted]]),n[0]||(n[0]=b()),t("span",null,u(e.voted)+"%",1)])])]))),256))])]))]))}},E=x(P,[["__scopeId","data-v-d6cbc5a7"]]);export{E as default};