var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):r(t.value).then(a,s)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(t){a=[6,t];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,g as getElement}from"./index-e3f64949.js";var balHintCss="@-webkit-keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.sc-bal-hint-h{display:inline-block}.bal-hint-icon.sc-bal-hint{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;background:#003399;width:20px;height:20px;border-radius:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.bal-hint-icon.sc-bal-hint span.sc-bal-hint{color:#ffffff;font-weight:700;font-family:MetaPro, Arial, sans-serif;font-size:15px;margin-top:-1px}.bal-hint-icon.sc-bal-hint:hover{background:#002b82}.bal-hint-content.sc-bal-hint{position:fixed;top:0;bottom:0;left:0;right:0;z-index:100;background:#003399;color:#ffffff;padding:30px;min-width:280px}.bal-hint-content.sc-bal-hint .title.sc-bal-hint{color:#ffffff}.bal-hint-content.sc-bal-hint .buttons.sc-bal-hint{margin-top:30px}@media screen and (min-width: 720px), print{.bal-hint-content.sc-bal-hint{position:absolute;margin-left:40px;top:-20px;bottom:initial;left:initial;right:initial;-webkit-box-shadow:0 0 10px 0 rgba(0, 33, 98, 0.15);box-shadow:0 0 10px 0 rgba(0, 33, 98, 0.15)}}";var Hint=function(){function t(t){registerInstance(this,t);this.isActive=false;this.closeLabel="Close";this.disabled=false}t.prototype.handleKeyUp=function(t){if(t.key==="Escape"||t.key==="Esc"){t.preventDefault();this.close()}};t.prototype.clickOnOutside=function(t){if(!this.element.contains(t.target)&&this.isActive){this.toggle()}};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isActive=!this.isActive;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isActive=true;return[2]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isActive=false;return[2]}))}))};t.prototype.render=function(){var t=this;return h(Host,null,h("div",{role:"button",class:"bal-hint-icon",onClick:function(){return t.toggle()}},h("span",null,"i")),h("div",{class:"bal-hint-content",style:{display:this.isActive?"inline-block":"none"}},h("slot",null),h("div",{class:"buttons is-row-reverse"},h("bal-button",{type:"is-info",outlined:true,inverted:true,onClick:function(){return t.close()}},this.closeLabel))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();Hint.style=balHintCss;export{Hint as bal_hint};