PageSourceSearch

https://keykorea.vercel.app/_next/static/chunks/pages/settings-6666a36ad439a507e5f3.js

js keykorea.vercel.app collected 2026-10-03 07:11:23 UTC 15,005 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{37162:function(e,r,n){"use strict";var i=n(85893),s=n(68527),t=n(49609);r.Z=function(){return(0,i.jsx)(s.xu,{pt:"8",w:"full",children:(0,i.jsx)(s.M5,{children:(0,i.jsx)(t.$,{color:"blue.400"})})})}},99802:function(e,r,n){"use strict";n.d(r,{y:function(){return i}});var i=/^[a-z0-9]+$/i},84144:function(e,r,n){"use strict";n.d(r,{h:function(){return a}});var i=n(55645),s=n(85893),t=n(6886),o=n(68527),a=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"6";return e&&e.response&&e.response.data?e.response.data.detail?(0,s.jsxs)(t.bZ,{marginBottom:r,status:"error",children:[(0,s.jsx)(t.zM,{})," ",e.response.data.detail]}):"object"!==typeof e.response.data||Array.isArray(e.response.data)||null==e.response.data?(0,s.jsxs)(t.bZ,{marginBottom:r,status:"error",children:[(0,s.jsx)(t.zM,{})," Internal Server Error"]}):(0,s.jsx)(t.bZ,{marginBottom:r,status:"error",children:(0,s.jsxs)(o.Kq,{children:[(0,s.jsxs)(o.Ug,{ml:"0",pl:"0",children:[(0,s.jsx)(t.zM,{}),(0,s.jsx)(o.xv,{children:"Errors in the following fields"})]}),(0,s.jsx)(o.QI,{children:Object.entries(e.response.data).map((function(e){var r=(0,i.Z)(e,2),n=r[0],t=r[1];return(0,s.jsxs)(o.HC,{ml:"14",children:[(n.charAt(0).toUpperCase()+n.slice(1)).split("_").join(" ")," ","- ",t[0]||"Unknown Error"]})}))})]})}):(0,s.jsxs)(t.bZ,{marginBottom:r,status:"error",children:[(0,s.jsx)(t.zM,{})," Internal Server Error"]})}},41390:function(e,r,n){"use strict";n.d(r,{s:function(){return i}});var i=function(){return!1}},50873:function(e,r,n){"use strict";n.d(r,{b:function(){return o}});var i=n(11163),s=n(41390),t=n(89789),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",r=(0,i.useRouter)(),n=(0,t.a)(),o=n.state,a=o.isAuthenticated,c=o.isLoading;return(0,s.s)()||a||c||r.push(e),{isLoading:c}}},67420:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return $}});var i=n(55645),s=n(85893),t=n(67294),o=n(68527),a=n(73465),c=n(11391),d=n(46871),l=n(92809),u=n(809),h=n.n(u),x=n(30266),p=n(93083),f=n(20949),j=n(79762),m=n(54107),g=n(4612),y=n(33441),b=n(7657),v=n(10894),w=n(15193),P=n(58256),O=n(88767),S=n(9669),C=n.n(S),I=n(58747),k=n(89789),z=n(84144),Z=n(19501),_=n(99802);function M(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,i)}return n}function E(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?M(Object(n),!0).forEach((function(r){(0,l.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var L=Z.Ry({username:Z.Z_().required("Required!").matches(_.y,"Usernames must only contain letters or numbers").max(50),bio:Z.Z_().required("Required!").max(500)}),N=function(){var e=(0,x.Z)(h().mark((function e(){var r,n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C().get("".concat(I.M,"/api/user/profile/"));case 2:return r=e.sent,n=r.data,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=function(){var e=(0,x.Z)(h().mark((function e(r){var n,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C().patch("".concat(I.M,"/api/user/profile/"),r);case 2:return n=e.sent,i=n.data,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),q=function(){var e=(0,k.a)().dispatch,r=(0,p.pm)(),n=(0,O.useQuery)("profile-setttings",N),i=n.data,t=n.isLoading,a=(0,O.useMutation)(A,{onSuccess:function(n){e({type:"update",payload:n.username}),r({title:"Updated profile",description:"You have successfully updated your profile",status:"success",position:"top-right",duration:4e3,isClosable:!0})}}),c=a.mutate,d=a.isError,l=a.isLoading,u=a.error;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.xu,{children:(0,s.jsxs)(o.MI,{display:{base:"initial",md:"grid"},columns:{md:3},spacing:{md:6},children:[(0,s.jsx)(o.P4,{colSpan:{md:1},children:(0,s.jsxs)(o.xu,{children:[(0,s.jsx)(o.X6,{fontSize:"lg",fontWeight:"md",lineHeight:"6",children:"Profile"}),(0,s.jsx)(o.xv,{mt:1,fontSize:"sm",color:(0,f.ff)("gray.600","gray.400"),children:"This information will be displayed publicly"})]})}),(0,s.jsx)(o.P4,{mt:[5,null,0],colSpan:{md:2},children:(0,s.jsx)(P.J9,{enableReinitialize:!0,initialValues:{username:i&&i.username||"",bio:i&&i.bio||""},onSubmit:c,validationSchema:L,children:function(){return(0,s.jsxs)(P.l0,{children:[(0,s.jsxs)(o.Kq,{pl:[0,0,6],py:5,spacing:6,children:[(0,s.jsx)(P.gN,{name:"username",children:function(e){var r=e.field,n=e.form;return(0,s.jsxs)(j.NI,{isInvalid:n.errors.username&&n.touched.username,children:[d&&(0,z.h)(u),(0,s.jsx)(m.Od,{width:"100px",isLoaded:!t,children:(0,s.jsx)(j.lX,{children:"Username"})}),(0,s.jsx)(m.Od,{isLoaded:!t,children:(0,s.jsx)(g.II,E(E({},r),{},{id:"username"}))}),(0,s.jsx)(j.J1,{children:n.errors.username})]})}}),(0,s.jsx)(P.gN,{name:"bio",children:function(e){var r=e.field,n=e.form;return(0,s.jsxs)(j.NI,{isInvalid:n.errors.bio&&n.touched.bio,children:[(0,s.jsx)(m.Od,{width:"100px",isLoaded:!t,children:(0,s.jsx)(j.lX,{children:"About"})}),(0,s.jsx)(m.Od,{isLoaded:!t,children:(0,s.jsx)(y.g,E(E({rows:5,shadow:"sm"},r),{},{id:"bio"}))}),(0,s.jsx)(m.Od,{w:"200px",isLoaded:!t,children:n.errors.bio?(0,s.jsx)(j.J1,{children:n.errors.bio}):(0,s.jsx)(j.Q6,{children:"Brief description for your profile"})})]})}}),(0,s.jsxs)(j.NI,{children:[(0,s.jsx)(m.Od,{width:"100px",isLoaded:!t,children:(0,s.jsx)(j.lX,{children:"Photo"})}),(0,s.jsxs)(m.Od,{w:"200px",isLoaded:!t,children:[(0,s.jsxs)(o.kC,{alignItems:"center",mt:1,children:[(0,s.jsx)(b.qE,{src:i&&i.avatar,boxSize:12,bg:(0,f.ff)("gray.100","gray.800"),icon:(0,s.jsx)(v.JO,{boxSize:9,mt:3,rounded:"full",color:(0,f.ff)("gray.300","gray.700")})}),(0,s.jsx)(w.hE,{children:(0,s.jsx)(w.zx,{as:o.rU,target:"_blank",href:"https://en.gravatar.com/support/faq/",type:"button",ml:5,variant:"outline",size:"sm",fontWeight:"medium",_focus:{shadow:"none",underline:"none"},children:"Change"})})]})," "]})]})]}),(0,s.jsx)(o.xu,{py:3,textAlign:"right",children:(0,s.jsx)(w.zx,{isLoading:l,type:"submit",variant:"solid",fontWeight:"md",children:l?"Saving...":"Save Profile Changes"})})]})}})})]})}),(0,s.jsx)(o.xu,{visibility:{base:"hidden",sm:"visible"},"aria-hidden":"true",children:(0,s.jsx)(o.xu,{py:5,children:(0,s.jsx)(o.xu,{borderTop:"solid 1px",borderTopColor:(0,f.ff)("gray.200","whiteAlpha.200")})})})]})},D=n(9680),T=function(){var e=(0,f.If)(),r=e.colorMode,n=e.toggleColorMode;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.xu,{children:(0,s.jsxs)(o.MI,{display:{base:"initial",md:"grid"},columns:{md:3},spacing:{md:6},children:[(0,s.jsx)(o.P4,{colSpan:{md:1},children:(0,s.jsxs)(o.xu,{children:[(0,s.jsx)(o.X6,{fontSize:"lg",fontWeight:"md",lineHeight:"6",children:"Website Preferences"}),(0,s.jsx)(o.xv,{mt:1,fontSize:"sm",color:(0,f.ff)("gray.600","gray.400"),children:"Change how the site looks for you"})]})}),(0,s.jsx)(o.P4,{mt:[5,null,0],colSpan:{md:2},children:(0,s.jsx)(o.Kq,{pl:[0,0,6],py:5,spacing:6,children:(0,s.jsx)(o.xu,{children:(0,s.jsxs)(j.NI,{as:o.P4,children:[(0,s.jsx)(j.lX,{children:"Theme"}),(0,s.jsx)(D.Ee,{children:(0,s.jsxs)(o.Kq,{children:[(0,s.jsx)(o.xu,{onClick:function(){return"light"===r&&n()},children:(0,s.jsx)(D.Y8,{isChecked:"dark"===r,children:"Dark Mode"})}),(0,s.jsx)(o.xu,{onClick:function(){return"dark"===r&&n()},children:(0,s.jsx)(D.Y8,{isChecked:"light"===r,children:"Light Mode"})})]})})]})})})})]})}),(0,s.jsx)(o.xu,{visibility:{base:"hidden",sm:"visible"},"aria-hidden":"true",children:(0,s.jsx)(o.xu,{py:5,children:(0,s.jsx)(o.xu,{borderTop:"solid 1px",borderTopColor:(0,f.ff)("gray.200","whiteAlpha.200")})})})]})};function W(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,i)}return n}function X(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};
1r%2?W(Object(n),!0).forEach((function(r){(0,l.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var R=Z.Ry({password:Z.Z_().min(8,"Too short!").max(50,"Too long!").required("Required"),confirmPassword:Z.Z_().required("Required").oneOf([Z.iH("password"),null],"Passwords must match")}),U=function(){var e=(0,x.Z)(h().mark((function e(r){var n,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C().patch("".concat(I.M,"/api/auth/change-password/"),{password:r.password});case 2:return n=e.sent,i=n.data,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),Y=function(){var e=(0,p.pm)(),r=(0,O.useMutation)(U,{onSuccess:function(){return e({title:"Updated password",description:"You have successfully updated your password",status:"success",position:"top-right",duration:4e3,isClosable:!0})}}),n=r.mutate,i=r.isLoading,t=r.isError,a=r.error;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.xu,{children:(0,s.jsxs)(o.MI,{display:{base:"initial",md:"grid"},columns:{md:3},spacing:{md:6},children:[(0,s.jsx)(o.P4,{colSpan:{md:1},children:(0,s.jsxs)(o.xu,{children:[(0,s.jsx)(o.X6,{fontSize:"lg",fontWeight:"md",lineHeight:"6",children:"Change Password"}),(0,s.jsx)(o.xv,{mt:1,fontSize:"sm",color:(0,f.ff)("gray.600","gray.400"),children:"You can change your own password at any time"})]})}),(0,s.jsx)(o.P4,{mt:[5,null,0],colSpan:{md:2},children:(0,s.jsx)(P.J9,{initialValues:{password:"",confirmPassword:""},validationSchema:R,onSubmit:n,children:function(){return(0,s.jsxs)(P.l0,{children:[(0,s.jsxs)(o.Kq,{pl:[0,0,6],py:5,spacing:6,children:[(0,s.jsx)(P.gN,{name:"password",children:function(e){var r,n=e.f
1ield,i=e.form;return(0,s.jsxs)(j.NI,{isInvalid:i.errors.password&&i.touched.password,as:o.P4,children:[t&&(0,z.h)(a),(0,s.jsx)(j.lX,{children:"New Password"}),(0,s.jsx)(g.II,X(X({},n),{},(r={type:"tel",width:"100%"},(0,l.Z)(r,"type","password"),(0,l.Z)(r,"rounded","md"),r))),(0,s.jsx)(j.J1,{children:i.errors.password})]})}}),(0,s.jsx)(P.gN,{name:"confirmPassword",children:function(e){var r=e.field,n=e.form;return(0,s.jsxs)(j.NI,{isInvalid:n.errors.confirmPassword&&n.touched.confirmPassword,as:o.P4,children:[(0,s.jsx)(j.lX,{children:"New Password Confirm"}),(0,s.jsx)(g.II,X(X({},r),{},(0,l.Z)({type:"tel",width:"100%",rounded:"md"},"type","password"))),(0,s.jsx)(j.J1,{children:n.errors.confirmPassword})]})}})]}),(0,s.jsx)(o.xu,{py:3,textAlign:"right",children:(0,s.jsx)(w.zx,{type:"submit",isLoading:i,variant:"solid",fontWeight:"md",children:i?"Updating...":"Update Password"})})]})}})})]})}),(0,s.jsx)(o.xu,{visibility:{base:"hidden",sm:"visible"},"aria-hidden":"true",children:(0,s.jsx)(o.xu,{py:5,children:(0,s.jsx)(o.xu,{borderTop:"solid 1px",borderTopColor:(0,f.ff)("gray.200","whiteAlpha.200")})})})]})},K=n(55667),J=n(9457),F=function(){var e=(0,x.Z)(h().mark((function e(){var r,n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C().delete("".concat(I.M,"/api/user/"));case 2:return r=e.sent,n=r.data,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){var e=t.useState(!1),r=(0,i.Z)(e,2),n=r[0],a=r[1],c=function(){return a(!1)},d=t.useRef(),l=(0,k.a)().dispatch,u=(0,p.pm)(),h=(0,O.useMutation)(F,{onSuccess:function(){l({type:"logout"}),(0,J.u)(),localStorage.removeItem("access-token"),localStorage.removeItem("refresh-token"),c(),u({title:"Deleted account",description:"You have successfully deleted your account",status:"success",position:"top-right",duration:4e3,isClosable:!0})}}),x=h.mutate,j=(h.isLoading,h.isError),m=h.error;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.xu,{children:(0,s.jsxs)(o.MI,{display:{base:"initial",md:"grid"},columns:{md:3},spacing:{md:6},children:[(0,s.jsx)(o.P4,{colSpan:{md:1},children:(0,s.jsxs)(o.xu,{children:[(0,s.jsx)(o.X6,{fontSize:"lg",fontWeight:"md",lineHeight:"6",children:"Delete Account"}),(0,s.jsx)(o.xv,{mt:1,fontSize:"sm",color:(0,f.ff)("gray.600","gray.400"),children:"You can delete your account at any time"})]})}),(0,s.jsx)(o.P4,{mt:[5,null,0],colSpan:{md:2},children:(0,s.jsx)(o.xu,{pl:[0,0,6],py:3,textAlign:"right",children:(0,s.jsx)(w.zx,{onClick:function(){return a(!0)},variant:"solid",fontWeight:"md",children:"Delete Account"})})})]})}),(0,s.jsx)(o.xu,{visibility:{base:"hidden",sm:"visible"},"aria-hidden":"true",children:(0,s.jsx)(o.xu,{py:5,children:(0,s.jsx)(o.xu,{borderTop:"solid 1px",borderTopColor:(0,f.ff)("gray.200","whiteAlpha.200")})})}),(0,s.jsx)(K.aR,{isCentered:!0,isOpen:n,leastDestructiveRef:d,onClose:c,children:(0,s.jsx)(K.dh,{children:(0,s.jsxs)(K._T,{children:[(0,s.jsx)(K.fY,{fontSize:"lg",fontWeight:"bold",children:"Delete Account"}),(0,s.jsxs)(K.iP,{children:[j&&(0,z.h)(m),"Are you sure? You can't undo this action afterwards."]}),(0,s.jsxs)(K.xo,{children:[(0,s.jsx)(w.zx,{ref:d,onClick:c,children:"Cancel"}),(0,s.jsx)(w.zx,{colorScheme:"red",onClick:x,ml:3,children:"Delete"})]})]})})})]})},B=n(50873),Q=n(37162),G=n(14428),V=[{heading:"General Settings",name:"General",content:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(q,{})})},{heading:"Security and Privacy Settings",name:"Security and Privacy",content:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Y,{}),(0,s.jsx)(H,{})]})},{heading:"Website Preferences",name:"Website Preferences",content:(0,s.jsx)(T,{})}],$=function(){(0,G.Z)("KeyKorea - Settings");var e=(0,B.b)("/auth/sign-in").isLoading,r=t.useRef(),n=t.useState(0),l=(0,i.Z)(n,2),u=l[0],h=l[1];return e?(0,s.jsx)(Q.Z,{}):(0,s.jsx)(o.W2,{pt:"8",maxW:"container.xl",children:(0,s.jsxs)(o.gC,{spacing:2,width:"100%",align:"stretch",children:[(0,s.jsx)(o.X6,{ref:r}),(0,s.jsxs)(a.mQ,{isLazy:!0,variant:"enclosed",index:u,onChange:function(e){h(e)},children:[(0,s.jsx)(c.Ph,{onChange:function(e){return h(1*e.target.value)},display:{base:"flex",lg:"none"},children:V.map((function(e,r){return(0,s.jsx)("option",{value:r,children:e.name},r)}))}),(0,s.jsx)(a.td,{display:{base:"none",lg:"flex"},children:V.map((function(e,r){return(0,s.jsx)(a.OK,{children:e.name},r)}))}),(0,s.jsx)(a.nP,{children:V.map((function(e,n){return(0,s.jsxs)(a.x4,{paddingX:"0",children:[(0,s.jsx)(d.h_,{containerRef:r,children:e.heading}),e.content]},n)}))})]})]})})}},16944:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return n(67420)}])}},function(e){e.O(0,[729,667,407,92,683,199,774,888,179],(function(){return r=16944,e(e.s=r);var r}));var r=e.O();_N_E=r}]);

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.