1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4933],{55301:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/ChangePassword",function(){return a(17681)}])},8946:function(e,s){"use strict";s.Z={src:"/_next/static/media/profile.3f0160b4.jpeg",height:600,width:600,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/sBCgoKCgoKCwwMCw8QDhAPFhQTExQWIhgaGBoYIjMgJSAgJSAzLTcsKSw3LVFAODhAUV5PSk9ecWVlcY+Ij7u7+//CABEIAAgACAMBIgACEQEDEQH/xAAoAAEBAAAAAAAAAAAAAAAAAAAABwEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAKUJf//EAB4QAAAEBwAAAAAAAAAAAAAAAAACEhMEERUkMjOx/9oACAEBAAE/AFx1RS1Zs5TLs6P/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oACAECAQE/AH//xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oACAEDAQE/AH//2Q==",blurWidth:8,blurHeight:8}},66506:function(e,s,a){"use strict";var r=a(85893),t=a(67294),o=a(8193),l=a(51526),n=a(43495);let i=e=>{let{isOpen:s,onClose:a,onConfirm:i}=e,c=(0,t.useRef)();return(0,t.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&a()};return s?document.addEventListener("mousedown",e):document.removeEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[s,a]),(0,r.jsx)(l.M,{children:s&&(0,r.jsx)(n.E.div,{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:(0,r.jsx)(n.E.div,{className:"bg-white rounded-lg shadow-lg p-8 w-full max-w-lg border-t-4 border-primary md:max-w-md",initial:{y:50,opacity:0},animate:{y:0,opacity:1},exit:{y:50,opacity:0},transition:{type:"tween",ease:"easeInOut",duration:.4},ref:c,children:(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsx)(o.sQg,{className:"text-red-500 text-6xl mb-4"}),(0,r.jsx)("h2",{className:"text-2xl font-semibold mb-4",children:"Are you sure?"}),(0,r.jsx)("p",{className:"text-gray-600 mb-6 text-center",children:"Do you want to logout?"}),(0,r.jsxs)("div",{className:"flex flex-wrap justify-center space-x-4 space-y-2 md:space-y-0",children:[(0,r.jsx)("button",{onClick:i,className:"bg-blue-500 text-white px-6 py-2 rounded-full shadow-md hover:bg-blue-600 transition-all duration-300 transform hover:scale-105",children:"Yes, logout!"}),(0,r.jsx)("button",{onClick:a,className:"bg-red-500 text-white px-6 py-2 rounded-full shadow-md hover:bg-red-600 transition-all duration-300 transform hover:scale-105",children:"Cancel"})]})]})})})})};s.Z=i},4422:function(e,s,a){"use strict";var r=a(67294),t=a(82940),o=a(87066),l=a(37351);let n=()=>{let e="#";for(let s=0;s<6;s++)e+="0123456789ABCDEF"[Math.floor(16*Math.random())];return e},i=()=>{let e=new Date,s="".concat(e.getFullYear()).concat((e.getMonth()+1).toString().padStart(2,"0")).concat(e.getDate().toString().padStart(2,"0")).concat(e.getHours().toString().padStart(2,"0")).concat(e.getMinutes().toString().padStart(2,"0")).concat(e.getSeconds().toString().padStart(2,"0"));return s+n()},c=e=>{let s=(0,t.b)(),a=(0,r.useContext)(l.ThemeContext),n=async()=>{if(1===a.siteStatus){let r={};try{let t=await o.Z.get("https://api.ipify.org?format=json"),l=await o.Z.get("https://ipapi.co/".concat(t.data.ip,"/json/"));r=l.data}catch(d){console.warn("Failed to fetch IP details from ipapi.co. Trying fallback...");try{let n=await o.Z.get("https://ipwhois.app/json/");r=n.data}catch(c){console.warn("Failed to fetch IP details from fallback service. Proceeding without IP data.")}}let u={ipDetails:JSON.stringify(r),reference:window.location.hostname,track:"track",page:window.location.href,method:"open",page_type:e,UID:"",scode:i()};try{await s.post("user/tracking",u)}catch(m){console.error("Error sending tracking data:",m)}}else console.error("Tracking not enabled due to site status.")};return n};s.Z=c},15788:function(e,s,a){"use strict";var r=a(85893),t=a(41664),o=a.n(t);let l=e=>{let{label:s}=e;return(0,r.jsx)("div",{className:"xl:container px-4 py-4 flex justify-between",children:(0,r.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,r.jsx)(o(),{href:"/",className:"text-primary text-base",children:(0,r.jsx)("i",{className:"fas fa-home"})}),(0,r.jsxs)("div",{className:"flex gap-3 items-center mt-1",children:[(0,r.jsx)("span",{className:"text-sm text-gray-500",children:(0,r.jsx)("i",{className:"fas fa-chevron-right"})}),(0,r.jsx)("p",{className:"text-gray-500 font-medium uppercase",children:s})]})]})})};s.Z=l},71846:function(e,s,a){"use strict";var r=a(85893),t=a(41664),o=a.n(t),l=a(25675),n=a.n(l),i=a(68015),c=a(85574),d=a(67294);let u=e=>{let{user:s,userDetails:a,goldPlanEnable:t,buySellEnable:l,websiteStatus:u,theme:m,handleLogout:f,applySiteStatus:h,selectedPage:p}=e,{jboId:x}=(0,i.useJobId)(),{menuJsonApp:A}=(0,d.useContext)(c.UserContext);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"lg:hidden",children:[(0,r.jsx)("div",{className:"bg-gray-50 p-4 flex items-center justify-center shadow rounded-t-lg",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(n(),{src:s,alt:"User",className:"rounded-full w-14 h-14 border border-gray-300"}),(0,r.jsxs)("div",{className:"ml-3",children:[(0,r.jsx)("p",{className:"text-gray-600",children:"Hello.."}),(0,r.jsxs)("h4",{className:"text-gray-800 font-semibold capitalize",children:[null==a?void 0:a.name,".."]})]})]})}),(0,r.jsx)("div",{className:"flex flex-wrap justify-between p-4 bg-gray-50 shadow rounded-b-lg",children:[{href:"/profile/User",label:"Manage Account"},{href:"/profile/Address",label:"Manage Address"},{href:"/profile/ChangePassword",label:"Change Password"},{href:"/profile/orders",label:"My Order History"},1==A.customized_status&&{href:"/profile/customizedEnquiry",label:"Customized Order"},t&&{href:"/profile/GoldPlans",label:"Gold Plans"},l&&{href:"/profile/Wallet",label:"Wallet"}
1,((null==a?void 0:a.user_type)>=2||3==u)&&{href:"/profile/BidAsk",label:"Bid & Ask",className:"border-2 border-primary"},{href:"/profile/Wishlist",label:"My Wishlist"},233==x&&{href:"/profile/TryEarRing",label:"Try Ear Ring"},,{href:"#",label:"Logout",onClick:f}].filter(Boolean).map((e,s)=>(0,r.jsx)("div",{className:"w-1/2 p-2",children:(0,r.jsx)("a",{href:e.href,onClick:e.onClick,className:"flex flex-col items-center bg-white rounded-lg shadow py-3 hover:text-primary ".concat(e.href===p?"text-primary text-base font-semibold":""," ").concat(e.className||""),children:(0,r.jsx)("span",{className:"text-xs text-center",children:e.label})})},s))})]}),(!h||0!==m.siteStatus)&&(0,r.jsxs)("div",{className:"col-span-3 hidden lg:block",children:[(0,r.jsxs)("div",{className:"px-4 py-3 shadow flex bg-gray-100 items-center gap-4",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)(n(),{src:s,className:"rounded-full w-14 h-14 p-1 border border-gray-200 object-cover"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-gray-600",children:"Hello.."}),(0,r.jsxs)("h4",{className:"text-gray-800 capitalize font-semibold",children:[null==a?void 0:a.name,".."]})]})]}),(0,r.jsx)("div",{className:"mt-6 bg-gray-100 shadow rounded p-4 divide-y divide-gray-200 space-y-4 text-gray-600",children:[{href:"/profile/User",label:"Manage Account",icon:"fas fa-address-card"},{href:"/profile/Address",label:"Manage Address",icon:"fas fa-map-marker-alt"},{href:"/profile/ChangePassword",label:"Change Password",icon:"fas fa-key"},{href:"/profile/orders",label:"My Order History",icon:"fas fa-gift"},1==A.customized_status&&{href:"/profile/customizedEnquiry",label:"Customized Order",icon:"fas fa-pen-ruler"},t&&{href:"/profile/GoldPlans",label:"Gold Plans",icon:"fas fa-crown"},l&&{href:"/profile/Wallet",label:"Wallet",icon:"fas fa-wallet"},(null==a?void 0:a.user_type)>=2&&{href:"/profile/BidAsk",label:"Bid & Ask",icon:"fas fa-gavel",className:"text-primary"},{href:"/profile/Wishlist",label:"My Wishlist",icon:"fas fa-heart"},233==x&&{href:"/profile/TryEarRing",label:"Try Ear Ring",icon:"fas fa-ring",iconClass:"transform rotate-90"},{href:"#",label:"Logout",icon:"fas fa-sign-out-alt",onClick:f}].filter(Boolean).map((e,s)=>(0,r.jsx)("div",{className:"space-y-1 pl-8 pt-4",children:(0,r.jsxs)(o(),{href:e.href,onClick:e.onClick,className:"relative text-base font-medium capitalize hover:text-primary transition block ".concat(e.href===p?"text-primary text-base font-semibold":""," ").concat(e.className||""),children:[e.label,e.icon&&(0,r.jsx)("span",{className:"absolute -left-8 top-0 text-base ".concat(e.iconClass||""),children:(0,r.jsx)("i",{className:e.icon})})]})},s))})]})]})};s.Z=u},17681:function(e,s,a){"use strict";a.r(s),a.d(s,{__N_SSP:function(){return w}});var r=a(85893),t=a(67294);a(25675),a(41664);var o=a(11163),l=a(85574);a(35271);var n=a(82940),i=a(8946),c=a(8193);a(43812);var d=a(68015),u=a(15268),m=a(66506),f=a(14762),h=a(4422),p=a(15788),x=a(71846);let A=()=>{let e=(0,o.useRouter)(),[s,a]=(0,t.useState)(!1),{clearUser:A,userDetails:w,goldPlanEnable:g,buySellEnable:b,websiteStatus:y}=(0,t.useContext)(l.UserContext),j=(0,n.b)(),{jboId:C}=(0,d.useJobId)(),P=(0,h.Z)("User Change password Page"),[N,v]=(0,t.useState)(!1),[E,k]=(0,t.useState)({}),[S,B]=(0,t.useState)({oldPassword:"",newPassword:"",confirmPassword:""}),[M,_]=(0,t.useState)({oldPassword:!1,newPassword:!1,confirmPassword:!1}),[I,Z]=(0,t.useState)({newPassword:"",confirmPassword:""}),Q=e=>{k(e),v(!0)},D=()=>{v(!1),E.redirectOnClose&&e.push(E.redirectOnClose)},[z,T]=(0,t.useState)(!1),U=e=>{_(s=>({...s,[e]:!s[e]}))},F=e=>{let{name:s,value:a}=e.target;B(e=>({...e,[s]:a})),("newPassword"===s||"confirmPassword"===s)&&(a.length>0&&a.length<8?Z(e=>({...e,[s]:"Password must be at least 8 characters long."})):Z(e=>({...e,[s]:""})))},O=()=>S.newPassword.length<8?(Z(e=>({...e,newPassword:"Password must be at least 8 characters long."})),!1):S.newPassword===S.confirmPassword||(Z(e=>({...e,confirmPassword:"Passwords do not match."})),!1);(0,t.useEffect)(()=>{P()},[]);let L=async e=>{if(e.preventDefault(),Z({newPassword:"",confirmPassword:""}),!O())return;let s={oldpassword:S.oldPassword,newpassword:S.newPassword,confirmpassword:S.confirmPassword,user_id:null==w?void 0:w.user_id};try{let a=await j.post("user/changePassword",s);1===a.data.status?Q({type:"success",title:"Success!",subText:"Password changed successfully!",onConfirm:D,onClose:D,autoClose:2,redirectOnClose:"/profile/User",showConfirmButton:!1,showCancelButton:!1}):Q({type:"error",title:"Error!",subText:a.data.message||"Failed to change password.",autoClose:2,showConfirmButton:!1,showCancelButton:!1,onClose:D})}catch(o){var r;let t=(null==o?void 0:null===(r=o.response)||void 0===r?void 0:r.data)?o.response.data:"";(0,u.Z)({job_id:C,endpoint:"user/changePassword",payload:s,responseData:t,errorMsg:o}),Q({type:"error",title:"Error!",subText:"An error occurred while changing the password.",autoClose:2,showConfirmButton:!1,showCancelButton:!1,onClose:D})}},R=()=>{a(!0)},W=()=>{A(),a(!1),window.location.href="/"};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Z,{label:"My Account"}),(0,r.jsxs)("div",{className:"block xl:container px-4 lg:grid grid-cols-12 items-start gap-6 pt-4 pb-16",children:[(0,r.jsx)(x.Z,{user:i.Z,userDetails:w,goldPlanEnable:g,buySellEnable:b,websiteStatus:y,handleLogout:R,applySiteStatus:!1,selectedPage:"/profile/ChangePassword"}),(0,r.jsxs)("div",{className:"col-span-9 shadow-lg rounded-lg bg-white p-8 mt-6 lg:mt-0",children:[(0,r.jsx)("h1",{className:"sr-only",children:"Change Password"}),(0,r.jsxs)("form",{onSubmit:L,className:"space-y-6",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("label",{htmlFor:"oldPassword",className:"block text-gray-700 font-medium mb-2",children:"Current Password"}),(0,r.jsx)("input",{type:M.oldPassword?"text":"password",name:"oldPassword",value:S.oldPassword,onChange:F,className:"w-full px-4 py-2 border rounded-md text-gray-700 focus:ring-primary focus:border-primary",placeholder:"Enter current password",required:!0}),(0,r.jsx)("span",{className:"absolute top-7 inset-y-0 right-0 flex items-center pr-3 cursor-pointer",onClick:()=>U("oldPassword"),children:M.oldPassword?(0,r.jsx)(c.I0d,{size:24}):(0,r.jsx)(c.Zju,{size:24})})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("label",{htmlFor:"newPassword",className:"block text-gray-700 font-medium mb-2",children:"New Password"}),(0,r.jsx)("input",{type:M.newPassword?"text":"password",name:"newPassword",value:S.newPassword,onChange:F,className:"w-full px-4 py-2 border rounded-md text-gray-700 focus:ring-primary focus:border-primary",placeholder:"Enter new password",required:!0}),(0,r.jsx)("span",{className:"absolute top-7 inset-y-0 right-0 flex items-center pr-3 cursor-pointer",onClick:()=>U("newPassword"),children:M.newPassword?(0,r.jsx)(c.I0d,{size:24}):(0,r.jsx)(c.Zju,{size:24})})]}),I.newPassword&&(0,r.jsx)("span",{className:"text-red-500 text-sm",children:I.newPassword}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("label",{htmlFor:"confirmPassword",className:"block text-gray-700 font-medium mb-2",children:"Confirm Password"}),(0,r.jsx)("input",{type:M.confirmPassword?"text":"password",name:"confirmPassword",value:S.confirmPassword,onChange:F,className:"w-full px-4 py-2 border rounded-md text-gray-700 focus:ring-primary focus:border-primary",placeholder:"Re-enter new password",required:!0}),(0,r.jsx)("span",{className:"absolute top-7 inset-y-0 right-0 flex items-center pr-3 cursor-pointer",onClick:()=>U("confirmPassword"),children:M.confirmPassword?(0,r.jsx)(c.I0d,{size:24}):(0,r.jsx)(c.Zju,{size:24})})]}),I.confirmPassword&&(0,r.jsx)("span",{className:"text-red-500 text-sm",children:I.confirmPassword}),(0,r.jsx)("div",{className:"mt-10",children:(0,r.jsx)("button",{type:"submit",className:"mt-4 px-6 py-2 text-white bg-primary rounded hover:bg-primary-dark transition",children:"Save Changes"})})]})]})]}),(0,r.jsx)(m.Z,{isOpen:s,onClose:()=>a(!1),onConfirm:W}),(0,r.jsx)(f.Z,{isOpen:N,type:E.type,title:E.title,subText:E.subText,onConfirm:E.onConfirm,onClose:D,autoClose:E.autoClose,confirmLabel:E.confirmLabel,cancelLabel:E.cancelLabel,showConfirmButton:E.showConfirmButton,showCancelButton:E.showCancelButton,showCloseIcon:!0,redirectOnClose:E.redirectOnClose})]})};var w=!0;s.default=A}},function(e){e.O(0,[4617,7066,3495,5675,1664,7460,17,2940,5271,9774,2888,179],function(){return e(e.s=55301)}),_N_E=e.O()}]);
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.