import{B as e,E as t,F as n,H as r,It as i,Mt as a,Q as o,U as s,V as c,W as l,Y as u,Z as d,d as f,ft as p,i as m,j as h,jt as g,mt as _,p as v,pt as y,s as b,st as x,t as S,tt as C,yt as w}from"./BA99CCI5.js";import"./xihTtKlq.js";import"./DGo8yE5j.js";import{t as T}from"./BB59mDRy.js";import{r as E,t as D}from"./B66v-P2b.js";import{a as O,r as k,t as A}from"./DvT-Y1N62.js";import{n as j,t as M}from"./C73dJ-MR2.js";var N=l(`<p class="text-sm text-neutral-600 dark:text-neutral-400"> </p>`),P=l(`<!> <!>`,1),ee=l(`<div class="fixed inset-0 z-[100] overflow-y-auto bg-black/50 p-4 backdrop-blur-sm sm:p-6" role="dialog" aria-modal="true" tabindex="-1"><div class="flex min-h-full w-full items-start justify-center sm:items-center"><div><div class="flex flex-shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-neutral-300 px-6 py-4 dark:border-neutral-700/60"><h2 class="text-lg font-semibold text-neutral-900 dark:text-neutral-50"> </h2> <!></div> <div><!></div> <div class="flex flex-shrink-0 justify-between border-t border-neutral-300 px-6 py-4 dark:border-neutral-700/60"><!></div></div></div></div>`);function F(l,F){a(F,!1);let I=b(F,`open`,8,!1),L=b(F,`header`,8,`Confirm`),R=b(F,`bodyMessage`,8,`Are you sure?`),z=b(F,`confirmText`,8,`Confirm`),B=b(F,`cancelText`,8,`Cancel`),V=b(F,`confirmDanger`,8,!1),H=b(F,`confirmDisabled`,8,!1),U=b(F,`loading`,8,!1),W=b(F,`size`,8,`md`),G=b(F,`height`,8,`auto`),K=b(F,`bodyOverflow`,8,`auto`),q={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-2xl`,xl:`max-w-4xl`,"2xl":`max-w-6xl`},J={auto:``,md:`h-[50vh]`,lg:`h-[70vh]`,xl:`h-[85vh]`,full:`h-[95vh]`},Y=S();function X(){Y(`confirm`)}function Z(){Y(`cancel`)}function Q(e){e.key===`Escape`&&I()&&Z()}m(()=>(window.addEventListener(`keydown`,Q),()=>{window.removeEventListener(`keydown`,Q)})),f();var $=s(),te=y($),ne=e=>{var a=ee(),s=p(a),l=p(s),f=p(l),m=p(f),g=p(m,!0);i(m);var b=_(m,2);n(b,F,`header-extra`,{},null),i(f);var S=_(f,2),I=p(S);n(I,F,`body`,{},e=>{var t=N(),n=p(t,!0);i(t),x(()=>c(n,R())),r(e,t)}),i(S);var Y=_(S,2),Q=p(Y);n(Q,F,`footer`,{},e=>{var t=P(),n=y(t);D(n,{get text(){return B()},get icon(){return O},get disabled(){return U()},$$events:{click:Z}});var i=_(n,2);{let e=w(()=>U()?E:T),t=w(()=>V()?`danger`:`primary`),n=w(()=>H()||U());D(i,{get text(){return z()},get icon(){return o(e)},get variant(){return o(t)},get disabled(){return o(n)},get loading(){return U()},$$events:{click:X}})}r(e,t)}),i(Y),i(l),i(s),i(a),x(()=>{t(l,1,`relative my-4 flex w-full flex-col ${d(W()),C(()=>q[W()])??``} ${d(G()),C(()=>J[G()])??``} max-h-[calc(100svh-2rem)] rounded-xl border border-neutral-300 bg-white shadow-xl sm:my-0 dark:border-neutral-700/60 dark:bg-neutral-900`),c(g,L()),t(S,1,`flex-1 px-6 py-4 ${K()===`visible`?`overflow-visible`:`overflow-auto`}`)}),h(1,l,()=>k,()=>({duration:170,start:.97,opacity:.5,easing:j})),h(2,l,()=>k,()=>({duration:120,start:.97,opacity:.5,easing:M})),u(`click`,s,v(Z)),h(1,a,()=>A,()=>({duration:140})),h(2,a,()=>A,()=>({duration:110})),r(e,a)};e(te,e=>{I()&&e(ne)}),r(l,$),g()}export{F as t};