text: !function(t,n,e,i){"use strict";function a(){n.body.removeChild(this);var t=f(this.getAttribute("data-backdrop-for"));s.splice(t.index,1),this.off(e.event.transitionEnd,a,!1)}function o(t){if(t.style.visibility="visible",!t.classList.contains("active")){t.classList.add("active");var e=c(t.getAttribute("id"));n.body.appendChild(e),s.push({panel:t,backdrop:e})}}function r(t){if(t.classList.contains("active")){t.classList.remove("active"),t.classList.add("panel-closing");var n=function(){t.classList.remove("panel-closing"),t.off(e.event.transitionEnd,n)};t.on(e.event.transitionEnd,n);var i=f(t.getAttribute("id"));i&&(i.backdrop.classList.add("fadeout"),i.backdrop.on(e.event.transitionEnd,a,!1))}}var s=[],c=function(t){var e=n.createElement("div");return e.classList.add("backdrop-panel"),e.setAttribute("data-backdrop-for",t),e},l=function(t){for(var e,i=n.querySelectorAll("[data-panel-id], [data-panel-close]");t&&t!==n;t=t.parentNode)for(e=i.length;e--;)if(i[e]===t)return t},d=function(t){var e=l(t.target);if(e){var i=e.getAttribute("data-panel-id");return i?n.querySelector("#"+i):u(t.target)}},f=function(t){for(var n=s.length,e=0;n>e;e++)if(s[e].panel.getAttribute("id")===t){var i=s[e];return i.index=e,i}return null},u=function(t){for(var e,i=n.querySelectorAll(".panel, .panel-full");t&&t!==n;t=t.parentNode)for(e=i.length;e--;)if(i[e]===t&&t.classList.contains("active"))return t},p=function(t){for(;t&&t!==n;t=t.parentNode)if(t.classList.contains("dialog")||t.classList.contains("backdrop-dialog"))return!0;return!1};n.on(e.event.start,function(t){if(t=t.originalEvent||t,!(t.target.classList.contains("notification")||t.parentNode&&t.target.parentNode.classList.contains("notification"))&&!p(t.target)&&s.length>0){var n=s[s.length-1].panel,e=u(t.target);e||r(n),e&&e!==n&&e.id!==n.id&&r(n)}}),n.on(e.event.tap,function(t){if(!(t.target.classList.contains("notification")||t.parentNode&&t.target.parentNode.classList.contains("notification")||p(t.target))){var n=l(t.target),e=null;if(n&&(e=d(t),e&&(e.classList.contains("active")?r(e):o(e))),e=u(t.target),!e&&!n&&s.length>0){var i=s[s.length-1].panel;u(t.target);r(i)}}}),e.panel=function(t){if("undefined"==typeof t)return{closeActive:function(){var t=s.length>0;return t&&r(s[s.length-1].panel),t}};var e="string"==typeof t?n.querySelector(t):t;if(null===e)throw new Error("The panel with ID "+t+" does not exist");return{open:function(){o(e)},close:function(){r(e)}}},t.phonon=e,"object"==typeof exports?module.exports=e.panel:"function"==typeof define&&define.amd&&define(function(){return e.panel})}(window,document,window.phonon||{});