1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3e79cce9-bec7-4488-94f3-32232740ca97",e._sentryDebugIdIdentifier="sentry-dbid-3e79cce9-bec7-4488-94f3-32232740ca97")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9415],{48028:function(e,t,r){"use strict";r.d(t,{u:function(){return UserDashBoardErrorDialog}});var n=r(4609),i=r(11250),a=r(78011),o=r(18726),l=r(60237),c=r(74959),s=r(47627),d=r(39036),u=r(27719);r(44194);var p=r(11461),f=r(2e3),h=r(62940),UserDashBoardErrorDialog=function(e){var t=e.openDialog,r=e.setOpenDialog,g=(0,a.Z)(),m=(0,p.$G)().t,b=(0,f.bj)(),handleCloseDialog=function(){r({status:!1,message:void 0})};return t.message?(0,h.BX)(o.Z,{fullScreen:!!b.isMobile,open:t.status,onClose:handleCloseDialog,PaperProps:{sx:{borderRadius:{desktop:"16px",tablet:"16px",mobile:"0px"},p:"24px"}},children:[(0,h.tZ)(l.Z,{"aria-label":"close",sx:{position:"absolute",right:0,top:0,color:g.palette.primary.darkGray},onClick:handleCloseDialog,children:(0,h.tZ)(n.Z,{width:24,height:24})}),(0,h.BX)(c.Z,{sx:{textAlign:"center"},children:[(0,h.tZ)(i.Z,{width:48,height:48,color:g.palette.secondary.red}),(0,h.tZ)(s.ZP,{sx:{mt:2},children:(0,h.tZ)(d.Z,{variant:"h4",children:m("user-profile-page.error.title")})}),(0,h.tZ)(s.ZP,{sx:{mt:2,mb:3},children:(0,h.tZ)(d.Z,{variant:"body",children:void 0!==t.message?t.message:""})}),(0,h.tZ)(u.Z,{variant:"contained",fullWidth:!0,size:"medium",onClick:handleCloseDialog,children:m("user-profile-page.error.button")})]})]}):null}},67477:function(e,t,r){"use strict";r.d(t,{S:function(){return TitleUserDashboard}});var n=r(84302),i=r(2e3),a=r(92406),o=r(90253),l=r(60237),c=r(39036),s=r(1597),d=r(62940);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var TitleUserDashboard=function(e){var t=e.title,r=e.centerTitleOnMobile,u=(0,s.useRouter)(),p=(0,i.bj)(),f=void 0!==r&&r&&p.isMobile;return(0,d.BX)(o.Z,{direction:"row",alignItems:"center",sx:{justifyContent:"flex-start"},children:[(0,d.tZ)(l.Z,{"aria-label":"back",onClick:function(){u.back()},sx:{p:0,mr:2,color:"inherit",flexShrink:0},children:(0,d.tZ)(a.Z,{width:p.isMobile?24:28,height:p.isMobile?24:28})}),(0,d.tZ)(c.Z,{variant:p.isMobile&&!f?"h4":"h3",fontWeight:700,sx:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({minWidth:0,overflowWrap:"anywhere",wordBreak:"break-word",whiteSpace:"pre-line"},f&&{flexGrow:1,textAlign:"center",pr:"40px"}),children:void 0===t?"":t})]})}},84674:function(e,t,r){"use strict";r.d(t,{F:function(){return ProtectRoute}});var n=r(37403),i=r(1597),a=r(44194),o=r(84239),l=r(62940),ProtectRoute=function(e){var t=e.children,r=(0,o.aC)();return useRedirectIfUnAuth((0,n.kr)()),(0,l.tZ)(l.HY,{children:r.accessToken?t:null})},useRedirectIfUnAuth=function(e){var t=(0,i.useRouter)(),r=(0,o.aC)();(0,a.useEffect)(function(){t.isReady&&!r.accessToken&&t.replace(e)},[t.isReady,r.accessToken,e])}},91485:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return EditProfilePageRoute}});
1var n=r(83102),i=r(84302),a=r(30179),o=r(76880),l=r.n(o),c=r(67477),s=r(67546),d=r(52218),u=r(84239),p=r(52153),f="YYYY-MM-DD",h=r(37403),g=r(33111),m=r(45718),b=r(99717),Z=r(78011),y=r(56602),v=r(43206),x=r(47627),w=r(90253),E=r(39036),P=r(6255),k=r(49057),S=r(6810),_=r(27719),j=r(47243),D=r(27866),O=r(22057),N=r(27469),C=r.n(N),R=r(58519),I=r(89771),A=r(1597),B=r(44194),M=r(11461),T=r(48028),U=r(24231),X=r(2080),G=r(76313),L=r(35918),Y=r(8898),z=r(62940),K=["imgUrl","onImgChange","circle"],ProfilePicture=function(e){var t=e.imgUrl,r=e.onImgChange,n=e.circle,i=(0,U.Z)(e,K),a=(0,M.$G)().t,o=(0,B.useState)(!1),l=o[0],c=o[1],s=(0,B.useState)(),d=s[0],u=s[1],p=(0,B.useState)(void 0),f=p[0],h=p[1],g=(0,B.useRef)(null),handleSelectImage=function(){g.current&&g.current.click()};return(0,z.BX)(z.HY,{children:[(0,z.BX)("div",{className:"flex gap-x-4",children:[(0,z.tZ)(L.Z,{src:null!=t?t:"",className:"w-24 h-24"}),(0,z.BX)("div",{className:"flex flex-col h-fit gap-y-1 my-auto",children:[a("edit-profile-page.profile-picture"),(0,z.tZ)("p",{className:"my-0 text-xs text-ci-gray",children:a("image.recommend-size",{w:300,h:300})}),(0,z.BX)(Y.Z,{component:"button",className:"flex gap-x-1 items-center",onClick:handleSelectImage,children:[(0,z.tZ)(G.Z,{width:16,height:16}),(0,z.tZ)("p",{className:"my-0 text-base",children:i.linkText})]})]})]}),d&&f&&(0,z.tZ)(X.f,{image:d,size:f,circle:n,open:l,onClose:function(){c(!1),h(void 0)},onCrop:function(e){var t=URL.createObjectURL(e),n=new FileReader;n.readAsDataURL(e),n.onload=function(e){var t,r=new Image;e.target&&(r.src=null===(t=e.target)||void 0===t?void 0:t.result,r.onload=function(){h({w:r.width,h:r.height})})},u(e),c(!1),r(t,e)},onSelectNewImg:handleSelectImage}),(0,z.tZ)("input",{ref:g,type:"file",className:"hidden",onChange:function(){if(g.current&&g.current.files){var e=g.current.files[0],t=new FileReader;t.readAsDataURL(e),t.onload=function(e){var t,r=new Image;e.target&&(r.src=null===(t=e.target)||void 0===t?void 0:t.result,r.onload=function(){h({w:r.width,h:r.height})})},u(e),c(!0),g.current.value=""}}})]})};function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,i.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var W=(0,I.Pi)(function(){var e,t=(0,u.aC)(),r=(0,Z.Z)(),n=(0,A.useRouter)(),i=(0,d.l)(),o=(0,M.$G)().t,p=(0,s.Ek)().authAPI,N=p("/me").method("get").create(),R=p("/update-profile").method("post").create(),I=(0,B.useState)({}),U=I[0],X=I[1],G=(0,B.useState)({status:!1,message:void 0}),L=G[0],Y=G[1],K=(0,B.useState)(!1),W=K[0],H=K[1],$=(0,B.useState)(""),q=$[0],J=$[1],Q=(0,B.useState)(null),V=Q[0],ee=Q[1];(0,B.useEffect)(function(){var e,t=!0,r=new AbortController;return(e=(0,a.Z)(l().mark(function _callee(){var e;return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,N({},{signal:null==r?void 0:r.signal});case 3:e=n.sent.data,t&&(null==e?void 0:e.me)!==void 0&&(X(e.me),e.me.profilePicture&&J(e.me.profilePicture)),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),n.t0 instanceof N.Error&&console.error(null===n.t0||void 0===n.t0?void 0:n.t0.getActualType());case 11:case"end":return n.stop()}},_callee,null,[[0,8]])})),function(){return e.apply(this,arguments)})(),function(){t=!1,r.abort()}},[null==t?void 0:t.accessToken]);var et=(e=(0,a.Z)(l().mark(function _callee2(){var e,t;return l().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(H(!0),r.prev=1,e={userName:null==U?void 0:U.userName,firstName:null==U?void 0:U.firstName,lastName:null==U?void 0:U.lastName,birthday:null!=U&&U.birthday?C()(U.birthday).format(f):void 0,gender:null==U?void 0:U.gender},!V){r.next=8;break}return r.next=6,i(V,V.type);case 6:t=r.sent,e.profilePicture={tmpPath:t,name:"profile-picture"};case 8:return r.next=10,R(e);case 10:r.sent.data&&(H(!1),n.push((0,h.du)("profile"))),r.next=19;break;case 15:r.prev=15,r.t0=r.catch(1),H(!1),Y({status:!0,message:mapUpdateProfileError(r.t0)});case 19:case"end":return r.stop()}},_callee2,null,[[1,15]])})),function(){return e.apply(this,arguments)});return(0,z.BX)(y.Z,{sx:{marginBottom:"50px",mt:3,width:{desktop:"816px",tablet:"512px",mobile:"340p
1x"}},children:[(0,z.tZ)(c.S,{title:o("edit-profile-page.page-title")}),(0,z.tZ)(v.Z,{variant:"outlined",sx:{mt:3,p:{desktop:3,tablet:3,mobile:0},borderRadius:"8px",borderStyle:{desktop:"solid",tablet:"solid",mobile:"hidden"}},children:(0,z.BX)(x.ZP,{container:!0,spacing:2,sx:{width:"100%"},children:[(0,z.tZ)(x.ZP,{item:!0,desktop:12,tablet:12,mobile:12,children:(0,z.tZ)("div",{className:"w-fit",children:(0,z.tZ)(ProfilePicture,{imgUrl:q||null,onImgChange:function(e,t){J(e),ee(t)},icon:(0,z.tZ)(g.Z,{}),text:o("edit-profile-page.user-image"),linkText:o("image.select"),circle:!0,fileType:["jpg","png","gif"]})})}),(0,z.tZ)(x.ZP,{item:!0,desktop:6,tablet:12,mobile:12,children:(0,z.BX)(w.Z,{spacing:1,children:[(0,z.BX)(E.Z,{variant:"body",children:[" ",o("edit-profile-page.user-name")]}),(0,z.tZ)(P.Z,{value:null==U?void 0:U.userName,error:L.status,onChange:function(e){X(_objectSpread(_objectSpread({},U),{},{userName:e.target.value}))}})]})}),(0,z.tZ)(x.ZP,{item:!0,desktop:6,tablet:12,mobile:12,sx:{width:"100%"}}),(0,z.tZ)(x.ZP,{item:!0,desktop:6,tablet:12,mobile:12,sx:{width:"100%"},children:(0,z.BX)(w.Z,{spacing:1,children:[(0,z.tZ)(E.Z,{variant:"body",children:o("edit-profile-page.user-first-name")}),(0,z.tZ)(P.Z,{value:null==U?void 0:U.firstName,error:L.status,onChange:function(e){X(_objectSpread(_objectSpread({},U),{},{firstName:e.target.value}))}})]})}),(0,z.tZ)(x.ZP,{item:!0,desktop:6,tablet:12,mobile:12,sx:{width:"100%"},children:(0,z.BX)(w.Z,{spacing:1,children:[(0,z.tZ)(E.Z,{variant:"body",children:o("edit-profile-page.user-last-name")}),(0,z.tZ)(P.Z,{value:null==U?void 0:U.lastName,error:L.status,onChange:function(e){X(_objectSpread(_objectSpread({},U),{},{lastName:e.target.value}))}})]})}),(0,z.tZ)(x.ZP,{item:!0,desktop:6,tablet:12,mobile:12,sx:{width:"100%"},children:(0,z.BX)(w.Z,{spacing:1,children:[(0,z.tZ)(E.Z,{variant:"body",children:o("edit-profile-page.user-birthday")}),(0,z.tZ)(O._,{dateAdapter:D.y,children:(0,z.tZ)(j.M,{inputFormat:"DD/MM/YYYY",disableFuture:!0,onChange:function(e){X(_objectSpread(_objectSpread({},U),{},{birthday:e?e.format(f):void 0}))},value:null!=U&&U.birthday&&(null==U?void 0:U.birthday)!==""?C()(U.birthday,f):null,components:{OpenPickerIcon:m.UilCalender},renderInput:function(e){return(0,z.tZ)(P.Z,_objectSpread({error:L.status,variant:"outlined",size:"small",sx:{borderRadius:"8px",maxWidth:"200px"}},e))}})})]})}),(0,z.tZ)(x.ZP,{item:!0,desktop:6,tablet:12,mobile:12,sx:{width:"100%"}}),(0,z.BX)(x.ZP,{item:!0,desktop:6,tablet:12,mobile:12,sx:{width:"100%"},children:[(0,z.tZ)(x.ZP,{sx:{mb:1},children:(0,z.tZ)(E.Z,{variant:"body",color:"primary.darkGray",children:o("edit-profile-page.user-gender")})}),(0,z.BX)(k.Z,{color:"primary",value:null!=U&&U.gender?null==U?void 0:U.gender:"GENDER_UNSPECIFIED",exclusive:!0,onChange:function(e){"GENDER_MALE"==e.target.value?X(_objectSpread(_objectSpread({},U),{},{gender:"GENDER_MALE"})):"GENDER_FEMALE"==e.target.value?X(_objectSpread(_objectSpread({},U),{},{gender:"GENDER_FEMALE"})):X(_objectSpread(_objectSpread({},U),{},{gender:"GENDER_UNSPECIFIED"}))},sx:{"& .MuiToggleButtonGroup-grouped":{border:"1px solid ","&.Mui-disabled":{border:"1px solid ".concat(r.palette.primary.gray)},"&:not(:first-of-type)":{borderLeft:"1px solid",borderRadius:"30px"},"&:first-of-type":{borderRadius:"30px"},"&.Mui-selected":{background:r.palette.primary.white,fontSize:"16px",marginLeft:"0px","&:hover":{background:r.palette.primary.white,fontSize:"16px"}},"&:not(.Mui-selected)":{fontWeight:400,fontSize:"16px",border:"1px solid ".concat(r.palette.primary.gray),color:r.palette.primary.darkGray,marginLeft:"0px"}}},children:[(0,z.tZ)(S.Z,{value:"GENDER_MALE",sx:{mr:"12px",width:"73px",height:"32px"},children:o("edit-profile-page.gender-male")}),(0,z.tZ)(S.Z,{value:"GENDER_FEMALE",sx:{mr:"12px",width:"73px",height:"32px"},children:o("edit-profile-page.gender-female")}),(0,z.tZ)(S.Z,{value:"GENDER_UNSPECIFIED",sx:{mr:"12px",width:"73px",height:"32px"},children:o("edit-profile-page.gender-unspecified")})]})]}),(0,z.tZ)(x.ZP,{item:!0,mobile:12,sx:{width:"100%",mt:3},children:(0,z.BX)(w.Z,{spacing:2,children:[(0,z.tZ)(b.Z,{variant:"contained",loading:W,size:"medium",sx:{width:"100%"},onClick:et,children:o("edit-profile-page.button-save")}),(0,z.tZ)(_.Z,{variant:"text",size:"medium",sx:{width:"100%",fontWeight:700,fontSize:"16px",color:r.palette.primary.darkGray,borderRadius:"16px"},onClick:function(){n.push((0,h.du)("profile"))},children:o("edit-profile-page.button-cancel")})]})})]})}),(0,z.tZ)(T.u,{openDialog:L,setOpenDialog:Y})]})}),mapUpdateProfileError=function(e){if("username-duplicate"===(0,p.errToAppErr)(e).detail)return R.ZP.t("user-profile-page.error.username-duplicate");if(!(0,p.isInvalidArgsErr)(e))return(0,z.tZ)(z.HY,{children:R.ZP.t((0,p.errToDefaultI18nKey)(e))});var t,r=(0,p.errToAppErr)(e),n=[],i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(e,t)}}(e))){r&&(e=r);var n=0,F=function(){};return{s:F,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:F}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}(r.details);try{for(i.s();!(t=i.n()).done;){var a=t.value;switch("".concat(a.field,"-").concat(a.description)){case"username-duplicate":case"username-empty":case"username-frequency":case"username-format":case"firstName-length":case"lastName-length":case"gender-not-support":case"birthday-format":case"birthday-timing":n.push("user-profile-page.error.".concat(a.field,"-").concat(a.description));break;default:n.push(a.description)}}}catch(e){i.e(e)}finally{i.f()}return(0,z.tZ)(E.Z,{align:"left",children:(0,z.tZ)("ul",{children:n.map(function(e){return(0,z.tZ)("li",{children:(0,R.t)(e)},e)})})})},H=r(84674);function EditProfilePageRoute(){return(0,z.tZ)(n.H,{children:(0,z.tZ)(
1H.F,{children:(0,z.tZ)(W,{})})})}},57298:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user-dashboard/edit-profile",function(){return r(91485)}])}},function(e){e.O(0,[7383,6255,4987,6950,7011,2941,3405,9774,2888,179],function(){return e(e.s=57298)}),_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.