PageSourceSearch

https://splinterlands.com/assets/StakeUnstakeLicenses-CtgrHtGQ.js

js splinterlands.com collected 2026-10-01 12:15:03 UTC 4,483 bytes, 1 lines download raw bytes

1import{Y as D,j as e,ab as P,Z as $}from"./vendor-ui-BfO2VaBV.js";import{a as W}from"./vendor-redux-DAFPkm2K.js";import{s as c,B as o,b as Q,x as U,iJ as O,a6 as h,X as f,e as V,j9 as z,t as i,Y as G,n as l,p as H,a2 as J,J as y,ag as M}from"./index-DNro_9Uk.js";import{g as X,h as Y}from"./transaction-Bbldnb9x.js";import{i as Z,h as K,n as ee,C as te}from"./Common.styled-K9aXabSq.js";import"./vendor-blockchain-B33N8Jyr.js";import"./three-DYsWAOM3.js";import"./maps-BKggpbsI.js";import"./purchases.service-CmwI6uzV.js";import"./web3-DRqYnfuj.js";import"./bignumber-B1z4pYDt.js";import"./react-number-format.es-4hMs4u0_.js";const se=c(o,{backgroundImage:"url(".concat(window.config.SL_ASSETS_URL,"/ui_elements/sps_management/bg_nodes2.jpg)"),backgroundRepeat:"no-repeat",backgroundAttachment:"fixed",backgroundSize:"cover",minHeight:"100vh",paddingBottom:20}),ne=c(o,{font:"normal normal 800 24px/28px Proxima Nova",color:"#FFEDA0",textTransform:"uppercase"}),fe=c(o,{font:"normal normal normal 15px/20px Proxima Nova",color:"white",marginTop:29}),ye=c(o,{font:"normal normal normal 15px/20px Proxima Nova",color:"#FFEDA0",marginTop:20}),ae=c("button",{all:"unset",background:"transparent linear-gradient(180deg, #023E41 0%, #142E2C 100%) 0% 0% no-repeat padding-box",boxShadow:"0px 3px 6px #00000072",borderRadius:6,font:"normal normal normal 14px/17px Proxima Nova",color:"#FFEDA0",border:"1px solid #142E2C",padding:"6px 11px",cursor:"pointer","&:hover":{background:"transparent linear-gradient(180deg, #008689 0%, #00666B 36%, #00B3B7 100%) 0% 0% no-repeat padding-box",border:"1px solid #FFFFFF",padding:"6px 11px"}}),je=()=>{var u;const m=Q(),j=U(),{type:n}=O(),[b]=h(f.License),[S]=h(f.ActivatedLicense),r=n==="stake"?b:S,_=X(),k=Y(),v=[{text:"25%",times:.25},{text:"50%",times:.5},{text:"75%",times:.75},{text:"MAX",times:1}],C=V().shape({quantity:z().typeError(i("dec_management.err_invalid")).required(i("dec_management.err_invalid")).test("Is positive?",i("common.greater_than_0"),t=>t>0)}),E={resolver:$(C),defaultValues:{quantity:n==="stake"?r:0}},{register:T,handleSubmit:L,setValue:w,watch:F,control:B,clearErrors:A,formState:{errors:I}}=D(E),d=+F("quantity"),a=isNaN(d)?0:d,q=t=>{const s=(r||0)*t;w("quantity",parseInt(s==null?void 0:s.toFixed(0),10)),A("quantity")};W.useEffect(()=>{n!=="stake"&&n!=="unstake"&&m("/dashboard/licenses")},[]);const N=async t=>{var p,x,g;let s;n==="unstake"?s=await k({qty:(p=t==null?void 0:t.quantity)==null?void 0:p.toFixed(0)}):s=await _({qty:(x=t==null?void 0:t.quantity)==null?void 0:x.toFixed(0)}),(g=s==null?void 0:s.data)!=null&&g.success&&m("/dashboard/licenses")},R=t=>t===""?"":M(+t,!0);return e.jsxs(se,{children:[e.jsx(G,{headerTitle:"".concat(n," LICENSES"),onGoBack:()=>{m("/dashboard/licenses")},onGoBackTitle:"LICENSES"}),e.jsx(l,{css:{justifyContent:"center"},children:e.jsxs(o,{css:{marginTop:90,width:430,maxWidth:"100%","@mdRev":{width:"90%"}},children:[e.jsx(ne,{children:i("stake_unstake_page.enter_amount",{type:n})}),e.jsxs(Z,{css:{marginTop:40},children:[e.jsx("img",{src:"".concat(window.config.SL_ASSETS_URL,"/ui_elements/sps_management/img_node.png"),style:{height:67,transform:"scale(1.8)",marginBottom:"40px"},alt:"node"}),e.jsxs("span",{children:["TOTAL: ",j(r)]})]}),e.jsxs(K,{type:"sps",children:[e.jsx(P,{render:({field:{onChange:t,value:s}})=>e.jsx(ee,{value:s,type:"number",...T("quantity"),onChange:p=>t(R(p.target.value))}),control:B,name:"quantity"}),e.jsx(te,{type:"sps",css:{padingLeft:20},children:"LICENSES"}),e.jsx(o,{css:{position:"absolute",left:10,top:9},children:e.jsx(H,{src:"".concat(window.config.SL_ASSETS_URL,"/ui_elements/sps_management/img_node.png"),alt:"license",css:{width:50,marginTop:-15}})})]}),e.jsx(J,{css:{fontSize:"12px"},children:(u=I.quantity)==null?void 0:u.message}),e.jsx(l,{css:{gap:20,justifyContent:"center",marginTop:28},children:v.map(t=>e.jsx(ae,{onClick:()=>q(t.times),children:t.text},t.text))}),e.jsx(l,{css:{justifyContent:"center",marginTop:n==="stake"?30:62},children:e.jsxs(l,{css:{gap:40,flexWrap:"wrap",justifyContent:"center","@mdRev":{gap:20}},children:[e.jsx(y,{color:"red",css:{width:140,fontWeight:"normal"},onClick:()=>{m("/dashboard/licenses")},children:i("stake_unstake_page.cancel")}),e.jsx(y,{color:"green",css:{width:140,fontWeight:"normal"},onClick:L(N),isDisabled:!a||a<=0||r<a,disabled:!a||a<=0||r<a,children:n})]})})]})})]})};export{fe as DescriptionOne,ye as DescriptionThree,je as StakeUnstakeLicenses,ne as Title,je 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.