import{B as e,H as t,Mt as n,O as r,Q as i,W as a,_t as o,d as s,g as c,ht as l,jt as u,mt as d,pt as f,s as p,st as m,t as h,u as g,x as _}from"./BA99CCI5.js";import{t as v}from"./BJ4akexL.js";import"./xihTtKlq.js";import"./DGo8yE5j.js";import{t as y}from"./7yuvYLu22.js";import{n as b}from"./DCkiND_92.js";var x=a(`<form method="POST" class="hidden"></form>`),S=a(`<!> <!>`,1);function C(a,C){n(C,!1);let w=p(C,`open`,8,!1),T=p(C,`databaseId`,8),E=p(C,`announcementId`,8),D=p(C,`withdrawing`,12,!1),O=h(),k=l(null);function A(){i(k)?.requestSubmit()}s();var j=S(),M=f(j),N=e=>{var n=x();c(n,e=>o(k,e),()=>i(k)),r(n,(e,t)=>b?.(e,t),()=>()=>(D(!0),async({result:e,update:t})=>{if(e.type===`redirect`)O(`withdrawn`),v.add(`success`,`Announcement withdrawn`);else if(e.type===`failure`){let t=e.data;v.add(`error`,t?.error??`Failed to withdraw`)}await t(),D(!1)})),m(()=>_(n,`action`,`/databases/${T()}/announcements/${E()}?/delete`)),t(e,n)};e(M,e=>{w()&&E()&&e(N)});var P=d(M,2);y(P,{get open(){return w()},header:`Withdraw announcement`,bodyMessage:`Withdrawing deletes the announcement file from the working copy. Linked databases will mark this announcement as withdrawn on their next sync. This cannot be undone unless you re-create the file.`,confirmText:`Withdraw`,cancelText:`Cancel`,confirmDanger:!0,get confirmDisabled(){return D()},get loading(){return D()},$$events:{cancel(e){g.call(this,C,e)},confirm:A}}),t(a,j),u()}export{C as t};