"use strict";(self.webpackChunk_pixelpay_ui_core=self.webpackChunk_pixelpay_ui_core||[]).push([[3955],{"./dist/ui-stencil/p-b680106f.entry.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{x_dropdown:()=>r});var _p_d85247d2_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./dist/ui-stencil/p-d85247d2.js"),_p_efbc3883_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./dist/ui-stencil/p-efbc3883.js"),_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./dist/ui-stencil/p-384ed661.js");const r=class{constructor(s){(0,_p_d85247d2_js__WEBPACK_IMPORTED_MODULE_0__.r)(this,s),this.show=!1,this.align="bottom",this.hover=!1,this.syncWidth=!1,this.offset=0}onAlignWatch(){this.updateDropdownContainer()}componentDidLoad(){this.container=this.el.querySelector(".dropdown-container"),this.updateDropdownContainer(),this.el.addEventListener("mouseenter",this.onMouseEnterOnContainer.bind(this)),this.el.addEventListener("mouseleave",this.onMouseLeaveOnContainer.bind(this))}disconectedCallback(){this.el&&(this.el.removeEventListener("mouseenter",this.onMouseEnterOnContainer),this.el.removeEventListener("mouseleave",this.onMouseLeaveOnContainer))}onMouseEnterOnContainer(){this.hover&&(this.show=!0)}onMouseLeaveOnContainer(){this.hover&&(this.show=!1)}updateDropdownContainer(){this.syncWidth?(this.container.style.maxWidth=`${this.el.offsetWidth}px`,this.container.style.width="100%"):(this.container.style.maxWidth="auto",this.container.style.width="auto"),setTimeout((()=>{(0,_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__.c)(this.el,this.container,{placement:this.align,middleware:[(0,_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__.f)(),(0,_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__.s)({padding:10}),(0,_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__.o)(this.offset)]}).then((({x:t,y:s})=>{this.container.style.left=`${t}px`,this.container.style.top=`${s}px`}))}),50)}async display(t){this.show=t}render(){return(0,_p_d85247d2_js__WEBPACK_IMPORTED_MODULE_0__.h)(_p_d85247d2_js__WEBPACK_IMPORTED_MODULE_0__.H,{key:"71e5bd83345ae6f95e820a7c4bbe477c2593436d"},(0,_p_d85247d2_js__WEBPACK_IMPORTED_MODULE_0__.h)("slot",{key:"c68838e07e036ad4196ac0c44d16708c89c67313"}),(0,_p_d85247d2_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{key:"ddb1c6581583632112eccf1a00163e75dbe9b243",class:(0,_p_efbc3883_js__WEBPACK_IMPORTED_MODULE_2__.c)("dropdown-container",{"dropdown-show":this.show,"dropdown-hover":this.hover})},(0,_p_d85247d2_js__WEBPACK_IMPORTED_MODULE_0__.h)("slot",{key:"6be924779eae483e258cdb9ade1c9fbe72677fae",name:"dropdown"})))}get el(){return(0,_p_d85247d2_js__WEBPACK_IMPORTED_MODULE_0__.g)(this)}static get watchers(){return{align:["onAlignWatch"],show:["onAlignWatch"]}}};r.style="x-dropdown{display:inherit;text-align:inherit}x-dropdown .dropdown-container{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;top:0;left:0;position:absolute;z-index:10000}x-dropdown .dropdown-container.dropdown-show{display:block;-webkit-animation:0.3s fadeIn;animation:0.3s fadeIn}"}}]);