1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5cff5264-bdf5-45df-9f61-317cb734f00e",e._sentryDebugIdIdentifier="sentry-dbid-5cff5264-bdf5-45df-9f61-317cb734f00e")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7733],{5752:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var a=l(37876),n=l(13903);l(14232);let s=e=>{let{id:t="",src:l,className:s="",alt:i="",title:r="",style:o={},placeHolder:c="/images/profiles/placeholder.png",width:d="",height:u="",imageRatio:h,containerClassName:m}=e,x=e=>{e.currentTarget.src=c,(0,n.JV)({Screen:"ImageError",Url:e.currentTarget.src})};return void 0!==h?(0,a.jsx)("div",{className:"w-full h-0 relative overflow-hidden ".concat(m," ").concat(h),children:(0,a.jsx)("img",{id:t,src:l||c,className:"min-w-full min-h-full absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 ".concat(s),alt:i,title:r,width:d,height:u,onError:x,"original-src":l})}):(0,a.jsx)("img",{id:t,style:o,src:l||c,className:s,alt:i,title:r,width:d,height:u,onError:x})}},10514:e=>{e.exports={blinkCaret:"SingleOtpInput_blinkCaret__7Ag3Z",blink:"SingleOtpInput_blink__VfN3C"}},17909:e=>{e.exports={enabledButton:"ModalPin_enabledButton__Xsu8K",disabledButton:"ModalPin_disabledButton__unkqZ"}},28500:e=>{e.exports={disabledText:"ProfileButton_disabledText__xvCP2"}},42980:e=>{e.exports={enabledButton:"ProfileForm_enabledButton__JADtq",disabledButton:"ProfileForm_disabledButton__Ioira"}},48495:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var a=l(37876);l(14232);var n=l(28500),s=l.n(n);let i=e=>{let{content:t="Button",disabled:l=!1,variant:n="",width:i="",className:r="fpl-bg",onClickBtn:o,children:c}=e;return(0,a.jsx)("button",{disabled:l,onClick:()=>{o&&o()},className:"\n rounded-[40px] cursor-pointer px-5 py-[13px] text-base font-semibold leading-5\n flex items-center justify-center\n border-none outline-none\n transition-all duration-200\n whitespace-nowrap\n md:px-10 md:text-base md:leading-6\n ".concat("dark"===n?"text-[#d2d2d2] bg-[#2c2c2e]":"","\n ").concat("full"===i?"w-full":"","\n ").concat(l?"cursor-not-allowed ".concat(s().disabledText):"text-white-smoke","\n ").concat(r||"","\n "),children:c||t})}},50467:(e,t,l)=>{"use strict";l.d(t,{z:()=>a});let a=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/Ä/g,"d").replace(/Ä/g,"D")},55483:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var a=l(37876),n=l(14232),s=l(10514),i=l.n(s);let r=e=>{let{value:t="",focus:l=!1,inputClasses:s="",inputType:r="tel",shouldAutoFocus:o=!1,disableAutoMask:c=!1,onPaste:d,onFocus:u,onBlur:h,onChange:m,onKeyDown:x}=e,[p,g]=(0,n.useState)(t),[f,v]=(0,n.useState)(!1),b=(0,n.useRef)(null);return(0,n.useEffect)(()=>{t!==p&&g(t)},[t]),(0,n.useEffect)(()=>{l&&b.current&&(b.current.focus(),b.current.select())},[l]),(0,n.useEffect)(()=>{"error"===s&&b.current&&g("")},[s]),(0,n.useEffect)(()=>{if(p&&!c){v(!1);let e=setTimeout(()=>{v(!0)},500);return()=>clearTimeout(e)}v(!1)},[p,c]),(0,a.jsxs)("div",{className:"flex items-center",children:[l&&!p&&(0,a.jsx)("span",{className:"absolute bottom-[7px] tablet:bottom-[25px] left-1/2 w-[2px] h-[32px] bg-[#F5F5F4] -translate-x-1/2 ".concat(i().blinkCaret)}),(0,a.jsx)("input",{id:l?"otp-input-focus":void 0,ref:b,value:p,type:f?"password":r,inputMode:"numeric",pattern:"[0-9]*",min:"0",max:"9",maxLength:1,className:"\n caret-transparent\n bg-transparent border-t-0 border-r-0 border-l-0 border-b-2 border-black-olive-404040\n text-center font-bold text-[24px] tablet:text-[40px] leading-[48px] text-white\n p-0 outline-none\n focus:ring-0\n ".concat("error"===s?"border-b-scarlet":"","\n ").concat(s,"\n w-[40px] h-[50px]\n ml-1 mr-1\n tablet:w-[52px] tablet:h-[60px] tablet:mx-[5px]\n tablet:ml-2 tablet:mr-2\n "),autoComplete:"one-time-code",autoFocus:o,onChange:e=>{let t=e.target.value.replace(/[^0-9]/g,"").slice(0,1);g(t),null==m||m(t)},onKeyDown:e=>{if(["Backspace","Delete","Tab","ArrowLeft","ArrowRight"].includes(e.ke
1y)||e.ctrlKey&&("v"===e.key||"V"===e.key)){null==x||x(e);return}if(!/^[0-9]$/.test(e.key))return void e.preventDefault();null==x||x(e)},onPaste:d,onFocus:()=>{var e;null==(e=b.current)||e.select(),null==u||u()},onBlur:h})]})},o=e=>{let{numInputs:t=4,separator:l="",inputClasses:s="",type:i="create",inputType:o="tel",shouldAutoFocus:c=!1,defaultValue:d=[],disableAutoMask:u=!1,onChange:h,onComplete:m}=e,[x,p]=(0,n.useState)(0),[g,f]=(0,n.useState)(d||[]),[v,b]=(0,n.useState)([]);(0,n.useEffect)(()=>{k()},[]),(0,n.useEffect)(()=>{"error"===s&&k()},[s]),(0,n.useEffect)(()=>{if(4===d.length&&"edit"!==i){let e=setTimeout(()=>{p(3)},300);return()=>clearTimeout(e)}},[d,i]);let j=e=>{null===e?p(null):p(Math.max(Math.min(t-1,e),0))},_=()=>{null!==x&&j(x+1)},w=()=>{null!==x&&j(x-1)},N=e=>{if(null===x)return;b([...g]);let l=JSON.parse(JSON.stringify(g));l[x]=e,f(l),null==h||h(l.join("")),v.join("")!==l.join("")&&g.join("").length===t&&x===t-1&&(null==m||m(g.join("")))},k=()=>{g.length>0&&(null==h||h("")),f([]),setTimeout(()=>{p(0)},500)},y=()=>{p(null)},S=e=>{e?(N(e),setTimeout(()=>{_()},50)):N("")},I=e=>{switch(e.keyCode){case 46:e.preventDefault(),N("");break;case 37:e.preventDefault(),w();break;case 39:case 9:e.preventDefault(),_()}"Backspace"===e.key&&(e.preventDefault(),N(""),w())},C=e=>{e.preventDefault(),(e=>{let l=null!=x?x:0,a=e.slice(0,t-l).split("");if("text"!==o&&!a.join("").match(/^\d+$/))return;let n=g.slice(0,l).concat(a);f(n.slice(0,t)),j(n.slice(0,t).length)})(e.clipboardData.getData("text/plain"))};return(0,a.jsxs)("div",{className:"flex justify-center",children:[(0,a.jsx)("input",{autoComplete:"false",name:"hidden",type:"text",className:"hidden"}),Array.from({length:t}).map((e,n)=>(0,a.jsxs)("div",{className:"relative",children:[!g[n]&&x!==n&&(0,a.jsx)("span",{className:"absolute inset-0 bottom-[7px] tablet:bottom-[26px] flex items-center justify-center text-white-smoke text-[24px] tablet:text-[40px] font-semibold pointer-events-none select-none",children:"-"}),(0,a.jsx)(r,{focus:x===n,value:g[n]||"",separator:l,inputType:o,inputClasses:s,isLastChild:n===t-1,shouldAutoFocus:c,disableAutoMask:u,onChange:S,onKeyDown:I,onPaste:C,onFocus:()=>{p(n)},onBlur:y})]},n))]})}},70152:(e,t,l)=>{"use strict";l.r(t),l.d(t,{__N_SSP:()=>H,default:()=>$});var a=l(37876),n=l(89099),s=l(14232),i=l(48495),r=l(5752),o=l(66360);let c=e=>{let{data:t={}}=e,l=(0,n.useRouter)(),i=(0,s.useMemo)(()=>l.pathname.includes("/watching"),[l.pathname]),c=(0,s.useMemo)(()=>!i&&(null==t?void 0:t.allow_edit)==="1",[i,null==t?void 0:t.allow_edit]),d=(0,s.useMemo)(()=>localStorage.getItem(o.fC7),[]),u=(0,s.useMemo)(()=>localStorage.getItem(o.Om4),[]),h=(0,s.useMemo)(()=>!i&&u===o.KUi.KID_PROFILE&&(null==t?void 0:t.profile_id)!==d,[i,u,null==t?void 0:t.profile_id,d]);return(0,a.jsxs)("div",{className:"relative flex flex-col items-center",children:[(null==t?void 0:t.profile_id)===d&&(0,a.jsx)(r.A,{className:"absolute -top-2 left-1/2 w-5 h-5 min-w-5 -translate-x-1/2 md:-top-4 md:w-8 md:h-8 md:min-w-8",src:"/images/profiles/done.png",alt:"done",width:"32px",height:"32px"}),(0,a.jsxs)("div",{className:"relative ".concat(h?"pointer-events-none cursor-not-allowed":"cursor-pointer"),children:[(0,a.jsx)(r.A,{className:"w-18 h-18 min-w-18 rounded-2xl md:w-25 md:h-25 md:min-w-25 lg:w-40 lg:h-40 lg:min-w-40",src:(e=>{let{url:t,width:l,height:a}=e;return t?"".concat(t,"?w=").concat(l,"&h=").concat(a):o.wxC})({url:null==t?void 0:t.avatar_url,width:160,height:160}),alt:(null==t?void 0:t.name)||"Profile Avatar",width:"160px",height:"160px"}),(null==t?void 0:t.profile_type)===o.KUi.KID_PROFILE&&(0,a.jsx)(r.A,{className:"absolute left-1/2 bottom-2.5 w-12 min-w-12 -translate-x-1/2 lg:w-16 lg:min-w-16",src:"/images/profiles/child_2.png",alt:"child",width:"48px",height:"48px"}),c&&(0,a.jsx)("div",{className:"absolute inset-0 z-[1] flex items-center justify-center ".concat(i?"bg-transparent":"bg-black/50"),children:(0,a.jsx)(r.A,{className:"w-5 h-5 min-w-5 md:w-10 md:h-10 md:min-w-10",src:"/images/profiles/edit.png",alt:"edit",width:"40px",height:"40px"})}),(null==t?void 0:t.pin_type)===o.a$_.REQUIRED_PIN&&(0,a.jsx)(r.A,{className:"absolute right-0.5 top-0.5 w-5 h-5 min-w-5 lg:w-8 lg:h-8 lg:min-w-8 lg:right-2 lg:top-2",src:"/images/profiles/lock_white.png",alt:"lock",width:"32px",height:"32px"})]}),(0,a.jsx)("p",{className:"pt-4 text-center text-base leading-6 m-0",children:null==t?void 0:t.name})]})},d=e=>{let{variant:t="",children:l}=e;return(0,a.jsx)("h1",{className:"\n text-white-smoke inline-block font-semibold text-[20px] tablet:text-[32px] leading-[1.3] text-left\n ".concat(t,"\n "),children:l})};var u=l(77430);let h=e=>{let{type:t="edit",heading:l="Chá»nh sá»a há» sÆ¡",addText:n="Th\xeam ngưá»i d\xf9ng",confirmText:h="Ho\xe0n tất",loading:m=!1,clickProfile:x,clickAdd:p,confirm:g}=e,{profiles:f,fetchProfiles:v,isLoading:b}
1=(0,u.D)(),[j,_]=(0,s.useState)(null),[w,N]=(0,s.useState)(null);return(0,s.useEffect)(()=>{_(localStorage.getItem("profile_id")),N(localStorage.getItem(o.Om4)),v()},[v]),(0,a.jsxs)("div",{className:"mx-auto ".concat(m||b?"pointer-events-none":""),children:[(0,a.jsx)("div",{className:"mb-20 2xl:mb-32",children:(0,a.jsx)(d,{children:l})}),(0,a.jsxs)("div",{className:"flex flex-wrap justify-center gap-6 lg:gap-16",children:[f.map((e,t)=>(0,a.jsx)(c,{data:e,isTick:e.profile_id===j,clickProfile:()=>null==x?void 0:x(e)},"profile-".concat(t))),(null==f?void 0:f.length)<5&&w===o.KUi.MASTER_PROFILE&&(0,a.jsxs)("div",{className:"flex flex-col items-center cursor-pointer",onClick:p,children:[(0,a.jsx)("span",{className:"w-18 h-18 min-w-18 rounded-2xl flex items-center justify-center bg-[#202020] hover:bg-[#353535] transition-all duration-300 md:w-25 md:h-25 md:min-w-25 md:rounded-8 lg:w-40 lg:h-40 lg:min-w-40",children:(0,a.jsx)(r.A,{src:"/images/profiles/cancel.png",alt:"add",width:"160px",height:"160px"})}),(0,a.jsx)("p",{className:"pt-4 text-center text-base leading-6 m-0 text-[#616161]",children:n})]})]}),(0,a.jsx)("div",{className:"mt-10 text-center 2xl:mt-20",children:(0,a.jsx)(i.A,{variant:"watching"===t?"dark":"",onClickBtn:g,children:h})})]})};var m=l(31083),x=l(88109),p=l(29287),g=l(4772),f=l(48711),v=l(60184);let b=function(){let{setIsEmpty:e,setIsError:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
1,[l,a]=(0,s.useState)([]),[n,i]=(0,s.useState)(!1),[r,o]=(0,s.useState)(null),c=(0,s.useCallback)(async()=>{i(!0),o(null),null==t||t(!1);try{let n=await (0,m.Qf)();n.success?(null==e||e(0===l.length),a((null==n?void 0:n.data)||[])):(a([]),null==e||e(!0),null==t||t(!0),o(Error(n.error||"Failed to fetch avatars")))}catch(l){a([]),o(l instanceof Error?l:Error("Failed to fetch avatars")),null==e||e(!0),null==t||t(!0)}finally{i(!1)}},[e,t,l.length]);return{avatars:l,fetchAvatars:c,isLoading:n,error:r}};var j=l(26435);let _=e=>{var t;let{title:l="Chá»n ảnh Äại diá»n",defaultAvatar:i={},onChange:o,onClickNav:c}=e,{avatars:u,fetchAvatars:h,isLoading:m,error:x}=b({setIsEmpty:()=>{},setIsError:()=>{}}),p=(0,n.useRouter)(),[g,f]=(0,s.useState)(i),[v,_]=(0,s.useState)([]),w=(null==p||null==(t=p.query)?void 0:t["is-setting"])?"Chá»nh sá»a há» sÆ¡":"Tạo há» sÆ¡";return(0,s.useEffect)(()=>{(async()=>{await h()})()},[]),(0,s.useEffect)(()=>{f(i)},[i]),(0,s.useEffect)(()=>{if(!u.length)return void _([]);_(u.sort((e,t)=>parseInt(e.group_position)-parseInt(t.group_position)))},[u,i]),(0,s.useEffect)(()=>{Object.keys(g).length>0&&(null==o||o(g))},[g]),(0,a.jsx)("div",{className:"max-w-[1916px]",children:(0,a.jsxs)("div",{className:"",children:[(0,a.jsx)("div",{onClick:()=>{null==c||c(g)},className:"relative bigscreen:absolute inline-flex items-center left-0 cursor-pointer min-w-[280px] pl-0 bigscreen:pl-[20px] p-[20px] mb-[22px] bigscreen:mb-0 rounded-[10px] relative hover:bg-eerie-black",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2",children:[(0,a.jsx)(j.JWD,{size:24,className:"text-white-smoke"}),(0,a.jsx)("p",{className:"m-0 text-white",children:w})]})}),(0,a.jsxs)("div",{className:"relative bigscreen:min-w-[916px] bigscreen:absolute bigscreen:right-0 overflow-hidden p-0 bigscreen:p-4 top-0 left-1/2 -translate-x-1/2 mx-auto",children:[(0,a.jsx)("div",{className:"text-left ml-0 xl:ml-4 mb-6 xl:mb-4",children:(0,a.jsx)(d,{children:l})}),(0,a.jsxs)("div",{className:"overflow-auto md:min-w-[888px] p-0 xl:p-4 max-h-custom [&::-webkit-scrollbar]:hidden [-ms-overflow-style:'none'] [scrollbar-width:'none']",children:[m&&(0,a.jsx)("p",{className:"text-center text-gray-500",children:"Loading..."}),x&&(0,a.jsx)("p",{className:"text-center text-red-500 bg-red-100 rounded-lg p-3 mx-4",children:x.message}),v.map((e,t)=>(0,a.jsxs)("div",{className:"mb-[56px] w-full mx-auto",children:[(0,a.jsx)("h3",{className:"text-white-smoke text-lg font-medium mb-4",children:e.group_name}),(0,a.jsx)("div",{className:"\n flex flex-wrap gap-6 gap-[24px] xl:gap-[39px] justify-start\n xl:mb-[56px]\n mx-auto\n ",children:e.avatars.map((t,l)=>(0,a.jsxs)("div",{className:"\n relative cursor-pointer transition-all duration-500 \n hover:opacity-95 hover:scale-105\n ".concat(t.id===(g.avatar_id||(null==g?void 0:g.id))?"rounded-full":"","\n "),onClick:()=>{f(t),null==c||c(t)},children:[(0,a.jsx)(r.A,{className:"h-[80px] w-[80px] xl:h-[140px] xl:w-[140px] rounded-full object-cover",src:t.image||"/images/profiles/placeholder.png",alt:t.name}),t.id===(g.avatar_id||(null==g?void 0:g.id))&&(0,a.jsx)("div",{className:"absolute h-[80px] w-[80px] xl:h-[140px] xl:w-[140px] inset-0 flex items-center justify-center bg-black/50 rounded-full",children:(0,a.jsx)("img",{src:"/images/profiles/done.png",alt:"selected avatar",className:"w-6 h-6"})})]},"avatar-item-".concat(e.group_id,"-").concat(l)))})]},"group-".concat(e.group_id,"-").concat(t)))]})]})]})})};var w=l(86788);let N=e=>{let{defaultValue:t=!1,onChange:l,disabled:n=!1,isKid:i=!1}=e,[r,o]=s.useState(t);return s.useEffect(()=>{o(t)},[t]),(0,a.jsx)("div",{className:"relative inline-flex items-center w-10 h-6 rounded-full cursor-pointer transition-colors duration-300 ".concat(r?"bg-[#ff3d00]":"bg-[#404040]"," ").concat(n?"opacity-37 pointer-events-none":""),onClick:()=>{if(!i&&!n){let e=!r;o(e),null==l||l(e)}},children:(0,a.jsx)("span",{className:"absolute w-[18px] h-[18px] bg-white rounded-full transition-transform duration-300 ".concat(r?"translate-x-[19px]":"translate-x-1")})})};
1var k=l(92917),y=l(75501),S=l(24146),I=l(97250),C=l(22329),E=l(84320),P=l(42980),T=l.n(P),A=l(3898),R=l(50467),D=l(87078),L=l(64941),U=l(11826);let K=/^[0-9a-zA-Z_ÃÃÃÃÃÃÃẾÃĨÃÃÃÃÃÃÃÄÄÅ¨Æ Ã Ã¡Ã¢Ã£Ã¨Ã©Ãªáº¿Ã¬Ä©ÃòóôõùúÄÄũơƯÄẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼá»á»á»Æ°Äạảấầẩẫáºáº¯áº±áº³áºµáº·áº¹áº»áº½á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á» ỢỤỦỨỪá»
á»á»á»á»á»á»á»á»á»á»á»á»á»á»¡á»£á»¥á»§á»©á»«á»¬á»®á»°á»²á»´ÃỶỸá»á»¯á»±á»³Ã½á»µá»·á»¹ ]+$/,B=e=>{var t;let{profile:l={},title:c="",type:u="create",loading:h=!1,errorUpdate:b,listProfiles:j=[],onCancel:P,onConfirm:B,onRemovePin:O}=e,[F,z]=(0,s.useState)(!1),[V,M]=(0,s.useState)(""),[H,$]=(0,s.useState)(!1),[G,X]=(0,s.useState)(""),[J,q]=(0,s.useState)(""),[Q,Z]=(0,s.useState)(""),[W,Y]=(0,s.useState)(!1),[ee,et]=(0,s.useState)(""),[el,ea]=(0,s.useState)({title:"",content:"",buttons:{accept:"X\xf3a",cancel:"Ä\xf3ng"}}),[en,es]=(0,s.useState)(!1),[ei,er]=(0,s.useState)(!0),[eo,ec]=(0,s.useState)({avatar_id:"",avatar_url:""}),[ed,eu]=(0,s.useState)(!1),[eh,em]=(0,s.useState)(!1),[ex,ep]=(0,s.use
1State)(""),[eg,ef]=(0,s.useState)(!1),[ev,eb]=(0,s.useState)(!1),[ej,e_]=(0,s.useState)(!1),[ew,eN]=(0,s.useState)(!1),[ek,ey]=(0,s.useState)(null),[eS,eI]=(0,s.useState)([]),[eC,eE]=(0,s.useState)(!1),[eP,eT]=(0,s.useState)(0),[eA,eR]=(0,s.useState)(""),[eD,eL]=(0,s.useState)([]),[eU,eK]=(0,s.useState)(!1),[eB,eO]=(0,s.useState)(0),[eF,ez]=(0,s.useState)(!1),[eV,eM]=(0,s.useState)(0),[eH,e$]=(0,s.useState)(""),[eG,eX]=(0,s.useState)([]),[eJ,eq]=(0,s.useState)(""),eQ=(0,n.useRouter)(),{isOffline:eZ}=(0,L.h)(),eW=(0,D.A)(()=>{ef&&ef(!1)},["show_pin_dropdown"]),{profileData:eY,fetchRecommendedProfile:e0,isLoading:e1,error:e4}=(e=>{let{setIsError:t}=e,[l,a]=(0,s.useState)(null),[n,i]=(0,s.useState)(!1),[r,o]=(0,s.useState)(null);return{profileData:l,fetchRecommendedProfile:(0,s.useCallback)(async()=>{i(!0),o(null),null==t||t(!1);try{let e=(await (0,m.uM)()).data;"1"===e.status?a((null==e?void 0:e.data)||null):(a(null),null==t||t(!0))}catch(e){o(e instanceof Error?e:Error("Failed to fetch recommended profile")),null==t||t(!0)}finally{i(!1)}},[]),isLoading:n,error:r}})({setIsError:eN}),e2=(0,v.jL)(),{createNewProfile:e3,isLoading:e5,error:e8}=(e=>{let{setLoadingCreate:t}=e,l=(0,v.jL)(),[a,i]=(0,s.useState)(null),[r,c]=(0,s.useState)(!1),[d,u]=(0,s.useState)(null),h=(0,n.useRouter)();return{profileData:a,createNewProfile:(0,s.useCallback)(async e=>{var a,n,s,r;c(!0),null==t||t(!0),u(null);try{let t=(await (0,m.jq)(e)).data;"1"===t.status?(i(t.data),(0,x.P)({title:null==t||null==(a=t.message)?void 0:a.title,desc:(null==t||null==(n=t.message)?void 0:n.content)||""}),(0,p.cw)({ItemId:e.profile_type===o.KUi.KID_PROFILE?"Kid":"Normal",ItemName:e.name}),h.push("/tai-khoan?tab=ho-so")):(null==t?void 0:t.status)==="0"&&(0,x.P)({title:"Tạo há» sÆ¡ kh\xf4ng th\xe0nh c\xf4ng",desc:(null==t||null==(s=t.message)?void 0:s.content)||""})}catch(e){e instanceof f.pe&&(null==(r=e.response)?void 0:r.status)===401?l((0,g.LL)(new Date().getTime())):e instanceof f.pe&&e.response&&(u(null),(0,x.P)({title:"Tạo há» sÆ¡ kh\xf4ng th\xe0nh c\xf4ng",desc:o.f$k}))}finally{c(!1),null==t||t(!1)}},[t]),isLoading:r,error:d}})({setLoadingCreate:e_}),{info:e6}=(0,v.GV)(e=>e.user),{messageConfigs:e7}=(0,v.GV)(e=>e.app),{verify_token:e9}=(0,v.GV)(e=>e.accountSlice),te=(0,s.useMemo)(()=>null==j?void 0:j.find(e=>(null==e?void 0:e.is_root)==="1"),[j]),tt=async()=>{var e,t,a,n,s,i,r,c,d,u,h,m,p,v,b,j,_,w,N,k;try{if(!(null==l?void 0:l.profile_id))return;let x=localStorage.getItem(o.HCT),g=await (0,A.oC)((null==l?void 0:l.profile_id)||""),f=await (null==g?void 0:g.data);if((null==f?void 0:f.status)==="1"){Z((null==f||null==(e=f.data)?void 0:e.nickname)||""),q((null==f||null==(t=f.data)?void 0:t.display_name)||""),X((null==f||null==(a=f.data)?void 0:a.name)||""),ec({avatar_id:(null==f||null==(n=f.data)?void 0:n.avatar_id)||"",avatar_url:(null==f||null==(s=f.data)?void 0:s.avatar_url)||""});let l=(null==f||null==(i=f.data)?void 0:i.profile_maturity)?null==f||null==(r=f.data)?void 0:r.profile_maturity:(null==f||null==(c=f.data)?void 0:c.profile_type)===o.KUi.KID_PROFILE?"U16":"T18";(x&&x!==l||!x)&&localStorage.setItem(o.HCT,l||x||""),l&&!V&&M(l),(null==f||null==(d=f.data)?void 0:d.profile_type)===o.KUi.KID_PROFILE?z(!0):z(!1),(null==f||null==(u=f.data)?void 0:u.allow_edit_nickname)==="1"?et(""):(null==f||null==(h=f.data)?void 0:h.allow_edit_nickname)==="0"&&(Y(!0),et((null==f||null==(m=f.data)?void 0:m.msg_warning_edit_nickname)||""));return}switch(null==f?void 0:f.error_code){case"3":if((null==e6?void 0:e6.user_id_str)!==(null==(p=JSON.parse(localStorage.getItem("user")||"{}"))?void 0:p.user_id_str)){ea({title:"T\xe0i khoản Ä\xe3 thay Äá»i",content:"Bạn hiá»n Äang ÄÄng nháºp bằng má»t t\xe0i khoản kh\xe1c. Vui l\xf2ng nhấn Cáºp nháºt Äá» tải lại dữ liá»u má»i nhất.",buttons:{accept:"Cáºp nháºt"}}),es(!0),ey("3");return}ea({title:(null==f||null==(v=f.message)?void 0:v.title)||"Há» sÆ¡ Ä\xe3 bá» x\xf3a",content:(null==f||null==(b=f.message)?void 0:b.content)||"Há» sÆ¡ n\xe0y Ä\xe3 bá» x\xf3a bá»i thiết bá» kh\xe1c",buttons:{accept:"Ä\xf3ng"}}
1),es(!0),ey("3");break;case"4":ea({title:(null==e7||null==(_=e7.profile)||null==(j=_.action_delete)?void 0:j.title_deleted)||"Há» sÆ¡ Ä\xe3 bá» x\xf3a",content:(null==e7||null==(N=e7.profile)||null==(w=N.action_delete)?void 0:w.msg_deleted)||"Há» sÆ¡ n\xe0y Ä\xe3 bá» x\xf3a. Nhấn âX\xe1c nháºnâ Äá» chuyá»n qua sá» dụng há» sÆ¡ mặc Äá»nh.",buttons:{accept:"X\xe1c nháºn"}}),es(!0),ey("4")}}catch(e){e instanceof f.pe&&(null==(k=e.response)?void 0:k.status)===401&&e2((0,g.LL)(new Date().getTime())),e instanceof f.pe&&e.response&&401!==e.response.status&&(0,x.P)({title:o.mAl,desc:o.f$k})}};(0,s.useEffect)(()=>{eQ.isReady&&((async()=>{try{c!==o.P01||(null==eQ?void 0:eQ.pathname.includes("is-setting=1"))||await e0(),tl()}catch(e){}})(),tt())},[c,eQ,eQ.isReady]),(0,s.useEffect)(()=>{if(G!==(null==eY?void 0:eY.name)){let e=(null==eY?void 0:eY.name)||(null==l?void 0:l.name)||"";X(e),e$(e)}if(!J){let e=(null==eY?void 0:eY.display_name)||(null==l?void 0:l.display_name)||"";q(e),eq(e)}if(!Q){let e=(null==eY?void 0:eY.nickname)||(null==l?void 0:l.nickname)||"",t=(0,R.z)(e).toLowerCase().replace(/[^a-zA-z0-9]+/g,"").slice(0,24);Z(t),localStorage.setItem(o.QPI,t),eR(t)}(eo.avatar_id!==(null==eY?void 0:eY.avatar_id)||eo.avatar_url!==(null==eY?void 0:eY.avatar_url))&&ec({avatar_id:(null==eY?void 0:eY.avatar_id)||(null==l?void 0:l.avatar_id)||"",avatar_url:(null==eY?void 0:eY.avatar_url)||(null==l?void 0:l.avatar_url)||""})},[eY]),(0,s.useEffect)(()=>{if(eP>=1&&Q!==eA){let e=setTimeout(()=>{(async()=>{eE(!0),eI((await ti(Q)).slice(0,1)),setTimeout(()=>{eE(!1)},300)})()},1e3);return()=>clearTimeout(e)}},[Q,W,eP,eA]),(0,s.useEffect)(()=>{if(eK(!1),eB>=1&&J!==eJ){let e=setTimeout(()=>{(async()=>{eK(!0),eL((await tn(J)).slice(0,1)),setTimeout(()=>{eK(!1)},300)})()},1e3);return()=>clearTimeout(e)}},[J,eB,eJ]),(0,s.useEffect)(()=>{if(ez(!1),eV>=1&&G!==eH){let e=setTimeout(()=>{(async()=>{ez(!0),eX((await ts(G)).slice(0,1)),setTimeout(()=>{ez(!1)},300)})()},1e3);return()=>clearTimeout(e)}},[G,eV,eH]),(0,s.useEffect)(()=>{},[ew]),(0,s.useEffect)(()=>{(null==l?void 0:l.nickname)&&localStorage.setItem(o.QPI,null==l?void 0:l.nickname)},[null==l?void 0:l.nickname]),(0,s.useEffect)(()=>{let e=K.test(G.trim());e1||""===G||er(e)},[G]),(0,s.useEffect)(()=>{F&&ep("")},[F]),(0,s.useEffect)(()=>{eb(!1)},[ex]),(0,s.useEffect)(()=>{(ed||eh)&&ef(!1)},[ed,eh]);let tl=()=>{c===o.$G4&&(null==l?void 0:l.name)&&(G!==l.name&&X(l.name),(eo.avatar_id!==l.avatar_id||eo.avatar_url!==l.avatar_url)&&ec({avatar_id:l.avatar_id||"",avatar_url:l.avatar_url||""}),l.profile_type!==o.KUi.KID_PROFILE||F?l.profile_type===o.KUi.MASTER_PROFILE&&z(!1):z(!0))},ta=async()=>{var e,t,a,n,s,i,r,c,d,u,h,v,b,j,_,w,N,k;try{if("3"===ek)return void((null==e6?void 0:e6.user_id_str)!==(null==(a=JSON.parse(localStorage.getItem("user")||"{}"))?void 0:a.user_id_str)?window.location.href="/":eQ.push("/tai-khoan?tab=ho-so"));if("4"===ek){window.location.href="/";return}let g=localStorage.getItem("verify_token"),f=await (0,m.lp)(l.profile_id||"",(null==l?void 0:l.name)||"",e9||g||"");if((null==f||null==(e=f.data)?void 0:e.status)==="0")switch(null==f||null==(n=f.data)?void 0:n.error_code){case"3":if((null==e6?void 0:e6.user_id_str)!==(null==(s=JSON.parse(localStorage.getItem("user")||"{}"))?void 0:s.user_id_str)){ea({title:"T\xe0i khoản Ä\xe3 thay Äá»i",content:"Bạn hiá»n Äang ÄÄng nháºp bằng má»t t\xe0i khoản kh\xe1c. Vui l\xf2ng nhấn Cáºp nháºt Äá» tải lại dữ liá»u má»i nhất.",buttons:{accept:"Cáºp nháºt"}}),es(!0),ey("3");return}ea({title:(null==f||null==(r=f.data)||null==(i=r.message)?void 0:i.title)||"Há» sÆ¡ Ä\xe3 bá» x\xf3a",content:(null==f||null==(d=f.data)||null==(c=d.message)?void 0:c.content)||"Há» sÆ¡ Ä\xe3 bá» xo\xe1 bá»i thiết bá» kh\xe1c.",buttons:{accept:"Ä\xf3ng"}}),es(!0),ey("3");break;case"4":ea({title:(null==e7||null==(h=e7.profile)||null==(u=h.action_delete)?void 0:u.title_deleted)||"Há» sÆ¡ Ä\xe3 bá» x\xf3a",content:(null==e7||null==(b=e7.profile)||null==(v=b.action_delete)?void 0:v.msg_deleted)||"Há» sÆ¡ n\xe0y Ä\xe3 bá» x\xf3a. Nhấn âX\xe1c nháºnâ Äá» chuyá»n qua sá» dụng há» sÆ¡ mặc Äá»nh.",buttons:{accept:"X\xe1c nháºn"}}),es(!0),ey("4");break;case"1":case"6":case"2":(0,x.P)({title:(null==f||null==(_=f.data)||null==(j=_.message)?void 0:j.title)||o.qVE,desc:(null==f||null==(N=f.data)||null==(w=N.message)?void 0:w.content)||o.h41});break;default:ey(null)}else(null==f||null==(t=f.data)?void 0:t.status)==="1"&&(es(!1),(0,p.tV)({Screen:"RemovedProfile",Event:"RemovedProfile",ItemId:l.profile_id||"",ItemName:l.name||"",Status:(null==l?void 0:l.profile_type)===o.KUi.KID_PROFILE?"Kid":"Normal"}),eQ.push("/tai-khoan?tab=ho-so"))}catch(e){e instanceof f.pe&&(null==(k=e.response)?void 0:k.status)===401?(es(!1),e2((0,g.LL)(new Date().getTime()))):(0,x.P)({title:o.qVE,desc:o.h41})}},tn=async e=>{let t=(e||"").trim(),l=t.length,a=/^[a-zA-Z0-9ÃÃÃÃÃÃÃẾÃĨÃÃÃÃÃÃÃÄÄÅ¨Æ Ã Ã¡Ã¢Ã£Ã¨Ã©Ãªáº¿Ã¬Ä©ÃòóôõùúÄÄũơƯÄẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼá»á»á»Æ°Äạảấầẩẫáºáº¯áº±áº³áºµáº·áº¹áº»áº½á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á» ỢỤỦỨỪá»
á»á»á»á»á»á»á»á»á»á»á»á»á»á»¡á»£á»¥á»§á»©á»«á»¬á»®á»°á»²á»´ÃỶỸá»á»¯á»±á»³Ã½á»µá»·á»¹\s]+$/.test(t);if(!(l>=2&&l<=20)||!a||""===t)return["T\xean hiá»n thá» kh\xf4ng hợp lá». T\xean hiá»n thá» bao gá»m từ 2 Äến 15 k\xfd tá»± (a-z, 0-9)"];try{var n;let e=await (0,m._x)({display_name:t});if((null==e?void 0:e.status)==="1")return[];return[(null==e||null==(n=e.message)?void 0:n.content)||"T\xean hiá»n thá» kh\xf4ng hợp lá». Vui l\xf2ng chá»n t\xean hiá»n thá» kh\xe1c."]}catch(e){return["Kh\xf4ng thá» x\xe1c thá»±c t\xean hiá»n thá». Vui l\xf2ng thá» lại."]}},ts=async e=>{let t=(e||"").trim(),l=t.length,a=/^[a-zA-Z0-9ÃÃÃÃÃÃÃẾÃĨÃÃÃÃÃÃÃÄÄÅ¨Æ Ã Ã¡Ã¢Ã£Ã¨Ã©Ãªáº¿Ã¬Ä©ÃòóôõùúÄÄũơƯÄẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼá»á»á»Æ°Äạảấầẩẫáºáº¯áº±áº³áºµáº·áº¹áº»áº½á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á»á» ỢỤỦỨỪá»
á»á»á»á»á»á»á»á»á»á»á»á»á»á»¡á»£á»¥á»§á»©á»«á»¬á»®á»°á»²á»´ÃỶỸá»á»¯á»±á»³Ã½á»µá»·á»¹\s]+$/.test(t);if(!(l>=1&&l<=15)||!a||""===t)return["T\xean há» sÆ¡ kh\xf4ng hợp lá». T\xean há» sÆ¡ bao gá»m từ 1 Äến 15 k\xfd tá»± (a-z, 0-9)"];try{var n;let e=await (0,m._x)({name:t});if((null==e?void 0:e.status)==="1")return[];return[(null==e||null==(n=e.message)?void 0:n.content)||"T\xean há» sÆ¡ kh\xf4ng hợp lá». Vui l\xf2ng chá»n t\xean há» sÆ¡ kh\xe1c."]}catch(e){return["Kh\xf4ng thá» x\xe1c thá»±c t\xean há» sÆ¡. Vui l\xf2ng thá» lại."]}},ti=async e=>{let t=(e||"").trim(),l=t.length,a=/^[a-zA-Z0-9._]+$/.test(t);if((0,R.z)(t).toLowerCase().replace(/[^a-zA-Z0-9]+/g,"")===localStorage.getItem("initialNickname"))return[];if(!(l>=2&&l<=15)||!a||""===t)return["Biá»t danh bao gá»m từ 2 Äến 15 k\xfd tá»± (a-z, 0-9, dấu gạch dưá»i _ , dấu chấm .)"];
1if(/^[_\.]|[_\.]$/.test(t))return["Biá»t danh kh\xf4ng bắt Äầu hoặc kết th\xfac bằng dấu gạch dưá»i, dấu chấm."];if(/__|\.\.|__.|.__/.test(t))return["Biá»t danh kh\xf4ng thá» chứa li\xean tiếp nhiá»u dấu gạch dưá»i, dấu chấm."];try{var n;let e=await (0,m._x)({nickname:t.toLowerCase()});if((null==e?void 0:e.status)==="1")return[];return[(null==e||null==(n=e.message)?void 0:n.content)||"Biá»t danh kh\xf4ng hợp lá». Vui l\xf2ng chá»n biá»t danh kh\xe1c."]}catch(e){return["Kh\xf4ng thá» x\xe1c thá»±c biá»t danh. Vui l\xf2ng thá» lại."]}},tr=async()=>{let e=localStorage.getItem("verify_token"),t=localStorage.getItem(o.HCT),l={name:G.trim()||"",avatar_id:eo.avatar_id||"",avatar_url:eo.avatar_url||"",display_name:J.trim()||"",verify_token:e9||e||"",profile_maturity:V||t||"",profile_type:F?o.KUi.KID_PROFILE:o.KUi.MASTER_PROFILE,...ex&&4===ex.length&&{pin:ex},...ev&&{pin:""}};c===o.$G4&&Q!==localStorage.getItem(o.QPI)&&(l.nickname=Q.trim()||""),c===o.P01?e3(l):null==B||B(l)},to="create"===u?ex?"Chá»nh sá»a":"Thiết láºp":"",tc=(null==l?void 0:l.profile_type)===o.KUi.MASTER_PROFILE;return e1?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)("div",{className:"max-w-[542px] relative min-h-[500px] mx-auto",children:(0,a.jsx)(E.A,{})})}):(0,a.jsxs)("div",{className:"relative",children:[H?(0,a.jsx)("div",{className:"mt-[94px] tablet:mt-[120px]",children:(0,a.jsx)(_,{defaultAvatar:eo,onClickNav:e=>{ec({avatar_id:e.id||"",avatar_url:e.image||(null==e?void 0:e.avatar_url)||""}),$(!1)}})}):(0,a.jsxs)("div",{className:"max-w-[542px] mx-auto mt-[104px] tablet:mt-[152px]",children:[(0,a.jsx)("div",{className:"mb-4 text-center",children:(0,a.jsx)(d,{children:c})}),(0,a.jsx)("div",{className:"text-center mt-[24px] tablet:mt-[40px] mb-[24px]",children:(0,a.jsxs)("div",{className:"relative text-center cursor-pointer inline-block ",onClick:()=>{eZ?(0,x.P)({title:"Mất kết ná»i mạng",customIcon:(0,a.jsx)(U.A,{}),timeout:3e3}):$(!0)},children:[(0,a.jsx)(r.A,{className:"w-[80px] tablet:w-[120px] h-[80px] tablet:h-[120px] rounded-full",src:(null==eo?void 0:eo.avatar_url)||o.wxC,alt:"PROFILE_DEFAULT_AVATAR"}),(0,a.jsx)("div",{className:"absolute top-0 right-0 bg-white rounded-full flex items-center justify-center w-5 tablet:w-8 h-5 tablet:h-8",children:(0,a.jsx)("img",{src:"/images/profiles/edit_black.png",alt:"edit avatar",className:"w-[24px] h-[24px]"})}),F&&(0,a.jsx)("img",{className:"absolute bottom-2.5 left-1/2 -translate-x-1/2 w-16",src:"/images/profiles/child_2.png",alt:"edit avatar"})]})}),(0,a.jsxs)("div",{className:"w-full mb-[24px]",children:[(0,a.jsxs)("p",{className:"text-white-smoke font-medium text-base leading-[1.3] mb-2",children:["T\xean há» sÆ¡",(0,a.jsx)("span",{className:"text-base leading-[1.3] font-normal text-silver-chalice mt-2 inline-block",children:"D\xf9ng Äá» ph\xe2n biá»t c\xe1c há» sÆ¡ trong c\xf9ng t\xe0i khoản v\xe0 hiá»n thá» trong giao diá»n chá»n há» sÆ¡. V\xed dụ: âBá»â, âMẹâ, âB\xe9 Naâ,..."})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:G,placeholder:"Nháºp t\xean há» sÆ¡",onChange:e=>{X(e.target.value),eM(e=>e+1),eG.length&&eX([])},onBlur:()=>er(K.test(G.trim())),maxLength:15,className:"".concat(!ei||(null==e8?void 0:e8.message)||b||eG.length?"border-scarlet focus:border-scarlet":"border-black-olive-404040 focus:border-gray"," border w-full py-[15px] pl-6 pr-12 rounded-[104px] bg-[rgba(0,0,0,0.05)] text-white-smoke placeholder:text-davys-grey-585858 text-base leading-6 outline-none")}),eF&&(0,a.jsx)("div",{className:"absolute right-4 top-1/2 -translate-y-1/2",children:(0,a.jsx)("div",{className:"w-4 h-4 border-2 border-white-smoke border-t-transparent rounded-full animate-spin"})})]}),eG.length>0&&(0,a.jsx)("div",{className:"mt-3 text-left text-[#ef1348] text-base leading-6",children:eG.map((e,t)=>(0,a.jsx)("div",{children:e},"name-err-".concat(t)))}),!ei&&!b&&!eG.length&&(0,a.jsx)("div",{className:"mt-3 text-left text-[#ef1348] text-base leading-6",children:"T\xean há» sÆ¡ kh\xf4ng hợp lá». T\xean há» sÆ¡ bao gá»m từ 1 Äến 15 k\xfd tá»± (a-z, 0-9)"}),b&&!ei&&(0,a.jsx)("div",{className:"mt-3 text-left text-[#ef1348] text-base leading-6",children:b}),b&&ei&&(0,a.jsx)("div",{className:"mt-3 text-left text-[#ef1348] text-base leading-6",children:b}),e8&&(0,a.jsx)("div",{className:"mt-3 text-[#ef1348] text-base leading-6",children:e8.message})]}),(0,a.jsxs)("div",{className:"w-full mb-[24px]",children:[(0,a.jsx)("p",{className:"text-white-smoke font-medium text-base leading-[1.3] mb-2",children:"T\xean hiá»n thá»"}),(0,a.jsx)("p",{className:"text-silver-chalice text-base leading-[1.3] mb-2",children:"D\xf9ng Äá» hiá»n thá» c\xf4ng khai khi tham gia c\xe1c hoạt Äá»ng cá»ng Äá»
1ng tr\xean FPT Play như b\xecnh luáºn, tr\xf2 chuyá»n trá»±c tiếp v\xe0 c\xe1c hoạt Äá»ng kh\xe1c."}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:J,placeholder:"Nháºp t\xean hiá»n thá»",onChange:e=>{q(e.target.value),eO(e=>e+1),eD.length&&eL([])},maxLength:15,className:"border ".concat(eD.length?"border-scarlet focus:border-scarlet":"border-black-olive-404040 focus:border-gray"," w-full py-[18px] pl-6 pr-12 rounded-[104px] bg-[rgba(0,0,0,0.05)] text-white-smoke placeholder:text-davys-grey-585858 text-base leading-6 outline-none overflow-hidden whitespace-nowrap text-ellipsis")}),eU&&(0,a.jsx)("div",{className:"absolute right-4 top-1/2 -translate-y-1/2",children:(0,a.jsx)("div",{className:"w-4 h-4 border-2 border-white-smoke border-t-transparent rounded-full animate-spin"})})]}),eD.length>0&&(0,a.jsx)("div",{className:"mt-3 text-left text-[#ef1348] text-base leading-6",children:eD.map((e,t)=>(0,a.jsx)("div",{children:e},"display-name-err-".concat(t)))})]}),c===o.$G4&&(0,a.jsxs)("div",{className:"w-full mb-[24px] flex gap-2 ".concat(W?"flex-col":"flex-row items-center"),children:[(0,a.jsx)("p",{className:"text-white-smoke font-medium text-base leading-[1.3]",children:"Biá»t danh"}),W&&!ee&&(0,a.jsx)("p",{className:"text-silver-chalice text-base leading-[1.3]",children:"Th\xeam chữ c\xe1i v\xe0 sá» Äá» chá»n biá»t danh duy nhất. Bạn c\xf3 thá» thay Äá»i biá»t danh cá»§a m\xecnh má»t lần trong má»i 14 ng\xe0y."}),ee&&(0,a.jsx)("p",{className:"text-silver-chalice text-base leading-[1.3] mb-2",children:ee}),W?(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 ".concat(ee?"text-black-olive-404040":"text-silver-chalice"),children:"@"}),(0,a.jsx)("input",{type:"text",value:Q,disabled:!!ee,onChange:e=>{Z(e.target.value),eT(e=>e+1),eS.length&&eI([])},maxLength:15,placeholder:"Nháºp biá»t danh",className:"border ".concat(eS.length?"border-scarlet focus:border-scarlet":ee?"border-charleston-green focus:border-charleston-green cursor-not-allowed":"border-black-olive-404040 focus:border-gray"," w-full py-[18px] pl-8 pr-12 rounded-[104px] bg-[rgba(0,0,0,0.05)] ").concat(ee?"text-black-olive-404040 placeholder:text-black-olive-404040":"text-white-smoke placeholder:text-davys-grey-585858"," text-base leading-6 outline-none")}),eC&&(0,a.jsx)("div",{className:"absolute right-4 top-1/2 -translate-y-1/2",children:(0,a.jsx)("div",{className:"w-4 h-4 border-2 border-white-smoke border-t-transparent rounded-full animate-spin"})})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2 text-silver-chalice text-base leading-[1.3]",children:[(0,a.jsxs)("span",{onClick:()=>{Y(!0),eT(0),eR((0,R.z)(Q).toLowerCase().replace(/[^a-zA-Z0-9]+/g,""))},children:["@",Q]}),(0,a.jsx)("button",{type:"button","aria-label":"Chá»nh sá»a biá»t danh",className:"inline-flex items-center text-white-smoke hover:text-fpl",onClick:()=>{Y(!0),eT(0),eR((0,R.z)(Q).toLowerCase().replace(/[^a-zA-Z0-9]+/g,""))},children:(0,a.jsx)(I.z$h,{className:"ml-1",fontSize:16})})]}),eS.length>0&&(0,a.jsx)("div",{className:"mt-1 text-left text-[#ef1348] text-base leading-6",children:eS.map((e,t)=>(0,a.jsx)("div",{children:e},"nick-err-".concat(t)))})]}),((null==l?void 0:l.profile_type)===o.KUi.KID_PROFILE||c===o.P01)&&(0,a.jsxs)("div",{className:"w-full mb-[24px]",children:[(0,a.jsx)("p",{className:"text-silver-chalice text-base leading-[1.3] mb-2",children:"Ph\xe2n loại há» sÆ¡"}),(0,a.jsx)("div",{className:"px-4 tablet:px-6 py-4 rounded-[12px] bg-eerie-black",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-white-smoke text-base leading-6 font-medium mb-2",children:"Trẻ em"}),(0,a.jsx)("p",{className:"text-spanish-gray text-base leading-[1.3] max-w-[284px] tablet:max-w-none",children:"Chá» hiá»n thá» c\xe1c ná»i dung ph\xf9 hợp vá»i trẻ em"})]}),(0,a.jsx)("div",{className:"w-10",children:(0,a.jsx)(N,{defaultValue:F,isKid:tc,onChange:e=>{z(e);let t=localStorage.getItem(o.HCT);e?t&&"U13"===t?M("U13"):M("U16"):t&&"U18"===t?M("U18"):M("T18")}})})]})})]}),c===o.$G4&&(0,a.jsxs)("div",{className:"w-full mb-[24px]",children:[(0,a.jsx)("p",{className:"text-silver-chalice text-base leading-[1.3] mb-2",children:"Xếp hạng Äá» tuá»i"}),(0,a.jsxs)("div",{className:"px-4 tablet:px-6 py-4 rounded-[12px] bg-eerie-black",children:[F&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer mb-4 last:mb-0",children:[(0,a.jsx)("input",{type:"radio",name:"ageRating",value:"U13",checked:"U13"===V,onChange:e=>M(e.target.value),className:"sr-only"}),(0,a.jsx)("div",{className:"h-5 w-5 shrink-0 rounded-full border flex items-center justify-center mt-0.5 ".concat("U13"===V?"border-fpl":"border-silver-chalice"),children:"U13"===V&&(0,a.jsx)("span",{className:"w-3 h-3 rounded-full bg-fpl block"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-white-smoke text-base leading-6 font-medium mb-1",children:"Trẻ
1nhá» (dưá»i 13)"}),(0,a.jsx)("p",{className:"text-spanish-gray text-base leading-[1.3]",children:"D\xe0nh cho trẻ em, kh\xf4ng chứa yếu tá» g\xe2y sợ h\xe3i hoặc kh\xf4ng ph\xf9 hợp"})]})]}),(0,a.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer mb-4 last:mb-0",children:[(0,a.jsx)("input",{type:"radio",name:"ageRating",value:"U16",checked:"U16"===V,onChange:e=>M(e.target.value),className:"sr-only"}),(0,a.jsx)("div",{className:"h-5 w-5 shrink-0 rounded-full border flex items-center justify-center mt-0.5 ".concat("U16"===V?"border-fpl":"border-silver-chalice"),children:"U16"===V&&(0,a.jsx)("span",{className:"w-3 h-3 rounded-full bg-fpl block"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-white-smoke text-base leading-6 font-medium mb-1",children:"Thiếu ni\xean (dưá»i 16)"}),(0,a.jsx)("p",{className:"text-spanish-gray text-base leading-[1.3]",children:"D\xe0nh cho trẻ từ 13 tuá»i trá» l\xean, c\xf3 thá» kh\xf4ng ph\xf9 hợp vá»i trẻ nhá» hÆ¡n"})]})]})]}),!F&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer mb-4 last:mb-0",children:[(0,a.jsx)("input",{type:"radio",name:"ageRating",value:"U18",checked:"U18"===V,onChange:e=>M(e.target.value),className:"sr-only"}),(0,a.jsx)("div",{className:"h-5 w-5 shrink-0 rounded-full border flex items-center justify-center mt-0.5 ".concat("U18"===V?"border-fpl":"border-silver-chalice"),children:"U18"===V&&(0,a.jsx)("span",{className:"w-3 h-3 rounded-full bg-fpl block"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-white-smoke text-base leading-6 font-medium mb-1",children:"Thanh thiếu ni\xean (từ 16 Äến dưá»i 18)"}),(0,a.jsx)("p",{className:"text-spanish-gray text-base leading-[1.3]",children:"Kh\xf4ng chứa yếu tá» hoặc chá»§ Äá» kh\xf4ng ph\xf9 hợp cho ngưá»i dưá»i 18 tuá»i"})]})]}),(0,a.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer mb-4 last:mb-0",children:[(0,a.jsx)("input",{type:"radio",name:"ageRating",value:"T18",checked:"T18"===V,onChange:e=>M(e.target.value),className:"sr-only"}),(0,a.jsx)("div",{className:"h-5 w-5 shrink-0 rounded-full border flex items-center justify-center mt-0.5 ".concat("T18"===V?"border-fpl":"border-silver-chalice"),children:"T18"===V&&(0,a.jsx)("span",{className:"w-3 h-3 rounded-full bg-fpl block"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-white-smoke text-base leading-6 font-medium mb-1",children:"Ngưá»i trưá»ng th\xe0nh (18+)"}),(0,a.jsx)("p",{className:"text-spanish-gray text-base leading-[1.3]",children:"D\xe0nh cho ngưá»i trưá»ng th\xe0nh"})]})]})]})]})]}),(0,a.jsxs)("div",{className:"w-full mb-[24px] ".concat(F?"pointer-events-none opacity-37":""),children:[(0,a.jsx)("p",{className:"text-silver-chalice text-base leading-[1.3] mb-2",children:"Quản l\xfd m\xe3 PIN"}),(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 tablet:px-6 py-4 rounded-[12px] bg-eerie-black relative",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"".concat((null==l?void 0:l.pin_type)===o.a$_.REQUIRED_PIN||ex?"":"mb-2"," text-white-smoke text-base leading-6 font-medium"),children:"M\xe3 PIN há» sÆ¡"}),(null==l?void 0:l.pin_type)!==o.a$_.REQUIRED_PIN&&!ex&&(0,a.jsx)("p",{className:"text-spanish-gray text-base leading-[1.3] max-w-[284px] tablet:max-w-none",children:"Thiết láºp m\xe3 PIN Äá» n\xe2ng cao bảo máºt há» sÆ¡"})]}),(null==l?void 0:l.pin_type)===o.a$_.REQUIRED_PIN||ex?(0,a.jsx)("div",{className:"relative",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>ef(!eg),children:[(0,a.jsx)("span",{className:"text-white-smoke text-base leading-6 font-medium hover:text-fpl",children:"Chá»nh sá»a"}),(0,a.jsx)(y.pte,{fontSize:17,className:"".concat(eg?"rotate-180":"")})]})}):(0,a.jsx)("p",{className:"text-white-smoke text-base leading-6 font-medium cursor-pointer hover:text-fpl",onClick:()=>eu(!0),children:to}),eg&&(0,a.jsxs)("div",{ref:eW,className:"absolute z-10 right-0 top-[calc(100%+4px)] bg-charleston-green w-[252px] rounded-2xl py-3",children:[(0,a.jsx)("div",{className:"hover:bg-black-olive-404040",children:(0,a.jsxs)("div",{className:"py-3 px-4 flex items-center whitespace-nowrap text-base leading-6 cursor-pointer transition-colors",onClick:()=>{em(!0),ef(!1)},children:[(0,a.jsx)(I.z$h,{className:"mr-3",fontSize:20})," Äá»i m\xe3 PIN há» sÆ¡"]})}),(0,a.jsx)("div",{className:"hover:bg-black-olive-404040",children:(0,a.jsxs)("div",{className:"py-3 px-4 flex items-center whitespace-nowrap text-base leading-6 cursor-pointer transition-colors",onClick:()=>{ep(""),eb(!0),null==O||O({name:G,avarta:eo}),ef(!1)},children:[(0,a.jsx)(C.M9y,{className:"mr-3",fontSize:20})," X\xf3a m\xe3 PIN há» sÆ¡"]})})]})]})]}),c===o.$G4&&(null==e6||null==(t=e6.profile)?void 0:t.profile_id)!==(null==l?void 0:l.profile_id)&&(null==l?void 0:l.profile_id)!==(null==e6?void 0:e6.user_id_str)&&(0,a.jsx)("div",{className:"w-full mb-[24px]",children:(0,a.jsx)("div",{className:"px-4 tablet:px-6 py-4 rounded-[12px] bg-eerie-black",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("p",{className:"text-white-smoke text-base leading-6 font-medium",children:"X\xf3a há» sÆ¡"}),(0,a.jsx)("button",{onClick:()=>{var e,t,l,a,n;ea({title:(null==e7||null==(t=e7.profile)||null==(e=t.action_delete)?void 0:e.title_delete)||"Bạn muá»n x\xf3a há» sÆ¡?",content:(null==e7||null==(n=e7.profile)||null==(a=n.action_delete)||null==(l=a.msg_delete)?void 0:l.replace("%s",(null==te?void 0:te.name)||""))||"Há» sÆ¡ bá» x\xf3a sẽ kh\xf4ng thá» kh\xf4i phục. Thiết bá» sá» dụng há» sÆ¡ n\xe0y sẽ ÄÆ°á»£c chuyá»n vá» há» sÆ¡ ".concat(null==te?void 0:te.name,"."),buttons:{accept:"X\xf3a",cancel:"Ä\xf3ng"}}
1),es(!0)},className:"cursor-pointer text-white-smoke hover:text-fpl text-base leading-6 font-medium outline-0 bg-transparent p-0 m-0",children:"X\xf3a"})]})})}),(0,a.jsx)(k.A,{modalContent:el,open:en,onSubmit:ta,onCancel:()=>es(!1),onHidden:()=>es(!1)}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 pt-4",children:[(0,a.jsx)(i.A,{variant:"dark",width:"full",disabled:h||ej||e1||e5,onClickBtn:()=>{null==P||P()},className:"bg-charleston-green",children:"Há»§y"}),(0,a.jsx)(i.A,{width:"full",className:"".concat(!ei||h||ej||e1||e5||eG.length>0||eS.length>0||eD.length>0?T().disabledButton:T().enabledButton),disabled:!ei||h||ej||e1||e5||eG.length>0,onClickBtn:tr,children:"Ho\xe0n tất"})]}),e1&&(0,a.jsx)("div",{className:"text-gray-500 text-base leading-6",children:(0,a.jsx)(E.A,{})}),e4&&(0,a.jsxs)("div",{className:"text-[#ef1348] text-base leading-6",children:["Lá»i khi tải há» sÆ¡ gợi \xfd: ",e4.message]}),e5&&(0,a.jsx)("div",{className:"text-gray-500 text-base leading-6",children:(0,a.jsx)(E.A,{})})]}),ed&&(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-eerie-black rounded-[16px] p-8 relative max-w-[calc(100vw-32px)] sm:max-w-[460px]",children:[(0,a.jsx)("button",{className:"absolute top-4 right-4 text-white-smoke",onClick:()=>eu(!1),children:(0,a.jsx)(S.lr4,{size:28})}),(0,a.jsx)(w.A,{avatarUrl:(null==eo?void 0:eo.avatar_url)||"",defaultValue:ex.split(""),isChild:F,loading:h,profile:l,onConfirm:e=>{localStorage.setItem(o.GIx,e),ep(e),eu(!1)},onCancel:()=>eu(!1)})]})}),eh&&(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-eerie-black rounded-[16px] p-8 relative max-w-[calc(100vw-32px)] sm:max-w-[460px]",children:[(0,a.jsx)("button",{className:"absolute top-4 right-4 text-white-smoke",onClick:()=>{localStorage.setItem(o.GIx,ex),ep(ex),em(!1)},children:(0,a.jsx)(S.lr4,{size:28})}),(0,a.jsx)(w.A,{avatarUrl:(null==eo?void 0:eo.avatar_url)||"",title:"Äá»i m\xe3 PIN há» sÆ¡",type:"edit",subTitle:"Vui l\xf2ng nháºp m\xe3 PIN gá»m 4 sá» (0-9) Äá» thá»±c hiá»n Äá»i m\xe3 PIN há» sÆ¡.",defaultValue:ex.split(""),isChild:F,loading:h,profile:l,onConfirm:e=>{localStorage.setItem(o.GIx,e),ep(e),em(!1)},onCancel:()=>em(!1)})]})})]})};var O=l(45697),F=l(10218);let z=function(){let{setLoadingUpdate:e,onUpdateSuccess:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=(0,v.jL)(),[a,n]=(0,s.useState)(null),[i,r]=(0,s.useState)(!1),[c,d]=(0,s.useState)(null);return{profileData:a,updateProfileAction:(0,s.useCallback)(async(a,s)=>{var i,c,u,h,v,b,j;r(!0),null==e||e(!0),d(null);try{let e=(await (0,m.r7)(a,s)).data;n(e);let l=JSON.parse(localStorage.getItem("user")||"{}");"1"===e.status?((0,p.tV)({Screen:"ModifiedProfile",Event:"ModifiedProfile",ItemId:(null==s?void 0:s.profile_id)||"",ItemName:(null==s?void 0:s.name)||"",Status:(null==s?void 0:s.profile_type)===o.KUi.KID_PROFILE?"Kid":"Normal"}),(null==s?void 0:s.profile_id)===(null==l||null==(i=l.profile)?void 0:i.profile_id)&&localStorage.setItem(o.u6M,(null==e||null==(c=e.data)?void 0:c.profile_maturity)||""),localStorage.setItem("userSelected",JSON.stringify(null==e?void 0:e.data)),null==t||t()):(null==e?void 0:e.error_code)==="1"||(null==e?void 0:e.error_code)==="2"?(0,x.P)({title:(null==e||null==(u=e.message)?void 0:u.title)||"Chá»nh sá»a há» sÆ¡ kh\xf4ng th\xe0nh c\xf4ng",desc:(null==e||null==(h=e.message)?void 0:h.content)||""}):(null==e?void 0:e.error_code)==="6"&&(0,x.P)({title:(null==e||null==(v=e.message)?void 0:v.title)||"Thá»i gian thao t\xe1c Ä\xe3 hết",desc:(null==e||null==(b=e.message)?void 0:b.content)||"Ä\xe3 qu\xe1 thá»i gian Äá» thá»±c hiá»n thao t\xe1c n\xe0y. Bạn c\xf3 thá» thá» lại từ Äầu."})}catch(e){if(e instanceof f.pe&&(null==(j=e.response)?void 0:j.status)===401)return void l((0,g.LL)(new Date().getTime()));e.response&&(d(null),(0,x.P)({title:"Chá»nh sá»a há» sÆ¡ kh\xf4ng th\xe0nh c\xf4ng",desc:(0,F.Lq)({error:e})}))}finally{r(!1),null==e||e(!1)}},[e,t]),isLoading:i,error:c}};var V=l(4297);let M=()=>{let e=(0,n.useRouter)(),{profiles:t,fetchProfiles:l}
1=(0,u.D)(),[i,r]=(0,s.useState)(null),{info:c}=(0,v.GV)(e=>e.user),[d,m]=(0,s.useState)(null),[p,g]=(0,s.useState)(null),[f,b]=(0,s.useState)(!1),[j,_]=(0,s.useState)(!1),[w,N]=(0,s.useState)(null),{updateProfileAction:y,profileData:S,isLoading:I,error:C}=z({setLoadingUpdate:b,onUpdateSuccess:()=>{p?e.push("/tai-khoan?tab=ho-so&child=quan-ly-va-tuy-chon"):e.push("/tai-khoan?tab=ho-so")}}),{messageConfigs:E}=(0,v.GV)(e=>e.app),P=(0,s.useMemo)(()=>t.filter(e=>(null==e?void 0:e.profile_id)===(null==p?void 0:p.profile_id)),[t]);(0,s.useEffect)(()=>{var e,t,l,a,n,s,i,r,o;switch(null==S?void 0:S.error_code){case"3":if((null==c?void 0:c.user_id_str)!==(null==(e=JSON.parse(localStorage.getItem("user")||"{}"))?void 0:e.user_id_str)){N({title:"T\xe0i khoản Ä\xe3 thay Äá»i",content:"Bạn hiá»n Äang ÄÄng nháºp bằng má»t t\xe0i khoản kh\xe1c. Vui l\xf2ng nhấn Cáºp nháºt Äá» tải lại dữ liá»u má»i nhất.",buttons:{accept:"Cáºp nháºt"}}),_(!0);return}N({title:(null==S||null==(t=S.message)?void 0:t.title)||"Há» sÆ¡ Ä\xe3 bá» x\xf3a",content:(null==S||null==(l=S.message)?void 0:l.content)||"Há» sÆ¡ n\xe0y Ä\xe3 bá» x\xf3a bá»i thiết bá» kh\xe1c",buttons:{accept:"Ä\xf3ng"}}),_(!0);break;case"4":N({title:(null==E||null==(n=E.profile)||null==(a=n.action_delete)?void 0:a.title_deleted)||"Há» sÆ¡ Ä\xe3 bá» x\xf3a",content:(null==E||null==(i=E.profile)||null==(s=i.action_delete)?void 0:s.msg_deleted)||"Há» sÆ¡ n\xe0y Ä\xe3 bá» x\xf3a. Nhấn âX\xe1c nháºnâ Äá» chuyá»n qua sá» dụng há» sÆ¡ mặc Äá»nh.",buttons:{accept:"X\xe1c nháºn "}}),_(!0);break;case"5":N({title:(null==S||null==(r=S.message)?void 0:r.title)||"Há» sÆ¡ Ä\xe3 thay Äá»i",content:(null==S||null==(o=S.message)?void 0:o.content)||"Th\xf4ng tin cá»
1§a há» sÆ¡ n\xe0y Ä\xe3 bá» thay Äá»i trưá»c Ä\xf3. Bạn c\xf3 thá» cáºp nháºt lại dữ liá»u má»i Äá» tiếp tục chá»nh sá»a.",buttons:{accept:"Cáºp nháºt",cancel:"Ä\xf3ng"}}),_(!0)}},[S]);let T=(0,s.useMemo)(()=>localStorage.getItem("profile_id"),[]);(0,s.useEffect)(()=>{(async()=>{await l()})()},[]),(0,s.useEffect)(()=>{(async()=>{if(e.query["is-setting"]&&"undefined"!=typeof localStorage){let e=localStorage.getItem("userSelected"),t=e?JSON.parse(e):null;g(t),(t&&(null==P?void 0:P.length)>0||t)&&m(P[0]||t||null)}})()},[t,P]),(0,s.useEffect)(()=>{var e,t;(null==(t=window)||null==(e=t.location)?void 0:e.search)?r("edit"):(r("add"),localStorage.removeItem("userSelected"),g(null))},[]),(0,s.useEffect)(()=>{if("edit"===i){let e=localStorage.getItem("userSelected"),t=e?JSON.parse(e):null;g(t),t&&(null==P?void 0:P.length)>0&&m(P[0]||null)}},[i]);let R=async e=>{try{if(b(!0),m(e),e.profile_id===T)return void r("edit");if(localStorage.getItem(o.Om4)===o.KUi.MASTER_PROFILE){let a=await (0,A.ug)();(0,V.g$)((null==a?void 0:a.data)||null);let n=await a;if(a)await l(),m(e);else{var t;(0,x.P)({title:o.mAl,desc:(null==n||null==(t=n.data)?void 0:t.msg)||o.f$k});return}}}catch(e){(0,V.g$)()}finally{b(!1)}};return(0,a.jsxs)(O.H,{children:[(0,a.jsxs)("div",{className:"min-h-screen w-full relative",children:["list"===i&&!p&&(0,a.jsx)(h,{heading:"Chá»nh sá»a há» sÆ¡",clickAdd:()=>r("add"),confirm:()=>{e.push("/tai-khoan/multi-profiles/watching")},clickProfile:e=>R(e||{})}),("edit"===i||p)&&(0,a.jsx)(B,{errorUpdate:C,title:"Chá»nh sá»a há» sÆ¡",profile:d||{},listProfiles:t,loading:f||I,onRemovePin:e=>{var t;m({...d,avatar_url:null==e||null==(t=e.avarta)?void 0:t.avatar_url,name:null==e?void 0:e.name,pin_type:o.a$_.NO_PIN,pin:""})},onCancel:()=>{p?e.push("/tai-khoan?tab=ho-so&child=quan-ly-va-tuy-chon"):e.push("/tai-khoan?tab=ho-so")},onConfirm:e=>y(e,d)}),"add"===i&&!p&&(0,a.jsx)(B,{listProfiles:t,title:"Tạo há» sÆ¡",onCancel:()=>{var t;(null==c?void 0:c.user_id_str)!==(null==(t=JSON.parse(localStorage.getItem("user")||"{}"))?void 0:t.user_id_str)?(N({title:"T\xe0i khoản Ä\xe3 thay Äá»i",content:"Bạn hiá»n Äang ÄÄng nháºp bằng má»t t\xe0i khoản kh\xe1c. Vui l\xf2ng nhấn Cáºp nháºt Äá» tải lại dữ liá»u má»i nhất.",buttons:{accept:"Cáºp nháºt"}}),_(!0)):e.push("/tai-khoan?tab=ho-so")}})]}),(0,a.jsx)(k.A,{open:j,onHidden:()=>_(!1),onSubmit:()=>{var t;if((null==c?void 0:c.user_id_str)!==(null==(t=JSON.parse(localStorage.getItem("user")||"{}"))?void 0:t.user_id_str)){window.location.href="/";return}if((null==S?void 0:S.error_code)==="3")return void e.push("/tai-khoan?tab=ho-so");if((null==S?void 0:S.error_code)==="4"){window.location.href="/";return}if((null==S?void 0:S.error_code)==="5")return void e.reload()},onCancel:()=>_(!1),modalContent:w||{}})]})};var H=!0;let $=()=>(0,a.jsx)("div",{className:"mx-auto f-container px-4 sm:px-6 lg:px-8",children:(0,a.jsx)("div",{className:"flex flex-col lg:flex-row gap-[32px] lg:gap-[148px]",children:(0,a.jsx)(M,{})})})},84657:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/tai-khoan/multi-profiles",function(){return l(70152)}])},86788:(e,t,l)=>{"use strict";l.d(t,{A:()=>h});var a=l(37876),n=l(14232),s=l(5752),i=l(55483),r=l(48495),o=l(66360),c=l(17909),d=l.n(c);let u=(0,n.forwardRef)((e,t)=>{let{profile:l={},type:c="create",title:u="Thiết láºp m\xe3 PIN há» sÆ¡",subTitle:h="Vui l\xf2ng nháºp m\xe3 PIN gá»m 4 sá» (0-9) Äá» tiến h\xe0nh thiết láºp m\xe3 PIN há» sÆ¡",avatarUrl:m="",defaultValue:x=[],isChild:p=!1,onConfirm:g,onForget:f}
1=e,[v,b]=(0,n.useState)(x),[j,_]=(0,n.useState)(""),w=(0,n.useMemo)(()=>v.join(""),[v]);(0,n.useImperativeHandle)(t,()=>({setError:e=>{_(e)}})),(0,n.useEffect)(()=>{x.length&&b(x)},[x]),(0,n.useEffect)(()=>{"access"===c&&4===w.length&&(null==g||g(w))},[w,c]);let N=()=>{let e=v.join(""),t=localStorage.getItem(o.GIx);return!e||4!==e.length||e===t};return(0,a.jsxs)("div",{className:"pin-modal",children:[(0,a.jsx)("div",{className:"flex items-center justify-center mb-10",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.A,{src:m,alt:"",className:"w-[80px] xl:w-[120px] h-[80px] xl:h-[120px] rounded-full border-[2px] border-white-smoke"}),l&&l.pin_type===o.a$_.REQUIRED_PIN&&(0,a.jsx)("img",{className:"absolute w-[24px] xl:w-[32px] h-[24px] xl:h-[32px] right-0 xl:right-1.5 top-0 xl:top-1.5",src:"/images/profiles/lock.png",alt:"lock"}),l&&l.profile_type===o.KUi.KID_PROFILE&&p&&(0,a.jsx)("img",{className:"absolute bottom-2.5 left-1/2 -translate-x-1/2 w-16",src:"/images/profiles/child_2.png",alt:"edit avatar",width:64,height:32})]})}),(0,a.jsx)("div",{className:"text-center text-[20px] xl:text-2xl leading-[1.3] font-bold mb-3 tablet:mb-4 text-white-smoke",children:u}),(0,a.jsx)("div",{className:"text-spanish-gray text-center text-base leading-[21px] font-normal mb-6",children:h}),(0,a.jsx)("div",{className:"mb-0 ".concat(j?"mb-2":""),children:(0,a.jsx)(i.A,{defaultValue:v,type:c,inputClasses:j?"error":"",onChange:e=>{e&&localStorage.removeItem(o.GIx),b(e.split(""))}})}),j&&(0,a.jsx)("div",{className:"mt-4 mb-8 text-center text-scarlet text-sm leading-6",children:j}),(0,a.jsxs)("div",{className:"pin-modal__footer mt-6 tablet:mt-8",children:["access"===c&&(0,a.jsx)("span",{className:"block text-center text-sm tablet:text-base hover:text-fpl cursor-pointer transition-all duration-300 text-white-smoke",onClick:()=>{null==f||f()},children:"Qu\xean m\xe3 PIN?"}),("create"===c||"edit"===c)&&(0,a.jsx)("div",{className:"flex flex-row items-center gap-3 w-full",children:(0,a.jsx)(r.A,{width:"full",disabled:N(),className:"".concat(N()?d().disabledButton:d().enabledButton),onClickBtn:()=>{localStorage.setItem(o.GIx,v.join("")),null==g||g(v.join(""))},children:"X\xe1c Nháºn"})})]})]})});u.displayName="ModalPin";let h=u}},e=>{e.O(0,[2768,7177,636,6593,8792],()=>e(e.s=84657)),_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.