import{z as e}from"./lz-string-CMojKG3P.js";import{$ as t,Ct as n,Et as r,Gt as i,wt as a}from"./src-DTHkTkyy-Ce1TZuRw.js";import{a as o}from"./connect-BSkeWkEI-BYzoVZOI.js";import{t as s}from"./useTranslation-D1YdOuD6.js";import{t as c}from"./reactor-Nm3jOev1-Cl_iEnvO.js";import{useState as l}from"react";import{jsx as u}from"react/jsx-runtime";var d=e([`ClearStorage`]);function f(){let e=i()?.type===`clearStorage`,{t:f}=s(),[p,m]=l(!1);function h(){m(!0),c().then(()=>{d.info(`Storage cleared`),n(void 0),a(void 0),window.location.reload()}).catch(e=>{d.error(`Error clearing storage: @error`,e),m(!1)})}return u(o,{open:e,header:f(`modals.connectSettings.clearStorage.confirmation.title`),title:f(`modals.connectSettings.clearStorage.confirmation.title`),body:f(`modals.connectSettings.clearStorage.confirmation.body`),cancelLabel:f(`common.cancel`),continueLabel:f(`modals.connectSettings.clearStorage.confirmation.clearButton`),onCancel:()=>r({type:`settings`}),onContinue:h,onOpenChange:e=>{if(!e)return t()},continueButtonProps:{disabled:p}})}export{f as ClearStorageModal};
//# sourceMappingURL=ClearStorageModal-K1H6NgT6-C_nQz9y4.js.map