/*! base UI components v2.0.3 | Apache License, Version 2.0 | github.com/base-angewandte/base-ui-components */
var BaseTooltip=function(t){"use strict";var e=function(t){try{return!!t()}catch(t){return!0}},n=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=function(t){return t&&t.Math==Math&&t},r=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof o&&o)||function(){return this}()||Function("return this")(),s=function(t){return"object"==typeof t?null!==t:"function"==typeof t},c=r.document,l=s(c)&&s(c.createElement),a=!n&&!e((function(){return 7!=Object.defineProperty((t="div",l?c.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),f=function(t){if(!s(t))throw TypeError(String(t)+" is not an object");return t},u=Object.defineProperty,d={f:n?u:function(t,e,n){if(f(t),e=function(t,e){if(!s(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!s(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!s(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!s(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}(e,!0),f(n),a)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}}.f,h=Function.prototype,p=h.toString,y=/^\s*function ([^ (]*)/;n&&!("name"in h)&&d(h,"name",{configurable:!0,get:function(){try{return p.call(this).match(y)[1]}catch(t){return""}}});function g(t,e,n,o,i,r,s,c,l,a){"boolean"!=typeof s&&(l=c,c=s,s=!1);const f="function"==typeof n?n.options:n;let u;if(t&&t.render&&(f.render=t.render,f.staticRenderFns=t.staticRenderFns,f._compiled=!0,i&&(f.functional=!0)),o&&(f._scopeId=o),r?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(r)},f._ssrRegister=u):e&&(u=s?function(t){e.call(this,a(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,c(t))}),u)if(f.functional){const t=f.render;f.render=function(e,n){return u.call(n),t(e,n)}}else{const t=f.beforeCreate;f.beforeCreate=t?[].concat(t,u):[u]}return n}var v,b=g({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["base-tooltip","base-tooltip--"+t.direction,{"base-tooltip--active":t.isActive}],style:Object.assign({},t.styles,t.css)},[t._t("default",(function(){return[n("i",[t._v("use default slot")])]}))],2)},staticRenderFns:[]},void 0,{name:"BaseTooltip",props:{attachTo:{type:null,required:!0},styles:{type:Object,default:function(){}}},data:function(){return{isActive:!1,direction:"top",css:{},thresholdX:10,thresholdY:3}},mounted:function(){document.querySelector("body").appendChild(this.$el),this.calcPosition(),this.isActive=!0},methods:{calcPosition:function(){var t=this.attachTo,e=t.getBoundingClientRect(),n=this.$el,o=parseFloat(window.getComputedStyle(n,":after").height)/2,i=n.offsetWidth,r=n.offsetHeight+o;this.css={};var s=window.scrollY;e.top<r?(this.direction="bottom",this.css.top="".concat(e.bottom+o+this.thresholdY+s,"px")):(this.direction="top",this.css.top="".concat(e.top-r-this.thresholdY+s,"px")),e.x<i/2?(this.css.left="".concat(this.thresholdX,"px"),this.css["--triangle-left"]="".concat(e.left+e.width/2-this.thresholdX,"px")):t.getBoundingClientRect().right+i/2>window.outerWidth?(this.css.right="".concat(this.thresholdX,"px"),this.css["--triangle-left"]="".concat(i-e.width/2+this.thresholdX-(window.outerWidth-t.getBoundingClientRect().right),"px")):(this.css.left="".concat(e.left+e.width/2-i/2,"px"),this.css["--triangle-left"]="50%")}}},"data-v-96d21402",!1,void 0,!1,void 0,void 0,void 0),w={install:function(t){!function(t,e){t.component(e.name,e)}(t,b)}};return v=w,"undefined"!=typeof window&&window.Vue&&window.Vue.use(v),t.BaseTooltip=b,t.default=w,Object.defineProperty(t,"__esModule",{value:!0}),t}({});