!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define("$event",["vue"],e):"object"===typeof exports?exports.$event=e(require("vue")):t.$event=e(t.Vue)}("undefined"!==typeof self?self:this,(function(t){return function(){"use strict";var e={895:function(e){e.exports=t}},n={};function o(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return function(){o.r(r),o.d(r,{default:function(){return x},install:function(){return m},useBus:function(){return $},useEvent:function(){return E}});var t=o(895);const e=/(?:^\[object\s(.*?)\]$)/;var n=t=>Object.prototype.toString.call(t).replace(e,"$1").toLowerCase();var i=function(){if("function"===typeof window.CustomEvent)return!1;window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}};var u=function(t,e,n){n=n||window;let o=!1;n.addEventListener(t,(function(){o||(o=!0,requestAnimationFrame((function(){n.dispatchEvent(new CustomEvent(e)),o=!1})))}))};var l=function(){i(),u("resize","balmResize"),u("scroll","balmScroll")};const c=new Map,s=new Map;function a(t){c.has(t)&&c.delete(t)}const f={on:function(t,e){c.set(t,e)},once:function(t,e){s.set(t,e)},off:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t?Array.isArray(t)?t.forEach((e=>a(t))):a(t):c.clear()},emit:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];s.has(t)?(s.get(t)(...n),s.delete(t)):c.has(t)?c.get(t)(...n):console.warn("[$bus]",`The '${t}' event is not defined`)}};var d=f;const v=()=>{};let p=!1;function h(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=t.shift(),r=n?n[o]:this[o];t.length?h.call(this,t,e,r):n?n[o]=e:this[o]=e}function b(t,e,o){"function"===n(new Function)?new Function("value",`this.${e} = value;`).call(t,o):h.call(t,e.split("."),o)}function g(t,e){const n=t.split(".")[0];if(n){const{setupState:o,data:r}=this;if(o.hasOwnProperty(n))b(o,t,e);else{if(!r.hasOwnProperty(n))throw new Error("[$event]: Only support 'setup' or 'data' state.");b(r,t,e)}}}function y(t){let e,o=n(t);return e="function"===o||"generatorfunction"===o?t():t,e}class w{constructor(){const e=(0,t.getCurrentInstance)();this.instance=e}onChange(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v;return g.call(this.instance,t,e),y(n)}onOpen(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return g.call(this.instance,t,!0),y(e)}onClose(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return g.call(this.instance,t,!1),y(e)}onShow(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return g.call(this.instance,t,!0),y(e)}onHide(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return g.call(this.instance,t,!1),y(e)}}function m(t){t.mixin({mounted(){p||(p=!0,l())}}),t.config.globalProperties.$bus=d,t.provide("bus",d),t.config.globalProperties.$throttle=u,t.provide("throttle",u)}const E=()=>new w,$=()=>d;var x={install:m}}(),r}()}));