Panic-EODV0Eb_.js

4.2 KB · raw

1import{A as e,D as t,E as n,T as r,_ as i,g as a,k as o,m as s,t as c,w as l,x as u,y as d}from"./index-9Uuo-ckB.js";import{t as f}from"./RuneCanvas-CMSEYJAb.js";var p=u(`<div class=peach-overlay-header><button class="peach-btn peach-btn--ghost peach-btn--sm peach-icon-btn"aria-label=Back><svg width=7 height=12 viewBox="0 0 7 12"fill=none stroke=currentColor stroke-width=1.1 stroke-linecap=round stroke-linejoin=round><path d="M6 1L1 6L6 11"></path></svg></button><span class=peach-overlay-title></span><div class=peach-overlay-spacer>`),m=u(`<div class=peach-panic><h2 class=peach-panic-title>Before you destroy your vault</h2><p class=peach-panic-body>Once destroyed, your vault cannot be recovered. Ever. There is no undo, no support ticket, no way back.</p><p class=peach-panic-body>If you haven't already, export your vault now. It takes ten seconds and you'll be glad you did.</p><button class="peach-panic-button peach-panic-button--primary">Export my vault first</button><div class=peach-panic-divider></div><p class=peach-panic-body>I have already exported my vault or I don't want to.</p><button class=peach-panic-link>Continue to destruction →`),h=u(`<div class="peach-panic peach-panic-step2"><span class=peach-panic-icon aria-hidden=true>⚠</span><h2 class="peach-panic-title peach-panic-title--severe">This will permanently destroy your vault.</h2><p class="peach-panic-body peach-panic-body--severe">Every password, card, passkey, note, and setting will be wiped from this device. This cannot be undone.</p><p class=peach-panic-confirm-label>Type DESTROY to confirm:</p><input class=peach-panic-confirm-input type=text autocomplete=off autocapitalize=off aria-label="Type DESTROY to confirm"><div class=peach-panic-actions><button class="peach-panic-button peach-panic-button--danger">Yes, destroy my vault</button><button class="peach-panic-button peach-panic-button--ghost">Cancel — keep my vault`),g=u(`<button class="peach-panic-button peach-panic-button--ghost">No — take me back`),_=u(`<div class="peach-panic peach-panic-step3"><div class=peach-panic-rune-bg aria-hidden=true></div><div class=peach-panic-bar>THIS IS YOUR LAST CHANCE</div><p class="peach-panic-body peach-panic-body--final-intro">Your vault is about to be permanently destroyed.</p><p class="peach-panic-body peach-panic-body--final">There is no recovery.<br>There is no support.<br>There is no undo.</p><div class=peach-panic-divider></div><div class=peach-panic-actions><button class=peach-panic-final-button>`),v=u(`<div class="peach-overlay-view ov-enter-right"style=display:flex;flex-direction:column>`),y=Array.from({length:80},(e,t)=>String.fromCodePoint(57344+(t*19+7)%256)).join(``);function b(e){return(()=>{var t=p(),n=t.firstChild,r=n.nextSibling;return s(n,`click`,e.onBack,!0),i(r,()=>e.title),t})()}function x(a){let[s,u]=e(1),[p,x]=e(``),[S,C]=e(!1),w=()=>p()===`DESTROY`;async function T(){if(!S()){if(C(!0),!(await c({type:`DESTROY_VAULT`}))?.ok){C(!1);return}await a.onDestroyed()}}return(()=>{var e=v();return i(e,t(n,{get children(){return[t(l,{get when(){return s()===1},get children(){return[t(b,{title:`danger zone`,get onBack(){return a.onCancel}}),(()=>{var e=m(),t=e.firstChild.nextSibling.nextSibling.nextSibling,n=t.nextSibling.nextSibling.nextSibling;return t.$$click=()=>a.onOpenExport(),n.$$click=()=>u(2),e})()]}}),t(l,{get when(){return s()===2},get children(){var e=h(),t=e.firstChild.nextSibling.nextSibling.nextSibling.nextSibling,n=t.nextSibling.firstChild,r=n.nextSibling;return t.$$input=e=>x(e.currentTarget.value),d(t,`spellcheck`,!1),n.$$click=()=>u(3),r.$$click=()=>{x(``),a.onCancel()},o(e=>{var r=!!w(),i=!w();return r!==e.e&&t.classList.toggle(`peach-panic-confirm-input--match`,e.e=r),i!==e.t&&(n.disabled=e.t=i),e},{e:void 0,t:void 0}),o(()=>t.value=p()),e}}),t(l,{get when(){return s()===3},get children(){var e=_(),n=e.firstChild,a=n.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling,s=a.firstChild;return i(n,t(f,{runeString:y,width:320,height:480})),s.$$click=()=>void T(),i(s,()=>S()?`Destroying…`:`Destroy my vault forever`),i(a,t(r,{get when(){return!S()},get children(){var e=g();return e.$$click=()=>{x(``),u(1)},e}}),null),o(()=>s.disabled=S()),e}})]}})),e})()}a([`click`,`input`]);export{x as PanicView};