text: var __awaiter=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?r(e.value):i(e.value).then(o,u)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(o){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;i=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){r.label=o[1];break}if(o[0]===6&&r.label<a[1]){r.label=a[1];a=o;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(o);break}if(a[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];i=0}finally{n=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};System.register(["./p-840fb55b.system.js","./p-7e283b4e.system.js"],(function(e){"use strict";var t,r,n,i,a;return{setters:[function(e){t=e.c},function(e){r=e.c;n=e.a;i=e.b;a=e.g}],execute:function(){var o=this;var u=0;var s=e("g",new WeakMap);var c=function(e){return{create:function(t){return k(e,t)},dismiss:function(t,r,n){return A(document,t,r,e,n)},getTop:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,E(document,e)]}))}))}}};var l=e("a",c("bkkr-alert"));var f=e("d",c("bkkr-drawer"));var d=e("l",c("bkkr-loading"));var v=e("m",c("bkkr-modal"));var b=e("p",c("bkkr-popover"));var h=e("t",c("bkkr-toast"));var m=e("b",(function(e){if(typeof document!=="undefined"){x(document)}var t=u++;e.overlayIndex=t;if(!e.hasAttribute("id")){e.id="bkkr-overlay-"+t}}));var k=function(e,t){if(typeof customElements!=="undefined"){return customElements.whenDefined(e).then((function(){var n=document.createElement(e);n.classList.add("overlay-hidden");Object.assign(n,Object.assign({},t));L(document).appendChild(n);return new Promise((function(e){return r(n,e)}))}))}return Promise.resolve()};var p='[tabindex]:not([tabindex^="-"]), input:not([type=hidden]):not([tabindex^="-"]), textarea:not([tabindex^="-"]), button:not([tabindex^="-"]), select:not([tabindex^="-"]), .state-focusable:not([tabindex^="-"])';var y="input:not([type=hidden]), textarea, button, select";var w=e("h",(function(e,t){var r=e.querySelector(p);var n=r&&r.shadowRoot;if(n){r=n.querySelector(y)||r}if(r){r.focus();if(r.classList.contains("state-focusable")){var i=t.closest("bkkr-root");if(i){i.setFocus([r])}}}else{t.focus()}}));var _=function(e,t){var r=Array.from(e.querySelectorAll(p));var n=r.length>0?r[r.length-1]:null;var i=n&&n.shadowRoot;if(i){n=i.querySelector(y)||n}if(n){n.focus()}else{t.focus()}};var g=function(e,t){var r=E(t);var n=e.target;if(!r||!n){return}var i=function(){if(r===n){r.lastFocus=undefined}else{var e=a(r);if(!e.contains(n)){return}var i=e.querySelector(".bkkr-overlay-wrapper");if(!i){return}if(i.contains(n)){r.lastFocus=n}else{var o=r.lastFocus;w(i,r);if(o===t.activeElement){_(i,r)}r.lastFocus=t.activeElement}}};var o=function(){if(r.contains(n)){r.lastFocus=n}else{var e=r.lastFocus;w(r,r);if(e===t.activeElement){_(r,r)}r.lastFocus=t.activeElement}};if(r.shadowRoot){o()}else{i()}};var x=function(e){if(u===0){u=1;e.addEventListener("focus",(function(t){return g(t,e)}),true);e.addEventListener("keyup",(function(t){if(t.key==="Escape"){var r=E(e);if(r&&r.backdropDismiss){r.dismiss(undefined,C)}}}))}};var A=function(e,t,r,n,i){var a=E(e,n,i);if(!a){return Promise.reject("overlay does not exist")}return a.dismiss(t,r)};var S=function(e,t){if(t===undefined){t="bkkr-alert,bkkr-drawer,bkkr-loading,bkkr-modal,bkkr-popover,bkkr-toast"}return Array.from(e.querySelectorAll(t)).filter((function(e){return e.overlayIndex>0}))};var E=function(e,t,r){var n=S(e,t);return r===undefined?n[n.length-1]:n.find((function(e){return e.id===r}))};var P=function(e){if(e===void 0){e=false}var t=L(document);var r=t.querySelector("bkkr-router-outlet, bkkr-nav, #bkkr-view-container-root");if(!r){return}if(e){r.setAttribute("aria-hidden","true")}else{r.removeAttribute("aria-hidden")}};var q=e("c",(function(e,r,n,i){return __awaiter(o,void 0,void 0,(function(){var a,o,u,s;return __generator(this,(function(c){switch(c.label){case 0:if(e.presented){return[2]}P(true);e.presented=true;e.willPresent.emit();(a=e.willPresentShorthand)===null||a===void 0?void 0:a.emit();u=e.enterAnimation?e.enterAnimation:t.get(r,n);return[4,j(e,u,e.el,i)];case 1:s=c.sent();if(s){e.didPresent.emit();(o=e.didPresentShorthand)===null||o===void 0?void 0:o.emit()}if(e.el.tagName!=="BKKR-TOAST"){D(e.el)}if(e.keyboardClose){e.el.focus()}return[2]}}))}))}));var D=function(e){return __awaiter(o,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:t=document.activeElement;if(!t){return[2]}r=t&&t.shadowRoot;if(r){t=r.querySelector(y)||t}return[4,e.onDidDismiss()];case 1:n.sent();t.focus();return[2]}}))}))};var F=e("e",(function(e,r,n,i,a,u){return __awaiter(o,void 0,void 0,(function(){var o,c,l,f;return __generator(this,(function(d){switch(d.label){case 0:if(!e.presented){return[2,false]}P(false);e.presented=false;d.label=1;case 1:d.trys.push([1,4,,5]);e.el.style.setProperty("pointer-events","none");e.willDismiss.emit({data:r,role:n});(o=e.willDismissShorthand)===null||o===void 0?void 0:o.emit({data:r,role:n});l=e.leaveAnimation?e.leaveAnimation:t.get(i,a);if(!(n!=="gesture"))return[3,3];return[4,j(e,l,e.el,u)];case 2:d.sent();d.label=3;case 3:e.didDismiss.emit({data:r,role:n});(c=e.didDismissShorthand)===null||c===void 0?void 0:c.emit({data:r,role:n});s.delete(e);e.el.classList.add("overlay-hidden");return[3,5];case 4:f=d.sent();console.error(f);return[3,5];case 5:e.el.remove();return[2,true]}}))}))}));var L=function(e){return e.querySelector("bkkr-root")||e.body};var j=function(e,r,n,i){return __awaiter(o,void 0,void 0,(function(){var a,o,u;return __generator(this,(function(c){switch(c.label){case 0:n.classList.remove("overlay-hidden");a=e.el;o=r(a,i);if(!e.animated||!t.getBoolean("animated",true)){o.duration(0)}if(e.keyboardClose){o.beforeAddWrite((function(){var e=n.ownerDocument.activeElement;if(e&&e.matches("input,bkkr-input, bkkr-datepicker, bkkr-textarea")){e.blur()}}))}u=s.get(e)||[];s.set(e,__spreadArray(__spreadArray([],u),[o]));return[4,o.play()];case 1:c.sent();return[2,true]}}))}))};var R=e("f",(function(e,t){var r;var n=new Promise((function(e){return r=e}));T(e,t,(function(e){r(e.detail)}));return n}));var T=function(e,t,r){var a=function(n){i(e,t,a);r(n)};n(e,t,a)};var B=e("i",(function(e){return e==="cancel"||e===C}));var C=e("B","backdrop")}}}));