1import{_ as g}from"./Button.BHbaWVnc.js";import{_ as k,j as w,c as l,w as d,b as e,p as b,t as c,F as u,r as p,f as j,d as m,e as B,o as s,v as V}from"./entry.CPOdO0l9.js";import{b as _}from"./api.B3vmFK6a.js";import{b as I}from"./alert.Dg7w7gGn.js";import"./Spinner.BItXuzjd.js";import"./nuxt-link.BgpVRpwb.js";const C={data(){return{loading:!1,survey:null}},computed:{payload(){return{option_ids:this.survey.questions.map(o=>o.selectedOptionId)}}},methods:{async fetch(){const o=`/survey/${w().params.uuid}`,{data:i,error:a}=await _(o,"get");if(a.value){console.error(a.value);return}this.survey=i},async submit(){this.loading=!0;const o=`/session/${this.survey.id}`,{data:i,error:a}=await _(o,"put",this.payload);if(a.value){this.loading=!1,console.error(a.value);return}this.loading=!1,this.$router.push("/"),I("Anketa je uspješno popunjena")}},created(){this.fetch()}},O={class:"flex flex-col"},z={key:0,class:"w-full max-w-3xl mx-auto sm:px-4 pt-1"},A={class:"text-2xl lg:text-4xl"},D=e("strong",null,"Anketa:",-1),F={class:"font-medium"},N={class:"flex flex-col space-y-6 mt-8"},S={class:"text-lg lg:text-xl"},U={class:"font-medium"},Z={class:"flex flex-col space-y-2 mt-2 pl-4"},M=["id","value","onUpdate:modelValue"],R=["for"],$=e("div",{class:"flex items-center space-x-2 text-gray-600 mt-8 px-4 py-2 w-fit"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"})]),e("p",{class:""},"Popunite sva pitanja kako bi završili anketu")],-1);function E(o,i,a,H,r,f){const h=g,v=B("auto-animate");return s(),l("div",O,[r.survey?d((s(),l("div",z,[e("h1",A,[D,b(),e("span",F,c(r.survey.title),1)]),e("div",N,[(s(!0),l(u,null,p(r.survey.questions,(t,x)=>(s(),l("div",{class:"flex flex-col",key:t.id},[e("h3",S,[e("strong",null,c(x+1)+". ",1),e("span",U,c(t.title),1)]),e("div",Z,[(s(!0),l(u,null,p(t.options,n=>(s(),l("div",{class:"flex items-center space-x-2",key:n.id},[d(e("input",{class:"!accent-red-600 !focus:ring-2 !focus:ring-red-600 focus:ring-offset-2 focus:ring-offset-white",id:n.id,type:"radio",value:n.id,"onUpdate:modelValue":y=>t.selectedOptionId=y},null,8,M),[[V,t.selectedOptionId]]),e("label",{for:n.id},c(n.title),9,R)]))),128))])]))),128))]),$,r.survey.questions.some(t=>!t.selectedOptionId)?m("",!0):(s(),j(h,{key:0,class:"w-36 h-12 mt-6",colorStyle:"zpcg_red/white",loaderColor:"white",text:"Završi anketu",loading:r.loading,onClick:i[0]||(i[0]=t=>f.submit())},null,8,["loading"]))])),[[v]]):m("",!0)])}const Q=k(C,[["render",E]]);export{Q 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.