1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[966],{7017:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account",function(){return i(6028)}])},6028:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return L}});var s=i(5893),n=i(7294),a=i(1649),l=i(1324),r=i(1611),d=i(4687),c=i(4327),o=i(969),u=i(2685),v=i(5914),m=i(5819),p=i(6729),h=i(1444),f=i(4214),N=i(3486),_=i(5223);let x=[{name:"CONSENT_GUARDIAN_ALLOWED_ACHIEVEMENTS",printName:"Mastery"},{name:"CONSENT_GUARDIAN_ALLOWED_DEVICE_LINK",printName:"Device Link"},{name:"CONSENT_GUARDIAN_ALLOWED_MARKETING",printName:"Newsletters & Marketing"},{name:"CONSENT_GUARDIAN_ALLOWED_TELEMETRY",printName:"Telemetry"},{name:"CONSENT_GUARDIAN_ALLOWED_UGC",printName:"Creators Club"}];var j=e=>{var t;let i=(0,a.I0)(),l=(0,a.v9)(r.zR),d=(0,a.v9)(r.mG),c=(0,a.v9)(r.n4),[o,j]=(0,n.useState)(x),[y,g]=(0,n.useState)(null==l?void 0:null===(t=l.attributes)||void 0===t?void 0:t.CONSENT_GUARDIAN_MINOR_EMAILS[0]);(0,n.useEffect)(()=>{var e,t;(null==l?void 0:null===(t=l.attributes)||void 0===t?void 0:null===(e=t.CONSENT_GUARDIAN_MINOR_EMAILS)||void 0===e?void 0:e.length)>0&&g(l.attributes.CONSENT_GUARDIAN_MINOR_EMAILS[0])},[l]),(0,n.useEffect)(()=>{if(!(null==l?void 0:l.attributes)||!y)return;let e=x.map(e=>{var t;return{...e,checked:(null===(t=l.attributes[e.name])||void 0===t?void 0:t.includes(y))||!1}});j(e)},[l,y]);let b=async()=>{let e=o.reduce((e,t)=>{let i=e[t.name]||[];return t.checked?e[t.name]=Array.from(new Set([...i,y])):(e[t.name]=i.filter(e=>e!==y),0===e[t.name].length&&delete e[t.name]),e},{...null==l?void 0:l.attributes}),t={...l,attributes:{...l.attributes,...e}},s=await i((0,f.e7)({data:t}));"fulfilled"===s.meta.requestStatus?h.Am.success("Permissions updated"):h.Am.error("Permission update failed")},A=e=>{g(e.target.value)};return d.loading||c.loading?(0,s.jsx)(u.LoadingSpinner,{}):(0,s.jsx)("div",{id:e.id,children:(0,s.jsx)(p.l0,{onSubmit:b,children:e=>{var t,i;let{handleSubmit:n}=e;return(0,s.jsxs)("form",{onSubmit:n,children:[(0,s.jsx)(v.Z,{value:y||(null==l?void 0:null===(t=l.attributes)||void 0===t?void 0:t.CONSENT_GUARDIAN_MINOR_EMAILS[0]),onChange:A,style:{width:"100%"},children:null==l?void 0:null===(i=l.attributes)||void 0===i?void 0:i.CONSENT_GUARDIAN_MINOR_EMAILS.map((e,t)=>(0,s.jsx)(m.Z,{value:e,children:e},t))}),o.map((e,t)=>(0,s.jsxs)("div",{children:[(0,s.jsx)(p.gN,{name:"option",render:t=>{let{input:i,meta:n}=t;return(0,s.jsx)(N.Z,{checked:e.checked,label:e.printName,onChange:t=>{let i=o.map(i=>i.name===e.name?{...i,checked:t.target.checked}:i);j(i)},id:e.name})}}),t+1<o.length&&(0,s.jsx)("hr",{className:"accountDivider"})]},t)),(0,s.jsx)("div",{className:"profileSettings__submitButton",children:(0,s.jsx)(_.Z,{type:"submit",children:"Save changes"})})]})}})})},y=i(7399),g=i(7454),b=i(135),A=e=>{let[t,i]=(0,n.useState)({}),r=(0,a.I0)(),d=(0,a.v9)(l.Ai),c=(0,a.v9)(g.lt);(0,n.useEffect)(()=>{o()},[]);let o=async()=>{let e=d.usernameUrlSafe,t=await r((0,y.PR)(e)),{privacyOptions:s}=t.payload,n={};s&&Object.entries(s).forEach(e=>{let[t,i]=e;n[t]="public"===i}),i({updatedPrivacyOptions:n})},u=async()=>{let e={};for(let i in t.updatedPrivacyOptions)t.updatedPrivacyOptions[i]?e[i]="public":e[i]="private";let i=await r((0,y.h2)({data:e}));"fulfilled"===i.meta.requestStatus&&"fulfilled"===i.meta.requestStatus?h.Am.success("Privacy updated"):h.Am.error("Privacy update failed")};return(0,s.jsx)("div",{className:"privacy accountManagement__tab",id:e.id,children:!c.loading&&(null==t?void 0:t.updatedPrivacyOptions)?(0,s.jsx)("div",{children:(0,s.jsx)(p.l0,{onSubmit:u,children:e=>{var n,a,l;let{handleSubmit:r}=e;return(0,s.jsxs)("form",{onSubmit:r,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(p.gN,{name:"profile",initialValue:null===(n=t.updatedPrivacyOptions)||void 0===n?void 0:n.profile,render:e=>{var n;let{input:a,meta:l}=e;return(0,s.jsx)(N.Z,{checked:null===(n=t.updatedPrivacyOptions)||void 0===n?void 0:n.profile,label:"Show my profile publicly",onChange:e=>{!1===e.target.checked?i(t=>{let i=Object.assign({},t.updatedPrivacyOptions);
1return Object.keys(i).forEach(e=>i[e]=!1),i.profile=e.target.checked,{updatedPrivacyOptions:i}}):i(t=>{let i=Object.assign({},t.updatedPrivacyOptions);return i.profile=e.target.checked,{updatedPrivacyOptions:i}})},id:"privacyProfile"})}}),(0,s.jsx)("hr",{className:"accountDivider"}),(0,s.jsx)(p.gN,{name:"mastery",initialValue:null===(a=t.updatedPrivacyOptions)||void 0===a?void 0:a.mastery,render:e=>{var n,a;let{input:l,meta:r}=e;return(0,s.jsx)(N.Z,{checked:null===(n=t.updatedPrivacyOptions)||void 0===n?void 0:n.mastery,label:"Show Mastery on my profile",disabled:!(null===(a=t.updatedPrivacyOptions)||void 0===a?void 0:a.profile),onChange:e=>i(t=>{let i=Object.assign({},t.updatedPrivacyOptions);return i.mastery=e.target.checked,{updatedPrivacyOptions:i}}),id:"privacyMastery"})}}),(0,s.jsx)("hr",{className:"accountDivider"}),(0,s.jsx)(p.gN,{name:"screenshots",initialValue:null===(l=t.updatedPrivacyOptions)||void 0===l?void 0:l.screenshots,render:e=>{var n,a;let{input:l,meta:r}=e;return(0,s.jsx)(N.Z,{checked:null===(n=t.updatedPrivacyOptions)||void 0===n?void 0:n.screenshots,label:"Show Photos on my profile",disabled:!(null===(a=t.updatedPrivacyOptions)||void 0===a?void 0:a.profile),onChange:e=>i(t=>{let i=Object.assign({},t.updatedPrivacyOptions);return i.screenshots=e.target.checked,{updatedPrivacyOptions:i}}),id:"privacyScreenshots"})}})]}),(0,s.jsx)("div",{className:"profileSettings__submitButton",children:(0,s.jsx)(_.Z,{type:"submit",children:"Save changes"})})]})}})}):(0,s.jsx)(b.Z,{})})},S=i(7860),O=i(7878),E=i(8271),I=()=>{let[e,t]=(0,n.useState)(!1),[i,r]=(0,n.useState)(!1),[d,c]=(0,n.useState)(!1),[o,u]=(0,n.use
1State)(""),v=(0,a.v9)(l.Ai),m=(0,a.I0)(),N=async()=>{await x()},x=async()=>{let e={username:v.email,password:o,grant_type:"password",scope:"openid",client_id:"nexus"},t=new URLSearchParams(e).toString(),i=await m((0,f.eU)({data:t}));"fulfilled"===i.meta.requestStatus&&"fulfilled"===i.meta.requestStatus?(c(!1),j()):c(!0)},j=async()=>{let e=await m((0,S.xU)());"fulfilled"===e.meta.requestStatus&&"fulfilled"===e.meta.requestStatus?(t(!1),r(!0)):h.Am.error("Account deletion failed")};return(0,s.jsxs)("div",{children:[(0,s.jsx)(_.Z,{onClick:()=>t(!0),variant:"negative",children:"Delete Account"}),(0,s.jsx)(O.Z,{open:e,onClose:()=>t(!1),children:(0,s.jsx)("div",{className:"security__deleteAccountModal flexAlignCenter flexJustifyCenter",children:(0,s.jsxs)("div",{className:"security__modalContent dtl-p-4",children:[(0,s.jsx)("p",{children:"Are you sure you want to delete your Dovetail Live Account? All data identifying you and your account and/or related purchases will be deleted. This action cannot be undone."}),(0,s.jsx)("p",{children:"To continue, enter your Dovetail Live Account password."}),(0,s.jsx)(p.l0,{onSubmit:N,children:e=>{let{handleSubmit:i}=e;return(0,s.jsxs)("form",{onSubmit:i,children:[(0,s.jsx)(E.Z,{label:"Enter password",type:"password",value:o,onChange:e=>u(e.target.value),fullWidth:!0,required:!0,error:d,helperText:d?"Invalid password. A correct password must be provided in order to delete your Dovetail Live Account.":""}),(0,s.jsxs)("div",{className:"security__modalButtons",children:[(0,s.jsx)(_.Z,{onClick:()=>t(!1),children:"Cancel"}),(0,s.jsx)(_.Z,{variant:"negative",type:"submit",children:"Proceed"})]})]})}})]})})}),(0,s.jsx)(O.Z,{open:i,children:(0,s.jsx)("div",{className:"security__deleteAccountModal",children:(0,s.jsxs)("div",{className:"security__modalContent",children:[(0,s.jsx)("p",{children:"Dovetail Live Account successfully deleted"}),(0,s.jsx)(_.Z,{onClick:()=>window.location.href="/",children:"Close"})]})})})]})},C=e=>{let[t,i]=(0,n.useState)(!1),l=(0,a.I0)(),r=(0,a.v9)(g.KL),d=(0,a.v9)(g.YD),c=async()=>{let e=await l((0,y.LS)());"fulfilled"===e.meta.requestStatus&&"fulfilled"===e.meta.requestStatus?(h.Am.success("Password reset email sent"),i(!0)):h.Am.error("Failed to send password reset email")};return(0,s.jsx)("div",{className:"security accountManagement__tab",id:e.id,children:r.loading||d.loading?(0,s.jsx)(b.Z,{}):(0,s.jsx)("div",{children:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"I'd like to update my password or delete my Dovetail Live account and all data within"}),(0,s.jsxs)("div",{className:"security__buttonContainer flexAlignCenter",children:[(0,s.jsx)(_.Z,{disabled:t,onClick:c,children:t?"Password reset email sent!":"Update Password"}),(0,s.jsx)(I,{})]})]})})})},w=i(1857),M=e=>(0,s.jsx)("div",{className:"notLoggedIn",children:(0,s.jsxs)("div",{className:"notLoggedIn__cont",children:[(0,s.jsx)("div",{className:"notLoggedIn__text",children:"You must be logged in to access this content"}),(0,s.jsx)(w.Z,{})]})}),P=e=>(0,s.jsx)("div",{className:"nexusSidebar",children:e.sectionRefs.map((e,t)=>(0,s.jsx)("a",{href:"#".concat(e.id),className:"nexusSidebar__link dtl-py-3 dtl-px-4",children:e.label},t))}),R=e=>{var t,i,u;let v=(0,a.v9)(r.v0),m=(0,a.v9)(l.Ai),p=(0,a.v9)(r.zR),h=(0,n.useRef)(null);(0,n.useRef)(null);let f=(0,n.useRef)(null),N=(0,n.useRef)(null),_=(0,n.useRef)(null),x=(0,n.useRef)(null),[y,g]=(0,n.useState)([]);(0,n.useEffect)(()=>{var e,t;let i=[],s=[{id:"profileSettings",label:"Profile Details",ref:h},{id:"notifications",label:"Notifications",ref:f},...(null==p?void 0:null===(t=p.attributes)||void 0===t?void 0:null===(e=t.CONSENT_GUARDIAN_MINOR_EMAILS)||void 0===e?void 0:e.length)>0?[{id:"permissions",label:"Guardian Permissions",ref:N}]:[],{id:"privacy",label:"Privacy",ref:_},{id:"security",label:"Security",ref:x}];s.forEach(e=>{i.push({id:e.id,label:e.label,offset:b(e.ref)})}),g(i)},[null==p?void 0:null===(t=p.attributes)||void 0===t?void 0:t.CONSENT_GUARDIAN_MINOR_EMAILS]);let b=e=>{if(e.current){let t=e.current.getBoundingClientRect();return t.top+window.scrollY}};return(0,d.j)(m,v)?(0,s.jsx)("div",{className:"accountManagement dtl-p-4",children:(0,s.jsxs)("div",{className:"accountManagement__container",children:[(0,s.jsx)("h1",{children:"My A
1ccount Overview"}),(0,s.jsxs)("div",{className:"accountManagement__contentContainer",children:[(0,s.jsx)("div",{className:"accountManagement__sidebarContainer",children:(0,s.jsx)(P,{sectionRefs:y})}),(0,s.jsxs)("div",{className:"accountManagement__content",children:[(0,s.jsxs)("section",{className:"accountManagement__section dtl-pt-3 dtl-pr-4 dtl-pb-4 dtl-pl-4",ref:h,children:[(0,s.jsx)("h1",{className:"dtl-pb-3",children:"Profile Details"}),(0,s.jsx)(c.Z,{id:"profileSettings"})]}),(0,s.jsxs)("section",{className:"accountManagement__section dtl-pt-3 dtl-pr-4 dtl-pb-4 dtl-pl-4",ref:f,children:[(0,s.jsx)("h1",{className:"dtl-pb-3",children:"Notifications"}),(0,s.jsx)(o.Z,{id:"notifications"})]}),(null==p?void 0:null===(u=p.attributes)||void 0===u?void 0:null===(i=u.CONSENT_GUARDIAN_MINOR_EMAILS)||void 0===i?void 0:i.length)>0&&(0,s.jsxs)("section",{className:"accountManagement__section dtl-pt-3 dtl-pr-4 dtl-pb-4 dtl-pl-4",ref:N,children:[(0,s.jsx)("h1",{className:"dtl-pb-3",children:"Guardian Permissions"}),(0,s.jsx)(j,{id:"permissions"})]}),(0,s.jsxs)("section",{className:"accountManagement__section dtl-pt-3 dtl-pr-4 dtl-pb-4 dtl-pl-4",ref:_,children:[(0,s.jsx)("h1",{className:"dtl-pb-3",children:"Privacy"}),(0,s.jsx)(A,{id:"privacy"})]}),(0,s.jsxs)("section",{className:"accountManagement__section dtl-pt-3 dtl-pr-4 dtl-pb-4 dtl-pl-4",ref:x,children:[(0,s.jsx)("h1",{className:"dtl-pb-3",children:"Security"}),(0,s.jsx)(C,{id:"security"})]})]})]})]})}):(0,s.jsx)("div",{className:"accountManagement",children:(0,s.jsx)(M,{})})},L=e=>(0,s.jsx)(R,{...e})},7454:function(e,t,i){"use strict";i.d(t,{KL:function(){return n},V_:function(){return s},YD:function(){return r},eL:function(){return a},lt:function(){return l},mg:function(){return d}});let s=e=>e.users.data.targetUser,n=e=>e.users.getUser,a=e=>e.users.getUserById,l=e=>e.users.updatePrivacy,r=e=>e.users.sendPasswordResetEmail,d=e=>e.users.data.currentUser.profilePicture}},function(e){e.O(0,[271,774,888,179],function(){return e(e.s=7017)}),_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.