var __awaiter=this&&this.__awaiter||function(t,e,n,o){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(e){r(e)}}function u(t){try{a(o["throw"](t))}catch(e){r(e)}}function a(t){t.done?n(t.value):i(t.value).then(s,u)}a((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(e){return a([t,e])}}function a(u){if(o)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(n=0)),n)try{if(o=1,i&&(r=u[0]&2?i["return"]:u[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,u[1])).done)return r;if(i=0,r)u=[u[0]&2,r.value];switch(u[0]){case 0:case 1:r=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;i=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){n.label=u[1];break}if(u[0]===6&&n.label<r[1]){n.label=r[1];r=u;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(u);break}if(r[2])n.ops.pop();n.trys.pop();continue}u=e.call(t,n)}catch(a){u=[6,a];i=0}finally{o=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./index-0425c4de.system.js","./position-element-3e47398a.system.js"],(function(t){"use strict";var e,n,o,i,r,s;return{setters:[function(t){e=t.r;n=t.e;o=t.h;i=t.f},function(t){r=t.g;s=t.a}],execute:function(){var u=".menu{position:fixed;pointer-events:none;top:0;left:0;padding:2px;background-color:var(--color-surface-1, #f6f6f6);border-radius:8px;-webkit-box-shadow:0px 8px 12px rgba(0, 0, 0, 0.08);box-shadow:0px 8px 12px rgba(0, 0, 0, 0.08);width:240px;opacity:0;-webkit-transition:opacity 0.5s;-moz-transition:opacity 0.5s;transition:opacity 0.5s;z-index:90000}.menu__open{pointer-events:auto;opacity:1}.outzone{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:80000}";var a=t("bds_menu",function(){function t(t){var o=this;e(this,t);this.bdsToggle=n(this,"bdsToggle",7);this.refMenuElement=function(t){o.menuElement=t};this.onClickCloseButtom=function(t){o.open=false;t.stopPropagation()};this.refElement=null;this.intoView=null;this.menupositionTop=0;this.menupositionLeft=0;this.menu=null;this.position="right";this.open=false}t.prototype.componentWillLoad=function(){this.refElement=document.getElementById(this.menu);this.intoView=r(this.refElement)};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.open=!this.open;return[2]}))}))};t.prototype.openMenu=function(){this.bdsToggle.emit({value:this.open});if(this.open){var t=s({actionElement:this.refElement,changedElement:this.menuElement,intoView:this.intoView});this.menupositionTop=t.top;this.menupositionLeft=t.left}};t.prototype.render=function(){var t;var e=this;var n={top:"".concat(this.menupositionTop,"px"),left:"".concat(this.menupositionLeft,"px")};return o(i,null,o("div",{ref:this.refMenuElement,class:(t={menu:true},t["menu__".concat(this.position)]=true,t["menu__open"]=this.open,t),style:n},o("slot",null)),this.open&&o("div",{class:{outzone:true},onClick:function(t){return e.onClickCloseButtom(t)}}))};Object.defineProperty(t,"watchers",{get:function(){return{open:["openMenu"]}},enumerable:false,configurable:true});return t}());a.style=u}}}));