@hpcc-js/phosphor 2.14.59 → 2.14.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],e):e((t=t||self)["@hpcc-js/phosphor"]={},t["@hpcc-js/common"])}(this,function(t,e){"use strict";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function r(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&n.path)}},n.exports),n.exports}var o=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(o);o.ArrayExt;var a=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i});i(a);a.iter,a.each,a.every,a.some,a.toArray,a.ArrayIterator;var s=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(a.iter(t.map(a.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(s);s.chain,s.ChainIterator;var u=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(u);u.empty,u.EmptyIterator;var c=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(a.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i(c);c.filter,c.FilterIterator;var h=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=a.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.min=function(t,e){var n=a.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=a.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=a.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(h);h.find,h.min,h.max,h.minmax;var d=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(a.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(d);d.map,d.MapIterator;var l=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(l);l.range,l.RangeIterator;var p=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=a.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var s,u,c=r.next();if(void 0===c&&void 0===n)return o;if(void 0===c)return e(n,o,i++);for(s=e(void 0===n?o:e(n,o,i++),c,i++);void 0!==(u=r.next());)s=e(s,u,i++);return s}});i(p);p.reduce;var f=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(f);f.repeat,f.once,f.RepeatIterator;var v=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(v);v.retro,v.RetroArrayIterator;var m=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return a.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(m);m.topologicSort;var _=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(a.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(_);_.stride,_.StrideIterator;var g=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i}}(e.StringExt||(e.StringExt={}))});i(g);g.StringExt;var y=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(a.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(y);y.take,y.TakeIterator;var b=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(a.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(b);b.zip,b.ZipIterator;var x=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(o),n(s),n(u),n(c),n(h),n(a),n(d),n(l),n(p),n(f),n(v),n(m),n(_),n(g),n(y),n(b)}),M=i(x),w=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function n(t){return Array.isArray(t)}function i(t,r){if(t===r)return!0;if(e(t)||e(r))return!1;var o=n(t),a=n(r);return o===a&&(o&&a?function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;++n)if(!i(t[n],e[n]))return!1;return!0}(t,r):function(t,e){if(t===e)return!0;for(var n in t)if(!(n in e))return!1;for(var n in e)if(!(n in t))return!1;for(var n in t)if(!i(t[n],e[n]))return!1;return!0}(t,r))}function r(t){return e(t)?t:n(t)?function(t){for(var e=new Array(t.length),n=0,i=t.length;n<i;++n)e[n]=r(t[n]);return e}(t):function(t){var e={};for(var n in t)e[n]=r(t[n]);return e}(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=function(t){return!e(t)&&!n(t)},t.deepEqual=i,t.deepCopy=r}(e.JSONExt||(e.JSONExt={}))});i(w);w.JSONExt;var P=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this._types=[],this._values=[]}return t.prototype.types=function(){return this._types.slice()},t.prototype.hasData=function(t){return-1!==this._types.indexOf(t)},t.prototype.getData=function(t){var e=this._types.indexOf(t);return-1!==e?this._values[e]:void 0},t.prototype.setData=function(t,e){this.clearData(t),this._types.push(t),this._values.push(e)},t.prototype.clearData=function(t){var e=this._types.indexOf(t);-1!==e&&(this._types.splice(e,1),this._values.splice(e,1))},t.prototype.clear=function(){this._types.length=0,this._values.length=0},t}();e.MimeData=n});i(P);P.MimeData;var I=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){var t=this;this.promise=new Promise(function(e,n){t._resolve=e,t._reject=n})}return t.prototype.resolve=function(t){(0,this._resolve)(t)},t.prototype.reject=function(t){(0,this._reject)(t)},t}();e.PromiseDelegate=n});i(I);I.PromiseDelegate;var A=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e;t.getRandomValues=(e="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null)&&"function"==typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:e&&"function"==typeof e.randomFillSync?function(t){return e.randomFillSync(t)}:e&&"function"==typeof e.randomBytes?function(t){for(var n=e.randomBytes(t.length),i=0,r=n.length;i<r;++i)t[i]=n[i]}:function(t){for(var e=0,n=0,i=t.length;n<i;++n)n%4==0&&(e=4294967295*Math.random()>>>0),t[n]=255&e,e>>>=8}}(e.Random||(e.Random={}))});i(A);A.Random;var E=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(t){this.name=t,this._tokenStructuralPropertyT=null}}();e.Token=n});i(E);E.Token;var S=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.uuid4=function(){for(var t=new Uint8Array(16),e=new Array(256),n=0;n<16;++n)e[n]="0"+n.toString(16);for(n=16;n<256;++n)e[n]=n.toString(16);return function(){return A.Random.getRandomValues(t),t[6]=64|15&t[6],t[8]=128|63&t[8],e[t[0]]+e[t[1]]+e[t[2]]+e[t[3]]+"-"+e[t[4]]+e[t[5]]+"-"+e[t[6]]+e[t[7]]+"-"+e[t[8]]+e[t[9]]+"-"+e[t[10]]+e[t[11]]+e[t[12]]+e[t[13]]+e[t[14]]+e[t[15]]}}()}(e.UUID||(e.UUID={}))});i(S);S.UUID;var O=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(w),n(P),n(I),n(A),n(E),n(S)});i(O);var C=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(var i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e){void 0===e&&(e={});var n=e.start,i=e.stop,r=e.step;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");var o,a=t.length;void 0===n?n=r<0?a-1:0:n<0?n=Math.max(n+a,r<0?-1:0):n>=a&&(n=r<0?a-1:a),void 0===i?i=r<0?-1:a:i<0?i=Math.max(i+a,r<0?-1:0):i>=a&&(i=r<0?a-1:a),o=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);for(var s=[],u=0;u<o;++u)s[u]=t[n+u*r];return s},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(C);C.ArrayExt;var L=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.iterKeys=function(t){return new r(t)},e.iterValues=function(t){return new o(t)},e.iterItems=function(t){return new a(t)},e.iterFn=function(t){return new s(t)},e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r},e.toObject=function(t){for(var e,i=n(t),r={};void 0!==(e=i.next());)r[e[0]]=e[1];return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i;var r=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}();e.KeyIterator=r;var o=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}();e.ValueIterator=o;var a=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}();e.ItemIterator=a;var s=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();e.FnIterator=s});i(L);L.iter,L.iterKeys,L.iterValues,L.iterItems,L.iterFn,L.each,L.every,L.some,L.toArray,L.toObject,L.ArrayIterator,L.KeyIterator,L.ValueIterator,L.ItemIterator,L.FnIterator;var z=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(L.iter(t.map(L.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(z);z.chain,z.ChainIterator;var k=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(k);k.empty,k.EmptyIterator;var T=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.enumerate=function(t,e){return void 0===e&&(e=0),new n(L.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._index=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();e.EnumerateIterator=n});i(T);T.enumerate,T.EnumerateIterator;var j=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(L.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i(j);j.filter,j.FilterIterator;var D=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=L.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.findIndex=function(t,e){for(var n,i=0,r=L.iter(t);void 0!==(n=r.next());)if(e(n,i++))return i-1;return-1},e.min=function(t,e){var n=L.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=L.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=L.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(D);D.find,D.findIndex,D.min,D.max,D.minmax;var B=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(L.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(B);B.map,B.MapIterator;var R=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(R);R.range,R.RangeIterator;var W=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=L.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var a,s,u=r.next();if(void 0===u&&void 0===n)return o;if(void 0===u)return e(n,o,i++);for(a=e(void 0===n?o:e(n,o,i++),u,i++);void 0!==(s=r.next());)a=e(a,s,i++);return a}});i(W);W.reduce;var N=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(N);N.repeat,N.once,N.RepeatIterator;var F=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(F);F.retro,F.RetroArrayIterator;var H=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return L.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(H);H.topologicSort;var q=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(L.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(q);q.stride,q.StrideIterator;var V=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(e.StringExt||(e.StringExt={}))});i(V);V.StringExt;var K=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(L.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(K);K.take,K.TakeIterator;var U=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(L.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(U);U.zip,U.ZipIterator;var Y=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(C),n(z),n(k),n(T),n(j),n(D),n(L),n(B),n(R),n(W),n(N),n(F),n(H),n(q),n(V),n(K),n(U)});i(Y);var X=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(var i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e){void 0===e&&(e={});var n=e.start,i=e.stop,r=e.step;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");var o,a=t.length;void 0===n?n=r<0?a-1:0:n<0?n=Math.max(n+a,r<0?-1:0):n>=a&&(n=r<0?a-1:a),void 0===i?i=r<0?-1:a:i<0?i=Math.max(i+a,r<0?-1:0):i>=a&&(i=r<0?a-1:a),o=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);for(var s=[],u=0;u<o;++u)s[u]=t[n+u*r];return s},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(X);X.ArrayExt;var G=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.iterKeys=function(t){return new r(t)},e.iterValues=function(t){return new o(t)},e.iterItems=function(t){return new a(t)},e.iterFn=function(t){return new s(t)},e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r},e.toObject=function(t){for(var e,i=n(t),r={};void 0!==(e=i.next());)r[e[0]]=e[1];return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i;var r=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}();e.KeyIterator=r;var o=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}();e.ValueIterator=o;var a=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}();e.ItemIterator=a;var s=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();e.FnIterator=s});i(G);G.iter,G.iterKeys,G.iterValues,G.iterItems,G.iterFn,G.each,G.every,G.some,G.toArray,G.toObject,G.ArrayIterator,G.KeyIterator,G.ValueIterator,G.ItemIterator,G.FnIterator;var J=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(G.iter(t.map(G.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(J);J.chain,J.ChainIterator;var Z=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(Z);Z.empty,Z.EmptyIterator;var Q=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.enumerate=function(t,e){return void 0===e&&(e=0),new n(G.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._index=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();e.EnumerateIterator=n});i(Q);Q.enumerate,Q.EnumerateIterator;var $=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(G.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i($);$.filter,$.FilterIterator;var tt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=G.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.findIndex=function(t,e){for(var n,i=0,r=G.iter(t);void 0!==(n=r.next());)if(e(n,i++))return i-1;return-1},e.min=function(t,e){var n=G.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=G.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=G.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(tt);tt.find,tt.findIndex,tt.min,tt.max,tt.minmax;var et=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(G.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(et);et.map,et.MapIterator;var nt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(nt);nt.range,nt.RangeIterator;var it=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=G.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var a,s,u=r.next();if(void 0===u&&void 0===n)return o;if(void 0===u)return e(n,o,i++);for(a=e(void 0===n?o:e(n,o,i++),u,i++);void 0!==(s=r.next());)a=e(a,s,i++);return a}});i(it);it.reduce;var rt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(rt);rt.repeat,rt.once,rt.RepeatIterator;var ot=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(ot);ot.retro,ot.RetroArrayIterator;var at=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return G.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(at);at.topologicSort;var st=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(G.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(st);st.stride,st.StrideIterator;var ut=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(e.StringExt||(e.StringExt={}))});i(ut);ut.StringExt;var ct=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(G.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(ct);ct.take,ct.TakeIterator;var ht=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(G.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(ht);ht.zip,ht.ZipIterator;var dt=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(X),n(J),n(Z),n(Q),n($),n(tt),n(G),n(et),n(nt),n(it),n(rt),n(ot),n(at),n(st),n(ut),n(ct),n(ht)});i(dt);var lt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t){this.sender=t}return t.prototype.connect=function(t,e){return n.connect(this,t,e)},t.prototype.disconnect=function(t,e){return n.disconnect(this,t,e)},t.prototype.emit=function(t){n.emit(this,t)},t}();e.Signal=i,function(t){t.disconnectBetween=function(t,e){n.disconnectBetween(t,e)},t.disconnectSender=function(t){n.disconnectSender(t)},t.disconnectReceiver=function(t){n.disconnectReceiver(t)},t.disconnectAll=function(t){n.disconnectAll(t)},t.clearData=function(t){n.disconnectAll(t)},t.getExceptionHandler=function(){return n.exceptionHandler},t.setExceptionHandler=function(t){var e=n.exceptionHandler;return n.exceptionHandler=t,e}}(i=e.Signal||(e.Signal={})),e.Signal=i,function(t){t.exceptionHandler=function(t){console.error(t)},t.connect=function(t,i,r){r=r||void 0;var a=e.get(t.sender);if(a||(a=[],e.set(t.sender,a)),o(a,t,i,r))return!1;var s=r||i,u=n.get(s);u||(u=[],n.set(s,u));var c={signal:t,slot:i,thisArg:r};return a.push(c),u.push(c),!0},t.disconnect=function(t,i,r){r=r||void 0;var a=e.get(t.sender);if(!a||0===a.length)return!1;var u=o(a,t,i,r);if(!u)return!1;var c=r||i,h=n.get(c);return u.signal=null,s(a),s(h),!0},t.disconnectBetween=function(t,i){var r=e.get(t);if(r&&0!==r.length){var o=n.get(i);o&&0!==o.length&&(dt.each(o,function(e){e.signal&&e.signal.sender===t&&(e.signal=null)}),s(r),s(o))}},t.disconnectSender=function(t){var i=e.get(t);i&&0!==i.length&&(dt.each(i,function(t){if(t.signal){var e=t.thisArg||t.slot;t.signal=null,s(n.get(e))}}),s(i))},t.disconnectReceiver=function(t){var i=n.get(t);i&&0!==i.length&&(dt.each(i,function(t){if(t.signal){var n=t.signal.sender;t.signal=null,s(e.get(n))}}),s(i))},t.disconnectAll=function(t){var i=e.get(t);i&&i.length>0&&(dt.each(i,function(t){t.signal=null}),s(i));var r=n.get(t);r&&r.length>0&&(dt.each(r,function(t){t.signal=null}),s(r))},t.emit=function(t,n){var i=e.get(t.sender);if(i&&0!==i.length)for(var r=0,o=i.length;r<o;++r){var s=i[r];s.signal===t&&a(s,n)}};var e=new WeakMap,n=new WeakMap,i=new Set,r="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function o(t,e,n,i){return dt.find(t,function(t){return t.signal===e&&t.slot===n&&t.thisArg===i})}function a(e,n){var i=e.signal,r=e.slot,o=e.thisArg;try{r.call(o,i.sender,n)}catch(e){t.exceptionHandler(e)}}function s(t){0===i.size&&r(u),i.add(t)}function u(){i.forEach(c),i.clear()}function c(t){dt.ArrayExt.removeAllWhere(t,h)}function h(t){return null===t.signal}}(n||(n={}))});i(lt);lt.Signal;var pt=r(function(t,e){var i=n&&n.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this._fn=t}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){if(this._fn){var t=this._fn;this._fn=null,t()}},t}();e.DisposableDelegate=r;var o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._disposed=new lt.Signal(e),e}return i(e,t),Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),lt.Signal.clearData(this))},e}(r);e.ObservableDisposableDelegate=o;var a=function(){function t(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(t){t.dispose()}),this._items.clear())},t.prototype.contains=function(t){return this._items.has(t)},t.prototype.add=function(t){this._items.add(t)},t.prototype.remove=function(t){this._items.delete(t)},t.prototype.clear=function(){this._items.clear()},t}();e.DisposableSet=a,function(t){t.from=function(e){var n=new t;return Y.each(e,function(t){n.add(t)}),n}}(a=e.DisposableSet||(e.DisposableSet={})),e.DisposableSet=a;var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._disposed=new lt.Signal(e),e}return i(e,t),Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),lt.Signal.clearData(this))},e}(a);e.ObservableDisposableSet=s,function(t){t.from=function(e){var n=new t;return Y.each(e,function(t){n.add(t)}),n}}(s=e.ObservableDisposableSet||(e.ObservableDisposableSet={})),e.ObservableDisposableSet=s});i(pt);pt.DisposableDelegate,pt.ObservableDisposableDelegate,pt.DisposableSet,pt.ObservableDisposableSet;var ft=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.copyText=function(t){var e=document.body,n=function(i){i.preventDefault(),i.stopPropagation(),i.clipboardData.setData("text",t),e.removeEventListener("copy",n,!0)};e.addEventListener("copy",n,!0),document.execCommand("copy")}}(e.ClipboardExt||(e.ClipboardExt={}))});i(ft);ft.ClipboardExt;var vt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.boxSizing=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.borderTopWidth)||0,i=parseFloat(e.borderLeftWidth)||0,r=parseFloat(e.borderRightWidth)||0,o=parseFloat(e.borderBottomWidth)||0,a=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingLeft)||0,u=parseFloat(e.paddingRight)||0,c=parseFloat(e.paddingBottom)||0;return{borderTop:n,borderLeft:i,borderRight:r,borderBottom:o,paddingTop:a,paddingLeft:s,paddingRight:u,paddingBottom:c,horizontalSum:i+s+u+r,verticalSum:n+a+c+o}},t.sizeLimits=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.minWidth)||0,i=parseFloat(e.minHeight)||0,r=parseFloat(e.maxWidth)||1/0,o=parseFloat(e.maxHeight)||1/0;return{minWidth:n,minHeight:i,maxWidth:r=Math.max(n,r),maxHeight:o=Math.max(i,o)}},t.hitTest=function(t,e,n){var i=t.getBoundingClientRect();return e>=i.left&&e<i.right&&n>=i.top&&n<i.bottom},t.scrollIntoViewIfNeeded=function(t,e){var n=t.getBoundingClientRect(),i=e.getBoundingClientRect();i.top<=n.top&&i.bottom>=n.bottom||(i.top<n.top&&i.height<=n.height?t.scrollTop-=n.top-i.top:i.bottom>n.bottom&&i.height>=n.height?t.scrollTop-=n.top-i.top:i.top<n.top&&i.height>n.height?t.scrollTop-=n.bottom-i.bottom:i.bottom>n.bottom&&i.height<n.height&&(t.scrollTop-=n.bottom-i.bottom))}}(e.ElementExt||(e.ElementExt={}))});i(vt);vt.ElementExt;var mt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.IS_MAC=!!navigator.platform.match(/Mac/i),t.IS_WIN=!!navigator.platform.match(/Win/i),t.IS_IE=/Trident/.test(navigator.userAgent),t.IS_EDGE=/Edge/.test(navigator.userAgent),t.accelKey=function(e){return t.IS_MAC?e.metaKey:e.ctrlKey}}(e.Platform||(e.Platform={}))});i(mt);mt.Platform;var _t=r(function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.calculateSpecificity=function(t){if(t in n.specificityCache)return n.specificityCache[t];var e=n.calculateSingle(t);return n.specificityCache[t]=e},t.isValid=function(t){if(t in n.validityCache)return n.validityCache[t];var e=!0;try{n.testElem.querySelector(t)}catch(t){e=!1}return n.validityCache[t]=e},t.matches=function(t,e){return n.protoMatchFunc.call(t,e)}}(e.Selector||(e.Selector={})),function(t){var e;t.specificityCache=Object.create(null),t.validityCache=Object.create(null),t.testElem=document.createElement("div"),t.protoMatchFunc=(e=Element.prototype).matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(t){var e=this.ownerDocument.querySelectorAll(t);return-1!==Array.prototype.indexOf.call(e,this)},t.calculateSingle=function(t){var e=0,h=0,d=0;function l(e){var n=t.match(e);return null!==n&&(t=t.slice(n[0].length),!0)}for(t=(t=t.split(",",1)[0]).replace(c," $1 ");t.length>0;)if(l(n))e++;else if(l(i))h++;else if(l(r))h++;else if(l(a))d++;else if(l(s))h++;else if(l(o))d++;else if(!l(u))return 0;return(e=Math.min(e,255))<<16|(h=Math.min(h,255))<<8|(d=Math.min(d,255))};var n=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,r=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,a=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,s=/^:[^\s\+>~#\.\[:]+/,u=/^[\s\+>~\*]+/,c=/:not\(([^\)]+)\)/g}(n||(n={}))});i(_t);_t.Selector;var gt=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(ft),n(vt),n(mt),n(_t)});i(gt);var yt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getKeyboardLayout=function(){return n.keyboardLayout},e.setKeyboardLayout=function(t){n.keyboardLayout=t};var n,i=function(){function t(e,n){this.name=e,this._codes=n,this._keys=t.extractKeys(n)}return t.prototype.keys=function(){return Object.keys(this._keys)},t.prototype.isValidKey=function(t){return t in this._keys},t.prototype.keyForKeydownEvent=function(t){return this._codes[t.keyCode]||""},t}();e.KeycodeLayout=i,function(t){t.extractKeys=function(t){var e=Object.create(null);for(var n in t)e[t[n]]=!0;return e}}(i=e.KeycodeLayout||(e.KeycodeLayout={})),e.KeycodeLayout=i,e.EN_US=new i("en-us",{8:"Backspace",9:"Tab",13:"Enter",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}),function(t){t.keyboardLayout=e.EN_US}(n||(n={}))});i(yt);yt.getKeyboardLayout,yt.setKeyboardLayout,yt.KeycodeLayout,yt.EN_US;var bt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=Object.create(null),this._commandChanged=new lt.Signal(this),this._commandExecuted=new lt.Signal(this),this._keyBindingChanged=new lt.Signal(this)}return Object.defineProperty(t.prototype,"commandChanged",{get:function(){return this._commandChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"commandExecuted",{get:function(){return this._commandExecuted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindingChanged",{get:function(){return this._keyBindingChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindings",{get:function(){return this._keyBindings},enumerable:!0,configurable:!0}),t.prototype.listCommands=function(){return Object.keys(this._commands)},t.prototype.hasCommand=function(t){return t in this._commands},t.prototype.addCommand=function(t,e){var i=this;if(t in this._commands)throw new Error("Command '"+t+"' already registered.");return this._commands[t]=n.createCommand(e),this._commandChanged.emit({id:t,type:"added"}),new pt.DisposableDelegate(function(){delete i._commands[t],i._commandChanged.emit({id:t,type:"removed"})})},t.prototype.notifyCommandChanged=function(t){if(void 0!==t&&!(t in this._commands))throw new Error("Command '"+t+"' is not registered.");this._commandChanged.emit({id:t,type:t?"changed":"many-changed"})},t.prototype.label=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.label.call(void 0,e):""},t.prototype.mnemonic=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.mnemonic.call(void 0,e):-1},t.prototype.icon=function(t,e){return void 0===e&&(e=O.JSONExt.emptyObject),this.iconClass(t,e)},t.prototype.iconClass=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.iconClass.call(void 0,e):""},t.prototype.iconLabel=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.iconLabel.call(void 0,e):""},t.prototype.caption=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.caption.call(void 0,e):""},t.prototype.usage=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.usage.call(void 0,e):""},t.prototype.className=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.className.call(void 0,e):""},t.prototype.dataset=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.dataset.call(void 0,e):{}},t.prototype.isEnabled=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return!!n&&n.isEnabled.call(void 0,e)},t.prototype.isToggled=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return!!n&&n.isToggled.call(void 0,e)},t.prototype.isVisible=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return!!n&&n.isVisible.call(void 0,e)},t.prototype.execute=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n,i=this._commands[t];if(!i)return Promise.reject(new Error("Command '"+t+"' not registered."));try{n=i.execute.call(void 0,e)}catch(t){n=Promise.reject(t)}var r=Promise.resolve(n);return this._commandExecuted.emit({id:t,args:e,result:r}),r},t.prototype.addKeyBinding=function(t){var e=this,i=n.createKeyBinding(t);return this._keyBindings.push(i),this._keyBindingChanged.emit({binding:i,type:"added"}),new pt.DisposableDelegate(function(){x.ArrayExt.removeFirstOf(e._keyBindings,i),e._keyBindingChanged.emit({binding:i,type:"removed"})})},t.prototype.processKeydownEvent=function(e){if(!this._replaying){var i=t.keystrokeForKeydownEvent(e);if(!i)return this._replayKeydownEvents(),void this._clearPendingState();this._keystrokes.push(i);var r=n.matchKeyBinding(this._keyBindings,this._keystrokes,e),o=r.exact,a=r.partial;if(!o&&!a)return this._replayKeydownEvents(),void this._clearPendingState();if(e.preventDefault(),e.stopPropagation(),o&&!a)return this._executeKeyBinding(o),void this._clearPendingState();o&&(this._exactKeyMatch=o),this._keydownEvents.push(e),this._startTimer()}},t.prototype._startTimer=function(){var t=this;this._clearTimer(),this._timerID=setTimeout(function(){t._onPendingTimeout()},n.CHORD_TIMEOUT)},t.prototype._clearTimer=function(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)},t.prototype._replayKeydownEvents=function(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(n.replayKeyEvent),this._replaying=!1)},t.prototype._executeKeyBinding=function(t){var e=t.command,n=t.args;if(this.hasCommand(e)&&this.isEnabled(e,n))this.execute(e,n);else{var i=this.hasCommand(e)?"enabled":"registered",r="Cannot execute key binding '"+t.keys.join(", ")+"':",o="command '"+e+"' is not "+i+".";console.warn(r+" "+o)}},t.prototype._clearPendingState=function(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0},t.prototype._onPendingTimeout=function(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()},t}();e.CommandRegistry=i,function(t){function e(t){for(var e="",n=!1,i=!1,r=!1,o=!1,a=0,s=t.split(/\s+/);a<s.length;a++){var u=s[a];"Accel"===u?gt.Platform.IS_MAC?i=!0:r=!0:"Alt"===u?n=!0:"Cmd"===u?i=!0:"Ctrl"===u?r=!0:"Shift"===u?o=!0:u.length>0&&(e=u)}return{cmd:i,ctrl:r,alt:n,shift:o,key:e}}t.parseKeystroke=e,t.normalizeKeystroke=function(t){var n="",i=e(t);return i.ctrl&&(n+="Ctrl "),i.alt&&(n+="Alt "),i.shift&&(n+="Shift "),i.cmd&&gt.Platform.IS_MAC&&(n+="Cmd "),n+i.key},t.keystrokeForKeydownEvent=function(t){var e=yt.getKeyboardLayout().keyForKeydownEvent(t);if(!e)return"";var n="";return t.ctrlKey&&(n+="Ctrl "),t.altKey&&(n+="Alt "),t.shiftKey&&(n+="Shift "),t.metaKey&&gt.Platform.IS_MAC&&(n+="Cmd "),n+e}}(i=e.CommandRegistry||(e.CommandRegistry={})),e.CommandRegistry=i,function(t){t.CHORD_TIMEOUT=1e3,t.createCommand=function(t){return{execute:t.execute,label:s(t.label,e),mnemonic:s(t.mnemonic,n),iconClass:s(t.iconClass||t.icon,e),iconLabel:s(t.iconLabel,e),caption:s(t.caption,e),usage:s(t.usage,e),className:s(t.className,e),dataset:s(t.dataset,a),isEnabled:t.isEnabled||r,isToggled:t.isToggled||o,isVisible:t.isVisible||r}},t.createKeyBinding=function(t){return{keys:u(t),selector:c(t),command:t.command,args:t.args||O.JSONExt.emptyObject}},t.matchKeyBinding=function(t,e,n){for(var i=null,r=!1,o=1/0,a=0,s=0,u=t.length;s<u;++s){var c=t[s],l=h(c.keys,e);if(0!==l)if(2!==l){var p=d(c.selector,n);if(!(-1===p||p>o)){var f=gt.Selector.calculateSpecificity(c.selector);(!i||p<o||f>=a)&&(i=c,o=p,a=f)}}else r||-1===d(c.selector,n)||(r=!0)}return{exact:i,partial:r}},t.replayKeyEvent=function(t){t.target.dispatchEvent(function(t){var e=document.createEvent("Event"),n=t.bubbles||!0,i=t.cancelable||!0;return e.initEvent(t.type||"keydown",n,i),e.key=t.key||"",e.keyCode=t.keyCode||0,e.which=t.keyCode||0,e.ctrlKey=t.ctrlKey||!1,e.altKey=t.altKey||!1,e.shiftKey=t.shiftKey||!1,e.metaKey=t.metaKey||!1,e.view=t.view||window,e}(t))};var e=function(){return""},n=function(){return-1},r=function(){return!0},o=function(){return!1},a=function(){return{}};function s(t,e){return void 0===t?e:"function"==typeof t?t:function(){return t}}function u(t){return(gt.Platform.IS_WIN?t.winKeys||t.keys:gt.Platform.IS_MAC?t.macKeys||t.keys:t.linuxKeys||t.keys).map(i.normalizeKeystroke)}function c(t){if(-1!==t.selector.indexOf(","))throw new Error("Selector cannot contain commas: "+t.selector);if(!gt.Selector.isValid(t.selector))throw new Error("Invalid selector: "+t.selector);return t.selector}function h(t,e){if(t.length<e.length)return 0;for(var n=0,i=e.length;n<i;++n)if(t[n]!==e[n])return 0;return t.length>e.length?2:1}function d(t,e){for(var n=e.target,i=e.currentTarget,r=0;null!==n;n=n.parentElement,++r){if(gt.Selector.matches(n,t))return r;if(n===i)return-1}return-1}}(n||(n={}))});i(bt);var xt=bt.CommandRegistry,Mt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(var i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e){void 0===e&&(e={});var n=e.start,i=e.stop,r=e.step;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");var o,a=t.length;void 0===n?n=r<0?a-1:0:n<0?n=Math.max(n+a,r<0?-1:0):n>=a&&(n=r<0?a-1:a),void 0===i?i=r<0?-1:a:i<0?i=Math.max(i+a,r<0?-1:0):i>=a&&(i=r<0?a-1:a),o=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);for(var s=[],u=0;u<o;++u)s[u]=t[n+u*r];return s},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(Mt);Mt.ArrayExt;var wt=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.iterKeys=function(t){return new r(t)},e.iterValues=function(t){return new o(t)},e.iterItems=function(t){return new a(t)},e.iterFn=function(t){return new s(t)},e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r},e.toObject=function(t){for(var e,i=n(t),r={};void 0!==(e=i.next());)r[e[0]]=e[1];return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i;var r=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}();e.KeyIterator=r;var o=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}();e.ValueIterator=o;var a=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}();e.ItemIterator=a;var s=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();e.FnIterator=s});i(wt);wt.iter,wt.iterKeys,wt.iterValues,wt.iterItems,wt.iterFn,wt.each,wt.every,wt.some,wt.toArray,wt.toObject,wt.ArrayIterator,wt.KeyIterator,wt.ValueIterator,wt.ItemIterator,wt.FnIterator;var Pt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(wt.iter(t.map(wt.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(Pt);Pt.chain,Pt.ChainIterator;var It=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(It);It.empty,It.EmptyIterator;var At=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.enumerate=function(t,e){return void 0===e&&(e=0),new n(wt.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._index=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();e.EnumerateIterator=n});i(At);At.enumerate,At.EnumerateIterator;var Et=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(wt.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i(Et);Et.filter,Et.FilterIterator;var St=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=wt.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.findIndex=function(t,e){for(var n,i=0,r=wt.iter(t);void 0!==(n=r.next());)if(e(n,i++))return i-1;return-1},e.min=function(t,e){var n=wt.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=wt.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=wt.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(St);St.find,St.findIndex,St.min,St.max,St.minmax;var Ot=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(wt.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(Ot);Ot.map,Ot.MapIterator;var Ct=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(Ct);Ct.range,Ct.RangeIterator;var Lt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=wt.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var a,s,u=r.next();if(void 0===u&&void 0===n)return o;if(void 0===u)return e(n,o,i++);for(a=e(void 0===n?o:e(n,o,i++),u,i++);void 0!==(s=r.next());)a=e(a,s,i++);return a}});i(Lt);Lt.reduce;var zt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(zt);zt.repeat,zt.once,zt.RepeatIterator;var kt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(kt);kt.retro,kt.RetroArrayIterator;var Tt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return wt.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(Tt);Tt.topologicSort;var jt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(wt.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(jt);jt.stride,jt.StrideIterator;var Dt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(e.StringExt||(e.StringExt={}))});i(Dt);Dt.StringExt;var Bt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(wt.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(Bt);Bt.take,Bt.TakeIterator;var Rt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(wt.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(Rt);Rt.zip,Rt.ZipIterator;var Wt=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(Mt),n(Pt),n(It),n(At),n(Et),n(St),n(wt),n(Ot),n(Ct),n(Lt),n(zt),n(kt),n(Tt),n(jt),n(Dt),n(Bt),n(Rt)});i(Wt);var Nt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t){this._root=new n.LeafNode,this.cmp=t}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){var t=n.firstLeaf(this._root);return t.size>0?t.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){var t=n.lastLeaf(this._root);return t.size>0?t.items[t.size-1]:void 0},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return n.iterItems(this._root)},t.prototype.retro=function(){return n.retroItems(this._root)},t.prototype.slice=function(t,e){return n.sliceItems(this._root,t,e)},t.prototype.retroSlice=function(t,e){return n.retroSliceItems(this._root,t,e)},t.prototype.at=function(t){return n.itemAt(this._root,t)},t.prototype.has=function(t,e){return n.hasItem(this._root,t,e)},t.prototype.indexOf=function(t,e){return n.indexOf(this._root,t,e)},t.prototype.get=function(t,e){return n.getItem(this._root,t,e)},t.prototype.assign=function(t){this.clear(),this.update(t)},t.prototype.insert=function(t){var e=n.insertItem(this._root,t,this.cmp);return this._root=n.maybeSplitRoot(this._root),e},t.prototype.update=function(t){var e=this;Wt.each(t,function(t){e.insert(t)})},t.prototype.delete=function(t,e){var i=n.deleteItem(this._root,t,e);return this._root=n.maybeExtractRoot(this._root),i},t.prototype.remove=function(t){var e=n.removeItem(this._root,t);return this._root=n.maybeExtractRoot(this._root),e},t.prototype.clear=function(){n.clear(this._root),this._root=new n.LeafNode},t}();e.BPlusTree=i,function(t){t.from=function(e,n){var i=new t(n);return i.assign(e),i}}(i=e.BPlusTree||(e.BPlusTree={})),e.BPlusTree=i,function(t){var e=function(){function t(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(t.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),t}();t.BranchNode=e;var n=function(){function t(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(t.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t}();function i(t){for(;0===t.type;)t=t.children[0];return t}function r(t){for(;0===t.type;)t=t.children[t.children.length-1];return t}function o(t){0===t.type?(Wt.each(t.children,o),t.children.length=0,t.sizes.length=0,t.items.length=0):(t.items.length=0,t.next=null,t.prev=null)}t.LeafNode=n,t.firstLeaf=i,t.lastLeaf=r,t.iterItems=function(t){var e=i(t);return new u(e,0,-1)},t.retroItems=function(t){var e=r(t);return new c(e,e.size-1,-1)},t.sliceItems=function(t,e,n){e=void 0===e?0:e<0?Math.max(0,e+t.size):Math.min(e,t.size),n=void 0===n?t.size:n<0?Math.max(0,n+t.size):Math.min(n,t.size);var i=Math.max(0,n-e);if(0===i)return Wt.empty();for(;0===t.type;){var r=h(t.sizes,e);r>0&&(e-=t.sizes[r-1]),t=t.children[r]}return new u(t,e,i)},t.retroSliceItems=function(t,e,n){e=void 0===e?t.size-1:e<0?Math.max(-1,e+t.size):Math.min(e,t.size-1),n=void 0===n?-1:n<0?Math.max(-1,n+t.size):Math.min(n,t.size-1);var i=Math.max(0,e-n);if(0===i)return Wt.empty();for(;0===t.type;){var r=h(t.sizes,e);r>0&&(e-=t.sizes[r-1]),t=t.children[r]}return new c(t,e,i)},t.itemAt=function(t,e){if(e<0&&(e+=t.size),!(e<0||e>=t.size)){for(;0===t.type;){var n=h(t.sizes,e);n>0&&(e-=t.sizes[n-1]),t=t.children[n]}return t.items[e]}},t.hasItem=function(t,e,n){for(;0===t.type;){var i=d(t.items,e,n);t=t.children[i]}return l(t.items,e,n)>=0},t.indexOf=function(t,e,n){for(var i=0;0===t.type;){var r=d(t.items,e,n);r>0&&(i+=t.sizes[r-1]),t=t.children[r]}var o=l(t.items,e,n);return o>=0?i+o:-i+o},t.getItem=function(t,e,n){for(;0===t.type;){var i=d(t.items,e,n);t=t.children[i]}var r=l(t.items,e,n);return r>=0?t.items[r]:void 0},t.insertItem=function t(e,n,i){if(1===e.type){var r,o=l(e.items,n,i);return o>=0?(r=e.items[o],e.items[o]=n):(r=void 0,Wt.ArrayExt.insert(e.items,-o-1,n)),r}var s=d(e.items,n,i),u=e.children[s],c=u.size,h=t(u,n,i),v=u.size;if(e.items[s]=u.items[0],c===v)return h;if(u.width>a){var m=f(u);Wt.ArrayExt.insert(e.children,s+1,m),Wt.ArrayExt.insert(e.items,s+1,m.items[0])}return p(e,s),h},t.deleteItem=function t(e,n,i){if(1===e.type){var r=l(e.items,n,i);if(r<0)return;return Wt.ArrayExt.removeAt(e.items,r)}var o=d(e.items,n,i),a=e.children[o],u=a.size,c=t(a,n,i);return u===a.size?c:(e.items[o]=a.items[0],a.width<s&&(o=v(e,o)),p(e,o),c)},t.removeItem=function t(e,n){if(n<0&&(n+=e.size),!(n<0||n>=e.size)){if(1===e.type)return Wt.ArrayExt.removeAt(e.items,n);var i=h(e.sizes,n);i>0&&(n-=e.sizes[i]);var r=e.children[i],o=t(r,n);return e.items[i]=r.items[0],r.width<s&&(i=v(e,i)),p(e,i),o}},t.clear=o,t.maybeSplitRoot=function(t){if(t.width<=a)return t;var n=new e,i=f(t);return n.sizes[0]=t.size,n.sizes[1]=t.size+i.size,n.children[0]=t,n.children[1]=i,n.items[0]=t.items[0],n.items[1]=i.items[0],n},t.maybeExtractRoot=function(t){if(1===t.type)return t;if(t.children.length>1)return t;var e=t.children.pop();return o(t),e};var a=32,s=a>>1,u=function(){function t(t,e,n){this._node=t,this._index=e,this._count=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node,this._index,this._count)},t.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},t}(),c=function(){function t(t,e,n){this._node=t,this._index=e,this._count=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node,this._index,this._count)},t.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},t}();function h(t,e){for(var n=t.length,i=0;i<n;++i)if(t[i]>e)return i;return n-1}function d(t,e,n){for(var i=t.length,r=1;r<i;++r)if(n(t[r],e)>0)return r-1;return i-1}function l(t,e,n){for(var i=t.length,r=0;r<i;++r){var o=n(t[r],e);if(0===o)return r;if(o>0)return-r-1}return-i-1}function p(t,e){for(var n=t.sizes,i=t.children,r=e>0?n[e-1]:0,o=i.length;e<o;++e)r=n[e]=r+i[e].size;n.length=i.length}function f(t){if(1===t.type){for(var i=new n,r=t.items,o=i.items,a=s,u=r.length;a<u;++a)o.push(r[a]);return r.length=s,t.next&&(t.next.prev=i),i.next=t.next,i.prev=t,t.next=i,i}var c=new e,h=t.children,d=c.children;for(a=s,u=h.length;a<u;++a)d.push(h[a]);h.length=s;var l=t.items,f=c.items;for(a=s,u=l.length;a<u;++a)f.push(l[a]);return l.length=s,p(t,s),p(c,0),c}function v(t,e){var n,i,r,a,u,c,h=t.children[e],d=0===e?t.children[e+1]:t.children[e-1],l=0===e,f=1===h.type,v=d.width>s;if(f&&v&&l){var m=d;return(_=h).items.push(m.items.shift()),t.items[e+1]=m.items[0],e}if(f&&v&&!l){m=d;return(_=h).items.unshift(m.items.pop()),t.items[e]=_.items[0],e-1}if(f&&!v&&l){var _=h;return(n=(m=d).items).unshift.apply(n,_.items),Wt.ArrayExt.removeAt(t.children,e),Wt.ArrayExt.removeAt(t.items,e+1),_.prev&&(_.prev.next=m),m.prev=_.prev,o(_),e}if(f&&!v&&!l){_=h;return(i=(m=d).items).push.apply(i,_.items),Wt.ArrayExt.removeAt(t.children,e),Wt.ArrayExt.removeAt(t.items,e),_.next&&(_.next.prev=m),m.next=_.next,o(_),e-1}if(!f&&v&&l){m=d;return(_=h).children.push(m.children.shift()),_.items.push(m.items.shift()),t.items[e+1]=m.items[0],p(_,_.width-1),p(m,0),e}if(!f&&v&&!l){m=d;return(_=h).children.unshift(m.children.pop()),_.items.unshift(m.items.pop()),t.items[e]=_.items[0],p(_,0),p(m,m.width-1),e-1}if(!f&&!v&&l){_=h;return(r=(m=d).children).unshift.apply(r,_.children),(a=m.items).unshift.apply(a,_.items),Wt.ArrayExt.removeAt(t.children,e),Wt.ArrayExt.removeAt(t.items,e+1),p(m,0),_.children.length=0,o(_),e}if(!f&&!v&&!l){_=h;return(u=(m=d).children).push.apply(u,_.children),(c=m.items).push.apply(c,_.items),Wt.ArrayExt.removeAt(t.children,e),Wt.ArrayExt.removeAt(t.items,e),p(m,0),_.children.length=0,o(_),e-1}throw"unreachable"}}(n||(n={}))});i(Nt);Nt.BPlusTree;var Ft=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return new t.ForwardValueIterator(this._first)},t.prototype.retro=function(){return new t.RetroValueIterator(this._last)},t.prototype.nodes=function(){return new t.ForwardNodeIterator(this._first)},t.prototype.retroNodes=function(){return new t.RetroNodeIterator(this._last)},t.prototype.assign=function(t){var e=this;this.clear(),Wt.each(t,function(t){e.addLast(t)})},t.prototype.push=function(t){this.addLast(t)},t.prototype.pop=function(){return this.removeLast()},t.prototype.shift=function(t){this.addFirst(t)},t.prototype.unshift=function(){return this.removeFirst()},t.prototype.addFirst=function(t){var e=new n.LinkedListNode(this,t);return this._first?(e.next=this._first,this._first.prev=e,this._first=e):(this._first=e,this._last=e),this._size++,e},t.prototype.addLast=function(t){var e=new n.LinkedListNode(this,t);return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._first=e,this._last=e),this._size++,e},t.prototype.insertBefore=function(t,e){if(!e||e===this._first)return this.addFirst(t);if(!(e instanceof n.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var i=new n.LinkedListNode(this,t),r=e,o=r.prev;return i.next=r,i.prev=o,r.prev=i,o.next=i,this._size++,i},t.prototype.insertAfter=function(t,e){if(!e||e===this._last)return this.addLast(t);if(!(e instanceof n.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var i=new n.LinkedListNode(this,t),r=e,o=r.next;return i.next=o,i.prev=r,r.next=i,o.prev=i,this._size++,i},t.prototype.removeFirst=function(){var t=this._first;if(t)return t===this._last?(this._first=null,this._last=null):(this._first=t.next,this._first.prev=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value},t.prototype.removeLast=function(){var t=this._last;if(t)return t===this._first?(this._first=null,this._last=null):(this._last=t.prev,this._last.next=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value},t.prototype.removeNode=function(t){if(!(t instanceof n.LinkedListNode)||t.list!==this)throw new Error("Node is not owned by the list.");var e=t;e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._size--},t.prototype.clear=function(){for(var t=this._first;t;){var e=t.next;t.list=null,t.prev=null,t.next=null,t=e}this._first=null,this._last=null,this._size=0},t}();e.LinkedList=i,function(t){t.from=function(e){var n=new t;return n.assign(e),n};var e=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t.value}},t}();t.ForwardValueIterator=e;var n=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t.value}},t}();t.RetroValueIterator=n;var i=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t}},t}();t.ForwardNodeIterator=i;var r=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t}},t}();t.RetroNodeIterator=r}(i=e.LinkedList||(e.LinkedList={})),e.LinkedList=i,function(t){var e=function(){return function(t,e){this.list=null,this.next=null,this.prev=null,this.list=t,this.value=e}}();t.LinkedListNode=e}(n||(n={}))});i(Ft);Ft.LinkedList;var Ht=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(Nt),n(Ft)});i(Ht);var qt=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.type=t}return Object.defineProperty(t.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),t.prototype.conflate=function(t){return!1},t}();e.Message=r;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.conflate=function(t){return!0},e}(r);e.ConflatableMessage=o,function(t){function e(t,e){var n=i.get(t);n&&0!==n.length?x.every(x.retro(n),function(n){return!n||function(t,e,n){var i=!0;try{i="function"==typeof t?t(e,n):t.messageHook(e,n)}catch(t){o(t)}return i}(n,t,e)})&&h(t,e):h(t,e)}t.sendMessage=e,t.postMessage=function(t,e){e.isConflatable&&x.some(n,function(n){return n.handler===t&&!!n.msg&&n.msg.type===e.type&&!!n.msg.isConflatable&&n.msg.conflate(e)})||d(t,e)},t.installMessageHook=function(t,e){var n=i.get(t);n&&-1!==n.indexOf(e)||(n?n.push(e):i.set(t,[e]))},t.removeMessageHook=function(t,e){var n=i.get(t);if(n){var r=n.indexOf(e);-1!==r&&(n[r]=null,p(n))}},t.clearData=function(t){var e=i.get(t);e&&e.length>0&&(x.ArrayExt.fill(e,null),p(e)),x.each(n,function(e){e.handler===t&&(e.handler=null,e.msg=null)})},t.flush=function(){s||0===a||(c(a),s=!0,l(),s=!1)},t.getExceptionHandler=function(){return o},t.setExceptionHandler=function(t){var e=o;return o=t,e};var n=new Ht.LinkedList,i=new WeakMap,r=new Set,o=function(t){console.error(t)},a=0,s=!1,u="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate,c="function"==typeof cancelAnimationFrame?cancelAnimationFrame:clearImmediate;function h(t,e){try{t.processMessage(e)}catch(t){o(t)}}function d(t,e){n.addLast({handler:t,msg:e}),0===a&&(a=u(l))}function l(){if(a=0,!n.isEmpty){var t={handler:null,msg:null};for(n.addLast(t);;){var i=n.removeFirst();if(i===t)return;i.handler&&i.msg&&e(i.handler,i.msg)}}}function p(t){0===r.size&&u(f),r.add(t)}function f(){r.forEach(v),r.clear()}function v(t){x.ArrayExt.removeAllWhere(t,m)}function m(t){return null===t}}(e.MessageLoop||(e.MessageLoop={}))});i(qt);qt.Message;var Vt=qt.ConflatableMessage,Kt=qt.MessageLoop,Ut=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}();e.BoxSizer=n,function(t){t.calc=function(t,e){var n=t.length;if(0===n)return e;for(var i=0,r=0,o=0,a=0,s=0,u=0;u<n;++u){var c=(_=t[u]).minSize,h=_.maxSize,d=_.sizeHint;_.done=!1,_.size=Math.max(c,Math.min(d,h)),o+=_.size,i+=c,r+=h,_.stretch>0&&(a+=_.stretch,s++)}if(e===o)return 0;if(e<=i){for(u=0;u<n;++u)(_=t[u]).size=_.minSize;return e-i}if(e>=r){for(u=0;u<n;++u)(_=t[u]).size=_.maxSize;return e-r}var l=n;if(e<o){for(var p=o-e;s>0&&p>.01;){var f=p,v=a;for(u=0;u<n;++u)if(!(_=t[u]).done&&0!==_.stretch){var m=_.stretch*f/v;_.size-m<=_.minSize?(p-=_.size-_.minSize,a-=_.stretch,_.size=_.minSize,_.done=!0,l--,s--):(p-=m,_.size-=m)}}for(;l>0&&p>.01;)for(m=p/l,u=0;u<n;++u)(_=t[u]).done||(_.size-m<=_.minSize?(p-=_.size-_.minSize,_.size=_.minSize,_.done=!0,l--):(p-=m,_.size-=m))}else{for(p=e-o;s>0&&p>.01;)for(f=p,v=a,u=0;u<n;++u)(_=t[u]).done||0===_.stretch||(m=_.stretch*f/v,_.size+m>=_.maxSize?(p-=_.maxSize-_.size,a-=_.stretch,_.size=_.maxSize,_.done=!0,l--,s--):(p-=m,_.size+=m));for(;l>0&&p>.01;)for(m=p/l,u=0;u<n;++u){var _;(_=t[u]).done||(_.size+m>=_.maxSize?(p-=_.maxSize-_.size,_.size=_.maxSize,_.done=!0,l--):(p-=m,_.size+=m))}}return 0},t.adjust=function(t,e,n){0!==t.length&&0!==n&&(n>0?function(t,e,n){for(var i=0,r=0;r<=e;++r){var o=t[r];i+=o.maxSize-o.size}for(var a=0,r=e+1,s=t.length;r<s;++r){var o=t[r];a+=o.size-o.minSize}for(var u=n=Math.min(n,i,a),r=e;r>=0&&u>0;--r){var o=t[r],c=o.maxSize-o.size;c>=u?(o.sizeHint=o.size+u,u=0):(o.sizeHint=o.size+c,u-=c)}for(var h=n,r=e+1,s=t.length;r<s&&h>0;++r){var o=t[r],c=o.size-o.minSize;c>=h?(o.sizeHint=o.size-h,h=0):(o.sizeHint=o.size-c,h-=c)}}(t,e,n):function(t,e,n){for(var i=0,r=e+1,o=t.length;r<o;++r){var a=t[r];i+=a.maxSize-a.size}for(var s=0,r=0;r<=e;++r){var a=t[r];s+=a.size-a.minSize}for(var u=n=Math.min(n,i,s),r=e+1,o=t.length;r<o&&u>0;++r){var a=t[r],c=a.maxSize-a.size;c>=u?(a.sizeHint=a.size+u,u=0):(a.sizeHint=a.size+c,u-=c)}for(var h=n,r=e;r>=0&&h>0;--r){var a=t[r],c=a.size-a.minSize;c>=h?(a.sizeHint=a.size-h,h=0):(a.sizeHint=a.size-c,h-=c)}}(t,e,-n))}}(e.BoxEngine||(e.BoxEngine={}))});i(Ut);Ut.BoxSizer,Ut.BoxEngine;var Yt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t){this._pid=n.nextPID(),this.name=t.name,this._create=t.create,this._coerce=t.coerce||null,this._compare=t.compare||null,this._changed=t.changed||null}return t.prototype.get=function(t){var e=n.ensureMap(t);return this._pid in e?e[this._pid]:e[this._pid]=this._createValue(t)},t.prototype.set=function(t,e){var i,r=n.ensureMap(t);i=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(t);var o=this._coerceValue(t,e);this._maybeNotify(t,i,r[this._pid]=o)},t.prototype.coerce=function(t){var e,i=n.ensureMap(t);e=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(t);var r=this._coerceValue(t,e);this._maybeNotify(t,e,i[this._pid]=r)},t.prototype._createValue=function(t){return(0,this._create)(t)},t.prototype._coerceValue=function(t,e){var n=this._coerce;return n?n(t,e):e},t.prototype._compareValue=function(t,e){var n=this._compare;return n?n(t,e):t===e},t.prototype._maybeNotify=function(t,e,n){var i=this._changed;i&&!this._compareValue(e,n)&&i(t,e,n)},t}();e.AttachedProperty=i,function(t){t.clearData=function(t){n.ownerData.delete(t)}}(i=e.AttachedProperty||(e.AttachedProperty={})),e.AttachedProperty=i,function(t){var e;t.ownerData=new WeakMap,t.nextPID=(e=0,function(){return"pid-"+(""+Math.random()).slice(2)+"-"+e++}),t.ensureMap=function(e){var n=t.ownerData.get(e);return n||(n=Object.create(null),t.ownerData.set(e,n),n)}}(n||(n={}))});i(Yt);Yt.AttachedProperty;var Xt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new lt.Signal(this),this.owner=t.owner,void 0!==t.label&&(this._label=t.label),void 0!==t.mnemonic&&(this._mnemonic=t.mnemonic),void 0!==t.icon&&(this._iconClass=t.icon),void 0!==t.iconClass&&(this._iconClass=t.iconClass),void 0!==t.iconLabel&&(this._iconLabel=t.iconLabel),void 0!==t.caption&&(this._caption=t.caption),void 0!==t.className&&(this._className=t.className),void 0!==t.closable&&(this._closable=t.closable),this._dataset=t.dataset||{}}return Object.defineProperty(t.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(t){this._label!==t&&(this._label=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(t){this._mnemonic!==t&&(this._mnemonic=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this.iconClass},set:function(t){this.iconClass=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._iconClass},set:function(t){this._iconClass!==t&&(this._iconClass=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(t){this._iconLabel!==t&&(this._iconLabel=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._caption},set:function(t){this._caption!==t&&(this._caption=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._className},set:function(t){this._className!==t&&(this._className=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closable",{get:function(){return this._closable},set:function(t){this._closable!==t&&(this._closable=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._dataset},set:function(t){this._dataset!==t&&(this._dataset=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),t}();e.Title=n});i(Xt);Xt.Title;var Gt=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t){void 0===t&&(t={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new lt.Signal(this),this.node=r.createNode(t),this.addClass("p-Widget")}return t.prototype.dispose=function(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),lt.Signal.clearData(this),qt.MessageLoop.clearData(this),Yt.AttachedProperty.clearData(this))},Object.defineProperty(t.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.testFlag(t.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.testFlag(t.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.testFlag(t.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.testFlag(t.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return r.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.node.id},set:function(t){this.node.id=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var n=new t.ChildMessage("child-removed",this);qt.MessageLoop.sendMessage(this._parent,n)}if(this._parent=e,this._parent&&!this._parent.isDisposed){n=new t.ChildMessage("child-added",this);qt.MessageLoop.sendMessage(this._parent,n)}this.isDisposed||qt.MessageLoop.sendMessage(this,t.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}},enumerable:!0,configurable:!0}),t.prototype.children=function(){return this._layout?this._layout.iter():x.empty()},t.prototype.contains=function(t){for(var e=t;e;e=e._parent)if(e===this)return!0;return!1},t.prototype.hasClass=function(t){return this.node.classList.contains(t)},t.prototype.addClass=function(t){this.node.classList.add(t)},t.prototype.removeClass=function(t){this.node.classList.remove(t)},t.prototype.toggleClass=function(t,e){return!0===e?(this.node.classList.add(t),!0):!1===e?(this.node.classList.remove(t),!1):this.node.classList.toggle(t)},t.prototype.update=function(){qt.MessageLoop.postMessage(this,t.Msg.UpdateRequest)},t.prototype.fit=function(){qt.MessageLoop.postMessage(this,t.Msg.FitRequest)},t.prototype.activate=function(){qt.MessageLoop.postMessage(this,t.Msg.ActivateRequest)},t.prototype.close=function(){qt.MessageLoop.sendMessage(this,t.Msg.CloseRequest)},t.prototype.show=function(){if(this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||qt.MessageLoop.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this.removeClass("p-mod-hidden"),!this.isAttached||this.parent&&!this.parent.isVisible||qt.MessageLoop.sendMessage(this,t.Msg.AfterShow),this.parent)){var e=new t.ChildMessage("child-shown",this);qt.MessageLoop.sendMessage(this.parent,e)}},t.prototype.hide=function(){if(!this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||qt.MessageLoop.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this.addClass("p-mod-hidden"),!this.isAttached||this.parent&&!this.parent.isVisible||qt.MessageLoop.sendMessage(this,t.Msg.AfterHide),this.parent)){var e=new t.ChildMessage("child-hidden",this);qt.MessageLoop.sendMessage(this.parent,e)}},t.prototype.setHidden=function(t){t?this.hide():this.show()},t.prototype.testFlag=function(t){return 0!=(this._flags&t)},t.prototype.setFlag=function(t){this._flags|=t},t.prototype.clearFlag=function(t){this._flags&=~t},t.prototype.processMessage=function(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}},t.prototype.notifyLayout=function(t){this._layout&&this._layout.processParentMessage(t)},t.prototype.onCloseRequest=function(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)},t.prototype.onResize=function(t){},t.prototype.onUpdateRequest=function(t){},t.prototype.onFitRequest=function(t){},t.prototype.onActivateRequest=function(t){},t.prototype.onBeforeShow=function(t){},t.prototype.onAfterShow=function(t){},t.prototype.onBeforeHide=function(t){},t.prototype.onAfterHide=function(t){},t.prototype.onBeforeAttach=function(t){},t.prototype.onAfterAttach=function(t){},t.prototype.onBeforeDetach=function(t){},t.prototype.onAfterDetach=function(t){},t.prototype.onChildAdded=function(t){},t.prototype.onChildRemoved=function(t){},t}();e.Widget=o,function(t){!function(t){t[t.IsDisposed=1]="IsDisposed",t[t.IsAttached=2]="IsAttached",t[t.IsHidden=4]="IsHidden",t[t.IsVisible=8]="IsVisible",t[t.DisallowLayout=16]="DisallowLayout"}(t.Flag||(t.Flag={})),function(t){t.BeforeShow=new qt.Message("before-show"),t.AfterShow=new qt.Message("after-show"),t.BeforeHide=new qt.Message("before-hide"),t.AfterHide=new qt.Message("after-hide"),t.BeforeAttach=new qt.Message("before-attach"),t.AfterAttach=new qt.Message("after-attach"),t.BeforeDetach=new qt.Message("before-detach"),t.AfterDetach=new qt.Message("after-detach"),t.ParentChanged=new qt.Message("parent-changed"),t.UpdateRequest=new qt.ConflatableMessage("update-request"),t.FitRequest=new qt.ConflatableMessage("fit-request"),t.ActivateRequest=new qt.ConflatableMessage("activate-request"),t.CloseRequest=new qt.ConflatableMessage("close-request")}(t.Msg||(t.Msg={}));var e=function(t){function e(e,n){var i=t.call(this,e)||this;return i.child=n,i}return i(e,t),e}(qt.Message);t.ChildMessage=e;var n=function(t){function e(e,n){var i=t.call(this,"resize")||this;return i.width=e,i.height=n,i}return i(e,t),e}(qt.Message);t.ResizeMessage=n,function(t){t.UnknownSize=new t(-1,-1)}(n=t.ResizeMessage||(t.ResizeMessage={})),t.attach=function(e,n,i){if(void 0===i&&(i=null),e.parent)throw new Error("Cannot attach a child widget.");if(e.isAttached||document.body.contains(e.node))throw new Error("Widget is already attached.");if(!document.body.contains(n))throw new Error("Host is not attached.");qt.MessageLoop.sendMessage(e,t.Msg.BeforeAttach),n.insertBefore(e.node,i),qt.MessageLoop.sendMessage(e,t.Msg.AfterAttach)},t.detach=function(e){if(e.parent)throw new Error("Cannot detach a child widget.");if(!e.isAttached||!document.body.contains(e.node))throw new Error("Widget is not attached.");qt.MessageLoop.sendMessage(e,t.Msg.BeforeDetach),e.node.parentNode.removeChild(e.node),qt.MessageLoop.sendMessage(e,t.Msg.AfterDetach)}}(o=e.Widget||(e.Widget={})),e.Widget=o,function(t){t.titleProperty=new Yt.AttachedProperty({name:"title",create:function(t){return new Xt.Title({owner:t})}}),t.createNode=function(t){return t.node||document.createElement("div")}}(r||(r={}))});i(Gt);Gt.Widget;var Jt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){void 0===t&&(t={}),this._disposed=!1,this._parent=null,this._fitPolicy=t.fitPolicy||"set-min-size"}return t.prototype.dispose=function(){this._parent=null,this._disposed=!0,lt.Signal.clearData(this),Yt.AttachedProperty.clearData(this)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(t){if(this._parent!==t){if(this._parent)throw new Error("Cannot change parent widget.");if(t.layout!==this)throw new Error("Invalid parent widget.");this._parent=t,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(t){if(this._fitPolicy!==t&&(this._fitPolicy=t,this._parent)){var e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),t.prototype.processParentMessage=function(t){switch(t.type){case"resize":this.onResize(t);break;case"update-request":this.onUpdateRequest(t);break;case"fit-request":this.onFitRequest(t);break;case"before-show":this.onBeforeShow(t);break;case"after-show":this.onAfterShow(t);break;case"before-hide":this.onBeforeHide(t);break;case"after-hide":this.onAfterHide(t);break;case"before-attach":this.onBeforeAttach(t);break;case"after-attach":this.onAfterAttach(t);break;case"before-detach":this.onBeforeDetach(t);break;case"after-detach":this.onAfterDetach(t);break;case"child-removed":this.onChildRemoved(t);break;case"child-shown":this.onChildShown(t);break;case"child-hidden":this.onChildHidden(t)}},t.prototype.init=function(){var t=this;x.each(this,function(e){e.parent=t.parent})},t.prototype.onResize=function(t){x.each(this,function(t){qt.MessageLoop.sendMessage(t,Gt.Widget.ResizeMessage.UnknownSize)})},t.prototype.onUpdateRequest=function(t){x.each(this,function(t){qt.MessageLoop.sendMessage(t,Gt.Widget.ResizeMessage.UnknownSize)})},t.prototype.onBeforeAttach=function(t){x.each(this,function(e){qt.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterAttach=function(t){x.each(this,function(e){qt.MessageLoop.sendMessage(e,t)})},t.prototype.onBeforeDetach=function(t){x.each(this,function(e){qt.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterDetach=function(t){x.each(this,function(e){qt.MessageLoop.sendMessage(e,t)})},t.prototype.onBeforeShow=function(t){x.each(this,function(e){e.isHidden||qt.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterShow=function(t){x.each(this,function(e){e.isHidden||qt.MessageLoop.sendMessage(e,t)})},t.prototype.onBeforeHide=function(t){x.each(this,function(e){e.isHidden||qt.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterHide=function(t){x.each(this,function(e){e.isHidden||qt.MessageLoop.sendMessage(e,t)})},t.prototype.onChildRemoved=function(t){this.removeWidget(t.child)},t.prototype.onFitRequest=function(t){},t.prototype.onChildShown=function(t){},t.prototype.onChildHidden=function(t){},t}();e.Layout=n,function(t){t.getHorizontalAlignment=function(t){return i.horizontalAlignmentProperty.get(t)},t.setHorizontalAlignment=function(t,e){i.horizontalAlignmentProperty.set(t,e)},t.getVerticalAlignment=function(t){return i.verticalAlignmentProperty.get(t)},t.setVerticalAlignment=function(t,e){i.verticalAlignmentProperty.set(t,e)}}(n=e.Layout||(e.Layout={})),e.Layout=n;var i,r=function(){function t(t){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=t,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var t=this.widget.node.style;t.position="",t.top="",t.left="",t.width="",t.height=""}},Object.defineProperty(t.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),t.prototype.fit=function(){var t=gt.ElementExt.sizeLimits(this.widget.node);this._minWidth=t.minWidth,this._minHeight=t.minHeight,this._maxWidth=t.maxWidth,this._maxHeight=t.maxHeight},t.prototype.update=function(t,e,i,r){var o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),a=Math.max(this._minHeight,Math.min(r,this._maxHeight));if(o<i)switch(n.getHorizontalAlignment(this.widget)){case"left":break;case"center":t+=(i-o)/2;break;case"right":t+=i-o;break;default:throw"unreachable"}if(a<r)switch(n.getVerticalAlignment(this.widget)){case"top":break;case"center":e+=(r-a)/2;break;case"bottom":e+=r-a;break;default:throw"unreachable"}var s=!1,u=this.widget.node.style;if(this._top!==e&&(this._top=e,u.top=e+"px"),this._left!==t&&(this._left=t,u.left=t+"px"),this._width!==o&&(s=!0,this._width=o,u.width=o+"px"),this._height!==a&&(s=!0,this._height=a,u.height=a+"px"),s){var c=new Gt.Widget.ResizeMessage(o,a);qt.MessageLoop.sendMessage(this.widget,c)}},t}();e.LayoutItem=r,function(t){function e(t){t.parent&&t.parent.layout&&t.parent.update()}t.horizontalAlignmentProperty=new Yt.AttachedProperty({name:"horizontalAlignment",create:function(){return"center"},changed:e}),t.verticalAlignmentProperty=new Yt.AttachedProperty({name:"verticalAlignment",create:function(){return"top"},changed:e})}(i||(i={}))});i(Jt);Jt.Layout,Jt.LayoutItem;var Zt=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widgets=[],e}return i(e,t),e.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return x.iter(this._widgets)},e.prototype.addWidget=function(t){this.insertWidget(this._widgets.length,t)},e.prototype.insertWidget=function(t,e){e.parent=this.parent;var n=this._widgets.indexOf(e),i=Math.max(0,Math.min(t,this._widgets.length));if(-1===n)return x.ArrayExt.insert(this._widgets,i,e),void(this.parent&&this.attachWidget(i,e));i===this._widgets.length&&i--,n!==i&&(x.ArrayExt.move(this._widgets,n,i),this.parent&&this.moveWidget(n,i,e))},e.prototype.removeWidget=function(t){this.removeWidgetAt(this._widgets.indexOf(t))},e.prototype.removeWidgetAt=function(t){var e=x.ArrayExt.removeAt(this._widgets,t);e&&this.parent&&this.detachWidget(t,e)},e.prototype.init=function(){var e=this;t.prototype.init.call(this),x.each(this,function(t,n){e.attachWidget(n,t)})},e.prototype.attachWidget=function(t,e){var n=this.parent.node.children[t];this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(e.node,n),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterAttach)},e.prototype.moveWidget=function(t,e,n){this.parent.isAttached&&qt.MessageLoop.sendMessage(n,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(n,Gt.Widget.Msg.AfterDetach);var i=this.parent.node.children[e];this.parent.isAttached&&qt.MessageLoop.sendMessage(n,Gt.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,i),this.parent.isAttached&&qt.MessageLoop.sendMessage(n,Gt.Widget.Msg.AfterAttach)},e.prototype.detachWidget=function(t,e){this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterDetach)},e}(Jt.Layout);e.PanelLayout=r});i(Zt);Zt.PanelLayout;var Qt=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n._fixed=0,n._spacing=4,n._dirty=!1,n._sizers=[],n._items=[],n._box=null,n._alignment="start",n._direction="top-to-bottom",void 0!==e.direction&&(n._direction=e.direction),void 0!==e.alignment&&(n._alignment=e.alignment),void 0!==e.spacing&&(n._spacing=r.clampSpacing(e.spacing)),n}return i(e,t),e.prototype.dispose=function(){x.each(this._items,function(t){t.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(t){this._direction!==t&&(this._direction=t,this.parent&&(this.parent.dataset.direction=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=r.clampSpacing(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){x.ArrayExt.insert(this._items,t,new Jt.LayoutItem(e)),x.ArrayExt.insert(this._sizers,t,new Ut.BoxSizer),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){x.ArrayExt.move(this._items,t,e),x.ArrayExt.move(this._sizers,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=x.ArrayExt.removeAt(this._items,t);x.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,n=0,i=this._items.length;n<i;++n)t+=+!this._items[n].isHidden;this._fixed=this._spacing*Math.max(0,t-1);var o=r.isHorizontal(this._direction),a=o?this._fixed:0,s=o?0:this._fixed;for(n=0,i=this._items.length;n<i;++n){var u=this._items[n],c=this._sizers[n];u.isHidden?(c.minSize=0,c.maxSize=0):(u.fit(),c.sizeHint=e.getSizeBasis(u.widget),c.stretch=e.getStretch(u.widget),o?(c.minSize=u.minWidth,c.maxSize=u.maxWidth,a+=u.minWidth,s=Math.max(s,u.minHeight)):(c.minSize=u.minHeight,c.maxSize=u.maxHeight,s+=u.minHeight,a=Math.max(a,u.minWidth)))}var h=this._box=gt.ElementExt.boxSizing(this.parent.node);a+=h.horizontalSum,s+=h.verticalSum;var d=this.parent.node.style;d.minWidth=a+"px",d.minHeight=s+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var n=0,i=0,r=this._items.length;i<r;++i)n+=+!this._items[i].isHidden;if(0!==n){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var o,a=this._box.paddingTop,s=this._box.paddingLeft,u=t-this._box.horizontalSum,c=e-this._box.verticalSum;switch(this._direction){case"left-to-right":o=Ut.BoxEngine.calc(this._sizers,Math.max(0,u-this._fixed));break;case"top-to-bottom":o=Ut.BoxEngine.calc(this._sizers,Math.max(0,c-this._fixed));break;case"right-to-left":o=Ut.BoxEngine.calc(this._sizers,Math.max(0,u-this._fixed)),s+=u;break;case"bottom-to-top":o=Ut.BoxEngine.calc(this._sizers,Math.max(0,c-this._fixed)),a+=c;break;default:throw"unreachable"}var h=0,d=0;if(o>0)switch(this._alignment){case"start":break;case"center":h=0,d=o/2;break;case"end":h=0,d=o;break;case"justify":h=o/n,d=0;break;default:throw"unreachable"}for(i=0,r=this._items.length;i<r;++i){var l=this._items[i];if(!l.isHidden){var p=this._sizers[i].size;switch(this._direction){case"left-to-right":l.update(s+d,a,p+h,c),s+=p+h+this._spacing;break;case"top-to-bottom":l.update(s,a+d,u,p+h),a+=p+h+this._spacing;break;case"right-to-left":l.update(s-d-p-h,a,p+h,c),s-=p+h+this._spacing;break;case"bottom-to-top":l.update(s,a-d-p-h,u,p+h),a-=p+h+this._spacing;break;default:throw"unreachable"}}}}},e}(Zt.PanelLayout);e.BoxLayout=o,function(t){t.getStretch=function(t){return r.stretchProperty.get(t)},t.setStretch=function(t,e){r.stretchProperty.set(t,e)},t.getSizeBasis=function(t){return r.sizeBasisProperty.get(t)},t.setSizeBasis=function(t,e){r.sizeBasisProperty.set(t,e)}}(o=e.BoxLayout||(e.BoxLayout={})),e.BoxLayout=o,function(t){function e(t){t.parent&&t.parent.layout instanceof o&&t.parent.fit()}t.stretchProperty=new Yt.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.sizeBasisProperty=new Yt.AttachedProperty({name:"sizeBasis",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.isHorizontal=function(t){return"left-to-right"===t||"right-to-left"===t},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))}}(r||(r={}))});i(Qt);Qt.BoxLayout;var $t=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.addClass("p-Panel"),n.layout=r.createLayout(e),n}return i(e,t),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.layout.addWidget(t)},e.prototype.insertWidget=function(t,e){this.layout.insertWidget(t,e)},e}(Gt.Widget);e.Panel=o,function(t){t.createLayout=function(t){return t.layout||new Zt.PanelLayout}}(r||(r={}))});i($t);$t.Panel;var te=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{layout:r.createLayout(e)})||this;return n.addClass("p-BoxPanel"),n}return i(e,t),Object.defineProperty(e.prototype,"direction",{get:function(){return this.layout.direction},set:function(t){this.layout.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("p-BoxPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("p-BoxPanel-child")},e}($t.Panel);e.BoxPanel=o,function(t){t.getStretch=function(t){return Qt.BoxLayout.getStretch(t)},t.setStretch=function(t,e){Qt.BoxLayout.setStretch(t,e)},t.getSizeBasis=function(t){return Qt.BoxLayout.getSizeBasis(t)},t.setSizeBasis=function(t,e){Qt.BoxLayout.setSizeBasis(t,e)}}(o=e.BoxPanel||(e.BoxPanel={})),e.BoxPanel=o,function(t){t.createLayout=function(t){return t.layout||new Qt.BoxLayout(t)}}(r||(r={}))});i(te);te.BoxPanel;var ee=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(var i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e){void 0===e&&(e={});var n=e.start,i=e.stop,r=e.step;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");var o,a=t.length;void 0===n?n=r<0?a-1:0:n<0?n=Math.max(n+a,r<0?-1:0):n>=a&&(n=r<0?a-1:a),void 0===i?i=r<0?-1:a:i<0?i=Math.max(i+a,r<0?-1:0):i>=a&&(i=r<0?a-1:a),o=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);for(var s=[],u=0;u<o;++u)s[u]=t[n+u*r];return s},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(ee);ee.ArrayExt;var ne=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.iterKeys=function(t){return new r(t)},e.iterValues=function(t){return new o(t)},e.iterItems=function(t){return new a(t)},e.iterFn=function(t){return new s(t)},e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r},e.toObject=function(t){for(var e,i=n(t),r={};void 0!==(e=i.next());)r[e[0]]=e[1];return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i;var r=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}();e.KeyIterator=r;var o=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}();e.ValueIterator=o;var a=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}();e.ItemIterator=a;var s=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();e.FnIterator=s});i(ne);ne.iter,ne.iterKeys,ne.iterValues,ne.iterItems,ne.iterFn,ne.each,ne.every,ne.some,ne.toArray,ne.toObject,ne.ArrayIterator,ne.KeyIterator,ne.ValueIterator,ne.ItemIterator,ne.FnIterator;var ie=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(ne.iter(t.map(ne.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(ie);ie.chain,ie.ChainIterator;var re=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(re);re.empty,re.EmptyIterator;var oe=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.enumerate=function(t,e){return void 0===e&&(e=0),new n(ne.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._index=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();e.EnumerateIterator=n});i(oe);oe.enumerate,oe.EnumerateIterator;var ae=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(ne.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i(ae);ae.filter,ae.FilterIterator;var se=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=ne.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.findIndex=function(t,e){for(var n,i=0,r=ne.iter(t);void 0!==(n=r.next());)if(e(n,i++))return i-1;return-1},e.min=function(t,e){var n=ne.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=ne.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=ne.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(se);se.find,se.findIndex,se.min,se.max,se.minmax;var ue=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(ne.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(ue);ue.map,ue.MapIterator;var ce=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(ce);ce.range,ce.RangeIterator;var he=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=ne.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var a,s,u=r.next();if(void 0===u&&void 0===n)return o;if(void 0===u)return e(n,o,i++);for(a=e(void 0===n?o:e(n,o,i++),u,i++);void 0!==(s=r.next());)a=e(a,s,i++);return a}});i(he);he.reduce;var de=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(de);de.repeat,de.once,de.RepeatIterator;var le=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(le);le.retro,le.RetroArrayIterator;var pe=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return ne.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(pe);pe.topologicSort;var fe=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(ne.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(fe);fe.stride,fe.StrideIterator;var ve=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(e.StringExt||(e.StringExt={}))});i(ve);ve.StringExt;var me=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(ne.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(me);me.take,me.TakeIterator;var _e=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(ne.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(_e);_e.zip,_e.ZipIterator;var ge=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(ee),n(ie),n(re),n(oe),n(ae),n(se),n(ne),n(ue),n(ce),n(he),n(de),n(le),n(pe),n(fe),n(ve),n(me),n(_e)});i(ge);var ye=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(t){this.type="text",this.content=t}}();e.VirtualText=n;var i,r=function(){return function(t,e,n){this.type="element",this.tag=t,this.attrs=e,this.children=n}}();function o(t){for(var e={},i=[],o=1,a=arguments.length;o<a;++o){var s=arguments[o];"string"==typeof s?i.push(new n(s)):s instanceof n?i.push(s):s instanceof r?i.push(s):s instanceof Array?u(i,s):1===o&&s&&"object"==typeof s&&(e=s)}return new r(t,e,i);function u(t,e){for(var i=0,o=e;i<o.length;i++){var a=o[i];"string"==typeof a?t.push(new n(a)):a instanceof n?t.push(a):a instanceof r&&t.push(a)}}}e.VirtualElement=r,e.h=o,function(t){t.a=t.bind(void 0,"a"),t.abbr=t.bind(void 0,"abbr"),t.address=t.bind(void 0,"address"),t.area=t.bind(void 0,"area"),t.article=t.bind(void 0,"article"),t.aside=t.bind(void 0,"aside"),t.audio=t.bind(void 0,"audio"),t.b=t.bind(void 0,"b"),t.bdi=t.bind(void 0,"bdi"),t.bdo=t.bind(void 0,"bdo"),t.blockquote=t.bind(void 0,"blockquote"),t.br=t.bind(void 0,"br"),t.button=t.bind(void 0,"button"),t.canvas=t.bind(void 0,"canvas"),t.caption=t.bind(void 0,"caption"),t.cite=t.bind(void 0,"cite"),t.code=t.bind(void 0,"code"),t.col=t.bind(void 0,"col"),t.colgroup=t.bind(void 0,"colgroup"),t.data=t.bind(void 0,"data"),t.datalist=t.bind(void 0,"datalist"),t.dd=t.bind(void 0,"dd"),t.del=t.bind(void 0,"del"),t.dfn=t.bind(void 0,"dfn"),t.div=t.bind(void 0,"div"),t.dl=t.bind(void 0,"dl"),t.dt=t.bind(void 0,"dt"),t.em=t.bind(void 0,"em"),t.embed=t.bind(void 0,"embed"),t.fieldset=t.bind(void 0,"fieldset"),t.figcaption=t.bind(void 0,"figcaption"),t.figure=t.bind(void 0,"figure"),t.footer=t.bind(void 0,"footer"),t.form=t.bind(void 0,"form"),t.h1=t.bind(void 0,"h1"),t.h2=t.bind(void 0,"h2"),t.h3=t.bind(void 0,"h3"),t.h4=t.bind(void 0,"h4"),t.h5=t.bind(void 0,"h5"),t.h6=t.bind(void 0,"h6"),t.header=t.bind(void 0,"header"),t.hr=t.bind(void 0,"hr"),t.i=t.bind(void 0,"i"),t.iframe=t.bind(void 0,"iframe"),t.img=t.bind(void 0,"img"),t.input=t.bind(void 0,"input"),t.ins=t.bind(void 0,"ins"),t.kbd=t.bind(void 0,"kbd"),t.label=t.bind(void 0,"label"),t.legend=t.bind(void 0,"legend"),t.li=t.bind(void 0,"li"),t.main=t.bind(void 0,"main"),t.map=t.bind(void 0,"map"),t.mark=t.bind(void 0,"mark"),t.meter=t.bind(void 0,"meter"),t.nav=t.bind(void 0,"nav"),t.noscript=t.bind(void 0,"noscript"),t.object=t.bind(void 0,"object"),t.ol=t.bind(void 0,"ol"),t.optgroup=t.bind(void 0,"optgroup"),t.option=t.bind(void 0,"option"),t.output=t.bind(void 0,"output"),t.p=t.bind(void 0,"p"),t.param=t.bind(void 0,"param"),t.pre=t.bind(void 0,"pre"),t.progress=t.bind(void 0,"progress"),t.q=t.bind(void 0,"q"),t.rp=t.bind(void 0,"rp"),t.rt=t.bind(void 0,"rt"),t.ruby=t.bind(void 0,"ruby"),t.s=t.bind(void 0,"s"),t.samp=t.bind(void 0,"samp"),t.section=t.bind(void 0,"section"),t.select=t.bind(void 0,"select"),t.small=t.bind(void 0,"small"),t.source=t.bind(void 0,"source"),t.span=t.bind(void 0,"span"),t.strong=t.bind(void 0,"strong"),t.sub=t.bind(void 0,"sub"),t.summary=t.bind(void 0,"summary"),t.sup=t.bind(void 0,"sup"),t.table=t.bind(void 0,"table"),t.tbody=t.bind(void 0,"tbody"),t.td=t.bind(void 0,"td"),t.textarea=t.bind(void 0,"textarea"),t.tfoot=t.bind(void 0,"tfoot"),t.th=t.bind(void 0,"th"),t.thead=t.bind(void 0,"thead"),t.time=t.bind(void 0,"time"),t.title=t.bind(void 0,"title"),t.tr=t.bind(void 0,"tr"),t.track=t.bind(void 0,"track"),t.u=t.bind(void 0,"u"),t.ul=t.bind(void 0,"ul"),t.var_=t.bind(void 0,"var"),t.video=t.bind(void 0,"video"),t.wbr=t.bind(void 0,"wbr")}(o=e.h||(e.h={})),function(t){t.realize=function(t){return i.createDOMNode(t)},t.render=function(t,e){var n=i.hostMap.get(e)||[],r=i.asContentArray(t);i.hostMap.set(e,r),i.updateContent(e,n,r)}}(e.VirtualDOM||(e.VirtualDOM={})),function(t){function e(t){if("text"===t.type)return document.createTextNode(t.content);var i=document.createElement(t.tag);!function(t,e){for(var i in e)i in n||("on"===i.substr(0,2)?t[i]=e[i]:t.setAttribute(i,e[i]));void 0!==e.className&&t.setAttribute("class",e.className);void 0!==e.htmlFor&&t.setAttribute("for",e.htmlFor);e.dataset&&function(t,e){for(var n in e)t.setAttribute("data-"+n,e[n])}(t,e.dataset);e.style&&function(t,e){var n,i=t.style;for(n in e)i[n]=e[n]}(t,e.style)}(i,t.attrs);for(var r=0,o=t.children.length;r<o;++r)i.appendChild(e(t.children[r]));return i}t.hostMap=new WeakMap,t.asContentArray=function(t){return t?t instanceof Array?t:[t]:[]},t.createDOMNode=e,t.updateContent=function t(n,r,o){if(r!==o){for(var a=function(t,e){for(var n=t.firstChild,i=Object.create(null),r=0,o=e;r<o.length;r++){var a=o[r];"element"===a.type&&a.attrs.key&&(i[a.attrs.key]={vNode:a,element:n}),n=n.nextSibling}return i}(n,r),s=r.slice(),u=n.firstChild,c=o.length,h=0;h<c;++h)if(h>=s.length)n.appendChild(e(o[h]));else{var d=s[h],l=o[h];if(d!==l)if("text"!==d.type||"text"!==l.type)if("text"!==d.type&&"text"!==l.type){var p=l.attrs.key;if(p&&p in a){var f=a[p];f.vNode!==d&&(ge.ArrayExt.move(s,s.indexOf(f.vNode,h+1),h),n.insertBefore(f.element,u),d=f.vNode,u=f.element)}if(d!==l){var v=d.attrs.key;v&&v!==p?(ge.ArrayExt.insert(s,h,l),n.insertBefore(e(l),u)):d.tag===l.tag?(i(u,d.attrs,l.attrs),t(u,d.children,l.children),u=u.nextSibling):(ge.ArrayExt.insert(s,h,l),n.insertBefore(e(l),u))}else u=u.nextSibling}else ge.ArrayExt.insert(s,h,l),n.insertBefore(e(l),u);else u.textContent=l.content,u=u.nextSibling;else u=u.nextSibling}for(h=s.length-c;h>0;--h)n.removeChild(n.lastChild)}};var n={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function i(t,e,i){if(e!==i){var r;for(r in e)r in n||r in i||("on"===r.substr(0,2)?t[r]=null:t.removeAttribute(r));for(r in i)r in n||e[r]===i[r]||("on"===r.substr(0,2)?t[r]=i[r]:t.setAttribute(r,i[r]));e.className!==i.className&&(void 0!==i.className?t.setAttribute("class",i.className):t.removeAttribute("class")),e.htmlFor!==i.htmlFor&&(void 0!==i.htmlFor?t.setAttribute("for",i.htmlFor):t.removeAttribute("for")),e.dataset!==i.dataset&&function(t,e,n){for(var i in e)i in n||t.removeAttribute("data-"+i);for(var r in n)e[r]!==n[r]&&t.setAttribute("data-"+r,n[r])}(t,e.dataset||{},i.dataset||{}),e.style!==i.style&&function(t,e,n){var i,r=t.style;for(i in e)i in n||(r[i]="");for(i in n)e[i]!==n[i]&&(r[i]=n[i])}(t,e.style||{},i.style||{})}}}(i||(i={}))});i(ye);ye.VirtualText,ye.VirtualElement,ye.h,ye.VirtualDOM;var be=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=n&&n.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o,a=function(t){function e(n){var i=t.call(this,{node:o.createNode()})||this;return i._activeIndex=-1,i._items=[],i._results=null,i.addClass("p-CommandPalette"),i.setFlag(Gt.Widget.Flag.DisallowLayout),i.commands=n.commands,i.renderer=n.renderer||e.defaultRenderer,i.commands.commandChanged.connect(i._onGenericChange,i),i.commands.keyBindingChanged.connect(i._onGenericChange,i),i}return i(e,t),e.prototype.dispose=function(){this._items.length=0,this._results=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("p-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("p-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.addItem=function(t){var e=o.createItem(this.commands,t);return this._items.push(e),this.refresh(),e},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){x.ArrayExt.removeAt(this._items,t)&&this.refresh()},e.prototype.clearItems=function(){0!==this._items.length&&(this._items.length=0,this.refresh())},e.prototype.refresh=function(){this._results=null,this.update()},e.prototype.handleEvent=function(t){switch(t.type){case"click":this._evtClick(t);break;case"keydown":this._evtKeyDown(t);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)},e.prototype.onActivateRequest=function(t){if(this.isAttached){var e=this.inputNode;e.focus(),e.select()}},e.prototype.onUpdateRequest=function(t){var e=this.inputNode.value,n=this.contentNode,i=this._results;if(i||(i=this._results=o.search(this._items,e),this._activeIndex=e?x.ArrayExt.findFirstIndex(i,o.canActivate):-1),e||0!==i.length)if(e&&0===i.length){var r=this.renderer.renderEmptyMessage({query:e});ye.VirtualDOM.render(r,n)}else{for(var a=this.renderer,s=this._activeIndex,u=new Array(i.length),c=0,h=i.length;c<h;++c){var d=i[c];if("header"===d.type){var l=d.indices,p=d.category;u[c]=a.renderHeader({category:p,indices:l})}else{var f=d.item,v=(l=d.indices,c===s);u[c]=a.renderItem({item:f,indices:l,active:v})}}if(ye.VirtualDOM.render(u,n),s<0||s>=i.length)n.scrollTop=0;else{var m=n.children[s];gt.ElementExt.scrollIntoViewIfNeeded(n,m)}}else ye.VirtualDOM.render(null,n)},e.prototype._evtClick=function(t){if(0===t.button){var e=x.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return e.contains(t.target)});-1!==e&&(t.preventDefault(),t.stopPropagation(),this._execute(e))}},e.prototype._evtKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey))switch(t.keyCode){case 13:t.preventDefault(),t.stopPropagation(),this._execute(this._activeIndex);break;case 38:t.preventDefault(),t.stopPropagation(),this._activatePreviousItem();break;case 40:t.preventDefault(),t.stopPropagation(),this._activateNextItem()}},e.prototype._activateNextItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<e-1?t+1:0,i=0===n?e-1:n-1;this._activeIndex=x.ArrayExt.findFirstIndex(this._results,o.canActivate,n,i),this.update()}},e.prototype._activatePreviousItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<=0?e-1:t-1,i=n===e-1?0:n+1;this._activeIndex=x.ArrayExt.findLastIndex(this._results,o.canActivate,n,i),this.update()}},e.prototype._execute=function(t){if(this._results){var e=this._results[t];if(e){if("header"===e.type){var n=this.inputNode;return n.value=e.category.toLowerCase()+" ",n.focus(),void this.refresh()}e.item.isEnabled&&(this.commands.execute(e.item.command,e.item.args),this.inputNode.value="",this.refresh())}}},e.prototype._toggleFocused=function(){var t=document.activeElement===this.inputNode;this.toggleClass("p-mod-focused",t)},e.prototype._onGenericChange=function(){this.refresh()},e}(Gt.Widget);e.CommandPalette=a,function(t){var e=function(){function t(){}return t.prototype.renderHeader=function(t){var e=this.formatHeader(t);return ye.h.li({className:"p-CommandPalette-header"},e)},t.prototype.renderItem=function(t){var e=this.createItemClass(t),n=this.createItemDataset(t);return ye.h.li({className:e,dataset:n},this.renderItemIcon(t),this.renderItemContent(t),this.renderItemShortcut(t))},t.prototype.renderEmptyMessage=function(t){var e=this.formatEmptyMessage(t);return ye.h.li({className:"p-CommandPalette-emptyMessage"},e)},t.prototype.renderItemIcon=function(t){var e=this.createIconClass(t);return ye.h.div({className:e},t.item.iconLabel)},t.prototype.renderItemContent=function(t){return ye.h.div({className:"p-CommandPalette-itemContent"},this.renderItemLabel(t),this.renderItemCaption(t))},t.prototype.renderItemLabel=function(t){var e=this.formatItemLabel(t);return ye.h.div({className:"p-CommandPalette-itemLabel"},e)},t.prototype.renderItemCaption=function(t){var e=this.formatItemCaption(t);return ye.h.div({className:"p-CommandPalette-itemCaption"},e)},t.prototype.renderItemShortcut=function(t){var e=this.formatItemShortcut(t);return ye.h.div({className:"p-CommandPalette-itemShortcut"},e)},t.prototype.createItemClass=function(t){var e="p-CommandPalette-item";t.item.isEnabled||(e+=" p-mod-disabled"),t.item.isToggled&&(e+=" p-mod-toggled"),t.active&&(e+=" p-mod-active");var n=t.item.className;return n&&(e+=" "+n),e},t.prototype.createItemDataset=function(t){return r({},t.item.dataset,{command:t.item.command})},t.prototype.createIconClass=function(t){var e="p-CommandPalette-itemIcon",n=t.item.iconClass;return n?e+" "+n:e},t.prototype.formatHeader=function(t){return t.indices&&0!==t.indices.length?x.StringExt.highlight(t.category,t.indices,ye.h.mark):t.category},t.prototype.formatEmptyMessage=function(t){return"No commands found that match '"+t.query+"'"},t.prototype.formatItemShortcut=function(t){var e=t.item.keyBinding;return e?e.keys.map(o.formatKeystroke).join(", "):null},t.prototype.formatItemLabel=function(t){return t.indices&&0!==t.indices.length?x.StringExt.highlight(t.item.label,t.indices,ye.h.mark):t.item.label},t.prototype.formatItemCaption=function(t){return t.item.caption},t}();t.Renderer=e,t.defaultRenderer=new e}(a=e.CommandPalette||(e.CommandPalette={})),e.CommandPalette=a,function(t){function e(t,e){for(var n=t.category.toLowerCase(),i=n+" "+t.label.toLowerCase(),r=1/0,o=null,a=/\b\w/g;;){var s=a.exec(i);if(!s)break;var u=x.StringExt.matchSumOfDeltas(i,e,s.index);if(!u)break;u&&u.score<=r&&(r=u.score,o=u.indices)}if(!o||r===1/0)return null;for(var c=n.length+1,h=x.ArrayExt.lowerBound(o,c,function(t,e){return t-e}),d=o.slice(0,h),l=o.slice(h),p=0,f=l.length;p<f;++p)l[p]-=c;return 0===d.length?{matchType:0,categoryIndices:null,labelIndices:l,score:r,item:t}:0===l.length?{matchType:1,categoryIndices:d,labelIndices:null,score:r,item:t}:{matchType:2,categoryIndices:d,labelIndices:l,score:r,item:t}}function n(t,e){var n=t.matchType-e.matchType;if(0!==n)return n;var i=t.score-e.score;if(0!==i)return i;var r=0,o=0;switch(t.matchType){case 0:r=t.labelIndices[0],o=e.labelIndices[0];break;case 1:case 2:r=t.categoryIndices[0],o=e.categoryIndices[0]}if(r!==o)return r-o;var a=t.item.category.localeCompare(e.item.category);if(0!==a)return a;var s=t.item.rank,u=e.item.rank;return s!==u?s<u?-1:1:t.item.label.localeCompare(e.item.label)}t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("input"),r=document.createElement("ul");return e.className="p-CommandPalette-search",n.className="p-CommandPalette-wrapper",i.className="p-CommandPalette-input",r.className="p-CommandPalette-content",i.spellcheck=!1,n.appendChild(i),e.appendChild(n),t.appendChild(e),t.appendChild(r),t},t.createItem=function(t,e){return new i(t,e)},t.formatKeystroke=function(t){var e="",n=bt.CommandRegistry.parseKeystroke(t);return gt.Platform.IS_MAC?(n.ctrl&&(e+="⌃ "),n.alt&&(e+="⌥ "),n.shift&&(e+="⇧ "),n.cmd&&(e+="⌘ ")):(n.ctrl&&(e+="Ctrl+"),n.alt&&(e+="Alt+"),n.shift&&(e+="Shift+")),e+n.key},t.search=function(t,i){var r=function(t,n){n=n.replace(/\s+/g,"").toLowerCase();for(var i=[],r=0,o=t.length;r<o;++r){var a=t[r];if(a.isVisible)if(n){var s=e(a,n);s&&(a.isEnabled||(s.score+=1e3),i.push(s))}else i.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:a})}return i}(t,i);return r.sort(n),function(t){var e=new Array(t.length);x.ArrayExt.fill(e,!1);for(var n=[],i=0,r=t.length;i<r;++i)if(!e[i]){var o=t[i],a=o.item,s=o.categoryIndices,u=a.category;n.push({type:"header",category:u,indices:s});for(var c=i;c<r;++c)if(!e[c]){var h=t[c],d=h.item,l=h.labelIndices;d.category===u&&(n.push({type:"item",item:d,indices:l}),e[c]=!0)}}return n}(r)},t.canActivate=function(t){return"item"===t.type&&t.item.isEnabled};var i=function(){function t(t,e){this._commands=t,this.category=e.category.trim().replace(/\s+/g," "),this.command=e.command,this.args=e.args||O.JSONExt.emptyObject,this.rank=void 0!==e.rank?e.rank:1/0}return Object.defineProperty(t.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBinding",{get:function(){var t=this.command,e=this.args;return x.ArrayExt.findLastValue(this._commands.keyBindings,function(n){return n.command===t&&O.JSONExt.deepEqual(n.args,e)})||null},enumerable:!0,configurable:!0}),t}()}(o||(o={}))});i(be);be.CommandPalette;var xe=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=n&&n.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o,a=function(t){function e(n){var i=t.call(this,{node:o.createNode()})||this;return i._childIndex=-1,i._activeIndex=-1,i._openTimerID=0,i._closeTimerID=0,i._items=[],i._childMenu=null,i._parentMenu=null,i._aboutToClose=new lt.Signal(i),i._menuRequested=new lt.Signal(i),i.addClass("p-Menu"),i.setFlag(Gt.Widget.Flag.DisallowLayout),i.commands=n.commands,i.renderer=n.renderer||e.defaultRenderer,i}return i(e,t),e.prototype.dispose=function(){this.close(),this._items.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootMenu",{get:function(){for(var t=this;t._parentMenu;)t=t._parentMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leafMenu",{get:function(){for(var t=this;t._childMenu;)t=t._childMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._items.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._items.length)&&(t=-1),-1===t||o.canActivate(this._items[t])||(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.activateNextItem=function(){var t=this._items.length,e=this._activeIndex,n=e<t-1?e+1:0,i=0===n?t-1:n-1;this.activeIndex=x.ArrayExt.findFirstIndex(this._items,o.canActivate,n,i)},e.prototype.activatePreviousItem=function(){var t=this._items.length,e=this._activeIndex,n=e<=0?t-1:e-1,i=n===t-1?0:n+1;this.activeIndex=x.ArrayExt.findLastIndex(this._items,o.canActivate,n,i)},e.prototype.triggerActiveItem=function(){if(this.isAttached){var t=this.activeItem;if(t)if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"!==t.type){this.rootMenu.close();var e=t.command,n=t.args;this.commands.isEnabled(e,n)?this.commands.execute(e,n):console.log("Command '"+e+"' is disabled.")}else this._openChildMenu(!0)}},e.prototype.addItem=function(t){return this.insertItem(this._items.length,t)},e.prototype.insertItem=function(t,e){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(t,this._items.length)),i=o.createItem(this,e);return x.ArrayExt.insert(this._items,n,i),this.update(),i},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){this.isAttached&&this.close(),this.activeIndex=-1,x.ArrayExt.removeAt(this._items,t)&&this.update()},e.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length&&(this._items.length=0,this.update())},e.prototype.open=function(t,e,n){if(void 0===n&&(n={}),!this.isAttached){var i=n.forceX||!1,r=n.forceY||!1;o.openRootMenu(this,t,e,i,r),this.activate()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mouseup":this._evtMouseUp(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseenter":this._evtMouseEnter(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"mousedown":this._evtMouseDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this._items,n=this.renderer,i=this._activeIndex,r=o.computeCollapsed(e),a=new Array(e.length),s=0,u=e.length;s<u;++s){var c=e[s],h=s===i,d=r[s];a[s]=n.renderItem({item:c,active:h,collapsed:d})}ye.VirtualDOM.render(a,this.contentNode)},e.prototype.onCloseRequest=function(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var n=this._childMenu;n&&(this._childIndex=-1,this._childMenu=null,n._parentMenu=null,n.close());var i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),t.prototype.onCloseRequest.call(this,e)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e)if(27!==e)if(37!==e)if(38!==e)if(39!==e)if(40!==e){var n=yt.getKeyboardLayout().keyForKeydownEvent(t);if(n){var i=this._activeIndex+1,r=o.findMnemonic(this._items,n,i);-1===r.index||r.multiple?-1!==r.index?this.activeIndex=r.index:-1!==r.auto&&(this.activeIndex=r.auto):(this.activeIndex=r.index,this.triggerActiveItem())}}else this.activateNextItem();else{var a=this.activeItem;a&&"submenu"===a.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next")}else this.activatePreviousItem();else this._parentMenu?this.close():this._menuRequested.emit("previous");else this.close();else this.triggerActiveItem()},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this.triggerActiveItem())},e.prototype._evtMouseMove=function(t){var e=x.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});if(e!==this._activeIndex){if(this.activeIndex=e,(e=this.activeIndex)===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;n&&"submenu"===n.type&&n.submenu&&this._startOpenTimer()}},e.prototype._evtMouseEnter=function(t){for(var e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex},e.prototype._evtMouseLeave=function(t){if(this._cancelOpenTimer(),this._childMenu){var e=t.clientX,n=t.clientY;gt.ElementExt.hitTest(this._childMenu.node,e,n)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}else this.activeIndex=-1},e.prototype._evtMouseDown=function(t){this._parentMenu||(o.hitTestMenus(this,t.clientX,t.clientY)?(t.preventDefault(),t.stopPropagation()):this.close())},e.prototype._openChildMenu=function(t){void 0===t&&(t=!1);var e=this.activeItem;if(e&&"submenu"===e.type&&e.submenu){var n=e.submenu;if(n!==this._childMenu){this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,qt.MessageLoop.sendMessage(this,Gt.Widget.Msg.UpdateRequest);var i=this.contentNode.children[this._activeIndex];o.openSubmenu(n,i),t&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},e.prototype._startOpenTimer=function(){var t=this;0===this._openTimerID&&(this._openTimerID=setTimeout(function(){t._openTimerID=0,t._openChildMenu()},o.TIMER_DELAY))},e.prototype._startCloseTimer=function(){var t=this;0===this._closeTimerID&&(this._closeTimerID=setTimeout(function(){t._closeTimerID=0,t._closeChildMenu()},o.TIMER_DELAY))},e.prototype._cancelOpenTimer=function(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)},e.prototype._cancelCloseTimer=function(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},e}(Gt.Widget);e.Menu=a,function(t){var e=function(){function t(){}return t.prototype.renderItem=function(t){var e=this.createItemClass(t),n=this.createItemDataset(t);return ye.h.li({className:e,dataset:n},this.renderIcon(t),this.renderLabel(t),this.renderShortcut(t),this.renderSubmenu(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return ye.h.div({className:e},t.item.iconLabel)},t.prototype.renderLabel=function(t){var e=this.formatLabel(t);return ye.h.div({className:"p-Menu-itemLabel"},e)},t.prototype.renderShortcut=function(t){var e=this.formatShortcut(t);return ye.h.div({className:"p-Menu-itemShortcut"},e)},t.prototype.renderSubmenu=function(t){return ye.h.div({className:"p-Menu-itemSubmenuIcon"})},t.prototype.createItemClass=function(t){var e="p-Menu-item";t.item.isEnabled||(e+=" p-mod-disabled"),t.item.isToggled&&(e+=" p-mod-toggled"),t.item.isVisible||(e+=" p-mod-hidden"),t.active&&(e+=" p-mod-active"),t.collapsed&&(e+=" p-mod-collapsed");var n=t.item.className;return n&&(e+=" "+n),e},t.prototype.createItemDataset=function(t){var e=t.item,n=e.type,i=e.command,o=e.dataset;return r({},o,"command"===n?{type:n,command:i}:{type:n})},t.prototype.createIconClass=function(t){var e="p-Menu-itemIcon",n=t.item.iconClass;return n?e+" "+n:e},t.prototype.formatLabel=function(t){var e=t.item,n=e.label,i=e.mnemonic;if(i<0||i>=n.length)return n;var r=n.slice(0,i),o=n.slice(i+1),a=n[i];return[r,ye.h.span({className:"p-Menu-itemMnemonic"},a),o]},t.prototype.formatShortcut=function(t){var e=t.item.keyBinding;return e?e.keys.map(o.formatKeystroke).join(", "):null},t}();t.Renderer=e,t.defaultRenderer=new e}(a=e.Menu||(e.Menu={})),e.Menu=a,function(t){function e(t){return"separator"!==t.type&&t.isEnabled&&t.isVisible}t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="p-Menu-content",t.appendChild(e),t.tabIndex=-1,t},t.canActivate=e,t.createItem=function(t,e){return new n(t.commands,e)},t.formatKeystroke=function(t){var e="",n=bt.CommandRegistry.parseKeystroke(t);return gt.Platform.IS_MAC?(n.ctrl&&(e+="⌃ "),n.alt&&(e+="⌥ "),n.shift&&(e+="⇧ "),n.cmd&&(e+="⌘ ")):(n.ctrl&&(e+="Ctrl+"),n.alt&&(e+="Alt+"),n.shift&&(e+="Shift+")),e+n.key},t.hitTestMenus=function(t,e,n){for(var i=t;i;i=i.childMenu)if(gt.ElementExt.hitTest(i.node,e,n))return!0;return!1},t.computeCollapsed=function(t){var e=new Array(t.length);x.ArrayExt.fill(e,!1);for(var n=0,i=t.length;n<i;++n)if((a=t[n]).isVisible){if("separator"!==a.type)break;e[n]=!0}for(var r=i-1;r>=0;--r)if((a=t[r]).isVisible){if("separator"!==a.type)break;e[r]=!0}for(var o=!1;++n<r;){var a;(a=t[n]).isVisible&&("separator"!==a.type?o=!1:o?e[n]=!0:o=!0)}return e},t.openRootMenu=function(t,e,n,i,r){qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.UpdateRequest);var o=window.pageXOffset,a=window.pageYOffset,s=document.documentElement.clientWidth,u=document.documentElement.clientHeight,c=u-(r?n:0),h=t.node,d=h.style;d.top="",d.left="",d.width="",d.height="",d.visibility="hidden",d.maxHeight=c+"px",Gt.Widget.attach(t,document.body);var l=h.getBoundingClientRect(),p=l.width,f=l.height;!i&&e+p>o+s&&(e=o+s-p),!r&&n+f>a+u&&(n>a+u?n=a+u-f:n-=f),d.top=Math.max(0,n)+"px",d.left=Math.max(0,e)+"px",d.visibility=""},t.openSubmenu=function(e,n){qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.UpdateRequest);var i=window.pageXOffset,r=window.pageYOffset,o=document.documentElement.clientWidth,a=document.documentElement.clientHeight,s=a,u=e.node,c=u.style;c.top="",c.left="",c.width="",c.height="",c.visibility="hidden",c.maxHeight=s+"px",Gt.Widget.attach(e,document.body);var h=u.getBoundingClientRect(),d=h.width,l=h.height,p=gt.ElementExt.boxSizing(e.node),f=n.getBoundingClientRect(),v=f.right-t.SUBMENU_OVERLAP;v+d>i+o&&(v=f.left+t.SUBMENU_OVERLAP-d);var m=f.top-p.borderTop-p.paddingTop;m+l>r+a&&(m=f.bottom+p.borderBottom+p.paddingBottom-l),c.top=Math.max(0,m)+"px",c.left=Math.max(0,v)+"px",c.visibility=""},t.findMnemonic=function(t,n,i){for(var r=-1,o=-1,a=!1,s=n.toUpperCase(),u=0,c=t.length;u<c;++u){var h=(u+i)%c,d=t[h];if(e(d)){var l=d.label;if(0!==l.length){var p=d.mnemonic;p>=0&&p<l.length?l[p].toUpperCase()===s&&(-1===r?r=h:a=!0):-1===o&&l[0].toUpperCase()===s&&(o=h)}}}return{index:r,multiple:a,auto:o}};var n=function(){function t(t,e){this._commands=t,this.type=e.type||"command",this.command=e.command||"",this.args=e.args||O.JSONExt.emptyObject,this.submenu=e.submenu||null}return Object.defineProperty(t.prototype,"label",{get:function(){return"command"===this.type?this._commands.label(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return"command"===this.type?this._commands.mnemonic(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return"command"===this.type?this._commands.iconClass(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return"command"===this.type?this._commands.iconLabel(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return"command"===this.type?this._commands.caption(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return"command"===this.type?this._commands.className(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return"command"===this.type?this._commands.dataset(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return"command"===this.type?this._commands.isEnabled(this.command,this.args):"submenu"!==this.type||null!==this.submenu},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggled",{get:function(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return"command"===this.type?this._commands.isVisible(this.command,this.args):"submenu"!==this.type||null!==this.submenu},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBinding",{get:function(){if("command"===this.type){var t=this.command,e=this.args;return x.ArrayExt.findLastValue(this._commands.keyBindings,function(n){return n.command===t&&O.JSONExt.deepEqual(n.args,e)})||null}return null},enumerable:!0,configurable:!0}),t}()}(o||(o={}))});i(xe);xe.Menu;var Me=r(function(t,e){var i=n&&n.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t){this._idTick=0,this._items=[],this.menu=new xe.Menu(t)}return t.prototype.addItem=function(t){var e=this,n=r.createItem(t,this._idTick++);return this._items.push(n),new pt.DisposableDelegate(function(){x.ArrayExt.removeFirstOf(e._items,n)})},t.prototype.open=function(t){var e=this;if(this.menu.clearItems(),0===this._items.length)return!1;var n=r.matchItems(this._items,t);return!(!n||0===n.length)&&(x.each(n,function(t){e.menu.addItem(t)}),this.menu.open(t.clientX,t.clientY),!0)},t}();e.ContextMenu=o,function(t){function e(t,e){var n=gt.Selector.calculateSpecificity(t.selector),i=gt.Selector.calculateSpecificity(e.selector);if(n!==i)return i-n;var r=t.rank,o=e.rank;return r!==o?r<o?-1:1:t.id-e.id}t.createItem=function(t,e){var n=function(t){if(-1!==t.indexOf(","))throw new Error("Selector cannot contain commas: "+t);if(!gt.Selector.isValid(t))throw new Error("Invalid selector: "+t);return t}(t.selector),r=void 0!==t.rank?t.rank:1/0;return i({},t,{selector:n,rank:r,id:e})},t.matchItems=function(t,n){var i=n.target;if(!i)return null;var r=n.currentTarget;if(!r)return null;if(!(r.contains(i)||(i=document.elementFromPoint(n.clientX,n.clientY))&&r.contains(i)))return null;for(var o=[],a=t.slice();null!==i;){for(var s=[],u=0,c=a.length;u<c;++u){var h=a[u];h&&gt.Selector.matches(i,h.selector)&&(s.push(h),a[u]=null)}if(0!==s.length&&(s.sort(e),o.push.apply(o,s)),i===r)break;i=i.parentElement}return o}}(r||(r={}))});i(Me);Me.ContextMenu;var we=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){var n=t.call(this)||this;return n._spacing=4,n._dirty=!1,n._root=null,n._box=null,n._items=new Map,n.renderer=e.renderer,void 0!==e.spacing&&(n._spacing=r.clampSpacing(e.spacing)),n}return i(e,t),e.prototype.dispose=function(){var e=this.iter();this._items.forEach(function(t){t.dispose()}),this._box=null,this._root=null,this._items.clear(),x.each(e,function(t){t.dispose()}),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=r.clampSpacing(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return null===this._root},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._root?this._root.iterAllWidgets():x.empty()},e.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():x.empty()},e.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():x.empty()},e.prototype.tabBars=function(){return this._root?this._root.iterTabBars():x.empty()},e.prototype.handles=function(){return this._root?this._root.iterHandles():x.empty()},e.prototype.moveHandle=function(t,e,n){if(this._root&&!t.classList.contains("p-mod-hidden")){var i,r=this._root.findSplitNode(t);if(r)0!==(i="horizontal"===r.node.orientation?e-t.offsetLeft:n-t.offsetTop)&&(r.node.holdSizes(),Ut.BoxEngine.adjust(r.node.sizers,r.index,i),this.parent&&this.parent.update())}},e.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},e.prototype.restoreLayout=function(t){var e,n=this,i=new Set;e=t.main?r.normalizeAreaConfig(t.main,i):null;var o=this.widgets(),a=this.tabBars(),s=this.handles();this._root=null,x.each(o,function(t){i.has(t)||(t.parent=null)}),x.each(a,function(t){t.dispose()}),x.each(s,function(t){t.parentNode&&t.parentNode.removeChild(t)}),i.forEach(function(t){t.parent=n.parent}),this._root=e?r.realizeAreaConfig(e,{createTabBar:function(){return n._createTabBar()},createHandle:function(){return n._createHandle()}}):null,this.parent&&(i.forEach(function(t){n.attachWidget(t)}),this.parent.fit())},e.prototype.addWidget=function(t,e){void 0===e&&(e={});var n=e.ref||null,i=e.mode||"tab-after",r=null;if(this._root&&n&&(r=this._root.findTabNode(n)),n&&!r)throw new Error("Reference widget is not in the layout.");switch(t.parent=this.parent,i){case"tab-after":this._insertTab(t,n,r,!0);break;case"tab-before":this._insertTab(t,n,r,!1);break;case"split-top":this._insertSplit(t,n,r,"vertical",!1);break;case"split-left":this._insertSplit(t,n,r,"horizontal",!1);break;case"split-right":this._insertSplit(t,n,r,"horizontal",!0);break;case"split-bottom":this._insertSplit(t,n,r,"vertical",!0)}this.parent&&(this.attachWidget(t),this.parent.fit())},e.prototype.removeWidget=function(t){this._removeWidget(t),this.parent&&(this.detachWidget(t),this.parent.fit())},e.prototype.hitTestTabAreas=function(t,e){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var n=this.parent.node.getBoundingClientRect(),i=t-n.left-this._box.borderLeft,r=e-n.top-this._box.borderTop,o=this._root.hitTestTabNodes(i,r);if(!o)return null;var a=o.tabBar,s=o.top,u=o.left,c=o.width,h=o.height,d=this._box.borderLeft+this._box.borderRight,l=this._box.borderTop+this._box.borderBottom;return{tabBar:a,x:i,y:r,top:s,left:u,right:n.width-d-(u+c),bottom:n.height-l-(s+h),width:c,height:h}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),x.each(this,function(t){e.attachWidget(t)}),x.each(this.handles(),function(t){e.parent.node.appendChild(t)}),this.parent.fit()},e.prototype.attachWidget=function(t){this.parent.node!==t.node.parentNode&&(this._items.set(t,new Jt.LayoutItem(t)),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterAttach))},e.prototype.detachWidget=function(t){if(this.parent.node===t.node.parentNode){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterDetach);var e=this._items.get(t);e&&(this._items.delete(t),e.dispose())}},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._removeWidget=function(t){if(this._root){var e=this._root.findTabNode(t);if(e)if(e.tabBar.titles.length>1)e.tabBar.removeTab(t.title);else if(e.tabBar.dispose(),this._root!==e){this._root.holdAllSizes();var n=e.parent;e.parent=null;var i=x.ArrayExt.removeFirstOf(n.children,e),o=x.ArrayExt.removeAt(n.handles,i);if(x.ArrayExt.removeAt(n.sizers,i),o.parentNode&&o.parentNode.removeChild(o),n.children.length>1)n.syncHandles();else{var a=n.parent;n.parent=null;var s=n.children[0],u=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,u.parentNode&&u.parentNode.removeChild(u),this._root===n)return s.parent=null,void(this._root=s);var c=a,h=c.children.indexOf(n);if(s instanceof r.TabLayoutNode)return s.parent=c,void(c.children[h]=s);var d=x.ArrayExt.removeAt(c.handles,h);x.ArrayExt.removeAt(c.children,h),x.ArrayExt.removeAt(c.sizers,h),d.parentNode&&d.parentNode.removeChild(d);for(var l=0,p=s.children.length;l<p;++l){var f=s.children[l],v=s.handles[l],m=s.sizers[l];x.ArrayExt.insert(c.children,h+l,f),x.ArrayExt.insert(c.handles,h+l,v),x.ArrayExt.insert(c.sizers,h+l,m),f.parent=c}s.children.length=0,s.handles.length=0,s.sizers.length=0,s.parent=null,c.syncHandles()}}else this._root=null}},e.prototype._insertTab=function(t,e,n,i){if(t!==e){if(!this._root){var o=new r.TabLayoutNode(this._createTabBar());return o.tabBar.addTab(t.title),void(this._root=o)}var a;n||(n=this._root.findFirstTabNode()),-1===n.tabBar.titles.indexOf(t.title)&&(this._removeWidget(t),t.hide()),a=e?n.tabBar.titles.indexOf(e.title):n.tabBar.currentIndex,n.tabBar.insertTab(a+(i?1:0),t.title)}},e.prototype._insertSplit=function(t,e,n,i,o){if(t!==e||!n||1!==n.tabBar.titles.length){this._removeWidget(t);var a=new r.TabLayoutNode(this._createTabBar());if(a.tabBar.addTab(t.title),this._root){if(!n||!n.parent){var s=this._splitRoot(i),u=o?s.children.length:0;s.normalizeSizes();var c=r.createSizer(n?1:r.GOLDEN_RATIO);return x.ArrayExt.insert(s.children,u,a),x.ArrayExt.insert(s.sizers,u,c),x.ArrayExt.insert(s.handles,u,this._createHandle()),a.parent=s,s.normalizeSizes(),void s.syncHandles()}var h=n.parent;if(h.orientation===i){var d=h.children.indexOf(n);h.normalizeSizes();var l=h.sizers[d].sizeHint/=2,p=d+(o?1:0);return x.ArrayExt.insert(h.children,p,a),x.ArrayExt.insert(h.sizers,p,r.createSizer(l)),x.ArrayExt.insert(h.handles,p,this._createHandle()),a.parent=h,void h.syncHandles()}var f=x.ArrayExt.removeFirstOf(h.children,n),v=new r.SplitLayoutNode(i);v.normalized=!0,v.children.push(n),v.sizers.push(r.createSizer(.5)),v.handles.push(this._createHandle()),n.parent=v;var m=o?1:0;x.ArrayExt.insert(v.children,m,a),x.ArrayExt.insert(v.sizers,m,r.createSizer(.5)),x.ArrayExt.insert(v.handles,m,this._createHandle()),a.parent=v,v.syncHandles(),x.ArrayExt.insert(h.children,f,v),v.parent=h}else this._root=a}},e.prototype._splitRoot=function(t){var e=this._root;if(e instanceof r.SplitLayoutNode&&e.orientation===t)return e;var n=this._root=new r.SplitLayoutNode(t);return e&&(n.children.push(e),n.sizers.push(r.createSizer(0)),n.handles.push(this._createHandle()),e.parent=n),n},e.prototype._fit=function(){var t=0,e=0;if(this._root){var n=this._root.fit(this._spacing,this._items);t=n.minWidth,e=n.minHeight}var i=this._box=gt.ElementExt.boxSizing(this.parent.node);t+=i.horizontalSum,e+=i.verticalSum;var r=this.parent.node.style;r.minWidth=t+"px",r.minHeight=e+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){if(this._dirty=!1,this._root){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var n=this._box.paddingTop,i=this._box.paddingLeft,r=t-this._box.horizontalSum,o=e-this._box.verticalSum;this._root.update(n,i,r,o,this._spacing,this._items)}},e.prototype._createTabBar=function(){var t=this.renderer.createTabBar();return t.orientation="horizontal",this.parent&&(t.parent=this.parent,this.attachWidget(t)),t},e.prototype._createHandle=function(){var t=this.renderer.createHandle(),e=t.style;return e.position="absolute",e.top="0",e.left="0",e.width="0",e.height="0",this.parent&&this.parent.node.appendChild(t),t},e}(Jt.Layout);e.DockLayout=o,function(t){function e(t){var e=new Ut.BoxSizer;return e.sizeHint=t,e.size=t,e}function n(t,e){return"tab-area"===t.type?function(t,e){if(0===t.widgets.length)return null;var n=[];if(x.each(t.widgets,function(t){e.has(t)||(e.add(t),n.push(t))}),0===n.length)return null;var i=t.currentIndex;-1!==i&&(i<0||i>=n.length)&&(i=0);return{type:"tab-area",widgets:n,currentIndex:i}}(t,e):function(t,e){for(var i=t.orientation,r=[],o=[],a=0,s=t.children.length;a<s;++a){var u=n(t.children[a],e);u&&("tab-area"===u.type||u.orientation!==i?(r.push(u),o.push(Math.abs(t.sizes[a]||0))):(r.push.apply(r,u.children),o.push.apply(o,u.sizes)))}if(0===r.length)return null;if(1===r.length)return r[0];return{type:"split-area",orientation:i,children:r,sizes:o}}(t,e)}function i(t,n){return"tab-area"===t.type?function(t,e){var n=e.createTabBar();return x.each(t.widgets,function(t){t.hide(),n.addTab(t.title)}),n.currentIndex=t.currentIndex,new r(n)}(t,n):function(t,n){var r=new o(t.orientation);return x.each(t.children,function(o,a){var s=i(o,n),u=e(t.sizes[a]),c=n.createHandle();r.children.push(s),r.handles.push(c),r.sizers.push(u),s.parent=r}),r.syncHandles(),r.normalizeSizes(),r}(t,n)}t.GOLDEN_RATIO=.618,t.clampSpacing=function(t){return Math.max(0,Math.floor(t))},t.createSizer=e,t.normalizeAreaConfig=n,t.realizeAreaConfig=i;var r=function(){function t(t){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var e=new Ut.BoxSizer,n=new Ut.BoxSizer;e.stretch=0,n.stretch=1,this.tabBar=t,this.sizers=[e,n]}return Object.defineProperty(t.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.iterAllWidgets=function(){return x.chain(x.once(this.tabBar),this.iterUserWidgets())},t.prototype.iterUserWidgets=function(){return x.map(this.tabBar.titles,function(t){return t.owner})},t.prototype.iterSelectedWidgets=function(){var t=this.tabBar.currentTitle;return t?x.once(t.owner):x.empty()},t.prototype.iterTabBars=function(){return x.once(this.tabBar)},t.prototype.iterHandles=function(){return x.empty()},t.prototype.findTabNode=function(t){return-1!==this.tabBar.titles.indexOf(t.title)?this:null},t.prototype.findSplitNode=function(t){return null},t.prototype.findFirstTabNode=function(){return this},t.prototype.hitTestTabNodes=function(t,e){return t<this._left||t>=this._left+this._width?null:e<this._top||e>=this._top+this._height?null:this},t.prototype.createConfig=function(){return{type:"tab-area",widgets:this.tabBar.titles.map(function(t){return t.owner}),currentIndex:this.tabBar.currentIndex}},t.prototype.holdAllSizes=function(){},t.prototype.fit=function(t,e){var n=0,i=0,r=e.get(this.tabBar),o=this.tabBar.currentTitle,a=o?e.get(o.owner):void 0,s=this.sizers,u=s[0],c=s[1];return r&&r.fit(),a&&a.fit(),r&&!r.isHidden?(n=Math.max(n,r.minWidth),i+=r.minHeight,u.minSize=r.minHeight,u.maxSize=r.maxHeight):(u.minSize=0,u.maxSize=0),a&&!a.isHidden?(n=Math.max(n,a.minWidth),i+=a.minHeight,c.minSize=a.minHeight,c.maxSize=1/0):(c.minSize=0,c.maxSize=1/0),{minWidth:n,minHeight:i,maxWidth:1/0,maxHeight:1/0}},t.prototype.update=function(t,e,n,i,r,o){this._top=e,this._left=t,this._width=n,this._height=i;var a=o.get(this.tabBar),s=this.tabBar.currentTitle,u=s?o.get(s.owner):void 0;if(Ut.BoxEngine.calc(this.sizers,i),a&&!a.isHidden){var c=this.sizers[0].size;a.update(t,e,n,c),e+=c}if(u&&!u.isHidden){c=this.sizers[1].size;u.update(t,e,n,c)}},t}();t.TabLayoutNode=r;var o=function(){function t(t){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=t}return t.prototype.iterAllWidgets=function(){var t=x.map(this.children,function(t){return t.iterAllWidgets()});return new x.ChainIterator(t)},t.prototype.iterUserWidgets=function(){var t=x.map(this.children,function(t){return t.iterUserWidgets()});return new x.ChainIterator(t)},t.prototype.iterSelectedWidgets=function(){var t=x.map(this.children,function(t){return t.iterSelectedWidgets()});return new x.ChainIterator(t)},t.prototype.iterTabBars=function(){var t=x.map(this.children,function(t){return t.iterTabBars()});return new x.ChainIterator(t)},t.prototype.iterHandles=function(){var t=x.map(this.children,function(t){return t.iterHandles()});return x.chain(this.handles,new x.ChainIterator(t))},t.prototype.findTabNode=function(t){for(var e=0,n=this.children.length;e<n;++e){var i=this.children[e].findTabNode(t);if(i)return i}return null},t.prototype.findSplitNode=function(t){var e=this.handles.indexOf(t);if(-1!==e)return{index:e,node:this};for(var n=0,i=this.children.length;n<i;++n){var r=this.children[n].findSplitNode(t);if(r)return r}return null},t.prototype.findFirstTabNode=function(){return 0===this.children.length?null:this.children[0].findFirstTabNode()},t.prototype.hitTestTabNodes=function(t,e){for(var n=0,i=this.children.length;n<i;++n){var r=this.children[n].hitTestTabNodes(t,e);if(r)return r}return null},t.prototype.createConfig=function(){var t=this.orientation,e=this.createNormalizedSizes();return{type:"split-area",orientation:t,children:this.children.map(function(t){return t.createConfig()}),sizes:e}},t.prototype.syncHandles=function(){var t=this;x.each(this.handles,function(e,n){e.setAttribute("data-orientation",t.orientation),n===t.handles.length-1?e.classList.add("p-mod-hidden"):e.classList.remove("p-mod-hidden")})},t.prototype.holdSizes=function(){x.each(this.sizers,function(t){t.sizeHint=t.size})},t.prototype.holdAllSizes=function(){x.each(this.children,function(t){return t.holdAllSizes()}),this.holdSizes()},t.prototype.normalizeSizes=function(){var t=this.sizers.length;if(0!==t){this.holdSizes();var e=x.reduce(this.sizers,function(t,e){return t+e.sizeHint},0);0===e?x.each(this.sizers,function(e){e.size=e.sizeHint=1/t}):x.each(this.sizers,function(t){t.size=t.sizeHint/=e}),this.normalized=!0}},t.prototype.createNormalizedSizes=function(){var t=this.sizers.length;if(0===t)return[];var e=this.sizers.map(function(t){return t.size}),n=x.reduce(e,function(t,e){return t+e},0);return 0===n?x.each(e,function(n,i){e[i]=1/t}):x.each(e,function(t,i){e[i]=t/n}),e},t.prototype.fit=function(t,e){for(var n="horizontal"===this.orientation,i=Math.max(0,this.children.length-1)*t,r=n?i:0,o=n?0:i,a=0,s=this.children.length;a<s;++a){var u=this.children[a].fit(t,e);n?(o=Math.max(o,u.minHeight),r+=u.minWidth,this.sizers[a].minSize=u.minWidth):(r=Math.max(r,u.minWidth),o+=u.minHeight,this.sizers[a].minSize=u.minHeight)}return{minWidth:r,minHeight:o,maxWidth:1/0,maxHeight:1/0}},t.prototype.update=function(t,e,n,i,r,o){var a="horizontal"===this.orientation,s=Math.max(0,this.children.length-1)*r,u=Math.max(0,(a?n:i)-s);this.normalized&&(x.each(this.sizers,function(t){t.sizeHint*=u}),this.normalized=!1),Ut.BoxEngine.calc(this.sizers,u);for(var c=0,h=this.children.length;c<h;++c){var d=this.children[c],l=this.sizers[c].size,p=this.handles[c].style;a?(d.update(t,e,l,i,r,o),t+=l,p.top=e+"px",p.left=t+"px",p.width=r+"px",p.height=i+"px",t+=r):(d.update(t,e,n,l,r,o),e+=l,p.top=e+"px",p.left=t+"px",p.width=n+"px",p.height=r+"px",e+=r)}},t}();t.SplitLayoutNode=o}(r||(r={}))});i(we);we.DockLayout;var Pe=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t){var e=this;this._onScrollFrame=function(){if(e._scrollTarget){var t=e._scrollTarget,i=t.element,r=t.edge,o=t.distance,a=n.SCROLL_EDGE_SIZE-o,s=Math.pow(a/n.SCROLL_EDGE_SIZE,2),u=Math.max(1,Math.round(s*n.SCROLL_EDGE_SIZE));switch(r){case"top":i.scrollTop-=u;break;case"left":i.scrollLeft-=u;break;case"right":i.scrollLeft+=u;break;case"bottom":i.scrollTop+=u}requestAnimationFrame(e._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.mimeData=t.mimeData,this.dragImage=t.dragImage||null,this.proposedAction=t.proposedAction||"copy",this.supportedActions=t.supportedActions||"all",this.source=t.source||null}return t.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var t=n.createMouseEvent("mouseup",-1,-1);n.dispatchDragLeave(this,this._currentTarget,null,t)}this._finalize("none")}},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),t.prototype.start=function(t,e){var i=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(t,e),this._promise=new Promise(function(t,e){i._resolve=t});var r=n.createMouseEvent("mousemove",t,e);return document.dispatchEvent(r),this._promise},t.prototype.handleEvent=function(t){switch(t.type){case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;default:t.preventDefault(),t.stopPropagation()}},t.prototype._evtMouseMove=function(t){t.preventDefault(),t.stopPropagation(),this._updateCurrentTarget(t),this._updateDragScroll(t),this._moveDragImage(t.clientX,t.clientY)},t.prototype._evtMouseUp=function(t){if(t.preventDefault(),t.stopPropagation(),0===t.button)if(this._updateCurrentTarget(t),this._currentTarget){if("none"===this._dropAction)return n.dispatchDragLeave(this,this._currentTarget,null,t),void this._finalize("none");var e=n.dispatchDrop(this,this._currentTarget,t);this._finalize(e)}else this._finalize("none")},t.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this.dispose()},t.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},t.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},t.prototype._updateDragScroll=function(t){var e=n.findScrollTarget(t);(this._scrollTarget||e)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=e)},t.prototype._updateCurrentTarget=function(t){var e=this._currentTarget,i=this._currentTarget,r=this._currentElement,o=document.elementFromPoint(t.clientX,t.clientY);this._currentElement=o,o!==r&&o!==i&&n.dispatchDragExit(this,i,o,t),o!==r&&o!==i&&(i=n.dispatchDragEnter(this,o,i,t)),i!==e&&(this._currentTarget=i,n.dispatchDragLeave(this,e,i,t));var a=n.dispatchDragOver(this,i,t);this._setDropAction(a)},t.prototype._attachDragImage=function(t,e){if(this.dragImage){this.dragImage.classList.add("p-mod-drag-image");var n=this.dragImage.style;n.pointerEvents="none",n.position="fixed",n.top=e+"px",n.left=t+"px",document.body.appendChild(this.dragImage)}},t.prototype._moveDragImage=function(t,e){if(this.dragImage){var n=this.dragImage.style;n.top=e+"px",n.left=t+"px"}},t.prototype._detachDragImage=function(){if(this.dragImage){var t=this.dragImage.parentNode;t&&t.removeChild(this.dragImage)}},t.prototype._setDropAction=function(e){if(e=n.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=t.overrideCursor("no-drop");break;case"copy":this._dropAction=e,this._override=t.overrideCursor("copy");break;case"link":this._dropAction=e,this._override=t.overrideCursor("alias");break;case"move":this._dropAction=e,this._override=t.overrideCursor("move")}},t.prototype._finalize=function(t){var e=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,e&&e(t)},t}();e.Drag=i,function(t){t.overrideCursor=function(t){var n=++e;return document.body.style.cursor=t,document.body.classList.add("p-mod-override-cursor"),new pt.DisposableDelegate(function(){n===e&&(document.body.style.cursor="",document.body.classList.remove("p-mod-override-cursor"))})};var e=0}(i=e.Drag||(e.Drag={})),e.Drag=i,function(t){t.SCROLL_EDGE_SIZE=20,t.validateAction=function(t,i){return e[t]&n[i]?t:"none"},t.createMouseEvent=function(t,e,n){var i=document.createEvent("MouseEvent");return i.initMouseEvent(t,!0,!0,window,0,0,0,e,n,!1,!1,!1,!1,0,null),i},t.findScrollTarget=function(e){for(var n=e.clientX,i=e.clientY,r=document.elementFromPoint(n,i);r;r=r.parentElement)if(r.hasAttribute("data-p-dragscroll")){var o=0,a=0;r===document.body&&(o=window.pageXOffset,a=window.pageYOffset);var s=r.getBoundingClientRect(),u=s.top+a,c=s.left+o,h=c+s.width,d=u+s.height;if(!(n<c||n>=h||i<u||i>=d)){var l=n-c+1,p=i-u+1,f=h-n,v=d-i,m=Math.min(l,p,f,v);if(!(m>t.SCROLL_EDGE_SIZE)){var _=void 0;switch(m){case v:_="bottom";break;case p:_="top";break;case f:_="right";break;case l:_="left";break;default:throw"unreachable"}var g=r.scrollWidth-r.clientWidth,y=r.scrollHeight-r.clientHeight,b=void 0;switch(_){case"top":b=y>0&&r.scrollTop>0;break;case"left":b=g>0&&r.scrollLeft>0;break;case"right":b=g>0&&r.scrollLeft<g;break;case"bottom":b=y>0&&r.scrollTop<y;break;default:throw"unreachable"}if(b)return{element:r,edge:_,distance:m}}}}return null},t.dispatchDragEnter=function(t,e,n,r){if(!e)return null;var o=i("p-dragenter",t,r,n);return e.dispatchEvent(o)?e===document.body?n:(o=i("p-dragenter",t,r,n),document.body.dispatchEvent(o),document.body):e},t.dispatchDragExit=function(t,e,n,r){if(e){var o=i("p-dragexit",t,r,n);e.dispatchEvent(o)}},t.dispatchDragLeave=function(t,e,n,r){if(e){var o=i("p-dragleave",t,r,n);e.dispatchEvent(o)}},t.dispatchDragOver=function(t,e,n){if(!e)return"none";var r=i("p-dragover",t,n,null);return e.dispatchEvent(r)?"none":r.dropAction},t.dispatchDrop=function(t,e,n){if(!e)return"none";var r=i("p-drop",t,n,null);return e.dispatchEvent(r)?"none":r.dropAction};var e={none:0,copy:1,link:2,move:4},n={none:e.none,copy:e.copy,link:e.link,move:e.move,"copy-link":e.copy|e.link,"copy-move":e.copy|e.move,"link-move":e.link|e.move,all:e.copy|e.link|e.move};function i(t,e,n,i){var r=document.createEvent("MouseEvent");return r.initMouseEvent(t,!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.button,i),r.dropAction="none",r.mimeData=e.mimeData,r.proposedAction=e.proposedAction,r.supportedActions=e.supportedActions,r.source=e.source,r}}(n||(n={}))});i(Pe);Pe.Drag;var Ie=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(n){void 0===n&&(n={});var i=t.call(this,{node:r.createNode()})||this;return i._currentIndex=-1,i._titles=[],i._previousTitle=null,i._dragData=null,i._tabMoved=new lt.Signal(i),i._currentChanged=new lt.Signal(i),i._tabCloseRequested=new lt.Signal(i),i._tabDetachRequested=new lt.Signal(i),i._tabActivateRequested=new lt.Signal(i),i.addClass("p-TabBar"),i.setFlag(Gt.Widget.Flag.DisallowLayout),i.tabsMovable=n.tabsMovable||!1,i.allowDeselect=n.allowDeselect||!1,i.insertBehavior=n.insertBehavior||"select-tab-if-needed",i.removeBehavior=n.removeBehavior||"select-tab-after",i.renderer=n.renderer||e.defaultRenderer,i._orientation=n.orientation||"horizontal",i.dataset.orientation=i._orientation,i}return i(e,t),e.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(t){this.currentIndex=t?this._titles.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(t){if((t<0||t>=this._titles.length)&&(t=-1),this._currentIndex!==t){var e=this._currentIndex,n=this._titles[e]||null,i=t,r=this._titles[i]||null;this._currentIndex=i,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:e,previousTitle:n,currentIndex:i,currentTitle:r})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-TabBar-content")[0]},enumerable:!0,configurable:!0}),e.prototype.addTab=function(t){return this.insertTab(this._titles.length,t)},e.prototype.insertTab=function(t,e){this._releaseMouse();var n=r.asTitle(e),i=this._titles.indexOf(n),o=Math.max(0,Math.min(t,this._titles.length));return-1===i?(x.ArrayExt.insert(this._titles,o,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,n),n):(o===this._titles.length&&o--,i===o?n:(x.ArrayExt.move(this._titles,i,o),this.update(),this._adjustCurrentForMove(i,o),n))},e.prototype.removeTab=function(t){this.removeTabAt(this._titles.indexOf(t))},e.prototype.removeTabAt=function(t){this._releaseMouse();var e=x.ArrayExt.removeAt(this._titles,t);e&&(e.changed.disconnect(this._onTitleChanged,this),e===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(t,e))},e.prototype.clearTabs=function(){if(0!==this._titles.length){this._releaseMouse();for(var t=0,e=this._titles;t<e.length;t++){e[t].changed.disconnect(this._onTitleChanged,this)}var n=this.currentIndex,i=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==n&&this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:-1,currentTitle:null})}},e.prototype.releaseMouse=function(){this._releaseMouse()},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){for(var e=this._titles,n=this.renderer,i=this.currentTitle,r=new Array(e.length),o=0,a=e.length;o<a;++o){var s=e[o],u=s===i,c=u?a:a-o-1;r[o]=n.renderTab({title:s,current:u,zIndex:c})}ye.VirtualDOM.render(r,this.contentNode)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if((0===t.button||1===t.button)&&!this._dragData){var e=this.contentNode.children,n=x.ArrayExt.findFirstIndex(e,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});if(-1!==n&&(t.preventDefault(),t.stopPropagation(),this._dragData={tab:e[n],index:n,pressX:t.clientX,pressY:t.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},document.addEventListener("mouseup",this,!0),1!==t.button)){var i=e[n].querySelector(this.renderer.closeIconSelector);i&&i.contains(t.target)||(this.tabsMovable&&(document.addEventListener("mousemove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===n?this.currentIndex=-1:this.currentIndex=n,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},e.prototype._evtMouseMove=function(t){var e=this._dragData;if(e){t.preventDefault(),t.stopPropagation();var n=this.contentNode.children;if(e.dragActive||r.dragExceeded(e,t)){if(!e.dragActive){var i=e.tab.getBoundingClientRect();"horizontal"===this._orientation?(e.tabPos=e.tab.offsetLeft,e.tabSize=i.width,e.tabPressPos=e.pressX-i.left):(e.tabPos=e.tab.offsetTop,e.tabSize=i.height,e.tabPressPos=e.pressY-i.top),e.tabLayout=r.snapTabLayout(n,this._orientation),e.contentRect=this.contentNode.getBoundingClientRect(),e.override=Pe.Drag.overrideCursor("default"),e.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),e.dragActive=!0}if(!e.detachRequested&&r.detachExceeded(e,t)){e.detachRequested=!0;var o=e.index,a=t.clientX,s=t.clientY,u=n[o],c=this._titles[o];if(this._tabDetachRequested.emit({index:o,title:c,tab:u,clientX:a,clientY:s}),e.dragAborted)return}r.layoutTabs(n,e,t,this._orientation)}}},e.prototype._evtMouseUp=function(t){var e=this;if(0===t.button||1===t.button){var n=this._dragData;if(n){if(t.preventDefault(),t.stopPropagation(),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),!n.dragActive){this._dragData=null;var i=this.contentNode.children,o=x.ArrayExt.findFirstIndex(i,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});if(o!==n.index)return;var a=this._titles[o];if(!a.closable)return;if(1===t.button)return void this._tabCloseRequested.emit({index:o,title:a});var s=i[o].querySelector(this.renderer.closeIconSelector);return s&&s.contains(t.target)?void this._tabCloseRequested.emit({index:o,title:a}):void 0}if(0===t.button){r.finalizeTabPosition(n,this._orientation),n.tab.classList.remove("p-mod-dragging");var u=r.parseTransitionDuration(n.tab);setTimeout(function(){if(!n.dragAborted){e._dragData=null,r.resetTabPositions(e.contentNode.children,e._orientation),n.override.dispose(),e.removeClass("p-mod-dragging");var t=n.index,i=n.targetIndex;-1!==i&&t!==i&&(x.ArrayExt.move(e._titles,t,i),e._adjustCurrentForMove(t,i),e._tabMoved.emit({fromIndex:t,toIndex:i,title:e._titles[i]}),qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.UpdateRequest))}},u)}}}},e.prototype._releaseMouse=function(){var t=this._dragData;t&&(this._dragData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),t.dragAborted=!0,t.dragActive&&(r.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),t.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},e.prototype._adjustCurrentForInsert=function(t,e){var n=this.currentTitle,i=this._currentIndex,r=this.insertBehavior;if("select-tab"===r||"select-tab-if-needed"===r&&-1===i)return this._currentIndex=t,this._previousTitle=n,void this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:t,currentTitle:e});i>=t&&this._currentIndex++},e.prototype._adjustCurrentForMove=function(t,e){this._currentIndex===t?this._currentIndex=e:this._currentIndex<t&&this._currentIndex>=e?this._currentIndex++:this._currentIndex>t&&this._currentIndex<=e&&this._currentIndex--},e.prototype._adjustCurrentForRemove=function(t,e){var n=this._currentIndex,i=this.removeBehavior;if(n===t){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null});if("select-tab-after"===i)return this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===i)return this._currentIndex=Math.max(0,t-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-previous-tab"===i)return this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null})}else n>t&&this._currentIndex--},e.prototype._onTitleChanged=function(t){this.update()},e}(Gt.Widget);e.TabBar=o,function(t){var e=function(){function t(){this.closeIconSelector=".p-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap}return t.prototype.renderTab=function(t){var e=t.title.caption,n=this.createTabKey(t),i=this.createTabStyle(t),r=this.createTabClass(t),o=this.createTabDataset(t);return ye.h.li({key:n,className:r,title:e,style:i,dataset:o},this.renderIcon(t),this.renderLabel(t),this.renderCloseIcon(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return ye.h.div({className:e},t.title.iconLabel)},t.prototype.renderLabel=function(t){return ye.h.div({className:"p-TabBar-tabLabel"},t.title.label)},t.prototype.renderCloseIcon=function(t){return ye.h.div({className:"p-TabBar-tabCloseIcon"})},t.prototype.createTabKey=function(t){var e=this._tabKeys.get(t.title);return void 0===e&&(e="tab-key-"+this._tabID++,this._tabKeys.set(t.title,e)),e},t.prototype.createTabStyle=function(t){return{zIndex:""+t.zIndex}},t.prototype.createTabClass=function(t){var e="p-TabBar-tab";return t.title.className&&(e+=" "+t.title.className),t.title.closable&&(e+=" p-mod-closable"),t.current&&(e+=" p-mod-current"),e},t.prototype.createTabDataset=function(t){return t.title.dataset},t.prototype.createIconClass=function(t){var e="p-TabBar-tabIcon",n=t.title.iconClass;return n?e+" "+n:e},t}();t.Renderer=e,t.defaultRenderer=new e}(o=e.TabBar||(e.TabBar={})),e.TabBar=o,function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="p-TabBar-content",t.appendChild(e),t},t.asTitle=function(t){return t instanceof Xt.Title?t:new Xt.Title(t)},t.parseTransitionDuration=function(t){var e=window.getComputedStyle(t);return 1e3*(parseFloat(e.transitionDuration)||0)},t.snapTabLayout=function(t,e){for(var n=new Array(t.length),i=0,r=t.length;i<r;++i){var o=t[i],a=window.getComputedStyle(o);n[i]="horizontal"===e?{pos:o.offsetLeft,size:o.offsetWidth,margin:parseFloat(a.marginLeft)||0}:{pos:o.offsetTop,size:o.offsetHeight,margin:parseFloat(a.marginTop)||0}}return n},t.dragExceeded=function(e,n){var i=Math.abs(n.clientX-e.pressX),r=Math.abs(n.clientY-e.pressY);return i>=t.DRAG_THRESHOLD||r>=t.DRAG_THRESHOLD},t.detachExceeded=function(e,n){var i=e.contentRect;return n.clientX<i.left-t.DETACH_THRESHOLD||n.clientX>=i.right+t.DETACH_THRESHOLD||n.clientY<i.top-t.DETACH_THRESHOLD||n.clientY>=i.bottom+t.DETACH_THRESHOLD},t.layoutTabs=function(t,e,n,i){var r,o,a,s;"horizontal"===i?(r=e.pressX,o=n.clientX-e.contentRect.left,a=n.clientX,s=e.contentRect.width):(r=e.pressY,o=n.clientY-e.contentRect.top,a=n.clientY,s=e.contentRect.height);for(var u=e.index,c=o-e.tabPressPos,h=c+e.tabSize,d=0,l=t.length;d<l;++d){var p=void 0,f=e.tabLayout[d],v=f.pos+(f.size>>1);if(d<e.index&&c<v)p=e.tabSize+e.tabLayout[d+1].margin+"px",u=Math.min(u,d);else if(d>e.index&&h>v)p=-e.tabSize-f.margin+"px",u=Math.max(u,d);else if(d===e.index){var m=a-r,_=s-(e.tabPos+e.tabSize);p=Math.max(-e.tabPos,Math.min(m,_))+"px"}else p="";"horizontal"===i?t[d].style.left=p:t[d].style.top=p}e.targetIndex=u},t.finalizeTabPosition=function(t,e){var n,i;if(n="horizontal"===e?t.contentRect.width:t.contentRect.height,t.targetIndex===t.index)i=0;else if(t.targetIndex>t.index)i=(r=t.tabLayout[t.targetIndex]).pos+r.size-t.tabSize-t.tabPos;else{var r;i=(r=t.tabLayout[t.targetIndex]).pos-t.tabPos}var o=n-(t.tabPos+t.tabSize),a=Math.max(-t.tabPos,Math.min(i,o));"horizontal"===e?t.tab.style.left=a+"px":t.tab.style.top=a+"px"},t.resetTabPositions=function(t,e){x.each(t,function(t){"horizontal"===e?t.style.left="":t.style.top=""})}}(r||(r={}))});i(Ie);Ie.TabBar;var Ae=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(n){void 0===n&&(n={});var i=t.call(this)||this;i._drag=null,i._pressData=null,i._layoutModified=new lt.Signal(i),i.addClass("p-DockPanel"),i._mode=n.mode||"multiple-document",i._renderer=n.renderer||e.defaultRenderer,i.dataset.mode=i._mode;var r={createTabBar:function(){return i._createTabBar()},createHandle:function(){return i._createHandle()}};return i.layout=new we.DockLayout({renderer:r,spacing:n.spacing}),i.overlay=n.overlay||new e.Overlay,i.node.appendChild(i.overlay.node),i}return i(e,t),e.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(t){if(this._mode!==t){this._mode=t,this.dataset.mode=t;var e=this.layout;switch(t){case"multiple-document":x.each(e.tabBars(),function(t){t.show()});break;case"single-document":e.restoreLayout(r.createSingleDocumentConfig(this));break;default:throw"unreachable"}qt.MessageLoop.postMessage(this,r.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),e.prototype.widgets=function(){return this.layout.widgets()},e.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},e.prototype.tabBars=function(){return this.layout.tabBars()},e.prototype.handles=function(){return this.layout.handles()},e.prototype.selectWidget=function(t){var e=x.find(this.tabBars(),function(e){return-1!==e.titles.indexOf(t.title)});if(!e)throw new Error("Widget is not contained in the dock panel.");e.currentTitle=t.title},e.prototype.activateWidget=function(t){this.selectWidget(t),t.activate()},e.prototype.saveLayout=function(){return this.layout.saveLayout()},e.prototype.restoreLayout=function(t){this._mode="multiple-document",this.layout.restoreLayout(t),(gt.Platform.IS_EDGE||gt.Platform.IS_IE)&&qt.MessageLoop.flush(),qt.MessageLoop.postMessage(this,r.LayoutModified)},e.prototype.addWidget=function(t,e){void 0===e&&(e={}),"single-document"===this._mode?this.layout.addWidget(t):this.layout.addWidget(t,e),qt.MessageLoop.postMessage(this,r.LayoutModified)},e.prototype.processMessage=function(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):t.prototype.processMessage.call(this,e)},e.prototype.handleEvent=function(t){switch(t.type){case"p-dragenter":this._evtDragEnter(t);break;case"p-dragleave":this._evtDragLeave(t);break;case"p-dragover":this._evtDragOver(t);break;case"p-drop":this._evtDrop(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("p-dragenter",this),this.node.addEventListener("p-dragleave",this),this.node.addEventListener("p-dragover",this),this.node.addEventListener("p-drop",this),this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("p-dragenter",this),this.node.removeEventListener("p-dragleave",this),this.node.removeEventListener("p-dragover",this),this.node.removeEventListener("p-drop",this),this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onChildAdded=function(t){r.isGeneratedTabBarProperty.get(t.child)||t.child.addClass("p-DockPanel-widget")},e.prototype.onChildRemoved=function(t){r.isGeneratedTabBarProperty.get(t.child)||(t.child.removeClass("p-DockPanel-widget"),qt.MessageLoop.postMessage(this,r.LayoutModified))},e.prototype._evtDragEnter=function(t){t.mimeData.hasData("application/vnd.phosphor.widget-factory")&&(t.preventDefault(),t.stopPropagation())},e.prototype._evtDragLeave=function(t){t.preventDefault(),t.stopPropagation();var e=t.relatedTarget;e&&this.node.contains(e)||this.overlay.hide(0)},e.prototype._evtDragOver=function(t){t.preventDefault(),t.stopPropagation(),"invalid"===this._showOverlay(t.clientX,t.clientY)?t.dropAction="none":t.dropAction=t.proposedAction},e.prototype._evtDrop=function(t){if(t.preventDefault(),t.stopPropagation(),this.overlay.hide(0),"none"!==t.proposedAction){var e=t.clientX,n=t.clientY,i=r.findDropTarget(this,e,n),o=i.zone,a=i.target;if("invalid"!==o){var s=t.mimeData.getData("application/vnd.phosphor.widget-factory");if("function"==typeof s){var u=s();if(u instanceof Gt.Widget)if(u.contains(this))t.dropAction="none";else{var c=a?r.getDropRef(a.tabBar):null;switch(o){case"root-all":this.addWidget(u);break;case"root-top":this.addWidget(u,{mode:"split-top"});break;case"root-left":this.addWidget(u,{mode:"split-left"});break;case"root-right":this.addWidget(u,{mode:"split-right"});break;case"root-bottom":this.addWidget(u,{mode:"split-bottom"});break;case"widget-all":this.addWidget(u,{mode:"tab-after",ref:c});break;case"widget-top":this.addWidget(u,{mode:"split-top",ref:c});break;case"widget-left":this.addWidget(u,{mode:"split-left",ref:c});break;case"widget-right":this.addWidget(u,{mode:"split-right",ref:c});break;case"widget-bottom":this.addWidget(u,{mode:"split-bottom",ref:c});break;default:throw"unreachable"}t.dropAction=t.proposedAction,this.activateWidget(u)}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&(this._releaseMouse(),qt.MessageLoop.postMessage(this,r.LayoutModified))},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,n=t.target,i=x.find(e.handles(),function(t){return t.contains(n)});if(i){t.preventDefault(),t.stopPropagation(),document.addEventListener("keydown",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("contextmenu",this,!0);var r=i.getBoundingClientRect(),o=t.clientX-r.left,a=t.clientY-r.top,s=window.getComputedStyle(i),u=Pe.Drag.overrideCursor(s.cursor);this._pressData={handle:i,deltaX:o,deltaY:a,override:u}}}},e.prototype._evtMouseMove=function(t){if(this._pressData){t.preventDefault(),t.stopPropagation();var e=this.node.getBoundingClientRect(),n=t.clientX-e.left-this._pressData.deltaX,i=t.clientY-e.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,n,i)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse(),qt.MessageLoop.postMessage(this,r.LayoutModified))},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("keydown",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("contextmenu",this,!0))},e.prototype._showOverlay=function(t,e){var n,i,o,a,s=r.findDropTarget(this,t,e),u=s.zone,c=s.target;if("invalid"===u)return this.overlay.hide(100),u;var h=gt.ElementExt.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(u){case"root-all":n=h.paddingTop,i=h.paddingLeft,o=h.paddingRight,a=h.paddingBottom;break;case"root-top":n=h.paddingTop,i=h.paddingLeft,o=h.paddingRight,a=d.height*r.GOLDEN_RATIO;break;case"root-left":n=h.paddingTop,i=h.paddingLeft,o=d.width*r.GOLDEN_RATIO,a=h.paddingBottom;break;case"root-right":n=h.paddingTop,i=d.width*r.GOLDEN_RATIO,o=h.paddingRight,a=h.paddingBottom;break;case"root-bottom":n=d.height*r.GOLDEN_RATIO,i=h.paddingLeft,o=h.paddingRight,a=h.paddingBottom;break;case"widget-all":n=c.top,i=c.left,o=c.right,a=c.bottom;break;case"widget-top":n=c.top,i=c.left,o=c.right,a=c.bottom+c.height/2;break;case"widget-left":n=c.top,i=c.left,o=c.right+c.width/2,a=c.bottom;break;case"widget-right":n=c.top,i=c.left+c.width/2,o=c.right,a=c.bottom;break;case"widget-bottom":n=c.top+c.height/2,i=c.left,o=c.right,a=c.bottom;break;default:throw"unreachable"}return this.overlay.show({top:n,left:i,right:o,bottom:a}),u},e.prototype._createTabBar=function(){var t=this._renderer.createTabBar();return r.isGeneratedTabBarProperty.set(t,!0),"single-document"===this._mode&&t.hide(),t.tabsMovable=!0,t.allowDeselect=!1,t.removeBehavior="select-previous-tab",t.insertBehavior="select-tab-if-needed",t.tabMoved.connect(this._onTabMoved,this),t.currentChanged.connect(this._onCurrentChanged,this),t.tabCloseRequested.connect(this._onTabCloseRequested,this),t.tabDetachRequested.connect(this._onTabDetachRequested,this),t.tabActivateRequested.connect(this._onTabActivateRequested,this),t},e.prototype._createHandle=function(){return this._renderer.createHandle()},e.prototype._onTabMoved=function(){qt.MessageLoop.postMessage(this,r.LayoutModified)},e.prototype._onCurrentChanged=function(t,e){var n=e.previousTitle,i=e.currentTitle;n&&n.owner.hide(),i&&i.owner.show(),(gt.Platform.IS_EDGE||gt.Platform.IS_IE)&&qt.MessageLoop.flush(),qt.MessageLoop.postMessage(this,r.LayoutModified)},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabDetachRequested=function(t,e){var n=this;if(!this._drag){t.releaseMouse();var i=e.title,r=e.tab,o=e.clientX,a=e.clientY,s=new O.MimeData;s.setData("application/vnd.phosphor.widget-factory",function(){return i.owner});var u=r.cloneNode(!0);this._drag=new Pe.Drag({mimeData:s,dragImage:u,proposedAction:"move",supportedActions:"move"}),r.classList.add("p-mod-hidden");this._drag.start(o,a).then(function(){n._drag=null,r.classList.remove("p-mod-hidden")})}},e}(Gt.Widget);e.DockPanel=o,function(t){var e=function(){function t(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return t.prototype.show=function(t){var e=this.node.style;e.top=t.top+"px",e.left=t.left+"px",e.right=t.right+"px",e.bottom=t.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("p-mod-hidden"))},t.prototype.hide=function(t){var e=this;if(!this._hidden)return t<=0?(clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("p-mod-hidden")):void(-1===this._timer&&(this._timer=setTimeout(function(){e._timer=-1,e._hidden=!0,e.node.classList.add("p-mod-hidden")},t)))},t}();t.Overlay=e;var n=function(){function t(){}return t.prototype.createTabBar=function(){var t=new Ie.TabBar;return t.addClass("p-DockPanel-tabBar"),t},t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="p-DockPanel-handle",t},t}();t.Renderer=n,t.defaultRenderer=new n}(o=e.DockPanel||(e.DockPanel={})),e.DockPanel=o,function(t){t.GOLDEN_RATIO=.618,t.EDGE_SIZE=40,t.LayoutModified=new qt.ConflatableMessage("layout-modified"),t.isGeneratedTabBarProperty=new Yt.AttachedProperty({name:"isGeneratedTabBar",create:function(){return!1}}),t.createSingleDocumentConfig=function(t){if(t.isEmpty)return{main:null};var e=x.toArray(t.widgets()),n=t.selectedWidgets().next(),i=n?e.indexOf(n):-1;return{main:{type:"tab-area",widgets:e,currentIndex:i}}},t.findDropTarget=function(e,n,i){if(!gt.ElementExt.hitTest(e.node,n,i))return{zone:"invalid",target:null};var r=e.layout;if(r.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===e.mode){var o=e.node.getBoundingClientRect(),a=n-o.left+1,s=i-o.top+1,u=o.right-n,c=o.bottom-i,h=Math.min(a,s,u,c);if(h<=t.EDGE_SIZE){var d;switch(h){case a:d="root-left";break;case s:d="root-top";break;case u:d="root-right";break;case c:d="root-bottom";break;default:throw"unreachable"}return{zone:d,target:null}}}var l=r.hitTestTabAreas(n,i);if(!l)return{zone:"invalid",target:null};if("single-document"===e.mode)return{zone:"widget-all",target:l};var p,f=l.x-l.left+1,v=l.y-l.top+1,m=l.left+l.width-l.x,_=l.top+l.height-l.y,g=Math.round(l.width/3),y=Math.round(l.height/3);if(f>g&&m>g&&v>y&&_>y)return{zone:"widget-all",target:l};switch(f/=g,v/=y,m/=g,_/=y,Math.min(f,v,m,_)){case f:p="widget-left";break;case v:p="widget-top";break;case m:p="widget-right";break;case _:p="widget-bottom";break;default:throw"unreachable"}return{zone:p,target:l}},t.getDropRef=function(t){return 0===t.titles.length?null:t.currentTitle?t.currentTitle.owner:t.titles[t.titles.length-1].owner}}(r||(r={}))});i(Ae);Ae.DockPanel;var Ee=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new lt.Signal(this),this._currentChanged=new lt.Signal(this)}return t.prototype.dispose=function(){var t=this;this._counter<0||(this._counter=-1,lt.Signal.clearData(this),x.each(this._widgets,function(e){e.node.removeEventListener("focus",t,!0),e.node.removeEventListener("blur",t,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(t.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),t.prototype.focusNumber=function(t){var e=this._numbers.get(t);return void 0===e?-1:e},t.prototype.has=function(t){return this._numbers.has(t)},t.prototype.add=function(t){if(!this._numbers.has(t)){var e=t.node.contains(document.activeElement),n=e?this._counter++:-1;this._widgets.push(t),this._numbers.set(t,n),this._nodes.set(t.node,t),t.node.addEventListener("focus",this,!0),t.node.addEventListener("blur",this,!0),t.disposed.connect(this._onWidgetDisposed,this),e&&this._setWidgets(t,t)}},t.prototype.remove=function(t){var e=this;if(this._numbers.has(t)&&(t.disposed.disconnect(this._onWidgetDisposed,this),t.node.removeEventListener("focus",this,!0),t.node.removeEventListener("blur",this,!0),x.ArrayExt.removeFirstOf(this._widgets,t),this._nodes.delete(t.node),this._numbers.delete(t),this._currentWidget===t)){var n=x.filter(this._widgets,function(t){return-1!==e._numbers.get(t)}),i=x.max(n,function(t,n){return e._numbers.get(t)-e._numbers.get(n)})||null;this._setWidgets(i,null)}},t.prototype.handleEvent=function(t){switch(t.type){case"focus":this._evtFocus(t);break;case"blur":this._evtBlur(t)}},t.prototype._setWidgets=function(t,e){var n=this._currentWidget;this._currentWidget=t;var i=this._activeWidget;this._activeWidget=e,n!==t&&this._currentChanged.emit({oldValue:n,newValue:t}),i!==e&&this._activeChanged.emit({oldValue:i,newValue:e})},t.prototype._evtFocus=function(t){var e=this._nodes.get(t.currentTarget);e!==this._currentWidget&&this._numbers.set(e,this._counter++),this._setWidgets(e,e)},t.prototype._evtBlur=function(t){var e=this._nodes.get(t.currentTarget),n=t.relatedTarget;n&&(e.node.contains(n)||x.find(this._widgets,function(t){return t.node.contains(n)}))||this._setWidgets(this._currentWidget,null)},t.prototype._onWidgetDisposed=function(t){this.remove(t)},t}();e.FocusTracker=n});i(Ee);Ee.FocusTracker;var Se=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n._dirty=!1,n._rowSpacing=4,n._columnSpacing=4,n._items=[],n._rowStarts=[],n._columnStarts=[],n._rowSizers=[new Ut.BoxSizer],n._columnSizers=[new Ut.BoxSizer],n._box=null,void 0!==e.rowCount&&r.reallocSizers(n._rowSizers,e.rowCount),void 0!==e.columnCount&&r.reallocSizers(n._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(n._rowSpacing=r.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(n._columnSpacing=r.clampValue(e.columnSpacing)),n}return i(e,t),e.prototype.dispose=function(){x.each(this._items,function(t){var e=t.widget;t.dispose(),e.dispose()}),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(t){t!==this.rowCount&&(r.reallocSizers(this._rowSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(t){t!==this.columnCount&&(r.reallocSizers(this._columnSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(t){t=r.clampValue(t),this._rowSpacing!==t&&(this._rowSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(t){t=r.clampValue(t),this._columnSpacing!==t&&(this._columnSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.rowStretch=function(t){var e=this._rowSizers[t];return e?e.stretch:-1},e.prototype.setRowStretch=function(t,e){var n=this._rowSizers[t];n&&(e=r.clampValue(e),n.stretch!==e&&(n.stretch=e,this.parent&&this.parent.update()))},e.prototype.columnStretch=function(t){var e=this._columnSizers[t];return e?e.stretch:-1},e.prototype.setColumnStretch=function(t,e){var n=this._columnSizers[t];n&&(e=r.clampValue(e),n.stretch!==e&&(n.stretch=e,this.parent&&this.parent.update()))},e.prototype.iter=function(){return x.map(this._items,function(t){return t.widget})},e.prototype.addWidget=function(t){-1===x.ArrayExt.findFirstIndex(this._items,function(e){return e.widget===t})&&(this._items.push(new Jt.LayoutItem(t)),this.parent&&this.attachWidget(t))},e.prototype.removeWidget=function(t){var e=x.ArrayExt.findFirstIndex(this._items,function(e){return e.widget===t});if(-1===e){var n=x.ArrayExt.removeAt(this._items,e);this.parent&&this.detachWidget(t),n.dispose()}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),x.each(this,function(t){e.attachWidget(t)})},e.prototype.attachWidget=function(t){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.detachWidget=function(t){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterDetach),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,n=this.rowCount;t<n;++t)this._rowSizers[t].minSize=0;for(t=0,n=this.columnCount;t<n;++t)this._columnSizers[t].minSize=0;var i=this._items.filter(function(t){return!t.isHidden});for(t=0,n=i.length;t<n;++t)i[t].fit();var o=this.rowCount-1,a=this.columnCount-1;i.sort(r.rowSpanCmp);for(t=0,n=i.length;t<n;++t){var s=i[t],u=e.getCellConfig(s.widget),c=Math.min(u.row,o),h=Math.min(u.row+u.rowSpan-1,o);r.distributeMin(this._rowSizers,c,h,s.minHeight)}i.sort(r.columnSpanCmp);for(t=0,n=i.length;t<n;++t){s=i[t],u=e.getCellConfig(s.widget);var d=Math.min(u.column,a),l=Math.min(u.column+u.columnSpan-1,a);r.distributeMin(this._columnSizers,d,l,s.minWidth)}if("set-no-constraint"!==this.fitPolicy){var p=o*this._rowSpacing,f=a*this._columnSpacing;for(t=0,n=this.rowCount;t<n;++t)p+=this._rowSizers[t].minSize;for(t=0,n=this.columnCount;t<n;++t)f+=this._columnSizers[t].minSize;var v=this._box=gt.ElementExt.boxSizing(this.parent.node);f+=v.horizontalSum,p+=v.verticalSum;var m=this.parent.node.style;m.minWidth=f+"px",m.minHeight=p+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)}else qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,n){this._dirty=!1,t<0&&(t=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var i=this._box.paddingTop,r=this._box.paddingLeft,o=t-this._box.horizontalSum,a=n-this._box.verticalSum,s=this.rowCount-1,u=this.columnCount-1,c=s*this._rowSpacing,h=u*this._columnSpacing;Ut.BoxEngine.calc(this._rowSizers,Math.max(0,a-c)),Ut.BoxEngine.calc(this._columnSizers,Math.max(0,o-h));for(var d=0,l=i,p=this.rowCount;d<p;++d)this._rowStarts[d]=l,l+=this._rowSizers[d].size+this._rowSpacing;for(d=0,l=r,p=this.columnCount;d<p;++d)this._columnStarts[d]=l,l+=this._columnSizers[d].size+this._columnSpacing;for(d=0,p=this._items.length;d<p;++d){var f=this._items[d];if(!f.isHidden){var v=e.getCellConfig(f.widget),m=Math.min(v.row,s),_=Math.min(v.column,u),g=Math.min(v.row+v.rowSpan-1,s),y=Math.min(v.column+v.columnSpan-1,u),b=this._columnStarts[_],x=this._rowStarts[m],M=this._columnStarts[y]+this._columnSizers[y].size-b,w=this._rowStarts[g]+this._rowSizers[g].size-x;f.update(b,x,M,w)}}},e}(Jt.Layout);e.GridLayout=o,function(t){t.getCellConfig=function(t){return r.cellConfigProperty.get(t)},t.setCellConfig=function(t,e){r.cellConfigProperty.set(t,r.normalizeConfig(e))}}(o=e.GridLayout||(e.GridLayout={})),e.GridLayout=o,function(t){t.cellConfigProperty=new Yt.AttachedProperty({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:function(t){t.parent&&t.parent.layout instanceof o&&t.parent.fit()}}),t.normalizeConfig=function(t){return{row:Math.max(0,Math.floor(t.row||0)),column:Math.max(0,Math.floor(t.column||0)),rowSpan:Math.max(1,Math.floor(t.rowSpan||0)),columnSpan:Math.max(1,Math.floor(t.columnSpan||0))}},t.clampValue=function(t){return Math.max(0,Math.floor(t))},t.rowSpanCmp=function(e,n){var i=t.cellConfigProperty.get(e.widget),r=t.cellConfigProperty.get(n.widget);return i.rowSpan-r.rowSpan},t.columnSpanCmp=function(e,n){var i=t.cellConfigProperty.get(e.widget),r=t.cellConfigProperty.get(n.widget);return i.columnSpan-r.columnSpan},t.reallocSizers=function(t,e){for(e=Math.max(1,Math.floor(e));t.length<e;)t.push(new Ut.BoxSizer);t.length<e&&(t.length=e)},t.distributeMin=function(t,e,n,i){if(!(n<e))if(e!==n){for(var r=0,o=e;o<=n;++o)r+=t[o].minSize;if(!(r>=i)){var a=(i-r)/(n-e+1);for(o=e;o<=n;++o)t[o].minSize+=a}}else{var s=t[e];s.minSize=Math.max(s.minSize,i)}}}(r||(r={}))});i(Se);Se.GridLayout;var Oe=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(n){void 0===n&&(n={});var i=t.call(this,{node:r.createNode()})||this;return i._activeIndex=-1,i._menus=[],i._childMenu=null,i.addClass("p-MenuBar"),i.setFlag(Gt.Widget.Flag.DisallowLayout),i.renderer=n.renderer||e.defaultRenderer,i}return i(e,t),e.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._menus.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._menus.length)&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),e.prototype.openActiveMenu=function(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},e.prototype.addMenu=function(t){this.insertMenu(this._menus.length,t)},e.prototype.insertMenu=function(t,e){this._closeChildMenu();var n=this._menus.indexOf(e),i=Math.max(0,Math.min(t,this._menus.length));if(-1===n)return x.ArrayExt.insert(this._menus,i,e),e.addClass("p-MenuBar-menu"),e.aboutToClose.connect(this._onMenuAboutToClose,this),e.menuRequested.connect(this._onMenuMenuRequested,this),e.title.changed.connect(this._onTitleChanged,this),void this.update();i===this._menus.length&&i--,n!==i&&(x.ArrayExt.move(this._menus,n,i),this.update())},e.prototype.removeMenu=function(t){this.removeMenuAt(this._menus.indexOf(t))},e.prototype.removeMenuAt=function(t){this._closeChildMenu();var e=x.ArrayExt.removeAt(this._menus,t);e&&(e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("p-MenuBar-menu"),this.update())},e.prototype.clearMenus=function(){if(0!==this._menus.length){this._closeChildMenu();for(var t=0,e=this._menus;t<e.length;t++){var n=e[t];n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this._menus,n=this.renderer,i=this._activeIndex,r=new Array(e.length),o=0,a=e.length;o<a;++o){var s=e[o].title,u=o===i;r[o]=n.renderItem({title:s,active:u})}ye.VirtualDOM.render(r,this.contentNode)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e&&38!==e&&40!==e){if(27===e)return this._closeChildMenu(),this.activeIndex=-1,void this.node.blur();if(37!==e)if(39!==e){var n=yt.getKeyboardLayout().keyForKeydownEvent(t);if(n){var i=this._activeIndex+1,o=r.findMnemonic(this._menus,n,i);-1===o.index||o.multiple?-1!==o.index?this.activeIndex=o.index:-1!==o.auto&&(this.activeIndex=o.auto):(this.activeIndex=o.index,this.openActiveMenu())}}else{a=this._activeIndex,s=this._menus.length;this.activeIndex=a===s-1?0:a+1}else{var a=this._activeIndex,s=this._menus.length;this.activeIndex=0===a?s-1:a-1}}else this.openActiveMenu()},e.prototype._evtMouseDown=function(t){if(gt.ElementExt.hitTest(this.node,t.clientX,t.clientY)){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation();var e=x.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});-1!==e?0===t.button&&(this._childMenu?(this._closeChildMenu(),this.activeIndex=e):(this.activeIndex=e,this._openChildMenu())):this._closeChildMenu()}},e.prototype._evtMouseMove=function(t){var e=x.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});e!==this._activeIndex&&(-1===e&&this._childMenu||(this.activeIndex=e,this._childMenu&&this._openChildMenu()))},e.prototype._evtMouseLeave=function(t){this._childMenu||(this.activeIndex=-1)},e.prototype._openChildMenu=function(){var t=this.activeMenu;if(t){var e=this._childMenu;if(e!==t){this._childMenu=t,e?e.close():(this.addClass("p-mod-active"),document.addEventListener("mousedown",this,!0)),qt.MessageLoop.sendMessage(this,Gt.Widget.Msg.UpdateRequest);var n=this.contentNode.children[this._activeIndex].getBoundingClientRect(),i=n.left,r=n.bottom;t.open(i,r,{forceX:!0,forceY:!0})}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var t=this._childMenu;this._childMenu=null,t.close(),this.activeIndex=-1}},e.prototype._onMenuAboutToClose=function(t){t===this._childMenu&&(this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},e.prototype._onMenuMenuRequested=function(t,e){if(t===this._childMenu){var n=this._activeIndex,i=this._menus.length;switch(e){case"next":this.activeIndex=n===i-1?0:n+1;break;case"previous":this.activeIndex=0===n?i-1:n-1}this.openActiveMenu()}},e.prototype._onTitleChanged=function(){this.update()},e}(Gt.Widget);e.MenuBar=o,function(t){var e=function(){function t(){}return t.prototype.renderItem=function(t){var e=this.createItemClass(t),n=this.createItemDataset(t);return ye.h.li({className:e,dataset:n},this.renderIcon(t),this.renderLabel(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return ye.h.div({className:e},t.title.iconLabel)},t.prototype.renderLabel=function(t){var e=this.formatLabel(t);return ye.h.div({className:"p-MenuBar-itemLabel"},e)},t.prototype.createItemClass=function(t){var e="p-MenuBar-item";return t.title.className&&(e+=" "+t.title.className),t.active&&(e+=" p-mod-active"),e},t.prototype.createItemDataset=function(t){return t.title.dataset},t.prototype.createIconClass=function(t){var e="p-MenuBar-itemIcon",n=t.title.iconClass;return n?e+" "+n:e},t.prototype.formatLabel=function(t){var e=t.title,n=e.label,i=e.mnemonic;if(i<0||i>=n.length)return n;var r=n.slice(0,i),o=n.slice(i+1),a=n[i];return[r,ye.h.span({className:"p-MenuBar-itemMnemonic"},a),o]},t}();t.Renderer=e,t.defaultRenderer=new e}(o=e.MenuBar||(e.MenuBar={})),e.MenuBar=o,function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="p-MenuBar-content",t.appendChild(e),t.tabIndex=-1,t},t.findMnemonic=function(t,e,n){for(var i=-1,r=-1,o=!1,a=e.toUpperCase(),s=0,u=t.length;s<u;++s){var c=(s+n)%u,h=t[c].title;if(0!==h.label.length){var d=h.mnemonic;d>=0&&d<h.label.length?h.label[d].toUpperCase()===a&&(-1===i?i=c:o=!0):-1===r&&h.label[0].toUpperCase()===a&&(r=c)}}return{index:i,multiple:o,auto:r}}}(r||(r={}))});i(Oe);Oe.MenuBar;var Ce=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{node:r.createNode()})||this;return n._onRepeat=function(){if(n._repeatTimer=-1,n._pressData){var t=n._pressData.part;if("thumb"!==t){n._repeatTimer=setTimeout(n._onRepeat,20);var e=n._pressData.mouseX,i=n._pressData.mouseY;if("decrement"!==t)if("increment"!==t){if("track"===t){if(!gt.ElementExt.hitTest(n.trackNode,e,i))return;var r=n.thumbNode;if(gt.ElementExt.hitTest(r,e,i))return;var o=r.getBoundingClientRect(),a=void 0;return a="horizontal"===n._orientation?e<o.left?"decrement":"increment":i<o.top?"decrement":"increment",void n._pageRequested.emit(a)}}else{if(!gt.ElementExt.hitTest(n.incrementNode,e,i))return;n._stepRequested.emit("increment")}else{if(!gt.ElementExt.hitTest(n.decrementNode,e,i))return;n._stepRequested.emit("decrement")}}}},n._value=0,n._page=10,n._maximum=100,n._repeatTimer=-1,n._pressData=null,n._thumbMoved=new lt.Signal(n),n._stepRequested=new lt.Signal(n),n._pageRequested=new lt.Signal(n),n.addClass("p-ScrollBar"),n.setFlag(Gt.Widget.Flag.DisallowLayout),n._orientation=e.orientation||"vertical",n.dataset.orientation=n._orientation,void 0!==e.maximum&&(n._maximum=Math.max(0,e.maximum)),void 0!==e.page&&(n._page=Math.max(0,e.page)),void 0!==e.value&&(n._value=Math.max(0,Math.min(e.value,n._maximum))),n}return i(e,t),Object.defineProperty(e.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this._page},set:function(t){t=Math.max(0,t),this._page!==t&&(this._page=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(t){t=Math.max(0,t),this._maximum!==t&&(this._maximum=t,this._value=Math.min(this._value,t),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this),this.update()},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){var e=100*this._value/this._maximum,n=100*this._page/(this._page+this._maximum);e=Math.max(0,Math.min(e,100)),n=Math.max(0,Math.min(n,100));var i=this.thumbNode.style;"horizontal"===this._orientation?(i.top="",i.height="",i.left=e+"%",i.width=n+"%",i.transform="translate("+-e+"%, 0%)"):(i.left="",i.width="",i.top=e+"%",i.height=n+"%",i.transform="translate(0%, "+-e+"%)")},e.prototype._evtKeyDown=function(t){if(t.preventDefault(),t.stopPropagation(),27===t.keyCode){var e=this._pressData?this._pressData.value:-1;this._releaseMouse(),-1!==e&&this._moveThumb(e)}},e.prototype._evtMouseDown=function(t){if(0===t.button&&!this._pressData){var e=r.findPart(this,t.target);if(e){t.preventDefault(),t.stopPropagation();var n=Pe.Drag.overrideCursor("default");if(this._pressData={part:e,override:n,delta:-1,value:-1,mouseX:t.clientX,mouseY:t.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),"thumb"===e){var i=this.thumbNode,o=i.getBoundingClientRect();return"horizontal"===this._orientation?this._pressData.delta=t.clientX-o.left:this._pressData.delta=t.clientY-o.top,i.classList.add("p-mod-active"),void(this._pressData.value=this._value)}if("track"===e){o=this.thumbNode.getBoundingClientRect();var a=void 0;return a="horizontal"===this._orientation?t.clientX<o.left?"decrement":"increment":t.clientY<o.top?"decrement":"increment",this._repeatTimer=setTimeout(this._onRepeat,350),void this._pageRequested.emit(a)}return"decrement"===e?(this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=setTimeout(this._onRepeat,350),void this._stepRequested.emit("decrement")):"increment"===e?(this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=setTimeout(this._onRepeat,350),void this._stepRequested.emit("increment")):void 0}}},e.prototype._evtMouseMove=function(t){if(this._pressData&&(t.preventDefault(),t.stopPropagation(),this._pressData.mouseX=t.clientX,this._pressData.mouseY=t.clientY,"thumb"===this._pressData.part)){var e,n,i=this.thumbNode.getBoundingClientRect(),r=this.trackNode.getBoundingClientRect();"horizontal"===this._orientation?(e=t.clientX-r.left-this._pressData.delta,n=r.width-i.width):(e=t.clientY-r.top-this._pressData.delta,n=r.height-i.height);var o=0===n?0:e*this._maximum/n;this._moveThumb(o)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(clearTimeout(this._repeatTimer),this._repeatTimer=-1,this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},e.prototype._moveThumb=function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update(),this._thumbMoved.emit(t))},e}(Gt.Widget);e.ScrollBar=o,function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("div"),r=document.createElement("div");return e.className="p-ScrollBar-button",n.className="p-ScrollBar-button",e.dataset.action="decrement",n.dataset.action="increment",i.className="p-ScrollBar-track",r.className="p-ScrollBar-thumb",i.appendChild(r),t.appendChild(e),t.appendChild(i),t.appendChild(n),t},t.findPart=function(t,e){return t.thumbNode.contains(e)?"thumb":t.trackNode.contains(e)?"track":t.decrementNode.contains(e)?"decrement":t.incrementNode.contains(e)?"increment":null}}(r||(r={}))});i(Ce);Ce.ScrollBar;var Le=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widget=null,e}return i(e,t),e.prototype.dispose=function(){if(this._widget){var e=this._widget;this._widget=null,e.dispose()}t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widget",{get:function(){return this._widget},set:function(t){this._widget!==t&&(this._widget&&this._widget.dispose(),this._widget=t,this.parent&&t&&this.attachWidget(t))},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._widget?x.once(this._widget):x.empty()},e.prototype.removeWidget=function(t){this._widget===t&&(this._widget=null,this.parent&&this.detachWidget(t))},e.prototype.init=function(){var e=this;t.prototype.init.call(this),x.each(this,function(t){e.attachWidget(t)})},e.prototype.attachWidget=function(t){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterAttach)},e.prototype.detachWidget=function(t){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterDetach)},e}(Jt.Layout);e.SingletonLayout=r});i(Le);Le.SingletonLayout;var ze=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){var n=t.call(this)||this;return n._fixed=0,n._spacing=4,n._dirty=!1,n._hasNormedSizes=!1,n._sizers=[],n._items=[],n._handles=[],n._box=null,n._alignment="start",n._orientation="horizontal",n.renderer=e.renderer,void 0!==e.orientation&&(n._orientation=e.orientation),void 0!==e.alignment&&(n._alignment=e.alignment),void 0!==e.spacing&&(n._spacing=r.clampSpacing(e.spacing)),n}return i(e,t),e.prototype.dispose=function(){x.each(this._items,function(t){t.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._orientation=t,this.parent&&(this.parent.dataset.orientation=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=r.clampSpacing(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return r.normalize(this._sizers.map(function(t){return t.size}))},e.prototype.setRelativeSizes=function(t){for(var e=this._sizers.length,n=t.slice(0,e);n.length<e;)n.push(0);for(var i=r.normalize(n),o=0;o<e;++o){var a=this._sizers[o];a.sizeHint=i[o],a.size=i[o]}this._hasNormedSizes=!0,this.parent&&this.parent.update()},e.prototype.moveHandle=function(t,e){var n,i=this._handles[t];if(i&&!i.classList.contains("p-mod-hidden")&&0!==(n="horizontal"===this._orientation?e-i.offsetLeft:e-i.offsetTop)){for(var r=0,o=this._sizers;r<o.length;r++){var a=o[r];a.size>0&&(a.sizeHint=a.size)}Ut.BoxEngine.adjust(this._sizers,t,n),this.parent&&this.parent.update()}},e.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){var n=new Jt.LayoutItem(e),i=r.createHandle(this.renderer),o=r.averageSize(this._sizers),a=r.createSizer(o);x.ArrayExt.insert(this._items,t,n),x.ArrayExt.insert(this._sizers,t,a),x.ArrayExt.insert(this._handles,t,i),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.node.appendChild(i),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){x.ArrayExt.move(this._items,t,e),x.ArrayExt.move(this._sizers,t,e),x.ArrayExt.move(this._handles,t,e),this.parent.fit()},e.prototype.detachWidget=function(t,e){var n=x.ArrayExt.removeAt(this._items,t),i=x.ArrayExt.removeAt(this._handles,t);x.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.node.removeChild(i),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,n=-1,i=0,r=this._items.length;i<r;++i)this._items[i].isHidden?this._handles[i].classList.add("p-mod-hidden"):(this._handles[i].classList.remove("p-mod-hidden"),n=i,t++);-1!==n&&this._handles[n].classList.add("p-mod-hidden"),this._fixed=this._spacing*Math.max(0,t-1);var o="horizontal"===this._orientation,a=o?this._fixed:0,s=o?0:this._fixed;for(i=0,r=this._items.length;i<r;++i){var u=this._items[i],c=this._sizers[i];c.size>0&&(c.sizeHint=c.size),u.isHidden?(c.minSize=0,c.maxSize=0):(u.fit(),c.stretch=e.getStretch(u.widget),o?(c.minSize=u.minWidth,c.maxSize=u.maxWidth,a+=u.minWidth,s=Math.max(s,u.minHeight)):(c.minSize=u.minHeight,c.maxSize=u.maxHeight,s+=u.minHeight,a=Math.max(a,u.minWidth)))}var h=this._box=gt.ElementExt.boxSizing(this.parent.node);a+=h.horizontalSum,s+=h.verticalSum;var d=this.parent.node.style;d.minWidth=a+"px",d.minHeight=s+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var n=0,i=0,r=this._items.length;i<r;++i)n+=+!this._items[i].isHidden;if(0!==n){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var o,a=this._box.paddingTop,s=this._box.paddingLeft,u=t-this._box.horizontalSum,c=e-this._box.verticalSum,h="horizontal"===this._orientation;if(o=h?Math.max(0,u-this._fixed):Math.max(0,c-this._fixed),this._hasNormedSizes){for(var d=0,l=this._sizers;d<l.length;d++){l[d].sizeHint*=o}this._hasNormedSizes=!1}var p=Ut.BoxEngine.calc(this._sizers,o),f=0,v=0;if(p>0)switch(this._alignment){case"start":break;case"center":f=0,v=p/2;break;case"end":f=0,v=p;break;case"justify":f=p/n,v=0;break;default:throw"unreachable"}for(i=0,r=this._items.length;i<r;++i){var m=this._items[i];if(!m.isHidden){var _=this._sizers[i].size,g=this._handles[i].style;h?(m.update(s+v,a,_+f,c),s+=_+f,g.top=a+"px",g.left=s+v+"px",g.width=this._spacing+"px",g.height=c+"px",s+=this._spacing):(m.update(s,a+v,u,_+f),a+=_+f,g.top=a+v+"px",g.left=s+"px",g.width=u+"px",g.height=this._spacing+"px",a+=this._spacing)}}}},e}(Zt.PanelLayout);e.SplitLayout=o,function(t){t.getStretch=function(t){return r.stretchProperty.get(t)},t.setStretch=function(t,e){r.stretchProperty.set(t,e)}}(o=e.SplitLayout||(e.SplitLayout={})),e.SplitLayout=o,function(t){t.stretchProperty=new Yt.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:function(t){t.parent&&t.parent.layout instanceof o&&t.parent.fit()}}),t.createSizer=function(t){var e=new Ut.BoxSizer;return e.sizeHint=Math.floor(t),e},t.createHandle=function(t){var e=t.createHandle();return e.style.position="absolute",e},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))},t.averageSize=function(t){return t.reduce(function(t,e){return t+e.size},0)/t.length||0},t.normalize=function(t){var e=t.length;if(0===e)return[];var n=t.reduce(function(t,e){return t+Math.abs(e)},0);return 0===n?t.map(function(t){return 1/e}):t.map(function(t){return t/n})}}(r||(r={}))});i(ze);ze.SplitLayout;var ke=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{layout:r.createLayout(e)})||this;return n._pressData=null,n.addClass("p-SplitPanel"),n}return i(e,t),e.prototype.dispose=function(){this._releaseMouse(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(t){this.layout.orientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return this.layout.relativeSizes()},e.prototype.setRelativeSizes=function(t){this.layout.setRelativeSizes(t)},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onChildAdded=function(t){t.child.addClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype.onChildRemoved=function(t){t.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,n=x.ArrayExt.findFirstIndex(e.handles,function(e){return e.contains(t.target)});if(-1!==n){var i;t.preventDefault(),t.stopPropagation(),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var r=e.handles[n],o=r.getBoundingClientRect();i="horizontal"===e.orientation?t.clientX-o.left:t.clientY-o.top;var a=window.getComputedStyle(r),s=Pe.Drag.overrideCursor(a.cursor);this._pressData={index:n,delta:i,override:s}}}},e.prototype._evtMouseMove=function(t){var e;t.preventDefault(),t.stopPropagation();var n=this.layout,i=this.node.getBoundingClientRect();e="horizontal"===n.orientation?t.clientX-i.left-this._pressData.delta:t.clientY-i.top-this._pressData.delta,n.moveHandle(this._pressData.index,e)},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0))},e}($t.Panel);e.SplitPanel=o,function(t){var e=function(){function t(){}return t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="p-SplitPanel-handle",t},t}();t.Renderer=e,t.defaultRenderer=new e,t.getStretch=function(t){return ze.SplitLayout.getStretch(t)},t.setStretch=function(t,e){ze.SplitLayout.setStretch(t,e)}}(o=e.SplitPanel||(e.SplitPanel={})),e.SplitPanel=o,function(t){t.createLayout=function(t){return t.layout||new ze.SplitLayout({renderer:t.renderer||o.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}}(r||(r={}))});i(ke);ke.SplitPanel;var Te=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._dirty=!1,e._items=[],e._box=null,e}return i(e,t),e.prototype.dispose=function(){x.each(this._items,function(t){t.dispose()}),this._box=null,this._items.length=0,t.prototype.dispose.call(this)},e.prototype.attachWidget=function(t,e){x.ArrayExt.insert(this._items,t,new Jt.LayoutItem(e)),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){x.ArrayExt.move(this._items,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=x.ArrayExt.removeAt(this._items,t);this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterDetach),n.widget.node.style.zIndex="",n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,e=0,n=0,i=this._items.length;n<i;++n){var r=this._items[n];r.isHidden||(r.fit(),t=Math.max(t,r.minWidth),e=Math.max(e,r.minHeight))}var o=this._box=gt.ElementExt.boxSizing(this.parent.node);t+=o.horizontalSum,e+=o.verticalSum;var a=this.parent.node.style;a.minWidth=t+"px",a.minHeight=e+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var n=0,i=0,r=this._items.length;i<r;++i)n+=+!this._items[i].isHidden;if(0!==n){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var o=this._box.paddingTop,a=this._box.paddingLeft,s=t-this._box.horizontalSum,u=e-this._box.verticalSum;for(i=0,r=this._items.length;i<r;++i){var c=this._items[i];c.isHidden||(c.widget.node.style.zIndex=""+i,c.update(a,o,s,u))}}},e}(Zt.PanelLayout);e.StackedLayout=r});i(Te);Te.StackedLayout;var je=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{layout:r.createLayout(e)})||this;return n._widgetRemoved=new lt.Signal(n),n.addClass("p-StackedPanel"),n}return i(e,t),Object.defineProperty(e.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("p-StackedPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(t.child)},e}($t.Panel);e.StackedPanel=o,function(t){t.createLayout=function(t){return t.layout||new Te.StackedLayout}}(r||(r={}))});i(je);je.StackedPanel;var De=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;n._currentChanged=new lt.Signal(n),n.addClass("p-TabPanel"),n.tabBar=new Ie.TabBar(e),n.tabBar.addClass("p-TabPanel-tabBar"),n.stackedPanel=new je.StackedPanel,n.stackedPanel.addClass("p-TabPanel-stackedPanel"),n.tabBar.tabMoved.connect(n._onTabMoved,n),n.tabBar.currentChanged.connect(n._onCurrentChanged,n),n.tabBar.tabCloseRequested.connect(n._onTabCloseRequested,n),n.tabBar.tabActivateRequested.connect(n._onTabActivateRequested,n),n.stackedPanel.widgetRemoved.connect(n._onWidgetRemoved,n),n._tabPlacement=e.tabPlacement||"top";var i=r.directionFromPlacement(n._tabPlacement),o=r.orientationFromPlacement(n._tabPlacement);n.tabBar.orientation=o,n.tabBar.dataset.placement=n._tabPlacement;var a=new Qt.BoxLayout({direction:i,spacing:0});return Qt.BoxLayout.setStretch(n.tabBar,0),Qt.BoxLayout.setStretch(n.stackedPanel,1),a.addWidget(n.tabBar),a.addWidget(n.stackedPanel),n.layout=a,n}return i(e,t),Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(t){this.tabBar.currentIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){var t=this.tabBar.currentTitle;return t?t.owner:null},set:function(t){this.tabBar.currentTitle=t?t.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(t){this.tabBar.tabsMovable=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(t){if(this._tabPlacement!==t){this._tabPlacement=t;var e=r.directionFromPlacement(t),n=r.orientationFromPlacement(t);this.tabBar.orientation=n,this.tabBar.dataset.placement=t,this.layout.direction=e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.insertWidget(this.widgets.length,t)},e.prototype.insertWidget=function(t,e){e!==this.currentWidget&&e.hide(),this.stackedPanel.insertWidget(t,e),this.tabBar.insertTab(t,e.title)},e.prototype._onCurrentChanged=function(t,e){var n=e.previousIndex,i=e.previousTitle,r=e.currentIndex,o=e.currentTitle,a=i?i.owner:null,s=o?o.owner:null;a&&a.hide(),s&&s.show(),this._currentChanged.emit({previousIndex:n,previousWidget:a,currentIndex:r,currentWidget:s}),(gt.Platform.IS_EDGE||gt.Platform.IS_IE)&&qt.MessageLoop.flush()},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabMoved=function(t,e){this.stackedPanel.insertWidget(e.toIndex,e.title.owner)},e.prototype._onWidgetRemoved=function(t,e){this.tabBar.removeTab(e.title)},e}(Gt.Widget);e.TabPanel=o,function(t){t.orientationFromPlacement=function(t){return e[t]},t.directionFromPlacement=function(t){return n[t]};var e={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},n={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}}(r||(r={}))});i(De);De.TabPanel;var Be=i(r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(Ut),n(Qt),n(te),n(be),n(Me),n(we),n(Ae),n(Ee),n(Se),n(Jt),n(xe),n(Oe),n($t),n(Zt),n(Ce),n(Le),n(ze),n(ke),n(Te),n(je),n(Ie),n(De),n(Xt),n(Gt)}));function Re(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}Re(".p-Widget{box-sizing:border-box;position:relative;overflow:hidden;cursor:default}.p-Widget.p-mod-hidden{display:none!important}");Re(".p-CommandPalette{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-CommandPalette-search{flex:0 0 auto}.p-CommandPalette-content{flex:1 1 auto;margin:0;padding:0;min-height:0;overflow:auto;list-style-type:none}.p-CommandPalette-header{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.p-CommandPalette-item{display:flex;flex-direction:row}.p-CommandPalette-itemIcon{flex:0 0 auto}.p-CommandPalette-itemContent{flex:1 1 auto}.p-CommandPalette-itemShortcut{flex:0 0 auto}.p-CommandPalette-itemLabel{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}");Re('.p-DockPanel,.p-DockPanel-widget{z-index:0}.p-DockPanel-tabBar{z-index:1}.p-DockPanel-handle{z-index:2}.p-DockPanel-handle.p-mod-hidden{display:none!important}.p-DockPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.p-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.p-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.p-DockPanel-handle[data-orientation=horizontal]:after{left:50%;min-width:8px;transform:translateX(-50%)}.p-DockPanel-handle[data-orientation=vertical]:after{top:50%;min-height:8px;transform:translateY(-50%)}.p-DockPanel-overlay{z-index:3;box-sizing:border-box;pointer-events:none}.p-DockPanel-overlay.p-mod-hidden{display:none!important}');Re(".p-Menu{z-index:10000;position:absolute;white-space:nowrap;overflow-x:hidden;overflow-y:auto;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-Menu-content{margin:0;padding:0;display:table;list-style-type:none}.p-Menu-item{display:table-row}.p-Menu-item.p-mod-collapsed,.p-Menu-item.p-mod-hidden{display:none!important}.p-Menu-itemIcon,.p-Menu-itemSubmenuIcon{display:table-cell;text-align:center}.p-Menu-itemLabel{display:table-cell;text-align:left}.p-Menu-itemShortcut{display:table-cell;text-align:right}");Re(".p-MenuBar{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-MenuBar-content{margin:0;padding:0;display:flex;flex-direction:row;list-style-type:none}.p-MenuBar-item{box-sizing:border-box}.p-MenuBar-itemIcon,.p-MenuBar-itemLabel{display:inline-block}");Re(".p-ScrollBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-ScrollBar[data-orientation=horizontal]{flex-direction:row}.p-ScrollBar[data-orientation=vertical]{flex-direction:column}.p-ScrollBar-button{box-sizing:border-box;flex:0 0 auto}.p-ScrollBar-track{box-sizing:border-box;position:relative;overflow:hidden;flex:1 1 auto}.p-ScrollBar-thumb{box-sizing:border-box;position:absolute}");Re('.p-SplitPanel-child{z-index:0}.p-SplitPanel-handle{z-index:1}.p-SplitPanel-handle.p-mod-hidden{display:none!important}.p-SplitPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle{cursor:ew-resize}.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle{cursor:ns-resize}.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle:after{left:50%;min-width:8px;transform:translateX(-50%)}.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle:after{top:50%;min-height:8px;transform:translateY(-50%)}');Re(".p-TabBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-TabBar[data-orientation=horizontal]{flex-direction:row}.p-TabBar[data-orientation=vertical]{flex-direction:column}.p-TabBar-content{margin:0;padding:0;display:flex;flex:1 1 auto;list-style-type:none}.p-TabBar[data-orientation=horizontal]>.p-TabBar-content{flex-direction:row}.p-TabBar[data-orientation=vertical]>.p-TabBar-content{flex-direction:column}.p-TabBar-tab{display:flex;flex-direction:row;box-sizing:border-box;overflow:hidden}.p-TabBar-tabCloseIcon,.p-TabBar-tabIcon{flex:0 0 auto}.p-TabBar-tabLabel{flex:1 1 auto;overflow:hidden;white-space:nowrap}.p-TabBar-tab.p-mod-hidden{display:none!important}.p-TabBar.p-mod-dragging .p-TabBar-tab{position:relative}.p-TabBar.p-mod-dragging[data-orientation=horizontal] .p-TabBar-tab{left:0;transition:left .15s ease}.p-TabBar.p-mod-dragging[data-orientation=vertical] .p-TabBar-tab{top:0;transition:top .15s ease}.p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging{transition:none}");Re(".p-TabPanel-tabBar{z-index:1}.p-TabPanel-stackedPanel{z-index:0}");Be.BoxPanel;var We=Be.CommandPalette,Ne=Be.ContextMenu,Fe=(Be.DockLayout,Be.DockPanel),He=(Be.Menu,Be.MenuBar,Be.SplitPanel),qe=(Be.TabBar,Be.TabPanel),Ve=Be.Widget,Ke=M.each,Ue=function(t,e){return(Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function Ye(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ue(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Xe=function(){return(Xe=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function Ge(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var Je,Ze;Ge(".phosphor_WidgetAdapter{border-left:1px solid silver;border-right:1px solid silver;border-bottom:1px solid silver;background:#fff;min-width:64px;min-height:64px}.phosphor_WidgetAdapter.p-DockPanel-widget{border-top:none;box-shadow:0 -1px 0 rgba(0,0,0,.2),1px 1px 2px rgba(0,0,0,.2)}.phosphor_WidgetAdapter.p-SplitPanel-child{border:none}"),Je=t.Msg||(t.Msg={}),Ze=function(t){function e(e){var n=t.call(this,"wa-activate-request")||this;return n._wa=e,n}return Ye(e,t),Object.defineProperty(e.prototype,"wa",{get:function(){return this._wa},enumerable:!1,configurable:!0}),e.prototype.conflate=function(t){return this._wa=t.wa,!0},e}(Vt),Je.WAActivateRequest=Ze;var Qe=function(n){function i(t,i,r,o,a){void 0===r&&(r={}),void 0===o&&(o=!1),void 0===a&&(a={});var s=n.call(this)||this;return s.lparam={},s.padding=0,s._width=0,s._height=0,s._owner=t,s._element=e.select(s.node),s.addClass("phosphor_WidgetAdapter"),s.title.label="",s.title.closable=!!o,s.title.caption="Long description for: "+name,s._ext=a,s._closable="boolean"==typeof o?{canClose:function(t,e){return o}}:o,i instanceof e.Widget?s._widget=i.target(s.node):s._widgetLayout=i,s.lparam=r,s}return Ye(i,n),Object.defineProperty(i.prototype,"widget",{get:function(){return this._widget},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"inputNode",{get:function(){return this.node.getElementsByTagName("input")[0]},enumerable:!1,configurable:!0}),i.prototype.resizeAndRender=function(){this._widget&&(e.select(this.node).style("padding",this.padding+"px").style("width",this._width+"px").style("height",this._height+"px").style("overflow-x",this._ext.overflowX).style("overflow-y",this._ext.overflowY),this._widget.resize({width:this._width-2*this.padding-2,height:this._height-2*this.padding-2}).lazyRender())},i.prototype.onActivateRequest=function(e){n.prototype.onActivateRequest.call(this,e),this._widget&&this.resizeAndRender(),this._owner&&Kt.postMessage(this._owner,new t.Msg.WAActivateRequest(this))},i.prototype.onResize=function(t){n.prototype.onResize.call(this,t),this.node&&null!==this.node.offsetParent&&t.width>=0&&t.height>=0?(this._width=t.width,this._height=t.height,this.resizeAndRender()):this._widgetLayout},i.prototype.onCloseRequest=function(t){this._closable.canClose(this._widget,this)&&this.dispose()},i}(Ve),$e=function(t){function e(e){return t.apply(this,e)||this}return Ye(e,t),e.create=function(){return Object.create(e.prototype)},e.prototype.watchRendered=function(t,e){if(e)var n=this.map(function(t){return{wa:t,w:t.widget,rc:t.widget.renderCount()}}),i=setInterval(function(){(function(){for(var t=0,e=n;t<e.length;t++){var i=e[t];if(i.wa.isVisible&&i.rc>=i.w.renderCount())return!1}return!0})()&&(clearInterval(i),e(t))},20)},e}(Array),tn=function(t){function e(){return t.call(this)||this}return Ye(e,t),e.prototype.createTabBar=function(){var e=t.prototype.createTabBar.call(this);return e.tabsMovable=this._owner.tabsMovable,e},e}(Fe.Renderer),en=function(t){function e(e){void 0===e&&(e={});var n=this;return e.renderer=e.renderer||new tn,(n=t.call(this,e)||this)._renderer instanceof tn&&(n._renderer._owner=n),n._tabsMovable=!0,n._content=$e.create(),n._contentMap={},n}return Ye(e,t),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(t){this._tabsMovable=t,Ke(this.tabBars(),function(e){return e.tabsMovable=t})},enumerable:!1,configurable:!0}),e.prototype.appendContent=function(t){this._content.push(t),this._contentMap[t.widget.id()]=t},e.prototype.removeContent=function(t){var e=this._content.indexOf(t);e>=0&&this._content.splice(e,1),delete this._contentMap[t.widget.id()],t.dispose()},e.prototype.content=function(){return this._content},e.prototype.serializeWidget=function(t){if(t instanceof Qe)try{return{__id:t.widget.id()}}catch(t){return{exception:{message:t.message,stack:t.stack}}}return null},e.prototype.deserializeWidget=function(t){var e=this._contentMap[t.__id];return e||(e=new Qe(void 0,t)),e},e.prototype.serializeITabAreaConfig=function(t,e){var n=this;return Xe(Xe({},t),{widgets:t.widgets.map(function(t){return e?n.deserializeWidget(t):n.serializeWidget(t)})})},e.prototype.serializeISplitAreaConfig=function(t,e){var n=this;return Xe(Xe({},t),{children:t.children.map(function(t){return n.serializeAreaConfig(t,e)})})},e.prototype.serializeAreaConfig=function(t,e){if(t)switch(t.type){case"tab-area":return this.serializeITabAreaConfig(t,e);case"split-area":return this.serializeISplitAreaConfig(t,e)}},e.prototype.saveLayout=function(){return{main:this.serializeAreaConfig(t.prototype.saveLayout.call(this).main,!1)}},e.prototype.restoreLayout=function(e){return t.prototype.restoreLayout.call(this,{main:this.serializeAreaConfig(e.main,!0)})},e}(Fe);Ge('.p-DockPanel-overlay{background:hsla(0,0%,100%,.6);border:1px dashed #000;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.p-TabBar{min-height:24px;max-height:24px}.p-TabBar-content{min-width:0;min-height:0;align-items:flex-end}.p-TabPanel-tabBar .p-TabBar-content{border-bottom:1px solid silver}.p-TabBar-tab{padding:0 10px;background:#e5e5e5;border:1px solid silver;border-bottom:none;font:12px Helvetica,Arial,sans-serif;flex:0 1 125px;min-height:20px;max-height:20px;min-width:35px;margin-left:-1px;line-height:20px}.p-TabBar-tab.p-mod-current{background:#fff}.p-TabBar-tab:hover:not(.p-mod-current){background:#f0f0f0}.p-TabBar-tab:first-child{margin-left:0}.p-TabBar-tab.p-mod-current{min-height:23px;max-height:23px;transform:translateY(1px)}.p-TabBar-tabCloseIcon,.p-TabBar-tabIcon,.p-TabBar-tabLabel{display:inline-block}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon{margin-left:4px}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon:before{content:"\\f00d";font-family:FontAwesome}.p-TabBar-tab.p-mod-drag-image{min-height:23px;max-height:23px;min-width:125px;border:none;box-shadow:1px 1px 2px rgba(0,0,0,.3);transform:translateX(-40%) translateY(-58%)}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide{min-height:1px!important;max-height:1px!important}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide .p-TabBar-tab.p-mod-current{display:none}');var nn=function(t){function n(){var e=t.call(this)||this;return e._dock=new en({mode:"multiple-document"}),e._layoutObj=null,e._tag="div",e._dock.id="p"+e.id(),Kt.installMessageHook(e,e),e}return Ye(n,t),n.prototype.getWidgetAdapter=function(t){var e=null;return this._dock.content().some(function(n){return n.widget===t&&(e=n,!0)}),e},n.prototype.addWidget=function(t,e,n,i,r){void 0===n&&(n="split-right");var o={mode:n,ref:this.getWidgetAdapter(i)},a=new Qe(this,t,{},r);return a.title.label=e,a.padding=8,this._dock.addWidget(a,o),this._dock.appendContent(a),this._dock.tabsMovable=!0,this},n.prototype.removeWidget=function(t){var e=this.getWidgetAdapter(t);return e&&(t.target(null),this._dock.removeContent(e)),this},n.prototype.isVisible=function(t){return this.getWidgetAdapter(t).isVisible},n.prototype.widgetAdapters=function(){return this._dock.content()},n.prototype.widgets=function(){return this._dock.content().map(function(t){return t.widget})},n.prototype.layout=function(t){return arguments.length?(this._dock.restoreLayout(t),this):this._dock.saveLayout()},n.prototype.layoutObj=function(t){return this._layoutObj=t,this},n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._pPlaceholder=n.append("div"),Ve.attach(this._dock,this._pPlaceholder.node())},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._pPlaceholder.style("width",this.width()+"px").style("height",this.height()+"px").style("overflow","auto"),n.select(".p-Widget").style("width",this._pPlaceholder.node().clientWidth+"px").style("height",this.height()+"px"),this.widgets().forEach(function(t){return t.render()})},n.prototype.exit=function(e,n){var i=this;(function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||e)})([],this.widgets()).forEach(function(t){return i.removeWidget(t)}),t.prototype.exit.call(this,e,n)},n.prototype.render=function(n){var i=this,r=this;return null!==this._layoutObj&&(this.layout(this._layoutObj),this.layoutObj(null)),t.prototype.render.call(this,function(t){i._dock.content().watchRendered(i,n),i._dock.update(),setTimeout(function(){var t=i.element().selectAll(".p-Widget.p-TabBar.p-DockPanel-tabBar"),n=!1;t.each(function(){var t=e.select(this),i=t.node().childNodes[0].childNodes.length,o=r.hideSingleTabs()&&1===i;o!==t.classed("hide")&&(t.classed("hide",o),n=!0)}),n&&i._dock.fit()},0)})},n.prototype.refit=function(){this._dock.fit()},n.prototype.messageHook=function(t,e){return t===this&&this.processMessage(e),!0},n.prototype.processMessage=function(t){switch(t.type){case"wa-activate-request":var e=t.wa,n=e.widget;this._prevActive!==n&&(this._prevActive=n,this.childActivation(n,e))}},n.prototype.childActivation=function(t,e){},n.prototype.active=function(){return this._prevActive},n}(e.HTMLWidget);nn.prototype._class+=" phosphor_DockPanel",nn.prototype.publish("hideSingleTabs",!1,"boolean");var rn=function(t){function e(e){void 0===e&&(e="vertical");var n=t.call(this)||this;return n.content=$e.create(),n._split=new He({orientation:e}),n._tag="div",n._split.id="p"+n.id(),n}return Ye(e,t),e.prototype.getWidgetAdapter=function(t){var e=null;return this.content.some(function(n){return n.widget===t&&(e=n,!0)}),e},e.prototype.addWidget=function(t){var e=new Qe(this,t);return this._split.addWidget(e),this.content.push(e),this},e.prototype.relativeSizes=function(t){return arguments.length?(this._split.setRelativeSizes(t),this):this._split.relativeSizes()},e.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),Ve.attach(this._split,e)},e.prototype.update=function(e,n){t.prototype.update.call(this,e,n),n.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.exit=function(e,n){t.prototype.exit.call(this,e,n)},e.prototype.render=function(e){var n=this;return t.prototype.render.call(this,function(t){n.content.watchRendered(n,e),n._split.update()})},e}(e.HTMLWidget);rn.prototype._class+=" phosphor_SplitPanel";var on=function(t){function e(){var e=t.call(this)||this;return e._tab=new qe({tabPlacement:"top"}),e.content=$e.create(),e._tag="div",e._tab.id="p"+e.id(),e}return Ye(e,t),e.prototype.getWidget=function(t){if(t instanceof Qe)return t.widget},e.prototype.getWidgetAdapter=function(t){var e=null;return this.content.some(function(n){return n.widget===t&&(e=n,!0)}),e},e.prototype.addWidget=function(t,e,n){void 0===n&&(n={}),this._prevActive||(this._prevActive=t);var i=new Qe(this,t,void 0,void 0,n);return i.title.label=e,i.padding=8,this._tab.addWidget(i),this.content.push(i),this},e.prototype.removeWidget=function(t){var e=this.getWidgetAdapter(t);if(e){var n=this.content.indexOf(e);n>=0&&this.content.splice(n,1),t.target(null),e.dispose()}return this},e.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),Ve.attach(this._tab,e)},e.prototype.update=function(e,n){t.prototype.update.call(this,e,n),n.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.exit=function(e,n){t.prototype.exit.call(this,e,n)},e.prototype.render=function(e){var n=this;return t.prototype.render.call(this,function(t){n.content.watchRendered(n,e),n._tab.update()})},e.prototype.messageHook=function(t,e){return t===this&&this.processMessage(e),!0},e.prototype.processMessage=function(t){switch(t.type){case"wa-activate-request":var e=t.wa.widget;this._prevActive!==e&&(this._prevActive=e,this.childActivation(e))}},e.prototype.childActivation=function(t){},e.prototype.active=function(t){return arguments.length?(this._tab.currentWidget=this.getWidgetAdapter(t),this):this.getWidget(this._tab.currentWidget)},e}(e.HTMLWidget);on.prototype._class+=" phosphor_TabPanel",t.BUILD_VERSION="2.100.0",t.CommandPalette=We,t.CommandRegistry=xt,t.ContextMenu=Ne,t.DockPanel=nn,t.PKG_NAME="@hpcc-js/phosphor",t.PKG_VERSION="2.14.59",t.SplitPanel=rn,t.TabPanel=on,t.WidgetAdapter=Qe,t.WidgetAdapterArray=$e,Object.defineProperty(t,"__esModule",{value:!0})});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],e):e((t=t||self)["@hpcc-js/phosphor"]={},t["@hpcc-js/common"])}(this,function(t,e){"use strict";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function r(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&n.path)}},n.exports),n.exports}var o=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(o);o.ArrayExt;var a=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i});i(a);a.iter,a.each,a.every,a.some,a.toArray,a.ArrayIterator;var s=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(a.iter(t.map(a.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(s);s.chain,s.ChainIterator;var u=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(u);u.empty,u.EmptyIterator;var c=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(a.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i(c);c.filter,c.FilterIterator;var h=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=a.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.min=function(t,e){var n=a.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=a.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=a.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(h);h.find,h.min,h.max,h.minmax;var d=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(a.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(d);d.map,d.MapIterator;var l=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(l);l.range,l.RangeIterator;var p=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=a.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var s,u,c=r.next();if(void 0===c&&void 0===n)return o;if(void 0===c)return e(n,o,i++);for(s=e(void 0===n?o:e(n,o,i++),c,i++);void 0!==(u=r.next());)s=e(s,u,i++);return s}});i(p);p.reduce;var f=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(f);f.repeat,f.once,f.RepeatIterator;var v=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(v);v.retro,v.RetroArrayIterator;var m=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return a.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(m);m.topologicSort;var _=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(a.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(_);_.stride,_.StrideIterator;var g=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i}}(e.StringExt||(e.StringExt={}))});i(g);g.StringExt;var y=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(a.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(y);y.take,y.TakeIterator;var b=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(a.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(b);b.zip,b.ZipIterator;var x=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(o),n(s),n(u),n(c),n(h),n(a),n(d),n(l),n(p),n(f),n(v),n(m),n(_),n(g),n(y),n(b)}),M=i(x),w=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function n(t){return Array.isArray(t)}function i(t,r){if(t===r)return!0;if(e(t)||e(r))return!1;var o=n(t),a=n(r);return o===a&&(o&&a?function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;++n)if(!i(t[n],e[n]))return!1;return!0}(t,r):function(t,e){if(t===e)return!0;for(var n in t)if(!(n in e))return!1;for(var n in e)if(!(n in t))return!1;for(var n in t)if(!i(t[n],e[n]))return!1;return!0}(t,r))}function r(t){return e(t)?t:n(t)?function(t){for(var e=new Array(t.length),n=0,i=t.length;n<i;++n)e[n]=r(t[n]);return e}(t):function(t){var e={};for(var n in t)e[n]=r(t[n]);return e}(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=function(t){return!e(t)&&!n(t)},t.deepEqual=i,t.deepCopy=r}(e.JSONExt||(e.JSONExt={}))});i(w);w.JSONExt;var P=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this._types=[],this._values=[]}return t.prototype.types=function(){return this._types.slice()},t.prototype.hasData=function(t){return-1!==this._types.indexOf(t)},t.prototype.getData=function(t){var e=this._types.indexOf(t);return-1!==e?this._values[e]:void 0},t.prototype.setData=function(t,e){this.clearData(t),this._types.push(t),this._values.push(e)},t.prototype.clearData=function(t){var e=this._types.indexOf(t);-1!==e&&(this._types.splice(e,1),this._values.splice(e,1))},t.prototype.clear=function(){this._types.length=0,this._values.length=0},t}();e.MimeData=n});i(P);P.MimeData;var I=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){var t=this;this.promise=new Promise(function(e,n){t._resolve=e,t._reject=n})}return t.prototype.resolve=function(t){(0,this._resolve)(t)},t.prototype.reject=function(t){(0,this._reject)(t)},t}();e.PromiseDelegate=n});i(I);I.PromiseDelegate;var A=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e;t.getRandomValues=(e="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null)&&"function"==typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:e&&"function"==typeof e.randomFillSync?function(t){return e.randomFillSync(t)}:e&&"function"==typeof e.randomBytes?function(t){for(var n=e.randomBytes(t.length),i=0,r=n.length;i<r;++i)t[i]=n[i]}:function(t){for(var e=0,n=0,i=t.length;n<i;++n)n%4==0&&(e=4294967295*Math.random()>>>0),t[n]=255&e,e>>>=8}}(e.Random||(e.Random={}))});i(A);A.Random;var E=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(t){this.name=t,this._tokenStructuralPropertyT=null}}();e.Token=n});i(E);E.Token;var S=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.uuid4=function(){for(var t=new Uint8Array(16),e=new Array(256),n=0;n<16;++n)e[n]="0"+n.toString(16);for(n=16;n<256;++n)e[n]=n.toString(16);return function(){return A.Random.getRandomValues(t),t[6]=64|15&t[6],t[8]=128|63&t[8],e[t[0]]+e[t[1]]+e[t[2]]+e[t[3]]+"-"+e[t[4]]+e[t[5]]+"-"+e[t[6]]+e[t[7]]+"-"+e[t[8]]+e[t[9]]+"-"+e[t[10]]+e[t[11]]+e[t[12]]+e[t[13]]+e[t[14]]+e[t[15]]}}()}(e.UUID||(e.UUID={}))});i(S);S.UUID;var O=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(w),n(P),n(I),n(A),n(E),n(S)});i(O);var C=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(var i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e){void 0===e&&(e={});var n=e.start,i=e.stop,r=e.step;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");var o,a=t.length;void 0===n?n=r<0?a-1:0:n<0?n=Math.max(n+a,r<0?-1:0):n>=a&&(n=r<0?a-1:a),void 0===i?i=r<0?-1:a:i<0?i=Math.max(i+a,r<0?-1:0):i>=a&&(i=r<0?a-1:a),o=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);for(var s=[],u=0;u<o;++u)s[u]=t[n+u*r];return s},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(C);C.ArrayExt;var L=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.iterKeys=function(t){return new r(t)},e.iterValues=function(t){return new o(t)},e.iterItems=function(t){return new a(t)},e.iterFn=function(t){return new s(t)},e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r},e.toObject=function(t){for(var e,i=n(t),r={};void 0!==(e=i.next());)r[e[0]]=e[1];return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i;var r=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}();e.KeyIterator=r;var o=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}();e.ValueIterator=o;var a=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}();e.ItemIterator=a;var s=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();e.FnIterator=s});i(L);L.iter,L.iterKeys,L.iterValues,L.iterItems,L.iterFn,L.each,L.every,L.some,L.toArray,L.toObject,L.ArrayIterator,L.KeyIterator,L.ValueIterator,L.ItemIterator,L.FnIterator;var z=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(L.iter(t.map(L.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(z);z.chain,z.ChainIterator;var k=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(k);k.empty,k.EmptyIterator;var T=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.enumerate=function(t,e){return void 0===e&&(e=0),new n(L.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._index=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();e.EnumerateIterator=n});i(T);T.enumerate,T.EnumerateIterator;var j=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(L.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i(j);j.filter,j.FilterIterator;var D=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=L.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.findIndex=function(t,e){for(var n,i=0,r=L.iter(t);void 0!==(n=r.next());)if(e(n,i++))return i-1;return-1},e.min=function(t,e){var n=L.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=L.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=L.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(D);D.find,D.findIndex,D.min,D.max,D.minmax;var B=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(L.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(B);B.map,B.MapIterator;var R=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(R);R.range,R.RangeIterator;var W=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=L.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var a,s,u=r.next();if(void 0===u&&void 0===n)return o;if(void 0===u)return e(n,o,i++);for(a=e(void 0===n?o:e(n,o,i++),u,i++);void 0!==(s=r.next());)a=e(a,s,i++);return a}});i(W);W.reduce;var N=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(N);N.repeat,N.once,N.RepeatIterator;var F=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(F);F.retro,F.RetroArrayIterator;var H=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return L.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(H);H.topologicSort;var q=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(L.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(q);q.stride,q.StrideIterator;var V=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(e.StringExt||(e.StringExt={}))});i(V);V.StringExt;var K=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(L.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(K);K.take,K.TakeIterator;var U=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(L.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(U);U.zip,U.ZipIterator;var Y=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(C),n(z),n(k),n(T),n(j),n(D),n(L),n(B),n(R),n(W),n(N),n(F),n(H),n(q),n(V),n(K),n(U)});i(Y);var X=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(var i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e){void 0===e&&(e={});var n=e.start,i=e.stop,r=e.step;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");var o,a=t.length;void 0===n?n=r<0?a-1:0:n<0?n=Math.max(n+a,r<0?-1:0):n>=a&&(n=r<0?a-1:a),void 0===i?i=r<0?-1:a:i<0?i=Math.max(i+a,r<0?-1:0):i>=a&&(i=r<0?a-1:a),o=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);for(var s=[],u=0;u<o;++u)s[u]=t[n+u*r];return s},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(X);X.ArrayExt;var G=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.iterKeys=function(t){return new r(t)},e.iterValues=function(t){return new o(t)},e.iterItems=function(t){return new a(t)},e.iterFn=function(t){return new s(t)},e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r},e.toObject=function(t){for(var e,i=n(t),r={};void 0!==(e=i.next());)r[e[0]]=e[1];return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i;var r=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}();e.KeyIterator=r;var o=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}();e.ValueIterator=o;var a=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}();e.ItemIterator=a;var s=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();e.FnIterator=s});i(G);G.iter,G.iterKeys,G.iterValues,G.iterItems,G.iterFn,G.each,G.every,G.some,G.toArray,G.toObject,G.ArrayIterator,G.KeyIterator,G.ValueIterator,G.ItemIterator,G.FnIterator;var J=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(G.iter(t.map(G.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(J);J.chain,J.ChainIterator;var Z=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(Z);Z.empty,Z.EmptyIterator;var Q=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.enumerate=function(t,e){return void 0===e&&(e=0),new n(G.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._index=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();e.EnumerateIterator=n});i(Q);Q.enumerate,Q.EnumerateIterator;var $=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(G.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i($);$.filter,$.FilterIterator;var tt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=G.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.findIndex=function(t,e){for(var n,i=0,r=G.iter(t);void 0!==(n=r.next());)if(e(n,i++))return i-1;return-1},e.min=function(t,e){var n=G.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=G.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=G.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(tt);tt.find,tt.findIndex,tt.min,tt.max,tt.minmax;var et=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(G.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(et);et.map,et.MapIterator;var nt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(nt);nt.range,nt.RangeIterator;var it=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=G.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var a,s,u=r.next();if(void 0===u&&void 0===n)return o;if(void 0===u)return e(n,o,i++);for(a=e(void 0===n?o:e(n,o,i++),u,i++);void 0!==(s=r.next());)a=e(a,s,i++);return a}});i(it);it.reduce;var rt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(rt);rt.repeat,rt.once,rt.RepeatIterator;var ot=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(ot);ot.retro,ot.RetroArrayIterator;var at=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return G.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(at);at.topologicSort;var st=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(G.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(st);st.stride,st.StrideIterator;var ut=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(e.StringExt||(e.StringExt={}))});i(ut);ut.StringExt;var ct=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(G.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(ct);ct.take,ct.TakeIterator;var ht=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(G.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(ht);ht.zip,ht.ZipIterator;var dt=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(X),n(J),n(Z),n(Q),n($),n(tt),n(G),n(et),n(nt),n(it),n(rt),n(ot),n(at),n(st),n(ut),n(ct),n(ht)});i(dt);var lt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t){this.sender=t}return t.prototype.connect=function(t,e){return n.connect(this,t,e)},t.prototype.disconnect=function(t,e){return n.disconnect(this,t,e)},t.prototype.emit=function(t){n.emit(this,t)},t}();e.Signal=i,function(t){t.disconnectBetween=function(t,e){n.disconnectBetween(t,e)},t.disconnectSender=function(t){n.disconnectSender(t)},t.disconnectReceiver=function(t){n.disconnectReceiver(t)},t.disconnectAll=function(t){n.disconnectAll(t)},t.clearData=function(t){n.disconnectAll(t)},t.getExceptionHandler=function(){return n.exceptionHandler},t.setExceptionHandler=function(t){var e=n.exceptionHandler;return n.exceptionHandler=t,e}}(i=e.Signal||(e.Signal={})),e.Signal=i,function(t){t.exceptionHandler=function(t){console.error(t)},t.connect=function(t,i,r){r=r||void 0;var a=e.get(t.sender);if(a||(a=[],e.set(t.sender,a)),o(a,t,i,r))return!1;var s=r||i,u=n.get(s);u||(u=[],n.set(s,u));var c={signal:t,slot:i,thisArg:r};return a.push(c),u.push(c),!0},t.disconnect=function(t,i,r){r=r||void 0;var a=e.get(t.sender);if(!a||0===a.length)return!1;var u=o(a,t,i,r);if(!u)return!1;var c=r||i,h=n.get(c);return u.signal=null,s(a),s(h),!0},t.disconnectBetween=function(t,i){var r=e.get(t);if(r&&0!==r.length){var o=n.get(i);o&&0!==o.length&&(dt.each(o,function(e){e.signal&&e.signal.sender===t&&(e.signal=null)}),s(r),s(o))}},t.disconnectSender=function(t){var i=e.get(t);i&&0!==i.length&&(dt.each(i,function(t){if(t.signal){var e=t.thisArg||t.slot;t.signal=null,s(n.get(e))}}),s(i))},t.disconnectReceiver=function(t){var i=n.get(t);i&&0!==i.length&&(dt.each(i,function(t){if(t.signal){var n=t.signal.sender;t.signal=null,s(e.get(n))}}),s(i))},t.disconnectAll=function(t){var i=e.get(t);i&&i.length>0&&(dt.each(i,function(t){t.signal=null}),s(i));var r=n.get(t);r&&r.length>0&&(dt.each(r,function(t){t.signal=null}),s(r))},t.emit=function(t,n){var i=e.get(t.sender);if(i&&0!==i.length)for(var r=0,o=i.length;r<o;++r){var s=i[r];s.signal===t&&a(s,n)}};var e=new WeakMap,n=new WeakMap,i=new Set,r="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function o(t,e,n,i){return dt.find(t,function(t){return t.signal===e&&t.slot===n&&t.thisArg===i})}function a(e,n){var i=e.signal,r=e.slot,o=e.thisArg;try{r.call(o,i.sender,n)}catch(e){t.exceptionHandler(e)}}function s(t){0===i.size&&r(u),i.add(t)}function u(){i.forEach(c),i.clear()}function c(t){dt.ArrayExt.removeAllWhere(t,h)}function h(t){return null===t.signal}}(n||(n={}))});i(lt);lt.Signal;var pt=r(function(t,e){var i=n&&n.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this._fn=t}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){if(this._fn){var t=this._fn;this._fn=null,t()}},t}();e.DisposableDelegate=r;var o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._disposed=new lt.Signal(e),e}return i(e,t),Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),lt.Signal.clearData(this))},e}(r);e.ObservableDisposableDelegate=o;var a=function(){function t(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(t){t.dispose()}),this._items.clear())},t.prototype.contains=function(t){return this._items.has(t)},t.prototype.add=function(t){this._items.add(t)},t.prototype.remove=function(t){this._items.delete(t)},t.prototype.clear=function(){this._items.clear()},t}();e.DisposableSet=a,function(t){t.from=function(e){var n=new t;return Y.each(e,function(t){n.add(t)}),n}}(a=e.DisposableSet||(e.DisposableSet={})),e.DisposableSet=a;var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._disposed=new lt.Signal(e),e}return i(e,t),Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),lt.Signal.clearData(this))},e}(a);e.ObservableDisposableSet=s,function(t){t.from=function(e){var n=new t;return Y.each(e,function(t){n.add(t)}),n}}(s=e.ObservableDisposableSet||(e.ObservableDisposableSet={})),e.ObservableDisposableSet=s});i(pt);pt.DisposableDelegate,pt.ObservableDisposableDelegate,pt.DisposableSet,pt.ObservableDisposableSet;var ft=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.copyText=function(t){var e=document.body,n=function(i){i.preventDefault(),i.stopPropagation(),i.clipboardData.setData("text",t),e.removeEventListener("copy",n,!0)};e.addEventListener("copy",n,!0),document.execCommand("copy")}}(e.ClipboardExt||(e.ClipboardExt={}))});i(ft);ft.ClipboardExt;var vt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.boxSizing=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.borderTopWidth)||0,i=parseFloat(e.borderLeftWidth)||0,r=parseFloat(e.borderRightWidth)||0,o=parseFloat(e.borderBottomWidth)||0,a=parseFloat(e.paddingTop)||0,s=parseFloat(e.paddingLeft)||0,u=parseFloat(e.paddingRight)||0,c=parseFloat(e.paddingBottom)||0;return{borderTop:n,borderLeft:i,borderRight:r,borderBottom:o,paddingTop:a,paddingLeft:s,paddingRight:u,paddingBottom:c,horizontalSum:i+s+u+r,verticalSum:n+a+c+o}},t.sizeLimits=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.minWidth)||0,i=parseFloat(e.minHeight)||0,r=parseFloat(e.maxWidth)||1/0,o=parseFloat(e.maxHeight)||1/0;return{minWidth:n,minHeight:i,maxWidth:r=Math.max(n,r),maxHeight:o=Math.max(i,o)}},t.hitTest=function(t,e,n){var i=t.getBoundingClientRect();return e>=i.left&&e<i.right&&n>=i.top&&n<i.bottom},t.scrollIntoViewIfNeeded=function(t,e){var n=t.getBoundingClientRect(),i=e.getBoundingClientRect();i.top<=n.top&&i.bottom>=n.bottom||(i.top<n.top&&i.height<=n.height?t.scrollTop-=n.top-i.top:i.bottom>n.bottom&&i.height>=n.height?t.scrollTop-=n.top-i.top:i.top<n.top&&i.height>n.height?t.scrollTop-=n.bottom-i.bottom:i.bottom>n.bottom&&i.height<n.height&&(t.scrollTop-=n.bottom-i.bottom))}}(e.ElementExt||(e.ElementExt={}))});i(vt);vt.ElementExt;var mt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.IS_MAC=!!navigator.platform.match(/Mac/i),t.IS_WIN=!!navigator.platform.match(/Win/i),t.IS_IE=/Trident/.test(navigator.userAgent),t.IS_EDGE=/Edge/.test(navigator.userAgent),t.accelKey=function(e){return t.IS_MAC?e.metaKey:e.ctrlKey}}(e.Platform||(e.Platform={}))});i(mt);mt.Platform;var _t=r(function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.calculateSpecificity=function(t){if(t in n.specificityCache)return n.specificityCache[t];var e=n.calculateSingle(t);return n.specificityCache[t]=e},t.isValid=function(t){if(t in n.validityCache)return n.validityCache[t];var e=!0;try{n.testElem.querySelector(t)}catch(t){e=!1}return n.validityCache[t]=e},t.matches=function(t,e){return n.protoMatchFunc.call(t,e)}}(e.Selector||(e.Selector={})),function(t){var e;t.specificityCache=Object.create(null),t.validityCache=Object.create(null),t.testElem=document.createElement("div"),t.protoMatchFunc=(e=Element.prototype).matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(t){var e=this.ownerDocument.querySelectorAll(t);return-1!==Array.prototype.indexOf.call(e,this)},t.calculateSingle=function(t){var e=0,h=0,d=0;function l(e){var n=t.match(e);return null!==n&&(t=t.slice(n[0].length),!0)}for(t=(t=t.split(",",1)[0]).replace(c," $1 ");t.length>0;)if(l(n))e++;else if(l(i))h++;else if(l(r))h++;else if(l(a))d++;else if(l(s))h++;else if(l(o))d++;else if(!l(u))return 0;return(e=Math.min(e,255))<<16|(h=Math.min(h,255))<<8|(d=Math.min(d,255))};var n=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,r=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,a=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,s=/^:[^\s\+>~#\.\[:]+/,u=/^[\s\+>~\*]+/,c=/:not\(([^\)]+)\)/g}(n||(n={}))});i(_t);_t.Selector;var gt=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(ft),n(vt),n(mt),n(_t)});i(gt);var yt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getKeyboardLayout=function(){return n.keyboardLayout},e.setKeyboardLayout=function(t){n.keyboardLayout=t};var n,i=function(){function t(e,n){this.name=e,this._codes=n,this._keys=t.extractKeys(n)}return t.prototype.keys=function(){return Object.keys(this._keys)},t.prototype.isValidKey=function(t){return t in this._keys},t.prototype.keyForKeydownEvent=function(t){return this._codes[t.keyCode]||""},t}();e.KeycodeLayout=i,function(t){t.extractKeys=function(t){var e=Object.create(null);for(var n in t)e[t[n]]=!0;return e}}(i=e.KeycodeLayout||(e.KeycodeLayout={})),e.KeycodeLayout=i,e.EN_US=new i("en-us",{8:"Backspace",9:"Tab",13:"Enter",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}),function(t){t.keyboardLayout=e.EN_US}(n||(n={}))});i(yt);yt.getKeyboardLayout,yt.setKeyboardLayout,yt.KeycodeLayout,yt.EN_US;var bt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=Object.create(null),this._commandChanged=new lt.Signal(this),this._commandExecuted=new lt.Signal(this),this._keyBindingChanged=new lt.Signal(this)}return Object.defineProperty(t.prototype,"commandChanged",{get:function(){return this._commandChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"commandExecuted",{get:function(){return this._commandExecuted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindingChanged",{get:function(){return this._keyBindingChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindings",{get:function(){return this._keyBindings},enumerable:!0,configurable:!0}),t.prototype.listCommands=function(){return Object.keys(this._commands)},t.prototype.hasCommand=function(t){return t in this._commands},t.prototype.addCommand=function(t,e){var i=this;if(t in this._commands)throw new Error("Command '"+t+"' already registered.");return this._commands[t]=n.createCommand(e),this._commandChanged.emit({id:t,type:"added"}),new pt.DisposableDelegate(function(){delete i._commands[t],i._commandChanged.emit({id:t,type:"removed"})})},t.prototype.notifyCommandChanged=function(t){if(void 0!==t&&!(t in this._commands))throw new Error("Command '"+t+"' is not registered.");this._commandChanged.emit({id:t,type:t?"changed":"many-changed"})},t.prototype.label=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.label.call(void 0,e):""},t.prototype.mnemonic=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.mnemonic.call(void 0,e):-1},t.prototype.icon=function(t,e){return void 0===e&&(e=O.JSONExt.emptyObject),this.iconClass(t,e)},t.prototype.iconClass=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.iconClass.call(void 0,e):""},t.prototype.iconLabel=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.iconLabel.call(void 0,e):""},t.prototype.caption=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.caption.call(void 0,e):""},t.prototype.usage=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.usage.call(void 0,e):""},t.prototype.className=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.className.call(void 0,e):""},t.prototype.dataset=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return n?n.dataset.call(void 0,e):{}},t.prototype.isEnabled=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return!!n&&n.isEnabled.call(void 0,e)},t.prototype.isToggled=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return!!n&&n.isToggled.call(void 0,e)},t.prototype.isVisible=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n=this._commands[t];return!!n&&n.isVisible.call(void 0,e)},t.prototype.execute=function(t,e){void 0===e&&(e=O.JSONExt.emptyObject);var n,i=this._commands[t];if(!i)return Promise.reject(new Error("Command '"+t+"' not registered."));try{n=i.execute.call(void 0,e)}catch(t){n=Promise.reject(t)}var r=Promise.resolve(n);return this._commandExecuted.emit({id:t,args:e,result:r}),r},t.prototype.addKeyBinding=function(t){var e=this,i=n.createKeyBinding(t);return this._keyBindings.push(i),this._keyBindingChanged.emit({binding:i,type:"added"}),new pt.DisposableDelegate(function(){x.ArrayExt.removeFirstOf(e._keyBindings,i),e._keyBindingChanged.emit({binding:i,type:"removed"})})},t.prototype.processKeydownEvent=function(e){if(!this._replaying){var i=t.keystrokeForKeydownEvent(e);if(!i)return this._replayKeydownEvents(),void this._clearPendingState();this._keystrokes.push(i);var r=n.matchKeyBinding(this._keyBindings,this._keystrokes,e),o=r.exact,a=r.partial;if(!o&&!a)return this._replayKeydownEvents(),void this._clearPendingState();if(e.preventDefault(),e.stopPropagation(),o&&!a)return this._executeKeyBinding(o),void this._clearPendingState();o&&(this._exactKeyMatch=o),this._keydownEvents.push(e),this._startTimer()}},t.prototype._startTimer=function(){var t=this;this._clearTimer(),this._timerID=setTimeout(function(){t._onPendingTimeout()},n.CHORD_TIMEOUT)},t.prototype._clearTimer=function(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)},t.prototype._replayKeydownEvents=function(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(n.replayKeyEvent),this._replaying=!1)},t.prototype._executeKeyBinding=function(t){var e=t.command,n=t.args;if(this.hasCommand(e)&&this.isEnabled(e,n))this.execute(e,n);else{var i=this.hasCommand(e)?"enabled":"registered",r="Cannot execute key binding '"+t.keys.join(", ")+"':",o="command '"+e+"' is not "+i+".";console.warn(r+" "+o)}},t.prototype._clearPendingState=function(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0},t.prototype._onPendingTimeout=function(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()},t}();e.CommandRegistry=i,function(t){function e(t){for(var e="",n=!1,i=!1,r=!1,o=!1,a=0,s=t.split(/\s+/);a<s.length;a++){var u=s[a];"Accel"===u?gt.Platform.IS_MAC?i=!0:r=!0:"Alt"===u?n=!0:"Cmd"===u?i=!0:"Ctrl"===u?r=!0:"Shift"===u?o=!0:u.length>0&&(e=u)}return{cmd:i,ctrl:r,alt:n,shift:o,key:e}}t.parseKeystroke=e,t.normalizeKeystroke=function(t){var n="",i=e(t);return i.ctrl&&(n+="Ctrl "),i.alt&&(n+="Alt "),i.shift&&(n+="Shift "),i.cmd&&gt.Platform.IS_MAC&&(n+="Cmd "),n+i.key},t.keystrokeForKeydownEvent=function(t){var e=yt.getKeyboardLayout().keyForKeydownEvent(t);if(!e)return"";var n="";return t.ctrlKey&&(n+="Ctrl "),t.altKey&&(n+="Alt "),t.shiftKey&&(n+="Shift "),t.metaKey&&gt.Platform.IS_MAC&&(n+="Cmd "),n+e}}(i=e.CommandRegistry||(e.CommandRegistry={})),e.CommandRegistry=i,function(t){t.CHORD_TIMEOUT=1e3,t.createCommand=function(t){return{execute:t.execute,label:s(t.label,e),mnemonic:s(t.mnemonic,n),iconClass:s(t.iconClass||t.icon,e),iconLabel:s(t.iconLabel,e),caption:s(t.caption,e),usage:s(t.usage,e),className:s(t.className,e),dataset:s(t.dataset,a),isEnabled:t.isEnabled||r,isToggled:t.isToggled||o,isVisible:t.isVisible||r}},t.createKeyBinding=function(t){return{keys:u(t),selector:c(t),command:t.command,args:t.args||O.JSONExt.emptyObject}},t.matchKeyBinding=function(t,e,n){for(var i=null,r=!1,o=1/0,a=0,s=0,u=t.length;s<u;++s){var c=t[s],l=h(c.keys,e);if(0!==l)if(2!==l){var p=d(c.selector,n);if(!(-1===p||p>o)){var f=gt.Selector.calculateSpecificity(c.selector);(!i||p<o||f>=a)&&(i=c,o=p,a=f)}}else r||-1===d(c.selector,n)||(r=!0)}return{exact:i,partial:r}},t.replayKeyEvent=function(t){t.target.dispatchEvent(function(t){var e=document.createEvent("Event"),n=t.bubbles||!0,i=t.cancelable||!0;return e.initEvent(t.type||"keydown",n,i),e.key=t.key||"",e.keyCode=t.keyCode||0,e.which=t.keyCode||0,e.ctrlKey=t.ctrlKey||!1,e.altKey=t.altKey||!1,e.shiftKey=t.shiftKey||!1,e.metaKey=t.metaKey||!1,e.view=t.view||window,e}(t))};var e=function(){return""},n=function(){return-1},r=function(){return!0},o=function(){return!1},a=function(){return{}};function s(t,e){return void 0===t?e:"function"==typeof t?t:function(){return t}}function u(t){return(gt.Platform.IS_WIN?t.winKeys||t.keys:gt.Platform.IS_MAC?t.macKeys||t.keys:t.linuxKeys||t.keys).map(i.normalizeKeystroke)}function c(t){if(-1!==t.selector.indexOf(","))throw new Error("Selector cannot contain commas: "+t.selector);if(!gt.Selector.isValid(t.selector))throw new Error("Invalid selector: "+t.selector);return t.selector}function h(t,e){if(t.length<e.length)return 0;for(var n=0,i=e.length;n<i;++n)if(t[n]!==e[n])return 0;return t.length>e.length?2:1}function d(t,e){for(var n=e.target,i=e.currentTarget,r=0;null!==n;n=n.parentElement,++r){if(gt.Selector.matches(n,t))return r;if(n===i)return-1}return-1}}(n||(n={}))});i(bt);var xt=bt.CommandRegistry,Mt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(var i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e){void 0===e&&(e={});var n=e.start,i=e.stop,r=e.step;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");var o,a=t.length;void 0===n?n=r<0?a-1:0:n<0?n=Math.max(n+a,r<0?-1:0):n>=a&&(n=r<0?a-1:a),void 0===i?i=r<0?-1:a:i<0?i=Math.max(i+a,r<0?-1:0):i>=a&&(i=r<0?a-1:a),o=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);for(var s=[],u=0;u<o;++u)s[u]=t[n+u*r];return s},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(Mt);Mt.ArrayExt;var wt=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.iterKeys=function(t){return new r(t)},e.iterValues=function(t){return new o(t)},e.iterItems=function(t){return new a(t)},e.iterFn=function(t){return new s(t)},e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r},e.toObject=function(t){for(var e,i=n(t),r={};void 0!==(e=i.next());)r[e[0]]=e[1];return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i;var r=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}();e.KeyIterator=r;var o=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}();e.ValueIterator=o;var a=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}();e.ItemIterator=a;var s=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();e.FnIterator=s});i(wt);wt.iter,wt.iterKeys,wt.iterValues,wt.iterItems,wt.iterFn,wt.each,wt.every,wt.some,wt.toArray,wt.toObject,wt.ArrayIterator,wt.KeyIterator,wt.ValueIterator,wt.ItemIterator,wt.FnIterator;var Pt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(wt.iter(t.map(wt.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(Pt);Pt.chain,Pt.ChainIterator;var It=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(It);It.empty,It.EmptyIterator;var At=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.enumerate=function(t,e){return void 0===e&&(e=0),new n(wt.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._index=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();e.EnumerateIterator=n});i(At);At.enumerate,At.EnumerateIterator;var Et=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(wt.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i(Et);Et.filter,Et.FilterIterator;var St=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=wt.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.findIndex=function(t,e){for(var n,i=0,r=wt.iter(t);void 0!==(n=r.next());)if(e(n,i++))return i-1;return-1},e.min=function(t,e){var n=wt.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=wt.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=wt.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(St);St.find,St.findIndex,St.min,St.max,St.minmax;var Ot=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(wt.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(Ot);Ot.map,Ot.MapIterator;var Ct=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(Ct);Ct.range,Ct.RangeIterator;var Lt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=wt.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var a,s,u=r.next();if(void 0===u&&void 0===n)return o;if(void 0===u)return e(n,o,i++);for(a=e(void 0===n?o:e(n,o,i++),u,i++);void 0!==(s=r.next());)a=e(a,s,i++);return a}});i(Lt);Lt.reduce;var zt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(zt);zt.repeat,zt.once,zt.RepeatIterator;var kt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(kt);kt.retro,kt.RetroArrayIterator;var Tt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return wt.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(Tt);Tt.topologicSort;var jt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(wt.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(jt);jt.stride,jt.StrideIterator;var Dt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(e.StringExt||(e.StringExt={}))});i(Dt);Dt.StringExt;var Bt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(wt.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(Bt);Bt.take,Bt.TakeIterator;var Rt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(wt.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(Rt);Rt.zip,Rt.ZipIterator;var Wt=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(Mt),n(Pt),n(It),n(At),n(Et),n(St),n(wt),n(Ot),n(Ct),n(Lt),n(zt),n(kt),n(Tt),n(jt),n(Dt),n(Bt),n(Rt)});i(Wt);var Nt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t){this._root=new n.LeafNode,this.cmp=t}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){var t=n.firstLeaf(this._root);return t.size>0?t.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){var t=n.lastLeaf(this._root);return t.size>0?t.items[t.size-1]:void 0},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return n.iterItems(this._root)},t.prototype.retro=function(){return n.retroItems(this._root)},t.prototype.slice=function(t,e){return n.sliceItems(this._root,t,e)},t.prototype.retroSlice=function(t,e){return n.retroSliceItems(this._root,t,e)},t.prototype.at=function(t){return n.itemAt(this._root,t)},t.prototype.has=function(t,e){return n.hasItem(this._root,t,e)},t.prototype.indexOf=function(t,e){return n.indexOf(this._root,t,e)},t.prototype.get=function(t,e){return n.getItem(this._root,t,e)},t.prototype.assign=function(t){this.clear(),this.update(t)},t.prototype.insert=function(t){var e=n.insertItem(this._root,t,this.cmp);return this._root=n.maybeSplitRoot(this._root),e},t.prototype.update=function(t){var e=this;Wt.each(t,function(t){e.insert(t)})},t.prototype.delete=function(t,e){var i=n.deleteItem(this._root,t,e);return this._root=n.maybeExtractRoot(this._root),i},t.prototype.remove=function(t){var e=n.removeItem(this._root,t);return this._root=n.maybeExtractRoot(this._root),e},t.prototype.clear=function(){n.clear(this._root),this._root=new n.LeafNode},t}();e.BPlusTree=i,function(t){t.from=function(e,n){var i=new t(n);return i.assign(e),i}}(i=e.BPlusTree||(e.BPlusTree={})),e.BPlusTree=i,function(t){var e=function(){function t(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(t.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),t}();t.BranchNode=e;var n=function(){function t(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(t.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t}();function i(t){for(;0===t.type;)t=t.children[0];return t}function r(t){for(;0===t.type;)t=t.children[t.children.length-1];return t}function o(t){0===t.type?(Wt.each(t.children,o),t.children.length=0,t.sizes.length=0,t.items.length=0):(t.items.length=0,t.next=null,t.prev=null)}t.LeafNode=n,t.firstLeaf=i,t.lastLeaf=r,t.iterItems=function(t){var e=i(t);return new u(e,0,-1)},t.retroItems=function(t){var e=r(t);return new c(e,e.size-1,-1)},t.sliceItems=function(t,e,n){e=void 0===e?0:e<0?Math.max(0,e+t.size):Math.min(e,t.size),n=void 0===n?t.size:n<0?Math.max(0,n+t.size):Math.min(n,t.size);var i=Math.max(0,n-e);if(0===i)return Wt.empty();for(;0===t.type;){var r=h(t.sizes,e);r>0&&(e-=t.sizes[r-1]),t=t.children[r]}return new u(t,e,i)},t.retroSliceItems=function(t,e,n){e=void 0===e?t.size-1:e<0?Math.max(-1,e+t.size):Math.min(e,t.size-1),n=void 0===n?-1:n<0?Math.max(-1,n+t.size):Math.min(n,t.size-1);var i=Math.max(0,e-n);if(0===i)return Wt.empty();for(;0===t.type;){var r=h(t.sizes,e);r>0&&(e-=t.sizes[r-1]),t=t.children[r]}return new c(t,e,i)},t.itemAt=function(t,e){if(e<0&&(e+=t.size),!(e<0||e>=t.size)){for(;0===t.type;){var n=h(t.sizes,e);n>0&&(e-=t.sizes[n-1]),t=t.children[n]}return t.items[e]}},t.hasItem=function(t,e,n){for(;0===t.type;){var i=d(t.items,e,n);t=t.children[i]}return l(t.items,e,n)>=0},t.indexOf=function(t,e,n){for(var i=0;0===t.type;){var r=d(t.items,e,n);r>0&&(i+=t.sizes[r-1]),t=t.children[r]}var o=l(t.items,e,n);return o>=0?i+o:-i+o},t.getItem=function(t,e,n){for(;0===t.type;){var i=d(t.items,e,n);t=t.children[i]}var r=l(t.items,e,n);return r>=0?t.items[r]:void 0},t.insertItem=function t(e,n,i){if(1===e.type){var r,o=l(e.items,n,i);return o>=0?(r=e.items[o],e.items[o]=n):(r=void 0,Wt.ArrayExt.insert(e.items,-o-1,n)),r}var s=d(e.items,n,i),u=e.children[s],c=u.size,h=t(u,n,i),v=u.size;if(e.items[s]=u.items[0],c===v)return h;if(u.width>a){var m=f(u);Wt.ArrayExt.insert(e.children,s+1,m),Wt.ArrayExt.insert(e.items,s+1,m.items[0])}return p(e,s),h},t.deleteItem=function t(e,n,i){if(1===e.type){var r=l(e.items,n,i);if(r<0)return;return Wt.ArrayExt.removeAt(e.items,r)}var o=d(e.items,n,i),a=e.children[o],u=a.size,c=t(a,n,i);return u===a.size?c:(e.items[o]=a.items[0],a.width<s&&(o=v(e,o)),p(e,o),c)},t.removeItem=function t(e,n){if(n<0&&(n+=e.size),!(n<0||n>=e.size)){if(1===e.type)return Wt.ArrayExt.removeAt(e.items,n);var i=h(e.sizes,n);i>0&&(n-=e.sizes[i]);var r=e.children[i],o=t(r,n);return e.items[i]=r.items[0],r.width<s&&(i=v(e,i)),p(e,i),o}},t.clear=o,t.maybeSplitRoot=function(t){if(t.width<=a)return t;var n=new e,i=f(t);return n.sizes[0]=t.size,n.sizes[1]=t.size+i.size,n.children[0]=t,n.children[1]=i,n.items[0]=t.items[0],n.items[1]=i.items[0],n},t.maybeExtractRoot=function(t){if(1===t.type)return t;if(t.children.length>1)return t;var e=t.children.pop();return o(t),e};var a=32,s=a>>1,u=function(){function t(t,e,n){this._node=t,this._index=e,this._count=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node,this._index,this._count)},t.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},t}(),c=function(){function t(t,e,n){this._node=t,this._index=e,this._count=n}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node,this._index,this._count)},t.prototype.next=function(){if(null!==this._node&&0!==this._count)return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},t}();function h(t,e){for(var n=t.length,i=0;i<n;++i)if(t[i]>e)return i;return n-1}function d(t,e,n){for(var i=t.length,r=1;r<i;++r)if(n(t[r],e)>0)return r-1;return i-1}function l(t,e,n){for(var i=t.length,r=0;r<i;++r){var o=n(t[r],e);if(0===o)return r;if(o>0)return-r-1}return-i-1}function p(t,e){for(var n=t.sizes,i=t.children,r=e>0?n[e-1]:0,o=i.length;e<o;++e)r=n[e]=r+i[e].size;n.length=i.length}function f(t){if(1===t.type){for(var i=new n,r=t.items,o=i.items,a=s,u=r.length;a<u;++a)o.push(r[a]);return r.length=s,t.next&&(t.next.prev=i),i.next=t.next,i.prev=t,t.next=i,i}var c=new e,h=t.children,d=c.children;for(a=s,u=h.length;a<u;++a)d.push(h[a]);h.length=s;var l=t.items,f=c.items;for(a=s,u=l.length;a<u;++a)f.push(l[a]);return l.length=s,p(t,s),p(c,0),c}function v(t,e){var n,i,r,a,u,c,h=t.children[e],d=0===e?t.children[e+1]:t.children[e-1],l=0===e,f=1===h.type,v=d.width>s;if(f&&v&&l){var m=d;return(_=h).items.push(m.items.shift()),t.items[e+1]=m.items[0],e}if(f&&v&&!l){m=d;return(_=h).items.unshift(m.items.pop()),t.items[e]=_.items[0],e-1}if(f&&!v&&l){var _=h;return(n=(m=d).items).unshift.apply(n,_.items),Wt.ArrayExt.removeAt(t.children,e),Wt.ArrayExt.removeAt(t.items,e+1),_.prev&&(_.prev.next=m),m.prev=_.prev,o(_),e}if(f&&!v&&!l){_=h;return(i=(m=d).items).push.apply(i,_.items),Wt.ArrayExt.removeAt(t.children,e),Wt.ArrayExt.removeAt(t.items,e),_.next&&(_.next.prev=m),m.next=_.next,o(_),e-1}if(!f&&v&&l){m=d;return(_=h).children.push(m.children.shift()),_.items.push(m.items.shift()),t.items[e+1]=m.items[0],p(_,_.width-1),p(m,0),e}if(!f&&v&&!l){m=d;return(_=h).children.unshift(m.children.pop()),_.items.unshift(m.items.pop()),t.items[e]=_.items[0],p(_,0),p(m,m.width-1),e-1}if(!f&&!v&&l){_=h;return(r=(m=d).children).unshift.apply(r,_.children),(a=m.items).unshift.apply(a,_.items),Wt.ArrayExt.removeAt(t.children,e),Wt.ArrayExt.removeAt(t.items,e+1),p(m,0),_.children.length=0,o(_),e}if(!f&&!v&&!l){_=h;return(u=(m=d).children).push.apply(u,_.children),(c=m.items).push.apply(c,_.items),Wt.ArrayExt.removeAt(t.children,e),Wt.ArrayExt.removeAt(t.items,e),p(m,0),_.children.length=0,o(_),e-1}throw"unreachable"}}(n||(n={}))});i(Nt);Nt.BPlusTree;var Ft=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return new t.ForwardValueIterator(this._first)},t.prototype.retro=function(){return new t.RetroValueIterator(this._last)},t.prototype.nodes=function(){return new t.ForwardNodeIterator(this._first)},t.prototype.retroNodes=function(){return new t.RetroNodeIterator(this._last)},t.prototype.assign=function(t){var e=this;this.clear(),Wt.each(t,function(t){e.addLast(t)})},t.prototype.push=function(t){this.addLast(t)},t.prototype.pop=function(){return this.removeLast()},t.prototype.shift=function(t){this.addFirst(t)},t.prototype.unshift=function(){return this.removeFirst()},t.prototype.addFirst=function(t){var e=new n.LinkedListNode(this,t);return this._first?(e.next=this._first,this._first.prev=e,this._first=e):(this._first=e,this._last=e),this._size++,e},t.prototype.addLast=function(t){var e=new n.LinkedListNode(this,t);return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._first=e,this._last=e),this._size++,e},t.prototype.insertBefore=function(t,e){if(!e||e===this._first)return this.addFirst(t);if(!(e instanceof n.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var i=new n.LinkedListNode(this,t),r=e,o=r.prev;return i.next=r,i.prev=o,r.prev=i,o.next=i,this._size++,i},t.prototype.insertAfter=function(t,e){if(!e||e===this._last)return this.addLast(t);if(!(e instanceof n.LinkedListNode)||e.list!==this)throw new Error("Reference node is not owned by the list.");var i=new n.LinkedListNode(this,t),r=e,o=r.next;return i.next=o,i.prev=r,r.next=i,o.prev=i,this._size++,i},t.prototype.removeFirst=function(){var t=this._first;if(t)return t===this._last?(this._first=null,this._last=null):(this._first=t.next,this._first.prev=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value},t.prototype.removeLast=function(){var t=this._last;if(t)return t===this._first?(this._first=null,this._last=null):(this._last=t.prev,this._last.next=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value},t.prototype.removeNode=function(t){if(!(t instanceof n.LinkedListNode)||t.list!==this)throw new Error("Node is not owned by the list.");var e=t;e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._size--},t.prototype.clear=function(){for(var t=this._first;t;){var e=t.next;t.list=null,t.prev=null,t.next=null,t=e}this._first=null,this._last=null,this._size=0},t}();e.LinkedList=i,function(t){t.from=function(e){var n=new t;return n.assign(e),n};var e=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t.value}},t}();t.ForwardValueIterator=e;var n=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t.value}},t}();t.RetroValueIterator=n;var i=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.next,t}},t}();t.ForwardNodeIterator=i;var r=function(){function t(t){this._node=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._node)},t.prototype.next=function(){if(this._node){var t=this._node;return this._node=t.prev,t}},t}();t.RetroNodeIterator=r}(i=e.LinkedList||(e.LinkedList={})),e.LinkedList=i,function(t){var e=function(){return function(t,e){this.list=null,this.next=null,this.prev=null,this.list=t,this.value=e}}();t.LinkedListNode=e}(n||(n={}))});i(Ft);Ft.LinkedList;var Ht=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(Nt),n(Ft)});i(Ht);var qt=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.type=t}return Object.defineProperty(t.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),t.prototype.conflate=function(t){return!1},t}();e.Message=r;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.conflate=function(t){return!0},e}(r);e.ConflatableMessage=o,function(t){function e(t,e){var n=i.get(t);n&&0!==n.length?x.every(x.retro(n),function(n){return!n||function(t,e,n){var i=!0;try{i="function"==typeof t?t(e,n):t.messageHook(e,n)}catch(t){o(t)}return i}(n,t,e)})&&h(t,e):h(t,e)}t.sendMessage=e,t.postMessage=function(t,e){e.isConflatable&&x.some(n,function(n){return n.handler===t&&!!n.msg&&n.msg.type===e.type&&!!n.msg.isConflatable&&n.msg.conflate(e)})||d(t,e)},t.installMessageHook=function(t,e){var n=i.get(t);n&&-1!==n.indexOf(e)||(n?n.push(e):i.set(t,[e]))},t.removeMessageHook=function(t,e){var n=i.get(t);if(n){var r=n.indexOf(e);-1!==r&&(n[r]=null,p(n))}},t.clearData=function(t){var e=i.get(t);e&&e.length>0&&(x.ArrayExt.fill(e,null),p(e)),x.each(n,function(e){e.handler===t&&(e.handler=null,e.msg=null)})},t.flush=function(){s||0===a||(c(a),s=!0,l(),s=!1)},t.getExceptionHandler=function(){return o},t.setExceptionHandler=function(t){var e=o;return o=t,e};var n=new Ht.LinkedList,i=new WeakMap,r=new Set,o=function(t){console.error(t)},a=0,s=!1,u="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate,c="function"==typeof cancelAnimationFrame?cancelAnimationFrame:clearImmediate;function h(t,e){try{t.processMessage(e)}catch(t){o(t)}}function d(t,e){n.addLast({handler:t,msg:e}),0===a&&(a=u(l))}function l(){if(a=0,!n.isEmpty){var t={handler:null,msg:null};for(n.addLast(t);;){var i=n.removeFirst();if(i===t)return;i.handler&&i.msg&&e(i.handler,i.msg)}}}function p(t){0===r.size&&u(f),r.add(t)}function f(){r.forEach(v),r.clear()}function v(t){x.ArrayExt.removeAllWhere(t,m)}function m(t){return null===t}}(e.MessageLoop||(e.MessageLoop={}))});i(qt);qt.Message;var Vt=qt.ConflatableMessage,Kt=qt.MessageLoop,Ut=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}();e.BoxSizer=n,function(t){t.calc=function(t,e){var n=t.length;if(0===n)return e;for(var i=0,r=0,o=0,a=0,s=0,u=0;u<n;++u){var c=(_=t[u]).minSize,h=_.maxSize,d=_.sizeHint;_.done=!1,_.size=Math.max(c,Math.min(d,h)),o+=_.size,i+=c,r+=h,_.stretch>0&&(a+=_.stretch,s++)}if(e===o)return 0;if(e<=i){for(u=0;u<n;++u)(_=t[u]).size=_.minSize;return e-i}if(e>=r){for(u=0;u<n;++u)(_=t[u]).size=_.maxSize;return e-r}var l=n;if(e<o){for(var p=o-e;s>0&&p>.01;){var f=p,v=a;for(u=0;u<n;++u)if(!(_=t[u]).done&&0!==_.stretch){var m=_.stretch*f/v;_.size-m<=_.minSize?(p-=_.size-_.minSize,a-=_.stretch,_.size=_.minSize,_.done=!0,l--,s--):(p-=m,_.size-=m)}}for(;l>0&&p>.01;)for(m=p/l,u=0;u<n;++u)(_=t[u]).done||(_.size-m<=_.minSize?(p-=_.size-_.minSize,_.size=_.minSize,_.done=!0,l--):(p-=m,_.size-=m))}else{for(p=e-o;s>0&&p>.01;)for(f=p,v=a,u=0;u<n;++u)(_=t[u]).done||0===_.stretch||(m=_.stretch*f/v,_.size+m>=_.maxSize?(p-=_.maxSize-_.size,a-=_.stretch,_.size=_.maxSize,_.done=!0,l--,s--):(p-=m,_.size+=m));for(;l>0&&p>.01;)for(m=p/l,u=0;u<n;++u){var _;(_=t[u]).done||(_.size+m>=_.maxSize?(p-=_.maxSize-_.size,_.size=_.maxSize,_.done=!0,l--):(p-=m,_.size+=m))}}return 0},t.adjust=function(t,e,n){0!==t.length&&0!==n&&(n>0?function(t,e,n){for(var i=0,r=0;r<=e;++r){var o=t[r];i+=o.maxSize-o.size}for(var a=0,r=e+1,s=t.length;r<s;++r){var o=t[r];a+=o.size-o.minSize}for(var u=n=Math.min(n,i,a),r=e;r>=0&&u>0;--r){var o=t[r],c=o.maxSize-o.size;c>=u?(o.sizeHint=o.size+u,u=0):(o.sizeHint=o.size+c,u-=c)}for(var h=n,r=e+1,s=t.length;r<s&&h>0;++r){var o=t[r],c=o.size-o.minSize;c>=h?(o.sizeHint=o.size-h,h=0):(o.sizeHint=o.size-c,h-=c)}}(t,e,n):function(t,e,n){for(var i=0,r=e+1,o=t.length;r<o;++r){var a=t[r];i+=a.maxSize-a.size}for(var s=0,r=0;r<=e;++r){var a=t[r];s+=a.size-a.minSize}for(var u=n=Math.min(n,i,s),r=e+1,o=t.length;r<o&&u>0;++r){var a=t[r],c=a.maxSize-a.size;c>=u?(a.sizeHint=a.size+u,u=0):(a.sizeHint=a.size+c,u-=c)}for(var h=n,r=e;r>=0&&h>0;--r){var a=t[r],c=a.size-a.minSize;c>=h?(a.sizeHint=a.size-h,h=0):(a.sizeHint=a.size-c,h-=c)}}(t,e,-n))}}(e.BoxEngine||(e.BoxEngine={}))});i(Ut);Ut.BoxSizer,Ut.BoxEngine;var Yt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t){this._pid=n.nextPID(),this.name=t.name,this._create=t.create,this._coerce=t.coerce||null,this._compare=t.compare||null,this._changed=t.changed||null}return t.prototype.get=function(t){var e=n.ensureMap(t);return this._pid in e?e[this._pid]:e[this._pid]=this._createValue(t)},t.prototype.set=function(t,e){var i,r=n.ensureMap(t);i=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(t);var o=this._coerceValue(t,e);this._maybeNotify(t,i,r[this._pid]=o)},t.prototype.coerce=function(t){var e,i=n.ensureMap(t);e=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(t);var r=this._coerceValue(t,e);this._maybeNotify(t,e,i[this._pid]=r)},t.prototype._createValue=function(t){return(0,this._create)(t)},t.prototype._coerceValue=function(t,e){var n=this._coerce;return n?n(t,e):e},t.prototype._compareValue=function(t,e){var n=this._compare;return n?n(t,e):t===e},t.prototype._maybeNotify=function(t,e,n){var i=this._changed;i&&!this._compareValue(e,n)&&i(t,e,n)},t}();e.AttachedProperty=i,function(t){t.clearData=function(t){n.ownerData.delete(t)}}(i=e.AttachedProperty||(e.AttachedProperty={})),e.AttachedProperty=i,function(t){var e;t.ownerData=new WeakMap,t.nextPID=(e=0,function(){return"pid-"+(""+Math.random()).slice(2)+"-"+e++}),t.ensureMap=function(e){var n=t.ownerData.get(e);return n||(n=Object.create(null),t.ownerData.set(e,n),n)}}(n||(n={}))});i(Yt);Yt.AttachedProperty;var Xt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new lt.Signal(this),this.owner=t.owner,void 0!==t.label&&(this._label=t.label),void 0!==t.mnemonic&&(this._mnemonic=t.mnemonic),void 0!==t.icon&&(this._iconClass=t.icon),void 0!==t.iconClass&&(this._iconClass=t.iconClass),void 0!==t.iconLabel&&(this._iconLabel=t.iconLabel),void 0!==t.caption&&(this._caption=t.caption),void 0!==t.className&&(this._className=t.className),void 0!==t.closable&&(this._closable=t.closable),this._dataset=t.dataset||{}}return Object.defineProperty(t.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(t){this._label!==t&&(this._label=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(t){this._mnemonic!==t&&(this._mnemonic=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this.iconClass},set:function(t){this.iconClass=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._iconClass},set:function(t){this._iconClass!==t&&(this._iconClass=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(t){this._iconLabel!==t&&(this._iconLabel=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._caption},set:function(t){this._caption!==t&&(this._caption=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._className},set:function(t){this._className!==t&&(this._className=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closable",{get:function(){return this._closable},set:function(t){this._closable!==t&&(this._closable=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._dataset},set:function(t){this._dataset!==t&&(this._dataset=t,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),t}();e.Title=n});i(Xt);Xt.Title;var Gt=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t){void 0===t&&(t={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new lt.Signal(this),this.node=r.createNode(t),this.addClass("p-Widget")}return t.prototype.dispose=function(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),lt.Signal.clearData(this),qt.MessageLoop.clearData(this),Yt.AttachedProperty.clearData(this))},Object.defineProperty(t.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.testFlag(t.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.testFlag(t.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.testFlag(t.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.testFlag(t.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return r.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.node.id},set:function(t){this.node.id=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var n=new t.ChildMessage("child-removed",this);qt.MessageLoop.sendMessage(this._parent,n)}if(this._parent=e,this._parent&&!this._parent.isDisposed){n=new t.ChildMessage("child-added",this);qt.MessageLoop.sendMessage(this._parent,n)}this.isDisposed||qt.MessageLoop.sendMessage(this,t.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}},enumerable:!0,configurable:!0}),t.prototype.children=function(){return this._layout?this._layout.iter():x.empty()},t.prototype.contains=function(t){for(var e=t;e;e=e._parent)if(e===this)return!0;return!1},t.prototype.hasClass=function(t){return this.node.classList.contains(t)},t.prototype.addClass=function(t){this.node.classList.add(t)},t.prototype.removeClass=function(t){this.node.classList.remove(t)},t.prototype.toggleClass=function(t,e){return!0===e?(this.node.classList.add(t),!0):!1===e?(this.node.classList.remove(t),!1):this.node.classList.toggle(t)},t.prototype.update=function(){qt.MessageLoop.postMessage(this,t.Msg.UpdateRequest)},t.prototype.fit=function(){qt.MessageLoop.postMessage(this,t.Msg.FitRequest)},t.prototype.activate=function(){qt.MessageLoop.postMessage(this,t.Msg.ActivateRequest)},t.prototype.close=function(){qt.MessageLoop.sendMessage(this,t.Msg.CloseRequest)},t.prototype.show=function(){if(this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||qt.MessageLoop.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this.removeClass("p-mod-hidden"),!this.isAttached||this.parent&&!this.parent.isVisible||qt.MessageLoop.sendMessage(this,t.Msg.AfterShow),this.parent)){var e=new t.ChildMessage("child-shown",this);qt.MessageLoop.sendMessage(this.parent,e)}},t.prototype.hide=function(){if(!this.testFlag(t.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||qt.MessageLoop.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this.addClass("p-mod-hidden"),!this.isAttached||this.parent&&!this.parent.isVisible||qt.MessageLoop.sendMessage(this,t.Msg.AfterHide),this.parent)){var e=new t.ChildMessage("child-hidden",this);qt.MessageLoop.sendMessage(this.parent,e)}},t.prototype.setHidden=function(t){t?this.hide():this.show()},t.prototype.testFlag=function(t){return 0!=(this._flags&t)},t.prototype.setFlag=function(t){this._flags|=t},t.prototype.clearFlag=function(t){this._flags&=~t},t.prototype.processMessage=function(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}},t.prototype.notifyLayout=function(t){this._layout&&this._layout.processParentMessage(t)},t.prototype.onCloseRequest=function(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)},t.prototype.onResize=function(t){},t.prototype.onUpdateRequest=function(t){},t.prototype.onFitRequest=function(t){},t.prototype.onActivateRequest=function(t){},t.prototype.onBeforeShow=function(t){},t.prototype.onAfterShow=function(t){},t.prototype.onBeforeHide=function(t){},t.prototype.onAfterHide=function(t){},t.prototype.onBeforeAttach=function(t){},t.prototype.onAfterAttach=function(t){},t.prototype.onBeforeDetach=function(t){},t.prototype.onAfterDetach=function(t){},t.prototype.onChildAdded=function(t){},t.prototype.onChildRemoved=function(t){},t}();e.Widget=o,function(t){!function(t){t[t.IsDisposed=1]="IsDisposed",t[t.IsAttached=2]="IsAttached",t[t.IsHidden=4]="IsHidden",t[t.IsVisible=8]="IsVisible",t[t.DisallowLayout=16]="DisallowLayout"}(t.Flag||(t.Flag={})),function(t){t.BeforeShow=new qt.Message("before-show"),t.AfterShow=new qt.Message("after-show"),t.BeforeHide=new qt.Message("before-hide"),t.AfterHide=new qt.Message("after-hide"),t.BeforeAttach=new qt.Message("before-attach"),t.AfterAttach=new qt.Message("after-attach"),t.BeforeDetach=new qt.Message("before-detach"),t.AfterDetach=new qt.Message("after-detach"),t.ParentChanged=new qt.Message("parent-changed"),t.UpdateRequest=new qt.ConflatableMessage("update-request"),t.FitRequest=new qt.ConflatableMessage("fit-request"),t.ActivateRequest=new qt.ConflatableMessage("activate-request"),t.CloseRequest=new qt.ConflatableMessage("close-request")}(t.Msg||(t.Msg={}));var e=function(t){function e(e,n){var i=t.call(this,e)||this;return i.child=n,i}return i(e,t),e}(qt.Message);t.ChildMessage=e;var n=function(t){function e(e,n){var i=t.call(this,"resize")||this;return i.width=e,i.height=n,i}return i(e,t),e}(qt.Message);t.ResizeMessage=n,function(t){t.UnknownSize=new t(-1,-1)}(n=t.ResizeMessage||(t.ResizeMessage={})),t.attach=function(e,n,i){if(void 0===i&&(i=null),e.parent)throw new Error("Cannot attach a child widget.");if(e.isAttached||document.body.contains(e.node))throw new Error("Widget is already attached.");if(!document.body.contains(n))throw new Error("Host is not attached.");qt.MessageLoop.sendMessage(e,t.Msg.BeforeAttach),n.insertBefore(e.node,i),qt.MessageLoop.sendMessage(e,t.Msg.AfterAttach)},t.detach=function(e){if(e.parent)throw new Error("Cannot detach a child widget.");if(!e.isAttached||!document.body.contains(e.node))throw new Error("Widget is not attached.");qt.MessageLoop.sendMessage(e,t.Msg.BeforeDetach),e.node.parentNode.removeChild(e.node),qt.MessageLoop.sendMessage(e,t.Msg.AfterDetach)}}(o=e.Widget||(e.Widget={})),e.Widget=o,function(t){t.titleProperty=new Yt.AttachedProperty({name:"title",create:function(t){return new Xt.Title({owner:t})}}),t.createNode=function(t){return t.node||document.createElement("div")}}(r||(r={}))});i(Gt);Gt.Widget;var Jt=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){void 0===t&&(t={}),this._disposed=!1,this._parent=null,this._fitPolicy=t.fitPolicy||"set-min-size"}return t.prototype.dispose=function(){this._parent=null,this._disposed=!0,lt.Signal.clearData(this),Yt.AttachedProperty.clearData(this)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(t){if(this._parent!==t){if(this._parent)throw new Error("Cannot change parent widget.");if(t.layout!==this)throw new Error("Invalid parent widget.");this._parent=t,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(t){if(this._fitPolicy!==t&&(this._fitPolicy=t,this._parent)){var e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),t.prototype.processParentMessage=function(t){switch(t.type){case"resize":this.onResize(t);break;case"update-request":this.onUpdateRequest(t);break;case"fit-request":this.onFitRequest(t);break;case"before-show":this.onBeforeShow(t);break;case"after-show":this.onAfterShow(t);break;case"before-hide":this.onBeforeHide(t);break;case"after-hide":this.onAfterHide(t);break;case"before-attach":this.onBeforeAttach(t);break;case"after-attach":this.onAfterAttach(t);break;case"before-detach":this.onBeforeDetach(t);break;case"after-detach":this.onAfterDetach(t);break;case"child-removed":this.onChildRemoved(t);break;case"child-shown":this.onChildShown(t);break;case"child-hidden":this.onChildHidden(t)}},t.prototype.init=function(){var t=this;x.each(this,function(e){e.parent=t.parent})},t.prototype.onResize=function(t){x.each(this,function(t){qt.MessageLoop.sendMessage(t,Gt.Widget.ResizeMessage.UnknownSize)})},t.prototype.onUpdateRequest=function(t){x.each(this,function(t){qt.MessageLoop.sendMessage(t,Gt.Widget.ResizeMessage.UnknownSize)})},t.prototype.onBeforeAttach=function(t){x.each(this,function(e){qt.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterAttach=function(t){x.each(this,function(e){qt.MessageLoop.sendMessage(e,t)})},t.prototype.onBeforeDetach=function(t){x.each(this,function(e){qt.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterDetach=function(t){x.each(this,function(e){qt.MessageLoop.sendMessage(e,t)})},t.prototype.onBeforeShow=function(t){x.each(this,function(e){e.isHidden||qt.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterShow=function(t){x.each(this,function(e){e.isHidden||qt.MessageLoop.sendMessage(e,t)})},t.prototype.onBeforeHide=function(t){x.each(this,function(e){e.isHidden||qt.MessageLoop.sendMessage(e,t)})},t.prototype.onAfterHide=function(t){x.each(this,function(e){e.isHidden||qt.MessageLoop.sendMessage(e,t)})},t.prototype.onChildRemoved=function(t){this.removeWidget(t.child)},t.prototype.onFitRequest=function(t){},t.prototype.onChildShown=function(t){},t.prototype.onChildHidden=function(t){},t}();e.Layout=n,function(t){t.getHorizontalAlignment=function(t){return i.horizontalAlignmentProperty.get(t)},t.setHorizontalAlignment=function(t,e){i.horizontalAlignmentProperty.set(t,e)},t.getVerticalAlignment=function(t){return i.verticalAlignmentProperty.get(t)},t.setVerticalAlignment=function(t,e){i.verticalAlignmentProperty.set(t,e)}}(n=e.Layout||(e.Layout={})),e.Layout=n;var i,r=function(){function t(t){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=t,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var t=this.widget.node.style;t.position="",t.top="",t.left="",t.width="",t.height=""}},Object.defineProperty(t.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),t.prototype.fit=function(){var t=gt.ElementExt.sizeLimits(this.widget.node);this._minWidth=t.minWidth,this._minHeight=t.minHeight,this._maxWidth=t.maxWidth,this._maxHeight=t.maxHeight},t.prototype.update=function(t,e,i,r){var o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),a=Math.max(this._minHeight,Math.min(r,this._maxHeight));if(o<i)switch(n.getHorizontalAlignment(this.widget)){case"left":break;case"center":t+=(i-o)/2;break;case"right":t+=i-o;break;default:throw"unreachable"}if(a<r)switch(n.getVerticalAlignment(this.widget)){case"top":break;case"center":e+=(r-a)/2;break;case"bottom":e+=r-a;break;default:throw"unreachable"}var s=!1,u=this.widget.node.style;if(this._top!==e&&(this._top=e,u.top=e+"px"),this._left!==t&&(this._left=t,u.left=t+"px"),this._width!==o&&(s=!0,this._width=o,u.width=o+"px"),this._height!==a&&(s=!0,this._height=a,u.height=a+"px"),s){var c=new Gt.Widget.ResizeMessage(o,a);qt.MessageLoop.sendMessage(this.widget,c)}},t}();e.LayoutItem=r,function(t){function e(t){t.parent&&t.parent.layout&&t.parent.update()}t.horizontalAlignmentProperty=new Yt.AttachedProperty({name:"horizontalAlignment",create:function(){return"center"},changed:e}),t.verticalAlignmentProperty=new Yt.AttachedProperty({name:"verticalAlignment",create:function(){return"top"},changed:e})}(i||(i={}))});i(Jt);Jt.Layout,Jt.LayoutItem;var Zt=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widgets=[],e}return i(e,t),e.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return x.iter(this._widgets)},e.prototype.addWidget=function(t){this.insertWidget(this._widgets.length,t)},e.prototype.insertWidget=function(t,e){e.parent=this.parent;var n=this._widgets.indexOf(e),i=Math.max(0,Math.min(t,this._widgets.length));if(-1===n)return x.ArrayExt.insert(this._widgets,i,e),void(this.parent&&this.attachWidget(i,e));i===this._widgets.length&&i--,n!==i&&(x.ArrayExt.move(this._widgets,n,i),this.parent&&this.moveWidget(n,i,e))},e.prototype.removeWidget=function(t){this.removeWidgetAt(this._widgets.indexOf(t))},e.prototype.removeWidgetAt=function(t){var e=x.ArrayExt.removeAt(this._widgets,t);e&&this.parent&&this.detachWidget(t,e)},e.prototype.init=function(){var e=this;t.prototype.init.call(this),x.each(this,function(t,n){e.attachWidget(n,t)})},e.prototype.attachWidget=function(t,e){var n=this.parent.node.children[t];this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(e.node,n),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterAttach)},e.prototype.moveWidget=function(t,e,n){this.parent.isAttached&&qt.MessageLoop.sendMessage(n,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(n,Gt.Widget.Msg.AfterDetach);var i=this.parent.node.children[e];this.parent.isAttached&&qt.MessageLoop.sendMessage(n,Gt.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,i),this.parent.isAttached&&qt.MessageLoop.sendMessage(n,Gt.Widget.Msg.AfterAttach)},e.prototype.detachWidget=function(t,e){this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterDetach)},e}(Jt.Layout);e.PanelLayout=r});i(Zt);Zt.PanelLayout;var Qt=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n._fixed=0,n._spacing=4,n._dirty=!1,n._sizers=[],n._items=[],n._box=null,n._alignment="start",n._direction="top-to-bottom",void 0!==e.direction&&(n._direction=e.direction),void 0!==e.alignment&&(n._alignment=e.alignment),void 0!==e.spacing&&(n._spacing=r.clampSpacing(e.spacing)),n}return i(e,t),e.prototype.dispose=function(){x.each(this._items,function(t){t.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(t){this._direction!==t&&(this._direction=t,this.parent&&(this.parent.dataset.direction=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=r.clampSpacing(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){x.ArrayExt.insert(this._items,t,new Jt.LayoutItem(e)),x.ArrayExt.insert(this._sizers,t,new Ut.BoxSizer),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){x.ArrayExt.move(this._items,t,e),x.ArrayExt.move(this._sizers,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=x.ArrayExt.removeAt(this._items,t);x.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,n=0,i=this._items.length;n<i;++n)t+=+!this._items[n].isHidden;this._fixed=this._spacing*Math.max(0,t-1);var o=r.isHorizontal(this._direction),a=o?this._fixed:0,s=o?0:this._fixed;for(n=0,i=this._items.length;n<i;++n){var u=this._items[n],c=this._sizers[n];u.isHidden?(c.minSize=0,c.maxSize=0):(u.fit(),c.sizeHint=e.getSizeBasis(u.widget),c.stretch=e.getStretch(u.widget),o?(c.minSize=u.minWidth,c.maxSize=u.maxWidth,a+=u.minWidth,s=Math.max(s,u.minHeight)):(c.minSize=u.minHeight,c.maxSize=u.maxHeight,s+=u.minHeight,a=Math.max(a,u.minWidth)))}var h=this._box=gt.ElementExt.boxSizing(this.parent.node);a+=h.horizontalSum,s+=h.verticalSum;var d=this.parent.node.style;d.minWidth=a+"px",d.minHeight=s+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var n=0,i=0,r=this._items.length;i<r;++i)n+=+!this._items[i].isHidden;if(0!==n){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var o,a=this._box.paddingTop,s=this._box.paddingLeft,u=t-this._box.horizontalSum,c=e-this._box.verticalSum;switch(this._direction){case"left-to-right":o=Ut.BoxEngine.calc(this._sizers,Math.max(0,u-this._fixed));break;case"top-to-bottom":o=Ut.BoxEngine.calc(this._sizers,Math.max(0,c-this._fixed));break;case"right-to-left":o=Ut.BoxEngine.calc(this._sizers,Math.max(0,u-this._fixed)),s+=u;break;case"bottom-to-top":o=Ut.BoxEngine.calc(this._sizers,Math.max(0,c-this._fixed)),a+=c;break;default:throw"unreachable"}var h=0,d=0;if(o>0)switch(this._alignment){case"start":break;case"center":h=0,d=o/2;break;case"end":h=0,d=o;break;case"justify":h=o/n,d=0;break;default:throw"unreachable"}for(i=0,r=this._items.length;i<r;++i){var l=this._items[i];if(!l.isHidden){var p=this._sizers[i].size;switch(this._direction){case"left-to-right":l.update(s+d,a,p+h,c),s+=p+h+this._spacing;break;case"top-to-bottom":l.update(s,a+d,u,p+h),a+=p+h+this._spacing;break;case"right-to-left":l.update(s-d-p-h,a,p+h,c),s-=p+h+this._spacing;break;case"bottom-to-top":l.update(s,a-d-p-h,u,p+h),a-=p+h+this._spacing;break;default:throw"unreachable"}}}}},e}(Zt.PanelLayout);e.BoxLayout=o,function(t){t.getStretch=function(t){return r.stretchProperty.get(t)},t.setStretch=function(t,e){r.stretchProperty.set(t,e)},t.getSizeBasis=function(t){return r.sizeBasisProperty.get(t)},t.setSizeBasis=function(t,e){r.sizeBasisProperty.set(t,e)}}(o=e.BoxLayout||(e.BoxLayout={})),e.BoxLayout=o,function(t){function e(t){t.parent&&t.parent.layout instanceof o&&t.parent.fit()}t.stretchProperty=new Yt.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.sizeBasisProperty=new Yt.AttachedProperty({name:"sizeBasis",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:e}),t.isHorizontal=function(t){return"left-to-right"===t||"right-to-left"===t},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))}}(r||(r={}))});i(Qt);Qt.BoxLayout;var $t=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.addClass("p-Panel"),n.layout=r.createLayout(e),n}return i(e,t),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.layout.addWidget(t)},e.prototype.insertWidget=function(t,e){this.layout.insertWidget(t,e)},e}(Gt.Widget);e.Panel=o,function(t){t.createLayout=function(t){return t.layout||new Zt.PanelLayout}}(r||(r={}))});i($t);$t.Panel;var te=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{layout:r.createLayout(e)})||this;return n.addClass("p-BoxPanel"),n}return i(e,t),Object.defineProperty(e.prototype,"direction",{get:function(){return this.layout.direction},set:function(t){this.layout.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("p-BoxPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("p-BoxPanel-child")},e}($t.Panel);e.BoxPanel=o,function(t){t.getStretch=function(t){return Qt.BoxLayout.getStretch(t)},t.setStretch=function(t,e){Qt.BoxLayout.setStretch(t,e)},t.getSizeBasis=function(t){return Qt.BoxLayout.getSizeBasis(t)},t.setSizeBasis=function(t,e){Qt.BoxLayout.setSizeBasis(t,e)}}(o=e.BoxPanel||(e.BoxPanel={})),e.BoxPanel=o,function(t){t.createLayout=function(t){return t.layout||new Qt.BoxLayout(t)}}(r||(r={}))});i(te);te.BoxPanel;var ee=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(t[s]===e)return s}return-1}function n(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(t[s]===e)return s}return-1}function i(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r,o=t.length;if(0===o)return-1;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=(i=i<0?Math.max(0,i+o):Math.min(i,o-1))<n?i+1+(o-n):i-n+1;for(var a=0;a<r;++a){var s=(n+a)%o;if(e(t[s],s))return s}return-1}function r(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var r,o=t.length;if(0===o)return-1;r=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))<(i=i<0?Math.max(0,i+o):Math.min(i,o-1))?n+1+(o-i):n-i+1;for(var a=0;a<r;++a){var s=(n-a+o)%o;if(e(t[s],s))return s}return-1}function o(t,e,n){void 0===e&&(e=0),void 0===n&&(n=-1);var i=t.length;if(!(i<=1))for(e=e<0?Math.max(0,e+i):Math.min(e,i-1),n=n<0?Math.max(0,n+i):Math.min(n,i-1);e<n;){var r=t[e],o=t[n];t[e++]=o,t[n--]=r}}function a(t,e){var n=t.length;if(e<0&&(e+=n),!(e<0||e>=n)){for(var i=t[e],r=e+1;r<n;++r)t[r-1]=t[r];return t.length=n-1,i}}t.firstIndexOf=e,t.lastIndexOf=n,t.findFirstIndex=i,t.findLastIndex=r,t.findFirstValue=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=-1);var o=i(t,e,n,r);return-1!==o?t[o]:void 0},t.findLastValue=function(t,e,n,i){void 0===n&&(n=-1),void 0===i&&(i=0);var o=r(t,e,n,i);return-1!==o?t[o]:void 0},t.lowerBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)<0?(a=c+1,s-=u+1):s=u}return a},t.upperBound=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=t.length;if(0===o)return 0;for(var a=i=i<0?Math.max(0,i+o):Math.min(i,o-1),s=(r=r<0?Math.max(0,r+o):Math.min(r,o-1))-i+1;s>0;){var u=s>>1,c=a+u;n(t[c],e)>0?s=u:(a=c+1,s-=u+1)}return a},t.shallowEqual=function(t,e,n){if(t===e)return!0;if(t.length!==e.length)return!1;for(var i=0,r=t.length;i<r;++i)if(n?!n(t[i],e[i]):t[i]!==e[i])return!1;return!0},t.slice=function(t,e){void 0===e&&(e={});var n=e.start,i=e.stop,r=e.step;if(void 0===r&&(r=1),0===r)throw new Error("Slice `step` cannot be zero.");var o,a=t.length;void 0===n?n=r<0?a-1:0:n<0?n=Math.max(n+a,r<0?-1:0):n>=a&&(n=r<0?a-1:a),void 0===i?i=r<0?-1:a:i<0?i=Math.max(i+a,r<0?-1:0):i>=a&&(i=r<0?a-1:a),o=r<0&&i>=n||r>0&&n>=i?0:r<0?Math.floor((i-n+1)/r+1):Math.floor((i-n-1)/r+1);for(var s=[],u=0;u<o;++u)s[u]=t[n+u*r];return s},t.move=function(t,e,n){var i=t.length;if(!(i<=1)&&(e=e<0?Math.max(0,e+i):Math.min(e,i-1))!==(n=n<0?Math.max(0,n+i):Math.min(n,i-1))){for(var r=t[e],o=e<n?1:-1,a=e;a!==n;a+=o)t[a]=t[a+o];t[n]=r}},t.reverse=o,t.rotate=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(!(r<=1||(n=n<0?Math.max(0,n+r):Math.min(n,r-1))>=(i=i<0?Math.max(0,i+r):Math.min(i,r-1)))){var a=i-n+1;if(e>0?e%=a:e<0&&(e=(e%a+a)%a),0!==e){var s=n+e;o(t,n,s-1),o(t,s,i),o(t,n,i)}}},t.fill=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0!==r){var o;n=n<0?Math.max(0,n+r):Math.min(n,r-1),o=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<n?i+1+(r-n):i-n+1;for(var a=0;a<o;++a)t[(n+a)%r]=e}},t.insert=function(t,e,n){var i=t.length;e=e<0?Math.max(0,e+i):Math.min(e,i);for(var r=i;r>e;--r)t[r]=t[r-1];t[e]=n},t.removeAt=a,t.removeFirstOf=function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=-1);var o=e(t,n,i,r);return-1!==o&&a(t,o),o},t.removeLastOf=function(t,e,i,r){void 0===i&&(i=-1),void 0===r&&(r=0);var o=n(t,e,i,r);return-1!==o&&a(t,o),o},t.removeAllOf=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&t[a]===e?o++:i<n&&(a<=i||a>=n)&&t[a]===e?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o},t.removeFirstWhere=function(t,e,n,r){var o;void 0===n&&(n=0),void 0===r&&(r=-1);var s=i(t,e,n,r);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeLastWhere=function(t,e,n,i){var o;void 0===n&&(n=-1),void 0===i&&(i=0);var s=r(t,e,n,i);return-1!==s&&(o=a(t,s)),{index:s,value:o}},t.removeAllWhere=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=-1);var r=t.length;if(0===r)return 0;n=n<0?Math.max(0,n+r):Math.min(n,r-1),i=i<0?Math.max(0,i+r):Math.min(i,r-1);for(var o=0,a=0;a<r;++a)n<=i&&a>=n&&a<=i&&e(t[a],a)?o++:i<n&&(a<=i||a>=n)&&e(t[a],a)?o++:o>0&&(t[a-o]=t[a]);return o>0&&(t.length=r-o),o}}(e.ArrayExt||(e.ArrayExt={}))});i(ee);ee.ArrayExt;var ne=r(function(t,e){function n(t){return"function"==typeof t.iter?t.iter():new i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.iter=n,e.iterKeys=function(t){return new r(t)},e.iterValues=function(t){return new o(t)},e.iterItems=function(t){return new a(t)},e.iterFn=function(t){return new s(t)},e.each=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!1===e(i,r++))return},e.every=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(!e(i,r++))return!1;return!0},e.some=function(t,e){for(var i,r=0,o=n(t);void 0!==(i=o.next());)if(e(i,r++))return!0;return!1},e.toArray=function(t){for(var e,i=0,r=[],o=n(t);void 0!==(e=o.next());)r[i++]=e;return r},e.toObject=function(t){for(var e,i=n(t),r={};void 0!==(e=i.next());)r[e[0]]=e[1];return r};var i=function(){function t(t){this._index=0,this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}();e.ArrayIterator=i;var r=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?t:this.next()}},t}();e.KeyIterator=r;var o=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?this._source[t]:this.next()}},t}();e.ValueIterator=o;var a=function(){function t(t,e){void 0===e&&(e=Object.keys(t)),this._index=0,this._source=t,this._keys=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var t=this._keys[this._index++];return t in this._source?[t,this._source[t]]:this.next()}},t}();e.ItemIterator=a;var s=function(){function t(t){this._fn=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();e.FnIterator=s});i(ne);ne.iter,ne.iterKeys,ne.iterValues,ne.iterItems,ne.iterFn,ne.each,ne.every,ne.some,ne.toArray,ne.toObject,ne.ArrayIterator,ne.KeyIterator,ne.ValueIterator,ne.ItemIterator,ne.FnIterator;var ie=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(ne.iter(t.map(ne.iter)))};var n=function(){function t(t){this._cloned=!1,this._source=t,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(void 0===this._active){var t=this._source.next();if(void 0===t)return;this._active=this._cloned?t.clone():t}var e=this._active.next();return void 0!==e?e:(this._active=void 0,this.next())},t}();e.ChainIterator=n});i(ie);ie.chain,ie.ChainIterator;var re=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.empty=function(){return new n};var n=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();e.EmptyIterator=n});i(re);re.empty,re.EmptyIterator;var oe=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.enumerate=function(t,e){return void 0===e&&(e=0),new n(ne.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._index=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return[this._index++,t]},t}();e.EnumerateIterator=n});i(oe);oe.enumerate,oe.EnumerateIterator;var ae=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.filter=function(t,e){return new n(ne.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var t,e=this._fn,n=this._source;void 0!==(t=n.next());)if(e(t,this._index++))return t},t}();e.FilterIterator=n});i(ae);ae.filter,ae.FilterIterator;var se=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.find=function(t,e){for(var n,i=0,r=ne.iter(t);void 0!==(n=r.next());)if(e(n,i++))return n},e.findIndex=function(t,e){for(var n,i=0,r=ne.iter(t);void 0!==(n=r.next());)if(e(n,i++))return i-1;return-1},e.min=function(t,e){var n=ne.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)<0&&(r=i);return r}},e.max=function(t,e){var n=ne.iter(t),i=n.next();if(void 0!==i){for(var r=i;void 0!==(i=n.next());)e(i,r)>0&&(r=i);return r}},e.minmax=function(t,e){var n=ne.iter(t),i=n.next();if(void 0!==i){for(var r=i,o=i;void 0!==(i=n.next());)e(i,r)<0?r=i:e(i,o)>0&&(o=i);return[r,o]}}});i(se);se.find,se.findIndex,se.min,se.max,se.minmax;var ue=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.map=function(t,e){return new n(ne.iter(t),e)};var n=function(){function t(t,e){this._index=0,this._source=t,this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var t=this._source.next();if(void 0!==t)return this._fn.call(void 0,t,this._index++)},t}();e.MapIterator=n});i(ue);ue.map,ue.MapIterator;var ce=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.range=function(t,e,n){return void 0===e?new i(0,t,1):new i(t,e,void 0===n?1:n)};var n,i=function(){function t(t,e,i){this._index=0,this._start=t,this._stop=e,this._step=i,this._length=n.rangeLength(t,e,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}();e.RangeIterator=i,function(t){t.rangeLength=function(t,e,n){return 0===n?1/0:t>e&&n>0?0:t<e&&n<0?0:Math.ceil((e-t)/n)}}(n||(n={}))});i(ce);ce.range,ce.RangeIterator;var he=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.reduce=function(t,e,n){var i=0,r=ne.iter(t),o=r.next();if(void 0===o&&void 0===n)throw new TypeError("Reduce of empty iterable with no initial value.");if(void 0===o)return n;var a,s,u=r.next();if(void 0===u&&void 0===n)return o;if(void 0===u)return e(n,o,i++);for(a=e(void 0===n?o:e(n,o,i++),u,i++);void 0!==(s=r.next());)a=e(a,s,i++);return a}});i(he);he.reduce;var de=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.repeat=function(t,e){return new n(t,e)},e.once=function(t){return new n(t,1)};var n=function(){function t(t,e){this._value=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();e.RepeatIterator=n});i(de);de.repeat,de.once,de.RepeatIterator;var le=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.retro=function(t){return"function"==typeof t.retro?t.retro():new n(t)};var n=function(){function t(t){this._source=t,this._index=t.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();e.RetroArrayIterator=n});i(le);le.retro,le.RetroArrayIterator;var pe=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.topologicSort=function(t){var e=[],n=new Set,i=new Map;return ne.each(t,function(t){var e=t[0],n=t[1],r=i.get(n);r?r.push(e):i.set(n,[e])}),i.forEach(function(t,e){r(e)}),e;function r(t){if(!n.has(t)){n.add(t);var o=i.get(t);o&&o.forEach(r),e.push(t)}}}});i(pe);pe.topologicSort;var fe=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.stride=function(t,e){return new n(ne.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._step=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var t=this._source.next(),e=this._step-1;e>0;--e)this._source.next();return t},t}();e.StrideIterator=n});i(fe);fe.stride,fe.StrideIterator;var ve=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){function e(t,e,n){void 0===n&&(n=0);for(var i=new Array(e.length),r=0,o=n,a=e.length;r<a;++r,++o){if(-1===(o=t.indexOf(e[r],o)))return null;i[r]=o}return i}t.findIndices=e,t.matchSumOfSquares=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=0,s=r.length;a<s;++a){var u=r[a]-i;o+=u*u}return{score:o,indices:r}},t.matchSumOfDeltas=function(t,n,i){void 0===i&&(i=0);var r=e(t,n,i);if(!r)return null;for(var o=0,a=i-1,s=0,u=r.length;s<u;++s){var c=r[s];o+=c-a-1,a=c}return{score:o,indices:r}},t.highlight=function(t,e,n){for(var i=[],r=0,o=0,a=e.length;r<a;){for(var s=e[r],u=e[r];++r<a&&e[r]===u+1;)u++;o<s&&i.push(t.slice(o,s)),s<u+1&&i.push(n(t.slice(s,u+1))),o=u+1}return o<t.length&&i.push(t.slice(o)),i},t.cmp=function(t,e){return t<e?-1:t>e?1:0}}(e.StringExt||(e.StringExt={}))});i(ve);ve.StringExt;var me=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.take=function(t,e){return new n(ne.iter(t),e)};var n=function(){function t(t,e){this._source=t,this._count=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var t=this._source.next();if(void 0!==t)return this._count--,t}},t}();e.TakeIterator=n});i(me);me.take,me.TakeIterator;var _e=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new n(t.map(ne.iter))};var n=function(){function t(t){this._source=t}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(t){return t.clone()}))},t.prototype.next=function(){for(var t=new Array(this._source.length),e=0,n=this._source.length;e<n;++e){var i=this._source[e].next();if(void 0===i)return;t[e]=i}return t},t}();e.ZipIterator=n});i(_e);_e.zip,_e.ZipIterator;var ge=r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(ee),n(ie),n(re),n(oe),n(ae),n(se),n(ne),n(ue),n(ce),n(he),n(de),n(le),n(pe),n(fe),n(ve),n(me),n(_e)});i(ge);var ye=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(t){this.type="text",this.content=t}}();e.VirtualText=n;var i,r=function(){return function(t,e,n){this.type="element",this.tag=t,this.attrs=e,this.children=n}}();function o(t){for(var e={},i=[],o=1,a=arguments.length;o<a;++o){var s=arguments[o];"string"==typeof s?i.push(new n(s)):s instanceof n?i.push(s):s instanceof r?i.push(s):s instanceof Array?u(i,s):1===o&&s&&"object"==typeof s&&(e=s)}return new r(t,e,i);function u(t,e){for(var i=0,o=e;i<o.length;i++){var a=o[i];"string"==typeof a?t.push(new n(a)):a instanceof n?t.push(a):a instanceof r&&t.push(a)}}}e.VirtualElement=r,e.h=o,function(t){t.a=t.bind(void 0,"a"),t.abbr=t.bind(void 0,"abbr"),t.address=t.bind(void 0,"address"),t.area=t.bind(void 0,"area"),t.article=t.bind(void 0,"article"),t.aside=t.bind(void 0,"aside"),t.audio=t.bind(void 0,"audio"),t.b=t.bind(void 0,"b"),t.bdi=t.bind(void 0,"bdi"),t.bdo=t.bind(void 0,"bdo"),t.blockquote=t.bind(void 0,"blockquote"),t.br=t.bind(void 0,"br"),t.button=t.bind(void 0,"button"),t.canvas=t.bind(void 0,"canvas"),t.caption=t.bind(void 0,"caption"),t.cite=t.bind(void 0,"cite"),t.code=t.bind(void 0,"code"),t.col=t.bind(void 0,"col"),t.colgroup=t.bind(void 0,"colgroup"),t.data=t.bind(void 0,"data"),t.datalist=t.bind(void 0,"datalist"),t.dd=t.bind(void 0,"dd"),t.del=t.bind(void 0,"del"),t.dfn=t.bind(void 0,"dfn"),t.div=t.bind(void 0,"div"),t.dl=t.bind(void 0,"dl"),t.dt=t.bind(void 0,"dt"),t.em=t.bind(void 0,"em"),t.embed=t.bind(void 0,"embed"),t.fieldset=t.bind(void 0,"fieldset"),t.figcaption=t.bind(void 0,"figcaption"),t.figure=t.bind(void 0,"figure"),t.footer=t.bind(void 0,"footer"),t.form=t.bind(void 0,"form"),t.h1=t.bind(void 0,"h1"),t.h2=t.bind(void 0,"h2"),t.h3=t.bind(void 0,"h3"),t.h4=t.bind(void 0,"h4"),t.h5=t.bind(void 0,"h5"),t.h6=t.bind(void 0,"h6"),t.header=t.bind(void 0,"header"),t.hr=t.bind(void 0,"hr"),t.i=t.bind(void 0,"i"),t.iframe=t.bind(void 0,"iframe"),t.img=t.bind(void 0,"img"),t.input=t.bind(void 0,"input"),t.ins=t.bind(void 0,"ins"),t.kbd=t.bind(void 0,"kbd"),t.label=t.bind(void 0,"label"),t.legend=t.bind(void 0,"legend"),t.li=t.bind(void 0,"li"),t.main=t.bind(void 0,"main"),t.map=t.bind(void 0,"map"),t.mark=t.bind(void 0,"mark"),t.meter=t.bind(void 0,"meter"),t.nav=t.bind(void 0,"nav"),t.noscript=t.bind(void 0,"noscript"),t.object=t.bind(void 0,"object"),t.ol=t.bind(void 0,"ol"),t.optgroup=t.bind(void 0,"optgroup"),t.option=t.bind(void 0,"option"),t.output=t.bind(void 0,"output"),t.p=t.bind(void 0,"p"),t.param=t.bind(void 0,"param"),t.pre=t.bind(void 0,"pre"),t.progress=t.bind(void 0,"progress"),t.q=t.bind(void 0,"q"),t.rp=t.bind(void 0,"rp"),t.rt=t.bind(void 0,"rt"),t.ruby=t.bind(void 0,"ruby"),t.s=t.bind(void 0,"s"),t.samp=t.bind(void 0,"samp"),t.section=t.bind(void 0,"section"),t.select=t.bind(void 0,"select"),t.small=t.bind(void 0,"small"),t.source=t.bind(void 0,"source"),t.span=t.bind(void 0,"span"),t.strong=t.bind(void 0,"strong"),t.sub=t.bind(void 0,"sub"),t.summary=t.bind(void 0,"summary"),t.sup=t.bind(void 0,"sup"),t.table=t.bind(void 0,"table"),t.tbody=t.bind(void 0,"tbody"),t.td=t.bind(void 0,"td"),t.textarea=t.bind(void 0,"textarea"),t.tfoot=t.bind(void 0,"tfoot"),t.th=t.bind(void 0,"th"),t.thead=t.bind(void 0,"thead"),t.time=t.bind(void 0,"time"),t.title=t.bind(void 0,"title"),t.tr=t.bind(void 0,"tr"),t.track=t.bind(void 0,"track"),t.u=t.bind(void 0,"u"),t.ul=t.bind(void 0,"ul"),t.var_=t.bind(void 0,"var"),t.video=t.bind(void 0,"video"),t.wbr=t.bind(void 0,"wbr")}(o=e.h||(e.h={})),function(t){t.realize=function(t){return i.createDOMNode(t)},t.render=function(t,e){var n=i.hostMap.get(e)||[],r=i.asContentArray(t);i.hostMap.set(e,r),i.updateContent(e,n,r)}}(e.VirtualDOM||(e.VirtualDOM={})),function(t){function e(t){if("text"===t.type)return document.createTextNode(t.content);var i=document.createElement(t.tag);!function(t,e){for(var i in e)i in n||("on"===i.substr(0,2)?t[i]=e[i]:t.setAttribute(i,e[i]));void 0!==e.className&&t.setAttribute("class",e.className);void 0!==e.htmlFor&&t.setAttribute("for",e.htmlFor);e.dataset&&function(t,e){for(var n in e)t.setAttribute("data-"+n,e[n])}(t,e.dataset);e.style&&function(t,e){var n,i=t.style;for(n in e)i[n]=e[n]}(t,e.style)}(i,t.attrs);for(var r=0,o=t.children.length;r<o;++r)i.appendChild(e(t.children[r]));return i}t.hostMap=new WeakMap,t.asContentArray=function(t){return t?t instanceof Array?t:[t]:[]},t.createDOMNode=e,t.updateContent=function t(n,r,o){if(r!==o){for(var a=function(t,e){for(var n=t.firstChild,i=Object.create(null),r=0,o=e;r<o.length;r++){var a=o[r];"element"===a.type&&a.attrs.key&&(i[a.attrs.key]={vNode:a,element:n}),n=n.nextSibling}return i}(n,r),s=r.slice(),u=n.firstChild,c=o.length,h=0;h<c;++h)if(h>=s.length)n.appendChild(e(o[h]));else{var d=s[h],l=o[h];if(d!==l)if("text"!==d.type||"text"!==l.type)if("text"!==d.type&&"text"!==l.type){var p=l.attrs.key;if(p&&p in a){var f=a[p];f.vNode!==d&&(ge.ArrayExt.move(s,s.indexOf(f.vNode,h+1),h),n.insertBefore(f.element,u),d=f.vNode,u=f.element)}if(d!==l){var v=d.attrs.key;v&&v!==p?(ge.ArrayExt.insert(s,h,l),n.insertBefore(e(l),u)):d.tag===l.tag?(i(u,d.attrs,l.attrs),t(u,d.children,l.children),u=u.nextSibling):(ge.ArrayExt.insert(s,h,l),n.insertBefore(e(l),u))}else u=u.nextSibling}else ge.ArrayExt.insert(s,h,l),n.insertBefore(e(l),u);else u.textContent=l.content,u=u.nextSibling;else u=u.nextSibling}for(h=s.length-c;h>0;--h)n.removeChild(n.lastChild)}};var n={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function i(t,e,i){if(e!==i){var r;for(r in e)r in n||r in i||("on"===r.substr(0,2)?t[r]=null:t.removeAttribute(r));for(r in i)r in n||e[r]===i[r]||("on"===r.substr(0,2)?t[r]=i[r]:t.setAttribute(r,i[r]));e.className!==i.className&&(void 0!==i.className?t.setAttribute("class",i.className):t.removeAttribute("class")),e.htmlFor!==i.htmlFor&&(void 0!==i.htmlFor?t.setAttribute("for",i.htmlFor):t.removeAttribute("for")),e.dataset!==i.dataset&&function(t,e,n){for(var i in e)i in n||t.removeAttribute("data-"+i);for(var r in n)e[r]!==n[r]&&t.setAttribute("data-"+r,n[r])}(t,e.dataset||{},i.dataset||{}),e.style!==i.style&&function(t,e,n){var i,r=t.style;for(i in e)i in n||(r[i]="");for(i in n)e[i]!==n[i]&&(r[i]=n[i])}(t,e.style||{},i.style||{})}}}(i||(i={}))});i(ye);ye.VirtualText,ye.VirtualElement,ye.h,ye.VirtualDOM;var be=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=n&&n.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o,a=function(t){function e(n){var i=t.call(this,{node:o.createNode()})||this;return i._activeIndex=-1,i._items=[],i._results=null,i.addClass("p-CommandPalette"),i.setFlag(Gt.Widget.Flag.DisallowLayout),i.commands=n.commands,i.renderer=n.renderer||e.defaultRenderer,i.commands.commandChanged.connect(i._onGenericChange,i),i.commands.keyBindingChanged.connect(i._onGenericChange,i),i}return i(e,t),e.prototype.dispose=function(){this._items.length=0,this._results=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("p-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("p-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.addItem=function(t){var e=o.createItem(this.commands,t);return this._items.push(e),this.refresh(),e},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){x.ArrayExt.removeAt(this._items,t)&&this.refresh()},e.prototype.clearItems=function(){0!==this._items.length&&(this._items.length=0,this.refresh())},e.prototype.refresh=function(){this._results=null,this.update()},e.prototype.handleEvent=function(t){switch(t.type){case"click":this._evtClick(t);break;case"keydown":this._evtKeyDown(t);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)},e.prototype.onActivateRequest=function(t){if(this.isAttached){var e=this.inputNode;e.focus(),e.select()}},e.prototype.onUpdateRequest=function(t){var e=this.inputNode.value,n=this.contentNode,i=this._results;if(i||(i=this._results=o.search(this._items,e),this._activeIndex=e?x.ArrayExt.findFirstIndex(i,o.canActivate):-1),e||0!==i.length)if(e&&0===i.length){var r=this.renderer.renderEmptyMessage({query:e});ye.VirtualDOM.render(r,n)}else{for(var a=this.renderer,s=this._activeIndex,u=new Array(i.length),c=0,h=i.length;c<h;++c){var d=i[c];if("header"===d.type){var l=d.indices,p=d.category;u[c]=a.renderHeader({category:p,indices:l})}else{var f=d.item,v=(l=d.indices,c===s);u[c]=a.renderItem({item:f,indices:l,active:v})}}if(ye.VirtualDOM.render(u,n),s<0||s>=i.length)n.scrollTop=0;else{var m=n.children[s];gt.ElementExt.scrollIntoViewIfNeeded(n,m)}}else ye.VirtualDOM.render(null,n)},e.prototype._evtClick=function(t){if(0===t.button){var e=x.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return e.contains(t.target)});-1!==e&&(t.preventDefault(),t.stopPropagation(),this._execute(e))}},e.prototype._evtKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey))switch(t.keyCode){case 13:t.preventDefault(),t.stopPropagation(),this._execute(this._activeIndex);break;case 38:t.preventDefault(),t.stopPropagation(),this._activatePreviousItem();break;case 40:t.preventDefault(),t.stopPropagation(),this._activateNextItem()}},e.prototype._activateNextItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<e-1?t+1:0,i=0===n?e-1:n-1;this._activeIndex=x.ArrayExt.findFirstIndex(this._results,o.canActivate,n,i),this.update()}},e.prototype._activatePreviousItem=function(){if(this._results&&0!==this._results.length){var t=this._activeIndex,e=this._results.length,n=t<=0?e-1:t-1,i=n===e-1?0:n+1;this._activeIndex=x.ArrayExt.findLastIndex(this._results,o.canActivate,n,i),this.update()}},e.prototype._execute=function(t){if(this._results){var e=this._results[t];if(e){if("header"===e.type){var n=this.inputNode;return n.value=e.category.toLowerCase()+" ",n.focus(),void this.refresh()}e.item.isEnabled&&(this.commands.execute(e.item.command,e.item.args),this.inputNode.value="",this.refresh())}}},e.prototype._toggleFocused=function(){var t=document.activeElement===this.inputNode;this.toggleClass("p-mod-focused",t)},e.prototype._onGenericChange=function(){this.refresh()},e}(Gt.Widget);e.CommandPalette=a,function(t){var e=function(){function t(){}return t.prototype.renderHeader=function(t){var e=this.formatHeader(t);return ye.h.li({className:"p-CommandPalette-header"},e)},t.prototype.renderItem=function(t){var e=this.createItemClass(t),n=this.createItemDataset(t);return ye.h.li({className:e,dataset:n},this.renderItemIcon(t),this.renderItemContent(t),this.renderItemShortcut(t))},t.prototype.renderEmptyMessage=function(t){var e=this.formatEmptyMessage(t);return ye.h.li({className:"p-CommandPalette-emptyMessage"},e)},t.prototype.renderItemIcon=function(t){var e=this.createIconClass(t);return ye.h.div({className:e},t.item.iconLabel)},t.prototype.renderItemContent=function(t){return ye.h.div({className:"p-CommandPalette-itemContent"},this.renderItemLabel(t),this.renderItemCaption(t))},t.prototype.renderItemLabel=function(t){var e=this.formatItemLabel(t);return ye.h.div({className:"p-CommandPalette-itemLabel"},e)},t.prototype.renderItemCaption=function(t){var e=this.formatItemCaption(t);return ye.h.div({className:"p-CommandPalette-itemCaption"},e)},t.prototype.renderItemShortcut=function(t){var e=this.formatItemShortcut(t);return ye.h.div({className:"p-CommandPalette-itemShortcut"},e)},t.prototype.createItemClass=function(t){var e="p-CommandPalette-item";t.item.isEnabled||(e+=" p-mod-disabled"),t.item.isToggled&&(e+=" p-mod-toggled"),t.active&&(e+=" p-mod-active");var n=t.item.className;return n&&(e+=" "+n),e},t.prototype.createItemDataset=function(t){return r({},t.item.dataset,{command:t.item.command})},t.prototype.createIconClass=function(t){var e="p-CommandPalette-itemIcon",n=t.item.iconClass;return n?e+" "+n:e},t.prototype.formatHeader=function(t){return t.indices&&0!==t.indices.length?x.StringExt.highlight(t.category,t.indices,ye.h.mark):t.category},t.prototype.formatEmptyMessage=function(t){return"No commands found that match '"+t.query+"'"},t.prototype.formatItemShortcut=function(t){var e=t.item.keyBinding;return e?e.keys.map(o.formatKeystroke).join(", "):null},t.prototype.formatItemLabel=function(t){return t.indices&&0!==t.indices.length?x.StringExt.highlight(t.item.label,t.indices,ye.h.mark):t.item.label},t.prototype.formatItemCaption=function(t){return t.item.caption},t}();t.Renderer=e,t.defaultRenderer=new e}(a=e.CommandPalette||(e.CommandPalette={})),e.CommandPalette=a,function(t){function e(t,e){for(var n=t.category.toLowerCase(),i=n+" "+t.label.toLowerCase(),r=1/0,o=null,a=/\b\w/g;;){var s=a.exec(i);if(!s)break;var u=x.StringExt.matchSumOfDeltas(i,e,s.index);if(!u)break;u&&u.score<=r&&(r=u.score,o=u.indices)}if(!o||r===1/0)return null;for(var c=n.length+1,h=x.ArrayExt.lowerBound(o,c,function(t,e){return t-e}),d=o.slice(0,h),l=o.slice(h),p=0,f=l.length;p<f;++p)l[p]-=c;return 0===d.length?{matchType:0,categoryIndices:null,labelIndices:l,score:r,item:t}:0===l.length?{matchType:1,categoryIndices:d,labelIndices:null,score:r,item:t}:{matchType:2,categoryIndices:d,labelIndices:l,score:r,item:t}}function n(t,e){var n=t.matchType-e.matchType;if(0!==n)return n;var i=t.score-e.score;if(0!==i)return i;var r=0,o=0;switch(t.matchType){case 0:r=t.labelIndices[0],o=e.labelIndices[0];break;case 1:case 2:r=t.categoryIndices[0],o=e.categoryIndices[0]}if(r!==o)return r-o;var a=t.item.category.localeCompare(e.item.category);if(0!==a)return a;var s=t.item.rank,u=e.item.rank;return s!==u?s<u?-1:1:t.item.label.localeCompare(e.item.label)}t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("input"),r=document.createElement("ul");return e.className="p-CommandPalette-search",n.className="p-CommandPalette-wrapper",i.className="p-CommandPalette-input",r.className="p-CommandPalette-content",i.spellcheck=!1,n.appendChild(i),e.appendChild(n),t.appendChild(e),t.appendChild(r),t},t.createItem=function(t,e){return new i(t,e)},t.formatKeystroke=function(t){var e="",n=bt.CommandRegistry.parseKeystroke(t);return gt.Platform.IS_MAC?(n.ctrl&&(e+="⌃ "),n.alt&&(e+="⌥ "),n.shift&&(e+="⇧ "),n.cmd&&(e+="⌘ ")):(n.ctrl&&(e+="Ctrl+"),n.alt&&(e+="Alt+"),n.shift&&(e+="Shift+")),e+n.key},t.search=function(t,i){var r=function(t,n){n=n.replace(/\s+/g,"").toLowerCase();for(var i=[],r=0,o=t.length;r<o;++r){var a=t[r];if(a.isVisible)if(n){var s=e(a,n);s&&(a.isEnabled||(s.score+=1e3),i.push(s))}else i.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:a})}return i}(t,i);return r.sort(n),function(t){var e=new Array(t.length);x.ArrayExt.fill(e,!1);for(var n=[],i=0,r=t.length;i<r;++i)if(!e[i]){var o=t[i],a=o.item,s=o.categoryIndices,u=a.category;n.push({type:"header",category:u,indices:s});for(var c=i;c<r;++c)if(!e[c]){var h=t[c],d=h.item,l=h.labelIndices;d.category===u&&(n.push({type:"item",item:d,indices:l}),e[c]=!0)}}return n}(r)},t.canActivate=function(t){return"item"===t.type&&t.item.isEnabled};var i=function(){function t(t,e){this._commands=t,this.category=e.category.trim().replace(/\s+/g," "),this.command=e.command,this.args=e.args||O.JSONExt.emptyObject,this.rank=void 0!==e.rank?e.rank:1/0}return Object.defineProperty(t.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBinding",{get:function(){var t=this.command,e=this.args;return x.ArrayExt.findLastValue(this._commands.keyBindings,function(n){return n.command===t&&O.JSONExt.deepEqual(n.args,e)})||null},enumerable:!0,configurable:!0}),t}()}(o||(o={}))});i(be);be.CommandPalette;var xe=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=n&&n.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o,a=function(t){function e(n){var i=t.call(this,{node:o.createNode()})||this;return i._childIndex=-1,i._activeIndex=-1,i._openTimerID=0,i._closeTimerID=0,i._items=[],i._childMenu=null,i._parentMenu=null,i._aboutToClose=new lt.Signal(i),i._menuRequested=new lt.Signal(i),i.addClass("p-Menu"),i.setFlag(Gt.Widget.Flag.DisallowLayout),i.commands=n.commands,i.renderer=n.renderer||e.defaultRenderer,i}return i(e,t),e.prototype.dispose=function(){this.close(),this._items.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootMenu",{get:function(){for(var t=this;t._parentMenu;)t=t._parentMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leafMenu",{get:function(){for(var t=this;t._childMenu;)t=t._childMenu;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._items.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._items.length)&&(t=-1),-1===t||o.canActivate(this._items[t])||(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.activateNextItem=function(){var t=this._items.length,e=this._activeIndex,n=e<t-1?e+1:0,i=0===n?t-1:n-1;this.activeIndex=x.ArrayExt.findFirstIndex(this._items,o.canActivate,n,i)},e.prototype.activatePreviousItem=function(){var t=this._items.length,e=this._activeIndex,n=e<=0?t-1:e-1,i=n===t-1?0:n+1;this.activeIndex=x.ArrayExt.findLastIndex(this._items,o.canActivate,n,i)},e.prototype.triggerActiveItem=function(){if(this.isAttached){var t=this.activeItem;if(t)if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"!==t.type){this.rootMenu.close();var e=t.command,n=t.args;this.commands.isEnabled(e,n)?this.commands.execute(e,n):console.log("Command '"+e+"' is disabled.")}else this._openChildMenu(!0)}},e.prototype.addItem=function(t){return this.insertItem(this._items.length,t)},e.prototype.insertItem=function(t,e){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(t,this._items.length)),i=o.createItem(this,e);return x.ArrayExt.insert(this._items,n,i),this.update(),i},e.prototype.removeItem=function(t){this.removeItemAt(this._items.indexOf(t))},e.prototype.removeItemAt=function(t){this.isAttached&&this.close(),this.activeIndex=-1,x.ArrayExt.removeAt(this._items,t)&&this.update()},e.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length&&(this._items.length=0,this.update())},e.prototype.open=function(t,e,n){if(void 0===n&&(n={}),!this.isAttached){var i=n.forceX||!1,r=n.forceY||!1;o.openRootMenu(this,t,e,i,r),this.activate()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mouseup":this._evtMouseUp(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseenter":this._evtMouseEnter(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"mousedown":this._evtMouseDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this._items,n=this.renderer,i=this._activeIndex,r=o.computeCollapsed(e),a=new Array(e.length),s=0,u=e.length;s<u;++s){var c=e[s],h=s===i,d=r[s];a[s]=n.renderItem({item:c,active:h,collapsed:d})}ye.VirtualDOM.render(a,this.contentNode)},e.prototype.onCloseRequest=function(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var n=this._childMenu;n&&(this._childIndex=-1,this._childMenu=null,n._parentMenu=null,n.close());var i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),t.prototype.onCloseRequest.call(this,e)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e)if(27!==e)if(37!==e)if(38!==e)if(39!==e)if(40!==e){var n=yt.getKeyboardLayout().keyForKeydownEvent(t);if(n){var i=this._activeIndex+1,r=o.findMnemonic(this._items,n,i);-1===r.index||r.multiple?-1!==r.index?this.activeIndex=r.index:-1!==r.auto&&(this.activeIndex=r.auto):(this.activeIndex=r.index,this.triggerActiveItem())}}else this.activateNextItem();else{var a=this.activeItem;a&&"submenu"===a.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next")}else this.activatePreviousItem();else this._parentMenu?this.close():this._menuRequested.emit("previous");else this.close();else this.triggerActiveItem()},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this.triggerActiveItem())},e.prototype._evtMouseMove=function(t){var e=x.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});if(e!==this._activeIndex){if(this.activeIndex=e,(e=this.activeIndex)===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;n&&"submenu"===n.type&&n.submenu&&this._startOpenTimer()}},e.prototype._evtMouseEnter=function(t){for(var e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex},e.prototype._evtMouseLeave=function(t){if(this._cancelOpenTimer(),this._childMenu){var e=t.clientX,n=t.clientY;gt.ElementExt.hitTest(this._childMenu.node,e,n)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}else this.activeIndex=-1},e.prototype._evtMouseDown=function(t){this._parentMenu||(o.hitTestMenus(this,t.clientX,t.clientY)?(t.preventDefault(),t.stopPropagation()):this.close())},e.prototype._openChildMenu=function(t){void 0===t&&(t=!1);var e=this.activeItem;if(e&&"submenu"===e.type&&e.submenu){var n=e.submenu;if(n!==this._childMenu){this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,qt.MessageLoop.sendMessage(this,Gt.Widget.Msg.UpdateRequest);var i=this.contentNode.children[this._activeIndex];o.openSubmenu(n,i),t&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},e.prototype._startOpenTimer=function(){var t=this;0===this._openTimerID&&(this._openTimerID=setTimeout(function(){t._openTimerID=0,t._openChildMenu()},o.TIMER_DELAY))},e.prototype._startCloseTimer=function(){var t=this;0===this._closeTimerID&&(this._closeTimerID=setTimeout(function(){t._closeTimerID=0,t._closeChildMenu()},o.TIMER_DELAY))},e.prototype._cancelOpenTimer=function(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)},e.prototype._cancelCloseTimer=function(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},e}(Gt.Widget);e.Menu=a,function(t){var e=function(){function t(){}return t.prototype.renderItem=function(t){var e=this.createItemClass(t),n=this.createItemDataset(t);return ye.h.li({className:e,dataset:n},this.renderIcon(t),this.renderLabel(t),this.renderShortcut(t),this.renderSubmenu(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return ye.h.div({className:e},t.item.iconLabel)},t.prototype.renderLabel=function(t){var e=this.formatLabel(t);return ye.h.div({className:"p-Menu-itemLabel"},e)},t.prototype.renderShortcut=function(t){var e=this.formatShortcut(t);return ye.h.div({className:"p-Menu-itemShortcut"},e)},t.prototype.renderSubmenu=function(t){return ye.h.div({className:"p-Menu-itemSubmenuIcon"})},t.prototype.createItemClass=function(t){var e="p-Menu-item";t.item.isEnabled||(e+=" p-mod-disabled"),t.item.isToggled&&(e+=" p-mod-toggled"),t.item.isVisible||(e+=" p-mod-hidden"),t.active&&(e+=" p-mod-active"),t.collapsed&&(e+=" p-mod-collapsed");var n=t.item.className;return n&&(e+=" "+n),e},t.prototype.createItemDataset=function(t){var e=t.item,n=e.type,i=e.command,o=e.dataset;return r({},o,"command"===n?{type:n,command:i}:{type:n})},t.prototype.createIconClass=function(t){var e="p-Menu-itemIcon",n=t.item.iconClass;return n?e+" "+n:e},t.prototype.formatLabel=function(t){var e=t.item,n=e.label,i=e.mnemonic;if(i<0||i>=n.length)return n;var r=n.slice(0,i),o=n.slice(i+1),a=n[i];return[r,ye.h.span({className:"p-Menu-itemMnemonic"},a),o]},t.prototype.formatShortcut=function(t){var e=t.item.keyBinding;return e?e.keys.map(o.formatKeystroke).join(", "):null},t}();t.Renderer=e,t.defaultRenderer=new e}(a=e.Menu||(e.Menu={})),e.Menu=a,function(t){function e(t){return"separator"!==t.type&&t.isEnabled&&t.isVisible}t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="p-Menu-content",t.appendChild(e),t.tabIndex=-1,t},t.canActivate=e,t.createItem=function(t,e){return new n(t.commands,e)},t.formatKeystroke=function(t){var e="",n=bt.CommandRegistry.parseKeystroke(t);return gt.Platform.IS_MAC?(n.ctrl&&(e+="⌃ "),n.alt&&(e+="⌥ "),n.shift&&(e+="⇧ "),n.cmd&&(e+="⌘ ")):(n.ctrl&&(e+="Ctrl+"),n.alt&&(e+="Alt+"),n.shift&&(e+="Shift+")),e+n.key},t.hitTestMenus=function(t,e,n){for(var i=t;i;i=i.childMenu)if(gt.ElementExt.hitTest(i.node,e,n))return!0;return!1},t.computeCollapsed=function(t){var e=new Array(t.length);x.ArrayExt.fill(e,!1);for(var n=0,i=t.length;n<i;++n)if((a=t[n]).isVisible){if("separator"!==a.type)break;e[n]=!0}for(var r=i-1;r>=0;--r)if((a=t[r]).isVisible){if("separator"!==a.type)break;e[r]=!0}for(var o=!1;++n<r;){var a;(a=t[n]).isVisible&&("separator"!==a.type?o=!1:o?e[n]=!0:o=!0)}return e},t.openRootMenu=function(t,e,n,i,r){qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.UpdateRequest);var o=window.pageXOffset,a=window.pageYOffset,s=document.documentElement.clientWidth,u=document.documentElement.clientHeight,c=u-(r?n:0),h=t.node,d=h.style;d.top="",d.left="",d.width="",d.height="",d.visibility="hidden",d.maxHeight=c+"px",Gt.Widget.attach(t,document.body);var l=h.getBoundingClientRect(),p=l.width,f=l.height;!i&&e+p>o+s&&(e=o+s-p),!r&&n+f>a+u&&(n>a+u?n=a+u-f:n-=f),d.top=Math.max(0,n)+"px",d.left=Math.max(0,e)+"px",d.visibility=""},t.openSubmenu=function(e,n){qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.UpdateRequest);var i=window.pageXOffset,r=window.pageYOffset,o=document.documentElement.clientWidth,a=document.documentElement.clientHeight,s=a,u=e.node,c=u.style;c.top="",c.left="",c.width="",c.height="",c.visibility="hidden",c.maxHeight=s+"px",Gt.Widget.attach(e,document.body);var h=u.getBoundingClientRect(),d=h.width,l=h.height,p=gt.ElementExt.boxSizing(e.node),f=n.getBoundingClientRect(),v=f.right-t.SUBMENU_OVERLAP;v+d>i+o&&(v=f.left+t.SUBMENU_OVERLAP-d);var m=f.top-p.borderTop-p.paddingTop;m+l>r+a&&(m=f.bottom+p.borderBottom+p.paddingBottom-l),c.top=Math.max(0,m)+"px",c.left=Math.max(0,v)+"px",c.visibility=""},t.findMnemonic=function(t,n,i){for(var r=-1,o=-1,a=!1,s=n.toUpperCase(),u=0,c=t.length;u<c;++u){var h=(u+i)%c,d=t[h];if(e(d)){var l=d.label;if(0!==l.length){var p=d.mnemonic;p>=0&&p<l.length?l[p].toUpperCase()===s&&(-1===r?r=h:a=!0):-1===o&&l[0].toUpperCase()===s&&(o=h)}}}return{index:r,multiple:a,auto:o}};var n=function(){function t(t,e){this._commands=t,this.type=e.type||"command",this.command=e.command||"",this.args=e.args||O.JSONExt.emptyObject,this.submenu=e.submenu||null}return Object.defineProperty(t.prototype,"label",{get:function(){return"command"===this.type?this._commands.label(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return"command"===this.type?this._commands.mnemonic(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return"command"===this.type?this._commands.iconClass(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return"command"===this.type?this._commands.iconLabel(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return"command"===this.type?this._commands.caption(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return"command"===this.type?this._commands.className(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return"command"===this.type?this._commands.dataset(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return"command"===this.type?this._commands.isEnabled(this.command,this.args):"submenu"!==this.type||null!==this.submenu},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isToggled",{get:function(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return"command"===this.type?this._commands.isVisible(this.command,this.args):"submenu"!==this.type||null!==this.submenu},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBinding",{get:function(){if("command"===this.type){var t=this.command,e=this.args;return x.ArrayExt.findLastValue(this._commands.keyBindings,function(n){return n.command===t&&O.JSONExt.deepEqual(n.args,e)})||null}return null},enumerable:!0,configurable:!0}),t}()}(o||(o={}))});i(xe);xe.Menu;var Me=r(function(t,e){var i=n&&n.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t){this._idTick=0,this._items=[],this.menu=new xe.Menu(t)}return t.prototype.addItem=function(t){var e=this,n=r.createItem(t,this._idTick++);return this._items.push(n),new pt.DisposableDelegate(function(){x.ArrayExt.removeFirstOf(e._items,n)})},t.prototype.open=function(t){var e=this;if(this.menu.clearItems(),0===this._items.length)return!1;var n=r.matchItems(this._items,t);return!(!n||0===n.length)&&(x.each(n,function(t){e.menu.addItem(t)}),this.menu.open(t.clientX,t.clientY),!0)},t}();e.ContextMenu=o,function(t){function e(t,e){var n=gt.Selector.calculateSpecificity(t.selector),i=gt.Selector.calculateSpecificity(e.selector);if(n!==i)return i-n;var r=t.rank,o=e.rank;return r!==o?r<o?-1:1:t.id-e.id}t.createItem=function(t,e){var n=function(t){if(-1!==t.indexOf(","))throw new Error("Selector cannot contain commas: "+t);if(!gt.Selector.isValid(t))throw new Error("Invalid selector: "+t);return t}(t.selector),r=void 0!==t.rank?t.rank:1/0;return i({},t,{selector:n,rank:r,id:e})},t.matchItems=function(t,n){var i=n.target;if(!i)return null;var r=n.currentTarget;if(!r)return null;if(!(r.contains(i)||(i=document.elementFromPoint(n.clientX,n.clientY))&&r.contains(i)))return null;for(var o=[],a=t.slice();null!==i;){for(var s=[],u=0,c=a.length;u<c;++u){var h=a[u];h&&gt.Selector.matches(i,h.selector)&&(s.push(h),a[u]=null)}if(0!==s.length&&(s.sort(e),o.push.apply(o,s)),i===r)break;i=i.parentElement}return o}}(r||(r={}))});i(Me);Me.ContextMenu;var we=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){var n=t.call(this)||this;return n._spacing=4,n._dirty=!1,n._root=null,n._box=null,n._items=new Map,n.renderer=e.renderer,void 0!==e.spacing&&(n._spacing=r.clampSpacing(e.spacing)),n}return i(e,t),e.prototype.dispose=function(){var e=this.iter();this._items.forEach(function(t){t.dispose()}),this._box=null,this._root=null,this._items.clear(),x.each(e,function(t){t.dispose()}),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=r.clampSpacing(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return null===this._root},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._root?this._root.iterAllWidgets():x.empty()},e.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():x.empty()},e.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():x.empty()},e.prototype.tabBars=function(){return this._root?this._root.iterTabBars():x.empty()},e.prototype.handles=function(){return this._root?this._root.iterHandles():x.empty()},e.prototype.moveHandle=function(t,e,n){if(this._root&&!t.classList.contains("p-mod-hidden")){var i,r=this._root.findSplitNode(t);if(r)0!==(i="horizontal"===r.node.orientation?e-t.offsetLeft:n-t.offsetTop)&&(r.node.holdSizes(),Ut.BoxEngine.adjust(r.node.sizers,r.index,i),this.parent&&this.parent.update())}},e.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},e.prototype.restoreLayout=function(t){var e,n=this,i=new Set;e=t.main?r.normalizeAreaConfig(t.main,i):null;var o=this.widgets(),a=this.tabBars(),s=this.handles();this._root=null,x.each(o,function(t){i.has(t)||(t.parent=null)}),x.each(a,function(t){t.dispose()}),x.each(s,function(t){t.parentNode&&t.parentNode.removeChild(t)}),i.forEach(function(t){t.parent=n.parent}),this._root=e?r.realizeAreaConfig(e,{createTabBar:function(){return n._createTabBar()},createHandle:function(){return n._createHandle()}}):null,this.parent&&(i.forEach(function(t){n.attachWidget(t)}),this.parent.fit())},e.prototype.addWidget=function(t,e){void 0===e&&(e={});var n=e.ref||null,i=e.mode||"tab-after",r=null;if(this._root&&n&&(r=this._root.findTabNode(n)),n&&!r)throw new Error("Reference widget is not in the layout.");switch(t.parent=this.parent,i){case"tab-after":this._insertTab(t,n,r,!0);break;case"tab-before":this._insertTab(t,n,r,!1);break;case"split-top":this._insertSplit(t,n,r,"vertical",!1);break;case"split-left":this._insertSplit(t,n,r,"horizontal",!1);break;case"split-right":this._insertSplit(t,n,r,"horizontal",!0);break;case"split-bottom":this._insertSplit(t,n,r,"vertical",!0)}this.parent&&(this.attachWidget(t),this.parent.fit())},e.prototype.removeWidget=function(t){this._removeWidget(t),this.parent&&(this.detachWidget(t),this.parent.fit())},e.prototype.hitTestTabAreas=function(t,e){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var n=this.parent.node.getBoundingClientRect(),i=t-n.left-this._box.borderLeft,r=e-n.top-this._box.borderTop,o=this._root.hitTestTabNodes(i,r);if(!o)return null;var a=o.tabBar,s=o.top,u=o.left,c=o.width,h=o.height,d=this._box.borderLeft+this._box.borderRight,l=this._box.borderTop+this._box.borderBottom;return{tabBar:a,x:i,y:r,top:s,left:u,right:n.width-d-(u+c),bottom:n.height-l-(s+h),width:c,height:h}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),x.each(this,function(t){e.attachWidget(t)}),x.each(this.handles(),function(t){e.parent.node.appendChild(t)}),this.parent.fit()},e.prototype.attachWidget=function(t){this.parent.node!==t.node.parentNode&&(this._items.set(t,new Jt.LayoutItem(t)),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterAttach))},e.prototype.detachWidget=function(t){if(this.parent.node===t.node.parentNode){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterDetach);var e=this._items.get(t);e&&(this._items.delete(t),e.dispose())}},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._removeWidget=function(t){if(this._root){var e=this._root.findTabNode(t);if(e)if(e.tabBar.titles.length>1)e.tabBar.removeTab(t.title);else if(e.tabBar.dispose(),this._root!==e){this._root.holdAllSizes();var n=e.parent;e.parent=null;var i=x.ArrayExt.removeFirstOf(n.children,e),o=x.ArrayExt.removeAt(n.handles,i);if(x.ArrayExt.removeAt(n.sizers,i),o.parentNode&&o.parentNode.removeChild(o),n.children.length>1)n.syncHandles();else{var a=n.parent;n.parent=null;var s=n.children[0],u=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,u.parentNode&&u.parentNode.removeChild(u),this._root===n)return s.parent=null,void(this._root=s);var c=a,h=c.children.indexOf(n);if(s instanceof r.TabLayoutNode)return s.parent=c,void(c.children[h]=s);var d=x.ArrayExt.removeAt(c.handles,h);x.ArrayExt.removeAt(c.children,h),x.ArrayExt.removeAt(c.sizers,h),d.parentNode&&d.parentNode.removeChild(d);for(var l=0,p=s.children.length;l<p;++l){var f=s.children[l],v=s.handles[l],m=s.sizers[l];x.ArrayExt.insert(c.children,h+l,f),x.ArrayExt.insert(c.handles,h+l,v),x.ArrayExt.insert(c.sizers,h+l,m),f.parent=c}s.children.length=0,s.handles.length=0,s.sizers.length=0,s.parent=null,c.syncHandles()}}else this._root=null}},e.prototype._insertTab=function(t,e,n,i){if(t!==e){if(!this._root){var o=new r.TabLayoutNode(this._createTabBar());return o.tabBar.addTab(t.title),void(this._root=o)}var a;n||(n=this._root.findFirstTabNode()),-1===n.tabBar.titles.indexOf(t.title)&&(this._removeWidget(t),t.hide()),a=e?n.tabBar.titles.indexOf(e.title):n.tabBar.currentIndex,n.tabBar.insertTab(a+(i?1:0),t.title)}},e.prototype._insertSplit=function(t,e,n,i,o){if(t!==e||!n||1!==n.tabBar.titles.length){this._removeWidget(t);var a=new r.TabLayoutNode(this._createTabBar());if(a.tabBar.addTab(t.title),this._root){if(!n||!n.parent){var s=this._splitRoot(i),u=o?s.children.length:0;s.normalizeSizes();var c=r.createSizer(n?1:r.GOLDEN_RATIO);return x.ArrayExt.insert(s.children,u,a),x.ArrayExt.insert(s.sizers,u,c),x.ArrayExt.insert(s.handles,u,this._createHandle()),a.parent=s,s.normalizeSizes(),void s.syncHandles()}var h=n.parent;if(h.orientation===i){var d=h.children.indexOf(n);h.normalizeSizes();var l=h.sizers[d].sizeHint/=2,p=d+(o?1:0);return x.ArrayExt.insert(h.children,p,a),x.ArrayExt.insert(h.sizers,p,r.createSizer(l)),x.ArrayExt.insert(h.handles,p,this._createHandle()),a.parent=h,void h.syncHandles()}var f=x.ArrayExt.removeFirstOf(h.children,n),v=new r.SplitLayoutNode(i);v.normalized=!0,v.children.push(n),v.sizers.push(r.createSizer(.5)),v.handles.push(this._createHandle()),n.parent=v;var m=o?1:0;x.ArrayExt.insert(v.children,m,a),x.ArrayExt.insert(v.sizers,m,r.createSizer(.5)),x.ArrayExt.insert(v.handles,m,this._createHandle()),a.parent=v,v.syncHandles(),x.ArrayExt.insert(h.children,f,v),v.parent=h}else this._root=a}},e.prototype._splitRoot=function(t){var e=this._root;if(e instanceof r.SplitLayoutNode&&e.orientation===t)return e;var n=this._root=new r.SplitLayoutNode(t);return e&&(n.children.push(e),n.sizers.push(r.createSizer(0)),n.handles.push(this._createHandle()),e.parent=n),n},e.prototype._fit=function(){var t=0,e=0;if(this._root){var n=this._root.fit(this._spacing,this._items);t=n.minWidth,e=n.minHeight}var i=this._box=gt.ElementExt.boxSizing(this.parent.node);t+=i.horizontalSum,e+=i.verticalSum;var r=this.parent.node.style;r.minWidth=t+"px",r.minHeight=e+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){if(this._dirty=!1,this._root){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var n=this._box.paddingTop,i=this._box.paddingLeft,r=t-this._box.horizontalSum,o=e-this._box.verticalSum;this._root.update(n,i,r,o,this._spacing,this._items)}},e.prototype._createTabBar=function(){var t=this.renderer.createTabBar();return t.orientation="horizontal",this.parent&&(t.parent=this.parent,this.attachWidget(t)),t},e.prototype._createHandle=function(){var t=this.renderer.createHandle(),e=t.style;return e.position="absolute",e.top="0",e.left="0",e.width="0",e.height="0",this.parent&&this.parent.node.appendChild(t),t},e}(Jt.Layout);e.DockLayout=o,function(t){function e(t){var e=new Ut.BoxSizer;return e.sizeHint=t,e.size=t,e}function n(t,e){return"tab-area"===t.type?function(t,e){if(0===t.widgets.length)return null;var n=[];if(x.each(t.widgets,function(t){e.has(t)||(e.add(t),n.push(t))}),0===n.length)return null;var i=t.currentIndex;-1!==i&&(i<0||i>=n.length)&&(i=0);return{type:"tab-area",widgets:n,currentIndex:i}}(t,e):function(t,e){for(var i=t.orientation,r=[],o=[],a=0,s=t.children.length;a<s;++a){var u=n(t.children[a],e);u&&("tab-area"===u.type||u.orientation!==i?(r.push(u),o.push(Math.abs(t.sizes[a]||0))):(r.push.apply(r,u.children),o.push.apply(o,u.sizes)))}if(0===r.length)return null;if(1===r.length)return r[0];return{type:"split-area",orientation:i,children:r,sizes:o}}(t,e)}function i(t,n){return"tab-area"===t.type?function(t,e){var n=e.createTabBar();return x.each(t.widgets,function(t){t.hide(),n.addTab(t.title)}),n.currentIndex=t.currentIndex,new r(n)}(t,n):function(t,n){var r=new o(t.orientation);return x.each(t.children,function(o,a){var s=i(o,n),u=e(t.sizes[a]),c=n.createHandle();r.children.push(s),r.handles.push(c),r.sizers.push(u),s.parent=r}),r.syncHandles(),r.normalizeSizes(),r}(t,n)}t.GOLDEN_RATIO=.618,t.clampSpacing=function(t){return Math.max(0,Math.floor(t))},t.createSizer=e,t.normalizeAreaConfig=n,t.realizeAreaConfig=i;var r=function(){function t(t){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var e=new Ut.BoxSizer,n=new Ut.BoxSizer;e.stretch=0,n.stretch=1,this.tabBar=t,this.sizers=[e,n]}return Object.defineProperty(t.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.iterAllWidgets=function(){return x.chain(x.once(this.tabBar),this.iterUserWidgets())},t.prototype.iterUserWidgets=function(){return x.map(this.tabBar.titles,function(t){return t.owner})},t.prototype.iterSelectedWidgets=function(){var t=this.tabBar.currentTitle;return t?x.once(t.owner):x.empty()},t.prototype.iterTabBars=function(){return x.once(this.tabBar)},t.prototype.iterHandles=function(){return x.empty()},t.prototype.findTabNode=function(t){return-1!==this.tabBar.titles.indexOf(t.title)?this:null},t.prototype.findSplitNode=function(t){return null},t.prototype.findFirstTabNode=function(){return this},t.prototype.hitTestTabNodes=function(t,e){return t<this._left||t>=this._left+this._width?null:e<this._top||e>=this._top+this._height?null:this},t.prototype.createConfig=function(){return{type:"tab-area",widgets:this.tabBar.titles.map(function(t){return t.owner}),currentIndex:this.tabBar.currentIndex}},t.prototype.holdAllSizes=function(){},t.prototype.fit=function(t,e){var n=0,i=0,r=e.get(this.tabBar),o=this.tabBar.currentTitle,a=o?e.get(o.owner):void 0,s=this.sizers,u=s[0],c=s[1];return r&&r.fit(),a&&a.fit(),r&&!r.isHidden?(n=Math.max(n,r.minWidth),i+=r.minHeight,u.minSize=r.minHeight,u.maxSize=r.maxHeight):(u.minSize=0,u.maxSize=0),a&&!a.isHidden?(n=Math.max(n,a.minWidth),i+=a.minHeight,c.minSize=a.minHeight,c.maxSize=1/0):(c.minSize=0,c.maxSize=1/0),{minWidth:n,minHeight:i,maxWidth:1/0,maxHeight:1/0}},t.prototype.update=function(t,e,n,i,r,o){this._top=e,this._left=t,this._width=n,this._height=i;var a=o.get(this.tabBar),s=this.tabBar.currentTitle,u=s?o.get(s.owner):void 0;if(Ut.BoxEngine.calc(this.sizers,i),a&&!a.isHidden){var c=this.sizers[0].size;a.update(t,e,n,c),e+=c}if(u&&!u.isHidden){c=this.sizers[1].size;u.update(t,e,n,c)}},t}();t.TabLayoutNode=r;var o=function(){function t(t){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=t}return t.prototype.iterAllWidgets=function(){var t=x.map(this.children,function(t){return t.iterAllWidgets()});return new x.ChainIterator(t)},t.prototype.iterUserWidgets=function(){var t=x.map(this.children,function(t){return t.iterUserWidgets()});return new x.ChainIterator(t)},t.prototype.iterSelectedWidgets=function(){var t=x.map(this.children,function(t){return t.iterSelectedWidgets()});return new x.ChainIterator(t)},t.prototype.iterTabBars=function(){var t=x.map(this.children,function(t){return t.iterTabBars()});return new x.ChainIterator(t)},t.prototype.iterHandles=function(){var t=x.map(this.children,function(t){return t.iterHandles()});return x.chain(this.handles,new x.ChainIterator(t))},t.prototype.findTabNode=function(t){for(var e=0,n=this.children.length;e<n;++e){var i=this.children[e].findTabNode(t);if(i)return i}return null},t.prototype.findSplitNode=function(t){var e=this.handles.indexOf(t);if(-1!==e)return{index:e,node:this};for(var n=0,i=this.children.length;n<i;++n){var r=this.children[n].findSplitNode(t);if(r)return r}return null},t.prototype.findFirstTabNode=function(){return 0===this.children.length?null:this.children[0].findFirstTabNode()},t.prototype.hitTestTabNodes=function(t,e){for(var n=0,i=this.children.length;n<i;++n){var r=this.children[n].hitTestTabNodes(t,e);if(r)return r}return null},t.prototype.createConfig=function(){var t=this.orientation,e=this.createNormalizedSizes();return{type:"split-area",orientation:t,children:this.children.map(function(t){return t.createConfig()}),sizes:e}},t.prototype.syncHandles=function(){var t=this;x.each(this.handles,function(e,n){e.setAttribute("data-orientation",t.orientation),n===t.handles.length-1?e.classList.add("p-mod-hidden"):e.classList.remove("p-mod-hidden")})},t.prototype.holdSizes=function(){x.each(this.sizers,function(t){t.sizeHint=t.size})},t.prototype.holdAllSizes=function(){x.each(this.children,function(t){return t.holdAllSizes()}),this.holdSizes()},t.prototype.normalizeSizes=function(){var t=this.sizers.length;if(0!==t){this.holdSizes();var e=x.reduce(this.sizers,function(t,e){return t+e.sizeHint},0);0===e?x.each(this.sizers,function(e){e.size=e.sizeHint=1/t}):x.each(this.sizers,function(t){t.size=t.sizeHint/=e}),this.normalized=!0}},t.prototype.createNormalizedSizes=function(){var t=this.sizers.length;if(0===t)return[];var e=this.sizers.map(function(t){return t.size}),n=x.reduce(e,function(t,e){return t+e},0);return 0===n?x.each(e,function(n,i){e[i]=1/t}):x.each(e,function(t,i){e[i]=t/n}),e},t.prototype.fit=function(t,e){for(var n="horizontal"===this.orientation,i=Math.max(0,this.children.length-1)*t,r=n?i:0,o=n?0:i,a=0,s=this.children.length;a<s;++a){var u=this.children[a].fit(t,e);n?(o=Math.max(o,u.minHeight),r+=u.minWidth,this.sizers[a].minSize=u.minWidth):(r=Math.max(r,u.minWidth),o+=u.minHeight,this.sizers[a].minSize=u.minHeight)}return{minWidth:r,minHeight:o,maxWidth:1/0,maxHeight:1/0}},t.prototype.update=function(t,e,n,i,r,o){var a="horizontal"===this.orientation,s=Math.max(0,this.children.length-1)*r,u=Math.max(0,(a?n:i)-s);this.normalized&&(x.each(this.sizers,function(t){t.sizeHint*=u}),this.normalized=!1),Ut.BoxEngine.calc(this.sizers,u);for(var c=0,h=this.children.length;c<h;++c){var d=this.children[c],l=this.sizers[c].size,p=this.handles[c].style;a?(d.update(t,e,l,i,r,o),t+=l,p.top=e+"px",p.left=t+"px",p.width=r+"px",p.height=i+"px",t+=r):(d.update(t,e,n,l,r,o),e+=l,p.top=e+"px",p.left=t+"px",p.width=n+"px",p.height=r+"px",e+=r)}},t}();t.SplitLayoutNode=o}(r||(r={}))});i(we);we.DockLayout;var Pe=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t){var e=this;this._onScrollFrame=function(){if(e._scrollTarget){var t=e._scrollTarget,i=t.element,r=t.edge,o=t.distance,a=n.SCROLL_EDGE_SIZE-o,s=Math.pow(a/n.SCROLL_EDGE_SIZE,2),u=Math.max(1,Math.round(s*n.SCROLL_EDGE_SIZE));switch(r){case"top":i.scrollTop-=u;break;case"left":i.scrollLeft-=u;break;case"right":i.scrollLeft+=u;break;case"bottom":i.scrollTop+=u}requestAnimationFrame(e._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.mimeData=t.mimeData,this.dragImage=t.dragImage||null,this.proposedAction=t.proposedAction||"copy",this.supportedActions=t.supportedActions||"all",this.source=t.source||null}return t.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var t=n.createMouseEvent("mouseup",-1,-1);n.dispatchDragLeave(this,this._currentTarget,null,t)}this._finalize("none")}},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),t.prototype.start=function(t,e){var i=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(t,e),this._promise=new Promise(function(t,e){i._resolve=t});var r=n.createMouseEvent("mousemove",t,e);return document.dispatchEvent(r),this._promise},t.prototype.handleEvent=function(t){switch(t.type){case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;default:t.preventDefault(),t.stopPropagation()}},t.prototype._evtMouseMove=function(t){t.preventDefault(),t.stopPropagation(),this._updateCurrentTarget(t),this._updateDragScroll(t),this._moveDragImage(t.clientX,t.clientY)},t.prototype._evtMouseUp=function(t){if(t.preventDefault(),t.stopPropagation(),0===t.button)if(this._updateCurrentTarget(t),this._currentTarget){if("none"===this._dropAction)return n.dispatchDragLeave(this,this._currentTarget,null,t),void this._finalize("none");var e=n.dispatchDrop(this,this._currentTarget,t);this._finalize(e)}else this._finalize("none")},t.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this.dispose()},t.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},t.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},t.prototype._updateDragScroll=function(t){var e=n.findScrollTarget(t);(this._scrollTarget||e)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=e)},t.prototype._updateCurrentTarget=function(t){var e=this._currentTarget,i=this._currentTarget,r=this._currentElement,o=document.elementFromPoint(t.clientX,t.clientY);this._currentElement=o,o!==r&&o!==i&&n.dispatchDragExit(this,i,o,t),o!==r&&o!==i&&(i=n.dispatchDragEnter(this,o,i,t)),i!==e&&(this._currentTarget=i,n.dispatchDragLeave(this,e,i,t));var a=n.dispatchDragOver(this,i,t);this._setDropAction(a)},t.prototype._attachDragImage=function(t,e){if(this.dragImage){this.dragImage.classList.add("p-mod-drag-image");var n=this.dragImage.style;n.pointerEvents="none",n.position="fixed",n.top=e+"px",n.left=t+"px",document.body.appendChild(this.dragImage)}},t.prototype._moveDragImage=function(t,e){if(this.dragImage){var n=this.dragImage.style;n.top=e+"px",n.left=t+"px"}},t.prototype._detachDragImage=function(){if(this.dragImage){var t=this.dragImage.parentNode;t&&t.removeChild(this.dragImage)}},t.prototype._setDropAction=function(e){if(e=n.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=t.overrideCursor("no-drop");break;case"copy":this._dropAction=e,this._override=t.overrideCursor("copy");break;case"link":this._dropAction=e,this._override=t.overrideCursor("alias");break;case"move":this._dropAction=e,this._override=t.overrideCursor("move")}},t.prototype._finalize=function(t){var e=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,e&&e(t)},t}();e.Drag=i,function(t){t.overrideCursor=function(t){var n=++e;return document.body.style.cursor=t,document.body.classList.add("p-mod-override-cursor"),new pt.DisposableDelegate(function(){n===e&&(document.body.style.cursor="",document.body.classList.remove("p-mod-override-cursor"))})};var e=0}(i=e.Drag||(e.Drag={})),e.Drag=i,function(t){t.SCROLL_EDGE_SIZE=20,t.validateAction=function(t,i){return e[t]&n[i]?t:"none"},t.createMouseEvent=function(t,e,n){var i=document.createEvent("MouseEvent");return i.initMouseEvent(t,!0,!0,window,0,0,0,e,n,!1,!1,!1,!1,0,null),i},t.findScrollTarget=function(e){for(var n=e.clientX,i=e.clientY,r=document.elementFromPoint(n,i);r;r=r.parentElement)if(r.hasAttribute("data-p-dragscroll")){var o=0,a=0;r===document.body&&(o=window.pageXOffset,a=window.pageYOffset);var s=r.getBoundingClientRect(),u=s.top+a,c=s.left+o,h=c+s.width,d=u+s.height;if(!(n<c||n>=h||i<u||i>=d)){var l=n-c+1,p=i-u+1,f=h-n,v=d-i,m=Math.min(l,p,f,v);if(!(m>t.SCROLL_EDGE_SIZE)){var _=void 0;switch(m){case v:_="bottom";break;case p:_="top";break;case f:_="right";break;case l:_="left";break;default:throw"unreachable"}var g=r.scrollWidth-r.clientWidth,y=r.scrollHeight-r.clientHeight,b=void 0;switch(_){case"top":b=y>0&&r.scrollTop>0;break;case"left":b=g>0&&r.scrollLeft>0;break;case"right":b=g>0&&r.scrollLeft<g;break;case"bottom":b=y>0&&r.scrollTop<y;break;default:throw"unreachable"}if(b)return{element:r,edge:_,distance:m}}}}return null},t.dispatchDragEnter=function(t,e,n,r){if(!e)return null;var o=i("p-dragenter",t,r,n);return e.dispatchEvent(o)?e===document.body?n:(o=i("p-dragenter",t,r,n),document.body.dispatchEvent(o),document.body):e},t.dispatchDragExit=function(t,e,n,r){if(e){var o=i("p-dragexit",t,r,n);e.dispatchEvent(o)}},t.dispatchDragLeave=function(t,e,n,r){if(e){var o=i("p-dragleave",t,r,n);e.dispatchEvent(o)}},t.dispatchDragOver=function(t,e,n){if(!e)return"none";var r=i("p-dragover",t,n,null);return e.dispatchEvent(r)?"none":r.dropAction},t.dispatchDrop=function(t,e,n){if(!e)return"none";var r=i("p-drop",t,n,null);return e.dispatchEvent(r)?"none":r.dropAction};var e={none:0,copy:1,link:2,move:4},n={none:e.none,copy:e.copy,link:e.link,move:e.move,"copy-link":e.copy|e.link,"copy-move":e.copy|e.move,"link-move":e.link|e.move,all:e.copy|e.link|e.move};function i(t,e,n,i){var r=document.createEvent("MouseEvent");return r.initMouseEvent(t,!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.button,i),r.dropAction="none",r.mimeData=e.mimeData,r.proposedAction=e.proposedAction,r.supportedActions=e.supportedActions,r.source=e.source,r}}(n||(n={}))});i(Pe);Pe.Drag;var Ie=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(n){void 0===n&&(n={});var i=t.call(this,{node:r.createNode()})||this;return i._currentIndex=-1,i._titles=[],i._previousTitle=null,i._dragData=null,i._tabMoved=new lt.Signal(i),i._currentChanged=new lt.Signal(i),i._tabCloseRequested=new lt.Signal(i),i._tabDetachRequested=new lt.Signal(i),i._tabActivateRequested=new lt.Signal(i),i.addClass("p-TabBar"),i.setFlag(Gt.Widget.Flag.DisallowLayout),i.tabsMovable=n.tabsMovable||!1,i.allowDeselect=n.allowDeselect||!1,i.insertBehavior=n.insertBehavior||"select-tab-if-needed",i.removeBehavior=n.removeBehavior||"select-tab-after",i.renderer=n.renderer||e.defaultRenderer,i._orientation=n.orientation||"horizontal",i.dataset.orientation=i._orientation,i}return i(e,t),e.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(t){this.currentIndex=t?this._titles.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(t){if((t<0||t>=this._titles.length)&&(t=-1),this._currentIndex!==t){var e=this._currentIndex,n=this._titles[e]||null,i=t,r=this._titles[i]||null;this._currentIndex=i,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:e,previousTitle:n,currentIndex:i,currentTitle:r})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-TabBar-content")[0]},enumerable:!0,configurable:!0}),e.prototype.addTab=function(t){return this.insertTab(this._titles.length,t)},e.prototype.insertTab=function(t,e){this._releaseMouse();var n=r.asTitle(e),i=this._titles.indexOf(n),o=Math.max(0,Math.min(t,this._titles.length));return-1===i?(x.ArrayExt.insert(this._titles,o,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,n),n):(o===this._titles.length&&o--,i===o?n:(x.ArrayExt.move(this._titles,i,o),this.update(),this._adjustCurrentForMove(i,o),n))},e.prototype.removeTab=function(t){this.removeTabAt(this._titles.indexOf(t))},e.prototype.removeTabAt=function(t){this._releaseMouse();var e=x.ArrayExt.removeAt(this._titles,t);e&&(e.changed.disconnect(this._onTitleChanged,this),e===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(t,e))},e.prototype.clearTabs=function(){if(0!==this._titles.length){this._releaseMouse();for(var t=0,e=this._titles;t<e.length;t++){e[t].changed.disconnect(this._onTitleChanged,this)}var n=this.currentIndex,i=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==n&&this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:-1,currentTitle:null})}},e.prototype.releaseMouse=function(){this._releaseMouse()},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){for(var e=this._titles,n=this.renderer,i=this.currentTitle,r=new Array(e.length),o=0,a=e.length;o<a;++o){var s=e[o],u=s===i,c=u?a:a-o-1;r[o]=n.renderTab({title:s,current:u,zIndex:c})}ye.VirtualDOM.render(r,this.contentNode)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if((0===t.button||1===t.button)&&!this._dragData){var e=this.contentNode.children,n=x.ArrayExt.findFirstIndex(e,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});if(-1!==n&&(t.preventDefault(),t.stopPropagation(),this._dragData={tab:e[n],index:n,pressX:t.clientX,pressY:t.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},document.addEventListener("mouseup",this,!0),1!==t.button)){var i=e[n].querySelector(this.renderer.closeIconSelector);i&&i.contains(t.target)||(this.tabsMovable&&(document.addEventListener("mousemove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===n?this.currentIndex=-1:this.currentIndex=n,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},e.prototype._evtMouseMove=function(t){var e=this._dragData;if(e){t.preventDefault(),t.stopPropagation();var n=this.contentNode.children;if(e.dragActive||r.dragExceeded(e,t)){if(!e.dragActive){var i=e.tab.getBoundingClientRect();"horizontal"===this._orientation?(e.tabPos=e.tab.offsetLeft,e.tabSize=i.width,e.tabPressPos=e.pressX-i.left):(e.tabPos=e.tab.offsetTop,e.tabSize=i.height,e.tabPressPos=e.pressY-i.top),e.tabLayout=r.snapTabLayout(n,this._orientation),e.contentRect=this.contentNode.getBoundingClientRect(),e.override=Pe.Drag.overrideCursor("default"),e.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),e.dragActive=!0}if(!e.detachRequested&&r.detachExceeded(e,t)){e.detachRequested=!0;var o=e.index,a=t.clientX,s=t.clientY,u=n[o],c=this._titles[o];if(this._tabDetachRequested.emit({index:o,title:c,tab:u,clientX:a,clientY:s}),e.dragAborted)return}r.layoutTabs(n,e,t,this._orientation)}}},e.prototype._evtMouseUp=function(t){var e=this;if(0===t.button||1===t.button){var n=this._dragData;if(n){if(t.preventDefault(),t.stopPropagation(),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),!n.dragActive){this._dragData=null;var i=this.contentNode.children,o=x.ArrayExt.findFirstIndex(i,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});if(o!==n.index)return;var a=this._titles[o];if(!a.closable)return;if(1===t.button)return void this._tabCloseRequested.emit({index:o,title:a});var s=i[o].querySelector(this.renderer.closeIconSelector);return s&&s.contains(t.target)?void this._tabCloseRequested.emit({index:o,title:a}):void 0}if(0===t.button){r.finalizeTabPosition(n,this._orientation),n.tab.classList.remove("p-mod-dragging");var u=r.parseTransitionDuration(n.tab);setTimeout(function(){if(!n.dragAborted){e._dragData=null,r.resetTabPositions(e.contentNode.children,e._orientation),n.override.dispose(),e.removeClass("p-mod-dragging");var t=n.index,i=n.targetIndex;-1!==i&&t!==i&&(x.ArrayExt.move(e._titles,t,i),e._adjustCurrentForMove(t,i),e._tabMoved.emit({fromIndex:t,toIndex:i,title:e._titles[i]}),qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.UpdateRequest))}},u)}}}},e.prototype._releaseMouse=function(){var t=this._dragData;t&&(this._dragData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),t.dragAborted=!0,t.dragActive&&(r.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),t.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},e.prototype._adjustCurrentForInsert=function(t,e){var n=this.currentTitle,i=this._currentIndex,r=this.insertBehavior;if("select-tab"===r||"select-tab-if-needed"===r&&-1===i)return this._currentIndex=t,this._previousTitle=n,void this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:t,currentTitle:e});i>=t&&this._currentIndex++},e.prototype._adjustCurrentForMove=function(t,e){this._currentIndex===t?this._currentIndex=e:this._currentIndex<t&&this._currentIndex>=e?this._currentIndex++:this._currentIndex>t&&this._currentIndex<=e&&this._currentIndex--},e.prototype._adjustCurrentForRemove=function(t,e){var n=this._currentIndex,i=this.removeBehavior;if(n===t){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null});if("select-tab-after"===i)return this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===i)return this._currentIndex=Math.max(0,t-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-previous-tab"===i)return this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(t,this._titles.length-1),void this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:t,previousTitle:e,currentIndex:-1,currentTitle:null})}else n>t&&this._currentIndex--},e.prototype._onTitleChanged=function(t){this.update()},e}(Gt.Widget);e.TabBar=o,function(t){var e=function(){function t(){this.closeIconSelector=".p-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap}return t.prototype.renderTab=function(t){var e=t.title.caption,n=this.createTabKey(t),i=this.createTabStyle(t),r=this.createTabClass(t),o=this.createTabDataset(t);return ye.h.li({key:n,className:r,title:e,style:i,dataset:o},this.renderIcon(t),this.renderLabel(t),this.renderCloseIcon(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return ye.h.div({className:e},t.title.iconLabel)},t.prototype.renderLabel=function(t){return ye.h.div({className:"p-TabBar-tabLabel"},t.title.label)},t.prototype.renderCloseIcon=function(t){return ye.h.div({className:"p-TabBar-tabCloseIcon"})},t.prototype.createTabKey=function(t){var e=this._tabKeys.get(t.title);return void 0===e&&(e="tab-key-"+this._tabID++,this._tabKeys.set(t.title,e)),e},t.prototype.createTabStyle=function(t){return{zIndex:""+t.zIndex}},t.prototype.createTabClass=function(t){var e="p-TabBar-tab";return t.title.className&&(e+=" "+t.title.className),t.title.closable&&(e+=" p-mod-closable"),t.current&&(e+=" p-mod-current"),e},t.prototype.createTabDataset=function(t){return t.title.dataset},t.prototype.createIconClass=function(t){var e="p-TabBar-tabIcon",n=t.title.iconClass;return n?e+" "+n:e},t}();t.Renderer=e,t.defaultRenderer=new e}(o=e.TabBar||(e.TabBar={})),e.TabBar=o,function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20,t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="p-TabBar-content",t.appendChild(e),t},t.asTitle=function(t){return t instanceof Xt.Title?t:new Xt.Title(t)},t.parseTransitionDuration=function(t){var e=window.getComputedStyle(t);return 1e3*(parseFloat(e.transitionDuration)||0)},t.snapTabLayout=function(t,e){for(var n=new Array(t.length),i=0,r=t.length;i<r;++i){var o=t[i],a=window.getComputedStyle(o);n[i]="horizontal"===e?{pos:o.offsetLeft,size:o.offsetWidth,margin:parseFloat(a.marginLeft)||0}:{pos:o.offsetTop,size:o.offsetHeight,margin:parseFloat(a.marginTop)||0}}return n},t.dragExceeded=function(e,n){var i=Math.abs(n.clientX-e.pressX),r=Math.abs(n.clientY-e.pressY);return i>=t.DRAG_THRESHOLD||r>=t.DRAG_THRESHOLD},t.detachExceeded=function(e,n){var i=e.contentRect;return n.clientX<i.left-t.DETACH_THRESHOLD||n.clientX>=i.right+t.DETACH_THRESHOLD||n.clientY<i.top-t.DETACH_THRESHOLD||n.clientY>=i.bottom+t.DETACH_THRESHOLD},t.layoutTabs=function(t,e,n,i){var r,o,a,s;"horizontal"===i?(r=e.pressX,o=n.clientX-e.contentRect.left,a=n.clientX,s=e.contentRect.width):(r=e.pressY,o=n.clientY-e.contentRect.top,a=n.clientY,s=e.contentRect.height);for(var u=e.index,c=o-e.tabPressPos,h=c+e.tabSize,d=0,l=t.length;d<l;++d){var p=void 0,f=e.tabLayout[d],v=f.pos+(f.size>>1);if(d<e.index&&c<v)p=e.tabSize+e.tabLayout[d+1].margin+"px",u=Math.min(u,d);else if(d>e.index&&h>v)p=-e.tabSize-f.margin+"px",u=Math.max(u,d);else if(d===e.index){var m=a-r,_=s-(e.tabPos+e.tabSize);p=Math.max(-e.tabPos,Math.min(m,_))+"px"}else p="";"horizontal"===i?t[d].style.left=p:t[d].style.top=p}e.targetIndex=u},t.finalizeTabPosition=function(t,e){var n,i;if(n="horizontal"===e?t.contentRect.width:t.contentRect.height,t.targetIndex===t.index)i=0;else if(t.targetIndex>t.index)i=(r=t.tabLayout[t.targetIndex]).pos+r.size-t.tabSize-t.tabPos;else{var r;i=(r=t.tabLayout[t.targetIndex]).pos-t.tabPos}var o=n-(t.tabPos+t.tabSize),a=Math.max(-t.tabPos,Math.min(i,o));"horizontal"===e?t.tab.style.left=a+"px":t.tab.style.top=a+"px"},t.resetTabPositions=function(t,e){x.each(t,function(t){"horizontal"===e?t.style.left="":t.style.top=""})}}(r||(r={}))});i(Ie);Ie.TabBar;var Ae=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(n){void 0===n&&(n={});var i=t.call(this)||this;i._drag=null,i._pressData=null,i._layoutModified=new lt.Signal(i),i.addClass("p-DockPanel"),i._mode=n.mode||"multiple-document",i._renderer=n.renderer||e.defaultRenderer,i.dataset.mode=i._mode;var r={createTabBar:function(){return i._createTabBar()},createHandle:function(){return i._createHandle()}};return i.layout=new we.DockLayout({renderer:r,spacing:n.spacing}),i.overlay=n.overlay||new e.Overlay,i.node.appendChild(i.overlay.node),i}return i(e,t),e.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(t){if(this._mode!==t){this._mode=t,this.dataset.mode=t;var e=this.layout;switch(t){case"multiple-document":x.each(e.tabBars(),function(t){t.show()});break;case"single-document":e.restoreLayout(r.createSingleDocumentConfig(this));break;default:throw"unreachable"}qt.MessageLoop.postMessage(this,r.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),e.prototype.widgets=function(){return this.layout.widgets()},e.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},e.prototype.tabBars=function(){return this.layout.tabBars()},e.prototype.handles=function(){return this.layout.handles()},e.prototype.selectWidget=function(t){var e=x.find(this.tabBars(),function(e){return-1!==e.titles.indexOf(t.title)});if(!e)throw new Error("Widget is not contained in the dock panel.");e.currentTitle=t.title},e.prototype.activateWidget=function(t){this.selectWidget(t),t.activate()},e.prototype.saveLayout=function(){return this.layout.saveLayout()},e.prototype.restoreLayout=function(t){this._mode="multiple-document",this.layout.restoreLayout(t),(gt.Platform.IS_EDGE||gt.Platform.IS_IE)&&qt.MessageLoop.flush(),qt.MessageLoop.postMessage(this,r.LayoutModified)},e.prototype.addWidget=function(t,e){void 0===e&&(e={}),"single-document"===this._mode?this.layout.addWidget(t):this.layout.addWidget(t,e),qt.MessageLoop.postMessage(this,r.LayoutModified)},e.prototype.processMessage=function(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):t.prototype.processMessage.call(this,e)},e.prototype.handleEvent=function(t){switch(t.type){case"p-dragenter":this._evtDragEnter(t);break;case"p-dragleave":this._evtDragLeave(t);break;case"p-dragover":this._evtDragOver(t);break;case"p-drop":this._evtDrop(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("p-dragenter",this),this.node.addEventListener("p-dragleave",this),this.node.addEventListener("p-dragover",this),this.node.addEventListener("p-drop",this),this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("p-dragenter",this),this.node.removeEventListener("p-dragleave",this),this.node.removeEventListener("p-dragover",this),this.node.removeEventListener("p-drop",this),this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onChildAdded=function(t){r.isGeneratedTabBarProperty.get(t.child)||t.child.addClass("p-DockPanel-widget")},e.prototype.onChildRemoved=function(t){r.isGeneratedTabBarProperty.get(t.child)||(t.child.removeClass("p-DockPanel-widget"),qt.MessageLoop.postMessage(this,r.LayoutModified))},e.prototype._evtDragEnter=function(t){t.mimeData.hasData("application/vnd.phosphor.widget-factory")&&(t.preventDefault(),t.stopPropagation())},e.prototype._evtDragLeave=function(t){t.preventDefault(),t.stopPropagation();var e=t.relatedTarget;e&&this.node.contains(e)||this.overlay.hide(0)},e.prototype._evtDragOver=function(t){t.preventDefault(),t.stopPropagation(),"invalid"===this._showOverlay(t.clientX,t.clientY)?t.dropAction="none":t.dropAction=t.proposedAction},e.prototype._evtDrop=function(t){if(t.preventDefault(),t.stopPropagation(),this.overlay.hide(0),"none"!==t.proposedAction){var e=t.clientX,n=t.clientY,i=r.findDropTarget(this,e,n),o=i.zone,a=i.target;if("invalid"!==o){var s=t.mimeData.getData("application/vnd.phosphor.widget-factory");if("function"==typeof s){var u=s();if(u instanceof Gt.Widget)if(u.contains(this))t.dropAction="none";else{var c=a?r.getDropRef(a.tabBar):null;switch(o){case"root-all":this.addWidget(u);break;case"root-top":this.addWidget(u,{mode:"split-top"});break;case"root-left":this.addWidget(u,{mode:"split-left"});break;case"root-right":this.addWidget(u,{mode:"split-right"});break;case"root-bottom":this.addWidget(u,{mode:"split-bottom"});break;case"widget-all":this.addWidget(u,{mode:"tab-after",ref:c});break;case"widget-top":this.addWidget(u,{mode:"split-top",ref:c});break;case"widget-left":this.addWidget(u,{mode:"split-left",ref:c});break;case"widget-right":this.addWidget(u,{mode:"split-right",ref:c});break;case"widget-bottom":this.addWidget(u,{mode:"split-bottom",ref:c});break;default:throw"unreachable"}t.dropAction=t.proposedAction,this.activateWidget(u)}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"}else t.dropAction="none"},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&(this._releaseMouse(),qt.MessageLoop.postMessage(this,r.LayoutModified))},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,n=t.target,i=x.find(e.handles(),function(t){return t.contains(n)});if(i){t.preventDefault(),t.stopPropagation(),document.addEventListener("keydown",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("contextmenu",this,!0);var r=i.getBoundingClientRect(),o=t.clientX-r.left,a=t.clientY-r.top,s=window.getComputedStyle(i),u=Pe.Drag.overrideCursor(s.cursor);this._pressData={handle:i,deltaX:o,deltaY:a,override:u}}}},e.prototype._evtMouseMove=function(t){if(this._pressData){t.preventDefault(),t.stopPropagation();var e=this.node.getBoundingClientRect(),n=t.clientX-e.left-this._pressData.deltaX,i=t.clientY-e.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,n,i)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse(),qt.MessageLoop.postMessage(this,r.LayoutModified))},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("keydown",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("contextmenu",this,!0))},e.prototype._showOverlay=function(t,e){var n,i,o,a,s=r.findDropTarget(this,t,e),u=s.zone,c=s.target;if("invalid"===u)return this.overlay.hide(100),u;var h=gt.ElementExt.boxSizing(this.node),d=this.node.getBoundingClientRect();switch(u){case"root-all":n=h.paddingTop,i=h.paddingLeft,o=h.paddingRight,a=h.paddingBottom;break;case"root-top":n=h.paddingTop,i=h.paddingLeft,o=h.paddingRight,a=d.height*r.GOLDEN_RATIO;break;case"root-left":n=h.paddingTop,i=h.paddingLeft,o=d.width*r.GOLDEN_RATIO,a=h.paddingBottom;break;case"root-right":n=h.paddingTop,i=d.width*r.GOLDEN_RATIO,o=h.paddingRight,a=h.paddingBottom;break;case"root-bottom":n=d.height*r.GOLDEN_RATIO,i=h.paddingLeft,o=h.paddingRight,a=h.paddingBottom;break;case"widget-all":n=c.top,i=c.left,o=c.right,a=c.bottom;break;case"widget-top":n=c.top,i=c.left,o=c.right,a=c.bottom+c.height/2;break;case"widget-left":n=c.top,i=c.left,o=c.right+c.width/2,a=c.bottom;break;case"widget-right":n=c.top,i=c.left+c.width/2,o=c.right,a=c.bottom;break;case"widget-bottom":n=c.top+c.height/2,i=c.left,o=c.right,a=c.bottom;break;default:throw"unreachable"}return this.overlay.show({top:n,left:i,right:o,bottom:a}),u},e.prototype._createTabBar=function(){var t=this._renderer.createTabBar();return r.isGeneratedTabBarProperty.set(t,!0),"single-document"===this._mode&&t.hide(),t.tabsMovable=!0,t.allowDeselect=!1,t.removeBehavior="select-previous-tab",t.insertBehavior="select-tab-if-needed",t.tabMoved.connect(this._onTabMoved,this),t.currentChanged.connect(this._onCurrentChanged,this),t.tabCloseRequested.connect(this._onTabCloseRequested,this),t.tabDetachRequested.connect(this._onTabDetachRequested,this),t.tabActivateRequested.connect(this._onTabActivateRequested,this),t},e.prototype._createHandle=function(){return this._renderer.createHandle()},e.prototype._onTabMoved=function(){qt.MessageLoop.postMessage(this,r.LayoutModified)},e.prototype._onCurrentChanged=function(t,e){var n=e.previousTitle,i=e.currentTitle;n&&n.owner.hide(),i&&i.owner.show(),(gt.Platform.IS_EDGE||gt.Platform.IS_IE)&&qt.MessageLoop.flush(),qt.MessageLoop.postMessage(this,r.LayoutModified)},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabDetachRequested=function(t,e){var n=this;if(!this._drag){t.releaseMouse();var i=e.title,r=e.tab,o=e.clientX,a=e.clientY,s=new O.MimeData;s.setData("application/vnd.phosphor.widget-factory",function(){return i.owner});var u=r.cloneNode(!0);this._drag=new Pe.Drag({mimeData:s,dragImage:u,proposedAction:"move",supportedActions:"move"}),r.classList.add("p-mod-hidden");this._drag.start(o,a).then(function(){n._drag=null,r.classList.remove("p-mod-hidden")})}},e}(Gt.Widget);e.DockPanel=o,function(t){var e=function(){function t(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return t.prototype.show=function(t){var e=this.node.style;e.top=t.top+"px",e.left=t.left+"px",e.right=t.right+"px",e.bottom=t.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("p-mod-hidden"))},t.prototype.hide=function(t){var e=this;if(!this._hidden)return t<=0?(clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("p-mod-hidden")):void(-1===this._timer&&(this._timer=setTimeout(function(){e._timer=-1,e._hidden=!0,e.node.classList.add("p-mod-hidden")},t)))},t}();t.Overlay=e;var n=function(){function t(){}return t.prototype.createTabBar=function(){var t=new Ie.TabBar;return t.addClass("p-DockPanel-tabBar"),t},t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="p-DockPanel-handle",t},t}();t.Renderer=n,t.defaultRenderer=new n}(o=e.DockPanel||(e.DockPanel={})),e.DockPanel=o,function(t){t.GOLDEN_RATIO=.618,t.EDGE_SIZE=40,t.LayoutModified=new qt.ConflatableMessage("layout-modified"),t.isGeneratedTabBarProperty=new Yt.AttachedProperty({name:"isGeneratedTabBar",create:function(){return!1}}),t.createSingleDocumentConfig=function(t){if(t.isEmpty)return{main:null};var e=x.toArray(t.widgets()),n=t.selectedWidgets().next(),i=n?e.indexOf(n):-1;return{main:{type:"tab-area",widgets:e,currentIndex:i}}},t.findDropTarget=function(e,n,i){if(!gt.ElementExt.hitTest(e.node,n,i))return{zone:"invalid",target:null};var r=e.layout;if(r.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===e.mode){var o=e.node.getBoundingClientRect(),a=n-o.left+1,s=i-o.top+1,u=o.right-n,c=o.bottom-i,h=Math.min(a,s,u,c);if(h<=t.EDGE_SIZE){var d;switch(h){case a:d="root-left";break;case s:d="root-top";break;case u:d="root-right";break;case c:d="root-bottom";break;default:throw"unreachable"}return{zone:d,target:null}}}var l=r.hitTestTabAreas(n,i);if(!l)return{zone:"invalid",target:null};if("single-document"===e.mode)return{zone:"widget-all",target:l};var p,f=l.x-l.left+1,v=l.y-l.top+1,m=l.left+l.width-l.x,_=l.top+l.height-l.y,g=Math.round(l.width/3),y=Math.round(l.height/3);if(f>g&&m>g&&v>y&&_>y)return{zone:"widget-all",target:l};switch(f/=g,v/=y,m/=g,_/=y,Math.min(f,v,m,_)){case f:p="widget-left";break;case v:p="widget-top";break;case m:p="widget-right";break;case _:p="widget-bottom";break;default:throw"unreachable"}return{zone:p,target:l}},t.getDropRef=function(t){return 0===t.titles.length?null:t.currentTitle?t.currentTitle.owner:t.titles[t.titles.length-1].owner}}(r||(r={}))});i(Ae);Ae.DockPanel;var Ee=r(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new lt.Signal(this),this._currentChanged=new lt.Signal(this)}return t.prototype.dispose=function(){var t=this;this._counter<0||(this._counter=-1,lt.Signal.clearData(this),x.each(this._widgets,function(e){e.node.removeEventListener("focus",t,!0),e.node.removeEventListener("blur",t,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(t.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),t.prototype.focusNumber=function(t){var e=this._numbers.get(t);return void 0===e?-1:e},t.prototype.has=function(t){return this._numbers.has(t)},t.prototype.add=function(t){if(!this._numbers.has(t)){var e=t.node.contains(document.activeElement),n=e?this._counter++:-1;this._widgets.push(t),this._numbers.set(t,n),this._nodes.set(t.node,t),t.node.addEventListener("focus",this,!0),t.node.addEventListener("blur",this,!0),t.disposed.connect(this._onWidgetDisposed,this),e&&this._setWidgets(t,t)}},t.prototype.remove=function(t){var e=this;if(this._numbers.has(t)&&(t.disposed.disconnect(this._onWidgetDisposed,this),t.node.removeEventListener("focus",this,!0),t.node.removeEventListener("blur",this,!0),x.ArrayExt.removeFirstOf(this._widgets,t),this._nodes.delete(t.node),this._numbers.delete(t),this._currentWidget===t)){var n=x.filter(this._widgets,function(t){return-1!==e._numbers.get(t)}),i=x.max(n,function(t,n){return e._numbers.get(t)-e._numbers.get(n)})||null;this._setWidgets(i,null)}},t.prototype.handleEvent=function(t){switch(t.type){case"focus":this._evtFocus(t);break;case"blur":this._evtBlur(t)}},t.prototype._setWidgets=function(t,e){var n=this._currentWidget;this._currentWidget=t;var i=this._activeWidget;this._activeWidget=e,n!==t&&this._currentChanged.emit({oldValue:n,newValue:t}),i!==e&&this._activeChanged.emit({oldValue:i,newValue:e})},t.prototype._evtFocus=function(t){var e=this._nodes.get(t.currentTarget);e!==this._currentWidget&&this._numbers.set(e,this._counter++),this._setWidgets(e,e)},t.prototype._evtBlur=function(t){var e=this._nodes.get(t.currentTarget),n=t.relatedTarget;n&&(e.node.contains(n)||x.find(this._widgets,function(t){return t.node.contains(n)}))||this._setWidgets(this._currentWidget,null)},t.prototype._onWidgetDisposed=function(t){this.remove(t)},t}();e.FocusTracker=n});i(Ee);Ee.FocusTracker;var Se=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n._dirty=!1,n._rowSpacing=4,n._columnSpacing=4,n._items=[],n._rowStarts=[],n._columnStarts=[],n._rowSizers=[new Ut.BoxSizer],n._columnSizers=[new Ut.BoxSizer],n._box=null,void 0!==e.rowCount&&r.reallocSizers(n._rowSizers,e.rowCount),void 0!==e.columnCount&&r.reallocSizers(n._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(n._rowSpacing=r.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(n._columnSpacing=r.clampValue(e.columnSpacing)),n}return i(e,t),e.prototype.dispose=function(){x.each(this._items,function(t){var e=t.widget;t.dispose(),e.dispose()}),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(t){t!==this.rowCount&&(r.reallocSizers(this._rowSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(t){t!==this.columnCount&&(r.reallocSizers(this._columnSizers,t),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(t){t=r.clampValue(t),this._rowSpacing!==t&&(this._rowSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(t){t=r.clampValue(t),this._columnSpacing!==t&&(this._columnSpacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.rowStretch=function(t){var e=this._rowSizers[t];return e?e.stretch:-1},e.prototype.setRowStretch=function(t,e){var n=this._rowSizers[t];n&&(e=r.clampValue(e),n.stretch!==e&&(n.stretch=e,this.parent&&this.parent.update()))},e.prototype.columnStretch=function(t){var e=this._columnSizers[t];return e?e.stretch:-1},e.prototype.setColumnStretch=function(t,e){var n=this._columnSizers[t];n&&(e=r.clampValue(e),n.stretch!==e&&(n.stretch=e,this.parent&&this.parent.update()))},e.prototype.iter=function(){return x.map(this._items,function(t){return t.widget})},e.prototype.addWidget=function(t){-1===x.ArrayExt.findFirstIndex(this._items,function(e){return e.widget===t})&&(this._items.push(new Jt.LayoutItem(t)),this.parent&&this.attachWidget(t))},e.prototype.removeWidget=function(t){var e=x.ArrayExt.findFirstIndex(this._items,function(e){return e.widget===t});if(-1===e){var n=x.ArrayExt.removeAt(this._items,e);this.parent&&this.detachWidget(t),n.dispose()}},e.prototype.init=function(){var e=this;t.prototype.init.call(this),x.each(this,function(t){e.attachWidget(t)})},e.prototype.attachWidget=function(t){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.detachWidget=function(t){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterDetach),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,n=this.rowCount;t<n;++t)this._rowSizers[t].minSize=0;for(t=0,n=this.columnCount;t<n;++t)this._columnSizers[t].minSize=0;var i=this._items.filter(function(t){return!t.isHidden});for(t=0,n=i.length;t<n;++t)i[t].fit();var o=this.rowCount-1,a=this.columnCount-1;i.sort(r.rowSpanCmp);for(t=0,n=i.length;t<n;++t){var s=i[t],u=e.getCellConfig(s.widget),c=Math.min(u.row,o),h=Math.min(u.row+u.rowSpan-1,o);r.distributeMin(this._rowSizers,c,h,s.minHeight)}i.sort(r.columnSpanCmp);for(t=0,n=i.length;t<n;++t){s=i[t],u=e.getCellConfig(s.widget);var d=Math.min(u.column,a),l=Math.min(u.column+u.columnSpan-1,a);r.distributeMin(this._columnSizers,d,l,s.minWidth)}if("set-no-constraint"!==this.fitPolicy){var p=o*this._rowSpacing,f=a*this._columnSpacing;for(t=0,n=this.rowCount;t<n;++t)p+=this._rowSizers[t].minSize;for(t=0,n=this.columnCount;t<n;++t)f+=this._columnSizers[t].minSize;var v=this._box=gt.ElementExt.boxSizing(this.parent.node);f+=v.horizontalSum,p+=v.verticalSum;var m=this.parent.node.style;m.minWidth=f+"px",m.minHeight=p+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)}else qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,n){this._dirty=!1,t<0&&(t=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var i=this._box.paddingTop,r=this._box.paddingLeft,o=t-this._box.horizontalSum,a=n-this._box.verticalSum,s=this.rowCount-1,u=this.columnCount-1,c=s*this._rowSpacing,h=u*this._columnSpacing;Ut.BoxEngine.calc(this._rowSizers,Math.max(0,a-c)),Ut.BoxEngine.calc(this._columnSizers,Math.max(0,o-h));for(var d=0,l=i,p=this.rowCount;d<p;++d)this._rowStarts[d]=l,l+=this._rowSizers[d].size+this._rowSpacing;for(d=0,l=r,p=this.columnCount;d<p;++d)this._columnStarts[d]=l,l+=this._columnSizers[d].size+this._columnSpacing;for(d=0,p=this._items.length;d<p;++d){var f=this._items[d];if(!f.isHidden){var v=e.getCellConfig(f.widget),m=Math.min(v.row,s),_=Math.min(v.column,u),g=Math.min(v.row+v.rowSpan-1,s),y=Math.min(v.column+v.columnSpan-1,u),b=this._columnStarts[_],x=this._rowStarts[m],M=this._columnStarts[y]+this._columnSizers[y].size-b,w=this._rowStarts[g]+this._rowSizers[g].size-x;f.update(b,x,M,w)}}},e}(Jt.Layout);e.GridLayout=o,function(t){t.getCellConfig=function(t){return r.cellConfigProperty.get(t)},t.setCellConfig=function(t,e){r.cellConfigProperty.set(t,r.normalizeConfig(e))}}(o=e.GridLayout||(e.GridLayout={})),e.GridLayout=o,function(t){t.cellConfigProperty=new Yt.AttachedProperty({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:function(t){t.parent&&t.parent.layout instanceof o&&t.parent.fit()}}),t.normalizeConfig=function(t){return{row:Math.max(0,Math.floor(t.row||0)),column:Math.max(0,Math.floor(t.column||0)),rowSpan:Math.max(1,Math.floor(t.rowSpan||0)),columnSpan:Math.max(1,Math.floor(t.columnSpan||0))}},t.clampValue=function(t){return Math.max(0,Math.floor(t))},t.rowSpanCmp=function(e,n){var i=t.cellConfigProperty.get(e.widget),r=t.cellConfigProperty.get(n.widget);return i.rowSpan-r.rowSpan},t.columnSpanCmp=function(e,n){var i=t.cellConfigProperty.get(e.widget),r=t.cellConfigProperty.get(n.widget);return i.columnSpan-r.columnSpan},t.reallocSizers=function(t,e){for(e=Math.max(1,Math.floor(e));t.length<e;)t.push(new Ut.BoxSizer);t.length<e&&(t.length=e)},t.distributeMin=function(t,e,n,i){if(!(n<e))if(e!==n){for(var r=0,o=e;o<=n;++o)r+=t[o].minSize;if(!(r>=i)){var a=(i-r)/(n-e+1);for(o=e;o<=n;++o)t[o].minSize+=a}}else{var s=t[e];s.minSize=Math.max(s.minSize,i)}}}(r||(r={}))});i(Se);Se.GridLayout;var Oe=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(n){void 0===n&&(n={});var i=t.call(this,{node:r.createNode()})||this;return i._activeIndex=-1,i._menus=[],i._childMenu=null,i.addClass("p-MenuBar"),i.setFlag(Gt.Widget.Flag.DisallowLayout),i.renderer=n.renderer||e.defaultRenderer,i}return i(e,t),e.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("p-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(t){this.activeIndex=t?this._menus.indexOf(t):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(t){(t<0||t>=this._menus.length)&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),e.prototype.openActiveMenu=function(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},e.prototype.addMenu=function(t){this.insertMenu(this._menus.length,t)},e.prototype.insertMenu=function(t,e){this._closeChildMenu();var n=this._menus.indexOf(e),i=Math.max(0,Math.min(t,this._menus.length));if(-1===n)return x.ArrayExt.insert(this._menus,i,e),e.addClass("p-MenuBar-menu"),e.aboutToClose.connect(this._onMenuAboutToClose,this),e.menuRequested.connect(this._onMenuMenuRequested,this),e.title.changed.connect(this._onTitleChanged,this),void this.update();i===this._menus.length&&i--,n!==i&&(x.ArrayExt.move(this._menus,n,i),this.update())},e.prototype.removeMenu=function(t){this.removeMenuAt(this._menus.indexOf(t))},e.prototype.removeMenuAt=function(t){this._closeChildMenu();var e=x.ArrayExt.removeAt(this._menus,t);e&&(e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("p-MenuBar-menu"),this.update())},e.prototype.clearMenus=function(){if(0!==this._menus.length){this._closeChildMenu();for(var t=0,e=this._menus;t<e.length;t++){var n=e[t];n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},e.prototype.handleEvent=function(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseleave":this._evtMouseLeave(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()},e.prototype.onActivateRequest=function(t){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(t){for(var e=this._menus,n=this.renderer,i=this._activeIndex,r=new Array(e.length),o=0,a=e.length;o<a;++o){var s=e[o].title,u=o===i;r[o]=n.renderItem({title:s,active:u})}ye.VirtualDOM.render(r,this.contentNode)},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation();var e=t.keyCode;if(13!==e&&38!==e&&40!==e){if(27===e)return this._closeChildMenu(),this.activeIndex=-1,void this.node.blur();if(37!==e)if(39!==e){var n=yt.getKeyboardLayout().keyForKeydownEvent(t);if(n){var i=this._activeIndex+1,o=r.findMnemonic(this._menus,n,i);-1===o.index||o.multiple?-1!==o.index?this.activeIndex=o.index:-1!==o.auto&&(this.activeIndex=o.auto):(this.activeIndex=o.index,this.openActiveMenu())}}else{a=this._activeIndex,s=this._menus.length;this.activeIndex=a===s-1?0:a+1}else{var a=this._activeIndex,s=this._menus.length;this.activeIndex=0===a?s-1:a-1}}else this.openActiveMenu()},e.prototype._evtMouseDown=function(t){if(gt.ElementExt.hitTest(this.node,t.clientX,t.clientY)){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation();var e=x.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});-1!==e?0===t.button&&(this._childMenu?(this._closeChildMenu(),this.activeIndex=e):(this.activeIndex=e,this._openChildMenu())):this._closeChildMenu()}},e.prototype._evtMouseMove=function(t){var e=x.ArrayExt.findFirstIndex(this.contentNode.children,function(e){return gt.ElementExt.hitTest(e,t.clientX,t.clientY)});e!==this._activeIndex&&(-1===e&&this._childMenu||(this.activeIndex=e,this._childMenu&&this._openChildMenu()))},e.prototype._evtMouseLeave=function(t){this._childMenu||(this.activeIndex=-1)},e.prototype._openChildMenu=function(){var t=this.activeMenu;if(t){var e=this._childMenu;if(e!==t){this._childMenu=t,e?e.close():(this.addClass("p-mod-active"),document.addEventListener("mousedown",this,!0)),qt.MessageLoop.sendMessage(this,Gt.Widget.Msg.UpdateRequest);var n=this.contentNode.children[this._activeIndex].getBoundingClientRect(),i=n.left,r=n.bottom;t.open(i,r,{forceX:!0,forceY:!0})}}else this._closeChildMenu()},e.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var t=this._childMenu;this._childMenu=null,t.close(),this.activeIndex=-1}},e.prototype._onMenuAboutToClose=function(t){t===this._childMenu&&(this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},e.prototype._onMenuMenuRequested=function(t,e){if(t===this._childMenu){var n=this._activeIndex,i=this._menus.length;switch(e){case"next":this.activeIndex=n===i-1?0:n+1;break;case"previous":this.activeIndex=0===n?i-1:n-1}this.openActiveMenu()}},e.prototype._onTitleChanged=function(){this.update()},e}(Gt.Widget);e.MenuBar=o,function(t){var e=function(){function t(){}return t.prototype.renderItem=function(t){var e=this.createItemClass(t),n=this.createItemDataset(t);return ye.h.li({className:e,dataset:n},this.renderIcon(t),this.renderLabel(t))},t.prototype.renderIcon=function(t){var e=this.createIconClass(t);return ye.h.div({className:e},t.title.iconLabel)},t.prototype.renderLabel=function(t){var e=this.formatLabel(t);return ye.h.div({className:"p-MenuBar-itemLabel"},e)},t.prototype.createItemClass=function(t){var e="p-MenuBar-item";return t.title.className&&(e+=" "+t.title.className),t.active&&(e+=" p-mod-active"),e},t.prototype.createItemDataset=function(t){return t.title.dataset},t.prototype.createIconClass=function(t){var e="p-MenuBar-itemIcon",n=t.title.iconClass;return n?e+" "+n:e},t.prototype.formatLabel=function(t){var e=t.title,n=e.label,i=e.mnemonic;if(i<0||i>=n.length)return n;var r=n.slice(0,i),o=n.slice(i+1),a=n[i];return[r,ye.h.span({className:"p-MenuBar-itemMnemonic"},a),o]},t}();t.Renderer=e,t.defaultRenderer=new e}(o=e.MenuBar||(e.MenuBar={})),e.MenuBar=o,function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("ul");return e.className="p-MenuBar-content",t.appendChild(e),t.tabIndex=-1,t},t.findMnemonic=function(t,e,n){for(var i=-1,r=-1,o=!1,a=e.toUpperCase(),s=0,u=t.length;s<u;++s){var c=(s+n)%u,h=t[c].title;if(0!==h.label.length){var d=h.mnemonic;d>=0&&d<h.label.length?h.label[d].toUpperCase()===a&&(-1===i?i=c:o=!0):-1===r&&h.label[0].toUpperCase()===a&&(r=c)}}return{index:i,multiple:o,auto:r}}}(r||(r={}))});i(Oe);Oe.MenuBar;var Ce=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{node:r.createNode()})||this;return n._onRepeat=function(){if(n._repeatTimer=-1,n._pressData){var t=n._pressData.part;if("thumb"!==t){n._repeatTimer=setTimeout(n._onRepeat,20);var e=n._pressData.mouseX,i=n._pressData.mouseY;if("decrement"!==t)if("increment"!==t){if("track"===t){if(!gt.ElementExt.hitTest(n.trackNode,e,i))return;var r=n.thumbNode;if(gt.ElementExt.hitTest(r,e,i))return;var o=r.getBoundingClientRect(),a=void 0;return a="horizontal"===n._orientation?e<o.left?"decrement":"increment":i<o.top?"decrement":"increment",void n._pageRequested.emit(a)}}else{if(!gt.ElementExt.hitTest(n.incrementNode,e,i))return;n._stepRequested.emit("increment")}else{if(!gt.ElementExt.hitTest(n.decrementNode,e,i))return;n._stepRequested.emit("decrement")}}}},n._value=0,n._page=10,n._maximum=100,n._repeatTimer=-1,n._pressData=null,n._thumbMoved=new lt.Signal(n),n._stepRequested=new lt.Signal(n),n._pageRequested=new lt.Signal(n),n.addClass("p-ScrollBar"),n.setFlag(Gt.Widget.Flag.DisallowLayout),n._orientation=e.orientation||"vertical",n.dataset.orientation=n._orientation,void 0!==e.maximum&&(n._maximum=Math.max(0,e.maximum)),void 0!==e.page&&(n._page=Math.max(0,e.page)),void 0!==e.value&&(n._value=Math.max(0,Math.min(e.value,n._maximum))),n}return i(e,t),Object.defineProperty(e.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this._page},set:function(t){t=Math.max(0,t),this._page!==t&&(this._page=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(t){t=Math.max(0,t),this._maximum!==t&&(this._maximum=t,this._value=Math.min(this._value,t),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("p-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this),this.update()},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(t){var e=100*this._value/this._maximum,n=100*this._page/(this._page+this._maximum);e=Math.max(0,Math.min(e,100)),n=Math.max(0,Math.min(n,100));var i=this.thumbNode.style;"horizontal"===this._orientation?(i.top="",i.height="",i.left=e+"%",i.width=n+"%",i.transform="translate("+-e+"%, 0%)"):(i.left="",i.width="",i.top=e+"%",i.height=n+"%",i.transform="translate(0%, "+-e+"%)")},e.prototype._evtKeyDown=function(t){if(t.preventDefault(),t.stopPropagation(),27===t.keyCode){var e=this._pressData?this._pressData.value:-1;this._releaseMouse(),-1!==e&&this._moveThumb(e)}},e.prototype._evtMouseDown=function(t){if(0===t.button&&!this._pressData){var e=r.findPart(this,t.target);if(e){t.preventDefault(),t.stopPropagation();var n=Pe.Drag.overrideCursor("default");if(this._pressData={part:e,override:n,delta:-1,value:-1,mouseX:t.clientX,mouseY:t.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),"thumb"===e){var i=this.thumbNode,o=i.getBoundingClientRect();return"horizontal"===this._orientation?this._pressData.delta=t.clientX-o.left:this._pressData.delta=t.clientY-o.top,i.classList.add("p-mod-active"),void(this._pressData.value=this._value)}if("track"===e){o=this.thumbNode.getBoundingClientRect();var a=void 0;return a="horizontal"===this._orientation?t.clientX<o.left?"decrement":"increment":t.clientY<o.top?"decrement":"increment",this._repeatTimer=setTimeout(this._onRepeat,350),void this._pageRequested.emit(a)}return"decrement"===e?(this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=setTimeout(this._onRepeat,350),void this._stepRequested.emit("decrement")):"increment"===e?(this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=setTimeout(this._onRepeat,350),void this._stepRequested.emit("increment")):void 0}}},e.prototype._evtMouseMove=function(t){if(this._pressData&&(t.preventDefault(),t.stopPropagation(),this._pressData.mouseX=t.clientX,this._pressData.mouseY=t.clientY,"thumb"===this._pressData.part)){var e,n,i=this.thumbNode.getBoundingClientRect(),r=this.trackNode.getBoundingClientRect();"horizontal"===this._orientation?(e=t.clientX-r.left-this._pressData.delta,n=r.width-i.width):(e=t.clientY-r.top-this._pressData.delta,n=r.height-i.height);var o=0===n?0:e*this._maximum/n;this._moveThumb(o)}},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(clearTimeout(this._repeatTimer),this._repeatTimer=-1,this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},e.prototype._moveThumb=function(t){t=Math.max(0,Math.min(t,this._maximum)),this._value!==t&&(this._value=t,this.update(),this._thumbMoved.emit(t))},e}(Gt.Widget);e.ScrollBar=o,function(t){t.createNode=function(){var t=document.createElement("div"),e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("div"),r=document.createElement("div");return e.className="p-ScrollBar-button",n.className="p-ScrollBar-button",e.dataset.action="decrement",n.dataset.action="increment",i.className="p-ScrollBar-track",r.className="p-ScrollBar-thumb",i.appendChild(r),t.appendChild(e),t.appendChild(i),t.appendChild(n),t},t.findPart=function(t,e){return t.thumbNode.contains(e)?"thumb":t.trackNode.contains(e)?"track":t.decrementNode.contains(e)?"decrement":t.incrementNode.contains(e)?"increment":null}}(r||(r={}))});i(Ce);Ce.ScrollBar;var Le=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._widget=null,e}return i(e,t),e.prototype.dispose=function(){if(this._widget){var e=this._widget;this._widget=null,e.dispose()}t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widget",{get:function(){return this._widget},set:function(t){this._widget!==t&&(this._widget&&this._widget.dispose(),this._widget=t,this.parent&&t&&this.attachWidget(t))},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._widget?x.once(this._widget):x.empty()},e.prototype.removeWidget=function(t){this._widget===t&&(this._widget=null,this.parent&&this.detachWidget(t))},e.prototype.init=function(){var e=this;t.prototype.init.call(this),x.each(this,function(t){e.attachWidget(t)})},e.prototype.attachWidget=function(t){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterAttach)},e.prototype.detachWidget=function(t){this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(t,Gt.Widget.Msg.AfterDetach)},e}(Jt.Layout);e.SingletonLayout=r});i(Le);Le.SingletonLayout;var ze=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){var n=t.call(this)||this;return n._fixed=0,n._spacing=4,n._dirty=!1,n._hasNormedSizes=!1,n._sizers=[],n._items=[],n._handles=[],n._box=null,n._alignment="start",n._orientation="horizontal",n.renderer=e.renderer,void 0!==e.orientation&&(n._orientation=e.orientation),void 0!==e.alignment&&(n._alignment=e.alignment),void 0!==e.spacing&&(n._spacing=r.clampSpacing(e.spacing)),n}return i(e,t),e.prototype.dispose=function(){x.each(this._items,function(t){t.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){this._orientation!==t&&(this._orientation=t,this.parent&&(this.parent.dataset.orientation=t,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(t){t=r.clampSpacing(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return r.normalize(this._sizers.map(function(t){return t.size}))},e.prototype.setRelativeSizes=function(t){for(var e=this._sizers.length,n=t.slice(0,e);n.length<e;)n.push(0);for(var i=r.normalize(n),o=0;o<e;++o){var a=this._sizers[o];a.sizeHint=i[o],a.size=i[o]}this._hasNormedSizes=!0,this.parent&&this.parent.update()},e.prototype.moveHandle=function(t,e){var n,i=this._handles[t];if(i&&!i.classList.contains("p-mod-hidden")&&0!==(n="horizontal"===this._orientation?e-i.offsetLeft:e-i.offsetTop)){for(var r=0,o=this._sizers;r<o.length;r++){var a=o[r];a.size>0&&(a.sizeHint=a.size)}Ut.BoxEngine.adjust(this._sizers,t,n),this.parent&&this.parent.update()}},e.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(t,e){var n=new Jt.LayoutItem(e),i=r.createHandle(this.renderer),o=r.averageSize(this._sizers),a=r.createSizer(o);x.ArrayExt.insert(this._items,t,n),x.ArrayExt.insert(this._sizers,t,a),x.ArrayExt.insert(this._handles,t,i),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.node.appendChild(i),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){x.ArrayExt.move(this._items,t,e),x.ArrayExt.move(this._sizers,t,e),x.ArrayExt.move(this._handles,t,e),this.parent.fit()},e.prototype.detachWidget=function(t,e){var n=x.ArrayExt.removeAt(this._items,t),i=x.ArrayExt.removeAt(this._handles,t);x.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.node.removeChild(i),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,n=-1,i=0,r=this._items.length;i<r;++i)this._items[i].isHidden?this._handles[i].classList.add("p-mod-hidden"):(this._handles[i].classList.remove("p-mod-hidden"),n=i,t++);-1!==n&&this._handles[n].classList.add("p-mod-hidden"),this._fixed=this._spacing*Math.max(0,t-1);var o="horizontal"===this._orientation,a=o?this._fixed:0,s=o?0:this._fixed;for(i=0,r=this._items.length;i<r;++i){var u=this._items[i],c=this._sizers[i];c.size>0&&(c.sizeHint=c.size),u.isHidden?(c.minSize=0,c.maxSize=0):(u.fit(),c.stretch=e.getStretch(u.widget),o?(c.minSize=u.minWidth,c.maxSize=u.maxWidth,a+=u.minWidth,s=Math.max(s,u.minHeight)):(c.minSize=u.minHeight,c.maxSize=u.maxHeight,s+=u.minHeight,a=Math.max(a,u.minWidth)))}var h=this._box=gt.ElementExt.boxSizing(this.parent.node);a+=h.horizontalSum,s+=h.verticalSum;var d=this.parent.node.style;d.minWidth=a+"px",d.minHeight=s+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var n=0,i=0,r=this._items.length;i<r;++i)n+=+!this._items[i].isHidden;if(0!==n){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var o,a=this._box.paddingTop,s=this._box.paddingLeft,u=t-this._box.horizontalSum,c=e-this._box.verticalSum,h="horizontal"===this._orientation;if(o=h?Math.max(0,u-this._fixed):Math.max(0,c-this._fixed),this._hasNormedSizes){for(var d=0,l=this._sizers;d<l.length;d++){l[d].sizeHint*=o}this._hasNormedSizes=!1}var p=Ut.BoxEngine.calc(this._sizers,o),f=0,v=0;if(p>0)switch(this._alignment){case"start":break;case"center":f=0,v=p/2;break;case"end":f=0,v=p;break;case"justify":f=p/n,v=0;break;default:throw"unreachable"}for(i=0,r=this._items.length;i<r;++i){var m=this._items[i];if(!m.isHidden){var _=this._sizers[i].size,g=this._handles[i].style;h?(m.update(s+v,a,_+f,c),s+=_+f,g.top=a+"px",g.left=s+v+"px",g.width=this._spacing+"px",g.height=c+"px",s+=this._spacing):(m.update(s,a+v,u,_+f),a+=_+f,g.top=a+v+"px",g.left=s+"px",g.width=u+"px",g.height=this._spacing+"px",a+=this._spacing)}}}},e}(Zt.PanelLayout);e.SplitLayout=o,function(t){t.getStretch=function(t){return r.stretchProperty.get(t)},t.setStretch=function(t,e){r.stretchProperty.set(t,e)}}(o=e.SplitLayout||(e.SplitLayout={})),e.SplitLayout=o,function(t){t.stretchProperty=new Yt.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(t,e){return Math.max(0,Math.floor(e))},changed:function(t){t.parent&&t.parent.layout instanceof o&&t.parent.fit()}}),t.createSizer=function(t){var e=new Ut.BoxSizer;return e.sizeHint=Math.floor(t),e},t.createHandle=function(t){var e=t.createHandle();return e.style.position="absolute",e},t.clampSpacing=function(t){return Math.max(0,Math.floor(t))},t.averageSize=function(t){return t.reduce(function(t,e){return t+e.size},0)/t.length||0},t.normalize=function(t){var e=t.length;if(0===e)return[];var n=t.reduce(function(t,e){return t+Math.abs(e)},0);return 0===n?t.map(function(t){return 1/e}):t.map(function(t){return t/n})}}(r||(r={}))});i(ze);ze.SplitLayout;var ke=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{layout:r.createLayout(e)})||this;return n._pressData=null,n.addClass("p-SplitPanel"),n}return i(e,t),e.prototype.dispose=function(){this._releaseMouse(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(t){this.layout.orientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(t){this.layout.alignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(t){this.layout.spacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return this.layout.relativeSizes()},e.prototype.setRelativeSizes=function(t){this.layout.setRelativeSizes(t)},e.prototype.handleEvent=function(t){switch(t.type){case"mousedown":this._evtMouseDown(t);break;case"mousemove":this._evtMouseMove(t);break;case"mouseup":this._evtMouseUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}},e.prototype.onBeforeAttach=function(t){this.node.addEventListener("mousedown",this)},e.prototype.onAfterDetach=function(t){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onChildAdded=function(t){t.child.addClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype.onChildRemoved=function(t){t.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype._evtKeyDown=function(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this._releaseMouse()},e.prototype._evtMouseDown=function(t){if(0===t.button){var e=this.layout,n=x.ArrayExt.findFirstIndex(e.handles,function(e){return e.contains(t.target)});if(-1!==n){var i;t.preventDefault(),t.stopPropagation(),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var r=e.handles[n],o=r.getBoundingClientRect();i="horizontal"===e.orientation?t.clientX-o.left:t.clientY-o.top;var a=window.getComputedStyle(r),s=Pe.Drag.overrideCursor(a.cursor);this._pressData={index:n,delta:i,override:s}}}},e.prototype._evtMouseMove=function(t){var e;t.preventDefault(),t.stopPropagation();var n=this.layout,i=this.node.getBoundingClientRect();e="horizontal"===n.orientation?t.clientX-i.left-this._pressData.delta:t.clientY-i.top-this._pressData.delta,n.moveHandle(this._pressData.index,e)},e.prototype._evtMouseUp=function(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0))},e}($t.Panel);e.SplitPanel=o,function(t){var e=function(){function t(){}return t.prototype.createHandle=function(){var t=document.createElement("div");return t.className="p-SplitPanel-handle",t},t}();t.Renderer=e,t.defaultRenderer=new e,t.getStretch=function(t){return ze.SplitLayout.getStretch(t)},t.setStretch=function(t,e){ze.SplitLayout.setStretch(t,e)}}(o=e.SplitPanel||(e.SplitPanel={})),e.SplitPanel=o,function(t){t.createLayout=function(t){return t.layout||new ze.SplitLayout({renderer:t.renderer||o.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}}(r||(r={}))});i(ke);ke.SplitPanel;var Te=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._dirty=!1,e._items=[],e._box=null,e}return i(e,t),e.prototype.dispose=function(){x.each(this._items,function(t){t.dispose()}),this._box=null,this._items.length=0,t.prototype.dispose.call(this)},e.prototype.attachWidget=function(t,e){x.ArrayExt.insert(this._items,t,new Jt.LayoutItem(e)),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(t,e,n){x.ArrayExt.move(this._items,t,e),this.parent.update()},e.prototype.detachWidget=function(t,e){var n=x.ArrayExt.removeAt(this._items,t);this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&qt.MessageLoop.sendMessage(e,Gt.Widget.Msg.AfterDetach),n.widget.node.style.zIndex="",n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(e){t.prototype.onBeforeShow.call(this,e),this.parent.update()},e.prototype.onBeforeAttach=function(e){t.prototype.onBeforeAttach.call(this,e),this.parent.fit()},e.prototype.onChildShown=function(t){this.parent.fit()},e.prototype.onChildHidden=function(t){this.parent.fit()},e.prototype.onResize=function(t){this.parent.isVisible&&this._update(t.width,t.height)},e.prototype.onUpdateRequest=function(t){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(t){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var t=0,e=0,n=0,i=this._items.length;n<i;++n){var r=this._items[n];r.isHidden||(r.fit(),t=Math.max(t,r.minWidth),e=Math.max(e,r.minHeight))}var o=this._box=gt.ElementExt.boxSizing(this.parent.node);t+=o.horizontalSum,e+=o.verticalSum;var a=this.parent.node.style;a.minWidth=t+"px",a.minHeight=e+"px",this._dirty=!0,this.parent.parent&&qt.MessageLoop.sendMessage(this.parent.parent,Gt.Widget.Msg.FitRequest),this._dirty&&qt.MessageLoop.sendMessage(this.parent,Gt.Widget.Msg.UpdateRequest)},e.prototype._update=function(t,e){this._dirty=!1;for(var n=0,i=0,r=this._items.length;i<r;++i)n+=+!this._items[i].isHidden;if(0!==n){t<0&&(t=this.parent.node.offsetWidth),e<0&&(e=this.parent.node.offsetHeight),this._box||(this._box=gt.ElementExt.boxSizing(this.parent.node));var o=this._box.paddingTop,a=this._box.paddingLeft,s=t-this._box.horizontalSum,u=e-this._box.verticalSum;for(i=0,r=this._items.length;i<r;++i){var c=this._items[i];c.isHidden||(c.widget.node.style.zIndex=""+i,c.update(a,o,s,u))}}},e}(Zt.PanelLayout);e.StackedLayout=r});i(Te);Te.StackedLayout;var je=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,{layout:r.createLayout(e)})||this;return n._widgetRemoved=new lt.Signal(n),n.addClass("p-StackedPanel"),n}return i(e,t),Object.defineProperty(e.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(t){t.child.addClass("p-StackedPanel-child")},e.prototype.onChildRemoved=function(t){t.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(t.child)},e}($t.Panel);e.StackedPanel=o,function(t){t.createLayout=function(t){return t.layout||new Te.StackedLayout}}(r||(r={}))});i(je);je.StackedPanel;var De=r(function(t,e){var i=n&&n.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;n._currentChanged=new lt.Signal(n),n.addClass("p-TabPanel"),n.tabBar=new Ie.TabBar(e),n.tabBar.addClass("p-TabPanel-tabBar"),n.stackedPanel=new je.StackedPanel,n.stackedPanel.addClass("p-TabPanel-stackedPanel"),n.tabBar.tabMoved.connect(n._onTabMoved,n),n.tabBar.currentChanged.connect(n._onCurrentChanged,n),n.tabBar.tabCloseRequested.connect(n._onTabCloseRequested,n),n.tabBar.tabActivateRequested.connect(n._onTabActivateRequested,n),n.stackedPanel.widgetRemoved.connect(n._onWidgetRemoved,n),n._tabPlacement=e.tabPlacement||"top";var i=r.directionFromPlacement(n._tabPlacement),o=r.orientationFromPlacement(n._tabPlacement);n.tabBar.orientation=o,n.tabBar.dataset.placement=n._tabPlacement;var a=new Qt.BoxLayout({direction:i,spacing:0});return Qt.BoxLayout.setStretch(n.tabBar,0),Qt.BoxLayout.setStretch(n.stackedPanel,1),a.addWidget(n.tabBar),a.addWidget(n.stackedPanel),n.layout=a,n}return i(e,t),Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(t){this.tabBar.currentIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){var t=this.tabBar.currentTitle;return t?t.owner:null},set:function(t){this.tabBar.currentTitle=t?t.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(t){this.tabBar.tabsMovable=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(t){if(this._tabPlacement!==t){this._tabPlacement=t;var e=r.directionFromPlacement(t),n=r.orientationFromPlacement(t);this.tabBar.orientation=n,this.tabBar.dataset.placement=t,this.layout.direction=e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(t){this.insertWidget(this.widgets.length,t)},e.prototype.insertWidget=function(t,e){e!==this.currentWidget&&e.hide(),this.stackedPanel.insertWidget(t,e),this.tabBar.insertTab(t,e.title)},e.prototype._onCurrentChanged=function(t,e){var n=e.previousIndex,i=e.previousTitle,r=e.currentIndex,o=e.currentTitle,a=i?i.owner:null,s=o?o.owner:null;a&&a.hide(),s&&s.show(),this._currentChanged.emit({previousIndex:n,previousWidget:a,currentIndex:r,currentWidget:s}),(gt.Platform.IS_EDGE||gt.Platform.IS_IE)&&qt.MessageLoop.flush()},e.prototype._onTabActivateRequested=function(t,e){e.title.owner.activate()},e.prototype._onTabCloseRequested=function(t,e){e.title.owner.close()},e.prototype._onTabMoved=function(t,e){this.stackedPanel.insertWidget(e.toIndex,e.title.owner)},e.prototype._onWidgetRemoved=function(t,e){this.tabBar.removeTab(e.title)},e}(Gt.Widget);e.TabPanel=o,function(t){t.orientationFromPlacement=function(t){return e[t]},t.directionFromPlacement=function(t){return n[t]};var e={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},n={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}}(r||(r={}))});i(De);De.TabPanel;var Be=i(r(function(t,e){function n(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),n(Ut),n(Qt),n(te),n(be),n(Me),n(we),n(Ae),n(Ee),n(Se),n(Jt),n(xe),n(Oe),n($t),n(Zt),n(Ce),n(Le),n(ze),n(ke),n(Te),n(je),n(Ie),n(De),n(Xt),n(Gt)}));function Re(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}Re(".p-Widget{box-sizing:border-box;position:relative;overflow:hidden;cursor:default}.p-Widget.p-mod-hidden{display:none!important}");Re(".p-CommandPalette{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-CommandPalette-search{flex:0 0 auto}.p-CommandPalette-content{flex:1 1 auto;margin:0;padding:0;min-height:0;overflow:auto;list-style-type:none}.p-CommandPalette-header{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.p-CommandPalette-item{display:flex;flex-direction:row}.p-CommandPalette-itemIcon{flex:0 0 auto}.p-CommandPalette-itemContent{flex:1 1 auto}.p-CommandPalette-itemShortcut{flex:0 0 auto}.p-CommandPalette-itemLabel{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}");Re('.p-DockPanel,.p-DockPanel-widget{z-index:0}.p-DockPanel-tabBar{z-index:1}.p-DockPanel-handle{z-index:2}.p-DockPanel-handle.p-mod-hidden{display:none!important}.p-DockPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.p-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.p-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.p-DockPanel-handle[data-orientation=horizontal]:after{left:50%;min-width:8px;transform:translateX(-50%)}.p-DockPanel-handle[data-orientation=vertical]:after{top:50%;min-height:8px;transform:translateY(-50%)}.p-DockPanel-overlay{z-index:3;box-sizing:border-box;pointer-events:none}.p-DockPanel-overlay.p-mod-hidden{display:none!important}');Re(".p-Menu{z-index:10000;position:absolute;white-space:nowrap;overflow-x:hidden;overflow-y:auto;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-Menu-content{margin:0;padding:0;display:table;list-style-type:none}.p-Menu-item{display:table-row}.p-Menu-item.p-mod-collapsed,.p-Menu-item.p-mod-hidden{display:none!important}.p-Menu-itemIcon,.p-Menu-itemSubmenuIcon{display:table-cell;text-align:center}.p-Menu-itemLabel{display:table-cell;text-align:left}.p-Menu-itemShortcut{display:table-cell;text-align:right}");Re(".p-MenuBar{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-MenuBar-content{margin:0;padding:0;display:flex;flex-direction:row;list-style-type:none}.p-MenuBar-item{box-sizing:border-box}.p-MenuBar-itemIcon,.p-MenuBar-itemLabel{display:inline-block}");Re(".p-ScrollBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-ScrollBar[data-orientation=horizontal]{flex-direction:row}.p-ScrollBar[data-orientation=vertical]{flex-direction:column}.p-ScrollBar-button{box-sizing:border-box;flex:0 0 auto}.p-ScrollBar-track{box-sizing:border-box;position:relative;overflow:hidden;flex:1 1 auto}.p-ScrollBar-thumb{box-sizing:border-box;position:absolute}");Re('.p-SplitPanel-child{z-index:0}.p-SplitPanel-handle{z-index:1}.p-SplitPanel-handle.p-mod-hidden{display:none!important}.p-SplitPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle{cursor:ew-resize}.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle{cursor:ns-resize}.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle:after{left:50%;min-width:8px;transform:translateX(-50%)}.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle:after{top:50%;min-height:8px;transform:translateY(-50%)}');Re(".p-TabBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-TabBar[data-orientation=horizontal]{flex-direction:row}.p-TabBar[data-orientation=vertical]{flex-direction:column}.p-TabBar-content{margin:0;padding:0;display:flex;flex:1 1 auto;list-style-type:none}.p-TabBar[data-orientation=horizontal]>.p-TabBar-content{flex-direction:row}.p-TabBar[data-orientation=vertical]>.p-TabBar-content{flex-direction:column}.p-TabBar-tab{display:flex;flex-direction:row;box-sizing:border-box;overflow:hidden}.p-TabBar-tabCloseIcon,.p-TabBar-tabIcon{flex:0 0 auto}.p-TabBar-tabLabel{flex:1 1 auto;overflow:hidden;white-space:nowrap}.p-TabBar-tab.p-mod-hidden{display:none!important}.p-TabBar.p-mod-dragging .p-TabBar-tab{position:relative}.p-TabBar.p-mod-dragging[data-orientation=horizontal] .p-TabBar-tab{left:0;transition:left .15s ease}.p-TabBar.p-mod-dragging[data-orientation=vertical] .p-TabBar-tab{top:0;transition:top .15s ease}.p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging{transition:none}");Re(".p-TabPanel-tabBar{z-index:1}.p-TabPanel-stackedPanel{z-index:0}");Be.BoxPanel;var We=Be.CommandPalette,Ne=Be.ContextMenu,Fe=(Be.DockLayout,Be.DockPanel),He=(Be.Menu,Be.MenuBar,Be.SplitPanel),qe=(Be.TabBar,Be.TabPanel),Ve=Be.Widget,Ke=M.each,Ue=function(t,e){return(Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function Ye(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ue(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Xe=function(){return(Xe=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function Ge(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var Je,Ze;Ge(".phosphor_WidgetAdapter{border-left:1px solid silver;border-right:1px solid silver;border-bottom:1px solid silver;background:#fff;min-width:64px;min-height:64px}.phosphor_WidgetAdapter.p-DockPanel-widget{border-top:none;box-shadow:0 -1px 0 rgba(0,0,0,.2),1px 1px 2px rgba(0,0,0,.2)}.phosphor_WidgetAdapter.p-SplitPanel-child{border:none}"),Je=t.Msg||(t.Msg={}),Ze=function(t){function e(e){var n=t.call(this,"wa-activate-request")||this;return n._wa=e,n}return Ye(e,t),Object.defineProperty(e.prototype,"wa",{get:function(){return this._wa},enumerable:!1,configurable:!0}),e.prototype.conflate=function(t){return this._wa=t.wa,!0},e}(Vt),Je.WAActivateRequest=Ze;var Qe=function(n){function i(t,i,r,o,a){void 0===r&&(r={}),void 0===o&&(o=!1),void 0===a&&(a={});var s=n.call(this)||this;return s.lparam={},s.padding=0,s._width=0,s._height=0,s._owner=t,s._element=e.select(s.node),s.addClass("phosphor_WidgetAdapter"),s.title.label="",s.title.closable=!!o,s.title.caption="Long description for: "+name,s._ext=a,s._closable="boolean"==typeof o?{canClose:function(t,e){return o}}:o,i instanceof e.Widget?s._widget=i.target(s.node):s._widgetLayout=i,s.lparam=r,s}return Ye(i,n),Object.defineProperty(i.prototype,"widget",{get:function(){return this._widget},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"inputNode",{get:function(){return this.node.getElementsByTagName("input")[0]},enumerable:!1,configurable:!0}),i.prototype.resizeAndRender=function(){this._widget&&(e.select(this.node).style("padding",this.padding+"px").style("width",this._width+"px").style("height",this._height+"px").style("overflow-x",this._ext.overflowX).style("overflow-y",this._ext.overflowY),this._widget.resize({width:this._width-2*this.padding-2,height:this._height-2*this.padding-2}).lazyRender())},i.prototype.onActivateRequest=function(e){n.prototype.onActivateRequest.call(this,e),this._widget&&this.resizeAndRender(),this._owner&&Kt.postMessage(this._owner,new t.Msg.WAActivateRequest(this))},i.prototype.onResize=function(t){n.prototype.onResize.call(this,t),this.node&&null!==this.node.offsetParent&&t.width>=0&&t.height>=0?(this._width=t.width,this._height=t.height,this.resizeAndRender()):this._widgetLayout},i.prototype.onCloseRequest=function(t){this._closable.canClose(this._widget,this)&&this.dispose()},i}(Ve),$e=function(t){function e(e){return t.apply(this,e)||this}return Ye(e,t),e.create=function(){return Object.create(e.prototype)},e.prototype.watchRendered=function(t,e){if(e)var n=this.map(function(t){return{wa:t,w:t.widget,rc:t.widget.renderCount()}}),i=setInterval(function(){(function(){for(var t=0,e=n;t<e.length;t++){var i=e[t];if(i.wa.isVisible&&i.rc>=i.w.renderCount())return!1}return!0})()&&(clearInterval(i),e(t))},20)},e}(Array),tn=function(t){function e(){return t.call(this)||this}return Ye(e,t),e.prototype.createTabBar=function(){var e=t.prototype.createTabBar.call(this);return e.tabsMovable=this._owner.tabsMovable,e},e}(Fe.Renderer),en=function(t){function e(e){void 0===e&&(e={});var n=this;return e.renderer=e.renderer||new tn,(n=t.call(this,e)||this)._renderer instanceof tn&&(n._renderer._owner=n),n._tabsMovable=!0,n._content=$e.create(),n._contentMap={},n}return Ye(e,t),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(t){this._tabsMovable=t,Ke(this.tabBars(),function(e){return e.tabsMovable=t})},enumerable:!1,configurable:!0}),e.prototype.appendContent=function(t){this._content.push(t),this._contentMap[t.widget.id()]=t},e.prototype.removeContent=function(t){var e=this._content.indexOf(t);e>=0&&this._content.splice(e,1),delete this._contentMap[t.widget.id()],t.dispose()},e.prototype.content=function(){return this._content},e.prototype.serializeWidget=function(t){if(t instanceof Qe)try{return{__id:t.widget.id()}}catch(t){return{exception:{message:t.message,stack:t.stack}}}return null},e.prototype.deserializeWidget=function(t){var e=this._contentMap[t.__id];return e||(e=new Qe(void 0,t)),e},e.prototype.serializeITabAreaConfig=function(t,e){var n=this;return Xe(Xe({},t),{widgets:t.widgets.map(function(t){return e?n.deserializeWidget(t):n.serializeWidget(t)})})},e.prototype.serializeISplitAreaConfig=function(t,e){var n=this;return Xe(Xe({},t),{children:t.children.map(function(t){return n.serializeAreaConfig(t,e)})})},e.prototype.serializeAreaConfig=function(t,e){if(t)switch(t.type){case"tab-area":return this.serializeITabAreaConfig(t,e);case"split-area":return this.serializeISplitAreaConfig(t,e)}},e.prototype.saveLayout=function(){return{main:this.serializeAreaConfig(t.prototype.saveLayout.call(this).main,!1)}},e.prototype.restoreLayout=function(e){return t.prototype.restoreLayout.call(this,{main:this.serializeAreaConfig(e.main,!0)})},e}(Fe);Ge('.p-DockPanel-overlay{background:hsla(0,0%,100%,.6);border:1px dashed #000;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.p-TabBar{min-height:24px;max-height:24px}.p-TabBar-content{min-width:0;min-height:0;align-items:flex-end}.p-TabPanel-tabBar .p-TabBar-content{border-bottom:1px solid silver}.p-TabBar-tab{padding:0 10px;background:#e5e5e5;border:1px solid silver;border-bottom:none;font:12px Helvetica,Arial,sans-serif;flex:0 1 125px;min-height:20px;max-height:20px;min-width:35px;margin-left:-1px;line-height:20px}.p-TabBar-tab.p-mod-current{background:#fff}.p-TabBar-tab:hover:not(.p-mod-current){background:#f0f0f0}.p-TabBar-tab:first-child{margin-left:0}.p-TabBar-tab.p-mod-current{min-height:23px;max-height:23px;transform:translateY(1px)}.p-TabBar-tabCloseIcon,.p-TabBar-tabIcon,.p-TabBar-tabLabel{display:inline-block}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon{margin-left:4px}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon:before{content:"\\f00d";font-family:FontAwesome}.p-TabBar-tab.p-mod-drag-image{min-height:23px;max-height:23px;min-width:125px;border:none;box-shadow:1px 1px 2px rgba(0,0,0,.3);transform:translateX(-40%) translateY(-58%)}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide{min-height:1px!important;max-height:1px!important}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide .p-TabBar-tab.p-mod-current{display:none}');var nn=function(t){function n(){var e=t.call(this)||this;return e._dock=new en({mode:"multiple-document"}),e._layoutObj=null,e._tag="div",e._dock.id="p"+e.id(),Kt.installMessageHook(e,e),e}return Ye(n,t),n.prototype.getWidgetAdapter=function(t){var e=null;return this._dock.content().some(function(n){return n.widget===t&&(e=n,!0)}),e},n.prototype.addWidget=function(t,e,n,i,r){void 0===n&&(n="split-right");var o={mode:n,ref:this.getWidgetAdapter(i)},a=new Qe(this,t,{},r);return a.title.label=e,a.padding=8,this._dock.addWidget(a,o),this._dock.appendContent(a),this._dock.tabsMovable=!0,this},n.prototype.removeWidget=function(t){var e=this.getWidgetAdapter(t);return e&&(t.target(null),this._dock.removeContent(e)),this},n.prototype.isVisible=function(t){return this.getWidgetAdapter(t).isVisible},n.prototype.widgetAdapters=function(){return this._dock.content()},n.prototype.widgets=function(){return this._dock.content().map(function(t){return t.widget})},n.prototype.layout=function(t){return arguments.length?(this._dock.restoreLayout(t),this):this._dock.saveLayout()},n.prototype.layoutObj=function(t){return this._layoutObj=t,this},n.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),this._pPlaceholder=n.append("div"),Ve.attach(this._dock,this._pPlaceholder.node())},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),this._pPlaceholder.style("width",this.width()+"px").style("height",this.height()+"px").style("overflow","auto"),n.select(".p-Widget").style("width",this._pPlaceholder.node().clientWidth+"px").style("height",this.height()+"px"),this.widgets().forEach(function(t){return t.render()})},n.prototype.exit=function(e,n){var i=this;(function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||e)})([],this.widgets()).forEach(function(t){return i.removeWidget(t)}),t.prototype.exit.call(this,e,n)},n.prototype.render=function(n){var i=this,r=this;return null!==this._layoutObj&&(this.layout(this._layoutObj),this.layoutObj(null)),t.prototype.render.call(this,function(t){i._dock.content().watchRendered(i,n),i._dock.update(),setTimeout(function(){var t=i.element().selectAll(".p-Widget.p-TabBar.p-DockPanel-tabBar"),n=!1;t.each(function(){var t=e.select(this),i=t.node().childNodes[0].childNodes.length,o=r.hideSingleTabs()&&1===i;o!==t.classed("hide")&&(t.classed("hide",o),n=!0)}),n&&i._dock.fit()},0)})},n.prototype.refit=function(){this._dock.fit()},n.prototype.messageHook=function(t,e){return t===this&&this.processMessage(e),!0},n.prototype.processMessage=function(t){switch(t.type){case"wa-activate-request":var e=t.wa,n=e.widget;this._prevActive!==n&&(this._prevActive=n,this.childActivation(n,e))}},n.prototype.childActivation=function(t,e){},n.prototype.active=function(){return this._prevActive},n}(e.HTMLWidget);nn.prototype._class+=" phosphor_DockPanel",nn.prototype.publish("hideSingleTabs",!1,"boolean");var rn=function(t){function e(e){void 0===e&&(e="vertical");var n=t.call(this)||this;return n.content=$e.create(),n._split=new He({orientation:e}),n._tag="div",n._split.id="p"+n.id(),n}return Ye(e,t),e.prototype.getWidgetAdapter=function(t){var e=null;return this.content.some(function(n){return n.widget===t&&(e=n,!0)}),e},e.prototype.addWidget=function(t){var e=new Qe(this,t);return this._split.addWidget(e),this.content.push(e),this},e.prototype.relativeSizes=function(t){return arguments.length?(this._split.setRelativeSizes(t),this):this._split.relativeSizes()},e.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),Ve.attach(this._split,e)},e.prototype.update=function(e,n){t.prototype.update.call(this,e,n),n.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.exit=function(e,n){t.prototype.exit.call(this,e,n)},e.prototype.render=function(e){var n=this;return t.prototype.render.call(this,function(t){n.content.watchRendered(n,e),n._split.update()})},e}(e.HTMLWidget);rn.prototype._class+=" phosphor_SplitPanel";var on=function(t){function e(){var e=t.call(this)||this;return e._tab=new qe({tabPlacement:"top"}),e.content=$e.create(),e._tag="div",e._tab.id="p"+e.id(),e}return Ye(e,t),e.prototype.getWidget=function(t){if(t instanceof Qe)return t.widget},e.prototype.getWidgetAdapter=function(t){var e=null;return this.content.some(function(n){return n.widget===t&&(e=n,!0)}),e},e.prototype.addWidget=function(t,e,n){void 0===n&&(n={}),this._prevActive||(this._prevActive=t);var i=new Qe(this,t,void 0,void 0,n);return i.title.label=e,i.padding=8,this._tab.addWidget(i),this.content.push(i),this},e.prototype.removeWidget=function(t){var e=this.getWidgetAdapter(t);if(e){var n=this.content.indexOf(e);n>=0&&this.content.splice(n,1),t.target(null),e.dispose()}return this},e.prototype.enter=function(e,n){t.prototype.enter.call(this,e,n),Ve.attach(this._tab,e)},e.prototype.update=function(e,n){t.prototype.update.call(this,e,n),n.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")},e.prototype.exit=function(e,n){t.prototype.exit.call(this,e,n)},e.prototype.render=function(e){var n=this;return t.prototype.render.call(this,function(t){n.content.watchRendered(n,e),n._tab.update()})},e.prototype.messageHook=function(t,e){return t===this&&this.processMessage(e),!0},e.prototype.processMessage=function(t){switch(t.type){case"wa-activate-request":var e=t.wa.widget;this._prevActive!==e&&(this._prevActive=e,this.childActivation(e))}},e.prototype.childActivation=function(t){},e.prototype.active=function(t){return arguments.length?(this._tab.currentWidget=this.getWidgetAdapter(t),this):this.getWidget(this._tab.currentWidget)},e}(e.HTMLWidget);on.prototype._class+=" phosphor_TabPanel",t.BUILD_VERSION="2.101.0",t.CommandPalette=We,t.CommandRegistry=xt,t.ContextMenu=Ne,t.DockPanel=nn,t.PKG_NAME="@hpcc-js/phosphor",t.PKG_VERSION="2.14.60",t.SplitPanel=rn,t.TabPanel=on,t.WidgetAdapter=Qe,t.WidgetAdapterArray=$e,Object.defineProperty(t,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=index.min.js.map