function i(e){if(jQuery("#".concat(e.id)).length>0){jQuery("#".concat(e.id)).addClass("show"),jQuery("body").css("overflow","hidden");return}const t=d(e);jQuery(document.body).append(t),jQuery(document.body).on("click",".saai-modal-close",n),jQuery(document.body).on("click",".saai-modal",function(o){o.target===this&&a(jQuery(this).attr("id"))}),setTimeout(()=>{jQuery(".saai-modal").addClass("show"),jQuery("body").css("overflow","hidden")},100)}function n(e){const o=jQuery(this).closest(".saai-modal");a(o.attr("id"))}function a(e){const t=jQuery("#".concat(e));t.removeClass("show"),jQuery("body").css("overflow",""),!t.data("retain-on-close")&&setTimeout(()=>{t.remove()},300)}function d(e){const t={width:1e3,height:500,showCloseButton:!0,retainOnClose:!1,flexCenter:!1},o=lodash.defaults(e,t),s=["saai-modal"];return o.flexCenter&&s.push("flex-center"),'\n        <div id="'.concat(o.id,'" class="').concat(s.join(" "),'" data-retain-on-close="').concat(o.retainOnClose,'">\n            <div class="saai-modal-box" style="max-width: ').concat(o.width,"px; min-height: ").concat(o.height,'px;">\n                <div class="saai-modal-box-content">\n                    ').concat(o.content,"\n                </div>\n                ").concat(o.showCloseButton?'\n                    <button class="saai-modal-close">\n                        <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n                        <path d="M18 6L6 18" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n                        <path d="M6 6L18 18" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n                        </svg>\n                    </button>\n                ':"","\n            </div>\n        </div>\n    ")}export{a as c,i as s};
