import{k as g,ag as b,b as k,a as w,G as n,H as C,Q as c,I as i,ac as S,ad as B,u as m,O as d,a1 as u,U as f,M as _,J as O,X as q,W as E}from"./BO9AmBA3.js";import{u as M}from"./Blx3Uc3i.js";import{$ as N,a0 as V}from"./BmsEUx_s.js";const z={class:"mt-14 md:mt-0 fixed z-99 inset-0 overflow-y-auto bg-black bg-opacity-50"},$=g({__name:"SharedModal",props:{controller:{},backgroundColor:{},classes:{},variant:{default:"normal"},allowScroll:{type:Boolean}},setup(y){const t=y,{controller:v}=b(t),{isOpen:o,close:s}=v.value;t!=null&&t.allowScroll||M(o);const{escape:p}=N(),h=()=>{var e,a;return!!((a=(e=document.querySelector("#usercentrics-root"))==null?void 0:e.shadowRoot)!=null&&a.querySelector("#focus-lock-id"))};k(p,()=>{!h()&&o.value&&s()});const l=w();return V(l,e=>{const a=document.querySelector("#usercentrics-root");a!=null&&a.contains(e.target)||s()}),(e,a)=>(n(),C(E,{to:"body"},[c(f,{"enter-active-class":"transition ease-out duration-200 transform","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition ease-in duration-200 transform","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:i(()=>[S(d("div",z,[d("div",{class:u(["flex justify-center text-center",[e.variant==="normal"&&"min-h-screen items-center",e.variant==="mobile-fullheight"&&"h-full min-h-full items-start sm:items-center"]])},[c(f,{"enter-active-class":"transition ease-out duration-500 transform","enter-from-class":"opacity-0 translate-y-10 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-active-class":"ease-in duration-200","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-10 translate-y-0 scale-95"},{default:i(()=>{var r;return[m(o)?(n(),_("div",{key:0,id:"modal-content",ref_key:"modalContentElement",ref:l,class:u(["bg-white text-left overflow-hidden shadow-xl p-8 lg:mt-20",[e.backgroundColor?"bg-"+e.backgroundColor:"bg-white",(r=e.classes)==null?void 0:r.modalContent,e.variant==="mobile-fullheight"&&"w-full sm:w-auto h-full sm:h-auto"]]),role:"dialog","aria-modal":"true","aria-labelledby":"modal-content"},[O(e.$slots,"default")],2)):q("",!0)]}),_:3})],2)],512),[[B,m(o)]])]),_:3})]))}});export{$ as _};