(function(){var a;"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.nonce=(a=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:a.content,e.appendChild(document.createTextNode(`.vue-modal[data-v-31076951]{position:fixed;top:0;left:0;width:100%;height:100%;overflow-y:auto;opacity:0;visibility:hidden;display:flex;justify-content:center;flex-wrap:wrap}.vue-modal.vue-modal--slideDown[data-v-31076951]{transform:translateY(-40px)}.vue-modal.vue-modal--slideUp[data-v-31076951]{transform:translateY(40px)}.vue-modal.vue-modal--slideLeft[data-v-31076951]{transform:translate(-40px)}.vue-modal.vue-modal--slideRight[data-v-31076951]{transform:translate(40px)}.vue-modal.vue-modal--center[data-v-31076951]{align-items:center}.vue-modal.vue-modal--top[data-v-31076951]{align-items:flex-start}.vue-modal.vue-modal--active[data-v-31076951]:not(.vue-modal--hide){transform:translate(0);opacity:1;visibility:visible}.vue-modals[data-v-33aecfee]{width:0}.vue-modals[data-v-33aecfee] *{box-sizing:border-box}.vue-modals-overlay[data-v-33aecfee]{position:fixed;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden}.vue-modals-overlay.active[data-v-33aecfee]{opacity:1;visibility:visible}.vue-modal-content[data-v-08977c6b]{background:#fff;border-radius:.5rem;font-family:inherit}.vue-modal-content.size-sm[data-v-08977c6b]{width:100%;max-width:576px}.vue-modal-content.size-md[data-v-08977c6b]{width:100%;max-width:768px}.vue-modal-content.size-lg[data-v-08977c6b]{width:100%;max-width:992px}.vue-modal-content.size-xl[data-v-08977c6b]{width:100%;max-width:1200px}.vue-modal-content.size-xxl[data-v-08977c6b]{width:100%;max-width:1400px}.vue-modal-header[data-v-08977c6b]{padding:1rem;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;border-bottom:1px solid #dee2e6;border-top-left-radius:.5rem;border-top-right-radius:.5rem}.vue-modal-title[data-v-08977c6b]{font-size:1.25rem;font-weight:500;margin:0}.vue-modal-btn-close[data-v-08977c6b]{opacity:.5;width:2rem;height:2rem;background:transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;border:none;padding:0;cursor:pointer;transition:opacity .2s ease}.vue-modal-btn-close[data-v-08977c6b]:hover{opacity:1}.vue-modal-body[data-v-08977c6b]{padding:1rem}.vue-modal-footer[data-v-08977c6b]{padding:1rem;display:flex;flex-wrap:wrap;justify-content:flex-end;border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem;border-top:1px solid #dee2e6;gap:.25rem}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); (function(d,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("js-event-bus")):typeof define=="function"&&define.amd?define(["exports","vue","js-event-bus"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d["vue-modal"]={},d.vue,d["js-event-bus"]))})(this,function(d,o,N){"use strict";function P(){var e;try{const t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",document.body.appendChild(t);const l=document.createElement("div");t.appendChild(l);const n=t.offsetWidth-l.offsetWidth;return(e=t.parentNode)==null||e.removeChild(t),n}catch{return 0}}function T(){const e=o.ref(P());function t(){document.documentElement.style.overflow="hidden",document.documentElement.scrollHeight>document.documentElement.clientHeight&&(document.body.style.paddingRight=`${e.value}px`)}function l(){document.documentElement.style.overflow="auto",document.body.style.paddingRight="0px"}function n(c){c?t():l()}return{paddingSize:e,toggleLock:n}}const m=o.reactive({modals:[]}),v=o.computed(()=>m.modals[m.modals.length-1]),V=o.computed(()=>m.modals),j=o.computed(()=>m.modals.length>0);function I(e){e.options.group=e.options.group||"default",m.modals.push(o.markRaw(e))}function R(){m.modals.pop()}const B=new N;function k(e,...t){B.emit(e,null,...t)}function y(e,t){B.on(e,t)}function p(e,t){B.detach(e,t)}const s=o.reactive({transitionTime:200,animationType:"slideDown",modalStyle:{padding:void 0,align:"center","z-index":201},overlayStyle:{"background-color":"rgba(0, 0, 0, 0.9)","z-index":200}});function W(e){var t,l,n,c,u,f;e!=null&&e.transitionTime&&(s.transitionTime=e.transitionTime),e!=null&&e.animationType&&(s.animationType=e.animationType),e!=null&&e.modalStyle&&((t=e.modalStyle)!=null&&t.padding&&(s.modalStyle.padding=e.modalStyle.padding),(l=e.modalStyle)!=null&&l.align&&(s.modalStyle.align=e.modalStyle.align),(n=e.modalStyle)!=null&&n["z-index"]&&(s.modalStyle["z-index"]=e.modalStyle["z-index"])),(c=e==null?void 0:e.overlayStyle)!=null&&c["z-index"]&&(s.overlayStyle["z-index"]=e.overlayStyle["z-index"]),(u=e==null?void 0:e.overlayStyle)!=null&&u["background-color"]&&(s.overlayStyle["background-color"]=e.overlayStyle["background-color"]),(f=e==null?void 0:e.overlayStyle)!=null&&f["backdrop-filter"]&&(s.overlayStyle["backdrop-filter"]=e.overlayStyle["backdrop-filter"])}var a=(e=>(e.Open="open",e.Opened="opened",e.Close="close",e.Closed="closed",e))(a||{});async function D(e,t,l){l!=null&&l.force&&m.modals.length&&await $(!1);const n=m.modals.length;return I({id:n,component:e,props:t,options:l||{}}),k(a.Open),new Promise((c,u)=>{function f(_){_.id===n&&(p(a.Closed,f),_.success?c(_.data):u("Modal closed."))}y(a.Closed,f)})}function q(e){return new Promise(t=>{function l(n){p(a.Closed,l),t(n.data)}y(a.Closed,l),k(a.Close,{success:!0,data:e})})}function M(){return new Promise(e=>{function t(){p(a.Closed,t),e()}y(a.Closed,t),k(a.Close,{success:!1})})}function $(e=!0){return new Promise(t=>{function l(){p(a.Closed,l);for(let n=m.modals.length-1;n>=0;n--)m.modals.splice(n,1),k(a.Closed,{id:n,success:!1});t()}y(a.Closed,l),k(a.Close,{success:!1,forceCloseAll:e})})}function H(e){return"key"in e?e.key==="Escape"||e.key==="Esc":e.keyCode===27}const U=o.defineComponent({__name:"BaseModal",props:{group:{default:"default"},item:{}},setup(e){const t=e,l=o.ref(!1),n=o.computed(()=>t.item.id!==v.value.id),c=o.computed(()=>s.animationType!=="none"&&s.transitionTime||0),u=o.computed(()=>{var i,g,r,S,C,E,x,L;return{padding:((r=(g=(i=t.item)==null?void 0:i.options)==null?void 0:g.modalStyle)==null?void 0:r.padding)??((S=s.modalStyle)==null?void 0:S.padding),"z-index":((x=(E=(C=t.item)==null?void 0:C.options)==null?void 0:E.modalStyle)==null?void 0:x["z-index"])??((L=s.modalStyle)==null?void 0:L["z-index"]),transition:`opacity ${c.value}ms ease, visibility ${c.value}ms ease, transform ${c.value}ms ease`}}),f=o.computed(()=>{var i,g,r,S;return[{"vue-modal--active":l.value,"vue-modal--hide":n.value},`vue-modal--${((r=(g=(i=t.item)==null?void 0:i.options)==null?void 0:g.modalStyle)==null?void 0:r.align)??((S=s.modalStyle)==null?void 0:S.align)}`,`vue-modal--${s.animationType}`]});function _(i){v.value.id===t.item.id&&(l.value=!1,setTimeout(k,c.value,a.Closed,{id:t.item.id,success:i.success,data:i.data}))}function h(i){H(i)&&v.value.id===t.item.id&&M()}return o.onMounted(()=>{setTimeout(()=>{l.value=!0},t.item.id>0?c.value:0),y(a.Close,_),document.addEventListener("keydown",h),k(a.Opened)}),o.onBeforeUnmount(()=>{p(a.Close,_),document.removeEventListener("keydown",h)}),(i,g)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([f.value,"vue-modal"]),style:o.normalizeStyle(u.value)},[o.renderSlot(i.$slots,"default",{},void 0,!0)],6))}}),w="",b=(e,t)=>{const l=e.__vccOpts||e;for(const[n,c]of t)l[n]=c;return l},A=b(U,[["__scopeId","data-v-31076951"]]),F=o.defineComponent({__name:"ModalTarget",props:{group:{default:"default"},withoutOverlay:{type:Boolean,default:!1}},setup(e){const t=e,l=T(),n=s.animationType!=="none"&&s.transitionTime||0,c=o.computed(()=>({...(s==null?void 0:s.overlayStyle)||{},transition:`opacity ${n}ms ease, visibility ${n}ms ease`})),u=o.ref(!1),f=o.computed(()=>m.modals.filter(r=>r.options.group===t.group)),_=o.computed(()=>f.value.length&&!u.value&&v.value.options.group===t.group);function h({forceCloseAll:r}){(f.value.length===1&&r!==!1||r)&&(u.value=!0,setTimeout(()=>{u.value=!1},n))}function i(){l.toggleLock(!1)}function g(){l.toggleLock(!0)}return o.onMounted(()=>{y(a.Close,h),y(a.Closed,i),y(a.Open,g)}),o.onBeforeUnmount(()=>{p(a.Close,h),p(a.Closed,i),p(a.Open,g)}),(r,S)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([[`vue-modals-${t.group}-group`],"vue-modals"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(f.value,C=>(o.openBlock(),o.createBlock(A,{item:C,key:`${t.group}-${C.id}`},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(C.component),o.normalizeProps(o.guardReactiveProps(C.props)),null,16))]),_:2},1032,["item"]))),128)),r.withoutOverlay?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle(c.value),class:o.normalizeClass([{active:_.value},"vue-modals-overlay"])},null,6))],2))}}),O="",z=b(F,[["__scopeId","data-v-33aecfee"]]),G={key:0,class:"vue-modal-header"},J={key:0,class:"vue-modal-title"},K={class:"vue-modal-body"},Q={key:1,class:"vue-modal-footer"},X=o.defineComponent({__name:"SimpleModal",props:{title:{},showClose:{type:Boolean,default:!0},size:{type:String,default:"sm",validator(e){return["sm","md","lg","xl","xxl"].includes(e)}}},setup(e){const t=e,l=o.useSlots();return(n,c)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([`size-${t.size}`,"vue-modal-content"])},[t.title||t.showClose?(o.openBlock(),o.createElementBlock("div",G,[t.title?(o.openBlock(),o.createElementBlock("h1",J,o.toDisplayString(t.title),1)):o.createCommentVNode("",!0),t.showClose?(o.openBlock(),o.createElementBlock("button",{key:1,onClick:c[0]||(c[0]=u=>o.unref(M)()),class:"vue-modal-btn-close","aria-label":"Close"})):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",K,[o.renderSlot(n.$slots,"default",{},void 0,!0)]),o.unref(l).footer?(o.openBlock(),o.createElementBlock("div",Q,[o.renderSlot(n.$slots,"footer",{},void 0,!0)])):o.createCommentVNode("",!0)],2))}}),ee="",Y=b(X,[["__scopeId","data-v-08977c6b"]]);function Z(e){return{install(t){W(e||{}),t.component("ModalTarget",z),t.component("SimpleModal",Y),y(a.Closed,R)}}}d.$off=p,d.$on=y,d.Events=a,d.ModalTarget=z,d.closeAllModals=$,d.closeModal=M,d.confirmModal=q,d.createModal=Z,d.isOpened=j,d.modals=V,d.openModal=D,d.useLock=T,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});