PageSourceSearch

https://ordinalswallet.com/_next/static/chunks/0gx3sf8...dvv.js

js ordinalswallet.com collected 2026-10-03 20:15:26 UTC 120,477 bytes, 3 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,780773,e=>{e.v({desktopOnly:"Wallet-module__tuJdLq__desktopOnly",legacyLink:"Wallet-module__tuJdLq__legacyLink",line:"Wallet-module__tuJdLq__line",mobileOnly:"Wallet-module__tuJdLq__mobileOnly",modal:"Wallet-module__tuJdLq__modal",root:"Wallet-module__tuJdLq__root",tabSection:"Wallet-module__tuJdLq__tabSection",tabs:"Wallet-module__tuJdLq__tabs",title:"Wallet-module__tuJdLq__title",titleActionButton:"Wallet-module__tuJdLq__titleActionButton",titleActionIcon:"Wallet-module__tuJdLq__titleActionIcon",walletHistoryStatus:"Wallet-module__tuJdLq__walletHistoryStatus"})},220712,e=>{e.v({address:"WalletReceive-module__oaa6sa__address",cancelButton:"WalletReceive-module__oaa6sa__cancelButton",copyButton:"WalletReceive-module__oaa6sa__copyButton",copyButtonContainer:"WalletReceive-module__oaa6sa__copyButtonContainer",description:"WalletReceive-module__oaa6sa__description",header:"WalletReceive-module__oaa6sa__header",qrCode:"WalletReceive-module__oaa6sa__qrCode",qrContainer:"WalletReceive-module__oaa6sa__qrContainer",qrFooter:"WalletReceive-module__oaa6sa__qrFooter",receive:"WalletReceive-module__oaa6sa__receive",root:"WalletReceive-module__oaa6sa__root",sendRcvIconContainer:"WalletReceive-module__oaa6sa__sendRcvIconContainer",swapOption:"WalletReceive-module__oaa6sa__swapOption"})},459864,e=>{e.v({addressInputEndAdornment:"WalletSend-module__7MyZPG__addressInputEndAdornment",altCurrency:"WalletSend-module__7MyZPG__altCurrency",altCurrencyIcon:"WalletSend-module__7MyZPG__altCurrencyIcon",altCurrencyLabel:"WalletSend-module__7MyZPG__altCurrencyLabel",balanceTitle:"WalletSend-module__7MyZPG__balanceTitle",cancelButton:"WalletSend-module__7MyZPG__cancelButton",description:"WalletSend-module__7MyZPG__description",error:"WalletSend-module__7MyZPG__error",form:"WalletSend-module__7MyZPG__form",header:"WalletSend-module__7MyZPG__header",icon:"WalletSend-module__7MyZPG__icon",input:"WalletSend-module__7MyZPG__input",inputEndAdornment:"WalletSend-module__7MyZPG__inputEndAdornment",loading:"WalletSend-module__7MyZPG__loading",receive:"WalletSend-module__7MyZPG__receive",root:"WalletSend-module__7MyZPG__root",sendRcvIconContainer:"WalletSend-module__7MyZPG__sendRcvIconContainer"})},948514,e=>{e.v({balanceContainer:"WalletBalanceDisplay-module__Y71vNa__balanceContainer",btcIcon:"WalletBalanceDisplay-module__Y71vNa__btcIcon",btcIconSmall:"WalletBalanceDisplay-module__Y71vNa__btcIconSmall",incomingBalanceContainer:"WalletBalanceDisplay-module__Y71vNa__incomingBalanceContainer",incomingLabel:"WalletBalanceDisplay-module__Y71vNa__incomingLabel",root:"WalletBalanceDisplay-module__Y71vNa__root",skele:"WalletBalanceDisplay-module__Y71vNa__skele"})},518542,e=>{e.v({copyButton:"WalletSign-module__SPKuaG__copyButton",description:"WalletSign-module__SPKuaG__description",form:"WalletSign-module__SPKuaG__form",header:"WalletSign-module__SPKuaG__header",input:"WalletSign-module__SPKuaG__input",loading:"WalletSign-module__SPKuaG__loading",root:"WalletSign-module__SPKuaG__root",signature:"WalletSign-module__SPKuaG__signature",signatureContainer:"WalletSign-module__SPKuaG__signatureContainer",title:"WalletSign-module__SPKuaG__title"})},165810,e=>{"use strict";var t=e.i(657941),l=e.i(958922),s=e.i(205536),a=e.i(780773),r=e.i(264458),o=e.i(220712),n=e.i(26012),i=e.i(773643),d=e.i(33028),c=e.i(95866),u=e.i(741787),x=e.i(202020),m=e.i(94778),f=e.i(644588),h=e.i(430494);let g=(0,e.i(157205).default)("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);var p=e.i(869480);let b=e=>{let a=l.default.useRef(!1),b=u.default.getTaprootAddress();return l.default.useCallback(()=>{(0,n.default)(b),a.current=!0,setTimeout(()=>a.current=!1,1500)},[b]),(0,t.jsxs)("div",{className:o.default.root,children:[(0,t.jsx)("div",{className:o.default.header,children:(0,t.jsx)("div",{className:o.default.sendRcvIconContainer,children:(0,t.jsx)(f.default,{fill:"#7F56D9",width:17,height:20})})}),(0,t.jsx)("div",{className:(0,r.default)(o.default.receive,"text-lg","semibold"),children:"Receive"}),(0,t.jsxs)("div",{className:(0,r.default)(o.default.description,"text-sm","regular"),children:["Only send ",h.NETWORK," and Ordinals NFTs to this wallet."]}
1),"BTC"===h.NETWORK&&(0,t.jsxs)(s.default,{href:"/swap",onClick:e.handleModalClose,className:o.default.swapOption,children:[(0,t.jsx)(g,{size:20}),(0,t.jsxs)("span",{children:[(0,t.jsx)("strong",{children:"Swap crypto to BTC"}),(0,t.jsx)("small",{children:"Deposit from another coin or network"})]}),(0,t.jsx)(p.ArrowUpRight,{size:17})]}),(0,t.jsx)("div",{className:o.default.qrContainer,children:(0,t.jsx)("div",{className:o.default.qrCode,children:(0,t.jsx)(d.default,{size:256,style:{height:"auto",margin:"0 auto",width:"100%"},value:b,viewBox:"0 0 256 256"})})}),(0,t.jsx)(x.default,{className:(0,r.default)(o.default.address,"text-xs")}),(0,t.jsxs)("div",{className:o.default.copyButtonContainer,children:[(0,t.jsx)(i.default,{width:18,height:18}),(0,t.jsx)(c.default,{className:(0,r.default)(o.default.copyButton,"text-sm","regulat"),label:"Copy to clipboard",value:b})]}),(0,t.jsx)(m.default,{background:"transparent",className:(0,r.default)(o.default.cancelButton,"text-md","semibold"),onClick:e.handleModalClose,children:"Cancel"})]})};var j=e.i(459855),v=e.i(459864),N=e.i(772943),w=e.i(254002),y=e.i(650653),S=e.i(215300),_=e.i(261976),k=e.i(469444),C=e.i(640299),L=e.i(597770),T=e.i(752255),M=e.i(913749),I=e.i(593019),P=e.i(948514),A=e.i(478633);let B=e=>{let{confirmedSatoshis:l,unconfirmedSatoshis:s,isLoading:a}=e;return(0,t.jsxs)("div",{className:P.default.root,children:[(0,t.jsx)(A.default,{className:(0,r.default)("display-md","semibold"),satoshis:l,iconClassName:P.default.btcIcon,skeleClassName:P.default.skele,isLoading:a}),!!s&&(0,t.jsxs)("div",{className:P.default.incomingBalanceContainer,children:[(0,t.jsx)(A.default,{className:(0,r.default)("text-md","regular"),satoshis:s,iconClassName:P.default.btcIconSmall}),(0,t.jsx)("span",{className:(0,r.default)(P.default.incomingLabel,"text-md","regular"),children:"Incoming"})]})]})};var z=e.i(4850),$=e.i(467746),F=e.i(750509),R=e.i(265358);let U=h.NETWORK,W=0,E=e=>{let{handleModalClose:a}=e,[o,n]=l.default.useState(!1),[i,d]=l.default.useState(!1),[c,x]=l.default.useState(e?.usdAmount?e?.usdAmount:""),[f,g]=l.default.useState(null),[p,b]=l.default.useState(null),[P,A]=l.default.useState(null),[E,D]=l.default.useState(null),[O,V]=l.default.useState(null),{value:K,handleChange:G,setValue:q,resolveSnsEl:Z,loading:H,error:X,sns:Y}=(0,I.default)(e?.recipient),J=(0,F.default)(f,300),Q=(0,F.default)(K,300),ee=(0,$.default)(p),{data:et}=(0,_.default)(),[el,es]=l.default.useState(e?.usdAmount?"USD":U),{exchangeRate:ea,isLoading:er}=(0,C.default)(),{bitcoinAmount:eo,usdAmount:en}=l.default.useMemo(()=>{let e=c,t=c?.length>0?parseFloat(c):0;return{bitcoinAmount:e=(t/ea).toFixed(8).toString(),usdAmount:(t*ea).toFixed(2).toString()}},[c,ea]);l.default.useEffect(()=>{!async function(){let e,t=Y?.address||Q;if(!o&&t?.length!==0&&c?.length!==0&&(e="USD"===el?parseFloat((parseFloat(c)/ea*1e8).toFixed(0)):parseFloat((1e8*parseFloat(c)).toFixed(0)))){W+=1,D(null),V(!0);try{let{data:{psbt:l}}=await y.default.post(`${h.API_URL}/wallet/send`,{from:u.default.getTaprootAddress(),to:t,sats:e,public_key:u.default.getPublicKey(),fee_rate:J});W-=1;let s=u.default.getPSBTFee(l);A(l),b(Number(s))}catch(t){W-=1;let e=t?.response?.data?.message||t?.message;0===W&&D((0,j.friendlyTxError)(e))}0===W&&V(!1)}}()},[J,Q,c,ea,el,Y,o]);let ei=l.default.useCallback(()=>{"USD"===el?(x(c?.length>0?eo:""),es(U)):el===U&&(x(c?.length>0?en:""),es("USD"))},[el,c?.length,eo,en]),ed=l.default.useCallback(async e=>{e.preventDefault(),e.stopPropagation(),n(!0);try{let e=await u.default.signPSBTExtractTx(P),t=Y?.address||Q;S.default.emit("open-broadcast-modal",{type:"send",address:t,rawtx:e}),a()}catch(e){u.default.handleError(e)}n(!1)},[Q,Y,a,P]),ec=l.default.useCallback(e=>{x(e.target.value)},[]),eu=c?.length>0&&isNaN(Number(c));return(0,t.jsxs)("div",{className:v.default.root,children:[(0,t.jsx)("div",{className:v.default.header,children:(0,t.jsx)("div",{className:v.default.sendRcvIconContainer,children:(0,t.jsx)(T.default,{width:17,height:20})})}),(0,t.jsx)("div",{className:(0,r.default)(v.default.receive,"text-lg","semibold"),children:"Send"}),(0,t.jsxs)("div",{className:(0,r.default)(v.default.description,"text-sm","regular"),children:["Send ",h.NETWORK," from your wallet."]}
1),(0,t.jsx)("span",{className:(0,r.default)(v.default.balanceTitle,"text-sm","regular"),children:"Balance"}),(0,t.jsx)(B,{confirmedSatoshis:et?.confirmed_balance,unconfirmedSatoshis:et?.unconfirmed_balance}),(0,t.jsxs)("form",{className:v.default.form,onSubmit:ed,children:[(0,t.jsx)(N.default,{className:(0,r.default)(v.default.input,{[v.default.error]:i}),placeholder:`Recipient’s ${h.NETWORK_NAME} address`,value:K,onChange:G,endAdornmentClassName:v.default.addressInputEndAdornment,endAdornment:(0,t.jsx)(L.default,{onSuccess:e=>q(e),onError:()=>S.default.emit("snackbar",{variant:"error",title:"Unable to read QR code!"})})}),Z,(0,t.jsx)(N.default,{className:(0,r.default)(v.default.input,{[v.default.error]:eu}),placeholder:"Amount",value:c,endAdornmentClassName:v.default.inputEndAdornment,endAdornment:(0,t.jsx)(w.default,{type:el}),onEndAdornmentClick:ei,onChange:ec}),!er&&(0,t.jsxs)("div",{className:v.default.altCurrency,onClick:ei,role:"button",tabIndex:0,onKeyDown:(0,R.onKeyboardClick)(ei),children:[(0,t.jsx)("p",{className:v.default.altCurrencyLabel,children:el===U?"$"+(en||"0.00"):(eo||"0.00000000")+" "+U}),(0,t.jsx)(k.default,{className:v.default.altCurrencyIcon})]}),(0,t.jsxs)("div",{className:"border border-border rounded-lg p-3",children:[(0,t.jsx)(z.default,{feeRate:f,setFeeRate:g}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,t.jsx)("p",{className:"text-sm font-bold text-foreground/80",children:"Total fee cost"}),(0,t.jsxs)("div",{className:"flex flex-col justify-right items-right",children:[(0,t.jsxs)("p",{className:"text-xs font-bold text-right",children:[ee," ",h.NETWORK]}),(0,t.jsxs)("p",{className:"text-sm font-regular text-muted-foreground text-right",children:["$",(p/1e8*ea).toFixed(2)]})]})]})]}),(0,t.jsxs)("div",{className:"items-center text-muted-foreground text-xs pt-2 pb-1",children:['By clicking "Send Now", you agree to the Ordinals Wallet'," ",(0,t.jsx)(s.default,{href:"/terms",className:"underline",target:"_blank",children:"Terms of Service."})]}),E&&(0,t.jsx)("p",{className:"text-red-500",children:E}),(0,t.jsx)(M.default,{loading:o,disabled:H||X||O,size:"medium",type:"submit",children:"Send Now"}),(0,t.jsx)(m.default,{background:"transparent",className:(0,r.default)(v.default.cancelButton,"text-md","semibold"),onClick:e.handleModalClose,children:"Cancel"})]})]})};var D=e.i(518542),O=e.i(626821),V=e.i(67787),K=e.i(674666),G=e.i(349642);let q=e=>{let{className:s}=e,[a,o]=l.default.useState(!1),[i,d]=l.default.useState(!1),[c,x]=l.default.useState(""),[f,h]=l.default.useState(""),g=l.default.useCallback(e=>x(e.target.value),[]),p=l.default.useCallback(async e=>{e.preventDefault(),e.stopPropagation(),o(!0);let{success:t,signature:l}=await u.default.signMessage(c);t&&h(l),o(!1)},[c]);return(0,t.jsxs)("div",{className:(0,r.default)({[e.className]:!!s},D.default.root),children:[(0,t.jsxs)("div",{className:D.default.header,children:[(0,t.jsx)("div",{}),(0,t.jsx)("div",{className:(0,r.default)(D.default.title,"display-md","semibold"),children:"Sign message"}),(0,t.jsx)(G.default,{onClick:e.handleModalClose,style:{fontSize:40}})]}),(0,t.jsx)("div",{className:(0,r.default)(D.default.description,"text-md","regular"),children:"Sign a message to prove you own this wallet"}),(0,t.jsxs)("form",{onSubmit:p,className:D.default.form,children:[(0,t.jsx)(O.default,{inputClassName:D.default.input,value:c,onChange:g,placeholder:"Message"}),(0,t.jsx)(m.default,{size:"small",background:"white",className:D.default.button,type:"submit",children:a?(0,t.jsx)(K.default,{className:D.default.loading}):"Sign"})]}),f&&(0,t.jsxs)("div",{className:D.default.signatureContainer,children:[(0,t.jsx)("p",{className:(0,r.default)(D.default.signature,"text-sm","medium"),children:f}),(0,t.jsx)(V.default,{size:"small",className:D.default.copyButton,onClick:()=>{d(!0),(0,n.default)(f),setTimeout(()=>d(!1),1500)},children:i?"Copied!":"Copy signature"})]})]})};var Z=e.i(223810),H=e.i(966200),X=e.i(379856),Y=e.i(536111),J=e.i(759684),Q=e.i(967489),ee=e.i(337822),et=e.i(784774),el=e.i(746798),es=e.i(302747),ea=e.i(989312),er=e.i(178252);let eo=e=>fetch(e).then(e=>e.json());function en(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}var ei=e.i(390702),ed=e.i(681471),ec=e.i(170577),eu=e.i(243702),ex=e.i(57020),em=e.i(917157),ef=e.i(277254),eh=e.i(914525),eg=e.i(547842),ep=e.i(425138);function eb(e){if(!e||!(0,ep.default)(e))return null;let t=e.slice(7);return/^\d+:\d+$/.test(t)?`/alkanes/${t}`:null}var ej=e.i(229261);function ev(){let{data:e,isLoading:t}=(0,er.default)(`${h.API_URL}
1/alkane/assets`,em.fetcher),s=(0,l.useMemo)(()=>{let t=new Map;for(let l of Array.isArray(e?.assets)?e.assets:Array.isArray(e)?e:[]){let e=l?.id,s=Number(l?.price_usd);"string"==typeof e&&Number.isFinite(s)&&s>0&&t.set(`alkane-${e}`,s)}return t},[e]);return(0,l.useMemo)(()=>({priceForSlug:e=>e?s.get(e)??null:null,isLoading:t}),[s,t])}var eN=e.i(939309),ew=e.i(495227),ey=e.i(783914),eS=e.i(587829),e_=e.i(838456),ek=e.i(886264),eC=e.i(864197),eL=e.i(734580),eT=e.i(504857),eM=e.i(403850),eI=e.i(539282),eP=e.i(740514),eA=e.i(922140),eB=e.i(15912),ez=e.i(105346),e$=e.i(973055),eF=e.i(905013),eR=e.i(65974),eU=e.i(831813),eW=e.i(150588),eE=e.i(964410),eD=e.i(938206),eO=e.i(710388),eV=e.i(394258),eK=e.i(774185);let eG=()=>()=>{},eq=e=>`${(e/1e8).toFixed(8).replace(/0+$/,"").replace(/\.$/,"")} BTC`,eZ=/^(bc1[a-z0-9]{25,90}|[13][a-km-zA-HJ-NP-Z1-9]{25,40})$/;function eH(){let e=l.default.useSyncExternalStore(eG,eK.readRawRecoveryContext,()=>null),[s,a]=l.default.useState(!1),r=l.default.useMemo(()=>{if(!e||s)return null;let t=(0,eK.readRecoveryContext)();if(!t)return null;try{return u.default.getTaprootAddress()===t.from?t:null}catch{return null}},[e,s]),[o,n]=l.default.useState(()=>(0,eK.readRecoveryContext)()?.to||""),[i,d]=l.default.useState(null),[c,x]=l.default.useState(!1),[m,f]=l.default.useState(!1),[g,p]=l.default.useState("idle"),[b,v]=l.default.useState("idle"),[N,w]=l.default.useState([]),[S,_]=l.default.useState(null),{data:k,mutate:C}=(0,eE.default)(),{feeRate:L}=(0,eD.default)(),{toast:T}=(0,eA.useToast)();if(!r)return null;let M=async()=>{x(!0);try{let{seed:e}=await u.default.seed();d((0,eV.normalizeMnemonic)(e))}catch{_("Could not read the phrase. Unlock the wallet and try again.")}finally{x(!1)}},I=(k?.inscriptions||[]).map(e=>e.id).filter(Boolean),P=Number(k?.balance)||0,A=Number(k?.confirmed_balance??k?.balance)||0,B=Number(k?.utxo_count)||1,z=eZ.test(o.trim()),$="working"===g||"working"===b,F=0===I.length&&P<=0,R=async e=>{let{data:t}=await y.default.post(`${h.API_URL}/wallet/broadcast`,{rawtx:e});if(t?.error){let e=Error(t.error.message||"Broadcast failed");throw e.name="BroadcastError",e}return String(t?.txid||t?.result||"")},U=e=>{let t=String(e?.message||"").toLowerCase();return e?.name==="BroadcastError"&&/replacement|conflict|missingorspent|already spent|insufficient fee/.test(t)},W=async()=>{if(0===I.length)return void p("done");p("working");let e=await u.default.getTransfers(I,o.trim(),L,[]),t=await u.default.signPSBTExtractTx(e),l=await R(t);w(e=>[...e,l]),p("done")},E=async e=>{if(v("working"),A<=0)return void v(P>0?"waiting":"done");e&&await new Promise(e=>setTimeout(e,6e3));let t=Math.ceil(L*(11+58*B+43)),l=A-t;for(let e=0;e<6&&l>546;e++)try{let{data:{psbt:e}}=await y.default.post(`${h.API_URL}/wallet/send`,{from:u.default.getTaprootAddress(),to:o.trim(),sats:l,public_key:u.default.getPublicKey(),fee_rate:L}),t=await u.default.signPSBTExtractTx(e),s=await R(t);w(e=>[...e,s]),v("done");return}catch(s){if(U(s))return void v("waiting");let e=String(s?.response?.data?.message||s?.message||"").toLowerCase();if(s?.name!=="BroadcastError"&&/insufficient|not enough|exceeds|short/.test(e)){l-=Math.max(500,Math.ceil(t/2));continue}throw s}v(P>0?"waiting":"done")},D=async()=>{_(null);try{let e="done"!==g&&I.length>0;"done"!==g&&await W(),await E(e),C(),T({title:"On its way",description:"Your assets are moving to your normal wallet."})}catch(e){_((0,j.friendlyTxError)(e)),"working"===g&&p("error"),"working"===b&&v("error")}},O="done"===g&&"done"===b;return(0,t.jsx)("section",{"aria-label":"Move everything to your normal wallet",className:"mx-0 mb-4 border-y md:border border-violet-500/40 bg-violet-500/[0.06] md:rounded-lg md:mx-4 lg:mx-0",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 md:p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold text-violet-500",children:"Recovered wallet"}),(0,t.jsx)("h2",{className:"mt-0.5 text-base font-semibold text-foreground",children:O?"Everything is on its way":"Move everything to your normal wallet"}),(0,t.jsxs)("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:["This wallet was opened by the phrase typed with ",r.spelling.toLowerCase(),". Any normal restore opens a different one, so send your assets there once and use that wallet from now on."]})]}),(0,t.jsx)("button",{type:"button","aria-label":"Dismiss",onClick:()=>{(0,eK.clearRecoveryContext)(),a(!0)},className:"shrink-0 rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,t.jsx)(eW.X,{className:"size-4"})})]}),(0,t.jsxs)("dl",{className:"grid grid-cols-1 gap-2 rounded-lg border border-border bg-background/60 p-3 text-sm sm:grid-cols-[auto_1fr] sm:gap-x-4",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:"Moving"}),(0,t.jsxs)("dd",{className:"font-medium tabular-nums text-foreground",children:[I.length," inscription",1===I.length?"":"s"," ·"," ",eq(P)]}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:"To"}),(0,t.jsx)("dd",{className:"min-w-0",children:m?(0,t.jsx)("input",{value:o,onChange:e=>n(e.target.value),spellCheck:!1,autoCapitalize:"none",className:"w-full rounded-md border border-border bg-background px-2 py-1 font-mono text-xs text-foreground",placeholder:"bc1p…"}):(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsx)("span",{className:"font-mono text-xs text-foreground",children:`${o.slice(0,10)}…${o.slice(-6)}`}),o===r.to&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"your normal wallet"}),(0,t.jsx)("button",{type:"button",onClick:()=>f(!0),className:"text-xs text-violet-500 underline-offset-2 hover:underline",children:"Use a different address"})]})}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:"Network fee"}),(0,t.jsxs)("dd",{className:"text-foreground",children:[L," sat/vB · up to two transactions"]})]}),("idle"!==g||"idle"!==b)&&(0,t.jsxs)("ol",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(eX,{label:`Inscriptions (${I.length})`,leg:g}),(0,t.jsx)(eX,{label:`Bitcoin (${eq(P)}
1)`,leg:b})]}),"waiting"===b&&(0,t.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:["The bitcoin is waiting for the inscription transaction to confirm (about one block). Come back to this page and press"," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Move the bitcoin"}),"."]}),S&&(0,t.jsx)("p",{className:"text-xs text-red-500",children:S}),N.length>0&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:N.map(e=>(0,t.jsxs)("a",{href:`/tx/${e}`,className:"mr-3 font-mono text-violet-500 underline-offset-2 hover:underline",children:[e.slice(0,10),"…"]},e))}),(O||o!==r.to)&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border bg-background/60 p-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"The phrase to keep"}),(0,t.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Write down or copy this spelling — all lowercase, single spaces. It opens the wallet your assets now live in, on any device, every time. The oddly typed version is no longer needed."}),i?(0,t.jsx)(eO.default,{seed:i}):(0,t.jsxs)("button",{type:"button",disabled:c,onClick:M,className:"inline-flex h-10 w-full items-center justify-center gap-2 rounded-xl border border-violet-500/50 text-sm font-medium text-violet-500 transition-colors hover:bg-violet-500/10 disabled:opacity-60 sm:w-auto sm:px-4",children:[c?(0,t.jsx)(eU.Loader2,{className:"size-4 animate-spin"}):null,"Show my recovery phrase"]})]}),!O&&(0,t.jsxs)("button",{type:"button",disabled:$||!z||F,onClick:D,className:"inline-flex h-11 w-full items-center justify-center gap-2 rounded-xl bg-violet-600 text-sm font-semibold text-white transition-colors hover:bg-violet-500 disabled:opacity-50 sm:w-auto sm:px-5",children:[$?(0,t.jsx)(eU.Loader2,{className:"size-4 animate-spin"}):null,$?"Signing and sending…":"waiting"===b?"Move the bitcoin":F?"Nothing left to move":"Move everything",!$&&!F&&(0,t.jsx)(eF.ArrowRight,{className:"size-4"})]})]})})}function eX({label:e,leg:l}){return(0,t.jsxs)("li",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"done"===l?"inline-flex size-4 items-center justify-center rounded-full bg-emerald-500 text-white":"working"===l?"inline-flex size-4 items-center justify-center text-violet-500":"error"===l?"inline-flex size-4 items-center justify-center rounded-full bg-red-500 text-white":"inline-flex size-4 items-center justify-center rounded-full border border-border",children:["done"===l&&(0,t.jsx)(eR.Check,{className:"size-3"}),"working"===l&&(0,t.jsx)(eU.Loader2,{className:"size-3 animate-spin"}),"error"===l&&(0,t.jsx)(eW.X,{className:"size-3"})]}),(0,t.jsx)("span",{className:"idle"===l?"text-muted-foreground":"text-foreground",children:e}),"waiting"===l&&(0,t.jsx)("span",{className:"text-muted-foreground",children:"— waiting for confirmation"})]})}var eY=e.i(814661);let eJ=e=>{let t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},eQ=e=>{if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"!=typeof e)return null;let t=parseFloat(e.replace(/,/g,""));return Number.isFinite(t)?t:null},e0=()=>{try{if("u"<typeof localStorage)return{};let e=localStorage.getItem(h.STORAGE_PROFILE);return e?JSON.parse(e):{}}catch{return{}}},e1=e=>{if(e?.ticker)return e.ticker.toString().toUpperCase();let t=e?.collection?.slug;return t&&"string"==typeof t&&t.split("-").slice(1).join("-").replace(/dot/g,".").toUpperCase()||"TOKEN"},e2=e=>{let t=e?.collection?.slug||"";return(0,eg.default)(t)?"RUNE":(0,ep.default)(t)?"ALKANES":t.startsWith("tap-")?"TAP":t.startsWith("brc20-")||t.startsWith("drc20-")||t.startsWith("bel20-")?"BRC-20":"TOKEN"},e4=e=>{let t=e1(e),l=(e=>{let t=eQ(e?.amount);if(null!==t)return t;let l=Array.isArray(e?.meta?.attributes)?e.meta.attributes:[],s=l.find(e=>e?.trait_type?.toLowerCase?.().includes("amount"))||l.find(e=>null!==eQ(e?.value));return eQ(s?.value)})(e);return null===l?t:`${(0,eh.default)(l)} ${t}`},e5=e=>{if(!(0,eN.default)(e?.collection?.slug))return!1;let t=e?.id,l=e?.outpoint?.outpoint;if(!t||!l||"string"!=typeof t)return!1;let s=t.split("i")[0];if(!s||64!==s.length)return!1;try{return ew.default.decode(l).txid!==s}catch{return!1}},e3=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]}),e8=()=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("polyline",{points:"20 6 9 17 4 12"})}),e6=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"2",x2:"22",y1:"12",y2:"12"}),(0,t.jsx)("line",{x1:"12",x2:"12",y1:"2",y2:"22"}),(0,t.jsx)("path",{d:"m20 16-4-4 4-4"}),(0,t.jsx)("path",{d:"m4 8 4 4-4 4"}),(0,t.jsx)("path",{d:"m16 4-4 4-4-4"}),(0,t.jsx)("path",{d:"m8 20 4-4 4 4"})]}),e7=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}),(0,t.jsx)("path",{d:"m3.3 7 8.7 5 8.7-5"}),(0,t.jsx)("path",{d:"M12 22V12"})]}),e9=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,t.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,t.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),te=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,t.jsx)("path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18"}),(0,t.jsx)("path",{d:"M7 6h1v4"}),(0,t.jsx)("path",{d:"m16.71 13.88.7.71-2.82 2.82"})]}),tt=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z"}),(0,t.jsx)("path",{d:"M7 7h.01"})]}),tl=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M12 20h9"}),(0,t.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]}),ts=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}),ta=()=>(0,t.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M4.93 5.43a.45.45 0 0 0 0 .64.45.45 0 0 0 .64 0L7.5 4.14l1.93 1.93a.45.45 0 0 0 .64 0 .45.45 0 0 0 0-.64L7.82 3.18a.45.45 0 0 0-.64 0L4.93 5.43Zm5.14 4.14a.45.45 0 0 0 0-.64.45.45 0 0 0-.64 0L7.5 10.86 5.57 8.93a.45.45 0 0 0-.64 0 .45.45 0 0 0 0 .64l2.25 2.25a.45.45 0 0 0 .64 0l2.25-2.25Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),tr=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,t.jsx)("path",{d:"m21 21-4.3-4.3"})]}),to=({className:e})=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:(0,t.jsx)("path",{d:"m9 18 6-6-6-6"})}),tn=new Set(h.NAMES_SLUGS),ti=new Set(["brc-20","tap","rune"]);function td(e){return`mb-3 flex min-h-11 w-full shrink-0 items-center justify-center rounded-lg px-4 py-2.5 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-500 focus-visible:ring-offset-2 focus-visible:ring-offset-background ${e?"bg-purple-600 text-white hover:bg-purple-700":"border border-border bg-background text-foreground hover:bg-accent"}`}function tc(e){return(0,t.jsxs)("div",{className:"flex h-[338px] flex-col border-y border-border bg-chrome-muted px-5 pt-5 dark:bg-transparent md:rounded-lg md:border lg:h-auto lg:min-h-0 lg:grid lg:grid-rows-subgrid lg:row-span-4",children:[e.header,(0,t.jsx)("div",{className:"flex flex-col lg:h-full lg:justify-end",children:e.value}),e.action,(0,t.jsx)(J.ScrollArea,{className:"min-h-0 flex-1 lg:h-full",children:e.children})]})}let tu=e=>{let{toggleSendCoin:s,toggleRecieveCoin:a,toggleManageUtxos:r}=e,o=(0,ey.default)(),[i,d]=l.default.useState(!1),[c]=l.default.useState(()=>e0().sns||""),x=(0,eS.default)(),[m,f]=l.default.useState(48),[g,p]=l.default.useState(48),[b,j]=l.default.useState(48),[v,N]=l.default.useState(48),[w,k]=l.default.useState(48),[L,T]=l.default.useState("recent"),[M,I]=l.default.useState("recent"),[P,A]=l.default.useState("all"),[B,z]=l.default.useState(""),[F,R]=l.default.useState(new Set),[U,W]=l.default.useState("recent"),[E,D]=l.default.useState("all"),[O,V]=l.default.useState(""),[K,G]=l.default.useState("highest"),[q,Z]=l.default.useState("highest"),[H,ew]=l.default.useState(!1),eF=async e=>{try{let t=e.id,l=u.default.getTaprootAddress(),s=await u.default.signInscription(t);await y.default.post(`${h.API_URL}
1/wallet/${l}/icon`,{inscription:t,signature:s}),u.default.fetchProfile(),ew(!1),(0,eA.toast)({title:"Profile picture updated!",description:"Your new profile picture has been set."})}catch(e){(0,eA.toast)({title:"Error",description:"Failed to update profile picture. Please try again."})}};u.default.type(),u.default.provider?.name;let{data:eR,isLoading:eU}=(0,_.default)(),eW=eR?.inscriptions,{exchangeRate:eE}=(0,C.default)(),eD=(0,ej.useRouter)(),{data:eO,isLoading:eV}=(0,ei.default)(),eK=l.default.useMemo(()=>{let e=new Set;for(let t of eO??[])t?.collection?.slug&&e.add(t.collection.slug);for(let t of eW??[])t?.collection?.slug&&e.add(t.collection.slug);return[...e]},[eO,eW]),eG=(0,ed.useMarks)(eK),{data:eq}=(0,eu.default)(),{priceForSlug:eZ}=ev(),eX=u.default.balanceAddress(),{data:eQ}=(0,er.default)(`${h.API_URL}/wallet/${eX}/all-utxos`,em.fetcher),tu=function(e){let{data:t}=(0,er.default)(e?`${h.API_URL}/wallet/${e}/acquisitions`:null,eo,{revalidateOnFocus:!1,dedupingInterval:3e4});return t??null}(eX),tx=u.default.getTaprootAddress(),{data:tm,isLoading:tf}=(0,er.default)(`${h.API_URL}/wallet/${tx}/inscriptions/activity?status=Sold`,em.fetcher),{data:th}=(0,er.default)(`${h.API_URL}/${h.COLLECTIONS_VERSION}?limit=500&order=VolumeTotalDesc`,em.fetcher),tg=l.default.useMemo(()=>{let e=new Map;return th?.collections&&th.collections.forEach(t=>{t?.slug&&t?.volume_all_time&&e.set(t.slug,t.volume_all_time)}),e},[th]),tp=(0,$.default)(eR?.confirmed_balance),[tb]=(0,ex.default)(eR?.confirmed_balance),tj=!eU&&Number(eR?.frozen_balance)>0,tv=!eU&&Number(eR?.utxo_count)>0,tN=(0,$.default)(eR?.frozen_balance),[tw]=(0,ex.default)(eR?.frozen_balance),ty=l.default.useMemo(()=>eW?eW.flatMap(e=>tn.has(e?.collection?.slug)&&e?.meta?.name?[e.meta.name]:[]):[],[eW]),tS=e0().icon,t_=(0,eB.default)(),tk=(0,ez.resolveTwetchImage)(t_.icon),tC=t_.name?.trim()||null,tL=u.default.getTaprootAddress(),tT=u.default.balanceAddress?.()||null,tM=parseInt(u.default.getPublicKey(),16),tI=x&&!tL,tP=l.default.useMemo(()=>[...eQ?.utxos||[],...eQ?.mempool||[]].sort((e,t)=>"lowest"===K?e.value-t.value:t.value-e.value),[eQ,K]),tA=l.default.useMemo(()=>{if(!eW)return[];let e=[...eW].filter(e=>!tn.has(e?.collection?.slug)&&!ti.has(e?.collection?.slug));return"for-sale"===P&&(e=e.filter(e=>e?.escrow?.satoshi_price)),e.sort((e,t)=>{let l=e5(e);if(l!==e5(t))return l?1:-1;switch(M){case"recent":{let l=e=>en(tu?.inscriptions?.[e?.id]),s=l(t)-l(e);if(0!==s)return s;return(t?.num||t?.number||0)-(e?.num||e?.number||0)}case"least-value":return(e?.collection?.floor_price||0)-(t?.collection?.floor_price||0);case"highest-num":return(t?.num||t?.number||0)-(e?.num||e?.number||0);case"lowest-num":return(e?.num||e?.number||0)-(t?.num||t?.number||0);default:return(t?.collection?.floor_price||0)-(e?.collection?.floor_price||0)}})},[eW,P,M,tu]),tB=l.default.useMemo(()=>eW?eW.filter(e=>!h.NAMES_SLUGS.includes(e?.collection?.slug)&&e?.escrow?.satoshi_price).length:0,[eW]),tz=l.default.useMemo(()=>{let e=B.trim().toLowerCase(),t=e?new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")):null,l=e=>!t||t.test(e.toLowerCase()),s=t=>{if(!e)return!0;let s=t?.collection?.name?.toLowerCase?.()||"",a=t?.collection?.slug?.toLowerCase?.()||"",r=String(t?.num??t?.number??""),o=t?.meta?.name?.toLowerCase?.()||"",n=(0,eN.default)(t?.collection?.slug)?e1(t).toLowerCase():"";return l(s)||l(a)||l(r)||l(o)||l(n)},a=new Map;for(let e of tA){let t=e?.collection?.slug;if(!t)continue;let l=a.get(t)||[];l.push(e),a.set(t,l)}let r=[],o=new Set;for(let e of tA){let t=e?.collection?.slug;if(t){if(o.has(t))continue;o.add(t);let l=a.get(t);1===l.length?r.push({type:"single",key:l[0]?.id||`${t}-0`,item:l[0]}):r.push({type:"group",key:t,slug:t,name:e?.collection?.name||t,items:l,collection:e?.collection})}else r.push({type:"single",key:e?.id||`nokey-${r.length}`,item:e})}if(!e)return r;let n=[];for(let e of r){if("single"===e.type){s(e.item)&&n.push(e);continue}if(l(e.name)||l(e.slug)){n.push(e);continue}let t=e.items.filter(s);0!==t.length&&(1===t.length?n.push({type:"single",key:t[0]?.id||e.slug,item:t[0]}):n.push({...e,items:t}))}return n},[tA,B]),t$=B.trim().length>0,tF=l.default.useCallback(e=>{R(t=>{let l=new Set(t);return l.has(e)?l.delete(e):l.add(e),l})},[]),tR=l.default.useMemo(()=>eW?eW.filter(e=>e?.content_type?.includes("image")).slice(0,20):[],[eW]),tU=l.default.useMemo(()=>
1{if(!eW)return[];let e=[...eW].filter(e=>!h.NAMES_SLUGS.includes(e?.collection?.slug)),t=new Map;for(let l of e){let e=l?.outpoint?.outpoint||l?.id;t.has(e)?t.get(e)._utxoGroupCount+=1:t.set(e,{...l,_utxoGroupCount:1})}let l=[];return t.forEach(e=>l.push(e)),l.sort((e,t)=>{let l=e?.outpoint?.sats||546,s=t?.outpoint?.sats||546,a=(0,ea.getUnfreezableSats)(l),r=(0,ea.getUnfreezableSats)(s);return!!a!=!!r?r-a:"lowest"===q?l-s:s-l})},[eW,q]),tW=l.default.useMemo(()=>tm&&Array.isArray(tm)?[...tm].sort((e,t)=>"amount"===L?(t?.escrow?.satoshi_price||0)-(e?.escrow?.satoshi_price||0):new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()):[],[tm,L]),tE=l.default.useMemo(()=>tW?.length?tW.reduce((e,t)=>e+(t?.escrow?.satoshi_price||0),0)/1e8*eE:0,[tW,eE]),tD=l.default.useMemo(()=>eO?eO.map(e=>{let t=0,l="0.00",s=(eq||[]).find(t=>t.slug===e?.collection?.slug),a=(0,ep.default)(e?.collection?.slug)?eZ(e?.collection?.slug):null;if((0,ep.default)(e?.collection?.slug)){let s=Number(e?.overall_balance);a&&Number.isFinite(s)&&s>0&&eE&&(t=a*s/eE*1e8,l=(0,ex.getSatoshiPriceUSD)(t,eE))}else{let a=(0,ed.lowerQuote)(eG[e?.collection?.slug]?.fair_sats,Number(s?.floor_price_per));a&&e?.overall_balance&&(t=a*e.overall_balance,l=(0,ex.getSatoshiPriceUSD)(t,eE)),a&&(0,eg.default)(s?.slug??e?.collection?.slug)&&(t=a*e.amount,l=(0,ex.getSatoshiPriceUSD)(t,eE))}let r=tg.get(e?.collection?.slug)||0,o=s?{...e.collection,...s,icon:s.icon||e.collection?.icon}:e.collection,n=e?.collection?.slug||"",i=e?.type||"brc-20";return(0,eg.default)(n)?i="runes":(0,ep.default)(n)?i="alkanes":n.includes("tap-")?i="tap":e?.type==="pow-20"&&(i="pow-20"),{...e,collection:o,balanceUSD:l,satoshiPrice:t,volumeAllTime:r,protocol:i}}).filter(e=>e.overall_balance>0||e.amount>0).filter(e=>"all"===E||e.protocol===E).sort((e,t)=>{if("recent"===U){let l=e=>en(tu?.tokens?.[e?.collection?.slug]),s=l(t)-l(e);return 0!==s?s:t.volumeAllTime-e.volumeAllTime}if("highest"===U||"lowest"===U){let l=e=>Number(e.overall_balance||e.amount||0),s=e.satoshiPrice>0?e.satoshiPrice:null,a=t.satoshiPrice>0?t.satoshiPrice:null;return null===s||null===a?null!==s?-1:null!==a?1:l(t)-l(e):s===a?l(t)-l(e):"highest"===U?a-s:s-a}return t.volumeAllTime-e.volumeAllTime}):[],[eO,eq,eZ,eE,tg,U,E,tu]),tO=l.default.useMemo(()=>{let e=O.trim().toLowerCase();return e?tD.filter(t=>{let l=(t?.ticker||"").toString().toLowerCase(),s=(t?.collection?.slug||"").toString().toLowerCase(),a=(t?.collection?.name||"").toString().toLowerCase(),r=(t?.protocol||"").toString().toLowerCase();return l.includes(e)||s.includes(e)||a.includes(e)||r.includes(e)}):tD},[tD,O]),tV=O.trim().length>0;return(0,t.jsx)(el.TooltipProvider,{children:(0,t.jsxs)("div",{className:"w-full py-8 md:py-16 px-0 md:px-4 lg:px-0",children:[(0,t.jsx)(eH,{}),(0,t.jsx)(Y.default,{}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-0 md:gap-4 mb-0 md:mb-6",children:[(0,t.jsxs)("div",{className:"flex flex-col h-[338px] border-y md:border border-border bg-chrome-muted dark:bg-transparent md:rounded-lg pt-5 px-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[x?(0,t.jsxs)(ee.Popover,{open:H,onOpenChange:e=>{e&&null!==t_.userId?(0,e$.openProfileEditor)():ew(e)},children:[(0,t.jsx)(ee.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{className:"relative group",children:[tk||tS?(0,t.jsx)(e_.default,{className:"size-12 rounded-full ring-2 ring-border group-hover:ring-purple-500 transition-all",src:tk??`${h.CDN_URL}/${tS}`,defaultGradientId:tM,size:48}):(0,t.jsx)(e_.default,{className:"size-12 rounded-full ring-2 ring-border group-hover:ring-purple-500 transition-all",defaultGradientId:tM,size:48}),(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-background/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M12 20h9"}),(0,t.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})})]})}),(0,t.jsxs)(ee.PopoverContent,{className:"w-64 p-2 bg-card border-border",align:"start",children:[(0,t.jsx)("div",{className:"mb-2 px-2",children:(0,t.jsx)("p",{className:"text-xs text-muted-foreground font-medium",children:"Choose Profile Picture"})}),(0,t.jsx)(J.ScrollArea,{className:"h-48",children:(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-1",children:[tR.map((e,l)=>(0,t.jsx)("button",{onClick:()=>eF(e),className:"size-12 rounded overflow-hidden ring-2 ring-transparent hover:ring-purple-500 transition-all",children:(0,t.jsx)(eL.default,{className:"size-12 object-cover",inscription:e,smallCard:!0})},l)),0===tR.length&&(0,t.jsx)("div",{className:"col-span-4 py-4 text-center text-muted-foreground text-xs",children:"No image inscriptions foun
1d"})]})})]})]}):(0,t.jsx)("div",{className:"size-12 rounded-full bg-foreground/[0.08] dark:bg-foreground/[0.12] ring-2 ring-border animate-pulse"}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[x?tL?(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:tC??(ty.length>0?c||ty[0]:(0,ef.default)(tL))}):(0,t.jsx)("button",{onClick:()=>S.default.emit("command",{id:"connect-wallet"}),className:"text-sm font-semibold text-foreground hover:text-purple-500 transition-colors text-left",children:"Connect Wallet"}):(0,t.jsx)("div",{className:"h-7 w-24 bg-foreground/[0.08] dark:bg-foreground/[0.12] rounded animate-pulse"}),(0,t.jsx)("div",{className:"flex flex-col gap-1 mt-2",children:x?tL?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>{(0,n.default)(tL),d(!0),setTimeout(()=>d(!1),2e3)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group",children:[tT&&tT!==tL&&(0,t.jsx)("span",{className:"text-zinc-600 text-[10px]",children:"Ordinals:"}),(0,t.jsx)("span",{className:"font-mono",children:(0,ef.default)(tL)}),(0,t.jsx)("span",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:i?(0,t.jsx)(e8,{}):(0,t.jsx)(e3,{})}),i&&(0,t.jsx)("span",{className:"text-success text-[10px] flex-shrink-0",children:"Copied!"})]}),tT&&tT!==tL&&(0,t.jsxs)("button",{onClick:()=>{(0,n.default)(tT),d(!0),setTimeout(()=>d(!1),2e3)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group",children:[(0,t.jsx)("span",{className:"text-zinc-600 text-[10px]",children:"Payment:"}),(0,t.jsx)("span",{className:"font-mono",children:(0,ef.default)(tT)}),(0,t.jsx)("span",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:(0,t.jsx)(e3,{})})]})]}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"No wallet connected"}
1):(0,t.jsx)("div",{className:"h-4 w-32 bg-foreground/[0.08] dark:bg-foreground/[0.12] rounded animate-pulse"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(eY.default,{}),x&&tL&&(0,t.jsx)("button",{type:"button",onClick:()=>(0,e$.openProfileEditor)(),"aria-label":"Edit profile",title:"Edit profile","data-testid":"wallet-edit-profile",className:"text-muted-foreground hover:text-foreground transition-colors p-1",children:(0,t.jsx)(tl,{})}),(0,t.jsx)(eM.default,{href:"/settings",children:(0,t.jsx)("button",{"aria-label":"Settings",title:"Settings",className:"text-muted-foreground hover:text-foreground transition-colors p-1",children:(0,t.jsx)(ts,{})})})]})]}),(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center",children:(0,t.jsxs)("div",{className:"relative rounded-2xl border border-border p-5 overflow-hidden",children:[(0,t.jsx)("div",{className:"absolute top-0 right-0 size-40 rounded-full -translate-y-1/2 translate-x-1/2 blur-3xl bg-gradient-to-br from-purple-500/30 via-violet-600/20 to-[#5B21B6]/30"}),(0,t.jsx)("div",{className:"absolute bottom-0 left-0 size-32 rounded-full translate-y-1/2 -translate-x-1/2 blur-3xl bg-gradient-to-tr from-violet-600/25 via-purple-500/20 to-fuchsia-500/25"}),(0,t.jsx)("div",{className:"relative",children:tI?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground font-medium",children:"Get Started"}),(0,t.jsx)(eT.default,{className:"size-6 text-amber-500"})]}),(0,t.jsx)("p",{className:"text-lg font-bold text-foreground tracking-tight leading-tight mb-1",children:"Your Bitcoin & Ordinals home."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed mb-4",children:"Inscriptions, Runes, BRC-20, TAP, and Bitcoin — all in one wallet."}),(0,t.jsx)("button",{onClick:()=>S.default.emit("command",{id:"connect-wallet"}),className:"w-full px-4 py-2 bg-foreground text-background font-semibold text-sm rounded-lg hover:bg-foreground
1/90 transition-colors",children:"Connect Wallet"}),(0,t.jsx)("button",{onClick:()=>S.default.emit("command",{id:"connect-wallet"}),className:"w-full mt-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:"or create a new wallet"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground font-medium",children:"Balance"}),(0,t.jsx)(eT.default,{className:"size-6 text-amber-500"})]}),eU?(0,t.jsx)(es.Skeleton,{className:"h-10 w-40"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-1 mb-1",children:[(0,t.jsx)("span",{className:"text-3xl font-bold text-foreground tracking-tight",children:tp||"0.00000000"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground font-medium",children:"BTC"})]}),(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:["≈ $",tb||"0.00"," USD"]})]}),eR?.unconfirmed_balance>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-3 px-2 py-1 bg-amber-500/10 border border-amber-500/20 rounded w-fit",children:[(0,t.jsx)("div",{className:"size-1.5 bg-amber-500 rounded-full animate-pulse"}),(0,t.jsxs)("span",{className:"text-amber-400 text-[11px] font-medium",children:["+",(eR.unconfirmed_balance/1e8).toFixed(8)," incoming"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-4",children:[(0,t.jsx)("button",{onClick:()=>{a()},className:"flex-1 px-4 py-2 bg-foreground text-background font-semibold text-sm rounded-lg hover:bg-foreground
1/90 transition-colors",children:"Receive"}),(0,t.jsx)("button",{onClick:()=>{s()},className:"flex-1 px-4 py-2 bg-accent text-foreground font-semibold text-sm rounded-lg hover:bg-accent/80 transition-colors border border-border",children:"Send"})]})]})})]})})]}),(0,t.jsxs)("div",{className:"flex flex-col h-[338px] border-y md:border border-border bg-chrome-muted dark:bg-transparent md:rounded-lg pt-5 px-5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-2",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(e9,{}),"Inscriptions"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{onClick:()=>{S.default.emit("command",{command:{featured:!1,component:eP.default,name:"Import Listings",heading:"External Listings",args:{}}})},className:"h-6 shrink-0 whitespace-nowrap px-2 text-xs text-muted-foreground bg-transparent border border-purple-500/30 rounded-md hover:text-foreground hover:border-purple-500/50 transition-colors",children:"Import Listings"}),(0,t.jsxs)(Q.Select,{value:M,onValueChange:e=>{f(48),I(e)},children:[(0,t.jsxs)(Q.SelectTrigger,{hideChevron:!0,className:"w-auto h-6 shrink-0 whitespace-nowrap bg-transparent border-border text-muted-foreground text-xs px-2 gap-1",children:[(0,t.jsx)(Q.SelectValue,{}),(0,t.jsx)(ta,{})]}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"recent",className:"text-foreground text-xs hover:bg-accent",children:"Most Recent"}),(0,t.jsx)(Q.SelectItem,{value:"most-value",className:"text-foreground text-xs hover:bg-accent",children:"Highest Floor"}),(0,t.jsx)(Q.SelectItem,{value:"least-value",className:"text-foreground text-xs hover:bg-accent",children:"Lowest Floor"}),(0,t.jsx)(Q.SelectItem,{value:"highest-num",className:"text-foreground text-xs hover:bg-accent",children:"Highest #"}),(0,t.jsx)(Q.SelectItem,{value:"lowest-num",className:"text-foreground text-xs hover:bg-accent",children:"Lowest #"})]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[eU?(0,t.jsx)(es.Skeleton,{className:"h-10 w-20"}):(0,t.jsx)("p",{className:"text-3xl font-bold text-foreground",children:tA?.length||0}),tB>0&&(0,t.jsxs)("button",{onClick:()=>{f(48),A("for-sale"===P?"all":"for-sale")},className:`text-[10px] px-1.5 py-0.5 rounded transition-colors ${"for-sale"===P?"bg-purple-600 text-white":"text-muted-foreground hover:text-foreground"}`,children:["For Sale (",tB,")"]})]}),(0,t.jsxs)("div",{className:"relative mb-2",children:[(0,t.jsx)("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",children:(0,t.jsx)(tr,{})}),(0,t.jsx)("input",{type:"text",value:B,onChange:e=>{f(48),z(e.target.value)},placeholder:"Search collections or inscriptions",className:"w-full h-7 pl-7 pr-7 text-xs bg-transparent border border-border rounded-md text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-purple-500/50"}),B&&(0,t.jsx)("button",{onClick:()=>{f(48),z("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground text-xs","aria-label":"Clear search",children:"×"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground px-2 pb-2 border-b border-border",children:[(0,t.jsx)("span",{children:"Item"}),(0,t.jsx)("span",{children:"Price"})]}),(0,t.jsxs)(J.ScrollArea,{className:"flex-1 min-h-0",children:[0!==tz.length||eU?(0,t.jsx)(et.Table,{children:(0,t.jsx)(et.TableBody,{children:tz.slice(0,m).flatMap(e=>{let l=(e,l,s)=>{let a=!!e?.escrow?.satoshi_price,r=(0,eN.default)(e?.collection?.slug),n=r&&e5(e),i=r?e4(e):"",d=r?e2(e):"",c=a?(e.escrow.satoshi_price/1e8).toFixed(8):null,u=a?eJ(e.escrow.satoshi_price/1e8*eE):null,x=(0,ed.lowerQuote)(eG[e?.collection?.slug]?.fair_sats,Number(e?.collection?.floor_price)),m=r?i:s?`#${e?.num||e?.number||"Unknown"}`:e?.collection?.name||`#${e?.num||e?.number||"Unknown"}`;return(0,t.jsxs)(et.TableRow,{className:"cursor-pointer border-border hover:bg-accent/50",onClick:t=>{if(t.stopPropagation(),s&&e?.id)return void o({id:e.id,inscription:e});let l=e?.collection?.slug,a=eb(l);a?eD.push(a):l?S.default.emit("command",{command:{featured:!1,component:eI.default,name:r?i:e?.collection?.name||`#${e?.num||e?.number||"Unknown"}`,args:{slug:l},heading:r?"Token":"Collection"}}):e?.id&&o({id:e.id,inscription:e})},children:[(0,t.jsx)(et.TableCell,{className:`p-2 ${s?"pl-8":""}`,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"size-8 rounded overflow-hidden flex-shrink-0",children:r?(0,t.jsx)(ek.default,{collection:e.collection,className:"size-8 rounded-full",imageClassName:"size-8 rounded-full"}):(0,t.jsx)(eL.default,{className:"size-8 object-cover",inscription:e,smallCard:!0})}),(0,t.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[!r&&e?.id?(0,t.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),o({id:e.id,inscription:e})},className:"text-sm text-foreground truncate max-w-[110px] text-left hover:underline",children:m}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground truncate max-w-[110px]",children:m}),n&&(0,t.jsx)(eC.default,{}),a&&!n&&(0,t.jsx)("span",{className:"text-[9px] text-white bg-gradient-to-r from-purple-600 to-blue-500 px-1.5 py-0.5 rounded",children:"Listed"})]}),r&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:d})]})]})}),(0,t.jsx)(et.TableCell,{className:"p-2 text-right",children:n?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"—"}):a?(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:c}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["$",u]})]}):x?(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:["~",(0,t.jsx)(ec.default,{value:x,format:e=>(e/1e8).toFixed(8),snapBelow:1e-5})]}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["~$",(0,t.jsx)(ec.default,{value:null!==x?x/1e8*eE:null,format:e=>eJ(e),tint:!1,snapBelow:1e-5})]})]}):(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"—"})})]},l)};if("single"===e.type)return[l(e.item,e.key,!1)];let s=t$||F.has(e.slug),a=e.items.filter(e=>!!e?.escrow?.satoshi_price).length,r=e.collection?.floor_price||0,n=(0,ed.lowerQuote)(eG[e.slug]?.fair_sats,r),i=(0,t.jsxs)(et.TableRow,{className:"cursor-pointer border-border hover:bg-accent/50 bg-accent/20",onClick:t=>{t.stopPropagation(),tF(e.slug)},children:[(0,t.jsx)(et.TableCell,{className:"p-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(to,{className:`text-muted-foreground transition-transform ${s?"rotate-90":""}`}),(0,t.jsxs)("div",{className:"relative size-8 flex-shrink-0",children:[(0,t.jsx)("div",{className:"absolute inset-0 rounded overflow-hidden border border-border translate-x-[3px] translate-y-[3px] opacity-50",children:(0,t.jsx)(ek.default,{collection:e.collection,className:"w-full h-full",imageClassName:"w-full h-full object-cover"})}),(0,t.jsx)("div",{className:"absolute inset-0 rounded overflow-hidden border border-border bg-card",children:e.items[0]&&
1!(0,eN.default)(e.slug)?(0,t.jsx)(eL.default,{className:"size-8 object-cover",inscription:e.items[0],smallCard:!0}):(0,t.jsx)(ek.default,{collection:e.collection,className:"size-8 rounded",imageClassName:"size-8 rounded object-cover"})})]}),(0,t.jsx)("div",{className:"flex flex-col min-w-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-sm text-foreground truncate max-w-[110px]",children:e.name}),(0,t.jsxs)("span",{className:"text-[9px] text-muted-foreground bg-accent px-1.5 py-0.5 rounded",children:["×",e.items.length]}),a>0&&(0,t.jsxs)("span",{className:"text-[9px] text-white bg-zinc-700 px-1.5 py-0.5 rounded",children:[a," listed"]})]})})]})}),(0,t.jsx)(et.TableCell,{className:"p-2 text-right",children:n?(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:["~",(0,t.jsx)(ec.default,{value:n,format:e=>(e/1e8).toFixed(8),snapBelow:1e-5})]}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["~$",(0,t.jsx)(ec.default,{value:null!==n?n/1e8*eE:null,format:e=>eJ(e),tint:!1,snapBelow:1e-5})," ","ea"]})]}):(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"—"})})]},`group-${e.slug}`);return s?[i,...e.items.map((t,s)=>l(t,`${e.slug}-${t?.id||s}`,!0))]:[i]})})}):(0,t.jsx)("div",{className:"flex flex-col items-center justify-center h-full py-8 text-center",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:t$?"No matches":"for-sale"===P?"No listed items":"No inscriptions"})}),(0,t.jsx)(X.default,{hasMore:tz.length>m,itemCount:Math.min(tz.length,m),onLoadMore:()=>f(e=>e+48)})]})]}),(0,t.jsxs)("div",{className:"flex flex-col h-[338px] border-y md:border border-border bg-chrome-muted dark:bg-transparent md:rounded-lg pt-5 px-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(te,{}),"Tokens"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(Q.Select,{value:E,onValueChange:e=>{p(48),D(e)},children:[(0,t.jsx)(Q.SelectTrigger,{className:"w-auto h-6 shrink-0 whitespace-nowrap bg-transparent border-border text-muted-foreground text-xs px-2 gap-1",children:(0,t.jsx)(Q.SelectValue,{})}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"all",className:"text-foreground text-xs hover:bg-accent",children:"All"}),(0,t.jsx)(Q.SelectItem,{value:"runes",className:"text-foreground text-xs hover:bg-accent",children:"Runes"}),(0,t.jsx)(Q.SelectItem,{value:"brc-20",className:"text-foreground text-xs hover:bg-accent",children:"BRC-20"}),(0,t.jsx)(Q.SelectItem,{value:"tap",className:"text-foreground text-xs hover:bg-accent",children:"TAP"}),(0,t.jsx)(Q.SelectItem,{value:"alkanes",className:"text-foreground text-xs hover:bg-accent",children:"Alkanes"}),(0,t.jsx)(Q.SelectItem,{value:"pow-20",className:"text-foreground text-xs hover:bg-accent",children:"POW-20"})]})]}),(0,t.jsxs)(Q.Select,{value:U,onValueChange:e=>{p(48),W(e)},children:[(0,t.jsxs)(Q.SelectTrigger,{hideChevron:!0,className:"w-auto h-6 shrink-0 whitespace-nowrap bg-transparent border-border text-muted-foreground text-xs px-2 gap-1",children:[(0,t.jsx)(Q.SelectValue,{}),(0,t.jsx)(ta,{})]}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"recent",className:"text-foreground text-xs hover:bg-accent",children:"Most Recent"}),(0,t.jsx)(Q.SelectItem,{value:"volume",className:"text-foreground text-xs hover:bg-accent",children:"Volume"}),(0,t.jsx)(Q.SelectItem,{value:"highest",className:"text-foreground text-xs hover:bg-accent",children:"Highest Price"}),(0,t.jsx)(Q.SelectItem,{value:"lowest",className:"text-foreground text-xs hover:bg-accent",children:"Lowest Price"})]})]})]})]}),eV?(0,t.jsx)(es.Skeleton,{className:"h-10 w-20 mb-3"}):(0,t.jsx)("p",{className:"text-3xl font-bold text-foreground mb-3",children:tD.length||0}),(0,t.jsxs)("div",{className:"relative mb-2",children:[(0,t.jsx)("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",children:(0,t.jsx)(tr,{})}),(0,t.jsx)("input",{type:"text",value:O,onChange:e=>{p(48),V(e.target.value)},placeholder:"Search tokens",className:"w-full h-7 pl-7 pr-7 text-xs bg-transparent border border-border rounded-md text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-purple-500/50"}),O&&(0,t.jsx)("button",{onClick:()=>{p(48),V("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground text-xs","aria-label":"Clear search",children:"×"})]}),(0,t.jsxs)(J.ScrollArea,{className:"flex-1 min-h-0",children:[0!==tO.length||eV?(0,t.jsx)(et.Table,{children:(0,t.jsx)(et.TableBody,{children:tO.slice(0,g).map((e,l)=>{let s=!!e?.escrow?.satoshi_price;return(0,t.jsxs)(et.TableRow,{className:"border-border hover:bg-accent/50 cursor-pointer",onClick:t=>{t.stopPropagation();let l=e?.collection?.slug,s=eb(l);s?eD.push(s):l&&S.default.emit("command",{command:{featured:!1,component:eI.default,name:(0,ep.default)(l)?e.ticker:l?.split("-")?.[1],args:{slug:l},heading:"Collections"}})},children:[(0,t.jsx)(et.TableCell,{className:"p-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ek.default,{collection:e.collection,className:"size-8 rounded-full",imageClassName:"size-8 rounded-full"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground font-medium truncate max-w-[100px]",children:e.ticker?.toUpperCase()}),s&&(0,t.jsx)("span",{className:"text-[9px] text-white bg-gradient-to-r from-purple-600 to-blue-500 px-1.5 py-0.5 rounded",children:"Listed"})]}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:(e.type||"brc-20").toUpperCase()})]})]})}),(0,t.jsx)(et.TableCell,{className:"p-2 text-right",children:(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:(0,eh.default)(e.overall_balance||e.amount)}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["~$",(0,t.jsx)(ec.default,{value:e.satoshiPrice>0?e.satoshiPrice/1e8*eE:null,format:e=>eJ(e),placeholder:e.balanceUSD,tint:!1})]})]})})]},l)})})}):(0,t.jsx)("div",{className:"flex flex-col items-center justify-center h-full py-8 text-center",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:tV?"No matches":"No tokens"})}),(0,t.jsx)(X.default,{hasMore:tO.length>g,itemCount:Math.min(tO.length,g),onLoadMore:()=>p(e=>e+48)})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-0 md:gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col h-[338px] border-y md:border border-border bg-chrome-muted dark:bg-transparent md:rounded-lg pt-5 px-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(tt,{}
1),"Sold Items"]}),(0,t.jsxs)(Q.Select,{value:L,onValueChange:e=>{j(48),T(e)},children:[(0,t.jsxs)(Q.SelectTrigger,{hideChevron:!0,className:"w-auto h-6 shrink-0 whitespace-nowrap bg-transparent border-border text-muted-foreground text-xs px-2 gap-1",children:[(0,t.jsx)(Q.SelectValue,{}),(0,t.jsx)(ta,{})]}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"recent",className:"text-foreground text-xs hover:bg-accent",children:"Recent"}),(0,t.jsx)(Q.SelectItem,{value:"amount",className:"text-foreground text-xs hover:bg-accent",children:"Amount"})]})]})]}),tf?(0,t.jsx)(es.Skeleton,{className:"h-10 w-20mb-3"}):(0,t.jsxs)("div",{className:"flex items-baseline justify-between mb-3",children:[(0,t.jsx)("p",{className:"text-3xl font-bold text-foreground",children:tW?.length||0}),tE>0&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Total: $",eJ(tE)]})]}),(0,t.jsxs)(J.ScrollArea,{className:"flex-1 min-h-0",children:[(0,t.jsx)(et.Table,{children:(0,t.jsxs)(et.TableBody,{children:[tW.slice(0,b).map((e,l)=>{let s=(e?.escrow?.satoshi_price||0)/1e8,a=eJ(s*eE),r=(0,eN.default)(e?.collection?.slug),o=r&&e5(e),n=r?e4(e):"",i=r?e2(e):"";return(0,t.jsxs)(et.TableRow,{className:"border-border hover:bg-accent/50 cursor-pointer",onClick:t=>{t.stopPropagation();let l=e?.collection?.slug,s=eb(l);s?eD.push(s):l&&S.default.emit("command",{command:{featured:!1,component:eI.default,name:r?n:e?.collection?.name||`#${e?.num||e?.number||"Unknown"}`,args:{slug:l},heading:r?"Token":"Collection"}})},children:[(0,t.jsx)(et.TableCell,{className:"p-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[r?(0,t.jsx)(ek.default,{collection:e.collection,className:"size-8 rounded-full",imageClassName:"size-8 rounded-full"}):e?.id?(0,t.jsx)(eL.default,{className:"size-8 rounded overflow-hidden",inscription:e,smallCard:!0}):(0,t.jsx)(ek.default,{collection:e.collection,className:"size-8",imageClassName:"size-8"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground truncate max-w-[100px]",children:r?n:e?.collection?.name||`#${e?.num||e?.number||"Unknown"}`}),r&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:i})]}),o&&(0,t.jsx)(eC.default,{})]})}),(0,t.jsx)(et.TableCell,{className:"p-2 text-right",children:(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsxs)("span",{className:"text-sm text-success font-medium",children:[s.toFixed(8)," BTC"]}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["$",a]})]})})]},l)}),0===tW.length&&!tf&&(0,t.jsx)(et.TableRow,{children:(0,t.jsx)(et.TableCell,{className:"py-4 text-center text-muted-foreground text-sm",children:"No sold items yet"})})]})}),(0,t.jsx)(X.default,{hasMore:tW.length>b,itemCount:Math.min(tW.length,b),onLoadMore:()=>j(e=>e+48)})]})]}),(0,t.jsxs)("div",{className:"contents lg:col-span-2 lg:grid lg:h-[338px] lg:min-h-0 lg:grid-cols-2 lg:grid-rows-[auto_auto_auto_minmax(0,1fr)] lg:gap-x-4",children:[(0,t.jsxs)(tc,{header:(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(e7,{}),"UTXOs"]}),(0,t.jsxs)(Q.Select,{value:K,onValueChange:e=>{N(48),G(e)},children:[(0,t.jsxs)(Q.SelectTrigger,{hideChevron:!0,className:"w-auto h-6 shrink-0 whitespace-nowrap bg-transparent border-border text-muted-foreground text-xs px-2 gap-1",children:[(0,t.jsx)(Q.SelectValue,{}),(0,t.jsx)(ta,{})]}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"highest",className:"text-foreground text-xs hover:bg-accent",children:"Biggest"}),(0,t.jsx)(Q.SelectItem,{value:"lowest",className:"text-foreground text-xs hover:bg-accent",children:"Smallest"})]})]})]}),value:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground mb-2 leading-relaxed",children:"UTXOs are like your money bills on Bitcoin. If you have many you can make many transactions quickly without waiting for change."}),eU?(0,t.jsx)(es.Skeleton,{className:"h-10 w-20mb-2"}):(0,t.jsx)("p",{className:"text-3xl font-bold text-foreground mb-2",children:eR?.utxo_count||0})]}),action:(0,t.jsx)("button",{onClick:r,type:"button",className:td(tv),children:"Manage your UTXOs"}),children:[0!==tP.length||eU?(0,t.jsx)(et.Table,{children:(0,t.jsx)(et.TableBody,{children:tP.slice(0,v).map((e,l)=>(0,t.jsxs)(et.TableRow,{className:"border-border hover:bg-accent/50 cursor-pointer",onClick:()=>window.open(`https://mempool.space/tx/${e.txid}`,"_blank"),children:[(0,t.jsx)(et.TableCell,{className:"p-2",children:(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:(e.value/1e8).toFixed(8)})}),(0,t.jsx)(et.TableCell,{className:"p-2 text-right",children:(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",eJ(e.value/1e8*eE)]})})]},l))})}):(0,t.jsx)("div",{className:"flex flex-col items-center justify-center h-full py-8 text-center",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No UTXOs"})}),(0,t.jsx)(X.default,{hasMore:tP.length>v,itemCount:Math.min(tP.length,v),onLoadMore:()=>N(e=>e+48)})]}),(0,t.jsxs)(tc,{header:(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(e6,{}),"BTC in inscriptions"]}),(0,t.jsxs)(Q.Select,{value:q,onValueChange:e=>{k(48),Z(e)},children:[(0,t.jsxs)(Q.SelectTrigger,{hideChevron:!0,className:"w-auto h-6 shrink-0 whitespace-nowrap bg-transparent border-border text-muted-foreground text-xs px-2 gap-1",children:[(0,t.jsx)(Q.SelectValue,{}),(0,t.jsx)(ta,{})]}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"highest",className:"text-foreground text-xs hover:bg-accent",children:"Biggest"}),(0,t.jsx)(Q.SelectItem,{value:"lowest",className:"text-foreground text-xs hover:bg-accent",children:"Smallest"})]})]})]}),value:eU?(0,t.jsx)(es.Skeleton,{className:"h-10 w-32mb-1"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-1 mb-1",children:[(0,t.jsx)("span",{className:"text-3xl font-bold text-foreground tracking-tight tabular-nums",children:tN||"0"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground font-medium",children:"BTC"})]}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mb-4",children:["≈ $",tw||"0.00"," held in inscriptions"]})]}),action:(0,t.jsx)("button",{onClick:()=>{S.default.emit("command",{command:{featured:!1,component:eI.default,name:"Manage Inscriptions",args:{slug:"frozen",tab:"refund"},heading:""}})},type:"button",className:td(tj),children:"Check unfreeze amount"}),children:[0!==tU.length||eU?(0,t.jsx)(et.Table,{children:(0,t.jsx)(et.TableBody,{children:tU.slice(0,w).map((e,l)=>{let s=(0,eN.default)(e?.collection?.slug),a=!!e?.escrow?.satoshi_price,r=s&&e5(e),o=s?e4(e):"",n=s?e2(e):"";return(0,t.jsxs)(et.TableRow,{className:"border-border hover:bg-accent/50 cursor-pointer",onClick:e=>{e.stopPropagation(),S.default.emit("command",{command:{featured:!1,component:eI.default,name:"Manage Inscriptions",args:{slug:"frozen",tab:"refund"},heading:""}})},children:[(0,t.jsx)(et.TableCell,{className:"p-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"size-8 rounded overflow-hidden flex-shrink-0",children:s?(0,t.jsx)(ek.default,{collection:e.collection,className:"size-8 rounded-full",imageClassName:"size-8 rounded-full"}):(0,t.jsx)(eL.default,{className:"size-8 object-cover",inscription:e,smallCard:!0})}),(0,t.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground truncate max-w-[100px]",children:s?o:e?.collection?.name||`#${e?.num||e?.number||"Unknown"}`}),e?._utxoGroupCount>1&&(0,t.jsxs)("span",{className:"text-[9px] text-warning bg-yellow-500/15 px-1.5 py-0.5 rounded",children:["×",e._utxoGroupCount]}),r&&(0,t.jsx)(eC.default,{}),a&&!r&&(0,t.jsx)("span",{className:"text-[9px] text-white bg-gradient-to-r from-purple-600 to-blue-500 px-1.5 py-0.5 rounded",children:"Listed"})]}),s&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n})]})]})}),(0,t.jsx)(et.TableCell,{className:"p-2 text-right",children:(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:((e?.outpoint?.sats||546)/1e8).toFixed(8)}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["$",eJ((e?.outpoint?.sats||546)/1e8*eE)]})]})})]},l)})})}):(0,t.jsx)("div",{className:"flex flex-col items-center justify-center h-full py-8 text-center",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:tj?"Open Unfreeze to review inscriptions":"No frozen balance"})}),(0,t.jsx)(X.default,{hasMore:tU.length>w,itemCount:Math.min(tU.length,w),onLoadMore:()=>k(e=>e+48)})]})]})]})]})})};var tx=e.i(793479),tm=e.i(776639),tf=e.i(532768),th=e.i(644114);let tg=e=>{let t="string"==typeof e?parseFloat(e):e;
1return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},tp=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,t.jsx)("path",{d:"m21 21-4.3-4.3"})]}),tb=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"})]}),tj=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"8",x2:"21",y1:"6",y2:"6"}),(0,t.jsx)("line",{x1:"8",x2:"21",y1:"12",y2:"12"}),(0,t.jsx)("line",{x1:"8",x2:"21",y1:"18",y2:"18"}),(0,t.jsx)("line",{x1:"3",x2:"3.01",y1:"6",y2:"6"}),(0,t.jsx)("line",{x1:"3",x2:"3.01",y1:"12",y2:"12"}),(0,t.jsx)("line",{x1:"3",x2:"3.01",y1:"18",y2:"18"})]}),tv=()=>(0,t.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M4.93 5.43C4.76 5.61 4.76 5.89 4.93 6.07C5.11 6.24 5.39 6.24 5.57 6.07L7.5 4.14L9.43 6.07C9.61 6.24 9.89 6.24 10.07 6.07C10.24 5.89 10.24 5.61 10.07 5.43L7.82 3.18C7.73 3.1 7.62 3.05 7.5 3.05C7.38 3.05 7.27 3.1 7.18 3.18L4.93 5.43ZM10.07 9.57C10.24 9.39 10.24 9.11 10.07 8.93C9.89 8.76 9.61 8.76 9.43 8.93L7.5 10.86L5.57 8.93C5.39 8.76 5.11 8.76 4.93 8.93C4.76 9.11 4.76 9.39 4.93 9.57L7.18 11.82C7.36 11.99 7.64 11.99 7.82 11.82L10.07 9.57Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),tN=["brc-20","tap","rune"],tw=({isMobile:e})=>{let s=u.default.getTaprootAddress(),a=(0,ey.default)(),[r,o]=l.default.useState("nft"),[n,i]=l.default.useState(()=>{{let e=localStorage.getItem("wallet-view-mode");if("grid"===e||"list"===e)return e}return"grid"}),[d,c]=l.default.useState(""),[x,m]=l.default.useState("floor-high"),[f,g]=l.default.useState("value-high"),[p,b]=l.default.useState(null),[j,v]=l.default.useState(null),[N,w]=l.default.useState("all"),[y,k]=l.default.useState("volume"),[L,T]=l.default.useState(96),[M,I]=l.default.useState(!1),[P,A]=l.default.useState(null),{data:B,isLoading:z}=(0,_.default)(),$=B?.inscriptions,{data:F,isLoading:U}=(0,ei.default)(),{data:W,isLoading:E}=(0,er.default)(s?`${h.API_URL}/wallet/${s}/inscriptions/activity?status=Sold`:null,em.fetcher),{exchangeRate:D}=(0,C.default)(),O=(0,ej.useRouter)(),{data:V}=(0,eu.default)(),{priceForSlug:K}=ev(),{data:G}=(0,er.default)(`${h.API_URL}/${h.COLLECTIONS_VERSION}?limit=500&order=VolumeTotalDesc`,em.fetcher),q=l.default.useMemo(()=>{let e=new Map;return G?.collections&&G.collections.forEach(t=>{t?.slug&&t?.volume_all_time&&e.set(t.slug,t.volume_all_time)}),e},[G]);l.default.useEffect(()=>{localStorage.setItem("wallet-view-mode",n)},[n]),l.default.useEffect(()=>{requestAnimationFrame(()=>{T(96)})},[r,d,p,j,x,f,N]);let Z=l.default.useMemo(()=>$?$.filter(e=>!h.NAMES_SLUGS.includes(e?.collection?.slug)&&!(0,eN.default)(e?.collection?.slug)&&!tN.includes(e?.collection?.slug)):[],[$]),H=l.default.useMemo(()=>$?$.filter(e=>h.NAMES_SLUGS.includes(e?.collection?.slug)):[],[$]),Y=l.default.useMemo(()=>W&&Array.isArray(W)?[...W].sort((e,t)=>new Date(t?.timestamp||0).getTime()-new Date(e?.timestamp||0).getTime()):[],[W]),J=l.default.useMemo(()=>{let e=new Set;for(let t of F||[])t?.collection?.slug&&e.add(t.collection.slug);for(let t of Z||[])t?.collection?.slug&&e.add(t.collection.slug);return[...e]},[F,Z]),ee=(0,ed.useMarks)(J),et=l.default.useCallback((e,t)=>(0,ed.lowerQuote)(e?ee[e]?.fair_sats:null,Number(t)||null)||0,[ee]),el=l.default.useMemo(()=>F?F.filter(e=>(e?.overall_balance||e?.amount||0)>0).map(e=>{let t=0,l="0.00",s=(V||[]).find(t=>t.slug===e?.collection?.slug),a=(0,ep.default)(e?.collection?.slug)?K(e?.collection?.slug):null;if((0,ep.default)(e?.collection?.slug)){let s=Number(e?.overall_balance);a&&Number.isFinite(s)&&s>0&&D&&(t=a*s/D*1e8,l=(0,ex.getSatoshiPriceUSD)(t,D))}else{let a=et(e?.collection?.slug,s?.floor_price_per);a&&e?.overall_balance&&(t=a*e.overall_balance,l=(0,ex.getSatoshiPriceUSD)(t,D)),a&&(0,eg.default)(s?.slug)&&(t=a*e.amount,l=(0,ex.getSatoshiPriceUSD)(t,D))}let r=q.get(e?.collection?.slug)||0,o=e?.collection?.slug||"",n="BRC-20";(0,eg.default)(o)?n="RUNE":(0,ep.default)(o)?n="ALKANES":o.includes("tap-")?n="TAP":"pow-20"===e.type?n="POW-20":e.type&&(n=e.type.toUpperCase());let i=s?{...e.collection,...s,icon:s.icon||e.collection?.icon}:e.collection;return{...e,collection:i,balanceUSD:l,satoshiPrice:t,volumeAllTime:r,protocol:n}}):[],[F,V,K,D,q,et]),ea=l.default.useMemo(()=>{let e=(0,tf.default)(Z,e=>e?.collection?.slug||"unknown"),t=[];for(let[l,s]of Object.entries(e)){let e=s[0]?.collection,a=q.get(l)||0,r=et(l,e?.floor_price);
1t.push({slug:l,name:e?.name||"Unknown",icon:e?.icon,collection:e,count:s.length,volume:a,floorPrice:r})}switch(y){case"count":return t.sort((e,t)=>t.count-e.count);case"floor":return t.sort((e,t)=>t.floorPrice-e.floorPrice);default:return t.sort((e,t)=>t.volume-e.volume)}},[Z,q,y,et]),eo=l.default.useMemo(()=>{let e=(0,tf.default)(el,e=>e.protocol),t=[];for(let[l,s]of Object.entries(e))t.push({protocol:l,count:s.length,totalValue:s.reduce((e,t)=>e+(t.satoshiPrice||0),0)});return t.sort((e,t)=>t.totalValue-e.totalValue)},[el]),en=l.default.useMemo(()=>{let e=(0,tf.default)(Y,e=>e?.collection?.slug||"unknown"),t=[];for(let[l,s]of Object.entries(e)){let e=s[0]?.collection,a=s.reduce((e,t)=>e+(t?.escrow?.satoshi_price||0),0);t.push({slug:l,name:e?.name||"Unknown",collection:e,count:s.length,totalSales:a})}return t.sort((e,t)=>t.totalSales-e.totalSales)},[Y]),ec=l.default.useMemo(()=>{let e=[];if("nft"===r){if(e=[...Z],p&&(e=e.filter(e=>(e?.collection?.slug||"unknown")===p)),"listed"===N?e=e.filter(e=>e?.escrow?.satoshi_price):"unlisted"===N&&(e=e.filter(e=>!e?.escrow?.satoshi_price)),d){let t=d.toLowerCase();e=e.filter(e=>e?.collection?.name?.toLowerCase().includes(t)||e?.meta?.name?.toLowerCase().includes(t)||(e?.num||e?.number)?.toString().includes(t)||e?.id?.toLowerCase().includes(t))}switch(x){case"floor-high":e.sort((e,t)=>et(t?.collection?.slug,t?.collection?.floor_price)-et(e?.collection?.slug,e?.collection?.floor_price));break;case"floor-low":e.sort((e,t)=>et(e?.collection?.slug,e?.collection?.floor_price)-et(t?.collection?.slug,t?.collection?.floor_price));break;case"volume-high":e.sort((e,t)=>(q.get(t?.collection?.slug)||0)-(q.get(e?.collection?.slug)||0));break;case"number-high":e.sort((e,t)=>(t?.num||t?.number||0)-(e?.num||e?.number||0));break;case"number-low":e.sort((e,t)=>(e?.num||e?.number||0)-(t?.num||t?.number||0))}}else if("tokens"===r){if(e=[...el],j&&(e=e.filter(e=>e.protocol===j)),"listed"===N?e=e.filter(e=>!!e?.escrow?.satoshi_price):"unlisted"===N&&(e=e.filter(e=>!e?.escrow?.satoshi_price)),d){let t=d.toLowerCase();e=e.filter(e=>e?.ticker?.toLowerCase().includes(t)||e?.collection?.name?.toLowerCase().includes(t))}switch(f){case"value-high":case"value-low":{let t="value-high"===f?-1:1,l=e=>Number(e.overall_balance||e.amount||0);e.sort((e,s)=>{let a=e.satoshiPrice>0?e.satoshiPrice:null,r=s.satoshiPrice>0?s.satoshiPrice:null;return null===a||null===r?null!==a?-1:null!==r?1:l(s)-l(e):a===r?l(s)-l(e):(a-r)*t});break}case"volume-high":e.sort((e,t)=>t.volumeAllTime-e.volumeAllTime);break;case"balance-high":e.sort((e,t)=>(t.overall_balance||t.amount||0)-(e.overall_balance||e.amount||0))}}else if("sns"===r){if(e=[...H],d){let t=d.toLowerCase();e=e.filter(e=>e?.meta?.name?.toLowerCase().includes(t))}}else if("sold"===r&&(e=[...Y],p&&(e=e.filter(e=>(e?.collection?.slug||"unknown")===p)),d)){let t=d.toLowerCase();e=e.filter(e=>e?.collection?.name?.toLowerCase().includes(t)||e?.meta?.name?.toLowerCase().includes(t)||(e?.num||e?.number)?.toString().includes(t))}return e},[et,r,Z,el,H,Y,p,j,d,x,f,N,q]),ef=e=>{if("nft"===r||"sns"===r)a({id:e.id,inscription:e});else if("tokens"===r){let t=e?.collection?.slug,l=eb(t);if(l)return void O.push(l);t&&S.default.emit("command",{command:{featured:!1,component:eI.default,name:(0,ep.default)(t)?e.ticker:t?.split("-")?.[1],args:{slug:t},heading:"Collections"}})}},ew=e=>{if("tokens"===r){let t=e?.collection?.slug,l=eb(t);if(l)return void O.push(l);t&&S.default.emit("command",{command:{featured:!1,component:eI.default,name:(0,ep.default)(t)?e.ticker:t?.split("-")?.[1],args:{slug:t},heading:"Collections"}})}else S.default.emit("command",{command:{featured:!1,component:eI.default,name:e?.collection?.name||`#${e?.num||e?.number||"Unknown"}`,args:{slug:e?.collection?.slug,tab:e?.escrow?.satoshi_price?"delist":"list",inscriptionId:e.id},heading:e?.escrow?.satoshi_price?"Manage Listing":"List for Sale"}})},eS="nft"===r?z:"tokens"===r?U:"sold"===r?E:z,e_=ec.slice(0,L),eC=ec.length>L;return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"border-b border-border sticky top-0 z-10 mt-8 md:mt-16 bg-background",children:[(0,t.jsx)("div",{className:"block md:hidden px-4 pt-4",children:(0,t.jsxs)("div",{className:"relative w-full",children:[(0,t.jsx)(tx.Input,{type:"text",placeholder:"Search...",value:d,onChange:e=>c(e.target.value),className:"pl-9 bg-transparent border-border text-foreground placeholder:text-muted-foreground h-9 w-full text-sm"}),(0,t.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:(0,t.jsx)(tp,{})})]})}),(0,t.jsxs)("div",{className:"px-4 md:pl-0 py-3 flex items-center gap-4 flex-wrap md:flex-nowrap",children:[(0,t.jsxs)("div",{className:"flex items-center h-9 border border-border rounded-md overflow-hidden",children:[(0,t.jsx)("button",{onClick:()=>{o("nft"),b(null),v(null)},className:`px-3 h-full text-xs font-medium transition-colors border-r border-border ${"nft"===r?"bg-white text-black":"bg-transparent text-muted-foreground hover:text-foreground"}`,children:"NFT"}),(0,t.jsx)("button",{onClick:()=>{o("tokens"),b(null),v(null)},className:`px-3 h-full text-xs font-medium transition-colors border-r border-border ${"tokens"===r?"bg-white text-black":"bg-transparent text-muted-foreground hover:text-foreground"}`,children:"Tokens"}),(0,t.jsx)("button",{onClick:()=>{o("sns"),b(null),v(null)},className:`px-3 h-full text-xs font-medium transition-colors border-r border-border ${"sns"===r?"bg-white text-black":"bg-transparent text-muted-foreground hover:text-foreground"}`,children:"SNS"}),(0,t.jsx)("button",{onClick:()=>{o("sold"),b(null),v(null)},className:`px-3 h-full text-xs font-medium transition-colors ${"sold"===r?"bg-white text-black":"bg-transparent text-muted-foreground hover:text-foreground"}`,children:"Sold"})]}),(0,t.jsxs)("div",{className:"relative hidden md:block w-48",children:[(0,t.jsx)(tx.Input,{type:"text",placeholder:"Search...",value:d,onChange:e=>c(e.target.value),className:"pl-9 bg-transparent border-border text-foreground placeholder:text-muted-foreground h-9 text-sm"}),(0,t.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:(0,t.jsx)(tp,{})})]}),"nft"===r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Q.Select,{value:x,onValueChange:e=>m(e),children:[(0,t.jsxs)(Q.SelectTrigger,{hideChevron:!0,className:"w-auto h-9 bg-transparent border-border text-muted-foreground px-3 gap-2 text-sm",children:[(0,t.jsx)(Q.SelectValue,{}),(0,t.jsx)(tv,{})]}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"floor-high",className:"text-foreground hover:bg-accent",children:"Floor: High to Low"}),(0,t.jsx)(Q.SelectItem,{value:"floor-low",className:"text-foreground hover:bg-accent",children:"Floor: Low to High"}),(0,t.jsx)(Q.SelectItem,{value:"volume-high",className:"text-foreground hover:bg-accent",children:"Volume: High to Low"}),(0,t.jsx)(Q.SelectItem,{value:"number-high",className:"text-foreground hover:bg-accent",children:"# High to Low"}),(0,t.jsx)(Q.SelectItem,{value:"number-low",className:"text-foreground hover:bg-accent",children:"# Low to High"})]})]}),(0,t.jsxs)(Q.Select,{value:N,onValueChange:e=>w(e),children:[(0,t.jsx)(Q.SelectTrigger,{className:"w-auto h-9 bg-transparent border-border text-muted-foreground px-3 gap-2 text-sm",children:(0,t.jsx)(Q.SelectValue,{})}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"all",className:"text-foreground hover:bg-accent",children:"Show All"}),(0,t.jsx)(Q.SelectItem,{value:"listed",className:"text-foreground hover:bg-accent",children:"Show Listed"}),(0,t.jsx)(Q.SelectItem,{value:"unlisted",className:"text-foreground hover:bg-accent",children:"Show Unlisted"})]})]})]}),"tokens"===r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Q.Select,{value:f,onValueChange:e=>g(e),children:[(0,t.jsxs)(Q.SelectTrigger,{hideChevron:!0,className:"w-auto h-9 bg-transparent border-border text-muted-foreground px-3 gap-2 text-sm",children:[(0,t.jsx)(Q.SelectValue,{}),(0,t.jsx)(tv,{})]}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"value-high",className:"text-foreground hover:bg-accent",children:"Value: High to Low"}),(0,t.jsx)(Q.SelectItem,{value:"value-low",className:"text-foreground hover:bg-accent",children:"Value: Low to High"}),(0,t.jsx)(Q.SelectItem,{value:"volume-high",className:"text-foreground hover:bg-accent",children:"Volume: High to Low"}),(0,t.jsx)(Q.SelectItem,{value:"balance-high",className:"text-foreground hover:bg-accent",children:"Balance: High to Low"})]})]}),(0,t.jsxs)(Q.Select,{value:N,onValueChange:e=>w(e),children:[(0,t.jsx)(Q.SelectTrigger,{className:"w-auto h-9 bg-transparent border-border text-muted-foreground px-3 gap-2 text-sm",children:(0,t.jsx)(Q.SelectValue,{})}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"all",className:"text-foreground hover:bg-accent",children:"Show All"}),(0,t.jsx)(Q.SelectItem,{value:"listed",className:"text-foreground hover:bg-accent",children:"Show Listed"}),(0,t.jsx)(Q.SelectItem,{value:"unlisted",className:"text-foreground hover:bg-accent",children:"Show Unlisted"})]})]})]}),(0,t.jsx)("div",{className:"flex-1 md:hidden"}),(0,t.jsxs)("div",{className:"flex items-center border border-border rounded overflow-hidden",children:[(0,t.jsx)("button",{onClick:()=>i("list"),className:`p-2 transition-colors ${"list"===n?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(tj,{})}),(0,t.jsx)("button",{onClick:()=>i("grid"),className:`p-2 transition-colors ${"grid"===n?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(tb,{})})]})]})]}),(0,t.jsx)("div",{className:"md:hidden px-4 py-3 border-b border-border",children:(0,t.jsxs)(Q.Select,{value:p||j||"all",onValueChange:e=>{"all"===e?(b(null),v(null)):"tokens"===r?v(e):b(e)},children:[(0,t.jsx)(Q.SelectTrigger,{className:"w-full h-9 bg-transparent border-border text-muted-foreground text-sm",children:(0,t.jsx)(Q.SelectValue,{placeholder:"tokens"===r?"All Protocols":"All Collections"})}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border max-h-64",children:[(0,t.jsx)(Q.SelectItem,{value:"all",className:"text-foreground hover:bg-accent",children:"tokens"===r?"All Protocols":"sold"===r?"All Sold Items":"All Collections"}),"nft"===r&&ea.map(e=>(0,t.jsxs)(Q.SelectItem,{value:e.slug,className:"text-foreground hover:bg-accent",children:[e.name," (",e.count,")"]},e.slug)),"tokens"===r&&eo.map(e=>(0,t.jsxs)(Q.SelectItem,{value:e.protocol,className:"text-foreground hover:bg-accent",children:[e.protocol," (",e.count,")"]},e.protocol)),"sold"===r&&en.map(e=>(0,t.jsxs)(Q.SelectItem,{value:e.slug,className:"text-foreground hover:bg-accent",children:[e.name," (",e.count,")"]},e.slug))]})]})}),(0,t.jsxs)("div",{className:"md:grid md:grid-cols-[256px_1fr] border-b border-border",children:[(0,t.jsx)("aside",{className:"hidden md:block border-l border-r border-border",children:(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:"tokens"===r?"Protocols":"sold"===r?"Sold Collections":"Collections"}),"nft"===r&&(0,t.jsxs)(Q.Select,{value:y,onValueChange:e=>k(e),children:[(0,t.jsxs)(Q.SelectTrigger,{hideChevron:!0,className:"size-auto bg-transparent border-0 text-muted-foreground text-[10px] p-0 gap-1 hover:text-foreground",children:[(0,t.jsx)(Q.SelectValue,{}),(0,t.jsx)(tv,{})]}),(0,t.jsxs)(Q.SelectContent,{className:"bg-card border-border",children:[(0,t.jsx)(Q.SelectItem,{value:"volume",className:"text-foreground text-xs hover:bg-accent",children:"Volume"}),(0,t.jsx)(Q.SelectItem,{value:"count",className:"text-foreground text-xs hover:bg-accent",children:"Count"}),(0,t.jsx)(Q.SelectItem,{value:"floor",className:"text-foreground text-xs hover:bg-accent",children:"Floor"})]})]})]}),"nft"===r&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("button",{onClick:()=>b(null),className:`w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm transition-colors ${!p?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50"}`,children:[(0,t.jsx)("span",{children:"All Collections"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:Z.length})]}),ea.map(e=>(0,t.jsxs)("button",{onClick:()=>b(e.slug),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors ${p===e.slug?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50"}`,children:[(0,t.jsx)(ek.default,{collection:e.collection,className:"size-6 rounded",imageClassName:"size-6 rounded"}),(0,t.jsx)("span",{className:"flex-1 truncate text-left",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.count})]},e.slug))]}),"tokens"===r&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("button",{onClick:()=>v(null),className:`w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm transition-colors ${!j?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50"}`,children:[(0,t.jsx)("span",{children:"All Protocols"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:el.length})]}),eo.map(e=>(0,t.jsxs)("button",{onClick:()=>v(e.protocol),className:`w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm transition-colors ${j===e.protocol?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50"}`,children:[(0,t.jsx)("span",{children:e.protocol}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.count})]},e.protocol))]}),"sns"===r&&(0,t.jsx)("div",{className:"text-sm text-muted-foreground px-3 py-2",children:"Your SNS names"}),"sold"===r&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("button",{onClick:()=>b(null),className:`w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm transition-colors ${!p?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50"}`,children:[(0,t.jsx)("span",{children:"All Sold Items"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:Y.length})]}),en.map(e=>(0,t.jsxs)("button",{onClick:()=>b(e.slug),className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors ${p===e.slug?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50"}`,children:[(0,t.jsx)(ek.default,{collection:e.collection,className:"size-6 rounded",imageClassName:"size-6 rounded"}),(0,t.jsx)("span",{className:"flex-1 truncate text-left",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.count})]},e.slug))]})]})})}),(0,t.jsxs)("div",{className:"p-4 md:p-6 min-w-0 border-r border-border",children:[eS?(0,t.jsx)("div",{className:"space-y-4",children:[...Array(6)].map((e,l)=>(0,t.jsx)(es.Skeleton,{className:"h-16 w-full"},l))}):0===ec.length?(0,t.jsxs)("div",{className:"text-center py-16",children:[(0,t.jsxs)("div",{className:"text-zinc-600 mb-2",children:["nft"===r&&(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-12 mx-auto mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,t.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,t.jsx)("path",{d:"m21 15-3.09-3.09a2 2 0 0 0-2.83 0L6 21"})]}),"tokens"===r&&(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-12 mx-auto mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"8"}),(0,t.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,t.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),"sns"===r&&(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-12 mx-auto mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap
1:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),(0,t.jsx)("circle",{cx:"12",cy:"7",r:"4"})]}),"sold"===r&&(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-12 mx-auto mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"}),(0,t.jsx)("path",{d:"M3 6h18"}),(0,t.jsx)("path",{d:"M16 10a4 4 0 0 1-8 0"})]})]}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:["nft"===r&&("listed"===N?"No listed NFTs":"unlisted"===N?"No unlisted NFTs":"No NFTs found"),"tokens"===r&&"No tokens found","sns"===r&&"No SNS names found","sold"===r&&"No sold items"]}),(0,t.jsx)("br",{}),(0,t.jsxs)("p",{className:"text-zinc-600 text-sm",children:["nft"===r&&"Your NFT inscriptions will appear here","tokens"===r&&"Your BRC-20, Runes, and other tokens will appear here","sns"===r&&"Your .sats and other name inscriptions will appear here","sold"===r&&"Items you've sold will appear here"]})]}):"list"===n?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 md:gap-x-4 mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground px-2 pb-2 border-b border-border",children:[(0,t.jsx)("span",{children:"Item"}),(0,t.jsx)("span",{children:"tokens"===r?"Balance":"Price"})]}),(0,t.jsxs)("div",{className:"hidden md:flex items-center justify-between text-[10px] text-muted-foreground px-2 pb-2 border-b border-border",children:[(0,t.jsx)("span",{children:"Item"}),(0,t.jsx)("span",{children:"tokens"===r?"Balance":"Price"})]})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 md:gap-x-4",children:e_.map((e,l)=>{let s=!!e?.escrow?.satoshi_price,a=s?(e.escrow.satoshi_price/1e8).toFixed(8):null,o=et(e?.collection?.slug,e?.collection?.floor_price),n=o?(o/1e8).toFixed(8):null,i=o?tg(o/1e8*D):null;return(0,t.jsxs)("div",{onClick:()=>ew(e),className:"flex items-center gap-2 p-2 cursor-pointer transition-colors hover:bg-accent/50 border-b border-border",role:"button",tabIndex:0,onKeyDown:(0,R.onKeyboardClick)(()=>ew(e)),children:[(0,t.jsx)("div",{className:"size-8 rounded overflow-hidden flex-shrink-0 cursor-pointer hover:opacity-80 transition-opacity",onClick:t=>{t.stopPropagation(),A(e),I(!0)},role:"button",tabIndex:0,onKeyDown:(0,R.onKeyboardClick)(t=>{t.stopPropagation(),A(e),I(!0)}),children:"tokens"===r||(0,eN.default)(e?.collection?.slug)?(0,t.jsx)(ek.default,{collection:e.collection,className:"size-8",imageClassName:"size-8"}):(0,t.jsx)(eL.default,{className:"size-8 object-cover",inscription:e,smallCard:!0})}),(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),ef(e)},className:"text-sm text-muted-foreground truncate hover:underline text-left max-w-[120px] md:max-w-[200px]",children:"tokens"===r||(0,eN.default)(e?.collection?.slug)?e.ticker?.toUpperCase()||e?.collection?.slug?.split("-")?.[1]?.toUpperCase()||e?.collection?.name:e?.meta?.name||e?.collection?.name||`#${e?.num||e?.number||"Unknown"}`}),"tokens"!==r&&!(0,eN.default)(e?.collection?.slug)&&(e?.num||e?.number)&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground leading-none",children:["#",e?.num||e?.number]}),(0,eN.default)(e?.collection?.slug)&&"sold"===r&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground leading-none",children:(0,eg.default)(e?.collection?.slug)?"RUNE":(0,ep.default)(e?.collection?.slug)?"ALKANES":e?.collection?.slug?.includes("tap-")?"TAP":"BRC-20"})]}),s&&"sold"!==r&&(0,t.jsx)("span",{className:"text-[9px] text-white bg-gradient-to-r from-purple-600 to-blue-500 px-1.5 py-0.5 rounded flex-shrink-0 self-center",children:"Listed"})]}),(0,t.jsx)("div",{className:"text-right flex-shrink-0 self-center",children:"tokens"===r?s?(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground leading-none",children:(e.escrow.satoshi_price/1e8).toFixed(8)}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground leading-none mt-0.5",children:[(0,eh.default)(e.overall_balance||e.amount)," listed"]})]}):(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground leading-none",children:(0,eh.default)(e.overall_balance||e.amount)}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground leading-none mt-0.5",children:["$",tg(e.balanceUSD)]})]}):"sold"===r&&e?.escrow?.satoshi_price?(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsx)("span",{className:"text-sm text-success leading-none",children:(e.escrow.satoshi_price/1e8).toFixed(8)}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground leading-none mt-0.5",children:["$",tg(e.escrow.satoshi_price/1e8*D)]})]}):s?(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground leading-none",children:a}),n&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground leading-none mt-0.5",children:["Floor: ",n]})]}):n?(0,t.jsxs)("div",{className:"flex flex-col items-end",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground leading-none",children:["~",n]}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground leading-none mt-0.5",children:["~$",i]})]}):(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"—"})})]},e.id||l)})})]}):(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-2 md:gap-4",children:e_.map((e,l)=>(0,t.jsxs)("div",{className:`rounded-lg border overflow-hidden transition-all duration-200 ease-in-out hover:-translate-y-0.5 hover:shadow-lg hover:shadow-black/20 ${e?.escrow?.satoshi_price&&"sold"!==r?"border-purple-500/50 bg-purple-500/5":"border-border hover:bg-accent/30"}`,children:[(0,t.jsxs)("div",{className:"aspect-square cursor-pointer relative",onClick:()=>ew(e),role:"button",tabIndex:0,onKeyDown:(0,R.onKeyboardClick)(()=>ew(e)),children:[e?.escrow?.satoshi_price&&"sold"!==r&&(0,t.jsx)("div",{className:"absolute top-2 left-2 px-2 py-0.5 bg-purple-600 text-white text-[10px] font-bold rounded",children:"LISTED"}),"tokens"===r||(0,eN.default)(e?.collection?.slug)?(0,t.jsx)(ek.default,{collection:e.collection,className:"size-full",imageClassName:"w-full h-full"}):(0,t.jsx)(eL.default,{className:"size-full object-cover",inscription:e,smallCard:!0})]}),(0,t.jsxs)("div",{className:"p-3 cursor-pointer",onClick:()=>ew(e),role:"button",tabIndex:0,onKeyDown:(0,R.onKeyboardClick)(()=>ew(e)),children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),ef(e)},className:"text-sm font-medium text-foreground truncate block hover:underline text-left w-full",children:"tokens"===r||(0,eN.default)(e?.collection?.slug)?e.ticker?.toUpperCase()||e?.collection?.slug?.split("-")?.[1]?.toUpperCase()||e?.collection?.name:e?.meta?.name||`#${e?.num||e?.number||"Unknown"}`}),(0,t.jsxs)("a",{href:e?.collection?.slug?`/collection/${e.collection.slug}`:void 0,onClick:e=>e.stopPropagation(),className:"text-xs text-muted-foreground truncate block hover:text-purple-700 dark:hover:text-purple-400 hover:underline text-left w-full mt-0.5",children:["tokens"===r||"sold"===r&&(0,eN.default)(e?.collection?.slug)?(0,eg.default)(e?.collection?.slug)?"RUNE":(0,ep.default)(e?.collection?.slug)?"ALKANES":e?.collection?.slug?.includes("tap-")?"TAP":e.protocol||"BRC-20":e?.collection?.name||"Inscription",(0,t.jsx)(th.default,{slug:e?.collection?.slug})]}),"tokens"===r?e?.escrow?.satoshi_price?(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("div",{className:"text-xs text-amber-400 font-medium",children:[(e.escrow.satoshi_price/1e8).toFixed(6)," BTC"]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,eh.default)(e.overall_balance||e.amount)," listed"]})]}):(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-0.5",children:[(0,t.jsx)("div",{className:"text-xs text-foreground font-medium",children:(0,eh.default)(e.overall_balance||e.amount)}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["$",tg(e.balanceUSD)]})]}):"sold"===r&&e?.escrow?.satoshi_price?(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("div",{className:"text-xs text-success",children:[(e.escrow.satoshi_price/1e8).toFixed(6)," BTC"]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["$",tg(e.escrow.satoshi_price/1e8*D)]})]}):e?.escrow?.satoshi_price?(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("div",{className:"text-xs text-amber-400",children:[(e.escrow.satoshi_price/1e8).toFixed(6)," BTC"]}),e?.collection?.floor_price&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Floor: ",(e.collection.floor_price/1e8).toFixed(6)]})]}):et(e?.collection?.slug,e?.collection?.floor_price)?(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("div",{className:"text-xs text-foreground",children:["~",(et(e?.collection?.slug,e?.collection?.floor_price)/1e8).toFixed(6)," BTC"]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["~$",tg(et(e?.collection?.slug,e?.collection?.floor_price)/1e8*D)]})]}):null]}),"nft"===r&&(0,t.jsx)("div",{className:"px-3 pb-3 flex gap-2",children:e?.escrow?.satoshi_price?(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),S.default.emit("command",{command:{featured:!1,component:eI.default,name:e?.collection?.name||`#${e?.num||e?.number||"Unknown"}`,args:{slug:e?.collection?.slug,tab:"delist",inscriptionId:e.id},heading:"Delist Item"}})},className:"flex-1 px-3 py-2 text-xs font-medium text-amber-400 bg-transparent hover:bg-amber-500/10 border border-amber-400 rounded-lg transition-colors text-center",children:"Delist"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),S.default.emit("command",{command:{featured:!1,component:eI.default,name:e?.collection?.name||`#${e?.num||e?.number||"Unknown"}`,args:{slug:e?.collection?.slug,tab:"list",inscriptionId:e.id},heading:"List for Sale"}})},className:"flex-1 px-3 py-2 text-xs font-medium text-white bg-purple-600 hover:bg-purple-500 rounded-lg transition-colors text-center",children:"List"}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),S.default.emit("command",{command:{featured:!1,component:eI.default,name:e?.collection?.name||`#${e?.num||e?.number||"Unknown"}
1`,args:{slug:e?.collection?.slug,tab:"send",inscriptionId:e.id},heading:"Transfer"}})},className:"flex-1 px-3 py-2 text-xs font-medium text-muted-foreground bg-accent hover:bg-accent/80 rounded-lg transition-colors text-center",children:"Send"})]})})]},e.id||l))}),(0,t.jsx)(X.default,{hasMore:eC,itemCount:e_.length,onLoadMore:()=>T(e=>e+96)})]})]}),(0,t.jsx)(tm.Dialog,{open:M,onOpenChange:I,children:(0,t.jsx)(tm.DialogContent,{className:"sm:max-w-[500px] p-0 bg-transparent border-0",children:P&&(0,t.jsx)(eL.default,{className:"size-full max-h-[80vh] object-contain rounded-lg",inscription:P})})})]})};var ty=e.i(820134),tS=e.i(71269),t_=e.i(27613),tk=e.i(424539),tC=e.i(772401),tL=e.i(721291),tT=e.i(367692),tM=e.i(106990);let tI=e=>{let{data:a,isLoading:o}=(0,er.default)(`${h.API_URL}/wallet/${u.default.balanceAddress()}/all-utxos`,em.fetcher),{handleModalClose:n}=e,[i,d]=l.default.useState(1),[c,x]=l.default.useState(new Set),[m,f]=l.default.useState(2),[g,p]=l.default.useState(null),[b,j]=l.default.useState(0),[v,N]=l.default.useState(0),[w,_]=l.default.useState(!1),[k,L]=l.default.useState(0),[T,I]=l.default.useState("smallest"),[P,A]=l.default.useState(!1),B=l.default.useRef(null),z=(0,F.default)(m,300),U=(0,F.default)(b,300),{exchangeRate:W}=(0,C.default)(),[E,D]=l.default.useState(""),{data:O}=(0,eD.default)();l.default.useEffect(()=>{if(O?.hourFee){let e=O?.minimumFee||5;requestAnimationFrame(()=>{j(O.hourFee<e?e:parseInt(O.hourFee.toFixed(0),10))})}},[O]);let V=O?.minimumFee||5,K=O?.fastestFee?2*parseInt(O.fastestFee.toFixed(0),10):500,G=b<=(O?.economyFee||10)?"Slow":b<=(O?.halfHourFee||30)?"Medium":"Fast",q=l.default.useMemo(()=>(a?.utxos||[])?.sort((e,t)=>"biggest"===T?t.value-e.value:e.value-t.value).map(e=>({...e,outpoint:`${e.txid}:${e.vout}`})),[a,T]),{selectedUtxos:Z,inputSats:H}=l.default.useMemo(()=>{let e=Array.from(c?.values()||[]).map(e=>q.find(t=>t.outpoint===e)),t=e.reduce((e,t)=>t.value+e,0);return{selectedUtxos:e,inputSats:t}},[c,q]),X=l.default.useCallback(e=>{if(c.has(e)){let t=new Set(c);t.delete(e),x(t),L(t.size)}else{let t=new Set(c).add(e);x(t),L(t.size)}},[c]),Y=l.default.useCallback(([e])=>{L(e);let t=new Set;for(let l=0;l<e&&l<q.length;l++)t.add(q[l].outpoint);x(t)},[q]),J=l.default.useCallback(e=>{I(e),A(!1)},[]);l.default.useEffect(()=>{if(!P)return;let e=e=>{B.current&&!B.current.contains(e.target)&&A(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[P]),l.default.useEffect(()=>{if(k>0&&q.length>0){let e=new Set;for(let t=0;t<k&&t<q.length;t++)e.add(q[t].outpoint);requestAnimationFrame(()=>{x(e)})}},[k,T,q]),l.default.useEffect(()=>{if(!Z.length&&q.length>0){let e=q[0];e&&requestAnimationFrame(()=>{x(new Set().add(e.outpoint)),L(1)})}},[Z.length,q]),l.default.useEffect(()=>{!async function(){_(!0);try{if(!Z.length)return;let e={outputs:Array(parseInt(z,10)).fill("").map(e=>[u.default.balanceAddress(),"BTC"===h.NETWORK?546:1e6]),public_key:u.default.getPublicKey(),from:u.default.balanceAddress(),utxos:Z.map(e=>[e.txid,e.vout,e.value]),fee_rate:U,purpose:"utxo_split"},{data:t}=await y.default.post(`${h.API_URL}/wallet/build`,e),l=parseInt(Math.floor((H-t.fees)/z).toFixed(0),10);N(t.fees),p(l)}catch(e){console.log(e)}_(!1)}()},[z,U,Z,H]);let[Q,ee]=l.default.useState(!1),et=l.default.useCallback(async()=>{ee(!0);try{let e={outputs:Array(m).fill("").map(()=>[E||u.default.balanceAddress(),"BTC"===h.NETWORK?546:1e6]),public_key:u.default.getPublicKey(),from:u.default.balanceAddress(),utxos:Z.map(e=>[e.txid,e.vout,e.value]),fee_rate:b,purpose:"utxo_split"},{data:t}=await y.default.post(`${h.API_URL}/wallet/build`,e),{rawtx:l}=await u.default.signInscribe(t.psbt);n(),S.default.emit("open-broadcast-modal",{type:"send",address:E||u.default.balanceAddress(),rawtx:l,psbt:t.psbt})}catch(e){u.default.handleError(e)}finally{ee(!1)}},[E,m,b,n,Z]),el=l.default.useCallback(async e=>{D(e.target.value)},[]),es=l.default.useCallback(e=>{let t=parseInt(e.target.value,10);isNaN(t)||t<1?f(1):f(t)},[]),ea=l.default.useCallback(e=>{let t=parseInt(e.target.value,10);isNaN(t)||j(Math.max(V,Math.min(t,1e3)))},[V]);return 1===i?(0,t.jsxs)("div",{className:"w-full max-w-[400px] flex flex-col gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-foreground",children:"Select UTXOs to split"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Split large UTXOs into smaller ones to make multiple purchases at once, or consolidate small UTXOs into fewer, larger ones."})]}),q.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[c.size,"/",q.length]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(tT.Slider,{defaultValue:[k],value:[k],max:q.length,step:1,onValueChange:Y,className:"[&_[role=slider]]:size-3.5"})}),(0,t.jsxs)("div",{className:"relative shrink-0",ref:B,children:[(0,t.jsxs)("button",{onClick:()=>A(!P),className:"flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground bg-transparent border border-border rounded-md hover:border-border transition-colors",children:["biggest"===T?"Biggest":"Smallest",(0,t.jsx)(tL.ChevronDown,{className:(0,r.default)("size-3 transition-transform",P&&"rotate-180")}
1)]}),P&&(0,t.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-card border border-border rounded-md shadow-lg overflow-hidden min-w-[120px]",children:[(0,t.jsx)("button",{onClick:()=>J("biggest"),className:(0,r.default)("w-full text-left px-3 py-1.5 text-xs transition-colors","biggest"===T?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:"Biggest first"}),(0,t.jsx)("button",{onClick:()=>J("smallest"),className:(0,r.default)("w-full text-left px-3 py-1.5 text-xs transition-colors","smallest"===T?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:"Smallest first"})]})]})]}),(0,t.jsxs)("div",{className:"max-h-[300px] overflow-y-auto rounded-lg border border-border",children:[q.map(e=>{let l=c.has(e.outpoint),s=W?(e.value/1e8*W).toFixed(2):"0";return(0,t.jsxs)("div",{onClick:()=>X(e.outpoint),className:(0,r.default)("flex items-center justify-between px-3 py-2 cursor-pointer transition-colors border-b border-border/50 last:border-b-0",l?"bg-violet-500/10":"hover:bg-accent/50"),role:"button",tabIndex:0,onKeyDown:(0,R.onKeyboardClick)(()=>X(e.outpoint)),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[l?(0,t.jsx)(tC.CircleCheck,{className:"size-4 stroke-violet-500 shrink-0"}):(0,t.jsx)(tk.CirclePlus,{className:"size-4 stroke-zinc-500 shrink-0"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(eT.default,{className:"size-3 text-orange-500"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:(0,$.formatSatoshis)(e.value)})]})]}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["$",s]})]},e.outpoint)}),o&&(0,t.jsx)("div",{className:"flex justify-center py-4",children:(0,t.jsx)("div",{className:"size-4 border-2 border-foreground
1/20 border-t-foreground rounded-full animate-spin"})})]}),(0,t.jsxs)(M.default,{className:"w-full",disabled:!Z.length,onClick:()=>d(0),children:["Select ",Z.length," UTXO",1!==Z.length?"s":""]}),(0,t.jsx)("button",{className:"text-sm text-muted-foreground hover:text-muted-foreground transition-colors",onClick:n,children:"Cancel"})]}):(0,t.jsxs)("div",{className:"w-full max-w-[400px] flex flex-col gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-foreground",children:"Create UTXOs"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your inputs will create multiple outputs. Add outputs to split transactions at the desired UTXO size."})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:"Selected Inputs"}),(0,t.jsx)("button",{onClick:()=>d(1),className:"text-violet-700 dark:text-violet-400 hover:text-violet-700 dark:text-violet-300 transition-colors",children:(0,t.jsx)(tM.default,{className:"size-4"})})]}),(0,t.jsx)("div",{className:"max-h-[150px] overflow-y-auto",children:Z?.map(e=>{let l=W?(e.value/1e8*W).toFixed(2):"0";return(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50 last:border-b-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(eT.default,{className:"size-3 text-orange-500"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:(0,$.formatSatoshis)(e.value)})]}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["$",l]})]},e.outpoint)})})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-border",children:[(0,t.jsx)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50",children:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:"Outputs"})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border/50",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(tT.Slider,{defaultValue:[m],value:[Math.min(m,10)],min:1,max:10,step:1,onValueChange:([e])=>f(e),className:"[&_[role=slider]]:size-3.5"})}),(0,t.jsx)("input",{type:"number",min:1,value:m,onChange:es,className:"w-12 h-7 text-center text-xs font-medium text-foreground bg-background border border-border rounded focus:outline-none focus:border-border transition-colors [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"})]}),(0,t.jsx)("div",{className:"max-h-[150px] overflow-y-auto",children:Array(m).fill("").map((e,l)=>{let s=W&&g?(g/1e8*W).toFixed(2):"0";return(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50 last:border-b-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(eT.default,{className:"size-3 text-orange-500"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:g?(0,$.formatSatoshis)(g):"—"})]}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["$",s]})]},l)})})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:"Network Fee"}),(0,t.jsx)("span",{className:(0,r.default)("text-[10px] font-medium","Slow"===G?"text-destructive":"Medium"===G?"text-warning":"text-success"),children:G})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border/50",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(tT.Slider,{defaultValue:[b],value:[b],min:V,max:K,step:1,onValueChange:([e])=>j(e),className:"[&_[role=slider]]:size-3.5"})}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,t.jsx)("input",{type:"number",min:V,max:1e3,value:b,onChange:ea,className:"w-12 h-7 text-center text-xs font-medium text-foreground bg-background border border-border rounded focus:outline-none focus:border-border transition-colors [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"sat/vB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Total Fee"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eT.default,{className:"size-3 text-orange-500"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:(0,$.formatSatoshis)(v)}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["($",W?(v/1e8*W).toFixed(2):"0",")"]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("input",{className:"w-full h-9 px-3 text-xs font-medium text-foreground bg-background border border-border rounded-full placeholder:text-muted-foreground focus:outline-none focus:border-border transition-colors",placeholder:"Send to address (optional)",value:E,onChange:el}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground px-1",children:"If not specified, sends to your connected wallet."})]}),(0,t.jsxs)("p",{className:"text-[10px] text-zinc-600 px-1",children:['By clicking "Create UTXOs", you agree to the Ordinals Wallet'," ",(0,t.jsx)(s.default,{href:"/terms",className:"underline whitespace-nowrap",target:"_blank",children:"Terms of Service."})]}),(0,t.jsx)(M.default,{className:"w-full",disabled:Q||w,onClick:et,children:Q?"Creating...":w?"Bu
1ilding...":"Create UTXOs"}),(0,t.jsx)("button",{className:"text-sm text-muted-foreground hover:text-muted-foreground transition-colors",onClick:()=>d(1),children:"Go Back"})]})};var tP=e.i(998031),tA=e.i(671631),tB=e.i(835827);function tz({open:e,largestSats:s,btcUsd:a,onInteract:r,onDone:o,onLater:n,manager:i}){let d=(s/1e8).toLocaleString("en-US",{maximumFractionDigits:8}),c=a?(s/1e8*a).toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}):null,u=l.default.useRef(!1),x=()=>{u.current||(u.current=!0,r?.())};return(0,t.jsx)(tm.Dialog,{open:e,onOpenChange:e=>e?void 0:n(),children:(0,t.jsxs)(tm.DialogContent,{className:"max-h-[92dvh] max-w-lg gap-0 overflow-y-auto p-0 focus:outline-none focus-visible:outline-none","data-testid":"split-prompt",onOpenAutoFocus:e=>e.preventDefault(),children:[(0,t.jsxs)("header",{className:"px-5 pb-4 pt-5 sm:px-6",children:[(0,t.jsx)(tm.DialogTitle,{className:"text-base font-semibold text-foreground",children:"Split your largest UTXO"}),(0,t.jsxs)("p",{className:"mt-3 flex flex-wrap items-baseline gap-x-2 tabular-nums",children:[(0,t.jsx)("span",{className:"text-3xl font-semibold tracking-tight text-foreground",children:c??`${d} BTC`}),c&&(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[d," BTC"]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"in one UTXO"})]}),(0,t.jsx)(tm.DialogDescription,{className:"mt-2 max-w-[60ch] text-sm leading-relaxed text-muted-foreground",children:"Each purchase spends a whole UTXO, and its change waits about 10 minutes for a confirmation. Smaller pieces let you buy several items back to back. Your bitcoin stays in your wallet."})]}),(0,t.jsx)("div",{className:"border-t border-border",onPointerDownCapture:x,onKeyDownCapture:x,children:i??(0,t.jsx)(tB.default,{onClose:o,onNavigate:()=>{},args:{embedded:!0}})}),(0,t.jsxs)("footer",{className:"flex items-center justify-between border-t border-border px-5 py-3 sm:px-6",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"We'll ask again in a week."}),(0,t.jsx)("button",{type:"button",onClick:n,className:"rounded-md px-2 py-1 text-sm font-medium text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Not now"})]})]})})}var t$=e.i(369929);function tF(){let e=l.default.useMemo(()=>{try{return u.default.balanceAddress()||null}catch{return null}},[]),s=l.default.useMemo(()=>{try{return u.default.getTaprootAddress()||null}catch{return null}},[]),a=l.default.useMemo(()=>{try{return String(u.default.type()||"")}catch{return""}},[]),{data:r}=(0,er.default)(e?`${h.API_URL}/wallet/${e}/all-utxos`:null,em.fetcher,{revalidateOnFocus:!1}),{isAdmin:o}=(0,tA.useAdminCheck)(s),{exchangeRate:n}=(0,C.default)(),i=l.default.useMemo(()=>r?(0,t$.measureUtxos)(r.utxos):null,[r]),[d,c]=l.default.useState(!1),x=l.default.useRef(!1);return(l.default.useEffect(()=>{e&&i&&(0,t$.claimDailyMeasure)(e)&&(0,t$.recordSplitPrompt)("measured",e,i,{wallet:a})},[e,i,a]),l.default.useEffect(()=>{if(!e||!i||x.current)return;let t="1"===new URLSearchParams(window.location.search).get("split_prompt"),l=(0,t$.isSplitPromptTester)(s);if(!(t||l||o||(0,tP.default)(t$.SPLIT_PROMPT_FLAG))||!(t||l?i.largestSats>0:(0,t$.shouldPromptSplit)(i,(0,t$.thresholdSats)(n)))||!t&&((0,t$.wasSeenLocally)(e)||(0,t$.isSnoozed)(e)))return;x.current=!0;let r=!1;return(async()=>{if(!t&&await (0,t$.wasSeenRemotely)(e))return(0,t$.markSeen)(e);r||((0,t$.markSeen)(e),c(!0),(0,t$.recordSplitPrompt)("shown",e,i,{wallet:a}))})(),()=>{r=!0}},[e,i,o,a,n,s]),e&&i)?(0,t.jsx)(tz,{open:d,largestSats:i.largestSats,btcUsd:n,onInteract:()=>{(0,t$.recordSplitPrompt)("clicked",e,i,{wallet:a}),(0,t$.markSplitFromPrompt)(e)},onDone:()=>c(!1),onLater:()=>{(0,t$.recordSplitPrompt)("dismissed",e,i,{wallet:a}),(0,t$.snooze)(e),c(!1)}}):null}let tR="wallet-tabs";e.s(["default",0,e=>{let[r,o]=l.default.useState(!1),[n,i]=l.default.useState(0);l.default.useEffect(()=>{window.scrollTo(0,0)},[]);let[d]=(0,H.default)(),c=l.default.useCallback(()=>{S.default.emit("command",{id:"manage-utxos"})},[]),u=l.default.useCallback(()=>{o(!0),i(+(1!==n))},[n]),x=l.default.useCallback(()=>{S.default.emit("command",{id:"manage-utxos"})},[]),m=l.default.useCallback(()=>{o(!0),i(3*(3!==n))},[n]);(0,Z.default)(),l.default.useEffect(()=>{let e=e=>{"send"===e.type&&"success"===e.event&&i(0)};return S.default.listen("open-broadcast-modal",e),()=>{S.default.removeListener("open-broadcast-modal",e)}},[]);let f=()=>{o(!1),i(0)};return(0,t.jsx)(tS.default,{children:(0,t.jsxs)(t_.default,{children:[(0,t.jsxs)("div",{className:a.default.root,children:[(0,t.jsx)(tu,{openTab:(e,t)=>
1{document.getElementById(tR)?.scrollIntoView({behavior:"smooth"})},toggleSignMessage:m,toggleSendCoin:x,toggleRecieveCoin:u,toggleTopupModal:d,toggleManageUtxos:c}),(0,t.jsx)("div",{id:tR,children:(0,t.jsx)(tw,{isMobile:e.isMobile})}),(0,t.jsx)(tF,{}),(0,t.jsx)("div",{className:a.default.legacyLink,children:(0,t.jsx)(s.default,{href:"/legacy-wallet",children:"Switch to legacy wallet"})})]}),(0,t.jsxs)(ty.default,{open:r,onClose:f,bodyClassName:a.default.modal,ariaLabel:1===n?"Receive or swap to Bitcoin":void 0,children:[2===n&&(0,t.jsx)(E,{handleModalClose:f}),1===n&&(0,t.jsx)(b,{handleModalClose:f}),3===n&&(0,t.jsx)(q,{handleModalClose:f}),4===n&&(0,t.jsx)(tI,{handleModalClose:f})]})]})})}],165810)}]);
2
3//# sourceMappingURL=0xly5t_phgmt7.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.