import{r as l,aU as f,j as e,aS as g}from"./react-vendor-xYZnmIII.js";import{I as b}from"./input-error-_LAmvivg.js";import{L as t,R as v,f as n,B as c,J as j,M as N}from"./ui-components-CQM92IK3.js";import y from"./Layout-DRlegCuc.js";import w from"./Message-CKMudK7b.js";import C from"./StepNavigator-BZxgvzIC.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./interactive-vendor-B1OgcAgP.js";const S=({flash:s})=>{const[d,o]=l.useState(!1),[m,r]=l.useState(!1),{data:i,errors:u,post:p,processing:L,setData:x}=f({course_creation:"collaborative"}),h=a=>{a.preventDefault(),o(!0),r(!0),p(route("install.store-processing"),{onFinish(){o(!1),r(!1)}})};return e.jsxs("div",{children:[e.jsx(C,{step1:"fill",step2:"fill",step3:"fill",step4:"fill",step5:"active"}),d&&e.jsx("div",{id:"loader",className:"mb-4 rounded-md bg-green-100 px-5 py-3 text-center text-sm font-medium text-green-500",children:"Loading..."}),e.jsx(w,{success:s.success,error:s.error}),e.jsxs("form",{onSubmit:h,children:[e.jsxs("div",{children:[e.jsx(t,{children:"Select Course Creation Mode"}),e.jsxs(v,{required:!0,defaultValue:i.course_creation,className:"flex items-center space-x-4 pt-2 pb-1",onValueChange:a=>x("course_creation",a),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(n,{className:"cursor-pointer",id:"collaborative",value:"collaborative"}),e.jsx(t,{htmlFor:"collaborative",children:"Collaborative"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(n,{className:"cursor-pointer",id:"administrative",value:"administrative"}),e.jsx(t,{htmlFor:"administrative",children:"Administrative"})]})]}),e.jsx(b,{message:u.course_creation}),i.course_creation==="collaborative"?e.jsx("div",{className:"mt-3 rounded-md border border-orange-200 bg-orange-50 p-4",children:e.jsxs("p",{className:"text-sm leading-relaxed text-gray-700",children:[e.jsx("span",{className:"mb-1 block font-medium text-orange-600",children:"Collaborative Mode:"}),"Enable a collaborative platform where qualified users can become instructors and create their own courses. The platform administrator will receive a percentage of revenue from each instructor's course sales."]})}):e.jsx("div",{className:"mt-3 rounded-md border border-orange-200 bg-orange-50 p-4",children:e.jsxs("p",{className:"text-sm leading-relaxed text-gray-700",children:[e.jsx("span",{className:"mb-1 block font-medium text-orange-600",children:"Administrative Mode:"}),"Centralize course management where only administrators can create and publish educational content. Students can enroll in these official courses, with all revenue flowing directly to the platform administration."]})})]}),e.jsxs("div",{className:"mt-12 flex w-full items-center justify-end gap-4",children:[e.jsx(g,{href:route("install.show-step4"),children:e.jsx(c,{type:"button",variant:"outline",className:"border border-orange-500 !bg-transparent !text-orange-500 uppercase",children:"Previous Step"})}),e.jsx(c,{type:"submit",className:"bg-orange-500 px-6 py-3 text-white uppercase hover:bg-orange-600/90",children:"Confirm"})]})]}),e.jsx(j,{open:m,onOpenChange:r,children:e.jsx(N,{children:e.jsxs("div",{className:"modal-box ! !rounded-md !bg-orange-50 !p-4 md:max-w-md",children:[e.jsx("p",{className:"!mb-6 !text-justify !font-medium",children:"Your app is currently undergoing an automatic installation. This process will take a few minutes. Please don't refresh your page or turn off your device. Just stay with this process."}),e.jsx("div",{className:"relative mt-6 w-full rounded-full bg-gray-200",children:e.jsx("div",{id:"shim-blue",className:"absolute h-2 animate-pulse rounded-full bg-blue-500",style:{width:"100%"}})})]})})})]})};S.layout=s=>e.jsx(y,{children:s});export{S as default};
