1import I from"./Icon.v1Pl6JOI.js";import{_ as B}from"./nuxt-link.tqsGShdE.js";import{_ as C,a as j,b as Q}from"./index.cGvxROQl.js";import{f as F,r as i,j as U,o as x,c as v,a as e,q as V,v as W,h as o,s as D,l as E,x as L,_ as P,m as z,b as s,w as A,t as M,k as Y,p as J,e as O}from"./entry.YJk1JGxv.js";import{a as G,b as H}from"./useUtils.MFa5ei-n.js";import"./index.lSDm5iYo.js";const K={class:"mx-10 my-4 p-4 border"},X=e("h2",{class:"mb-2 text-sm text-slate-500"}," Your answer: ",-1),Z={class:"flex items-center justify-between py-2"},ee=["disabled"],te={key:1},se={__name:"TextInput",props:{questionId:Number,taskId:String,category:String,gpt4:Boolean},emits:["send-result","typing-started","submit-clicked"],setup(d,{emit:_}){const{account:h}=F(),b=_,r=d,t=i(null),u=i(!1),p=i(!1),w=()=>{!p.value&&t.value&&t.value.trim().length>0&&(p.value=!0,b("typing-started"))},f=()=>{p.value};U(()=>r.questionId,()=>{p.value=!1,t.value=null});async function y(){b("submit-clicked"),u.value=!0;const g=`${r.category}${r.taskId}`,m=H+"toefl/writting";try{const c=await h.createJWT(),a={questionId:r.questionId,questionType:g,answer:t.value,gpt4:r.gpt4},l=(await G.post(m,a,{headers:{Authorization:`Bearer ${c.jwt}`}})).data.completion;b("send-result",l)}catch(c){alert("Network error, please try again"),console.error("Error fetching data:",c.response.data.detail)}finally{u.value=!1}}return(g,m)=>{const c=I;return x(),v("div",null,[e("form",{onSubmit:L(y,["prevent"])},[e("div",K,[X,V(e("textarea",{rows:"4","onUpdate:modelValue":m[0]||(m[0]=a=>D(t)?t.value=a:null),required:"",onInput:w,onFocus:f,class:"block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500",placeholder:"Write your thoughts here..."},` 2 `,544),[[W,o(t)]]),e("div",Z,[e("button",{disabled:o(u),type:"submit",class:"m-1 text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 inline-flex items-center"},[o(u)?(x(),E(c,{key:0,name:"mdi:loading",class:"w-5 h-5 text-white animate-spin"})):(x(),v("span",te," Submit "))],8,ee)])])],32)])}}},n=d=>(J("data-v-e7e7f2b1"),d=d(),O(),d),oe={class:"min-h-screen bg-gradient-to-br from-blue-50 via-indigo-50 to-purple-100"},ne=n(()=>e("div",{class:"absolute inset-0 bg-white opacity-40"},null,-1)),ie=n(()=>e("div",{class:"absolute inset-0 bg-gradient-to-r from-blue-100/30 to-purple-100/30"},null,-1)),ae=n(()=>e("div",{class:"absolute top-20 left-10 w-72 h-72 bg-blue-200 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-blob"},null,-1)),le=n(()=>e("div",{class:"absolute top-40 right-10 w-72 h-72 bg-purple-200 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-blob animation-delay-2000"},null,-1)),re={class:"relative z-10 max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-6"},ce={class:"mb-8"},de=n(()=>e("span",{class:"font-medium"},"Back to Dashboard",-1)),ue={class:"flex items-center justify-between"},pe={class:"flex items-center space-x-4"},me={class:"w-16 h-16 bg-gradient-to-br from-green-500 to-teal-600 rounded-2xl flex items-center justify-center shadow-lg"},_e={class:"text-3xl font-bold text-gray-900 mb-1"},he={class:"text-gray-600 flex items-center space-x-2"},be=n(()=>e("span",null,"TOEFL Writing Practice",-1)),fe={class:"flex items-center space-x-4"},ge=n(()=>e("span",null,"New Question",-1)),xe={class:"grid lg:grid-cols-1 gap-8"},ve={class:"space-y-6"},we={class:"bg-white/90 backdrop-blur-sm rounded-2xl border border-gray-100 shadow-lg overflow-hidden"},ye={class:"p-6 space-y-6"},ke=n(()=>e("div",{class:"border-t border-gray-200"},null,-1)),Ie={class:"text-lg font-semibold text-gray-900 mb-4 flex items-center space-x-2"},qe=n(()=>e("span",null,"Your Response",-1)),Te={key:0,class:"mt-8"},Se={class:"bg-white/90 backdrop-blur-sm rounded-2xl border border-gray-100 shadow-lg overflow-hidden"},Re={class:"bg-gradient-to-r from-purple-500 to-indigo-600 px-6 py-4"},$e={class:"text-xl font-semibold text-white flex items-center space-x-2"},Ne=n(()=>e("span",null,"Results & Feedback",-1)),Be={class:"p-6"},Ce={__name:"[id]",setup(d){const _=i(null),h=i(null),b=i(!1),r=i(),t=i(null),u=a=>{},p=()=>{t.value&&t.value.startTimer()},w=()=>{t.value&&t.value.stopTimer()},{id:f}=z().params,y=`toefl/question/writting/${f}`,g=i(null);function m(){g.value.getQuestion(),t.value&&t.value.resetTimer()}function c(a){h.value=a,r.value=a.credits}return(a,k)=>{const l=I,q=B,T=Q,S=C,R=se,$=j;
2return x(),v("div",oe,[ne,ie,ae,le,e("div",re,[e("div",ce,[s(q,{to:"/dashboard",class:"inline-flex items-center space-x-2 px-4 py-2 text-gray-600 hover:text-blue-600 hover:bg-white/50 rounded-xl transition-all duration-300 mb-6 backdrop-blur-sm border border-white/20"},{default:A(()=>[s(l,{name:"i-heroicons-arrow-left",class:"w-4 h-4"}),de]),_:1}),e("div",ue,[e("div",pe,[e("div",me,[s(l,{name:"i-heroicons-pencil-square",class:"w-8 h-8 text-white"})]),e("div",null,[e("h1",_e,"Writing Task "+M(o(f)),1),e("p",he,[s(l,{name:"i-heroicons-document-text",class:"w-4 h-4"}),be])])]),e("div",fe,[s(T,{ref_key:"timerRef",ref:t,autoStart:!1,onTimeUpdate:u},null,512),e("button",{onClick:m,class:"flex items-center space-x-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white font-medium rounded-xl transition-all duration-300 shadow-sm hover:shadow-md"},[s(l,{name:"i-heroicons-arrow-path",class:"w-4 h-4"}),ge])])])]),e("div",xe,[e("div",ve,[e("div",we,[e("div",ye,[s(S,{reqPath:y,onReturnQuestionId:k[0]||(k[0]=N=>_.value=N),ref_key:"quesCompRef",ref:g},null,512),ke,e("div",null,[e("h3",Ie,[s(l,{name:"i-heroicons-pencil-square",class:"w-5 h-5 text-emerald-600"}),qe]),s(R,{gpt4:o(b),questionId:o(_),category:"writting",taskId:o(f),onSendResult:c,onTypingStarted:p,onSubmitClicked:w},null,8,["gpt4","questionId","taskId"])])])])])]),o(h)?(x(),v("div",Te,[e("div",Se,[e("div",Re,[e("h2",$e,[s(l,{name:"i-heroicons-chart-bar",class:"w-5 h-5"}),Ne])]),e("div",Be,[s($,{questionId:o(_),result:o(h)},null,8,["questionId","result"])])])])):Y("",!0)])])}}},De=P(Ce,[["__scopeId","data-v-e7e7f2b1"]]);export{De 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.