import{d as N,b as P,o as I,i as n,c as a,L as k,e as f,f as D,s as R,t as x,r as L}from"./Logo1am-CaBWyNpM.js";import"./_virtual_wxt-plugins-CDnz5Vh6.js";var q=x('<div style=flex:1;display:flex;flex-direction:column;justify-content:center;padding:24px><div style="background:var(--bg-primary);border-radius:12px;border:1px solid var(--border-secondary);overflow:hidden"><div style=padding:24px;text-align:center><div style="width:56px;height:56px;border-radius:12px;background:var(--bg-primary-solid);display:flex;align-items:center;justify-content:center;margin:0 auto 16px"></div><p style="font-family:var(--font-display);font-size:16px;font-weight:600;color:var(--text-primary);margin:0 0 4px"></p><p style=font-size:13px;color:var(--text-placeholder);margin:0></p></div><div style="padding:0 24px 24px"><div style=padding:12px;border-radius:8px;font-size:12px;line-height:1.5></div></div><div style="display:flex;gap:12px;padding:0 24px 24px"><button style="flex:1;height:44px;border-radius:8px;border:1px solid var(--border-secondary);background:var(--bg-primary);font-size:14px;font-weight:500;color:var(--text-tertiary);cursor:pointer">Reject</button><button style=flex:1;height:44px;border-radius:8px;border:none;background:var(--text-primary);font-size:14px;font-weight:500;color:var(--fg-white);cursor:pointer>'),O=x('<div style=min-height:100vh;background:var(--bg-tertiary);font-family:var(--font-body);display:flex;flex-direction:column><div style="background:var(--bg-primary-solid);padding:16px 20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border-secondary)"><span style=font-family:var(--font-display);font-size:12px;color:var(--color-grey-dark-400);text-transform:uppercase;letter-spacing:0.05em>'),z=x("<div style=flex:1;display:flex;align-items:center;justify-content:center;color:var(--text-placeholder);font-size:14px>No approval request found");const M=()=>{const[s,l]=P(null),[d,E]=P(!1);I(()=>{(async()=>{const e=new URLSearchParams(window.location.hash.slice(1)),r=e.get("requestId"),i=e.get("responseToken")||e.get("nonce"),p=e.get("networkId")||void 0;if(!r||!i){l(null);return}try{const c=await chrome.runtime.sendMessage({type:"GET_PENDING_APPROVAL",requestId:r,responseToken:i}),t=c?.approval;if(!c?.success||!t?.requestId||!t.responseToken){l(null);return}l({requestId:t.requestId,responseToken:t.responseToken,type:t.type||"Approval Request",origin:t.origin||"Unknown",networkId:p})}catch{l(null)}})()});const b=e=>{const r=s();!r||d()||(E(!0),chrome.runtime.sendMessage({type:"WALLET_RESPONSE",requestId:r.requestId,responseToken:r.responseToken,data:{success:e}}),setTimeout(()=>window.close(),300))},u=()=>s()?.type==="DAPP_CONNECT_APPROVAL",m=()=>{switch(s()?.type){case"DAPP_CONNECT_APPROVAL":return"Connection Request";case"DAPP_SIGN_DATA":return"Sign Data";case"DAPP_MAKE_TRANSFER":return"Send Tokens";case"DAPP_MAKE_INTENT":return"Create Transaction";case"DAPP_BALANCE_UNSEALED_TX":case"DAPP_BALANCE_SEALED_TX":return"Balance Transaction";case"DAPP_SUBMIT_TRANSACTION":return"Submit Transaction";default:return"Approval Request"}};return(()=>{var e=O(),r=e.firstChild,i=r.firstChild;return n(r,a(k,{class:"h-5 w-auto",animated:!0}),i),n(i,m),n(e,a(f,{get when(){return s()},get fallback(){return z()},get children(){var p=q(),c=p.firstChild,t=c.firstChild,h=t.firstChild,_=h.nextSibling,S=_.nextSibling,A=t.nextSibling,g=A.firstChild,C=A.nextSibling,v=C.firstChild,y=v.nextSibling;return n(h,a(k,{class:"h-6 w-auto"})),n(_,m),n(S,()=>s().origin),n(g,a(f,{get when(){return u()},children:"This site wants to connect to your 1AM wallet. It will be able to view your balances and addresses."}),null),n(g,a(f,{get when(){return!u()},children:"This action may spend funds from your wallet. Only approve if you trust this site."}),null),v.$$click=()=>b(!1),y.$$click=()=>b(!0),n(y,()=>d()?"Done":"Approve"),D(o=>{var $={...u()?{background:"var(--bg-tertiary)",color:"var(--text-tertiary)"}:{background:"var(--bg-warning-primary)",color:"var(--text-warning-primary)",border:"1px solid color-mix(in srgb, var(--warning-foreground) 30%, transparent)"}},w=d(),T=d();return o.e=R(g,$,o.e),w!==o.t&&(v.disabled=o.t=w),T!==o.a&&(y.disabled=o.a=T),o},{e:void 0,t:void 0,a:void 0}),p}}),null),e})()};N(["click"]);const B=document.getElementById("root");L(()=>a(M,{}),B);
