PageSourceSearch

https://cdn.archidekt.com/_next/static/chunks/pages/accountSettings/[settingsName]-d592f04a7da33ca9.js

js archidekt.com collected 2026-09-25 18:51:26 UTC 32,847 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4023],{2244:e=>{e.exports={container:"notificationSettings_container__D3Vqr",submitButtonContainer:"notificationSettings_submitButtonContainer__ItvHg"}},4010:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h}});let r=a(75591)._(a(76430)),s=a(66060),o=[],n=[],l=!1;function i(e){let t=e(),a={loading:!0,loaded:null,error:null};return a.promise=t.then(e=>(a.loading=!1,a.loaded=e,e)).catch(e=>{throw a.loading=!1,a.error=e,e}),a}class c{constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}}function d(e){return function(e,t){let a=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),o=null;function i(){if(!o){let t=new c(e,a);o={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return o.promise()}if(!l){let e=a.webpack&&1?a.webpack():a.modules;e&&n.push(t=>{for(let a of e)if(t.includes(a))return i()})}function d(e,t){let n;i(),(n=r.default.useContext(s.LoadableContext))&&Array.isArray(a.modules)&&a.modules.forEach(e=>{n(e)});let l=r.default.useSyncExternalStore(o.subscribe,o.getCurrentValue,o.getCurrentValue);return r.default.useImperativeHandle(t,()=>({retry:o.retry}),[]),r.default.useMemo(()=>{var t;return l.loading||l.error?r.default.createElement(a.loading,{isLoading:l.loading,pastDelay:l.pastDelay,timedOut:l.timedOut,error:l.error,retry:o.retry}):l.loaded?r.default.createElement((t=l.loaded)&&t.default?t.default:t,e):null},[e,l])}return d.preload=()=>i(),d.displayName="LoadableComponent",r.default.forwardRef(d)}(i,e)}function u(e,t){let a=[];for(;e.length;){let r=e.pop();a.push(r(t))}return Promise.all(a).then(()=>{if(e.length)return u(e,t)})}d.preloadAll=()=>new Promise((e,t)=>{u(o).then(e,t)}),d.preloadReady=(e=[])=>new Promise(t=>{let a=()=>(l=!0,t());u(n,e).then(a,a)}),window.__NEXT_PRELOADREADY=d.preloadReady;let h=d},4825:e=>{e.exports={container:"accountDetails_container__aLubg",trialSection:"accountDetails_trialSection__F6t7c",controls:"accountDetails_controls__N_nOz",ctaLink:"accountDetails_ctaLink__4UfKN"}},6772:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var r=a(75038),s=a(76430);let o="unmounted",n="exited",l={unmounted:{opacity:0},entering:{opacity:0,overflow:"hidden"},entered:{opacity:1},exiting:{opacity:0,overflow:"hidden"},exited:{opacity:0}},i=({children:e,show:t,duration:a=300,outDuration:i,inDuration:c,className:d,style:u,onClick:h,onMouseUp:p,onMouseDown:m,unmountOnClosed:g,cssRemovedFromDOMOnClosed:f})=>{let[x,_]=(0,s.useState)(o);(0,s.useEffect)(()=>{t?j():b()},[t]);let j=()=>{_("entering"),setTimeout(()=>_("entered"),c??a)},b=()=>{_("exiting"),setTimeout(()=>_(n),i??a)},A={};return g&&(x===o||x===n)?null:(f&&(x===o||x===n)&&(A.display="none"),(0,r.jsx)("div",{onClick:h,onMouseDown:m,onMouseUp:p,className:d,style:{...u,transition:`opacity ${a}ms ease-in-out`,opacity:.1,...l[x],...A},children:e}))}},7537:(e,t,a)=>{"use strict";a.d(t,{U:()=>s,h:()=>o});var r=a(57413);let s=r.Ay.div.withConfig({componentId:"sc-b54a5876-0"})(["display:flex;flex-direction:column;flex:1 0 auto;align-items:center;width:100%;position:relative;"]),o=r.Ay.div.withConfig({componentId:"sc-b54a5876-1"})(["width:",";height:","px;min-height:","px;"],e=>e.width?`${e.width}px`:"100%",e=>e.height?e.height:50,e=>e.height?e.height:50)},10235:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var r=a(75038),s=a(76430),o=a(15918),n=a(3957),l=a(68835);let i=({followed:e,followId:t,compact:a,className:i})=>{let[{tbId:c}
1]=(0,o.A)(["tbId"]),[d,u]=(0,s.useState)(!1),[h,p]=(0,s.useState)(e);return((0,s.useEffect)(()=>{p(e)},[e]),Number(c)!==t&&Number(c))?(0,r.jsx)(l.A,{className:i,disabled:!c||d,onClick:()=>{u(!0),n.A.follow(t,h).then(e=>"success"===e.status&&p(!h)).catch(e=>console.error(e)).finally(()=>u(!1))},color:h?void 0:"green",icon:a?void 0:h?"check":"plus",children:h?"Unfollow":"Follow"}):null}},23490:e=>{e.exports={loadingText:"editor_loadingText__QQbZN"}},29677:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={default:function(){return c},noSSR:function(){return i}};for(var s in r)Object.defineProperty(t,s,{enumerable:!0,get:r[s]});let o=a(75591);a(75038),a(76430);let n=o._(a(4010));function l(e){return{default:e?.default||e}}function i(e,t){return delete t.webpack,delete t.modules,e(t)}function c(e,t){let a=n.default,r={loading:({error:e,isLoading:t,pastDelay:a})=>null};e instanceof Promise?r.loader=()=>e:"function"==typeof e?r.loader=e:"object"==typeof e&&(r={...r,...e});let s=(r={...r,...t}).loader;return(r.loadableGenerated&&(r={...r,...r.loadableGenerated},delete r.loadableGenerated),"boolean"!=typeof r.ssr||r.ssr)?a({...r,loader:()=>null!=s?s().then(l):Promise.resolve(l(()=>null))}):(delete r.webpack,delete r.modules,i(a,r))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},30394:e=>{e.exports={container:"accountSettingsContent_container__tSR_V",content:"accountSettingsContent_content__3_H_D",settings:"accountSettingsContent_settings__YQZs1",links:"accountSettingsContent_links__miBgz",selected:"accountSettingsContent_selected__pZoHL",mobileNavigation:"accountSettingsContent_mobileNavigation__aG729",tabButton:"accountSettingsContent_tabButton__XJYap"}},36916:e=>{e.exports={presetAvatars:"uploadAvatar_presetAvatars__qqmWd",dropzone:"uploadAvatar_dropzone__U_IgU",errorMessage:"uploadAvatar_errorMessage__gorTh"}},37383:(e,t,a)=>{"use strict";a.d(t,{q:()=>d});var r=a(75038);a(76430);var s=a(7648),o=a(40120),n=a(23418),l=a(80389),i=a.n(l);let c=({priceSource:e,changePriceSource:t,header:a,className:l="",menuClassName:c=""})=>{let d=n.Vb[e],u=n.L1[e],h=Object.values(n.UV).reduce((e,a)=>{let s=n.Vb[a],l=n.L1[a],i=n.zv[a];return a===n.s6.NONE&&e.push({type:"spacer"}),e.push({id:`${a}`,onClick:()=>t(a),label:(0,r.jsxs)(r.Fragment,{children:[a!==n.s6.NONE&&(0,r.jsx)(o.A,{className:l,style:{color:s}}),a===n.s6.NONE&&(0,r.jsx)(o.A,{name:"cancel",style:{color:s}}),i]})}),e},[]),p=(0,r.jsxs)("label",{children:[e!==n.s6.NONE&&(0,r.jsx)(o.A,{className:u,style:{color:d}}),e===n.s6.NONE&&(0,r.jsx)(o.A,{name:"cancel",style:{color:d}})]});return(0,r.jsx)(s.A,{fixedMenu:!0,matchMenuWidthToParent:!0,header:a,options:h,value:e,selectedLabel:p,className:i().container,triggerClassName:`${i().dropdown} ${l}`,menuClassName:`${i().menu} ${c}`})},d=({priceSources:e,noLabel:t})=>(0,r.jsx)("div",{className:i().group,children:e.map((a,s)=>(0,r.jsx)(c,{header:t||0!==s?void 0:"Price sources",priceSource:a.priceSource,changePriceSource:a.changePriceSource,className:0===s?i().priceSourceOne:s===e.length-1?i().priceSourceLast:i().priceSourceMiddle},`${a}-${s}`))})},39003:e=>{e.exports={form:"username_form___rP1k"}},42952:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>eR,default:()=>e$});var r=a(75038),s=a(76430),o=a(98381),n=a.n(o),l=a(82185),i=a(15918),c=a(3957),d=a(9866),u=a(22335),h=a(68835),p=a(97359),m=a(75249),g=a(36916),f=a.n(g);let x=({user:e,onUserUpdated:t})=>{let[a,o]=(0,s.useState)(!1),[n,l]=(0,s.useState)(!1),[g,x]=(0,s.use
1State)(),[_,j]=(0,s.useState)(!1),[b,A]=(0,i.A)(["tbAvatar"]),w=a=>{A("tbAvatar",a,{path:"/",expires:new Date(Date.now()+3456e6)}),t({profile:{...e.profile,avatar:a}})};return(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{children:"Avatar"}),(0,r.jsx)("h3",{children:"Current Avatar"}),(0,r.jsx)(p.A,{src:e.profile.avatar,username:e.username}),(0,r.jsx)("h3",{children:"Upload New Avatar"}),(0,r.jsxs)("div",{children:[(0,r.jsx)(d.A,{className:f().dropzone,onDrop:e=>x(e[0]),onDropRejected:()=>j(!0),accept:"image/jpeg, image/png",maxSize:1e6,multiple:!1,children:g?(0,r.jsx)("p",{children:g.name}):(0,r.jsx)("p",{children:"Drop a jpeg or png image here or click to upload. (Less than 1 MB)"})}),(0,r.jsx)(h.A,{color:"green",disabled:!g,onClick:()=>{if(g)return o(!0),c.A.uploadAvatar(g).then(e=>{w(e),x(void 0)}).catch(e=>console.error(e)).finally(()=>o(!1))},children:"Set Avatar"}),_&&(0,r.jsx)("div",{className:f().errorMessage,children:"An error occured with the file you selected. Please be sure to choose an image less than 1 MB."})]}),a||a&&(0,r.jsx)(m.A,{}),(0,r.jsx)("h3",{children:"Select a preset avatar"}),(0,r.jsx)("div",{className:f().presetAvatars,children:u.vI.map(t=>{let a=t.toLowerCase().replace(" ","_"),s=u.Cs.includes(t)?"svg":"jpg",o=(e.profile.avatar?.split("avatar_")[1]||"filename").split(".")[0]===a,n=`https://storage.googleapis.com/topdekt-user/avatars/default/avatar_${a}.${s}`;return(0,r.jsxs)("button",{className:o?f().selected:void 0,onClick:()=>!o&&(l(!0),c.A.update({profile:{avatar:a}}).then(e=>w(e.profile.avatar)).catch(e=>console.error(e)).finally(()=>l(!1))),children:[(0,r.jsx)(p.A,{src:n}),(0,r.jsx)("label",{children:t})]},t)})})]})};var _=a(81993),j=a(21159),b=a(84919);let A=({user:e,onUserUpdated:t})=>{let[a,o]=(0,s.useState)(e.profile.bio||_.cR);return(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{children:"User Biography"}),(0,r.jsx)(b.A,{placeholder:"Tell us about yourself...",value:a,onChange:o,onSubmit:()=>c.A.update({profile:{bio:a}}).then(()=>t({profile:{...e.profile,bio:a}})).then(()=>j.A.create("User bio updated","Account settings","success")).catch(()=>j.A.create("Unable to update user bio"))})]})};var w=a(32071),y=a(40120),v=a(7537),S=a(55502),k=a.n(S);let C=({user:e,onUserUpdated:t})=>{let a=(0,o.useRouter)(),[n,l]=(0,s.useState)(""),[i,d]=(0,s.useState)(!1),[u,p]=(0,s.useState)(!1);return((0,s.useEffect)(()=>{var e;l((window.location.origin?window.location.origin:"")+`/accountSettings/patreon&scope=${encodeURIComponent("identity identity[email] campaigns.members")}`),a.query.code&&!Array.isArray(a.query.code)&&(e=a.query.code,d(!0),c.A.connectPatreon(e).then(e=>t({patreonAccount:e.patreonAccount})).catch(()=>j.A.create("Unable to connect patreon account","User Settings")).finally(()=>d(!1))),p(w.Ay.getIsFirefox())},[]),e.patreonAccount)?(0,r.jsxs)("div",{className:k().container,children:[(0,r.jsxs)("h1",{children:[(0,r.jsx)(y.A,{name:"patreon"})," Patreon"]}),(0,r.jsx)("div",{className:k().button,children:(0,r.jsxs)("label",{className:k().label,children:[(0,r.jsx)(y.A,{name:"check"}),e.patreonAccount.email]})}),(0,r.jsx)(v.h,{height:"15"}),e.patreonAccount.pledge?(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{children:[e.patreonAccount.pledge.name," Tier"]}),(0,r.jsx)("div",{children:e.patreonAccount.pledge.description}),(0,r.jsx)("p",{children:" Thank you for your support! "}),(0,r.jsx)("a",{href:"https://www.patreon.com/archidekt",rel:"noopener noreferrer",target:"_blank",children:"See our other tiers!"})]}):(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:"You have no Archidekt pledges linked to this Patreon account."}),(0,r.jsx)("a",{href:"https://www.patreon.com/archidekt",rel:"noopener noreferrer",target:"_blank",children:(0,r.jsx)(h.A,{color:"green",children:"Help us with a pledge!"})})]}),(0,r.jsx)(v.h,{height:"25"}),(0,r.jsx)("div",{className:k().button,children:(0,r.jsx)(h.A,{onClick:()=>{c.A.disconnectPatreon().then(()=>t({patreonAccount:void 0})).catch(()=>j.A.create("Error disconnecting patreon account","User Settings"))},color:"red",children:"Disconnect your patreon"})})]}):(0,r.jsxs)("div",{className:k().container,children:[(0,r.jsxs)("h1",{children:[(0,r.jsx)(y.A,{name:"patreon"})," Patreon"]}),(0,r.jsx)("a",{href:u?"#":`https://www.patreon.com/oauth2/authorize?response_type=code&client_id=3BPChBjaSlyr60wuTl99Ut2725w7nl699cXQnrblyLBVTtVZ6rB4Znsh-Dfgcv3N&redirect_uri=${n}`,children:(0,r.jsx)(h.A,{color:"green",disabled:u,children:"Link your patreon!"})}),u&&(0,r.jsx)("p",{className:k().firefoxMessage,children:"Linking patreon is disabed in Firefox due to a technical issue regarding the way Firefox handles redirects. Please use another browser to link your patreon account. All other features on the site work correctly using Firefox, so this only applies to this specific action."}),i&&(0,r.jsx)(m.A,{})]})};var N=a(44650),U=a(32418),D=a.n(U),T=a(50017),P=a(47853);let E=(e,t)=>({type:P.Ny,payload:{priceSource:e,game:t}});var O=a(85785),R=a(7648),$=a(26975),L=a(97911),M=a(37383),I=a(46118),B=a(60884),F=a.n(B);let V=({user:e,onUserUpdated:t})=>{let a=(0,l.GV)(e=>e.active.priceSource),[s,o]=(0,l.dN)(T.df,E),n=(e,a)=>c.A.update({accountSettings:{[e]:a}}).then(e=>t({accountSettings:e.accountSettings})).catch(()=>j.A.create(`Unable to update user setting - ${e}`)),i=({name:t,value:a})=>{a!==e.accountSettings[t]&&("deckSorting"===t&&(0,I.Iu)(a),"deckStack"===t&&(0,I.Qs)(a),"deckView"===t&&(0,I.pt)(a),"collectionPrice"===t&&o(a,e.accountSettings.collectionGame),"collectionGame"===t&&o(e.accountSettings.collectionGame,a),n(t,a))},d=(t,r)=>{let o=[...a];o[t]=r,s(o),n("deckPrices",D()(e.accountSettings.deckPrices,{[t]:{$set:r}}))};if(!e.accountSettings.deckPrices)return null;let{deckView:u,deckStack:h,deckSorting:p,deckPrices:m,searchUnique:g,searchGame:f,noUseDefaultCategories:x,show_custom_uploads:_}=e.accountSettings;return(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{children:"New Device Default Settings"}),(0,r.jsx)("p",{children:"These settings are set the first time logging in on a new device. It will not override settings manually set from previous sessions."}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{children:"Deck Settings"}),(0,r.jsx)(R.A,{value:u,header:"Default deck page layout",className:F().dropdown,options:Object.keys(O.KF).map(e=>({id:`${O.KF[e]}`,label:e,onClick:()=>i({name:"deckView",value:O.KF[e]})}))}),(0,r.jsx)(R.A,{value:h,header:"Default deck page group-by",className:F().dropdown,options:Object.keys(O.p2).map(e=>({id:`${O.p2[e]}`,label:e,onClick:()=>i({name:"deckStack",value:O.p2[e]})}))}),(0,r.jsx)(R.A,{value:p,header:"Default deck page card order sorting (within a group)",className:F().dropdown,options:Object.keys(O.Zl).map(e=>({id:`${O.Zl[e]}`,label:e,onClick:()=>i({name:"deckSorting",value:O.Zl[e]})}))}),(0,r.jsxs)("div",{className:F().priceSources,children:[(0,r.jsx)("label",{children:"Default price sources"}),(0,r.jsx)(M.q,{noLabel:!0,priceSources:[{priceSource:m[0],changePriceSource:e=>d(0,e)},{priceSource:m[1],changePriceSource:e=>d(1,e)}]})]}),(0,r.jsx)("h2",{children:"Account Settings"}),(0,r.jsx)("p",{children:"These settings will be applied as shown every time you load the page"}),(0,r.jsx)("h3",{children:"Card Search Settings"}),(0,r.jsx)($.A,{onChange:()=>{var t;let a;return t="searchUnique",a=e.accountSettings[t],void n(t,+!a)},label:"Hide all but one edition of a card by default.",checked:!!g}),(0,r.jsx)($.A,{onChange:e=>i({name:"noUseDefaultCategories",value:e}),label:"Disable Community Categories. Cards will use their card type as the default category (eg: Artifact, Creature, Enchantment rather than Ramp, Draw, Removal)",checked:x}),(0,r.jsx)(R.A,{value:f,header:"Default search game-type",className:F().dropdown,options:Object.keys(O.$p).map(e=>({id:`${O.$p[e]}`,label:e,onClick:()=>i({name:"searchGame",value:O.$p[e]})}))}),(0,r.jsx)("h3",{children:"Content Settings"}),(0,r.jsx)($.A,{onChange:e=>i({name:"show_custom_uploads",value:e}),label:"I wish to view other users' uploaded images for custom cards or alters. These images (while moderated) may have less than desirable content, and do not reflect the views of Archidekt.",checked:_})]}),(0,r.jsx)(L.Ay,{})]})};var G=a(69433),q=a(36601),Y=a(76975),Z=a(56771),z=a(46057),Q=a.n(z);let H=()=>{(0,o.useRouter)();
1let[e,t]=(0,s.useState)(!1),[a,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(""),[c,d]=(0,s.useState)(""),[u,p]=(0,s.useState)(""),[m,g]=(0,s.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.A,{onClick:()=>n(!0),children:"Change password"}),(0,r.jsxs)(Y.A,{open:a,onClose:()=>n(!1),children:[(0,r.jsx)("h2",{children:"Change password"}),(0,r.jsxs)("form",{onSubmit:e=>(e.preventDefault(),t(!0),q.A.post("/api/rest-auth/password/change/",{old_password:l,new_password1:c,new_password2:u}).then(()=>j.A.create("Password changed successfully","Password change","success")).catch(e=>{e.old_password&&j.A.create(e.old_password,"Password change","error"),e.new_password2&&j.A.create(e.new_password2,"Password change","error")}).finally(()=>t(!1))),className:Q().form,children:[(0,r.jsx)(Z.A,{header:"Current password",type:"password",value:l,placeholder:"current super strong password",onChange:i,autocomplete:"current-password"}),(0,r.jsx)(Z.A,{header:"New password",type:"password",value:c,placeholder:"super strong password",onChange:d,autocomplete:"new-password"}),(0,r.jsx)(Z.A,{header:"New password (again)",type:"password",value:u,placeholder:"super strong password",onChange:p,autocomplete:"new-password"}),(0,r.jsx)(h.A,{color:"green",type:"submit",disabled:e,children:e?"Changing password...":"Change password"})]})]})]})};var W=a(12912),X=a(39003),K=a.n(X);let J=()=>{let[e,t]=(0,s.useState)(!1),[a,o]=(0,s.useState)(!1),[n,l]=(0,s.useState)(""),[{tbUser:d},u]=(0,i.A)(["tbUser"]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.A,{onClick:()=>o(!0),children:"Change username"}),(0,r.jsxs)(Y.A,{open:a,onClose:()=>o(!1),children:[(0,r.jsx)("h2",{children:"Change username"}),(0,r.jsxs)("form",{onSubmit:e=>(e.preventDefault(),t(!0),c.A.update({username:n}).then(e=>u("tbUser",e.username,{path:"/",domain:(0,W.FB)(),expires:new Date(Date.now()+3456e6)})).catch(e=>{if(e.username)return j.A.create(e.username,"Username change","error")}).finally(()=>t(!1))),className:K().form,children:[(0,r.jsx)(Z.A,{header:"New username",type:"text",value:n,placeholder:"super_username_22",onChange:l}),(0,r.jsx)(h.A,{color:"green",type:"submit",disabled:e,children:e?"Update username...":"Update username"})]})]})]})};var ee=a(90922);let et=()=>
1{let e=(0,o.useRouter)(),[t,a]=(0,s.useState)(!1),[{tbId:n,tbUser:l}]=(0,i.A)(["tbId","tbUser"]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.A,{color:"red",onClick:()=>a(!0),children:"Delete account"}),(0,r.jsx)(ee.A,{open:t,onClose:()=>a(!1),onConfirm:()=>q.A.delete(`/api/users/${n}/delete/`).then(e=>{if(204!==e.status)throw Error("Did not receive a 204 status: Received: "+e.status)}).catch(e=>console.error(e)).finally(()=>{W.Ay.logout(),e.push("/")}),delayEnabledTime:5e3,header:"Delete account",buttonText:`Delete account "${l}"`,loadingMessage:"Deleting account...",message:"Are you sure you want to delete your account? This action is irreversible. You will lose all of your data and settings."})]})};var ea=a(60513),er=a.n(ea);let es=()=>{let[e,t]=(0,s.useState)(!1),[a,o]=(0,s.useState)(!1),[n,l]=(0,s.useState)(""),[i,c]=(0,s.useState)(""),[d,u]=(0,s.useState)("");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.A,{onClick:()=>o(!0),children:"Change email"}),(0,r.jsxs)(Y.A,{open:a,onClose:()=>o(!1),children:[(0,r.jsx)("h2",{children:"Change email"}),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),t(!0),q.A.patch("/api/users/emailChange/",{email:n,password:d}).then(e=>{j.A.create("You must check your inbox for a confirmation email to finish.","Request submitted","success"),o(!1)}).catch(j.A.create).finally(()=>t(!1))},className:er().form,children:[(0,r.jsx)(Z.A,{header:"New email",type:"email",value:n,placeholder:"[email protected]",onChange:l}),(0,r.jsx)(Z.A,{header:"New email",type:"email",value:i,placeholder:"[email protected]",onChange:c}),(0,r.jsx)(Z.A,{header:"Password",type:"password",value:d,placeholder:"super strong password",onChange:u}),(0,r.jsx)(h.A,{color:"green",type:"submit",disabled:e,children:e?"Changing email...":"Change email"})]})]})]})};var eo=a(4825),en=a.n(eo),el=a(33048),ei=a(84932),ec=a.n(ei);let ed=()=>{let e=(0,o.useRouter)(),[t,a]=(0,el.Zd)(),s=(0,el.rI)();return(0,r.jsxs)("div",{className:en().container,children:[(0,r.jsxs)("div",{className:en().trialSection,children:[(0,r.jsx)("h4",{children:"Ad-free trial"}),"IN_PROGRESS"===t&&(0,r.jsxs)("p",{children:["You've claimed a 30 day ad-free experience on Archidekt. Your trial will end on"," ",a.toLocaleDateString()," ",a.toLocaleTimeString(),". At any time, you can extend your ad-free experience by supporting us for as little as $2/month on"," ",(0,r.jsx)(ec(),{href:"https://www.patreon.com/archidekt",className:en().ctaLink,children:"Patreon"}),"."]}),"NOT_STARTED"===t&&!s&&(0,r.jsxs)("p",{children:["Click below to claim 30 days ad-free on Archidekt! At any time, you can extend your ad-free experience by supporting us for as little as $2/month on"," ",(0,r.jsx)(ec(),{href:"https://www.patreon.com/archidekt",className:en().ctaLink,children:"Patreon"}),"."]}),"EXPIRED"===t&&!s&&(0,r.jsxs)("p",{children:["You've already used your 30 day ad-free trial. At any time, you can become ad-free again by supporting us for as little as $2/month on"," ",(0,r.jsx)(ec(),{href:"https://www.patreon.com/archidekt",className:en().ctaLink,children:"Patreon"}),"."]}),"NOT_STARTED"===t&&!s&&(0,r.jsx)("div",{className:en().controls,children:(0,r.jsx)(h.A,{color:"blue",onClick:()=>{c.A.claimAdFreeTrial().then(()=>{j.A.create("Ad free accepted - reloading page...","User service","success"),G.A.signalEvent("Free trial accepted"),setTimeout(()=>e.reload(),3e3)}).catch(e=>j.A.create(e,"User service","error"))},children:"Start 30 day ad-free"})})]}),(0,r.jsx)(H,{}),(0,r.jsx)(J,{}),(0,r.jsx)(es,{}),(0,r.jsx)(et,{})]})};var eu=a(25730),eh=a(34131),ep=a(44619),em=a(76602),eg=a.n(em);let ef=()=>{let[e,t]=(0,s.useState)(!0),[a,o]=(0,s.useState)([]),[n,l]=(0,s.useState)(null),[c,d]=(0,s.useState)(null),[{tbId:u}]=(0,i.A)(["tbId"]),p=()=>{t(!0),eu.A.listTemplates(u).then(o).catch(l).finally(()=>t(!1))};return((0,s.useEffect)(p,[]),e)?(0,r.jsx)(m.A,{}):n?(0,r.jsx)("div",{children:"Unable to load category templates"}):(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{children:"Category Templates"}),(0,r.jsx)("p",{children:"Category templates can be added to decks at creation time, or through a deck's settings. Using category templates allows you to create categories once, then reuse them across multiple decks. Once a category template is added to a deck, it's unlinked to the category template that created it; editing one will not affect the other."}),(0,r.jsx)(eh.A,{categories:a,onEdit:d,onDelete:e=>{e.id&&eu.A.deleteTemplate(e.id).then(p).catch(e=>j.A.create(e,"Category Templates","error"))}}
1),!a.length&&(0,r.jsx)("h5",{children:"You have no Category Templates"}),(0,r.jsx)("div",{className:eg().endRow,children:(0,r.jsx)(h.A,{onClick:()=>d((0,O.F3)()),color:"green",children:"Create new Category Template"})}),(0,r.jsx)(ep.A,{isTemplate:!0,open:!!c,category:c||(0,O.F3)(),onSave:()=>{d(null),p()},onClose:()=>d(null)})]})};var ex=a(47303),e_=a(51202),ej=a(37217),eb=a(83394),eA=a.n(eb);let ew=()=>{let[e,t]=(0,s.useState)(!0),[a,o]=(0,s.useState)([]),[n,l]=(0,s.useState)(!1);(0,s.useEffect)(()=>{i()},[]);let i=()=>{t(!0),ex.A.list().then(o).catch(()=>j.A.create("Unable to fetch color tags","Account settings","error")).finally(()=>t(!1))};return(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{children:"Color tag templates"}),(0,r.jsxs)("p",{children:["Color tag templates exist outside of the context of a deck. They can be used to quickly add consistent color tags to cards without having to recreate them per deck. Once a color tag is added to a card, it"," ",(0,r.jsx)("b",{children:"does not remain linked to the color tag that created it"}),". What this means is that if you edit a color tag template after it has been added to a card, the card will not be updated."]}),e&&(0,r.jsx)(m.A,{}),(0,r.jsx)(e_.A,{tags:a,onDeleted:e=>e&&e.id?ex.A.deleteItem(e.id).then(()=>{j.A.create("Color tag deleted","Account settings","success"),i()}).catch(()=>j.A.create("Unable to delete color tag","Account settings","error")):Promise.resolve(),onEdited:e=>e.name&&e.color?e.name.length>32?j.A.create("Name is too long","Account settings","error"):ex.A.updateItems(e).then(()=>{j.A.create("Color tag updated","Account settings","success"),i()}).catch(e=>j.A.create(e?.name||"Unable to edit color tag","Account settings","error")):j.A.create("Please fill out all fields","Account settings","error")}),(0,r.jsx)("div",{className:eA().controls,children:(0,r.jsx)(h.A,{color:"green",icon:"add",onClick:()=>l(!0),children:"Create new color tag"})}),(0,r.jsx)(ej.A,{open:n,onClose:()=>l(!1),onEdit:e=>e.name&&e.color?e.name.length>32?j.A.create("Name is too long","Account settings","error"):ex.A.create({name:e.name,color:e.color}).then(()=>{j.A.create("Color tag created","Account settings","success"),i()}).catch(e=>j.A.create(e?.name||"Unable to create color tag","Account settings","error")).finally(()=>l(!1)):j.A.create("Please fill out all fields","Account settings","error")})]})};var ey=a(65293),ev=a(69133),eS=a(2244),ek=a.n(eS);let eC=({user:e,onUserUpdated:t})=>{let[a,o]=(0,s.useState)(!1),[n,l]=(0,s.useState)(e.profile.contactable),[i,d]=(0,s.useState)(e.profile.newsletterable),[u,p]=(0,s.useState)(e.profile.comment_notification_emailable),[m,g]=(0,s.useState)(e.accountSettings.noArchidektNotifications);return(0,r.jsxs)("div",{className:ek().container,children:[(0,r.jsx)("h2",{children:"Notification Settings"}),(0,r.jsx)(ey.A,{onClick:()=>l(!n),header:"User feedback emails",description:"We may email you to conduct user feedback surveys or interviews",checked:n}),(0,r.jsx)(ey.A,{onClick:()=>d(!i),header:"Archidekt newsletter",description:"Email newsletter about deck info, interesting data facts, and general MTG information",checked:i}),(0,r.jsx)(ey.A,{onClick:()=>p(!u),header:"Comment notification emails",description:"Receive emails when someone comments on your deck, responds to your comment/thread or adds you as an editor on their deck.",checked:u}),(0,r.jsx)(ey.A,{onClick:()=>g(!m),header:"On-site notifications",description:"News/ contests/ internal update notifications (you'll still receive comment / deck notifications without this enabled)",checked:!m}),(0,r.jsx)("div",{className:ek().submitButtonContainer,children:(0,r.jsxs)(h.A,{onClick:()=>{o(!0),c.A.update({profile:{contactable:n,newsletterable:i,comment_notification_emailable:u},accountSettings:{noArchidektNotifications:m}}).then(()=>{j.A.create("Notification settings updated","Notification settings","success"),t({profile:{...e.profile,contactable:n,newsletterable:i,comment_notification_emailable:u},accountSettings:{...e.accountSettings,noArchidektNotifications:m}})}).catch(()=>j.A.create("Failed to update notification settings","Notification settings","error")).finally(()=>o(!1))},color:"blue",disabled:a,children:[a?(0,r.jsx)(ev.A,{size:"xSmall"}):(0,r.jsx)(y.A,{name:"save"}),"Save notification settings"]})})]})};var eN=a(92910),eU=a(30394),eD=a.n(eU),eT=a(97930);let eP=({user:e,onUserUpdated:t,settingName:a})=>{let s=(0,o.useRouter)(),[{tbId:n}]=(0,i.A)(["tbId"]),l={"site-settings":{label:"Site settings",content:(0,r.jsx)(V,{user:e,onUserUpdated:t})},"account-details":{label:"Account details",content:(0,r.jsx)(ed,{})},bio:{label:"Bio",content:(0,r.jsx)(A,{user:e,onUserUpdated:t})},avatar:{label:"User avatar",content:(0,r.jsx)(x,{user:e,onUserUpdated:t})},"category-templates":{label:"Category templates",content:(0,r.jsx)(ef,{})},"color-tag-templates":{label:"Color tag templates",content:(0,r.jsx)(ew,{})},"notification-settings":{label:"Notification options",content:(0,r.jsx)(eC,{user:e,onUserUpdated:t})},patreon:{label:"Patreon",content:(0,r.jsx)(C,{user:e,onUserUpdated:t})},following:{label:"Following",content:(0,r.jsx)(N.A,{header:"Followed users",fetchUsers:e=>c.A.following(n,e)})}};return(0,r.jsx)("div",{className:eD().container,children:(0,r.jsxs)("div",{className:eD().content,children:[(0,r.jsx)("div",{className:eD().links,children:Object.keys(l).map(e=>(0,r.jsx)(eN.A,{href:`/accountSettings/${e}`,className:a===e?eD().selected:void 0,children:l[e].label},e))}),(0,r.jsx)(eT.A,{className:eD().mobileNavigation,optionsClassName:eD().tabButton,options:Object.keys(l).map(e=>({label:l[e].label,onClick:()=>s.push(`/accountSettings/${e}`),selected:a===e}))}),(0,r.jsx)("div",{className:eD().settings,children:l[a]?.content||null})]})})};var eE=a(79761),eO=a(98419),eR=!0;let e$=({settingsName:e,serverUserData:t})=>{let a=(0,l.GV)(e=>
1e.active.isMobile),[o,i]=(0,s.useState)(t);return((0,s.useEffect)(()=>{t||n().reload()},[]),o)?(0,r.jsxs)(eE.A,{title:"Account Settings",robots:"noindex",children:[(0,r.jsx)(eO.A,{src:"/images/archidekt_small.webp",style:{height:a?150:250}}),(0,r.jsx)(eP,{settingName:e,user:o,onUserUpdated:e=>o?i({...o,...e}):null})]}):null}},44650:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var r=a(75038),s=a(76430),o=a(97359),n=a(10235),l=a(92910),i=a(78393),c=a(64590),d=a.n(c);let u=({header:e,fetchUsers:t})=>{let[a,c]=(0,s.useState)(!0),[u,h]=(0,s.useState)([]),[p,m]=(0,s.useState)(null),[g,f]=(0,s.useState)(0);return(0,s.useEffect)(()=>{t().then(e=>{e.results&&(h([...u,...e.results]),m(e.next),f(e.count))}).catch(e=>console.error(e)).finally(()=>c(!1))},[]),(0,r.jsxs)("div",{className:d().container,children:[(0,r.jsxs)("i",{children:[e," (",g,")"]}),(0,r.jsx)("div",{className:d().users,children:u.map((e,t)=>(0,r.jsxs)("div",{className:d().row,children:[(0,r.jsxs)(l.A,{href:`/u/${(0,i.O)(e.username)}`,children:[(0,r.jsx)(o.A,{src:e?.avatar,username:e?.username}),(0,r.jsx)("div",{children:e.username})]}),(0,r.jsx)(n.A,{followId:e.id,followed:e.following,className:d().followButton})]},t))}),p&&(0,r.jsx)("div",{className:d().loadMore,children:(0,r.jsx)("button",{onClick:()=>{p&&t(p||void 0).then(e=>{e.results&&(h([...u,...e.results]),m(e.next),f(e.count))}).catch(e=>console.error(e)).finally(()=>c(!1))},children:"Load more"})})]})}},46057:e=>{e.exports={form:"newPassword_form__wDQS0"}},55502:e=>{e.exports={container:"patreon_container__ivCnB",button:"patreon_button__aBnLl",firefoxMessage:"patreon_firefoxMessage__7ixX9",label:"patreon_label__khQRf"}},60513:e=>{e.exports={form:"email_form__iVB8H"}},60884:e=>{e.exports={priceSources:"siteSettings_priceSources__j8gS_",dropdown:"siteSettings_dropdown__qEgtd"}},64590:e=>{e.exports={container:"followedUsers_container__44cYo",row:"followedUsers_row__OUQuE",followButton:"followedUsers_followButton__z55EZ",users:"followedUsers_users__hyrxt",loadMore:"followedUsers_loadMore__pGThN"}},66060:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return r}});let r=a(75591)._(a(76430)).default.createContext(null)},76196:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/accountSettings/[settingsName]",function(){return a(42952)}])},76602:e=>{e.exports={flex:"categoryTemplateSettings_flex__UkAQ5",endRow:"categoryTemplateSettings_endRow__YeV7j",loadingColumn:"categoryTemplateSettings_loadingColumn__TOr9M",addButton:"categoryTemplateSettings_addButton__iWK7t",form:"categoryTemplateSettings_form__TCf_G"}},78841:(e,t,a)=>{e.exports=a(29677)},80389:e=>{e.exports={container:"priceDropdown_container__HW2ZV",dropdown:"priceDropdown_dropdown__6GSvV",menu:"priceDropdown_menu__uvCKx",group:"priceDropdown_group__DUysW",priceSourceOne:"priceDropdown_priceSourceOne__hElL_",priceSourceMiddle:"priceDropdown_priceSourceMiddle__e3r0D",priceSourceLast:"priceDropdown_priceSourceLast__tZ5Pd"}},83394:e=>{e.exports={flex:"globalColorTagSettings_flex__NAPq5",controls:"globalColorTagSettings_controls__UwROs"}},84919:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var r=a(75038),s=a(76430),o=a(78841),n=a.n(o),l=a(6772),i=a(23490),c=a.n(i);let d=e=>{let t=()=>(0,r.jsx)("div",{className:c().loadingText,children:e.value}),o=(0,s.useRef)(n()(()=>Promise.all([a.e(9503),a.e(7),a.e(4095),a.e(3945)]).then(a.bind(a,33945)),{loadableGenerated:{webpack:()=>[33945]},ssr:!1,loading:()=>(0,r.jsx)(t,{})})).current;return(0,r.jsx)(l.A,{show:!0,children:(0,r.jsx)(o,{...e})})}}},e=>{e.O(0,[2358,636,6593,8792],()=>e(e.s=76196)),_N_E=e.O()}]);
2//# sourceMappingURL=[settingsName]-d592f04a7da33ca9.js.map

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.