PageSourceSearch

https://www.admin.academicjobs.com/static/js/5847.49922175.chunk.js

js academicjobs.com collected 2026-09-24 21:50:51 UTC 5,262 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkacademicJobs=globalThis.webpackChunkacademicJobs||[]).push([[5847],{2978(e,s,a){a.d(s,{A:()=>u});var t=a(9950),r=a(2074),l=a(8429),o=a(3023),d=a(6536),n=a.n(d),c=a(4826),i=a(4414);const m=e=>{let{name:s,label:a,value:r,onChange:l}=e;const[o,d]=(0,t.useState)(!1);return(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:s,className:"block text-sm font-medium text-slate-700",children:a}),(0,i.jsxs)("div",{className:"mt-1 relative",children:[(0,i.jsx)("input",{id:s,name:s,type:o?"text":"password",value:r,onChange:l,className:"form-input block w-full border-slate-300 rounded-lg shadow-sm focus:ring-amber-500 focus:border-amber-500 sm:text-sm"}),(0,i.jsx)("button",{type:"button",onClick:()=>d(!o),className:"absolute inset-y-0 right-0 flex items-center px-3 text-slate-400 hover:text-slate-600","aria-label":o?"Hide password":"Show password",children:o?(0,i.jsx)(c.mx3,{}):(0,i.jsx)(c.Ny1,{})})]})]})},u=e=>{let{userId:s}=e;const[a,d]=(0,t.useState)({currentPassword:"",password:"",confirmPassword:""}),[c]=(0,r.ok)(),u=(0,l.Zp)(),h=c.get("token"),x=c.get("id"),[b,{isLoading:g}]=(0,o.a_)(),p=e=>{d(s=>({...s,[e.target.name]:e.target.value}))};return(0,i.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),a.password!==a.confirmPassword)return void n()("Error","New passwords do not match.","error");const t={userId:s||x,password:a.password,...h&&{token:h},...s&&{currentPassword:a.currentPassword}};try{await b(t).unwrap(),n()("Success","Password updated successfully!","success").then(()=>{s||u("/")}),d({currentPassword:"",password:"",confirmPassword:""})}catch(l){var r;const e=(null===(r=l.data)||void 0===r?void 0:r.message)||"Failed to update password. Please check your current password and try again.";n()("Error",e,"error")}},className:"space-y-6",children:[s&&(0,i.jsx)(m,{name:"currentPassword",label:"Current Password",value:a.currentPassword,onChange:p}),(0,i.jsx)(m,{name:"password",label:"New Password",value:a.password,onChange:p}),(0,i.jsx)(m,{name:"confirmPassword",label:"Confirm New Password",value:a.confirmPassword,onChange:p}),(0,i.jsxs)("div",{className:"flex justify-between items-center pt-2",children:[s?(0,i.jsx)(r.N_,{to:"/forgot-password",className:"text-sm text-amber-600 hover:underline",children:"Forgot Password?"}):(0,i.jsx)("div",{}),(0,i.jsx)("button",{type:"submit",className:"bg-amber-500 text-white font-bold py-2 px-6 rounded-lg hover:bg-amber-600 transition-colors shadow-sm disabled:bg-slate-400",disabled:g,children:g?"Updating...":"Update Password"})]})]})}},5847(e,s,a){a.r(s),a.d(s,{default:()=>m});var t=a(9950),r=a(3501),l=a(2446),o=a(2978),d=a(6536),n=a.n(d),c=a(4414);const i=e=>{let{name:s,label:a,value:t,onChange:r,type:l="text",className:o="sm:col-span-1"}=e;return(0,c.jsxs)("div",{className:o,children:[(0,c.jsx)("label",{htmlFor:s,className:"block text-sm font-medium text-slate-700",children:a}),(0,c.jsx)("div",{className:"mt-1",children:(0,c.jsx)("input",{id:s,name:s,type:l,value:t||"",onChange:r,className:"form-input block w-full border-slate-300 rounded-lg shadow-sm focus:ring-amber-500 focus:border-amber-500 sm:text-sm"})})]})},m=()=>{const e=(0,r.d4)(e=>e.auth.userInfo),[s,a]=(0,t.useState)(e),[d,{isLoading:m}]=(0,l.H7)(),u=e=>{a(s=>({...s,[e.target.name]:e.target.value}))};return(0,c.jsxs)("div",{className:"bg-slate-50",children:[(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)("h1",{className:"text-3xl font-bold text-slate-800",children:"Profile Settings"}),(0,c.jsx)("p",{className:"text-slate-500 mt-1",children:"Manage your account details and password."})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,c.jsxs)("div",{className:"bg-white p-6 rounded-xl shadow-md border border-slate-200",children:[(0,c.jsx)("h2",{className:"text-xl font-bold text-slate-800",children:"User Details"}),(0,c.jsxs)("form",{onSubmit:async e=>{e.preventDefault();try{await d(s).unwrap(),n()("Success","Your details have been updated successfully!","success")}catch(a){n()("Error","Failed to update user details. Please try again.","error")}},className:"mt-6 space-y-6",children:[(0,c.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[(0,c.jsx)(i,{name:"firstName",label:"First Name",value:s.firstName,onChange:u}),(0,c.jsx)(i,{name:"lastName",label:"Last Name",value:s.lastName,onChange:u})]}),(0,c.jsx)(i,{name:"phone",label:"Phone",type:"tel",value:s.phone,onChange:u,className:"sm:col-span-2"}),(0,c.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[(0,c.jsx)(i,{name:"state",label:"State",value:s.state,onChange:u}),(0,c.jsx)(i,{name:"postCode",label:"Post Code",value:s.postCode,onChange:u})]}),(0,c.jsx)("div",{className:"flex justify-end pt-2",children:(0,c.jsx)("button",{type:"submit",className:"bg-amber-500 text-white font-bold py-2 px-6 rounded-lg hover:bg-amber-600 transition-colors shadow-sm disabled:bg-slate-400",disabled:m,children:m?"Saving...":"Save Changes"})})]})]}),(0,c.jsxs)("div",{className:"bg-white p-6 rounded-xl shadow-md border border-slate-200",children:[(0,c.jsx)("h2",{className:"text-xl font-bold text-slate-800",children:"Password Reset"}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(o.A,{userId:e.id})})]})]})]})}}}]);

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.