T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/domains/lavocat.ca/private_html/.next/server/chunks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/lavocat.ca/private_html/.next/server/chunks/3646.js
exports.id=3646,exports.ids=[3646,6847],exports.modules={23646:(e,a,l)=>{"use strict";l.d(a,{A:()=>u});var t=l(8732),s=l(82015),n=l(44233),r=l(4722),i=l(46847),d=l(99862),o=l.n(d),c=l(74233),m=l.n(c);let u=({onSuccess:e,initialData:a,isEditing:l=!1,onSave:d,isAdmin:c=!1,mode:u="user",initialValues:x,isFrench:h=!1,initialLocale:b,isMobile:p=!1,preSelectedCaseId:v,selectedCase:g})=>{let f=(0,n.useRouter)(),{data:y}=(0,r.useSession)(),[N,j]=(0,s.useState)(""),[w,C]=(0,s.useState)(()=>{let e={firstName:"",lastName:"",email:"",phone:"",birthDate:"",detaineeInfo:{name:"",facility:"",inmateId:""},relationship:"",preferredLanguage:b||"en",preferredContactMethod:"email",gender:"",address:{street:"",city:"",state:"",postalCode:"",country:"CA"},detaineeIncarcerationDates:"",detaineeExpectedReleaseDates:"",previousLegalActions:"",reasonForJoining:"",howDidYouHearAboutUs:"",representation:"",urgentNeeds:"",additionalNotes:"",lawyerName:"",lawyerEmail:"",lawyerPhone:"",lawFirm:"",status:"PENDING",caseId:v||""};if(a){let l={...a,birthDate:a.birthDate?new Date(a.birthDate).toISOString().split("T")[0]:"",detaineeIncarcerationDates:a.detaineeInfo?.incarcerationDate?new Date(a.detaineeInfo.incarcerationDate).toISOString().split("T")[0]:"",detaineeExpectedReleaseDates:a.detaineeInfo?.expectedReleaseDate?new Date(a.detaineeInfo.expectedReleaseDate).toISOString().split("T")[0]:""},t=l.address?.country;return"Canada"===t&&(t="CA"),"United States"===t&&(t="US"),t||(t="CA"),{...e,...l,address:{...e.address,...l.address||{},country:t},detaineeInfo:{...e.detaineeInfo,...l.detaineeInfo||{}}}}return e}),[k,S]=(0,s.useState)(!1),[I,D]=(0,s.useState)(""),[A,L]=(0,s.useState)(p);(0,s.useEffect)(()=>{let e=()=>{L(p||window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[p]);let[E,R]=(0,s.useState)("CA"),P=(0,s.useMemo)(()=>[{value:"",label:"S\xe9lectionner"},{value:"amos",label:"\xc9tablissement de d\xe9tention d'Amos"},{value:"baie-comeau",label:"\xc9tablissement de d\xe9tention de Baie-Comeau"},{value:"bordeaux",label:"\xc9tablissement de d\xe9tention de Montr\xe9al (Bordeaux)"},{value:"cowansville",label:"\xc9tablissement de d\xe9tention de Cowansville"},{value:"drummondville",label:"\xc9tablissement de d\xe9tention de Drummondville"},{value:"hull",label:"\xc9tablissement de d\xe9tention de Hull"},{value:"leclerc",label:"\xc9tablissement de d\xe9tention de Laval (Leclerc)"},{value:"new-carlisle",label:"\xc9tablissement de d\xe9tention de New Carlisle"},{value:"perce",label:"\xc9tablissement de d\xe9tention de Perc\xe9"},{value:"quebec",label:"\xc9tablissement de d\xe9tention de Qu\xe9bec"},{value:"rimouski",label:"\xc9tablissement de d\xe9tention de Rimouski"},{value:"roberval",label:"\xc9tablissement de d\xe9tention de Roberval"},{value:"saint-jerome",label:"\xc9tablissement de d\xe9tention de Saint-J\xe9r\xf4me"},{value:"sept-iles",label:"\xc9tablissement de d\xe9tention de Sept-\xceles"},{value:"sherbrooke",label:"\xc9tablissement de d\xe9tention de Sherbrooke"},{value:"sorel-tracy",label:"\xc9tablissement de d\xe9tention de Sorel-Tracy"},{value:"trois-rivieres",label:"\xc9tablissement de d\xe9tention de Trois-Rivi\xe8res"},{value:"other",label:"Autre \xe9tablissement"}],[]),[M,T]=(0,s.useState)([]),[U,F]=(0,s.useState)([]),[O,q]=(0,s.useState)(null),H=(0,s.useRef)(null),[Y,J]=(0,s.useState)(!1),[B,W]=(0,s.useState)(!1),V=!!(x&&x.id),K=o()(async e=>{if(V){J(!0),W(!1);try{let a=c?`/api/admin/registrations/${x.id}`:`/api/user/registrations/${x.id}`;await fetch(a,{method:c?"PATCH":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),W(!0),q(new Date)}catch{}finally{J(!1)}}},1e3);(0,s.useEffect)(()=>{let e=M.map(e=>({file:e,url:URL.createObjectURL(e)}));return F(e),()=>{e.forEach(e=>URL.revokeObjectURL(e.url))}},[M]),(0,s.useEffect)(()=>{(async()=>{let e=await (0,r.getCsrfToken)();e&&j(e)})()},[]),(0,s.useEffect)(()=>{if(x&&x.id&&!k)return H.current&&clearTimeout(H.current),H.current=setTimeout(async()=>{try{S(!0);let e={firstName:w.firstName,lastName:w.lastName,email:w.email,phone:w.phone,birthDate:new Date(w.birthDate).toISOString(),gender:w.gender,relationship:w.relationship,preferredLanguage:w.preferredLanguage,preferredContactMethod:w.preferredContactMethod,message:w.additionalNotes,additionalNotes:w.additionalNotes,previousLegalActions:w.previousLegalActions,reasonForJoining:w.reasonForJoining,howDidYouHearAboutUs:w.howDidYouHearAboutUs,representation:w.representation,urgentNeeds:w.urgentNeeds,address:{street:w.address.street||"",city:w.address.city||"",state:w.address.state||"",postalCode:w.address.postalCode||"",country:w.address.country||""},detaineeInfo:{name:w.detaineeInfo.name||"",facility:w.detaineeInfo.facility||"",inmateId:w.detaineeInfo.inmateId||"",incarcerationDate:w.detaineeIncarcerationDates?new Date(w.detaineeIncarcerationDates).toISOString():void 0,expectedReleaseDate:w.detaineeExpectedReleaseDates?new Date(w.detaineeExpectedReleaseDates).toISOString():null},lawyerName:w.lawyerName,lawyerEmail:w.lawyerEmail,lawyerPhone:w.lawyerPhone,lawFirm:w.lawFirm},a=c?`/api/admin/registrations/${x.id}`:`/api/user/registrations/${x.id}`;await fetch(a,{method:c?"PATCH":"PUT",headers:{"Content-Type":"application/json","X-CSRF-Token":N||""},body:JSON.stringify(e)}),q(new Date)}catch(e){}finally{S(!1)}},1e3),()=>{H.current&&clearTimeout(H.current)}},[w]),(0,s.useEffect)(()=>{v&&C(e=>({...e,caseId:v}))},[v]);let z=()=>{let e=[];return c||w.caseId||e.push("Legal Case Selection"),w.firstName||e.push("First Name"),w.lastName||e.push("Last Name"),w.email||e.push("Email"),w.phone||e.push("Phone"),w.birthDate||e.push("Birth Date"),w.gender||e.push("Gender"),w.address.street||e.push("Street Address"),w.address.city||e.push("City"),w.address.state||e.push("State/Province"),w.address.postalCode||e.push("Postal Code"),w.address.country||e.push("Country"),w.detaineeInfo.name||e.push("Detainee Name"),w.detaineeInfo.facility||e.push("Facility"),w.detaineeInfo.inmateId||e.push("Inmate ID"),w.relationship||e.push("Relationship to Detainee"),w.preferredLanguage||e.push("Preferred Language"),w.preferredContactMethod||e.push("Preferred Contact Method"),w.representation||e.push("Legal Representation"),w.howDidYouHearAboutUs||e.push("How did you hear about us"),w.detaineeIncarcerationDates||e.push("Incarceration Date"),!(e.length>0)||(D("Please fill in all required fields. Missing fields: "+e.join(", ")),!1)},G=async a=>{if(a.preventDefault(),S(!0),D(""),!z())return void S(!1);try{let a={...w,detaineeInfo:{name:w.detaineeInfo.name,facility:w.detaineeInfo.facility,inmateId:w.detaineeInfo.inmateId,incarcerationDate:w.detaineeIncarcerationDates?new Date(w.detaineeIncarcerationDates).toISOString():void 0,expectedReleaseDate:w.detaineeExpectedReleaseDates?new Date(w.detaineeExpectedReleaseDates).toISOString():null}};delete a.detaineeIncarcerationDates,delete a.detaineeExpectedReleaseDates;let l=await fetch(c?"/api/register":"/api/user/registrations",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-Token":N},body:JSON.stringify(a)}),t=await l.json();if(!l.ok){D(t.message||"Registration error"),alert(t.message||"Registration error"),S(!1);return}alert("Application submitted successfully!"),e?e():f.push("/success")}catch(e){D(e instanceof Error?e.message:"Unknown error"),alert(e instanceof Error?e.message:"Unknown error"),console.error("Form submission error:",e)}finally{S(!1)}},_=e=>{let{name:a,value:l,type:t}=e.target;if(a.includes(".")){let[e,t]=a.split(".");C(a=>({...a,[e]:{...a[e]||{},[t]:l}}))}else C(s=>({...s,[a]:"checkbox"===t?e.target.checked:l}));V&&K(w)};(0,s.useEffect)(()=>{if(x?.address?.country){let e=x.address.country;"Canada"===e&&(e="CA"),"United States"===e&&(e="US"),R(e),C(a=>({...a,address:{...a.address,country:e}}))}},[x]);let[$,Q]=(0,s.useState)([]),X=e=>{Q(a=>a.filter(a=>a.id!==e))},[Z,ee]=(0,s.useState)(null);return(0,t.jsxs)("div",{className:"min-h-screen bg-gray-50 py-12 px-4 sm:px-6 lg:px-8",children:[(0,t.jsx)("div",{className:"max-w-3xl mx-auto",children:(0,t.jsx)("div",{className:"bg-white shadow sm:rounded-lg",children:(0,t.jsx)("div",{className:"px-4 py-5 sm:p-6",children:(0,t.jsxs)("form",{onSubmit:G,className:"space-y-10",children:[V&&O&&(0,t.jsxs)("div",{className:"mb-4 text-sm text-gray-500",children:["Last saved: ",O.toLocaleString()]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Personal Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["First Name ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"text",name:"firstName",value:w.firstName,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Last Name ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"text",name:"lastName",value:w.lastName,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Email ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"email",name:"email",value:w.email,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Phone ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"tel",name:"phone",value:w.phone,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Birth Date ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"date",name:"birthDate",value:w.birthDate,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Gender ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("select",{name:"gender",value:w.gender,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm",children:[{value:"",label:"Select"},{value:"male",label:"Male"},{value:"female",label:"Female"},{value:"non_binary",label:"Non-binary"},{value:"prefer_not_to_say",label:"Prefer not to say"}].map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Address"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Street Address ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"text",name:"address.street",value:w.address.street,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["City ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"text",name:"address.city",value:w.address.city,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Country ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("select",{value:E,onChange:e=>{let{value:a}=e.target;R(a),C(e=>({...e,address:{...e.address,country:a,state:""}}))},required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm",children:[{value:"CA",label:"Canada"},{value:"US",label:"United States"}].map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["State/Province ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsxs)("select",{name:"address.state",value:w.address.state,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm",children:[(0,t.jsx)("option",{value:"",children:"Select"}),("CA"===E||"US"===E)&&({CA:[{value:"AB",label:"Alberta"},{value:"BC",label:"British Columbia"},{value:"MB",label:"Manitoba"},{value:"NB",label:"New Brunswick"},{value:"NL",label:"Newfoundland and Labrador"},{value:"NS",label:"Nova Scotia"},{value:"NT",label:"Northwest Territories"},{value:"NU",label:"Nunavut"},{value:"ON",label:"Ontario"},{value:"PE",label:"Prince Edward Island"},{value:"QC",label:"Quebec"},{value:"SK",label:"Saskatchewan"},{value:"YT",label:"Yukon"}],US:[{value:"AL",label:"Alabama"},{value:"AK",label:"Alaska"},{value:"AZ",label:"Arizona"},{value:"AR",label:"Arkansas"},{value:"CA",label:"California"},{value:"CO",label:"Colorado"},{value:"CT",label:"Connecticut"},{value:"DE",label:"Delaware"},{value:"FL",label:"Florida"},{value:"GA",label:"Georgia"},{value:"HI",label:"Hawaii"},{value:"ID",label:"Idaho"},{value:"IL",label:"Illinois"},{value:"IN",label:"Indiana"},{value:"IA",label:"Iowa"},{value:"KS",label:"Kansas"},{value:"KY",label:"Kentucky"},{value:"LA",label:"Louisiana"},{value:"ME",label:"Maine"},{value:"MD",label:"Maryland"},{value:"MA",label:"Massachusetts"},{value:"MI",label:"Michigan"},{value:"MN",label:"Minnesota"},{value:"MS",label:"Mississippi"},{value:"MO",label:"Missouri"},{value:"MT",label:"Montana"},{value:"NE",label:"Nebraska"},{value:"NV",label:"Nevada"},{value:"NH",label:"New Hampshire"},{value:"NJ",label:"New Jersey"},{value:"NM",label:"New Mexico"},{value:"NY",label:"New York"},{value:"NC",label:"North Carolina"},{value:"ND",label:"North Dakota"},{value:"OH",label:"Ohio"},{value:"OK",label:"Oklahoma"},{value:"OR",label:"Oregon"},{value:"PA",label:"Pennsylvania"},{value:"RI",label:"Rhode Island"},{value:"SC",label:"South Carolina"},{value:"SD",label:"South Dakota"},{value:"TN",label:"Tennessee"},{value:"TX",label:"Texas"},{value:"UT",label:"Utah"},{value:"VT",label:"Vermont"},{value:"VA",label:"Virginia"},{value:"WA",label:"Washington"},{value:"WV",label:"West Virginia"},{value:"WI",label:"Wisconsin"},{value:"WY",label:"Wyoming"}]})[E].map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Postal Code ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"text",name:"address.postalCode",value:w.address.postalCode,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Detainee Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Detainee Name ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"text",name:"detaineeInfo.name",value:w.detaineeInfo.name,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Facility ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("select",{name:"detaineeInfo.facility",value:w.detaineeInfo.facility,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm",children:P.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Select the facility where the detainee is currently held."})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Inmate ID ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"text",name:"detaineeInfo.inmateId",value:w.detaineeInfo.inmateId,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"As provided by the facility."})]}),(0,t.jsx)("div",{className:"md:col-span-2",children:(0,t.jsxs)("div",{className:"flex flex-col md:flex-row gap-6",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Incarceration Date ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("input",{type:"date",name:"detaineeIncarcerationDates",value:w.detaineeIncarcerationDates,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Expected Release Date ",(0,t.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,t.jsx)("input",{type:"date",name:"detaineeExpectedReleaseDates",value:w.detaineeExpectedReleaseDates,onChange:_,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]})]})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Relationship to Detainee ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("select",{name:"relationship",value:w.relationship,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm",children:[{value:"",label:"Select"},{value:"self",label:"I am the Detainee"},{value:"spouse",label:"Spouse"},{value:"parent",label:"Parent"},{value:"child",label:"Child"},{value:"sibling",label:"Sibling"},{value:"friend",label:"Friend"},{value:"lawyer",label:"Lawyer"},{value:"other",label:"Other"}].map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Contact Preferences"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Preferred Language ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("select",{name:"preferredLanguage",value:w.preferredLanguage,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm",children:[{value:"en",label:"English"},{value:"fr",label:"French"}].map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Preferred Contact Method ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsxs)("select",{name:"preferredContactMethod",value:w.preferredContactMethod,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm",children:[(0,t.jsx)("option",{value:"email",children:"Email"}),(0,t.jsx)("option",{value:"phone",children:"Phone"}),(0,t.jsx)("option",{value:"mail",children:"Mail"})]})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Legal Representation"}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Legal Representation ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsxs)("select",{name:"representation",value:w.representation,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm",children:[(0,t.jsx)("option",{value:"",children:"Select"}),(0,t.jsx)("option",{value:"yes",children:"Yes"}),(0,t.jsx)("option",{value:"no",children:"No"})]})]})}),"yes"===w.representation&&(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mt-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Lawyer Name ",(0,t.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,t.jsx)("input",{type:"text",name:"lawyerName",value:w.lawyerName,onChange:_,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Law Firm ",(0,t.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,t.jsx)("input",{type:"text",name:"lawFirm",value:w.lawFirm,onChange:_,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Lawyer Email ",(0,t.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,t.jsx)("input",{type:"email",name:"lawyerEmail",value:w.lawyerEmail,onChange:_,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Lawyer Phone ",(0,t.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,t.jsx)("input",{type:"tel",name:"lawyerPhone",value:w.lawyerPhone,onChange:_,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Additional Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Previous Legal Actions ",(0,t.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,t.jsx)("textarea",{name:"previousLegalActions",value:w.previousLegalActions,onChange:_,rows:2,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Reason for Joining ",(0,t.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,t.jsx)("textarea",{name:"reasonForJoining",value:w.reasonForJoining,onChange:_,rows:2,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["How did you hear about us? ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("select",{name:"howDidYouHearAboutUs",value:w.howDidYouHearAboutUs,onChange:_,required:!0,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm",children:[{value:"",label:"Select"},{value:"social_media",label:"Social Media"},{value:"friend",label:"Friend or Family"},{value:"lawyer",label:"Lawyer"},{value:"news",label:"News"},{value:"search",label:"Search Engine"},{value:"other",label:"Other"}].map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Urgent Needs ",(0,t.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,t.jsx)("textarea",{name:"urgentNeeds",value:w.urgentNeeds,onChange:_,rows:2,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Additional Notes ",(0,t.jsx)("span",{className:"text-gray-400",children:"(optional)"})]}),(0,t.jsx)("textarea",{name:"additionalNotes",value:w.additionalNotes,onChange:_,rows:2,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm"})]})]})]}),c&&a?.documents&&a.documents.length>0&&(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-2",children:"Uploaded Documents"}),(0,t.jsx)("ul",{className:"space-y-2",children:a.documents.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate flex-1",children:e.name||e.title||e.url}),(0,t.jsx)("button",{type:"button",className:"px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700",onClick:()=>ee({url:e.url,type:e.type,name:e.name||e.title||e.url}),children:"View"})]},e.id))})]}),I&&(0,t.jsx)("div",{className:"text-red-600 text-sm mt-2",children:I}),Y&&(0,t.jsx)("div",{className:"text-sm text-blue-500",children:"Saving..."}),B&&!Y&&(0,t.jsx)("div",{className:"text-sm text-green-500",children:"Saved"}),!V&&(0,t.jsx)("button",{type:"submit",disabled:k,className:"w-full py-3 px-4 bg-indigo-600 text-white rounded-md text-lg font-semibold hover:bg-indigo-700 disabled:opacity-50 mt-8",children:k?"Submitting...":"Submit"})]})})})}),$.map(({id:e,file:a})=>(0,t.jsx)(m(),{handle:".modal-header",children:(0,t.jsxs)("div",{className:"fixed z-50 top-20 left-20 bg-white shadow-lg rounded-lg border border-gray-300 w-[90vw] max-w-2xl h-[80vh] flex flex-col",children:[(0,t.jsxs)("div",{className:"modal-header flex items-center justify-between bg-indigo-600 text-white px-4 py-2 cursor-move rounded-t-lg",children:[(0,t.jsx)("span",{children:a.name}),(0,t.jsx)("div",{children:(0,t.jsx)("button",{onClick:()=>X(e),className:"ml-2 px-2 py-1 bg-red-500 rounded text-white",children:"Close"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(i.A,{url:URL.createObjectURL(a),type:a.type,name:a.name})})]})},e)),Z&&(0,t.jsx)("div",{className:"fixed z-50 inset-0 flex items-center justify-center bg-black bg-opacity-50",children:(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full h-[80vh] flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 bg-indigo-600 text-white rounded-t-lg",children:[(0,t.jsx)("span",{children:Z.name}),(0,t.jsx)("button",{onClick:()=>ee(null),className:"ml-2 px-2 py-1 bg-red-500 rounded text-white",children:"Close"})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsx)(i.A,{url:Z.url,type:Z.type,name:Z.name})})]})})]})}},46847:(e,a,l)=>{"use strict";l.d(a,{A:()=>d});var t=l(8732),s=l(82015);l(86120),l(81430);let n=["text/plain","text/markdown","text/csv","application/json","text/x-log","text/x-yaml","text/yaml","text/xml","application/xml","text/html","text/css","text/javascript","application/javascript","application/typescript","text/typescript"],r=[".txt",".md",".csv",".log",".json",".ts",".js",".css",".html",".xml",".yaml",".yml"],i=({url:e,type:a,name:l,status:i,onApprove:d,onReject:o,onDelete:c,isAdmin:m})=>{let[u,x]=(0,s.useState)(null),[h,b]=(0,s.useState)(!1),[p,v]=(0,s.useState)(null),g=()=>{let e=l?l.slice(l.lastIndexOf(".")).toLowerCase():"";return n.includes(a)||r.includes(e)};return((0,s.useEffect)(()=>{g()&&(b(!0),v(null),fetch(e).then(e=>{if(!e.ok)throw Error("Failed to fetch file");return e.text()}).then(x).catch(e=>v(e.message)).finally(()=>b(!1)))},[e,a,l]),g())?h?(0,t.jsx)("div",{className:"p-8 text-center text-gray-500",children:"Loading preview..."}):p?(0,t.jsxs)("div",{className:"p-8 text-center text-red-600",children:["Failed to load file: ",p]}):(0,t.jsx)("div",{className:"p-4 max-h-[70vh] overflow-auto bg-gray-900 text-gray-100 rounded-lg shadow-inner border border-gray-300 text-left",children:(0,t.jsx)("pre",{className:"whitespace-pre-wrap break-words text-sm font-mono",children:u})}):(0,t.jsxs)("div",{className:"p-8 text-center text-red-600 font-bold",children:["PDF viewing is temporarily disabled for stability. Please contact the admin if you need this feature re-enabled.",(0,t.jsx)("br",{}),(0,t.jsx)("span",{className:"block mt-2 text-gray-500",children:"Preview not available for this file type."}),m&&(0,t.jsxs)("div",{className:"mt-4 text-sm",children:["Admin mode: ",l]})]})},d=e=>(0,t.jsx)(i,{...e})},81430:()=>{},86120:()=>{}};

CasperSecurity Mini