1import{c as Et,a as v,s as u,t as Qe,f as H,d as Ea,b as re}from"../chunks/D9sGZGkf.js";import{o as Vs}from"../chunks/WB-YkL4p.js";import{p as et,f as he,g as e,a as tt,v as D,c as a,r as t,t as $,s,n as ke,b as y,w as Fs,d as i,o as V}from"../chunks/CN4tyA6q.js";import{i as I}from"../chunks/C5sdDPiI.js";import{e as kt,i as Ps,s as $e,S as Ys,b as zs,r as be}from"../chunks/8mUhvwNQ.js";import{s as ye}from"../chunks/pf6Xs9Ff.js";import{s as Dt}from"../chunks/DyJcqSGM.js";import{b as _e}from"../chunks/BlnfMc48.js";import{N as Ze,f as Q,g as Se,i as qs,O as Da,c as se,d as x,Q as Ma}from"../chunks/BEQGXt1Q.js";import{H as Us}from"../chunks/DfvTF37Y.js";import{p as Tt}from"../chunks/CWFXYUSS.js";import{S as js}from"../chunks/2Hd2hf89.js";const Xs=!1,Gr=Object.freeze(Object.defineProperty({__proto__:null,ssr:Xs},Symbol.toStringTag,{value:"Module"}));function X(f,m=3){if(!f)return"";try{return Q(Se(BigInt(f)),m)}catch{return f??""}}function je(f,m){if(!f)return"";try{const r=Da[m]??1000n;return Ze(BigInt(f),r)}catch{return f}}function ne(f){return f?qs(f):""}function we(f,m){return f?m?`${ne(f)}/${m}`:ne(f):""}const Js=["viral","deep"],Ks=["split 20/80","all minted","burned"],Qs={"mint.volume_start":{what:"the mint-size bonus should start rising at",unit:"LASSECASH"},"mint.volume_end":{what:"the full 1.50x mint-size bonus should start at",unit:"LASSECASH"},"post.threshold_viral":{what:"the viral posting threshold should be",unit:"L-Shares"},"post.threshold_deep":{what:"the deep posting threshold should be",unit:"L-Shares"},"post.threshold_comment":{what:"the comment threshold should be",unit:"L-Shares"},"promote.min_burn":{what:"promoting a post should cost at least",unit:"LASSECASH"}};function Zs(f,m){const r=m.split("|");if(f==="+transfer")return`${X(r[1])} LASSECASH from ${ne(r[2])||"another account"}`;if(f==="+ledger"||f==="ledger"){const[o,C,S,g]=r,b=(g??"").toUpperCase();return f==="+ledger"?`${S} ${b} from ${ne(o)}`:`${S} ${b} to ${ne(C)}`}if(m.startsWith("{"))try{const o=JSON.parse(m);if(f==="transfer"&&o.to&&o.amount)return`Sent ${Ze(BigInt(o.amount),100000000n)} BTC to ${ne(o.to)}`;if(f==="increaseAllowance"&&o.spender&&o.amount)return`Allowed MAGI's swap contract to draw ${Ze(BigInt(o.amount),100000000n)} BTC`}catch{}switch(f){case"transfer":return`${X(r[1])} LASSECASH to ${ne(r[0])}`+(r[2]?` â "${r[2]}"`:"");case"burn":return`${X(r[0])} LASSECASH burned`;case"mint":return`${X(r[0])} LASSECASH locked for ${r[1]} days`;case"claim_mint":return`Closed mint #${r[0]}`;case"sweep_mint":return`Swept ${ne(r[0])}'s dead mint #${r[1]}`;case"good_accounting":return`Armed Good Accounting on mint #${r[0]}`;case"set_duration":return`Monthly Proof-of-Brain mint set to ${r[0]} days`;case"swap_lassecash_hbd":case"swap_lc_hbd":return`Sold ${X(r[0])} LASSECASH · at least ${X(r[1],6)} HBD`;case"swap_hbd_lassecash":case"swap_hbd_lc":return`Bought with ${X(r[0],6)} HBD · at least ${X(r[1])} LASSECASH`;case"add_liquidity":return`Added ${X(r[0])} LASSECASH + ${X(r[1],6)} HBD`;case"remove_liquidity":return`Withdrew tranche #${r[0]}`;case"claim_pool":return`Claimed rewards on tranche #${r[0]}`;case"sweep_tranche":return`Evicted ${ne(r[0])}'s dormant tranche #${r[1]}`;case"post":return`${r[0]} · ${Js[Number(r[1])]??"?"} · ${Ks[Number(r[2])]??"?"}`;case"comment":return`Replied to ${we(r[1],r[2])}`;case"vote":{const o=(r[1]??"").startsWith("re-")?"comment":"post";return r[2]==="0"?`Removed vote on ${o}: ${we(r[0],r[1])}`:`Voted ${r[2]}% on ${o}: ${we(r[0],r[1])}`}case"payout":return`Settled ${we(r[0],r[1])}`;case"promote_post":return`${X(r[2])} LASSECASH burned to promote ${we(r[0],r[1])}`;case"claim_curation":return`Claimed curation on ${we(r[0],r[1])}`;case"sweep_curation":return`Swept expired curation on ${we(r[0],r[1])}`;case"claim_migration":return`Claimed ${X(r[0])} LASSECASH liquid + ${X(r[1])} as a mint`;case"record_burn":return`Recorded ${ne(r[0])}'s burn`;case"settle":return"Settled this account";case"settle_pending":return"Settled pending rewards";case"advance":return r[0]?`Advanced the accrual by ${r[0]} days`:"Advanced the accrual";case"promote":return`Offered ${ne(r[0])} a board seat`;case"set_param":{const o=Qs[r[0]??""];return o?`Voted: ${o.what} ${X(r[1],0)} ${o.unit}`:`${r[0]} preference set to ${r[1]}`}}if(m.startsWith("{"))try{const o=JSON.parse(m);
1if(o.type==="swap"&&o.asset_in&&o.asset_out){const C=je(o.amount_in,o.asset_in),S=je(o.min_amount_out,o.asset_out),g=S?` · at least ${S} ${o.asset_out}`:` for ${o.asset_out}`;return`Swapped ${C} ${o.asset_in}${g}`}if(o.type==="deposit"&&o.asset0&&o.asset1)return`Added ${je(o.amount0,o.asset0)} ${o.asset0} + ${je(o.amount1,o.asset1)} ${o.asset1}`;if(o.type)return String(o.type)}catch{}return m}var er=H('<a class="svelte-u0y9l0"> </a>');function tr(f,m){et(m,!0);const r=/@([a-z0-9][a-z0-9.-]{2,15})(\/[a-z0-9-]+)?/g,o=D(()=>{const g=[];let b=0;for(const T of m.text.matchAll(r)){const h=T.index??0;h>b&&g.push({t:m.text.slice(b,h)}),g.push({t:T[0],href:`/@${T[1]}${T[2]??""}`}),b=h+T[0].length}return b<m.text.length&&g.push({t:m.text.slice(b)}),g});var C=Et(),S=he(C);kt(S,17,()=>e(o),Ps,(g,b)=>{var T=Et(),h=he(T);{var L=Z=>{var A=er(),W=a(A,!0);t(A),$(()=>{$e(A,"href",e(b).href),u(W,e(b).t)}),v(Z,A)},ve=Z=>{var A=Qe();$(()=>u(A,e(b).t)),v(Z,A)};I(h,Z=>{e(b).href?Z(L):Z(ve,-1)})}v(g,T)}),v(f,C),tt()}var ar=H('<img class="coin svelte-1s9rr67" alt="" loading="lazy"/>'),sr=H('<span class="coin glyph svelte-1s9rr67"> </span>');function Lt(f,m){et(m,!0);let r=Tt(m,"size",3,22);const o=D(()=>m.asset.toUpperCase()),C=D(()=>e(o)==="BTC"?"/coins/btc.svg":e(o)==="HIVE"?"/coins/hive.svg":e(o)==="HBD"?"/coins/hbd.svg":null);var S=Et(),g=he(S);{var b=h=>{var L=ar();$(()=>{$e(L,"src",e(C)),$e(L,"width",r()),$e(L,"height",r())}),v(h,L)},T=h=>{var L=sr(),ve=a(L,!0);t(L),$(()=>{Dt(L,`--ring:${e(o)==="ETH"?"#8a92b2":"var(--gold)"}; width:${r()??""}px; height:${r()??""}px; font-size:${r()*.52}px`),u(ve,e(o)==="ETH"?"Î":"L")}),v(h,L)};I(g,h=>{e(C)?h(b):h(T,-1)})}v(f,S),tt()}var rr=H('<button><!> <span class="meta svelte-hla9o8"><span class="sym svelte-hla9o8"> </span> <span class="bal mono svelte-hla9o8"> </span></span></button>'),nr=H('<div class="chips svelte-hla9o8" role="group"></div>');function Xe(f,m){et(m,!0);let r=Tt(m,"balances",19,()=>({})),o=Tt(m,"disabled",3,!1);var C=nr();kt(C,20,()=>m.assets,S=>S,(S,g)=>{var b=rr();let T;var h=a(b);Lt(h,{get asset(){return g}});var L=s(h,2),ve=a(L),Z=a(ve,!0);t(ve);var A=s(ve,2),W=a(A,!0);t(A),t(L),t(b),$(()=>{T=ye(b,1,"chip svelte-hla9o8",null,T,{on:g===m.selected}),b.disabled=o(),$e(b,"aria-pressed",g===m.selected),u(Z,g),u(W,r()[g]??"â")}),re("click",b,()=>m.onpick(g)),v(S,b)}),t(C),v(f,C),tt()}Ea(["click"]);var ir=H('<section class="panel"><h2>Wallet</h2> <p class="empty">Sign in to see what you hold.</p></section>'),lr=H('<section class="panel"><p class="empty">Reading the chainâ¦</p></section>'),Ia=H('<span class="dim">unknown</span>'),or=H(`<b>
1MAGI credits are low.</b> Contract calls â claiming, minting, voting, 2 swapping â will be refused before the wallet opens. Hold a little more HBD on 3 MAGI for an instant fix, or wait for recovery.`,1),dr=H(`<b>Hive credits are low.</b> Posts, comments and votes will be refused by Hive 4 itself. This one only refills with time.`,1),ur=H('<p class="warn svelte-1duri02"><!></p>'),vr=H('<button class="maxbtn svelte-1duri02"> </button>'),cr=H('<div class="quote svelte-1duri02"><div class="line small svelte-1duri02"><span class="dim">Price impact</span> <b> </b> <span class="dim"> </span></div> <p class="fine svelte-1duri02">You receive at least <b class="mono"> </b> <b>the swap is rejected</b> â the chain enforces that floor, not this page.</p></div> <label class="field svelte-1duri02"><span class="svelte-1duri02"> </span> <input type="range" min="0.1" max="5" step="0.1"/></label>',1),pr=H('<p class="fine dim svelte-1duri02">No quote â that pool could not be read.</p>'),Je=H('<p class="err svelte-1duri02"> </p>'),Ke=H('<p class="ok svelte-1duri02"> </p>'),hr=H(`<div class="btcbox svelte-1duri02"><div class="sides svelte-1duri02"><div class="side svelte-1duri02"><span class="slabel svelte-1duri02">on MAGI</span> <b class="mono svelte-1duri02"> </b> <span class="sunit svelte-1duri02">BTC</span></div> <span class="arrow svelte-1duri02">â</span> <div class="side svelte-1duri02"><span class="slabel svelte-1duri02">to</span> <b class="mono small svelte-1duri02">Bitcoin mainnet</b></div></div> <label class="field svelte-1duri02"><span class="svelte-1duri02">Bitcoin address</span> <input placeholder="bc1â¦" spellcheck="false"/></label> <div class="hbdform svelte-1duri02"><input inputmode="decimal" placeholder="0.00000000" aria-label="BTC amount" class="svelte-1duri02"/> <button>Withdraw BTC</button></div> <!> <!> <p class="note svelte-1duri02"><b>Check the address twice.</b> Bitcoin has no recall: a wrong address is gone, 5 and neither we nor MAGI can reverse it. The Bitcoin miner fee comes out of the 6 amount you send, so you receive slightly less than you type â that is the only 7 version that cannot fail for being a few satoshis short. The smallest 8 withdrawal is <span class="mono">0.00000546</span> BTC, Bitcoin's dust limit.</p> <p class="note svelte-1duri02"><b>Getting BTC in</b> needs a deposit address MAGI issues through a service we 9 do not run â <a href="https://altera.magi.eco/deposit" target="_blank" rel="noopener">Altera handles that</a>. 10 Once it is on MAGI, everything here works on it.</p></div>`),Ca=H('<button class="maxbtn svelte-1duri02">MAX</button>'),mr=H(`<p class="note hint svelte-1duri02">Nothing to deposit: your <b>Hive</b> HBD balance is empty. Everything you hold is 11 already on MAGI, so the move available to you is <b>Withdraw</b>.</p>`),br=H(`<div class="sides svelte-1duri02"><div class="side svelte-1duri02"><span class="slabel svelte-1duri02">on MAGI</span> <b class="mono svelte-1duri02"> </b> <span class="sunit svelte-1duri02"> </span> <!></div> <span class="arrow svelte-1duri02">â</span> <div class="side svelte-1duri02"><span class="slabel svelte-1duri02">on Hive</span> <b class="mono svelte-1duri02"> </b> <span class="sunit svelte-1duri02"> </span> <!></div></div> <div class="hbdform svelte-1duri02"><input inputmode="decimal" placeholder="0.000" aria-label="HBD amount" class="svelte-1duri02"/> <button>Deposit to MAGI</button> <button class="ghost">Withdraw to Hive</button></div> <!> <!> <!> <p class="note svelte-1duri02">A deposit is a Hive transfer to <span class="mono">vsc.gateway</span> carrying the 12 memo that names your account â the page builds that memo from your signed-in name, 13 never from anything typed, because a wrong memo is a transfer to a stranger with no 14 refund path. Both directions ask for your <b>active</b> key, and both take a few 15 minutes to appear.</p> <p class="note svelte-1duri02"><b>Not trustless, and worth knowing.</b> Your HBD and HIVE on MAGI are held on Hive 16 by an 18-key validator multisig â no individual can move them, but the set could. <a href="/about#what-you-are-trusting-layer-by-layer">What you are trusting â</a></p>`,1),_r=H('<small class="dim sendbal svelte-1duri02"> <button class="maxbtn svelte-1duri02">MAX</button></small>'),fr=H(`<label class="field svelte-1duri02"><span class="svelte-1duri02">Memo <span class="dim svelte-1duri02">â optional</span></span> <input placeholder="what it is for" maxlength="200" spellcheck="false"/></label> <small class="dim">Memos are public and permanent â they live in the transaction itself, and 17 unlike a Hive memo they cannot be encrypted.</small>`,1),gr=H('<p class="empty"> </p>'),wr=H('<span class="in svelte-1duri02">in</span>'),yr=H('<tr class="svelte-1duri02"><td class="mono dim svelte-1duri02"> </td><td class="clip svelte-1duri02"><!> <!></td><td class="svelte-1duri02"><span> </span></td></tr>'),Sr=H('<small class="dim"> </small> <div class="scroll svelte-1duri02"><table class="svelte-1duri02"><thead><tr><th class="svelte-1duri02">When</th><th class="svelte-1duri02">What it did</th><th class="svelte-1duri02">Status</th></tr></thead><tbody class="svelte-1duri02"></tbody></table></div>',1),Ar=H(`<section class="holdings svelte-1duri02"><div class="group"><div class="ghead svelte-1duri02">LasseCash</div> <div class="tiles svelte-1duri02"><div class="panel stat svelte-1duri02"><div class="label svelte-1duri02">LASSECASH</div> <div class="value gold svelte-1duri02"> </div> <div class="sub svelte-1duri02">liquid â spendable now<!></div></div> <div class="panel stat svelte-1duri02"><div class="label svelte-1duri02">L-Shares</div> <div class="value svelte-1duri02"> </div> <div class="sub svelte-1duri02">voting power & yield weight â held in mints</div></div> <div class="panel stat svelte-1duri02"><div class="label svelte-1duri02">Pending rewards</div> <div class="value svelte-1duri02"> </div> <div class="sub svelte-1duri02">mints into one position on the 1st</div></div></div></div> <div class="group"><div class="ghead svelte-1duri02">On MAGI</div> <div class="tiles svelte-1duri02"><div class="panel stat svelte-1duri02"><div class="label svelte-1duri02">BTC</div> <div> </div> <div class="sub svelte-1duri02">
17mapped Bitcoin, held on MAGI · swappable below</div></div> <div class="panel stat svelte-1duri02"><div class="label svelte-1duri02">HBD</div> <div class="value svelte-1duri02"> </div> <div class="sub svelte-1duri02">your resource meter, and the pool's other side</div></div> <div class="panel stat svelte-1duri02"><div class="label svelte-1duri02">HIVE</div> <div class="value svelte-1duri02"> </div> <div class="sub svelte-1duri02">bridged from Hive, like HBD</div></div> <div class="panel stat svelte-1duri02"><div class="label svelte-1duri02">ETH <span class="soon svelte-1duri02">soon</span></div> <div class="value dim svelte-1duri02">â</div> <div class="sub svelte-1duri02">MAGI maps it; no pool for it yet</div></div></div></div></section> <section class="panel"><h2>Can this account act?</h2> <p class="lede svelte-1duri02">MAGI has no fees, so <b>resource credits are the entire cost of everything</b>. 18 Publishing on LasseCash spends BOTH meters in one signed transaction â a Hive 19 comment and a MAGI contract call â so either one running dry stops the same 20 action, for completely different reasons.</p> <div class="meters svelte-1duri02"><div><div class="mhead svelte-1duri02"><strong class="svelte-1duri02">MAGI</strong> <span class="mono"><!></span></div> <div class="bar svelte-1duri02"><div class="fill magi svelte-1duri02"></div></div> <p class="note svelte-1duri02">Claims, mints, votes, comments, swaps â every contract call. Your meter is <b>HBD held on MAGI</b> plus 10,000 free: about <b class="mono"> </b> at 21 your current balance. Spent credits recover over five days, and the HBD is never 22 spent â it is a meter, and you can move it out whenever you like.</p></div> <div><div class="mhead svelte-1duri02"><strong class="svelte-1duri02">Hive</strong> <span class="mono"><!></span></div> <div class="bar svelte-1duri02"><div class="fill hive svelte-1duri02"></div></div> <p class="note svelte-1duri02">The Hive side of a post, comment or vote. It regenerates from your HIVE POWER 23 over about five days and cannot be bought â if it is empty, waiting is the 24 only fix, or someone delegates you HIVE POWER.</p></div></div> <!></section> <section class="panel"><h2>Swap on MAGI</h2> <p class="lede svelte-1duri02">HBD, HIVE and BTC, traded on <b>MAGI's own pools</b> â their contracts, not 25 ours, and they charge <b>0.08%</b> where our LASSECASH pool charges nothing. You 26 sign each swap yourself and nobody takes custody, but read the note below for 27 what that does and does not mean.</p> <div class="swapcard svelte-1duri02"><div class="leg svelte-1duri02"><div class="leghead svelte-1duri02"><span>You pay</span> <!></div> <div class="legrow svelte-1duri02"><input inputmode="decimal" placeholder="0.000" class="svelte-1duri02"/> <span class="asset svelte-1duri02"><!> </span></div> <!></div> <button class="flip svelte-1duri02" aria-label="Swap direction">â</button> <div class="leg svelte-1duri02"><div class="leghead svelte-1duri02"><span>You receive â estimate</span></div> <div class="legrow svelte-1duri02"><div> </div> <span class="asset svelte-1duri02"><!> </span></div> <!></div></div> <!> <!> <!> <button> </button> <p class="note trust svelte-1duri02"><b>Ours becomes unchangeable on 10 October</b> â the LASSECASH:HBD pool above, no 28 owner key, no fee. These two are MAGI's own contracts and charge 0.08%. <a href="/about#what-you-are-trusting-layer-by-layer">What you are trusting â</a></p></section> <section class="panel"><h2>Move funds between Hive and MAGI</h2> <p class="lede svelte-1duri02">It is the <b>same HBD</b> â bridged, not wrapped. On MAGI it is your resource 29 meter, the pool's other side, and the only way to buy LASSECASH, which makes 30 this the one move that unblocks everything else on the site.</p> <!> <small class="dim chipnote svelte-1duri02"> </small> <!> <p class="note svelte-1duri02"><b>Want BTC?</b> Sell LASSECASH for HBD here, then swap HBD for BTC on <a href="https://altera.magi.eco/swap" target="_blank" rel="noopener">Altera</a>. 31 Both legs are on-chain swaps you sign yourself â nobody takes custody of your funds 32 at any point, and no account or permission is granted to anyone.</p></section> <section class="panel"><h2>Send</h2> <p class="lede svelte-1duri02">To another MAGI account â LASSECASH through our contract, HBD and HIVE as MAGI's 33 own assets, BTC through its mapping contract. All three rails, one form. <b>This stays on MAGI</b>: to reach Hive or Bitcoin, use the sections above.</p> <!> <label class="field svelte-1duri02"><span class="svelte-1duri02">To</span> <input placeholder="account name" spellcheck="false"/></label> <label class="field svelte-1duri02"><span class="svelte-1duri02"> </span> <input inputmode="decimal" placeholder="0.000"/></label> <!> <!> <!> <!> <button> </button></section> <section class="panel"><h2>Recent activity</h2> <!></section>`,1),Br=H('<!> <div class="grid"><!></div>',1);function Or(f,m){et(m,!0);let r=y(""),o=y(!1),C=y(null),S=y(null),g=y(null),b=y(null),T=y(null),h=y("HBD"),L=y("");async function ve(){i(S,null),i(C,null);const d=`${e(r)} BTC`,c=await x.submit(()=>se.withdrawBtc(e(r),e(L)));if(c){i(S,c,!0);return}i(C,`Sent ${d} to ${e(L).slice(0,10)}⦠â Bitcoin confirmation takes its own time.`),i(r,""),i(L,""),await Te(),Be()}async function Z(d){var ce,He;const c=Number(e(r));if(!Number.isFinite(c)||c<=0){i(S,"Enter an amount");return}const _=e(h)==="HBD"?e(g):e(b),P=Se(BigInt(Math.trunc(Number(e(h)==="HBD"?((ce=e(w))==null?void 0:ce.hbd)??0:((He=e(w))==null?void 0:He.hive)??0)))),ie=1e-9;if(d==="in"&&_!==null&&c>Number(_)+ie){i(S,`A deposit spends your Hive ${e(h)} â you have ${Q(_,3)} there.`+(c<=Number(P)+ie?` ${Q(e(r),3)} is on your MAGI side: to move it to Hive, press Withdraw to Hive.`:""));return}if(d==="out"&&c>Number(P)+ie){i(S,`A withdrawal spends your MAGI ${e(h)} â you have ${Q(P,3)} there.`+(_!==null&&c<=Number(_)+ie?` ${Q(e(r),3)} is on your Hive side: to move it to MAGI, press Deposit to MAGI.`:""));return}i(o,!0),i(S,null),i(C,null);try{const me=d==="in"?await se.depositHbd(e(r),e(h)):await se.withdrawHbd(e(r),void 0,e(h));if(!me.ok){i(S,me.msg,!0);return}i(C,d==="in"?`Sent to the gateway. Your MAGI ${e(h)} balance updates within a few minutes.`:`Withdrawal submitted. The ${e(h)} lands on Hive within a few minutes.`,!0),i(r,""),await x.refresh()}catch(me){i(S,me instanceof Error?me.message:String(me),!0)}finally{i(o,!1)}}let A=y("HBD"),W=y("BTC"),ee=y(""),Me=y(1),Ie=y(null),Ne=y(null),U=y(null),Ge=y(!1);const at=D(()=>Ma(e(A)));ke(()=>{e(at).includes(e(W))||i(W,e(at)[0]??"HBD",!0)}),ke(()=>{const[d,c,_]=[e(A),e(W),e(ee)];if(!Number(_)){i(U,null);return}i(Ge,!0),se.quoteMagi(d,c,_).then(P=>{i(U,P,!0)}).catch(()=>{i(U,null)}).finally(()=>{i(Ge,!1)})});const Ta=D(()=>
33{if(!e(U))return null;const d=BigInt(Math.round(Math.max(.1,Math.min(50,e(Me)))*100)),c=e(U).amountOutUnits*(10000n-d)/10000n;return Ze(c,Da[e(W)]??1000n)}),st=D(()=>({HBD:e(w)?(Number(e(w).hbd)/1e8).toFixed(3):null,HIVE:e(w)?(Number(e(w).hive??0)/1e8).toFixed(3):null,BTC:e(T)})),Ce=D(()=>e(w)?e(A)==="HBD"?Number(e(Pt))/1e8:e(A)==="HIVE"?Number(e(w).hive)/1e8:e(A)==="BTC"&&e(T)!==null?Number(e(T)):null:null),Nt=D(()=>e(A)==="BTC"?8:3),Gt=D(()=>e(Ce)!==null&&Number(e(ee)||"0")>e(Ce));function La(){const[d,c]=[e(A),e(W)];Ma(c).includes(d)&&(i(A,c,!0),i(W,d,!0),i(ee,""))}const Ot=3e3;async function ka(){if(!e(U))return;if(i(Ie,null),i(Ne,null),e(F)&&e(F).amount<Ot){i(Ie,`Not enough resource credits on MAGI: ${Math.trunc(e(F).amount).toLocaleString()} of ${Math.trunc(e(F).max).toLocaleString()} available, and a swap reserves ${Ot.toLocaleString()}. Spent credits recover over five days; HBD held on MAGI raises the meter immediately.`);return}const d=`${e(ee)} ${e(A)}`,c=await x.submit(()=>se.magiSwap(e(A),e(W),e(ee),e(Me)),{movesHbd:!0});if(c){i(Ie,c,!0);return}i(Ne,`Swapped ${d} for ${e(W)}.`),i(ee,""),await Te(),Be()}let J=y("LASSECASH"),Oe=y(""),te=y(""),We=y(""),Ae=y(null),Ee=y(null);const Re=D(()=>({LASSECASH:e(w)?Q(e(w).balance,3):null,HBD:e(w)?(Number(e(w).hbd)/1e8).toFixed(3):null,HIVE:e(w)?(Number(e(w).hive??0)/1e8).toFixed(3):null,BTC:e(T)}));let Wt=y("");const Na=1e3;async function Ga(){i(Ae,null),i(Ee,null);const d=`${e(te)} ${e(J)}`,c=e(Oe).trim().replace(/^@/,"");if(e(J)==="HBD"&&e(F)){const P=Math.round(Number(e(te)||"0")*1e3),ie=Math.trunc(e(F).amount)-P,ce=`${e(J)}|${e(te)}|${c}`;if(Number.isFinite(P)&&P>0&&ie<Na&&e(Wt)!==ce){i(Wt,ce),i(Ae,`Sending ${e(te)} HBD also lowers your resource credits by ${P.toLocaleString()} â you would have ${Math.max(0,ie).toLocaleString()} left, and claims, swaps, posts and votes on MAGI would be refused until credits recover (about five days), or until HBD is deposited again. Press Send again to do it anyway.`);return}}const _=await x.submit(()=>se.sendAsset(e(J),c,e(te),e(We)));if(_){i(Ae,_,!0);return}i(Ee,`Sent ${d} to @${c}.`),i(te,""),i(We,""),await Te(),Be()}let De=y(Fs([])),rt=y(!1);async function Te(){if(x.account){try{i(De,await se.accountOps(30),!0)}catch{i(De,[],!0)}i(rt,!0)}}ke(()=>{x.account&&!e(rt)&&Te()});const Oa=d=>new Date(d+"Z").toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),w=D(()=>x.me);let F=y(null),fe=y(null),Ve=y(!1);async function Be(){if(!x.account)return;const[d,c]=await Promise.all([se.resourceCredits().catch(()=>null),se.hiveResourceCredits().catch(()=>null)]);i(F,d,!0),i(fe,c,!0),i(Ve,!0);const _=await se.hiveBalances().catch(()=>null);i(g,(_==null?void 0:_.hbd)??null,!0),i(b,(_==null?void 0:_.hive)??null,!0),i(T,await se.btcBalance().catch(()=>null),!0)}Vs(()=>{Be(),Te()});let Rt=0;ke(()=>{var _;if(!((_=x.info)==null?void 0:_.height)||!e(Ve))return;const c=Date.now();c-Rt<25e3||(Rt=c,Be())}),ke(()=>{x.account&&!e(Ve)&&Be()});const Fe=d=>d&&d.max>0?Math.max(0,Math.min(100,d.amount/d.max*100)):0,ge=d=>d!==null&&Fe(d)<10,Wa=D(()=>e(w)?Number(e(w).hbd)/1e8:0),Vt=D(()=>{const d=e(h)==="HBD"?e(g):e(b);return d===null||Number(d)>0}),Ft=D(()=>{var d,c;return Number(e(h)==="HBD"?((d=e(w))==null?void 0:d.hbd)??0:((c=e(w))==null?void 0:c.hive)??0)>0}),Ra=5500,Va=100000n,Pt=D(()=>{var P;const d=BigInt(Math.trunc(Number(((P=e(w))==null?void 0:P.hbd)??0)));if(!e(F))return d;const _=BigInt(Math.max(0,Math.trunc(e(F).amount)-Ra))*Va;return _<d?_:d});function Yt(d){var c;if(d==="in"){const _=e(h)==="HBD"?e(g):e(b);_!==null&&i(r,_,!0);return}i(r,e(h)==="HBD"?Se(e(Pt)):Se(BigInt(Math.trunc(Number(((c=e(w))==null?void 0:c.hive)??0)))),!0)}var zt=Br(),qt=he(zt);{let d=D(()=>`${zs}/wallet`);js(qt,{title:"Wallet",description:"Your LASSECASH, HBD, L-Shares and resource credits on both chains.",get canonical(){return e(d)},get image(){return Ys},noindex:!0})}var Ut=s(qt,2),Fa=a(Ut);{var Pa=d=>{var c=ir();v(d,c)},Ya=d=>{var c=lr();v(d,c)},za=d=>{var c=Ar(),_=he(c),P=a(_),ie=s(a(P),2),ce=a(ie),He=s(a(ce),2),me=a(He,!0);t(He);var jt=s(He,2),qa=s(a(jt));Us(qa,{get amount(){return e(w).balance},block:!0}),t(jt),t(ce);var nt=s(ce,2),Xt=s(a(nt),2),Ua=a(Xt,!0);t(Xt),V(2),t(nt);var Jt=s(nt,2),Kt=s(a(Jt),2),ja=a(Kt,!0);t(Kt),V(2),t(Jt),t(ie),t(P);var Qt=s(P,2),Zt=s(a(Qt),2),it=a(Zt),lt=s(a(it),2);let ea;var Xa=a(lt,!0);t(lt),V(2),t(it);var ot=s(it,2),ta=s(a(ot),2),Ja=a(ta,!0);t(ta),V(2),t(ot);var aa=s(ot,2),sa=s(a(aa),2),Ka=a(sa,!0);t(sa),V(2),t(aa),V(2),t(Zt),t(Qt),t(_);var dt=s(_,2),ut=s(a(dt),4),Pe=a(ut);let ra;var vt=a(Pe),na=s(a(vt),2),Qa=a(na);{var Za=n=>{var l=Qe();$((p,M)=>u(l,`${p??""} / ${M??""}`),[()=>
33Math.round(e(F).amount).toLocaleString(),()=>Math.round(e(F).max).toLocaleString()]),v(n,l)},es=n=>{var l=Ia();v(n,l)};I(Qa,n=>{e(F)?n(Za):n(es,-1)})}t(na),t(vt);var ct=s(vt,2),ts=a(ct);t(ct);var ia=s(ct,2),la=s(a(ia),3),as=a(la,!0);t(la),V(),t(ia),t(Pe);var pt=s(Pe,2);let oa;var ht=a(pt),da=s(a(ht),2),ss=a(da);{var rs=n=>{var l=Qe();$(p=>u(l,`${p??""}%`),[()=>Fe(e(fe)).toFixed(1)]),v(n,l)},ns=n=>{var l=Ia();v(n,l)};I(ss,n=>{e(fe)?n(rs):n(ns,-1)})}t(da),t(ht);var ua=s(ht,2),is=a(ua);t(ua),V(2),t(pt),t(ut);var ls=s(ut,2);{var os=n=>{var l=ur(),p=a(l);{var M=B=>{var k=Qe("Both meters are low, so almost nothing will go through right now.");v(B,k)},N=D(()=>ge(e(F))&&ge(e(fe))),K=B=>{var k=or();V(),v(B,k)},Y=D(()=>ge(e(F))),R=B=>{var k=dr();V(),v(B,k)};I(p,B=>{e(N)?B(M):e(Y)?B(K,1):B(R,-1)})}t(l),v(n,l)},ds=D(()=>e(Ve)&&(ge(e(F))||ge(e(fe))));I(ls,n=>{e(ds)&&n(os)})}t(dt);var mt=s(dt,2),bt=s(a(mt),4),_t=a(bt),ft=a(_t),us=s(a(ft),2);{var vs=n=>{var l=vr(),p=a(l);t(l),$(M=>u(p,`Balance ${M??""} ${e(A)??""} · MAX`),[()=>e(Ce).toFixed(e(Nt))]),re("click",l,()=>i(ee,e(Ce).toFixed(e(Nt)),!0)),v(n,l)};I(us,n=>{e(Ce)!==null&&n(vs)})}t(ft);var gt=s(ft,2),Ye=a(gt);be(Ye);var va=s(Ye,2),ca=a(va);Lt(ca,{get asset(){return e(A)}});var cs=s(ca);t(va),t(gt);var ps=s(gt,2);Xe(ps,{assets:["HBD","HIVE","BTC"],get selected(){return e(A)},get balances(){return e(st)},get disabled(){return x.busy},onpick:n=>{i(A,n,!0),i(ee,"")}}),t(_t);var wt=s(_t,2),pa=s(wt,2),yt=s(a(pa),2),ze=a(yt);let ha;var hs=a(ze,!0);t(ze);var ma=s(ze,2),ba=a(ma);Lt(ba,{get asset(){return e(W)}});var ms=s(ba);t(ma),t(yt);var bs=s(yt,2);Xe(bs,{get assets(){return e(at)},get selected(){return e(W)},get balances(){return e(st)},get disabled(){return x.busy},onpick:n=>i(W,n,!0)}),t(pa),t(bt);var _a=s(bt,2);{var _s=n=>{var l=cr(),p=he(l),M=a(p),N=s(a(M),2);let K;var Y=a(N);t(N);var R=s(N,2),B=a(R);t(R),t(M);var k=s(M,2),z=s(a(k)),le=a(z,!0);t(z);var oe=s(z);V(2),t(k),t(p);var ae=s(p,2),pe=a(ae),G=a(pe);t(pe);var q=s(pe,2);be(q),t(ae),$((j,de)=>{K=ye(N,1,"mono svelte-1duri02",null,K,{warn:e(U).priceImpact>.05}),u(Y,`${j??""}%`),u(B,`· their fee ${de??""}%`),u(le,e(Ta)),u(oe,` ${e(W)??""} or `),u(G,`Slippage tolerance â ${e(Me)??""}%`),q.disabled=x.busy},[()=>(e(U).priceImpact*100).toFixed(2),()=>(e(U).feeBps/100).toFixed(2)]),_e(q,()=>e(Me),j=>i(Me,j)),v(n,l)},fs=n=>{var l=pr();v(n,l)},gs=D(()=>Number(e(ee))&&!e(Ge));I(_a,n=>{e(U)?n(_s):e(gs)&&n(fs,1)})}var fa=s(_a,2);{var ws=n=>{var l=Je(),p=a(l,!0);t(l),$(()=>u(p,e(Ie))),v(n,l)};I(fa,n=>{e(Ie)&&n(ws)})}var ga=s(fa,2);{var ys=n=>{var l=Ke(),p=a(l,!0);t(l),$(()=>u(p,e(Ne))),v(n,l)};I(ga,n=>{e(Ne)&&n(ys)})}var qe=s(ga,2),Ss=a(qe,!0);t(qe),V(2),t(mt);var St=s(mt,2),wa=s(a(St),4);Xe(wa,{assets:["HBD","HIVE","BTC"],get selected(){return e(h)},get balances(){return e(st)},get disabled(){return x.busy},onpick:n=>{i(h,n,!0),i(r,""),i(S,null),i(C,null)}});var At=s(wa,2),As=a(At,!0);t(At);var Bs=s(At,2);{var Hs=n=>{var l=hr(),p=a(l),M=a(p),N=s(a(M),2),K=a(N,!0);t(N),V(2),t(M),V(4),t(p);var Y=s(p,2),R=s(a(Y),2);be(R),t(Y);var B=s(Y,2),k=a(B);be(k);var z=s(k,2);t(B);var le=s(B,2);{var oe=G=>{var q=Je(),j=a(q,!0);t(q),$(()=>u(j,e(S))),v(G,q)};I(le,G=>{e(S)&&G(oe)})}var ae=s(le,2);{var pe=G=>{var q=Ke(),j=a(q,!0);t(q),$(()=>u(j,e(C))),v(G,q)};I(ae,G=>{e(C)&&G(pe)})}V(4),t(l),$(G=>{u(K,e(T)??"â"),R.disabled=x.busy,k.disabled=x.busy,z.disabled=G},[()=>x.busy||!e(L).trim()||!Number(e(r))]),_e(R,()=>e(L),G=>i(L,G)),_e(k,()=>e(r),G=>i(r,G)),re("click",z,ve),v(n,l)},xs=n=>{var l=br(),p=he(l),M=a(p),N=s(a(M),2),K=a(N,!0);t(N);var Y=s(N,2),R=a(Y,!0);t(Y);var B=s(Y,2);{var k=E=>{var O=Ca();$(()=>O.disabled=e(o)),re("click",O,()=>Yt("out")),v(E,O)};I(B,E=>{e(Ft)&&E(k)})}t(M);var z=s(M,4),le=s(a(z),2),oe=a(le,!0);t(le);var ae=s(le,2),pe=a(ae,!0);t(ae);var G=s(ae,2);{var q=E=>{var O=Ca();$(()=>O.disabled=e(o)),re("click",O,()=>Yt("in")),v(E,O)};I(G,E=>{e(Vt)&&(e(h)==="HBD"?e(g):e(b))!==null&&E(q)})}t(z),t(p);var j=s(p,2),de=a(j);be(de);var Le=s(de,2),ue=s(Le,2);t(j);var xe=s(j,2);{var Ns=E=>{var O=mr();v(E,O)},Gs=D(()=>e(g)!==null&&Number(e(g))<=0);I(xe,E=>{e(Gs)&&E(Ns)})}var $a=s(xe,2);{var Os=E=>
33{var O=Je(),Ct=a(O,!0);t(O),$(()=>u(Ct,e(S))),v(E,O)};I($a,E=>{e(S)&&E(Os)})}var Ws=s($a,2);{var Rs=E=>{var O=Ke(),Ct=a(O,!0);t(O),$(()=>u(Ct,e(C))),v(E,O)};I(Ws,E=>{e(C)&&E(Rs)})}V(4),$((E,O)=>{u(K,E),u(R,e(h)),u(oe,O),u(pe,e(h)),de.disabled=e(o),Le.disabled=e(o)||!e(Vt),ue.disabled=e(o)||!e(Ft)},[()=>Q(Se(BigInt(Math.trunc(Number(e(h)==="HBD"?e(w).hbd:e(w).hive??0)))),3),()=>(e(h)==="HBD"?e(g):e(b))===null?"â¦":Q(e(h)==="HBD"?e(g):e(b),3)]),_e(de,()=>e(r),E=>i(r,E)),re("click",Le,()=>Z("in")),re("click",ue,()=>Z("out")),v(n,l)};I(Bs,n=>{e(h)==="BTC"?n(Hs):n(xs,-1)})}V(2),t(St);var Bt=s(St,2),ya=s(a(Bt),4);Xe(ya,{assets:["LASSECASH","HBD","HIVE","BTC"],get selected(){return e(J)},get balances(){return e(Re)},get disabled(){return x.busy},onpick:n=>{i(J,n,!0),i(te,""),i(Ae,null),i(Ee,null)}});var Ht=s(ya,2),xt=s(a(Ht),2);be(xt),t(Ht);var $t=s(Ht,2),Mt=a($t),$s=a(Mt);t(Mt);var It=s(Mt,2);be(It),t($t);var Sa=s($t,2);{var Ms=n=>{var l=_r(),p=a(l),M=s(p);t(l),$(()=>u(p,`Balance ${e(Re)[e(J)]??""} ${e(J)??""} `)),re("click",M,()=>i(te,e(Re)[e(J)]??"",!0)),v(n,l)};I(Sa,n=>{e(Re)[e(J)]&&n(Ms)})}var Aa=s(Sa,2);{var Is=n=>{var l=fr(),p=he(l),M=s(a(p),2);be(M),t(p),V(2),$(()=>M.disabled=x.busy),_e(M,()=>e(We),N=>i(We,N)),v(n,l)};I(Aa,n=>{e(J)!=="BTC"&&n(Is)})}var Ba=s(Aa,2);{var Cs=n=>{var l=Je(),p=a(l,!0);t(l),$(()=>u(p,e(Ae))),v(n,l)};I(Ba,n=>{e(Ae)&&n(Cs)})}var Ha=s(Ba,2);{var Es=n=>{var l=Ke(),p=a(l,!0);t(l),$(()=>u(p,e(Ee))),v(n,l)};I(Ha,n=>{e(Ee)&&n(Es)})}var Ue=s(Ha,2),Ds=a(Ue);t(Ue),t(Bt);var xa=s(Bt,2),Ts=s(a(xa),2);{var Ls=n=>{var l=gr(),p=a(l,!0);t(l),$(()=>u(p,e(rt)?"No contract calls yet.":"Reading your historyâ¦")),v(n,l)},ks=n=>{var l=Sr(),p=he(l),M=a(p);t(p);var N=s(p,2),K=a(N),Y=s(a(K));kt(Y,21,()=>e(De),R=>R.id+R.action+R.time,(R,B)=>{var k=yr(),z=a(k),le=a(z,!0);t(z);var oe=s(z),ae=a(oe);{var pe=ue=>{var xe=wr();v(ue,xe)},G=D(()=>e(B).action.startsWith("+"));I(ae,ue=>{e(G)&&ue(pe)})}var q=s(ae,2);{let ue=D(()=>Zs(e(B).action,e(B).payload));tr(q,{get text(){return e(ue)}})}t(oe);var j=s(oe),de=a(j),Le=a(de,!0);t(de),t(j),t(k),$((ue,xe)=>{u(le,ue),$e(oe,"title",`${xe??""} · ${e(B).payload??""}`),ye(de,1,`pill ${e(B).status??""}`,"svelte-1duri02"),u(Le,e(B).status)},[()=>Oa(e(B).time),()=>e(B).action.replace(/^\+/,"")]),v(R,k)}),t(Y),t(K),t(N),$(()=>u(M,`Your last ${e(De).length??""} contract calls, newest first â including the ones the chain 34 refused, which are the rows worth having.`)),v(n,l)};I(Ts,n=>{e(De).length?n(ks,-1):n(Ls)})}t(xa),$((n,l,p,M,N,K,Y,R,B,k,z)=>{u(me,n),u(Ua,l),u(ja,p),ea=ye(lt,1,"value svelte-1duri02",null,ea,{dim:e(T)===null}),u(Xa,e(T)??"â"),u(Ja,M),u(Ka,N),ra=ye(Pe,1,"meter svelte-1duri02",null,ra,K),Dt(ts,`width:${Y??""}%`),u(as,R),oa=ye(pt,1,"meter svelte-1duri02",null,oa,B),Dt(is,`width:${k??""}%`),Ye.disabled=x.busy,u(cs,` ${e(A)??""}`),wt.disabled=x.busy,ha=ye(ze,1,"out mono svelte-1duri02",null,ha,{dim:!e(U)}),u(hs,e(U)?e(U).amountOut:e(Ge)?"â¦":"0.000"),u(ms,` ${e(W)??""}`),qe.disabled=x.busy||!e(U)||e(Gt),u(Ss,e(Gt)?`Not enough ${e(A)}`:x.busy?"Signingâ¦":`Swap ${e(A)} â ${e(W)}`),u(As,e(h)==="BTC"?"Your mapped BTC on MAGI. It leaves to a real Bitcoin address.":"Your balance on MAGI. A deposit spends the Hive side, shown below."),xt.disabled=x.busy,u($s,`Amount â ${e(J)??""}`),It.disabled=x.busy,Ue.disabled=z,u(Ds,`Send ${e(J)??""}`)},[()=>Q(e(w).balance),()=>Q(e(w).shares),()=>Q(e(w).pending),()=>Q(Se(BigInt(Math.trunc(Number(e(w).hbd)))),3),()=>Q(Se(BigInt(Math.trunc(Number(e(w).hive??0)))),3),()=>({low:ge(e(F))}),()=>Fe(e(F)),()=>Math.round(e(Wa)*1e3+1e4).toLocaleString(),()=>({low:ge(e(fe))}),()=>Fe(e(fe)),()=>x.busy||!e(Oe).trim()||!Number(e(te))]),_e(Ye,()=>e(ee),n=>i(ee,n)),re("click",wt,La),re("click",qe,ka),_e(xt,()=>e(Oe),n=>i(Oe,n)),_e(It,()=>e(te),n=>i(te,n)),re("click",Ue,Ga),v(d,c)};I(Fa,d=>{x.account?e(w)?d(za,-1):d(Ya,1):d(Pa)})}t(Ut),v(f,zt),tt()}Ea(["click"]);export{Or as component,Gr as universal};
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.