import{a as e,f as t,l as n}from"./preact.module-CNakwbc9.js";import{d as r,s as i,t as a}from"./hooks.module-BrXTvcfS.js";import{a as o}from"./i18n-BaLR3UdQ.js";import{t as s}from"./jsxRuntime.module-Cao1NCKs.js";import{J as c}from"./hooks-ClTXKdUl.js";import{t as l}from"./Modal-hBkTa-Ee.js";import{t as u}from"./Button-Du0dYm4Z.js";import{n as d}from"./RawHtml-BZRPHliO.js";import{t as f}from"./FormCheckbox-B6Pj6_Zs.js";r(),n();function p(){let[n,r]=i(),[p,m]=i(!1),[h,g]=i(!1),_=a(null);function v(e,t,n,i){r({title:e??void 0,message:t,callback:n,isConfirmDeleteNoteBox:i}),g(!0)}return c(`showConfirmDialog`,({message:e,callback:t})=>v(null,e,t,!1)),c(`showConfirmDeleteNoteBoxWithNoteDialog`,({title:e,callback:t})=>v(e,o(`confirm.are_you_sure_remove_note`,{title:e}),t,!0)),s(l,{className:`confirm-dialog`,title:n?.title??o(`confirm.confirmation`),size:`md`,zIndex:2e3,scrollable:!0,onShown:()=>_.current?.focus(),onHidden:()=>{n?.callback?.({confirmed:!1,isDeleteNoteChecked:p}),g(!1)},footer:s(e,{children:[s(u,{text:o(`confirm.cancel`),onClick:()=>g(!1)}),s(u,{buttonRef:_,text:o(`confirm.ok`),onClick:()=>{n?.callback?.({confirmed:!0,isDeleteNoteChecked:p}),g(!1)}})]}),show:h,stackable:!0,children:[t(n?.message)?n?.message:s(d,{html:n?.message}),n?.isConfirmDeleteNoteBox&&s(f,{name:`confirm-dialog-delete-note`,label:o(`confirm.also_delete_note`),hint:o(`confirm.if_you_dont_check`),currentValue:p,onChange:m})]})}export{p as default};