text: /*!
   * wavesurfer.js 2.1.1 (2018-12-22)
   * https://github.com/katspaugh/wavesurfer.js
   * @license BSD-3-Clause
   */
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("elan",[],t):"object"==typeof exports?exports.elan=t():(e.WaveSurfer=e.WaveSurfer||{},e.WaveSurfer.elan=t())}(window,function(){return function(n){var r={};function a(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,a),t.l=!0,t.exports}return a.m=n,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(n,r,function(e){return t[e]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="localhost:8080/dist/plugin/",a(a.s=7)}({7:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(){function n(e,t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.Types={ALIGNABLE_ANNOTATION:"ALIGNABLE_ANNOTATION",REF_ANNOTATION:"REF_ANNOTATION"},this.data=null,this.params=e,this.container="string"==typeof e.container?document.querySelector(e.container):e.container,!this.container)throw Error("No container for ELAN")}return a(n,null,[{key:"create",value:function(e){return{name:"elan",deferInit:!(!e||!e.deferInit)&&e.deferInit,params:e,instance:n}}}]),a(n,[{key:"init",value:function(){this.bindClick(),this.params.url&&this.load(this.params.url)}},{key:"destroy",value:function(){this.container.removeEventListener("click",this._onClick),this.container.removeChild(this.table)}},{key:"load",value:function(e){var t=this;this.loadXML(e,function(e){t.data=t.parseElan(e),t.render(),t.fireEvent("ready",t.data)})}},{key:"loadXML",value:function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="document",n.send(),n.addEventListener("load",function(e){t&&t(e.target.responseXML)})}},{key:"parseElan",value:function(e){var n=this,t=Array.prototype.forEach,r=Array.prototype.map,a={media:{},timeOrder:{},tiers:[],annotations:{},alignableAnnotations:[]},i=e.querySelector("HEADER"),o="milliseconds"==i.getAttribute("TIME_UNITS"),u=i.querySelector("MEDIA_DESCRIPTOR");a.media.url=u.getAttribute("MEDIA_URL"),a.media.type=u.getAttribute("MIME_TYPE");var l=e.querySelectorAll("TIME_ORDER TIME_SLOT"),c={};return t.call(l,function(e){var t=parseFloat(e.getAttribute("TIME_VALUE"));o&&(t=Math.round(100*t)/1e5),c[e.getAttribute("TIME_SLOT_ID")]=t}),a.tiers=r.call(e.querySelectorAll("TIER"),function(e){return{id:e.getAttribute("TIER_ID"),linguisticTypeRef:e.getAttribute("LINGUISTIC_TYPE_REF"),defaultLocale:e.getAttribute("DEFAULT_LOCALE"),annotations:r.call(e.querySelectorAll("REF_ANNOTATION, ALIGNABLE_ANNOTATION"),function(e){var t={type:e.nodeName,id:e.getAttribute("ANNOTATION_ID"),ref:e.getAttribute("ANNOTATION_REF"),value:e.querySelector("ANNOTATION_VALUE").textContent.trim()};return n.Types.ALIGNABLE_ANNOTATION==t.type&&(t.start=c[e.getAttribute("TIME_SLOT_REF1")],t.end=c[e.getAttribute("TIME_SLOT_REF2")],a.alignableAnnotations.push(t)),a.annotations[t.id]=t})}}),a.tiers.forEach(function(e){e.annotations.forEach(function(e){null!=e.ref&&(e.reference=a.annotations[e.ref])})}),a.alignableAnnotations.sort(function(e,t){var n=e.start-t.start;return 0==n&&(n=t.end-e.end),n}),a.length=a.alignableAnnotations.length,a}},{key:"render",value:function(){var r=this,u=this.data.tiers;this.params.tiers&&(u=u.filter(function(e){return e.id in r.params.tiers}));var n={},l={};u.forEach(function(e,t){e.annotations.forEach(function(e){e.reference&&e.reference.type==r.Types.ALIGNABLE_ANNOTATION&&(e.reference.id in n||(n[e.ref]={}),n[e.ref][t]=e,l[t]=!0)})}),l=Object.keys(l).sort(),this.renderedAlignable=this.data.alignableAnnotations.filter(function(e){return n[e.id]});var e=this.table=document.createElement("table");e.className="wavesurfer-annotations";var t=document.createElement("thead"),a=document.createElement("tr");t.appendChild(a),e.appendChild(t);var i=document.createElement("th");i.textContent="Time",i.className="wavesurfer-time",a.appendChild(i),l.forEach(function(e){var t=u[e],n=document.createElement("th");n.className="wavesurfer-tier-"+t.id,n.textContent=t.id,n.style.width=r.params.tiers[t.id],a.appendChild(n)});var c=document.createElement("tbody");e.appendChild(c),this.renderedAlignable.forEach(function(a){var i=document.createElement("tr");i.id="wavesurfer-alignable-"+a.id,c.appendChild(i);var e=document.createElement("td");e.className="wavesurfer-time",e.textContent=a.start.toFixed(1)+"–"+a.end.toFixed(1),i.appendChild(e);var o=n[a.id];l.forEach(function(e){var t=u[e],n=document.createElement("td"),r=o[e];r&&(n.id="wavesurfer-annotation-"+r.id,n.dataset.ref=a.id,n.dataset.start=a.start,n.dataset.end=a.end,n.textContent=r.value),n.className="wavesurfer-tier-"+t.id,i.appendChild(n)})}),this.container.innerHTML="",this.container.appendChild(e)}},{key:"bindClick",value:function(){var r=this;this._onClick=function(e){var t=e.target.dataset.ref;if(null!=t){var n=r.data.annotations[t];n&&r.fireEvent("select",n.start,n.end)}},this.container.addEventListener("click",this._onClick)}},{key:"getRenderedAnnotation",value:function(t){var n;return this.renderedAlignable.some(function(e){return e.start<=t&&e.end>=t&&(n=e,!0)}),n}},{key:"getAnnotationNode",value:function(e){return document.getElementById("wavesurfer-alignable-"+e.id)}}]),n}();t.default=i,e.exports=t.default}})});
  //# sourceMappingURL=wavesurfer.elan.min.js.map