var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function s(t){try{a(i.next(t))}catch(t){r(t)}}function f(t){try{a(i["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):o(t.value).then(s,f)}a((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:f(0),throw:f(1),return:f(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function f(t){return function(n){return a([t,n])}}function a(f){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,f[0]&&(e=0)),e)try{if(i=1,o&&(r=f[0]&2?o["return"]:f[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,f[1])).done)return r;if(o=0,r)f=[f[0]&2,r.value];switch(f[0]){case 0:case 1:r=f;break;case 4:e.label++;return{value:f[1],done:false};case 5:e.label++;o=f[1];f=[0];continue;case 7:f=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!r||f[1]>r[0]&&f[1]<r[3])){e.label=f[1];break}if(f[0]===6&&e.label<r[1]){e.label=r[1];r=f;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(f);break}if(r[2])e.ops.pop();e.trys.pop();continue}f=n.call(t,e)}catch(t){f=[6,t];o=0}finally{i=r=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:true}}};System.register(["./p-0607228f.system.js","./p-bbed38ef.system.js","./p-e0ac9edf.system.js"],(function(t){"use strict";var n,e,i,o,r,s;return{setters:[function(t){n=t.r;e=t.h;i=t.H;o=t.g},function(t){r=t.c},function(t){s=t.c}],execute:function(){var f="x-dropdown{display:inherit;text-align:inherit}x-dropdown .dropdown-container{position:absolute;visibility:hidden;z-index:-1}x-dropdown .dropdown-container.dropdown-show{z-index:10000;visibility:visible;-webkit-animation:0.4s fadeIn;animation:0.4s fadeIn}";var a=f;var c={placement:"auto",modifiers:[{name:"offset",options:{offset:[0,0]}}]};var u=t("x_dropdown",function(){function t(t){n(this,t);this.show=false;this.align="bottom";this.hover=false;this.syncWidth=false}t.prototype.onAlignWatch=function(){this.updatePopper()};t.prototype.componentDidLoad=function(){var t=this;this.container=this.el.querySelector(".dropdown-container");this.updatePopper();this.el.addEventListener("mouseenter",(function(){if(t.hover){t.show=true}}));this.el.addEventListener("mouseleave",(function(){if(t.hover){t.show=false}}))};t.prototype.disconectedCallback=function(){if(this.popper){this.popper.destroy()}};t.prototype.updatePopper=function(){this.popper=s(this.el,this.container,Object.assign(Object.assign({},c),{placement:this.align}));if(this.syncWidth){this.container.style.maxWidth="".concat(this.el.offsetWidth,"px");this.container.style.width="100%"}else{this.container.style.maxWidth="auto";this.container.style.width="auto"}};t.prototype.display=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){this.show=t;return[2]}))}))};t.prototype.render=function(){return e(i,{key:"ecfd7bf191d9fe90c4157e6c05bb4074fb33fc57"},e("slot",{key:"5a720b6b5f9dd78c76945dbbaa148dc19bf1e0fc"}),e("div",{key:"b5205981b09d40a758f83354e82f815d74afa939",class:r("dropdown-container",{"dropdown-show":this.show,"dropdown-hover":this.hover})},e("slot",{key:"6ab7f3925d9f4a2b6eadc999f7b23254282f2365",name:"dropdown"})))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{align:["onAlignWatch"],show:["onAlignWatch"]}},enumerable:false,configurable:true});return t}());u.style=a}}}));