Demo for query storing
Change-Id: I947bcac841992c3f6cfd01ab337c265b0d01cb70
diff --git a/public/js/kalamar-0.41.1-de.js b/public/js/kalamar-0.41.1-de.js
new file mode 100644
index 0000000..2b226d1
--- /dev/null
+++ b/public/js/kalamar-0.41.1-de.js
@@ -0,0 +1,12 @@
+!function(){
+/**
+ * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
+ * Released under MIT license, http://github.com/requirejs/almond/LICENSE
+ */
+var t,e,n;!function(i){var r,o,s,a,c={},l={},u={},h={},d=Object.prototype.hasOwnProperty,f=[].slice,p=/\.js$/;function m(t,e){return d.call(t,e)}function g(t,e){var n,i,r,o,s,a,c,l,h,d,f,m=e&&e.split("/"),g=u.map,_=g&&g["*"]||{};if(t){for(s=(t=t.split("/")).length-1,u.nodeIdCompat&&p.test(t[s])&&(t[s]=t[s].replace(p,"")),"."===t[0].charAt(0)&&m&&(t=m.slice(0,m.length-1).concat(t)),h=0;h<t.length;h++)if("."===(f=t[h]))t.splice(h,1),h-=1;else if(".."===f){if(0===h||1===h&&".."===t[2]||".."===t[h-1])continue;h>0&&(t.splice(h-1,2),h-=2)}t=t.join("/")}if((m||_)&&g){for(h=(n=t.split("/")).length;h>0;h-=1){if(i=n.slice(0,h).join("/"),m)for(d=m.length;d>0;d-=1)if((r=g[m.slice(0,d).join("/")])&&(r=r[i])){o=r,a=h;break}if(o)break;!c&&_&&_[i]&&(c=_[i],l=h)}!o&&c&&(o=c,a=l),o&&(n.splice(0,a,o),t=n.join("/"))}return t}function _(t,e){return function(){var n=f.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),o.apply(void 0,n.concat([t,e]))}}function v(t){return function(e){c[t]=e}}function y(t){if(m(l,t)){var e=l[t];delete l[t],h[t]=!0,r.apply(void 0,e)}if(!m(c,t)&&!m(h,t))throw new Error("No "+t);return c[t]}function b(t){var e,n=t?t.indexOf("!"):-1;return n>-1&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),[e,t]}function w(t){return t?b(t):[]}function E(t){return function(){return u&&u.config&&u.config[t]||{}}}s=function(t,e){var n,i,r=b(t),o=r[0],s=e[1];return t=r[1],o&&(n=y(o=g(o,s))),o?t=n&&n.normalize?n.normalize(t,(i=s,function(t){return g(t,i)})):g(t,s):(o=(r=b(t=g(t,s)))[0],t=r[1],o&&(n=y(o))),{f:o?o+"!"+t:t,n:t,pr:o,p:n}},a={require:function(t){return _(t)},exports:function(t){var e=c[t];return void 0!==e?e:c[t]={}},module:function(t){return{id:t,uri:"",exports:c[t],config:E(t)}}},r=function(t,e,n,i){var r,o,u,d,f,p,g,b=[],E=typeof n;if(p=w(i=i||t),"undefined"===E||"function"===E){for(e=!e.length&&n.length?["require","exports","module"]:e,f=0;f<e.length;f+=1)if("require"===(o=(d=s(e[f],p)).f))b[f]=a.require(t);else if("exports"===o)b[f]=a.exports(t),g=!0;else if("module"===o)r=b[f]=a.module(t);else if(m(c,o)||m(l,o)||m(h,o))b[f]=y(o);else{if(!d.p)throw new Error(t+" missing "+o);d.p.load(d.n,_(i,!0),v(o),{}),b[f]=c[o]}u=n?n.apply(c[t],b):void 0,t&&(r&&void 0!==r.exports&&r.exports!==c[t]?c[t]=r.exports:void 0===u&&g||(c[t]=u))}else t&&(c[t]=n)},t=e=o=function(t,e,n,i,c){if("string"==typeof t)return a[t]?a[t](e):y(s(t,w(e)).f);if(!t.splice){if((u=t).deps&&o(u.deps,u.callback),!e)return;e.splice?(t=e,e=n,n=null):t=void 0}return e=e||function(){},"function"==typeof n&&(n=i,i=c),i?r(void 0,t,e,n):setTimeout((function(){r(void 0,t,e,n)}),4),o},o.config=function(t){return o(t)},t._defined=c,(n=function(t,e,n){if("string"!=typeof t)throw new Error("See almond README: incorrect module build, no module name");e.splice||(n=e,e=[]),m(c,t)||m(l,t)||(l[t]=[t,e,n])}).amd={jQuery:!0}}(),n("lib/almond",(function(){})),window.KorAP=window.KorAP||{},void 0===Event.halt&&(Event.prototype.halt=function(){this.stopPropagation(),this.preventDefault()});const r=new RegExp('(["\\\\])',"g");String.prototype.quote=function(){return'"'+this.replace(r,"\\$1")+'"'};const o=new RegExp("([/\\\\])","g");String.prototype.escapeRegex=function(){return this.replace(o,"\\$1")};const c=new RegExp("[^-a-zA-Z0-9_\\s]+","g"),l=new RegExp("[-\\s]+","g");function h(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function d(t){return t.charCode&&0==t.keyCode?t.charCode:t.keyCode}function f(t){return("0"+t.toString(16)).substr(-2)}String.prototype.slugify=function(){return this.toLowerCase().replace(c,"").replace(l,"-")},HTMLElement.prototype.toggleClass=function(t,e){const n=this.classList;n.contains(t)?(n.add(e),n.remove(t)):(n.remove(e),n.add(t))},HTMLElement.prototype.addE=function(t){return this.appendChild(document.createElement(t))},HTMLElement.prototype.addT=function(t){return this.appendChild(document.createTextNode(t))},n("util",[],(function(){KorAP.API=KorAP.API||{},KorAP.Locale=KorAP.Locale||{};const t=KorAP.Locale;return t.OR=t.OR||"or",t.AND=t.AND||"and",KorAP.newStyleSheet=function(){if(void 0===KorAP._sheet){const t=document.createElement("style");document.head.appendChild(t),KorAP._sheet=t.sheet}return KorAP._sheet},KorAP.log=KorAP.log||function(t,e,n){n&&(e+=" from "+n),console.log(t+": "+e)},KorAP})),KorAP.annotationHelper=KorAP.annotationHelper||{"-":[]},n("hint/foundries",["util"],(function(){const t=KorAP.annotationHelper;return t.getDesc=function(t,e){if(!t)return;let n=this[t];if(n){if(e.includes(":")){{const i=e.split(":");let r=i[0]+":",o=i[1]+" ",s="";for(let t=0;t<n.length;t++)if(n[t]&&n[t][1]==r){n[t][2]?s+=n[t][2]:s+=n[t][0];break}if(0===s.length)return;if(n=this[t+r],!n)return;for(let t=0;t<n.length;t++)if(n[t]&&n[t][1]==o)return n[t][2]&&(s+=": "+n[t][2]),s}return""}e+=" ";for(var i=0;i<n.length;i++)if(n[i]&&n[i][1]==e)return n[i][2]?n[i][2]:void 0}},t})),n("hint/foundries/base",["hint/foundries"],(function(t){t["-"].push(["Base Annotation","base/s=","Structure"]),t["base/s="]=[["s","s","Sentence"],["p","p","Paragraph"],["t","t","Text"]]})),n("hint/foundries/dereko",["hint/foundries"],(function(t){t["-"].push(["DeReKo","dereko/s=","Structure"])})),n("hint/foundries/storedQueries",["hint/foundries"],(function(t){t["-"].push(["Stored Queries","storedQ/=","stored online"]),t["storedQ/="]=[["Baum","baum","DescBaum"],["Holz","holz","DescParagraph"],["Blatt","blatt","DescText"]]})),e(["hint/foundries/base","hint/foundries/dereko","hint/foundries/storedQueries"]),n("default",(function(){})),n("menu/item",{create:function(t){return Object.create(this)._init(t)},upgradeTo:function(t){for(let e in t)this[e]=t[e];return this},content:function(t){return 1===arguments.length&&(this._content=document.createTextNode(t)),this._content},action:function(t){return 1===arguments.length&&(this._action=t),this._action},lcField:function(){return this._lcField},active:function(t){const e=this.element().classList;if(void 0===t)return e.contains("active");t?e.add("active"):e.remove("active")},noMore:function(t){const e=this.element().classList;if(void 0===t)return e.contains("no-more");t?e.add("no-more"):e.remove("no-more")},element:function(){if(void 0!==this._el)return this._el;const t=document.createElement("li");return void 0!==this.onclick&&(t.onclick=this.onclick.bind(this)),t.appendChild(this.content()),this._el=t},highlight:function(t){if(this._prefix===t)return;null!==this._prefix&&this.lowlight();const e=this.element().childNodes;for(let n=e.length-1;n>=0;n--)this._highlight(e[n],t);this._prefix=t},lowlight:function(){if(null===this._prefix)return;const t=this.element(),e=t.getElementsByTagName("mark");for(let t=e.length-1;t>=0;t--)e[t].parentNode.replaceChild(document.createTextNode(e[t].firstChild.nodeValue),e[t]);t.normalize(),this._prefix=null},_highlight:function(t,e){if(3===t.nodeType){const n=t.nodeValue,i=n.toLowerCase();if(e){const r=(e=e.trim()).split(" ");let o,s=-1,a=0;if(r.forEach((function(t){o=i.indexOf(t),o<0||(-1===s||o<s?(s=o,a=t.length):o===s&&t.length>a&&(a=t.length))})),s>=0){s>0&&t.parentNode.insertBefore(document.createTextNode(n.substr(0,s)),t);const i=document.createElement("mark");i.appendChild(document.createTextNode(n.substr(s,a))),t.parentNode.insertBefore(i,t);const r=n.substr(s+a);if(r.length>0){const n=document.createTextNode(r);t.parentNode.insertBefore(n,t),this._highlight(n,e)}t.parentNode.removeChild(t)}}}else{const n=t.childNodes;for(let t=n.length-1;t>=0;t--)this._highlight(n[t],e)}},_init:function(t){if(void 0===t[0])throw new Error("Missing parameters");const e=this;return e.content(t[0]),t.length>1&&(e._action=t[1],t.length>2&&(e._onclick=t[2])),e._lcField=" "+e.content().textContent.toLowerCase(),e._prefix=null,this},onclick:function(t){const e=this.menu();e.prefix(""),this._onclick&&this._onclick.apply(this,t),e.hide()},menu:function(){return this._menu}}),n("menu/prefix",{create:function(){return Object.create(this)._init()},_init:function(){const t=this;return t._string="",t._el=document.createElement("span"),t._el.classList.add("pref"),void 0!==t.onclick&&(t._el.onclick=t.onclick.bind(t)),t},_update:function(){return this._el.innerHTML=this._string},upgradeTo:function(t){for(let e in t)this[e]=t[e];return this},active:function(t){const e=this.element().classList;if(void 0===t)return e.contains("active");t?e.add("active"):e.remove("active")},isSet:function(){return this._string.length>0},value:function(t){return 1===arguments.length?(this._string=t,this._update()):this._string},add:function(t){return this._string+=t,this._update()},clear:function(){return this._string="",this._update()},onclick:function(){},chop:function(){const t=this;return t._string.length>1?t._string=t._string.substring(0,t._string.length-1):t._string="",t._update()},element:function(){return this._el},menu:function(){return this._menu}}),n("menu/lengthField",{create:function(){return Object.create(this)._init()},_init:function(){return this._el=document.createElement("div"),this._el.classList.add("lengthField"),this},upgradeTo:function(t){for(let e in t)this[e]=t[e];return this},element:function(){return this._el},add:function(t){this._el.appendChild(document.createElement("span")).appendChild(document.createTextNode(t[0]+"--"))},reset:function(){for(;this._el.firstChild;)this._el.firstChild.remove()}}),n("menu/slider",{create:function(t){return Object.create(this)._init(t)},length:function(t){return 0===arguments.length?this._length:(t==this._length||(this._length=t),this)},limit:function(t){return 0===arguments.length?this._limit:(t==this._limit||(this._limit=t),this)},active:function(t){return 1===arguments.length&&(t?this._active||(this._el.classList.add("active"),this._active=!0):this._active&&(this._el.classList.remove("active"),this._active=!1)),this._active},movetoRel:function(t){const e=t/(this._rulerHeight-this._sliderHeight),n=this.offset(parseInt(e*this._screens)+this._event.initOffset);void 0!==n&&this._menu.screen(n)},movetoAbs:function(t){const e=t/this._rulerHeight,n=this.offset(parseInt(e*(this._screens+1)));void 0!==n&&this._menu.screen(n)},offset:function(t){return 0===arguments.length?this._offset:(t>this._screens?t=this._screens:t<0&&(t=0),t!==this._offset?(this._offset=t,this._slider.style.top=this._step*t+"%",t):void 0)},element:function(){return this._el},reInit:function(){const t=this,e=t._el.style;t._length<=t._limit?e.display="none":(e.display="block",t._height=t._limit/t._length*100,t._screens=t._length-t._limit,t._step=(100-t._height)/t._screens,t._slider.style.height=t._height+"%")},_init:function(t){const e=this;e._menu=t,e._offset=0,e._event={},e._active=!1;const n=e._el=document.createElement("div");return n.setAttribute("class","ruler"),e._slider=n.appendChild(document.createElement("span")),e._ruler=n.appendChild(document.createElement("div")),e._ruler.addEventListener("mousedown",(function(t){t.halt()}),!1),e._ruler.addEventListener("click",e._mouseclick.bind(e),!1),e._slider.addEventListener("mousedown",e._mousedown.bind(e),!1),e},_initClientHeight:function(){this._rulerHeight=this._el.clientHeight,this._sliderHeight=this._slider.clientHeight},_mousemove:function(t){this.movetoRel(t.clientY-this._event.init),t.halt()},_mouseup:function(t){this.active(!1),window.removeEventListener("mousemove",this._event.mov),window.removeEventListener("mouseup",this._event.up),this._menu.focus()},_mousedown:function(t){const e=this._event;e.init=t.clientY,e.initOffset=this._offset,e.mov=this._mousemove.bind(this),e.up=this._mouseup.bind(this),this._initClientHeight(),this.active(!0),window.addEventListener("mousemove",e.mov),window.addEventListener("mouseup",e.up),t.halt()},_mouseclick:function(t){this._initClientHeight(),this.movetoAbs(t.clientY-this._ruler.getClientRects()[0].top),t.halt()}}),n("menu",["menu/item","menu/prefix","menu/lengthField","menu/slider","util"],(function(t,e,n,i){return{create:function(t,e){return Object.create(this)._init(t,e)},_init:function(r,o){void 0===o&&(o={});const s=this;s._itemClass=o.itemClass||t,void 0!==o.prefixClass?s._prefix=o.prefixClass.create():s._prefix=e.create(),s._prefix._menu=s,void 0!==o.lengthFieldClass?s._lengthField=o.lengthFieldClass.create():s._lengthField=n.create(),s._lengthField._menu=s,s._slider=i.create(s);var a=document.createElement("ul");return a.style.outline=0,a.setAttribute("tabindex",0),a.classList.add("menu","roll"),a.appendChild(s._prefix.element()),a.appendChild(s._lengthField.element()),a.appendChild(s._slider.element()),a.menu=s,a.addEventListener("keydown",s._keydown.bind(s),!1),a.addEventListener("keypress",s._keypress.bind(s),!1),a.addEventListener("wheel",s._mousewheel.bind(s),!1),["touchstart","touchend","touchmove"].forEach(t=>a.addEventListener(t,s._touch.bind(s),!1)),s._el=a,s._limit=8,s._items=new Array,s.readItems(r),s.dontHide=!1,s},readItems:function(t){const e=this;e._list=void 0;for(let t=0;t<e._items.length;t++)delete e._items[t]._menu,delete e._items[t];e._items=new Array,e.removeItems(),e._lengthField.reset(),t.forEach((function(t){const e=this._itemClass.create(t);e._menu=this,this._lengthField.add(t),this._items.push(e)}),e),e._slider.length(e.liveLength()).limit(e._limit).reInit(),e._firstActive=!1,e.offset=0,e.position=0},_initList:function(){const t=this;if(void 0===t._list?t._list=[]:0!==t._list.length&&(t._boundary(!1),t._list.length=0),t.offset=0,t.prefix().length<=0){let e=0;for(;e<t._items.length;e++)t._list.push(e),t._items[e].lowlight();return t._slider.length(e).reInit(),!0}const e=t.prefix().toLowerCase().split(" ");let n=1;return t._items.forEach((function(t,i){let r=0;e.forEach((function(e){t.lcField().includes(" "+e)?r+=5:t.lcField().includes(e)&&(r+=1)})),r>n?(this._list=[i],n=r):r==n&&this._list.push(i)}),t),t._slider.length(t._list.length).reInit(),t._list.length>0},destroy:function(){const t=this;null!=t._el&&delete t._el.menu,t._items.forEach((function(t){delete t._menu})),delete t._prefix._menu,delete t._lengthField._menu,delete t._slider._menu},focus:function(){this._el.focus()},_mousewheel:function(t){const e=t.deltaY/120;e>0?this.next():e<0&&this.prev(),t.halt()},_touch:function(t){this.slider();if("touchstart"===t.type)this._lastTouch=t.touches[0].clientY;else if("touchend"===t.type)this._lastTouch=void 0;else if("touchmove"===t.type){const e=t.touches[0];this._lastTouch+26<e.clientY?(this.viewDown(),this._lastTouch=e.clientY):this._lastTouch-26>e.clientY&&(this.viewUp(),this._lastTouch=e.clientY),t.halt()}},_keydown:function(t){const e=this;switch(d(t)){case 27:t.halt(),e.hide();break;case 38:t.halt(),e.prev();break;case 33:t.halt(),e.pageUp();break;case 40:t.halt(),e.next();break;case 34:t.halt(),e.pageDown();break;case 39:if(e._prefix.active())break;const n=e.liveItem(e.position);void 0!==n.further&&n.further.bind(n).apply(),t.halt();break;case 13:e._prefix.active()?e._prefix.onclick(t):e.liveItem(e.position).onclick(t),t.halt();break;case 8:e._prefix.chop(),e.show(),t.halt()}},_keypress:function(t){0!==t.charCode&&(t.halt(),this._prefix.add(String.fromCharCode(d(t))),this.show())},screen:function(t){const e=this;if(t<0)t=0;else{if(e.liveLength()<e.limit())return!1;t>e.liveLength()-e.limit()&&(t=e.liveLength()-e.limit())}return e.offset!==t&&(e._showItems(t),!0)},element:function(){return this._el},itemClass:function(){return this._itemClass},limit:function(t){return 1===arguments.length?(this._limit!==t&&(this._limit=t,this._slider.limit(t).reInit()),this):this._limit},upgradeTo:function(t){for(var e in t)this[e]=t[e];return this},show:function(t){const e=this;if(e._unmark(),e.removeItems(),!e._initList())return e._prefix.active(!0),e._el.classList.add("visible"),!0;let n=0;if(1===arguments.length){if(t<0?t=0:t>=e.liveLength()&&(t=e.liveLength()-1),t>=e._limit){n=t;const i=e.liveLength()-e._limit;n>i&&(n=i)}e.position=t}else e._firstActive?e.position=0:e.position=-1;return e.offset=n,e._showItems(n),-1!==e.position&&e.liveItem(e.position).active(!0),e._prefix.active(!1),e._el.classList.add("visible"),e._boundary(!0),!0},hide:function(){this.dontHide||(this.removeItems(),this._prefix.clear(),this.onHide(),this._el.classList.remove("visible"))},onHide:function(){},prefix:function(t){return 1===arguments.length?(this._prefix.value(t),this):this._prefix.value()},lengthField:function(){return this._lengthField},slider:function(){return this._slider},removeItems:function(){const t=this._el.childNodes;for(let e=t.length-1;e>=3;e--)this._el.removeChild(t[e])},item:function(t){return this._items[t]},liveItem:function(t){if(void 0!==this._list||this._initList())return this._items[this._list[t]]},shownItem:function(t){if(!(t>=this.limit()))return this.liveItem(this.offset+t)},length:function(){return this._items.length},liveLength:function(){return void 0===this._list&&this._initList(),this._list.length},next:function(){const t=this;if(0===t.liveLength())return;-1===t.position||t._prefix.active()||t.liveItem(t.position).active(!1),t.position++;let e=t.liveItem(t.position);if(void 0===e){const n=this._prefix;if(n.isSet()&&!n.active())return t.position--,void n.active(!0);e=t.liveItem(0),t.position=0,t._showItems(0)}else t.position>=t.limit()+t.offset?t.screen(t.position-t.limit()+1):t.position<=t.offset&&t.screen(t.position);t._prefix.active(!1),e.active(!0)},prev:function(){const t=this;if(0===t.liveLength())return;t._prefix.active()||(-1===t.position?t.position=t.liveLength():t.liveItem(t.position--).active(!1));let e=t.liveItem(t.position);if(void 0===e){const n=t._prefix;let i=t.liveLength()-t.limit();if(i=i<0?0:i,t.position=t.liveLength()-1,n.isSet()&&!n.active())return t.position++,n.active(!0),void(t.offset=i);e=t.liveItem(t.position),t._showItems(i)}else t.position<t.offset?t.screen(t.position):t.position>=t.limit()+t.offset&&t.screen(t.position-t.limit()+2);t._prefix.active(!1),e.active(!0)},pageUp:function(){this.screen(this.offset-this.limit())},pageDown:function(){this.screen(this.offset+this.limit())},viewUp:function(){this.screen(this.offset-1)},viewDown:function(){this.screen(this.offset+1)},_unmark:function(){this._list.forEach((function(t){const e=this._items[t];e.lowlight(),e.active(!1)}),this)},_boundary:function(t){0!==this._list.length&&(this.item(this._list[0]).noMore(t),this.item(this._list[this._list.length-1]).noMore(t))},_showItems:function(t){const e=this;if(e.offset===t-1)e.offset=t,e._el.removeChild(e._el.children[3]),e._append(e._list[e.offset+e.limit()-1]);else if(e.offset===t+1)e.offset=t,e._el.removeChild(e._el.lastChild),e._prepend(e._list[e.offset]);else{e.offset=t,e.removeItems();let n=0;for(let i=0;i<e._list.length&&(n++,n<=t||(e._append(e._list[i]),!(n>=e.limit()+t)));i++);}e._slider.offset(e.offset)},_append:function(t){const e=this.item(t);this.prefix().length>0&&e.highlight(this.prefix().toLowerCase()),this.element().appendChild(e.element())},_prepend:function(t){const e=this.item(t);this.prefix().length>0&&e.highlight(this.prefix().toLowerCase());const n=this.element();n.insertBefore(e.element(),n.children[3])}}})),n("buttongroup/menu",["menu"],(function(t){return{create:function(e,n){const i=Object.create(t).upgradeTo(this)._init(e,{itemClass:n});i.limit(6);const r=i.element();return r.addEventListener("blur",(function(t){this.menu.hide()})),r.classList.add("button-group-list"),document.getElementsByTagName("body")[0].appendChild(r),i},panel:function(t){return void 0!==t&&(this._panel=t),this._panel},button:function(t){this._button=t,this._repos(this._button),this.slider().reInit(),void 0!==this._onscroll&&window.removeEventListener("scroll",this._onscroll),this._onscroll=function(){this._repos(this._button)}.bind(this),window.addEventListener("scroll",this._onscroll)},onHide:function(){void 0!==this._onscroll&&window.removeEventListener("scroll",this._onscroll),this.element().blur()},_repos:function(t){const e=t.getBoundingClientRect();this._el.style.left=e.left+"px",this._el.style.top=e.top+e.height-this._el.clientHeight+"px"}}})),n("buttongroup",["buttongroup/menu","menu/item","util"],(function(t,e){return{create:function(t){return Object.create(this)._init(t)},_init:function(t){const e=document.createElement("div"),n=e.classList;return t&&n.add.apply(n,t),n.add("button-group"),this._el=e,this},element:function(){return this._el},upgradeTo:function(t){for(var e in t)this[e]=t[e];return this},add:function(t,e,n){const i=this._el.addE("span");i.setAttribute("title",t),void 0!==e&&(void 0!==e.cls&&i.classList.add.apply(i.classList,e.cls),void 0!==e.icon&&i.setAttribute("data-icon",e.icon),void 0!==e.state&&(i.state=e.state)),i.addE("span").addT(t);let r=this;return i.addEventListener("click",(function(t){t.halt();let e=r._bind||this;e.button=i,n.apply(e,t)})),i},addList:function(n,i,r=e){const o=t.create([],r);return this.add(n,i,(function(t){o.show(),o.button(this.button),o.focus()})),o},addToggle:function(t,e,n){const i=this._el.addE("span");i.setAttribute("title",t),null!=e&&void 0!==e.cls&&i.classList.add.apply(i.classList,e.cls);const r=i.addE("span");r.classList.add("check","button-icon"),r.addE("span"),r.setState=function(t){t?this.classList.add("checked"):this.classList.remove("checked")},n.associate(r),i.addE("span").addT(t);return i.addEventListener("click",(function(t){t.halt(),n.roll()})),i},bind:function(t){return void 0!==t?(this._bind=t,this):this._bind||this},clear:function(){return h(this._el),this}}})),n("vc/operators",["buttongroup"],(function(t){const e=KorAP.Locale;function n(t){return null!=t&&!1!==t}function i(t,e){const n=t.parent();if("docGroup"===t.ldType()){if(t.operation()===e)return;return null!==n.ldType()?n.newAfter(t):t.wrapOnRoot()}if("doc"===t.ldType()||"docGroupRef"===t.ldType())return null===n.ldType()?t.wrapOnRoot(e):n.operation()===e?n.newAfter(t):t.wrap(e)}return e.DEL=e.DEL||"×",KorAP._and=function(){return i(this,"and")},KorAP._or=function(){return i(this,"or")},KorAP._delete=function(){if(null!==this.parent().ldType())return this.parent().delOperand(this).update();this.parent().clean()},{create:function(e,n,i){var r=Object(t).create(["operators"]).upgradeTo(this);return r.and(e),r.or(n),r.del(i),r.update(),r},update:function(){const t=this;return t.clear(),!0===t._and&&t.add(e.AND,{cls:["and"]},KorAP._and),!0===t._or&&t.add(e.OR,{cls:["or"]},KorAP._or),!0===t._del&&t.add(e.DEL,{cls:["delete"]},KorAP._delete),t.element()},parent:function(t){return 1===arguments.length&&(this._parent=t,this.bind(t)),this._parent},and:function(t){return 1===arguments.length&&(this._and=n(t)),this._and},or:function(t){return 1===arguments.length&&(this._or=n(t)),this._or},del:function(t){return 1===arguments.length&&(this._del=n(t)),this._del}}})),n("vc/jsonld",["vc/operators"],(function(t){return{__changed:!1,create:function(){return Object.create(this)},upgradeTo:function(t){for(let e in t)this[e]=t[e];return this},ldType:function(t){return 1===arguments.length&&(this._ldType=t),this._ldType},parent:function(t){return 1===arguments.length&&(this._parent=t,this.__changed=!0),this._parent},destroy:function(){const t=this;null!=t._ops&&(t._ops._parent=void 0,void 0!==t._ops._el&&(t._ops._el.refTo=void 0),t._ops=void 0),void 0!==t._el&&(t._el=void 0),void 0!==t._operands&&(t._operands.forEach(t=>t.destroy()),t._operands=[])},wrapOnRoot:function(t){const n=this.parent(),i=e("vc/docgroup").create(n);return 1===arguments.length?i.operation(t):i.operation("and"===this.operation()?"or":"and"),i.append(this),this.parent(i),i.append(),i.element(),n.root(i),this.parent()},operators:function(e,n,i){return 0===arguments||(this._ops=t.create(e,n,i),this._ops.parent(this)),this._ops},toJson:function(){return{"@type":"koral:"+this.ldType()}},rewrites:function(){return null},incomplete:function(){return!1},toQuery:function(){return""}}})),n("vc/rewrite",["vc/jsonld","util"],(function(t){const e=new RegExp("^(operation:)?(?:injec|inser|modifica|dele)tion|override$");return{create:function(e){return Object(t).create().upgradeTo(this).fromJson(e)},src:function(t){return 1===arguments.length&&(this._src=t),this._src},operation:function(t){if(1===arguments.length){if(!e.test(t))return void KorAP.log(814,"Unknown rewrite operation");this._op=t}return this._op||"injection"},scope:function(t){return 1===arguments.length&&(this._scope=t),this._scope},fromJson:function(t){if(void 0===t)return this;if(void 0!==t["@type"]){if(void 0!==t.src&&"string"==typeof t.src)return this.src(t.src),void 0!==t.operation&&this.operation(t.operation.replace(/^operation:/,"")),void 0!==t.scope&&"string"==typeof t.scope&&this.scope(t.scope),this;KorAP.log(815,"Rewrite expects source")}else KorAP.log(701,"JSON-LD group has no @type attribute")},toString:function(){let t="";const e=this.operation();return t+=e.charAt(0).toUpperCase()+e.slice(1),t+=" of "+(null===this._scope?"object":this.scope().quote()),t+=" by "+this.src().quote(),t}}})),n("vc/rewritelist",["vc/jsonld","vc/rewrite","util"],(function(t,e){return{create:function(e){return Object(t).create().upgradeTo(this).fromJson(e)},fromJson:function(t){return this._list=new Array,t.forEach(t=>this._list.push(e.create(t))),this},length:function(){return this._list.length},element:function(){if(void 0!==this._el)return this._el;const t=this._el=document.createElement("div");t.setAttribute("class","rewrite");const e=[];let n,i;return this._list.forEach((function(t){n=document.createElement("span"),n.setAttribute("class",t.operation()),i=t.src(),void 0!==t.scope()&&(i+=": "+t.scope()),n.addT(i),e.push(i+" ("+t.operation()+")"),this._el.appendChild(n)}),this),t.setAttribute("title",e.join("\n")),t}}})),n("vc/stringval",["util"],(function(){const t=KorAP.Locale;return t.REGEX=t.REGEX||"RegEx",t.REGEX_DESC=t.REGEX_DESC||"Use a regular expression",{create:function(){const t=arguments;let e=!0,n=!1,i="";return t.length>=1&&void 0!==t[0]&&(i=t[0]),t.length>=2&&void 0!==t[1]&&(n=t[1]),t.length>=3&&(e=t[2],!1===e&&(n=!1)),Object.create(this)._init(i,n,e)},_init:function(t,e,n){return this.value(t),this.regex(e),this._regexOp(n),this},regex:function(t){return 1===arguments.length&&(this._regex=!!t,this._update()),this._regex},_regexOp:function(t){return 1===arguments.length&&(this.__regexOp=!!t,this._update()),this.__regexOp},toggleRegex:function(){this.regex(!1===this._regex)},value:function(t){return 1===arguments.length&&(this._value=t,this._update()),this._value},_update:function(){if(void 0===this._el)return;this._value=this._input.value;const t=this._el.classList;this._regexOp()&&this._regex?t.add("regex"):t.remove("regex")},store:function(t,e){},focus:function(){this._el.children[0].focus()},element:function(){if(void 0!==this._el)return this._el;const t=this._el=document.createElement("div");t.setAttribute("tabindex",0),t.style.outline=0;const e=t.classList;if(e.add("value"),!0===this.regex()&&e.add("regex"),this._input=t.addE("input"),void 0!==this.value()&&(this._input.value=this.value()),this._regexOp()){const e=t.addE("div");e.addEventListener("click",function(){this.toggleRegex()}.bind(this),!0),e.setAttribute("title","Use as regular expression"),e.addT("RegEx")}return this._input.addEventListener("blur",function(t){const e=this;e._inField||(e.value(e._input.value),e.store(e.value(),e.regex())),t.halt()}.bind(this)),t.addEventListener("mousedown",function(){this._inField=!0}.bind(this)),t.addEventListener("mouseup",function(){this._inField=!1,this._input.focus()}.bind(this)),this._input.addEventListener("keypress",function(t){const e=this;if(13==t.keyCode)return e.value(e._input.value),e.store(e.value(),e.regex()),!1}.bind(this)),t}}})),n("vc/docgroupref",["vc/jsonld","vc/rewritelist","vc/stringval","util"],(function(t,n,i){const r=KorAP.Locale;return r.EMPTY=r.EMPTY||"⋯",{_ldType:"docGroupRef",create:function(e,n){const i=Object(t).create().upgradeTo(this).fromJson(n);return void 0===i&&console.log(n),void 0!==e&&(i._parent=e),i.__changed=!0,i},update:function(){const t=this;if(void 0===t._el)return t.element();const e=t._el;if(!t.__changed)return e;e.refTo=t,void 0!==t.rewrites()&&e.classList.add("rewritten");const n=document.createElement("span");n.classList.add("key","fixed","ref"),n.addT("referTo");const i=t._refE=document.createElement("span");return i.setAttribute("data-type","string"),i.setAttribute("class","value"),this.ref()?i.addT(t.ref()):(i.addT(r.EMPTY),i.classList.add("unspecified")),i.addEventListener("click",t._changeRef.bind(t)),h(e),e.appendChild(n),e.appendChild(i),t.__changed=!1,void 0!==t._rewrites&&e.appendChild(t._rewrites.element()),void 0!==t._parent&&e.appendChild(t.operators(!0,!0,!0).element()),void 0!==KorAP.vc&&KorAP.vc.element().dispatchEvent(new CustomEvent("vcChange",{detail:t})),t.element()},element:function(){if(void 0!==this._el)return this._el;const t=this._el=document.createElement("div");return t.setAttribute("class","doc groupref"),this.update(),t},ref:function(t){return 1===arguments.length?(this._ref=t,this._changed(),this):this._ref},_changeRef:function(t){const e=this,n=i.create(this.ref(),!1,!1),r=n.element();n.store=function(t,n){e.ref(t),e._el.removeChild(this._el),e.update()},this._el.insertBefore(r,this._refE),n.focus()},wrap:function(t){const n=this.parent(),i=e("vc/docgroup").create(n);return i.operation(t),i.append(this),i.append(),n.replaceOperand(this,i).update()},fromJson:function(t){if(void 0===t)return this;if(void 0!==t["@type"]){if(void 0!==t.ref&&"string"==typeof t.ref)return this.ref(t.ref),void 0!==t.rewrites&&this.rewrite(t.rewrites),this;KorAP.log(821,"Reference is missing")}else KorAP.log(701,"JSON-LD group has no @type attribute")},onclick:function(){console.log("Do not support click on this")},rewrites:function(){return this._rewrites},rewrite:function(t){"string"==typeof t&&(t=[{"@type":"koral:rewrite",operation:"operation:"+t,src:"Kalamar"}]),this._rewrites=n.create(t)},_changed:function(){this.__changed=!0,void 0!==this._rewrites&&(delete this._rewrites,void 0!==this._el&&this._el.classList.remove("rewritten"))},toJson:function(){return this.ref?{"@type":"koral:"+this.ldType(),ref:this.ref()}:{}},incomplete:function(){return!this.ref()},toQuery:function(){return this.incomplete()?"":"referTo "+this.ref().quote()}}})),n("vc/doc",["vc/jsonld","vc/rewritelist","vc/stringval","vc/docgroupref","util"],(function(t,n,i,r){const o="Match type is not supported by value type",s=KorAP.Locale;return s.EMPTY=s.EMPTY||"⋯",{_ldType:"doc",_obj:function(){return"???"},create:function(e,n){const i=Object(t).create().upgradeTo(this).fromJson(n);if(void 0!==i)return void 0!==e&&(i._parent=e),i.__changed=!0,i;console.log(n)},update:function(){const t=this;if(void 0===t._el)return t.element();const e=t._el;if(!t.__changed)return e;e.refTo=t,void 0!==t.rewrites()&&e.classList.add("rewritten");const n=t._keyE=document.createElement("span");if(n.setAttribute("class","key"),n.addEventListener("click",t._changeKey.bind(t)),t.key()){const e=t.key();void 0!==s["VC_"+e]&&(e=s["VC_"+e]),n.addT(e)}const i=t._matchopE=document.createElement("span");i.setAttribute("data-type",t.type()),i.setAttribute("class","match"),i.addT(t.matchop()),t._matchopE.addEventListener("click",t._changeMatchop.bind(t));const r=t._valueE=document.createElement("span");return r.setAttribute("data-type",t.type()),r.setAttribute("class","value"),t.value()?r.addT(t.value()):(r.addT(s.EMPTY),r.classList.add("unspecified")),r.addEventListener("click",t._changeValue.bind(t)),h(e),e.appendChild(n),e.appendChild(i),e.appendChild(r),t.__changed=!1,void 0!==t._rewrites&&e.appendChild(t._rewrites.element()),void 0!==t._parent&&e.appendChild(t.operators(!0,!0,!0).element()),KorAP.vc&&KorAP.vc.element().dispatchEvent(new CustomEvent("vcChange",{detail:t})),e},element:function(){const t=this;return void 0!==t._el||(t._el=document.createElement("div"),t._el.setAttribute("class","doc"),t.update()),t._el},wrap:function(t){const n=this.parent(),i=e("vc/docgroup").create(n);return i.operation(t),i.append(this),i.append(),n.replaceOperand(this,i).update()},replaceWith:function(t){const e=this.parent();"docGroup"===e.ldType()?e.replaceOperand(this,t):null==e.ldType()&&e.root(t),e.update(),this.destroy()},fromJson:function(t){const e=this;if(void 0===t)return e;if(void 0===t["@type"])return void KorAP.log(701,"JSON-LD group has no @type attribute");if(void 0===t.value||"string"!=typeof t.value)return void KorAP.log(805,"Value is invalid");let n;if(void 0!==t.key&&"string"==typeof t.key){if(e.key(t.key),void 0!==t.match){if("string"!=typeof t.match)return void KorAP.log(802,o);e.matchop(t.match)}if(void 0===t.type&&KorAP._vcKeyMenu){const n=KorAP._vcKeyMenu.typeOf(e.key());null!=n&&(t.type="type:"+n)}if(void 0===t.type)KorAP._validUnspecMatchRE.test(e.matchop())||(KorAP.log(802,o),e.matchop("eq"),n="modification"),e.value(t.value);else if("type:string"==t.type)e.type("string"),KorAP._validStringMatchRE.test(e.matchop())||(KorAP.log(802,o),e.matchop("eq"),n="modification"),e.value(t.value);else if("type:text"==t.type)e.type("text"),KorAP._validTextMatchRE.test(e.matchop())||(KorAP.log(802,o),e.matchop("eq"),n="modification"),e.value(t.value);else if("type:date"===t.type){if(e.type("date"),void 0===t.value||!KorAP._validDateRE.test(t.value))return void KorAP.log(806,"Value is not a valid date string");KorAP._validDateMatchRE.test(e.matchop())||(KorAP.log(802,o),e.matchop("eq"),n="modification"),e.value(t.value)}else{if("type:regex"!==t.type)throw KorAP.log(804,"Unknown value type: "+e.type()),new Error("Unknown value type: "+e.type());e.type("regex");try{new RegExp(t.value);KorAP._validStringMatchRE.test(e.matchop())||(KorAP.log(802,o),e.matchop("eq"),n="modification"),e.value(t.value)}catch(t){return void KorAP.log(807,"Value is not a valid regular expression")}e.type("regex")}}return void 0!==t.rewrites?e.rewrite(t.rewrites):void 0!==n&&e.rewrite(n),e},key:function(t){return 1===arguments.length?(this._key=t,this._changed(),this):this._key},_changeKey:function(t){const e=KorAP._vcKeyMenu;this._el.insertBefore(e.element(),this._keyE);const n=this;e.released((function(t,e){if("ref"===e)n.replaceWith(r.create(n.parent()));else{const i=n.key(t).type(e);i.matchop(i.matchop()),i.value(i.value()),i.update()}this.hide()})),e.show(),e.focus()},matchop:function(t){const e=this;if(1===arguments.length){const n=t.replace(/^match:/,"");return null==e._type||("string"===e._type||"regex"===e._type)&&KorAP._validStringMatchRE.test(n)||"text"===e._type&&KorAP._validTextMatchRE.test(n)||"date"===e._type&&KorAP._validDateMatchRE.test(n)?e._matchop=n:e._matchop="eq",e._changed(),e}return e._matchop||"eq"},_changeMatchop:function(t){const e=KorAP._vcMatchopMenu[this.type()];if(void 0===e)return void KorAP.log(0,"Unable to init menu for "+this.type());this._el.insertBefore(e.element(),this._matchopE);const n=this;e.released((function(t){n.matchop(t).update(),this.hide()})),e.show(),e.focus()},type:function(t){return 1===arguments.length?(this._type=t,this._changed(),this):this._type||"string"},value:function(t){const e=this;return 1===arguments.length?("date"!==e._type||KorAP._validDateRE.test(t)?e._value=t:delete e._value,e._changed(),e):e._value},_changeValue:function(t){const e=this;if("date"===this.type()){const t=KorAP._vcDatePicker;t.fromString(this.value()),t.onclick((function(n){if(n.year)return e.value(this.toString()),void e.update();e._el.removeChild(t.element())})),this._el.insertBefore(t.show(),this._valueE),t.input().focus()}else{const t="regex"===this.type(),n=i.create(this.value(),t),r=n.element();n.store=function(t,n){e.value(t),!0===n?e.type("regex"):e.type("string"),e._el.removeChild(this._el),e.update()},this._el.insertBefore(r,this._valueE),n.focus()}},rewrites:function(){return this._rewrites},rewrite:function(t){"string"==typeof t&&(t=[{"@type":"koral:rewrite",operation:"operation:"+t,src:"Kalamar"}]),this._rewrites=n.create(t)},_changed:function(){this.__changed=!0,void 0!==this._rewrites&&(delete this._rewrites,void 0!==this._el&&this._el.classList.remove("rewritten"))},toJson:function(){const t=this;return t.matchop()&&t.key()?{"@type":"koral:"+t.ldType(),key:t.key(),match:"match:"+t.matchop(),value:t.value()||"",type:"type:"+t.type()}:{}},incomplete:function(){return!(this.matchop()&&this.key()&&this.value())},toQuery:function(){if(this.incomplete())return"";let t=this.key()+" ";switch(this.matchop()){case"ne":t+="!=";break;case"contains":t+="~";break;case"excludes":case"containsnot":t+="!~";break;case"geq":t+="since";break;case"leq":t+="until";break;default:t+="date"==this.type()?"in":"="}switch(t+=" ",this.type()){case"date":return t+this.value();case"regex":return t+"/"+this.value().escapeRegex()+"/";case"string":case"text":return t+this.value().quote()}return""}}})),n("vc/unspecified",["vc/jsonld","vc/doc","vc/docgroupref","util"],(function(t,e,n){const i=KorAP.Locale;return i.EMPTY=i.EMPTY||"⋯",{_ldType:"non",create:function(e){const n=Object.create(t).upgradeTo(this);return void 0!==e&&(n._parent=e),n},key:function(t){if(void 0===this._parent)return null;let i;const r=KorAP._vcKeyMenu.typeOf(t);return r&&"ref"===r?i=n.create(this._parent):(i=e.create(this._parent),i.key(t),i.type(r)),null===this._parent.ldType()?(this._parent.root(i),this.destroy()):this._parent.replaceOperand(this,i),this._parent.update(),i},update:function(){const t=this;if(void 0===t._el)return t.element();h(t._el);const e=document.createElement("span");return e.addT(i.EMPTY),e.addEventListener("click",t.onclick.bind(t)),t._el.appendChild(e),t._el.refTo=t,void 0!==t._parent&&null!==t.parent().ldType()&&t._el.appendChild(t.operators(!1,!1,!0).element()),t.element()},element:function(){const t=this;return void 0!==t._el||(t._el=document.createElement("div"),t._el.setAttribute("class","doc unspecified"),t.update()),t._el},incomplete:function(){return!0},onclick:function(){const t=KorAP._vcKeyMenu;this._el.insertBefore(t.element(),this._el.firstChild);const e=this;t.released((function(t){e.key(t).update(),this.hide()})),t.show(),t.focus()}}})),n("vc/docgroup",["vc/jsonld","vc/unspecified","vc/doc","vc/docgroupref","util"],(function(t,e,n,i){const r=new RegExp("^(?:and|or)$"),o={_ldType:"docGroup",create:function(e,n){const i=Object.create(t).upgradeTo(this);return i._operands=[],i.fromJson(n),void 0!==e&&(i._parent=e),i},newAfter:function(t){this._operands.forEach((function(n,i){if(n===t){const t=e.create(this);return this._operands.splice(i+1,0,t),this.update()}}),this)},_duplicate:function(t){if("doc"!==t.ldType())return null;const e=this._operands.find(e=>"doc"===e.ldType()&&t.key()===e.key()&&t.matchop()===e.matchop()&&t.value()===e.value());return e||null},append:function(t){if(void 0===t)return t=e.create(this),this._operands.push(t),t;switch(t["@type"]){case void 0:if(void 0!==t.ldType){if("doc"!==t.ldType()&&"docGroup"!==t.ldType()&&"docGroupRef"!==t.ldType())return void KorAP.log(812,"Operand not supported in document group");t.parent(this);const e=this._duplicate(t);return null===e?(this._operands.push(t),t):e}return void KorAP.log(701,"JSON-LD group has no @type attribute");case"koral:doc":const e=n.create(this,t);if(void 0===e)return;const r=this._duplicate(e);return null===r?(this._operands.push(e),e):r;case"koral:docGroup":const s=o.create(this,t);if(void 0===s)return;return s.operation()===this.operation()?(s.operands().forEach((function(t){null===this._duplicate(t)&&(this._operands.push(t),t.parent(this))}),this),s._operands=[],s.destroy(),this):(this._operands.push(s),s);case"koral:docGroupRef":const a=i.create(this,t);if(void 0===a)return;return this._operands.push(a),a;default:return void KorAP.log(812,"Operand not supported in document group")}},update:function(){const t=this;if(1===t._operands.length){const e=t.parent(),n=t.getOperand(0);return t._operands=[],null!==e.ldType()?e.replaceOperand(t,n).update():(t.destroy(),e.root(n),n.parent(e),e.root())}if(void 0===t._el)return t;const e=t._el;e.setAttribute("data-operation",t.operation()),h(e),t._operands.forEach(t=>e.appendChild(t.element()));var n=t.operators("and"!=t.operation(),"or"!=t.operation(),!0);return e.appendChild(n.element()),KorAP.vc&&KorAP.vc.element().dispatchEvent(new CustomEvent("vcChange",{detail:t})),t},element:function(){const t=this;if(void 0!==t._el)return t._el;const e=t._el=document.createElement("div");return e.setAttribute("class","docGroup"),t.update(),e},operation:function(t){if(1===arguments.length){if(!r.test(t))return void KorAP.log(810,"Unknown operation type");this._op=t}return this._op||"and"},operands:function(){return this._operands},getOperand:function(t){return this._operands[t]},replaceOperand:function(t,e){for(let n=0;n<this._operands.length;n++)if(this._operands[n]===t)return"doc"===e.ldType()||"non"===e.ldType()||"docGroupRef"===e.ldType()||e.operation()!=this.operation()?(this._operands[n]=e,e.parent(this)):(this._operands.splice(n,1),e.operands().reverse().forEach((function(t){this._operands.splice(n,0,t),t.parent(this)}),this),e._operands=[],e.destroy()),t.destroy(),this;return!1},delOperand:function(t){for(let e=0;e<this._operands.length;e++)if(this._operands[e]===t)return this._operands.splice(e,1),t.destroy(),this},fromJson:function(t){if(void 0===t)return this;if(void 0===t["@type"])return void KorAP.log(701,"JSON-LD group has no @type attribute");if(void 0===t.operation||"string"!=typeof t.operation)return void KorAP.log(811,"Document group expects operation");const e=t.operation;if(this.operation(e.replace(/^operation:/,"")),void 0!==t.operands&&t.operands instanceof Array)return t.operands.forEach(t=>this.append(t)),this;KorAP.log(704,"Operation needs operand list")},toJson:function(){const t=new Array;return this._operands.forEach((function(e){"non"!==e.ldType()&&t.push(e.toJson())})),{"@type":"koral:"+this.ldType(),operation:"operation:"+this.operation(),operands:t}},toQuery:function(t){var e=this._operands.filter((function(t){return!t.incomplete()})).map((function(t){return"docGroup"===t.ldType()?t.toQuery(!0):t.toQuery()}));if(1===e.length)return e.join("");{const n=e.join("or"===this.operation()?" | ":" & ");return t?"("+n+")":n}}};return o})),n("vc/item",["menu/item","util"],(function(t){const e=KorAP.Locale;return{create:function(e){return Object.create(t).upgradeTo(this)._init(e)},_init:function(t){const n=this;if(void 0===t[0])throw new Error("Missing parameters");n._key=t[0],n._type=t[1];const i=n._key;return n._name=e["VC_"+i]?e["VC_"+i]:i,n._lcField=" "+n._name.toLowerCase(),n},onclick:function(t){this.menu().release(this._key,this._type),t.halt()},name:function(){return this._name},type:function(){return this._type},key:function(){return this._key},element:function(){const t=this;if(void 0!==t._el)return t._el;var e=document.createElement("li");return t._type&&e.setAttribute("data-type",t._type),e.setAttribute("data-key",t._key),e.onclick=t.onclick.bind(t),e.addT(t._name),t._el=e}}})),n("vc/prefix",["menu/prefix"],(function(t){return{create:function(e){return Object.create(t).upgradeTo(this)._init(e)},onclick:function(t){var e=this.menu(),n=this.value();e.release(n,"string")}}})),n("vc/menu",["menu","vc/item","vc/prefix"],(function(t,e,n){return{create:function(i){const r=Object.create(t).upgradeTo(this)._init(i,{itemClass:e,prefixClass:n});return r.limit(6),r.element().addEventListener("blur",(function(t){this.menu.hide()})),r},released:function(t){this._cb=t},release:function(t,e){void 0!==this._cb&&this._cb(t,e)},typeOf:function(t){const e=this._items.find(e=>e.key()===t);if(e)return e.type()}}})),n("vc/statistic",["util"],(function(){return{create:function(t){return Object.create(this)._init(t)},_init:function(t){if(void 0===t)throw new Error("Missing parameter");return this._statistic=t,this},element:function(){if(void 0!==this._el)return this._el;const t=document.createElement("dl");t.classList.add("flex");const e=this._statistic;let n,i,r;return Object.keys(e).forEach((function(o){n=t.addE("div"),i=n.addE("dt"),i.addT(o),i.setAttribute("title",o),r=n.addE("dd"),r.addT(new Number(e[o]).toLocaleString())})),this._el=t,this._el}}})),n("datepicker",["util"],(function(){KorAP._validDateMatchRE=new RegExp("^(?:[lg]?eq|ne)$"),KorAP._validDateRE=new RegExp("^(?:\\d{4})(?:-\\d\\d(?:-\\d\\d)?)?$");const t=KorAP.Locale;t.WDAY=t.WDAY||["Mo","Tu","We","Th","Fr","Sa","Su"],t.MONTH=t.MONTH||["January","February","March","April","May","June","July","August","September","October","November","December"];const e=document;return{create:function(){return Object.create(this)._init()},_init:function(){return this._selected=[],this},select:function(t,e,n){const i=this;return arguments.length>=1?(i._selected={year:t},i._showYear=t,arguments.length>=2&&(i._selected.month=e,i._showMonth=e,arguments.length>=3&&(i._selected.day=n,i._showDay=n)),i):i._selected},set:function(t,e,n){this.select(t,e,n),this._store()},_store:function(){void 0!==this._click?this._click(this._selected):console.dir(this._selected)},onclick:function(t){this._click=t},input:function(){return this._input},show:function(t,n){const i=this._el=e.createElement("div");i.setAttribute("tabindex",0),i.style.outline=0,i.classList.add("datepicker");const r=new Date,o=this;return o._showYear=void 0!==t?t:o._selected.year?this._selected.year:r.getYear()+1900,o._showMonth=n||(o._selected.month?o._selected.month:r.getMonth()+1),i.appendChild(o._monthHelper()),i.appendChild(o._yearHelper()),i.appendChild(o._dayHelper()),o._input=i.appendChild(o._stringHelper()),i.addEventListener("mousedown",function(t){this._inField=!0}.bind(o)),i.addEventListener("mouseup",function(t){this._inField=!1,this._input.focus()}.bind(o)),o._input.addEventListener("blur",function(t){this._inField||this.fromString(this._input.value)&&this._store(),t.halt()}.bind(o)),o._input.focus(),o._el},_stringHelper:function(){const t=e.createElement("input");return t.value=this.toString(),t.setAttribute("tabindex",0),t.addEventListener("keyup",function(e){this.fromString(t.value)&&(this._updateYear(),this._updateMonth(),this._updateDay())}.bind(this)),t.addEventListener("keypress",function(e){if(13==e.keyCode)return this.fromString(t.value)&&this._store(),e.halt(),!1}.bind(this)),t},element:function(){return this._el},today:function(){const t=new Date;let e=t.getYear()+1900;const n=t.getMonth()+1,i=t.getDate();return e+="-"+(n<10?"0"+n:n),e+="-"+(i<10?"0"+i:i),e},toString:function(){let t="";const e=this._selected;return e.year&&(t+=e.year,e.month&&(t+="-",t+=e.month<10?"0"+e.month:e.month,e.day&&(t+="-",t+=e.day<10?"0"+e.day:e.day))),t},incrYear:function(){const t=this;if(t._showYear<9999)return t._showYear++,t._updateYear(),t._updateMonth(),t._updateDay(),t},decrYear:function(){const t=this;if(t._showYear>0)return t._showYear--,t._updateYear(),t._updateMonth(),t._updateDay(),t},incrMonth:function(){const t=this;return t._showMonth++,t._showMonth>12?(t._showMonth=1,t.incrYear()):(t._updateMonth(),t._updateDay()),t},decrMonth:function(){const t=this;return t._showMonth--,t._showMonth<1?(t._showMonth=12,t.decrYear()):(t._updateMonth(),t._updateDay()),t},_yearHelper:function(){const t=this,n=e.createElement("div");return n.classList.add("year"),n.addE("span").onclick=t.decrYear.bind(t),t._yElement=n.addE("span"),t._yElement.addT(t._showYear),t._yElement.onclick=function(){t.set(t._showYear)}.bind(t),t._selectYear(),n.addE("span").onclick=t.incrYear.bind(t),n},_updateYear:function(){this._yElement.firstChild.data=this._showYear,this._selectYear()},_selectYear:function(){this._showYear===this.select().year?this._yElement.classList.add("selected"):this._yElement.classList.remove("selected")},_monthHelper:function(){const n=this,i=e.createElement("div");return i.classList.add("month"),i.addE("span").onclick=n.decrMonth.bind(n),n._mElement=i.addE("span"),n._mElement.addT(t.MONTH[n._showMonth-1]),n._mElement.onclick=function(){this.set(this._showYear,this._showMonth)}.bind(n),n._selectMonth(),i.addE("span").onclick=n.incrMonth.bind(n),i},_updateMonth:function(){(void 0===this._showMonth||this._showMonth>12)&&(this._showMonth=1),this._mElement.firstChild.data=t.MONTH[this._showMonth-1],this._selectMonth()},_selectMonth:function(){const t=this;t._showYear===t.select().year&&t._showMonth===t.select().month?t._mElement.classList.add("selected"):t._mElement.classList.remove("selected")},_dayHelper:function(){const n=e.createElement("table"),i=n.addE("thead").addE("tr");for(let e=0;e<7;e++)i.addE("th").addT(t.WDAY[e]);return this._dBElement=this._dayBody(),n.appendChild(this._dBElement),n},_dayBody:function(){const t=new Date(this._showYear,this._showMonth-1,1,0,0,0,0),n=new Date(this._showYear,this._showMonth-1,1,0,0,0,0),i=new Date,r=this,o=function(){r.set(r._showYear,r._showMonth,parseInt(this.firstChild.data))};n.setDate(n.getDate()-(n.getDay()+6)%7);const s=e.createElement("tbody"),a=this.select();let c,l,u;for(;;){for(c=s.addE("tr"),l=0;l<7;l++)u=c.addE("td"),n.getMonth()!==t.getMonth()?u.classList.add("out"):u.onclick=o,n.getDate()===i.getDate()&&n.getMonth()===i.getMonth()&&n.getFullYear()===i.getFullYear()&&u.classList.add("today"),a&&a.day&&n.getDate()===a.day&&n.getMonth()===a.month-1&&n.getFullYear()===a.year&&u.classList.add("selected"),u.addT(n.getDate()),n.setDate(n.getDate()+1);if(n.getMonth()!==t.getMonth())break}return s},_updateDay:function(){const t=this._dayBody();this._dBElement.parentNode.replaceChild(t,this._dBElement),this._dBElement=t},fromString:function(t){if(void 0===t)return!1;if(!KorAP._validDateRE.test(t))return!1;const e=t.split("-",3);return e[0]=parseInt(e[0]),e[1]&&(e[1]=parseInt(e[1])),e[2]&&(e[2]=parseInt(e[2])),this.select(e[0],e[1],e[2]),!0}}})),n("panel",["buttongroup","util"],(function(t){return{create:function(t){return Object.create(this)._init(t)},_init:function(e){const n=this;n.views=[],n._classes=e;const i=["action","button-panel"];return e&&i.push.apply(i,e),n.actions=t.create(i).bind(this),n.prepend=!1,n.actions.panel=n,n},element:function(){if(this._el)return this._el;const t=document.createElement("div"),e=t.classList;e.add("panel"),this._classes&&e.add.apply(e,this._classes),this._viewE=t.addE("div");const n=this.actions.element();return n.parentNode||t.appendChild(n),this._el=t},_viewElement:function(){return this.element(),this._viewE},add:function(t){this.views.push(t),this.prepend?this._viewElement().prepend(t.element()):this._viewElement().appendChild(t.element()),t.afterEmbed&&t.afterEmbed(),t.panel=this},delView:function(t){this.views.forEach((function(e,n,i){e===t&&(i[n]=void 0)}))},upgradeTo:function(t){for(let e in t)this[e]=t[e];return this}}})),n("view",["buttongroup","util"],(function(t){const e=KorAP.Locale;return e.CLOSE=e.CLOSE||"Close",{create:function(t){return Object.create(this)._init(t)},_init:function(n){this.panel=void 0,this._classes=n,this._shown=!1;const i=["action","button-view"];return n&&i.push.apply(i,n),this.actions=t.create(i).bind(this),this.actions.add(e.CLOSE,{cls:["button-icon","close"]},(function(t){this.close()})),this.actions.view=this,this},element:function(){if(this._el)return this._el.classList.add("show"),this._el;const t=document.createElement("div"),e=t.classList;if(e.add("view","show"),this._classes&&e.add.apply(e,this._classes),void 0!==this.show){const e=this.show();if(!e)return t;t.appendChild(e)}return this._shown=!0,t.appendChild(this.actions.element()),this._el=t},shown:function(){return this._shown},minimize:function(){this._el&&this._el.classList.remove("show")},close:function(){this.onClose&&this.onClose();const t=this.element();t.parentNode&&t.parentNode.removeChild(t),this.panel.delView(this),this._shown=!1},upgradeTo:function(t){for(let e in t)this[e]=t[e];return this}}})),n("view/vc/corpstatv",["view","vc/statistic","buttongroup"],(function(t,e,n){const i=KorAP.Locale;return i.REFRESH=i.REFRESH||"Refresh",{create:function(e,n){return Object.create(t)._init(["vcstatistic"]).upgradeTo(this)._init(e,n)},_init:function(t,e){return this.vc=t,this.panel=e,this},getvc:function(){return this.vc},getStatistic:function(t){const e=this.vc;try{KorAP.API.getCorpStat(e.toQuery(),(function(e){if(null!==e)if(void 0!==e){if(null!==e.notifications&&void 0!==e.notifications){const n=e.notifications;return KorAP.log(0,n[0][1]),void t(null)}t(e)}else t(null);else t(null)}))}catch(e){KorAP.log(0,e),t(null)}},show:function(){if(this._show)return this._show;const t=document.createElement("div");return t.classList.add("stattable","loading"),this.getStatistic((function(n){t.classList.remove("loading"),null!==n&&t.appendChild(e.create(n).element())})),this._show=t},checkStatActive:function(){let t=KorAP.vc.toQuery();const e=this.vc.oldvcQuery;(t||""===t)&&(t.startsWith("(")&&(t=t.slice(1,t.length-1)),t!=e&&this.disableStat())},disableStat:function(){const t=this._show;if(0==t.getElementsByClassName("reloadStatB").length){const e=n.create(["reloadStatB","button-panel"]);e.add(i.REFRESH,{cls:["refresh","button-icon"]},function(e){t.classList.remove("stdisabled"),this.panel.reloadCorpStat()}.bind(this)),t.appendChild(e.element()),t.classList.add("stdisabled")}},onClose:function(){this.vc=void 0}}})),n("panel/vc",["panel","view/vc/corpstatv"],(function(t,e){document;const n=KorAP.Locale;return n.SHOW_STAT=n.SHOW_STAT||"Statistics",n.VERB_SHOWSTAT=n.VERB_SHOWSTAT||"Corpus Statistics",{create:function(e){return Object.create(t)._init(["vcinfo"]).upgradeTo(this)._init(e)},_init:function(t){this.vc=t;return this.actions.add(n.SHOW_STAT,{cls:["statistic"]},function(){this.addCorpStat()}.bind(this)),this},addCorpStat:function(){const t=this;if(void 0!==t.statView&&t.statView.shown()){let e=t.statView.show();e.classList.contains("stdisabled")&&(t.reloadCorpStat(),e.classList.remove("stdisabled"))}void 0!==t.statView&&t.statView.shown()||(t.statView=e.create(t.vc,t),t.add(t.statView),t.vc.oldvcQuery=KorAP.vc.toQuery())},reloadCorpStat:function(){this.statView.close(),this.addCorpStat()}}})),n("vc",["vc/unspecified","vc/doc","vc/docgroup","vc/docgroupref","vc/menu","vc/statistic","datepicker","buttongroup","panel/vc","view/vc/corpstatv","buttongroup","util"],(function(t,n,i,r,o,s,a,c,l,u,h){KorAP._validUnspecMatchRE=new RegExp("^(?:eq|ne|contains(?:not)?|excludes)$"),KorAP._validStringMatchRE=new RegExp("^(?:eq|ne)$"),KorAP._validTextMatchRE=KorAP._validUnspecMatchRE,KorAP._validTextOnlyMatchRE=new RegExp("^(?:contains(?:not)?|excludes)$"),KorAP._overrideStyles=!1;const d=KorAP.Locale;return d.SHOW_STAT=d.SHOW_STAT||"Statistics",d.VERB_SHOWSTAT=d.VERB_SHOWSTAT||"Corpus Statistics",d.VC_allCorpora=d.VC_allCorpora||"all corpora",d.VC_oneCollection=d.VC_oneCollection||"a virtual corpus",d.MINIMIZE=d.MINIMIZE||"Minimize",KorAP._vcKeyMenu=void 0,KorAP._vcDatePicker=a.create(),KorAP._vcMatchopMenu={string:o.create([["eq",null],["ne",null]]),text:o.create([["eq",null],["ne",null],["contains",null],["containsnot",null]]),date:o.create([["eq",null],["ne",null],["geq",null],["leq",null]]),regex:o.create([["eq",null],["ne",null]])},{ldType:function(){return null},_init:function(t){if(!KorAP._overrideStyles){const t=KorAP.newStyleSheet();t.insertRule('.vc .docGroup[data-operation=or] > .doc::before,.vc .docGroup[data-operation=or] > .docGroup::before { content: "'+d.OR+'" }',0),t.insertRule('.vc .docGroup[data-operation=and] > .doc::before,.vc .docGroup[data-operation=and] > .docGroup::before { content: "'+d.AND+'" }',1),KorAP._overrideStyles=!0}let e;return t?(e=t.slice(),e.unshift(["referTo","ref"])):e=[["referTo","ref"]],KorAP._vcKeyMenu=o.create(e),KorAP._vcKeyMenu.limit(6),this},create:function(e){const n=Object.create(this)._init(e);return n._root=t.create(n),n},fromJson:function(e){let o;if(void 0!==e)if("koral:doc"==e["@type"])o=n.create(this,e);else if("koral:docGroup"==e["@type"])o=i.create(this,e);else{if("koral:docGroupRef"!=e["@type"])return void KorAP.log(813,"Collection type is not supported");o=r.create(this,e)}else o=t.create(this);return this.root(o),this},wasRewritten:function(t){return 1!==arguments.length&&(t=this._root),!!(t.rewrites()&&t.rewrites().length()>0)||"docGroup"===t.ldType()&&void 0!==t.operands().find(t=>this.wasRewritten(t))},clean:function(){const e=this;return"non"!==e._root.ldType()&&(e._root.destroy(),e.root(t.create(e))),e.update(),e},root:function(t){if(1===arguments.length){const e=this.builder();null!==e.firstChild?e.firstChild!==t.element()&&e.replaceChild(t.element(),e.firstChild):e.appendChild(t.element()),this._root=t,t.parent(this),this.update()}return this._root},builder:function(){const t=this;return void 0!==t._builder||t.element(),t._builder},element:function(){const t=this;let e=t._el;if(void 0!==e)return e;e=t._el=document.createElement("div"),e.classList.add("vc"),t._builder=e.addE("div"),t._builder.setAttribute("class","builder");const n=h.create(["action","button-view"]);return n.add(d.MINIMIZE,{cls:["button-icon","minimize"]},function(){this.minimize()}.bind(t)),e.appendChild(n.element()),t._builder.appendChild(t._root.element()),t.addVcInfPanel(),t._el.addEventListener("vcChange",function(t){this.checkStatActive(t.detail)}.bind(t),!1),e},isOpen:function(){return!!this._el&&this._el.classList.contains("active")},open:function(){this.element().classList.add("active"),this.onOpen&&this.onOpen()},minimize:function(){this.element().classList.remove("active"),this.onMinimize&&this.onMinimize()},update:function(){return this._root.update(),KorAP.vc&&this.element().dispatchEvent(new CustomEvent("vcChange",{detail:this})),this},getName:function(){return"non"===this._root.ldType()?d.VC_allCorpora:"docGroupRef"===this._root.ldType()?this._root.ref():d.VC_oneCollection},addRequired:function(t){const n=this.root(),i=n.ldType(),r=n.parent();if("non"===i)r.root(t);else if("doc"===i||"docGroupRef"===i||"docGroup"===i&&"or"===n.operation()){const i=e("vc/docgroup").create(r);i.operation("and"),i.append(n),i.append(t),i.element(),r.root(i)}else"docGroup"===i?n.append(t):console.log("Unknown root object");this.update()},toJson:function(){return this._root.toJson()},toQuery:function(){return this._root.toQuery()},addVcInfPanel:function(){this.panel=l.create(this),this._el.addE("div").appendChild(this.panel.element())},checkStatActive:function(){void 0!==this.panel&&void 0!==this.panel.statView&&this.panel.statView.checkStatActive()}}})),n("loc/dereko",["vc","vc/doc"],(function(t,e){const n=KorAP.Locale;n.TOUR_Qexample="laufen",n.TOUR_vcQuery={"@type":"koral:doc",key:"docSigle",match:"match:eq",value:"WPD17/D01"},n.TOUR_Relations="corenlp/c"})),n("loc/de",[],(function(){const t=KorAP.Locale;t.OR="oder",t.AND="und",t.VC_allCorpora="allen Korpora",t.VC_oneCollection="einem virtuellen Korpus",t.REGEX_DESC=t.REGEX_DESC||"Regulären Ausdruck verwenden",t.WDAY=["Mo","Di","Mi","Do","Fr","Sa","So"],t.MONTH=["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],t.ADDTREE="Relationen",t.SHOWANNO="Token",t.SHOWINFO="Informationen",t.CLOSE="Schließen",t.MINIMIZE="Zuklappen",t.DOWNLOAD="Herunterladen",t.TOGGLE_ALIGN="tausche Textausrichtung",t.SHOW_KQ="zeige KoralQuery",t.SHOW_META="Metadaten",t.NEW_QUERY="Neue Anfrage",t.SHOW_STAT="Korpusstatistik",t.REFRESH="Neu laden",t.NEW_CONSTRAINT="Neue Bedingung",t.TOUR_lskip="Abbrechen",t.TOUR_lprev="Zurück",t.TOUR_lnext="Weiter",t.TOUR_ldone="Beenden",t.TOUR_ldoneSearch="Suchen",t.TOUR_welc="<span class = 'tgreeting'>Willkommen zur KorAP Tour! </span> <p class='pfirstStep'> Hier zeigen wir Ihnen einige wichtige Funktionalitäten von KorAP. Wir führen Sie Schritt bei Schritt anhand eines Beispiels durch die Anwendung. </p>",t.TOUR_sear1="Eingabe der Suchanfrage, zum Beispiel die Suche nach '"+t.TOUR_Qexample+"'.",t.TOUR_searAnnot="Für die Suche nach Annotationen steht der Annotationsassistent zur Verfügung.",t.TOUR_annotAss="Der Annotationsassistent erleichert die Formulierung von Suchanfragen mit Annotationen.",t.TOUR_vccho1="Öffnen des Korpusassistenten",t.TOUR_vccho2="Eigene Definition von Subkorpora durch Verknüpfung beliebiger Metadatenfelder.",t.TOUR_vcStat1="Es besteht die Möglichkeit, die Korpusstatistik anzuzeigen.",t.TOUR_vcStat2="Korpusstatistik",t.TOUR_qlfield="Auswahl der Suchanfragesprache: In KorAP können mehrere Suchanfragesprachen verwendet werden.",t.TOUR_glimpse="Beim Wählen dieser Option wird festgelegt ob nur die ersten Treffer in undefinierter Reihenfolge ausgewählt werden.",t.TOUR_help="Hilfe zu KorAP",t.TOUR_seargo="Suchanfrage starten",t.TOUR_kwic="Anzeige des Ergebnisses als KWIC (keyword in context).",t.TOUR_snippet="Durch Klicken auf das KWIC kann ein größerer Kontext angezeigt werden.",t.TOUR_snippetb="Anzeige des Snippets",t.TOUR_metadatab="Durch die Auswahl des Buttons werden die Metadaten angezeigt.",t.TOUR_metadata="Anzeige der Metadaten",t.TOUR_tokenb=t.TOUR_tokenb||"Anzeige der Token-Annotationen",t.TOUR_token=t.TOUR_token||"KorAP unterstützt multiple Annotationen.",t.TOUR_treeb=t.TOUR_tree||"Anzeige weiterer Ansichten",t.TOUR_tree=t.TOUR_tree||"Weitere Ansichten können als Baum- oder Bogenansichten angezeigt werden.",t.TOUR_tourdone="Viel Spaß mit KorAP!"})),n("match/treeitem",["menu/item"],(function(t){return{create:function(e){return Object.create(t).upgradeTo(this)._init(e)},content:function(t){return 1===arguments.length&&(this._content=t),this._content},foundry:function(){return this._foundry},layer:function(){return this._layer},type:function(){return this._type},onclick:function(t){const e=this.menu();e.hide(),t.halt(),void 0!==e.panel()&&e.panel().addTree(this._foundry,this._layer,this._type)},_init:function(t){if(void 0===t[0])throw new Error("Missing parameters");const e=this;return e._name=t[0],e._foundry=t[1],e._layer=t[2],e._type=t[3],e._content=document.createTextNode(e._name),e._lcField=" "+e.content().textContent.toLowerCase(),e}}})),n("match/querycreator",["util"],(function(){const t=KorAP.Locale;t.NEW_QUERY=t.NEW_QUERY||"New Query";const e=RegExp("[ .'\\\\|&]");function n(t){return null!=t.match(e)?"'"+t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'":t}function i(t,e){if(e.childNodes.length>1){let i=[];return e.childNodes.forEach((function(e){3===e.nodeType&&i.push(t+n(e.data))})),"("+i.sort().join(" | ")+")"}return""==e.innerText?"":t+n(e.innerText)}return{create:function(t){return Object.create(this)._init(t)},_init:function(e){if(void 0===e)throw new Error("Missing parameters");if(!(e instanceof Node))throw new Error("Requires element");const n=this;n._query=[],n._matchTable=e,n._matchTable.addEventListener("click",n.clickOnAnno.bind(n),!1);const i=n._el=document.createElement("p");return i.classList.add("query","fragment"),i.addE("span").addT(t.NEW_QUERY+":"),n._queryFragment=i.addE("span"),i.addEventListener("click",n.toQueryBar.bind(n),1),n._ql=document.getElementById("ql-field"),n._q=document.getElementById("q-field"),n._shown=!1,n},clickOnAnno:function(t){if(t.target!==t.currentTarget){const e=t.target;let n,r,o,s,a,c;if("TD"==e.tagName){if(""==e.innerText)return;if(e.classList.contains("matchkeyvalues"))return;for(n=e.parentNode.getElementsByTagName("th"),r=n[0].innerText,o=n[1].innerText,s=-2,a=e;null!=(a=a.previousSibling);)1===a.nodeType&&s++;c=i(r+"/"+o+"=",e),""!==c&&this.toggleInToken(e,s,c)}else if("SPAN"==e.tagName||"DIV"==e.tagName){if(""==e.innerText)return;"SPAN"==e.tagName&&(e=e.parentNode);const t=e.parentNode;for(n=t.parentNode.getElementsByTagName("th"),r=n[0].innerText,o=n[1].innerText,s=-2,a=t;null!=(a=a.previousSibling);)1===a.nodeType&&s++;c=i(r+"/"+o+"=",e),""!==c&&this.toggleInToken(e,s,c)}else if("TH"==e.tagName)if("THEAD"==e.parentNode.parentNode.tagName){if(e.classList.contains("cutted"))return;for(s=-2,a=e;null!=(a=a.previousSibling);)1===a.nodeType&&s++;s>=0&&this.toggleInToken(e,s,i("orth=",e))}else{n=e.parentNode.getElementsByTagName("th"),r=n[0].innerText,o=n[1].innerText;const t=r+"/"+o+"=";for(s=0,a=e;null!=(a=a.nextSibling);)1===a.nodeType&&"TH"!==a.tagName&&(a.classList.contains("matchkeyvalues")?Array.from(a.getElementsByTagName("div")).forEach((function(e){c=i(t,e),""!==c&&(this._addToToken(s,c),e.classList.add("chosen"))}),this):(c=i(t,a),""!==c&&(this._addToToken(s,c),a.classList.add("chosen"))),s++)}}t.stopPropagation()},_addToToken:function(t,e){let n=this._query[t];void 0===n&&(n=this._query[t]=[]),n.push(e),this._query[t]=n.filter((function(t,e,n){return n.lastIndexOf(t)===e})),this.show()},_removeFromToken:function(t,e){let n=this._query[t];void 0!==n&&(n.splice(n.indexOf(e),1),this._query[t]=n.length>0?n:void 0,this.show())},element:function(){return this._el},shown:function(){return this._shown},show:function(){const t=this,e=t.toString(),n=t._matchTable;""===e?!0===t._shown&&(n.parentNode.removeChild(t._el),t._shown=!1):(!1===t._shown&&(n.parentNode.insertBefore(t._el,n.nextSibling),t._shown=!0),t._queryFragment.innerText=e)},toggleInToken:function(t,e,n){const i=t.classList;i.contains("chosen")?(this._removeFromToken(e,n),i.remove("chosen")):(this._addToToken(e,n),i.add("chosen"))},toString:function(){let t,e="",n=0;for(let i=0;i<this._query.length;i++)t=this._query[i],void 0!==t?(n>0&&(e+="[]",n>1&&(e+="{"+n+"}"),n=0),e+="["+t.sort().join(" & ")+"]"):""!==e&&n++;return e},toQueryBar:function(t){const e=this;if(void 0===e._ql||void 0===e._q||null===e._ql)return void console.log("No query language object defined");const n=Array.from(e._ql.options).find(t=>"poliqarp"==t.value);n&&(n.selected=!0),e._q.value=e.toString(),window.scrollTo(0,0)}}})),n("match/table",["match/querycreator","util"],(function(t){const e=new RegExp("^(?:([^/]+?)/)?([^:]+?):(.+?)$"),n=document;return{create:function(t){return Object.create(this)._init(t)},_init:function(t){const e=n.createElement("div"),i=this;return e.innerHTML=t,i._pos=0,i._token=[],i._mark=[],i._markE=void 0,i._cutted=[],i._info=[],i._foundry={},i._layer={},i._parse(e.childNodes,!1),e.innerHTML="",i},destroy:function(){this._matchCreator=void 0},length:function(){return this._pos},toMark:function(){void 0!==this._markE&&this._markE.scrollIntoView({inline:"start",block:"nearest"})},getToken:function(t){return void 0===t?this._token:this._token[t]},getValue:function(t,e,n){return this._info[t][e+"/"+n]},_parse:function(t,n){t.forEach((function(t){const i=this;void 0===i._info[i._pos]&&(i._info[i._pos]={});const r=i._info[i._pos];if(1===t.nodeType){let o=n;if("MARK"===t.tagName)o=!0;else if(t.hasAttribute("title")&&e.exec(t.getAttribute("title"))){let t,e,n;RegExp.$2?(t=RegExp.$1,e=RegExp.$2):(t="base",e=RegExp.$1),n=RegExp.$3,void 0===r[t+"/"+e]?r[t+"/"+e]=[n]:r[t+"/"+e].includes(n)||r[t+"/"+e].push(n),void 0===i._foundry[t]&&(i._foundry[t]={}),i._foundry[t][e]=1,void 0===i._layer[e]&&(i._layer[e]={}),i._layer[e][t]=1}else t.hasAttribute("class")&&"cutted"==t.getAttribute("class")&&(i._cutted.push(i._pos),i._token[i._pos++]="");t.hasChildNodes()&&i._parse(t.childNodes,o)}else 3===t.nodeType&&t.nodeValue.match(/[a-z0-9\u25ae]/iu)&&(i._mark[i._pos]=!!n,i._token[i._pos++]=t.nodeValue)}),this),delete this._info[this._pos]},element:function(){if(void 0!==this._el)return this._el;const e=n.createElement("div"),i=e.addE("table");this._el=e;let r=i.addE("thead").addE("tr");const o=KorAP.annotationHelper||{getDesc:function(){}},s=function(t,e,n){const i=this.addE(t);if(void 0===n)return i;if(e&&n instanceof Array&&void 0!==n[1]){let t,r;i.classList.add("matchkeyvalues"),n.forEach((function(n){t=i.addE("div"),t.addT(n),r=o.getDesc(e,n),r&&t.setAttribute("title",r)}))}else{n instanceof Array&&(n=n[0]),i.addT(n);const t=o.getDesc(e,n);t&&i.setAttribute("title",t)}return i};r.addCell=s,r.addCell("th",void 0,"Foundry"),r.addCell("th",void 0,"Layer"),Object.keys(this._token).forEach((function(t){const e=this.getToken(t),n=r.addCell("th",void 0,e);this._mark[t]?(n.classList.add("mark"),void 0===this._markE&&(this._markE=n)):this._cutted[0]!=t&&this._cutted[1]!=t||n.classList.add("cutted"),e.length>20&&n.setAttribute("title",e)}),this);const a=i.addE("tbody");let c,l,u,h;return Object.keys(this._foundry).sort().forEach((function(t){Object.keys(this._foundry[t]).sort().forEach((function(e){for(r=a.addE("tr"),r.setAttribute("tabindex",0),r.addCell=s,r.addCell("th",void 0,t),r.addCell("th",void 0,e),c=t+"/"+e+"=",l=0;l<this.length();l++)u=this.getValue(l,t,e),h=r.addCell("td",c,u),this._mark[l]&&h.classList.add("mark")}),this)}),this),this._matchCreator=t.create(this._el),this._el}}})),n("match/infolayer",[],(function(){const t=new RegExp("^([^/]+?)/([^=]+?)(?:=(spans|rels|tokens))?$");return{create:function(t,e,n){return Object.create(this)._init(t,e,n)},_init:function(e,n,i){if(void 0===e)throw new Error("Missing parameters");const r=this;if(void 0===n){if(!t.exec(e))throw new Error("Missing parameters");r.foundry=RegExp.$1,r.layer=RegExp.$2,r.type=RegExp.$3}else r.foundry=e,r.layer=n,r.type=i;return void 0===r.type&&(r.type="tokens"),r}}})),n("view/match/tokentable",["view","match/table","match/infolayer"],(function(t,e,n){const i=document;return{create:function(e){return Object.create(t)._init(["tokentable"]).upgradeTo(this)._init(e)},_init:function(t){return this._match=t,this},show:function(){if(this._show)return this._show;const t=i.createElement("div");return t.classList.add("matchtable","loading"),this._show=t,t},afterEmbed:function(){const t=this._show;this.getData(void 0,(function(e){null!==e&&(t.appendChild(e.element()),e.toMark())})),t.classList.remove("loading")},match:function(){return this._match},getData:function(t,i){let r=[];void 0===t?r=this._match.getTokens():t.forEach((function(t){try{const e=n.create(t);e.type="tokens",r.push(e)}catch(t){return}})),0==r.length&&i(null);try{KorAP.API.getMatchInfo(this._match,{spans:!1,layer:r},function(t){void 0===t&&i(null),void 0!==t.snippet&&i(this._table=e.create(t.snippet))}.bind(this))}catch(t){KorAP.log(0,t),i(null)}},onClose:function(){this._match=void 0}}})),n("vc/fragment",["vc/doc","util"],(function(t){const e=KorAP.Locale;function n(t){const e=document.createElement("div");e.setAttribute("class","doc");const n=e.addE("span");n.setAttribute("class","key"),n.addT(t[0]);const i=e.addE("span");i.setAttribute("class","match"),i.addT("eq");const r=e.addE("span");return r.setAttribute("class","value"),r.addT(t[1]),e}return e.NEW_CONSTRAINT=e.NEW_CONSTRAINT||"New Constraint",{create:function(){const t=Object.create(this);return t._operands=[],t},add:function(t,e,n){this._operands.forEach((function(n,i,r){n[0]===t&&n[1]===e&&r.splice(i,1)})),this._operands.push([t,e,n]),this.update()},remove:function(t,e){for(let n=0;n<this._operands.length;n++){let i=this._operands[n];if(i[0]===t&&i[1]===e)return this._operands.splice(n,1),void this.update()}},isEmpty:function(){return!(this._operands.length>0)},element:function(){if(void 0!==this._el)return this._el;const t=this._el=document.createElement("div");return t.classList.add("vc","fragment"),t.addE("span").addT(e.NEW_CONSTRAINT+":"),this._frag=t.addE("div"),t},documents:function(){return this._operands.map((function(e){const n=t.create();return n.key(e[0]),n.matchop("eq"),n.value(e[1]),n.type("date"===e[2]?"date":"string"),n}))},update:function(){let t;const e=this._operands.length;e>1?(t=document.createElement("div"),t.setAttribute("class","docGroup"),t.setAttribute("data-operation","and"),this._operands.forEach(e=>t.appendChild(n(e)))):1==e&&(t=n(this._operands[0])),this.element();const i=this._frag;return 0===e?h(i):i.firstChild?i.replaceChild(t,i.firstChild):i.appendChild(t),this},toQuery:function(){return 0===this._operands.length?"":this._operands.map((function(t){return"date"===t[2]?t[0]+" in "+t[1]:t[0]+" = "+new String(t[1]).quote()})).join(" & ")}}})),n("match/corpusByMatch",["vc/fragment","util"],(function(t){return{create:function(t){return Object.create(this)._init(t)},_init:function(e){const n=this;if(void 0===e)throw new Error("Missing parameters");if(!(e instanceof Node))throw new Error("Requires element");return n._vc={},n._meta=e,KorAP.Conf&&KorAP.Conf.CorpusByMatchDisabled?(n._meta.classList.add("cbm-disabled"),n):(n._meta.addEventListener("click",n.clickOnMeta.bind(n),!1),n._fragment=t.create(),n._fragment.element().addEventListener("click",n.toVcBuilder.bind(n),!0),n)},toVcBuilder:function(t){if(t&&t.stopPropagation(),this._fragment.isEmpty())return;const e=KorAP.vc;if(e){for(const t of this._fragment.documents())e.addRequired(t);e.isOpen()||e.open(),window.scrollTo(0,0)}else console.log("Global VC not established")},clickOnMeta:function(t){if(t.stopPropagation(),t.target===t.currentTarget)return;const e=t.target;let n,i,r;if("DD"===e.tagName?(r=e.getAttribute("data-type"),n=e.previousElementSibling.innerText,i=e.innerText):"DIV"===e.tagName&&(r=e.parentNode.getAttribute("data-type"),n=e.parentNode.previousElementSibling.innerText,i=e.innerText),"type:store"!==r&&"type:attachement"!==r&&(r=r||"type:string",n&&i)){const t=this;e.classList.contains("chosen")?(e.classList.remove("chosen"),t.remove(n,i)):(e.classList.add("chosen"),t.add(n,i,r)),t._fragment.isEmpty()?t._meta.parentNode.removeChild(t._fragment.element()):t._meta.parentNode.insertBefore(t._fragment.element(),t._meta.nextSibling)}},add:function(t,e,n){n=n.replace(/^type:/,""),this._fragment.add(t,e,n)},remove:function(t,e){this._fragment.remove(t,e)},toQuery:function(){return this._fragment.toQuery()}}})),n("match/attachement",[],(function(){const t=new RegExp("^data: *([^;,]*?(?: *; *[^,;]+?)*) *, *(.+)$"),e=new RegExp("^ *([^=]+?) *= *(.+?) *$");return{create:function(t){return Object.create(this)._init(t)},_init:function(n){const i=this;if(n=decodeURIComponent(n),!t.exec(n))return;i.payload=RegExp.$2;let r={},o=0;return i.base64=!1,i.isLink=!1,i.contentType="text/plain",RegExp.$1.split(/ *; */).map(function(t){const n=this;!o++&&t.match(/^[-a-z0-9]+?\/.+$/)?(n.contentType=t,"application/x.korap-link"===t&&(n.isLink=!0)):"base64"==t.toLowerCase()?(n.base64=!0,n.payload=window.atob(n.payload)):e.exec(t)&&(r[RegExp.$1]=RegExp.$2)}.bind(i)),i.param=r,i},inline:function(){if(this.isLink){const t=this.param.title||this.payload,e=document.createElement("a");return e.setAttribute("href",this.payload),e.setAttribute("rel","noopener noreferrer"),e.addT(t),e}return document.createTextNode(this.payload)}}})),n("match/meta",["match/corpusByMatch","match/attachement","util"],(function(t,e){const n=KorAP.Locale;return n.METADATA=n.METADATA||"Metadata",{create:function(t,e){return Object.create(this)._init(t,e)},_init:function(t,e){return this._match=t,this._fields=e,this},match:function(){return this._match},element:function(){if(void 0!==this._el)return this._el;if(null===this._fields)return;const n=document.createElement("dl");n.classList.add("flex"),this._el=n;const i=this._fields,r={};return i.forEach((t,e)=>r[t.key]=e),Object.keys(r).sort().forEach((function(t){let o,s,a,c,l,u=i[r[t]];"UID"!==t&&"corpusID"!==t&&"docID"!==t&&"textID"!==t&&"layerInfos"!==t&&(o=document.createElement("div"),s=o.addE("dt"),s.addT(t),s.setAttribute("title",t),a=u.value,c=o.addE("dd"),c.setAttribute("data-type",u.type),a instanceof Array?(c.classList.add("metakeyvalues"),a.forEach((function(t){"type:attachement"===u.type?(l=e.create(t),l&&c.addE("div").appendChild(l.inline())):c.addE("div").addT(t)}))):"type:attachement"===u.type?(l=e.create(u.value),l&&c.appendChild(l.inline())):c.addT(u.value),n.appendChild(o))})),this._corpusByMatch=t.create(this._el),this._el}}})),n("view/match/meta",["view","match/meta"],(function(t,e){document;return{create:function(e){return Object.create(t)._init(["metatable"]).upgradeTo(this)._init(e)},_init:function(t){return this._match=t,this},show:function(){if(this._show)return this._show;const t=document.createElement("div");return t.classList.add("metatable","loading"),this.getData((function(e){null!==e&&(t.classList.remove("loading"),t.appendChild(e.element()))})),this._show=t},match:function(){return this._match},getData:function(t){const n=this._match;try{KorAP.API.getTextInfo(n,{},(function(i){if(void 0===i)return void t(null);const r=i.document;if(void 0===r)return void t(null);const o=r.fields;t(void 0!==o?e.create(n,o):null)}))}catch(e){KorAP.log(0,e),t(null)}},onClose:function(){this._match=void 0}}})),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof n&&n.amd)n("lib/dagre",[],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.dagre=t()}}((function(){return function t(n,i,r){function o(a,c){if(!i[a]){if(!n[a]){var l="function"==typeof e&&e;if(!c&&l)return l(a,!0);if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=i[a]={exports:{}};n[a][0].call(h.exports,(function(t){var e=n[a][1][t];return o(e||t)}),h,h.exports,t,n,i,r)}return i[a].exports}for(var s="function"==typeof e&&e,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){e.exports={graphlib:t("./lib/graphlib"),layout:t("./lib/layout"),debug:t("./lib/debug"),util:{time:t("./lib/util").time,notime:t("./lib/util").notime},version:t("./lib/version")}},{"./lib/debug":6,"./lib/graphlib":7,"./lib/layout":9,"./lib/util":29,"./lib/version":30}],2:[function(t,e,n){var i=t("./lodash"),r=t("./greedy-fas");e.exports={run:function(t){var e="greedy"===t.graph().acyclicer?r(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};function o(s){i.has(r,s)||(r[s]=!0,n[s]=!0,i.each(t.outEdges(s),(function(t){i.has(n,t.w)?e.push(t):o(t.w)})),delete n[s])}return i.each(t.nodes(),o),e}(t);i.each(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,i.uniqueId("rev"))}))},undo:function(t){i.each(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var i=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,i)}}))}}},{"./greedy-fas":8,"./lodash":10}],3:[function(t,e,n){var i=t("./lodash"),r=t("./util");function o(t,e,n,i,o,s){var a={width:0,height:0,rank:s},c=o[e][s-1],l=r.addDummyNode(t,"border",a,n);o[e][s]=l,t.setParent(l,i),c&&t.setEdge(c,l,{weight:1})}e.exports=function(t){i.each(t.children(),(function e(n){var r=t.children(n),s=t.node(n);if(r.length&&i.each(r,e),i.has(s,"minRank")){s.borderLeft=[],s.borderRight=[];for(var a=s.minRank,c=s.maxRank+1;a<c;++a)o(t,"borderLeft","_bl",n,s,a),o(t,"borderRight","_br",n,s,a)}}))}},{"./lodash":10,"./util":29}],4:[function(t,e,n){var i=t("./lodash");function r(t){i.each(t.nodes(),(function(e){o(t.node(e))})),i.each(t.edges(),(function(e){o(t.edge(e))}))}function o(t){var e=t.width;t.width=t.height,t.height=e}function s(t){t.y=-t.y}function a(t){var e=t.x;t.x=t.y,t.y=e}e.exports={adjust:function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||r(t)},undo:function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){i.each(t.nodes(),(function(e){s(t.node(e))})),i.each(t.edges(),(function(e){var n=t.edge(e);i.each(n.points,s),i.has(n,"y")&&s(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){i.each(t.nodes(),(function(e){a(t.node(e))})),i.each(t.edges(),(function(e){var n=t.edge(e);i.each(n.points,a),i.has(n,"x")&&a(n)}))}(t),r(t))}}},{"./lodash":10}],5:[function(t,e,n){function i(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function o(t,e){if("_next"!==t&&"_prev"!==t)return e}e.exports=i,i.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return r(e),e},i.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},i.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,o)),n=n._prev;return"["+t.join(", ")+"]"}},{}],6:[function(t,e,n){var i=t("./lodash"),r=t("./util"),o=t("./graphlib").Graph;e.exports={debugOrdering:function(t){var e=r.buildLayerMatrix(t),n=new o({compound:!0,multigraph:!0}).setGraph({});return i.each(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),i.each(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),i.each(e,(function(t,e){var r="layer"+e;n.setNode(r,{rank:"same"}),i.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}}},{"./graphlib":7,"./lodash":10,"./util":29}],7:[function(t,e,n){var i;if(t)try{i=t("graphlib")}catch(t){}i||(i=window.graphlib),e.exports=i},{graphlib:31}],8:[function(t,e,n){var i=t("./lodash"),r=t("./graphlib").Graph,o=t("./data/list");e.exports=function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new r,s=0,a=0;i.each(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),i.each(t.edges(),(function(t){var i=n.edge(t.v,t.w)||0,r=e(t),o=i+r;n.setEdge(t.v,t.w,o),a=Math.max(a,n.node(t.v).out+=r),s=Math.max(s,n.node(t.w).in+=r)}));var l=i.range(a+s+3).map((function(){return new o})),u=s+1;return i.each(n.nodes(),(function(t){c(l,u,n.node(t))})),{graph:n,buckets:l,zeroIdx:u}}(t,e||s),l=function(t,e,n){var i,r=[],o=e[e.length-1],s=e[0];for(;t.nodeCount();){for(;i=s.dequeue();)a(t,e,n,i);for(;i=o.dequeue();)a(t,e,n,i);if(t.nodeCount())for(var c=e.length-2;c>0;--c)if(i=e[c].dequeue()){r=r.concat(a(t,e,n,i,!0));break}}return r}(n.graph,n.buckets,n.zeroIdx);return i.flatten(i.map(l,(function(e){return t.outEdges(e.v,e.w)})),!0)};var s=i.constant(1);function a(t,e,n,r,o){var s=o?[]:void 0;return i.each(t.inEdges(r.v),(function(i){var r=t.edge(i),a=t.node(i.v);o&&s.push({v:i.v,w:i.w}),a.out-=r,c(e,n,a)})),i.each(t.outEdges(r.v),(function(i){var r=t.edge(i),o=i.w,s=t.node(o);s.in-=r,c(e,n,s)})),t.removeNode(r.v),s}function c(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}},{"./data/list":5,"./graphlib":7,"./lodash":10}],9:[function(t,e,n){var i=t("./lodash"),r=t("./acyclic"),o=t("./normalize"),s=t("./rank"),a=t("./util").normalizeRanks,c=t("./parent-dummy-chains"),l=t("./util").removeEmptyRanks,u=t("./nesting-graph"),h=t("./add-border-segments"),d=t("./coordinate-system"),f=t("./order"),p=t("./position"),m=t("./util"),g=t("./graphlib").Graph;e.exports=function(t,e){var n=e&&e.debugTiming?m.time:m.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new g({multigraph:!0,compound:!0}),n=C(t.graph());return e.setGraph(i.merge({},v,x(n,_),i.pick(n,y))),i.each(t.nodes(),(function(n){var r=C(t.node(n));e.setNode(n,i.defaults(x(r,b),w)),e.setParent(n,t.parent(n))})),i.each(t.edges(),(function(n){var r=C(t.edge(n));e.setEdge(n,i.merge({},k,x(r,E),i.pick(r,A)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,i.each(t.edges(),(function(n){var i=t.edge(n);i.minlen*=2,"c"!==i.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?i.width+=i.labeloffset:i.height+=i.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){i.each(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){r.run(t)})),e(" nestingGraph.run",(function(){u.run(t)})),e(" rank",(function(){s(m.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){i.each(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var i=t.node(e.v),r={rank:(t.node(e.w).rank-i.rank)/2+i.rank,e:e};m.addDummyNode(t,"edge-proxy",r,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){l(t)})),e(" nestingGraph.cleanup",(function(){u.cleanup(t)})),e(" normalizeRanks",(function(){a(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;i.each(t.nodes(),(function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=i.max(e,r.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){i.each(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){o.run(t)})),e(" parentDummyChains",(function(){c(t)})),e(" addBorderSegments",(function(){h(t)})),e(" order",(function(){f(t)})),e(" insertSelfEdges",(function(){!function(t){var e=m.buildLayerMatrix(t);i.each(e,(function(e){var n=0;i.each(e,(function(e,r){var o=t.node(e);o.order=r+n,i.each(o.selfEdges,(function(e){m.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){d.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){i.each(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var i=t.node(n.e.v),r=i.x+i.width/2,o=i.y,s=n.x-r,a=i.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:r+2*s/3,y:o-a},{x:r+5*s/6,y:o-a},{x:r+s,y:o},{x:r+5*s/6,y:o+a},{x:r+2*s/3,y:o+a}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){i.each(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),s=t.node(i.last(n.borderLeft)),a=t.node(i.last(n.borderRight));n.width=Math.abs(a.x-s.x),n.height=Math.abs(o.y-r.y),n.x=s.x+n.width/2,n.y=r.y+n.height/2}})),i.each(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){i.each(t.edges(),(function(e){var n=t.edge(e);if(i.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){d.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,s=t.graph(),a=s.marginx||0,c=s.marginy||0;function l(t){var i=t.x,s=t.y,a=t.width,c=t.height;e=Math.min(e,i-a/2),n=Math.max(n,i+a/2),r=Math.min(r,s-c/2),o=Math.max(o,s+c/2)}i.each(t.nodes(),(function(e){l(t.node(e))})),i.each(t.edges(),(function(e){var n=t.edge(e);i.has(n,"x")&&l(n)})),e-=a,r-=c,i.each(t.nodes(),(function(n){var i=t.node(n);i.x-=e,i.y-=r})),i.each(t.edges(),(function(n){var o=t.edge(n);i.each(o.points,(function(t){t.x-=e,t.y-=r})),i.has(o,"x")&&(o.x-=e),i.has(o,"y")&&(o.y-=r)})),s.width=n-e+a,s.height=o-r+c}(t)})),e(" assignNodeIntersects",(function(){!function(t){i.each(t.edges(),(function(e){var n,i,r=t.edge(e),o=t.node(e.v),s=t.node(e.w);r.points?(n=r.points[0],i=r.points[r.points.length-1]):(r.points=[],n=s,i=o),r.points.unshift(m.intersectRect(o,n)),r.points.push(m.intersectRect(s,i))}))}(t)})),e(" reversePoints",(function(){!function(t){i.each(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){r.undo(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){i.each(t.nodes(),(function(n){var i=t.node(n),r=e.node(n);i&&(i.x=r.x,i.y=r.y,e.children(n).length&&(i.width=r.width,i.height=r.height))})),i.each(t.edges(),(function(n){var r=t.edge(n),o=e.edge(n);r.points=o.points,i.has(o,"x")&&(r.x=o.x,r.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))};var _=["nodesep","edgesep","ranksep","marginx","marginy"],v={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},y=["acyclicer","ranker","rankdir","align"],b=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],k={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function x(t,e){return i.mapValues(i.pick(t,e),Number)}function C(t){var e={};return i.each(t,(function(t,n){e[n.toLowerCase()]=t})),e}},{"./acyclic":2,"./add-border-segments":3,"./coordinate-system":4,"./graphlib":7,"./lodash":10,"./nesting-graph":11,"./normalize":12,"./order":17,"./parent-dummy-chains":22,"./position":24,"./rank":26,"./util":29}],10:[function(t,e,n){var i;if(t)try{i=t("lodash")}catch(t){}i||(i=window._),e.exports=i},{lodash:51}],11:[function(t,e,n){var i=t("./lodash"),r=t("./util");e.exports={run:function(t){var e=r.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};return i.each(t.children(),(function(n){!function n(r,o){var s=t.children(r);s&&s.length&&i.each(s,(function(t){n(t,o+1)}));e[r]=o}(n,1)})),e}(t),o=i.max(n)-1,s=2*o+1;t.graph().nestingRoot=e,i.each(t.edges(),(function(e){t.edge(e).minlen*=s}));var a=function(t){return i.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;i.each(t.children(),(function(c){!function t(e,n,o,s,a,c,l){var u=e.children(l);if(!u.length)return void(l!==n&&e.setEdge(n,l,{weight:0,minlen:o}));var h=r.addBorderNode(e,"_bt"),d=r.addBorderNode(e,"_bb"),f=e.node(l);e.setParent(h,l),f.borderTop=h,e.setParent(d,l),f.borderBottom=d,i.each(u,(function(i){t(e,n,o,s,a,c,i);var r=e.node(i),u=r.borderTop?r.borderTop:i,f=r.borderBottom?r.borderBottom:i,p=r.borderTop?s:2*s,m=u!==f?1:a-c[l]+1;e.setEdge(h,u,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,d,{weight:p,minlen:m,nestingEdge:!0})})),e.parent(l)||e.setEdge(n,h,{weight:0,minlen:a+c[l]})}(t,e,s,a,o,n,c)})),t.graph().nodeRankFactor=s},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,i.each(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}}},{"./lodash":10,"./util":29}],12:[function(t,e,n){var i=t("./lodash"),r=t("./util");e.exports={run:function(t){t.graph().dummyChains=[],i.each(t.edges(),(function(e){!function(t,e){var n,i,o,s=e.v,a=t.node(s).rank,c=e.w,l=t.node(c).rank,u=e.name,h=t.edge(e),d=h.labelRank;if(l===a+1)return;for(t.removeEdge(e),o=0,++a;a<l;++o,++a)h.points=[],i={width:0,height:0,edgeLabel:h,edgeObj:e,rank:a},n=r.addDummyNode(t,"edge",i,"_d"),a===d&&(i.width=h.width,i.height=h.height,i.dummy="edge-label",i.labelpos=h.labelpos),t.setEdge(s,n,{weight:h.weight},u),0===o&&t.graph().dummyChains.push(n),s=n;t.setEdge(s,c,{weight:h.weight},u)}(t,e)}))},undo:function(t){i.each(t.graph().dummyChains,(function(e){var n,i=t.node(e),r=i.edgeLabel;for(t.setEdge(i.edgeObj,r);i.dummy;)n=t.successors(e)[0],t.removeNode(e),r.points.push({x:i.x,y:i.y}),"edge-label"===i.dummy&&(r.x=i.x,r.y=i.y,r.width=i.width,r.height=i.height),e=n,i=t.node(e)}))}}},{"./lodash":10,"./util":29}],13:[function(t,e,n){var i=t("../lodash");e.exports=function(t,e,n){var r,o={};i.each(n,(function(n){for(var i,s,a=t.parent(n);a;){if((i=t.parent(a))?(s=o[i],o[i]=a):(s=r,r=a),s&&s!==a)return void e.setEdge(s,a);a=i}}))}},{"../lodash":10}],14:[function(t,e,n){var i=t("../lodash");e.exports=function(t,e){return i.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=i.reduce(n,(function(e,n){var i=t.edge(n),r=t.node(n.v);return{sum:e.sum+i.weight*r.order,weight:e.weight+i.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}},{"../lodash":10}],15:[function(t,e,n){var i=t("../lodash"),r=t("../graphlib").Graph;e.exports=function(t,e,n){var o=function(t){var e;for(;t.hasNode(e=i.uniqueId("_root")););return e}(t),s=new r({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return i.each(t.nodes(),(function(r){var a=t.node(r),c=t.parent(r);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(s.setNode(r),s.setParent(r,c||o),i.each(t[n](r),(function(e){var n=e.v===r?e.w:e.v,o=s.edge(n,r),a=i.isUndefined(o)?0:o.weight;s.setEdge(n,r,{weight:t.edge(e).weight+a})})),i.has(a,"minRank")&&s.setNode(r,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),s}},{"../graphlib":7,"../lodash":10}],16:[function(t,e,n){var i=t("../lodash");function r(t,e,n){for(var r=i.zipObject(n,i.map(n,(function(t,e){return e}))),o=i.flatten(i.map(e,(function(e){return i.chain(t.outEdges(e)).map((function(e){return{pos:r[e.w],weight:t.edge(e).weight}})).sortBy("pos").value()})),!0),s=1;s<n.length;)s<<=1;var a=2*s-1;s-=1;var c=i.map(new Array(a),(function(){return 0})),l=0;return i.each(o.forEach((function(t){var e=t.pos+s;c[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=c[e+1]),c[e=e-1>>1]+=t.weight;l+=t.weight*n}))),l}e.exports=function(t,e){for(var n=0,i=1;i<e.length;++i)n+=r(t,e[i-1],e[i]);return n}},{"../lodash":10}],17:[function(t,e,n){var i=t("../lodash"),r=t("./init-order"),o=t("./cross-count"),s=t("./sort-subgraph"),a=t("./build-layer-graph"),c=t("./add-subgraph-constraints"),l=t("../graphlib").Graph,u=t("../util");function h(t,e,n){return i.map(e,(function(e){return a(t,e,n)}))}function d(t,e){var n=new l;i.each(t,(function(t){var r=t.graph().root,o=s(t,r,n,e);i.each(o.vs,(function(e,n){t.node(e).order=n})),c(t,n,o.vs)}))}function f(t,e){i.each(e,(function(e){i.each(e,(function(e,n){t.node(e).order=n}))}))}e.exports=function(t){var e=u.maxRank(t),n=h(t,i.range(1,e+1),"inEdges"),s=h(t,i.range(e-1,-1,-1),"outEdges"),a=r(t);f(t,a);for(var c,l=Number.POSITIVE_INFINITY,p=0,m=0;m<4;++p,++m){d(p%2?n:s,p%4>=2),a=u.buildLayerMatrix(t);var g=o(t,a);g<l&&(m=0,c=i.cloneDeep(a),l=g)}f(t,c)}},{"../graphlib":7,"../lodash":10,"../util":29,"./add-subgraph-constraints":13,"./build-layer-graph":15,"./cross-count":16,"./init-order":18,"./sort-subgraph":20}],18:[function(t,e,n){var i=t("../lodash");e.exports=function(t){var e={},n=i.filter(t.nodes(),(function(e){return!t.children(e).length})),r=i.max(i.map(n,(function(e){return t.node(e).rank}))),o=i.map(i.range(r+1),(function(){return[]}));var s=i.sortBy(n,(function(e){return t.node(e).rank}));return i.each(s,(function n(r){if(i.has(e,r))return;e[r]=!0;var s=t.node(r);o[s.rank].push(r),i.each(t.successors(r),n)})),o}},{"../lodash":10}],19:[function(t,e,n){var i=t("../lodash");e.exports=function(t,e){var n={};return i.each(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};i.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),i.each(e.edges(),(function(t){var e=n[t.v],r=n[t.w];i.isUndefined(e)||i.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(i.isUndefined(e.barycenter)||i.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,i=0;t.weight&&(n+=t.barycenter*t.weight,i+=t.weight);e.weight&&(n+=e.barycenter*e.weight,i+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),i.each(o.in.reverse(),n(o)),i.each(o.out,r(o))}return i.chain(e).filter((function(t){return!t.merged})).map((function(t){return i.pick(t,["vs","i","barycenter","weight"])})).value()}(i.filter(n,(function(t){return!t.indegree})))}},{"../lodash":10}],20:[function(t,e,n){var i=t("../lodash"),r=t("./barycenter"),o=t("./resolve-conflicts"),s=t("./sort");e.exports=function t(e,n,a,c){var l=e.children(n),u=e.node(n),h=u?u.borderLeft:void 0,d=u?u.borderRight:void 0,f={};h&&(l=i.filter(l,(function(t){return t!==h&&t!==d})));var p=r(e,l);i.each(p,(function(n){if(e.children(n.v).length){var r=t(e,n.v,a,c);f[n.v]=r,i.has(r,"barycenter")&&(o=n,s=r,i.isUndefined(o.barycenter)?(o.barycenter=s.barycenter,o.weight=s.weight):(o.barycenter=(o.barycenter*o.weight+s.barycenter*s.weight)/(o.weight+s.weight),o.weight+=s.weight))}var o,s}));var m=o(p,a);!function(t,e){i.each(t,(function(t){t.vs=i.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(m,f);var g=s(m,c);if(h&&(g.vs=i.flatten([h,g.vs,d],!0),e.predecessors(h).length)){var _=e.node(e.predecessors(h)[0]),v=e.node(e.predecessors(d)[0]);i.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+_.order+v.order)/(g.weight+2),g.weight+=2}return g}},{"../lodash":10,"./barycenter":14,"./resolve-conflicts":19,"./sort":21}],21:[function(t,e,n){var i=t("../lodash"),r=t("../util");function o(t,e,n){for(var r;e.length&&(r=i.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}e.exports=function(t,e){var n=r.partition(t,(function(t){return i.has(t,"barycenter")})),s=n.lhs,a=i.sortBy(n.rhs,(function(t){return-t.i})),c=[],l=0,u=0,h=0;s.sort((d=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:d?e.i-t.i:t.i-e.i})),h=o(c,a,h),i.each(s,(function(t){h+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,u+=t.weight,h=o(c,a,h)}));var d;var f={vs:i.flatten(c,!0)};u&&(f.barycenter=l/u,f.weight=u);return f}},{"../lodash":10,"../util":29}],22:[function(t,e,n){var i=t("./lodash");e.exports=function(t){var e=function(t){var e={},n=0;function r(o){var s=n;i.each(t.children(o),r),e[o]={low:s,lim:n++}}return i.each(t.children(),r),e}(t);i.each(t.graph().dummyChains,(function(n){for(var i=t.node(n),r=i.edgeObj,o=function(t,e,n,i){var r,o,s=[],a=[],c=Math.min(e[n].low,e[i].low),l=Math.max(e[n].lim,e[i].lim);r=n;do{r=t.parent(r),s.push(r)}while(r&&(e[r].low>c||l>e[r].lim));o=r,r=i;for(;(r=t.parent(r))!==o;)a.push(r);return{path:s.concat(a.reverse()),lca:o}}(t,e,r.v,r.w),s=o.path,a=o.lca,c=0,l=s[c],u=!0;n!==r.w;){if(i=t.node(n),u){for(;(l=s[c])!==a&&t.node(l).maxRank<i.rank;)c++;l===a&&(u=!1)}if(!u){for(;c<s.length-1&&t.node(l=s[c+1]).minRank<=i.rank;)c++;l=s[c]}t.setParent(n,l),n=t.successors(n)[0]}}))}},{"./lodash":10}],23:[function(t,e,n){var i=t("../lodash"),r=t("../graphlib").Graph,o=t("../util");function s(t,e){var n={};return i.reduce(e,(function(e,r){var o=0,s=0,a=e.length,l=i.last(r);return i.each(r,(function(e,u){var h=function(t,e){if(t.node(e).dummy)return i.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),d=h?t.node(h).order:a;(h||e===l)&&(i.each(r.slice(s,u+1),(function(e){i.each(t.predecessors(e),(function(i){var r=t.node(i),s=r.order;!(s<o||d<s)||r.dummy&&t.node(e).dummy||c(n,i,e)}))})),s=u+1,o=d)})),r})),n}function a(t,e){var n={};function r(e,r,o,s,a){var l;i.each(i.range(r,o),(function(r){l=e[r],t.node(l).dummy&&i.each(t.predecessors(l),(function(e){var i=t.node(e);i.dummy&&(i.order<s||i.order>a)&&c(n,e,l)}))}))}return i.reduce(e,(function(e,n){var o,s=-1,a=0;return i.each(n,(function(i,c){if("border"===t.node(i).dummy){var l=t.predecessors(i);l.length&&(o=t.node(l[0]).order,r(n,a,c,s,o),a=c,s=o)}r(n,a,n.length,o,e.length)})),n})),n}function c(t,e,n){if(e>n){var i=e;e=n,n=i}var r=t[e];r||(t[e]=r={}),r[n]=!0}function l(t,e,n){if(e>n){var r=e;e=n,n=r}return i.has(t[e],n)}function u(t,e,n,r){var o={},s={},a={};return i.each(e,(function(t){i.each(t,(function(t,e){o[t]=t,s[t]=t,a[t]=e}))})),i.each(e,(function(t){var e=-1;i.each(t,(function(t){var c=r(t);if(c.length)for(var u=((c=i.sortBy(c,(function(t){return a[t]}))).length-1)/2,h=Math.floor(u),d=Math.ceil(u);h<=d;++h){var f=c[h];s[t]===t&&e<a[f]&&!l(n,t,f)&&(s[f]=t,s[t]=o[t]=o[f],e=a[f])}}))})),{root:o,align:s}}function h(t,e,n,o,s){var a={},c=function(t,e,n,o){var s=new r,a=t.graph(),c=function(t,e,n){return function(r,o,s){var a,c=r.node(o),l=r.node(s),u=0;if(u+=c.width/2,i.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":a=-c.width/2;break;case"r":a=c.width/2}if(a&&(u+=n?a:-a),a=0,u+=(c.dummy?e:t)/2,u+=(l.dummy?e:t)/2,u+=l.width/2,i.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":a=l.width/2;break;case"r":a=-l.width/2}return a&&(u+=n?a:-a),a=0,u}}(a.nodesep,a.edgesep,o);return i.each(e,(function(e){var r;i.each(e,(function(e){var i=n[e];if(s.setNode(i),r){var o=n[r],a=s.edge(o,i);s.setEdge(o,i,Math.max(c(t,e,r),a||0))}r=e}))})),s}(t,e,n,s),l={};return i.each(c.nodes(),(function t(e){i.has(l,e)||(l[e]=!0,a[e]=i.reduce(c.inEdges(e),(function(e,n){return t(n.v),Math.max(e,a[n.v]+c.edge(n))}),0))})),i.each(c.nodes(),(function t(e){if(2!==l[e]){l[e]++;var n=i.reduce(c.outEdges(e),(function(e,n){return t(n.w),Math.min(e,a[n.w]-c.edge(n))}),Number.POSITIVE_INFINITY);n!==Number.POSITIVE_INFINITY&&(a[e]=Math.max(a[e],n))}})),i.each(o,(function(t){a[t]=a[n[t]]})),a}function d(t,e){return i.min(e,(function(e){var n=i.min(e,(function(e,n){return e-m(t,n)/2}));return i.max(e,(function(e,n){return e+m(t,n)/2}))-n}))}function f(t,e){var n=i.min(e),r=i.max(e);i.each(["u","d"],(function(o){i.each(["l","r"],(function(s){var a,c=o+s,l=t[c];l!==e&&(a="l"===s?n-i.min(l):r-i.max(l))&&(t[c]=i.mapValues(l,(function(t){return t+a})))}))}))}function p(t,e){return i.mapValues(t.ul,(function(n,r){if(e)return t[e.toLowerCase()][r];var o=i.sortBy(i.pluck(t,r));return(o[1]+o[2])/2}))}function m(t,e){return t.node(e).width}e.exports={positionX:function(t){var e,n=o.buildLayerMatrix(t),r=i.merge(s(t,n),a(t,n)),c={};i.each(["u","d"],(function(o){e="u"===o?n:i.values(n).reverse(),i.each(["l","r"],(function(n){"r"===n&&(e=i.map(e,(function(t){return i.values(t).reverse()})));var s=i.bind("u"===o?t.predecessors:t.successors,t),a=u(t,e,r,s),l=h(t,e,a.root,a.align,"r"===n);"r"===n&&(l=i.mapValues(l,(function(t){return-t}))),c[o+n]=l}))}));var l=d(t,c);return f(c,l),p(c,t.graph().align)},findType1Conflicts:s,findType2Conflicts:a,addConflict:c,hasConflict:l,verticalAlignment:u,horizontalCompaction:h,alignCoordinates:f,findSmallestWidthAlignment:d,balance:p}},{"../graphlib":7,"../lodash":10,"../util":29}],24:[function(t,e,n){var i=t("../lodash"),r=t("../util"),o=t("./bk").positionX;e.exports=function(t){(function(t){var e=r.buildLayerMatrix(t),n=t.graph().ranksep,o=0;i.each(e,(function(e){var r=i.max(i.map(e,(function(e){return t.node(e).height})));i.each(e,(function(e){t.node(e).y=o+r/2})),o+=r+n}))})(t=r.asNonCompoundGraph(t)),i.each(o(t),(function(e,n){t.node(n).x=e}))}},{"../lodash":10,"../util":29,"./bk":23}],25:[function(t,e,n){var i=t("../lodash"),r=t("../graphlib").Graph,o=t("./util").slack;function s(t,e){return i.each(t.nodes(),(function n(r){i.each(e.nodeEdges(r),(function(i){var s=i.v,a=r===s?i.w:s;t.hasNode(a)||o(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()}function a(t,e){return i.min(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return o(e,n)}))}function c(t,e,n){i.each(t.nodes(),(function(t){e.node(t).rank+=n}))}e.exports=function(t){var e,n,i=new r({directed:!1}),l=t.nodes()[0],u=t.nodeCount();i.setNode(l,{});for(;s(i,t)<u;)e=a(i,t),n=i.hasNode(e.v)?o(t,e):-o(t,e),c(i,t,n);return i}},{"../graphlib":7,"../lodash":10,"./util":28}],26:[function(t,e,n){var i=t("./util").longestPath,r=t("./feasible-tree"),o=t("./network-simplex");e.exports=function(t){switch(t.graph().ranker){case"network-simplex":a(t);break;case"tight-tree":!function(t){i(t),r(t)}(t);break;case"longest-path":s(t);break;default:a(t)}};var s=i;function a(t){o(t)}},{"./feasible-tree":25,"./network-simplex":27,"./util":28}],27:[function(t,e,n){var i=t("../lodash"),r=t("./feasible-tree"),o=t("./util").slack,s=t("./util").longestPath,a=t("../graphlib").alg.preorder,c=t("../graphlib").alg.postorder,l=t("../util").simplify;function u(t){t=l(t),s(t);var e,n=r(t);for(f(n),h(n,t);e=m(n);)_(n,t,e,g(n,t,e))}function h(t,e){var n=c(t,t.nodes());n=n.slice(0,n.length-1),i.each(n,(function(n){!function(t,e,n){var i=t.node(n).parent;t.edge(n,i).cutvalue=d(t,e,n)}(t,e,n)}))}function d(t,e,n){var r=t.node(n).parent,o=!0,s=e.edge(n,r),a=0;return s||(o=!1,s=e.edge(r,n)),a=s.weight,i.each(e.nodeEdges(n),(function(i){var s=i.v===n,c=s?i.w:i.v;if(c!==r){var l=s===o,u=e.edge(i).weight;if(a+=l?u:-u,function(t,e,n){return t.hasEdge(e,n)}(t,n,c)){var h=t.edge(n,c).cutvalue;a+=l?-h:h}}})),a}function f(t,e){arguments.length<2&&(e=t.nodes()[0]),p(t,{},1,e)}function p(t,e,n,r,o){var s=n,a=t.node(r);return e[r]=!0,i.each(t.neighbors(r),(function(o){i.has(e,o)||(n=p(t,e,n,o,r))})),a.low=s,a.lim=n++,o?a.parent=o:delete a.parent,n}function m(t){return i.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function g(t,e,n){var r=n.v,s=n.w;e.hasEdge(r,s)||(r=n.w,s=n.v);var a=t.node(r),c=t.node(s),l=a,u=!1;a.lim>c.lim&&(l=c,u=!0);var h=i.filter(e.edges(),(function(e){return u===v(t,t.node(e.v),l)&&u!==v(t,t.node(e.w),l)}));return i.min(h,(function(t){return o(e,t)}))}function _(t,e,n,r){var o=n.v,s=n.w;t.removeEdge(o,s),t.setEdge(r.v,r.w,{}),f(t),h(t,e),function(t,e){var n=i.find(t.nodes(),(function(t){return!e.node(t).parent})),r=a(t,n);r=r.slice(1),i.each(r,(function(n){var i=t.node(n).parent,r=e.edge(n,i),o=!1;r||(r=e.edge(i,n),o=!0),e.node(n).rank=e.node(i).rank+(o?r.minlen:-r.minlen)}))}(t,e)}function v(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}e.exports=u,u.initLowLimValues=f,u.initCutValues=h,u.calcCutValue=d,u.leaveEdge=m,u.enterEdge=g,u.exchangeEdges=_},{"../graphlib":7,"../lodash":10,"../util":29,"./feasible-tree":25,"./util":28}],28:[function(t,e,n){var i=t("../lodash");e.exports={longestPath:function(t){var e={};i.each(t.sources(),(function n(r){var o=t.node(r);if(i.has(e,r))return o.rank;e[r]=!0;var s=i.min(i.map(t.outEdges(r),(function(e){return n(e.w)-t.edge(e).minlen})));return s===Number.POSITIVE_INFINITY&&(s=0),o.rank=s}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}}},{"../lodash":10}],29:[function(t,e,n){var i=t("./lodash"),r=t("./graphlib").Graph;function o(t,e,n,r){var o;do{o=i.uniqueId(r)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function s(t){return i.max(i.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!i.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(t){var e=(new r).setGraph(t.graph());return i.each(t.nodes(),(function(n){e.setNode(n,t.node(n))})),i.each(t.edges(),(function(n){var i=e.edge(n.v,n.w)||{weight:0,minlen:1},r=t.edge(n);e.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})})),e},asNonCompoundGraph:function(t){var e=new r({multigraph:t.isMultigraph()}).setGraph(t.graph());return i.each(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),i.each(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=i.map(t.nodes(),(function(e){var n={};return i.each(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return i.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=i.map(t.nodes(),(function(e){var n={};return i.each(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return i.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,i,r=t.x,o=t.y,s=e.x-r,a=e.y-o,c=t.width/2,l=t.height/2;if(!s&&!a)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(a)*c>Math.abs(s)*l?(a<0&&(l=-l),n=l*s/a,i=l):(s<0&&(c=-c),n=c,i=c*a/s);return{x:r+n,y:o+i}},buildLayerMatrix:function(t){var e=i.map(i.range(s(t)+1),(function(){return[]}));return i.each(t.nodes(),(function(n){var r=t.node(n),o=r.rank;i.isUndefined(o)||(e[o][r.order]=n)})),e},normalizeRanks:function(t){var e=i.min(i.map(t.nodes(),(function(e){return t.node(e).rank})));i.each(t.nodes(),(function(n){var r=t.node(n);i.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=i.min(i.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];i.each(t.nodes(),(function(r){var o=t.node(r).rank-e;i.has(n,o)||(n[o]=[]),n[o].push(r)}));var r=0,o=t.graph().nodeRankFactor;i.each(n,(function(e,n){i.isUndefined(e)&&n%o!=0?--r:r&&i.each(e,(function(e){t.node(e).rank+=r}))}))},addBorderNode:function(t,e,n,i){var r={width:0,height:0};arguments.length>=4&&(r.rank=n,r.order=i);return o(t,"border",r,e)},maxRank:s,partition:function(t,e){var n={lhs:[],rhs:[]};return i.each(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=i.now();try{return e()}finally{console.log(t+" time: "+(i.now()-n)+"ms")}},notime:function(t,e){return e()}}},{"./graphlib":7,"./lodash":10}],30:[function(t,e,n){e.exports="0.7.1"},{}],31:[function(t,e,n){var i=t("./lib");e.exports={Graph:i.Graph,json:t("./lib/json"),alg:t("./lib/alg"),version:i.version}},{"./lib":47,"./lib/alg":38,"./lib/json":48}],32:[function(t,e,n){var i=t("../lodash");e.exports=function(t){var e,n={},r=[];function o(r){i.has(n,r)||(n[r]=!0,e.push(r),i.each(t.successors(r),o),i.each(t.predecessors(r),o))}return i.each(t.nodes(),(function(t){e=[],o(t),e.length&&r.push(e)})),r}},{"../lodash":49}],33:[function(t,e,n){var i=t("../lodash");e.exports=function(t,e,n){i.isArray(e)||(e=[e]);var r=[],o={};return i.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,n,r,o,s){i.has(o,n)||(o[n]=!0,r||s.push(n),i.each(e.neighbors(n),(function(n){t(e,n,r,o,s)})),r&&s.push(n))}(t,e,"post"===n,o,r)})),r}},{"../lodash":49}],34:[function(t,e,n){var i=t("./dijkstra"),r=t("../lodash");e.exports=function(t,e,n){return r.transform(t.nodes(),(function(r,o){r[o]=i(t,o,e,n)}),{})}},{"../lodash":49,"./dijkstra":35}],35:[function(t,e,n){var i=t("../lodash"),r=t("../data/priority-queue");e.exports=function(t,e,n,i){return function(t,e,n,i){var o,s,a={},c=new r,l=function(t){var e=t.v!==o?t.v:t.w,i=a[e],r=n(t),l=s.distance+r;if(r<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+r);l<i.distance&&(i.distance=l,i.predecessor=o,c.decrease(e,l))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;a[t]={distance:n},c.add(t,n)}));for(;c.size()>0&&(o=c.removeMin(),(s=a[o]).distance!==Number.POSITIVE_INFINITY);)i(o).forEach(l);return a}(t,String(e),n||o,i||function(e){return t.outEdges(e)})};var o=i.constant(1)},{"../data/priority-queue":45,"../lodash":49}],36:[function(t,e,n){var i=t("../lodash"),r=t("./tarjan");e.exports=function(t){return i.filter(r(t),(function(t){return t.length>1}))}},{"../lodash":49,"./tarjan":43}],37:[function(t,e,n){var i=t("../lodash");e.exports=function(t,e,n){return function(t,e,n){var i={},r=t.nodes();return r.forEach((function(t){i[t]={},i[t][t]={distance:0},r.forEach((function(e){t!==e&&(i[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var r=n.v===t?n.w:n.v,o=e(n);i[t][r]={distance:o,predecessor:t}}))})),r.forEach((function(t){var e=i[t];r.forEach((function(n){var o=i[n];r.forEach((function(n){var i=o[t],r=e[n],s=o[n],a=i.distance+r.distance;a<s.distance&&(s.distance=a,s.predecessor=r.predecessor)}))}))})),i}(t,e||r,n||function(e){return t.outEdges(e)})};var r=i.constant(1)},{"../lodash":49}],38:[function(t,e,n){e.exports={components:t("./components"),dijkstra:t("./dijkstra"),dijkstraAll:t("./dijkstra-all"),findCycles:t("./find-cycles"),floydWarshall:t("./floyd-warshall"),isAcyclic:t("./is-acyclic"),postorder:t("./postorder"),preorder:t("./preorder"),prim:t("./prim"),tarjan:t("./tarjan"),topsort:t("./topsort")}},{"./components":32,"./dijkstra":35,"./dijkstra-all":34,"./find-cycles":36,"./floyd-warshall":37,"./is-acyclic":39,"./postorder":40,"./preorder":41,"./prim":42,"./tarjan":43,"./topsort":44}],39:[function(t,e,n){var i=t("./topsort");e.exports=function(t){try{i(t)}catch(t){if(t instanceof i.CycleException)return!1;throw t}return!0}},{"./topsort":44}],40:[function(t,e,n){var i=t("./dfs");e.exports=function(t,e){return i(t,e,"post")}},{"./dfs":33}],41:[function(t,e,n){var i=t("./dfs");e.exports=function(t,e){return i(t,e,"pre")}},{"./dfs":33}],42:[function(t,e,n){var i=t("../lodash"),r=t("../graph"),o=t("../data/priority-queue");e.exports=function(t,e){var n,s=new r,a={},c=new o;function l(t){var i=t.v===n?t.w:t.v,r=c.priority(i);if(void 0!==r){var o=e(t);o<r&&(a[i]=n,c.decrease(i,o))}}if(0===t.nodeCount())return s;i.each(t.nodes(),(function(t){c.add(t,Number.POSITIVE_INFINITY),s.setNode(t)})),c.decrease(t.nodes()[0],0);var u=!1;for(;c.size()>0;){if(n=c.removeMin(),i.has(a,n))s.setEdge(n,a[n]);else{if(u)throw new Error("Input graph is not connected: "+t);u=!0}t.nodeEdges(n).forEach(l)}return s}},{"../data/priority-queue":45,"../graph":46,"../lodash":49}],43:[function(t,e,n){var i=t("../lodash");e.exports=function(t){var e=0,n=[],r={},o=[];return t.nodes().forEach((function(s){i.has(r,s)||function s(a){var c=r[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(t){i.has(r,t)?r[t].onStack&&(c.lowlink=Math.min(c.lowlink,r[t].index)):(s(t),c.lowlink=Math.min(c.lowlink,r[t].lowlink))})),c.lowlink===c.index){var l,u=[];do{l=n.pop(),r[l].onStack=!1,u.push(l)}while(a!==l);o.push(u)}}(s)})),o}},{"../lodash":49}],44:[function(t,e,n){var i=t("../lodash");function r(t){var e={},n={},r=[];if(i.each(t.sinks(),(function s(a){if(i.has(n,a))throw new o;i.has(e,a)||(n[a]=!0,e[a]=!0,i.each(t.predecessors(a),s),delete n[a],r.push(a))})),i.size(e)!==t.nodeCount())throw new o;return r}function o(){}e.exports=r,r.CycleException=o},{"../lodash":49}],45:[function(t,e,n){var i=t("../lodash");function r(){this._arr=[],this._keyIndices={}}e.exports=r,r.prototype.size=function(){return this._arr.length},r.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},r.prototype.has=function(t){return i.has(this._keyIndices,t)},r.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},r.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},r.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!i.has(n,t)){var r=this._arr,o=r.length;return n[t]=o,r.push({key:t,priority:e}),this._decrease(o),!0}return!1},r.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},r.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},r.prototype._heapify=function(t){var e=this._arr,n=2*t,i=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,i<e.length&&(r=e[i].priority<e[r].priority?i:r),r!==t&&(this._swap(t,r),this._heapify(r)))},r.prototype._decrease=function(t){for(var e,n=this._arr,i=n[t].priority;0!==t&&!(n[e=t>>1].priority<i);)this._swap(t,e),t=e},r.prototype._swap=function(t,e){var n=this._arr,i=this._keyIndices,r=n[t],o=n[e];n[t]=o,n[e]=r,i[o.key]=t,i[r.key]=e}},{"../lodash":49}],46:[function(t,e,n){var i=t("./lodash");e.exports=r;function r(t){this._isDirected=!i.has(t,"directed")||t.directed,this._isMultigraph=!!i.has(t,"multigraph")&&t.multigraph,this._isCompound=!!i.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=i.constant(void 0),this._defaultEdgeLabelFn=i.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function o(t,e){i.has(t,e)?t[e]++:t[e]=1}function s(t,e){--t[e]||delete t[e]}function a(t,e,n,r){if(!t&&e>n){var o=e;e=n,n=o}return e+""+n+""+(i.isUndefined(r)?"\0":r)}function c(t,e,n,i){if(!t&&e>n){var r=e;e=n,n=r}var o={v:e,w:n};return i&&(o.name=i),o}function l(t,e){return a(t,e.v,e.w,e.name)}r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(t){return this._label=t,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultNodeLabelFn=t,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return i.keys(this._nodes)},r.prototype.sources=function(){return i.filter(this.nodes(),(function(t){return i.isEmpty(this._in[t])}),this)},r.prototype.sinks=function(){return i.filter(this.nodes(),(function(t){return i.isEmpty(this._out[t])}),this)},r.prototype.setNodes=function(t,e){var n=arguments;return i.each(t,(function(t){n.length>1?this.setNode(t,e):this.setNode(t)}),this),this},r.prototype.setNode=function(t,e){return i.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},r.prototype.node=function(t){return this._nodes[t]},r.prototype.hasNode=function(t){return i.has(this._nodes,t)},r.prototype.removeNode=function(t){var e=this;if(i.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],i.each(this.children(t),(function(t){this.setParent(t)}),this),delete this._children[t]),i.each(i.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],i.each(i.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},r.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i.isUndefined(e))e="\0";else{for(var n=e;!i.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},r.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},r.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},r.prototype.children=function(t){if(i.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return i.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},r.prototype.predecessors=function(t){var e=this._preds[t];if(e)return i.keys(e)},r.prototype.successors=function(t){var e=this._sucs[t];if(e)return i.keys(e)},r.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return i.union(e,this.successors(t))},r.prototype.setDefaultEdgeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultEdgeLabelFn=t,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return i.values(this._edgeObjs)},r.prototype.setPath=function(t,e){var n=this,r=arguments;return i.reduce(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this},r.prototype.setEdge=function(){var t,e,n,r,s=!1;i.isPlainObject(arguments[0])?(t=arguments[0].v,e=arguments[0].w,n=arguments[0].name,2===arguments.length&&(r=arguments[1],s=!0)):(t=arguments[0],e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],s=!0)),t=""+t,e=""+e,i.isUndefined(n)||(n=""+n);var l=a(this._isDirected,t,e,n);if(i.has(this._edgeLabels,l))return s&&(this._edgeLabels[l]=r),this;if(!i.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=s?r:this._defaultEdgeLabelFn(t,e,n);var u=c(this._isDirected,t,e,n);return t=u.v,e=u.w,Object.freeze(u),this._edgeObjs[l]=u,o(this._preds[e],t),o(this._sucs[t],e),this._in[e][l]=u,this._out[t][l]=u,this._edgeCount++,this},r.prototype.edge=function(t,e,n){var i=1===arguments.length?l(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return this._edgeLabels[i]},r.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?l(this._isDirected,arguments[0]):a(this._isDirected,t,e,n);return i.has(this._edgeLabels,r)},r.prototype.removeEdge=function(t,e,n){var i=1===arguments.length?l(this._isDirected,arguments[0]):a(this._isDirected,t,e,n),r=this._edgeObjs[i];return r&&(t=r.v,e=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],s(this._preds[e],t),s(this._sucs[t],e),delete this._in[e][i],delete this._out[t][i],this._edgeCount--),this},r.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.v===e})):r}},r.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.w===e})):r}},r.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},{"./lodash":49}],47:[function(t,e,n){e.exports={Graph:t("./graph"),version:t("./version")}},{"./graph":46,"./version":50}],48:[function(t,e,n){var i=t("./lodash"),r=t("./graph");function o(t){return i.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return i.isUndefined(n)||(o.value=n),i.isUndefined(r)||(o.parent=r),o}))}function s(t){return i.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return i.isUndefined(e.name)||(r.name=e.name),i.isUndefined(n)||(r.value=n),r}))}e.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:o(t),edges:s(t)};i.isUndefined(t.graph())||(e.value=i.clone(t.graph()));return e},read:function(t){var e=new r(t.options).setGraph(t.value);return i.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),i.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}}},{"./graph":46,"./lodash":49}],49:[function(t,e,n){e.exports=t(10)},{"/Users/cpettitt/projects/dagre/lib/lodash.js":10,lodash:51}],50:[function(t,e,n){e.exports="1.0.1"},{}],51:[function(t,e,n){(function(t){(function(){var i=[],r=[],o=0,s=+new Date+"",a=/\b__p \+= '';/g,c=/\b(__p \+=) '' \+/g,l=/(__e\(.*?\)|\b__t\)) \+\n'';/g,u=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,h=/\w*$/,d=/^\s*function[ \n\r\t]+\w/,f=/<%=([\s\S]+?)%>/g,p=RegExp("^[ \t\v\f \ufeff\n\r\u2028\u2029 ]*0+(?=.$)"),m=/($^)/,g=/\bthis\b/,_=/['\n\r\t\u2028\u2029\\]/g,v=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],y=0,b="[object Arguments]",w="[object Array]",E="[object Boolean]",k="[object Date]",A="[object Object]",x="[object String]",C={"[object Function]":!1};C[b]=C[w]=C[E]=C[k]=C["[object Number]"]=C[A]=C["[object RegExp]"]=C[x]=!0;var T={leading:!1,maxWait:0,trailing:!1},L={configurable:!1,enumerable:!1,value:null,writable:!1},N={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1},S={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},P=N[typeof window]&&window||this,O=N[typeof n]&&n&&!n.nodeType&&n,R=N[typeof e]&&e&&!e.nodeType&&e,I=R&&R.exports===O&&O,j=N[typeof t]&&t;function K(t,e,n){for(var i=(n||0)-1,r=t?t.length:0;++i<r;)if(t[i]===e)return i;return-1}function M(t,e){var n=typeof e;if(t=t.cache,"boolean"==n||null==e)return t[e]?0:-1;"number"!=n&&"string"!=n&&(n="object");var i="number"==n?e:s+e;return t=(t=t[n])&&t[i],"object"==n?t&&K(t,e)>-1?0:-1:t?0:-1}function q(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var i="number"==n?t:s+t,r=e[n]||(e[n]={});"object"==n?(r[i]||(r[i]=[])).push(t):r[i]=!0}}function D(t){return t.charCodeAt(0)}function U(t,e){for(var n=t.criteria,i=e.criteria,r=-1,o=n.length;++r<o;){var s=n[r],a=i[r];if(s!==a){if(s>a||void 0===s)return 1;if(s<a||void 0===a)return-1}}return t.index-e.index}function B(t){var e=-1,n=t.length,i=t[0],r=t[n/2|0],o=t[n-1];if(i&&"object"==typeof i&&r&&"object"==typeof r&&o&&"object"==typeof o)return!1;var s=z();s.false=s.null=s.true=s[void 0]=!1;var a=z();for(a.array=t,a.cache=s,a.push=q;++e<n;)a.push(t[e]);return a}function F(t){return"\\"+S[t]}function H(){return i.pop()||[]}function z(){return r.pop()||{array:null,cache:null,criteria:null,false:!1,index:0,null:!1,number:null,object:null,push:null,string:null,true:!1,undefined:!1,value:null}}function V(t){t.length=0,i.length<40&&i.push(t)}function G(t){var e=t.cache;e&&G(e),t.array=t.cache=t.criteria=t.object=t.number=t.string=t.value=null,r.length<40&&r.push(t)}function W(t,e,n){e||(e=0),void 0===n&&(n=t?t.length:0);for(var i=-1,r=n-e||0,o=Array(r<0?0:r);++i<r;)o[i]=t[e+i];return o}!j||j.global!==j&&j.window!==j||(P=j);var Y=function t(e){var n=(e=e?Y.defaults(P.Object(),e,Y.pick(P,v)):P).Array,i=e.Boolean,r=e.Date,S=e.Function,O=e.Math,R=e.Number,I=e.Object,j=e.RegExp,q=e.String,Q=e.TypeError,$=[],J=I.prototype,Z=e._,X=J.toString,tt=j("^"+q(X).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),et=O.ceil,nt=e.clearTimeout,it=O.floor,rt=S.prototype.toString,ot=Ut(ot=I.getPrototypeOf)&&ot,st=J.hasOwnProperty,at=$.push,ct=e.setTimeout,lt=$.splice,ut=$.unshift,ht=function(){try{var t={},e=Ut(e=I.defineProperty)&&e,n=e(t,t,t)&&e}catch(t){}return n}(),dt=Ut(dt=I.create)&&dt,ft=Ut(ft=n.isArray)&&ft,pt=e.isFinite,mt=e.isNaN,gt=Ut(gt=I.keys)&>,_t=O.max,vt=O.min,yt=e.parseInt,bt=O.random,wt={};function Et(t){return t&&"object"==typeof t&&!Vt(t)&&st.call(t,"__wrapped__")?t:new kt(t)}function kt(t,e){this.__chain__=!!e,this.__wrapped__=t}wt[w]=n,wt[E]=i,wt[k]=r,wt["[object Function]"]=S,wt[A]=I,wt["[object Number]"]=R,wt["[object RegExp]"]=j,wt[x]=q,kt.prototype=Et.prototype;var At=Et.support={};function xt(t){var e=t[0],n=t[2],i=t[4];function r(){if(n){var t=W(n);at.apply(t,arguments)}if(this instanceof r){var o=Tt(e.prototype),s=e.apply(o,t||arguments);return oe(s)?s:o}return e.apply(i,t||arguments)}return Bt(r,t),r}function Ct(t,e,n,i,r){if(n){var o=n(t);if(void 0!==o)return o}if(!oe(t))return t;var s=X.call(t);if(!C[s])return t;var a=wt[s];switch(s){case E:case k:return new a(+t);case"[object Number]":case x:return new a(t);case"[object RegExp]":return(o=a(t.source,h.exec(t))).lastIndex=t.lastIndex,o}var c=Vt(t);if(e){var l=!i;i||(i=H()),r||(r=H());for(var u=i.length;u--;)if(i[u]==t)return r[u];o=c?a(t.length):{}}else o=c?W(t):Jt({},t);return c&&(st.call(t,"index")&&(o.index=t.index),st.call(t,"input")&&(o.input=t.input)),e?(i.push(t),r.push(o),(c?me:te)(t,(function(t,s){o[s]=Ct(t,e,n,i,r)})),l&&(V(i),V(r)),o):o}function Tt(t,e){return oe(t)?dt(t):{}}function Lt(t,e,n){if("function"!=typeof t)return Ke;if(void 0===e||!("prototype"in t))return t;var i=t.__bindData__;if(void 0===i&&(At.funcNames&&(i=!t.name),!(i=i||!At.funcDecomp))){var r=rt.call(t);At.funcNames||(i=!d.test(r)),i||(i=g.test(r),Bt(t,i))}if(!1===i||!0!==i&&1&i[1])return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)};case 4:return function(n,i,r,o){return t.call(e,n,i,r,o)}}return Ie(t,e)}function Nt(t){var e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=1&n,c=2&n,l=4&n,u=8&n,h=e;function d(){var t=a?o:this;if(i){var f=W(i);at.apply(f,arguments)}if((r||l)&&(f||(f=W(arguments)),r&&at.apply(f,r),l&&f.length<s))return n|=16,Nt([e,u?n:-4&n,f,null,o,s]);if(f||(f=arguments),c&&(e=t[h]),this instanceof d){t=Tt(e.prototype);var p=e.apply(t,f);return oe(p)?p:t}return e.apply(t,f)}return Bt(d,t),d}function St(t,e){var n=-1,i=Dt(),r=t?t.length:0,o=r>=75&&i===K,s=[];if(o){var a=B(e);a?(i=M,e=a):o=!1}for(;++n<r;){var c=t[n];i(e,c)<0&&s.push(c)}return o&&G(e),s}function Pt(t,e,n,i){for(var r=(i||0)-1,o=t?t.length:0,s=[];++r<o;){var a=t[r];if(a&&"object"==typeof a&&"number"==typeof a.length&&(Vt(a)||zt(a))){e||(a=Pt(a,e,n));var c=-1,l=a.length,u=s.length;for(s.length+=l;++c<l;)s[u++]=a[c]}else n||s.push(a)}return s}function Ot(t,e,n,i,r,o){if(n){var s=n(t,e);if(void 0!==s)return!!s}if(t===e)return 0!==t||1/t==1/e;if(!(t!=t||t&&N[typeof t]||e&&N[typeof e]))return!1;if(null==t||null==e)return t===e;var a=X.call(t),c=X.call(e);if(a==b&&(a=A),c==b&&(c=A),a!=c)return!1;switch(a){case E:case k:return+t==+e;case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object RegExp]":case x:return t==q(e)}var l=a==w;if(!l){var u=st.call(t,"__wrapped__"),h=st.call(e,"__wrapped__");if(u||h)return Ot(u?t.__wrapped__:t,h?e.__wrapped__:e,n,i,r,o);if(a!=A)return!1;var d=t.constructor,f=e.constructor;if(d!=f&&!(re(d)&&d instanceof d&&re(f)&&f instanceof f)&&"constructor"in t&&"constructor"in e)return!1}var p=!r;r||(r=H()),o||(o=H());for(var m=r.length;m--;)if(r[m]==t)return o[m]==e;var g=0;if(s=!0,r.push(t),o.push(e),l){if(m=t.length,g=e.length,(s=g==m)||i)for(;g--;){var _=m,v=e[g];if(i)for(;_--&&!(s=Ot(t[_],v,n,i,r,o)););else if(!(s=Ot(t[g],v,n,i,r,o)))break}}else Xt(e,(function(e,a,c){if(st.call(c,a))return g++,s=st.call(t,a)&&Ot(t[a],e,n,i,r,o)})),s&&!i&&Xt(t,(function(t,e,n){if(st.call(n,e))return s=--g>-1}));return r.pop(),o.pop(),p&&(V(r),V(o)),s}function Rt(t,e,n,i,r){(Vt(e)?me:te)(e,(function(e,o){var s,a,c=e,l=t[o];if(e&&((a=Vt(e))||ae(e))){for(var u,h=i.length;h--;)if(s=i[h]==e){l=r[h];break}if(!s)n&&(u=void 0!==(c=n(l,e)))&&(l=c),u||(l=a?Vt(l)?l:[]:ae(l)?l:{}),i.push(e),r.push(l),u||Rt(l,e,n,i,r)}else n&&void 0===(c=n(l,e))&&(c=e),void 0!==c&&(l=c);t[o]=l}))}function It(t,e){return t+it(bt()*(e-t+1))}function jt(t,e,n){var i=-1,r=Dt(),o=t?t.length:0,s=[],a=!e&&o>=75&&r===K,c=n||a?H():s;a&&(r=M,c=B(c));for(;++i<o;){var l=t[i],u=n?n(l,i,t):l;(e?!i||c[c.length-1]!==u:r(c,u)<0)&&((n||a)&&c.push(u),s.push(l))}return a?(V(c.array),G(c)):n&&V(c),s}function Kt(t){return function(e,n,i){var r={};n=Et.createCallback(n,i,3);var o=-1,s=e?e.length:0;if("number"==typeof s)for(;++o<s;){var a=e[o];t(r,a,n(a,o,e),e)}else te(e,(function(e,i,o){t(r,e,n(e,i,o),o)}));return r}}function Mt(t,e,n,i,r,o){var s=1&e,a=4&e,c=16&e,l=32&e;if(!(2&e)&&!re(t))throw new Q;c&&!n.length&&(e&=-17,c=n=!1),l&&!i.length&&(e&=-33,l=i=!1);var u=t&&t.__bindData__;return u&&!0!==u?((u=W(u))[2]&&(u[2]=W(u[2])),u[3]&&(u[3]=W(u[3])),!s||1&u[1]||(u[4]=r),!s&&1&u[1]&&(e|=8),!a||4&u[1]||(u[5]=o),c&&at.apply(u[2]||(u[2]=[]),n),l&&ut.apply(u[3]||(u[3]=[]),i),u[1]|=e,Mt.apply(null,u)):(1==e||17===e?xt:Nt)([t,e,n,i,r,o])}function qt(t){return Wt[t]}function Dt(){var t=(t=Et.indexOf)===Le?K:t;return t}function Ut(t){return"function"==typeof t&&tt.test(t)}At.funcDecomp=!Ut(e.WinRTError)&&g.test(t),At.funcNames="string"==typeof S.name,Et.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:f,variable:"",imports:{_:Et}},dt||(Tt=function(){function t(){}return function(n){if(oe(n)){t.prototype=n;var i=new t;t.prototype=null}return i||e.Object()}}());var Bt=ht?function(t,e){L.value=e,ht(t,"__bindData__",L)}:qe;function Ft(t){var e,n;return!(!t||X.call(t)!=A||re(e=t.constructor)&&!(e instanceof e))&&(Xt(t,(function(t,e){n=e})),void 0===n||st.call(t,n))}function Ht(t){return Yt[t]}function zt(t){return t&&"object"==typeof t&&"number"==typeof t.length&&X.call(t)==b||!1}var Vt=ft||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&X.call(t)==w||!1},Gt=gt?function(t){return oe(t)?gt(t):[]}:function(t){var e,n=t,i=[];if(!n)return i;if(!N[typeof t])return i;for(e in n)st.call(n,e)&&i.push(e);return i},Wt={"&":"&","<":"<",">":">",'"':""","'":"'"},Yt=ie(Wt),Qt=j("("+Gt(Yt).join("|")+")","g"),$t=j("["+Gt(Wt).join("")+"]","g"),Jt=function(t,e,n){var i,r=t,o=r;if(!r)return o;var s=arguments,a=0,c="number"==typeof n?2:s.length;if(c>3&&"function"==typeof s[c-2])var l=Lt(s[--c-1],s[c--],2);else c>2&&"function"==typeof s[c-1]&&(l=s[--c]);for(;++a<c;)if((r=s[a])&&N[typeof r])for(var u=-1,h=N[typeof r]&&Gt(r),d=h?h.length:0;++u<d;)o[i=h[u]]=l?l(o[i],r[i]):r[i];return o},Zt=function(t,e,n){var i,r=t,o=r;if(!r)return o;for(var s=arguments,a=0,c="number"==typeof n?2:s.length;++a<c;)if((r=s[a])&&N[typeof r])for(var l=-1,u=N[typeof r]&&Gt(r),h=u?u.length:0;++l<h;)void 0===o[i=u[l]]&&(o[i]=r[i]);return o},Xt=function(t,e,n){var i,r=t,o=r;if(!r)return o;if(!N[typeof r])return o;for(i in e=e&&void 0===n?e:Lt(e,n,3),r)if(!1===e(r[i],i,t))return o;return o},te=function(t,e,n){var i,r=t,o=r;if(!r)return o;if(!N[typeof r])return o;e=e&&void 0===n?e:Lt(e,n,3);for(var s=-1,a=N[typeof r]&&Gt(r),c=a?a.length:0;++s<c;)if(!1===e(r[i=a[s]],i,t))return o;return o};function ee(t,e,n){var i=Gt(t),r=i.length;for(e=Lt(e,n,3);r--;){var o=i[r];if(!1===e(t[o],o,t))break}return t}function ne(t){var e=[];return Xt(t,(function(t,n){re(t)&&e.push(n)})),e.sort()}function ie(t){for(var e=-1,n=Gt(t),i=n.length,r={};++e<i;){var o=n[e];r[t[o]]=o}return r}function re(t){return"function"==typeof t}function oe(t){return!(!t||!N[typeof t])}function se(t){return"number"==typeof t||t&&"object"==typeof t&&"[object Number]"==X.call(t)||!1}var ae=ot?function(t){if(!t||X.call(t)!=A)return!1;var e=t.valueOf,n=Ut(e)&&(n=ot(e))&&ot(n);return n?t==n||ot(t)==n:Ft(t)}:Ft;function ce(t){return"string"==typeof t||t&&"object"==typeof t&&X.call(t)==x||!1}function le(t){for(var e=-1,i=Gt(t),r=i.length,o=n(r);++e<r;)o[e]=t[i[e]];return o}function ue(t,e,n){var i=-1,r=Dt(),o=t?t.length:0,s=!1;return n=(n<0?_t(0,o+n):n)||0,Vt(t)?s=r(t,e,n)>-1:"number"==typeof o?s=(ce(t)?t.indexOf(e,n):r(t,e,n))>-1:te(t,(function(t){if(++i>=n)return!(s=t===e)})),s}var he=Kt((function(t,e,n){st.call(t,n)?t[n]++:t[n]=1}));function de(t,e,n){var i=!0;e=Et.createCallback(e,n,3);var r=-1,o=t?t.length:0;if("number"==typeof o)for(;++r<o&&(i=!!e(t[r],r,t)););else te(t,(function(t,n,r){return i=!!e(t,n,r)}));return i}function fe(t,e,n){var i=[];e=Et.createCallback(e,n,3);var r=-1,o=t?t.length:0;if("number"==typeof o)for(;++r<o;){var s=t[r];e(s,r,t)&&i.push(s)}else te(t,(function(t,n,r){e(t,n,r)&&i.push(t)}));return i}function pe(t,e,n){e=Et.createCallback(e,n,3);var i,r=-1,o=t?t.length:0;if("number"!=typeof o)return te(t,(function(t,n,r){if(e(t,n,r))return i=t,!1})),i;for(;++r<o;){var s=t[r];if(e(s,r,t))return s}}function me(t,e,n){var i=-1,r=t?t.length:0;if(e=e&&void 0===n?e:Lt(e,n,3),"number"==typeof r)for(;++i<r&&!1!==e(t[i],i,t););else te(t,e);return t}function ge(t,e,n){var i=t?t.length:0;if(e=e&&void 0===n?e:Lt(e,n,3),"number"==typeof i)for(;i--&&!1!==e(t[i],i,t););else{var r=Gt(t);i=r.length,te(t,(function(t,n,o){return n=r?r[--i]:--i,e(o[n],n,o)}))}return t}var _e=Kt((function(t,e,n){(st.call(t,n)?t[n]:t[n]=[]).push(e)})),ve=Kt((function(t,e,n){t[n]=e}));function ye(t,e,i){var r=-1,o=t?t.length:0;if(e=Et.createCallback(e,i,3),"number"==typeof o)for(var s=n(o);++r<o;)s[r]=e(t[r],r,t);else s=[],te(t,(function(t,n,i){s[++r]=e(t,n,i)}));return s}function be(t,e,n){var i=-1/0,r=i;if("function"!=typeof e&&n&&n[e]===t&&(e=null),null==e&&Vt(t))for(var o=-1,s=t.length;++o<s;){var a=t[o];a>r&&(r=a)}else e=null==e&&ce(t)?D:Et.createCallback(e,n,3),me(t,(function(t,n,o){var s=e(t,n,o);s>i&&(i=s,r=t)}));return r}var we=ye;function Ee(t,e,n,i){if(!t)return n;var r=arguments.length<3;e=Et.createCallback(e,i,4);var o=-1,s=t.length;if("number"==typeof s)for(r&&(n=t[++o]);++o<s;)n=e(n,t[o],o,t);else te(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}));return n}function ke(t,e,n,i){var r=arguments.length<3;return e=Et.createCallback(e,i,4),ge(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Ae(t){var e=-1,i=t?t.length:0,r=n("number"==typeof i?i:0);return me(t,(function(t){var n=It(0,++e);r[e]=r[n],r[n]=t})),r}function xe(t,e,n){var i;e=Et.createCallback(e,n,3);var r=-1,o=t?t.length:0;if("number"==typeof o)for(;++r<o&&!(i=e(t[r],r,t)););else te(t,(function(t,n,r){return!(i=e(t,n,r))}));return!!i}var Ce=fe;function Te(t,e,n){var i=0,r=t?t.length:0;if("number"!=typeof e&&null!=e){var o=-1;for(e=Et.createCallback(e,n,3);++o<r&&e(t[o],o,t);)i++}else if(null==(i=e)||n)return t?t[0]:void 0;return W(t,0,vt(_t(0,i),r))}function Le(t,e,n){if("number"==typeof n){var i=t?t.length:0;n=n<0?_t(0,i+n):n||0}else if(n){var r=Se(t,e);return t[r]===e?r:-1}return K(t,e,n)}function Ne(t,e,n){if("number"!=typeof e&&null!=e){var i=0,r=-1,o=t?t.length:0;for(e=Et.createCallback(e,n,3);++r<o&&e(t[r],r,t);)i++}else i=null==e||n?1:_t(0,e);return W(t,i)}function Se(t,e,n,i){var r=0,o=t?t.length:r;for(e=(n=n?Et.createCallback(n,i,1):Ke)(e);r<o;){var s=r+o>>>1;n(t[s])<e?r=s+1:o=s}return r}function Pe(t,e,n,i){return"boolean"!=typeof e&&null!=e&&(i=n,n="function"!=typeof e&&i&&i[e]===t?null:e,e=!1),null!=n&&(n=Et.createCallback(n,i,3)),jt(t,e,n)}function Oe(){for(var t=arguments.length>1?arguments:arguments[0],e=-1,i=t?be(we(t,"length")):0,r=n(i<0?0:i);++e<i;)r[e]=we(t,e);return r}function Re(t,e){var n=-1,i=t?t.length:0,r={};for(e||!i||Vt(t[0])||(e=[]);++n<i;){var o=t[n];e?r[o]=e[n]:o&&(r[o[0]]=o[1])}return r}function Ie(t,e){return arguments.length>2?Mt(t,17,W(arguments,2),null,e):Mt(t,1,null,null,e)}function je(t,e,n){var i,r,o,s,a,c,l,u=0,h=!1,d=!0;if(!re(t))throw new Q;if(e=_t(0,e)||0,!0===n){var f=!0;d=!1}else oe(n)&&(f=n.leading,h="maxWait"in n&&(_t(e,n.maxWait)||0),d="trailing"in n?n.trailing:d);var p=function(){var n=e-(Ue()-s);if(n<=0){r&&nt(r);var h=l;r=c=l=void 0,h&&(u=Ue(),o=t.apply(a,i),c||r||(i=a=null))}else c=ct(p,n)},m=function(){c&&nt(c),r=c=l=void 0,(d||h!==e)&&(u=Ue(),o=t.apply(a,i),c||r||(i=a=null))};return function(){if(i=arguments,s=Ue(),a=this,l=d&&(c||!f),!1===h)var n=f&&!c;else{r||f||(u=s);var g=h-(s-u),_=g<=0;_?(r&&(r=nt(r)),u=s,o=t.apply(a,i)):r||(r=ct(m,g))}return _&&c?c=nt(c):c||e===h||(c=ct(p,e)),n&&(_=!0,o=t.apply(a,i)),!_||c||r||(i=a=null),o}}function Ke(t){return t}function Me(t,e,n){var i=!0,r=e&&ne(e);e&&(n||r.length)||(null==n&&(n=e),o=kt,e=t,t=Et,r=ne(e)),!1===n?i=!1:oe(n)&&"chain"in n&&(i=n.chain);var o=t,s=re(o);me(r,(function(n){var r=t[n]=e[n];s&&(o.prototype[n]=function(){var e=this.__chain__,n=this.__wrapped__,s=[n];at.apply(s,arguments);var a=r.apply(t,s);if(i||e){if(n===a&&oe(a))return this;(a=new o(a)).__chain__=e}return a})}))}function qe(){}var De,Ue=Ut(Ue=r.now)&&Ue||function(){return(new r).getTime()},Be=8==yt(" \t\v\f \ufeff\n\r\u2028\u2029 08")?yt:function(t,e){return yt(ce(t)?t.replace(p,""):t,e||0)};function Fe(t){return function(e){return e[t]}}function He(){return this.__wrapped__}return Et.after=function(t,e){if(!re(e))throw new Q;return function(){if(--t<1)return e.apply(this,arguments)}},Et.assign=Jt,Et.at=function(t){for(var e=arguments,i=-1,r=Pt(e,!0,!1,1),o=e[2]&&e[2][e[1]]===t?1:r.length,s=n(o);++i<o;)s[i]=t[r[i]];return s},Et.bind=Ie,Et.bindAll=function(t){for(var e=arguments.length>1?Pt(arguments,!0,!1,1):ne(t),n=-1,i=e.length;++n<i;){var r=e[n];t[r]=Mt(t[r],1,null,null,t)}return t},Et.bindKey=function(t,e){return arguments.length>2?Mt(e,19,W(arguments,2),null,t):Mt(e,3,null,null,t)},Et.chain=function(t){return(t=new kt(t)).__chain__=!0,t},Et.compact=function(t){for(var e=-1,n=t?t.length:0,i=[];++e<n;){var r=t[e];r&&i.push(r)}return i},Et.compose=function(){for(var t=arguments,e=t.length;e--;)if(!re(t[e]))throw new Q;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}},Et.constant=function(t){return function(){return t}},Et.countBy=he,Et.create=function(t,e){var n=Tt(t);return e?Jt(n,e):n},Et.createCallback=function(t,e,n){var i=typeof t;if(null==t||"function"==i)return Lt(t,e,n);if("object"!=i)return Fe(t);var r=Gt(t),o=r[0],s=t[o];return 1!=r.length||s!=s||oe(s)?function(e){for(var n=r.length,i=!1;n--&&(i=Ot(e[r[n]],t[r[n]],null,!0)););return i}:function(t){var e=t[o];return s===e&&(0!==s||1/s==1/e)}},Et.curry=function(t,e){return Mt(t,4,null,null,null,e="number"==typeof e?e:+e||t.length)},Et.debounce=je,Et.defaults=Zt,Et.defer=function(t){if(!re(t))throw new Q;var e=W(arguments,1);return ct((function(){t.apply(void 0,e)}),1)},Et.delay=function(t,e){if(!re(t))throw new Q;var n=W(arguments,2);return ct((function(){t.apply(void 0,n)}),e)},Et.difference=function(t){return St(t,Pt(arguments,!0,!0,1))},Et.filter=fe,Et.flatten=function(t,e,n,i){return"boolean"!=typeof e&&null!=e&&(i=n,n="function"!=typeof e&&i&&i[e]===t?null:e,e=!1),null!=n&&(t=ye(t,n,i)),Pt(t,e)},Et.forEach=me,Et.forEachRight=ge,Et.forIn=Xt,Et.forInRight=function(t,e,n){var i=[];Xt(t,(function(t,e){i.push(e,t)}));var r=i.length;for(e=Lt(e,n,3);r--&&!1!==e(i[r--],i[r],t););return t},Et.forOwn=te,Et.forOwnRight=ee,Et.functions=ne,Et.groupBy=_e,Et.indexBy=ve,Et.initial=function(t,e,n){var i=0,r=t?t.length:0;if("number"!=typeof e&&null!=e){var o=r;for(e=Et.createCallback(e,n,3);o--&&e(t[o],o,t);)i++}else i=null==e||n?1:e||i;return W(t,0,vt(_t(0,r-i),r))},Et.intersection=function(){for(var t=[],e=-1,n=arguments.length,i=H(),r=Dt(),o=r===K,s=H();++e<n;){var a=arguments[e];(Vt(a)||zt(a))&&(t.push(a),i.push(o&&a.length>=75&&B(e?t[e]:s)))}var c=t[0],l=-1,u=c?c.length:0,h=[];t:for(;++l<u;){var d=i[0];if(a=c[l],(d?M(d,a):r(s,a))<0){for(e=n,(d||s).push(a);--e;)if(((d=i[e])?M(d,a):r(t[e],a))<0)continue t;h.push(a)}}for(;n--;)(d=i[n])&&G(d);return V(i),V(s),h},Et.invert=ie,Et.invoke=function(t,e){var i=W(arguments,2),r=-1,o="function"==typeof e,s=t?t.length:0,a=n("number"==typeof s?s:0);return me(t,(function(t){a[++r]=(o?e:t[e]).apply(t,i)})),a},Et.keys=Gt,Et.map=ye,Et.mapValues=function(t,e,n){var i={};return e=Et.createCallback(e,n,3),te(t,(function(t,n,r){i[n]=e(t,n,r)})),i},Et.max=be,Et.memoize=function(t,e){if(!re(t))throw new Q;var n=function(){var i=n.cache,r=e?e.apply(this,arguments):s+arguments[0];return st.call(i,r)?i[r]:i[r]=t.apply(this,arguments)};return n.cache={},n},Et.merge=function(t){var e=arguments,n=2;if(!oe(t))return t;if("number"!=typeof e[2]&&(n=e.length),n>3&&"function"==typeof e[n-2])var i=Lt(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(i=e[--n]);for(var r=W(arguments,1,n),o=-1,s=H(),a=H();++o<n;)Rt(t,r[o],i,s,a);return V(s),V(a),t},Et.min=function(t,e,n){var i=1/0,r=i;if("function"!=typeof e&&n&&n[e]===t&&(e=null),null==e&&Vt(t))for(var o=-1,s=t.length;++o<s;){var a=t[o];a<r&&(r=a)}else e=null==e&&ce(t)?D:Et.createCallback(e,n,3),me(t,(function(t,n,o){var s=e(t,n,o);s<i&&(i=s,r=t)}));return r},Et.omit=function(t,e,n){var i={};if("function"!=typeof e){var r=[];Xt(t,(function(t,e){r.push(e)}));for(var o=-1,s=(r=St(r,Pt(arguments,!0,!1,1))).length;++o<s;){var a=r[o];i[a]=t[a]}}else e=Et.createCallback(e,n,3),Xt(t,(function(t,n,r){e(t,n,r)||(i[n]=t)}));return i},Et.once=function(t){var e,n;if(!re(t))throw new Q;return function(){return e||(e=!0,n=t.apply(this,arguments),t=null),n}},Et.pairs=function(t){for(var e=-1,i=Gt(t),r=i.length,o=n(r);++e<r;){var s=i[e];o[e]=[s,t[s]]}return o},Et.partial=function(t){return Mt(t,16,W(arguments,1))},Et.partialRight=function(t){return Mt(t,32,null,W(arguments,1))},Et.pick=function(t,e,n){var i={};if("function"!=typeof e)for(var r=-1,o=Pt(arguments,!0,!1,1),s=oe(t)?o.length:0;++r<s;){var a=o[r];a in t&&(i[a]=t[a])}else e=Et.createCallback(e,n,3),Xt(t,(function(t,n,r){e(t,n,r)&&(i[n]=t)}));return i},Et.pluck=we,Et.property=Fe,Et.pull=function(t){for(var e=arguments,n=0,i=e.length,r=t?t.length:0;++n<i;)for(var o=-1,s=e[n];++o<r;)t[o]===s&&(lt.call(t,o--,1),r--);return t},Et.range=function(t,e,i){t=+t||0,null==e&&(e=t,t=0);for(var r=-1,o=_t(0,et((e-t)/((i="number"==typeof i?i:+i||1)||1))),s=n(o);++r<o;)s[r]=t,t+=i;return s},Et.reject=function(t,e,n){return e=Et.createCallback(e,n,3),fe(t,(function(t,n,i){return!e(t,n,i)}))},Et.remove=function(t,e,n){var i=-1,r=t?t.length:0,o=[];for(e=Et.createCallback(e,n,3);++i<r;){var s=t[i];e(s,i,t)&&(o.push(s),lt.call(t,i--,1),r--)}return o},Et.rest=Ne,Et.shuffle=Ae,Et.sortBy=function(t,e,i){var r=-1,o=Vt(e),s=t?t.length:0,a=n("number"==typeof s?s:0);for(o||(e=Et.createCallback(e,i,3)),me(t,(function(t,n,i){var s=a[++r]=z();o?s.criteria=ye(e,(function(e){return t[e]})):(s.criteria=H())[0]=e(t,n,i),s.index=r,s.value=t})),s=a.length,a.sort(U);s--;){var c=a[s];a[s]=c.value,o||V(c.criteria),G(c)}return a},Et.tap=function(t,e){return e(t),t},Et.throttle=function(t,e,n){var i=!0,r=!0;if(!re(t))throw new Q;return!1===n?i=!1:oe(n)&&(i="leading"in n?n.leading:i,r="trailing"in n?n.trailing:r),T.leading=i,T.maxWait=e,T.trailing=r,je(t,e,T)},Et.times=function(t,e,i){t=(t=+t)>-1?t:0;var r=-1,o=n(t);for(e=Lt(e,i,1);++r<t;)o[r]=e(r);return o},Et.toArray=function(t){return t&&"number"==typeof t.length?W(t):le(t)},Et.transform=function(t,e,n,i){var r=Vt(t);if(null==n)if(r)n=[];else{var o=t&&t.constructor,s=o&&o.prototype;n=Tt(s)}return e&&(e=Et.createCallback(e,i,4),(r?me:te)(t,(function(t,i,r){return e(n,t,i,r)}))),n},Et.union=function(){return jt(Pt(arguments,!0,!0))},Et.uniq=Pe,Et.values=le,Et.where=Ce,Et.without=function(t){return St(t,W(arguments,1))},Et.wrap=function(t,e){return Mt(e,16,[t])},Et.xor=function(){for(var t=-1,e=arguments.length;++t<e;){var n=arguments[t];if(Vt(n)||zt(n))var i=i?jt(St(i,n).concat(St(n,i))):n}return i||[]},Et.zip=Oe,Et.zipObject=Re,Et.collect=ye,Et.drop=Ne,Et.each=me,Et.eachRight=ge,Et.extend=Jt,Et.methods=ne,Et.object=Re,Et.select=fe,Et.tail=Ne,Et.unique=Pe,Et.unzip=Oe,Me(Et),Et.clone=function(t,e,n,i){return"boolean"!=typeof e&&null!=e&&(i=n,n=e,e=!1),Ct(t,e,"function"==typeof n&&Lt(n,i,1))},Et.cloneDeep=function(t,e,n){return Ct(t,!0,"function"==typeof e&&Lt(e,n,1))},Et.contains=ue,Et.escape=function(t){return null==t?"":q(t).replace($t,qt)},Et.every=de,Et.find=pe,Et.findIndex=function(t,e,n){var i=-1,r=t?t.length:0;for(e=Et.createCallback(e,n,3);++i<r;)if(e(t[i],i,t))return i;return-1},Et.findKey=function(t,e,n){var i;return e=Et.createCallback(e,n,3),te(t,(function(t,n,r){if(e(t,n,r))return i=n,!1})),i},Et.findLast=function(t,e,n){var i;return e=Et.createCallback(e,n,3),ge(t,(function(t,n,r){if(e(t,n,r))return i=t,!1})),i},Et.findLastIndex=function(t,e,n){var i=t?t.length:0;for(e=Et.createCallback(e,n,3);i--;)if(e(t[i],i,t))return i;return-1},Et.findLastKey=function(t,e,n){var i;return e=Et.createCallback(e,n,3),ee(t,(function(t,n,r){if(e(t,n,r))return i=n,!1})),i},Et.has=function(t,e){return!!t&&st.call(t,e)},Et.identity=Ke,Et.indexOf=Le,Et.isArguments=zt,Et.isArray=Vt,Et.isBoolean=function(t){return!0===t||!1===t||t&&"object"==typeof t&&X.call(t)==E||!1},Et.isDate=function(t){return t&&"object"==typeof t&&X.call(t)==k||!1},Et.isElement=function(t){return t&&1===t.nodeType||!1},Et.isEmpty=function(t){var e=!0;if(!t)return e;var n=X.call(t),i=t.length;return n==w||n==x||n==b||n==A&&"number"==typeof i&&re(t.splice)?!i:(te(t,(function(){return e=!1})),e)},Et.isEqual=function(t,e,n,i){return Ot(t,e,"function"==typeof n&&Lt(n,i,2))},Et.isFinite=function(t){return pt(t)&&!mt(parseFloat(t))},Et.isFunction=re,Et.isNaN=function(t){return se(t)&&t!=+t},Et.isNull=function(t){return null===t},Et.isNumber=se,Et.isObject=oe,Et.isPlainObject=ae,Et.isRegExp=function(t){return t&&"object"==typeof t&&"[object RegExp]"==X.call(t)||!1},Et.isString=ce,Et.isUndefined=function(t){return void 0===t},Et.lastIndexOf=function(t,e,n){var i=t?t.length:0;for("number"==typeof n&&(i=(n<0?_t(0,i+n):vt(n,i-1))+1);i--;)if(t[i]===e)return i;return-1},Et.mixin=Me,Et.noConflict=function(){return e._=Z,this},Et.noop=qe,Et.now=Ue,Et.parseInt=Be,Et.random=function(t,e,n){var i=null==t,r=null==e;if(null==n&&("boolean"==typeof t&&r?(n=t,t=1):r||"boolean"!=typeof e||(n=e,r=!0)),i&&r&&(e=1),t=+t||0,r?(e=t,t=0):e=+e||0,n||t%1||e%1){var o=bt();return vt(t+o*(e-t+parseFloat("1e-"+((o+"").length-1))),e)}return It(t,e)},Et.reduce=Ee,Et.reduceRight=ke,Et.result=function(t,e){if(t){var n=t[e];return re(n)?t[e]():n}},Et.runInContext=t,Et.size=function(t){var e=t?t.length:0;return"number"==typeof e?e:Gt(t).length},Et.some=xe,Et.sortedIndex=Se,Et.template=function(t,e,n){var i=Et.templateSettings;t=q(t||""),n=Zt({},n,i);var r,o=Zt({},n.imports,i.imports),s=Gt(o),h=le(o),d=0,p=n.interpolate||m,g="__p += '",v=j((n.escape||m).source+"|"+p.source+"|"+(p===f?u:m).source+"|"+(n.evaluate||m).source+"|$","g");t.replace(v,(function(e,n,i,o,s,a){return i||(i=o),g+=t.slice(d,a).replace(_,F),n&&(g+="' +\n__e("+n+") +\n'"),s&&(r=!0,g+="';\n"+s+";\n__p += '"),i&&(g+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),d=a+e.length,e})),g+="';\n";var b=n.variable,w=b;w||(g="with ("+(b="obj")+") {\n"+g+"\n}\n"),g=(r?g.replace(a,""):g).replace(c,"$1").replace(l,"$1;"),g="function("+b+") {\n"+(w?"":b+" || ("+b+" = {});\n")+"var __t, __p = '', __e = _.escape"+(r?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+g+"return __p\n}";var E="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+y+++"]")+"\n*/";try{var k=S(s,"return "+g+E).apply(void 0,h)}catch(t){throw t.source=g,t}return e?k(e):(k.source=g,k)},Et.unescape=function(t){return null==t?"":q(t).replace(Qt,Ht)},Et.uniqueId=function(t){var e=++o;return q(null==t?"":t)+e},Et.all=de,Et.any=xe,Et.detect=pe,Et.findWhere=pe,Et.foldl=Ee,Et.foldr=ke,Et.include=ue,Et.inject=Ee,Me((De={},te(Et,(function(t,e){Et.prototype[e]||(De[e]=t)})),De),!1),Et.first=Te,Et.last=function(t,e,n){var i=0,r=t?t.length:0;if("number"!=typeof e&&null!=e){var o=r;for(e=Et.createCallback(e,n,3);o--&&e(t[o],o,t);)i++}else if(null==(i=e)||n)return t?t[r-1]:void 0;return W(t,_t(0,r-i))},Et.sample=function(t,e,n){if(t&&"number"!=typeof t.length&&(t=le(t)),null==e||n)return t?t[It(0,t.length-1)]:void 0;var i=Ae(t);return i.length=vt(_t(0,e),i.length),i},Et.take=Te,Et.head=Te,te(Et,(function(t,e){var n="sample"!==e;Et.prototype[e]||(Et.prototype[e]=function(e,i){var r=this.__chain__,o=t(this.__wrapped__,e,i);return r||null!=e&&(!i||n&&"function"==typeof e)?new kt(o,r):o})})),Et.VERSION="2.4.1",Et.prototype.chain=function(){return this.__chain__=!0,this},Et.prototype.toString=function(){return q(this.__wrapped__)},Et.prototype.value=He,Et.prototype.valueOf=He,me(["join","pop","shift"],(function(t){var e=$[t];Et.prototype[t]=function(){var t=this.__chain__,n=e.apply(this.__wrapped__,arguments);return t?new kt(n,t):n}})),me(["push","reverse","sort","unshift"],(function(t){var e=$[t];Et.prototype[t]=function(){return e.apply(this.__wrapped__,arguments),this}})),me(["concat","slice","splice"],(function(t){var e=$[t];Et.prototype[t]=function(){return new kt(e.apply(this.__wrapped__,arguments),this.__chain__)}})),Et}();O&&R?I?(R.exports=Y)._=Y:O._=Y:P._=Y}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)})),n("match/treehierarchy",["lib/dagre"],(function(t){const e=document,n=new RegExp("^(?:([^/]+?)/)?([^:]+?):(.+?)$");return{create:function(t){return Object.create(this)._init(t)},_init:function(n){this._next=new Number(0);let i=e.createElement("div");i.innerHTML=n;const r=new t.graphlib.Graph({directed:!0});return r.setGraph({nodesep:35,ranksep:15,marginx:40,marginy:10}),r.setDefaultEdgeLabel({}),this._graph=r,this._addNode(this._next++,{class:"root"}),this._parse(0,i.childNodes,void 0),1===r.outEdges(0).length&&r.removeNode(0),i=void 0,this},_c:function(t){return e.createElementNS("http://www.w3.org/2000/svg",t)},nodes:function(){return this._next},_addNode:function(t,e){return e.width=55,e.height=20,this._graph.setNode(t,e),e},_addEdge:function(t,e){this._graph.setEdge(t,e)},_clean:function(t){return t.replace(n,"$3")},_parse:function(t,e,n){return e.forEach((function(e){if(1==e.nodeType)if(e.getAttribute("title")){const i=this._next++,r=this._addNode(i,{class:"middle",label:this._clean(e.getAttribute("title"))});void 0!==n&&(r.class+=" mark"),this._addEdge(t,i),e.hasChildNodes()&&this._parse(i,e.childNodes,n)}else e.hasChildNodes()&&this._parse(t,e.childNodes,"MARK"===e.tagName||n);else if(3==e.nodeType&&e.nodeValue.match(/[-a-z0-9]/i)){const n=this._next++;this._addNode(n,{class:"leaf",label:e.nodeValue}),this._addEdge(t,n)}}),this),this},show:function(){},center:function(){if(void 0===this._el)return;const t=this._el.parentNode,e=parseFloat(window.getComputedStyle(this._el).width),n=parseFloat(window.getComputedStyle(t).width);e>n&&(t.scrollLeft=(e-n)/2)},toBase64:function(){const t=e.createElement("div");t.innerHTML=this.element().outerHTML;const n=t.firstChild,i=this._c("style");return n.getElementsByTagName("defs")[0].appendChild(i),i.innerHTML="path.edge { stroke: black; stroke-width: 2pt; fill: none; }g.root rect.empty,g.middle rect{ stroke: black; stroke-width: 2pt; fill: #bbb; }g.leaf > rect { display: none }g > text > tspan { text-anchor: middle; font-size: 9pt }g.leaf > text > tspan { font-size: 10pt; overflow: visible; }",btoa(unescape(encodeURIComponent(n.outerHTML)).replace(/ /g," "))},element:function(){if(void 0!==this._el)return this._el;const n=this._graph;t.layout(n);const i=this._c("svg");this._el=i,i.appendChild(this._c("defs"));const r=this;let o,s,a;n.edges().forEach((function(t){o=n.node(t.v),s=n.node(t.w),a=r._c("path"),a.setAttributeNS(null,"d",function(t,e){const n=t.x,i=t.y,r=e.x,o=e.y-e.height/2;return"M "+n+","+i+" C "+n+","+i+" "+r+","+(o-(o-i)/2)+" "+r+","+o}(o,s)),a.classList.add("edge"),i.appendChild(a)}));let c=n.graph().height;return n.nodes().forEach((function(t){t=n.node(t);const o=r._c("g");o.setAttribute("class",t.class);const s=o.appendChild(r._c("rect"));if(s.setAttribute("x",t.x-t.width/2),s.setAttribute("y",t.y-t.height/2),s.setAttribute("rx",5),s.setAttribute("ry",5),s.setAttribute("width",t.width),s.setAttribute("height",t.height),"root"===t.class&&void 0===t.label&&(s.setAttribute("width",t.height),s.setAttribute("x",t.x-t.height/2),s.setAttribute("class","empty")),void 0!==t.label){const n=o.appendChild(r._c("text"));let i=t.y-t.height/2;n.setAttribute("y",i),n.setAttribute("transform","translate("+t.width/2+","+(t.height/2+5)+")");const s=t.label.replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");if("leaf"===t.class){n.setAttribute("title",s);let o,a=0;s.split(" ").forEach((function(s){0!==s.length&&(o=r._c("tspan"),o.appendChild(e.createTextNode(s)),0!==a?o.setAttribute("dy","14pt"):a=1,o.setAttribute("x",t.x-t.width/2),i+=14,n.appendChild(o))})),i+=14,i>c&&(c=i)}else{const i=r._c("tspan");i.appendChild(e.createTextNode(s)),i.setAttribute("x",t.x-t.width/2),n.appendChild(i)}}i.appendChild(o)})),i.setAttribute("width",n.graph().width),i.setAttribute("height",c),this._el},downloadLink:function(){const t=e.createElement("a");return t.setAttribute("href-lang","image/svg+xml"),t.setAttribute("href","data:image/svg+xml;base64,"+this.toBase64()),t.setAttribute("download","tree.svg"),t.target="_blank",t.setAttribute("rel","noopener noreferrer"),t}}})),n("match/treearc",[],(function(){const t=new RegExp("^(?:([^/]+?)/)?([^:]+?):(.+?)$"),e=document;return{create:function(t){return Object.create(this)._init(t)},_init:function(t){const n=this;if(n._tokens=[],n._arcs=[],n._tokenElements=[],n._y=0,n._currentInFocus=void 0,n.maxArc=200,n.overlapDiff=40,n.arcDiff=15,n.anchorDiff=8,n.anchorStart=15,n.tokenSep=30,n.xPadding=10,n.yPadding=5,null==t||null==t)return n;const i=e.createElement("div");i.innerHTML=t,n.temp={target:{},edges:[],pos:0},n._parse(0,i.childNodes,void 0);const r=n.temp.target;let o,s,a;return n.temp.edges.forEach((function(t){o=t.targetID,s=r[o],null!=s&&(a={start:[t.srcStart,t.srcEnd],end:s,direction:"uni",label:t.label},this.addRel(a))}),n),delete n.temp,this},_parse:function(t,e,n){Array.from(e).forEach((function(t){if(1==t.nodeType){let i,r,o,s;if(t.hasAttribute("xml:id"))i=t.getAttribute("xml:id"),o=this.temp.pos,s=this.temp.pos;else if(t.hasAttribute("xlink:href"))if("other"==t.getAttribute("xlink:show")&&t.hasAttribute("data-action")&&"join"==t.getAttribute("data-action"))i=t.getAttribute("xlink:href").replace(/^#/,""),o=this.temp.pos,s=this.temp.pos;else{let n;r=t.getAttribute("xlink:href").replace(/^#/,""),t.hasAttribute("xlink:title")&&(n=this._clean(t.getAttribute("xlink:title")));var e={label:n,srcStart:this.temp.pos,targetID:r};n.match(/--$/)||n.match(/ROOT$/)||this.temp.edges.push(e)}if(t.hasChildNodes()&&this._parse(0,t.childNodes,n),void 0!==i){if(void 0!==this.temp.target[i]){const t=this.temp.target[i];s=this.temp.pos-1,t[0]=o<t[0]?o:t[0],t[1]=s>t[1]?s:t[1]}else s=this.temp.pos-1,this.temp.target[i]=[o,s];i=void 0}else void 0!==r&&(e.srcEnd=this.temp.pos-1,r=void 0)}else if(3==t.nodeType&&void 0!==t.nodeValue){const e=t.nodeValue.trim();void 0!==e&&e.length>0&&(this.addToken(e),this.temp.pos++)}}),this)},_clean:function(e){return e.replace(t,"$3")},size:function(){return this._tokens.length},_c:function(t){return e.createElementNS("http://www.w3.org/2000/svg",t)},_rect:function(t){if("tspan"==t.tagName&&!navigator.userAgent.match(/Edge/)){const n=e.createRange();n.selectNode(t);const i=n.getBoundingClientRect();return n.detach(),i}return t.getBoundingClientRect()},_tokenPoint:function(t){const e=this._rect(t);return e.left+e.width/2},_drawAnchor:function(t){const e=this._rect(this._tokenElements[t.first]),n=this._rect(this._tokenElements[t.last]),i=this._y+t.overlaps*this.anchorDiff-this.anchorStart,r=this._c("path");this._arcsElement.appendChild(r);const o="M "+(e.left-this.offsetLeft)+","+i+" L "+(n.right-this.offsetLeft)+","+i;return r.setAttribute("d",o),r.setAttribute("class","anchor"),t.element=r,t.y=i,r},_drawArc:function(t){const n=this;let i,r,o=this._y,s=this._y;void 0!==t.startAnchor?(i=n._tokenPoint(t.startAnchor.element),o=t.startAnchor.y):i=n._tokenPoint(n._tokenElements[t.first]),void 0!==t.endAnchor?(r=n._tokenPoint(t.endAnchor.element),s=t.endAnchor.y):r=n._tokenPoint(n._tokenElements[t.last]),i-=n.offsetLeft,r-=n.offsetLeft;var a=t.overlaps;i==r&&(i-=n.overlapDiff/3,r+=n.overlapDiff/3,a+=.5);const c=n._c("g");c.setAttribute("class","arc");const l=c.appendChild(n._c("path"));l.setAttribute("class","edge"),n._arcsElement.appendChild(c);let u=Math.abs(r-i)/2,h=n.arcDiff+a*n.overlapDiff+u/2;h=h<n.maxArc?h:n.maxArc;var d=Math.min(i,r);let f=s-h;const p="M "+i+","+o+" C "+i+","+f+" "+r+","+f+" "+r+","+s;if(l.setAttribute("d",p),void 0!==t.direction&&(l.setAttribute("marker-end","url(#arr)"),"bi"===t.direction&&l.setAttribute("marker-start","url(#arr)")),void 0===t.label)return c;let m=((o+f)/2+f)/2;const g=this._c("g");g.setAttribute("class","label"),n._labelsElement.appendChild(g),g.arcRef=c;const _=n;g.addEventListener("mouseenter",(function(){_.inFocus(this)}));const v=g.appendChild(n._c("text"));v.setAttribute("x",d+u),v.setAttribute("y",m+3),v.setAttribute("text-anchor","middle");const y=e.createTextNode(t.label);v.appendChild(y);const b=v.getBBox(),w=b.width,E=b.height,k=g.insertBefore(n._c("rect"),v),A=w+2*n.xPadding;k.setAttribute("x",d+u-A/2),k.setAttribute("ry",5),k.setAttribute("y",b.y-n.yPadding),k.setAttribute("width",A),k.setAttribute("height",E+2*n.yPadding)},element:function(){if(void 0!==this._el)return this._el;const t=this._c("svg");window.addEventListener("resize",function(){this.show()}.bind(this));const e=t.appendChild(this._c("defs")).appendChild(this._c("marker"));e.setAttribute("refX",9),e.setAttribute("id","arr"),e.setAttribute("orient","auto-start-reverse"),e.setAttribute("markerUnits","userSpaceOnUse");const n=this._c("path");return n.setAttribute("transform","scale(0.8)"),n.setAttribute("d","M 0,-5 0,5 10,0 Z"),e.appendChild(n),this._el=t,this._el},addRel:function(t){return this._arcs.push(t),this},addToken:function(t){return this._tokens.push(t),this},inFocus:function(t){let e;if(this._currentInFocus){if(this._currentInFocus===t)return;e=this._currentInFocus,e.classList.remove("infocus"),e.arcRef.classList.remove("infocus")}e=this._currentInFocus=t,this._labelsElement.appendChild(e),this._arcsElement.appendChild(e.arcRef),e.classList.add("infocus"),e.arcRef.classList.add("infocus")},_sortArcs:function(){let t={};const e=this._arcs.map((function(e){if(e.start instanceof Array)if(e.start[0]==e.start[1])e.start=e.start[0];else{const n=Math.ceil(Math.abs(e.start[1]-e.start[0])/2)+e.start[0];let i="#"+e.start[0]+"_"+e.start[1];e.start[0]>e.start[1]&&(i="#"+e.start[1]+"_"+e.start[0]);let r=t[i];void 0===r&&(r={first:e.start[0],last:e.start[1],length:e.start[1]-e.start[0]},t[i]=r),e.startAnchor=r,e.start=n}if(e.end instanceof Array)if(e.end[0]==e.end[1])e.end=e.end[0];else{const i=Math.abs(e.end[0]-e.end[1])+e.end[0];let r="#"+e.end[0]+"_"+e.end[1];e.end[0]>e.end[1]&&(r="#"+e.end[1]+"_"+e.end[0]);var n=t[r];void 0===n&&(n={first:e.end[0],last:e.end[1],length:e.end[1]-e.end[0]},t[r]=n),e.endAnchor=n,e.end=i}return e.first=e.start,e.last=e.end,e.start<e.end?e.length=e.end-e.start:e.length=e.start-e.end,e}));e.sort((function(t,e){return t.length<e.length?-1:1})),this._sortedArcs=n(e,!1),this._sortedAnchors=n(Object.values(t),!0)},center:function(){if(void 0===this._el)return;const t=this._el.parentNode,e=parseFloat(window.getComputedStyle(this._el).width),n=parseFloat(window.getComputedStyle(t).width);if(e>n){var i=(e-n)/2;t.scrollLeft=i}},show:function(){const t=this,n=this._el,i=this.maxArc;void 0!==n.getElementsByTagName("g")[0]&&(n.removeChild(n.getElementsByTagName("g")[0]),t._tokenElements=[]);const r=n.appendChild(t._c("g")),o=r.appendChild(t._c("text"));o.setAttribute("class","leaf"),o.setAttribute("text-anchor","start"),o.setAttribute("y",i),t._y=i-t.anchorStart;const s=o.appendChild(t._c("tspan"));s.appendChild(e.createTextNode(" ")),s.style.textAnchor="start",t._tokens.forEach((function(t){const n=o.appendChild(this._c("tspan"));n.appendChild(e.createTextNode(t)),n.setAttribute("text-anchor","middle"),this._tokenElements.push(n),n.setAttribute("dx",this.tokenSep)}),t),t.offsetLeft=t._rect(r).left;const a=r.appendChild(t._c("g"));t._arcsElement=a,a.classList.add("arcs");const c=r.appendChild(t._c("g"));t._labelsElement=c,c.classList.add("labels"),void 0===t._sortedArcs&&t._sortArcs(),t._sortedAnchors.forEach(e=>t._drawAnchor(e)),t._sortedArcs.forEach(e=>t._drawArc(e)),n.setAttribute("width",t._rect(o).width+20),n.setAttribute("height",i+20),n.setAttribute("class","relTree")}};function n(t,e){let n=[];return t.forEach((function(t){let i,r=0;for(let o=n.length-1;o>=0;o--){if(i=n[o],t.first<=i.first&&t.last>=i.last){r=i.overlaps+1;break}t.first<=i.first&&t.last>=i.first?(e||t.first!=i.first&&t.last!=i.first)&&(r=i.overlaps+(t.length==i.length?0:1)):t.first<=i.last&&t.last>=i.last&&(e||t.first!=i.last&&t.last!=i.last)&&(r=i.overlaps+(t.length==i.length?0:1))}t.overlaps=r,n.push(t),n.sort((function(t,e){e.overlaps,t.overlaps}))})),n}})),n("view/match/relations",["view","match/treehierarchy","match/treearc"],(function(t,e,n){const i=document,r=KorAP.Locale;return r.DOWNLOAD=r.DOWNLOAD||"Download",{create:function(e,n,i,r){return Object.create(t)._init(["relations"]).upgradeTo(this)._init(e,n,i,r)},_init:function(t,e,n,i){return this._match=t,this._foundry=e,this._layer=n,this._type=i,this},show:function(){if(this._show)return this._show;const t=i.createElement("div");t.classList.add("matchtree","loading");const e=t.addE("h6");return e.addE("span").addT(this._foundry),e.addE("span").addT(this._layer),this._tree=t.addE("div"),this._show=t},afterEmbed:function(){const t=this._foundry,e=this._layer,n=this._type,o=this,s=this._tree,a=this._show;this.getData(t,e,n,(function(t){a.classList.remove("loading"),null===t?s.addT("No data available."):(s.appendChild(t.element()),t.show(),"spans"===n&&o.actions.add(r.DOWNLOAD,{cls:["button-icon","download"]},(function(e){const n=t.downloadLink();i.body.appendChild(n),n.click(),i.body.removeChild(n)})),t.center())})),a.classList.remove("loading")},match:function(){return this._match},getData:function(t,i,r,o){try{KorAP.API.getMatchInfo(this._match,{spans:!0,foundry:t,layer:i},function(t){void 0!==t&&void 0!==t.snippet?o("spans"===r?e.create(t.snippet):"rels"===r?n.create(t.snippet):null):o(null)}.bind(this))}catch(t){KorAP.log(0,t),o(null)}},onClose:function(){this._match=void 0}}})),n("panel/match",["panel","match/treeitem","view/match/tokentable","view/match/meta","view/match/relations","buttongroup/menu"],(function(t,e,n,i,r,o){KorAP.API.getMatchInfo=KorAP.API.getMatchInfo||function(){return KorAP.log(0,"KorAP.API.getMatchInfo() not implemented"),{}};const s=KorAP.Locale;return s.SHOWANNO=s.SHOWANNO||"Tokens",s.SHOW_META=s.SHOW_META||"Metadata",s.ADDTREE=s.ADDTREE||"Relations",{create:function(e){return Object.create(t)._init(["matchinfo"]).upgradeTo(this)._init(e)},_init:function(t){this._match=t;const n=this.actions,i=n.element().classList;if(i.remove("matchinfo"),i.add("button-matchinfo"),n.add(s.SHOW_META,{cls:["metatable"]},(function(t){this.addMeta()})),n.add(s.SHOWANNO,{cls:["info"]},(function(t){this.addTable()})),n.add(s.ADDTREE,{cls:["tree"]},(function(t){void 0===KorAP.TreeMenu&&(KorAP.TreeMenu=o.create([],e),KorAP.TreeMenu.element().setAttribute("id","treeMenu"));const n=KorAP.TreeMenu;n.panel(this),n.readItems(this._treeMenuList()),n.show(),n.button(this.button),n.focus()})),KorAP.Plugin){const t=KorAP.Plugin.buttonGroup("match");t&&t.forEach(t=>n.add.apply(n,t))}return this},addMeta:function(){const t=this;t._metaView&&t._metaView.shown()||(t._metaView=i.create(t._match),t.add(t._metaView))},addTable:function(){const t=this;t._tableView&&t._tableView.shown()||(t._tableView=n.create(t._match),t.add(t._tableView))},addTree:function(t,e,n){this.add(r.create(this._match,t,e,n))},_treeMenuList:function(){if(this._menuList)return this._menuList;let t=[];const e=this._match;e.getSpans().forEach(e=>t.push(e)),e.getRels().forEach(e=>t.push(e)),t=t.sort((function(t,e){return t.foundry<e.foundry?-1:t.foundry>e.foundry?1:t.layer<e.layer?-1:t.layer>e.layer?1:0}));let n=[];return t.forEach(t=>n.push([t.foundry+"/"+t.layer,t.foundry,t.layer,t.type])),this._menuList=n,n}}})),n("match",["buttongroup","panel/match","util"],(function(t,n){const i=KorAP.Locale;i.MINIMIZE=i.MINIMIZE||"Minimize";const r=["textSigle","matchID","available"];document;return{create:function(t){return Object.create(this)._init(t)},_init:function(t){const n=this;if(n._el=null,n._initialized=!1,arguments.length<1||null==t)throw new Error("Missing parameters");let i;return t instanceof Node?(n._el=t,t._match=n,t.hasAttribute("data-text-sigle")?n.textSigle=t.getAttribute("data-text-sigle"):n.textSigle=t.getAttribute("data-corpus-id")+"/"+t.getAttribute("data-doc-id")+"/"+t.getAttribute("data-text-id"),n.matchID=t.getAttribute("data-match-id"),n.available=t.getAttribute("data-available-info").split(" ")):r.forEach((function(e){this[e]=void 0!==t[e]?t[e]:void 0}),n),n._avail={tokens:[],spans:[],rels:[]},n.available.forEach((function(t){try{i=e("match/infolayer").create(t),this._avail[i.type].push(i)}catch(t){return}}),n),n},getSpans:function(){return this._avail.spans},getTokens:function(){return this._avail.tokens},getRels:function(){return this._avail.rels},init:function(){const t=this;if(t._initialized)return t;const e=t._el;if(null==e)return;const i=e.querySelector("p.ref");return i?(t.panel=n.create(t),t._el.insertBefore(t.panel.element(),t._el.querySelector("p.ref")),i.insertBefore(t.panel.actions.element(),i.firstChild),t._initialized=!0,t):void 0},open:function(){const e=this._el;if(null==e)return!1;if(e.classList.contains("active"))return!1;e.classList.add("active");const n=t.create(["action","button-view"]),r=this;return n.add(i.MINIMIZE,{cls:["button-icon","minimize"]},(function(){r.minimize()})),e.appendChild(n.element()),null!=this.init()},toggle:function(){this._el.classList.contains("active")?this.minimize():this.open()},minimize:function(){this._el.classList.remove("active")},element:function(){return this._el}}})),n("hint/input",["util"],(function(){return{create:function(t){return Object.create(this)._init(t)},_init:function(t){this._el=t,this._container=document.createElement("div"),this._container.setAttribute("id","hint"),this._mirror=document.createElement("div");const e=this._mirror;e.classList.add("hint","mirror"),e.addE("span"),e.appendChild(this._container),e.style.height="0px",document.getElementsByTagName("body")[0].appendChild(e);const n=this.reposition.bind(this);return window.addEventListener("resize",n),this._el.addEventListener("onfocus",n),this.reposition(),this},mirror:function(){return this._mirror},container:function(){return this._container},element:function(){return this._el},value:function(){return this._el.value},mirrorValue:function(){return this._mirror.firstChild.textContent},reset:function(){this._el.value=""},update:function(){return this._mirror.firstChild.textContent=this._split()[0],this._container.style.left=this._rightPos()+"px",this},insert:function(t){const e=this._split(),n=this._el;return n.value=e[0]+t+e[1],n.selectionStart=(e[0]+t).length,n.selectionEnd=n.selectionStart,this._mirror.firstChild.textContent=e[0]+t,this},moveto:function(t){const e=this._el;return e.selectionStart=t,e.selectionEnd=t,e.focus(),this.update()},reposition:function(){const t=this._el.getBoundingClientRect(),e=window.getComputedStyle(this._el,null),n=document.getElementsByTagName("body")[0].getBoundingClientRect(),i=this._mirror.style;i.left=parseInt(t.left)+"px",i.top=parseInt(t.bottom-n.top)+"px",i.width=e.getPropertyValue("width"),i.paddingLeft=e.getPropertyValue("padding-left"),i.marginLeft=e.getPropertyValue("margin-left"),i.borderLeftWidth=e.getPropertyValue("border-left-width"),i.borderLeftStyle=e.getPropertyValue("border-left-style"),i.fontSize=e.getPropertyValue("font-size"),i.fontFamily=e.getPropertyValue("font-family")},context:function(){return this._split()[0]},_rightPos:function(){const t=this._mirror.firstChild.getBoundingClientRect();return t.right-t.left},_split:function(t){const e=this._el,n=e.value;return 0===arguments.length&&(t=e.selectionStart),new Array(n.substring(0,t),n.substring(t,n.length))}}})),n("hint/item",["menu/item","util"],(function(t){return{create:function(e){return Object.create(t).upgradeTo(this)._init(e)},_init:function(t){if(void 0===t[0]||void 0===t[1])throw new Error("Missing parameters");return this._name=t[0],this._action=t[1],this._lcField=" "+this._name.toLowerCase(),t.length>2&&(this._desc=t[2],this._lcField+=" "+this._desc.toLowerCase()),this},content:function(t){return 1===arguments.length&&(this._content=t),this._content},onclick:function(t){var e=this.menu();e.prefix("");var n=e.hint();n.inputField().insert(this._action).update(),t.halt(),n.show(!0)},name:function(){return this._name},action:function(){return this._action},desc:function(){return this._desc},element:function(){if(void 0!==this._el)return this._el;var t=document.createElement("li");void 0!==this.onclick&&(t.onclick=this.onclick.bind(this));var e=document.createElement("span");if(e.addT(this._name),t.appendChild(e),void 0!==this._desc){var n=document.createElement("span");n.classList.add("desc"),n.addT(this._desc),t.appendChild(n)}return this._el=t}}})),n("hint/prefix",["menu/prefix"],(function(t){return{create:function(e){return Object.create(t).upgradeTo(this)._init(e)},onclick:function(t){const e=this.menu(),n=this.value(),i=e.hint();i.inputField().insert(n),i.active(null),e.hide(),t.halt()}}})),n("hint/lengthField",["menu/lengthField","util"],(function(t){return{create:function(){return Object.create(t).upgradeTo(this)._init()},add:function(t){this._el.addE("span").addT(t[0]+"--");var e=this._el.addE("span");e.classList.add("desc"),e.addT(t[2]+"--"),this._el.appendChild(e)}}})),n("hint/menu",["menu","hint/item","hint/prefix","hint/lengthField"],(function(t,e,n,i){return{create:function(r,o,s){const a=Object.create(t).upgradeTo(this)._init(s,{itemClass:e,prefixClass:n,lengthFieldClass:i});return a._context=o,a._el.classList.add("hint"),a._hint=r,a._firstActive=!0,a.element().addEventListener("blur",(function(t){this.menu.hide()})),a.onHide=function(){const t=this._hint;t._inputField.element().focus(),null!==t.active()&&(t._alert.active&&t._unshowAlert(),t.active(null))},a},hint:function(){return this._hint}}})),n("hint/contextanalyzer",{create:function(t){return Object.create(this)._init(t)},_init:function(t){try{this._regex=new RegExp(t)}catch(t){return void KorAP.log(0,t)}return this},test:function(t){if(this._regex.exec(t))return RegExp.$1}}),n("hint/alert",[],(function(){return{create:function(t){return Object.create(this)._init(t)},_init:function(t){const e=this;return e._type="alert",e.active=!1,e._el=document.createElement("div"),e._el.style.display="none",e._el.classList.add("alert","hint"),e},show:function(t){this.active=!0;const e=this._el;e.textContent=t,e.style.display="block"},hide:function(){return!!this.active&&(this._el.style.display="none",this.active=!1,!0)},element:function(){return this._el}}})),n("hint",["hint/input","hint/menu","hint/contextanalyzer","hint/alert","util"],(function(t,e,n,i){return{create:function(t){return Object.create(this)._init(t)},_init:function(e){if(e=e||{},this._menu={},this._alert=i.create(),this._active=null,!KorAP.annotationHelper)return void console.log("No annotationhelper defined");KorAP.context=KorAP.context||"(?:^|[^-_a-zA-Z0-9])((?:[-_a-zA-Z0-9]+?)/(?:(?:[-_a-zA-Z0-9]+?)=(?:(?:[^:=/ ]+?):|(?:[^-=/ ]+?)-)?)?)$";const r=e.inputField||document.getElementById("q-field");if(!r)return null;this._inputField=t.create(r);const o=this,s=this._inputField.container();s.appendChild(this._alert.element()),s.addEventListener("click",(function(t){this.classList.contains("active")||o.show(!1)}));const a=this._inputField.element();a.addEventListener("keyup",this.update.bind(this)),a.addEventListener("click",this.update.bind(this));return a.addEventListener("keydown",function(t){40===d(t)&&(this.show(!1),t.halt())}.bind(this),!1),a.addEventListener("touchstart",this._touch.bind(this),!1),a.addEventListener("touchend",this._touch.bind(this),!1),a.addEventListener("touchmove",this._touch.bind(this),!1),this._analyzer=n.create(e.context||KorAP.context),this},inputField:function(){return this._inputField},alert:function(t,e){const n=this;return 0===arguments.length?n._alert:!n._alert.active&&(n._inputField.moveto(t),n._alert.show(e),n.active(n._alert),!0)},update:function(){this._inputField.update(),this._alert.hide()&&this.active(null)},menu:function(t){if(void 0===this._menu[t]){if(void 0===KorAP.annotationHelper[t])return;this._menu[t]=e.create(this,t,KorAP.annotationHelper[t])}return this._menu[t]},contextMenu:function(t){const e=t?void 0:this.menu("-");let n=this._inputField.context();return void 0===n||0===n.length?e:(n=this._analyzer.test(n),void 0===n||0==n.length?e:this.menu(n)||e)},active:function(t){if(1===arguments.length){const e=this._inputField.container();null!==t?(e.classList.add("active"),this._active=t):(e.classList.remove("active"),this._active=null)}return this._active},show:function(t){let e;if(this._unshow(),e=this.contextMenu(t)){this.active(e);let t=e.element();this._active.element().blur(),this._inputField.container().appendChild(t),e.show(),e.focus()}else this._inputField.element().focus()},getContext:function(){},unshow:function(){this._unshow(),this._inputField.element().focus()},_touch:function(t){"touchstart"===t.type?this._lastTouch=t.touches[0].clientY:"touchend"===t.type?this._lastTouch=void 0:"touchmove"==t.type&&(this._lastTouch+10<t.touches[0].clientY&&(this.show(),this._lastTouch=void 0),t.halt())},_unshow:function(){null!==this.active()&&(this._alert.active?this._unshowAlert():this._inputField.container().removeChild(this._active.element()),this.active(null))},_unshowAlert:function(){this._alert.hide(),this.active(null)}}})),n("session",{create:function(t="korap"){const e=Object.create(this);return e._name=t.toLowerCase(),e._hash={},e._parse(),e},get:function(t){return this._hash[t.toLowerCase()]},set:function(t,e){this._hash[t]=e,this._store()},clear:function(){this._hash={},document.cookie=this._name+"=; expires=-1"},_store:function(){document.cookie=this.toString()},toString:function(){return this._name+"="+encodeURIComponent(JSON.stringify(this._hash))+";SameSite=Lax"},_parse:function(){document.cookie.split(";").forEach((function(t){const e=t.split("=");if(e[0].trim().toLowerCase()!==this._name);else{if(1===e.length||0===e[1].length)return;this._hash=JSON.parse(decodeURIComponent(e[1]))}}),this)}}),n("tutorial",["session","buttongroup","util"],(function(t,e){const n=KorAP.Locale;n.CLOSE=n.CLOSE||"Close";const i=document;return{create:function(t,e){return t?Object.create(this)._init(t,e):null},_init:function(e,n){const r=this;if(r._session=void 0===n?t.create():n,e){if(r._show=e,r.start=e.getAttribute("href"),!r.start)return null;e.removeAttribute("href"),e.onclick=function(){this.show()}.bind(r);const t=i.createElement("div");t.setAttribute("id","tutorial"),t.style.display="none",i.getElementsByTagName("body")[0].appendChild(t),r._iframe=null,r._el=t,r._ql=i.getElementById("ql-field"),r._q=i.getElementById("q-field"),r._cutoff=i.getElementById("q-cutoff-field")}return r},useQuery:function(t){const e=this,n=t.getAttribute("data-query"),i=t.getAttribute("data-query-language"),r=t.getAttribute("data-query-cutoff");if(0!==r&&"0"!==r&&"off"!==r&&null!==r&&e._cuttoff&&(e._cutoff.checked=!0),KorAP.QLmenu)KorAP.QLmenu.selectValue(i);else if(e._ql){let t=Array.from(e._ql.options).find(t=>t.value===i);t&&(t.selected=!0)}e._q&&(e._q.value=n),e.setPage(t),e.hide()},initQueries:function(t){Array.from(t.querySelectorAll("pre.query.tutorial:not(.unsupported)")).forEach(t=>t.onclick=function(t){this.useQuery(this,t)}.bind(this))},initDocLinks:function(t){const e=this;Array.from(t.getElementsByClassName("doc-link")).forEach(t=>t.onclick=function(){return e.setPage(this.getAttribute("href")),!0})},show:function(){const t=this,r=t._el;if("block"!==r.style.display){if(null===t._iframe){t._iframe=i.createElement("iframe"),t._iframe.setAttribute("src",(t.getPage()||t.start)+"?embedded=true");const o=e.create(["action","button-view"]);o.add(n.CLOSE,{cls:["button-icon","close"]},(function(){r.style.display="none"})),r.appendChild(o.element()),r.appendChild(t._iframe)}r.style.display="block"}},hide:function(){this._el.style.display="none"},setPage:function(t){let e=t;if("string"!=typeof e){const n=null!==this._iframe?window.frames[0].location:window.location;e=n.pathname+n.search;for(let n=1;n<5;n++){if(("SECTION"===t.nodeName||"PRE"===t.nodeName)&&t.hasAttribute("id")){e+="#"+t.getAttribute("id");break}if(null===(t=t.parentNode))break}}this._session.set("tutpage",e)},getPage:function(){return this._session.get("tutpage")}}})),
+/**
+ * @license RequireJS domReady 2.0.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/requirejs/domReady for details
+ */
+n("lib/domReady",[],(function(){"use strict";var t,e,n,i="undefined"!=typeof window&&window.document,r=!i,o=i?document:null,s=[];function a(){var t=s;r&&t.length&&(s=[],function(t){var e;for(e=0;e<t.length;e+=1)t[e](o)}(t))}function c(){r||(r=!0,n&&clearInterval(n),a())}if(i){if(document.addEventListener)document.addEventListener("DOMContentLoaded",c,!1),window.addEventListener("load",c,!1);else if(window.attachEvent){window.attachEvent("onload",c),e=document.createElement("div");try{t=null===window.frameElement}catch(t){}e.doScroll&&t&&window.external&&(n=setInterval((function(){try{e.doScroll(),c()}catch(t){}}),30))}"complete"===document.readyState&&c()}function l(t){return r?t(o):s.push(t),l}return l.version="2.0.1",l.load=function(t,e,n,i){i.isBuild?n(null):l(n)},l})),n("vc/array",[],(function(){return[["author","text"],["corpusAuthor","text"],["corpusSigle","string"],["corpusSubTitle","text"],["corpusTitle","text"],["creationDate","date"],["docAuthor","text"],["docSigle","string"],["docSubTitle","text"],["docTitle","text"],["foundries","string"],["keywords","string"],["language","string"],["license","string"],["pubDate","date"],["pubPlace","string"],["subTitle","text"],["textClass","string"],["textColumn","string"],["textDomain","string"],["textSigle","string"],["textType","string"],["textTypeArt","string"],["textTypeRef","string"],["title","text"]]})),function(t,e){"use strict";var i,r=t.document;i=function(){var e,n,i,o,s,a,c,l,u,h,d,f,p={},m={},g=!1,_=13,v=27,y=32,b=[];return m={buttons:{holder:'<nav class="alertify-buttons">{{buttons}}</nav>',submit:'<button type="submit" class="alertify-button alertify-button-ok" id="alertify-ok">{{ok}}</button>',ok:'<button class="alertify-button alertify-button-ok" id="alertify-ok">{{ok}}</button>',cancel:'<button class="alertify-button alertify-button-cancel" id="alertify-cancel">{{cancel}}</button>'},input:'<div class="alertify-text-wrapper"><input type="text" class="alertify-text" id="alertify-text"></div>',message:'<p class="alertify-message">{{message}}</p>',log:'<article class="alertify-log{{class}}">{{message}}</article>'},f=function(){var t,e,n=!1,i=r.createElement("fakeelement"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"};for(t in o)if(void 0!==i.style[t]){e=o[t],n=!0;break}return{type:e,supported:n}},e=function(t){return r.getElementById(t)},{alert:function(t,e,n){return p.dialog(t,"alert",e,"",n),this},confirm:function(t,e,n){return p.dialog(t,"confirm",e,"",n),this},extend:(p={labels:{ok:"OK",cancel:"Cancel"},delay:5e3,buttonReverse:!1,buttonFocus:"ok",transition:void 0,addListeners:function(t){var e,a,c,l,u,h=void 0!==i,f=void 0!==n,p=void 0!==d,m="",g=this;e=function(e){return void 0!==e.preventDefault&&e.preventDefault(),c(e),void 0!==d&&(m=d.value),"function"==typeof t&&(void 0!==d?t(!0,m):t(!0)),!1},a=function(e){return void 0!==e.preventDefault&&e.preventDefault(),c(e),"function"==typeof t&&t(!1),!1},c=function(t){g.hide(),g.unbind(r.body,"keyup",l),g.unbind(o,"focus",u),h&&g.unbind(i,"click",e),f&&g.unbind(n,"click",a)},l=function(t){var n=t.keyCode;(n===y&&!p||p&&n===_)&&e(t),n===v&&f&&a(t)},u=function(t){p?d.focus():!f||g.buttonReverse?i.focus():n.focus()},this.bind(o,"focus",u),this.bind(s,"focus",u),h&&this.bind(i,"click",e),f&&this.bind(n,"click",a),this.bind(r.body,"keyup",l),this.transition.supported||this.setFocus()},bind:function(t,e,n){"function"==typeof t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)},handleErrors:function(){if(void 0!==t.onerror){var e=this;return t.onerror=function(t,n,i){e.error("["+t+" on line "+i+" of "+n+"]",0)},!0}return!1},appendButtons:function(t,e){return this.buttonReverse?e+t:t+e},build:function(t){var e="",n=t.type,i=t.message,r=t.cssClass||"";switch(e+='<div class="alertify-dialog">',e+='<a id="alertify-resetFocusBack" class="alertify-resetFocus" href="#">Reset Focus</a>',"none"===p.buttonFocus&&(e+='<a href="#" id="alertify-noneFocus" class="alertify-hidden"></a>'),"prompt"===n&&(e+='<div id="alertify-form">'),e+='<article class="alertify-inner">',e+=m.message.replace("{{message}}",i),"prompt"===n&&(e+=m.input),e+=m.buttons.holder,e+="</article>","prompt"===n&&(e+="</div>"),e+='<a id="alertify-resetFocus" class="alertify-resetFocus" href="#">Reset Focus</a>',e+="</div>",n){case"confirm":e=(e=e.replace("{{buttons}}",this.appendButtons(m.buttons.cancel,m.buttons.ok))).replace("{{ok}}",this.labels.ok).replace("{{cancel}}",this.labels.cancel);break;case"prompt":e=(e=e.replace("{{buttons}}",this.appendButtons(m.buttons.cancel,m.buttons.submit))).replace("{{ok}}",this.labels.ok).replace("{{cancel}}",this.labels.cancel);break;case"alert":e=(e=e.replace("{{buttons}}",m.buttons.ok)).replace("{{ok}}",this.labels.ok)}return u.className="alertify alertify-"+n+" "+r,l.className="alertify-cover",e},close:function(t,e){var n,i,r=e&&!isNaN(e)?+e:this.delay,o=this;this.bind(t,"click",(function(){n(t)})),i=function(t){t.stopPropagation(),o.unbind(this,o.transition.type,i),h.removeChild(this),h.hasChildNodes()||(h.className+=" alertify-logs-hidden")},n=function(t){void 0!==t&&t.parentNode===h&&(o.transition.supported?(o.bind(t,o.transition.type,i),t.className+=" alertify-log-hide"):(h.removeChild(t),h.hasChildNodes()||(h.className+=" alertify-logs-hidden")))},0!==e&&setTimeout((function(){n(t)}),r)},dialog:function(t,e,n,i,o){c=r.activeElement;var s=function(){h&&null!==h.scrollTop&&l&&null!==l.scrollTop||s()};if("string"!=typeof t)throw new Error("message must be a string");if("string"!=typeof e)throw new Error("type must be a string");if(void 0!==n&&"function"!=typeof n)throw new Error("fn must be a function");return this.init(),s(),b.push({type:e,message:t,callback:n,placeholder:i,cssClass:o}),g||this.setup(),this},extend:function(t){if("string"!=typeof t)throw new Error("extend method must have exactly one paramter");return function(e,n){return this.log(e,t,n),this}},hide:function(){var t,e=this;b.splice(0,1),b.length>0?this.setup(!0):(g=!1,t=function(n){n.stopPropagation(),e.unbind(u,e.transition.type,t)},this.transition.supported?(this.bind(u,this.transition.type,t),u.className="alertify alertify-hide alertify-hidden"):u.className="alertify alertify-hide alertify-hidden alertify-isHidden",l.className="alertify-cover alertify-cover-hidden",c.focus())},init:function(){r.createElement("nav"),r.createElement("article"),r.createElement("section"),null==e("alertify-cover")&&((l=r.createElement("div")).setAttribute("id","alertify-cover"),l.className="alertify-cover alertify-cover-hidden",r.body.appendChild(l)),null==e("alertify")&&(g=!1,b=[],(u=r.createElement("section")).setAttribute("id","alertify"),u.className="alertify alertify-hidden",r.body.appendChild(u)),null==e("alertify-logs")&&((h=r.createElement("section")).setAttribute("id","alertify-logs"),h.className="alertify-logs alertify-logs-hidden",r.body.appendChild(h)),r.body.setAttribute("tabindex","0"),this.transition=f()},log:function(t,e,n){var i=function(){h&&null!==h.scrollTop||i()};return this.init(),i(),h.className="alertify-logs",this.notify(t,e,n),this},notify:function(t,e,n){var i=r.createElement("article");i.className="alertify-log"+("string"==typeof e&&""!==e?" alertify-log-"+e:""),i.innerHTML=t,h.appendChild(i),setTimeout((function(){i.className=i.className+" alertify-log-show"}),50),this.close(i,n)},set:function(t){var e;if("object"!=typeof t&&t instanceof Array)throw new Error("args must be an object");for(e in t)t.hasOwnProperty(e)&&(this[e]=t[e])},setFocus:function(){d?(d.focus(),d.select()):a.focus()},setup:function(t){var r,c=b[0],l=this;g=!0,r=function(t){t.stopPropagation(),l.setFocus(),l.unbind(u,l.transition.type,r)},this.transition.supported&&!t&&this.bind(u,this.transition.type,r),u.innerHTML=this.build(c),o=e("alertify-resetFocus"),s=e("alertify-resetFocusBack"),i=e("alertify-ok")||void 0,n=e("alertify-cancel")||void 0,a="cancel"===p.buttonFocus?n:"none"===p.buttonFocus?e("alertify-noneFocus"):i,d=e("alertify-text")||void 0,e("alertify-form")||void 0,"string"==typeof c.placeholder&&""!==c.placeholder&&(d.value=c.placeholder),t&&this.setFocus(),this.addListeners(c.callback)},unbind:function(t,e,n){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n)}}).extend,init:p.init,log:function(t,e,n){return p.log(t,e,n),this},prompt:function(t,e,n,i){return p.dialog(t,"prompt",e,n,i),this},success:function(t,e){return p.log(t,"success",e),this},error:function(t,e){return p.log(t,"error",e),this},set:function(t){p.set(t)},labels:p.labels,debug:p.handleErrors}},"function"==typeof n?n("lib/alertify",[],(function(){return new i})):void 0===t.alertify&&(t.alertify=new i)}(this),n("selectMenu/item",["menu/item"],(function(t){return{create:function(e){return Object.create(t).upgradeTo(this)._init(e)},onclick:function(t){var e=this.menu();e.hide(),e.select(this._index),e.showTitle(),t.halt()},title:function(){return this.content().textContent}}})),n("selectMenu",["menu","selectMenu/item","util"],(function(t,e){return{create:function(n){const i=n.getElementsByTagName("select")[0];if(null===i)return;const r=[];Array.from(i.getElementsByTagName("option")).forEach((function(t){const e=[t.textContent,t.getAttribute("value")];t.hasAttribute("desc")&&e.push(t.getAttribute("desc")),r.push(e)}));const o=Object.create(t).upgradeTo(this)._init(r,{itemClass:e});return o._container=n,o._select=i,i.style.display="none",o._title=o._container.addE("span"),o._title.addT(""),o._container.appendChild(o.element()),o._container.addEventListener("click",o.showSelected.bind(o)),o._items.forEach((t,e)=>t._index=e),o.element().addEventListener("blur",(function(t){this.menu.hide(),this.menu.showTitle()})),i.addEventListener("change",function(t){this.showTitle()}.bind(o)),o.showTitle(),o},select:function(t){const e=this;return arguments.length>0&&(e._selected=t,e._select.selectedIndex=t),e._selected||e._select.selectedIndex||0},selectValue:function(t){const e=this,n=e._select.options;for(let i=0;i<n.length;i++)if(n[i].value==t){e.hide(),e.select(i),e.showTitle();break}return e},showSelected:function(){const t=this;t._title.style.display="none",t.show(t._selected=t._select.selectedIndex),t.focus()},showTitle:function(){const t=this;t.select();t._title.textContent=t.item(t.select()).title(),t._title.style.display="inline"}}})),function(t){"undefined"!=typeof exports?t(exports):(window.hljs=t({}),"function"==typeof n&&n.amd&&n("lib/highlight/highlight.pack",[],(function(){return window.hljs})))}((function(t){function e(t){return t.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function n(t){return t.nodeName.toLowerCase()}function i(t,e){var n=t&&t.exec(e);return n&&0==n.index}function r(t,e){var n,i={};for(n in t)i[n]=t[n];if(e)for(n in e)i[n]=e[n];return i}function o(t){var e=[];return function t(i,r){for(var o=i.firstChild;o;o=o.nextSibling)3==o.nodeType?r+=o.nodeValue.length:1==o.nodeType&&(e.push({event:"start",offset:r,node:o}),r=t(o,r),n(o).match(/br|hr|img|input/)||e.push({event:"stop",offset:r,node:o}));return r}(t,0),e}function s(t,i,r){function o(){return t.length&&i.length?t[0].offset!=i[0].offset?t[0].offset<i[0].offset?t:i:"start"==i[0].event?t:i:t.length?t:i}function s(t){u+="<"+n(t)+Array.prototype.map.call(t.attributes,(function(t){return" "+t.nodeName+'="'+e(t.value)+'"'})).join("")+">"}function a(t){u+="</"+n(t)+">"}function c(t){("start"==t.event?s:a)(t.node)}for(var l=0,u="",h=[];t.length||i.length;){var d=o();if(u+=e(r.substr(l,d[0].offset-l)),l=d[0].offset,d==t){h.reverse().forEach(a);do{c(d.splice(0,1)[0]),d=o()}while(d==t&&d.length&&d[0].offset==l);h.reverse().forEach(s)}else"start"==d[0].event?h.push(d[0].node):h.pop(),c(d.splice(0,1)[0])}return u+e(r.substr(l))}function a(t){function e(t){return t&&t.source||t}function n(n,i){return new RegExp(e(n),"m"+(t.cI?"i":"")+(i?"g":""))}!function i(o,s){if(!o.compiled){if(o.compiled=!0,o.k=o.k||o.bK,o.k){var a={},c=function(e,n){t.cI&&(n=n.toLowerCase()),n.split(" ").forEach((function(t){var n=t.split("|");a[n[0]]=[e,n[1]?Number(n[1]):1]}))};"string"==typeof o.k?c("keyword",o.k):Object.keys(o.k).forEach((function(t){c(t,o.k[t])})),o.k=a}o.lR=n(o.l||/\b\w+\b/,!0),s&&(o.bK&&(o.b="\\b("+o.bK.split(" ").join("|")+")\\b"),o.b||(o.b=/\B|\b/),o.bR=n(o.b),o.e||o.eW||(o.e=/\B|\b/),o.e&&(o.eR=n(o.e)),o.tE=e(o.e)||"",o.eW&&s.tE&&(o.tE+=(o.e?"|":"")+s.tE)),o.i&&(o.iR=n(o.i)),void 0===o.r&&(o.r=1),o.c||(o.c=[]);var l=[];o.c.forEach((function(t){t.v?t.v.forEach((function(e){l.push(r(t,e))})):l.push("self"==t?o:t)})),o.c=l,o.c.forEach((function(t){i(t,o)})),o.starts&&i(o.starts,s);var u=o.c.map((function(t){return t.bK?"\\.?("+t.b+")\\.?":t.b})).concat([o.tE,o.i]).map(e).filter(Boolean);o.t=u.length?n(u.join("|"),!0):{exec:function(){return null}}}}(t)}function c(t,n,r,o){function s(t,e){for(var n=0;n<e.c.length;n++)if(i(e.c[n].bR,t))return e.c[n]}function u(t,e){if(i(t.eR,e)){for(;t.endsParent&&t.parent;)t=t.parent;return t}return t.eW?u(t.parent,e):void 0}function h(t,e){return!r&&i(e.iR,t)}function d(t,e){var n=b.cI?e[0].toLowerCase():e[0];return t.k.hasOwnProperty(n)&&t.k[n]}function g(t,e,n,i){var r='<span class="'+(i?"":p.classPrefix);return(r+=t+'">')+e+(n?"":"</span>")}function _(){return void 0!==E.sL?function(){if(E.sL&&!m[E.sL])return e(x);var t=E.sL?c(E.sL,x,!0,k[E.sL]):l(x);return E.r>0&&(C+=t.r),"continuous"==E.subLanguageMode&&(k[E.sL]=t.top),g(t.language,t.value,!1,!0)}():function(){if(!E.k)return e(x);var t="",n=0;E.lR.lastIndex=0;for(var i=E.lR.exec(x);i;){t+=e(x.substr(n,i.index-n));var r=d(E,i);r?(C+=r[1],t+=g(r[0],e(i[0]))):t+=e(i[0]),n=E.lR.lastIndex,i=E.lR.exec(x)}return t+e(x.substr(n))}()}function v(t,n){var i=t.cN?g(t.cN,"",!0):"";t.rB?(A+=i,x=""):t.eB?(A+=e(n)+i,x=""):(A+=i,x=n),E=Object.create(t,{parent:{value:E}})}function y(t,n){if(x+=t,void 0===n)return A+=_(),0;var i=s(n,E);if(i)return A+=_(),v(i,n),i.rB?0:n.length;var r=u(E,n);if(r){var o=E;o.rE||o.eE||(x+=n),A+=_();do{E.cN&&(A+="</span>"),C+=E.r,E=E.parent}while(E!=r.parent);return o.eE&&(A+=e(n)),x="",r.starts&&v(r.starts,""),o.rE?0:n.length}if(h(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"<unnamed>")+'"');return x+=n,n.length||1}var b=f(t);if(!b)throw new Error('Unknown language: "'+t+'"');a(b);var w,E=o||b,k={},A="";for(w=E;w!=b;w=w.parent)w.cN&&(A=g(w.cN,"",!0)+A);var x="",C=0;try{for(var T,L,N=0;E.t.lastIndex=N,T=E.t.exec(n);)L=y(n.substr(N,T.index-N),T[0]),N=T.index+L;for(y(n.substr(N)),w=E;w.parent;w=w.parent)w.cN&&(A+="</span>");return{r:C,value:A,language:t,top:E}}catch(t){if(-1!=t.message.indexOf("Illegal"))return{r:0,value:e(n)};throw t}}function l(t,n){n=n||p.languages||Object.keys(m);var i={r:0,value:e(t)},r=i;return n.forEach((function(e){if(f(e)){var n=c(e,t,!1);n.language=e,n.r>r.r&&(r=n),n.r>i.r&&(r=i,i=n)}})),r.language&&(i.second_best=r),i}function u(t){return p.tabReplace&&(t=t.replace(/^((<[^>]+>|\t)+)/gm,(function(t,e){return e.replace(/\t/g,p.tabReplace)}))),p.useBR&&(t=t.replace(/\n/g,"<br>")),t}function h(t){var e=function(t){var e=(t.className+" "+(t.parentNode?t.parentNode.className:"")).split(/\s+/);return(e=e.map((function(t){return t.replace(/^lang(uage)?-/,"")}))).filter((function(t){return f(t)||/no(-?)highlight|plain|text/.test(t)}))[0]}(t);if(!/no(-?)highlight|plain|text/.test(e)){var n;p.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=t.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n"):n=t;var i=n.textContent,r=e?c(e,i,!0):l(i),a=o(n);if(a.length){var h=document.createElementNS("http://www.w3.org/1999/xhtml","div");h.innerHTML=r.value,r.value=s(a,o(h),i)}r.value=u(r.value),t.innerHTML=r.value,t.className=function(t,e,n){var i=e?g[e]:n,r=[t.trim()];return t.match(/\bhljs\b/)||r.push("hljs"),-1===t.indexOf(i)&&r.push(i),r.join(" ").trim()}(t.className,e,r.language),t.result={language:r.language,re:r.r},r.second_best&&(t.second_best={language:r.second_best.language,re:r.second_best.r})}}function d(){if(!d.called){d.called=!0;var t=document.querySelectorAll("pre code");Array.prototype.forEach.call(t,h)}}function f(t){return m[t]||m[g[t]]}var p={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},m={},g={};return t.highlight=c,t.highlightAuto=l,t.fixMarkup=u,t.highlightBlock=h,t.configure=function(t){p=r(p,t)},t.initHighlighting=d,t.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",d,!1),addEventListener("load",d,!1)},t.registerLanguage=function(e,n){var i=m[e]=n(t);i.aliases&&i.aliases.forEach((function(t){g[t]=e}))},t.listLanguages=function(){return Object.keys(m)},t.getLanguage=f,t.inherit=r,t.IR="[a-zA-Z]\\w*",t.UIR="[a-zA-Z_]\\w*",t.NR="\\b\\d+(\\.\\d+)?",t.CNR="\\b(0[xX][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",t.BNR="\\b(0b[01]+)",t.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",t.BE={b:"\\\\[\\s\\S]",r:0},t.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[t.BE]},t.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[t.BE]},t.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},t.C=function(e,n,i){var r=t.inherit({cN:"comment",b:e,e:n,c:[]},i||{});return r.c.push(t.PWM),r},t.CLCM=t.C("//","$"),t.CBCM=t.C("/\\*","\\*/"),t.HCM=t.C("#","$"),t.NM={cN:"number",b:t.NR,r:0},t.CNM={cN:"number",b:t.CNR,r:0},t.BNM={cN:"number",b:t.BNR,r:0},t.CSSNM={cN:"number",b:t.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},t.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[t.BE,{b:/\[/,e:/\]/,r:0,c:[t.BE]}]},t.TM={cN:"title",b:t.IR,r:0},t.UTM={cN:"title",b:t.UIR,r:0},t})),hljs.registerLanguage("json",(function(t){var e={literal:"true false null"},n=[t.QSM,t.CNM],i={cN:"value",e:",",eW:!0,eE:!0,c:n,k:e},r={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[t.BE],i:"\\n",starts:i}],i:"\\S"},o={b:"\\[",e:"\\]",c:[t.inherit(i,{cN:null})],i:"\\S"};return n.splice(n.length,0,r,o),{c:n,k:e,i:"\\S"}})),n("view/result/koralquery",["view","lib/highlight/highlight.pack"],(function(t){return{create:function(e){return Object.create(t)._init(e).upgradeTo(this)},show:function(){if(this._show)return this._show;const t=document.createElement("div");t.setAttribute("id","koralquery");const e=t.addE("div");return e.addT(JSON.stringify(KorAP.koralQuery||{},null," ")),hljs.highlightBlock(e),this._show=t,t}}})),n("panel/result",["panel","view/result/koralquery"],(function(t,e){const n=document,i=KorAP.Locale;i.TOGGLE_ALIGN=i.TOGGLE_ALIGN||"toggle alignment",i.SHOW_KQ=i.SHOW_KQ||"show KoralQuery";const r=["left","right","center"];return{create:function(e){return Object.create(t)._init(["result"]).upgradeTo(this)._init(e)},_init:function(t){return this._opened=t,KorAP.Plugin&&(KorAP.Plugin.buttonGroup("result").forEach(t=>this.actions.add.apply(this.actions,t)),KorAP.Plugin.clearButtonGroup("result")),this.prepend=!0,this},addKqAction:function(){const t=this.actions.add(i.SHOW_KQ,{cls:["show-kq","button-icon"]},(function(){const t=this;t._kq&&t._kq.shown()?t._kq.close():(t._kq=e.create(),t._kq.onClose=function(){delete this._opened.kq}.bind(t),t._opened.kq=!0,t.add(t._kq))}));this._opened.kq&&t.click()},addAlignAction:function(){this.actions.add(i.TOGGLE_ALIGN,{cls:["align","right","button-icon"]},(function(t){var e=n.querySelector("#search > ol").classList;r.find((function(t,n){if(e.contains("align-"+t)){const i=n>=2?0:n+1,o=i>=2?0:i+1;return e.remove("align-"+t),e.add("align-"+r[i]),this.button.toggleClass(r[i],r[o]),!0}}),this)}))}}})),n("panel/query",["panel"],(function(t){document,KorAP.Locale;return{create:function(e){return Object.create(t)._init(["query"]).upgradeTo(this)._init(e)},_init:function(t){this._opened=t;const e=this.actions;return KorAP.Plugin&&(KorAP.Plugin.buttonGroup("query").forEach(t=>e.add.apply(e,t)),KorAP.Plugin.clearButtonGroup("query")),this}}})),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t(),module.exports.introJs=function(){return console.warn('Deprecated: please use require("intro.js") directly, instead of the introJs method of the function'),t().apply(this,arguments)};else if("function"==typeof n&&n.amd)n("lib/intro",[],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).introJs=t()}}((function(){function t(t){this._targetElement=t,this._introItems=[],this._options={nextLabel:"Next →",prevLabel:"← Back",skipLabel:"Skip",doneLabel:"Done",hidePrev:!1,hideNext:!1,tooltipPosition:"bottom",tooltipClass:"",highlightClass:"",exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!0,keyboardNavigation:!0,showButtons:!0,showBullets:!0,showProgress:!1,scrollToElement:!0,scrollTo:"element",scrollPadding:30,overlayOpacity:.8,positionPrecedence:["bottom","top","right","left"],disableInteraction:!1,helperElementPadding:10,hintPosition:"top-middle",hintButtonLabel:"Got it",hintAnimation:!0,buttonClass:"introjs-button"}}function e(t,e){var o=t.querySelectorAll("*[data-intro]"),s=[];if(this._options.steps)E(this._options.steps,function(t){var e=r(t);if(e.step=s.length+1,"string"==typeof e.element&&(e.element=document.querySelector(e.element)),void 0===e.element||null===e.element){var n=document.querySelector(".introjsFloatingElement");null===n&&((n=document.createElement("div")).className="introjsFloatingElement",document.body.appendChild(n)),e.element=n,e.position="floating"}e.scrollTo=e.scrollTo||this._options.scrollTo,void 0===e.disableInteraction&&(e.disableInteraction=this._options.disableInteraction),null!==e.element&&s.push(e)}.bind(this));else{var c;if(o.length<1)return!1;E(o,function(t){if((!e||t.getAttribute("data-intro-group")===e)&&"none"!==t.style.display){var n=parseInt(t.getAttribute("data-step"),10);c=void 0!==t.getAttribute("data-disable-interaction")?!!t.getAttribute("data-disable-interaction"):this._options.disableInteraction,n>0&&(s[n-1]={element:t,intro:t.getAttribute("data-intro"),step:parseInt(t.getAttribute("data-step"),10),tooltipClass:t.getAttribute("data-tooltipclass"),highlightClass:t.getAttribute("data-highlightclass"),position:t.getAttribute("data-position")||this._options.tooltipPosition,scrollTo:t.getAttribute("data-scrollto")||this._options.scrollTo,disableInteraction:c})}}.bind(this));var l=0;E(o,function(t){if((!e||t.getAttribute("data-intro-group")===e)&&null===t.getAttribute("data-step")){for(;void 0!==s[l];)l++;c=void 0!==t.getAttribute("data-disable-interaction")?!!t.getAttribute("data-disable-interaction"):this._options.disableInteraction,s[l]={element:t,intro:t.getAttribute("data-intro"),step:l+1,tooltipClass:t.getAttribute("data-tooltipclass"),highlightClass:t.getAttribute("data-highlightclass"),position:t.getAttribute("data-position")||this._options.tooltipPosition,scrollTo:t.getAttribute("data-scrollto")||this._options.scrollTo,disableInteraction:c}}}.bind(this))}for(var u=[],h=0;h<s.length;h++)s[h]&&u.push(s[h]);return(s=u).sort((function(t,e){return t.step-e.step})),this._introItems=s,P.call(this,t)&&(a.call(this),this._options.keyboardNavigation&&x.on(window,"keydown",i,this,!0),x.on(window,"resize",n,this,!0)),!1}function n(){this.refresh.call(this)}function i(t){var e=null===t.code?t.which:t.code;if(null===e&&(e=null===t.charCode?t.keyCode:t.charCode),"Escape"!==e&&27!==e||!0!==this._options.exitOnEsc){if("ArrowLeft"===e||37===e)c.call(this);else if("ArrowRight"===e||39===e)a.call(this);else if("Enter"===e||13===e){var n=t.target||t.srcElement;n&&n.className.match("introjs-prevbutton")?c.call(this):n&&n.className.match("introjs-skipbutton")?(this._introItems.length-1===this._currentStep&&"function"==typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),u.call(this,this._targetElement)):n&&n.getAttribute("data-stepnumber")?n.click():a.call(this),t.preventDefault?t.preventDefault():t.returnValue=!1}}else u.call(this,this._targetElement)}function r(t){if(null===t||"object"!=typeof t||void 0!==t.nodeType)return t;var e={};for(var n in t)void 0!==window.jQuery&&t[n]instanceof window.jQuery?e[n]=t[n]:e[n]=r(t[n]);return e}function o(t){this._currentStep=t-2,void 0!==this._introItems&&a.call(this)}function s(t){this._currentStepNumber=t,void 0!==this._introItems&&a.call(this)}function a(){this._direction="forward",void 0!==this._currentStepNumber&&E(this._introItems,function(t,e){t.step===this._currentStepNumber&&(this._currentStep=e-1,this._currentStepNumber=void 0)}.bind(this)),void 0===this._currentStep?this._currentStep=0:++this._currentStep;var t=this._introItems[this._currentStep],e=!0;return void 0!==this._introBeforeChangeCallback&&(e=this._introBeforeChangeCallback.call(this,t.element)),!1===e?(--this._currentStep,!1):this._introItems.length<=this._currentStep?("function"==typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),void u.call(this,this._targetElement)):void y.call(this,t)}function c(){if(this._direction="backward",0===this._currentStep)return!1;--this._currentStep;var t=this._introItems[this._currentStep],e=!0;if(void 0!==this._introBeforeChangeCallback&&(e=this._introBeforeChangeCallback.call(this,t.element)),!1===e)return++this._currentStep,!1;y.call(this,t)}function l(){if(g.call(this,document.querySelector(".introjs-helperLayer")),g.call(this,document.querySelector(".introjs-tooltipReferenceLayer")),g.call(this,document.querySelector(".introjs-disableInteraction")),void 0!==this._currentStep&&null!==this._currentStep){var t=document.querySelector(".introjs-helperNumberLayer"),e=document.querySelector(".introjs-arrow"),n=document.querySelector(".introjs-tooltip");h.call(this,this._introItems[this._currentStep].element,n,e,t)}return I.call(this),this}function u(t,e){var r=!0;if(void 0!==this._introBeforeExitCallback&&(r=this._introBeforeExitCallback.call(this)),e||!1!==r){var o=t.querySelectorAll(".introjs-overlay");o&&o.length&&E(o,function(t){t.style.opacity=0,window.setTimeout(function(){this.parentNode&&this.parentNode.removeChild(this)}.bind(t),500)}.bind(this));var s=t.querySelector(".introjs-helperLayer");s&&s.parentNode.removeChild(s);var a=t.querySelector(".introjs-tooltipReferenceLayer");a&&a.parentNode.removeChild(a);var c=t.querySelector(".introjs-disableInteraction");c&&c.parentNode.removeChild(c);var l=document.querySelector(".introjsFloatingElement");l&&l.parentNode.removeChild(l),w(),E(document.querySelectorAll(".introjs-fixParent"),(function(t){T(t,/introjs-fixParent/g)})),x.off(window,"keydown",i,this,!0),x.off(window,"resize",n,this,!0),void 0!==this._introExitCallback&&this._introExitCallback.call(this),this._currentStep=void 0}}function h(t,e,n,i,r){var o,s,a,c,l,u="";if(r=r||!1,e.style.top=null,e.style.right=null,e.style.bottom=null,e.style.left=null,e.style.marginLeft=null,e.style.marginTop=null,n.style.display="inherit",null!=i&&(i.style.top=null,i.style.left=null),this._introItems[this._currentStep])switch(u="string"==typeof(o=this._introItems[this._currentStep]).tooltipClass?o.tooltipClass:this._options.tooltipClass,e.className=("introjs-tooltip "+u).replace(/^\s+|\s+$/g,""),e.setAttribute("role","dialog"),"floating"!==(l=this._introItems[this._currentStep].position)&&(l=p.call(this,t,e,l)),a=V(t),s=V(e),c=S(),C(e,"introjs-"+l),l){case"top-right-aligned":n.className="introjs-arrow bottom-right";var h=0;f(a,h,s,e),e.style.bottom=a.height+20+"px";break;case"top-middle-aligned":n.className="introjs-arrow bottom-middle";var m=a.width/2-s.width/2;r&&(m+=5),f(a,m,s,e)&&(e.style.right=null,d(a,m,s,c,e)),e.style.bottom=a.height+20+"px";break;case"top-left-aligned":case"top":n.className="introjs-arrow bottom",d(a,r?0:15,s,c,e),e.style.bottom=a.height+20+"px";break;case"right":e.style.left=a.width+20+"px",a.top+s.height>c.height?(n.className="introjs-arrow left-bottom",e.style.top="-"+(s.height-a.height-20)+"px"):n.className="introjs-arrow left";break;case"left":r||!0!==this._options.showStepNumbers||(e.style.top="15px"),a.top+s.height>c.height?(e.style.top="-"+(s.height-a.height-20)+"px",n.className="introjs-arrow right-bottom"):n.className="introjs-arrow right",e.style.right=a.width+20+"px";break;case"floating":n.style.display="none",e.style.left="50%",e.style.top="50%",e.style.marginLeft="-"+s.width/2+"px",e.style.marginTop="-"+s.height/2+"px",null!=i&&(i.style.left="-"+(s.width/2+18)+"px",i.style.top="-"+(s.height/2+18)+"px");break;case"bottom-right-aligned":n.className="introjs-arrow top-right",f(a,h=0,s,e),e.style.top=a.height+20+"px";break;case"bottom-middle-aligned":n.className="introjs-arrow top-middle",m=a.width/2-s.width/2,r&&(m+=5),f(a,m,s,e)&&(e.style.right=null,d(a,m,s,c,e)),e.style.top=a.height+20+"px";break;default:n.className="introjs-arrow top",d(a,0,s,c,e),e.style.top=a.height+20+"px"}}function d(t,e,n,i,r){return t.left+e+n.width>i.width?(r.style.left=i.width-n.width-t.left+"px",!1):(r.style.left=e+"px",!0)}function f(t,e,n,i){return t.left+t.width-e-n.width<0?(i.style.left=-t.left+"px",!1):(i.style.right=e+"px",!0)}function p(t,e,n){var i=this._options.positionPrecedence.slice(),r=S(),o=V(e).height+10,s=V(e).width+20,a=t.getBoundingClientRect(),c="floating";a.bottom+o+o>r.height&&m(i,"bottom"),a.top-o<0&&m(i,"top"),a.right+s>r.width&&m(i,"right"),a.left-s<0&&m(i,"left");var l,u,h=-1!==(u=(l=n||"").indexOf("-"))?l.substr(u):"";return n&&(n=n.split("-")[0]),i.length&&(c="auto"!==n&&i.indexOf(n)>-1?n:i[0]),-1!==["top","bottom"].indexOf(c)&&(c+=function(t,e,n,i){var r=e/2,o=Math.min(n.width,window.screen.width),s=["-left-aligned","-middle-aligned","-right-aligned"],a="";o-t<e&&m(s,"-left-aligned");(t<r||o-t<r)&&m(s,"-middle-aligned");t<e&&m(s,"-right-aligned");a=s.length?-1!==s.indexOf(i)?i:s[0]:"-middle-aligned";return a}(a.left,s,r,h)),c}function m(t,e){t.indexOf(e)>-1&&t.splice(t.indexOf(e),1)}function g(t){if(t){if(!this._introItems[this._currentStep])return;var e=this._introItems[this._currentStep],n=V(e.element),i=this._options.helperElementPadding;N(e.element)?C(t,"introjs-fixedTooltip"):T(t,"introjs-fixedTooltip"),"floating"===e.position&&(i=0),t.style.cssText="width: "+(n.width+i)+"px; height:"+(n.height+i)+"px; top:"+(n.top-i/2)+"px;left: "+(n.left-i/2)+"px;"}}function _(){var t=document.querySelector(".introjs-disableInteraction");null===t&&((t=document.createElement("div")).className="introjs-disableInteraction",this._targetElement.appendChild(t)),g.call(this,t)}function v(t){t.setAttribute("role","button"),t.tabIndex=0}function y(t){void 0!==this._introChangeCallback&&this._introChangeCallback.call(this,t.element);var e,n,i,r,o=this,s=document.querySelector(".introjs-helperLayer"),l=document.querySelector(".introjs-tooltipReferenceLayer"),d="introjs-helperLayer";if("string"==typeof t.highlightClass&&(d+=" "+t.highlightClass),"string"==typeof this._options.highlightClass&&(d+=" "+this._options.highlightClass),null!==s){var f=l.querySelector(".introjs-helperNumberLayer"),p=l.querySelector(".introjs-tooltiptext"),m=l.querySelector(".introjs-arrow"),y=l.querySelector(".introjs-tooltip");if(i=l.querySelector(".introjs-skipbutton"),n=l.querySelector(".introjs-prevbutton"),e=l.querySelector(".introjs-nextbutton"),s.className=d,y.style.opacity=0,y.style.display="none",null!==f){var k=this._introItems[t.step-2>=0?t.step-2:0];(null!==k&&"forward"===this._direction&&"floating"===k.position||"backward"===this._direction&&"floating"===t.position)&&(f.style.opacity=0)}(r=G(t.element))!==document.body&&W(r,t.element),g.call(o,s),g.call(o,l),E(document.querySelectorAll(".introjs-fixParent"),(function(t){T(t,/introjs-fixParent/g)})),w(),o._lastShowElementTimer&&window.clearTimeout(o._lastShowElementTimer),o._lastShowElementTimer=window.setTimeout((function(){null!==f&&(f.innerHTML=t.step),p.innerHTML=t.intro,y.style.display="block",h.call(o,t.element,y,m,f),o._options.showBullets&&(l.querySelector(".introjs-bullets li > a.active").className="",l.querySelector('.introjs-bullets li > a[data-stepnumber="'+t.step+'"]').className="active"),l.querySelector(".introjs-progress .introjs-progressbar").style.cssText="width:"+Y.call(o)+"%;",l.querySelector(".introjs-progress .introjs-progressbar").setAttribute("aria-valuenow",Y.call(o)),y.style.opacity=1,f&&(f.style.opacity=1),null!=i&&/introjs-donebutton/gi.test(i.className)?i.focus():null!=e&&e.focus(),b.call(o,t.scrollTo,t,p)}),350)}else{var A=document.createElement("div"),x=document.createElement("div"),N=document.createElement("div"),S=document.createElement("div"),P=document.createElement("div"),O=document.createElement("div"),R=document.createElement("div"),I=document.createElement("div");A.className=d,x.className="introjs-tooltipReferenceLayer",(r=G(t.element))!==document.body&&W(r,t.element),g.call(o,A),g.call(o,x),this._targetElement.appendChild(A),this._targetElement.appendChild(x),N.className="introjs-arrow",P.className="introjs-tooltiptext",P.innerHTML=t.intro,O.className="introjs-bullets",!1===this._options.showBullets&&(O.style.display="none");var j=document.createElement("ul");j.setAttribute("role","tablist");var K=function(){o.goToStep(this.getAttribute("data-stepnumber"))};E(this._introItems,(function(e,n){var i=document.createElement("li"),r=document.createElement("a");i.setAttribute("role","presentation"),r.setAttribute("role","tab"),r.onclick=K,n===t.step-1&&(r.className="active"),v(r),r.innerHTML=" ",r.setAttribute("data-stepnumber",e.step),i.appendChild(r),j.appendChild(i)})),O.appendChild(j),R.className="introjs-progress",!1===this._options.showProgress&&(R.style.display="none");var M=document.createElement("div");M.className="introjs-progressbar",M.setAttribute("role","progress"),M.setAttribute("aria-valuemin",0),M.setAttribute("aria-valuemax",100),M.setAttribute("aria-valuenow",Y.call(this)),M.style.cssText="width:"+Y.call(this)+"%;",R.appendChild(M),I.className="introjs-tooltipbuttons",!1===this._options.showButtons&&(I.style.display="none"),S.className="introjs-tooltip",S.appendChild(P),S.appendChild(O),S.appendChild(R);var q=document.createElement("span");!0===this._options.showStepNumbers&&(q.className="introjs-helperNumberLayer",q.innerHTML=t.step,x.appendChild(q)),S.appendChild(N),x.appendChild(S),(e=document.createElement("a")).onclick=function(){o._introItems.length-1!==o._currentStep&&a.call(o)},v(e),e.innerHTML=this._options.nextLabel,(n=document.createElement("a")).onclick=function(){0!==o._currentStep&&c.call(o)},v(n),n.innerHTML=this._options.prevLabel,(i=document.createElement("a")).className=this._options.buttonClass+" introjs-skipbutton ",v(i),i.innerHTML=this._options.skipLabel,i.onclick=function(){o._introItems.length-1===o._currentStep&&"function"==typeof o._introCompleteCallback&&o._introCompleteCallback.call(o),o._introItems.length-1!==o._currentStep&&"function"==typeof o._introExitCallback&&o._introExitCallback.call(o),"function"==typeof o._introSkipCallback&&o._introSkipCallback.call(o),u.call(o,o._targetElement)},I.appendChild(i),this._introItems.length>1&&(I.appendChild(n),I.appendChild(e)),S.appendChild(I),h.call(o,t.element,S,N,q),b.call(this,t.scrollTo,t,S)}var D=o._targetElement.querySelector(".introjs-disableInteraction");D&&D.parentNode.removeChild(D),t.disableInteraction&&_.call(o),0===this._currentStep&&this._introItems.length>1?(null!=i&&(i.className=this._options.buttonClass+" introjs-skipbutton"),null!=e&&(e.className=this._options.buttonClass+" introjs-nextbutton"),!0===this._options.hidePrev?(null!=n&&(n.className=this._options.buttonClass+" introjs-prevbutton introjs-hidden"),null!=e&&C(e,"introjs-fullbutton")):null!=n&&(n.className=this._options.buttonClass+" introjs-prevbutton introjs-disabled"),null!=i&&(i.innerHTML=this._options.skipLabel)):this._introItems.length-1===this._currentStep||1===this._introItems.length?(null!=i&&(i.innerHTML=this._options.doneLabel,C(i,"introjs-donebutton")),null!=n&&(n.className=this._options.buttonClass+" introjs-prevbutton"),!0===this._options.hideNext?(null!=e&&(e.className=this._options.buttonClass+" introjs-nextbutton introjs-hidden"),null!=n&&C(n,"introjs-fullbutton")):null!=e&&(e.className=this._options.buttonClass+" introjs-nextbutton introjs-disabled")):(null!=i&&(i.className=this._options.buttonClass+" introjs-skipbutton"),null!=n&&(n.className=this._options.buttonClass+" introjs-prevbutton"),null!=e&&(e.className=this._options.buttonClass+" introjs-nextbutton"),null!=i&&(i.innerHTML=this._options.skipLabel)),n.setAttribute("role","button"),e.setAttribute("role","button"),i.setAttribute("role","button"),null!=e&&e.focus(),function(t){var e;if(t.element instanceof SVGElement)for(e=t.element.parentNode;null!==t.element.parentNode&&e.tagName&&"body"!==e.tagName.toLowerCase();)"svg"===e.tagName.toLowerCase()&&C(e,"introjs-showElement introjs-relativePosition"),e=e.parentNode;C(t.element,"introjs-showElement");var n=L(t.element,"position");"absolute"!==n&&"relative"!==n&&"fixed"!==n&&C(t.element,"introjs-relativePosition");e=t.element.parentNode;for(;null!==e&&e.tagName&&"body"!==e.tagName.toLowerCase();){var i=L(e,"z-index"),r=parseFloat(L(e,"opacity")),o=L(e,"transform")||L(e,"-webkit-transform")||L(e,"-moz-transform")||L(e,"-ms-transform")||L(e,"-o-transform");(/[0-9]+/.test(i)||r<1||"none"!==o&&void 0!==o)&&C(e,"introjs-fixParent"),e=e.parentNode}}(t),void 0!==this._introAfterChangeCallback&&this._introAfterChangeCallback.call(this,t.element)}function b(t,e,n){var i;if("off"!==t&&(this._options.scrollToElement&&(i="tooltip"===t?n.getBoundingClientRect():e.element.getBoundingClientRect(),!function(t){var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom+80<=window.innerHeight&&e.right<=window.innerWidth}(e.element)))){var r=S().height;i.bottom-(i.bottom-i.top)<0||e.element.clientHeight>r?window.scrollBy(0,i.top-(r/2-i.height/2)-this._options.scrollPadding):window.scrollBy(0,i.top-(r/2-i.height/2)+this._options.scrollPadding)}}function w(){E(document.querySelectorAll(".introjs-showElement"),(function(t){T(t,/introjs-[a-zA-Z]+/g)}))}function E(t,e,n){if(t)for(var i=0,r=t.length;i<r;i++)e(t[i],i);"function"==typeof n&&n()}var k,A=(k={},function(t,e){return k[e=e||"introjs-stamp"]=k[e]||0,void 0===t[e]&&(t[e]=k[e]++),t[e]}),x=new function(){var t="introjs_event";this._id=function(t,e,n,i){return e+A(n)+(i?"_"+A(i):"")},this.on=function(e,n,i,r,o){var s=this._id.apply(this,arguments),a=function(t){return i.call(r||e,t||window.event)};"addEventListener"in e?e.addEventListener(n,a,o):"attachEvent"in e&&e.attachEvent("on"+n,a),e[t]=e[t]||{},e[t][s]=a},this.off=function(e,n,i,r,o){var s=this._id.apply(this,arguments),a=e[t]&&e[t][s];a&&("removeEventListener"in e?e.removeEventListener(n,a,o):"detachEvent"in e&&e.detachEvent("on"+n,a),e[t][s]=null)}};function C(t,e){if(t instanceof SVGElement){var n=t.getAttribute("class")||"";t.setAttribute("class",n+" "+e)}else{if(void 0!==t.classList)E(e.split(" "),(function(e){t.classList.add(e)}));else t.className.match(e)||(t.className+=" "+e)}}function T(t,e){if(t instanceof SVGElement){var n=t.getAttribute("class")||"";t.setAttribute("class",n.replace(e,"").replace(/^\s+|\s+$/g,""))}else t.className=t.className.replace(e,"").replace(/^\s+|\s+$/g,"")}function L(t,e){var n="";return t.currentStyle?n=t.currentStyle[e]:document.defaultView&&document.defaultView.getComputedStyle&&(n=document.defaultView.getComputedStyle(t,null).getPropertyValue(e)),n&&n.toLowerCase?n.toLowerCase():n}function N(t){var e=t.parentNode;return!(!e||"HTML"===e.nodeName)&&("fixed"===L(t,"position")||N(e))}function S(){if(void 0!==window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var t=document.documentElement;return{width:t.clientWidth,height:t.clientHeight}}function P(t){var e=document.createElement("div"),n="",i=this;if(e.className="introjs-overlay",t.tagName&&"body"!==t.tagName.toLowerCase()){var r=V(t);r&&(n+="width: "+r.width+"px; height:"+r.height+"px; top:"+r.top+"px;left: "+r.left+"px;",e.style.cssText=n)}else n+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",e.style.cssText=n;return t.appendChild(e),e.onclick=function(){!0===i._options.exitOnOverlayClick&&u.call(i,t)},window.setTimeout((function(){n+="opacity: "+i._options.overlayOpacity.toString()+";",e.style.cssText=n}),10),!0}function O(){var t=document.querySelector(".introjs-hintReference");if(t){var e=t.getAttribute("data-step");return t.parentNode.removeChild(t),e}}function R(t){if(this._introItems=[],this._options.hints)E(this._options.hints,function(t){var e=r(t);"string"==typeof e.element&&(e.element=document.querySelector(e.element)),e.hintPosition=e.hintPosition||this._options.hintPosition,e.hintAnimation=e.hintAnimation||this._options.hintAnimation,null!==e.element&&this._introItems.push(e)}.bind(this));else{var e=t.querySelectorAll("*[data-hint]");if(!e||!e.length)return!1;E(e,function(t){var e=t.getAttribute("data-hintanimation");e=e?"true"===e:this._options.hintAnimation,this._introItems.push({element:t,hint:t.getAttribute("data-hint"),hintPosition:t.getAttribute("data-hintposition")||this._options.hintPosition,hintAnimation:e,tooltipClass:t.getAttribute("data-tooltipclass"),position:t.getAttribute("data-position")||this._options.tooltipPosition})}.bind(this))}F.call(this),x.on(document,"click",O,this,!1),x.on(window,"resize",I,this,!0)}function I(){E(this._introItems,function(t){void 0!==t.targetElement&&H.call(this,t.hintPosition,t.element,t.targetElement)}.bind(this))}function j(t){var e=document.querySelector(".introjs-hints");return e?e.querySelectorAll(t):[]}function K(t){var e=j('.introjs-hint[data-step="'+t+'"]')[0];O.call(this),e&&C(e,"introjs-hidehint"),void 0!==this._hintCloseCallback&&this._hintCloseCallback.call(this,t)}function M(){E(j(".introjs-hint"),function(t){K.call(this,t.getAttribute("data-step"))}.bind(this))}function q(){var t=j(".introjs-hint");t&&t.length?E(t,function(t){D.call(this,t.getAttribute("data-step"))}.bind(this)):R.call(this,this._targetElement)}function D(t){var e=j('.introjs-hint[data-step="'+t+'"]')[0];e&&T(e,/introjs-hidehint/g)}function U(){E(j(".introjs-hint"),function(t){B.call(this,t.getAttribute("data-step"))}.bind(this))}function B(t){var e=j('.introjs-hint[data-step="'+t+'"]')[0];e&&e.parentNode.removeChild(e)}function F(){var t=this,e=document.querySelector(".introjs-hints");null===e&&((e=document.createElement("div")).className="introjs-hints");E(this._introItems,function(n,i){if(!document.querySelector('.introjs-hint[data-step="'+i+'"]')){var r=document.createElement("a");v(r),r.onclick=function(e){return function(n){var i=n||window.event;i.stopPropagation&&i.stopPropagation(),null!==i.cancelBubble&&(i.cancelBubble=!0),z.call(t,e)}}(i),r.className="introjs-hint",n.hintAnimation||C(r,"introjs-hint-no-anim"),N(n.element)&&C(r,"introjs-fixedhint");var o=document.createElement("div");o.className="introjs-hint-dot";var s=document.createElement("div");s.className="introjs-hint-pulse",r.appendChild(o),r.appendChild(s),r.setAttribute("data-step",i),n.targetElement=n.element,n.element=r,H.call(this,n.hintPosition,r,n.targetElement),e.appendChild(r)}}.bind(this)),document.body.appendChild(e),void 0!==this._hintsAddedCallback&&this._hintsAddedCallback.call(this)}function H(t,e,n){var i=V.call(this,n);switch(t){default:case"top-left":e.style.left=i.left+"px",e.style.top=i.top+"px";break;case"top-right":e.style.left=i.left+i.width-20+"px",e.style.top=i.top+"px";break;case"bottom-left":e.style.left=i.left+"px",e.style.top=i.top+i.height-20+"px";break;case"bottom-right":e.style.left=i.left+i.width-20+"px",e.style.top=i.top+i.height-20+"px";break;case"middle-left":e.style.left=i.left+"px",e.style.top=i.top+(i.height-20)/2+"px";break;case"middle-right":e.style.left=i.left+i.width-20+"px",e.style.top=i.top+(i.height-20)/2+"px";break;case"middle-middle":e.style.left=i.left+(i.width-20)/2+"px",e.style.top=i.top+(i.height-20)/2+"px";break;case"bottom-middle":e.style.left=i.left+(i.width-20)/2+"px",e.style.top=i.top+i.height-20+"px";break;case"top-middle":e.style.left=i.left+(i.width-20)/2+"px",e.style.top=i.top+"px"}}function z(t){var e=document.querySelector('.introjs-hint[data-step="'+t+'"]'),n=this._introItems[t];void 0!==this._hintClickCallback&&this._hintClickCallback.call(this,e,n,t);var i=O.call(this);if(parseInt(i,10)!==t){var r=document.createElement("div"),o=document.createElement("div"),s=document.createElement("div"),a=document.createElement("div");r.className="introjs-tooltip",r.onclick=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},o.className="introjs-tooltiptext";var c=document.createElement("p");c.innerHTML=n.hint;var l=document.createElement("a");l.className=this._options.buttonClass,l.setAttribute("role","button"),l.innerHTML=this._options.hintButtonLabel,l.onclick=K.bind(this,t),o.appendChild(c),o.appendChild(l),s.className="introjs-arrow",r.appendChild(s),r.appendChild(o),this._currentStep=e.getAttribute("data-step"),a.className="introjs-tooltipReferenceLayer introjs-hintReference",a.setAttribute("data-step",e.getAttribute("data-step")),g.call(this,a),a.appendChild(r),document.body.appendChild(a),h.call(this,e,r,s,null,!0)}}function V(t){var e=document.body,n=document.documentElement,i=window.pageYOffset||n.scrollTop||e.scrollTop,r=window.pageXOffset||n.scrollLeft||e.scrollLeft,o=t.getBoundingClientRect();return{top:o.top+i,width:o.width,height:o.height,left:o.left+r}}function G(t){var e=window.getComputedStyle(t),n="absolute"===e.position,i=/(auto|scroll)/;if("fixed"===e.position)return document.body;for(var r=t;r=r.parentElement;)if(e=window.getComputedStyle(r),(!n||"static"!==e.position)&&i.test(e.overflow+e.overflowY+e.overflowX))return r;return document.body}function W(t,e){t.scrollTop=e.offsetTop-t.offsetTop}function Y(){return parseInt(this._currentStep+1,10)/this._introItems.length*100}var Q=function(e){var n;if("object"==typeof e)n=new t(e);else if("string"==typeof e){var i=document.querySelector(e);if(!i)throw new Error("There is no element with given selector.");n=new t(i)}else n=new t(document.body);return Q.instances[A(n,"introjs-instance")]=n,n};return Q.version="2.9.3",Q.instances={},Q.fn=t.prototype={clone:function(){return new t(this)},setOption:function(t,e){return this._options[t]=e,this},setOptions:function(t){return this._options=function(t,e){var n,i={};for(n in t)i[n]=t[n];for(n in e)i[n]=e[n];return i}(this._options,t),this},start:function(t){return e.call(this,this._targetElement,t),this},goToStep:function(t){return o.call(this,t),this},addStep:function(t){return this._options.steps||(this._options.steps=[]),this._options.steps.push(t),this},addSteps:function(t){if(t.length){for(var e=0;e<t.length;e++)this.addStep(t[e]);return this}},goToStepNumber:function(t){return s.call(this,t),this},nextStep:function(){return a.call(this),this},previousStep:function(){return c.call(this),this},exit:function(t){return u.call(this,this._targetElement,t),this},refresh:function(){return l.call(this),this},onbeforechange:function(t){if("function"!=typeof t)throw new Error("Provided callback for onbeforechange was not a function");return this._introBeforeChangeCallback=t,this},onchange:function(t){if("function"!=typeof t)throw new Error("Provided callback for onchange was not a function.");return this._introChangeCallback=t,this},onafterchange:function(t){if("function"!=typeof t)throw new Error("Provided callback for onafterchange was not a function");return this._introAfterChangeCallback=t,this},oncomplete:function(t){if("function"!=typeof t)throw new Error("Provided callback for oncomplete was not a function.");return this._introCompleteCallback=t,this},onhintsadded:function(t){if("function"!=typeof t)throw new Error("Provided callback for onhintsadded was not a function.");return this._hintsAddedCallback=t,this},onhintclick:function(t){if("function"!=typeof t)throw new Error("Provided callback for onhintclick was not a function.");return this._hintClickCallback=t,this},onhintclose:function(t){if("function"!=typeof t)throw new Error("Provided callback for onhintclose was not a function.");return this._hintCloseCallback=t,this},onexit:function(t){if("function"!=typeof t)throw new Error("Provided callback for onexit was not a function.");return this._introExitCallback=t,this},onskip:function(t){if("function"!=typeof t)throw new Error("Provided callback for onskip was not a function.");return this._introSkipCallback=t,this},onbeforeexit:function(t){if("function"!=typeof t)throw new Error("Provided callback for onbeforeexit was not a function.");return this._introBeforeExitCallback=t,this},addHints:function(){return R.call(this,this._targetElement),this},hideHint:function(t){return K.call(this,t),this},hideHints:function(){return M.call(this),this},showHint:function(t){return D.call(this,t),this},showHints:function(){return q.call(this),this},removeHints:function(){return U.call(this),this},removeHint:function(t){return B.call(this,t),this},showHintDialog:function(t){return z.call(this,t),this}},Q})),n("tour/tours",["lib/intro","vc","hint","menu","vc/doc","vc/docgroup"],(function(t,e,n,i,r,o){const s=KorAP.Locale;s.TOUR_lskip=s.TOUR_lskip||"Abort",s.TOUR_lprev=s.TOUR_lprev||"Back",s.TOUR_lnext=s.TOUR_lnext||"Next",s.TOUR_ldone=s.TOUR_ldone||"Done",s.TOUR_ldoneSearch=s.TOUR_ldoneSearch||"Search",s.TOUR_welc=s.TOUR_welc||"<span class='tgreeting'> Welcome to our guided tour!</span><p class='pfirstStep'> This tour should give you a quick introduction to KorAP. We lead you step by step through an example. </p>",s.TOUR_sear1=s.TOUR_sear1||"Input field for the query, for example the search for '"+s.TOUR_Qexample+"'.",s.TOUR_searAnnot=s.TOUR_searAnnot||"Annotation helper",s.TOUR_annotAss=s.TOUR_annotAss||"The assistant displays the annotations of the different layers and helps to formulate queries.",s.TOUR_vccho1=s.TOUR_vccho1||"Choose corpus",s.TOUR_vccho2=s.TOUR_vccho2||"Define your corpus here.",s.TOUR_vcStat1=s.TOUR_vcStat1||"Click here to display corpus statistic.",s.TOUR_vcStat2=s.TOUR_vcStat2||"Corpus statistic",s.TOUR_qlfield=s.TOUR_qlfield||"Selection of the query language: You can use KorAP with different query languages.",s.TOUR_help=s.TOUR_help||"Help and information about KorAP.",s.TOUR_glimpse=s.TOUR_glimpse||"Select this to show only the first hits in undefined order.",s.TOUR_seargo=s.TOUR_seargo||"Start the search",s.TOUR_kwic=s.TOUR_kwic||"KWIC result (keyword in context)",s.TOUR_snippet=s.TOUR_snippet||"Click on a match to show a larger snippet.",s.TOUR_snippetb=s.TOUR_snippetb||"Snippet",s.TOUR_metadatab=s.TOUR_metadatab||"Display of metadata",s.TOUR_metadata=s.TOUR_metadata||"Metadata",s.TOUR_tokenb=s.TOUR_tokenb||"Display of token annotations",s.TOUR_token=s.TOUR_token||"KorAP supports multiple annotations.",s.TOUR_treeb=s.TOUR_treeb||"Display further annotations",s.TOUR_tree=s.TOUR_tree||"Further annotations can be displayed as tree and arch views.",s.TOUR_tourdone=s.TOUR_tourdone||"Have fun with KorAP!";let a={skipLabel:s.TOUR_lskip,prevLabel:s.TOUR_lprev,nextLabel:s.TOUR_lnext,doneLabel:s.TOUR_ldone,showStepNumbers:!1},c={showBullets:!1,overlayOpacity:.7,exitOnOverlayClick:!1,disableInteraction:!0,hideNext:!0,hidePrev:!0};var l=document;return{gTstartSearch:function(e){let n=t();n.setOptions(a),n.setOption("tooltipClass","gTstartSearch"),n.setOption("doneLabel",s.TOUR_ldoneSearch),n.setOptions(c),e&&(l=e),l.querySelector("#q-field").value="";let i=[{intro:s.TOUR_welc},{element:"#q-field",intro:s.TOUR_sear1,position:"bottom"},{element:"#hint",intro:s.TOUR_searAnnot,position:"bottom"},{element:l.querySelector("#hint > .menu.hint"),intro:s.TOUR_annotAss,position:"bottom"},{element:"#vc-choose",intro:s.TOUR_vccho1,position:"bottom"},{element:"#vc-view",intro:s.TOUR_vccho2,position:"bottom"},{element:l.querySelector(".statistic"),intro:s.TOUR_vcStat1,position:"left"},{element:l.querySelector(".stattable"),intro:s.TOUR_vcStat2,position:"bottom"},{element:l.querySelector("#ql-field").parentNode,intro:s.TOUR_qlfield,position:"bottom"},{element:"#glimpse",intro:s.TOUR_glimpse,position:"bottom"},{element:"#view-tutorial",intro:s.TOUR_help,position:"bottom"},{element:"#qsubmit",intro:s.TOUR_seargo,position:"bottom"}];return n.setOptions({steps:i}),this.testPrerequ(i,n),n.onbeforechange((function(t){switch(t.id){case"q-field":t.value=s.TOUR_Qexample;break;case"vc-view":vchoo=l.querySelector("#vc-choose"),vcv=l.querySelector("#vc-view"),KorAP._delete.apply(KorAP.vc.root()),KorAP.vc.fromJson(s.TOUR_vcQuery),vcv.querySelector(".active")||(vchoo.click(),n._introItems[6].element=l.querySelector(".statistic"),n._introItems[6].position="left")}if(7==this._currentStep){l.querySelector(".statistic").click(),n._introItems[7].element=l.querySelector(".stattable"),n._introItems[7].position="bottom"}})),n.onbeforeexit((function(){KorAP.Hint.active()&&KorAP.Hint.active().dontHide&&KorAP.Hint.unshow()})),n.onchange((function(t){switch(this._currentStep){case 2:KorAP.Hint.active()&&KorAP.Hint.unshow();break;case 3:KorAP.Hint.show(!1),KorAP.Hint.active().dontHide=!0,n._introItems[3].element=l.querySelector(".menu.roll.hint"),n._introItems[3].position=l.querySelector("bottom");break;case 4:KorAP.Hint.unshow()}})),n.oncomplete((function(){KorAP.session.set("tour",!0),l.getElementById("qsubmit").click()})),n},gTshowResults:function(e){let n=t();n.setOptions(c),e&&(l=e);let i=[{element:"#search",intro:s.TOUR_kwic,position:"auto"},{element:l.querySelector("#search > ol > li"),intro:s.TOUR_snippet,position:"bottom"},{element:l.querySelector("#search > ol > li"),intro:s.TOUR_snippetb,position:"bottom"},{element:l.querySelector(".action > .metatable"),intro:s.TOUR_metadatab,position:"bottom"},{element:l.querySelector(".view.metatable"),intro:s.TOUR_metadata,position:"auto"},{element:l.querySelector(".action > .info"),intro:s.TOUR_tokenb,position:"bottom"},{element:l.querySelector(".view.tokentable"),intro:s.TOUR_token,position:"auto"},{element:l.querySelector(".tree"),intro:s.TOUR_treeb,position:"bottom"},{element:l.querySelector(".view.relations"),intro:s.TOUR_tree,position:"bottom"},{intro:s.TOUR_tourdone}];return n.setOptions({steps:i}),n.setOptions(a),n.onbeforeexit((function(){KorAP.session.set("tour",!1)})),n.setOption("scrollToElement",!0),n.setOption("scrollTo","tooltip"),this.testPrerequ(i,n),n.onbeforechange((function(t){if(1==this._currentStep&&KorAP.session.set("tour",!1),2==this._currentStep&&(l.querySelector("#search > ol > li").click(),n._introItems[3].element=l.querySelector(".action > .metatable"),n._introItems[3].position="bottom"),4==this._currentStep&&(l.querySelector(".metatable").click(),n._introItems[4].element=l.querySelector(".view.metatable"),n._introItems[5].element=l.querySelector(".action > .info"),n._introItems[5].position="bottom"),6==this._currentStep&&(l.querySelector(".info").click(),n._introItems[6].element=l.querySelector(".view.tokentable"),n._introItems[7].element=l.querySelector(".tree"),n._introItems[7].position="bottom"),8==this._currentStep){l.querySelector(".tree").click();let t=document.querySelectorAll(".button-group-list")[0].querySelectorAll("li");for(let e=0;e<t.length;e++)if(t[e].innerText==s.TOUR_Relations){t[e].click();break}n._introItems[8].element=l.querySelector(".view.relations")}})),n},testPrerequ:function(t,e){let n=t,i=e;i.stepCount=n.length,i.testIntros=[];for(let t=0;t<n.length;t++)i.testIntros.push(n[t].intro)}}})),n("plugin/service",[],(function(){let t={scripts:1,presentation:1,forms:1,"downloads-without-user-activation":1,downloads:1};return{create:function(t){return Object.create(this)._init(t)},_init:function(e){if(!(e&&e.name&&e.src&&e.id))throw Error("Service not well defined");this.name=e.name,this.src=e.src,this.id=e.id,this.desc=e.desc;let n=new Set,i=e.permissions;return i&&Array.isArray(i)&&i.forEach((function(e){e in t?n.add(e):KorAP.log(0,"Requested permission not allowed")})),this._perm=n,this.close||(this.close=function(){this._closeIframe()}),this},load:function(){if(this._load)return this._load;if("https:"==window.location.protocol&&0!=this.src.toLowerCase().indexOf("https:"))return void KorAP.log(0,"Service endpoint is insecure");let t=document.createElement("iframe");return t.setAttribute("allowTransparency","true"),t.setAttribute("frameborder",0),t.setAttribute("sandbox",Array.from(this._perm).sort().map((function(t){return"allow-"+t})).join(" ")),t.style.height="0px",t.setAttribute("name",this.id),t.setAttribute("src",this.src),this._load=t,t},sendMsg:function(t){this.load().contentWindow.postMessage(t,"*")},_closeIframe:function(){var t=this._load;t&&t.parentNode&&t.parentNode.removeChild(t),this._load=null}}})),n("plugin/widget",["view","plugin/service","util"],(function(t,e){return{create:function(n){return Object.create(t)._init(["widget"]).upgradeTo(e)._init(n).upgradeTo(this)._init()},_init:function(){return this.isWidget=!0,this},show:function(){if(this._load)return this._el&&this._el.classList.add("show"),this._load;let t=this.load();return this._load.classList.add("widget","show"),t.setAttribute("loading","lazy"),this.actions.add(this.name,{cls:["button-icon","plugin"]},function(t){let e=this.name;void 0!==this.desc&&(e+="\n\n"+this.desc),window.alert(e)}.bind(this)),t},resize:function(t){this.show().style.height=t.height+"px"},onClose:function(){this._mgr&&(this._mgr._closeService(this.id),this._mgr=void 0)}}})),n("state",[],(function(){return{create:function(t){return Object.create(this)._init(t)},_init:function(t){const e=this;return e._assoc=[],null==t?e.values=[!1,!0]:Array.isArray(t)?e.values=t:e.values=[t],e.value=e.values[0],e},associate:function(t){t.hasOwnProperty("setState")?(this._assoc.push(t),t.setState(this.value)):console.log("Object "+t+" has no setState() method")},set:function(t){t!=this.value&&(this.value=t,this._assoc.forEach(e=>e.setState(t)))},get:function(){return this.value},associates:function(){return this._assoc.length},clear:function(){return this._assoc=[]},roll:function(){let t=0;for(let e=0;e<this.values.length-1;e++)if(this.value==this.values[e]){t=e+1;break}this.set(this.values[t])}}})),n("plugin/server",["plugin/widget","plugin/service","state","util"],(function(t,e,n){KorAP.Panel=KorAP.Panel||{};var i={},r={},o={match:[]},s={query:[],result:[]},a={};return{create:function(){return Object.create(this)._init()},_init:function(){return this},register:function(t){var e=t.name;if(!e)throw new Error("Missing name of plugin");var a=t.desc,c=r[e]={name:e,desc:a,about:t.about,widgets:[],services:[]};if("object"!=typeof t.embed)throw new Error("Embedding of plugin is no list");var l=this;t.embed.forEach((function(t){if("object"!=typeof t)throw new Error("Embedding of plugin is no object");let r=t.title,u=t.panel,h=t.onClick,d=t.icon;if(!u||!o[u]&&!s[u])throw new Error("Panel for plugin is invalid");if(h.action&&"addWidget"!=h.action&&"setWidget"!=h.action){if("toggle"==h.action){let t=n.create([!0,!1]);KorAP.Panel[u].actions.addToggle(r,{cls:["title"]},t);let o=this.addService({name:e,src:h.template,permissions:h.permissions}),s=i[o];s.load().onload=function(){let e={setState:function(t){s.sendMsg({action:"state",key:h.state,value:t})}};t.associate(e)},c.services.push(o)}}else{let f=function(t){if("state"in this.button&&this.button.state.associates()>0){let t=this.button.state;if(i[this.button.widgetID])return void t.roll();t.clear(),t.set(!0)}let n=l.addWidget(this,{name:e,src:h.template,permissions:h.permissions,desc:a});c.widgets.push(n),"state"in this.button&&(this.button.widgetID=n,this.button.state.associate({setState:function(t){0==t?i[n].minimize():i[n].show()}}))},p={cls:t.classes,icon:d};h.action&&"setWidget"==h.action&&(p.state=n.create([!0,!1])),o[u]?o[u].push([r,p,f]):KorAP.Panel[u]?KorAP.Panel[u].actions.add(r,p,f):s[u].push([r,p,f])}}),this)},_interpolateURI:function(t,e){},buttonGroup:function(t){return null!=o[t]?o[t]:null!=s[t]?s[t]:[]},clearButtonGroup:function(t){null!=o[t]?o[t]=[]:null!=s[t]&&(s[t]=[])},_getServiceID:function(){return this._listener||(this._listener=this._receiveMsg.bind(this),window.addEventListener("message",this._listener),this._timer=window.setInterval((function(){for(let t=0;t<a.length;t++)a[t]++>=100&&(a[t]=100)}),1e3)),"id-"+this._randomID()},addService:function(t){if(!t.src)return;let n=this._getServiceID();t.id=n;let r=e.create(t);return i[n]=r,a[n]=100,this.element().appendChild(r.load()),n},addWidget:function(e,n){let r=this._getServiceID();n.id=r;var o=t.create(n);return i[r]=o,a[r]=100,o._mgr=this,e.add(o),r},service:function(t){return i[t]},_receiveMsg:function(t){var e=t.data;if(!e)return;var n=e.originID;if(!n)return;let r=i[n];if(r){if(a[n]--<0)return KorAP.log(0,"Suspicious action by service",r.src),this._closeService(r.id),void r.close();switch(e.action){case"resize":r.isWidget&&r.resize(e);break;case"log":KorAP.log(e.code,e.msg,r.src);break;case"pipe":null!=KorAP.Pipe&&("del"==e.job?KorAP.Pipe.remove(e.service):KorAP.Pipe.append(e.service));break;case"get":if("KQ"==e.key)void 0!==KorAP.koralQuery&&(e.value=KorAP.koralQuery);else if("QueryForm"==e.key){let t=document,n=e.value={};var o;(o=t.getElementById("q-field"))&&(n.q=o.value),(o=t.getElementById("ql-field"))&&(n.ql=o.value),(o=KorAP.vc)&&(n.cq=o.toQuery())}else if("QueryParam"==e.key){var s=new URLSearchParams(window.location.search);let t=e.value={};t.q=s.get("q"),t.ql=s.get("ql"),t.cq=s.get("cq")}}e._id&&r.sendMsg(e)}},_closeService:function(t){delete a[t],i[t]&&i[t]._closeIframe&&(i[t]._closeIframe(),delete i[t]),0==Object.keys(a).length&&this._removeListener()},_randomID:function(){return function(t){const e=new Uint8Array((t||40)/2);return window.crypto.getRandomValues(e),Array.from(e,f).join("")}(20)},_removeListener:function(){window.clearInterval(this._timer),this._timer=void 0,window.removeEventListener("message",this._listener),this._listener=void 0},element:function(){return this._el||(this._el=document.createElement("div"),this._el.setAttribute("id","services")),this._el},destroy:function(){if(a={},Object.keys(i).forEach(t=>i[t].close()),i={},Object.keys(o).forEach(t=>o[t]=[]),Object.keys(s).forEach(t=>s[t]=[]),this._el){let t=this._el;t.parentNode&&t.parentNode.removeChild(t),this._el=null}this._removeListener()}}})),n("pipe",[],(function(){const t=new RegExp("[a-zA-Z0-9]");function e(e){return(e=e.trim()).match(t)?e:null}return{create:function(){const t=Object.create(this);return t._pipe=[],t},append:function(t){(t=e(t))&&(this._pipe.push(t),this._update())},prepend:function(t){(t=e(t))&&(this._pipe.unshift(t),this._update())},remove:function(t){const e=this._pipe.indexOf(t);-1!=e&&(this._pipe.splice(e,1),this._update())},size:function(){return this._pipe.length},toString:function(){return this._pipe.join(",")},_update:function(){null!=this.e&&this.e.setAttribute("value",this.toString())},element:function(){let t=this.e;return null==t&&(t=this.e=document.createElement("input"),t.setAttribute("type","text"),t.setAttribute("name","pipe"),t.classList.add("pipe")),t}}})),n("api",["util"],(function(){KorAP.URL=void 0!==KorAP.URL?KorAP.URL:"",KorAP.API=KorAP.API||{};const t=new RegExp("^([^_]+)_([^\\.]+)\\.(.+?)$");KorAP.API.getMatchInfo=function(e,n,i){let r=KorAP.URL+"/corpus";const o=t.exec(e.textSigle);let s="";s=null!==o&&o[0]?o[1]+"/"+o[2]+"/"+o[3]:e.textSigle,s+="/"+e.matchID,r+="/"+s,1==n.spans?(r+="?spans=true",s+=" +spans ",void 0!==n.foundry&&(r+="&foundry="+n.foundry,s+=n.foundry),void 0!==n.layer&&(r+="&layer="+n.layer,s+="/"+n.layer)):(s+=" -spans",r+="?spans=false"),KorAP.API.getJSON(r,i,"MatchInfo: "+s)},KorAP.API.getTextInfo=function(t,e,n){let i=KorAP.URL+"/corpus/"+t.textSigle;void 0!==e.fields?i+="?fields=":i+="?fields=@all",KorAP.API.getJSON(i,n,"TextInfo: "+t.textSigle)},KorAP.API.getCollections=function(t){KorAP.API.getJSON(KorAP.URL+"/collection",t,"CorpusInfo")},KorAP.API.getCorpStat=function(t,e){let n=KorAP.URL+"/corpus?cq="+encodeURIComponent(t);KorAP.API.getJSON(n,e,"CorpusInfo: "+t)},KorAP.API.getPluginList=function(t,e){KorAP.API.getJSON(t,e,"Plugin-List")},KorAP.API.getJSON=function(t,e,n){const i=new XMLHttpRequest;i.open("GET",t,!0);const r=new CustomEvent("korapRequest",{bubbles:!1,detail:{url:t,title:n}});window.dispatchEvent(r),i.setRequestHeader("Accept","application/json"),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.onreadystatechange=function(){if(4==this.readyState){let t;try{t=JSON.parse(this.responseText)}catch(t){return KorAP.log(0,t),console.log(t),void e(void 0)}void 0!==t&&void 0!==t.errors?t.errors.forEach(t=>KorAP.log(t[0],t[1]||"Unknown")):200!==this.status&&KorAP.log(this.status,this.statusText),200===this.status?e(t):e(void 0)}},i.ontimeout=function(){KorAP.log(0,"Request Timeout")},i.send()}})),n("mailToChiffre",[],(function(){window.PArok=function(t,e){e&&((t=document.createElement("a")).href=e);var n,r=t.search,o=RegExp,c=String.fromCharCode,l=[];Math.pow;for(k=t.pathname.match(/([^\/]+)\/([^\/]+)$/),a=function(t){for(var e,r,o=0,a="";o<t.length;)if((r=t.charAt(o++)).match(/[A-Za-z]/))a+=c((r<="Z"?90:122)>=(r=r.charCodeAt(0)+13)?r:r-26);else{if("-"!=r)return;for(e="",r=t.charAt(o++);r.match(/\d/);)e+=r,r=t.charAt(o++);o--,a+=c(parseInt(e))}for(s=a.length,u=Math.abs(673%s-s),a=a.substr(u)+a.substr(0,u),n="",i=0;i<s;i++)n+=c(a.charCodeAt(i)^k[1].charCodeAt(k[1].length%(i+1)));return n};r;)r=r.replace(/^[\?\&]([^\&]+)/,""),(n=o.$1).match(/^(sid|b?cc|to)=(.+)$/)?"sid"==o.$1?l.push("to="+a(o.$2)+"@"+a(k[2])):l.push(o.$1+"="+a(o.$2)):l.push(n.replace(/\+/g," "));return location.href="mailto:?"+l.join("&"),!1}})),n("init",["match","hint","vc","tutorial","lib/domReady","vc/array","lib/alertify","session","selectMenu","panel/result","panel/query","tour/tours","plugin/server","pipe","api","mailToChiffre","util","state"],(function(t,e,n,i,r,o,s,a,c,l,u,h,f,p){const m=document;KorAP.URL=m.body.getAttribute("data-korap-url")||"";const g=m.getElementById("koralQuery");null!==g&&(KorAP.koralQuery=JSON.parse(g.getAttribute("data-koralquery")||"")),KorAP.session=a.create(KorAP.URL.length>0?"kalamarJS-"+KorAP.URL.slugify():"kalamarJS"),window.alertify=s,KorAP.log=function(t,e,n){n&&(e+='<code class="src">'+n+"</code>"),s.log((0===t?"":t+": ")+e,"error",1e4)},KorAP.vc=n.create(o),KorAP.tourshow=function(){h.gTstartSearch().start()},KorAP.tourshowR=function(){h.gTshowResults().start()},r((function(n){var r,o,a={},g=KorAP.session.get("show")||{};KorAP.Panel=KorAP.Panel||{},m.querySelectorAll("#notifications div.notify").forEach((function(t){let e=t.textContent,n=t.getAttribute("data-src");n&&(e+='<code class="src">'+n+"</code>");let i=t.getAttribute("data-type")||"error";s.log(e,i,1e4)}));var _=m.getElementById("cq"),v=KorAP.vc;if(_){if(_.style.display="none",(r=m.createElement("span")).setAttribute("id","vc-choose"),r.classList.add("select"),void 0!==KorAP.koralQuery&&(KorAP.koralQuery.collection||KorAP.koralQuery.corpus))try{v.fromJson(KorAP.koralQuery.collection||KorAP.koralQuery.corpus)}catch(t){KorAP.log(0,t)}(o=r.addE("span")).addT(v.getName()),v.wasRewritten()&&o.classList.add("rewritten"),_.parentNode.insertBefore(r,_)}var y=m.querySelectorAll("#search > ol > li");y.forEach((function(e){e.classList.contains("active")?void 0===this._match&&t.create(e).init():(e.addEventListener("click",(function(e){void 0!==this._match?this._match.open():t.create(this).open()})),e.addEventListener("keydown",(function(e){switch(d(e)){case 32:void 0!==this._match?this._match.toggle():t.create(this).open(),e.halt()}})))}),this);var b=m.getElementsByTagName("aside")[0];if(b&&0==b.classList.contains("active")){var w=!1;b.addEventListener("focus",(function(t){this.classList.add("active")}));var E=m.getElementsByTagName("body")[0];null!==E&&E.addEventListener("click",(function(){w?w=!1:b.classList.remove("active")})),b.addEventListener("click",(function(t){w=!0}))}null!==m.getElementById("ql-field")&&(KorAP.QLmenu=c.create(m.getElementById("ql-field").parentNode).limit(5));var k=m.getElementById("resultinfo"),A=l.create(g);if(null!=k){k.appendChild(A.actions.element());var x=m.getElementById("search");x.insertBefore(A.element(),x.firstChild)}if(void 0!==KorAP.koralQuery&&(null!==k&&A.addKqAction(),KorAP.koralQuery.errors&&KorAP.koralQuery.errors.forEach((function(t){302===t[0]&&void 0!==t[2]?(a.hint=e.create(),a.hint.alert(t[2],t[1])):301===t[0]&&(a.hint=e.create(),a.hint.alert(0,t[1]))}))),y.length>0&&A.addAlignAction(),KorAP.Panel.result=A,r){v.onMinimize=function(){r.classList.remove("active"),delete g.vc},v.onOpen=function(){r.classList.add("active");var t=m.getElementById("vc-view");t.firstChild||t.appendChild(this.element()),g.vc=!0};var C=function(){v.isOpen()?v.minimize():v.open()};r.onclick=C,g.vc&&C.apply()}m.getElementById("view-tutorial")?(window.tutorial=i.create(m.getElementById("view-tutorial"),KorAP.session),a.tutorial=window.tutorial):window.parent&&(a.tutorial=window.parent.tutorial),a.tutorial&&(a.tutorial.initQueries(m),a.tutorial.initDocLinks(m));var T=m.getElementById("searchform");null!==T&&T.addEventListener("submit",(function(t){var e=m.getElementById("q-field");if(void 0===e.value||""===e.value)return e.focus(),t.halt(),void KorAP.log(700,"No query given");KorAP.session.set("show",g),void 0!==v?(_.value=v.toQuery(),""==_.value&&_.removeAttribute("name")):(_.removeAttribute("value"),_.removeAttribute("name")),e.classList.add("loading"),m.getElementById("qsubmit").classList.add("loading")})),KorAP.session.get("tour")&&h.gTshowResults().start(),void 0===a.hint&&(a.hint=e.create()),KorAP.Hint=a.hint;var L=u.create(),N=m.getElementById("searchform"),S=m.getElementById("vc-view");let P;if(N&&S&&(N.insertBefore(L.element(),S),KorAP.Panel.query=L),P=m.getElementById("kalamar-plugins")){let t=P.getAttribute("data-plugins");void 0!==t&&KorAP.API.getPluginList(t,(function(t){if(t&&t.length>0){KorAP.Plugin=f.create(),m.head.appendChild(KorAP.Plugin.element()),KorAP.Pipe=p.create(),m.getElementById("searchform").appendChild(KorAP.Pipe.element());try{t.forEach(t=>KorAP.Plugin.register(t))}catch(t){KorAP.log(0,t)}}}))}return a}))})),window.KorAP=window.KorAP||{},KorAP.Locale=KorAP.Locale||{},e(["loc/dereko","loc/de","init"]),n("app/de",(function(){}))}();
\ No newline at end of file