PageSourceSearch

https://splinterlands.com/assets/AccountSecurity-B7hiN6xG.js

js splinterlands.com collected 2026-09-24 09:54:23 UTC 16,832 bytes, 1 lines download raw bytes

1import{Z as _e,Y as ye,j as s,X as je}from"./vendor-ui-BfO2VaBV.js";import{s as b,B as f,p as Q,E as A,G as ce,kH as Se,T as de,lS as we,lT as be,a as me,e as ve,g as oe,f as ke,l0 as Ee,t,lQ as Ce,n as T,lR as ee,a2 as Z,J as P,o as M,jy as Ae,lU as Re,k3 as qe,kL as Le,c as he,lV as $e,lJ as te,r as Te,iX as pe,lK as fe,lI as ne,lv as ge,$ as Be,lW as Ie,b as Ke,lh as Fe,lX as Pe,kA as Me,lY as Ue,lZ as We,l_ as De,lH as He,lG as Ne}from"./index-iXJSSkdU.js";import{a as w}from"./vendor-redux-DAFPkm2K.js";import{b as Ve}from"./transaction-CblphIKZ.js";import"./vendor-blockchain-B33N8Jyr.js";import"./three-DYsWAOM3.js";import"./maps-BKggpbsI.js";const ie=b(f,{font:"normal normal bold 23px/31px Proxima Nova",color:"#F0A528E6",letterSpacing:"0px"}),C=b(f,{font:"normal normal normal 14px/20px Proxima Nova",color:"#FFFFFF",letterSpacing:"0px",variants:{success:{true:{color:"#24DC34"}}}}),Ye=b(f,{width:540,maxWidth:"100%",background:"#000000B3 0% 0% no-repeat padding-box",boxShadow:"3px 3px 6px #00000029",minHeight:"100vh",padding:"60px 40px",position:"relative",margin:"auto"}),Oe=b("button",{all:"unset",opacity:"0.8",position:"absolute",top:"10px",right:"10px",zIndex:10}),Ge=b(Q,{all:"unset",cursor:"pointer",width:40});async function Xe(e,i){let u;const c=Date.now(),p="Change email for user: ".concat(e," | ").concat(c);try{if(i){if(!Re(i))throw new Error("Active key is invalid.");u=qe(p,i)}else u=(await Le(e,p,"Active")).result}catch(l){throw console.error("requestHiveSignature error",l),l}return{ts:c,msg:p,address:e,sig:u}}const ze=({setIsChangeEmailFormOpen:e,setSuccessChangeEmail:i})=>{var U,W,se,D,H,K,F,N,V;const[u,c]=w.useState(""),p=A(ce),l=A(Se),g=A(de),[y]=we(),[x]=be(),a=me(),r=!!(l&&!g),S=ve({email:oe().lowercase().email("Invalid email address").required("Email is required."),confirmEmail:oe().lowercase().required("Confirm Email is required.").oneOf([Ee("email")],t("dialogs.create_account.error_mismatched_emails")),activeKeyRequired:ke(),activeKey:oe().when(["activeKeyRequired"],([$],m)=>$?m.required("Active key is required"):m.optional())}),j={resolver:_e(S),defaultValues:{activeKeyRequired:r}},{register:o,handleSubmit:R,formState:{errors:n,touchedFields:v},watch:B,trigger:q}=ye(j),L=B("email"),d=B("confirmEmail"),k=B("activeKey");w.useEffect(()=>{L&&q("email"),d&&q("confirmEmail"),c("")},[L,d,q]),w.useEffect(()=>{k&&q("activeKey")},[q,k]);const Y=async $=>{try{c(""),a(M(!0));let m;if(g)m=await y({new_email:$.email}).unwrap();else{const{sig:O,ts:G}=await Xe(p,$.activeKey);m=await x({new_email:$.email,sig:O,ts:G}).unwrap()}if(!m.success){c((m==null?void 0:m.error)||t("account_security.error_change_email")),a(M(!1));return}a(Ae({email:$.email})),e(!1),i(!0),a(M(!1))}catch(m){c((m==null?void 0:m.message)||t("account_security.error_change_email")),console.error("rejected",m),a(M(!1))}};return s.jsxs(Ye,{children:[s.jsx(Oe,{type:"button",onClick:()=>{e(!1)},children:s.jsx(je,{label:"Close",children:s.jsx(Ge,{src:"".concat(window.config.SL_ASSETS_URL,"/ui_elements/account_security/cross.svg")})})}),s.jsxs(Ce,{onSubmit:R(Y),children:[s.jsxs(T,{css:{gap:20,flexDirection:"column"},children:[s.jsx(ie,{children:t("account_security.change_account_email")}),r&&s.jsx(C,{children:t("account_security.active_key_required_message")})]}),r&&s.jsxs(T,{css:{gap:10,flexDirection:"column",marginTop:20},children:[s.jsx(ie,{children:t("account_security.enter_active_keys")}),s.jsxs(f,{css:{position:"relative",width:"100%"},children:[s.jsx(ee,{...o("activeKey"),type:"password",css:{br:"20px"}}),s.jsx(f,{css:{position:"absolute",top:"50%",transform:"translateY(-50%)",right:10},children:v.activeKey&&s.jsx(Q,{src:!k||(U=n==null?void 0:n.activeKey)!=null&&U.message?"".concat(window.config.SL_ASSETS_URL,"/ui_elements/account_security/fail.svg"):"".concat(window.config.SL_ASSETS_URL,"/ui_elements/account_security/success.svg")})})]}),v.activeKey&&((W=n==null?void 0:n.activeKey)==null?void 0:W.message)&&s.jsx(Z,{children:(se=n==null?void 0:n.activeKey)==null?void 0:se.message})]}),s.jsxs(T,{css:{gap:10,flexDirection:"column",marginTop:20},children:[s.jsx(ie,{children:t("account_security.new_email")}),s.jsxs(f,{css:{position:"relative",width:"100%"},children:[s.jsx(ee,{...o("email"),placeholder:"Email",type:"email",autoComplete:"email",css:{br:"20px"}}),s.jsx(f,{css:{position:"absolute",top:"50%",transform:"translateY(-50%)",right:10},children:v.email&&s.jsx(Q,{src:!L||(D=n==null?void 0:n.email)!=null&&D.message?"".concat(window.config.SL_ASSETS_URL,"/ui_elements/account_security/fail.svg"):"".concat(window.config.SL_ASSETS_URL,"/ui_elements/account_security/success.svg")})})]}),v.email&&((H=n==null?void 0:n.email)==null?void 0:H.message)&&s.jsx(Z,{children:(K=n==null?void 0:n.email)==null?void 0:K.message}),s.jsxs(f,{css:{position:"relative",width:"100%"},children:[s.jsx(ee,{...o("confirmEmail"),placeholder:"Confirm Email",type:"email",autoComplete:"email",css:{br:"20px"}}),s.jsx(f,{css:{position:"absolute",top:"50%",transform:"translateY(-50%)",right:10},children:v.confirmEmail&&s.jsx(Q,{src:!d||(F=n==null?void 0:n.confirmEmail)!=null&&F.message?"".concat(window.config.SL_ASSETS_URL,"/ui_elements/account_security/fail.svg"):"".concat(window.config.SL_ASSETS_URL,"/ui_elements/account_security/success.svg")})})]}),v.confirmEmail&&((N=n==null?void 0:n.confirmEmail)==null?void 0:N.message)&&s.jsx(Z,{children:(V=n==null?void 0:n.confirmEmail)==null?void 0:V.message})]}),s.jsx(f,{css:{marginTop:20},children:s.jsx(Z,{children:u})}),s.jsx(f,{css:{marginTop:20},children:s.jsx(P,{color:"darkBlue",css:{width:141,fontWeight:"normal"},children:t("account_security.change_email")})})]})]})},Je=b(f,{font:'16px / 26px "Proxima Nova"',color:"#F7E49A"}),Qe=b(f,{font:'14px / 16px "Proxima Nova"',color:"white"}
1),Ze=b(T,{gap:"5px",alignItems:"center",background:"0% 0% no-repeat padding-box padding-box rgb(7, 92, 100)",borderRadius:"5px",padding:"6px 12px",color:"white",font:'12px / 14px "Proxima Nova"',justifyContent:"space-between"}),es=()=>{const e=he.c(34),i=Ve(),u=A(ce),[c,p]=w.useState(!1);let l;e[0]!==u?(l={players:u},e[0]=u,e[1]=l):l=e[1];const g=!u;let y;e[2]!==g?(y={skip:g},e[2]=g,e[3]=y):y=e[3];const{data:x}=$e(l,y);let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a={delegation:[],purchase:[],rental:[],sell:[]},e[4]=a):a=e[4];const[r,S]=w.useState(a);let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j={},e[5]=j):j=e[5];const[o,R]=w.useState(j);let n,v;e[6]!==x||e[7]!==u?(n=()=>{var I,X,E,z,re,ae,le,ue;if(!x)return;const h=x.find(xe=>xe.name===u);if(!h)return;const _={delegation:(X=(I=h==null?void 0:h.authorities)==null?void 0:I.delegation)!=null?X:[],purchase:(z=(E=h==null?void 0:h.authorities)==null?void 0:E.purchase)!=null?z:[],rental:(ae=(re=h==null?void 0:h.authorities)==null?void 0:re.rental)!=null?ae:[],sell:(ue=(le=h==null?void 0:h.authorities)==null?void 0:le.sell)!=null?ue:[]};S(_)},v=[x,u],e[6]=x,e[7]=u,e[8]=n,e[9]=v):(n=e[8],v=e[9]),w.useEffect(n,v);let B;e[10]===Symbol.for("react.memo_cache_sentinel")?(B=(h,_)=>{_&&S(I=>({...I,[h]:Array.from(new Set([...I[h],_]))}))},e[10]=B):B=e[10];const q=B;let L;e[11]===Symbol.for("react.memo_cache_sentinel")?(L=(h,_)=>{S(I=>({...I,[h]:I[h].filter(X=>X!==_)}))},e[11]=L):L=e[11];const d=L;let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k={authority:"delegation",title:t("account_security.delegation"),tooltip:t("account_security.delegation_info")},e[12]=k):k=e[12];let Y;e[13]===Symbol.for("react.memo_cache_sentinel")?(Y={authority:"rental",title:t("account_security.rental"),tooltip:t("account_security.rental_info")},e[13]=Y):Y=e[13];let U;e[14]===Symbol.for("react.memo_cache_sentinel")?(U={authority:"purchase",title:t("account_security.purchase"),tooltip:t("account_security.purchase_info")},e[14]=U):U=e[14];let W;e[15]===Symbol.for("react.memo_cache_sentinel")?(W=[k,Y,U,{authority:"sell",title:t("account_security.sell"),tooltip:t("account_security.sell_info")}],e[15]=W):W=e[15];const se=W;let D,H;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=t("account_security.authority_warning"),H=()=>{p(!1)},e[16]=D,e[17]=H):(D=e[16],H=e[17]);let K;e[18]!==r||e[19]!==i?(K=()=>{p(!1),i({authority:r})},e[18]=r,e[19]=i,e[20]=K):K=e[20];let F;e[21]!==c||e[22]!==K?(F=s.jsx(pe,{text:D,onCancel:H,onConfirm:K,open:c}),e[21]=c,e[22]=K,e[23]=F):F=e[23];let N,V;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(te,{children:t("account_security.authority")}),V=s.jsx(fe,{}),e[24]=N,e[25]=V):(N=e[24],V=e[25]);let $;e[26]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(C,{children:t("account_security.authority_description")}),e[26]=$):$=e[26];let m;e[27]!==r||e[28]!==o?(m=se.map(h=>{const{authority:_,title:I,tooltip:X}=h;return s.jsxs(T,{css:{flexDirection:"column",gap:"8px"},children:[s.jsxs(T,{css:{alignItems:"center",gap:"8px"},children:[s.jsx(Je,{children:I}),s.jsx(Te,{content:X})]}),s.jsxs(T,{css:{height:"40px"},children:[s.jsx(ee,{css:{color:"$paleYellow",borderRight:"none"},placeholder:t("account_security.account_placeholder"),value:o[_]||"",onChange:E=>R(z=>({...z,[_]:E.target.value})),onKeyUp:E=>{E.key==="Enter"&&(q(_,o[_]),R(z=>({...z,[_]:""})))}}),s.jsx(P,{css:{borderRadius:"0px 20px 20px 0px",width:100,fontWeight:"normal"},color:"darkBlue",onClick:()=>{q(_,o[_]),R(E=>({...E,[_]:""}))},children:t("account_security.add")})]}),s.jsx(T,{css:{flexWrap:"wrap",gap:"8px"},children:r[_].map(E=>s.jsxs(Ze,{children:[s.jsx(Q,{src:"".concat(window.config.SL_ASSETS_URL,"/ui_elements/cards/icon_close.png"),height:"10px",css:{cursor:"pointer"},onClick:()=>d(_,E)}),s.jsx(Qe,{children:E})]},E))})]},_)}),e[27]=r,e[28]=o,e[29]=m):m=e[29];let O;e[30]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(P,{color:"darkBlue",css:{width:180,fontWeight:"normal"},onClick:()=>p(!0),children:t("account_security.save")}),e[30]=O):O=e[30];let G;return e[31]!==F||e[32]!==m?(G=s.jsxs(ne,{children:[F,N,V,$,m,O]}),e[31]=F,e[32]=m,e[33]=G):G=e[33],G},ss=b(ge,{color:"#ff8484",mt:"12px"}),J=b(ge,{mt:"12px"}),ts=({isDisabled:e})=>{const i=A(ce),u=A(Be),[c,p]=w.useState(!1),[l,g]=w.useState(!1),[y,x]=w.useState(!1),[a,r]=w.useState(null),[S]=Ie(),j=async()=>{try{r(null);const o=await S({username:i,token:u}).unwrap();o!=null&&o.error?r(o==null?void 0:o.error):o!=null&&o.success?(o.warning&&x(!0),p(!0)):r("An error occurred requesting your keys please contact us at https://support.splinterlands.com if this issue continues.")}catch(o){r("An error occurred requesting your keys please contact us at https://support.splinterlands.com if this issue continues."),console.error("rejected",o)}};return s.jsxs(pe,{text:"",onCancel:c?null:()=>{g(!1),r(null)},confirmText:c?"CONTINUE":"SUBMIT",onConfirm:()=>{c?(g(!1),p(!1)):j()},open:l,triggerElement:s.jsx(P,{color:"darkBlue",css:{width:180,fontWeight:"normal"},disabled:e,isDisabled:e,onClick:()=>{e||g(!0)},children:t("account_security.request_keys")}),contentProps:{css:{top:"46%",background:"none",maxHeight:"90vh",overflow:"auto"},overlayCss:{background:"rgba(0, 0, 0, 0.8)"}},children:[!c&&s.jsxs(s.Fragment,{children:[s.jsx(J,{children:t("dialogs.request_keys.p1")}),s.jsx(J,{children:t("dialogs.request_keys.p2",{name:"@".concat(i)})}),s.jsx(J,{children:t("dialogs.request_keys.p3")}),s.jsx(J,{children:t("dialogs.request_keys.p4")}),a&&s.jsx(ss,{children:a})]}),c&&s.jsxs(s.Fragment,{children:[s.jsx(J,{children:t("dialogs.request_keys.complete")}
1),y&&s.jsx(J,{children:"One or more Hive keys were changed externally. Please contact support for further assistance."})]})]})},ns=b(T,{width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:24,padding:"60px 10px",variants:{isChangeEmailFormOpen:{true:{opacity:.2,display:"none"}}}}),os=({setIsChangeEmailFormOpen:e,isChangeEmailFormOpen:i})=>{const u=Ke(),c=A(Fe),p=A(Pe),l=A(de),g=A(Me),y=A(Ue),x=A(We),a=me(),[r,S]=w.useState(!1),[j,o]=w.useState(!1),[R,n]=w.useState(null),[v]=De(),B=async()=>{var q,L;try{a(M(!0)),n(null);const d=await v(null).unwrap();if(!d.success){const k=typeof(d==null?void 0:d.error)=="string"?d.error:t("account_security.error_try_again");n(k),a(M(!1));return}d!=null&&d.warning&&o(!0),S(!0),a(M(!1))}catch(d){const k=typeof((q=d==null?void 0:d.data)==null?void 0:q.error)=="string"?(L=d==null?void 0:d.data)==null?void 0:L.error:t("account_security.error_try_again");n(k),a(M(!1))}};return s.jsxs(ns,{isChangeEmailFormOpen:i,children:[s.jsxs(ne,{children:[s.jsx(te,{children:t("account_security.current_email")}),s.jsx(fe,{}),s.jsxs(T,{css:{height:"40px"},children:[s.jsx(ee,{value:c,disabled:!0,css:{color:"$paleYellow",borderRight:"none",cursor:"not-allowed"}}),s.jsx(P,{css:{borderRadius:"0px 20px 20px 0px",width:100,fontWeight:"normal"},color:"darkBlue",onClick:()=>{e(!0)},disabled:i,isDisabled:i,children:c?t("account_security.change"):t("account_security.set")})]}),!c&&s.jsx(C,{children:t("account_security.email_not_set")}),p&&s.jsxs(s.Fragment,{children:[s.jsx(C,{children:t("account_security.email_not_verified")}),s.jsx(P,{color:"darkBlue",css:{width:180,fontWeight:"normal"},disabled:i,isDisabled:i,onClick:()=>{u("/email-verification")},children:t("account_security.verify_email")})]})]}),x&&s.jsxs(ne,{children:[s.jsx(te,{children:t("account_security.change_password")}),s.jsx(C,{children:t("account_security.strong_password")}),s.jsx(P,{color:"darkBlue",css:{width:180,fontWeight:"normal"},disabled:i,isDisabled:i,onClick:()=>{B()},children:t("account_security.edit_password")}),(R||r)&&s.jsxs(f,{children:[R&&s.jsx(Z,{children:R}),r&&s.jsxs(s.Fragment,{children:[s.jsx(C,{success:!0,children:t("account_security.requested_change_email_description")}),s.jsx(C,{css:{mt:"8px"},success:!0,children:t("account_security.requested_change_email_additional")}),j&&s.jsx(C,{children:"One or more Hive keys were changed externally. If you need further assitance please contact support after resetting your password."})]})]})]}),s.jsxs(ne,{children:[s.jsx(te,{children:t("account_security.keys")}),s.jsx(C,{children:l?"Upgrade your account by buying the Summoner's Spellbook in order to request your private keys.":g?y?t("account_security.no_keys"):"Lost your keys?":"Upgrade your account by buying the Summoner's Spellbook in order to unlock more rewards."}),s.jsxs(T,{css:{gap:20,alignItems:"center"},children:[y&&s.jsx(ts,{isDisabled:i}),!y&&s.jsx(P,{color:"darkBlue",css:{width:180,fontWeight:"normal"},onClick:()=>{l||!g?u("/shop/spellbook"):window.open("https://support.splinterlands.com/hc/en-us/requests/new?ticket_form_id=4412127327252","_blank","noopener,noreferrer")},children:l||!g?"Purchase Spellbook":"Request Help"}),s.jsxs(f,{children:[s.jsx(C,{css:{color:"#BBF1F1",cursor:"pointer",textDecoration:"underline"},onClick:()=>{window.open("https://docs.splinterlands.com/platform/hiveblockchain/accounts-and-keys","_blank","noopener,noreferrer")},children:t("account_security.what_are_keys")}),s.jsx(C,{css:{color:"#BBF1F1",cursor:"pointer",textDecoration:"underline"},onClick:()=>{window.open("https://support.splinterlands.com/hc/en-us/articles/4412509430164-5-Steps-to-Retrieving-Your-Hive-Private-Keys","_blank","noopener,noreferrer")},children:"Key Retrieval Guide"})]})]})]}),!l&&s.jsx(es,{}),s.jsx(f,{css:{height:"60px"}})]})},is=b(f,{backgroundImage:"url(".concat(window.config.SL_ASSETS_URL,"/land/bg_buy_token.jpg)"),backgroundRepeat:"no-repeat",backgroundAttachment:"fixed",backgroundSize:"cover",minHeight:"100vh"}),cs=b(Q,{position:"absolute",top:-5,left:"50%",transform:"translateX(-50%)",cursor:"pointer",width:450,maxWidth:"90%"}),rs=b(C,{color:"$white",position:"absolute",top:16,cursor:"pointer",width:"100%",textAlign:"center","@mdRev":{top:6,fontSize:10}}),as=b(He,{position:"relative",padding:0,variants:{changeEmailSuccess:{true:{"@lgRev":{paddingTop:"25px"}}}}}),gs=()=>{const e=he.c(17),[i,u]=w.useState(!1),[c,p]=w.useState(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=R=>{p(!1),u(R)},e[0]=l):l=e[0];const g=l;let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ne,{}),e[1]=y):y=e[1];let x;e[2]!==c?(x=c&&s.jsxs(s.Fragment,{children:[s.jsx(cs,{onClick:()=>{p(!1)},src:"".concat(window.config.SL_ASSETS_URL,"/ui_elements/account_security/alert.svg")}),s.jsx(rs,{onClick:()=>{p(!1)},children:t("account_security.change_success")})]}),e[2]=c,e[3]=x):x=e[3];let a;e[4]!==i?(a=s.jsx(os,{setIsChangeEmailFormOpen:g,isChangeEmailFormOpen:i}),e[4]=i,e[5]=a):a=e[5];let r;e[6]!==c||e[7]!==x||e[8]!==a?(r=s.jsxs(as,{changeEmailSuccess:c,children:[x,a]}),e[6]=c,e[7]=x,e[8]=a,e[9]=r):r=e[9];let S;e[10]!==i?(S=i&&s.jsx(ze,{setIsChangeEmailFormOpen:g,setSuccessChangeEmail:p}),e[10]=i,e[11]=S):S=e[11];let j;e[12]!==S?(j=s.jsx(f,{children:S}),e[12]=S,e[13]=j):j=e[13];let o;return e[14]!==r||e[15]!==j?(o=s.jsxs(is,{children:[y,s.jsxs(f,{children:[r,j]})]}),e[14]=r,e[15]=j,e[16]=o):o=e[16],o};
1export{gs as AccountSecurity,gs as default};

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.