import{j as s}from"./vendor-BKmmeuxg.js";import{I as a}from"./input-error-LaPr_4wd.js";import{I as m}from"./input-DM0goJrn.js";import{L as n}from"./label-HmIcv5Yx.js";import{S as o,a as d,b as x,c as h,d as u}from"./select-CD9o3HN1.js";import{S as c}from"./slider-CUN53q6N.js";import{o as l}from"./inertia-SZXqLvQm.js";import"./utils-DxSsnXxD.js";import"./index-WW_1X1qx.js";const S=({data:e,setData:r,errors:i})=>s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(n,{htmlFor:"duration_hours",children:"Duration (Hours) *"}),s.jsx(m,{id:"duration_hours",name:"duration_hours",type:"number",value:e.duration_hours,onChange:t=>l(t,r),min:"0",max:"24",required:!0}),s.jsx(a,{message:i.duration_hours})]}),s.jsxs("div",{children:[s.jsx(n,{htmlFor:"duration_minutes",children:"Duration (Minutes) *"}),s.jsx(m,{id:"duration_minutes",name:"duration_minutes",type:"number",value:e.duration_minutes,onChange:t=>l(t,r),min:"0",max:"59",required:!0}),s.jsx(a,{message:i.duration_minutes})]})]}),(e.duration_hours>0||e.duration_minutes>0)&&s.jsx("div",{className:"rounded-lg bg-blue-50 p-3",children:s.jsxs("p",{className:"text-sm text-blue-800",children:["Total exam duration:"," ",s.jsxs("span",{className:"font-semibold",children:[e.duration_hours>0&&`${e.duration_hours} hour${e.duration_hours>1?"s":""} `,e.duration_minutes>0&&`${e.duration_minutes} minute${e.duration_minutes>1?"s":""}`]})]})}),s.jsxs("div",{children:[s.jsx(n,{htmlFor:"pass_mark",children:"Pass Mark *"}),s.jsx(m,{id:"pass_mark",name:"pass_mark",type:"number",value:e.pass_mark,onChange:t=>l(t,r),placeholder:"0",step:"0.01",min:"0",required:!0}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Minimum marks required to pass the exam"}),s.jsx(a,{message:i.pass_mark})]}),s.jsxs("div",{children:[s.jsx(n,{htmlFor:"max_attempts",children:"Maximum Attempts Allowed *"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(c,{value:[e.max_attempts||1],onValueChange:t=>r("max_attempts",t[0]),min:1,max:10,step:1,className:"py-4"}),s.jsxs("div",{className:"flex justify-between text-sm text-gray-600",children:[s.jsx("span",{children:"1 attempt"}),s.jsxs("span",{className:"font-semibold text-gray-900",children:[e.max_attempts||1," attempt(s)"]}),s.jsx("span",{children:"10 attempts"})]})]}),s.jsx(a,{message:i.max_attempts})]}),s.jsxs("div",{children:[s.jsx(n,{htmlFor:"status",children:"Exam Status *"}),s.jsxs(o,{name:"status",value:e.status,onValueChange:t=>r("status",t),children:[s.jsx(d,{children:s.jsx(x,{placeholder:"Select status"})}),s.jsxs(h,{children:[s.jsx(u,{value:"draft",children:"Draft"}),s.jsx(u,{value:"published",children:"Published"}),s.jsx(u,{value:"archived",children:"Archived"})]})]}),s.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:[e.status==="draft"&&"Only visible to you",e.status==="published"&&"Visible to all students",e.status==="archived"&&"Hidden from students"]}),s.jsx(a,{message:i.status})]})]});export{S as default};
