text: var LitPopup=function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;
  /*! *****************************************************************************
      Copyright (c) Microsoft Corporation. All rights reserved.
      Licensed under the Apache License, Version 2.0 (the "License"); you may not use
      this file except in compliance with the License. You may obtain a copy of the
      License at http://www.apache.org/licenses/LICENSE-2.0
  
      THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
      KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
      WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
      MERCHANTABLITY OR NON-INFRINGEMENT.
  
      See the Apache Version 2.0 License for specific language governing permissions
      and limitations under the License.
      ***************************************************************************** */
  var e=function(){return(e=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function n(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{u(o.next(t))}catch(t){r(t)}}function l(t){try{u(o.throw(t))}catch(t){r(t)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(s,l)}u((o=o.apply(t,e||[])).next())}))}function o(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function l(r){return function(l){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(6===r[0]&&s.label<i[1]){s.label=i[1],i=r;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(r);break}i[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,l])}}}var i=function(t){return"[lit-popup] "+t},r=27,s="lit-popup--opening",l="lit-popup--closing",u="lit-popup--opened",c="open",p="open-complete",a="close",h="close-complete",f="destroy",v=function(t){var e=function(e){e.keyCode===r&&(e.preventDefault(),t.isOpen&&t.close())},n=function(){document.removeEventListener("keydown",e)};return t.on(c,(function(){document.addEventListener("keydown",e)})),t.on(a,n),function(){n()}},d={plugins:[],innerContainerSelector:".lit-popup-container",onOpen:function(){},openAnimation:function(){return Promise.resolve()},onOpenComplete:function(){},onClose:function(){},closeAnimation:function(){return Promise.resolve()},onCloseComplete:function(){},onDestroy:function(){}};return function(){function r(n,o){var r=this;if(void 0===o&&(o={}),!n)throw new Error(i("Expected a name as a first argument."));this.options=e({},d,o),this.isOpen=!1;var s=document.querySelector('[data-lit-popup="'+n+'"]');if(!s)throw new Error(i("Element not found."));this.el=s,this.listeners=[],this.innerContainer=this.el.querySelector(this.options.innerContainerSelector),this.plugins=[v].concat(this.options.plugins),this.pluginDestroyers=[],this.previousActiveElement=null,this.open=this.open.bind(this),this.close=this.close.bind(this),this.openDelegation=t(document,'[data-lit-popup-open="'+n+'"]',"click",this.open),this.closeDelegation=t(document,'[data-lit-popup-close="'+n+'"]',"click",this.close),this.pluginDestroyers=this.plugins.map((function(t){return t(r)}))}return r.prototype.destroy=function(){var t=this;this.options.onDestroy(this),this.trigger(f),this.openDelegation.destroy(),this.closeDelegation.destroy(),this.pluginDestroyers.forEach((function(t){return t()})),this.listeners.forEach((function(e){var n=e[0],o=e[1];return t.off(n,o)})),this.listeners=[],this.isOpen=!1,this.el=null,this.innerContainer=null,this.previousActiveElement=null},r.prototype.on=function(t,e){"destroy"===t?this.one(t,e):(this.el.addEventListener(t,e),this.listeners.push([t,e]))},r.prototype.one=function(t,e){!function(t,e,n){t.addEventListener(e,(function o(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];t.removeEventListener(e,o),n.apply(void 0,i)}))}(this.el,t,e)},r.prototype.off=function(t,e){this.el.removeEventListener(t,e)},r.prototype.trigger=function(t,e){!function(t,e,n){var o;if(void 0===n&&(n={}),CustomEvent)try{o=new CustomEvent(e,{detail:n})}catch(t){(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n)}else(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n);t.dispatchEvent(o)}(this.el,t,e)},r.prototype.setOpenAnimation=function(t){this.options.openAnimation=t},r.prototype.setCloseAnimation=function(t){this.options.closeAnimation=t},r.prototype.open=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return t&&t.preventDefault(),this.previousActiveElement=document.activeElement,this.isOpen=!0,this.el.classList.add(u,s),this.options.onOpen(this,t?t.target:void 0),this.trigger(c,{triggerElement:t?t.target:void 0}),[4,this.options.openAnimation(this)];case 1:return e.sent(),this.el.classList.remove(s),this.options.onOpenComplete(this,t?t.target:void 0),this.trigger(p,{triggerElement:t?t.target:void 0}),[2]}}))}))},r.prototype.close=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return t&&t.preventDefault(),this.el.classList.add(l),this.options.onClose(this,t?t.target:void 0),this.trigger(a,{triggerElement:t?t.target:void 0}),[4,this.options.closeAnimation(this)];case 1:return e.sent(),this.isOpen=!1,this.el.classList.remove(l),this.el.classList.remove(u),this.innerContainer&&this.innerContainer.scrollTo&&this.innerContainer.scrollTo(0,0),this.options.onCloseComplete(this,t?t.target:void 0),this.trigger(h,{triggerElement:t?t.target:void 0}),[2]}}))}))},r}()}(delegate);
  