import{d as B,Y as u,f as C,o as a,c as r,a as n,n as w,r as m,t as _,j as f,g as E,w as O,k as x,h as N,l as $,X as H,N as S,i as W,e as D,_ as L}from"./XlhOY3QH.js";const V={class:"modal-body flex flex-col bg-bg-raised rounded-2xl"},X={key:0,"data-tauri-drag-region":"",class:"grid grid-cols-[auto_min-content] items-center gap-12 p-6 border-solid border-0 border-b-[1px] border-divider max-w-full"},Y={class:"flex text-wrap break-words items-center gap-3 min-w-0"},M={key:0,class:"text-lg font-extrabold text-contrast"},R={class:"overflow-y-auto p-6"},T={key:1},j=B({__name:"NewModal",props:{noblur:{type:Boolean},closable:{type:Boolean,default:!0},danger:{type:Boolean,default:!1},closeOnEsc:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0},warnOnClose:{type:Boolean,default:!1},header:{default:void 0},hideHeader:{type:Boolean,default:!1},onHide:{type:Function,default:()=>{}},onShow:{type:Function,default:()=>{}}},setup(h,{expose:p}){const o=h,c=u(!1),l=u(!1);function b(){const e=window.innerWidth-document.documentElement.clientWidth;e>0?document.body.style.paddingRight=`${e}px`:document.body.style.paddingRight=""}function g(e){var t;(t=o.onShow)==null||t.call(o),c.value=!0,b(),document.body.style.overflow="hidden",window.addEventListener("mousedown",v),window.addEventListener("keydown",y),e?v(e):(d.value=window.innerWidth/2,i.value=window.innerHeight/2),setTimeout(()=>{l.value=!0},50)}function s(){var e;(e=o.onHide)==null||e.call(o),l.value=!1,document.body.style.overflow="",document.body.style.paddingRight="",window.removeEventListener("mousedown",v),window.removeEventListener("keydown",y),setTimeout(()=>{c.value=!1},300)}p({show:g,hide:s});const d=u(-1),i=u(-1);function v(e){d.value=e.clientX,i.value=e.clientY}function y(e){o.closeOnEsc&&e.key==="Escape"&&o.closable&&(s(),d.value=window.innerWidth/2,i.value=window.innerHeight/2)}return(e,t)=>{const k=C("tooltip");return c.value?(a(),r("div",{key:0,style:D(`${d.value!==-1?`--_mouse-x: ${d.value};`:""} ${i.value!==-1?`--_mouse-y: ${i.value};`:""}`)},[n("div",{class:w([{shown:l.value},"tauri-overlay"]),"data-tauri-drag-region":"",onClick:t[0]||(t[0]=()=>e.closeOnClickOutside&&e.closable?s():{})},null,2),n("div",{class:w([{shown:l.value,noblur:o.noblur,danger:e.danger},"modal-overlay"]),onClick:t[1]||(t[1]=()=>e.closeOnClickOutside&&e.closable?s():{})},null,2),n("div",{class:w(["modal-container experimental-styles-within",{shown:l.value}])},[n("div",V,[e.hideHeader?f("",!0):(a(),r("div",X,[n("div",Y,[m(e.$slots,"title",{},()=>[e.header?(a(),r("span",M,_(e.header),1)):f("",!0)],!0)]),e.closable?(a(),E(S,{key:0,circular:""},{default:O(()=>[x((a(),r("button",{"aria-label":"Close",onClick:s},[N($(H),{"aria-hidden":"true"})])),[[k,"Close"]])]),_:1})):f("",!0)])),n("div",R,[m(e.$slots,"default",{},()=>[t[2]||(t[2]=W(" You just lost the game."))],!0)])])],2)],4)):(a(),r("div",T))}}}),F=L(j,[["__scopeId","data-v-a50ba502"]]);export{F as N};