@hpcc-js/phosphor 3.2.8 → 3.2.10
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.js +15658 -8420
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -67
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +8 -8
- package/src/DockPanel.css +18 -18
- package/src/DockPanel.ts +2 -2
- package/src/SplitPanel.ts +1 -1
- package/src/TabPanel.ts +1 -1
- package/src/WidgetAdapter.css +3 -3
package/dist/index.umd.cjs
CHANGED
|
@@ -1,68 +1,3 @@
|
|
|
1
|
-
(function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@hpcc-js/common")):typeof define=="function"&&define.amd?define(["exports","@hpcc-js/common"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global["@hpcc-js/phosphor"]={},global["@hpcc-js/common"]))})(this,function(exports2,common){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);const PKG_NAME="@hpcc-js/phosphor",PKG_VERSION="3.1.0",BUILD_VERSION="3.2.1";var ArrayExt;(function(ArrayExt2){function firstIndexOf(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;stop<start?span=stop+1+(n-start):span=stop-start+1;for(var i=0;i<span;++i){var j=(start+i)%n;if(array[j]===value)return j}return-1}ArrayExt2.firstIndexOf=firstIndexOf;function lastIndexOf(array,value,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;start<stop?span=start+1+(n-stop):span=start-stop+1;for(var i=0;i<span;++i){var j=(start-i+n)%n;if(array[j]===value)return j}return-1}ArrayExt2.lastIndexOf=lastIndexOf;function findFirstIndex(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;stop<start?span=stop+1+(n-start):span=stop-start+1;for(var i=0;i<span;++i){var j=(start+i)%n;if(fn(array[j],j))return j}return-1}ArrayExt2.findFirstIndex=findFirstIndex;function findLastIndex(array,fn,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var d;start<stop?d=start+1+(n-stop):d=start-stop+1;for(var i=0;i<d;++i){var j=(start-i+n)%n;if(fn(array[j],j))return j}return-1}ArrayExt2.findLastIndex=findLastIndex;function findFirstValue(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var index=findFirstIndex(array,fn,start,stop);return index!==-1?array[index]:void 0}ArrayExt2.findFirstValue=findFirstValue;function findLastValue(array,fn,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var index=findLastIndex(array,fn,start,stop);return index!==-1?array[index]:void 0}ArrayExt2.findLastValue=findLastValue;function lowerBound(array,value,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var begin=start,span=stop-start+1;span>0;){var half=span>>1,middle=begin+half;fn(array[middle],value)<0?(begin=middle+1,span-=half+1):span=half}return begin}ArrayExt2.lowerBound=lowerBound;function upperBound(array,value,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var begin=start,span=stop-start+1;span>0;){var half=span>>1,middle=begin+half;fn(array[middle],value)>0?span=half:(begin=middle+1,span-=half+1)}return begin}ArrayExt2.upperBound=upperBound;function shallowEqual(a,b,fn){if(a===b)return!0;if(a.length!==b.length)return!1;for(var i=0,n=a.length;i<n;++i)if(fn?!fn(a[i],b[i]):a[i]!==b[i])return!1;return!0}ArrayExt2.shallowEqual=shallowEqual;function slice(array,options){options===void 0&&(options={});var start=options.start,stop=options.stop,step=options.step;if(step===void 0&&(step=1),step===0)throw new Error("Slice `step` cannot be zero.");var n=array.length;start===void 0?start=step<0?n-1:0:start<0?start=Math.max(start+n,step<0?-1:0):start>=n&&(start=step<0?n-1:n),stop===void 0?stop=step<0?-1:n:stop<0?stop=Math.max(stop+n,step<0?-1:0):stop>=n&&(stop=step<0?n-1:n);var length;step<0&&stop>=start||step>0&&start>=stop?length=0:step<0?length=Math.floor((stop-start+1)/step+1):length=Math.floor((stop-start-1)/step+1);for(var result=[],i=0;i<length;++i)result[i]=array[start+i*step];return result}ArrayExt2.slice=slice;function move(array,fromIndex,toIndex){var n=array.length;if(!(n<=1)&&(fromIndex<0?fromIndex=Math.max(0,fromIndex+n):fromIndex=Math.min(fromIndex,n-1),toIndex<0?toIndex=Math.max(0,toIndex+n):toIndex=Math.min(toIndex,n-1),fromIndex!==toIndex)){for(var value=array[fromIndex],d=fromIndex<toIndex?1:-1,i=fromIndex;i!==toIndex;i+=d)array[i]=array[i+d];array[toIndex]=value}}ArrayExt2.move=move;function reverse(array,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(!(n<=1))for(start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);start<stop;){var a=array[start],b=array[stop];array[start++]=b,array[stop--]=a}}ArrayExt2.reverse=reverse;function rotate(array,delta,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(!(n<=1)&&(start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1),!(start>=stop))){var length=stop-start+1;if(delta>0?delta=delta%length:delta<0&&(delta=(delta%length+length)%length),delta!==0){var pivot=start+delta;reverse(array,start,pivot-1),reverse(array,pivot,stop),reverse(array,start,stop)}}}ArrayExt2.rotate=rotate;function fill(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n!==0){start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;stop<start?span=stop+1+(n-start):span=stop-start+1;for(var i=0;i<span;++i)array[(start+i)%n]=value}}ArrayExt2.fill=fill;function insert(array,index,value){var n=array.length;index<0?index=Math.max(0,index+n):index=Math.min(index,n);for(var i=n;i>index;--i)array[i]=array[i-1];array[index]=value}ArrayExt2.insert=insert;function removeAt(array,index){var n=array.length;if(index<0&&(index+=n),!(index<0||index>=n)){for(var value=array[index],i=index+1;i<n;++i)array[i-1]=array[i];return array.length=n-1,value}}ArrayExt2.removeAt=removeAt;function removeFirstOf(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var index=firstIndexOf(array,value,start,stop);return index!==-1&&removeAt(array,index),index}ArrayExt2.removeFirstOf=removeFirstOf;function removeLastOf(array,value,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var index=lastIndexOf(array,value,start,stop);return index!==-1&&removeAt(array,index),index}ArrayExt2.removeLastOf=removeLastOf;function removeAllOf(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var count=0,i=0;i<n;++i)start<=stop&&i>=start&&i<=stop&&array[i]===value||stop<start&&(i<=stop||i>=start)&&array[i]===value?count++:count>0&&(array[i-count]=array[i]);return count>0&&(array.length=n-count),count}ArrayExt2.removeAllOf=removeAllOf;function removeFirstWhere(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var value,index=findFirstIndex(array,fn,start,stop);return index!==-1&&(value=removeAt(array,index)),{index,value}}ArrayExt2.removeFirstWhere=removeFirstWhere;function removeLastWhere(array,fn,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var value,index=findLastIndex(array,fn,start,stop);return index!==-1&&(value=removeAt(array,index)),{index,value}}ArrayExt2.removeLastWhere=removeLastWhere;function removeAllWhere(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var count=0,i=0;i<n;++i)start<=stop&&i>=start&&i<=stop&&fn(array[i],i)||stop<start&&(i<=stop||i>=start)&&fn(array[i],i)?count++:count>0&&(array[i-count]=array[i]);return count>0&&(array.length=n-count),count}ArrayExt2.removeAllWhere=removeAllWhere})(ArrayExt||(ArrayExt={}));function iter(object){var it;return typeof object.iter=="function"?it=object.iter():it=new ArrayIterator(object),it}function each(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(fn(value,index++)===!1)return}function every(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(!fn(value,index++))return!1;return!0}function some(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(fn(value,index++))return!0;return!1}function toArray(object){for(var index=0,result=[],it=iter(object),value;(value=it.next())!==void 0;)result[index++]=value;return result}var ArrayIterator=function(){function ArrayIterator2(source){this._index=0,this._source=source}return ArrayIterator2.prototype.iter=function(){return this},ArrayIterator2.prototype.clone=function(){var result=new ArrayIterator2(this._source);return result._index=this._index,result},ArrayIterator2.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},ArrayIterator2}();function chain(){for(var objects=[],_i=0;_i<arguments.length;_i++)objects[_i]=arguments[_i];return new ChainIterator(iter(objects.map(iter)))}var ChainIterator=function(){function ChainIterator2(source){this._cloned=!1,this._source=source,this._active=void 0}return ChainIterator2.prototype.iter=function(){return this},ChainIterator2.prototype.clone=function(){var result=new ChainIterator2(this._source.clone());return result._active=this._active&&this._active.clone(),result._cloned=!0,this._cloned=!0,result},ChainIterator2.prototype.next=function(){if(this._active===void 0){var active=this._source.next();if(active===void 0)return;this._active=this._cloned?active.clone():active}var value=this._active.next();return value!==void 0?value:(this._active=void 0,this.next())},ChainIterator2}();function empty(){return new EmptyIterator}var EmptyIterator=function(){function EmptyIterator2(){}return EmptyIterator2.prototype.iter=function(){return this},EmptyIterator2.prototype.clone=function(){return new EmptyIterator2},EmptyIterator2.prototype.next=function(){},EmptyIterator2}();function filter(object,fn){return new FilterIterator(iter(object),fn)}var FilterIterator=function(){function FilterIterator2(source,fn){this._index=0,this._source=source,this._fn=fn}return FilterIterator2.prototype.iter=function(){return this},FilterIterator2.prototype.clone=function(){var result=new FilterIterator2(this._source.clone(),this._fn);return result._index=this._index,result},FilterIterator2.prototype.next=function(){for(var fn=this._fn,it=this._source,value;(value=it.next())!==void 0;)if(fn(value,this._index++))return value},FilterIterator2}();function find(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(fn(value,index++))return value}function max(object,fn){var it=iter(object),value=it.next();if(value!==void 0){for(var result=value;(value=it.next())!==void 0;)fn(value,result)>0&&(result=value);return result}}function map(object,fn){return new MapIterator(iter(object),fn)}var MapIterator=function(){function MapIterator2(source,fn){this._index=0,this._source=source,this._fn=fn}return MapIterator2.prototype.iter=function(){return this},MapIterator2.prototype.clone=function(){var result=new MapIterator2(this._source.clone(),this._fn);return result._index=this._index,result},MapIterator2.prototype.next=function(){var value=this._source.next();if(value!==void 0)return this._fn.call(void 0,value,this._index++)},MapIterator2}(),Private$s;(function(Private2){function rangeLength(start,stop,step){return step===0?1/0:start>stop&&step>0||start<stop&&step<0?0:Math.ceil((stop-start)/step)}Private2.rangeLength=rangeLength})(Private$s||(Private$s={}));function reduce(object,fn,initial){var index=0,it=iter(object),first=it.next();if(first===void 0)return initial;var second=it.next();if(second===void 0)return fn(initial,first,index++);var accumulator;accumulator=fn(fn(initial,first,index++),second,index++);for(var next;(next=it.next())!==void 0;)accumulator=fn(accumulator,next,index++);return accumulator}function once(value){return new RepeatIterator(value,1)}var RepeatIterator=function(){function RepeatIterator2(value,count){this._value=value,this._count=count}return RepeatIterator2.prototype.iter=function(){return this},RepeatIterator2.prototype.clone=function(){return new RepeatIterator2(this._value,this._count)},RepeatIterator2.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},RepeatIterator2}();function retro(object){var it;return typeof object.retro=="function"?it=object.retro():it=new RetroArrayIterator(object),it}var RetroArrayIterator=function(){function RetroArrayIterator2(source){this._source=source,this._index=source.length-1}return RetroArrayIterator2.prototype.iter=function(){return this},RetroArrayIterator2.prototype.clone=function(){var result=new RetroArrayIterator2(this._source);return result._index=this._index,result},RetroArrayIterator2.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},RetroArrayIterator2}(),StringExt;(function(StringExt2){function findIndices(source,query,start){start===void 0&&(start=0);for(var indices=new Array(query.length),i=0,j=start,n=query.length;i<n;++i,++j){if(j=source.indexOf(query[i],j),j===-1)return null;indices[i]=j}return indices}StringExt2.findIndices=findIndices;function matchSumOfSquares(source,query,start){start===void 0&&(start=0);var indices=findIndices(source,query,start);if(!indices)return null;for(var score=0,i=0,n=indices.length;i<n;++i){var j=indices[i]-start;score+=j*j}return{score,indices}}StringExt2.matchSumOfSquares=matchSumOfSquares;function matchSumOfDeltas(source,query,start){start===void 0&&(start=0);var indices=findIndices(source,query,start);if(!indices)return null;for(var score=0,last=start-1,i=0,n=indices.length;i<n;++i){var j=indices[i];score+=j-last-1,last=j}return{score,indices}}StringExt2.matchSumOfDeltas=matchSumOfDeltas;function highlight(source,indices,fn){for(var result=[],k=0,last=0,n=indices.length;k<n;){for(var i=indices[k],j=indices[k];++k<n&&indices[k]===j+1;)j++;last<i&&result.push(source.slice(last,i)),i<j+1&&result.push(fn(source.slice(i,j+1))),last=j+1}return last<source.length&&result.push(source.slice(last)),result}StringExt2.highlight=highlight;function cmp(a,b){return a<b?-1:a>b?1:0}StringExt2.cmp=cmp})(StringExt||(StringExt={}));var JSONExt;(function(JSONExt2){JSONExt2.emptyObject=Object.freeze({}),JSONExt2.emptyArray=Object.freeze([]);function isPrimitive(value){return value===null||typeof value=="boolean"||typeof value=="number"||typeof value=="string"}JSONExt2.isPrimitive=isPrimitive;function isArray(value){return Array.isArray(value)}JSONExt2.isArray=isArray;function isObject(value){return!isPrimitive(value)&&!isArray(value)}JSONExt2.isObject=isObject;function deepEqual(first,second){if(first===second)return!0;if(isPrimitive(first)||isPrimitive(second))return!1;var a1=isArray(first),a2=isArray(second);return a1!==a2?!1:a1&&a2?deepArrayEqual(first,second):deepObjectEqual(first,second)}JSONExt2.deepEqual=deepEqual;function deepCopy(value){return isPrimitive(value)?value:isArray(value)?deepArrayCopy(value):deepObjectCopy(value)}JSONExt2.deepCopy=deepCopy;function deepArrayEqual(first,second){if(first===second)return!0;if(first.length!==second.length)return!1;for(var i=0,n=first.length;i<n;++i)if(!deepEqual(first[i],second[i]))return!1;return!0}function deepObjectEqual(first,second){if(first===second)return!0;for(var key in first)if(first[key]!==void 0&&!(key in second))return!1;for(var key in second)if(second[key]!==void 0&&!(key in first))return!1;for(var key in first){var firstValue=first[key],secondValue=second[key];if(!(firstValue===void 0&&secondValue===void 0)&&(firstValue===void 0||secondValue===void 0||!deepEqual(firstValue,secondValue)))return!1}return!0}function deepArrayCopy(value){for(var result=new Array(value.length),i=0,n=value.length;i<n;++i)result[i]=deepCopy(value[i]);return result}function deepObjectCopy(value){var result={};for(var key in value){var subvalue=value[key];subvalue!==void 0&&(result[key]=deepCopy(subvalue))}return result}})(JSONExt||(JSONExt={}));var MimeData=function(){function MimeData2(){this._types=[],this._values=[]}return MimeData2.prototype.types=function(){return this._types.slice()},MimeData2.prototype.hasData=function(mime){return this._types.indexOf(mime)!==-1},MimeData2.prototype.getData=function(mime){var i=this._types.indexOf(mime);return i!==-1?this._values[i]:void 0},MimeData2.prototype.setData=function(mime,data){this.clearData(mime),this._types.push(mime),this._values.push(data)},MimeData2.prototype.clearData=function(mime){var i=this._types.indexOf(mime);i!==-1&&(this._types.splice(i,1),this._values.splice(i,1))},MimeData2.prototype.clear=function(){this._types.length=0,this._values.length=0},MimeData2}();function fallbackRandomValues(buffer){for(var value=0,i=0,n=buffer.length;i<n;++i)i%4===0&&(value=Math.random()*4294967295>>>0),buffer[i]=value&255,value>>>=8}var Random;(function(Random2){Random2.getRandomValues=function(){var crypto=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return crypto&&typeof crypto.getRandomValues=="function"?function(buffer){return crypto.getRandomValues(buffer)}:fallbackRandomValues}()})(Random||(Random={}));function uuid4Factory(getRandomValues){for(var bytes=new Uint8Array(16),lut=new Array(256),i=0;i<16;++i)lut[i]="0"+i.toString(16);for(var i=16;i<256;++i)lut[i]=i.toString(16);return function(){return getRandomValues(bytes),bytes[6]=64|bytes[6]&15,bytes[8]=128|bytes[8]&63,lut[bytes[0]]+lut[bytes[1]]+lut[bytes[2]]+lut[bytes[3]]+"-"+lut[bytes[4]]+lut[bytes[5]]+"-"+lut[bytes[6]]+lut[bytes[7]]+"-"+lut[bytes[8]]+lut[bytes[9]]+"-"+lut[bytes[10]]+lut[bytes[11]]+lut[bytes[12]]+lut[bytes[13]]+lut[bytes[14]]+lut[bytes[15]]}}var UUID;(function(UUID2){UUID2.uuid4=uuid4Factory(Random.getRandomValues)})(UUID||(UUID={}));var AttachedProperty=function(){function AttachedProperty2(options){this._pid=Private$r.nextPID(),this.name=options.name,this._create=options.create,this._coerce=options.coerce||null,this._compare=options.compare||null,this._changed=options.changed||null}return AttachedProperty2.prototype.get=function(owner){var value,map2=Private$r.ensureMap(owner);return this._pid in map2?value=map2[this._pid]:value=map2[this._pid]=this._createValue(owner),value},AttachedProperty2.prototype.set=function(owner,value){var oldValue,map2=Private$r.ensureMap(owner);this._pid in map2?oldValue=map2[this._pid]:oldValue=map2[this._pid]=this._createValue(owner);var newValue=this._coerceValue(owner,value);this._maybeNotify(owner,oldValue,map2[this._pid]=newValue)},AttachedProperty2.prototype.coerce=function(owner){var oldValue,map2=Private$r.ensureMap(owner);this._pid in map2?oldValue=map2[this._pid]:oldValue=map2[this._pid]=this._createValue(owner);var newValue=this._coerceValue(owner,oldValue);this._maybeNotify(owner,oldValue,map2[this._pid]=newValue)},AttachedProperty2.prototype._createValue=function(owner){var create=this._create;return create(owner)},AttachedProperty2.prototype._coerceValue=function(owner,value){var coerce=this._coerce;return coerce?coerce(owner,value):value},AttachedProperty2.prototype._compareValue=function(oldValue,newValue){var compare=this._compare;return compare?compare(oldValue,newValue):oldValue===newValue},AttachedProperty2.prototype._maybeNotify=function(owner,oldValue,newValue){var changed=this._changed;changed&&!this._compareValue(oldValue,newValue)&&changed(owner,oldValue,newValue)},AttachedProperty2}();(function(AttachedProperty2){function clearData(owner){Private$r.ownerData.delete(owner)}AttachedProperty2.clearData=clearData})(AttachedProperty||(AttachedProperty={}));var Private$r;(function(Private2){Private2.ownerData=new WeakMap,Private2.nextPID=function(){var id=0;return function(){var rand=Math.random(),stem=(""+rand).slice(2);return"pid-"+stem+"-"+id++}}();function ensureMap(owner){var map2=Private2.ownerData.get(owner);return map2||(map2=Object.create(null),Private2.ownerData.set(owner,map2),map2)}Private2.ensureMap=ensureMap})(Private$r||(Private$r={}));var Signal=function(){function Signal2(sender){this._blockedCount=0,this.sender=sender}return Signal2.prototype.block=function(fn){this._blockedCount++;try{fn()}finally{this._blockedCount--}},Signal2.prototype.connect=function(slot,thisArg){return Private$q.connect(this,slot,thisArg)},Signal2.prototype.disconnect=function(slot,thisArg){return Private$q.disconnect(this,slot,thisArg)},Signal2.prototype.emit=function(args){this._blockedCount||Private$q.emit(this,args)},Signal2}();(function(Signal2){function blockAll(sender,fn){var blockedProperty=Private$q.blockedProperty;blockedProperty.set(sender,blockedProperty.get(sender)+1);try{fn()}finally{blockedProperty.set(sender,blockedProperty.get(sender)-1)}}Signal2.blockAll=blockAll;function disconnectBetween(sender,receiver){Private$q.disconnectBetween(sender,receiver)}Signal2.disconnectBetween=disconnectBetween;function disconnectSender(sender){Private$q.disconnectSender(sender)}Signal2.disconnectSender=disconnectSender;function disconnectReceiver(receiver){Private$q.disconnectReceiver(receiver)}Signal2.disconnectReceiver=disconnectReceiver;function disconnectAll(object){Private$q.disconnectAll(object)}Signal2.disconnectAll=disconnectAll;function clearData(object){Private$q.disconnectAll(object)}Signal2.clearData=clearData;function getExceptionHandler(){return Private$q.exceptionHandler}Signal2.getExceptionHandler=getExceptionHandler;function setExceptionHandler(handler){var old=Private$q.exceptionHandler;return Private$q.exceptionHandler=handler,old}Signal2.setExceptionHandler=setExceptionHandler})(Signal||(Signal={}));var Private$q;(function(Private2){Private2.exceptionHandler=function(err){console.error(err)};function connect(signal,slot,thisArg){thisArg=thisArg||void 0;var receivers=receiversForSender.get(signal.sender);if(receivers||(receivers=[],receiversForSender.set(signal.sender,receivers)),findConnection(receivers,signal,slot,thisArg))return!1;var receiver=thisArg||slot,senders=sendersForReceiver.get(receiver);senders||(senders=[],sendersForReceiver.set(receiver,senders));var connection={signal,slot,thisArg};return receivers.push(connection),senders.push(connection),!0}Private2.connect=connect;function disconnect(signal,slot,thisArg){thisArg=thisArg||void 0;var receivers=receiversForSender.get(signal.sender);if(!receivers||receivers.length===0)return!1;var connection=findConnection(receivers,signal,slot,thisArg);if(!connection)return!1;var receiver=thisArg||slot,senders=sendersForReceiver.get(receiver);return connection.signal=null,scheduleCleanup(receivers),scheduleCleanup(senders),!0}Private2.disconnect=disconnect;function disconnectBetween(sender,receiver){var receivers=receiversForSender.get(sender);if(!(!receivers||receivers.length===0)){var senders=sendersForReceiver.get(receiver);!senders||senders.length===0||(each(senders,function(connection){connection.signal&&connection.signal.sender===sender&&(connection.signal=null)}),scheduleCleanup(receivers),scheduleCleanup(senders))}}Private2.disconnectBetween=disconnectBetween;function disconnectSender(sender){var receivers=receiversForSender.get(sender);!receivers||receivers.length===0||(each(receivers,function(connection){if(connection.signal){var receiver=connection.thisArg||connection.slot;connection.signal=null,scheduleCleanup(sendersForReceiver.get(receiver))}}),scheduleCleanup(receivers))}Private2.disconnectSender=disconnectSender;function disconnectReceiver(receiver){var senders=sendersForReceiver.get(receiver);!senders||senders.length===0||(each(senders,function(connection){if(connection.signal){var sender=connection.signal.sender;connection.signal=null,scheduleCleanup(receiversForSender.get(sender))}}),scheduleCleanup(senders))}Private2.disconnectReceiver=disconnectReceiver;function disconnectAll(object){disconnectSender(object),disconnectReceiver(object)}Private2.disconnectAll=disconnectAll;function emit(signal,args){if(!(Private2.blockedProperty.get(signal.sender)>0)){var receivers=receiversForSender.get(signal.sender);if(!(!receivers||receivers.length===0))for(var i=0,n=receivers.length;i<n;++i){var connection=receivers[i];connection.signal===signal&&invokeSlot(connection,args)}}}Private2.emit=emit;var receiversForSender=new WeakMap,sendersForReceiver=new WeakMap,dirtySet=new Set,schedule=function(){var ok=typeof requestAnimationFrame=="function";return ok?requestAnimationFrame:setImmediate}();function findConnection(connections,signal,slot,thisArg){return find(connections,function(connection){return connection.signal===signal&&connection.slot===slot&&connection.thisArg===thisArg})}function invokeSlot(connection,args){var signal=connection.signal,slot=connection.slot,thisArg=connection.thisArg;try{slot.call(thisArg,signal.sender,args)}catch(err){Private2.exceptionHandler(err)}}function scheduleCleanup(array){dirtySet.size===0&&schedule(cleanupDirtySet),dirtySet.add(array)}function cleanupDirtySet(){dirtySet.forEach(cleanupConnections),dirtySet.clear()}function cleanupConnections(connections){ArrayExt.removeAllWhere(connections,isDeadConnection)}function isDeadConnection(connection){return connection.signal===null}Private2.blockedProperty=new AttachedProperty({name:"blocked",create:function(){return 0}})})(Private$q||(Private$q={}));/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */var extendStatics$3=function(d,b){return extendStatics$3=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics$3(d,b)};function __extends$3(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics$3(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var DisposableDelegate=function(){function DisposableDelegate2(fn){this._fn=fn}return Object.defineProperty(DisposableDelegate2.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),DisposableDelegate2.prototype.dispose=function(){if(this._fn){var fn=this._fn;this._fn=null,fn()}},DisposableDelegate2}();(function(_super){__extends$3(ObservableDisposableDelegate,_super);function ObservableDisposableDelegate(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._disposed=new Signal(_this),_this}return Object.defineProperty(ObservableDisposableDelegate.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),ObservableDisposableDelegate.prototype.dispose=function(){this.isDisposed||(_super.prototype.dispose.call(this),this._disposed.emit(void 0),Signal.clearData(this))},ObservableDisposableDelegate})(DisposableDelegate);var DisposableSet=function(){function DisposableSet2(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(DisposableSet2.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),DisposableSet2.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(item){item.dispose()}),this._items.clear())},DisposableSet2.prototype.contains=function(item){return this._items.has(item)},DisposableSet2.prototype.add=function(item){this._items.add(item)},DisposableSet2.prototype.remove=function(item){this._items.delete(item)},DisposableSet2.prototype.clear=function(){this._items.clear()},DisposableSet2}();(function(DisposableSet2){function from(items){var set=new DisposableSet2;return each(items,function(item){set.add(item)}),set}DisposableSet2.from=from})(DisposableSet||(DisposableSet={}));var ObservableDisposableSet=function(_super){__extends$3(ObservableDisposableSet2,_super);function ObservableDisposableSet2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._disposed=new Signal(_this),_this}return Object.defineProperty(ObservableDisposableSet2.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),ObservableDisposableSet2.prototype.dispose=function(){this.isDisposed||(_super.prototype.dispose.call(this),this._disposed.emit(void 0),Signal.clearData(this))},ObservableDisposableSet2}(DisposableSet);(function(ObservableDisposableSet2){function from(items){var set=new ObservableDisposableSet2;return each(items,function(item){set.add(item)}),set}ObservableDisposableSet2.from=from})(ObservableDisposableSet||(ObservableDisposableSet={}));var ClipboardExt;(function(ClipboardExt2){function copyText(text){var body=document.body,handler=function(event){event.preventDefault(),event.stopPropagation(),event.clipboardData.setData("text",text),body.removeEventListener("copy",handler,!0)};body.addEventListener("copy",handler,!0),document.execCommand("copy")}ClipboardExt2.copyText=copyText})(ClipboardExt||(ClipboardExt={}));var ElementExt;(function(ElementExt2){function boxSizing(element){var style=window.getComputedStyle(element),bt=parseFloat(style.borderTopWidth)||0,bl=parseFloat(style.borderLeftWidth)||0,br=parseFloat(style.borderRightWidth)||0,bb=parseFloat(style.borderBottomWidth)||0,pt=parseFloat(style.paddingTop)||0,pl=parseFloat(style.paddingLeft)||0,pr=parseFloat(style.paddingRight)||0,pb=parseFloat(style.paddingBottom)||0,hs=bl+pl+pr+br,vs=bt+pt+pb+bb;return{borderTop:bt,borderLeft:bl,borderRight:br,borderBottom:bb,paddingTop:pt,paddingLeft:pl,paddingRight:pr,paddingBottom:pb,horizontalSum:hs,verticalSum:vs}}ElementExt2.boxSizing=boxSizing;function sizeLimits(element){var style=window.getComputedStyle(element),minWidth=parseFloat(style.minWidth)||0,minHeight=parseFloat(style.minHeight)||0,maxWidth=parseFloat(style.maxWidth)||1/0,maxHeight=parseFloat(style.maxHeight)||1/0;return maxWidth=Math.max(minWidth,maxWidth),maxHeight=Math.max(minHeight,maxHeight),{minWidth,minHeight,maxWidth,maxHeight}}ElementExt2.sizeLimits=sizeLimits;function hitTest(element,clientX,clientY){var rect=element.getBoundingClientRect();return clientX>=rect.left&&clientX<rect.right&&clientY>=rect.top&&clientY<rect.bottom}ElementExt2.hitTest=hitTest;function scrollIntoViewIfNeeded(area,element){var ar=area.getBoundingClientRect(),er=element.getBoundingClientRect();if(!(er.top<=ar.top&&er.bottom>=ar.bottom)){if(er.top<ar.top&&er.height<=ar.height){area.scrollTop-=ar.top-er.top;return}if(er.bottom>ar.bottom&&er.height>=ar.height){area.scrollTop-=ar.top-er.top;return}if(er.top<ar.top&&er.height>ar.height){area.scrollTop-=ar.bottom-er.bottom;return}if(er.bottom>ar.bottom&&er.height<ar.height){area.scrollTop-=ar.bottom-er.bottom;return}}}ElementExt2.scrollIntoViewIfNeeded=scrollIntoViewIfNeeded})(ElementExt||(ElementExt={}));var Platform;(function(Platform2){Platform2.IS_MAC=!!navigator.platform.match(/Mac/i),Platform2.IS_WIN=!!navigator.platform.match(/Win/i),Platform2.IS_IE=/Trident/.test(navigator.userAgent),Platform2.IS_EDGE=/Edge/.test(navigator.userAgent);function accelKey(event){return Platform2.IS_MAC?event.metaKey:event.ctrlKey}Platform2.accelKey=accelKey})(Platform||(Platform={}));var Selector;(function(Selector2){function calculateSpecificity(selector){if(selector in Private$p.specificityCache)return Private$p.specificityCache[selector];var result=Private$p.calculateSingle(selector);return Private$p.specificityCache[selector]=result}Selector2.calculateSpecificity=calculateSpecificity;function isValid(selector){if(selector in Private$p.validityCache)return Private$p.validityCache[selector];var result=!0;try{Private$p.testElem.querySelector(selector)}catch{result=!1}return Private$p.validityCache[selector]=result}Selector2.isValid=isValid;function matches(element,selector){return Private$p.protoMatchFunc.call(element,selector)}Selector2.matches=matches})(Selector||(Selector={}));var Private$p;(function(Private2){Private2.specificityCache=Object.create(null),Private2.validityCache=Object.create(null),Private2.testElem=document.createElement("div"),Private2.protoMatchFunc=function(){var proto=Element.prototype;return proto.matches||proto.matchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector||proto.webkitMatchesSelector||function(selector){var elem=this,matches=elem.ownerDocument?elem.ownerDocument.querySelectorAll(selector):[];return Array.prototype.indexOf.call(matches,elem)!==-1}}();function calculateSingle(selector){selector=selector.split(",",1)[0];var a=0,b=0,c=0;function match(re){var match2=selector.match(re);return match2===null?!1:(selector=selector.slice(match2[0].length),!0)}for(selector=selector.replace(NEGATION_RE," $1 ");selector.length>0;){if(match(ID_RE)){a++;continue}if(match(CLASS_RE)){b++;continue}if(match(ATTR_RE)){b++;continue}if(match(PSEUDO_ELEM_RE)){c++;continue}if(match(PSEDUO_CLASS_RE)){b++;continue}if(match(TYPE_RE)){c++;continue}if(!match(IGNORE_RE))return 0}return a=Math.min(a,255),b=Math.min(b,255),c=Math.min(c,255),a<<16|b<<8|c}Private2.calculateSingle=calculateSingle;var ID_RE=/^#[^\s\+>~#\.\[:]+/,CLASS_RE=/^\.[^\s\+>~#\.\[:]+/,ATTR_RE=/^\[[^\]]+\]/,TYPE_RE=/^[^\s\+>~#\.\[:]+/,PSEUDO_ELEM_RE=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,PSEDUO_CLASS_RE=/^:[^\s\+>~#\.\[:]+/,IGNORE_RE=/^[\s\+>~\*]+/,NEGATION_RE=/:not\(([^\)]+)\)/g})(Private$p||(Private$p={}));function getKeyboardLayout(){return Private$o.keyboardLayout}var KeycodeLayout=function(){function KeycodeLayout2(name2,codes,modifierKeys){modifierKeys===void 0&&(modifierKeys=[]),this.name=name2,this._codes=codes,this._keys=KeycodeLayout2.extractKeys(codes),this._modifierKeys=KeycodeLayout2.convertToKeySet(modifierKeys)}return KeycodeLayout2.prototype.keys=function(){return Object.keys(this._keys)},KeycodeLayout2.prototype.isValidKey=function(key){return key in this._keys},KeycodeLayout2.prototype.isModifierKey=function(key){return key in this._modifierKeys},KeycodeLayout2.prototype.keyForKeydownEvent=function(event){return this._codes[event.keyCode]||""},KeycodeLayout2}();(function(KeycodeLayout2){function extractKeys(codes){var keys=Object.create(null);for(var c in codes)keys[codes[c]]=!0;return keys}KeycodeLayout2.extractKeys=extractKeys;function convertToKeySet(keys){for(var keySet=Object(null),i=0,n=keys.length;i<n;++i)keySet[keys[i]]=!0;return keySet}KeycodeLayout2.convertToKeySet=convertToKeySet})(KeycodeLayout||(KeycodeLayout={}));var EN_US=new KeycodeLayout("en-us",{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",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",91:"Meta",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:"'",224:"Meta"},["Shift","Ctrl","Alt","Meta"]),Private$o;(function(Private2){Private2.keyboardLayout=EN_US})(Private$o||(Private$o={}));/*! *****************************************************************************
|
|
15
|
-
Copyright (c) Microsoft Corporation.
|
|
16
|
-
|
|
17
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
18
|
-
purpose with or without fee is hereby granted.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
21
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
22
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
23
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
24
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
25
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
26
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
27
|
-
***************************************************************************** */var __assign$1=function(){return __assign$1=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign$1.apply(this,arguments)};exports2.CommandRegistry=function(){function CommandRegistry(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=Object.create(null),this._commandChanged=new Signal(this),this._commandExecuted=new Signal(this),this._keyBindingChanged=new Signal(this)}return Object.defineProperty(CommandRegistry.prototype,"commandChanged",{get:function(){return this._commandChanged},enumerable:!0,configurable:!0}),Object.defineProperty(CommandRegistry.prototype,"commandExecuted",{get:function(){return this._commandExecuted},enumerable:!0,configurable:!0}),Object.defineProperty(CommandRegistry.prototype,"keyBindingChanged",{get:function(){return this._keyBindingChanged},enumerable:!0,configurable:!0}),Object.defineProperty(CommandRegistry.prototype,"keyBindings",{get:function(){return this._keyBindings},enumerable:!0,configurable:!0}),CommandRegistry.prototype.listCommands=function(){return Object.keys(this._commands)},CommandRegistry.prototype.hasCommand=function(id){return id in this._commands},CommandRegistry.prototype.addCommand=function(id,options){var _this=this;if(id in this._commands)throw new Error("Command '"+id+"' already registered.");return this._commands[id]=Private$n.createCommand(options),this._commandChanged.emit({id,type:"added"}),new DisposableDelegate(function(){delete _this._commands[id],_this._commandChanged.emit({id,type:"removed"})})},CommandRegistry.prototype.notifyCommandChanged=function(id){if(id!==void 0&&!(id in this._commands))throw new Error("Command '"+id+"' is not registered.");this._commandChanged.emit({id,type:id?"changed":"many-changed"})},CommandRegistry.prototype.describedBy=function(id){var cmd=this._commands[id];return cmd?cmd.describedBy||{args:null}:{args:null}},CommandRegistry.prototype.label=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.label.call(void 0,args):""},CommandRegistry.prototype.mnemonic=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.mnemonic.call(void 0,args):-1},CommandRegistry.prototype.icon=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.icon.call(void 0,args):""},CommandRegistry.prototype.iconClass=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.iconClass.call(void 0,args):""},CommandRegistry.prototype.iconLabel=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.iconLabel.call(void 0,args):""},CommandRegistry.prototype.caption=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.caption.call(void 0,args):""},CommandRegistry.prototype.usage=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.usage.call(void 0,args):""},CommandRegistry.prototype.className=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.className.call(void 0,args):""},CommandRegistry.prototype.dataset=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.dataset.call(void 0,args):{}},CommandRegistry.prototype.isEnabled=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.isEnabled.call(void 0,args):!1},CommandRegistry.prototype.isToggled=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.isToggled.call(void 0,args):!1},CommandRegistry.prototype.isToggleable=function(id,args){var cmd=this._commands[id];return cmd?cmd.isToggleable:!1},CommandRegistry.prototype.isVisible=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.isVisible.call(void 0,args):!1},CommandRegistry.prototype.execute=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];if(!cmd)return Promise.reject(new Error("Command '"+id+"' not registered."));var value;try{value=cmd.execute.call(void 0,args)}catch(err){value=Promise.reject(err)}var result=Promise.resolve(value);return this._commandExecuted.emit({id,args,result}),result},CommandRegistry.prototype.addKeyBinding=function(options){var _this=this,binding=Private$n.createKeyBinding(options);return this._keyBindings.push(binding),this._keyBindingChanged.emit({binding,type:"added"}),new DisposableDelegate(function(){ArrayExt.removeFirstOf(_this._keyBindings,binding),_this._keyBindingChanged.emit({binding,type:"removed"})})},CommandRegistry.prototype.processKeydownEvent=function(event){if(!(this._replaying||CommandRegistry.isModifierKeyPressed(event))){var keystroke=CommandRegistry.keystrokeForKeydownEvent(event);if(!keystroke){this._replayKeydownEvents(),this._clearPendingState();return}this._keystrokes.push(keystroke);var _a=Private$n.matchKeyBinding(this._keyBindings,this._keystrokes,event),exact=_a.exact,partial=_a.partial;if(!exact&&!partial){this._replayKeydownEvents(),this._clearPendingState();return}if(event.preventDefault(),event.stopPropagation(),exact&&!partial){this._executeKeyBinding(exact),this._clearPendingState();return}exact&&(this._exactKeyMatch=exact),this._keydownEvents.push(event),this._startTimer()}},CommandRegistry.prototype._startTimer=function(){var _this=this;this._clearTimer(),this._timerID=window.setTimeout(function(){_this._onPendingTimeout()},Private$n.CHORD_TIMEOUT)},CommandRegistry.prototype._clearTimer=function(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)},CommandRegistry.prototype._replayKeydownEvents=function(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(Private$n.replayKeyEvent),this._replaying=!1)},CommandRegistry.prototype._executeKeyBinding=function(binding){var command=binding.command,args=binding.args;if(!this.hasCommand(command)||!this.isEnabled(command,args)){var word=this.hasCommand(command)?"enabled":"registered",keys=binding.keys.join(", "),msg1="Cannot execute key binding '"+keys+"':",msg2="command '"+command+"' is not "+word+".";console.warn(msg1+" "+msg2);return}this.execute(command,args)},CommandRegistry.prototype._clearPendingState=function(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0},CommandRegistry.prototype._onPendingTimeout=function(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()},CommandRegistry}(),function(CommandRegistry){function parseKeystroke(keystroke){for(var key="",alt=!1,cmd=!1,ctrl=!1,shift=!1,_i=0,_a=keystroke.split(/\s+/);_i<_a.length;_i++){var token=_a[_i];token==="Accel"?Platform.IS_MAC?cmd=!0:ctrl=!0:token==="Alt"?alt=!0:token==="Cmd"?cmd=!0:token==="Ctrl"?ctrl=!0:token==="Shift"?shift=!0:token.length>0&&(key=token)}return{cmd,ctrl,alt,shift,key}}CommandRegistry.parseKeystroke=parseKeystroke;function normalizeKeystroke(keystroke){var mods="",parts=parseKeystroke(keystroke);return parts.ctrl&&(mods+="Ctrl "),parts.alt&&(mods+="Alt "),parts.shift&&(mods+="Shift "),parts.cmd&&Platform.IS_MAC&&(mods+="Cmd "),mods+parts.key}CommandRegistry.normalizeKeystroke=normalizeKeystroke;function normalizeKeys(options){var keys;return Platform.IS_WIN?keys=options.winKeys||options.keys:Platform.IS_MAC?keys=options.macKeys||options.keys:keys=options.linuxKeys||options.keys,keys.map(normalizeKeystroke)}CommandRegistry.normalizeKeys=normalizeKeys;function formatKeystroke(keystroke){return typeof keystroke=="string"?formatSingleKey(keystroke):keystroke.map(formatSingleKey).join(", ");function formatSingleKey(key){var mods=[],separator=Platform.IS_MAC?" ":"+",parts=parseKeystroke(key);return parts.ctrl&&mods.push("Ctrl"),parts.alt&&mods.push("Alt"),parts.shift&&mods.push("Shift"),Platform.IS_MAC&&parts.cmd&&mods.push("Cmd"),mods.push(parts.key),mods.map(Private$n.formatKey).join(separator)}}CommandRegistry.formatKeystroke=formatKeystroke;function isModifierKeyPressed(event){var layout=getKeyboardLayout(),key=layout.keyForKeydownEvent(event);return layout.isModifierKey(key)}CommandRegistry.isModifierKeyPressed=isModifierKeyPressed;function keystrokeForKeydownEvent(event){var layout=getKeyboardLayout(),key=layout.keyForKeydownEvent(event);if(!key||layout.isModifierKey(key))return"";var mods=[];return event.ctrlKey&&mods.push("Ctrl"),event.altKey&&mods.push("Alt"),event.shiftKey&&mods.push("Shift"),event.metaKey&&Platform.IS_MAC&&mods.push("Cmd"),mods.push(key),mods.join(" ")}CommandRegistry.keystrokeForKeydownEvent=keystrokeForKeydownEvent}(exports2.CommandRegistry||(exports2.CommandRegistry={}));var Private$n;(function(Private2){Private2.CHORD_TIMEOUT=1e3;function createCommand(options){var icon,iconClass;return!options.icon||typeof options.icon=="string"?(iconClass=asFunc(options.iconClass||options.icon,emptyStringFunc),icon=iconClass):(iconClass=asFunc(options.iconClass,emptyStringFunc),icon=asFunc(options.icon,undefinedFunc)),{execute:options.execute,describedBy:__assign$1({args:null},options.describedBy),label:asFunc(options.label,emptyStringFunc),mnemonic:asFunc(options.mnemonic,negativeOneFunc),icon,iconClass,iconLabel:asFunc(options.iconLabel,emptyStringFunc),caption:asFunc(options.caption,emptyStringFunc),usage:asFunc(options.usage,emptyStringFunc),className:asFunc(options.className,emptyStringFunc),dataset:asFunc(options.dataset,emptyDatasetFunc),isEnabled:options.isEnabled||trueFunc,isToggled:options.isToggled||falseFunc,isToggleable:options.isToggleable||!!options.isToggled,isVisible:options.isVisible||trueFunc}}Private2.createCommand=createCommand;function createKeyBinding(options){return{keys:exports2.CommandRegistry.normalizeKeys(options),selector:validateSelector(options),command:options.command,args:options.args||JSONExt.emptyObject}}Private2.createKeyBinding=createKeyBinding;function matchKeyBinding(bindings,keys,event){for(var exact=null,partial=!1,distance=1/0,specificity=0,i=0,n=bindings.length;i<n;++i){var binding=bindings[i],sqm=matchSequence(binding.keys,keys);if(sqm!==0){if(sqm===2){!partial&&targetDistance(binding.selector,event)!==-1&&(partial=!0);continue}var td=targetDistance(binding.selector,event);if(!(td===-1||td>distance)){var sp=Selector.calculateSpecificity(binding.selector);(!exact||td<distance||sp>=specificity)&&(exact=binding,distance=td,specificity=sp)}}}return{exact,partial}}Private2.matchKeyBinding=matchKeyBinding;function replayKeyEvent(event){event.target.dispatchEvent(cloneKeyboardEvent(event))}Private2.replayKeyEvent=replayKeyEvent;function formatKey(key){return Platform.IS_MAC?MAC_DISPLAY.hasOwnProperty(key)?MAC_DISPLAY[key]:key:WIN_DISPLAY.hasOwnProperty(key)?WIN_DISPLAY[key]:key}Private2.formatKey=formatKey;var MAC_DISPLAY={Backspace:"⌫",Tab:"⇥",Enter:"↩",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},WIN_DISPLAY={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},emptyStringFunc=function(){return""},negativeOneFunc=function(){return-1},trueFunc=function(){return!0},falseFunc=function(){return!1},emptyDatasetFunc=function(){return{}},undefinedFunc=function(){};function asFunc(value,dfault){return value===void 0?dfault:typeof value=="function"?value:function(){return value}}function validateSelector(options){if(options.selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+options.selector);if(!Selector.isValid(options.selector))throw new Error("Invalid selector: "+options.selector);return options.selector}function matchSequence(bindKeys,userKeys){if(bindKeys.length<userKeys.length)return 0;for(var i=0,n=userKeys.length;i<n;++i)if(bindKeys[i]!==userKeys[i])return 0;return bindKeys.length>userKeys.length?2:1}function targetDistance(selector,event){for(var targ=event.target,curr=event.currentTarget,dist=0;targ!==null;targ=targ.parentElement,++dist){if(targ.hasAttribute("data-lm-suppress-shortcuts")||targ.hasAttribute("data-p-suppress-shortcuts"))return-1;if(Selector.matches(targ,selector))return dist;if(targ===curr)return-1}return-1}function cloneKeyboardEvent(event){var clone=document.createEvent("Event"),bubbles=event.bubbles||!0,cancelable=event.cancelable||!0;return clone.initEvent(event.type||"keydown",bubbles,cancelable),clone.key=event.key||"",clone.keyCode=event.keyCode||0,clone.which=event.keyCode||0,clone.ctrlKey=event.ctrlKey||!1,clone.altKey=event.altKey||!1,clone.shiftKey=event.shiftKey||!1,clone.metaKey=event.metaKey||!1,clone.view=event.view||window,clone}})(Private$n||(Private$n={}));var BPlusTree=function(){function BPlusTree2(cmp){this._root=new Private$1$1.LeafNode,this.cmp=cmp}return Object.defineProperty(BPlusTree2.prototype,"isEmpty",{get:function(){return this._root.size===0},enumerable:!0,configurable:!0}),Object.defineProperty(BPlusTree2.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(BPlusTree2.prototype,"first",{get:function(){var node=Private$1$1.firstLeaf(this._root);return node.size>0?node.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(BPlusTree2.prototype,"last",{get:function(){var node=Private$1$1.lastLeaf(this._root);return node.size>0?node.items[node.size-1]:void 0},enumerable:!0,configurable:!0}),BPlusTree2.prototype.iter=function(){return Private$1$1.iterItems(this._root)},BPlusTree2.prototype.retro=function(){return Private$1$1.retroItems(this._root)},BPlusTree2.prototype.slice=function(start,stop){return Private$1$1.sliceItems(this._root,start,stop)},BPlusTree2.prototype.retroSlice=function(start,stop){return Private$1$1.retroSliceItems(this._root,start,stop)},BPlusTree2.prototype.at=function(index){return Private$1$1.itemAt(this._root,index)},BPlusTree2.prototype.has=function(key,cmp){return Private$1$1.hasItem(this._root,key,cmp)},BPlusTree2.prototype.indexOf=function(key,cmp){return Private$1$1.indexOf(this._root,key,cmp)},BPlusTree2.prototype.get=function(key,cmp){return Private$1$1.getItem(this._root,key,cmp)},BPlusTree2.prototype.assign=function(items){this.clear(),this.update(items)},BPlusTree2.prototype.insert=function(item){var existing=Private$1$1.insertItem(this._root,item,this.cmp);return this._root=Private$1$1.maybeSplitRoot(this._root),existing},BPlusTree2.prototype.update=function(items){var _this=this;each(items,function(item){_this.insert(item)})},BPlusTree2.prototype.delete=function(key,cmp){var item=Private$1$1.deleteItem(this._root,key,cmp);return this._root=Private$1$1.maybeExtractRoot(this._root),item},BPlusTree2.prototype.remove=function(index){var item=Private$1$1.removeItem(this._root,index);return this._root=Private$1$1.maybeExtractRoot(this._root),item},BPlusTree2.prototype.clear=function(){Private$1$1.clear(this._root),this._root=new Private$1$1.LeafNode},BPlusTree2}();(function(BPlusTree2){function from(items,cmp){var tree=new BPlusTree2(cmp);return tree.assign(items),tree}BPlusTree2.from=from})(BPlusTree||(BPlusTree={}));var Private$1$1;(function(Private2){var BranchNode=function(){function BranchNode2(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(BranchNode2.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(BranchNode2.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(BranchNode2.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),BranchNode2}();Private2.BranchNode=BranchNode;var LeafNode=function(){function LeafNode2(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(LeafNode2.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(LeafNode2.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(LeafNode2.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),LeafNode2}();Private2.LeafNode=LeafNode;function firstLeaf(node){for(;node.type===0;)node=node.children[0];return node}Private2.firstLeaf=firstLeaf;function lastLeaf(node){for(;node.type===0;)node=node.children[node.children.length-1];return node}Private2.lastLeaf=lastLeaf;function iterItems(node){var leaf=firstLeaf(node);return new ForwardIterator(leaf,0,-1)}Private2.iterItems=iterItems;function retroItems(node){var leaf=lastLeaf(node);return new RetroIterator(leaf,leaf.size-1,-1)}Private2.retroItems=retroItems;function sliceItems(node,start,stop){start===void 0?start=0:start<0?start=Math.max(0,start+node.size):start=Math.min(start,node.size),stop===void 0?stop=node.size:stop<0?stop=Math.max(0,stop+node.size):stop=Math.min(stop,node.size);var count=Math.max(0,stop-start);if(count===0)return empty();for(;node.type===0;){var i=findPivotIndexByIndex(node.sizes,start);i>0&&(start-=node.sizes[i-1]),node=node.children[i]}return new ForwardIterator(node,start,count)}Private2.sliceItems=sliceItems;function retroSliceItems(node,start,stop){start===void 0?start=node.size-1:start<0?start=Math.max(-1,start+node.size):start=Math.min(start,node.size-1),stop===void 0?stop=-1:stop<0?stop=Math.max(-1,stop+node.size):stop=Math.min(stop,node.size-1);var count=Math.max(0,start-stop);if(count===0)return empty();for(;node.type===0;){var i=findPivotIndexByIndex(node.sizes,start);i>0&&(start-=node.sizes[i-1]),node=node.children[i]}return new RetroIterator(node,start,count)}Private2.retroSliceItems=retroSliceItems;function itemAt(node,index){if(index<0&&(index+=node.size),!(index<0||index>=node.size)){for(;node.type===0;){var i=findPivotIndexByIndex(node.sizes,index);i>0&&(index-=node.sizes[i-1]),node=node.children[i]}return node.items[index]}}Private2.itemAt=itemAt;function hasItem(node,key,cmp){for(;node.type===0;){var i_1=findPivotIndexByKey(node.items,key,cmp);node=node.children[i_1]}var i=findKeyIndex(node.items,key,cmp);return i>=0}Private2.hasItem=hasItem;function indexOf(node,key,cmp){for(var index=0;node.type===0;){var i_2=findPivotIndexByKey(node.items,key,cmp);i_2>0&&(index+=node.sizes[i_2-1]),node=node.children[i_2]}var i=findKeyIndex(node.items,key,cmp);return i>=0?index+i:-index+i}Private2.indexOf=indexOf;function getItem(node,key,cmp){for(;node.type===0;){var i_3=findPivotIndexByKey(node.items,key,cmp);node=node.children[i_3]}var i=findKeyIndex(node.items,key,cmp);return i>=0?node.items[i]:void 0}Private2.getItem=getItem;function insertItem(node,item,cmp){if(node.type===1){var i_4=findKeyIndex(node.items,item,cmp),existing_1;return i_4>=0?(existing_1=node.items[i_4],node.items[i_4]=item):(existing_1=void 0,ArrayExt.insert(node.items,-i_4-1,item)),existing_1}var i=findPivotIndexByKey(node.items,item,cmp),child=node.children[i],prevSize=child.size,existing=insertItem(child,item,cmp),currSize=child.size;if(node.items[i]=child.items[0],prevSize===currSize)return existing;if(child.width>MAX_NODE_WIDTH){var next=splitNode(child);ArrayExt.insert(node.children,i+1,next),ArrayExt.insert(node.items,i+1,next.items[0])}return updateSizes(node,i),existing}Private2.insertItem=insertItem;function deleteItem(node,key,cmp){if(node.type===1){var i_5=findKeyIndex(node.items,key,cmp);return i_5<0?void 0:ArrayExt.removeAt(node.items,i_5)}var i=findPivotIndexByKey(node.items,key,cmp),child=node.children[i],prevSize=child.size,item=deleteItem(child,key,cmp),currSize=child.size;return prevSize===currSize||(node.items[i]=child.items[0],child.width<MIN_NODE_WIDTH&&(i=joinChild(node,i)),updateSizes(node,i)),item}Private2.deleteItem=deleteItem;function removeItem(node,index){if(index<0&&(index+=node.size),!(index<0||index>=node.size)){if(node.type===1)return ArrayExt.removeAt(node.items,index);var i=findPivotIndexByIndex(node.sizes,index);i>0&&(index-=node.sizes[i]);var child=node.children[i],item=removeItem(child,index);return node.items[i]=child.items[0],child.width<MIN_NODE_WIDTH&&(i=joinChild(node,i)),updateSizes(node,i),item}}Private2.removeItem=removeItem;function clear(node){node.type===0?(each(node.children,clear),node.children.length=0,node.sizes.length=0,node.items.length=0):(node.items.length=0,node.next=null,node.prev=null)}Private2.clear=clear;function maybeSplitRoot(node){if(node.width<=MAX_NODE_WIDTH)return node;var root=new BranchNode,next=splitNode(node);return root.sizes[0]=node.size,root.sizes[1]=node.size+next.size,root.children[0]=node,root.children[1]=next,root.items[0]=node.items[0],root.items[1]=next.items[0],root}Private2.maybeSplitRoot=maybeSplitRoot;function maybeExtractRoot(node){if(node.type===1||node.children.length>1)return node;var root=node.children.pop();return clear(node),root}Private2.maybeExtractRoot=maybeExtractRoot;var MAX_NODE_WIDTH=32,MIN_NODE_WIDTH=MAX_NODE_WIDTH>>1,ForwardIterator=function(){function ForwardIterator2(node,index,count){this._node=node,this._index=index,this._count=count}return ForwardIterator2.prototype.iter=function(){return this},ForwardIterator2.prototype.clone=function(){return new ForwardIterator2(this._node,this._index,this._count)},ForwardIterator2.prototype.next=function(){if(!(this._node===null||this._count===0))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++])},ForwardIterator2}(),RetroIterator=function(){function RetroIterator2(node,index,count){this._node=node,this._index=index,this._count=count}return RetroIterator2.prototype.iter=function(){return this},RetroIterator2.prototype.clone=function(){return new RetroIterator2(this._node,this._index,this._count)},RetroIterator2.prototype.next=function(){if(!(this._node===null||this._count===0))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--])},RetroIterator2}();function findPivotIndexByIndex(sizes,index){for(var n=sizes.length,i=0;i<n;++i)if(sizes[i]>index)return i;return n-1}function findPivotIndexByKey(items,key,cmp){for(var n=items.length,i=1;i<n;++i)if(cmp(items[i],key)>0)return i-1;return n-1}function findKeyIndex(items,key,cmp){for(var n=items.length,i=0;i<n;++i){var c=cmp(items[i],key);if(c===0)return i;if(c>0)return-i-1}return-n-1}function updateSizes(node,i){for(var sizes=node.sizes,children=node.children,last=i>0?sizes[i-1]:0,n=children.length;i<n;++i)last=sizes[i]=last+children[i].size;sizes.length=children.length}function splitNode(node){if(node.type===1){for(var next_1=new LeafNode,v1_1=node.items,v2_1=next_1.items,i=MIN_NODE_WIDTH,n=v1_1.length;i<n;++i)v2_1.push(v1_1[i]);return v1_1.length=MIN_NODE_WIDTH,node.next&&(node.next.prev=next_1),next_1.next=node.next,next_1.prev=node,node.next=next_1,next_1}for(var next=new BranchNode,c1=node.children,c2=next.children,i=MIN_NODE_WIDTH,n=c1.length;i<n;++i)c2.push(c1[i]);c1.length=MIN_NODE_WIDTH;for(var v1=node.items,v2=next.items,i=MIN_NODE_WIDTH,n=v1.length;i<n;++i)v2.push(v1[i]);return v1.length=MIN_NODE_WIDTH,updateSizes(node,MIN_NODE_WIDTH),updateSizes(next,0),next}function joinChild(node,i){var _a,_b,_c,_d,_e,_f,child=node.children[i],sibling=i===0?node.children[i+1]:node.children[i-1],hasNext=i===0,isLeaf=child.type===1,hasExtra=sibling.width>MIN_NODE_WIDTH;if(isLeaf&&hasExtra&&hasNext){var c=child,s=sibling;return c.items.push(s.items.shift()),node.items[i+1]=s.items[0],i}if(isLeaf&&hasExtra&&!hasNext){var c=child,s=sibling;return c.items.unshift(s.items.pop()),node.items[i]=c.items[0],i-1}if(isLeaf&&!hasExtra&&hasNext){var c=child,s=sibling;return(_a=s.items).unshift.apply(_a,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i+1),c.prev&&(c.prev.next=s),s.prev=c.prev,clear(c),i}if(isLeaf&&!hasExtra&&!hasNext){var c=child,s=sibling;return(_b=s.items).push.apply(_b,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i),c.next&&(c.next.prev=s),s.next=c.next,clear(c),i-1}if(!isLeaf&&hasExtra&&hasNext){var c=child,s=sibling;return c.children.push(s.children.shift()),c.items.push(s.items.shift()),node.items[i+1]=s.items[0],updateSizes(c,c.width-1),updateSizes(s,0),i}if(!isLeaf&&hasExtra&&!hasNext){var c=child,s=sibling;return c.children.unshift(s.children.pop()),c.items.unshift(s.items.pop()),node.items[i]=c.items[0],updateSizes(c,0),updateSizes(s,s.width-1),i-1}if(!isLeaf&&!hasExtra&&hasNext){var c=child,s=sibling;return(_c=s.children).unshift.apply(_c,c.children),(_d=s.items).unshift.apply(_d,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i+1),updateSizes(s,0),c.children.length=0,clear(c),i}if(!isLeaf&&!hasExtra&&!hasNext){var c=child,s=sibling;return(_e=s.children).push.apply(_e,c.children),(_f=s.items).push.apply(_f,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i),updateSizes(s,0),c.children.length=0,clear(c),i-1}throw"unreachable"}})(Private$1$1||(Private$1$1={}));var LinkedList=function(){function LinkedList2(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(LinkedList2.prototype,"isEmpty",{get:function(){return this._size===0},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),LinkedList2.prototype.iter=function(){return new LinkedList2.ForwardValueIterator(this._first)},LinkedList2.prototype.retro=function(){return new LinkedList2.RetroValueIterator(this._last)},LinkedList2.prototype.nodes=function(){return new LinkedList2.ForwardNodeIterator(this._first)},LinkedList2.prototype.retroNodes=function(){return new LinkedList2.RetroNodeIterator(this._last)},LinkedList2.prototype.assign=function(values){var _this=this;this.clear(),each(values,function(value){_this.addLast(value)})},LinkedList2.prototype.push=function(value){this.addLast(value)},LinkedList2.prototype.pop=function(){return this.removeLast()},LinkedList2.prototype.shift=function(value){this.addFirst(value)},LinkedList2.prototype.unshift=function(){return this.removeFirst()},LinkedList2.prototype.addFirst=function(value){var node=new Private$m.LinkedListNode(this,value);return this._first?(node.next=this._first,this._first.prev=node,this._first=node):(this._first=node,this._last=node),this._size++,node},LinkedList2.prototype.addLast=function(value){var node=new Private$m.LinkedListNode(this,value);return this._last?(node.prev=this._last,this._last.next=node,this._last=node):(this._first=node,this._last=node),this._size++,node},LinkedList2.prototype.insertBefore=function(value,ref){if(!ref||ref===this._first)return this.addFirst(value);if(!(ref instanceof Private$m.LinkedListNode)||ref.list!==this)throw new Error("Reference node is not owned by the list.");var node=new Private$m.LinkedListNode(this,value),_ref=ref,prev=_ref.prev;return node.next=_ref,node.prev=prev,_ref.prev=node,prev.next=node,this._size++,node},LinkedList2.prototype.insertAfter=function(value,ref){if(!ref||ref===this._last)return this.addLast(value);if(!(ref instanceof Private$m.LinkedListNode)||ref.list!==this)throw new Error("Reference node is not owned by the list.");var node=new Private$m.LinkedListNode(this,value),_ref=ref,next=_ref.next;return node.next=next,node.prev=_ref,_ref.next=node,next.prev=node,this._size++,node},LinkedList2.prototype.removeFirst=function(){var node=this._first;if(node)return node===this._last?(this._first=null,this._last=null):(this._first=node.next,this._first.prev=null),node.list=null,node.next=null,node.prev=null,this._size--,node.value},LinkedList2.prototype.removeLast=function(){var node=this._last;if(node)return node===this._first?(this._first=null,this._last=null):(this._last=node.prev,this._last.next=null),node.list=null,node.next=null,node.prev=null,this._size--,node.value},LinkedList2.prototype.removeNode=function(node){if(!(node instanceof Private$m.LinkedListNode)||node.list!==this)throw new Error("Node is not owned by the list.");var _node=node;_node===this._first&&_node===this._last?(this._first=null,this._last=null):_node===this._first?(this._first=_node.next,this._first.prev=null):_node===this._last?(this._last=_node.prev,this._last.next=null):(_node.next.prev=_node.prev,_node.prev.next=_node.next),_node.list=null,_node.next=null,_node.prev=null,this._size--},LinkedList2.prototype.clear=function(){for(var node=this._first;node;){var next=node.next;node.list=null,node.prev=null,node.next=null,node=next}this._first=null,this._last=null,this._size=0},LinkedList2}();(function(LinkedList2){function from(values){var list=new LinkedList2;return list.assign(values),list}LinkedList2.from=from;var ForwardValueIterator=function(){function ForwardValueIterator2(node){this._node=node}return ForwardValueIterator2.prototype.iter=function(){return this},ForwardValueIterator2.prototype.clone=function(){return new ForwardValueIterator2(this._node)},ForwardValueIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.next,node.value}},ForwardValueIterator2}();LinkedList2.ForwardValueIterator=ForwardValueIterator;var RetroValueIterator=function(){function RetroValueIterator2(node){this._node=node}return RetroValueIterator2.prototype.iter=function(){return this},RetroValueIterator2.prototype.clone=function(){return new RetroValueIterator2(this._node)},RetroValueIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.prev,node.value}},RetroValueIterator2}();LinkedList2.RetroValueIterator=RetroValueIterator;var ForwardNodeIterator=function(){function ForwardNodeIterator2(node){this._node=node}return ForwardNodeIterator2.prototype.iter=function(){return this},ForwardNodeIterator2.prototype.clone=function(){return new ForwardNodeIterator2(this._node)},ForwardNodeIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.next,node}},ForwardNodeIterator2}();LinkedList2.ForwardNodeIterator=ForwardNodeIterator;var RetroNodeIterator=function(){function RetroNodeIterator2(node){this._node=node}return RetroNodeIterator2.prototype.iter=function(){return this},RetroNodeIterator2.prototype.clone=function(){return new RetroNodeIterator2(this._node)},RetroNodeIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.prev,node}},RetroNodeIterator2}();LinkedList2.RetroNodeIterator=RetroNodeIterator})(LinkedList||(LinkedList={}));var Private$m;(function(Private2){var LinkedListNode=function(){function LinkedListNode2(list,value){this.list=null,this.next=null,this.prev=null,this.list=list,this.value=value}return LinkedListNode2}();Private2.LinkedListNode=LinkedListNode})(Private$m||(Private$m={}));/*! *****************************************************************************
|
|
28
|
-
Copyright (c) Microsoft Corporation.
|
|
29
|
-
|
|
30
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
31
|
-
purpose with or without fee is hereby granted.
|
|
32
|
-
|
|
33
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
34
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
35
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
36
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
37
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
38
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
39
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
40
|
-
***************************************************************************** */var extendStatics$2=function(d,b){return extendStatics$2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics$2(d,b)};function __extends$2(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics$2(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var Message=function(){function Message2(type){this.type=type}return Object.defineProperty(Message2.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),Message2.prototype.conflate=function(other){return!1},Message2}(),ConflatableMessage=function(_super){__extends$2(ConflatableMessage2,_super);function ConflatableMessage2(){return _super!==null&&_super.apply(this,arguments)||this}return Object.defineProperty(ConflatableMessage2.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),ConflatableMessage2.prototype.conflate=function(other){return!0},ConflatableMessage2}(Message),MessageLoop;(function(MessageLoop2){function sendMessage(handler,msg){var hooks=messageHooks.get(handler);if(!hooks||hooks.length===0){invokeHandler(handler,msg);return}var passed=every(retro(hooks),function(hook){return hook?invokeHook(hook,handler,msg):!0});passed&&invokeHandler(handler,msg)}MessageLoop2.sendMessage=sendMessage;function postMessage(handler,msg){if(!msg.isConflatable){enqueueMessage(handler,msg);return}var conflated=some(messageQueue,function(posted){return posted.handler!==handler||!posted.msg||posted.msg.type!==msg.type||!posted.msg.isConflatable?!1:posted.msg.conflate(msg)});conflated||enqueueMessage(handler,msg)}MessageLoop2.postMessage=postMessage;function installMessageHook(handler,hook){var hooks=messageHooks.get(handler);hooks&&hooks.indexOf(hook)!==-1||(hooks?hooks.push(hook):messageHooks.set(handler,[hook]))}MessageLoop2.installMessageHook=installMessageHook;function removeMessageHook(handler,hook){var hooks=messageHooks.get(handler);if(hooks){var i=hooks.indexOf(hook);i!==-1&&(hooks[i]=null,scheduleCleanup(hooks))}}MessageLoop2.removeMessageHook=removeMessageHook;function clearData(handler){var hooks=messageHooks.get(handler);hooks&&hooks.length>0&&(ArrayExt.fill(hooks,null),scheduleCleanup(hooks)),each(messageQueue,function(posted){posted.handler===handler&&(posted.handler=null,posted.msg=null)})}MessageLoop2.clearData=clearData;function flush(){flushGuard||loopTaskID===0||(unschedule(loopTaskID),flushGuard=!0,runMessageLoop(),flushGuard=!1)}MessageLoop2.flush=flush;function getExceptionHandler(){return exceptionHandler}MessageLoop2.getExceptionHandler=getExceptionHandler;function setExceptionHandler(handler){var old=exceptionHandler;return exceptionHandler=handler,old}MessageLoop2.setExceptionHandler=setExceptionHandler;var messageQueue=new LinkedList,messageHooks=new WeakMap,dirtySet=new Set,exceptionHandler=function(err){console.error(err)},loopTaskID=0,flushGuard=!1,schedule=function(){var ok=typeof requestAnimationFrame=="function";return ok?requestAnimationFrame:setImmediate}(),unschedule=function(){var ok=typeof cancelAnimationFrame=="function";return ok?cancelAnimationFrame:clearImmediate}();function invokeHook(hook,handler,msg){var result=!0;try{typeof hook=="function"?result=hook(handler,msg):result=hook.messageHook(handler,msg)}catch(err){exceptionHandler(err)}return result}function invokeHandler(handler,msg){try{handler.processMessage(msg)}catch(err){exceptionHandler(err)}}function enqueueMessage(handler,msg){messageQueue.addLast({handler,msg}),loopTaskID===0&&(loopTaskID=schedule(runMessageLoop))}function runMessageLoop(){if(loopTaskID=0,!messageQueue.isEmpty){var sentinel={handler:null,msg:null};for(messageQueue.addLast(sentinel);;){var posted=messageQueue.removeFirst();if(posted===sentinel)return;posted.handler&&posted.msg&&sendMessage(posted.handler,posted.msg)}}}function scheduleCleanup(hooks){dirtySet.size===0&&schedule(cleanupDirtySet),dirtySet.add(hooks)}function cleanupDirtySet(){dirtySet.forEach(cleanupHooks),dirtySet.clear()}function cleanupHooks(hooks){ArrayExt.removeAllWhere(hooks,isNull)}function isNull(value){return value===null}})(MessageLoop||(MessageLoop={}));var Drag=function(){function Drag2(options){var _this=this;this._onScrollFrame=function(){if(_this._scrollTarget){var _a=_this._scrollTarget,element=_a.element,edge=_a.edge,distance=_a.distance,d=Private$l.SCROLL_EDGE_SIZE-distance,f=Math.pow(d/Private$l.SCROLL_EDGE_SIZE,2),s=Math.max(1,Math.round(f*Private$l.SCROLL_EDGE_SIZE));switch(edge){case"top":element.scrollTop-=s;break;case"left":element.scrollLeft-=s;break;case"right":element.scrollLeft+=s;break;case"bottom":element.scrollTop+=s;break}requestAnimationFrame(_this._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.document=options.document||document,this.mimeData=options.mimeData,this.dragImage=options.dragImage||null,this.proposedAction=options.proposedAction||"copy",this.supportedActions=options.supportedActions||"all",this.source=options.source||null}return Drag2.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var event_1=Private$l.createMouseEvent("pointerup",-1,-1);Private$l.dispatchDragLeave(this,this._currentTarget,null,event_1)}this._finalize("none")}},Object.defineProperty(Drag2.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Drag2.prototype.start=function(clientX,clientY){var _this=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(clientX,clientY),this._promise=new Promise(function(resolve,reject){_this._resolve=resolve});var event=Private$l.createMouseEvent("pointermove",clientX,clientY);return document.dispatchEvent(event),this._promise},Drag2.prototype.handleEvent=function(event){switch(event.type){case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;default:event.preventDefault(),event.stopPropagation();break}},Drag2.prototype.moveDragImage=function(clientX,clientY){if(this.dragImage){var style=this.dragImage.style;style.top=clientY+"px",style.left=clientX+"px"}},Drag2.prototype._evtMouseMove=function(event){event.preventDefault(),event.stopPropagation(),this._updateCurrentTarget(event),this._updateDragScroll(event),this.moveDragImage(event.clientX,event.clientY)},Drag2.prototype._evtMouseUp=function(event){if(event.preventDefault(),event.stopPropagation(),event.button===0){if(this._updateCurrentTarget(event),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){Private$l.dispatchDragLeave(this,this._currentTarget,null,event),this._finalize("none");return}var action=Private$l.dispatchDrop(this,this._currentTarget,event);this._finalize(action)}},Drag2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation(),event.keyCode===27&&this.dispose()},Drag2.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("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},Drag2.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("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},Drag2.prototype._updateDragScroll=function(event){var target=Private$l.findScrollTarget(event);!this._scrollTarget&&!target||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=target)},Drag2.prototype._updateCurrentTarget=function(event){var prevTarget=this._currentTarget,currTarget=this._currentTarget,prevElem=this._currentElement,currElem=this.document.elementFromPoint(event.clientX,event.clientY);this._currentElement=currElem,currElem!==prevElem&&currElem!==currTarget&&Private$l.dispatchDragExit(this,currTarget,currElem,event),currElem!==prevElem&&currElem!==currTarget&&(currTarget=Private$l.dispatchDragEnter(this,currElem,currTarget,event)),currTarget!==prevTarget&&(this._currentTarget=currTarget,Private$l.dispatchDragLeave(this,prevTarget,currTarget,event));var action=Private$l.dispatchDragOver(this,currTarget,event);this._setDropAction(action)},Drag2.prototype._attachDragImage=function(clientX,clientY){if(this.dragImage){this.dragImage.classList.add("lm-mod-drag-image"),this.dragImage.classList.add("p-mod-drag-image");var style=this.dragImage.style;style.pointerEvents="none",style.position="fixed",style.top=clientY+"px",style.left=clientX+"px";var body=this.document instanceof Document?this.document.body:this.document.firstElementChild;body.appendChild(this.dragImage)}},Drag2.prototype._detachDragImage=function(){if(this.dragImage){var parent=this.dragImage.parentNode;parent&&parent.removeChild(this.dragImage)}},Drag2.prototype._setDropAction=function(action){if(action=Private$l.validateAction(action,this.supportedActions),!(this._override&&this._dropAction===action))switch(action){case"none":this._dropAction=action,this._override=Drag2.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=action,this._override=Drag2.overrideCursor("copy",this.document);break;case"link":this._dropAction=action,this._override=Drag2.overrideCursor("alias",this.document);break;case"move":this._dropAction=action,this._override=Drag2.overrideCursor("move",this.document);break}},Drag2.prototype._finalize=function(action){var resolve=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,resolve&&resolve(action)},Drag2}();(function(Drag2){function overrideCursor(cursor,doc){doc===void 0&&(doc=document);var id=++overrideCursorID,body=doc instanceof Document?doc.body:doc.firstElementChild;return body.style.cursor=cursor,body.classList.add("lm-mod-override-cursor"),body.classList.add("p-mod-override-cursor"),new DisposableDelegate(function(){id===overrideCursorID&&(body.style.cursor="",body.classList.remove("lm-mod-override-cursor"),body.classList.remove("p-mod-override-cursor"))})}Drag2.overrideCursor=overrideCursor;var overrideCursorID=0})(Drag||(Drag={}));var Private$l;(function(Private2){Private2.SCROLL_EDGE_SIZE=20;function validateAction(action,supported){return actionTable[action]&supportedTable[supported]?action:"none"}Private2.validateAction=validateAction;function createMouseEvent(type,clientX,clientY){var event=document.createEvent("MouseEvent");return event.initMouseEvent(type,!0,!0,window,0,0,0,clientX,clientY,!1,!1,!1,!1,0,null),event}Private2.createMouseEvent=createMouseEvent;function findScrollTarget(event){for(var x=event.clientX,y=event.clientY,element=document.elementFromPoint(x,y);element;element=element.parentElement){var scrollable=element.hasAttribute("data-lm-dragscroll");if(scrollable=scrollable||element.hasAttribute("data-p-dragscroll"),!!scrollable){var offsetX=0,offsetY=0;element===document.body&&(offsetX=window.pageXOffset,offsetY=window.pageYOffset);var r=element.getBoundingClientRect(),top_1=r.top+offsetY,left=r.left+offsetX,right=left+r.width,bottom=top_1+r.height;if(!(x<left||x>=right||y<top_1||y>=bottom)){var dl=x-left+1,dt=y-top_1+1,dr=right-x,db=bottom-y,distance=Math.min(dl,dt,dr,db);if(!(distance>Private2.SCROLL_EDGE_SIZE)){var edge=void 0;switch(distance){case db:edge="bottom";break;case dt:edge="top";break;case dr:edge="right";break;case dl:edge="left";break;default:throw"unreachable"}var dsw=element.scrollWidth-element.clientWidth,dsh=element.scrollHeight-element.clientHeight,shouldScroll=void 0;switch(edge){case"top":shouldScroll=dsh>0&&element.scrollTop>0;break;case"left":shouldScroll=dsw>0&&element.scrollLeft>0;break;case"right":shouldScroll=dsw>0&&element.scrollLeft<dsw;break;case"bottom":shouldScroll=dsh>0&&element.scrollTop<dsh;break;default:throw"unreachable"}if(shouldScroll)return{element,edge,distance}}}}}return null}Private2.findScrollTarget=findScrollTarget;function dispatchDragEnter(drag,currElem,currTarget,event){if(!currElem)return null;var dragEvent=createDragEvent("lm-dragenter",drag,event,currTarget),canceled=!currElem.dispatchEvent(dragEvent);if(canceled||(dragEvent=createDragEvent("p-dragenter",drag,event,currTarget),canceled=!currElem.dispatchEvent(dragEvent),canceled))return currElem;var body=drag.document instanceof Document?drag.document.body:drag.document.firstElementChild;return currElem===body?currTarget:(dragEvent=createDragEvent("lm-dragenter",drag,event,currTarget),body.dispatchEvent(dragEvent),dragEvent=createDragEvent("p-dragenter",drag,event,currTarget),body.dispatchEvent(dragEvent),body)}Private2.dispatchDragEnter=dispatchDragEnter;function dispatchDragExit(drag,prevTarget,currTarget,event){if(prevTarget){var dragEvent=createDragEvent("lm-dragexit",drag,event,currTarget);prevTarget.dispatchEvent(dragEvent),dragEvent=createDragEvent("p-dragexit",drag,event,currTarget),prevTarget.dispatchEvent(dragEvent)}}Private2.dispatchDragExit=dispatchDragExit;function dispatchDragLeave(drag,prevTarget,currTarget,event){if(prevTarget){var dragEvent=createDragEvent("lm-dragleave",drag,event,currTarget);prevTarget.dispatchEvent(dragEvent),dragEvent=createDragEvent("p-dragleave",drag,event,currTarget),prevTarget.dispatchEvent(dragEvent)}}Private2.dispatchDragLeave=dispatchDragLeave;function dispatchDragOver(drag,currTarget,event){if(!currTarget)return"none";var dragEvent=createDragEvent("lm-dragover",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent);return canceled||(dragEvent=createDragEvent("p-dragover",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent),canceled)?dragEvent.dropAction:"none"}Private2.dispatchDragOver=dispatchDragOver;function dispatchDrop(drag,currTarget,event){if(!currTarget)return"none";var dragEvent=createDragEvent("lm-drop",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent);return canceled||(dragEvent=createDragEvent("p-drop",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent),canceled)?dragEvent.dropAction:"none"}Private2.dispatchDrop=dispatchDrop;var actionTable={none:0,copy:1,link:2,move:4},supportedTable={none:actionTable.none,copy:actionTable.copy,link:actionTable.link,move:actionTable.move,"copy-link":actionTable.copy|actionTable.link,"copy-move":actionTable.copy|actionTable.move,"link-move":actionTable.link|actionTable.move,all:actionTable.copy|actionTable.link|actionTable.move};function createDragEvent(type,drag,event,related){var dragEvent=document.createEvent("MouseEvent");return dragEvent.initMouseEvent(type,!0,!0,window,0,event.screenX,event.screenY,event.clientX,event.clientY,event.ctrlKey,event.altKey,event.shiftKey,event.metaKey,event.button,related),dragEvent.dropAction="none",dragEvent.mimeData=drag.mimeData,dragEvent.proposedAction=drag.proposedAction,dragEvent.supportedActions=drag.supportedActions,dragEvent.source=drag.source,dragEvent}})(Private$l||(Private$l={}));/*! *****************************************************************************
|
|
41
|
-
Copyright (c) Microsoft Corporation.
|
|
42
|
-
|
|
43
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
44
|
-
purpose with or without fee is hereby granted.
|
|
45
|
-
|
|
46
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
47
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
48
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
49
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
50
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
51
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
52
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
53
|
-
***************************************************************************** */var extendStatics$1=function(d,b){return extendStatics$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics$1(d,b)};function __extends$1(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics$1(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var VirtualText=function(){function VirtualText2(content){this.type="text",this.content=content}return VirtualText2}(),VirtualElement=function(){function VirtualElement2(tag,attrs,children,renderer){this.type="element",this.tag=tag,this.attrs=attrs,this.children=children,this.renderer=renderer}return VirtualElement2}();(function(_super){__extends$1(VirtualElementPass,_super);function VirtualElementPass(tag,attrs,renderer){return _super.call(this,tag,attrs,[],renderer||void 0)||this}return VirtualElementPass})(VirtualElement);function h(tag){for(var attrs={},renderer,children=[],i=1,n=arguments.length;i<n;++i){var arg=arguments[i];typeof arg=="string"?children.push(new VirtualText(arg)):arg instanceof VirtualText||arg instanceof VirtualElement?children.push(arg):arg instanceof Array?extend(children,arg):(i===1||i===2)&&arg&&typeof arg=="object"&&("render"in arg?renderer=arg:attrs=arg)}return new VirtualElement(tag,attrs,children,renderer);function extend(array,values){for(var _i=0,values_1=values;_i<values_1.length;_i++){var child=values_1[_i];typeof child=="string"?array.push(new VirtualText(child)):(child instanceof VirtualText||child instanceof VirtualElement)&&array.push(child)}}}(function(h2){h2.a=h2.bind(void 0,"a"),h2.abbr=h2.bind(void 0,"abbr"),h2.address=h2.bind(void 0,"address"),h2.area=h2.bind(void 0,"area"),h2.article=h2.bind(void 0,"article"),h2.aside=h2.bind(void 0,"aside"),h2.audio=h2.bind(void 0,"audio"),h2.b=h2.bind(void 0,"b"),h2.bdi=h2.bind(void 0,"bdi"),h2.bdo=h2.bind(void 0,"bdo"),h2.blockquote=h2.bind(void 0,"blockquote"),h2.br=h2.bind(void 0,"br"),h2.button=h2.bind(void 0,"button"),h2.canvas=h2.bind(void 0,"canvas"),h2.caption=h2.bind(void 0,"caption"),h2.cite=h2.bind(void 0,"cite"),h2.code=h2.bind(void 0,"code"),h2.col=h2.bind(void 0,"col"),h2.colgroup=h2.bind(void 0,"colgroup"),h2.data=h2.bind(void 0,"data"),h2.datalist=h2.bind(void 0,"datalist"),h2.dd=h2.bind(void 0,"dd"),h2.del=h2.bind(void 0,"del"),h2.dfn=h2.bind(void 0,"dfn"),h2.div=h2.bind(void 0,"div"),h2.dl=h2.bind(void 0,"dl"),h2.dt=h2.bind(void 0,"dt"),h2.em=h2.bind(void 0,"em"),h2.embed=h2.bind(void 0,"embed"),h2.fieldset=h2.bind(void 0,"fieldset"),h2.figcaption=h2.bind(void 0,"figcaption"),h2.figure=h2.bind(void 0,"figure"),h2.footer=h2.bind(void 0,"footer"),h2.form=h2.bind(void 0,"form"),h2.h1=h2.bind(void 0,"h1"),h2.h2=h2.bind(void 0,"h2"),h2.h3=h2.bind(void 0,"h3"),h2.h4=h2.bind(void 0,"h4"),h2.h5=h2.bind(void 0,"h5"),h2.h6=h2.bind(void 0,"h6"),h2.header=h2.bind(void 0,"header"),h2.hr=h2.bind(void 0,"hr"),h2.i=h2.bind(void 0,"i"),h2.iframe=h2.bind(void 0,"iframe"),h2.img=h2.bind(void 0,"img"),h2.input=h2.bind(void 0,"input"),h2.ins=h2.bind(void 0,"ins"),h2.kbd=h2.bind(void 0,"kbd"),h2.label=h2.bind(void 0,"label"),h2.legend=h2.bind(void 0,"legend"),h2.li=h2.bind(void 0,"li"),h2.main=h2.bind(void 0,"main"),h2.map=h2.bind(void 0,"map"),h2.mark=h2.bind(void 0,"mark"),h2.meter=h2.bind(void 0,"meter"),h2.nav=h2.bind(void 0,"nav"),h2.noscript=h2.bind(void 0,"noscript"),h2.object=h2.bind(void 0,"object"),h2.ol=h2.bind(void 0,"ol"),h2.optgroup=h2.bind(void 0,"optgroup"),h2.option=h2.bind(void 0,"option"),h2.output=h2.bind(void 0,"output"),h2.p=h2.bind(void 0,"p"),h2.param=h2.bind(void 0,"param"),h2.pre=h2.bind(void 0,"pre"),h2.progress=h2.bind(void 0,"progress"),h2.q=h2.bind(void 0,"q"),h2.rp=h2.bind(void 0,"rp"),h2.rt=h2.bind(void 0,"rt"),h2.ruby=h2.bind(void 0,"ruby"),h2.s=h2.bind(void 0,"s"),h2.samp=h2.bind(void 0,"samp"),h2.section=h2.bind(void 0,"section"),h2.select=h2.bind(void 0,"select"),h2.small=h2.bind(void 0,"small"),h2.source=h2.bind(void 0,"source"),h2.span=h2.bind(void 0,"span"),h2.strong=h2.bind(void 0,"strong"),h2.sub=h2.bind(void 0,"sub"),h2.summary=h2.bind(void 0,"summary"),h2.sup=h2.bind(void 0,"sup"),h2.table=h2.bind(void 0,"table"),h2.tbody=h2.bind(void 0,"tbody"),h2.td=h2.bind(void 0,"td"),h2.textarea=h2.bind(void 0,"textarea"),h2.tfoot=h2.bind(void 0,"tfoot"),h2.th=h2.bind(void 0,"th"),h2.thead=h2.bind(void 0,"thead"),h2.time=h2.bind(void 0,"time"),h2.title=h2.bind(void 0,"title"),h2.tr=h2.bind(void 0,"tr"),h2.track=h2.bind(void 0,"track"),h2.u=h2.bind(void 0,"u"),h2.ul=h2.bind(void 0,"ul"),h2.var_=h2.bind(void 0,"var"),h2.video=h2.bind(void 0,"video"),h2.wbr=h2.bind(void 0,"wbr")})(h||(h={}));var VirtualDOM;(function(VirtualDOM2){function realize(node){return Private$k.createDOMNode(node)}VirtualDOM2.realize=realize;function render(content,host){var oldContent=Private$k.hostMap.get(host)||[],newContent=Private$k.asContentArray(content);Private$k.hostMap.set(host,newContent),Private$k.updateContent(host,oldContent,newContent)}VirtualDOM2.render=render})(VirtualDOM||(VirtualDOM={}));var Private$k;(function(Private2){Private2.hostMap=new WeakMap;function asContentArray(value){return value?value instanceof Array?value:[value]:[]}Private2.asContentArray=asContentArray;function createDOMNode(node){var host=arguments[1]||null,before=arguments[2]||null;if(host)host.insertBefore(createDOMNode(node),before);else{if(node.type==="text")return document.createTextNode(node.content);if(host=document.createElement(node.tag),addAttrs(host,node.attrs),node.renderer)return node.renderer.render(host,{attrs:node.attrs,children:node.children}),host;for(var i=0,n=node.children.length;i<n;++i)createDOMNode(node.children[i],host)}return host}Private2.createDOMNode=createDOMNode;function updateContent(host,oldContent,newContent){if(oldContent!==newContent){for(var oldKeyed=collectKeys(host,oldContent),oldCopy=oldContent.slice(),currElem=host.firstChild,newCount=newContent.length,i=0;i<newCount;++i){if(i>=oldCopy.length){createDOMNode(newContent[i],host);continue}var oldVNode=oldCopy[i],newVNode=newContent[i];if(oldVNode===newVNode){currElem=currElem.nextSibling;continue}if(oldVNode.type==="text"&&newVNode.type==="text"){currElem.textContent!==newVNode.content&&(currElem.textContent=newVNode.content),currElem=currElem.nextSibling;continue}if(oldVNode.type==="text"||newVNode.type==="text"){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}if(!oldVNode.renderer!=!newVNode.renderer){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}var newKey=newVNode.attrs.key;if(newKey&&newKey in oldKeyed){var pair=oldKeyed[newKey];pair.vNode!==oldVNode&&(ArrayExt.move(oldCopy,oldCopy.indexOf(pair.vNode,i+1),i),host.insertBefore(pair.element,currElem),oldVNode=pair.vNode,currElem=pair.element)}if(oldVNode===newVNode){currElem=currElem.nextSibling;continue}var oldKey=oldVNode.attrs.key;if(oldKey&&oldKey!==newKey){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}if(oldVNode.tag!==newVNode.tag){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}updateAttrs(currElem,oldVNode.attrs,newVNode.attrs),newVNode.renderer?newVNode.renderer.render(currElem,{attrs:newVNode.attrs,children:newVNode.children}):updateContent(currElem,oldVNode.children,newVNode.children),currElem=currElem.nextSibling}removeContent(host,oldCopy,newCount,!0)}}Private2.updateContent=updateContent;function removeContent(host,oldContent,newCount,_sentinel){for(var i=oldContent.length-1;i>=newCount;--i){var oldNode=oldContent[i],child=_sentinel?host.lastChild:host.childNodes[i];oldNode.type==="text"||(oldNode.renderer&&oldNode.renderer.unrender?oldNode.renderer.unrender(child,{attrs:oldNode.attrs,children:oldNode.children}):removeContent(child,oldNode.children,0,!1)),_sentinel&&host.removeChild(child)}}var specialAttrs={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function addAttrs(element,attrs){for(var name_1 in attrs)name_1 in specialAttrs||(name_1.substr(0,2)==="on"?element[name_1]=attrs[name_1]:element.setAttribute(name_1,attrs[name_1]));attrs.className!==void 0&&element.setAttribute("class",attrs.className),attrs.htmlFor!==void 0&&element.setAttribute("for",attrs.htmlFor),attrs.dataset&&addDataset(element,attrs.dataset),attrs.style&&addStyle(element,attrs.style)}function updateAttrs(element,oldAttrs,newAttrs){if(oldAttrs!==newAttrs){var name2;for(name2 in oldAttrs)name2 in specialAttrs||name2 in newAttrs||(name2.substr(0,2)==="on"?element[name2]=null:element.removeAttribute(name2));for(name2 in newAttrs)name2 in specialAttrs||oldAttrs[name2]===newAttrs[name2]||(name2.substr(0,2)==="on"?element[name2]=newAttrs[name2]:element.setAttribute(name2,newAttrs[name2]));oldAttrs.className!==newAttrs.className&&(newAttrs.className!==void 0?element.setAttribute("class",newAttrs.className):element.removeAttribute("class")),oldAttrs.htmlFor!==newAttrs.htmlFor&&(newAttrs.htmlFor!==void 0?element.setAttribute("for",newAttrs.htmlFor):element.removeAttribute("for")),oldAttrs.dataset!==newAttrs.dataset&&updateDataset(element,oldAttrs.dataset||{},newAttrs.dataset||{}),oldAttrs.style!==newAttrs.style&&updateStyle(element,oldAttrs.style||{},newAttrs.style||{})}}function addDataset(element,dataset){for(var name_2 in dataset)element.setAttribute("data-"+name_2,dataset[name_2])}function updateDataset(element,oldDataset,newDataset){for(var name_3 in oldDataset)name_3 in newDataset||element.removeAttribute("data-"+name_3);for(var name_4 in newDataset)oldDataset[name_4]!==newDataset[name_4]&&element.setAttribute("data-"+name_4,newDataset[name_4])}function addStyle(element,style){var elemStyle=element.style,name2;for(name2 in style)elemStyle[name2]=style[name2]}function updateStyle(element,oldStyle,newStyle){var elemStyle=element.style,name2;for(name2 in oldStyle)name2 in newStyle||(elemStyle[name2]="");for(name2 in newStyle)oldStyle[name2]!==newStyle[name2]&&(elemStyle[name2]=newStyle[name2])}function collectKeys(host,content){for(var node=host.firstChild,keyMap=Object.create(null),_i=0,content_1=content;_i<content_1.length;_i++){var vNode=content_1[_i];vNode.type==="element"&&vNode.attrs.key&&(keyMap[vNode.attrs.key]={vNode,element:node}),node=node.nextSibling}return keyMap}})(Private$k||(Private$k={}));/*! *****************************************************************************
|
|
54
|
-
Copyright (c) Microsoft Corporation.
|
|
55
|
-
|
|
56
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
57
|
-
purpose with or without fee is hereby granted.
|
|
58
|
-
|
|
59
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
60
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
61
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
62
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
63
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
64
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
65
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
66
|
-
***************************************************************************** */var extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics(d,b)};function __extends(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t}function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;for(var r=Array(s),k=0,i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var BoxSizer=function(){function BoxSizer2(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}return BoxSizer2}(),BoxEngine;(function(BoxEngine2){function calc(sizers,space){var count=sizers.length;if(count===0)return space;for(var totalMin=0,totalMax=0,totalSize=0,totalStretch=0,stretchCount=0,i=0;i<count;++i){var sizer=sizers[i],min=sizer.minSize,max2=sizer.maxSize,hint=sizer.sizeHint;sizer.done=!1,sizer.size=Math.max(min,Math.min(hint,max2)),totalSize+=sizer.size,totalMin+=min,totalMax+=max2,sizer.stretch>0&&(totalStretch+=sizer.stretch,stretchCount++)}if(space===totalSize)return 0;if(space<=totalMin){for(var i=0;i<count;++i){var sizer=sizers[i];sizer.size=sizer.minSize}return space-totalMin}if(space>=totalMax){for(var i=0;i<count;++i){var sizer=sizers[i];sizer.size=sizer.maxSize}return space-totalMax}var nearZero=.01,notDoneCount=count;if(space<totalSize){for(var freeSpace=totalSize-space;stretchCount>0&&freeSpace>nearZero;)for(var distSpace=freeSpace,distStretch=totalStretch,i=0;i<count;++i){var sizer=sizers[i];if(!(sizer.done||sizer.stretch===0)){var amt=sizer.stretch*distSpace/distStretch;sizer.size-amt<=sizer.minSize?(freeSpace-=sizer.size-sizer.minSize,totalStretch-=sizer.stretch,sizer.size=sizer.minSize,sizer.done=!0,notDoneCount--,stretchCount--):(freeSpace-=amt,sizer.size-=amt)}}for(;notDoneCount>0&&freeSpace>nearZero;)for(var amt=freeSpace/notDoneCount,i=0;i<count;++i){var sizer=sizers[i];sizer.done||(sizer.size-amt<=sizer.minSize?(freeSpace-=sizer.size-sizer.minSize,sizer.size=sizer.minSize,sizer.done=!0,notDoneCount--):(freeSpace-=amt,sizer.size-=amt))}}else{for(var freeSpace=space-totalSize;stretchCount>0&&freeSpace>nearZero;)for(var distSpace=freeSpace,distStretch=totalStretch,i=0;i<count;++i){var sizer=sizers[i];if(!(sizer.done||sizer.stretch===0)){var amt=sizer.stretch*distSpace/distStretch;sizer.size+amt>=sizer.maxSize?(freeSpace-=sizer.maxSize-sizer.size,totalStretch-=sizer.stretch,sizer.size=sizer.maxSize,sizer.done=!0,notDoneCount--,stretchCount--):(freeSpace-=amt,sizer.size+=amt)}}for(;notDoneCount>0&&freeSpace>nearZero;)for(var amt=freeSpace/notDoneCount,i=0;i<count;++i){var sizer=sizers[i];sizer.done||(sizer.size+amt>=sizer.maxSize?(freeSpace-=sizer.maxSize-sizer.size,sizer.size=sizer.maxSize,sizer.done=!0,notDoneCount--):(freeSpace-=amt,sizer.size+=amt))}}return 0}BoxEngine2.calc=calc;function adjust(sizers,index,delta){sizers.length===0||delta===0||(delta>0?growSizer(sizers,index,delta):shrinkSizer(sizers,index,-delta))}BoxEngine2.adjust=adjust;function growSizer(sizers,index,delta){for(var growLimit=0,i=0;i<=index;++i){var sizer=sizers[i];growLimit+=sizer.maxSize-sizer.size}for(var shrinkLimit=0,i=index+1,n=sizers.length;i<n;++i){var sizer=sizers[i];shrinkLimit+=sizer.size-sizer.minSize}delta=Math.min(delta,growLimit,shrinkLimit);for(var grow=delta,i=index;i>=0&&grow>0;--i){var sizer=sizers[i],limit=sizer.maxSize-sizer.size;limit>=grow?(sizer.sizeHint=sizer.size+grow,grow=0):(sizer.sizeHint=sizer.size+limit,grow-=limit)}for(var shrink=delta,i=index+1,n=sizers.length;i<n&&shrink>0;++i){var sizer=sizers[i],limit=sizer.size-sizer.minSize;limit>=shrink?(sizer.sizeHint=sizer.size-shrink,shrink=0):(sizer.sizeHint=sizer.size-limit,shrink-=limit)}}function shrinkSizer(sizers,index,delta){for(var growLimit=0,i=index+1,n=sizers.length;i<n;++i){var sizer=sizers[i];growLimit+=sizer.maxSize-sizer.size}for(var shrinkLimit=0,i=0;i<=index;++i){var sizer=sizers[i];shrinkLimit+=sizer.size-sizer.minSize}delta=Math.min(delta,growLimit,shrinkLimit);for(var grow=delta,i=index+1,n=sizers.length;i<n&&grow>0;++i){var sizer=sizers[i],limit=sizer.maxSize-sizer.size;limit>=grow?(sizer.sizeHint=sizer.size+grow,grow=0):(sizer.sizeHint=sizer.size+limit,grow-=limit)}for(var shrink=delta,i=index;i>=0&&shrink>0;--i){var sizer=sizers[i],limit=sizer.size-sizer.minSize;limit>=shrink?(sizer.sizeHint=sizer.size-shrink,shrink=0):(sizer.sizeHint=sizer.size-limit,shrink-=limit)}}})(BoxEngine||(BoxEngine={}));var Title=function(){function Title2(options){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Signal(this),this._isDisposed=!1,this.owner=options.owner,options.label!==void 0&&(this._label=options.label),options.mnemonic!==void 0&&(this._mnemonic=options.mnemonic),options.icon!==void 0?typeof options.icon=="string"?(this._icon=null,this._iconClass=options.icon):this._icon=options.icon:this._icon=null,options.iconClass!==void 0&&(this._iconClass=options.iconClass),options.iconLabel!==void 0&&(this._iconLabel=options.iconLabel),options.iconRenderer!==void 0&&(this._icon=options.iconRenderer),options.caption!==void 0&&(this._caption=options.caption),options.className!==void 0&&(this._className=options.className),options.closable!==void 0&&(this._closable=options.closable),this._dataset=options.dataset||{}}return Object.defineProperty(Title2.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"label",{get:function(){return this._label},set:function(value){this._label!==value&&(this._label=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(value){this._mnemonic!==value&&(this._mnemonic=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"icon",{get:function(){return this._icon===null?this.iconClass:this._icon},set:function(value){if(typeof value=="string")this._icon=null,this.iconClass=value;else{if(this._icon===value)return;this._icon=value,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"iconClass",{get:function(){return this._iconClass},set:function(value){this._iconClass!==value&&(this._iconClass=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(value){this._iconLabel!==value&&(this._iconLabel=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(value){this.icon=value},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"caption",{get:function(){return this._caption},set:function(value){this._caption!==value&&(this._caption=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"className",{get:function(){return this._className},set:function(value){this._className!==value&&(this._className=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"closable",{get:function(){return this._closable},set:function(value){this._closable!==value&&(this._closable=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"dataset",{get:function(){return this._dataset},set:function(value){this._dataset!==value&&(this._dataset=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),Title2.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,Signal.clearData(this))},Title2}(),Widget=function(){function Widget2(options){options===void 0&&(options={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new Signal(this),this._hiddenMode=Widget2.HiddenMode.Display,this.node=Private$j.createNode(options),this.addClass("lm-Widget"),this.addClass("p-Widget")}return Widget2.prototype.dispose=function(){this.isDisposed||(this.setFlag(Widget2.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&Widget2.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Signal.clearData(this),MessageLoop.clearData(this),AttachedProperty.clearData(this))},Object.defineProperty(Widget2.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isDisposed",{get:function(){return this.testFlag(Widget2.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isAttached",{get:function(){return this.testFlag(Widget2.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isHidden",{get:function(){return this.testFlag(Widget2.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isVisible",{get:function(){return this.testFlag(Widget2.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"title",{get:function(){return Private$j.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"id",{get:function(){return this.node.id},set:function(value){this.node.id=value},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(value){this._hiddenMode!==value&&(this.isHidden&&this._toggleHidden(!1),value==Widget2.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=value,this.isHidden&&this._toggleHidden(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"parent",{get:function(){return this._parent},set:function(value){if(this._parent!==value){if(value&&this.contains(value))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var msg=new Widget2.ChildMessage("child-removed",this);MessageLoop.sendMessage(this._parent,msg)}if(this._parent=value,this._parent&&!this._parent.isDisposed){var msg=new Widget2.ChildMessage("child-added",this);MessageLoop.sendMessage(this._parent,msg)}this.isDisposed||MessageLoop.sendMessage(this,Widget2.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"layout",{get:function(){return this._layout},set:function(value){if(this._layout!==value){if(this.testFlag(Widget2.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(value.parent)throw new Error("Cannot change layout parent.");this._layout=value,value.parent=this}},enumerable:!0,configurable:!0}),Widget2.prototype.children=function(){return this._layout?this._layout.iter():empty()},Widget2.prototype.contains=function(widget){for(var value=widget;value;value=value._parent)if(value===this)return!0;return!1},Widget2.prototype.hasClass=function(name2){return this.node.classList.contains(name2)},Widget2.prototype.addClass=function(name2){this.node.classList.add(name2)},Widget2.prototype.removeClass=function(name2){this.node.classList.remove(name2)},Widget2.prototype.toggleClass=function(name2,force){return force===!0?(this.node.classList.add(name2),!0):force===!1?(this.node.classList.remove(name2),!1):this.node.classList.toggle(name2)},Widget2.prototype.update=function(){MessageLoop.postMessage(this,Widget2.Msg.UpdateRequest)},Widget2.prototype.fit=function(){MessageLoop.postMessage(this,Widget2.Msg.FitRequest)},Widget2.prototype.activate=function(){MessageLoop.postMessage(this,Widget2.Msg.ActivateRequest)},Widget2.prototype.close=function(){MessageLoop.sendMessage(this,Widget2.Msg.CloseRequest)},Widget2.prototype.show=function(){if(this.testFlag(Widget2.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.BeforeShow),this.clearFlag(Widget2.Flag.IsHidden),this.node.removeAttribute("aria-hidden"),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.AfterShow),this.parent)){var msg=new Widget2.ChildMessage("child-shown",this);MessageLoop.sendMessage(this.parent,msg)}},Widget2.prototype.hide=function(){if(!this.testFlag(Widget2.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.BeforeHide),this.setFlag(Widget2.Flag.IsHidden),this.node.setAttribute("aria-hidden","true"),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.AfterHide),this.parent)){var msg=new Widget2.ChildMessage("child-hidden",this);MessageLoop.sendMessage(this.parent,msg)}},Widget2.prototype.setHidden=function(hidden){hidden?this.hide():this.show()},Widget2.prototype.testFlag=function(flag){return(this._flags&flag)!==0},Widget2.prototype.setFlag=function(flag){this._flags|=flag},Widget2.prototype.clearFlag=function(flag){this._flags&=~flag},Widget2.prototype.processMessage=function(msg){switch(msg.type){case"resize":this.notifyLayout(msg),this.onResize(msg);break;case"update-request":this.notifyLayout(msg),this.onUpdateRequest(msg);break;case"fit-request":this.notifyLayout(msg),this.onFitRequest(msg);break;case"before-show":this.notifyLayout(msg),this.onBeforeShow(msg);break;case"after-show":this.setFlag(Widget2.Flag.IsVisible),this.notifyLayout(msg),this.onAfterShow(msg);break;case"before-hide":this.notifyLayout(msg),this.onBeforeHide(msg);break;case"after-hide":this.clearFlag(Widget2.Flag.IsVisible),this.notifyLayout(msg),this.onAfterHide(msg);break;case"before-attach":this.notifyLayout(msg),this.onBeforeAttach(msg);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(Widget2.Flag.IsVisible),this.setFlag(Widget2.Flag.IsAttached),this.notifyLayout(msg),this.onAfterAttach(msg);break;case"before-detach":this.notifyLayout(msg),this.onBeforeDetach(msg);break;case"after-detach":this.clearFlag(Widget2.Flag.IsVisible),this.clearFlag(Widget2.Flag.IsAttached),this.notifyLayout(msg),this.onAfterDetach(msg);break;case"activate-request":this.notifyLayout(msg),this.onActivateRequest(msg);break;case"close-request":this.notifyLayout(msg),this.onCloseRequest(msg);break;case"child-added":this.notifyLayout(msg),this.onChildAdded(msg);break;case"child-removed":this.notifyLayout(msg),this.onChildRemoved(msg);break;default:this.notifyLayout(msg);break}},Widget2.prototype.notifyLayout=function(msg){this._layout&&this._layout.processParentMessage(msg)},Widget2.prototype.onCloseRequest=function(msg){this.parent?this.parent=null:this.isAttached&&Widget2.detach(this)},Widget2.prototype.onResize=function(msg){},Widget2.prototype.onUpdateRequest=function(msg){},Widget2.prototype.onFitRequest=function(msg){},Widget2.prototype.onActivateRequest=function(msg){},Widget2.prototype.onBeforeShow=function(msg){},Widget2.prototype.onAfterShow=function(msg){},Widget2.prototype.onBeforeHide=function(msg){},Widget2.prototype.onAfterHide=function(msg){},Widget2.prototype.onBeforeAttach=function(msg){},Widget2.prototype.onAfterAttach=function(msg){},Widget2.prototype.onBeforeDetach=function(msg){},Widget2.prototype.onAfterDetach=function(msg){},Widget2.prototype.onChildAdded=function(msg){},Widget2.prototype.onChildRemoved=function(msg){},Widget2.prototype._toggleHidden=function(hidden){if(hidden)switch(this._hiddenMode){case Widget2.HiddenMode.Display:this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden");break;case Widget2.HiddenMode.Scale:this.node.style.transform="scale(0)";break;case Widget2.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case Widget2.HiddenMode.Display:this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden");break;case Widget2.HiddenMode.Scale:this.node.style.transform="";break;case Widget2.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}},Widget2}();(function(Widget2){(function(HiddenMode){HiddenMode[HiddenMode.Display=0]="Display",HiddenMode[HiddenMode.Scale=1]="Scale",HiddenMode[HiddenMode.ContentVisibility=2]="ContentVisibility"})(Widget2.HiddenMode||(Widget2.HiddenMode={})),function(Flag){Flag[Flag.IsDisposed=1]="IsDisposed",Flag[Flag.IsAttached=2]="IsAttached",Flag[Flag.IsHidden=4]="IsHidden",Flag[Flag.IsVisible=8]="IsVisible",Flag[Flag.DisallowLayout=16]="DisallowLayout"}(Widget2.Flag||(Widget2.Flag={})),function(Msg){Msg.BeforeShow=new Message("before-show"),Msg.AfterShow=new Message("after-show"),Msg.BeforeHide=new Message("before-hide"),Msg.AfterHide=new Message("after-hide"),Msg.BeforeAttach=new Message("before-attach"),Msg.AfterAttach=new Message("after-attach"),Msg.BeforeDetach=new Message("before-detach"),Msg.AfterDetach=new Message("after-detach"),Msg.ParentChanged=new Message("parent-changed"),Msg.UpdateRequest=new ConflatableMessage("update-request"),Msg.FitRequest=new ConflatableMessage("fit-request"),Msg.ActivateRequest=new ConflatableMessage("activate-request"),Msg.CloseRequest=new ConflatableMessage("close-request")}(Widget2.Msg||(Widget2.Msg={}));var ChildMessage=function(_super){__extends(ChildMessage2,_super);function ChildMessage2(type,child){var _this=_super.call(this,type)||this;return _this.child=child,_this}return ChildMessage2}(Message);Widget2.ChildMessage=ChildMessage;var ResizeMessage=function(_super){__extends(ResizeMessage2,_super);function ResizeMessage2(width,height){var _this=_super.call(this,"resize")||this;return _this.width=width,_this.height=height,_this}return ResizeMessage2}(Message);Widget2.ResizeMessage=ResizeMessage,function(ResizeMessage2){ResizeMessage2.UnknownSize=new ResizeMessage2(-1,-1)}(ResizeMessage=Widget2.ResizeMessage||(Widget2.ResizeMessage={}));function attach(widget,host,ref){if(ref===void 0&&(ref=null),widget.parent)throw new Error("Cannot attach a child widget.");if(widget.isAttached||widget.node.isConnected)throw new Error("Widget is already attached.");if(!host.isConnected)throw new Error("Host is not attached.");MessageLoop.sendMessage(widget,Widget2.Msg.BeforeAttach),host.insertBefore(widget.node,ref),MessageLoop.sendMessage(widget,Widget2.Msg.AfterAttach)}Widget2.attach=attach;function detach(widget){if(widget.parent)throw new Error("Cannot detach a child widget.");if(!widget.isAttached||!widget.node.isConnected)throw new Error("Widget is not attached.");MessageLoop.sendMessage(widget,Widget2.Msg.BeforeDetach),widget.node.parentNode.removeChild(widget.node),MessageLoop.sendMessage(widget,Widget2.Msg.AfterDetach)}Widget2.detach=detach})(Widget||(Widget={}));var Private$j;(function(Private2){Private2.titleProperty=new AttachedProperty({name:"title",create:function(owner){return new Title({owner})}});function createNode(options){return options.node||document.createElement(options.tag||"div")}Private2.createNode=createNode})(Private$j||(Private$j={}));var Layout=function(){function Layout2(options){options===void 0&&(options={}),this._disposed=!1,this._parent=null,this._fitPolicy=options.fitPolicy||"set-min-size"}return Layout2.prototype.dispose=function(){this._parent=null,this._disposed=!0,Signal.clearData(this),AttachedProperty.clearData(this)},Object.defineProperty(Layout2.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(Layout2.prototype,"parent",{get:function(){return this._parent},set:function(value){if(this._parent!==value){if(this._parent)throw new Error("Cannot change parent widget.");if(value.layout!==this)throw new Error("Invalid parent widget.");this._parent=value,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(Layout2.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(value){if(this._fitPolicy!==value&&(this._fitPolicy=value,this._parent)){var style=this._parent.node.style;style.minWidth="",style.minHeight="",style.maxWidth="",style.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),Layout2.prototype.processParentMessage=function(msg){switch(msg.type){case"resize":this.onResize(msg);break;case"update-request":this.onUpdateRequest(msg);break;case"fit-request":this.onFitRequest(msg);break;case"before-show":this.onBeforeShow(msg);break;case"after-show":this.onAfterShow(msg);break;case"before-hide":this.onBeforeHide(msg);break;case"after-hide":this.onAfterHide(msg);break;case"before-attach":this.onBeforeAttach(msg);break;case"after-attach":this.onAfterAttach(msg);break;case"before-detach":this.onBeforeDetach(msg);break;case"after-detach":this.onAfterDetach(msg);break;case"child-removed":this.onChildRemoved(msg);break;case"child-shown":this.onChildShown(msg);break;case"child-hidden":this.onChildHidden(msg);break}},Layout2.prototype.init=function(){var _this=this;each(this,function(widget){widget.parent=_this.parent})},Layout2.prototype.onResize=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,Widget.ResizeMessage.UnknownSize)})},Layout2.prototype.onUpdateRequest=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,Widget.ResizeMessage.UnknownSize)})},Layout2.prototype.onBeforeAttach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterAttach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onBeforeDetach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterDetach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onBeforeShow=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterShow=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onBeforeHide=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterHide=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onChildRemoved=function(msg){this.removeWidget(msg.child)},Layout2.prototype.onFitRequest=function(msg){},Layout2.prototype.onChildShown=function(msg){},Layout2.prototype.onChildHidden=function(msg){},Layout2}();(function(Layout2){function getHorizontalAlignment(widget){return Private$i.horizontalAlignmentProperty.get(widget)}Layout2.getHorizontalAlignment=getHorizontalAlignment;function setHorizontalAlignment(widget,value){Private$i.horizontalAlignmentProperty.set(widget,value)}Layout2.setHorizontalAlignment=setHorizontalAlignment;function getVerticalAlignment(widget){return Private$i.verticalAlignmentProperty.get(widget)}Layout2.getVerticalAlignment=getVerticalAlignment;function setVerticalAlignment(widget,value){Private$i.verticalAlignmentProperty.set(widget,value)}Layout2.setVerticalAlignment=setVerticalAlignment})(Layout||(Layout={}));var LayoutItem=function(){function LayoutItem2(widget){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=widget,this.widget.node.style.position="absolute"}return LayoutItem2.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var style=this.widget.node.style;style.position="",style.top="",style.left="",style.width="",style.height=""}},Object.defineProperty(LayoutItem2.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),LayoutItem2.prototype.fit=function(){var limits=ElementExt.sizeLimits(this.widget.node);this._minWidth=limits.minWidth,this._minHeight=limits.minHeight,this._maxWidth=limits.maxWidth,this._maxHeight=limits.maxHeight},LayoutItem2.prototype.update=function(left,top,width,height){var clampW=Math.max(this._minWidth,Math.min(width,this._maxWidth)),clampH=Math.max(this._minHeight,Math.min(height,this._maxHeight));if(clampW<width)switch(Layout.getHorizontalAlignment(this.widget)){case"left":break;case"center":left+=(width-clampW)/2;break;case"right":left+=width-clampW;break;default:throw"unreachable"}if(clampH<height)switch(Layout.getVerticalAlignment(this.widget)){case"top":break;case"center":top+=(height-clampH)/2;break;case"bottom":top+=height-clampH;break;default:throw"unreachable"}var resized=!1,style=this.widget.node.style;if(this._top!==top&&(this._top=top,style.top=top+"px"),this._left!==left&&(this._left=left,style.left=left+"px"),this._width!==clampW&&(resized=!0,this._width=clampW,style.width=clampW+"px"),this._height!==clampH&&(resized=!0,this._height=clampH,style.height=clampH+"px"),resized){var msg=new Widget.ResizeMessage(clampW,clampH);MessageLoop.sendMessage(this.widget,msg)}},LayoutItem2}(),Private$i;(function(Private2){Private2.horizontalAlignmentProperty=new AttachedProperty({name:"horizontalAlignment",create:function(){return"center"},changed:onAlignmentChanged}),Private2.verticalAlignmentProperty=new AttachedProperty({name:"verticalAlignment",create:function(){return"top"},changed:onAlignmentChanged});function onAlignmentChanged(child){child.parent&&child.parent.layout&&child.parent.update()}})(Private$i||(Private$i={}));var PanelLayout=function(_super){__extends(PanelLayout2,_super);function PanelLayout2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._widgets=[],_this}return PanelLayout2.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();_super.prototype.dispose.call(this)},Object.defineProperty(PanelLayout2.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),PanelLayout2.prototype.iter=function(){return iter(this._widgets)},PanelLayout2.prototype.addWidget=function(widget){this.insertWidget(this._widgets.length,widget)},PanelLayout2.prototype.insertWidget=function(index,widget){widget.parent=this.parent;var i=this._widgets.indexOf(widget),j=Math.max(0,Math.min(index,this._widgets.length));if(i===-1){ArrayExt.insert(this._widgets,j,widget),this.parent&&this.attachWidget(j,widget);return}j===this._widgets.length&&j--,i!==j&&(ArrayExt.move(this._widgets,i,j),this.parent&&this.moveWidget(i,j,widget))},PanelLayout2.prototype.removeWidget=function(widget){this.removeWidgetAt(this._widgets.indexOf(widget))},PanelLayout2.prototype.removeWidgetAt=function(index){var widget=ArrayExt.removeAt(this._widgets,index);widget&&this.parent&&this.detachWidget(index,widget)},PanelLayout2.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget,index){_this.attachWidget(index,widget)})},PanelLayout2.prototype.attachWidget=function(index,widget){var ref=this.parent.node.children[index];this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.insertBefore(widget.node,ref),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach)},PanelLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach);var ref=this.parent.node.children[toIndex];this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.insertBefore(widget.node,ref),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach)},PanelLayout2.prototype.detachWidget=function(index,widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach)},PanelLayout2}(Layout),Utils;(function(Utils2){function clampDimension(value){return Math.max(0,Math.floor(value))}Utils2.clampDimension=clampDimension})(Utils||(Utils={}));var Utils$1=Utils,SplitLayout=function(_super){__extends(SplitLayout2,_super);function SplitLayout2(options){var _this=_super.call(this)||this;return _this.widgetOffset=0,_this._fixed=0,_this._spacing=4,_this._dirty=!1,_this._hasNormedSizes=!1,_this._sizers=[],_this._items=[],_this._handles=[],_this._box=null,_this._alignment="start",_this._orientation="horizontal",_this.renderer=options.renderer,options.orientation!==void 0&&(_this._orientation=options.orientation),options.alignment!==void 0&&(_this._alignment=options.alignment),options.spacing!==void 0&&(_this._spacing=Utils.clampDimension(options.spacing)),_this}return SplitLayout2.prototype.dispose=function(){each(this._items,function(item){item.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(SplitLayout2.prototype,"orientation",{get:function(){return this._orientation},set:function(value){this._orientation!==value&&(this._orientation=value,this.parent&&(this.parent.dataset.orientation=value,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(SplitLayout2.prototype,"alignment",{get:function(){return this._alignment},set:function(value){this._alignment!==value&&(this._alignment=value,this.parent&&(this.parent.dataset.alignment=value,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(SplitLayout2.prototype,"spacing",{get:function(){return this._spacing},set:function(value){value=Utils.clampDimension(value),this._spacing!==value&&(this._spacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(SplitLayout2.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),SplitLayout2.prototype.absoluteSizes=function(){return this._sizers.map(function(sizer){return sizer.size})},SplitLayout2.prototype.relativeSizes=function(){return Private$h.normalize(this._sizers.map(function(sizer){return sizer.size}))},SplitLayout2.prototype.setRelativeSizes=function(sizes,update){update===void 0&&(update=!0);for(var n=this._sizers.length,temp=sizes.slice(0,n);temp.length<n;)temp.push(0);for(var normed=Private$h.normalize(temp),i=0;i<n;++i){var sizer=this._sizers[i];sizer.sizeHint=normed[i],sizer.size=normed[i]}this._hasNormedSizes=!0,update&&this.parent&&this.parent.update()},SplitLayout2.prototype.moveHandle=function(index,position){var handle=this._handles[index];if(!(!handle||handle.classList.contains("lm-mod-hidden"))){var delta;if(this._orientation==="horizontal"?delta=position-handle.offsetLeft:delta=position-handle.offsetTop,delta!==0){for(var _i=0,_a=this._sizers;_i<_a.length;_i++){var sizer=_a[_i];sizer.size>0&&(sizer.sizeHint=sizer.size)}BoxEngine.adjust(this._sizers,index,delta),this.parent&&this.parent.update()}}},SplitLayout2.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,_super.prototype.init.call(this)},SplitLayout2.prototype.attachWidget=function(index,widget){var item=new LayoutItem(widget),handle=Private$h.createHandle(this.renderer),average=Private$h.averageSize(this._sizers),sizer=Private$h.createSizer(average);ArrayExt.insert(this._items,index,item),ArrayExt.insert(this._sizers,index,sizer),ArrayExt.insert(this._handles,index,handle),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.node.appendChild(handle),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},SplitLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._items,fromIndex,toIndex),ArrayExt.move(this._sizers,fromIndex,toIndex),ArrayExt.move(this._handles,fromIndex,toIndex),this.parent.fit()},SplitLayout2.prototype.detachWidget=function(index,widget){var item=ArrayExt.removeAt(this._items,index),handle=ArrayExt.removeAt(this._handles,index);ArrayExt.removeAt(this._sizers,index),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.node.removeChild(handle),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),item.dispose(),this.parent.fit()},SplitLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},SplitLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},SplitLayout2.prototype.onChildShown=function(msg){this.parent.fit()},SplitLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},SplitLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},SplitLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},SplitLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},SplitLayout2.prototype.updateItemPosition=function(i,isHorizontal,left,top,height,width,size){var item=this._items[i];if(!item.isHidden){var handleStyle=this._handles[i].style;isHorizontal?(left+=this.widgetOffset,item.update(left,top,size,height),left+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=this._spacing+"px",handleStyle.height=height+"px"):(top+=this.widgetOffset,item.update(left,top,width,size),top+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=width+"px",handleStyle.height=this._spacing+"px")}},SplitLayout2.prototype._fit=function(){for(var nVisible=0,lastHandleIndex=-1,i=0,n=this._items.length;i<n;++i)this._items[i].isHidden?(this._handles[i].classList.add("lm-mod-hidden"),this._handles[i].classList.add("p-mod-hidden")):(this._handles[i].classList.remove("lm-mod-hidden"),this._handles[i].classList.remove("p-mod-hidden"),lastHandleIndex=i,nVisible++);lastHandleIndex!==-1&&(this._handles[lastHandleIndex].classList.add("lm-mod-hidden"),this._handles[lastHandleIndex].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,nVisible-1)+this.widgetOffset*this._items.length;for(var horz=this._orientation==="horizontal",minW=horz?this._fixed:0,minH=horz?0:this._fixed,i=0,n=this._items.length;i<n;++i){var item=this._items[i],sizer=this._sizers[i];if(sizer.size>0&&(sizer.sizeHint=sizer.size),item.isHidden){sizer.minSize=0,sizer.maxSize=0;continue}item.fit(),sizer.stretch=SplitLayout2.getStretch(item.widget),horz?(sizer.minSize=item.minWidth,sizer.maxSize=item.maxWidth,minW+=item.minWidth,minH=Math.max(minH,item.minHeight)):(sizer.minSize=item.minHeight,sizer.maxSize=item.maxHeight,minH+=item.minHeight,minW=Math.max(minW,item.minWidth))}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},SplitLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1;for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;if(!(nVisible===0&&this.widgetOffset===0)){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,extra=0,offset=0,horz=this._orientation==="horizontal";if(nVisible>0){var space=void 0;if(horz?space=Math.max(0,width-this._fixed):space=Math.max(0,height-this._fixed),this._hasNormedSizes){for(var _i=0,_a=this._sizers;_i<_a.length;_i++){var sizer=_a[_i];sizer.sizeHint*=space}this._hasNormedSizes=!1}var delta=BoxEngine.calc(this._sizers,space);if(delta>0)switch(this._alignment){case"start":break;case"center":extra=0,offset=delta/2;break;case"end":extra=0,offset=delta;break;case"justify":extra=delta/nVisible,offset=0;break;default:throw"unreachable"}}for(var i=0,n=this._items.length;i<n;++i){var item=this._items[i],size=item.isHidden?0:this._sizers[i].size+extra;this.updateItemPosition(i,horz,horz?left+offset:left,horz?top:top+offset,height,width,size);var fullOffset=this.widgetOffset+(this._handles[i].classList.contains("lm-mod-hidden")?0:this._spacing);horz?left+=size+fullOffset:top+=size+fullOffset}}},SplitLayout2}(PanelLayout);(function(SplitLayout2){function getStretch(widget){return Private$h.stretchProperty.get(widget)}SplitLayout2.getStretch=getStretch;function setStretch(widget,value){Private$h.stretchProperty.set(widget,value)}SplitLayout2.setStretch=setStretch})(SplitLayout||(SplitLayout={}));var Private$h;(function(Private2){Private2.stretchProperty=new AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(owner,value){return Math.max(0,Math.floor(value))},changed:onChildSizingChanged});function createSizer(size){var sizer=new BoxSizer;return sizer.sizeHint=Math.floor(size),sizer}Private2.createSizer=createSizer;function createHandle(renderer){var handle=renderer.createHandle();return handle.style.position="absolute",handle}Private2.createHandle=createHandle;function averageSize(sizers){return sizers.reduce(function(v,s){return v+s.size},0)/sizers.length||0}Private2.averageSize=averageSize;function normalize(values){var n=values.length;if(n===0)return[];var sum=values.reduce(function(a,b){return a+Math.abs(b)},0);return sum===0?values.map(function(v){return 1/n}):values.map(function(v){return v/sum})}Private2.normalize=normalize;function onChildSizingChanged(child){child.parent&&child.parent.layout instanceof SplitLayout&&child.parent.fit()}})(Private$h||(Private$h={}));var AccordionLayout=function(_super){__extends(AccordionLayout2,_super);function AccordionLayout2(options){var _this=_super.call(this,__assign(__assign({},options),{orientation:options.orientation||"vertical"}))||this;return _this._titles=[],_this.titleSpace=options.titleSpace||22,_this}return Object.defineProperty(AccordionLayout2.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(value){value=Utils$1.clampDimension(value),this.widgetOffset!==value&&(this.widgetOffset=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(AccordionLayout2.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),AccordionLayout2.prototype.dispose=function(){this.isDisposed||(this._titles.length=0,_super.prototype.dispose.call(this))},AccordionLayout2.prototype.updateTitle=function(index,widget){var oldTitle=this._titles[index],expanded=oldTitle.classList.contains("lm-mod-expanded"),newTitle=Private$g.createTitle(this.renderer,widget.title,expanded);this._titles[index]=newTitle,this.parent.node.replaceChild(newTitle,oldTitle)},AccordionLayout2.prototype.attachWidget=function(index,widget){var title=Private$g.createTitle(this.renderer,widget.title);ArrayExt.insert(this._titles,index,title),this.parent.node.appendChild(title),widget.node.setAttribute("role","region"),widget.node.setAttribute("aria-labelledby",title.id),_super.prototype.attachWidget.call(this,index,widget)},AccordionLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._titles,fromIndex,toIndex),_super.prototype.moveWidget.call(this,fromIndex,toIndex,widget)},AccordionLayout2.prototype.detachWidget=function(index,widget){var title=ArrayExt.removeAt(this._titles,index);this.parent.node.removeChild(title),_super.prototype.detachWidget.call(this,index,widget)},AccordionLayout2.prototype.updateItemPosition=function(i,isHorizontal,left,top,height,width,size){var titleStyle=this._titles[i].style;titleStyle.top=top+"px",titleStyle.left=left+"px",titleStyle.height=this.widgetOffset+"px",isHorizontal?titleStyle.width=height+"px":titleStyle.width=width+"px",_super.prototype.updateItemPosition.call(this,i,isHorizontal,left,top,height,width,size)},AccordionLayout2}(SplitLayout),Private$g;(function(Private2){function createTitle(renderer,data,expanded){expanded===void 0&&(expanded=!0);var title=renderer.createSectionTitle(data);return title.style.position="absolute",title.setAttribute("aria-label",data.label+" Section"),title.setAttribute("aria-expanded",expanded?"true":"false"),title.setAttribute("aria-controls",data.owner.id),expanded&&title.classList.add("lm-mod-expanded"),title}Private2.createTitle=createTitle})(Private$g||(Private$g={}));var Panel=function(_super){__extends(Panel2,_super);function Panel2(options){options===void 0&&(options={});var _this=_super.call(this)||this;return _this.addClass("lm-Panel"),_this.addClass("p-Panel"),_this.layout=Private$f.createLayout(options),_this}return Object.defineProperty(Panel2.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),Panel2.prototype.addWidget=function(widget){this.layout.addWidget(widget)},Panel2.prototype.insertWidget=function(index,widget){this.layout.insertWidget(index,widget)},Panel2}(Widget),Private$f;(function(Private2){function createLayout(options){return options.layout||new PanelLayout}Private2.createLayout=createLayout})(Private$f||(Private$f={}));var SplitPanel$1=function(_super){__extends(SplitPanel2,_super);function SplitPanel2(options){options===void 0&&(options={});var _this=_super.call(this,{layout:Private$e.createLayout(options)})||this;return _this._handleMoved=new Signal(_this),_this._pressData=null,_this.addClass("lm-SplitPanel"),_this.addClass("p-SplitPanel"),_this}return SplitPanel2.prototype.dispose=function(){this._releaseMouse(),_super.prototype.dispose.call(this)},Object.defineProperty(SplitPanel2.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(value){this.layout.orientation=value},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(value){this.layout.alignment=value},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(value){this.layout.spacing=value},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"handleMoved",{get:function(){return this._handleMoved},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),SplitPanel2.prototype.relativeSizes=function(){return this.layout.relativeSizes()},SplitPanel2.prototype.setRelativeSizes=function(sizes,update){update===void 0&&(update=!0),this.layout.setRelativeSizes(sizes,update)},SplitPanel2.prototype.handleEvent=function(event){switch(event.type){case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointerdown":this._evtMouseDown(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},SplitPanel2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},SplitPanel2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},SplitPanel2.prototype.onChildAdded=function(msg){msg.child.addClass("lm-SplitPanel-child"),msg.child.addClass("p-SplitPanel-child"),this._releaseMouse()},SplitPanel2.prototype.onChildRemoved=function(msg){msg.child.removeClass("lm-SplitPanel-child"),msg.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},SplitPanel2.prototype._evtKeyDown=function(event){this._pressData&&(event.preventDefault(),event.stopPropagation()),event.keyCode===27&&this._releaseMouse()},SplitPanel2.prototype._evtMouseDown=function(event){if(event.button===0){var layout=this.layout,index=ArrayExt.findFirstIndex(layout.handles,function(handle2){return handle2.contains(event.target)});if(index!==-1){event.preventDefault(),event.stopPropagation(),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var delta,handle=layout.handles[index],rect=handle.getBoundingClientRect();layout.orientation==="horizontal"?delta=event.clientX-rect.left:delta=event.clientY-rect.top;var style=window.getComputedStyle(handle),override=Drag.overrideCursor(style.cursor);this._pressData={index,delta,override}}}},SplitPanel2.prototype._evtMouseMove=function(event){event.preventDefault(),event.stopPropagation();var pos,layout=this.layout,rect=this.node.getBoundingClientRect();layout.orientation==="horizontal"?pos=event.clientX-rect.left-this._pressData.delta:pos=event.clientY-rect.top-this._pressData.delta,layout.moveHandle(this._pressData.index,pos)},SplitPanel2.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this._releaseMouse())},SplitPanel2.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))},SplitPanel2}(Panel);(function(SplitPanel2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.createHandle=function(){var handle=document.createElement("div");return handle.className="lm-SplitPanel-handle",handle.classList.add("p-SplitPanel-handle"),handle},Renderer2}();SplitPanel2.Renderer=Renderer,SplitPanel2.defaultRenderer=new Renderer;function getStretch(widget){return SplitLayout.getStretch(widget)}SplitPanel2.getStretch=getStretch;function setStretch(widget,value){SplitLayout.setStretch(widget,value)}SplitPanel2.setStretch=setStretch})(SplitPanel$1||(SplitPanel$1={}));var Private$e;(function(Private2){function createLayout(options){return options.layout||new SplitLayout({renderer:options.renderer||SplitPanel$1.defaultRenderer,orientation:options.orientation,alignment:options.alignment,spacing:options.spacing})}Private2.createLayout=createLayout})(Private$e||(Private$e={}));var AccordionPanel=function(_super){__extends(AccordionPanel2,_super);function AccordionPanel2(options){options===void 0&&(options={});var _this=_super.call(this,__assign(__assign({},options),{layout:Private$d.createLayout(options)}))||this;return _this._widgetSizesCache=new WeakMap,_this.addClass("lm-AccordionPanel"),_this}return Object.defineProperty(AccordionPanel2.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(AccordionPanel2.prototype,"titleSpace",{get:function(){return this.layout.titleSpace},set:function(value){this.layout.titleSpace=value},enumerable:!0,configurable:!0}),Object.defineProperty(AccordionPanel2.prototype,"titles",{get:function(){return this.layout.titles},enumerable:!0,configurable:!0}),AccordionPanel2.prototype.addWidget=function(widget){_super.prototype.addWidget.call(this,widget),widget.title.changed.connect(this._onTitleChanged,this)},AccordionPanel2.prototype.collapse=function(index){var widget=this.layout.widgets[index];widget&&!widget.isHidden&&this._toggleExpansion(index)},AccordionPanel2.prototype.expand=function(index){var widget=this.layout.widgets[index];widget&&widget.isHidden&&this._toggleExpansion(index)},AccordionPanel2.prototype.insertWidget=function(index,widget){_super.prototype.insertWidget.call(this,index,widget),widget.title.changed.connect(this._onTitleChanged,this)},AccordionPanel2.prototype.handleEvent=function(event){switch(_super.prototype.handleEvent.call(this,event),event.type){case"click":this._evtClick(event);break;case"keydown":this._eventKeyDown(event);break}},AccordionPanel2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),_super.prototype.onBeforeAttach.call(this,msg)},AccordionPanel2.prototype.onAfterDetach=function(msg){_super.prototype.onAfterDetach.call(this,msg),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)},AccordionPanel2.prototype._onTitleChanged=function(sender){var index=ArrayExt.findFirstIndex(this.widgets,function(widget){return widget.contains(sender.owner)});index>=0&&(this.layout.updateTitle(index,sender.owner),this.update())},AccordionPanel2.prototype._computeWidgetSize=function(index){var layout=this.layout,widget=layout.widgets[index];if(widget){var isHidden=widget.isHidden,widgetSizes=layout.absoluteSizes(),delta=(isHidden?-1:1)*this.spacing,totalSize=widgetSizes.reduce(function(prev,curr){return prev+curr}),newSize=__spreadArrays(widgetSizes);if(isHidden){var previousSize_1=this._widgetSizesCache.get(widget);if(!previousSize_1)return;newSize[index]+=previousSize_1;var widgetToCollapse=newSize.map(function(sz){return sz-previousSize_1>0}).lastIndexOf(!0);widgetToCollapse===-1?newSize.forEach(function(_,idx){idx!==index&&(newSize[idx]-=widgetSizes[idx]/totalSize*(previousSize_1-delta))}):newSize[widgetToCollapse]-=previousSize_1-delta}else{var currentSize=widgetSizes[index];this._widgetSizesCache.set(widget,currentSize),newSize[index]=0;var widgetToCollapse=newSize.map(function(sz){return sz>0}).lastIndexOf(!0);if(widgetToCollapse===-1)return;newSize[widgetToCollapse]=widgetSizes[widgetToCollapse]+currentSize+delta}return newSize.map(function(sz){return sz/(totalSize+delta)})}},AccordionPanel2.prototype._evtClick=function(event){var target=event.target;if(target){var index=ArrayExt.findFirstIndex(this.titles,function(title){return title.contains(target)});index>=0&&(event.preventDefault(),event.stopPropagation(),this._toggleExpansion(index))}},AccordionPanel2.prototype._eventKeyDown=function(event){if(!event.defaultPrevented){var target=event.target,handled=!1;if(target){var index=ArrayExt.findFirstIndex(this.titles,function(title){return title.contains(target)});if(index>=0){var keyCode=event.keyCode.toString();if(event.key.match(/Space|Enter/)||keyCode.match(/13|32/))target.click(),handled=!0;else if(this.orientation==="horizontal"?event.key.match(/ArrowLeft|ArrowRight/)||keyCode.match(/37|39/):event.key.match(/ArrowUp|ArrowDown/)||keyCode.match(/38|40/)){var direction=event.key.match(/ArrowLeft|ArrowUp/)||keyCode.match(/37|38/)?-1:1,length_1=this.titles.length,newIndex=(index+length_1+direction)%length_1;this.titles[newIndex].focus(),handled=!0}else event.key==="End"||keyCode==="35"?(this.titles[this.titles.length-1].focus(),handled=!0):(event.key==="Home"||keyCode==="36")&&(this.titles[0].focus(),handled=!0)}handled&&event.preventDefault()}}},AccordionPanel2.prototype._toggleExpansion=function(index){var title=this.titles[index],widget=this.layout.widgets[index],newSize=this._computeWidgetSize(index);newSize&&this.setRelativeSizes(newSize,!1),widget.isHidden?(title.classList.add("lm-mod-expanded"),title.setAttribute("aria-expanded","true"),widget.show()):(title.classList.remove("lm-mod-expanded"),title.setAttribute("aria-expanded","false"),widget.hide())},AccordionPanel2}(SplitPanel$1);(function(AccordionPanel2){var Renderer=function(_super){__extends(Renderer2,_super);function Renderer2(){var _this=_super.call(this)||this;return _this.titleClassName="lm-AccordionPanel-title",_this._titleID=0,_this._titleKeys=new WeakMap,_this._uuid=++Renderer2._nInstance,_this}return Renderer2.prototype.createCollapseIcon=function(data){return document.createElement("span")},Renderer2.prototype.createSectionTitle=function(data){var handle=document.createElement("h3");handle.setAttribute("role","button"),handle.setAttribute("tabindex","0"),handle.id=this.createTitleKey(data),handle.className=this.titleClassName;for(var aData in data.dataset)handle.dataset[aData]=data.dataset[aData];var collapser=handle.appendChild(this.createCollapseIcon(data));collapser.className="lm-AccordionPanel-titleCollapser";var label=handle.appendChild(document.createElement("span"));return label.className="lm-AccordionPanel-titleLabel",label.textContent=data.label,label.title=data.caption||data.label,handle},Renderer2.prototype.createTitleKey=function(data){var key=this._titleKeys.get(data);return key===void 0&&(key="title-key-"+this._uuid+"-"+this._titleID++,this._titleKeys.set(data,key)),key},Renderer2._nInstance=0,Renderer2}(SplitPanel$1.Renderer);AccordionPanel2.Renderer=Renderer,AccordionPanel2.defaultRenderer=new Renderer})(AccordionPanel||(AccordionPanel={}));var Private$d;(function(Private2){function createLayout(options){return options.layout||new AccordionLayout({renderer:options.renderer||AccordionPanel.defaultRenderer,orientation:options.orientation,alignment:options.alignment,spacing:options.spacing,titleSpace:options.titleSpace})}Private2.createLayout=createLayout})(Private$d||(Private$d={}));var BoxLayout=function(_super){__extends(BoxLayout2,_super);function BoxLayout2(options){options===void 0&&(options={});var _this=_super.call(this)||this;return _this._fixed=0,_this._spacing=4,_this._dirty=!1,_this._sizers=[],_this._items=[],_this._box=null,_this._alignment="start",_this._direction="top-to-bottom",options.direction!==void 0&&(_this._direction=options.direction),options.alignment!==void 0&&(_this._alignment=options.alignment),options.spacing!==void 0&&(_this._spacing=Utils$1.clampDimension(options.spacing)),_this}return BoxLayout2.prototype.dispose=function(){each(this._items,function(item){item.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(BoxLayout2.prototype,"direction",{get:function(){return this._direction},set:function(value){this._direction!==value&&(this._direction=value,this.parent&&(this.parent.dataset.direction=value,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(BoxLayout2.prototype,"alignment",{get:function(){return this._alignment},set:function(value){this._alignment!==value&&(this._alignment=value,this.parent&&(this.parent.dataset.alignment=value,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(BoxLayout2.prototype,"spacing",{get:function(){return this._spacing},set:function(value){value=Utils$1.clampDimension(value),this._spacing!==value&&(this._spacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),BoxLayout2.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,_super.prototype.init.call(this)},BoxLayout2.prototype.attachWidget=function(index,widget){ArrayExt.insert(this._items,index,new LayoutItem(widget)),ArrayExt.insert(this._sizers,index,new BoxSizer),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},BoxLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._items,fromIndex,toIndex),ArrayExt.move(this._sizers,fromIndex,toIndex),this.parent.update()},BoxLayout2.prototype.detachWidget=function(index,widget){var item=ArrayExt.removeAt(this._items,index);ArrayExt.removeAt(this._sizers,index),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),item.dispose(),this.parent.fit()},BoxLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},BoxLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},BoxLayout2.prototype.onChildShown=function(msg){this.parent.fit()},BoxLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},BoxLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},BoxLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},BoxLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},BoxLayout2.prototype._fit=function(){for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;this._fixed=this._spacing*Math.max(0,nVisible-1);for(var horz=Private$c.isHorizontal(this._direction),minW=horz?this._fixed:0,minH=horz?0:this._fixed,i=0,n=this._items.length;i<n;++i){var item=this._items[i],sizer=this._sizers[i];if(item.isHidden){sizer.minSize=0,sizer.maxSize=0;continue}item.fit(),sizer.sizeHint=BoxLayout2.getSizeBasis(item.widget),sizer.stretch=BoxLayout2.getStretch(item.widget),horz?(sizer.minSize=item.minWidth,sizer.maxSize=item.maxWidth,minW+=item.minWidth,minH=Math.max(minH,item.minHeight)):(sizer.minSize=item.minHeight,sizer.maxSize=item.maxHeight,minH+=item.minHeight,minW=Math.max(minW,item.minWidth))}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},BoxLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1;for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;if(nVisible!==0){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,delta;switch(this._direction){case"left-to-right":delta=BoxEngine.calc(this._sizers,Math.max(0,width-this._fixed));break;case"top-to-bottom":delta=BoxEngine.calc(this._sizers,Math.max(0,height-this._fixed));break;case"right-to-left":delta=BoxEngine.calc(this._sizers,Math.max(0,width-this._fixed)),left+=width;break;case"bottom-to-top":delta=BoxEngine.calc(this._sizers,Math.max(0,height-this._fixed)),top+=height;break;default:throw"unreachable"}var extra=0,offset=0;if(delta>0)switch(this._alignment){case"start":break;case"center":extra=0,offset=delta/2;break;case"end":extra=0,offset=delta;break;case"justify":extra=delta/nVisible,offset=0;break;default:throw"unreachable"}for(var i=0,n=this._items.length;i<n;++i){var item=this._items[i];if(!item.isHidden){var size=this._sizers[i].size;switch(this._direction){case"left-to-right":item.update(left+offset,top,size+extra,height),left+=size+extra+this._spacing;break;case"top-to-bottom":item.update(left,top+offset,width,size+extra),top+=size+extra+this._spacing;break;case"right-to-left":item.update(left-offset-size-extra,top,size+extra,height),left-=size+extra+this._spacing;break;case"bottom-to-top":item.update(left,top-offset-size-extra,width,size+extra),top-=size+extra+this._spacing;break;default:throw"unreachable"}}}}},BoxLayout2}(PanelLayout);(function(BoxLayout2){function getStretch(widget){return Private$c.stretchProperty.get(widget)}BoxLayout2.getStretch=getStretch;function setStretch(widget,value){Private$c.stretchProperty.set(widget,value)}BoxLayout2.setStretch=setStretch;function getSizeBasis(widget){return Private$c.sizeBasisProperty.get(widget)}BoxLayout2.getSizeBasis=getSizeBasis;function setSizeBasis(widget,value){Private$c.sizeBasisProperty.set(widget,value)}BoxLayout2.setSizeBasis=setSizeBasis})(BoxLayout||(BoxLayout={}));var Private$c;(function(Private2){Private2.stretchProperty=new AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(owner,value){return Math.max(0,Math.floor(value))},changed:onChildSizingChanged}),Private2.sizeBasisProperty=new AttachedProperty({name:"sizeBasis",create:function(){return 0},coerce:function(owner,value){return Math.max(0,Math.floor(value))},changed:onChildSizingChanged});function isHorizontal(dir){return dir==="left-to-right"||dir==="right-to-left"}Private2.isHorizontal=isHorizontal;function clampSpacing(value){return Math.max(0,Math.floor(value))}Private2.clampSpacing=clampSpacing;function onChildSizingChanged(child){child.parent&&child.parent.layout instanceof BoxLayout&&child.parent.fit()}})(Private$c||(Private$c={}));var BoxPanel=function(_super){__extends(BoxPanel2,_super);function BoxPanel2(options){options===void 0&&(options={});var _this=_super.call(this,{layout:Private$b.createLayout(options)})||this;return _this.addClass("lm-BoxPanel"),_this.addClass("p-BoxPanel"),_this}return Object.defineProperty(BoxPanel2.prototype,"direction",{get:function(){return this.layout.direction},set:function(value){this.layout.direction=value},enumerable:!0,configurable:!0}),Object.defineProperty(BoxPanel2.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(value){this.layout.alignment=value},enumerable:!0,configurable:!0}),Object.defineProperty(BoxPanel2.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(value){this.layout.spacing=value},enumerable:!0,configurable:!0}),BoxPanel2.prototype.onChildAdded=function(msg){msg.child.addClass("lm-BoxPanel-child"),msg.child.addClass("p-BoxPanel-child")},BoxPanel2.prototype.onChildRemoved=function(msg){msg.child.removeClass("lm-BoxPanel-child"),msg.child.removeClass("p-BoxPanel-child")},BoxPanel2}(Panel);(function(BoxPanel2){function getStretch(widget){return BoxLayout.getStretch(widget)}BoxPanel2.getStretch=getStretch;function setStretch(widget,value){BoxLayout.setStretch(widget,value)}BoxPanel2.setStretch=setStretch;function getSizeBasis(widget){return BoxLayout.getSizeBasis(widget)}BoxPanel2.getSizeBasis=getSizeBasis;function setSizeBasis(widget,value){BoxLayout.setSizeBasis(widget,value)}BoxPanel2.setSizeBasis=setSizeBasis})(BoxPanel||(BoxPanel={}));var Private$b;(function(Private2){function createLayout(options){return options.layout||new BoxLayout(options)}Private2.createLayout=createLayout})(Private$b||(Private$b={})),exports2.CommandPalette=function(_super){__extends(CommandPalette,_super);function CommandPalette(options){var _this=_super.call(this,{node:Private$a.createNode()})||this;return _this._activeIndex=-1,_this._items=[],_this._results=null,_this.addClass("lm-CommandPalette"),_this.addClass("p-CommandPalette"),_this.setFlag(Widget.Flag.DisallowLayout),_this.commands=options.commands,_this.renderer=options.renderer||CommandPalette.defaultRenderer,_this.commands.commandChanged.connect(_this._onGenericChange,_this),_this.commands.keyBindingChanged.connect(_this._onGenericChange,_this),_this}return CommandPalette.prototype.dispose=function(){this._items.length=0,this._results=null,_super.prototype.dispose.call(this)},Object.defineProperty(CommandPalette.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(CommandPalette.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(CommandPalette.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(CommandPalette.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),CommandPalette.prototype.addItem=function(options){var item=Private$a.createItem(this.commands,options);return this._items.push(item),this.refresh(),item},CommandPalette.prototype.addItems=function(items){var _this=this,newItems=items.map(function(item){return Private$a.createItem(_this.commands,item)});return newItems.forEach(function(item){return _this._items.push(item)}),this.refresh(),newItems},CommandPalette.prototype.removeItem=function(item){this.removeItemAt(this._items.indexOf(item))},CommandPalette.prototype.removeItemAt=function(index){var item=ArrayExt.removeAt(this._items,index);item&&this.refresh()},CommandPalette.prototype.clearItems=function(){this._items.length!==0&&(this._items.length=0,this.refresh())},CommandPalette.prototype.refresh=function(){if(this._results=null,this.inputNode.value!==""){var clear=this.node.getElementsByClassName("lm-close-icon")[0];clear.style.display="inherit"}else{var clear=this.node.getElementsByClassName("lm-close-icon")[0];clear.style.display="none"}this.update()},CommandPalette.prototype.handleEvent=function(event){switch(event.type){case"click":this._evtClick(event);break;case"keydown":this._evtKeyDown(event);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}},CommandPalette.prototype.onBeforeAttach=function(msg){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)},CommandPalette.prototype.onAfterDetach=function(msg){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)},CommandPalette.prototype.onActivateRequest=function(msg){if(this.isAttached){var input=this.inputNode;input.focus(),input.select()}},CommandPalette.prototype.onUpdateRequest=function(msg){var query=this.inputNode.value,contentNode=this.contentNode,results=this._results;if(results||(results=this._results=Private$a.search(this._items,query),this._activeIndex=query?ArrayExt.findFirstIndex(results,Private$a.canActivate):-1),!query&&results.length===0){VirtualDOM.render(null,contentNode);return}if(query&&results.length===0){var content_1=this.renderer.renderEmptyMessage({query});VirtualDOM.render(content_1,contentNode);return}for(var renderer=this.renderer,activeIndex=this._activeIndex,content=new Array(results.length),i=0,n=results.length;i<n;++i){var result=results[i];if(result.type==="header"){var indices=result.indices,category=result.category;content[i]=renderer.renderHeader({category,indices})}else{var item=result.item,indices=result.indices,active=i===activeIndex;content[i]=renderer.renderItem({item,indices,active})}}if(VirtualDOM.render(content,contentNode),activeIndex<0||activeIndex>=results.length)contentNode.scrollTop=0;else{var element=contentNode.children[activeIndex];ElementExt.scrollIntoViewIfNeeded(contentNode,element)}},CommandPalette.prototype._evtClick=function(event){if(event.button===0){if(event.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return node.contains(event.target)});index!==-1&&(event.preventDefault(),event.stopPropagation(),this._execute(index))}},CommandPalette.prototype._evtKeyDown=function(event){if(!(event.altKey||event.ctrlKey||event.metaKey||event.shiftKey))switch(event.keyCode){case 13:event.preventDefault(),event.stopPropagation(),this._execute(this._activeIndex);break;case 38:event.preventDefault(),event.stopPropagation(),this._activatePreviousItem();break;case 40:event.preventDefault(),event.stopPropagation(),this._activateNextItem();break}},CommandPalette.prototype._activateNextItem=function(){if(!(!this._results||this._results.length===0)){var ai=this._activeIndex,n=this._results.length,start=ai<n-1?ai+1:0,stop=start===0?n-1:start-1;this._activeIndex=ArrayExt.findFirstIndex(this._results,Private$a.canActivate,start,stop),this.update()}},CommandPalette.prototype._activatePreviousItem=function(){if(!(!this._results||this._results.length===0)){var ai=this._activeIndex,n=this._results.length,start=ai<=0?n-1:ai-1,stop=start===n-1?0:start+1;this._activeIndex=ArrayExt.findLastIndex(this._results,Private$a.canActivate,start,stop),this.update()}},CommandPalette.prototype._execute=function(index){if(this._results){var part=this._results[index];if(part){if(part.type==="header"){var input=this.inputNode;input.value=part.category.toLowerCase()+" ",input.focus(),this.refresh();return}part.item.isEnabled&&(this.commands.execute(part.item.command,part.item.args),this.inputNode.value="",this.refresh())}}},CommandPalette.prototype._toggleFocused=function(){var focused=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",focused),this.toggleClass("p-mod-focused",focused)},CommandPalette.prototype._onGenericChange=function(){this.refresh()},CommandPalette}(Widget),function(CommandPalette){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.renderHeader=function(data){var content=this.formatHeader(data);return h.li({className:"lm-CommandPalette-header p-CommandPalette-header"},content)},Renderer2.prototype.renderItem=function(data){var className=this.createItemClass(data),dataset=this.createItemDataset(data);return data.item.isToggleable?h.li({className,dataset,role:"checkbox","aria-checked":""+data.item.isToggled},this.renderItemIcon(data),this.renderItemContent(data),this.renderItemShortcut(data)):h.li({className,dataset},this.renderItemIcon(data),this.renderItemContent(data),this.renderItemShortcut(data))},Renderer2.prototype.renderEmptyMessage=function(data){var content=this.formatEmptyMessage(data);return h.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},content)},Renderer2.prototype.renderItemIcon=function(data){var className=this.createIconClass(data);return typeof data.item.icon=="string"?h.div({className},data.item.iconLabel):h.div({className},data.item.icon,data.item.iconLabel)},Renderer2.prototype.renderItemContent=function(data){return h.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(data),this.renderItemCaption(data))},Renderer2.prototype.renderItemLabel=function(data){var content=this.formatItemLabel(data);return h.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},content)},Renderer2.prototype.renderItemCaption=function(data){var content=this.formatItemCaption(data);return h.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},content)},Renderer2.prototype.renderItemShortcut=function(data){var content=this.formatItemShortcut(data);return h.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},content)},Renderer2.prototype.createItemClass=function(data){var name2="lm-CommandPalette-item";name2+=" p-CommandPalette-item",data.item.isEnabled||(name2+=" lm-mod-disabled",name2+=" p-mod-disabled"),data.item.isToggled&&(name2+=" lm-mod-toggled",name2+=" p-mod-toggled"),data.active&&(name2+=" lm-mod-active",name2+=" p-mod-active");var extra=data.item.className;return extra&&(name2+=" "+extra),name2},Renderer2.prototype.createItemDataset=function(data){return __assign(__assign({},data.item.dataset),{command:data.item.command})},Renderer2.prototype.createIconClass=function(data){var name2="lm-CommandPalette-itemIcon";name2+=" p-CommandPalette-itemIcon";var extra=data.item.iconClass;return extra?name2+" "+extra:name2},Renderer2.prototype.formatHeader=function(data){return!data.indices||data.indices.length===0?data.category:StringExt.highlight(data.category,data.indices,h.mark)},Renderer2.prototype.formatEmptyMessage=function(data){return"No commands found that match '"+data.query+"'"},Renderer2.prototype.formatItemShortcut=function(data){var kb=data.item.keyBinding;return kb?exports2.CommandRegistry.formatKeystroke(kb.keys):null},Renderer2.prototype.formatItemLabel=function(data){return!data.indices||data.indices.length===0?data.item.label:StringExt.highlight(data.item.label,data.indices,h.mark)},Renderer2.prototype.formatItemCaption=function(data){return data.item.caption},Renderer2}();CommandPalette.Renderer=Renderer,CommandPalette.defaultRenderer=new Renderer}(exports2.CommandPalette||(exports2.CommandPalette={}));var Private$a;(function(Private2){function createNode(){var node=document.createElement("div"),search2=document.createElement("div"),wrapper=document.createElement("div"),input=document.createElement("input"),content=document.createElement("ul"),clear=document.createElement("button");return search2.className="lm-CommandPalette-search",wrapper.className="lm-CommandPalette-wrapper",input.className="lm-CommandPalette-input",clear.className="lm-close-icon",content.className="lm-CommandPalette-content",search2.classList.add("p-CommandPalette-search"),wrapper.classList.add("p-CommandPalette-wrapper"),input.classList.add("p-CommandPalette-input"),content.classList.add("p-CommandPalette-content"),input.spellcheck=!1,wrapper.appendChild(input),wrapper.appendChild(clear),search2.appendChild(wrapper),node.appendChild(search2),node.appendChild(content),node}Private2.createNode=createNode;function createItem(commands,options){return new CommandItem(commands,options)}Private2.createItem=createItem;function search(items,query){var scores=matchItems(items,query);return scores.sort(scoreCmp),createResults(scores)}Private2.search=search;function canActivate(result){return result.type==="item"&&result.item.isEnabled}Private2.canActivate=canActivate;function normalizeCategory(category){return category.trim().replace(/\s+/g," ")}function normalizeQuery(text){return text.replace(/\s+/g,"").toLowerCase()}function matchItems(items,query){query=normalizeQuery(query);for(var scores=[],i=0,n=items.length;i<n;++i){var item=items[i];if(item.isVisible){if(!query){scores.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item});continue}var score=fuzzySearch(item,query);score&&(item.isEnabled||(score.score+=1e3),scores.push(score))}}return scores}function fuzzySearch(item,query){for(var category=item.category.toLowerCase(),label=item.label.toLowerCase(),source=category+" "+label,score=1/0,indices=null,rgx=/\b\w/g;;){var rgxMatch=rgx.exec(source);if(!rgxMatch)break;var match=StringExt.matchSumOfDeltas(source,query,rgxMatch.index);if(!match)break;match&&match.score<=score&&(score=match.score,indices=match.indices)}if(!indices||score===1/0)return null;for(var pivot=category.length+1,j=ArrayExt.lowerBound(indices,pivot,function(a,b){return a-b}),categoryIndices=indices.slice(0,j),labelIndices=indices.slice(j),i=0,n=labelIndices.length;i<n;++i)labelIndices[i]-=pivot;return categoryIndices.length===0?{matchType:0,categoryIndices:null,labelIndices,score,item}:labelIndices.length===0?{matchType:1,categoryIndices,labelIndices:null,score,item}:{matchType:2,categoryIndices,labelIndices,score,item}}function scoreCmp(a,b){var m1=a.matchType-b.matchType;if(m1!==0)return m1;var d1=a.score-b.score;if(d1!==0)return d1;var i1=0,i2=0;switch(a.matchType){case 0:i1=a.labelIndices[0],i2=b.labelIndices[0];break;case 1:case 2:i1=a.categoryIndices[0],i2=b.categoryIndices[0];break}if(i1!==i2)return i1-i2;var d2=a.item.category.localeCompare(b.item.category);if(d2!==0)return d2;var r1=a.item.rank,r2=b.item.rank;return r1!==r2?r1<r2?-1:1:a.item.label.localeCompare(b.item.label)}function createResults(scores){var visited=new Array(scores.length);ArrayExt.fill(visited,!1);for(var results=[],i=0,n=scores.length;i<n;++i)if(!visited[i]){var _a=scores[i],item=_a.item,categoryIndices=_a.categoryIndices,category=item.category;results.push({type:"header",category,indices:categoryIndices});for(var j=i;j<n;++j)if(!visited[j]){var _b=scores[j],item_1=_b.item,labelIndices=_b.labelIndices;item_1.category===category&&(results.push({type:"item",item:item_1,indices:labelIndices}),visited[j]=!0)}}return results}var CommandItem=function(){function CommandItem2(commands,options){this._commands=commands,this.category=normalizeCategory(options.category),this.command=options.command,this.args=options.args||JSONExt.emptyObject,this.rank=options.rank!==void 0?options.rank:1/0}return Object.defineProperty(CommandItem2.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isToggleable",{get:function(){return this._commands.isToggleable(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"keyBinding",{get:function(){var _a=this,command=_a.command,args=_a.args;return ArrayExt.findLastValue(this._commands.keyBindings,function(kb){return kb.command===command&&JSONExt.deepEqual(kb.args,args)})||null},enumerable:!0,configurable:!0}),CommandItem2}()})(Private$a||(Private$a={}));var Menu=function(_super){__extends(Menu2,_super);function Menu2(options){var _this=_super.call(this,{node:Private$9.createNode()})||this;return _this._childIndex=-1,_this._activeIndex=-1,_this._openTimerID=0,_this._closeTimerID=0,_this._items=[],_this._childMenu=null,_this._parentMenu=null,_this._aboutToClose=new Signal(_this),_this._menuRequested=new Signal(_this),_this.addClass("lm-Menu"),_this.addClass("p-Menu"),_this.setFlag(Widget.Flag.DisallowLayout),_this.commands=options.commands,_this.renderer=options.renderer||Menu2.defaultRenderer,_this}return Menu2.prototype.dispose=function(){this.close(),this._items.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(Menu2.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"rootMenu",{get:function(){for(var menu=this;menu._parentMenu;)menu=menu._parentMenu;return menu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"leafMenu",{get:function(){for(var menu=this;menu._childMenu;)menu=menu._childMenu;return menu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(value){this.activeIndex=value?this._items.indexOf(value):-1},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(value){(value<0||value>=this._items.length)&&(value=-1),value!==-1&&!Private$9.canActivate(this._items[value])&&(value=-1),this._activeIndex!==value&&(this._activeIndex=value,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Menu2.prototype.activateNextItem=function(){var n=this._items.length,ai=this._activeIndex,start=ai<n-1?ai+1:0,stop=start===0?n-1:start-1;this.activeIndex=ArrayExt.findFirstIndex(this._items,Private$9.canActivate,start,stop)},Menu2.prototype.activatePreviousItem=function(){var n=this._items.length,ai=this._activeIndex,start=ai<=0?n-1:ai-1,stop=start===n-1?0:start+1;this.activeIndex=ArrayExt.findLastIndex(this._items,Private$9.canActivate,start,stop)},Menu2.prototype.triggerActiveItem=function(){if(this.isAttached){var item=this.activeItem;if(item){if(this._cancelOpenTimer(),this._cancelCloseTimer(),item.type==="submenu"){this._openChildMenu(!0);return}this.rootMenu.close();var command=item.command,args=item.args;this.commands.isEnabled(command,args)?this.commands.execute(command,args):console.log("Command '"+command+"' is disabled.")}}},Menu2.prototype.addItem=function(options){return this.insertItem(this._items.length,options)},Menu2.prototype.insertItem=function(index,options){this.isAttached&&this.close(),this.activeIndex=-1;var i=Math.max(0,Math.min(index,this._items.length)),item=Private$9.createItem(this,options);return ArrayExt.insert(this._items,i,item),this.update(),item},Menu2.prototype.removeItem=function(item){this.removeItemAt(this._items.indexOf(item))},Menu2.prototype.removeItemAt=function(index){this.isAttached&&this.close(),this.activeIndex=-1;var item=ArrayExt.removeAt(this._items,index);item&&this.update()},Menu2.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,this._items.length!==0&&(this._items.length=0,this.update())},Menu2.prototype.open=function(x,y,options){if(options===void 0&&(options={}),!this.isAttached){var forceX=options.forceX||!1,forceY=options.forceY||!1;Private$9.openRootMenu(this,x,y,forceX,forceY),this.activate()}},Menu2.prototype.handleEvent=function(event){switch(event.type){case"keydown":this._evtKeyDown(event);break;case"mouseup":this._evtMouseUp(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseenter":this._evtMouseEnter(event);break;case"mouseleave":this._evtMouseLeave(event);break;case"mousedown":this._evtMouseDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},Menu2.prototype.onBeforeAttach=function(msg){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)},Menu2.prototype.onAfterDetach=function(msg){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)},Menu2.prototype.onActivateRequest=function(msg){this.isAttached&&this.node.focus()},Menu2.prototype.onUpdateRequest=function(msg){for(var _this=this,items=this._items,renderer=this.renderer,activeIndex=this._activeIndex,collapsedFlags=Private$9.computeCollapsed(items),content=new Array(items.length),_loop_1=function(i2,n2){var item=items[i2],active=i2===activeIndex,collapsed=collapsedFlags[i2];content[i2]=renderer.renderItem({item,active,collapsed,onfocus:function(){_this.activeIndex=i2}})},i=0,n=items.length;i<n;++i)_loop_1(i);VirtualDOM.render(content,this.contentNode)},Menu2.prototype.onCloseRequest=function(msg){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var childMenu=this._childMenu;childMenu&&(this._childIndex=-1,this._childMenu=null,childMenu._parentMenu=null,childMenu.close());var parentMenu=this._parentMenu;parentMenu&&(this._parentMenu=null,parentMenu._childIndex=-1,parentMenu._childMenu=null,parentMenu.activate()),this.isAttached&&this._aboutToClose.emit(void 0),_super.prototype.onCloseRequest.call(this,msg)},Menu2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation();var kc=event.keyCode;if(kc===13){this.triggerActiveItem();return}if(kc===27){this.close();return}if(kc===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(kc===38){this.activatePreviousItem();return}if(kc===39){var item=this.activeItem;item&&item.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(kc===40){this.activateNextItem();return}var key=getKeyboardLayout().keyForKeydownEvent(event);if(key){var start=this._activeIndex+1,result=Private$9.findMnemonic(this._items,key,start);result.index!==-1&&!result.multiple?(this.activeIndex=result.index,this.triggerActiveItem()):result.index!==-1?this.activeIndex=result.index:result.auto!==-1&&(this.activeIndex=result.auto)}},Menu2.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this.triggerActiveItem())},Menu2.prototype._evtMouseMove=function(event){var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return ElementExt.hitTest(node,event.clientX,event.clientY)});if(index!==this._activeIndex){if(this.activeIndex=index,index=this.activeIndex,index===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();var item=this.activeItem;!item||item.type!=="submenu"||!item.submenu||this._startOpenTimer()}},Menu2.prototype._evtMouseEnter=function(event){for(var menu=this._parentMenu;menu;menu=menu._parentMenu)menu._cancelOpenTimer(),menu._cancelCloseTimer(),menu.activeIndex=menu._childIndex},Menu2.prototype._evtMouseLeave=function(event){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}var clientX=event.clientX,clientY=event.clientY;if(ElementExt.hitTest(this._childMenu.node,clientX,clientY)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()},Menu2.prototype._evtMouseDown=function(event){this._parentMenu||(Private$9.hitTestMenus(this,event.clientX,event.clientY)?(event.preventDefault(),event.stopPropagation()):this.close())},Menu2.prototype._openChildMenu=function(activateFirst){activateFirst===void 0&&(activateFirst=!1);var item=this.activeItem;if(!item||item.type!=="submenu"||!item.submenu){this._closeChildMenu();return}var submenu=item.submenu;if(submenu!==this._childMenu){Menu2.saveWindowData(),this._closeChildMenu(),this._childMenu=submenu,this._childIndex=this._activeIndex,submenu._parentMenu=this,MessageLoop.sendMessage(this,Widget.Msg.UpdateRequest);var itemNode=this.contentNode.children[this._activeIndex];Private$9.openSubmenu(submenu,itemNode),activateFirst&&(submenu.activeIndex=-1,submenu.activateNextItem()),submenu.activate()}},Menu2.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},Menu2.prototype._startOpenTimer=function(){var _this=this;this._openTimerID===0&&(this._openTimerID=window.setTimeout(function(){_this._openTimerID=0,_this._openChildMenu()},Private$9.TIMER_DELAY))},Menu2.prototype._startCloseTimer=function(){var _this=this;this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(function(){_this._closeTimerID=0,_this._closeChildMenu()},Private$9.TIMER_DELAY))},Menu2.prototype._cancelOpenTimer=function(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)},Menu2.prototype._cancelCloseTimer=function(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},Menu2.saveWindowData=function(){Private$9.saveWindowData()},Menu2}(Widget);(function(Menu2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.renderItem=function(data){var className=this.createItemClass(data),dataset=this.createItemDataset(data),aria=this.createItemARIA(data);return h.li(__assign({className,dataset,tabindex:"0",onfocus:data.onfocus},aria),this.renderIcon(data),this.renderLabel(data),this.renderShortcut(data),this.renderSubmenu(data))},Renderer2.prototype.renderIcon=function(data){var className=this.createIconClass(data);return typeof data.item.icon=="string"?h.div({className},data.item.iconLabel):h.div({className},data.item.icon,data.item.iconLabel)},Renderer2.prototype.renderLabel=function(data){var content=this.formatLabel(data);return h.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},content)},Renderer2.prototype.renderShortcut=function(data){var content=this.formatShortcut(data);return h.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},content)},Renderer2.prototype.renderSubmenu=function(data){return h.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},Renderer2.prototype.createItemClass=function(data){var name2="lm-Menu-item";name2+=" p-Menu-item",data.item.isEnabled||(name2+=" lm-mod-disabled",name2+=" p-mod-disabled"),data.item.isToggled&&(name2+=" lm-mod-toggled",name2+=" p-mod-toggled"),data.item.isVisible||(name2+=" lm-mod-hidden",name2+=" p-mod-hidden"),data.active&&(name2+=" lm-mod-active",name2+=" p-mod-active"),data.collapsed&&(name2+=" lm-mod-collapsed",name2+=" p-mod-collapsed");var extra=data.item.className;return extra&&(name2+=" "+extra),name2},Renderer2.prototype.createItemDataset=function(data){var result,_a=data.item,type=_a.type,command=_a.command,dataset=_a.dataset;return type==="command"?result=__assign(__assign({},dataset),{type,command}):result=__assign(__assign({},dataset),{type}),result},Renderer2.prototype.createIconClass=function(data){var name2="lm-Menu-itemIcon";name2+=" p-Menu-itemIcon";var extra=data.item.iconClass;return extra?name2+" "+extra:name2},Renderer2.prototype.createItemARIA=function(data){var aria={};switch(data.item.type){case"separator":aria.role="presentation";break;case"submenu":aria["aria-haspopup"]="true",data.item.isEnabled||(aria["aria-disabled"]="true");break;default:data.item.isEnabled||(aria["aria-disabled"]="true"),aria.role="menuitem"}return aria},Renderer2.prototype.formatLabel=function(data){var _a=data.item,label=_a.label,mnemonic=_a.mnemonic;if(mnemonic<0||mnemonic>=label.length)return label;var prefix=label.slice(0,mnemonic),suffix=label.slice(mnemonic+1),char=label[mnemonic],span=h.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},char);return[prefix,span,suffix]},Renderer2.prototype.formatShortcut=function(data){var kb=data.item.keyBinding;return kb?exports2.CommandRegistry.formatKeystroke(kb.keys):null},Renderer2}();Menu2.Renderer=Renderer,Menu2.defaultRenderer=new Renderer})(Menu||(Menu={}));var Private$9;(function(Private2){Private2.TIMER_DELAY=300,Private2.SUBMENU_OVERLAP=3;var transientWindowDataCache=null,transientCacheCounter=0;function getWindowData(){return transientCacheCounter>0?(transientCacheCounter--,transientWindowDataCache):_getWindowData()}function saveWindowData(){transientWindowDataCache=_getWindowData(),transientCacheCounter++}Private2.saveWindowData=saveWindowData;function createNode(){var node=document.createElement("div"),content=document.createElement("ul");return content.className="lm-Menu-content",content.classList.add("p-Menu-content"),node.appendChild(content),content.setAttribute("role","menu"),node.tabIndex=0,node}Private2.createNode=createNode;function canActivate(item){return item.type!=="separator"&&item.isEnabled&&item.isVisible}Private2.canActivate=canActivate;function createItem(owner,options){return new MenuItem(owner.commands,options)}Private2.createItem=createItem;function hitTestMenus(menu,x,y){for(var temp=menu;temp;temp=temp.childMenu)if(ElementExt.hitTest(temp.node,x,y))return!0;return!1}Private2.hitTestMenus=hitTestMenus;function computeCollapsed(items){var result=new Array(items.length);ArrayExt.fill(result,!1);for(var k1=0,n=items.length;k1<n;++k1){var item=items[k1];if(item.isVisible){if(item.type!=="separator")break;result[k1]=!0}}for(var k2=n-1;k2>=0;--k2){var item=items[k2];if(item.isVisible){if(item.type!=="separator")break;result[k2]=!0}}for(var hide=!1;++k1<k2;){var item=items[k1];item.isVisible&&(item.type!=="separator"?hide=!1:hide?result[k1]=!0:hide=!0)}return result}Private2.computeCollapsed=computeCollapsed;function _getWindowData(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}function openRootMenu(menu,x,y,forceX,forceY){var windowData=getWindowData(),px=windowData.pageXOffset,py=windowData.pageYOffset,cw=windowData.clientWidth,ch=windowData.clientHeight;MessageLoop.sendMessage(menu,Widget.Msg.UpdateRequest);var maxHeight=ch-(forceY?y:0),node=menu.node,style=node.style;style.opacity="0",style.maxHeight=maxHeight+"px",Widget.attach(menu,document.body);var _a=node.getBoundingClientRect(),width=_a.width,height=_a.height;!forceX&&x+width>px+cw&&(x=px+cw-width),!forceY&&y+height>py+ch&&(y>py+ch?y=py+ch-height:y=y-height),style.transform="translate("+Math.max(0,x)+"px, "+Math.max(0,y)+"px",style.opacity="1"}Private2.openRootMenu=openRootMenu;function openSubmenu(submenu,itemNode){var windowData=getWindowData(),px=windowData.pageXOffset,py=windowData.pageYOffset,cw=windowData.clientWidth,ch=windowData.clientHeight;MessageLoop.sendMessage(submenu,Widget.Msg.UpdateRequest);var maxHeight=ch,node=submenu.node,style=node.style;style.opacity="0",style.maxHeight=maxHeight+"px",Widget.attach(submenu,document.body);var _a=node.getBoundingClientRect(),width=_a.width,height=_a.height,box=ElementExt.boxSizing(submenu.node),itemRect=itemNode.getBoundingClientRect(),x=itemRect.right-Private2.SUBMENU_OVERLAP;x+width>px+cw&&(x=itemRect.left+Private2.SUBMENU_OVERLAP-width);var y=itemRect.top-box.borderTop-box.paddingTop;y+height>py+ch&&(y=itemRect.bottom+box.borderBottom+box.paddingBottom-height),style.transform="translate("+Math.max(0,x)+"px, "+Math.max(0,y)+"px",style.opacity="1"}Private2.openSubmenu=openSubmenu;function findMnemonic(items,key,start){for(var index=-1,auto=-1,multiple=!1,upperKey=key.toUpperCase(),i=0,n=items.length;i<n;++i){var k=(i+start)%n,item=items[k];if(canActivate(item)){var label=item.label;if(label.length!==0){var mn=item.mnemonic;if(mn>=0&&mn<label.length){label[mn].toUpperCase()===upperKey&&(index===-1?index=k:multiple=!0);continue}auto===-1&&label[0].toUpperCase()===upperKey&&(auto=k)}}}return{index,multiple,auto}}Private2.findMnemonic=findMnemonic;var MenuItem=function(){function MenuItem2(commands,options){this._commands=commands,this.type=options.type||"command",this.command=options.command||"",this.args=options.args||JSONExt.emptyObject,this.submenu=options.submenu||null}return Object.defineProperty(MenuItem2.prototype,"label",{get:function(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"mnemonic",{get:function(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"icon",{get:function(){return this.type==="command"?this._commands.icon(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.icon:this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"iconClass",{get:function(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"iconLabel",{get:function(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"caption",{get:function(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"className",{get:function(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"dataset",{get:function(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"isEnabled",{get:function(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"isToggled",{get:function(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"isVisible",{get:function(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"keyBinding",{get:function(){if(this.type==="command"){var _a=this,command_1=_a.command,args_1=_a.args;return ArrayExt.findLastValue(this._commands.keyBindings,function(kb){return kb.command===command_1&&JSONExt.deepEqual(kb.args,args_1)})||null}return null},enumerable:!0,configurable:!0}),MenuItem2}()})(Private$9||(Private$9={}));var ContextMenu=function(){function ContextMenu2(options){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;var groupByTarget=options.groupByTarget,sortBySelector=options.sortBySelector,others=__rest(options,["groupByTarget","sortBySelector"]);this.menu=new Menu(others),this._groupByTarget=groupByTarget!==!1,this._sortBySelector=sortBySelector!==!1}return ContextMenu2.prototype.addItem=function(options){var _this=this,item=Private$8.createItem(options,this._idTick++);return this._items.push(item),new DisposableDelegate(function(){ArrayExt.removeFirstOf(_this._items,item)})},ContextMenu2.prototype.open=function(event){var _this=this;if(Menu.saveWindowData(),this.menu.clearItems(),this._items.length===0)return!1;var items=Private$8.matchItems(this._items,event,this._groupByTarget,this._sortBySelector);return!items||items.length===0?!1:(each(items,function(item){_this.menu.addItem(item)}),this.menu.open(event.clientX,event.clientY),!0)},ContextMenu2}(),Private$8;(function(Private2){function createItem(options,id){var selector=validateSelector(options.selector),rank=options.rank!==void 0?options.rank:1/0;return __assign(__assign({},options),{selector,rank,id})}Private2.createItem=createItem;function matchItems(items,event,groupByTarget,sortBySelector){var target=event.target;if(!target)return null;var currentTarget=event.currentTarget;if(!currentTarget||!currentTarget.contains(target)&&(target=document.elementFromPoint(event.clientX,event.clientY),!target||!currentTarget.contains(target)))return null;for(var result=[],availableItems=items.slice();target!==null;){for(var matches=[],i=0,n=availableItems.length;i<n;++i){var item=availableItems[i];item&&Selector.matches(target,item.selector)&&(matches.push(item),availableItems[i]=null)}if(matches.length!==0&&(groupByTarget&&matches.sort(sortBySelector?itemCmp:itemCmpRank),result.push.apply(result,matches)),target===currentTarget)break;target=target.parentElement}return groupByTarget||result.sort(sortBySelector?itemCmp:itemCmpRank),result}Private2.matchItems=matchItems;function validateSelector(selector){if(selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+selector);if(!Selector.isValid(selector))throw new Error("Invalid selector: "+selector);return selector}function itemCmpRank(a,b){var r1=a.rank,r2=b.rank;return r1!==r2?r1<r2?-1:1:a.id-b.id}function itemCmp(a,b){var s1=Selector.calculateSpecificity(a.selector),s2=Selector.calculateSpecificity(b.selector);return s1!==s2?s2-s1:itemCmpRank(a,b)}})(Private$8||(Private$8={}));var TabBar=function(_super){__extends(TabBar2,_super);function TabBar2(options){options===void 0&&(options={});var _this=_super.call(this,{node:Private$7.createNode()})||this;return _this._currentIndex=-1,_this._titles=[],_this._titlesEditable=!1,_this._previousTitle=null,_this._dragData=null,_this._addButtonEnabled=!1,_this._tabMoved=new Signal(_this),_this._currentChanged=new Signal(_this),_this._addRequested=new Signal(_this),_this._tabCloseRequested=new Signal(_this),_this._tabDetachRequested=new Signal(_this),_this._tabActivateRequested=new Signal(_this),_this.addClass("lm-TabBar"),_this.addClass("p-TabBar"),_this.contentNode.setAttribute("role","tablist"),_this.setFlag(Widget.Flag.DisallowLayout),_this._document=options.document||document,_this.tabsMovable=options.tabsMovable||!1,_this.titlesEditable=options.titlesEditable||!1,_this.allowDeselect=options.allowDeselect||!1,_this.addButtonEnabled=options.addButtonEnabled||!1,_this.insertBehavior=options.insertBehavior||"select-tab-if-needed",_this.name=options.name||"",_this.orientation=options.orientation||"horizontal",_this.removeBehavior=options.removeBehavior||"select-tab-after",_this.renderer=options.renderer||TabBar2.defaultRenderer,_this}return TabBar2.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,_super.prototype.dispose.call(this)},Object.defineProperty(TabBar2.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"document",{get:function(){return this._document},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"titlesEditable",{get:function(){return this._titlesEditable},set:function(value){this._titlesEditable=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(value){this.currentIndex=value?this._titles.indexOf(value):-1},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(value){if((value<0||value>=this._titles.length)&&(value=-1),this._currentIndex!==value){var pi=this._currentIndex,pt=this._titles[pi]||null,ci=value,ct=this._titles[ci]||null;this._currentIndex=ci,this._previousTitle=pt,this.update(),this._currentChanged.emit({previousIndex:pi,previousTitle:pt,currentIndex:ci,currentTitle:ct})}},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"name",{get:function(){return this._name},set:function(value){this._name=value,value?this.contentNode.setAttribute("aria-label",value):this.contentNode.removeAttribute("aria-label")},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"orientation",{get:function(){return this._orientation},set:function(value){this._orientation!==value&&(this._releaseMouse(),this._orientation=value,this.dataset.orientation=value,this.contentNode.setAttribute("aria-orientation",value))},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(value){this._addButtonEnabled!==value&&(this._addButtonEnabled=value,value?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"addButtonNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]},enumerable:!0,configurable:!0}),TabBar2.prototype.addTab=function(value){return this.insertTab(this._titles.length,value)},TabBar2.prototype.insertTab=function(index,value){this._releaseMouse();var title=Private$7.asTitle(value),i=this._titles.indexOf(title),j=Math.max(0,Math.min(index,this._titles.length));return i===-1?(ArrayExt.insert(this._titles,j,title),title.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(j,title),title):(j===this._titles.length&&j--,i===j||(ArrayExt.move(this._titles,i,j),this.update(),this._adjustCurrentForMove(i,j)),title)},TabBar2.prototype.removeTab=function(title){this.removeTabAt(this._titles.indexOf(title))},TabBar2.prototype.removeTabAt=function(index){this._releaseMouse();var title=ArrayExt.removeAt(this._titles,index);title&&(title.changed.disconnect(this._onTitleChanged,this),title===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(index,title))},TabBar2.prototype.clearTabs=function(){if(this._titles.length!==0){this._releaseMouse();for(var _i=0,_a=this._titles;_i<_a.length;_i++){var title=_a[_i];title.changed.disconnect(this._onTitleChanged,this)}var pi=this.currentIndex,pt=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),pi!==-1&&this._currentChanged.emit({previousIndex:pi,previousTitle:pt,currentIndex:-1,currentTitle:null})}},TabBar2.prototype.releaseMouse=function(){this._releaseMouse()},TabBar2.prototype.handleEvent=function(event){switch(event.type){case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointerdown":this._evtMouseDown(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"dblclick":this._evtDblClick(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},TabBar2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)},TabBar2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()},TabBar2.prototype.onUpdateRequest=function(msg){for(var titles=this._titles,renderer=this.renderer,currentTitle=this.currentTitle,content=new Array(titles.length),i=0,n=titles.length;i<n;++i){var title=titles[i],current=title===currentTitle,zIndex=current?n:n-i-1;content[i]=renderer.renderTab({title,current,zIndex})}VirtualDOM.render(content,this.contentNode)},TabBar2.prototype._evtDblClick=function(event){if(this.titlesEditable){var tabs=this.contentNode.children,index=ArrayExt.findFirstIndex(tabs,function(tab){return ElementExt.hitTest(tab,event.clientX,event.clientY)});if(index!==-1){var title=this.titles[index],label=tabs[index].querySelector(".lm-TabBar-tabLabel");if(label&&label.contains(event.target)){var value=title.label||"",oldValue_1=label.innerHTML;label.innerHTML="";var input_1=document.createElement("input");input_1.classList.add("lm-TabBar-tabInput"),input_1.value=value,label.appendChild(input_1);var onblur_1=function(){input_1.removeEventListener("blur",onblur_1),label.innerHTML=oldValue_1};input_1.addEventListener("dblclick",function(event2){return event2.stopPropagation()}),input_1.addEventListener("blur",onblur_1),input_1.addEventListener("keydown",function(event2){event2.key==="Enter"?(input_1.value!==""&&(title.label=title.caption=input_1.value),onblur_1()):event2.key==="Escape"&&onblur_1()}),input_1.select(),input_1.focus(),label.children.length>0&&label.children[0].focus()}}}},TabBar2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation(),event.keyCode===27&&this._releaseMouse()},TabBar2.prototype._evtMouseDown=function(event){if(!(event.button!==0&&event.button!==1)&&!this._dragData){var addButtonClicked=this.addButtonEnabled&&this.addButtonNode.contains(event.target),tabs=this.contentNode.children,index=ArrayExt.findFirstIndex(tabs,function(tab){return ElementExt.hitTest(tab,event.clientX,event.clientY)});if(!(index===-1&&!addButtonClicked)&&(event.preventDefault(),event.stopPropagation(),this._dragData={tab:tabs[index],index,pressX:event.clientX,pressY:event.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("mouseup",this,!0),this.document.addEventListener("pointerup",this,!0),!(event.button===1||addButtonClicked))){var icon=tabs[index].querySelector(this.renderer.closeIconSelector);icon&&icon.contains(event.target)||(this.tabsMovable&&(this.document.addEventListener("mousemove",this,!0),this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===index?this.currentIndex=-1:this.currentIndex=index,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},TabBar2.prototype._evtMouseMove=function(event){var data=this._dragData;if(data){event.preventDefault(),event.stopPropagation();var tabs=this.contentNode.children;if(!(!data.dragActive&&!Private$7.dragExceeded(data,event))){if(!data.dragActive){var tabRect=data.tab.getBoundingClientRect();this._orientation==="horizontal"?(data.tabPos=data.tab.offsetLeft,data.tabSize=tabRect.width,data.tabPressPos=data.pressX-tabRect.left):(data.tabPos=data.tab.offsetTop,data.tabSize=tabRect.height,data.tabPressPos=data.pressY-tabRect.top),data.tabLayout=Private$7.snapTabLayout(tabs,this._orientation),data.contentRect=this.contentNode.getBoundingClientRect(),data.override=Drag.overrideCursor("default"),data.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),data.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),data.dragActive=!0}if(!data.detachRequested&&Private$7.detachExceeded(data,event)){data.detachRequested=!0;var index=data.index,clientX=event.clientX,clientY=event.clientY,tab=tabs[index],title=this._titles[index];if(this._tabDetachRequested.emit({index,title,tab,clientX,clientY}),data.dragAborted)return}Private$7.layoutTabs(tabs,data,event,this._orientation)}}},TabBar2.prototype._evtMouseUp=function(event){var _this=this;if(!(event.button!==0&&event.button!==1)){var data=this._dragData;if(data){if(event.preventDefault(),event.stopPropagation(),this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!data.dragActive){this._dragData=null;var addButtonClicked=this.addButtonEnabled&&this.addButtonNode.contains(event.target);if(addButtonClicked){this._addRequested.emit(void 0);return}var tabs=this.contentNode.children,index=ArrayExt.findFirstIndex(tabs,function(tab){return ElementExt.hitTest(tab,event.clientX,event.clientY)});if(index!==data.index)return;var title=this._titles[index];if(!title.closable)return;if(event.button===1){this._tabCloseRequested.emit({index,title});return}var icon=tabs[index].querySelector(this.renderer.closeIconSelector);if(icon&&icon.contains(event.target)){this._tabCloseRequested.emit({index,title});return}return}if(event.button===0){Private$7.finalizeTabPosition(data,this._orientation),data.tab.classList.remove("lm-mod-dragging"),data.tab.classList.remove("p-mod-dragging");var duration=Private$7.parseTransitionDuration(data.tab);setTimeout(function(){if(!data.dragAborted){_this._dragData=null,Private$7.resetTabPositions(_this.contentNode.children,_this._orientation),data.override.dispose(),_this.removeClass("lm-mod-dragging"),_this.removeClass("p-mod-dragging");var i=data.index,j=data.targetIndex;j===-1||i===j||(ArrayExt.move(_this._titles,i,j),_this._adjustCurrentForMove(i,j),_this._tabMoved.emit({fromIndex:i,toIndex:j,title:_this._titles[j]}),MessageLoop.sendMessage(_this,Widget.Msg.UpdateRequest))}},duration)}}}},TabBar2.prototype._releaseMouse=function(){var data=this._dragData;data&&(this._dragData=null,this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),data.dragAborted=!0,data.dragActive&&(Private$7.resetTabPositions(this.contentNode.children,this._orientation),data.override.dispose(),data.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging"),data.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},TabBar2.prototype._adjustCurrentForInsert=function(i,title){var ct=this.currentTitle,ci=this._currentIndex,bh=this.insertBehavior;if(bh==="select-tab"||bh==="select-tab-if-needed"&&ci===-1){this._currentIndex=i,this._previousTitle=ct,this._currentChanged.emit({previousIndex:ci,previousTitle:ct,currentIndex:i,currentTitle:title});return}ci>=i&&this._currentIndex++},TabBar2.prototype._adjustCurrentForMove=function(i,j){this._currentIndex===i?this._currentIndex=j:this._currentIndex<i&&this._currentIndex>=j?this._currentIndex++:this._currentIndex>i&&this._currentIndex<=j&&this._currentIndex--},TabBar2.prototype._adjustCurrentForRemove=function(i,title){var ci=this._currentIndex,bh=this.removeBehavior;if(ci!==i){ci>i&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:-1,currentTitle:null});return}if(bh==="select-tab-after"){this._currentIndex=Math.min(i,this._titles.length-1),this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(bh==="select-tab-before"){this._currentIndex=Math.max(0,i-1),this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(bh==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(i,this._titles.length-1),this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:-1,currentTitle:null})},TabBar2.prototype._onTitleChanged=function(sender){this.update()},TabBar2}(Widget);(function(TabBar2){var Renderer=function(){function Renderer2(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++Renderer2._nInstance}return Renderer2.prototype.renderTab=function(data){var title=data.title.caption,key=this.createTabKey(data),id=key,style=this.createTabStyle(data),className=this.createTabClass(data),dataset=this.createTabDataset(data),aria=this.createTabARIA(data);return data.title.closable?h.li(__assign({id,key,className,title,style,dataset},aria),this.renderIcon(data),this.renderLabel(data),this.renderCloseIcon(data)):h.li(__assign({id,key,className,title,style,dataset},aria),this.renderIcon(data),this.renderLabel(data))},Renderer2.prototype.renderIcon=function(data){var title=data.title,className=this.createIconClass(data);return typeof title.icon=="string"?h.div({className},title.iconLabel):h.div({className},title.icon,title.iconLabel)},Renderer2.prototype.renderLabel=function(data){return h.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},data.title.label)},Renderer2.prototype.renderCloseIcon=function(data){return h.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},Renderer2.prototype.createTabKey=function(data){var key=this._tabKeys.get(data.title);return key===void 0&&(key="tab-key-"+this._uuid+"-"+this._tabID++,this._tabKeys.set(data.title,key)),key},Renderer2.prototype.createTabStyle=function(data){return{zIndex:""+data.zIndex}},Renderer2.prototype.createTabClass=function(data){var name2="lm-TabBar-tab";return name2+=" p-TabBar-tab",data.title.className&&(name2+=" "+data.title.className),data.title.closable&&(name2+=" lm-mod-closable",name2+=" p-mod-closable"),data.current&&(name2+=" lm-mod-current",name2+=" p-mod-current"),name2},Renderer2.prototype.createTabDataset=function(data){return data.title.dataset},Renderer2.prototype.createTabARIA=function(data){return{role:"tab","aria-selected":data.current.toString()}},Renderer2.prototype.createIconClass=function(data){var name2="lm-TabBar-tabIcon";name2+=" p-TabBar-tabIcon";var extra=data.title.iconClass;return extra?name2+" "+extra:name2},Renderer2._nInstance=0,Renderer2}();TabBar2.Renderer=Renderer,TabBar2.defaultRenderer=new Renderer,TabBar2.addButtonSelector=".lm-TabBar-addButton"})(TabBar||(TabBar={}));var Private$7;(function(Private2){Private2.DRAG_THRESHOLD=5,Private2.DETACH_THRESHOLD=20;function createNode(){var node=document.createElement("div"),content=document.createElement("ul");content.setAttribute("role","tablist"),content.className="lm-TabBar-content",content.classList.add("p-TabBar-content"),node.appendChild(content);var add=document.createElement("div");return add.className="lm-TabBar-addButton lm-mod-hidden",node.appendChild(add),node}Private2.createNode=createNode;function asTitle(value){return value instanceof Title?value:new Title(value)}Private2.asTitle=asTitle;function parseTransitionDuration(tab){var style=window.getComputedStyle(tab);return 1e3*(parseFloat(style.transitionDuration)||0)}Private2.parseTransitionDuration=parseTransitionDuration;function snapTabLayout(tabs,orientation){for(var layout=new Array(tabs.length),i=0,n=tabs.length;i<n;++i){var node=tabs[i],style=window.getComputedStyle(node);orientation==="horizontal"?layout[i]={pos:node.offsetLeft,size:node.offsetWidth,margin:parseFloat(style.marginLeft)||0}:layout[i]={pos:node.offsetTop,size:node.offsetHeight,margin:parseFloat(style.marginTop)||0}}return layout}Private2.snapTabLayout=snapTabLayout;function dragExceeded(data,event){var dx=Math.abs(event.clientX-data.pressX),dy=Math.abs(event.clientY-data.pressY);return dx>=Private2.DRAG_THRESHOLD||dy>=Private2.DRAG_THRESHOLD}Private2.dragExceeded=dragExceeded;function detachExceeded(data,event){var rect=data.contentRect;return event.clientX<rect.left-Private2.DETACH_THRESHOLD||event.clientX>=rect.right+Private2.DETACH_THRESHOLD||event.clientY<rect.top-Private2.DETACH_THRESHOLD||event.clientY>=rect.bottom+Private2.DETACH_THRESHOLD}Private2.detachExceeded=detachExceeded;function layoutTabs(tabs,data,event,orientation){var pressPos,localPos,clientPos,clientSize;orientation==="horizontal"?(pressPos=data.pressX,localPos=event.clientX-data.contentRect.left,clientPos=event.clientX,clientSize=data.contentRect.width):(pressPos=data.pressY,localPos=event.clientY-data.contentRect.top,clientPos=event.clientY,clientSize=data.contentRect.height);for(var targetIndex=data.index,targetPos=localPos-data.tabPressPos,targetEnd=targetPos+data.tabSize,i=0,n=tabs.length;i<n;++i){var pxPos=void 0,layout=data.tabLayout[i],threshold=layout.pos+(layout.size>>1);if(i<data.index&&targetPos<threshold)pxPos=data.tabSize+data.tabLayout[i+1].margin+"px",targetIndex=Math.min(targetIndex,i);else if(i>data.index&&targetEnd>threshold)pxPos=-data.tabSize-layout.margin+"px",targetIndex=Math.max(targetIndex,i);else if(i===data.index){var ideal=clientPos-pressPos,limit=clientSize-(data.tabPos+data.tabSize);pxPos=Math.max(-data.tabPos,Math.min(ideal,limit))+"px"}else pxPos="";orientation==="horizontal"?tabs[i].style.left=pxPos:tabs[i].style.top=pxPos}data.targetIndex=targetIndex}Private2.layoutTabs=layoutTabs;function finalizeTabPosition(data,orientation){var clientSize;orientation==="horizontal"?clientSize=data.contentRect.width:clientSize=data.contentRect.height;var ideal;if(data.targetIndex===data.index)ideal=0;else if(data.targetIndex>data.index){var tgt=data.tabLayout[data.targetIndex];ideal=tgt.pos+tgt.size-data.tabSize-data.tabPos}else{var tgt=data.tabLayout[data.targetIndex];ideal=tgt.pos-data.tabPos}var limit=clientSize-(data.tabPos+data.tabSize),final=Math.max(-data.tabPos,Math.min(ideal,limit));orientation==="horizontal"?data.tab.style.left=final+"px":data.tab.style.top=final+"px"}Private2.finalizeTabPosition=finalizeTabPosition;function resetTabPositions(tabs,orientation){each(tabs,function(tab){orientation==="horizontal"?tab.style.left="":tab.style.top=""})}Private2.resetTabPositions=resetTabPositions})(Private$7||(Private$7={}));var DockLayout=function(_super){__extends(DockLayout2,_super);function DockLayout2(options){var _this=_super.call(this)||this;return _this._spacing=4,_this._dirty=!1,_this._root=null,_this._box=null,_this._items=new Map,_this.renderer=options.renderer,options.spacing!==void 0&&(_this._spacing=Utils$1.clampDimension(options.spacing)),_this._document=options.document||document,_this._hiddenMode=options.hiddenMode!==void 0?options.hiddenMode:Widget.HiddenMode.Display,_this}return DockLayout2.prototype.dispose=function(){var widgets=this.iter();this._items.forEach(function(item){item.dispose()}),this._box=null,this._root=null,this._items.clear(),each(widgets,function(widget){widget.dispose()}),_super.prototype.dispose.call(this)},Object.defineProperty(DockLayout2.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(v){var _this=this;this._hiddenMode!==v&&(this._hiddenMode=v,each(this.tabBars(),function(bar){bar.titles.length>1&&bar.titles.forEach(function(title){title.owner.hiddenMode=_this._hiddenMode})}))},enumerable:!0,configurable:!0}),Object.defineProperty(DockLayout2.prototype,"spacing",{get:function(){return this._spacing},set:function(value){value=Utils$1.clampDimension(value),this._spacing!==value&&(this._spacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(DockLayout2.prototype,"isEmpty",{get:function(){return this._root===null},enumerable:!0,configurable:!0}),DockLayout2.prototype.iter=function(){return this._root?this._root.iterAllWidgets():empty()},DockLayout2.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():empty()},DockLayout2.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():empty()},DockLayout2.prototype.tabBars=function(){return this._root?this._root.iterTabBars():empty()},DockLayout2.prototype.handles=function(){return this._root?this._root.iterHandles():empty()},DockLayout2.prototype.moveHandle=function(handle,offsetX,offsetY){var hidden=handle.classList.contains("lm-mod-hidden");if(hidden=hidden||handle.classList.contains("p-mod-hidden"),!(!this._root||hidden)){var data=this._root.findSplitNode(handle);if(data){var delta;data.node.orientation==="horizontal"?delta=offsetX-handle.offsetLeft:delta=offsetY-handle.offsetTop,delta!==0&&(data.node.holdSizes(),BoxEngine.adjust(data.node.sizers,data.index,delta),this.parent&&this.parent.update())}}},DockLayout2.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},DockLayout2.prototype.restoreLayout=function(config){var _this=this,widgetSet=new Set,mainConfig;config.main?mainConfig=Private$6.normalizeAreaConfig(config.main,widgetSet):mainConfig=null;var oldWidgets=this.widgets(),oldTabBars=this.tabBars(),oldHandles=this.handles();this._root=null,each(oldWidgets,function(widget){widgetSet.has(widget)||(widget.parent=null)}),each(oldTabBars,function(tabBar){tabBar.dispose()}),each(oldHandles,function(handle){handle.parentNode&&handle.parentNode.removeChild(handle)}),widgetSet.forEach(function(widget){widget.parent=_this.parent}),mainConfig?this._root=Private$6.realizeAreaConfig(mainConfig,{createTabBar:function(document2){return _this._createTabBar()},createHandle:function(){return _this._createHandle()}},this._document):this._root=null,this.parent&&(widgetSet.forEach(function(widget){_this.attachWidget(widget)}),this.parent.fit())},DockLayout2.prototype.addWidget=function(widget,options){options===void 0&&(options={});var ref=options.ref||null,mode=options.mode||"tab-after",refNode=null;if(this._root&&ref&&(refNode=this._root.findTabNode(ref)),ref&&!refNode)throw new Error("Reference widget is not in the layout.");switch(widget.parent=this.parent,mode){case"tab-after":this._insertTab(widget,ref,refNode,!0);break;case"tab-before":this._insertTab(widget,ref,refNode,!1);break;case"split-top":this._insertSplit(widget,ref,refNode,"vertical",!1);break;case"split-left":this._insertSplit(widget,ref,refNode,"horizontal",!1);break;case"split-right":this._insertSplit(widget,ref,refNode,"horizontal",!0);break;case"split-bottom":this._insertSplit(widget,ref,refNode,"vertical",!0);break}this.parent&&(this.attachWidget(widget),this.parent.fit())},DockLayout2.prototype.removeWidget=function(widget){this._removeWidget(widget),this.parent&&(this.detachWidget(widget),this.parent.fit())},DockLayout2.prototype.hitTestTabAreas=function(clientX,clientY){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=ElementExt.boxSizing(this.parent.node));var rect=this.parent.node.getBoundingClientRect(),x=clientX-rect.left-this._box.borderLeft,y=clientY-rect.top-this._box.borderTop,tabNode=this._root.hitTestTabNodes(x,y);if(!tabNode)return null;var tabBar=tabNode.tabBar,top=tabNode.top,left=tabNode.left,width=tabNode.width,height=tabNode.height,borderWidth=this._box.borderLeft+this._box.borderRight,borderHeight=this._box.borderTop+this._box.borderBottom,right=rect.width-borderWidth-(left+width),bottom=rect.height-borderHeight-(top+height);return{tabBar,x,y,top,left,right,bottom,width,height}},DockLayout2.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget){_this.attachWidget(widget)}),each(this.handles(),function(handle){_this.parent.node.appendChild(handle)}),this.parent.fit()},DockLayout2.prototype.attachWidget=function(widget){this.parent.node!==widget.node.parentNode&&(this._items.set(widget,new LayoutItem(widget)),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach))},DockLayout2.prototype.detachWidget=function(widget){if(this.parent.node===widget.node.parentNode){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach);var item=this._items.get(widget);item&&(this._items.delete(widget),item.dispose())}},DockLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},DockLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},DockLayout2.prototype.onChildShown=function(msg){this.parent.fit()},DockLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},DockLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},DockLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},DockLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},DockLayout2.prototype._removeWidget=function(widget){if(this._root){var tabNode=this._root.findTabNode(widget);if(tabNode){if(Private$6.removeAria(widget),tabNode.tabBar.titles.length>1){if(tabNode.tabBar.removeTab(widget.title),this._hiddenMode===Widget.HiddenMode.Scale&&tabNode.tabBar.titles.length==1){var existingWidget=tabNode.tabBar.titles[0].owner;existingWidget.hiddenMode=Widget.HiddenMode.Display}return}if(tabNode.tabBar.dispose(),this._root===tabNode){this._root=null;return}this._root.holdAllSizes();var splitNode=tabNode.parent;tabNode.parent=null;var i=ArrayExt.removeFirstOf(splitNode.children,tabNode),handle=ArrayExt.removeAt(splitNode.handles,i);if(ArrayExt.removeAt(splitNode.sizers,i),handle.parentNode&&handle.parentNode.removeChild(handle),splitNode.children.length>1){splitNode.syncHandles();return}var maybeParent=splitNode.parent;splitNode.parent=null;var childNode=splitNode.children[0],childHandle=splitNode.handles[0];if(splitNode.children.length=0,splitNode.handles.length=0,splitNode.sizers.length=0,childHandle.parentNode&&childHandle.parentNode.removeChild(childHandle),this._root===splitNode){childNode.parent=null,this._root=childNode;return}var parentNode=maybeParent,j=parentNode.children.indexOf(splitNode);if(childNode instanceof Private$6.TabLayoutNode){childNode.parent=parentNode,parentNode.children[j]=childNode;return}var splitHandle=ArrayExt.removeAt(parentNode.handles,j);ArrayExt.removeAt(parentNode.children,j),ArrayExt.removeAt(parentNode.sizers,j),splitHandle.parentNode&&splitHandle.parentNode.removeChild(splitHandle);for(var i_1=0,n=childNode.children.length;i_1<n;++i_1){var gChild=childNode.children[i_1],gHandle=childNode.handles[i_1],gSizer=childNode.sizers[i_1];ArrayExt.insert(parentNode.children,j+i_1,gChild),ArrayExt.insert(parentNode.handles,j+i_1,gHandle),ArrayExt.insert(parentNode.sizers,j+i_1,gSizer),gChild.parent=parentNode}childNode.children.length=0,childNode.handles.length=0,childNode.sizers.length=0,childNode.parent=null,parentNode.syncHandles()}}},DockLayout2.prototype._insertTab=function(widget,ref,refNode,after){if(widget!==ref){if(!this._root){var tabNode=new Private$6.TabLayoutNode(this._createTabBar());tabNode.tabBar.addTab(widget.title),this._root=tabNode,Private$6.addAria(widget,tabNode.tabBar);return}refNode||(refNode=this._root.findFirstTabNode()),refNode.tabBar.titles.indexOf(widget.title)===-1&&(this._removeWidget(widget),widget.hide());var index;if(ref?index=refNode.tabBar.titles.indexOf(ref.title):index=refNode.tabBar.currentIndex,this._hiddenMode===Widget.HiddenMode.Scale)if(refNode.tabBar.titles.length===0)widget.hiddenMode=Widget.HiddenMode.Display;else if(refNode.tabBar.titles.length==1){var existingWidget=refNode.tabBar.titles[0].owner;existingWidget.hiddenMode=Widget.HiddenMode.Scale}else widget.hiddenMode=Widget.HiddenMode.Scale;else widget.hiddenMode=this._hiddenMode;refNode.tabBar.insertTab(index+(after?1:0),widget.title),Private$6.addAria(widget,refNode.tabBar)}},DockLayout2.prototype._insertSplit=function(widget,ref,refNode,orientation,after){if(!(widget===ref&&refNode&&refNode.tabBar.titles.length===1)){this._removeWidget(widget);var tabNode=new Private$6.TabLayoutNode(this._createTabBar());if(tabNode.tabBar.addTab(widget.title),Private$6.addAria(widget,tabNode.tabBar),!this._root){this._root=tabNode;return}if(!refNode||!refNode.parent){var root=this._splitRoot(orientation),i_2=after?root.children.length:0;root.normalizeSizes();var sizer=Private$6.createSizer(refNode?1:Private$6.GOLDEN_RATIO);ArrayExt.insert(root.children,i_2,tabNode),ArrayExt.insert(root.sizers,i_2,sizer),ArrayExt.insert(root.handles,i_2,this._createHandle()),tabNode.parent=root,root.normalizeSizes(),root.syncHandles();return}var splitNode=refNode.parent;if(splitNode.orientation===orientation){var i_3=splitNode.children.indexOf(refNode);splitNode.normalizeSizes();var s=splitNode.sizers[i_3].sizeHint/=2,j_1=i_3+(after?1:0);ArrayExt.insert(splitNode.children,j_1,tabNode),ArrayExt.insert(splitNode.sizers,j_1,Private$6.createSizer(s)),ArrayExt.insert(splitNode.handles,j_1,this._createHandle()),tabNode.parent=splitNode,splitNode.syncHandles();return}var i=ArrayExt.removeFirstOf(splitNode.children,refNode),childNode=new Private$6.SplitLayoutNode(orientation);childNode.normalized=!0,childNode.children.push(refNode),childNode.sizers.push(Private$6.createSizer(.5)),childNode.handles.push(this._createHandle()),refNode.parent=childNode;var j=after?1:0;ArrayExt.insert(childNode.children,j,tabNode),ArrayExt.insert(childNode.sizers,j,Private$6.createSizer(.5)),ArrayExt.insert(childNode.handles,j,this._createHandle()),tabNode.parent=childNode,childNode.syncHandles(),ArrayExt.insert(splitNode.children,i,childNode),childNode.parent=splitNode}},DockLayout2.prototype._splitRoot=function(orientation){var oldRoot=this._root;if(oldRoot instanceof Private$6.SplitLayoutNode&&oldRoot.orientation===orientation)return oldRoot;var newRoot=this._root=new Private$6.SplitLayoutNode(orientation);return oldRoot&&(newRoot.children.push(oldRoot),newRoot.sizers.push(Private$6.createSizer(0)),newRoot.handles.push(this._createHandle()),oldRoot.parent=newRoot),newRoot},DockLayout2.prototype._fit=function(){var minW=0,minH=0;if(this._root){var limits=this._root.fit(this._spacing,this._items);minW=limits.minWidth,minH=limits.minHeight}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},DockLayout2.prototype._update=function(offsetWidth,offsetHeight){if(this._dirty=!1,!!this._root){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var x=this._box.paddingTop,y=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum;this._root.update(x,y,width,height,this._spacing,this._items)}},DockLayout2.prototype._createTabBar=function(){var tabBar=this.renderer.createTabBar(this._document);return tabBar.orientation="horizontal",this.parent&&(tabBar.parent=this.parent,this.attachWidget(tabBar)),tabBar},DockLayout2.prototype._createHandle=function(){var handle=this.renderer.createHandle(),style=handle.style;return style.position="absolute",style.top="0",style.left="0",style.width="0",style.height="0",this.parent&&this.parent.node.appendChild(handle),handle},DockLayout2}(Layout),Private$6;(function(Private2){Private2.GOLDEN_RATIO=.618;function createSizer(hint){var sizer=new BoxSizer;return sizer.sizeHint=hint,sizer.size=hint,sizer}Private2.createSizer=createSizer;function normalizeAreaConfig(config,widgetSet){var result;return config.type==="tab-area"?result=normalizeTabAreaConfig(config,widgetSet):result=normalizeSplitAreaConfig(config,widgetSet),result}Private2.normalizeAreaConfig=normalizeAreaConfig;function realizeAreaConfig(config,renderer,document2){var node;return config.type==="tab-area"?node=realizeTabAreaConfig(config,renderer,document2):node=realizeSplitAreaConfig(config,renderer,document2),node}Private2.realizeAreaConfig=realizeAreaConfig;var TabLayoutNode=function(){function TabLayoutNode2(tabBar){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var tabSizer=new BoxSizer,widgetSizer=new BoxSizer;tabSizer.stretch=0,widgetSizer.stretch=1,this.tabBar=tabBar,this.sizers=[tabSizer,widgetSizer]}return Object.defineProperty(TabLayoutNode2.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(TabLayoutNode2.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(TabLayoutNode2.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(TabLayoutNode2.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),TabLayoutNode2.prototype.iterAllWidgets=function(){return chain(once(this.tabBar),this.iterUserWidgets())},TabLayoutNode2.prototype.iterUserWidgets=function(){return map(this.tabBar.titles,function(title){return title.owner})},TabLayoutNode2.prototype.iterSelectedWidgets=function(){var title=this.tabBar.currentTitle;return title?once(title.owner):empty()},TabLayoutNode2.prototype.iterTabBars=function(){return once(this.tabBar)},TabLayoutNode2.prototype.iterHandles=function(){return empty()},TabLayoutNode2.prototype.findTabNode=function(widget){return this.tabBar.titles.indexOf(widget.title)!==-1?this:null},TabLayoutNode2.prototype.findSplitNode=function(handle){return null},TabLayoutNode2.prototype.findFirstTabNode=function(){return this},TabLayoutNode2.prototype.hitTestTabNodes=function(x,y){return x<this._left||x>=this._left+this._width||y<this._top||y>=this._top+this._height?null:this},TabLayoutNode2.prototype.createConfig=function(){var widgets=this.tabBar.titles.map(function(title){return title.owner}),currentIndex=this.tabBar.currentIndex;return{type:"tab-area",widgets,currentIndex}},TabLayoutNode2.prototype.holdAllSizes=function(){},TabLayoutNode2.prototype.fit=function(spacing,items){var minWidth=0,minHeight=0,maxWidth=1/0,maxHeight=1/0,tabBarItem=items.get(this.tabBar),current=this.tabBar.currentTitle,widgetItem=current?items.get(current.owner):void 0,_a=this.sizers,tabBarSizer=_a[0],widgetSizer=_a[1];return tabBarItem&&tabBarItem.fit(),widgetItem&&widgetItem.fit(),tabBarItem&&!tabBarItem.isHidden?(minWidth=Math.max(minWidth,tabBarItem.minWidth),minHeight+=tabBarItem.minHeight,tabBarSizer.minSize=tabBarItem.minHeight,tabBarSizer.maxSize=tabBarItem.maxHeight):(tabBarSizer.minSize=0,tabBarSizer.maxSize=0),widgetItem&&!widgetItem.isHidden?(minWidth=Math.max(minWidth,widgetItem.minWidth),minHeight+=widgetItem.minHeight,widgetSizer.minSize=widgetItem.minHeight,widgetSizer.maxSize=1/0):(widgetSizer.minSize=0,widgetSizer.maxSize=1/0),{minWidth,minHeight,maxWidth,maxHeight}},TabLayoutNode2.prototype.update=function(left,top,width,height,spacing,items){this._top=top,this._left=left,this._width=width,this._height=height;var tabBarItem=items.get(this.tabBar),current=this.tabBar.currentTitle,widgetItem=current?items.get(current.owner):void 0;if(BoxEngine.calc(this.sizers,height),tabBarItem&&!tabBarItem.isHidden){var size=this.sizers[0].size;tabBarItem.update(left,top,width,size),top+=size}if(widgetItem&&!widgetItem.isHidden){var size=this.sizers[1].size;widgetItem.update(left,top,width,size)}},TabLayoutNode2}();Private2.TabLayoutNode=TabLayoutNode;var SplitLayoutNode=function(){function SplitLayoutNode2(orientation){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=orientation}return SplitLayoutNode2.prototype.iterAllWidgets=function(){var children=map(this.children,function(child){return child.iterAllWidgets()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterUserWidgets=function(){var children=map(this.children,function(child){return child.iterUserWidgets()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterSelectedWidgets=function(){var children=map(this.children,function(child){return child.iterSelectedWidgets()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterTabBars=function(){var children=map(this.children,function(child){return child.iterTabBars()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterHandles=function(){var children=map(this.children,function(child){return child.iterHandles()});return chain(this.handles,new ChainIterator(children))},SplitLayoutNode2.prototype.findTabNode=function(widget){for(var i=0,n=this.children.length;i<n;++i){var result=this.children[i].findTabNode(widget);if(result)return result}return null},SplitLayoutNode2.prototype.findSplitNode=function(handle){var index=this.handles.indexOf(handle);if(index!==-1)return{index,node:this};for(var i=0,n=this.children.length;i<n;++i){var result=this.children[i].findSplitNode(handle);if(result)return result}return null},SplitLayoutNode2.prototype.findFirstTabNode=function(){return this.children.length===0?null:this.children[0].findFirstTabNode()},SplitLayoutNode2.prototype.hitTestTabNodes=function(x,y){for(var i=0,n=this.children.length;i<n;++i){var result=this.children[i].hitTestTabNodes(x,y);if(result)return result}return null},SplitLayoutNode2.prototype.createConfig=function(){var orientation=this.orientation,sizes=this.createNormalizedSizes(),children=this.children.map(function(child){return child.createConfig()});return{type:"split-area",orientation,children,sizes}},SplitLayoutNode2.prototype.syncHandles=function(){var _this=this;each(this.handles,function(handle,i){handle.setAttribute("data-orientation",_this.orientation),i===_this.handles.length-1?(handle.classList.add("lm-mod-hidden"),handle.classList.add("p-mod-hidden")):(handle.classList.remove("lm-mod-hidden"),handle.classList.remove("p-mod-hidden"))})},SplitLayoutNode2.prototype.holdSizes=function(){each(this.sizers,function(sizer){sizer.sizeHint=sizer.size})},SplitLayoutNode2.prototype.holdAllSizes=function(){each(this.children,function(child){return child.holdAllSizes()}),this.holdSizes()},SplitLayoutNode2.prototype.normalizeSizes=function(){var n=this.sizers.length;if(n!==0){this.holdSizes();var sum=reduce(this.sizers,function(v,sizer){return v+sizer.sizeHint},0);sum===0?each(this.sizers,function(sizer){sizer.size=sizer.sizeHint=1/n}):each(this.sizers,function(sizer){sizer.size=sizer.sizeHint/=sum}),this.normalized=!0}},SplitLayoutNode2.prototype.createNormalizedSizes=function(){var n=this.sizers.length;if(n===0)return[];var sizes=this.sizers.map(function(sizer){return sizer.size}),sum=reduce(sizes,function(v,size){return v+size},0);return sum===0?each(sizes,function(size,i){sizes[i]=1/n}):each(sizes,function(size,i){sizes[i]=size/sum}),sizes},SplitLayoutNode2.prototype.fit=function(spacing,items){for(var horizontal=this.orientation==="horizontal",fixed=Math.max(0,this.children.length-1)*spacing,minWidth=horizontal?fixed:0,minHeight=horizontal?0:fixed,maxWidth=1/0,maxHeight=1/0,i=0,n=this.children.length;i<n;++i){var limits=this.children[i].fit(spacing,items);horizontal?(minHeight=Math.max(minHeight,limits.minHeight),minWidth+=limits.minWidth,this.sizers[i].minSize=limits.minWidth):(minWidth=Math.max(minWidth,limits.minWidth),minHeight+=limits.minHeight,this.sizers[i].minSize=limits.minHeight)}return{minWidth,minHeight,maxWidth,maxHeight}},SplitLayoutNode2.prototype.update=function(left,top,width,height,spacing,items){var horizontal=this.orientation==="horizontal",fixed=Math.max(0,this.children.length-1)*spacing,space=Math.max(0,(horizontal?width:height)-fixed);this.normalized&&(each(this.sizers,function(sizer){sizer.sizeHint*=space}),this.normalized=!1),BoxEngine.calc(this.sizers,space);for(var i=0,n=this.children.length;i<n;++i){var child=this.children[i],size=this.sizers[i].size,handleStyle=this.handles[i].style;horizontal?(child.update(left,top,size,height,spacing,items),left+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=spacing+"px",handleStyle.height=height+"px",left+=spacing):(child.update(left,top,width,size,spacing,items),top+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=width+"px",handleStyle.height=spacing+"px",top+=spacing)}},SplitLayoutNode2}();Private2.SplitLayoutNode=SplitLayoutNode;function addAria(widget,tabBar){widget.node.setAttribute("role","tabpanel");var renderer=tabBar.renderer;if(renderer instanceof TabBar.Renderer){var tabId=renderer.createTabKey({title:widget.title,current:!1,zIndex:0});widget.node.setAttribute("aria-labelledby",tabId)}}Private2.addAria=addAria;function removeAria(widget){widget.node.removeAttribute("role"),widget.node.removeAttribute("aria-labelledby")}Private2.removeAria=removeAria;function normalizeTabAreaConfig(config,widgetSet){if(config.widgets.length===0)return null;var widgets=[];if(each(config.widgets,function(widget){widgetSet.has(widget)||(widgetSet.add(widget),widgets.push(widget))}),widgets.length===0)return null;var index=config.currentIndex;return index!==-1&&(index<0||index>=widgets.length)&&(index=0),{type:"tab-area",widgets,currentIndex:index}}function normalizeSplitAreaConfig(config,widgetSet){for(var orientation=config.orientation,children=[],sizes=[],i=0,n=config.children.length;i<n;++i){var child=normalizeAreaConfig(config.children[i],widgetSet);child&&(child.type==="tab-area"||child.orientation!==orientation?(children.push(child),sizes.push(Math.abs(config.sizes[i]||0))):(children.push.apply(children,child.children),sizes.push.apply(sizes,child.sizes)))}return children.length===0?null:children.length===1?children[0]:{type:"split-area",orientation,children,sizes}}function realizeTabAreaConfig(config,renderer,document2){var tabBar=renderer.createTabBar(document2);return each(config.widgets,function(widget){widget.hide(),tabBar.addTab(widget.title),Private2.addAria(widget,tabBar)}),tabBar.currentIndex=config.currentIndex,new TabLayoutNode(tabBar)}function realizeSplitAreaConfig(config,renderer,document2){var node=new SplitLayoutNode(config.orientation);return each(config.children,function(child,i){var childNode=realizeAreaConfig(child,renderer,document2),sizer=createSizer(config.sizes[i]),handle=renderer.createHandle();node.children.push(childNode),node.handles.push(handle),node.sizers.push(sizer),childNode.parent=node}),node.syncHandles(),node.normalizeSizes(),node}})(Private$6||(Private$6={}));var DockPanel$1=function(_super){__extends(DockPanel2,_super);function DockPanel2(options){options===void 0&&(options={});var _this=_super.call(this)||this;_this._drag=null,_this._tabsMovable=!0,_this._tabsConstrained=!1,_this._addButtonEnabled=!1,_this._pressData=null,_this._layoutModified=new Signal(_this),_this._addRequested=new Signal(_this),_this.addClass("lm-DockPanel"),_this.addClass("p-DockPanel"),_this._document=options.document||document,_this._mode=options.mode||"multiple-document",_this._renderer=options.renderer||DockPanel2.defaultRenderer,_this._edges=options.edges||Private$5.DEFAULT_EDGES,options.tabsMovable!==void 0&&(_this._tabsMovable=options.tabsMovable),options.tabsConstrained!==void 0&&(_this._tabsConstrained=options.tabsConstrained),options.addButtonEnabled!==void 0&&(_this._addButtonEnabled=options.addButtonEnabled),_this.dataset.mode=_this._mode;var renderer={createTabBar:function(){return _this._createTabBar()},createHandle:function(){return _this._createHandle()}};return _this.layout=new DockLayout({document:_this._document,renderer,spacing:options.spacing,hiddenMode:options.hiddenMode}),_this.overlay=options.overlay||new DockPanel2.Overlay,_this.node.appendChild(_this.overlay.node),_this}return DockPanel2.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),_super.prototype.dispose.call(this)},Object.defineProperty(DockPanel2.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(v){this.layout.hiddenMode=v},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(value){this.layout.spacing=value},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"mode",{get:function(){return this._mode},set:function(value){if(this._mode!==value){this._mode=value,this.dataset.mode=value;var layout=this.layout;switch(value){case"multiple-document":each(layout.tabBars(),function(tabBar){tabBar.show()});break;case"single-document":layout.restoreLayout(Private$5.createSingleDocumentConfig(this));break;default:throw"unreachable"}MessageLoop.postMessage(this,Private$5.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(value){this._tabsMovable=value,each(this.tabBars(),function(tabbar){tabbar.tabsMovable=value})},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"tabsConstrained",{get:function(){return this._tabsConstrained},set:function(value){this._tabsConstrained=value},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(value){this._addButtonEnabled=value,each(this.tabBars(),function(tabbar){tabbar.addButtonEnabled=value})},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),DockPanel2.prototype.widgets=function(){return this.layout.widgets()},DockPanel2.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},DockPanel2.prototype.tabBars=function(){return this.layout.tabBars()},DockPanel2.prototype.handles=function(){return this.layout.handles()},DockPanel2.prototype.selectWidget=function(widget){var tabBar=find(this.tabBars(),function(bar){return bar.titles.indexOf(widget.title)!==-1});if(!tabBar)throw new Error("Widget is not contained in the dock panel.");tabBar.currentTitle=widget.title},DockPanel2.prototype.activateWidget=function(widget){this.selectWidget(widget),widget.activate()},DockPanel2.prototype.saveLayout=function(){return this.layout.saveLayout()},DockPanel2.prototype.restoreLayout=function(config){this._mode="multiple-document",this.layout.restoreLayout(config),(Platform.IS_EDGE||Platform.IS_IE)&&MessageLoop.flush(),MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype.addWidget=function(widget,options){options===void 0&&(options={}),this._mode==="single-document"?this.layout.addWidget(widget):this.layout.addWidget(widget,options),MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype.processMessage=function(msg){msg.type==="layout-modified"?this._layoutModified.emit(void 0):_super.prototype.processMessage.call(this,msg)},DockPanel2.prototype.handleEvent=function(event){switch(event.type){case"lm-dragenter":this._evtDragEnter(event);break;case"lm-dragleave":this._evtDragLeave(event);break;case"lm-dragover":this._evtDragOver(event);break;case"lm-drop":this._evtDrop(event);break;case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointerdown":this._evtMouseDown(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},DockPanel2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},DockPanel2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},DockPanel2.prototype.onChildAdded=function(msg){Private$5.isGeneratedTabBarProperty.get(msg.child)||(msg.child.addClass("lm-DockPanel-widget"),msg.child.addClass("p-DockPanel-widget"))},DockPanel2.prototype.onChildRemoved=function(msg){Private$5.isGeneratedTabBarProperty.get(msg.child)||(msg.child.removeClass("lm-DockPanel-widget"),msg.child.removeClass("p-DockPanel-widget"),MessageLoop.postMessage(this,Private$5.LayoutModified))},DockPanel2.prototype._evtDragEnter=function(event){event.mimeData.hasData("application/vnd.lumino.widget-factory")&&(event.preventDefault(),event.stopPropagation())},DockPanel2.prototype._evtDragLeave=function(event){event.preventDefault(),!(this._tabsConstrained&&event.source!==this)&&(event.stopPropagation(),this.overlay.hide(1))},DockPanel2.prototype._evtDragOver=function(event){event.preventDefault(),this._tabsConstrained&&event.source!==this||this._showOverlay(event.clientX,event.clientY)==="invalid"?event.dropAction="none":(event.stopPropagation(),event.dropAction=event.proposedAction)},DockPanel2.prototype._evtDrop=function(event){if(event.preventDefault(),this.overlay.hide(0),event.proposedAction==="none"){event.dropAction="none";return}var clientX=event.clientX,clientY=event.clientY,_a=Private$5.findDropTarget(this,clientX,clientY,this._edges),zone=_a.zone,target=_a.target;if(this._tabsConstrained&&event.source!==this||zone==="invalid"){event.dropAction="none";return}var mimeData=event.mimeData,factory=mimeData.getData("application/vnd.lumino.widget-factory");if(typeof factory!="function"){event.dropAction="none";return}var widget=factory();if(!(widget instanceof Widget)){event.dropAction="none";return}if(widget.contains(this)){event.dropAction="none";return}var ref=target?Private$5.getDropRef(target.tabBar):null;switch(zone){case"root-all":this.addWidget(widget);break;case"root-top":this.addWidget(widget,{mode:"split-top"});break;case"root-left":this.addWidget(widget,{mode:"split-left"});break;case"root-right":this.addWidget(widget,{mode:"split-right"});break;case"root-bottom":this.addWidget(widget,{mode:"split-bottom"});break;case"widget-all":this.addWidget(widget,{mode:"tab-after",ref});break;case"widget-top":this.addWidget(widget,{mode:"split-top",ref});break;case"widget-left":this.addWidget(widget,{mode:"split-left",ref});break;case"widget-right":this.addWidget(widget,{mode:"split-right",ref});break;case"widget-bottom":this.addWidget(widget,{mode:"split-bottom",ref});break;case"widget-tab":this.addWidget(widget,{mode:"tab-after",ref});break;default:throw"unreachable"}event.dropAction=event.proposedAction,event.stopPropagation(),this.activateWidget(widget)},DockPanel2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation(),event.keyCode===27&&(this._releaseMouse(),MessageLoop.postMessage(this,Private$5.LayoutModified))},DockPanel2.prototype._evtMouseDown=function(event){if(event.button===0){var layout=this.layout,target=event.target,handle=find(layout.handles(),function(handle2){return handle2.contains(target)});if(handle){event.preventDefault(),event.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("mouseup",this,!0),this._document.addEventListener("mousemove",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);var rect=handle.getBoundingClientRect(),deltaX=event.clientX-rect.left,deltaY=event.clientY-rect.top,style=window.getComputedStyle(handle),override=Drag.overrideCursor(style.cursor,this._document);this._pressData={handle,deltaX,deltaY,override}}}},DockPanel2.prototype._evtMouseMove=function(event){if(this._pressData){event.preventDefault(),event.stopPropagation();var rect=this.node.getBoundingClientRect(),xPos=event.clientX-rect.left-this._pressData.deltaX,yPos=event.clientY-rect.top-this._pressData.deltaY,layout=this.layout;layout.moveHandle(this._pressData.handle,xPos,yPos)}},DockPanel2.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this._releaseMouse(),MessageLoop.postMessage(this,Private$5.LayoutModified))},DockPanel2.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("mouseup",this,!0),this._document.removeEventListener("mousemove",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))},DockPanel2.prototype._showOverlay=function(clientX,clientY){var _a=Private$5.findDropTarget(this,clientX,clientY,this._edges),zone=_a.zone,target=_a.target;if(zone==="invalid")return this.overlay.hide(100),zone;var top,left,right,bottom,box=ElementExt.boxSizing(this.node),rect=this.node.getBoundingClientRect();switch(zone){case"root-all":top=box.paddingTop,left=box.paddingLeft,right=box.paddingRight,bottom=box.paddingBottom;break;case"root-top":top=box.paddingTop,left=box.paddingLeft,right=box.paddingRight,bottom=rect.height*Private$5.GOLDEN_RATIO;break;case"root-left":top=box.paddingTop,left=box.paddingLeft,right=rect.width*Private$5.GOLDEN_RATIO,bottom=box.paddingBottom;break;case"root-right":top=box.paddingTop,left=rect.width*Private$5.GOLDEN_RATIO,right=box.paddingRight,bottom=box.paddingBottom;break;case"root-bottom":top=rect.height*Private$5.GOLDEN_RATIO,left=box.paddingLeft,right=box.paddingRight,bottom=box.paddingBottom;break;case"widget-all":top=target.top,left=target.left,right=target.right,bottom=target.bottom;break;case"widget-top":top=target.top,left=target.left,right=target.right,bottom=target.bottom+target.height/2;break;case"widget-left":top=target.top,left=target.left,right=target.right+target.width/2,bottom=target.bottom;break;case"widget-right":top=target.top,left=target.left+target.width/2,right=target.right,bottom=target.bottom;break;case"widget-bottom":top=target.top+target.height/2,left=target.left,right=target.right,bottom=target.bottom;break;case"widget-tab":var tabHeight=target.tabBar.node.getBoundingClientRect().height;top=target.top,left=target.left,right=target.right,bottom=target.bottom+target.height-tabHeight;break;default:throw"unreachable"}return this.overlay.show({top,left,right,bottom}),zone},DockPanel2.prototype._createTabBar=function(){var tabBar=this._renderer.createTabBar(this._document);return Private$5.isGeneratedTabBarProperty.set(tabBar,!0),this._mode==="single-document"&&tabBar.hide(),tabBar.tabsMovable=this._tabsMovable,tabBar.allowDeselect=!1,tabBar.addButtonEnabled=this._addButtonEnabled,tabBar.removeBehavior="select-previous-tab",tabBar.insertBehavior="select-tab-if-needed",tabBar.tabMoved.connect(this._onTabMoved,this),tabBar.currentChanged.connect(this._onCurrentChanged,this),tabBar.tabCloseRequested.connect(this._onTabCloseRequested,this),tabBar.tabDetachRequested.connect(this._onTabDetachRequested,this),tabBar.tabActivateRequested.connect(this._onTabActivateRequested,this),tabBar.addRequested.connect(this._onTabAddRequested,this),tabBar},DockPanel2.prototype._createHandle=function(){return this._renderer.createHandle()},DockPanel2.prototype._onTabMoved=function(){MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype._onCurrentChanged=function(sender,args){var previousTitle=args.previousTitle,currentTitle=args.currentTitle;previousTitle&&previousTitle.owner.hide(),currentTitle&¤tTitle.owner.show(),(Platform.IS_EDGE||Platform.IS_IE)&&MessageLoop.flush(),MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype._onTabAddRequested=function(sender){this._addRequested.emit(sender)},DockPanel2.prototype._onTabActivateRequested=function(sender,args){args.title.owner.activate()},DockPanel2.prototype._onTabCloseRequested=function(sender,args){args.title.owner.close()},DockPanel2.prototype._onTabDetachRequested=function(sender,args){var _this=this;if(!this._drag){sender.releaseMouse();var title=args.title,tab=args.tab,clientX=args.clientX,clientY=args.clientY,mimeData=new MimeData,factory=function(){return title.owner};mimeData.setData("application/vnd.lumino.widget-factory",factory);var dragImage=tab.cloneNode(!0);this._drag=new Drag({document:this._document,mimeData,dragImage,proposedAction:"move",supportedActions:"move",source:this}),tab.classList.add("lm-mod-hidden"),tab.classList.add("p-mod-hidden");var cleanup=function(){_this._drag=null,tab.classList.remove("lm-mod-hidden"),tab.classList.remove("p-mod-hidden")};this._drag.start(clientX,clientY).then(cleanup)}},DockPanel2}(Widget);(function(DockPanel2){var Overlay=function(){function Overlay2(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return Overlay2.prototype.show=function(geo){var style=this.node.style;style.top=geo.top+"px",style.left=geo.left+"px",style.right=geo.right+"px",style.bottom=geo.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"),this.node.classList.remove("p-mod-hidden"))},Overlay2.prototype.hide=function(delay){var _this=this;if(!this._hidden){if(delay<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(function(){_this._timer=-1,_this._hidden=!0,_this.node.classList.add("lm-mod-hidden"),_this.node.classList.add("p-mod-hidden")},delay))}},Overlay2}();DockPanel2.Overlay=Overlay;var Renderer=function(){function Renderer2(){}return Renderer2.prototype.createTabBar=function(document2){var bar=new TabBar({document:document2});return bar.addClass("lm-DockPanel-tabBar"),bar.addClass("p-DockPanel-tabBar"),bar},Renderer2.prototype.createHandle=function(){var handle=document.createElement("div");return handle.className="lm-DockPanel-handle",handle.classList.add("p-DockPanel-handle"),handle},Renderer2}();DockPanel2.Renderer=Renderer,DockPanel2.defaultRenderer=new Renderer})(DockPanel$1||(DockPanel$1={}));var Private$5;(function(Private2){Private2.GOLDEN_RATIO=.618,Private2.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},Private2.LayoutModified=new ConflatableMessage("layout-modified"),Private2.isGeneratedTabBarProperty=new AttachedProperty({name:"isGeneratedTabBar",create:function(){return!1}});function createSingleDocumentConfig(panel){if(panel.isEmpty)return{main:null};var widgets=toArray(panel.widgets()),selected=panel.selectedWidgets().next(),currentIndex=selected?widgets.indexOf(selected):-1;return{main:{type:"tab-area",widgets,currentIndex}}}Private2.createSingleDocumentConfig=createSingleDocumentConfig;function findDropTarget(panel,clientX,clientY,edges){if(!ElementExt.hitTest(panel.node,clientX,clientY))return{zone:"invalid",target:null};var layout=panel.layout;if(layout.isEmpty)return{zone:"root-all",target:null};if(panel.mode==="multiple-document"){var panelRect=panel.node.getBoundingClientRect(),pl=clientX-panelRect.left+1,pt=clientY-panelRect.top+1,pr=panelRect.right-clientX,pb=panelRect.bottom-clientY,pd=Math.min(pt,pr,pb,pl);switch(pd){case pt:if(pt<edges.top)return{zone:"root-top",target:null};break;case pr:if(pr<edges.right)return{zone:"root-right",target:null};break;case pb:if(pb<edges.bottom)return{zone:"root-bottom",target:null};break;case pl:if(pl<edges.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var target=layout.hitTestTabAreas(clientX,clientY);if(!target)return{zone:"invalid",target:null};if(panel.mode==="single-document")return{zone:"widget-all",target};var al=target.x-target.left+1,at=target.y-target.top+1,ar=target.left+target.width-target.x,ab=target.top+target.height-target.y,tabHeight=target.tabBar.node.getBoundingClientRect().height;if(at<tabHeight)return{zone:"widget-tab",target};var rx=Math.round(target.width/3),ry=Math.round(target.height/3);if(al>rx&&ar>rx&&at>ry&&ab>ry)return{zone:"widget-all",target};al/=rx,at/=ry,ar/=rx,ab/=ry;var ad=Math.min(al,at,ar,ab),zone;switch(ad){case al:zone="widget-left";break;case at:zone="widget-top";break;case ar:zone="widget-right";break;case ab:zone="widget-bottom";break;default:throw"unreachable"}return{zone,target}}Private2.findDropTarget=findDropTarget;function getDropRef(tabBar){return tabBar.titles.length===0?null:tabBar.currentTitle?tabBar.currentTitle.owner:tabBar.titles[tabBar.titles.length-1].owner}Private2.getDropRef=getDropRef})(Private$5||(Private$5={})),function(){function FocusTracker(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new Signal(this),this._currentChanged=new Signal(this)}return FocusTracker.prototype.dispose=function(){var _this=this;this._counter<0||(this._counter=-1,Signal.clearData(this),each(this._widgets,function(w){w.node.removeEventListener("focus",_this,!0),w.node.removeEventListener("blur",_this,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(FocusTracker.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),FocusTracker.prototype.focusNumber=function(widget){var n=this._numbers.get(widget);return n===void 0?-1:n},FocusTracker.prototype.has=function(widget){return this._numbers.has(widget)},FocusTracker.prototype.add=function(widget){if(!this._numbers.has(widget)){var focused=widget.node.contains(document.activeElement),n=focused?this._counter++:-1;this._widgets.push(widget),this._numbers.set(widget,n),this._nodes.set(widget.node,widget),widget.node.addEventListener("focus",this,!0),widget.node.addEventListener("blur",this,!0),widget.disposed.connect(this._onWidgetDisposed,this),focused&&this._setWidgets(widget,widget)}},FocusTracker.prototype.remove=function(widget){var _this=this;if(this._numbers.has(widget)&&(widget.disposed.disconnect(this._onWidgetDisposed,this),widget.node.removeEventListener("focus",this,!0),widget.node.removeEventListener("blur",this,!0),ArrayExt.removeFirstOf(this._widgets,widget),this._nodes.delete(widget.node),this._numbers.delete(widget),this._currentWidget===widget)){var valid=filter(this._widgets,function(w){return _this._numbers.get(w)!==-1}),previous=max(valid,function(first,second){var a=_this._numbers.get(first),b=_this._numbers.get(second);return a-b})||null;this._setWidgets(previous,null)}},FocusTracker.prototype.handleEvent=function(event){switch(event.type){case"focus":this._evtFocus(event);break;case"blur":this._evtBlur(event);break}},FocusTracker.prototype._setWidgets=function(current,active){var oldCurrent=this._currentWidget;this._currentWidget=current;var oldActive=this._activeWidget;this._activeWidget=active,oldCurrent!==current&&this._currentChanged.emit({oldValue:oldCurrent,newValue:current}),oldActive!==active&&this._activeChanged.emit({oldValue:oldActive,newValue:active})},FocusTracker.prototype._evtFocus=function(event){var widget=this._nodes.get(event.currentTarget);widget!==this._currentWidget&&this._numbers.set(widget,this._counter++),this._setWidgets(widget,widget)},FocusTracker.prototype._evtBlur=function(event){var widget=this._nodes.get(event.currentTarget),focusTarget=event.relatedTarget;if(!focusTarget){this._setWidgets(this._currentWidget,null);return}if(!widget.node.contains(focusTarget)&&!find(this._widgets,function(w){return w.node.contains(focusTarget)})){this._setWidgets(this._currentWidget,null);return}},FocusTracker.prototype._onWidgetDisposed=function(sender){this.remove(sender)},FocusTracker}();var GridLayout=function(_super){__extends(GridLayout2,_super);function GridLayout2(options){options===void 0&&(options={});var _this=_super.call(this,options)||this;return _this._dirty=!1,_this._rowSpacing=4,_this._columnSpacing=4,_this._items=[],_this._rowStarts=[],_this._columnStarts=[],_this._rowSizers=[new BoxSizer],_this._columnSizers=[new BoxSizer],_this._box=null,options.rowCount!==void 0&&Private$4.reallocSizers(_this._rowSizers,options.rowCount),options.columnCount!==void 0&&Private$4.reallocSizers(_this._columnSizers,options.columnCount),options.rowSpacing!==void 0&&(_this._rowSpacing=Private$4.clampValue(options.rowSpacing)),options.columnSpacing!==void 0&&(_this._columnSpacing=Private$4.clampValue(options.columnSpacing)),_this}return GridLayout2.prototype.dispose=function(){each(this._items,function(item){var widget=item.widget;item.dispose(),widget.dispose()}),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(GridLayout2.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(value){value!==this.rowCount&&(Private$4.reallocSizers(this._rowSizers,value),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(GridLayout2.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(value){value!==this.columnCount&&(Private$4.reallocSizers(this._columnSizers,value),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(GridLayout2.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(value){value=Private$4.clampValue(value),this._rowSpacing!==value&&(this._rowSpacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(GridLayout2.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(value){value=Private$4.clampValue(value),this._columnSpacing!==value&&(this._columnSpacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),GridLayout2.prototype.rowStretch=function(index){var sizer=this._rowSizers[index];return sizer?sizer.stretch:-1},GridLayout2.prototype.setRowStretch=function(index,value){var sizer=this._rowSizers[index];sizer&&(value=Private$4.clampValue(value),sizer.stretch!==value&&(sizer.stretch=value,this.parent&&this.parent.update()))},GridLayout2.prototype.columnStretch=function(index){var sizer=this._columnSizers[index];return sizer?sizer.stretch:-1},GridLayout2.prototype.setColumnStretch=function(index,value){var sizer=this._columnSizers[index];sizer&&(value=Private$4.clampValue(value),sizer.stretch!==value&&(sizer.stretch=value,this.parent&&this.parent.update()))},GridLayout2.prototype.iter=function(){return map(this._items,function(item){return item.widget})},GridLayout2.prototype.addWidget=function(widget){var i=ArrayExt.findFirstIndex(this._items,function(it){return it.widget===widget});i===-1&&(this._items.push(new LayoutItem(widget)),this.parent&&this.attachWidget(widget))},GridLayout2.prototype.removeWidget=function(widget){var i=ArrayExt.findFirstIndex(this._items,function(it){return it.widget===widget});if(i!==-1){var item=ArrayExt.removeAt(this._items,i);this.parent&&this.detachWidget(widget),item.dispose()}},GridLayout2.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget){_this.attachWidget(widget)})},GridLayout2.prototype.attachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},GridLayout2.prototype.detachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),this.parent.fit()},GridLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},GridLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},GridLayout2.prototype.onChildShown=function(msg){this.parent.fit()},GridLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},GridLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},GridLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},GridLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},GridLayout2.prototype._fit=function(){for(var i=0,n=this.rowCount;i<n;++i)this._rowSizers[i].minSize=0;for(var i=0,n=this.columnCount;i<n;++i)this._columnSizers[i].minSize=0;for(var items=this._items.filter(function(it){return!it.isHidden}),i=0,n=items.length;i<n;++i)items[i].fit();var maxRow=this.rowCount-1,maxCol=this.columnCount-1;items.sort(Private$4.rowSpanCmp);for(var i=0,n=items.length;i<n;++i){var item=items[i],config=GridLayout2.getCellConfig(item.widget),r1=Math.min(config.row,maxRow),r2=Math.min(config.row+config.rowSpan-1,maxRow);Private$4.distributeMin(this._rowSizers,r1,r2,item.minHeight)}items.sort(Private$4.columnSpanCmp);for(var i=0,n=items.length;i<n;++i){var item=items[i],config=GridLayout2.getCellConfig(item.widget),c1=Math.min(config.column,maxCol),c2=Math.min(config.column+config.columnSpan-1,maxCol);Private$4.distributeMin(this._columnSizers,c1,c2,item.minWidth)}if(this.fitPolicy==="set-no-constraint"){MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest);return}for(var minH=maxRow*this._rowSpacing,minW=maxCol*this._columnSpacing,i=0,n=this.rowCount;i<n;++i)minH+=this._rowSizers[i].minSize;for(var i=0,n=this.columnCount;i<n;++i)minW+=this._columnSizers[i].minSize;var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},GridLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1,offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,maxRow=this.rowCount-1,maxCol=this.columnCount-1,fixedRowSpace=maxRow*this._rowSpacing,fixedColSpace=maxCol*this._columnSpacing;BoxEngine.calc(this._rowSizers,Math.max(0,height-fixedRowSpace)),BoxEngine.calc(this._columnSizers,Math.max(0,width-fixedColSpace));for(var i=0,pos=top,n=this.rowCount;i<n;++i)this._rowStarts[i]=pos,pos+=this._rowSizers[i].size+this._rowSpacing;for(var i=0,pos=left,n=this.columnCount;i<n;++i)this._columnStarts[i]=pos,pos+=this._columnSizers[i].size+this._columnSpacing;for(var i=0,n=this._items.length;i<n;++i){var item=this._items[i];if(!item.isHidden){var config=GridLayout2.getCellConfig(item.widget),r1=Math.min(config.row,maxRow),c1=Math.min(config.column,maxCol),r2=Math.min(config.row+config.rowSpan-1,maxRow),c2=Math.min(config.column+config.columnSpan-1,maxCol),x=this._columnStarts[c1],y=this._rowStarts[r1],w=this._columnStarts[c2]+this._columnSizers[c2].size-x,h2=this._rowStarts[r2]+this._rowSizers[r2].size-y;item.update(x,y,w,h2)}}},GridLayout2}(Layout);(function(GridLayout2){function getCellConfig(widget){return Private$4.cellConfigProperty.get(widget)}GridLayout2.getCellConfig=getCellConfig;function setCellConfig(widget,value){Private$4.cellConfigProperty.set(widget,Private$4.normalizeConfig(value))}GridLayout2.setCellConfig=setCellConfig})(GridLayout||(GridLayout={}));var Private$4;(function(Private2){Private2.cellConfigProperty=new AttachedProperty({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:onChildCellConfigChanged});function normalizeConfig(config){var row=Math.max(0,Math.floor(config.row||0)),column=Math.max(0,Math.floor(config.column||0)),rowSpan=Math.max(1,Math.floor(config.rowSpan||0)),columnSpan=Math.max(1,Math.floor(config.columnSpan||0));return{row,column,rowSpan,columnSpan}}Private2.normalizeConfig=normalizeConfig;function clampValue(value){return Math.max(0,Math.floor(value))}Private2.clampValue=clampValue;function rowSpanCmp(a,b){var c1=Private2.cellConfigProperty.get(a.widget),c2=Private2.cellConfigProperty.get(b.widget);return c1.rowSpan-c2.rowSpan}Private2.rowSpanCmp=rowSpanCmp;function columnSpanCmp(a,b){var c1=Private2.cellConfigProperty.get(a.widget),c2=Private2.cellConfigProperty.get(b.widget);return c1.columnSpan-c2.columnSpan}Private2.columnSpanCmp=columnSpanCmp;function reallocSizers(sizers,count){for(count=Math.max(1,Math.floor(count));sizers.length<count;)sizers.push(new BoxSizer);sizers.length>count&&(sizers.length=count)}Private2.reallocSizers=reallocSizers;function distributeMin(sizers,i1,i2,minSize){if(!(i2<i1)){if(i1===i2){var sizer=sizers[i1];sizer.minSize=Math.max(sizer.minSize,minSize);return}for(var totalMin=0,i=i1;i<=i2;++i)totalMin+=sizers[i].minSize;if(!(totalMin>=minSize))for(var portion=(minSize-totalMin)/(i2-i1+1),i=i1;i<=i2;++i)sizers[i].minSize+=portion}}Private2.distributeMin=distributeMin;function onChildCellConfigChanged(child){child.parent&&child.parent.layout instanceof GridLayout&&child.parent.fit()}})(Private$4||(Private$4={}));var MenuBar=function(_super){__extends(MenuBar2,_super);function MenuBar2(options){options===void 0&&(options={});var _this=_super.call(this,{node:Private$3.createNode()})||this;return _this._activeIndex=-1,_this._tabFocusIndex=0,_this._menus=[],_this._childMenu=null,_this.addClass("lm-MenuBar"),_this.addClass("p-MenuBar"),_this.setFlag(Widget.Flag.DisallowLayout),_this.renderer=options.renderer||MenuBar2.defaultRenderer,_this._forceItemsPosition=options.forceItemsPosition||{forceX:!0,forceY:!0},_this}return MenuBar2.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(MenuBar2.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(value){this.activeIndex=value?this._menus.indexOf(value):-1},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(value){(value<0||value>=this._menus.length)&&(value=-1),this._activeIndex!==value&&(this._activeIndex=value,value!==-1&&(this._tabFocusIndex=value),this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),MenuBar2.prototype.openActiveMenu=function(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},MenuBar2.prototype.addMenu=function(menu){this.insertMenu(this._menus.length,menu)},MenuBar2.prototype.insertMenu=function(index,menu){this._closeChildMenu();var i=this._menus.indexOf(menu),j=Math.max(0,Math.min(index,this._menus.length));if(i===-1){ArrayExt.insert(this._menus,j,menu),menu.addClass("lm-MenuBar-menu"),menu.addClass("p-MenuBar-menu"),menu.aboutToClose.connect(this._onMenuAboutToClose,this),menu.menuRequested.connect(this._onMenuMenuRequested,this),menu.title.changed.connect(this._onTitleChanged,this),this.update();return}j===this._menus.length&&j--,i!==j&&(ArrayExt.move(this._menus,i,j),this.update())},MenuBar2.prototype.removeMenu=function(menu){this.removeMenuAt(this._menus.indexOf(menu))},MenuBar2.prototype.removeMenuAt=function(index){this._closeChildMenu();var menu=ArrayExt.removeAt(this._menus,index);menu&&(menu.aboutToClose.disconnect(this._onMenuAboutToClose,this),menu.menuRequested.disconnect(this._onMenuMenuRequested,this),menu.title.changed.disconnect(this._onTitleChanged,this),menu.removeClass("lm-MenuBar-menu"),menu.removeClass("p-MenuBar-menu"),this.update())},MenuBar2.prototype.clearMenus=function(){if(this._menus.length!==0){this._closeChildMenu();for(var _i=0,_a=this._menus;_i<_a.length;_i++){var menu=_a[_i];menu.aboutToClose.disconnect(this._onMenuAboutToClose,this),menu.menuRequested.disconnect(this._onMenuMenuRequested,this),menu.title.changed.disconnect(this._onTitleChanged,this),menu.removeClass("lm-MenuBar-menu"),menu.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},MenuBar2.prototype.handleEvent=function(event){switch(event.type){case"keydown":this._evtKeyDown(event);break;case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseleave":this._evtMouseLeave(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},MenuBar2.prototype.onBeforeAttach=function(msg){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)},MenuBar2.prototype.onAfterDetach=function(msg){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()},MenuBar2.prototype.onActivateRequest=function(msg){this.isAttached&&(this.activeIndex=0)},MenuBar2.prototype.onUpdateRequest=function(msg){for(var _this=this,menus=this._menus,renderer=this.renderer,activeIndex=this._activeIndex,tabFocusIndex=this._tabFocusIndex>=0&&this._tabFocusIndex<menus.length?this._tabFocusIndex:0,content=new Array(menus.length),_loop_1=function(i2,n2){var title=menus[i2].title,active=i2===activeIndex;active&&menus[i2].items.length==0&&(active=!1),content[i2]=renderer.renderItem({title,active,tabbable:i2===tabFocusIndex,onfocus:function(){_this.activeIndex=i2}})},i=0,n=menus.length;i<n;++i)_loop_1(i);VirtualDOM.render(content,this.contentNode)},MenuBar2.prototype._evtKeyDown=function(event){var kc=event.keyCode;if(kc===9){this.activeIndex=-1;return}if(event.preventDefault(),event.stopPropagation(),kc===13||kc===32||kc===38||kc===40){this.openActiveMenu();return}if(kc===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(kc===37){var i=this._activeIndex,n=this._menus.length;this.activeIndex=i===0?n-1:i-1;return}if(kc===39){var i=this._activeIndex,n=this._menus.length;this.activeIndex=i===n-1?0:i+1;return}var key=getKeyboardLayout().keyForKeydownEvent(event);if(key){var start=this._activeIndex+1,result=Private$3.findMnemonic(this._menus,key,start);result.index!==-1&&!result.multiple?(this.activeIndex=result.index,this.openActiveMenu()):result.index!==-1?this.activeIndex=result.index:result.auto!==-1&&(this.activeIndex=result.auto)}},MenuBar2.prototype._evtMouseDown=function(event){if(ElementExt.hitTest(this.node,event.clientX,event.clientY)){event.preventDefault(),event.stopPropagation(),event.stopImmediatePropagation();var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return ElementExt.hitTest(node,event.clientX,event.clientY)});if(index===-1){this._closeChildMenu();return}if(event.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=index;else{var position=this._positionForMenu(index);Menu.saveWindowData(),this.activeIndex=index,this._openChildMenu(position)}}},MenuBar2.prototype._evtMouseMove=function(event){var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return ElementExt.hitTest(node,event.clientX,event.clientY)});if(index!==this._activeIndex&&!(index===-1&&this._childMenu)){var position=this._positionForMenu(index);Menu.saveWindowData(),this.activeIndex=index,this._childMenu&&this._openChildMenu(position)}},MenuBar2.prototype._positionForMenu=function(index){var itemNode=this.contentNode.children[index],_a=itemNode.getBoundingClientRect(),left=_a.left,bottom=_a.bottom;return{top:bottom,left}},MenuBar2.prototype._evtMouseLeave=function(event){this._childMenu||(this.activeIndex=-1)},MenuBar2.prototype._openChildMenu=function(options){var _a;options===void 0&&(options={});var newMenu=this.activeMenu;if(!newMenu){this._closeChildMenu();return}var oldMenu=this._childMenu;if(oldMenu!==newMenu){this._childMenu=newMenu,oldMenu?oldMenu.close():document.addEventListener("mousedown",this,!0),MessageLoop.sendMessage(this,Widget.Msg.UpdateRequest);var left=options.left,top=options.top;(typeof left>"u"||typeof top>"u")&&(_a=this._positionForMenu(this._activeIndex),left=_a.left,top=_a.top),oldMenu||(this.addClass("lm-mod-active"),this.addClass("p-mod-active")),newMenu.items.length>0&&newMenu.open(left,top,this._forceItemsPosition)}},MenuBar2.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var menu=this._childMenu;this._childMenu=null,menu.close(),this.activeIndex=-1}},MenuBar2.prototype._onMenuAboutToClose=function(sender){sender===this._childMenu&&(this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},MenuBar2.prototype._onMenuMenuRequested=function(sender,args){if(sender===this._childMenu){var i=this._activeIndex,n=this._menus.length;switch(args){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=i===0?n-1:i-1;break}this.openActiveMenu()}},MenuBar2.prototype._onTitleChanged=function(){this.update()},MenuBar2}(Widget);(function(MenuBar2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.renderItem=function(data){var className=this.createItemClass(data),dataset=this.createItemDataset(data),aria=this.createItemARIA(data);return h.li(__assign({className,dataset,tabindex:data.tabbable?"0":"-1",onfocus:data.onfocus},aria),this.renderIcon(data),this.renderLabel(data))},Renderer2.prototype.renderIcon=function(data){var className=this.createIconClass(data);return typeof data.title.icon=="string"?h.div({className},data.title.iconLabel):h.div({className},data.title.icon,data.title.iconLabel)},Renderer2.prototype.renderLabel=function(data){var content=this.formatLabel(data);return h.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},content)},Renderer2.prototype.createItemClass=function(data){var name2="lm-MenuBar-item";return name2+=" p-MenuBar-item",data.title.className&&(name2+=" "+data.title.className),data.active&&(name2+=" lm-mod-active",name2+=" p-mod-active"),name2},Renderer2.prototype.createItemDataset=function(data){return data.title.dataset},Renderer2.prototype.createItemARIA=function(data){return{role:"menuitem","aria-haspopup":"true"}},Renderer2.prototype.createIconClass=function(data){var name2="lm-MenuBar-itemIcon";name2+=" p-MenuBar-itemIcon";var extra=data.title.iconClass;return extra?name2+" "+extra:name2},Renderer2.prototype.formatLabel=function(data){var _a=data.title,label=_a.label,mnemonic=_a.mnemonic;if(mnemonic<0||mnemonic>=label.length)return label;var prefix=label.slice(0,mnemonic),suffix=label.slice(mnemonic+1),char=label[mnemonic],span=h.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},char);return[prefix,span,suffix]},Renderer2}();MenuBar2.Renderer=Renderer,MenuBar2.defaultRenderer=new Renderer})(MenuBar||(MenuBar={}));var Private$3;(function(Private2){function createNode(){var node=document.createElement("div"),content=document.createElement("ul");return content.className="lm-MenuBar-content",content.classList.add("p-MenuBar-content"),node.appendChild(content),content.setAttribute("role","menubar"),node}Private2.createNode=createNode;function findMnemonic(menus,key,start){for(var index=-1,auto=-1,multiple=!1,upperKey=key.toUpperCase(),i=0,n=menus.length;i<n;++i){var k=(i+start)%n,title=menus[k].title;if(title.label.length!==0){var mn=title.mnemonic;if(mn>=0&&mn<title.label.length){title.label[mn].toUpperCase()===upperKey&&(index===-1?index=k:multiple=!0);continue}auto===-1&&title.label[0].toUpperCase()===upperKey&&(auto=k)}}return{index,multiple,auto}}Private2.findMnemonic=findMnemonic})(Private$3||(Private$3={})),function(_super){__extends(ScrollBar,_super);function ScrollBar(options){options===void 0&&(options={});var _this=_super.call(this,{node:Private$2.createNode()})||this;return _this._onRepeat=function(){if(_this._repeatTimer=-1,!!_this._pressData){var part=_this._pressData.part;if(part!=="thumb"){_this._repeatTimer=window.setTimeout(_this._onRepeat,20);var mouseX=_this._pressData.mouseX,mouseY=_this._pressData.mouseY;if(part==="decrement"){if(!ElementExt.hitTest(_this.decrementNode,mouseX,mouseY))return;_this._stepRequested.emit("decrement");return}if(part==="increment"){if(!ElementExt.hitTest(_this.incrementNode,mouseX,mouseY))return;_this._stepRequested.emit("increment");return}if(part==="track"){if(!ElementExt.hitTest(_this.trackNode,mouseX,mouseY))return;var thumbNode=_this.thumbNode;if(ElementExt.hitTest(thumbNode,mouseX,mouseY))return;var thumbRect=thumbNode.getBoundingClientRect(),dir=void 0;_this._orientation==="horizontal"?dir=mouseX<thumbRect.left?"decrement":"increment":dir=mouseY<thumbRect.top?"decrement":"increment",_this._pageRequested.emit(dir);return}}}},_this._value=0,_this._page=10,_this._maximum=100,_this._repeatTimer=-1,_this._pressData=null,_this._thumbMoved=new Signal(_this),_this._stepRequested=new Signal(_this),_this._pageRequested=new Signal(_this),_this.addClass("lm-ScrollBar"),_this.addClass("p-ScrollBar"),_this.setFlag(Widget.Flag.DisallowLayout),_this._orientation=options.orientation||"vertical",_this.dataset.orientation=_this._orientation,options.maximum!==void 0&&(_this._maximum=Math.max(0,options.maximum)),options.page!==void 0&&(_this._page=Math.max(0,options.page)),options.value!==void 0&&(_this._value=Math.max(0,Math.min(options.value,_this._maximum))),_this}return Object.defineProperty(ScrollBar.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"orientation",{get:function(){return this._orientation},set:function(value){this._orientation!==value&&(this._releaseMouse(),this._orientation=value,this.dataset.orientation=value,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"value",{get:function(){return this._value},set:function(value){value=Math.max(0,Math.min(value,this._maximum)),this._value!==value&&(this._value=value,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"page",{get:function(){return this._page},set:function(value){value=Math.max(0,value),this._page!==value&&(this._page=value,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"maximum",{get:function(){return this._maximum},set:function(value){value=Math.max(0,value),this._maximum!==value&&(this._maximum=value,this._value=Math.min(this._value,value),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),ScrollBar.prototype.handleEvent=function(event){switch(event.type){case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},ScrollBar.prototype.onBeforeAttach=function(msg){this.node.addEventListener("mousedown",this),this.update()},ScrollBar.prototype.onAfterDetach=function(msg){this.node.removeEventListener("mousedown",this),this._releaseMouse()},ScrollBar.prototype.onUpdateRequest=function(msg){var value=this._value*100/this._maximum,page=this._page*100/(this._page+this._maximum);value=Math.max(0,Math.min(value,100)),page=Math.max(0,Math.min(page,100));var thumbStyle=this.thumbNode.style;this._orientation==="horizontal"?(thumbStyle.top="",thumbStyle.height="",thumbStyle.left=value+"%",thumbStyle.width=page+"%",thumbStyle.transform="translate("+-value+"%, 0%)"):(thumbStyle.left="",thumbStyle.width="",thumbStyle.top=value+"%",thumbStyle.height=page+"%",thumbStyle.transform="translate(0%, "+-value+"%)")},ScrollBar.prototype._evtKeyDown=function(event){if(event.preventDefault(),event.stopPropagation(),event.keyCode===27){var value=this._pressData?this._pressData.value:-1;this._releaseMouse(),value!==-1&&this._moveThumb(value)}},ScrollBar.prototype._evtMouseDown=function(event){if(event.button===0&&(this.activate(),!this._pressData)){var part=Private$2.findPart(this,event.target);if(part){event.preventDefault(),event.stopPropagation();var override=Drag.overrideCursor("default");if(this._pressData={part,override,delta:-1,value:-1,mouseX:event.clientX,mouseY:event.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),part==="thumb"){var thumbNode=this.thumbNode,thumbRect=thumbNode.getBoundingClientRect();this._orientation==="horizontal"?this._pressData.delta=event.clientX-thumbRect.left:this._pressData.delta=event.clientY-thumbRect.top,thumbNode.classList.add("lm-mod-active"),thumbNode.classList.add("p-mod-active"),this._pressData.value=this._value;return}if(part==="track"){var thumbRect=this.thumbNode.getBoundingClientRect(),dir=void 0;this._orientation==="horizontal"?dir=event.clientX<thumbRect.left?"decrement":"increment":dir=event.clientY<thumbRect.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),this._pageRequested.emit(dir);return}if(part==="decrement"){this.decrementNode.classList.add("lm-mod-active"),this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("decrement");return}if(part==="increment"){this.incrementNode.classList.add("lm-mod-active"),this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("increment");return}}}},ScrollBar.prototype._evtMouseMove=function(event){if(this._pressData&&(event.preventDefault(),event.stopPropagation(),this._pressData.mouseX=event.clientX,this._pressData.mouseY=event.clientY,this._pressData.part==="thumb")){var thumbRect=this.thumbNode.getBoundingClientRect(),trackRect=this.trackNode.getBoundingClientRect(),trackPos,trackSpan;this._orientation==="horizontal"?(trackPos=event.clientX-trackRect.left-this._pressData.delta,trackSpan=trackRect.width-thumbRect.width):(trackPos=event.clientY-trackRect.top-this._pressData.delta,trackSpan=trackRect.height-thumbRect.height);var value=trackSpan===0?0:trackPos*this._maximum/trackSpan;this._moveThumb(value)}},ScrollBar.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this._releaseMouse())},ScrollBar.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("lm-mod-active"),this.decrementNode.classList.remove("lm-mod-active"),this.incrementNode.classList.remove("lm-mod-active"),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},ScrollBar.prototype._moveThumb=function(value){value=Math.max(0,Math.min(value,this._maximum)),this._value!==value&&(this._value=value,this.update(),this._thumbMoved.emit(value))},ScrollBar}(Widget);var Private$2;(function(Private2){function createNode(){var node=document.createElement("div"),decrement=document.createElement("div"),increment=document.createElement("div"),track=document.createElement("div"),thumb=document.createElement("div");return decrement.className="lm-ScrollBar-button",increment.className="lm-ScrollBar-button",decrement.dataset.action="decrement",increment.dataset.action="increment",track.className="lm-ScrollBar-track",thumb.className="lm-ScrollBar-thumb",decrement.classList.add("p-ScrollBar-button"),increment.classList.add("p-ScrollBar-button"),track.classList.add("p-ScrollBar-track"),thumb.classList.add("p-ScrollBar-thumb"),track.appendChild(thumb),node.appendChild(decrement),node.appendChild(track),node.appendChild(increment),node}Private2.createNode=createNode;function findPart(scrollBar,target){return scrollBar.thumbNode.contains(target)?"thumb":scrollBar.trackNode.contains(target)?"track":scrollBar.decrementNode.contains(target)?"decrement":scrollBar.incrementNode.contains(target)?"increment":null}Private2.findPart=findPart})(Private$2||(Private$2={})),function(_super){__extends(SingletonLayout,_super);function SingletonLayout(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._widget=null,_this}return SingletonLayout.prototype.dispose=function(){if(this._widget){var widget=this._widget;this._widget=null,widget.dispose()}_super.prototype.dispose.call(this)},Object.defineProperty(SingletonLayout.prototype,"widget",{get:function(){return this._widget},set:function(widget){widget&&(widget.parent=this.parent),this._widget!==widget&&(this._widget&&this._widget.dispose(),this._widget=widget,this.parent&&widget&&this.attachWidget(widget))},enumerable:!0,configurable:!0}),SingletonLayout.prototype.iter=function(){return this._widget?once(this._widget):empty()},SingletonLayout.prototype.removeWidget=function(widget){this._widget===widget&&(this._widget=null,this.parent&&this.detachWidget(widget))},SingletonLayout.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget){_this.attachWidget(widget)})},SingletonLayout.prototype.attachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach)},SingletonLayout.prototype.detachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach)},SingletonLayout}(Layout);var StackedLayout=function(_super){__extends(StackedLayout2,_super);function StackedLayout2(options){options===void 0&&(options={});var _this=_super.call(this,options)||this;return _this._dirty=!1,_this._items=[],_this._box=null,_this._hiddenMode=options.hiddenMode!==void 0?options.hiddenMode:Widget.HiddenMode.Display,_this}return Object.defineProperty(StackedLayout2.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(v){var _this=this;this._hiddenMode!==v&&(this._hiddenMode=v,this.widgets.length>1&&this.widgets.forEach(function(w){w.hiddenMode=_this._hiddenMode}))},enumerable:!0,configurable:!0}),StackedLayout2.prototype.dispose=function(){each(this._items,function(item){item.dispose()}),this._box=null,this._items.length=0,_super.prototype.dispose.call(this)},StackedLayout2.prototype.attachWidget=function(index,widget){this._hiddenMode===Widget.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=Widget.HiddenMode.Scale),widget.hiddenMode=Widget.HiddenMode.Scale):widget.hiddenMode=Widget.HiddenMode.Display,ArrayExt.insert(this._items,index,new LayoutItem(widget)),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},StackedLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._items,fromIndex,toIndex),this.parent.update()},StackedLayout2.prototype.detachWidget=function(index,widget){var item=ArrayExt.removeAt(this._items,index);this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),item.widget.node.style.zIndex="",this._hiddenMode===Widget.HiddenMode.Scale&&(widget.hiddenMode=Widget.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=Widget.HiddenMode.Display)),item.dispose(),this.parent.fit()},StackedLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},StackedLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},StackedLayout2.prototype.onChildShown=function(msg){this.parent.fit()},StackedLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},StackedLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},StackedLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},StackedLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},StackedLayout2.prototype._fit=function(){for(var minW=0,minH=0,i=0,n=this._items.length;i<n;++i){var item=this._items[i];item.isHidden||(item.fit(),minW=Math.max(minW,item.minWidth),minH=Math.max(minH,item.minHeight))}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},StackedLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1;for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;if(nVisible!==0){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));for(var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,i=0,n=this._items.length;i<n;++i){var item=this._items[i];item.isHidden||(item.widget.node.style.zIndex=""+i,item.update(left,top,width,height))}}},StackedLayout2}(PanelLayout),StackedPanel=function(_super){__extends(StackedPanel2,_super);function StackedPanel2(options){options===void 0&&(options={});var _this=_super.call(this,{layout:Private$1.createLayout(options)})||this;return _this._widgetRemoved=new Signal(_this),_this.addClass("lm-StackedPanel"),_this.addClass("p-StackedPanel"),_this}return Object.defineProperty(StackedPanel2.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(v){this.layout.hiddenMode=v},enumerable:!0,configurable:!0}),Object.defineProperty(StackedPanel2.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),StackedPanel2.prototype.onChildAdded=function(msg){msg.child.addClass("lm-StackedPanel-child"),msg.child.addClass("p-StackedPanel-child")},StackedPanel2.prototype.onChildRemoved=function(msg){msg.child.removeClass("lm-StackedPanel-child"),msg.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(msg.child)},StackedPanel2}(Panel),Private$1;(function(Private2){function createLayout(options){return options.layout||new StackedLayout}Private2.createLayout=createLayout})(Private$1||(Private$1={}));var TabPanel$1=function(_super){__extends(TabPanel2,_super);function TabPanel2(options){options===void 0&&(options={});var _this=_super.call(this)||this;_this._currentChanged=new Signal(_this),_this._addRequested=new Signal(_this),_this.addClass("lm-TabPanel"),_this.addClass("p-TabPanel"),_this.tabBar=new TabBar(options),_this.tabBar.addClass("lm-TabPanel-tabBar"),_this.stackedPanel=new StackedPanel,_this.stackedPanel.addClass("lm-TabPanel-stackedPanel"),_this.tabBar.addClass("p-TabPanel-tabBar"),_this.stackedPanel.addClass("p-TabPanel-stackedPanel"),_this.tabBar.tabMoved.connect(_this._onTabMoved,_this),_this.tabBar.currentChanged.connect(_this._onCurrentChanged,_this),_this.tabBar.tabCloseRequested.connect(_this._onTabCloseRequested,_this),_this.tabBar.tabActivateRequested.connect(_this._onTabActivateRequested,_this),_this.tabBar.addRequested.connect(_this._onTabAddRequested,_this),_this.stackedPanel.widgetRemoved.connect(_this._onWidgetRemoved,_this),_this._tabPlacement=options.tabPlacement||"top";var direction=Private.directionFromPlacement(_this._tabPlacement),orientation=Private.orientationFromPlacement(_this._tabPlacement);_this.tabBar.orientation=orientation,_this.tabBar.dataset.placement=_this._tabPlacement;var layout=new BoxLayout({direction,spacing:0});return BoxLayout.setStretch(_this.tabBar,0),BoxLayout.setStretch(_this.stackedPanel,1),layout.addWidget(_this.tabBar),layout.addWidget(_this.stackedPanel),_this.layout=layout,_this}return Object.defineProperty(TabPanel2.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(value){this.tabBar.currentIndex=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"currentWidget",{get:function(){var title=this.tabBar.currentTitle;return title?title.owner:null},set:function(value){this.tabBar.currentTitle=value?value.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(value){this.tabBar.tabsMovable=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"addButtonEnabled",{get:function(){return this.tabBar.addButtonEnabled},set:function(value){this.tabBar.addButtonEnabled=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(value){if(this._tabPlacement!==value){this._tabPlacement=value;var direction=Private.directionFromPlacement(value),orientation=Private.orientationFromPlacement(value);this.tabBar.orientation=orientation,this.tabBar.dataset.placement=value,this.layout.direction=direction}},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),TabPanel2.prototype.addWidget=function(widget){this.insertWidget(this.widgets.length,widget)},TabPanel2.prototype.insertWidget=function(index,widget){widget!==this.currentWidget&&widget.hide(),this.stackedPanel.insertWidget(index,widget),this.tabBar.insertTab(index,widget.title),widget.node.setAttribute("role","tabpanel");var renderer=this.tabBar.renderer;if(renderer instanceof TabBar.Renderer){var tabId=renderer.createTabKey({title:widget.title,current:!1,zIndex:0});widget.node.setAttribute("aria-labelledby",tabId)}},TabPanel2.prototype._onCurrentChanged=function(sender,args){var previousIndex=args.previousIndex,previousTitle=args.previousTitle,currentIndex=args.currentIndex,currentTitle=args.currentTitle,previousWidget=previousTitle?previousTitle.owner:null,currentWidget=currentTitle?currentTitle.owner:null;previousWidget&&previousWidget.hide(),currentWidget&¤tWidget.show(),this._currentChanged.emit({previousIndex,previousWidget,currentIndex,currentWidget}),(Platform.IS_EDGE||Platform.IS_IE)&&MessageLoop.flush()},TabPanel2.prototype._onTabAddRequested=function(sender,args){this._addRequested.emit(sender)},TabPanel2.prototype._onTabActivateRequested=function(sender,args){args.title.owner.activate()},TabPanel2.prototype._onTabCloseRequested=function(sender,args){args.title.owner.close()},TabPanel2.prototype._onTabMoved=function(sender,args){this.stackedPanel.insertWidget(args.toIndex,args.title.owner)},TabPanel2.prototype._onWidgetRemoved=function(sender,widget){widget.node.removeAttribute("role"),widget.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(widget.title)},TabPanel2}(Widget),Private;(function(Private2){function orientationFromPlacement(plc){return placementToOrientationMap[plc]}Private2.orientationFromPlacement=orientationFromPlacement;function directionFromPlacement(plc){return placementToDirectionMap[plc]}Private2.directionFromPlacement=directionFromPlacement;var placementToOrientationMap={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},placementToDirectionMap={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}})(Private||(Private={})),exports2.Msg=void 0,(Msg2=>{class WAConflatableMessage extends ConflatableMessage{constructor(wa,msg){super(msg);__publicField(this,"_wa");this._wa=wa}get wa(){return this._wa}conflate(other){return this._wa=other.wa,!0}}Msg2.WAConflatableMessage=WAConflatableMessage;const _WAActivateRequest=class _WAActivateRequest extends WAConflatableMessage{constructor(wa){super(wa,_WAActivateRequest.type)}};__publicField(_WAActivateRequest,"type","wa-activate-request");let WAActivateRequest=_WAActivateRequest;Msg2.WAActivateRequest=WAActivateRequest;const _WALayoutChanged=class _WALayoutChanged extends WAConflatableMessage{constructor(wa){super(wa,_WALayoutChanged.type)}};__publicField(_WALayoutChanged,"type","wa-layout-changed");let WALayoutChanged=_WALayoutChanged;Msg2.WALayoutChanged=WALayoutChanged})(exports2.Msg||(exports2.Msg={}));class WidgetAdapter extends Widget{constructor(owner,widget,lparam={},closable=!1,ext={}){super();__publicField(this,"_owner");__publicField(this,"_element");__publicField(this,"_widget");__publicField(this,"_widgetLayout");__publicField(this,"lparam",{});__publicField(this,"padding",0);__publicField(this,"_width",0);__publicField(this,"_height",0);__publicField(this,"_ext");__publicField(this,"_closable");this._owner=owner,this._element=common.select(this.node),this.addClass("phosphor_WidgetAdapter"),this.title.label="",this.title.closable=!!closable,this.title.caption=`Long description for: ${name}`,this._ext=ext,typeof closable=="boolean"?this._closable={canClose(e,wa){return closable}}:this._closable=closable,widget instanceof common.Widget?this._widget=widget.target(this.node):this._widgetLayout=widget,this.lparam=lparam}get widget(){return this._widget}get inputNode(){return this.node.getElementsByTagName("input")[0]}resizeAndRender(){this._widget&&(common.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-this.padding*2-2,height:this._height-this.padding*2-2}).lazyRender(),this._owner&&MessageLoop.postMessage(this._owner,new exports2.Msg.WALayoutChanged(this)))}onActivateRequest(msg){super.onActivateRequest(msg),this._widget&&this.resizeAndRender(),this._owner&&MessageLoop.postMessage(this._owner,new exports2.Msg.WAActivateRequest(this))}onResize(msg){super.onResize(msg),this.node&&this.node.offsetParent!==null&&msg.width>=0&&msg.height>=0?(this._width=msg.width,this._height=msg.height,this.resizeAndRender()):this._widgetLayout}onCloseRequest(msg){this._closable.canClose(this._widget,this)&&this.dispose()}}class WidgetAdapterArray extends Array{constructor(items){super(...items)}static create(){return Object.create(WidgetAdapterArray.prototype)}watchRendered(w,callback){if(!callback)return;const content=this.map(wa=>({wa,w:wa.widget,rc:wa.widget.renderCount()})),intervalHandle=setInterval(()=>{complete()&&(clearInterval(intervalHandle),callback(w))},20);function complete(){for(const item of content)if(item.wa.isVisible&&item.rc>=item.w.renderCount())return!1;return!0}}}class PRenderer extends DockPanel$1.Renderer{constructor(){super();__publicField(this,"_owner")}createTabBar(){const bar=super.createTabBar();return bar.tabsMovable=this._owner.tabsMovable,bar}}class PDockPanel extends DockPanel$1{constructor(options={}){options.renderer=options.renderer||new PRenderer;super(options);__publicField(this,"_content");__publicField(this,"_contentMap");this._renderer instanceof PRenderer&&(this._renderer._owner=this),this._content=WidgetAdapterArray.create(),this._contentMap={}}appendContent(wa){this._content.push(wa),this._contentMap[wa.widget.id()]=wa}removeContent(wa){const idx=this._content.indexOf(wa);idx>=0&&this._content.splice(idx,1),delete this._contentMap[wa.widget.id()],wa.dispose()}content(){return this._content}serializeWidget(widget){if(widget instanceof WidgetAdapter)try{return{__id:widget.widget.id()}}catch(e){return{exception:{message:e.message??"",stack:e.stack??[]}}}return null}deserializeWidget(layout){let wa=this._contentMap[layout.__id];return wa||(wa=new WidgetAdapter(void 0,layout)),wa}serializeITabAreaConfig(config,deserialize){return{...config,widgets:config.widgets.map(widget=>deserialize?this.deserializeWidget(widget):this.serializeWidget(widget))}}serializeISplitAreaConfig(config,deserialize){return{...config,children:config.children.map(child=>this.serializeAreaConfig(child,deserialize))}}serializeAreaConfig(config,deserialize){if(config)switch(config.type){case"tab-area":return this.serializeITabAreaConfig(config,deserialize);case"split-area":return this.serializeISplitAreaConfig(config,deserialize)}}saveLayout(){return{main:this.serializeAreaConfig(super.saveLayout().main,!1)}}restoreLayout(config){return super.restoreLayout({main:this.serializeAreaConfig(config.main,!0)})}}class DockPanel extends common.HTMLWidget{constructor(){super();__publicField(this,"_dock",new PDockPanel({mode:"multiple-document"}));__publicField(this,"_layoutObj",null);__publicField(this,"_pPlaceholder");__publicField(this,"_prevHideSingleTabs");__publicField(this,"_lazyLayoutChanged",common.Utility.debounce(async()=>{this.layoutChanged()},1e3));__publicField(this,"_prevActive");this._tag="div",this._dock.id="p"+this.id(),MessageLoop.installMessageHook(this,this)}getWidgetAdapter(widget){let retVal=null;return this._dock.content().some(wa=>wa.widget===widget?(retVal=wa,!0):!1),retVal}addWidget(widget,title,location="split-right",refWidget,closable,padding=8){const addMode={mode:location,ref:this.getWidgetAdapter(refWidget)},wa=new WidgetAdapter(this,widget,{},closable);return wa.title.label=title,wa.padding=padding,this._dock.addWidget(wa,addMode),this._dock.appendContent(wa),this._dock.tabsMovable=!0,this}removeWidget(widget){const wa=this.getWidgetAdapter(widget);return wa&&(widget.target(null),this._dock.removeContent(wa)),this}isVisible(widget){return this.getWidgetAdapter(widget).isVisible}widgetAdapters(){return this._dock.content()}widgets(){return this._dock.content().map(wa=>wa.widget)}layout(_){return arguments.length?(this._dock.restoreLayout(_),this):this._dock.saveLayout()}layoutObj(_){return this._layoutObj=_,this}enter(domNode,element){super.enter(domNode,element),this._pPlaceholder=element.append("div"),Widget.attach(this._dock,this._pPlaceholder.node())}update(domNode,element){super.update(domNode,element),this._pPlaceholder.style("width",this.width()+"px").style("height",this.height()+"px").style("overflow","hidden"),element.select(".p-Widget").style("width",this._pPlaceholder.node().clientWidth+"px").style("height",this.height()+"px"),this.widgets().forEach(w=>w.render())}exit(domNode,element){[...this.widgets()].forEach(w=>this.removeWidget(w)),Widget.detach(this._dock),super.exit(domNode,element)}render(callback){const context=this;return this._layoutObj!==null&&(this.layout(this._layoutObj),this.layoutObj(null)),super.render(w=>{this._dock.content().watchRendered(this,callback),this._dock.update(),setTimeout(()=>{const tabBars=this.element().selectAll(".p-Widget.p-TabBar.p-DockPanel-tabBar");let refit=!1;tabBars.each(function(){const tabBar=common.select(this),tabsCount=tabBar.node().childNodes[0].childNodes.length,hide=context.hideSingleTabs()&&tabsCount===1;hide!==tabBar.classed("hide")&&(tabBar.classed("hide",hide),refit=!0)}),refit&&this._dock.fit()},0)})}refit(){this._dock.fit()}messageHook(handler,msg){return handler===this&&this.processMessage(msg),!0}processMessage(msg){switch(msg.type){case exports2.Msg.WAActivateRequest.type:const wa=msg.wa,widget=wa.widget;this._prevActive!==widget&&(this._prevActive=widget,this.childActivation(widget,wa));break;case exports2.Msg.WALayoutChanged.type:this._lazyLayoutChanged();break}}active(){return this._prevActive}childActivation(w,wa){}layoutChanged(){}}DockPanel.prototype._class+=" phosphor_DockPanel",DockPanel.prototype.publish("hideSingleTabs",!1,"boolean");class SplitPanel extends common.HTMLWidget{constructor(orientation="vertical"){super();__publicField(this,"_split");__publicField(this,"content",WidgetAdapterArray.create());this._split=new SplitPanel$1({orientation}),this._tag="div",this._split.id="p"+this.id()}getWidgetAdapter(widget){let retVal=null;return this.content.some(wa=>wa.widget===widget?(retVal=wa,!0):!1),retVal}addWidget(widget){const wa=new WidgetAdapter(this,widget);return this._split.addWidget(wa),this.content.push(wa),this}relativeSizes(_){return arguments.length?(this._split.setRelativeSizes(_),this):this._split.relativeSizes()}enter(domNode,element){super.enter(domNode,element),Widget.attach(this._split,domNode)}update(domNode,element){super.update(domNode,element),element.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")}exit(domNode,element){Widget.detach(this._split),super.exit(domNode,element)}render(callback){return super.render(w=>{this.content.watchRendered(this,callback),this._split.update()})}}SplitPanel.prototype._class+=" phosphor_SplitPanel";class TabPanel extends common.HTMLWidget{constructor(){super();__publicField(this,"_tab",new TabPanel$1({tabPlacement:"top"}));__publicField(this,"content",WidgetAdapterArray.create());__publicField(this,"_prevActive");this._tag="div",this._tab.id="p"+this.id()}getWidget(wa){if(wa instanceof WidgetAdapter)return wa.widget}getWidgetAdapter(widget){let retVal=null;return this.content.some(wa=>wa.widget===widget?(retVal=wa,!0):!1),retVal}addWidget(widget,title,ext={}){this._prevActive||(this._prevActive=widget);const wa=new WidgetAdapter(this,widget,void 0,void 0,ext);return wa.title.label=title,wa.padding=8,this._tab.addWidget(wa),this.content.push(wa),this}removeWidget(widget){const wa=this.getWidgetAdapter(widget);if(wa){const found=this.content.indexOf(wa);found>=0&&this.content.splice(found,1),widget.target(null),wa.dispose()}return this}enter(domNode,element){super.enter(domNode,element),Widget.attach(this._tab,domNode)}update(domNode,element){super.update(domNode,element),element.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")}exit(domNode,element){Widget.detach(this._tab),super.exit(domNode,element)}render(callback){return super.render(w=>{this.content.watchRendered(this,callback),this._tab.update()})}messageHook(handler,msg){return handler===this&&this.processMessage(msg),!0}processMessage(msg){switch(msg.type){case"wa-activate-request":const widget=msg.wa.widget;this._prevActive!==widget&&(this._prevActive=widget,this.childActivation(widget));break}}childActivation(w){}active(_){return arguments.length?(this._tab.currentWidget=this.getWidgetAdapter(_),this):this.getWidget(this._tab.currentWidget)}}TabPanel.prototype._class+=" phosphor_TabPanel",exports2.BUILD_VERSION=BUILD_VERSION,exports2.ContextMenu=ContextMenu,exports2.DockPanel=DockPanel,exports2.PKG_NAME=PKG_NAME,exports2.PKG_VERSION=PKG_VERSION,exports2.SplitPanel=SplitPanel,exports2.TabPanel=TabPanel,exports2.WidgetAdapter=WidgetAdapter,exports2.WidgetAdapterArray=WidgetAdapterArray,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/phosphor"]={},e["@hpcc-js/common"])}(this,function(e,t){"use strict";var i,n,s,r=Object.defineProperty,o=(e,t)=>r(e,"name",{value:t,configurable:!0}),a=(e,t,i)=>((e,t,i)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i);var d,l,h,c;function*u(){}function m(e,t){let i=0;for(const n of e)if(t(n,i++))return n}function p(e,t){let i=0;for(const n of e)if(!1===t(n,i++))return!1;return!0}function g(e,t){let i=0;for(const n of e)if(t(n,i++))return!0;return!1}function*f(e){if("function"==typeof e.retro)yield*e.retro();else for(let t=e.length-1;t>-1;t--)yield e[t]}function _(e){let t=[],i=new Set,n=new Map;for(const o of e)s(o);for(const[o]of n)r(o);return t;function s(e){let[t,i]=e,s=n.get(i);s?s.push(t):n.set(i,[t])}function r(e){if(i.has(e))return;i.add(e);let s=n.get(e);if(s)for(const t of s)r(t);t.push(e)}}!function(e){function t(e,t,i=0,n=-1){let s,r=e.length;if(0===r)return-1;i=i<0?Math.max(0,i+r):Math.min(i,r-1),s=(n=n<0?Math.max(0,n+r):Math.min(n,r-1))<i?n+1+(r-i):n-i+1;for(let o=0;o<s;++o){let n=(i+o)%r;if(e[n]===t)return n}return-1}function i(e,t,i=-1,n=0){let s,r=e.length;if(0===r)return-1;s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<(n=n<0?Math.max(0,n+r):Math.min(n,r-1))?i+1+(r-n):i-n+1;for(let o=0;o<s;++o){let n=(i-o+r)%r;if(e[n]===t)return n}return-1}function n(e,t,i=0,n=-1){let s,r=e.length;if(0===r)return-1;i=i<0?Math.max(0,i+r):Math.min(i,r-1),s=(n=n<0?Math.max(0,n+r):Math.min(n,r-1))<i?n+1+(r-i):n-i+1;for(let o=0;o<s;++o){let n=(i+o)%r;if(t(e[n],n))return n}return-1}function s(e,t,i=-1,n=0){let s,r=e.length;if(0===r)return-1;s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))<(n=n<0?Math.max(0,n+r):Math.min(n,r-1))?i+1+(r-n):i-n+1;for(let o=0;o<s;++o){let n=(i-o+r)%r;if(t(e[n],n))return n}return-1}function r(e,t,i=0,s=-1){let r=n(e,t,i,s);return-1!==r?e[r]:void 0}function a(e,t,i=-1,n=0){let r=s(e,t,i,n);return-1!==r?e[r]:void 0}function d(e,t,i,n=0,s=-1){let r=e.length;if(0===r)return 0;let o=n=n<0?Math.max(0,n+r):Math.min(n,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-n+1;for(;a>0;){let n=a>>1,s=o+n;i(e[s],t)<0?(o=s+1,a-=n+1):a=n}return o}function l(e,t,i,n=0,s=-1){let r=e.length;if(0===r)return 0;let o=n=n<0?Math.max(0,n+r):Math.min(n,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-n+1;for(;a>0;){let n=a>>1,s=o+n;i(e[s],t)>0?a=n:(o=s+1,a-=n+1)}return o}function h(e,t,i){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;++n)if(i?!i(e[n],t[n]):e[n]!==t[n])return!1;return!0}function c(e,t={}){let{start:i,stop:n,step:s}=t;if(void 0===s&&(s=1),0===s)throw new Error("Slice `step` cannot be zero.");let r,o=e.length;void 0===i?i=s<0?o-1:0:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),void 0===n?n=s<0?-1:o:n<0?n=Math.max(n+o,s<0?-1:0):n>=o&&(n=s<0?o-1:o),r=s<0&&n>=i||s>0&&i>=n?0:s<0?Math.floor((n-i+1)/s+1):Math.floor((n-i-1)/s+1);let a=[];for(let d=0;d<r;++d)a[d]=e[i+d*s];return a}function u(e,t,i){let n=e.length;if(n<=1)return;if((t=t<0?Math.max(0,t+n):Math.min(t,n-1))===(i=i<0?Math.max(0,i+n):Math.min(i,n-1)))return;let s=e[t],r=t<i?1:-1;for(let o=t;o!==i;o+=r)e[o]=e[o+r];e[i]=s}function m(e,t=0,i=-1){let n=e.length;if(!(n<=1))for(t=t<0?Math.max(0,t+n):Math.min(t,n-1),i=i<0?Math.max(0,i+n):Math.min(i,n-1);t<i;){let n=e[t],s=e[i];e[t++]=s,e[i--]=n}}function p(e,t,i=0,n=-1){let s=e.length;if(s<=1)return;if((i=i<0?Math.max(0,i+s):Math.min(i,s-1))>=(n=n<0?Math.max(0,n+s):Math.min(n,s-1)))return;let r=n-i+1;if(t>0?t%=r:t<0&&(t=(t%r+r)%r),0===t)return;let o=i+t;m(e,i,o-1),m(e,o,n),m(e,i,n)}function g(e,t,i=0,n=-1){let s,r=e.length;if(0!==r){i=i<0?Math.max(0,i+r):Math.min(i,r-1),s=(n=n<0?Math.max(0,n+r):Math.min(n,r-1))<i?n+1+(r-i):n-i+1;for(let n=0;n<s;++n)e[(i+n)%r]=t}}function f(e,t,i){let n=e.length;t=t<0?Math.max(0,t+n):Math.min(t,n);for(let s=n;s>t;--s)e[s]=e[s-1];e[t]=i}function _(e,t){let i=e.length;if(t<0&&(t+=i),t<0||t>=i)return;let n=e[t];for(let s=t+1;s<i;++s)e[s-1]=e[s];return e.length=i-1,n}function v(e,i,n=0,s=-1){let r=t(e,i,n,s);return-1!==r&&_(e,r),r}function b(e,t,n=-1,s=0){let r=i(e,t,n,s);return-1!==r&&_(e,r),r}function y(e,t,i=0,n=-1){let s=e.length;if(0===s)return 0;i=i<0?Math.max(0,i+s):Math.min(i,s-1),n=n<0?Math.max(0,n+s):Math.min(n,s-1);let r=0;for(let o=0;o<s;++o)i<=n&&o>=i&&o<=n&&e[o]===t||n<i&&(o<=n||o>=i)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}function w(e,t,i=0,s=-1){let r,o=n(e,t,i,s);return-1!==o&&(r=_(e,o)),{index:o,value:r}}function x(e,t,i=-1,n=0){let r,o=s(e,t,i,n);return-1!==o&&(r=_(e,o)),{index:o,value:r}}function M(e,t,i=0,n=-1){let s=e.length;if(0===s)return 0;i=i<0?Math.max(0,i+s):Math.min(i,s-1),n=n<0?Math.max(0,n+s):Math.min(n,s-1);let r=0;for(let o=0;o<s;++o)i<=n&&o>=i&&o<=n&&t(e[o],o)||n<i&&(o<=n||o>=i)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}o(t,"firstIndexOf"),e.firstIndexOf=t,o(i,"lastIndexOf"),e.lastIndexOf=i,o(n,"findFirstIndex"),e.findFirstIndex=n,o(s,"findLastIndex"),e.findLastIndex=s,o(r,"findFirstValue"),e.findFirstValue=r,o(a,"findLastValue"),e.findLastValue=a,o(d,"lowerBound"),e.lowerBound=d,o(l,"upperBound"),e.upperBound=l,o(h,"shallowEqual"),e.shallowEqual=h,o(c,"slice"),e.slice=c,o(u,"move"),e.move=u,o(m,"reverse"),e.reverse=m,o(p,"rotate"),e.rotate=p,o(g,"fill"),e.fill=g,o(f,"insert"),e.insert=f,o(_,"removeAt"),e.removeAt=_,o(v,"removeFirstOf"),e.removeFirstOf=v,o(b,"removeLastOf"),e.removeLastOf=b,o(y,"removeAllOf"),e.removeAllOf=y,o(w,"removeFirstWhere"),e.removeFirstWhere=w,o(x,"removeLastWhere"),e.removeLastWhere=x,o(M,"removeAllWhere"),e.removeAllWhere=M}(d||(d={})),o(u,"empty"),o(m,"find"),o(p,"every"),o(g,"some"),function(e){function t(e,t,i){return 0===i?1/0:e>t&&i>0||e<t&&i<0?0:Math.ceil((t-e)/i)}o(t,"rangeLength"),e.rangeLength=t}(l||(l={})),o(f,"retro"),o(_,"topologicSort"),function(e){function t(e,t,i=0){let n=new Array(t.length);for(let s=0,r=i,o=t.length;s<o;++s,++r){if(r=e.indexOf(t[s],r),-1===r)return null;n[s]=r}return n}function i(e,i,n=0){let s=t(e,i,n);if(!s)return null;let r=0;for(let t=0,o=s.length;t<o;++t){let e=s[t]-n;r+=e*e}return{score:r,indices:s}}function n(e,i,n=0){let s=t(e,i,n);if(!s)return null;let r=0,o=n-1;for(let t=0,a=s.length;t<a;++t){let e=s[t];r+=e-o-1,o=e}return{score:r,indices:s}}function s(e,t,i){let n=[],s=0,r=0,o=t.length;for(;s<o;){let a=t[s],d=t[s];for(;++s<o&&t[s]===d+1;)d++;r<a&&n.push(e.slice(r,a)),a<d+1&&n.push(i(e.slice(a,d+1))),r=d+1}return r<e.length&&n.push(e.slice(r)),n}function r(e,t){return e<t?-1:e>t?1:0}o(t,"findIndices"),e.findIndices=t,o(i,"matchSumOfSquares"),e.matchSumOfSquares=i,o(n,"matchSumOfDeltas"),e.matchSumOfDeltas=n,o(s,"highlight"),e.highlight=s,o(r,"cmp"),e.cmp=r}(h||(h={})),function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function i(e){return Array.isArray(e)}function n(e){return!t(e)&&!i(e)}function s(e,n){if(e===n)return!0;if(t(e)||t(n))return!1;let s=i(e),r=i(n);return s===r&&(s&&r?a(e,n):d(e,n))}function r(e){return t(e)?e:i(e)?l(e):h(e)}function a(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;++i)if(!s(e[i],t[i]))return!1;return!0}function d(e,t){if(e===t)return!0;for(let i in e)if(void 0!==e[i]&&!(i in t))return!1;for(let i in t)if(void 0!==t[i]&&!(i in e))return!1;for(let i in e){let n=e[i],r=t[i];if(void 0!==n||void 0!==r){if(void 0===n||void 0===r)return!1;if(!s(n,r))return!1}}return!0}function l(e){let t=new Array(e.length);for(let i=0,n=e.length;i<n;++i)t[i]=r(e[i]);return t}function h(e){let t={};for(let i in e){let n=e[i];void 0!==n&&(t[i]=r(n))}return t}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),o(t,"isPrimitive"),e.isPrimitive=t,o(i,"isArray"),e.isArray=i,o(n,"isObject"),e.isObject=n,o(s,"deepEqual"),e.deepEqual=s,o(r,"deepCopy"),e.deepCopy=r,o(a,"deepArrayEqual"),o(d,"deepObjectEqual"),o(l,"deepArrayCopy"),o(h,"deepObjectCopy")}(c||(c={}));const v=class _MimeData{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(e){return-1!==this._types.indexOf(e)}getData(e){let t=this._types.indexOf(e);return-1!==t?this._values[t]:void 0}setData(e,t){this.clearData(e),this._types.push(e),this._values.push(t)}clearData(e){let t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))}clear(){this._types.length=0,this._values.length=0}};o(v,"MimeData");let b=v;var y,w,x;function M(e){let t=0;for(let i=0,n=e.length;i<n;++i)i%4==0&&(t=4294967295*Math.random()>>>0),e[i]=255&t,t>>>=8}function C(e){const t=new Uint8Array(16),i=new Array(256);for(let n=0;n<16;++n)i[n]="0"+n.toString(16);for(let n=16;n<256;++n)i[n]=n.toString(16);return o(function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],i[t[0]]+i[t[1]]+i[t[2]]+i[t[3]]+"-"+i[t[4]]+i[t[5]]+"-"+i[t[6]]+i[t[7]]+"-"+i[t[8]]+i[t[9]]+"-"+i[t[10]]+i[t[11]]+i[t[12]]+i[t[13]]+i[t[14]]+i[t[15]]},"uuid4")}!function(e){const t=class _PluginData{constructor(e){var t,i,n,s;this._activated=!1,this._promise=null,this._service=null,this.id=e.id,this.description=null!==(t=e.description)&&void 0!==t?t:"",this.activate=e.activate,this.deactivate=null!==(i=e.deactivate)&&void 0!==i?i:null,this.provides=null!==(n=e.provides)&&void 0!==n?n:null,this.autoStart=null!==(s=e.autoStart)&&void 0!==s&&s,this.requires=e.requires?e.requires.slice():[],this.optional=e.optional?e.optional.slice():[]}get activated(){return this._activated}set activated(e){this._activated=e}get service(){return this._service}set service(e){this._service=e}get promise(){return this._promise}set promise(e){this._promise=e}};o(t,"PluginData");let i=t;function n(e){return new i(e)}function s(e,t,i){const n=[...e.requires,...e.optional],s=o(n=>{if(n===e.provides)return!0;const o=i.get(n);if(!o)return!1;const a=t.get(o),d=[...a.requires,...a.optional];return 0!==d.length&&(r.push(o),!!d.some(s)||(r.pop(),!1))},"visit");if(!e.provides||0===n.length)return;const r=[e.id];if(n.some(s))throw new ReferenceError(`Cycle detected: ${r.join(" -> ")}.`)}function r(e,t,i){const n=new Array,s=o(e=>{const s=t.get(e),r=[...s.requires,...s.optional];n.push(...r.reduce((t,n)=>{const s=i.get(n);return s&&t.push([e,s]),t},[]))},"add");for(const o of t.keys())s(o);const r=n.filter(t=>t[1]===e);let a=0;for(;r.length>a;){const e=r.length,t=new Set(r.map(e=>e[0]));for(const i of t)n.filter(e=>e[1]===i).forEach(e=>{r.includes(e)||r.push(e)});a=e}const d=_(r),l=d.findIndex(t=>t===e);return-1===l?[e]:d.slice(0,l+1)}function a(e,t){const i=new Set;for(const n of e.keys())!0===e.get(n).autoStart&&i.add(n);if(t.startPlugins)for(const n of t.startPlugins)i.add(n);if(t.ignorePlugins)for(const n of t.ignorePlugins)i.delete(n);return Array.from(i)}o(n,"createPluginData"),e.createPluginData=n,o(s,"ensureNoCycle"),e.ensureNoCycle=s,o(r,"findDependents"),e.findDependents=r,o(a,"collectStartupPlugins"),e.collectStartupPlugins=a}(y||(y={})),o(M,"fallbackRandomValues"),(w||(w={})).getRandomValues=(()=>{const e="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return e&&"function"==typeof e.getRandomValues?o(function(t){return e.getRandomValues(t)},"getRandomValues"):M})(),o(C,"uuid4Factory"),(x||(x={})).uuid4=C(w.getRandomValues);const A=class _Signal{constructor(e){this.sender=e}connect(e,t){return I.connect(this,e,t)}disconnect(e,t){return I.disconnect(this,e,t)}emit(e){I.emit(this,e)}};o(A,"Signal");let S=A;var I;!function(e){function t(e,t){I.disconnectBetween(e,t)}function i(e){I.disconnectSender(e)}function n(e){I.disconnectReceiver(e)}function s(e){I.disconnectAll(e)}function r(e){I.disconnectAll(e)}function a(){return I.exceptionHandler}function d(e){let t=I.exceptionHandler;return I.exceptionHandler=e,t}o(t,"disconnectBetween"),e.disconnectBetween=t,o(i,"disconnectSender"),e.disconnectSender=i,o(n,"disconnectReceiver"),e.disconnectReceiver=n,o(s,"disconnectAll"),e.disconnectAll=s,o(r,"clearData"),e.clearData=r,o(a,"getExceptionHandler"),e.getExceptionHandler=a,o(d,"setExceptionHandler"),e.setExceptionHandler=d}(S||(S={})),function(e){function t(e,t,i){i=i||void 0;let n=h.get(e.sender);if(n||(n=[],h.set(e.sender,n)),g(n,e,t,i))return!1;let s=i||t,r=c.get(s);r||(r=[],c.set(s,r));let o={signal:e,slot:t,thisArg:i};return n.push(o),r.push(o),!0}function i(e,t,i){i=i||void 0;let n=h.get(e.sender);if(!n||0===n.length)return!1;let s=g(n,e,t,i);if(!s)return!1;let r=i||t,o=c.get(r);return s.signal=null,_(n),_(o),!0}function n(e,t){let i=h.get(e);if(!i||0===i.length)return;let n=c.get(t);if(n&&0!==n.length){for(const t of n)t.signal&&t.signal.sender===e&&(t.signal=null);_(i),_(n)}}function s(e){let t=h.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.thisArg||e.slot;e.signal=null,_(c.get(t))}_(t)}}function r(e){let t=c.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.signal.sender;e.signal=null,_(h.get(t))}_(t)}}function a(e){s(e),r(e)}function l(e,t){let i=h.get(e.sender);if(i&&0!==i.length)for(let n=0,s=i.length;n<s;++n){let s=i[n];s.signal===e&&f(s,t)}}e.exceptionHandler=e=>{console.error(e)},o(t,"connect"),e.connect=t,o(i,"disconnect"),e.disconnect=i,o(n,"disconnectBetween"),e.disconnectBetween=n,o(s,"disconnectSender"),e.disconnectSender=s,o(r,"disconnectReceiver"),e.disconnectReceiver=r,o(a,"disconnectAll"),e.disconnectAll=a,o(l,"emit"),e.emit=l;const h=new WeakMap,c=new WeakMap,u=new Set,p="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function g(e,t,i,n){return m(e,e=>e.signal===t&&e.slot===i&&e.thisArg===n)}function f(t,i){let{signal:n,slot:s,thisArg:r}=t;try{s.call(r,n.sender,i)}catch(o){e.exceptionHandler(o)}}function _(e){0===u.size&&p(v),u.add(e)}function v(){u.forEach(b),u.clear()}function b(e){d.removeAllWhere(e,y)}function y(e){return null===e.signal}o(g,"findConnection"),o(f,"invokeSlot"),o(_,"scheduleCleanup"),o(v,"cleanupDirtySet"),o(b,"cleanupConnections"),o(y,"isDeadConnection")}(I||(I={}));const z=class _DisposableDelegate{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}};o(z,"DisposableDelegate");let k=z;const E=class _DisposableSet{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(e=>{e.dispose()}),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}};o(E,"DisposableSet");let T=E;!function(e){function t(t){let i=new e;for(const e of t)i.add(e);return i}o(t,"from"),e.from=t}(T||(T={}));const L=class _ObservableDisposableSet extends T{constructor(){super(...arguments),this._disposed=new S(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),S.clearData(this))}};o(L,"ObservableDisposableSet");let D=L;var B,R,P,W,H;function N(){return K.keyboardLayout}!function(e){function t(t){let i=new e;for(const e of t)i.add(e);return i}o(t,"from"),e.from=t}(L||(D={})),function(e){function t(e){const t=document.body,i=o(n=>{n.preventDefault(),n.stopPropagation(),n.clipboardData.setData("text",e),t.removeEventListener("copy",i,!0)},"handler");t.addEventListener("copy",i,!0),document.execCommand("copy")}o(t,"copyText"),e.copyText=t}(B||(B={})),function(e){function t(e){let t=window.getComputedStyle(e),i=parseFloat(t.borderTopWidth)||0,n=parseFloat(t.borderLeftWidth)||0,s=parseFloat(t.borderRightWidth)||0,r=parseFloat(t.borderBottomWidth)||0,o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingLeft)||0,d=parseFloat(t.paddingRight)||0,l=parseFloat(t.paddingBottom)||0;return{borderTop:i,borderLeft:n,borderRight:s,borderBottom:r,paddingTop:o,paddingLeft:a,paddingRight:d,paddingBottom:l,horizontalSum:n+a+d+s,verticalSum:i+o+l+r}}function i(e){let t=window.getComputedStyle(e),i=parseFloat(t.minWidth)||0,n=parseFloat(t.minHeight)||0,s=parseFloat(t.maxWidth)||1/0,r=parseFloat(t.maxHeight)||1/0;return s=Math.max(i,s),r=Math.max(n,r),{minWidth:i,minHeight:n,maxWidth:s,maxHeight:r}}function n(e,t,i){let n=e.getBoundingClientRect();return t>=n.left&&t<n.right&&i>=n.top&&i<n.bottom}function s(e,t){let i=e.getBoundingClientRect(),n=t.getBoundingClientRect();n.top<=i.top&&n.bottom>=i.bottom||(n.top<i.top&&n.height<=i.height||n.bottom>i.bottom&&n.height>=i.height?e.scrollTop-=i.top-n.top:(n.top<i.top&&n.height>i.height||n.bottom>i.bottom&&n.height<i.height)&&(e.scrollTop-=i.bottom-n.bottom))}o(t,"boxSizing"),e.boxSizing=t,o(i,"sizeLimits"),e.sizeLimits=i,o(n,"hitTest"),e.hitTest=n,o(s,"scrollIntoViewIfNeeded"),e.scrollIntoViewIfNeeded=s}(R||(R={})),function(e){function t(t){return e.IS_MAC?t.metaKey:t.ctrlKey}e.IS_MAC=!!navigator.platform.match(/Mac/i),e.IS_WIN=!!navigator.platform.match(/Win/i),e.IS_IE=/Trident/.test(navigator.userAgent),e.IS_EDGE=/Edge/.test(navigator.userAgent),o(t,"accelKey"),e.accelKey=t}(P||(P={})),function(e){function t(e){if(e in H.specificityCache)return H.specificityCache[e];let t=H.calculateSingle(e);return H.specificityCache[e]=t}function i(e){if(e in H.validityCache)return H.validityCache[e];let t=!0;try{H.testElem.querySelector(e)}catch(i){t=!1}return H.validityCache[e]=t}function n(e,t){return H.protoMatchFunc.call(e,t)}o(t,"calculateSpecificity"),e.calculateSpecificity=t,o(i,"isValid"),e.isValid=i,o(n,"matches"),e.matches=n}(W||(W={})),function(e){function t(e){e=e.split(",",1)[0];let t=0,c=0,u=0;function m(t){let i=e.match(t);return null!==i&&(e=e.slice(i[0].length),!0)}for(o(m,"match"),e=e.replace(h," $1 ");e.length>0;)if(m(i))t++;else if(m(n))c++;else if(m(s))c++;else if(m(a))u++;else if(m(d))c++;else if(m(r))u++;else if(!m(l))return 0;return t=Math.min(t,255),c=Math.min(c,255),u=Math.min(u,255),t<<16|c<<8|u}e.specificityCache=Object.create(null),e.validityCache=Object.create(null),e.testElem=document.createElement("div"),e.protoMatchFunc=(()=>{let e=Element.prototype;return e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){let t=this,i=t.ownerDocument?t.ownerDocument.querySelectorAll(e):[];return-1!==Array.prototype.indexOf.call(i,t)}})(),o(t,"calculateSingle"),e.calculateSingle=t;const i=/^#[^\s\+>~#\.\[:]+/,n=/^\.[^\s\+>~#\.\[:]+/,s=/^\[[^\]]+\]/,r=/^[^\s\+>~#\.\[:]+/,a=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,d=/^:[^\s\+>~#\.\[:]+/,l=/^[\s\+>~\*]+/,h=/:not\(([^\)]+)\)/g}(H||(H={})),o(N,"getKeyboardLayout");const O=class _KeycodeLayout{constructor(e,t,i=[]){this.name=e,this._codes=t,this._keys=_KeycodeLayout.extractKeys(t),this._modifierKeys=_KeycodeLayout.convertToKeySet(i)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}};o(O,"KeycodeLayout");let F=O;!function(e){function t(e){let t=Object.create(null);for(let i in e)t[e[i]]=!0;return t}function i(e){let t=Object(null);for(let i=0,n=e.length;i<n;++i)t[e[i]]=!0;return t}o(t,"extractKeys"),e.extractKeys=t,o(i,"convertToKeySet"),e.convertToKeySet=i}(F||(F={}));const q=new F("en-us",{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",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",91:"Meta",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:"'",224:"Meta"},["Shift","Ctrl","Alt","Meta"]);var K;(K||(K={})).keyboardLayout=q;const $=class _CommandRegistry{constructor(){this._timerID=0,this._timerModifierID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=new Map,this._commandChanged=new S(this),this._commandExecuted=new S(this),this._keyBindingChanged=new S(this),this._holdKeyBindingPromises=new Map}get commandChanged(){return this._commandChanged}get commandExecuted(){return this._commandExecuted}get keyBindingChanged(){return this._keyBindingChanged}get keyBindings(){return this._keyBindings}listCommands(){return Array.from(this._commands.keys())}hasCommand(e){return this._commands.has(e)}addCommand(e,t){if(this._commands.has(e))throw new Error(`Command '${e}' already registered.`);return this._commands.set(e,U.createCommand(t)),this._commandChanged.emit({id:e,type:"added"}),new k(()=>{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})})}notifyCommandChanged(e){if(void 0!==e&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=c.emptyObject){var i;let n=this._commands.get(e);return Promise.resolve(null!==(i=null==n?void 0:n.describedBy.call(void 0,t))&&void 0!==i?i:{args:null})}label(e,t=c.emptyObject){var i;let n=this._commands.get(e);return null!==(i=null==n?void 0:n.label.call(void 0,t))&&void 0!==i?i:""}mnemonic(e,t=c.emptyObject){let i=this._commands.get(e);return i?i.mnemonic.call(void 0,t):-1}icon(e,t=c.emptyObject){var i;return null===(i=this._commands.get(e))||void 0===i?void 0:i.icon.call(void 0,t)}iconClass(e,t=c.emptyObject){let i=this._commands.get(e);return i?i.iconClass.call(void 0,t):""}iconLabel(e,t=c.emptyObject){let i=this._commands.get(e);return i?i.iconLabel.call(void 0,t):""}caption(e,t=c.emptyObject){let i=this._commands.get(e);return i?i.caption.call(void 0,t):""}usage(e,t=c.emptyObject){let i=this._commands.get(e);return i?i.usage.call(void 0,t):""}className(e,t=c.emptyObject){let i=this._commands.get(e);return i?i.className.call(void 0,t):""}dataset(e,t=c.emptyObject){let i=this._commands.get(e);return i?i.dataset.call(void 0,t):{}}isEnabled(e,t=c.emptyObject){let i=this._commands.get(e);return!!i&&i.isEnabled.call(void 0,t)}isToggled(e,t=c.emptyObject){let i=this._commands.get(e);return!!i&&i.isToggled.call(void 0,t)}isToggleable(e,t=c.emptyObject){let i=this._commands.get(e);return!!i&&i.isToggleable}isVisible(e,t=c.emptyObject){let i=this._commands.get(e);return!!i&&i.isVisible.call(void 0,t)}execute(e,t=c.emptyObject){let i,n=this._commands.get(e);if(!n)return Promise.reject(new Error(`Command '${e}' not registered.`));try{i=n.execute.call(void 0,t)}catch(r){i=Promise.reject(r)}let s=Promise.resolve(i);return this._commandExecuted.emit({id:e,args:t,result:s}),s}addKeyBinding(e){let t=U.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new k(()=>{d.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=_CommandRegistry.keystrokeForKeydownEvent(e);if(!t)return this._replayKeydownEvents(),void this._clearPendingState();if(_CommandRegistry.isModifierKeyPressed(e)){let{exact:i}=U.matchKeyBinding(this._keyBindings,[t],e);return void(i?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(i)):this._clearModifierTimer())}this._keystrokes.push(t);const{exact:i,partial:n}=U.matchKeyBinding(this._keyBindings,this._keystrokes,e),s=0!==n.length;return i||s?(((null==i?void 0:i.preventDefault)||n.some(e=>e.preventDefault))&&(e.preventDefault(),e.stopPropagation()),this._keydownEvents.push(e),i&&!s?(this._executeKeyBinding(i),void this._clearPendingState()):(i&&(this._exactKeyMatch=i),void this._startTimer())):(this._replayKeydownEvents(),void this._clearPendingState())}holdKeyBindingExecution(e,t){this._holdKeyBindingPromises.set(e,t)}processKeyupEvent(e){this._clearModifierTimer()}_startModifierTimer(e){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(e)},U.modifierkeyTimeOut)}_clearModifierTimer(){0!==this._timerModifierID&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},U.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(U.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(0!==this._holdKeyBindingPromises.size){const e=[...this._keydownEvents],t=(await Promise.race([Promise.all(e.map(async e=>{var t;return null!==(t=this._holdKeyBindingPromises.get(e))&&void 0!==t?t:Promise.resolve(!0)})),new Promise(e=>{setTimeout(()=>e([!1]),U.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!t)return}let{command:t,args:i}=e,n={_luminoEvent:{type:"keybinding",keys:e.keys},...i};if(!this.hasCommand(t)||!this.isEnabled(t,n)){let i=this.hasCommand(t)?"enabled":"registered",n=`Cannot execute key binding '${e.keys.join(", ")}':`,s=`command '${t}' is not ${i}.`;return void console.warn(`${n} ${s}`)}await this.execute(t,n)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}};o($,"CommandRegistry");let V=$;var U;!function(e){function t(e){let t="",i=!1,n=!1,s=!1,r=!1;for(let o of e.split(/\s+/))"Accel"===o?P.IS_MAC?n=!0:s=!0:"Alt"===o?i=!0:"Cmd"===o?n=!0:"Ctrl"===o?s=!0:"Shift"===o?r=!0:o.length>0&&(t=o);return{cmd:n,ctrl:s,alt:i,shift:r,key:t}}function i(e){let i="",n=t(e);return n.ctrl&&(i+="Ctrl "),n.alt&&(i+="Alt "),n.shift&&(i+="Shift "),n.cmd&&P.IS_MAC&&(i+="Cmd "),n.key?i+n.key:i.trim()}function n(e){let t;return t=P.IS_WIN?e.winKeys||e.keys:P.IS_MAC?e.macKeys||e.keys:e.linuxKeys||e.keys,t.map(i)}function s(e){return"string"==typeof e?i(e):e.map(i).join(", ");function i(e){let i=[],n=P.IS_MAC?" ":"+",s=t(e);return s.ctrl&&i.push("Ctrl"),s.alt&&i.push("Alt"),s.shift&&i.push("Shift"),P.IS_MAC&&s.cmd&&i.push("Cmd"),i.push(s.key),i.map(U.formatKey).join(n)}}function r(e){let t=N(),i=t.keyForKeydownEvent(e);return t.isModifierKey(i)}function a(e){let t=N(),i=t.keyForKeydownEvent(e),n=[];return e.ctrlKey&&n.push("Ctrl"),e.altKey&&n.push("Alt"),e.shiftKey&&n.push("Shift"),e.metaKey&&P.IS_MAC&&n.push("Cmd"),t.isModifierKey(i)||n.push(i),n.join(" ")}o(t,"parseKeystroke"),e.parseKeystroke=t,o(i,"normalizeKeystroke"),e.normalizeKeystroke=i,o(n,"normalizeKeys"),e.normalizeKeys=n,o(s,"formatKeystroke"),e.formatKeystroke=s,o(r,"isModifierKeyPressed"),e.isModifierKeyPressed=r,o(a,"keystrokeForKeydownEvent"),e.keystrokeForKeydownEvent=a}(V||(V={})),function(e){function t(e){return{execute:e.execute,describedBy:f("function"==typeof e.describedBy?e.describedBy:{args:null,...e.describedBy},()=>({args:null})),label:f(e.label,l),mnemonic:f(e.mnemonic,h),icon:f(e.icon,g),iconClass:f(e.iconClass,l),iconLabel:f(e.iconLabel,l),caption:f(e.caption,l),usage:f(e.usage,l),className:f(e.className,l),dataset:f(e.dataset,p),isEnabled:e.isEnabled||u,isToggled:e.isToggled||m,isToggleable:e.isToggleable||!!e.isToggled,isVisible:e.isVisible||u}}function i(e){var t;return{keys:V.normalizeKeys(e),selector:_(e),command:e.command,args:e.args||c.emptyObject,preventDefault:null===(t=e.preventDefault)||void 0===t||t}}function n(e,t,i){let n=null,s=[],r=1/0,o=0;for(let a=0,d=e.length;a<d;++a){let d=e[a],l=v(d.keys,t);if(0===l)continue;if(2===l){-1!==b(d.selector,i)&&s.push(d);continue}let h=b(d.selector,i);if(-1===h||h>r)continue;let c=W.calculateSpecificity(d.selector);(!n||h<r||c>=o)&&(n=d,r=h,o=c)}return{exact:n,partial:s}}function s(e){e.target.dispatchEvent(y(e))}function r(e){return P.IS_MAC?a.hasOwnProperty(e)?a[e]:e:d.hasOwnProperty(e)?d[e]:e}e.CHORD_TIMEOUT=1e3,e.KEYBINDING_HOLD_TIMEOUT=1e3,e.modifierkeyTimeOut=500,o(t,"createCommand"),e.createCommand=t,o(i,"createKeyBinding"),e.createKeyBinding=i,o(n,"matchKeyBinding"),e.matchKeyBinding=n,o(s,"replayKeyEvent"),e.replayKeyEvent=s,o(r,"formatKey"),e.formatKey=r;const a={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},d={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},l=o(()=>"","emptyStringFunc"),h=o(()=>-1,"negativeOneFunc"),u=o(()=>!0,"trueFunc"),m=o(()=>!1,"falseFunc"),p=o(()=>({}),"emptyDatasetFunc"),g=o(()=>{},"undefinedFunc");function f(e,t){return void 0===e?t:"function"==typeof e?e:()=>e}function _(e){if(-1!==e.selector.indexOf(","))throw new Error(`Selector cannot contain commas: ${e.selector}`);if(!W.isValid(e.selector))throw new Error(`Invalid selector: ${e.selector}`);return e.selector}function v(e,t){if(e.length<t.length)return 0;for(let i=0,n=t.length;i<n;++i)if(e[i]!==t[i])return 0;return e.length>t.length?2:1}function b(e,t){let i=t.target,n=t.currentTarget;for(let s=0;null!==i;i=i.parentElement,++s){if(i.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(W.matches(i,e))return s;if(i===n)return-1}return-1}function y(e){let t=document.createEvent("Event"),i=e.bubbles||!0,n=e.cancelable||!0;return t.initEvent(e.type||"keydown",i,n),t.key=e.key||"",t.keyCode=e.keyCode||0,t.which=e.keyCode||0,t.ctrlKey=e.ctrlKey||!1,t.altKey=e.altKey||!1,t.shiftKey=e.shiftKey||!1,t.metaKey=e.metaKey||!1,t.view=e.view||window,t}o(f,"asFunc"),o(_,"validateSelector"),o(v,"matchSequence"),o(b,"targetDistance"),o(y,"cloneKeyboardEvent")}(U||(U={}));const j=class _LinkedList{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(const t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new X.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new X.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof X.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new X.LinkedListNode(this,e),n=t,s=n.prev;return i.next=n,i.prev=s,n.prev=i,s.next=i,this._size++,i}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof X.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new X.LinkedListNode(this,e),n=t,s=n.next;return i.next=s,i.prev=n,n.next=i,s.prev=i,this._size++,i}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof X.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}};o(j,"LinkedList");let Y=j;var X;!function(e){function t(t){let i=new e;return i.assign(t),i}o(t,"from"),e.from=t}(Y||(Y={})),function(e){const t=class _LinkedListNode{constructor(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t}};o(t,"LinkedListNode");let i=t;e.LinkedListNode=i}(X||(X={}));const G=class _Message{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}};o(G,"Message");let Z=G;const Q=class _ConflatableMessage extends Z{get isConflatable(){return!0}conflate(e){return!0}};o(Q,"ConflatableMessage");let J=Q;var ee;!function(e){let t=null;const i=(e=>t=>{let i=!1;return e.then(()=>!i&&t()),()=>{i=!0}})(Promise.resolve());function n(e,t){let i=_.get(e);i&&0!==i.length?p(f(i),i=>!i||w(i,e,t))&&x(e,t):x(e,t)}function s(e,t){if(!t.isConflatable)return void M(e,t);g(m,i=>i.handler===e&&(!!i.msg&&(i.msg.type===t.type&&(!!i.msg.isConflatable&&i.msg.conflate(t)))))||M(e,t)}function r(e,t){let i=_.get(e);i&&-1!==i.indexOf(t)||(i?i.push(t):_.set(e,[t]))}function a(e,t){let i=_.get(e);if(!i)return;let n=i.indexOf(t);-1!==n&&(i[n]=null,A(i))}function l(e){let t=_.get(e);t&&t.length>0&&(d.fill(t,null),A(t));for(const i of m)i.handler===e&&(i.handler=null,i.msg=null)}function h(){y||null===t||(t(),t=null,y=!0,C(),y=!1)}function c(){return b}function u(e){let t=b;return b=e,t}o(n,"sendMessage"),e.sendMessage=n,o(s,"postMessage"),e.postMessage=s,o(r,"installMessageHook"),e.installMessageHook=r,o(a,"removeMessageHook"),e.removeMessageHook=a,o(l,"clearData"),e.clearData=l,o(h,"flush"),e.flush=h,o(c,"getExceptionHandler"),e.getExceptionHandler=c,o(u,"setExceptionHandler"),e.setExceptionHandler=u;const m=new Y,_=new WeakMap,v=new Set;let b=o(e=>{console.error(e)},"exceptionHandler"),y=!1;function w(e,t,i){let n=!0;try{n="function"==typeof e?e(t,i):e.messageHook(t,i)}catch(s){b(s)}return n}function x(e,t){try{e.processMessage(t)}catch(i){b(i)}}function M(e,n){m.addLast({handler:e,msg:n}),null===t&&(t=i(C))}function C(){if(t=null,m.isEmpty)return;let e={handler:null,msg:null};for(m.addLast(e);;){let t=m.removeFirst();if(t===e)return;t.handler&&t.msg&&n(t.handler,t.msg)}}function A(e){0===v.size&&i(S),v.add(e)}function S(){v.forEach(I),v.clear()}function I(e){d.removeAllWhere(e,z)}function z(e){return null===e}o(w,"invokeHook"),o(x,"invokeHandler"),o(M,"enqueueMessage"),o(C,"runMessageLoop"),o(A,"scheduleCleanup"),o(S,"cleanupDirtySet"),o(I,"cleanupHooks"),o(z,"isNull")}(ee||(ee={}));const te=class _AttachedProperty{constructor(e){this._pid=ne.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,i=ne.ensureMap(e);return t=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(e),t}set(e,t){let i,n=ne.ensureMap(e);i=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e);let s=this._coerceValue(e,t);this._maybeNotify(e,i,n[this._pid]=s)}coerce(e){let t,i=ne.ensureMap(e);t=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(e);let n=this._coerceValue(e,t);this._maybeNotify(e,t,i[this._pid]=n)}_createValue(e){return(0,this._create)(e)}_coerceValue(e,t){let i=this._coerce;return i?i(e,t):t}_compareValue(e,t){let i=this._compare;return i?i(e,t):e===t}_maybeNotify(e,t,i){let n=this._changed;n&&!this._compareValue(t,i)&&n(e,t,i)}};o(te,"AttachedProperty");let ie=te;var ne;!function(e){function t(e){ne.ownerData.delete(e)}o(t,"clearData"),e.clearData=t}(ie||(ie={})),function(e){function t(t){let i=e.ownerData.get(t);return i||(i=Object.create(null),e.ownerData.set(t,i),i)}e.ownerData=new WeakMap,e.nextPID=(()=>{let e=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${e++}`})(),o(t,"ensureMap"),e.ensureMap=t}(ne||(ne={}));const se=class _Drag{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:e,edge:t,distance:i}=this._scrollTarget,n=oe.SCROLL_EDGE_SIZE-i,s=Math.pow(n/oe.SCROLL_EDGE_SIZE,2),r=Math.max(1,Math.round(s*oe.SCROLL_EDGE_SIZE));switch(t){case"top":e.scrollTop-=r;break;case"left":e.scrollLeft-=r;break;case"right":e.scrollLeft+=r;break;case"bottom":e.scrollTop+=r}requestAnimationFrame(this._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.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});oe.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise(e=>{this._resolve=e});let i=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(i),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}}moveDragImage(e,t){if(!this.dragImage)return;this.dragImage.style.transform=`translate(${e}px, ${t}px)`}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),0!==e.button)return;if(this._updateCurrentTarget(e),!this._currentTarget)return void this._finalize("none");if("none"===this._dropAction)return oe.dispatchDragLeave(this,this._currentTarget,null,e),void this._finalize("none");let t=oe.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=oe.findScrollTarget(e);(this._scrollTarget||t)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,i=this._currentTarget,n=this._currentElement,s=oe.findElementBehindBackdrop(e,this.document);this._currentElement=s,s!==n&&s!==i&&oe.dispatchDragExit(this,i,s,e),s!==n&&s!==i&&(i=oe.dispatchDragEnter(this,s,i,e)),i!==t&&(this._currentTarget=i,oe.dispatchDragLeave(this,t,i,e));let r=oe.dispatchDragOver(this,i,e);this._setDropAction(r)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let i=this.dragImage.style;i.pointerEvents="none",i.position="fixed",i.transform=`translate(${e}px, ${t}px)`;(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(e){if(e=oe.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=_Drag.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=_Drag.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=_Drag.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=_Drag.overrideCursor("move",this.document)}}_finalize(e){let t=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,t&&t(e)}};o(se,"Drag");let re=se;var oe;!function(e){const t=class _Event extends DragEvent{constructor(e,t){super(t.type,{bubbles:!0,cancelable:!0,altKey:e.altKey,button:e.button,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,detail:0,metaKey:e.metaKey,relatedTarget:t.related,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey,view:window});const{drag:i}=t;this.dropAction="none",this.mimeData=i.mimeData,this.proposedAction=i.proposedAction,this.supportedActions=i.supportedActions,this.source=i.source}};o(t,"Event");let i=t;function n(e,t=document){return oe.overrideCursor(e,t)}e.Event=i,o(n,"overrideCursor"),e.overrideCursor=n}(re||(re={})),function(e){function t(e,t){return u[e]&m[t]?e:"none"}function i(t,i=document){if(t){if(n&&t==n.event)return n.element;e.cursorBackdrop.style.zIndex="-1000";const s=i.elementFromPoint(t.clientX,t.clientY);return e.cursorBackdrop.style.zIndex="",n={event:t,element:s},s}{const t=e.cursorBackdrop.style.transform;if(s&&t===s.transform)return s.element;const n=e.cursorBackdrop.getBoundingClientRect();e.cursorBackdrop.style.zIndex="-1000";const r=i.elementFromPoint(n.left+n.width/2,n.top+n.height/2);return e.cursorBackdrop.style.zIndex="",s={transform:t,element:r},r}}e.SCROLL_EDGE_SIZE=20,o(t,"validateAction"),e.validateAction=t,o(i,"findElementBehindBackdrop"),e.findElementBehindBackdrop=i;let n=null,s=null;function r(t){let n=t.clientX,s=t.clientY,r=i(t);for(;r;r=r.parentElement){if(!r.hasAttribute("data-lm-dragscroll"))continue;let t=0,i=0;r===document.body&&(t=window.pageXOffset,i=window.pageYOffset);let o=r.getBoundingClientRect(),a=o.top+i,d=o.left+t,l=d+o.width,h=a+o.height;if(n<d||n>=l||s<a||s>=h)continue;let c,u=n-d+1,m=s-a+1,p=l-n,g=h-s,f=Math.min(u,m,p,g);if(f>e.SCROLL_EDGE_SIZE)continue;switch(f){case g:c="bottom";break;case m:c="top";break;case p:c="right";break;case u:c="left";break;default:throw"unreachable"}let _,v=r.scrollWidth-r.clientWidth,b=r.scrollHeight-r.clientHeight;switch(c){case"top":_=b>0&&r.scrollTop>0;break;case"left":_=v>0&&r.scrollLeft>0;break;case"right":_=v>0&&r.scrollLeft<v;break;case"bottom":_=b>0&&r.scrollTop<b;break;default:throw"unreachable"}if(_)return{element:r,edge:c,distance:f}}return null}function a(e,t,i,n){if(!t)return null;let s=new re.Event(n,{drag:e,related:i,type:"lm-dragenter"});if(!t.dispatchEvent(s))return t;const r=e.document instanceof Document?e.document.body:e.document.firstElementChild;return t===r?i:(s=new re.Event(n,{drag:e,related:i,type:"lm-dragenter"}),r.dispatchEvent(s),r)}function d(e,t,i,n){if(!t)return;let s=new re.Event(n,{drag:e,related:i,type:"lm-dragexit"});t.dispatchEvent(s)}function l(e,t,i,n){if(!t)return;let s=new re.Event(n,{drag:e,related:i,type:"lm-dragleave"});t.dispatchEvent(s)}function h(e,t,i){if(!t)return"none";let n=new re.Event(i,{drag:e,related:null,type:"lm-dragover"});return!t.dispatchEvent(n)?n.dropAction:"none"}function c(e,t,i){if(!t)return"none";let n=new re.Event(i,{drag:e,related:null,type:"lm-drop"});return!t.dispatchEvent(n)?n.dropAction:"none"}o(r,"findScrollTarget"),e.findScrollTarget=r,o(a,"dispatchDragEnter"),e.dispatchDragEnter=a,o(d,"dispatchDragExit"),e.dispatchDragExit=d,o(l,"dispatchDragLeave"),e.dispatchDragLeave=l,o(h,"dispatchDragOver"),e.dispatchDragOver=h,o(c,"dispatchDrop"),e.dispatchDrop=c;const u={none:0,copy:1,link:2,move:4},m={none:u.none,copy:u.copy,link:u.link,move:u.move,"copy-link":u.copy|u.link,"copy-move":u.copy|u.move,"link-move":u.link|u.move,all:u.copy|u.link|u.move};function p(t,i=document){let n=++y;const s=i instanceof Document?i.body:i.firstElementChild;return e.cursorBackdrop.isConnected||(e.cursorBackdrop.style.transform="scale(0)",s.appendChild(e.cursorBackdrop),_(),document.addEventListener("pointermove",g,{capture:!0,passive:!0}),e.cursorBackdrop.addEventListener("scroll",f,{capture:!0,passive:!0})),e.cursorBackdrop.style.cursor=t,new k(()=>{n===y&&e.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",g,!0),e.cursorBackdrop.removeEventListener("scroll",f,!0),s.removeChild(e.cursorBackdrop))})}function g(t){e.cursorBackdrop&&(e.cursorBackdrop.style.transform=`translate(${t.clientX}px, ${t.clientY}px)`)}function f(t){if(!e.cursorBackdrop)return;let n=i();if(!n)return;const s=n.closest("[data-lm-dragscroll]");s&&(s.scrollTop+=e.cursorBackdrop.scrollTop-v,s.scrollLeft+=e.cursorBackdrop.scrollLeft-v,_())}function _(){e.cursorBackdrop.scrollTop=v,e.cursorBackdrop.scrollLeft=v}o(p,"overrideCursor"),e.overrideCursor=p,o(g,"alignBackdrop"),o(f,"propagateBackdropScroll"),o(_,"resetBackdropScroll");const v=500;function b(){const e=document.createElement("div");return e.classList.add("lm-cursor-backdrop"),e}o(b,"createCursorBackdrop");let y=0;e.cursorBackdrop=b()}(oe||(oe={}));const ae=class _VirtualText{constructor(e){this.type="text",this.content=e}};o(ae,"VirtualText");let de=ae;const le=class _VirtualElement{constructor(e,t,i,n){this.type="element",this.tag=e,this.attrs=t,this.children=i,this.renderer=n}};o(le,"VirtualElement");let he=le;function ce(e){let t,i={},n=[];for(let r=1,o=arguments.length;r<o;++r){let e=arguments[r];"string"==typeof e?n.push(new de(e)):e instanceof de||e instanceof he?n.push(e):e instanceof Array?s(n,e):1!==r&&2!==r||!e||"object"!=typeof e||("render"in e?t=e:i=e)}return new he(e,i,n,t);function s(e,t){for(let i of t)"string"==typeof i?e.push(new de(i)):(i instanceof de||i instanceof he)&&e.push(i)}}var ue,me,pe;o(ce,"h"),(ue=ce||(ce={})).a=ue.bind(void 0,"a"),ue.abbr=ue.bind(void 0,"abbr"),ue.address=ue.bind(void 0,"address"),ue.area=ue.bind(void 0,"area"),ue.article=ue.bind(void 0,"article"),ue.aside=ue.bind(void 0,"aside"),ue.audio=ue.bind(void 0,"audio"),ue.b=ue.bind(void 0,"b"),ue.bdi=ue.bind(void 0,"bdi"),ue.bdo=ue.bind(void 0,"bdo"),ue.blockquote=ue.bind(void 0,"blockquote"),ue.br=ue.bind(void 0,"br"),ue.button=ue.bind(void 0,"button"),ue.canvas=ue.bind(void 0,"canvas"),ue.caption=ue.bind(void 0,"caption"),ue.cite=ue.bind(void 0,"cite"),ue.code=ue.bind(void 0,"code"),ue.col=ue.bind(void 0,"col"),ue.colgroup=ue.bind(void 0,"colgroup"),ue.data=ue.bind(void 0,"data"),ue.datalist=ue.bind(void 0,"datalist"),ue.dd=ue.bind(void 0,"dd"),ue.del=ue.bind(void 0,"del"),ue.dfn=ue.bind(void 0,"dfn"),ue.div=ue.bind(void 0,"div"),ue.dl=ue.bind(void 0,"dl"),ue.dt=ue.bind(void 0,"dt"),ue.em=ue.bind(void 0,"em"),ue.embed=ue.bind(void 0,"embed"),ue.fieldset=ue.bind(void 0,"fieldset"),ue.figcaption=ue.bind(void 0,"figcaption"),ue.figure=ue.bind(void 0,"figure"),ue.footer=ue.bind(void 0,"footer"),ue.form=ue.bind(void 0,"form"),ue.h1=ue.bind(void 0,"h1"),ue.h2=ue.bind(void 0,"h2"),ue.h3=ue.bind(void 0,"h3"),ue.h4=ue.bind(void 0,"h4"),ue.h5=ue.bind(void 0,"h5"),ue.h6=ue.bind(void 0,"h6"),ue.header=ue.bind(void 0,"header"),ue.hr=ue.bind(void 0,"hr"),ue.i=ue.bind(void 0,"i"),ue.iframe=ue.bind(void 0,"iframe"),ue.img=ue.bind(void 0,"img"),ue.input=ue.bind(void 0,"input"),ue.ins=ue.bind(void 0,"ins"),ue.kbd=ue.bind(void 0,"kbd"),ue.label=ue.bind(void 0,"label"),ue.legend=ue.bind(void 0,"legend"),ue.li=ue.bind(void 0,"li"),ue.main=ue.bind(void 0,"main"),ue.map=ue.bind(void 0,"map"),ue.mark=ue.bind(void 0,"mark"),ue.meter=ue.bind(void 0,"meter"),ue.nav=ue.bind(void 0,"nav"),ue.noscript=ue.bind(void 0,"noscript"),ue.object=ue.bind(void 0,"object"),ue.ol=ue.bind(void 0,"ol"),ue.optgroup=ue.bind(void 0,"optgroup"),ue.option=ue.bind(void 0,"option"),ue.output=ue.bind(void 0,"output"),ue.p=ue.bind(void 0,"p"),ue.param=ue.bind(void 0,"param"),ue.pre=ue.bind(void 0,"pre"),ue.progress=ue.bind(void 0,"progress"),ue.q=ue.bind(void 0,"q"),ue.rp=ue.bind(void 0,"rp"),ue.rt=ue.bind(void 0,"rt"),ue.ruby=ue.bind(void 0,"ruby"),ue.s=ue.bind(void 0,"s"),ue.samp=ue.bind(void 0,"samp"),ue.section=ue.bind(void 0,"section"),ue.select=ue.bind(void 0,"select"),ue.small=ue.bind(void 0,"small"),ue.source=ue.bind(void 0,"source"),ue.span=ue.bind(void 0,"span"),ue.strong=ue.bind(void 0,"strong"),ue.sub=ue.bind(void 0,"sub"),ue.summary=ue.bind(void 0,"summary"),ue.sup=ue.bind(void 0,"sup"),ue.table=ue.bind(void 0,"table"),ue.tbody=ue.bind(void 0,"tbody"),ue.td=ue.bind(void 0,"td"),ue.textarea=ue.bind(void 0,"textarea"),ue.tfoot=ue.bind(void 0,"tfoot"),ue.th=ue.bind(void 0,"th"),ue.thead=ue.bind(void 0,"thead"),ue.time=ue.bind(void 0,"time"),ue.title=ue.bind(void 0,"title"),ue.tr=ue.bind(void 0,"tr"),ue.track=ue.bind(void 0,"track"),ue.u=ue.bind(void 0,"u"),ue.ul=ue.bind(void 0,"ul"),ue.var_=ue.bind(void 0,"var"),ue.video=ue.bind(void 0,"video"),ue.wbr=ue.bind(void 0,"wbr"),function(e){function t(e){return pe.createDOMNode(e)}function i(e,t){let i=pe.hostMap.get(t)||[],n=pe.asContentArray(e);pe.hostMap.set(t,n),pe.updateContent(t,i,n)}o(t,"realize"),e.realize=t,o(i,"render"),e.render=i}(me||(me={})),function(e){function t(e){return e?e instanceof Array?e:[e]:[]}function i(e){let t=arguments[1]||null;const n=arguments[2]||null;if(t)t.insertBefore(i(e),n);else{if("text"===e.type)return document.createTextNode(e.content);if(t=document.createElement(e.tag),a(t,e.attrs),e.renderer)return e.renderer.render(t,{attrs:e.attrs,children:e.children}),t;for(let n=0,s=e.children.length;n<s;++n)i(e.children[n],t)}return t}function n(e,t,r){if(t===r)return;let o=p(e,t),a=t.slice(),h=e.firstChild,c=r.length;for(let s=0;s<c;++s){if(s>=a.length){i(r[s],e);continue}let t=a[s],c=r[s];if(t===c){h=h.nextSibling;continue}if("text"===t.type&&"text"===c.type){h.textContent!==c.content&&(h.textContent=c.content),h=h.nextSibling;continue}if("text"===t.type||"text"===c.type){d.insert(a,s,c),i(c,e,h);continue}if(!t.renderer!=!c.renderer){d.insert(a,s,c),i(c,e,h);continue}let u=c.attrs.key;if(u&&u in o){let i=o[u];i.vNode!==t&&(d.move(a,a.indexOf(i.vNode,s+1),s),e.insertBefore(i.element,h),t=i.vNode,h=i.element)}if(t===c){h=h.nextSibling;continue}let m=t.attrs.key;m&&m!==u?(d.insert(a,s,c),i(c,e,h)):t.tag===c.tag?(l(h,t.attrs,c.attrs),c.renderer?c.renderer.render(h,{attrs:c.attrs,children:c.children}):n(h,t.children,c.children),h=h.nextSibling):(d.insert(a,s,c),i(c,e,h))}s(e,a,c,!0)}function s(e,t,i,n){for(let r=t.length-1;r>=i;--r){const i=t[r],o=n?e.lastChild:e.childNodes[r];"text"===i.type||(i.renderer&&i.renderer.unrender?i.renderer.unrender(o,{attrs:i.attrs,children:i.children}):s(o,i.children,0,!1)),n&&e.removeChild(o)}}e.hostMap=new WeakMap,o(t,"asContentArray"),e.asContentArray=t,o(i,"createDOMNode"),e.createDOMNode=i,o(n,"updateContent"),e.updateContent=n,o(s,"removeContent");const r={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function a(e,t){for(let i in t)i in r||("on"===i.substr(0,2)?e[i]=t[i]:e.setAttribute(i,t[i]));void 0!==t.className&&e.setAttribute("class",t.className),void 0!==t.htmlFor&&e.setAttribute("for",t.htmlFor),t.dataset&&h(e,t.dataset),t.style&&u(e,t.style)}function l(e,t,i){if(t===i)return;let n;for(n in t)n in r||n in i||("on"===n.substr(0,2)?e[n]=null:e.removeAttribute(n));for(n in i)n in r||t[n]===i[n]||("on"===n.substr(0,2)?e[n]=i[n]:e.setAttribute(n,i[n]));t.className!==i.className&&(void 0!==i.className?e.setAttribute("class",i.className):e.removeAttribute("class")),t.htmlFor!==i.htmlFor&&(void 0!==i.htmlFor?e.setAttribute("for",i.htmlFor):e.removeAttribute("for")),t.dataset!==i.dataset&&c(e,t.dataset||{},i.dataset||{}),t.style!==i.style&&m(e,t.style||{},i.style||{})}function h(e,t){for(let i in t)e.setAttribute(`data-${i}`,t[i])}function c(e,t,i){for(let n in t)n in i||e.removeAttribute(`data-${n}`);for(let n in i)t[n]!==i[n]&&e.setAttribute(`data-${n}`,i[n])}function u(e,t){let i,n=e.style;for(i in t)n[i]=t[i]}function m(e,t,i){let n,s=e.style;for(n in t)n in i||(s[n]="");for(n in i)t[n]!==i[n]&&(s[n]=i[n])}function p(e,t){let i=e.firstChild,n=Object.create(null);for(let s of t)"element"===s.type&&s.attrs.key&&(n[s.attrs.key]={vNode:s,element:i}),i=i.nextSibling;return n}o(a,"addAttrs"),o(l,"updateAttrs"),o(h,"addDataset"),o(c,"updateDataset"),o(u,"addStyle"),o(m,"updateStyle"),o(p,"collectKeys")}(pe||(pe={}));const ge=class _BoxSizer{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}};o(ge,"BoxSizer");let fe=ge;var _e;!function(e){function t(e,t){let i=e.length;if(0===i)return t;let n=0,s=0,r=0,o=0,a=0;for(let h=0;h<i;++h){let t=e[h],i=t.minSize,d=t.maxSize,l=t.sizeHint;t.done=!1,t.size=Math.max(i,Math.min(l,d)),r+=t.size,n+=i,s+=d,t.stretch>0&&(o+=t.stretch,a++)}if(t===r)return 0;if(t<=n){for(let t=0;t<i;++t){let i=e[t];i.size=i.minSize}return t-n}if(t>=s){for(let t=0;t<i;++t){let i=e[t];i.size=i.maxSize}return t-s}let d=.01,l=i;if(t<r){let n=r-t;for(;a>0&&n>d;){let t=n,s=o;for(let r=0;r<i;++r){let i=e[r];if(i.done||0===i.stretch)continue;let d=i.stretch*t/s;i.size-d<=i.minSize?(n-=i.size-i.minSize,o-=i.stretch,i.size=i.minSize,i.done=!0,l--,a--):(n-=d,i.size-=d)}}for(;l>0&&n>d;){let t=n/l;for(let s=0;s<i;++s){let i=e[s];i.done||(i.size-t<=i.minSize?(n-=i.size-i.minSize,i.size=i.minSize,i.done=!0,l--):(n-=t,i.size-=t))}}}else{let n=t-r;for(;a>0&&n>d;){let t=n,s=o;for(let r=0;r<i;++r){let i=e[r];if(i.done||0===i.stretch)continue;let d=i.stretch*t/s;i.size+d>=i.maxSize?(n-=i.maxSize-i.size,o-=i.stretch,i.size=i.maxSize,i.done=!0,l--,a--):(n-=d,i.size+=d)}}for(;l>0&&n>d;){let t=n/l;for(let s=0;s<i;++s){let i=e[s];i.done||(i.size+t>=i.maxSize?(n-=i.maxSize-i.size,i.size=i.maxSize,i.done=!0,l--):(n-=t,i.size+=t))}}}return 0}function i(e,t,i){0!==e.length&&0!==i&&(i>0?n(e,t,i):s(e,t,-i))}function n(e,t,i){let n=0;for(let a=0;a<=t;++a){let t=e[a];n+=t.maxSize-t.size}let s=0;for(let a=t+1,d=e.length;a<d;++a){let t=e[a];s+=t.size-t.minSize}let r=i=Math.min(i,n,s);for(let a=t;a>=0&&r>0;--a){let t=e[a],i=t.maxSize-t.size;i>=r?(t.sizeHint=t.size+r,r=0):(t.sizeHint=t.size+i,r-=i)}let o=i;for(let a=t+1,d=e.length;a<d&&o>0;++a){let t=e[a],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}function s(e,t,i){let n=0;for(let a=t+1,d=e.length;a<d;++a){let t=e[a];n+=t.maxSize-t.size}let s=0;for(let a=0;a<=t;++a){let t=e[a];s+=t.size-t.minSize}let r=i=Math.min(i,n,s);for(let a=t+1,d=e.length;a<d&&r>0;++a){let t=e[a],i=t.maxSize-t.size;i>=r?(t.sizeHint=t.size+r,r=0):(t.sizeHint=t.size+i,r-=i)}let o=i;for(let a=t;a>=0&&o>0;--a){let t=e[a],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}o(t,"calc"),e.calc=t,o(i,"adjust"),e.adjust=i,o(n,"growSizer"),o(s,"shrinkSizer")}(_e||(_e={}));const ve=class _Title{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new S(this),this._isDisposed=!1,this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon&&(this._icon=e.icon),void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,S.clearData(this))}};o(ve,"Title");let be=ve;const ye=class _Widget{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new S(this),this._hiddenMode=_Widget.HiddenMode.Display,this.node=xe.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(_Widget.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&_Widget.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),S.clearData(this),ee.clearData(this),ie.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(_Widget.Flag.IsDisposed)}get isAttached(){return this.testFlag(_Widget.Flag.IsAttached)}get isHidden(){return this.testFlag(_Widget.Flag.IsHidden)}get isVisible(){let e=this;do{if(e.isHidden||!e.isAttached)return!1;e=e.parent}while(null!=e);return!0}get title(){return xe.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==_Widget.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let e=new _Widget.ChildMessage("child-removed",this);ee.sendMessage(this._parent,e)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let e=new _Widget.ChildMessage("child-added",this);ee.sendMessage(this._parent,e)}this.isDisposed||ee.sendMessage(this,_Widget.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(_Widget.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}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){ee.postMessage(this,_Widget.Msg.UpdateRequest)}fit(){ee.postMessage(this,_Widget.Msg.FitRequest)}activate(){ee.postMessage(this,_Widget.Msg.ActivateRequest)}close(){ee.sendMessage(this,_Widget.Msg.CloseRequest)}show(){if(this.testFlag(_Widget.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||ee.sendMessage(this,_Widget.Msg.BeforeShow),this.clearFlag(_Widget.Flag.IsHidden),this._toggleHidden(!1),!this.isAttached||this.parent&&!this.parent.isVisible||ee.sendMessage(this,_Widget.Msg.AfterShow),this.parent)){let e=new _Widget.ChildMessage("child-shown",this);ee.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(_Widget.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||ee.sendMessage(this,_Widget.Msg.BeforeHide),this.setFlag(_Widget.Flag.IsHidden),this._toggleHidden(!0),!this.isAttached||this.parent&&!this.parent.isVisible||ee.sendMessage(this,_Widget.Msg.AfterHide),this.parent)){let e=new _Widget.ChildMessage("child-hidden",this);ee.sendMessage(this.parent,e)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return 0!==(this._flags&e)}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(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(_Widget.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(_Widget.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(_Widget.Flag.IsVisible),this.setFlag(_Widget.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(_Widget.Flag.IsVisible),this.clearFlag(_Widget.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)}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&_Widget.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case _Widget.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case _Widget.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case _Widget.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1"}else switch(this._hiddenMode){case _Widget.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case _Widget.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case _Widget.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex=""}}};o(ye,"Widget");let we=ye;var xe;!function(e){var t,i,n;(t=e.HiddenMode||(e.HiddenMode={}))[t.Display=0]="Display",t[t.Scale=1]="Scale",t[t.ContentVisibility=2]="ContentVisibility",(i=e.Flag||(e.Flag={}))[i.IsDisposed=1]="IsDisposed",i[i.IsAttached=2]="IsAttached",i[i.IsHidden=4]="IsHidden",i[i.IsVisible=8]="IsVisible",i[i.DisallowLayout=16]="DisallowLayout",(n=e.Msg||(e.Msg={})).BeforeShow=new Z("before-show"),n.AfterShow=new Z("after-show"),n.BeforeHide=new Z("before-hide"),n.AfterHide=new Z("after-hide"),n.BeforeAttach=new Z("before-attach"),n.AfterAttach=new Z("after-attach"),n.BeforeDetach=new Z("before-detach"),n.AfterDetach=new Z("after-detach"),n.ParentChanged=new Z("parent-changed"),n.UpdateRequest=new J("update-request"),n.FitRequest=new J("fit-request"),n.ActivateRequest=new J("activate-request"),n.CloseRequest=new J("close-request");const s=class _ChildMessage extends Z{constructor(e,t){super(e),this.child=t}};o(s,"ChildMessage");let r=s;e.ChildMessage=r;const a=class _ResizeMessage extends Z{constructor(e,t){super("resize"),this.width=e,this.height=t}};o(a,"ResizeMessage");let d=a;var l;function h(t,i,n=null){if(t.parent)throw new Error("Cannot attach a child widget.");if(t.isAttached||t.node.isConnected)throw new Error("Widget is already attached.");if(!i.isConnected)throw new Error("Host is not attached.");ee.sendMessage(t,e.Msg.BeforeAttach),i.insertBefore(t.node,n),ee.sendMessage(t,e.Msg.AfterAttach)}function c(t){if(t.parent)throw new Error("Cannot detach a child widget.");if(!t.isAttached||!t.node.isConnected)throw new Error("Widget is not attached.");ee.sendMessage(t,e.Msg.BeforeDetach),t.node.parentNode.removeChild(t.node),ee.sendMessage(t,e.Msg.AfterDetach)}e.ResizeMessage=d,(l=d=e.ResizeMessage||(e.ResizeMessage={})).UnknownSize=new l(-1,-1),o(h,"attach"),e.attach=h,o(c,"detach"),e.detach=c}(we||(we={})),function(e){function t(e){return e.node||document.createElement(e.tag||"div")}e.titleProperty=new ie({name:"title",create:o(e=>new be({owner:e}),"create")}),o(t,"createNode"),e.createNode=t}(xe||(xe={}));const Me=class _Layout{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,S.clearData(this),ie.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}}init(){for(const e of this)e.parent=this.parent}onResize(e){for(const t of this)ee.sendMessage(t,we.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const t of this)ee.sendMessage(t,we.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)ee.sendMessage(t,e)}onAfterAttach(e){for(const t of this)ee.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)ee.sendMessage(t,e)}onAfterDetach(e){for(const t of this)ee.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||ee.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||ee.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||ee.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||ee.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}};o(Me,"Layout");let Ce=Me;!function(e){function t(e){return Ie.horizontalAlignmentProperty.get(e)}function i(e,t){Ie.horizontalAlignmentProperty.set(e,t)}function n(e){return Ie.verticalAlignmentProperty.get(e)}function s(e,t){Ie.verticalAlignmentProperty.set(e,t)}o(t,"getHorizontalAlignment"),e.getHorizontalAlignment=t,o(i,"setHorizontalAlignment"),e.setHorizontalAlignment=i,o(n,"getVerticalAlignment"),e.getVerticalAlignment=n,o(s,"setVerticalAlignment"),e.setVerticalAlignment=s}(Ce||(Ce={}));const Ae=class _LayoutItem{constructor(e){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=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=R.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,i,n){let s=Math.max(this._minWidth,Math.min(i,this._maxWidth)),r=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(s<i)switch(Ce.getHorizontalAlignment(this.widget)){case"left":break;case"center":e+=(i-s)/2;break;case"right":e+=i-s;break;default:throw"unreachable"}if(r<n)switch(Ce.getVerticalAlignment(this.widget)){case"top":break;case"center":t+=(n-r)/2;break;case"bottom":t+=n-r;break;default:throw"unreachable"}let o=!1,a=this.widget.node.style;if(this._top!==t&&(this._top=t,a.top=`${t}px`),this._left!==e&&(this._left=e,a.left=`${e}px`),this._width!==s&&(o=!0,this._width=s,a.width=`${s}px`),this._height!==r&&(o=!0,this._height=r,a.height=`${r}px`),o){let e=new we.ResizeMessage(s,r);ee.sendMessage(this.widget,e)}}};o(Ae,"LayoutItem");let Se=Ae;var Ie;!function(e){function t(e){e.parent&&e.parent.layout&&e.parent.update()}e.horizontalAlignmentProperty=new ie({name:"horizontalAlignment",create:o(()=>"center","create"),changed:t}),e.verticalAlignmentProperty=new ie({name:"verticalAlignment",create:o(()=>"top","create"),changed:t}),o(t,"onAlignmentChanged")}(Ie||(Ie={}));const ze=class _PanelLayout extends Ce{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let i=this._widgets.indexOf(t),n=Math.max(0,Math.min(e,this._widgets.length));if(-1===i)return d.insert(this._widgets,n,t),void(this.parent&&this.attachWidget(n,t));n===this._widgets.length&&n--,i!==n&&(d.move(this._widgets,i,n),this.parent&&this.moveWidget(i,n,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=d.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(const t of this)this.attachWidget(e++,t)}attachWidget(e,t){let i=this.parent.node.children[e];this.parent.isAttached&&ee.sendMessage(t,we.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,i),this.parent.isAttached&&ee.sendMessage(t,we.Msg.AfterAttach)}moveWidget(e,t,i){this.parent.isAttached&&ee.sendMessage(i,we.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&ee.sendMessage(i,we.Msg.AfterDetach);let n=this.parent.node.children[t];this.parent.isAttached&&ee.sendMessage(i,we.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&ee.sendMessage(i,we.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&ee.sendMessage(t,we.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ee.sendMessage(t,we.Msg.AfterDetach)}};o(ze,"PanelLayout");let ke=ze;var Ee;!function(e){function t(e){return Math.max(0,Math.floor(e))}o(t,"clampDimension"),e.clampDimension=t}(Ee||(Ee={}));var Te=Ee;const Le=class _SplitLayout extends ke{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,void 0!==e.orientation&&(this._orientation=e.orientation),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=Ee.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=Ee.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(e=>e.size)}relativeSizes(){return Be.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let i=this._sizers.length,n=e.slice(0,i);for(;n.length<i;)n.push(0);let s=Be.normalize(n);for(let r=0;r<i;++r){let e=this._sizers[r];e.sizeHint=s[r],e.size=s[r]}this._hasNormedSizes=!0,t&&this.parent&&this.parent.update()}moveHandle(e,t){let i,n=this._handles[e];if(n&&!n.classList.contains("lm-mod-hidden")&&(i="horizontal"===this._orientation?t-n.offsetLeft:t-n.offsetTop,0!==i)){for(let e of this._sizers)e.size>0&&(e.sizeHint=e.size);_e.adjust(this._sizers,e,i),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let i=new Se(t),n=Be.createHandle(this.renderer),s=Be.averageSize(this._sizers),r=Be.createSizer(s);d.insert(this._items,e,i),d.insert(this._sizers,e,r),d.insert(this._handles,e,n),this.parent.isAttached&&ee.sendMessage(t,we.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(n),this.parent.isAttached&&ee.sendMessage(t,we.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){d.move(this._items,e,t),d.move(this._sizers,e,t),d.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let i=d.removeAt(this._items,e),n=d.removeAt(this._handles,e);d.removeAt(this._sizers,e),this.parent.isAttached&&ee.sendMessage(t,we.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(n),this.parent.isAttached&&ee.sendMessage(t,we.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,i,n,s,r,o){const a=this._items[e];if(a.isHidden)return;let d=this._handles[e].style;t?(i+=this.widgetOffset,a.update(i,n,o,s),i+=o,d.top=`${n}px`,d.left=`${i}px`,d.width=`${this._spacing}px`,d.height=`${s}px`):(n+=this.widgetOffset,a.update(i,n,r,o),n+=o,d.top=`${n}px`,d.left=`${i}px`,d.width=`${r}px`,d.height=`${this._spacing}px`)}_fit(){let e=0,t=-1;for(let a=0,d=this._items.length;a<d;++a)this._items[a].isHidden?this._handles[a].classList.add("lm-mod-hidden"):(this._handles[a].classList.remove("lm-mod-hidden"),t=a,e++);-1!==t&&this._handles[t].classList.add("lm-mod-hidden"),this._fixed=this._spacing*Math.max(0,e-1)+this.widgetOffset*this._items.length;let i="horizontal"===this._orientation,n=i?this._fixed:0,s=i?0:this._fixed;for(let a=0,d=this._items.length;a<d;++a){let e=this._items[a],t=this._sizers[a];t.size>0&&(t.sizeHint=t.size),e.isHidden?(t.minSize=0,t.maxSize=0):(e.fit(),t.stretch=_SplitLayout.getStretch(e.widget),i?(t.minSize=e.minWidth,t.maxSize=e.maxWidth,n+=e.minWidth,s=Math.max(s,e.minHeight)):(t.minSize=e.minHeight,t.maxSize=e.maxHeight,s+=e.minHeight,n=Math.max(n,e.minWidth)))}let r=this._box=R.boxSizing(this.parent.node);n+=r.horizontalSum,s+=r.verticalSum;let o=this.parent.node.style;o.minWidth=`${n}px`,o.minHeight=`${s}px`,this._dirty=!0,this.parent.parent&&ee.sendMessage(this.parent.parent,we.Msg.FitRequest),this._dirty&&ee.sendMessage(this.parent,we.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let i=0;for(let h=0,c=this._items.length;h<c;++h)i+=+!this._items[h].isHidden;if(0===i&&0===this.widgetOffset)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=R.boxSizing(this.parent.node));let n=this._box.paddingTop,s=this._box.paddingLeft,r=e-this._box.horizontalSum,o=t-this._box.verticalSum,a=0,d=0,l="horizontal"===this._orientation;if(i>0){let e;if(e=l?Math.max(0,r-this._fixed):Math.max(0,o-this._fixed),this._hasNormedSizes){for(let t of this._sizers)t.sizeHint*=e;this._hasNormedSizes=!1}let t=_e.calc(this._sizers,e);if(t>0)switch(this._alignment){case"start":break;case"center":a=0,d=t/2;break;case"end":a=0,d=t;break;case"justify":a=t/i,d=0;break;default:throw"unreachable"}}for(let h=0,c=this._items.length;h<c;++h){const e=this._items[h].isHidden?0:this._sizers[h].size+a;this.updateItemPosition(h,l,l?s+d:s,l?n:n+d,o,r,e);const t=this.widgetOffset+(this._handles[h].classList.contains("lm-mod-hidden")?0:this._spacing);l?s+=e+t:n+=e+t}}};o(Le,"SplitLayout");let De=Le;var Be;!function(e){function t(e){return Be.stretchProperty.get(e)}function i(e,t){Be.stretchProperty.set(e,t)}o(t,"getStretch"),e.getStretch=t,o(i,"setStretch"),e.setStretch=i}(De||(De={})),function(e){function t(e){let t=new fe;return t.sizeHint=Math.floor(e),t}function i(e){let t=e.createHandle();return t.style.position="absolute",t.style.contain="style",t}function n(e){return e.reduce((e,t)=>e+t.size,0)/e.length||0}function s(e){let t=e.length;if(0===t)return[];let i=e.reduce((e,t)=>e+Math.abs(t),0);return 0===i?e.map(e=>1/t):e.map(e=>e/i)}function r(e){e.parent&&e.parent.layout instanceof De&&e.parent.fit()}e.stretchProperty=new ie({name:"stretch",create:o(()=>0,"create"),coerce:o((e,t)=>Math.max(0,Math.floor(t)),"coerce"),changed:r}),o(t,"createSizer"),e.createSizer=t,o(i,"createHandle"),e.createHandle=i,o(n,"averageSize"),e.averageSize=n,o(s,"normalize"),e.normalize=s,o(r,"onChildSizingChanged")}(Be||(Be={}));const Re=class _AccordionLayout extends De{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=Te.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){const i=this._titles[e],n=i.classList.contains("lm-mod-expanded"),s=We.createTitle(this.renderer,t.title,n);this._titles[e]=s,this.parent.node.replaceChild(s,i)}insertWidget(e,t){t.id||(t.id=`id-${x.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const i=We.createTitle(this.renderer,t.title);d.insert(this._titles,e,i),this.parent.node.appendChild(i),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",i.id),super.attachWidget(e,t)}moveWidget(e,t,i){d.move(this._titles,e,t),super.moveWidget(e,t,i)}detachWidget(e,t){const i=d.removeAt(this._titles,e);this.parent.node.removeChild(i),super.detachWidget(e,t)}updateItemPosition(e,t,i,n,s,r,o){const a=this._titles[e].style;a.top=`${n}px`,a.left=`${i}px`,a.height=`${this.widgetOffset}px`,a.width=t?`${s}px`:`${r}px`,super.updateItemPosition(e,t,i,n,s,r,o)}};o(Re,"AccordionLayout");let Pe=Re;var We;!function(e){function t(e,t,i=!0){const n=e.createSectionTitle(t);return n.style.position="absolute",n.style.contain="strict",n.setAttribute("aria-label",`${t.label} Section`),n.setAttribute("aria-expanded",i?"true":"false"),n.setAttribute("aria-controls",t.owner.id),i&&n.classList.add("lm-mod-expanded"),n}o(t,"createTitle"),e.createTitle=t}(We||(We={}));const He=class _Panel extends we{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=Oe.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}};o(He,"Panel");let Ne=He;var Oe;!function(e){function t(e){return e.layout||new ke}o(t,"createLayout"),e.createLayout=t}(Oe||(Oe={}));let Fe=(o(i=class extends Ne{constructor(e={}){super({layout:qe.createLayout(e)}),this._handleMoved=new S(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()}_evtPointerDown(e){if(0!==e.button)return;let t,i=this.layout,n=d.findFirstIndex(i.handles,t=>t.contains(e.target));if(-1===n)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let s=i.handles[n],r=s.getBoundingClientRect();t="horizontal"===i.orientation?e.clientX-r.left:e.clientY-r.top;let o=window.getComputedStyle(s),a=re.overrideCursor(o.cursor);this._pressData={index:n,delta:t,override:a}}_evtPointerMove(e){let t;e.preventDefault(),e.stopPropagation();let i=this.layout,n=this.node.getBoundingClientRect();t="horizontal"===i.orientation?e.clientX-n.left-this._pressData.delta:e.clientY-n.top-this._pressData.delta,i.moveHandle(this._pressData.index,t)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}},"SplitPanel"),i);var qe;!function(e){const t=class _Renderer{createHandle(){let e=document.createElement("div");return e.className="lm-SplitPanel-handle",e}};o(t,"Renderer");let i=t;function n(e){return De.getStretch(e)}function s(e,t){De.setStretch(e,t)}e.Renderer=i,e.defaultRenderer=new i,o(n,"getStretch"),e.getStretch=n,o(s,"setStretch"),e.setStretch=s}(Fe||(Fe={})),function(e){function t(e){return e.layout||new De({renderer:e.renderer||Fe.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing})}o(t,"createLayout"),e.createLayout=t}(qe||(qe={}));const Ke=class _AccordionPanel extends Fe{constructor(e={}){super({...e,layout:Ve.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new S(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){const t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){const t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e)}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){const t=d.findFirstIndex(this.widgets,t=>t.contains(e.owner));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){const t=this.layout,i=t.widgets[e];if(!i)return;const n=i.isHidden,s=t.absoluteSizes(),r=(n?-1:1)*this.spacing,o=s.reduce((e,t)=>e+t);let a=[...s];if(n){const t=this._widgetSizesCache.get(i);if(!t)return;a[e]+=t;const n=a.map(e=>e-t>0).lastIndexOf(!0);-1===n?a.forEach((i,n)=>{n!==e&&(a[n]-=s[n]/o*(t-r))}):a[n]-=t-r}else{const t=s[e];this._widgetSizesCache.set(i,t),a[e]=0;const n=a.map(e=>e>0).lastIndexOf(!0);if(-1===n)return;a[n]=s[n]+t+r}return a.map(e=>e/(o+r))}_evtClick(e){const t=e.target;if(t){const i=d.findFirstIndex(this.titles,e=>e.contains(t));i>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(i))}}_eventKeyDown(e){if(e.defaultPrevented)return;const t=e.target;let i=!1;if(t){const n=d.findFirstIndex(this.titles,e=>e.contains(t));if(n>=0){const s=e.keyCode.toString();if(e.key.match(/Space|Enter/)||s.match(/13|32/))t.click(),i=!0;else if("horizontal"===this.orientation?e.key.match(/ArrowLeft|ArrowRight/)||s.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||s.match(/38|40/)){const t=e.key.match(/ArrowLeft|ArrowUp/)||s.match(/37|38/)?-1:1,r=this.titles.length,o=(n+r+t)%r;this.titles[o].focus(),i=!0}else"End"===e.key||"35"===s?(this.titles[this.titles.length-1].focus(),i=!0):"Home"!==e.key&&"36"!==s||(this.titles[0].focus(),i=!0)}i&&e.preventDefault()}}_toggleExpansion(e){const t=this.titles[e],i=this.layout.widgets[e],n=this._computeWidgetSize(e);n&&this.setRelativeSizes(n,!1),i.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),i.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),i.hide()),this._expansionToggled.emit(e)}};o(Ke,"AccordionPanel");let $e=Ke;var Ve;!function(e){const t=class _Renderer extends Fe.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++_Renderer._nInstance}createCollapseIcon(e){return document.createElement("span")}createSectionTitle(e){const t=document.createElement("h3");t.setAttribute("tabindex","0"),t.id=this.createTitleKey(e),t.className=this.titleClassName;for(const n in e.dataset)t.dataset[n]=e.dataset[n];t.appendChild(this.createCollapseIcon(e)).className="lm-AccordionPanel-titleCollapser";const i=t.appendChild(document.createElement("span"));return i.className="lm-AccordionPanel-titleLabel",i.textContent=e.label,i.title=e.caption||e.label,t}createTitleKey(e){let t=this._titleKeys.get(e);return void 0===t&&(t=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(e,t)),t}};o(t,"Renderer");let i=t;i._nInstance=0,e.Renderer=i,e.defaultRenderer=new i}($e||($e={})),function(e){function t(e){return e.layout||new Pe({renderer:e.renderer||$e.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing,titleSpace:e.titleSpace})}o(t,"createLayout"),e.createLayout=t}(Ve||(Ve={}));const Ue=class _BoxLayout extends ke{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==e.direction&&(this._direction=e.direction),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=Te.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=Te.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){d.insert(this._items,e,new Se(t)),d.insert(this._sizers,e,new fe),this.parent.isAttached&&ee.sendMessage(t,we.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&ee.sendMessage(t,we.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){d.move(this._items,e,t),d.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let i=d.removeAt(this._items,e);d.removeAt(this._sizers,e),this.parent.isAttached&&ee.sendMessage(t,we.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ee.sendMessage(t,we.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let o=0,a=this._items.length;o<a;++o)e+=+!this._items[o].isHidden;this._fixed=this._spacing*Math.max(0,e-1);let t=Ye.isHorizontal(this._direction),i=t?this._fixed:0,n=t?0:this._fixed;for(let o=0,a=this._items.length;o<a;++o){let e=this._items[o],s=this._sizers[o];e.isHidden?(s.minSize=0,s.maxSize=0):(e.fit(),s.sizeHint=_BoxLayout.getSizeBasis(e.widget),s.stretch=_BoxLayout.getStretch(e.widget),t?(s.minSize=e.minWidth,s.maxSize=e.maxWidth,i+=e.minWidth,n=Math.max(n,e.minHeight)):(s.minSize=e.minHeight,s.maxSize=e.maxHeight,n+=e.minHeight,i=Math.max(i,e.minWidth)))}let s=this._box=R.boxSizing(this.parent.node);i+=s.horizontalSum,n+=s.verticalSum;let r=this.parent.node.style;r.minWidth=`${i}px`,r.minHeight=`${n}px`,this._dirty=!0,this.parent.parent&&ee.sendMessage(this.parent.parent,we.Msg.FitRequest),this._dirty&&ee.sendMessage(this.parent,we.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let i=0;for(let h=0,c=this._items.length;h<c;++h)i+=+!this._items[h].isHidden;if(0===i)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=R.boxSizing(this.parent.node));let n,s=this._box.paddingTop,r=this._box.paddingLeft,o=e-this._box.horizontalSum,a=t-this._box.verticalSum;switch(this._direction){case"left-to-right":n=_e.calc(this._sizers,Math.max(0,o-this._fixed));break;case"top-to-bottom":n=_e.calc(this._sizers,Math.max(0,a-this._fixed));break;case"right-to-left":n=_e.calc(this._sizers,Math.max(0,o-this._fixed)),r+=o;break;case"bottom-to-top":n=_e.calc(this._sizers,Math.max(0,a-this._fixed)),s+=a;break;default:throw"unreachable"}let d=0,l=0;if(n>0)switch(this._alignment){case"start":break;case"center":d=0,l=n/2;break;case"end":d=0,l=n;break;case"justify":d=n/i,l=0;break;default:throw"unreachable"}for(let h=0,c=this._items.length;h<c;++h){let e=this._items[h];if(e.isHidden)continue;let t=this._sizers[h].size;switch(this._direction){case"left-to-right":e.update(r+l,s,t+d,a),r+=t+d+this._spacing;break;case"top-to-bottom":e.update(r,s+l,o,t+d),s+=t+d+this._spacing;break;case"right-to-left":e.update(r-l-t-d,s,t+d,a),r-=t+d+this._spacing;break;case"bottom-to-top":e.update(r,s-l-t-d,o,t+d),s-=t+d+this._spacing;break;default:throw"unreachable"}}}};o(Ue,"BoxLayout");let je=Ue;var Ye;!function(e){function t(e){return Ye.stretchProperty.get(e)}function i(e,t){Ye.stretchProperty.set(e,t)}function n(e){return Ye.sizeBasisProperty.get(e)}function s(e,t){Ye.sizeBasisProperty.set(e,t)}o(t,"getStretch"),e.getStretch=t,o(i,"setStretch"),e.setStretch=i,o(n,"getSizeBasis"),e.getSizeBasis=n,o(s,"setSizeBasis"),e.setSizeBasis=s}(je||(je={})),function(e){function t(e){return"left-to-right"===e||"right-to-left"===e}function i(e){return Math.max(0,Math.floor(e))}function n(e){e.parent&&e.parent.layout instanceof je&&e.parent.fit()}e.stretchProperty=new ie({name:"stretch",create:o(()=>0,"create"),coerce:o((e,t)=>Math.max(0,Math.floor(t)),"coerce"),changed:n}),e.sizeBasisProperty=new ie({name:"sizeBasis",create:o(()=>0,"create"),coerce:o((e,t)=>Math.max(0,Math.floor(t)),"coerce"),changed:n}),o(t,"isHorizontal"),e.isHorizontal=t,o(i,"clampSpacing"),e.clampSpacing=i,o(n,"onChildSizingChanged")}(Ye||(Ye={}));const Xe=class _BoxPanel extends Ne{constructor(e={}){super({layout:Ze.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}};o(Xe,"BoxPanel");let Ge=Xe;var Ze;!function(e){function t(e){return je.getStretch(e)}function i(e,t){je.setStretch(e,t)}function n(e){return je.getSizeBasis(e)}function s(e,t){je.setSizeBasis(e,t)}o(t,"getStretch"),e.getStretch=t,o(i,"setStretch"),e.setStretch=i,o(n,"getSizeBasis"),e.getSizeBasis=n,o(s,"setSizeBasis"),e.setSizeBasis=s}(Xe||(Ge={})),function(e){function t(e){return e.layout||new je(e)}o(t,"createLayout"),e.createLayout=t}(Ze||(Ze={}));const Qe=class _CommandPalette extends we{constructor(e){super({node:et.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(we.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||_CommandPalette.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=et.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map(e=>et.createItem(this.commands,e));return t.forEach(e=>this._items.push(e)),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){d.removeAt(this._items,e)&&this.refresh()}clearItems(){0!==this._items.length&&(this._items.length=0,this.refresh())}refresh(){if(this._results=null,""!==this.inputNode.value){this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit"}else{this.node.getElementsByClassName("lm-close-icon")[0].style.display="none"}this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}}onBeforeAttach(e){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)}onAfterDetach(e){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)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let e=this.inputNode;e.focus(),e.select()}}onUpdateRequest(e){if(!this.isVisible)return void me.render(null,this.contentNode);let t=this.inputNode.value,i=this.contentNode,n=this._results;if(n||(n=this._results=et.search(this._items,t),this._activeIndex=t?d.findFirstIndex(n,et.canActivate):-1),!t&&0===n.length)return void me.render(null,i);if(t&&0===n.length){let e=this.renderer.renderEmptyMessage({query:t});return void me.render(e,i)}let s=this.renderer,r=this._activeIndex,o=new Array(n.length);for(let a=0,d=n.length;a<d;++a){let e=n[a];if("header"===e.type){let t=e.indices,i=e.category;o[a]=s.renderHeader({category:i,indices:t})}else{let t=e.item,i=e.indices,n=a===r;o[a]=s.renderItem({item:t,indices:i,active:n})}}if(me.render(o,i),r<0||r>=n.length)i.scrollTop=0;else{let e=i.children[r];R.scrollIntoViewIfNeeded(i,e)}}_evtClick(e){if(0!==e.button)return;if(e.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();let t=d.findFirstIndex(this.contentNode.children,t=>t.contains(e.target));-1!==t&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem()}}_activateNextItem(){if(!this._results||0===this._results.length)return;let e=this._activeIndex,t=this._results.length,i=e<t-1?e+1:0,n=0===i?t-1:i-1;this._activeIndex=d.findFirstIndex(this._results,et.canActivate,i,n),this.update()}_activatePreviousItem(){if(!this._results||0===this._results.length)return;let e=this._activeIndex,t=this._results.length,i=e<=0?t-1:e-1,n=i===t-1?0:i+1;this._activeIndex=d.findLastIndex(this._results,et.canActivate,i,n),this.update()}_execute(e){if(!this._results)return;let t=this._results[e];if(t){if("header"===t.type){let e=this.inputNode;return e.value=`${t.category.toLowerCase()} `,e.focus(),void this.refresh()}t.item.isEnabled&&(this.commands.execute(t.item.command,t.item.args),this.inputNode.value="",this.refresh())}}_toggleFocused(){let e=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",e)}_onGenericChange(){this.refresh()}};o(Qe,"CommandPalette");let Je=Qe;var et;!function(e){const t=class _Renderer{renderHeader(e){let t=this.formatHeader(e);return ce.li({className:"lm-CommandPalette-header"},t)}renderItem(e){let t=this.createItemClass(e),i=this.createItemDataset(e);return e.item.isToggleable?ce.li({className:t,dataset:i,role:"menuitemcheckbox","aria-checked":`${e.item.isToggled}`},this.renderItemIcon(e),this.renderItemContent(e),this.renderItemShortcut(e)):ce.li({className:t,dataset:i,role:"menuitem"},this.renderItemIcon(e),this.renderItemContent(e),this.renderItemShortcut(e))}renderEmptyMessage(e){let t=this.formatEmptyMessage(e);return ce.li({className:"lm-CommandPalette-emptyMessage"},t)}renderItemIcon(e){let t=this.createIconClass(e);return ce.div({className:t},e.item.icon,e.item.iconLabel)}renderItemContent(e){return ce.div({className:"lm-CommandPalette-itemContent"},this.renderItemLabel(e),this.renderItemCaption(e))}renderItemLabel(e){let t=this.formatItemLabel(e);return ce.div({className:"lm-CommandPalette-itemLabel"},t)}renderItemCaption(e){let t=this.formatItemCaption(e);return ce.div({className:"lm-CommandPalette-itemCaption"},t)}renderItemShortcut(e){let t=this.formatItemShortcut(e);return ce.div({className:"lm-CommandPalette-itemShortcut"},t)}createItemClass(e){let t="lm-CommandPalette-item";e.item.isEnabled||(t+=" lm-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled"),e.active&&(t+=" lm-mod-active");let i=e.item.className;return i&&(t+=` ${i}`),t}createItemDataset(e){return{...e.item.dataset,command:e.item.command}}createIconClass(e){let t="lm-CommandPalette-itemIcon",i=e.item.iconClass;return i?`${t} ${i}`:t}formatHeader(e){return e.indices&&0!==e.indices.length?h.highlight(e.category,e.indices,ce.mark):e.category}formatEmptyMessage(e){return`No commands found that match '${e.query}'`}formatItemShortcut(e){let t=e.item.keyBinding;return t?V.formatKeystroke(t.keys):null}formatItemLabel(e){return e.indices&&0!==e.indices.length?h.highlight(e.item.label,e.indices,ce.mark):e.item.label}formatItemCaption(e){return e.item.caption}};o(t,"Renderer");let i=t;e.Renderer=i,e.defaultRenderer=new i}(Je||(Je={})),function(e){function t(){let e=document.createElement("div"),t=document.createElement("div"),i=document.createElement("div"),n=document.createElement("input"),s=document.createElement("ul"),r=document.createElement("button");return t.className="lm-CommandPalette-search",i.className="lm-CommandPalette-wrapper",n.className="lm-CommandPalette-input",r.className="lm-close-icon",s.className="lm-CommandPalette-content",s.setAttribute("role","menu"),n.spellcheck=!1,i.appendChild(n),i.appendChild(r),t.appendChild(i),e.appendChild(t),e.appendChild(s),e}function i(e,t){return new f(e,t)}function n(e,t){let i=l(e,t);return i.sort(m),p(i)}function s(e){return"item"===e.type&&e.item.isEnabled}function r(e){return e.trim().replace(/\s+/g," ")}function a(e){return e.replace(/\s+/g,"").toLowerCase()}function l(e,t){t=a(t);let i=[];for(let n=0,s=e.length;n<s;++n){let s=e[n];if(!s.isVisible)continue;if(!t){i.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:s});continue}let r=u(s,t);r&&(s.isEnabled||(r.score+=1e3),i.push(r))}return i}function u(e,t){let i=e.category.toLowerCase(),n=`${i} ${e.label.toLowerCase()}`,s=1/0,r=null,o=/\b\w/g;for(;;){let e=o.exec(n);if(!e)break;let i=h.matchSumOfDeltas(n,t,e.index);if(!i)break;i.score<=s&&(s=i.score,r=i.indices)}if(!r||s===1/0)return null;let a=i.length+1,l=d.lowerBound(r,a,(e,t)=>e-t),c=r.slice(0,l),u=r.slice(l);for(let d=0,h=u.length;d<h;++d)u[d]-=a;return 0===c.length?{matchType:0,categoryIndices:null,labelIndices:u,score:s,item:e}:0===u.length?{matchType:1,categoryIndices:c,labelIndices:null,score:s,item:e}:{matchType:2,categoryIndices:c,labelIndices:u,score:s,item:e}}function m(e,t){let i=e.matchType-t.matchType;if(0!==i)return i;let n=e.score-t.score;if(0!==n)return n;let s=0,r=0;switch(e.matchType){case 0:s=e.labelIndices[0],r=t.labelIndices[0];break;case 1:case 2:s=e.categoryIndices[0],r=t.categoryIndices[0]}if(s!==r)return s-r;let o=e.item.category.localeCompare(t.item.category);if(0!==o)return o;let a=e.item.rank,d=t.item.rank;return a!==d?a<d?-1:1:e.item.label.localeCompare(t.item.label)}function p(e){let t=[];for(let i=0,n=e.length;i<n;++i){let{item:n,categoryIndices:s,labelIndices:r}=e[i],o=n.category;0!==i&&o===e[i-1].item.category||t.push({type:"header",category:o,indices:s}),t.push({type:"item",item:n,indices:r})}return t}o(t,"createNode"),e.createNode=t,o(i,"createItem"),e.createItem=i,o(n,"search"),e.search=n,o(s,"canActivate"),e.canActivate=s,o(r,"normalizeCategory"),o(a,"normalizeQuery"),o(l,"matchItems"),o(u,"fuzzySearch"),o(m,"scoreCmp"),o(p,"createResults");const g=class _CommandItem{constructor(e,t){this._commands=e,this.category=r(t.category),this.command=t.command,this.args=t.args||c.emptyObject,this.rank=void 0!==t.rank?t.rank:1/0}get label(){return this._commands.label(this.command,this.args)}get icon(){return this._commands.icon(this.command,this.args)}get iconClass(){return this._commands.iconClass(this.command,this.args)}get iconLabel(){return this._commands.iconLabel(this.command,this.args)}get caption(){return this._commands.caption(this.command,this.args)}get className(){return this._commands.className(this.command,this.args)}get dataset(){return this._commands.dataset(this.command,this.args)}get isEnabled(){return this._commands.isEnabled(this.command,this.args)}get isToggled(){return this._commands.isToggled(this.command,this.args)}get isToggleable(){return this._commands.isToggleable(this.command,this.args)}get isVisible(){return this._commands.isVisible(this.command,this.args)}get keyBinding(){let{command:e,args:t}=this;return d.findLastValue(this._commands.keyBindings,i=>i.command===e&&c.deepEqual(i.args,t))||null}};o(g,"CommandItem");let f=g}(et||(et={}));const tt=class _Menu extends we{constructor(e){super({node:nt.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new S(this),this._menuRequested=new S(this),this.addClass("lm-Menu"),this.setFlag(we.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||_Menu.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),-1===e||nt.canActivate(this._items[e])||(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,i=t<e-1?t+1:0,n=0===i?e-1:i-1;this.activeIndex=d.findFirstIndex(this._items,nt.canActivate,i,n)}activatePreviousItem(){let e=this._items.length,t=this._activeIndex,i=t<=0?e-1:t-1,n=i===e-1?0:i+1;this.activeIndex=d.findLastIndex(this._items,nt.canActivate,i,n)}triggerActiveItem(){if(!this.isAttached)return;let e=this.activeItem;if(!e)return;if(this._cancelOpenTimer(),this._cancelCloseTimer(),"submenu"===e.type)return void this._openChildMenu(!0);this.rootMenu.close();let{command:t,args:i}=e;this.commands.isEnabled(t,i)?this.commands.execute(t,i):console.log(`Command '${t}' is disabled.`)}addItem(e){return this.insertItem(this._items.length,e)}insertItem(e,t){this.isAttached&&this.close(),this.activeIndex=-1;let i=Math.max(0,Math.min(e,this._items.length)),n=nt.createItem(this,t);return d.insert(this._items,i,n),this.update(),n}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){this.isAttached&&this.close(),this.activeIndex=-1,d.removeAt(this._items,e)&&this.update()}clearItems(){this.isAttached&&this.close(),this.activeIndex=-1,0!==this._items.length&&(this._items.length=0,this.update())}open(e,t,i={}){var n,s,r;if(this.isAttached)return;let o=i.forceX||!1,a=i.forceY||!1;const d=null!==(n=i.host)&&void 0!==n?n:null,l=null!==(s=i.ref)&&void 0!==s?s:null,h=null!==(r=i.horizontalAlignment)&&void 0!==r?r:"rtl"===document.documentElement.dir?"right":"left";nt.openRootMenu(this,e,t,o,a,h,d,l),this.activate()}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mouseup":this._evtMouseUp(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseenter":this._evtMouseEnter(e);break;case"mouseleave":this._evtMouseLeave(e);break;case"mousedown":this._evtMouseDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){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)}onAfterDetach(e){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)}onActivateRequest(e){this.isAttached&&this.node.focus()}onUpdateRequest(e){let t=this._items,i=this.renderer,n=this._activeIndex,s=nt.computeCollapsed(t),r=new Array(t.length);for(let a=0,d=t.length;a<d;++a){let e=t[a],d=a===n,l=s[a];r[a]=i.renderItem({item:e,active:d,collapsed:l,onfocus:o(()=>{this.activeIndex=a},"onfocus")})}me.render(r,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(13===t)return void this.triggerActiveItem();if(27===t)return void this.close();if(37===t)return void(this._parentMenu?this.close():this._menuRequested.emit("previous"));if(38===t)return void this.activatePreviousItem();if(39===t){let e=this.activeItem;return void(e&&"submenu"===e.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next"))}if(40===t)return void this.activateNextItem();let i=N().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,s=nt.findMnemonic(this._items,i,n);-1===s.index||s.multiple?-1!==s.index?this.activeIndex=s.index:-1!==s.auto&&(this.activeIndex=s.auto):(this.activeIndex=s.index,this.triggerActiveItem())}_evtMouseUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=d.findFirstIndex(this.contentNode.children,t=>R.hitTest(t,e.clientX,e.clientY));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();let i=this.activeItem;i&&"submenu"===i.type&&i.submenu&&this._startOpenTimer()}_evtMouseEnter(e){for(let t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu)return void(this.activeIndex=-1);let{clientX:t,clientY:i}=e;R.hitTest(this._childMenu.node,t,i)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}_evtMouseDown(e){this._parentMenu||(nt.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(e=!1){let t=this.activeItem;if(!t||"submenu"!==t.type||!t.submenu)return void this._closeChildMenu();let i=t.submenu;if(i===this._childMenu)return;_Menu.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,ee.sendMessage(this,we.Msg.UpdateRequest);let n=this.contentNode.children[this._activeIndex];nt.openSubmenu(i,n),e&&(i.activeIndex=-1,i.activateNextItem()),i.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},nt.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},nt.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){nt.saveWindowData()}};o(tt,"Menu");let it=tt;var nt;!function(e){const t=class _Renderer{renderItem(e){let t=this.createItemClass(e),i=this.createItemDataset(e),n=this.createItemARIA(e);return ce.li({className:t,dataset:i,tabindex:"0",onfocus:e.onfocus,...n},this.renderIcon(e),this.renderLabel(e),this.renderShortcut(e),this.renderSubmenu(e))}renderIcon(e){let t=this.createIconClass(e);return ce.div({className:t},e.item.icon,e.item.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return ce.div({className:"lm-Menu-itemLabel"},t)}renderShortcut(e){let t=this.formatShortcut(e);return ce.div({className:"lm-Menu-itemShortcut"},t)}renderSubmenu(e){return ce.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(e){let t="lm-Menu-item";e.item.isEnabled||(t+=" lm-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled"),e.item.isVisible||(t+=" lm-mod-hidden"),e.active&&(t+=" lm-mod-active"),e.collapsed&&(t+=" lm-mod-collapsed");let i=e.item.className;return i&&(t+=` ${i}`),t}createItemDataset(e){let t,{type:i,command:n,dataset:s}=e.item;return t="command"===i?{...s,type:i,command:n}:{...s,type:i},t}createIconClass(e){let t="lm-Menu-itemIcon",i=e.item.iconClass;return i?`${t} ${i}`:t}createItemARIA(e){let t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true",e.item.isEnabled||(t["aria-disabled"]="true");break;default:e.item.isEnabled||(t["aria-disabled"]="true"),e.item.isToggled?(t.role="menuitemcheckbox",t["aria-checked"]="true"):t.role="menuitem"}return t}formatLabel(e){let{label:t,mnemonic:i}=e.item;if(i<0||i>=t.length)return t;let n=t.slice(0,i),s=t.slice(i+1),r=t[i];return[n,ce.span({className:"lm-Menu-itemMnemonic"},r),s]}formatShortcut(e){let t=e.item.keyBinding;return t?V.formatKeystroke(t.keys):null}};o(t,"Renderer");let i=t;e.Renderer=i,e.defaultRenderer=new i}(it||(it={})),function(e){e.TIMER_DELAY=300,e.SUBMENU_OVERLAP=3;let t=null,i=0;function n(){return i>0?(i--,t):m()}function s(){t=m(),i++}function r(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-Menu-content",e.appendChild(t),t.setAttribute("role","menu"),e.tabIndex=0,e}function a(e){return"separator"!==e.type&&e.isEnabled&&e.isVisible}function l(e,t){return new v(e.commands,t)}function h(e,t,i){for(let n=e;n;n=n.childMenu)if(R.hitTest(n.node,t,i))return!0;return!1}function u(e){let t=new Array(e.length);d.fill(t,!1);let i=0,n=e.length;for(;i<n;++i){let n=e[i];if(n.isVisible){if("separator"!==n.type)break;t[i]=!0}}let s=n-1;for(;s>=0;--s){let i=e[s];if(i.isVisible){if("separator"!==i.type)break;t[s]=!0}}let r=!1;for(;++i<s;){let n=e[i];n.isVisible&&("separator"!==n.type?r=!1:r?t[i]=!0:r=!0)}return t}function m(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}function p(e,t,i,s,r,o,a,d){const l=n();let h=l.pageXOffset,c=l.pageYOffset,u=l.clientWidth,m=l.clientHeight;ee.sendMessage(e,we.Msg.UpdateRequest);let p=m-(r?i:0),g=e.node,f=g.style;f.opacity="0",f.maxHeight=`${p}px`,we.attach(e,a||document.body,d);let{width:_,height:v}=g.getBoundingClientRect();"right"===o&&(t-=_),!s&&t+_>h+u&&(t=h+u-_),!r&&i+v>c+m&&(i>c+m?i=c+m-v:i-=v),f.transform=`translate(${Math.max(0,t)}px, ${Math.max(0,i)}px`,f.opacity="1"}function g(t,i){const s=n();let r=s.pageXOffset,o=s.pageYOffset,a=s.clientWidth,d=s.clientHeight;ee.sendMessage(t,we.Msg.UpdateRequest);let l=d,h=t.node,c=h.style;c.opacity="0",c.maxHeight=`${l}px`,we.attach(t,document.body);let{width:u,height:m}=h.getBoundingClientRect(),p=R.boxSizing(t.node),g=i.getBoundingClientRect(),f=g.right-e.SUBMENU_OVERLAP;f+u>r+a&&(f=g.left+e.SUBMENU_OVERLAP-u);let _=g.top-p.borderTop-p.paddingTop;_+m>o+d&&(_=g.bottom+p.borderBottom+p.paddingBottom-m),c.transform=`translate(${Math.max(0,f)}px, ${Math.max(0,_)}px`,c.opacity="1"}function f(e,t,i){let n=-1,s=-1,r=!1,o=t.toUpperCase();for(let d=0,l=e.length;d<l;++d){let t=(d+i)%l,h=e[t];if(!a(h))continue;let c=h.label;if(0===c.length)continue;let u=h.mnemonic;u>=0&&u<c.length?c[u].toUpperCase()===o&&(-1===n?n=t:r=!0):-1===s&&c[0].toUpperCase()===o&&(s=t)}return{index:n,multiple:r,auto:s}}o(n,"getWindowData"),o(s,"saveWindowData"),e.saveWindowData=s,o(r,"createNode"),e.createNode=r,o(a,"canActivate"),e.canActivate=a,o(l,"createItem"),e.createItem=l,o(h,"hitTestMenus"),e.hitTestMenus=h,o(u,"computeCollapsed"),e.computeCollapsed=u,o(m,"_getWindowData"),o(p,"openRootMenu"),e.openRootMenu=p,o(g,"openSubmenu"),e.openSubmenu=g,o(f,"findMnemonic"),e.findMnemonic=f;const _=class _MenuItem{constructor(e,t){this._commands=e,this.type=t.type||"command",this.command=t.command||"",this.args=t.args||c.emptyObject,this.submenu=t.submenu||null}get label(){return"command"===this.type?this._commands.label(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.label:""}get mnemonic(){return"command"===this.type?this._commands.mnemonic(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.mnemonic:-1}get icon(){return"command"===this.type?this._commands.icon(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.icon:void 0}get iconClass(){return"command"===this.type?this._commands.iconClass(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconClass:""}get iconLabel(){return"command"===this.type?this._commands.iconLabel(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.iconLabel:""}get caption(){return"command"===this.type?this._commands.caption(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.caption:""}get className(){return"command"===this.type?this._commands.className(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.className:""}get dataset(){return"command"===this.type?this._commands.dataset(this.command,this.args):"submenu"===this.type&&this.submenu?this.submenu.title.dataset:{}}get isEnabled(){return"command"===this.type?this._commands.isEnabled(this.command,this.args):"submenu"!==this.type||null!==this.submenu}get isToggled(){return"command"===this.type&&this._commands.isToggled(this.command,this.args)}get isVisible(){return"command"===this.type?this._commands.isVisible(this.command,this.args):"submenu"!==this.type||null!==this.submenu}get keyBinding(){if("command"===this.type){let{command:e,args:t}=this;return d.findLastValue(this._commands.keyBindings,i=>i.command===e&&c.deepEqual(i.args,t))||null}return null}};o(_,"MenuItem");let v=_}(nt||(nt={}));const st=class _ContextMenu{constructor(e){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;const{groupByTarget:t,sortBySelector:i,...n}=e;this.menu=new it(n),this._groupByTarget=!1!==t,this._sortBySelector=!1!==i}addItem(e){let t=ot.createItem(e,this._idTick++);return this._items.push(t),new k(()=>{d.removeFirstOf(this._items,t)})}open(e){if(it.saveWindowData(),this.menu.clearItems(),0===this._items.length)return!1;let t=ot.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);if(!t||0===t.length)return!1;for(const i of t)this.menu.addItem(i);return this.menu.open(e.clientX,e.clientY),!0}};o(st,"ContextMenu");let rt=st;var ot;!function(e){function t(e,t){let i=n(e.selector),s=void 0!==e.rank?e.rank:1/0;return{...e,selector:i,rank:s,id:t}}function i(e,t,i,n){let o=t.target;if(!o)return null;let a=t.currentTarget;if(!a)return null;if(!a.contains(o)&&(o=document.elementFromPoint(t.clientX,t.clientY),!o||!a.contains(o)))return null;let d=[],l=e.slice();for(;null!==o;){let e=[];for(let t=0,i=l.length;t<i;++t){let i=l[t];i&&(W.matches(o,i.selector)&&(e.push(i),l[t]=null))}if(0!==e.length&&(i&&e.sort(n?r:s),d.push(...e)),o===a)break;o=o.parentElement}return i||d.sort(n?r:s),d}function n(e){if(-1!==e.indexOf(","))throw new Error(`Selector cannot contain commas: ${e}`);if(!W.isValid(e))throw new Error(`Invalid selector: ${e}`);return e}function s(e,t){let i=e.rank,n=t.rank;return i!==n?i<n?-1:1:e.id-t.id}function r(e,t){let i=W.calculateSpecificity(e.selector),n=W.calculateSpecificity(t.selector);return i!==n?n-i:s(e,t)}o(t,"createItem"),e.createItem=t,o(i,"matchItems"),e.matchItems=i,o(n,"validateSelector"),o(s,"itemCmpRank"),o(r,"itemCmp")}(ot||(ot={}));const at=["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End"],dt=class _TabBar extends we{constructor(e={}){super({node:ht.createNode()}),this._currentIndex=-1,this._titles=[],this._titlesEditable=!1,this._previousTitle=null,this._dragData=null,this._addButtonEnabled=!1,this._tabMoved=new S(this),this._currentChanged=new S(this),this._addRequested=new S(this),this._tabCloseRequested=new S(this),this._tabDetachRequested=new S(this),this._tabActivateRequested=new S(this),this.addClass("lm-TabBar"),this.contentNode.setAttribute("role","tablist"),this.setFlag(we.Flag.DisallowLayout),this._document=e.document||document,this.tabsMovable=e.tabsMovable||!1,this.titlesEditable=e.titlesEditable||!1,this.allowDeselect=e.allowDeselect||!1,this.addButtonEnabled=e.addButtonEnabled||!1,this.insertBehavior=e.insertBehavior||"select-tab-if-needed",this.name=e.name||"",this.orientation=e.orientation||"horizontal",this.removeBehavior=e.removeBehavior||"select-tab-after",this.renderer=e.renderer||_TabBar.defaultRenderer}dispose(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,super.dispose()}get currentChanged(){return this._currentChanged}get tabMoved(){return this._tabMoved}get tabActivateRequested(){return this._tabActivateRequested}get addRequested(){return this._addRequested}get tabCloseRequested(){return this._tabCloseRequested}get tabDetachRequested(){return this._tabDetachRequested}get document(){return this._document}get titlesEditable(){return this._titlesEditable}set titlesEditable(e){this._titlesEditable=e}get currentTitle(){return this._titles[this._currentIndex]||null}set currentTitle(e){this.currentIndex=e?this._titles.indexOf(e):-1}get currentIndex(){return this._currentIndex}set currentIndex(e){if((e<0||e>=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,i=this._titles[t]||null,n=e,s=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:n,currentTitle:s})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let i=ht.asTitle(t),n=this._titles.indexOf(i),s=Math.max(0,Math.min(e,this._titles.length));return-1===n?(d.insert(this._titles,s,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(s,i),i):(s===this._titles.length&&s--,n===s||(d.move(this._titles,n,s),this.update(),this._adjustCurrentForMove(n,s)),i)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=d.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(0===this._titles.length)return;this._releaseMouse();for(let i of this._titles)i.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==e&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){var t;let i=this._titles,n=this.renderer,s=this.currentTitle,r=new Array(i.length);const o=null!==(t=this._getCurrentTabindex())&&void 0!==t?t:this._currentIndex>-1?this._currentIndex:0;for(let a=0,d=i.length;a<d;++a){let e=i[a],t=e===s,l=t?d:d-a-1,h=o===a?0:-1;r[a]=n.renderTab({title:e,current:t,zIndex:l,tabIndex:h})}me.render(r,this.contentNode)}_getCurrentTabindex(){let e=null;const t=this.contentNode.querySelector('li[tabindex="0"]');return t?e=[...this.contentNode.children].indexOf(t):this._addButtonEnabled&&"0"===this.addButtonNode.getAttribute("tabindex")&&(e=-1),e}_evtDblClick(e){if(!this.titlesEditable)return;let t=this.contentNode.children,i=d.findFirstIndex(t,t=>R.hitTest(t,e.clientX,e.clientY));if(-1===i)return;let n=this.titles[i],s=t[i].querySelector(".lm-TabBar-tabLabel");if(s&&s.contains(e.target)){let e=n.label||"",t=s.innerHTML;s.innerHTML="";let i=document.createElement("input");i.classList.add("lm-TabBar-tabInput"),i.value=e,s.appendChild(i);let r=o(()=>{i.removeEventListener("blur",r),s.innerHTML=t,this.node.addEventListener("keydown",this)},"onblur");i.addEventListener("dblclick",e=>e.stopPropagation()),i.addEventListener("blur",r),i.addEventListener("keydown",e=>{"Enter"===e.key?(""!==i.value&&(n.label=n.caption=i.value),r()):"Escape"===e.key&&r()}),this.node.removeEventListener("keydown",this),i.select(),i.focus(),s.children.length>0&&s.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),"Escape"===e.key&&this._releaseMouse())}_evtKeyDown(e){var t,i,n;if("Tab"!==e.key&&e.eventPhase!==Event.CAPTURING_PHASE)if("Enter"===e.key||"Spacebar"===e.key||" "===e.key){const t=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(t))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{const i=d.findFirstIndex(this.contentNode.children,e=>e.contains(t));i>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=i)}}else if(at.includes(e.key)){const s=[...this.contentNode.children];if(this.addButtonEnabled&&s.push(this.addButtonNode),s.length<=1)return;e.preventDefault(),e.stopPropagation();let r,o=s.indexOf(document.activeElement);-1===o&&(o=this._currentIndex),"ArrowRight"===e.key&&"horizontal"===this._orientation||"ArrowDown"===e.key&&"vertical"===this._orientation?r=null!==(t=s[o+1])&&void 0!==t?t:s[0]:"ArrowLeft"===e.key&&"horizontal"===this._orientation||"ArrowUp"===e.key&&"vertical"===this._orientation?r=null!==(i=s[o-1])&&void 0!==i?i:s[s.length-1]:"Home"===e.key?r=s[0]:"End"===e.key&&(r=s[s.length-1]),r&&(null===(n=s[o])||void 0===n||n.setAttribute("tabindex","-1"),null==r||r.setAttribute("tabindex","0"),r.focus())}}_evtPointerDown(e){if(0!==e.button&&1!==e.button)return;if(this._dragData)return;if(e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),i=this.contentNode.children,n=d.findFirstIndex(i,t=>R.hitTest(t,e.clientX,e.clientY));if(-1===n&&!t)return;if(e.preventDefault(),e.stopPropagation(),this._dragData={tab:i[n],index:n,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===e.button||t)return;let s=i[n].querySelector(this.renderer.closeIconSelector);s&&s.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.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}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let i=this.contentNode.children;if(t.dragActive||ht.dragExceeded(t,e)){if(!t.dragActive){let e=t.tab.getBoundingClientRect();"horizontal"===this._orientation?(t.tabPos=t.tab.offsetLeft,t.tabSize=e.width,t.tabPressPos=t.pressX-e.left):(t.tabPos=t.tab.offsetTop,t.tabSize=e.height,t.tabPressPos=t.pressY-e.top),t.tabPressOffset={x:t.pressX-e.left,y:t.pressY-e.top},t.tabLayout=ht.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=re.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&ht.detachExceeded(t,e)){t.detachRequested=!0;let n=t.index,s=e.clientX,r=e.clientY,o=i[n],a=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:a,tab:o,clientX:s,clientY:r,offset:t.tabPressOffset}),t.dragAborted)return}ht.layoutTabs(i,t,e,this._orientation)}}_evtPointerUp(e){if(0!==e.button&&1!==e.button)return;const t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target))return void this._addRequested.emit(void 0);let i=this.contentNode.children,n=d.findFirstIndex(i,t=>R.hitTest(t,e.clientX,e.clientY));if(n!==t.index)return;let s=this._titles[n];if(!s.closable)return;if(1===e.button)return void this._tabCloseRequested.emit({index:n,title:s});let r=i[n].querySelector(this.renderer.closeIconSelector);return r&&r.contains(e.target)?void this._tabCloseRequested.emit({index:n,title:s}):void 0}if(0!==e.button)return;ht.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let i=ht.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,ht.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let e=t.index,i=t.targetIndex;-1!==i&&e!==i&&(d.move(this._titles,e,i),this._adjustCurrentForMove(e,i),this._tabMoved.emit({fromIndex:e,toIndex:i,title:this._titles[i]}),ee.sendMessage(this,we.Msg.UpdateRequest))},i)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(ht.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let i=this.currentTitle,n=this._currentIndex,s=this.insertBehavior;if("select-tab"===s||"select-tab-if-needed"===s&&-1===n)return this._currentIndex=e,this._previousTitle=i,void this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:e,currentTitle:t});n>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex<e&&this._currentIndex>=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let i=this._currentIndex,n=this.removeBehavior;if(i===e){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});if("select-tab-after"===n)return this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===n)return this._currentIndex=Math.max(0,e-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-previous-tab"===n)return this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}else i>e&&this._currentIndex--}_onTitleChanged(e){this.update()}};o(dt,"TabBar");let lt=dt;var ht;!function(e){const t=class _Renderer{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++_Renderer._nInstance}renderTab(e){let t=e.title.caption,i=this.createTabKey(e),n=i,s=this.createTabStyle(e),r=this.createTabClass(e),o=this.createTabDataset(e),a=this.createTabARIA(e);return e.title.closable?ce.li({id:n,key:i,className:r,title:t,style:s,dataset:o,...a},this.renderIcon(e),this.renderLabel(e),this.renderCloseIcon(e)):ce.li({id:n,key:i,className:r,title:t,style:s,dataset:o,...a},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){const{title:t}=e;let i=this.createIconClass(e);return ce.div({className:i},t.icon,t.iconLabel)}renderLabel(e){return ce.div({className:"lm-TabBar-tabLabel"},e.title.label)}renderCloseIcon(e){return ce.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(e){let t=this._tabKeys.get(e.title);return void 0===t&&(t=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(e.title,t)),t}createTabStyle(e){return{zIndex:`${e.zIndex}`}}createTabClass(e){let t="lm-TabBar-tab";return e.title.className&&(t+=` ${e.title.className}`),e.title.closable&&(t+=" lm-mod-closable"),e.current&&(t+=" lm-mod-current"),t}createTabDataset(e){return e.title.dataset}createTabARIA(e){var t;return{role:"tab","aria-selected":e.current.toString(),tabindex:`${null!==(t=e.tabIndex)&&void 0!==t?t:"-1"}`}}createIconClass(e){let t="lm-TabBar-tabIcon",i=e.title.iconClass;return i?`${t} ${i}`:t}};o(t,"Renderer");let i=t;i._nInstance=0,e.Renderer=i,e.defaultRenderer=new i,e.addButtonSelector=".lm-TabBar-addButton"}(lt||(lt={})),function(e){function t(){let e=document.createElement("div"),t=document.createElement("ul");t.setAttribute("role","tablist"),t.className="lm-TabBar-content",e.appendChild(t);let i=document.createElement("div");return i.className="lm-TabBar-addButton lm-mod-hidden",i.setAttribute("tabindex","-1"),i.setAttribute("role","button"),e.appendChild(i),e}function i(e){return e instanceof be?e:new be(e)}function n(e){let t=window.getComputedStyle(e);return 1e3*(parseFloat(t.transitionDuration)||0)}function s(e,t){let i=new Array(e.length);for(let n=0,s=e.length;n<s;++n){let s=e[n],r=window.getComputedStyle(s);i[n]="horizontal"===t?{pos:s.offsetLeft,size:s.offsetWidth,margin:parseFloat(r.marginLeft)||0}:{pos:s.offsetTop,size:s.offsetHeight,margin:parseFloat(r.marginTop)||0}}return i}function r(t,i){let n=Math.abs(i.clientX-t.pressX),s=Math.abs(i.clientY-t.pressY);return n>=e.DRAG_THRESHOLD||s>=e.DRAG_THRESHOLD}function a(t,i){let n=t.contentRect;return i.clientX<n.left-e.DETACH_THRESHOLD||i.clientX>=n.right+e.DETACH_THRESHOLD||i.clientY<n.top-e.DETACH_THRESHOLD||i.clientY>=n.bottom+e.DETACH_THRESHOLD}function d(e,t,i,n){let s,r,o,a;"horizontal"===n?(s=t.pressX,r=i.clientX-t.contentRect.left,o=i.clientX,a=t.contentRect.width):(s=t.pressY,r=i.clientY-t.contentRect.top,o=i.clientY,a=t.contentRect.height);let d=t.index,l=r-t.tabPressPos,h=l+t.tabSize;for(let c=0,u=e.length;c<u;++c){let i,r=t.tabLayout[c],u=r.pos+(r.size>>1);if(c<t.index&&l<u)i=`${t.tabSize+t.tabLayout[c+1].margin}px`,d=Math.min(d,c);else if(c>t.index&&h>u)i=-t.tabSize-r.margin+"px",d=Math.max(d,c);else if(c===t.index){let e=o-s,n=a-(t.tabPos+t.tabSize);i=`${Math.max(-t.tabPos,Math.min(e,n))}px`}else i="";"horizontal"===n?e[c].style.left=i:e[c].style.top=i}t.targetIndex=d}function l(e,t){let i,n;if(i="horizontal"===t?e.contentRect.width:e.contentRect.height,e.targetIndex===e.index)n=0;else if(e.targetIndex>e.index){let t=e.tabLayout[e.targetIndex];n=t.pos+t.size-e.tabSize-e.tabPos}else{n=e.tabLayout[e.targetIndex].pos-e.tabPos}let s=i-(e.tabPos+e.tabSize),r=Math.max(-e.tabPos,Math.min(n,s));"horizontal"===t?e.tab.style.left=`${r}px`:e.tab.style.top=`${r}px`}function h(e,t){for(const i of e)"horizontal"===t?i.style.left="":i.style.top=""}e.DRAG_THRESHOLD=5,e.DETACH_THRESHOLD=20,o(t,"createNode"),e.createNode=t,o(i,"asTitle"),e.asTitle=i,o(n,"parseTransitionDuration"),e.parseTransitionDuration=n,o(s,"snapTabLayout"),e.snapTabLayout=s,o(r,"dragExceeded"),e.dragExceeded=r,o(a,"detachExceeded"),e.detachExceeded=a,o(d,"layoutTabs"),e.layoutTabs=d,o(l,"finalizeTabPosition"),e.finalizeTabPosition=l,o(h,"resetTabPositions"),e.resetTabPositions=h}(ht||(ht={}));const ct=class _DockLayout extends Ce{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,void 0!==e.spacing&&(this._spacing=Te.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:we.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach(e=>{e.dispose()}),this._box=null,this._root=null,this._items.clear();for(const t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(const e of this.tabBars())if(e.titles.length>1)for(const t of e.titles)t.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=Te.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():u()}widgets(){return this._root?this._root.iterUserWidgets():u()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():u()}tabBars(){return this._root?this._root.iterTabBars():u()}handles(){return this._root?this._root.iterHandles():u()}moveHandle(e,t,i){let n=e.classList.contains("lm-mod-hidden");if(!this._root||n)return;let s,r=this._root.findSplitNode(e);r&&(s="horizontal"===r.node.orientation?t-e.offsetLeft:i-e.offsetTop,0!==s&&(r.node.holdSizes(),_e.adjust(r.node.sizers,r.index,s),this.parent&&this.parent.update()))}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t,i=new Set;t=e.main?mt.normalizeAreaConfig(e.main,i):null;let n=this.widgets(),s=this.tabBars(),r=this.handles();this._root=null;for(const o of n)i.has(o)||(o.parent=null);for(const o of s)o.dispose();for(const o of r)o.parentNode&&o.parentNode.removeChild(o);for(const o of i)o.parent=this.parent;this._root=t?mt.realizeAreaConfig(t,{createTabBar:o(e=>this._createTabBar(),"createTabBar"),createHandle:o(()=>this._createHandle(),"createHandle")},this._document):null,this.parent&&(i.forEach(e=>{this.attachWidget(e)}),this.parent.fit())}addWidget(e,t={}){let i=t.ref||null,n=t.mode||"tab-after",s=null;if(this._root&&i&&(s=this._root.findTabNode(i)),i&&!s)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,n){case"tab-after":this._insertTab(e,i,s,!0);break;case"tab-before":this._insertTab(e,i,s,!1);break;case"split-top":this._insertSplit(e,i,s,"vertical",!1);break;case"split-left":this._insertSplit(e,i,s,"horizontal",!1);break;case"split-right":this._insertSplit(e,i,s,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,i,s,"vertical",!0);break;case"merge-top":this._insertSplit(e,i,s,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,i,s,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,i,s,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,i,s,"vertical",!0,!0)}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=R.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),n=e-i.left-this._box.borderLeft,s=t-i.top-this._box.borderTop,r=this._root.hitTestTabNodes(n,s);if(!r)return null;let{tabBar:o,top:a,left:d,width:l,height:h}=r,c=this._box.borderLeft+this._box.borderRight,u=this._box.borderTop+this._box.borderBottom;return{tabBar:o,x:n,y:s,top:a,left:d,right:i.width-c-(d+l),bottom:i.height-u-(a+h),width:l,height:h}}init(){super.init();for(const e of this)this.attachWidget(e);for(const e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new Se(e)),this.parent.isAttached&&ee.sendMessage(e,we.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&ee.sendMessage(e,we.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&ee.sendMessage(e,we.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&ee.sendMessage(e,we.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(mt.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===we.HiddenMode.Scale&&1==t.tabBar.titles.length){t.tabBar.titles[0].owner.hiddenMode=we.HiddenMode.Display}return}if(t.tabBar.dispose(),this._root===t)return void(this._root=null);this._root.holdAllSizes();let i=t.parent;t.parent=null;let n=d.removeFirstOf(i.children,t),s=d.removeAt(i.handles,n);if(d.removeAt(i.sizers,n),s.parentNode&&s.parentNode.removeChild(s),i.children.length>1)return void i.syncHandles();let r=i.parent;i.parent=null;let o=i.children[0],a=i.handles[0];if(i.children.length=0,i.handles.length=0,i.sizers.length=0,a.parentNode&&a.parentNode.removeChild(a),this._root===i)return o.parent=null,void(this._root=o);let l=r,h=l.children.indexOf(i);if(o instanceof mt.TabLayoutNode)return o.parent=l,void(l.children[h]=o);let c=d.removeAt(l.handles,h);d.removeAt(l.children,h),d.removeAt(l.sizers,h),c.parentNode&&c.parentNode.removeChild(c);for(let u=0,m=o.children.length;u<m;++u){let e=o.children[u],t=o.handles[u],i=o.sizers[u];d.insert(l.children,h+u,e),d.insert(l.handles,h+u,t),d.insert(l.sizers,h+u,i),e.parent=l}o.children.length=0,o.handles.length=0,o.sizers.length=0,o.parent=null,l.syncHandles()}_createTabNode(e){let t=new mt.TabLayoutNode(this._createTabBar());return t.tabBar.addTab(e.title),mt.addAria(e,t.tabBar),t}_insertTab(e,t,i,n){if(e===t)return;if(!this._root){let t=new mt.TabLayoutNode(this._createTabBar());return t.tabBar.addTab(e.title),this._root=t,void mt.addAria(e,t.tabBar)}let s;if(i||(i=this._root.findFirstTabNode()),-1===i.tabBar.titles.indexOf(e.title)&&(this._removeWidget(e),e.hide()),s=t?i.tabBar.titles.indexOf(t.title):i.tabBar.currentIndex,this._hiddenMode===we.HiddenMode.Scale)if(0===i.tabBar.titles.length)e.hiddenMode=we.HiddenMode.Display;else if(1==i.tabBar.titles.length){i.tabBar.titles[0].owner.hiddenMode=we.HiddenMode.Scale}else e.hiddenMode=we.HiddenMode.Scale;else e.hiddenMode=this._hiddenMode;i.tabBar.insertTab(s+(n?1:0),e.title),mt.addAria(e,i.tabBar)}_insertSplit(e,t,i,n,s,r=!1){if(e===t&&i&&1===i.tabBar.titles.length)return;if(this._removeWidget(e),!this._root)return void(this._root=this._createTabNode(e));if(!i||!i.parent){let t=this._splitRoot(n),r=s?t.children.length:0;t.normalizeSizes();let o=mt.createSizer(i?1:mt.GOLDEN_RATIO),a=this._createTabNode(e);return d.insert(t.children,r,a),d.insert(t.sizers,r,o),d.insert(t.handles,r,this._createHandle()),a.parent=t,t.normalizeSizes(),void t.syncHandles()}let o=i.parent;if(o.orientation===n){let t=o.children.indexOf(i);if(r){let i=t+(s?1:-1),n=o.children[i];if(n instanceof mt.TabLayoutNode)return this._insertTab(e,null,n,!0),void++n.tabBar.currentIndex}o.normalizeSizes();let n=o.sizers[t].sizeHint/=2,a=t+(s?1:0),l=this._createTabNode(e);return d.insert(o.children,a,l),d.insert(o.sizers,a,mt.createSizer(n)),d.insert(o.handles,a,this._createHandle()),l.parent=o,void o.syncHandles()}let a=d.removeFirstOf(o.children,i),l=new mt.SplitLayoutNode(n);l.normalized=!0,l.children.push(i),l.sizers.push(mt.createSizer(.5)),l.handles.push(this._createHandle()),i.parent=l;let h=s?1:0,c=this._createTabNode(e);d.insert(l.children,h,c),d.insert(l.sizers,h,mt.createSizer(.5)),d.insert(l.handles,h,this._createHandle()),c.parent=l,l.syncHandles(),d.insert(o.children,a,l),l.parent=o}_splitRoot(e){let t=this._root;if(t instanceof mt.SplitLayoutNode&&t.orientation===e)return t;let i=this._root=new mt.SplitLayoutNode(e);return t&&(i.children.push(t),i.sizers.push(mt.createSizer(0)),i.handles.push(this._createHandle()),t.parent=i),i}_fit(){let e=0,t=0;if(this._root){let i=this._root.fit(this._spacing,this._items);e=i.minWidth,t=i.minHeight}let i=this._box=R.boxSizing(this.parent.node);e+=i.horizontalSum,t+=i.verticalSum;let n=this.parent.node.style;n.minWidth=`${e}px`,n.minHeight=`${t}px`,this._dirty=!0,this.parent.parent&&ee.sendMessage(this.parent.parent,we.Msg.FitRequest),this._dirty&&ee.sendMessage(this.parent,we.Msg.UpdateRequest)}_update(e,t){if(this._dirty=!1,!this._root)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=R.boxSizing(this.parent.node));let i=this._box.paddingTop,n=this._box.paddingLeft,s=e-this._box.horizontalSum,r=t-this._box.verticalSum;this._root.update(i,n,s,r,this._spacing,this._items)}_createTabBar(){let e=this.renderer.createTabBar(this._document);return e.orientation="horizontal",this.parent&&this.attachWidget(e),e}_createHandle(){let e=this.renderer.createHandle(),t=e.style;return t.position="absolute",t.contain="strict",t.top="0",t.left="0",t.width="0",t.height="0",this.parent&&this.parent.node.appendChild(e),e}};o(ct,"DockLayout");let ut=ct;var mt;!function(e){function t(e){let t=new fe;return t.sizeHint=e,t.size=e,t}function i(e,t){let i;return i="tab-area"===e.type?c(e,t):u(e,t),i}function n(e,t,i){let n;return n="tab-area"===e.type?m(e,t,i):p(e,t,i),n}e.GOLDEN_RATIO=.618,o(t,"createSizer"),e.createSizer=t,o(i,"normalizeAreaConfig"),e.normalizeAreaConfig=i,o(n,"realizeAreaConfig"),e.realizeAreaConfig=n;const s=class _TabLayoutNode{constructor(e){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let t=new fe,i=new fe;t.stretch=0,i.stretch=1,this.tabBar=e,this.sizers=[t,i]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(const e of this.tabBar.titles)yield e.owner}*iterSelectedWidgets(){let e=this.tabBar.currentTitle;e&&(yield e.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(e){return-1!==this.tabBar.titles.indexOf(e.title)?this:null}findSplitNode(e){return null}findFirstTabNode(){return this}hitTestTabNodes(e,t){return e<this._left||e>=this._left+this._width||t<this._top||t>=this._top+this._height?null:this}createConfig(){return{type:"tab-area",widgets:this.tabBar.titles.map(e=>e.owner),currentIndex:this.tabBar.currentIndex}}holdAllSizes(){}fit(e,t){let i=0,n=0,s=1/0,r=1/0,o=t.get(this.tabBar),a=this.tabBar.currentTitle,d=a?t.get(a.owner):void 0,[l,h]=this.sizers;return o&&o.fit(),d&&d.fit(),o&&!o.isHidden?(i=Math.max(i,o.minWidth),n+=o.minHeight,l.minSize=o.minHeight,l.maxSize=o.maxHeight):(l.minSize=0,l.maxSize=0),d&&!d.isHidden?(i=Math.max(i,d.minWidth),n+=d.minHeight,h.minSize=d.minHeight,h.maxSize=1/0):(h.minSize=0,h.maxSize=1/0),{minWidth:i,minHeight:n,maxWidth:s,maxHeight:r}}update(e,t,i,n,s,r){this._top=t,this._left=e,this._width=i,this._height=n;let o=r.get(this.tabBar),a=this.tabBar.currentTitle,d=a?r.get(a.owner):void 0;if(_e.calc(this.sizers,n),o&&!o.isHidden){let n=this.sizers[0].size;o.update(e,t,i,n),t+=n}if(d&&!d.isHidden){let n=this.sizers[1].size;d.update(e,t,i,n)}}};o(s,"TabLayoutNode");let r=s;e.TabLayoutNode=r;const a=class _SplitLayoutNode{constructor(e){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=e}*iterAllWidgets(){for(const e of this.children)yield*e.iterAllWidgets()}*iterUserWidgets(){for(const e of this.children)yield*e.iterUserWidgets()}*iterSelectedWidgets(){for(const e of this.children)yield*e.iterSelectedWidgets()}*iterTabBars(){for(const e of this.children)yield*e.iterTabBars()}*iterHandles(){yield*this.handles;for(const e of this.children)yield*e.iterHandles()}findTabNode(e){for(let t=0,i=this.children.length;t<i;++t){let i=this.children[t].findTabNode(e);if(i)return i}return null}findSplitNode(e){let t=this.handles.indexOf(e);if(-1!==t)return{index:t,node:this};for(let i=0,n=this.children.length;i<n;++i){let t=this.children[i].findSplitNode(e);if(t)return t}return null}findFirstTabNode(){return 0===this.children.length?null:this.children[0].findFirstTabNode()}hitTestTabNodes(e,t){for(let i=0,n=this.children.length;i<n;++i){let n=this.children[i].hitTestTabNodes(e,t);if(n)return n}return null}createConfig(){let e=this.orientation,t=this.createNormalizedSizes();return{type:"split-area",orientation:e,children:this.children.map(e=>e.createConfig()),sizes:t}}syncHandles(){this.handles.forEach((e,t)=>{e.setAttribute("data-orientation",this.orientation),t===this.handles.length-1?e.classList.add("lm-mod-hidden"):e.classList.remove("lm-mod-hidden")})}holdSizes(){for(const e of this.sizers)e.sizeHint=e.size}holdAllSizes(){for(const e of this.children)e.holdAllSizes();this.holdSizes()}normalizeSizes(){let e=this.sizers.length;if(0===e)return;this.holdSizes();let t=this.sizers.reduce((e,t)=>e+t.sizeHint,0);if(0===t)for(const i of this.sizers)i.size=i.sizeHint=1/e;else for(const i of this.sizers)i.size=i.sizeHint/=t;this.normalized=!0}createNormalizedSizes(){let e=this.sizers.length;if(0===e)return[];let t=this.sizers.map(e=>e.size),i=t.reduce((e,t)=>e+t,0);if(0===i)for(let n=t.length-1;n>-1;n--)t[n]=1/e;else for(let n=t.length-1;n>-1;n--)t[n]/=i;return t}fit(e,t){let i="horizontal"===this.orientation,n=Math.max(0,this.children.length-1)*e,s=i?n:0,r=i?0:n,o=1/0,a=1/0;for(let d=0,l=this.children.length;d<l;++d){let n=this.children[d].fit(e,t);i?(r=Math.max(r,n.minHeight),s+=n.minWidth,this.sizers[d].minSize=n.minWidth):(s=Math.max(s,n.minWidth),r+=n.minHeight,this.sizers[d].minSize=n.minHeight)}return{minWidth:s,minHeight:r,maxWidth:o,maxHeight:a}}update(e,t,i,n,s,r){let o="horizontal"===this.orientation,a=Math.max(0,this.children.length-1)*s,d=Math.max(0,(o?i:n)-a);if(this.normalized){for(const e of this.sizers)e.sizeHint*=d;this.normalized=!1}_e.calc(this.sizers,d);for(let l=0,h=this.children.length;l<h;++l){let a=this.children[l],d=this.sizers[l].size,h=this.handles[l].style;o?(a.update(e,t,d,n,s,r),e+=d,h.top=`${t}px`,h.left=`${e}px`,h.width=`${s}px`,h.height=`${n}px`,e+=s):(a.update(e,t,i,d,s,r),t+=d,h.top=`${t}px`,h.left=`${e}px`,h.width=`${i}px`,h.height=`${s}px`,t+=s)}}};o(a,"SplitLayoutNode");let d=a;function l(e,t){e.node.setAttribute("role","tabpanel");let i=t.renderer;if(i instanceof lt.Renderer){let t=i.createTabKey({title:e.title,current:!1,zIndex:0});e.node.setAttribute("aria-labelledby",t)}}function h(e){e.node.removeAttribute("role"),e.node.removeAttribute("aria-labelledby")}function c(e,t){if(0===e.widgets.length)return null;let i=[];for(const s of e.widgets)t.has(s)||(t.add(s),i.push(s));if(0===i.length)return null;let n=e.currentIndex;return-1!==n&&(n<0||n>=i.length)&&(n=0),{type:"tab-area",widgets:i,currentIndex:n}}function u(e,t){let n=e.orientation,s=[],r=[];for(let o=0,a=e.children.length;o<a;++o){let a=i(e.children[o],t);a&&("tab-area"===a.type||a.orientation!==n?(s.push(a),r.push(Math.abs(e.sizes[o]||0))):(s.push(...a.children),r.push(...a.sizes)))}return 0===s.length?null:1===s.length?s[0]:{type:"split-area",orientation:n,children:s,sizes:r}}function m(t,i,n){let s=i.createTabBar(n);for(const r of t.widgets)r.hide(),s.addTab(r.title),e.addAria(r,s);return s.currentIndex=t.currentIndex,new r(s)}function p(e,i,s){let r=new d(e.orientation);return e.children.forEach((o,a)=>{let d=n(o,i,s),l=t(e.sizes[a]),h=i.createHandle();r.children.push(d),r.handles.push(h),r.sizers.push(l),d.parent=r}),r.syncHandles(),r.normalizeSizes(),r}e.SplitLayoutNode=d,o(l,"addAria"),e.addAria=l,o(h,"removeAria"),e.removeAria=h,o(c,"normalizeTabAreaConfig"),o(u,"normalizeSplitAreaConfig"),o(m,"realizeTabAreaConfig"),o(p,"realizeSplitAreaConfig")}(mt||(mt={}));let pt=(o(n=class extends we{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new S(this),this._addRequested=new S(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||n.defaultRenderer,this._edges=e.edges||gt.DEFAULT_EDGES,void 0!==e.tabsMovable&&(this._tabsMovable=e.tabsMovable),void 0!==e.tabsConstrained&&(this._tabsConstrained=e.tabsConstrained),void 0!==e.addButtonEnabled&&(this._addButtonEnabled=e.addButtonEnabled),this.dataset.mode=this._mode;let t={createTabBar:o(()=>this._createTabBar(),"createTabBar"),createHandle:o(()=>this._createHandle(),"createHandle")};this.layout=new ut({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new n.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(const e of t.tabBars())e.show();break;case"single-document":t.restoreLayout(gt.createSingleDocumentConfig(this));break;default:throw"unreachable"}ee.postMessage(this,gt.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(const t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(const t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=m(this.tabBars(),t=>-1!==t.titles.indexOf(e.title));if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(P.IS_EDGE||P.IS_IE)&&ee.flush(),ee.postMessage(this,gt.LayoutModified)}addWidget(e,t={}){"single-document"===this._mode?this.layout.addWidget(e):this.layout.addWidget(e,t),ee.postMessage(this,gt.LayoutModified)}processMessage(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){gt.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){gt.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),ee.postMessage(this,gt.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||"invalid"===this._showOverlay(e.clientX,e.clientY)?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),"none"===e.proposedAction)return void(e.dropAction="none");let{clientX:t,clientY:i}=e,{zone:n,target:s}=gt.findDropTarget(this,t,i,this._edges);if(this._tabsConstrained&&e.source!==this||"invalid"===n)return void(e.dropAction="none");let r=e.mimeData.getData("application/vnd.lumino.widget-factory");if("function"!=typeof r)return void(e.dropAction="none");let o=r();if(!(o instanceof we))return void(e.dropAction="none");if(o.contains(this))return void(e.dropAction="none");let a=s?gt.getDropRef(s.tabBar):null;switch(n){case"root-all":this.addWidget(o);break;case"root-top":this.addWidget(o,{mode:"split-top"});break;case"root-left":this.addWidget(o,{mode:"split-left"});break;case"root-right":this.addWidget(o,{mode:"split-right"});break;case"root-bottom":this.addWidget(o,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(o,{mode:"tab-after",ref:a});break;case"widget-top":this.addWidget(o,{mode:"split-top",ref:a});break;case"widget-left":this.addWidget(o,{mode:"split-left",ref:a});break;case"widget-right":this.addWidget(o,{mode:"split-right",ref:a});break;case"widget-bottom":this.addWidget(o,{mode:"split-bottom",ref:a});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(o)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&(this._releaseMouse(),ee.postMessage(this,gt.LayoutModified))}_evtPointerDown(e){if(0!==e.button)return;let t=this.layout,i=e.target,n=m(t.handles(),e=>e.contains(i));if(!n)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let s=n.getBoundingClientRect(),r=e.clientX-s.left,o=e.clientY-s.top,a=window.getComputedStyle(n),d=re.overrideCursor(a.cursor,this._document);this._pressData={handle:n,deltaX:r,deltaY:o,override:d}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),i=e.clientX-t.left-this._pressData.deltaX,n=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,n)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),ee.postMessage(this,gt.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let i,n,s,r,{zone:o,target:a}=gt.findDropTarget(this,e,t,this._edges);if("invalid"===o)return this.overlay.hide(100),o;let d=R.boxSizing(this.node),l=this.node.getBoundingClientRect();switch(o){case"root-all":i=d.paddingTop,n=d.paddingLeft,s=d.paddingRight,r=d.paddingBottom;break;case"root-top":i=d.paddingTop,n=d.paddingLeft,s=d.paddingRight,r=l.height*gt.GOLDEN_RATIO;break;case"root-left":i=d.paddingTop,n=d.paddingLeft,s=l.width*gt.GOLDEN_RATIO,r=d.paddingBottom;break;case"root-right":i=d.paddingTop,n=l.width*gt.GOLDEN_RATIO,s=d.paddingRight,r=d.paddingBottom;break;case"root-bottom":i=l.height*gt.GOLDEN_RATIO,n=d.paddingLeft,s=d.paddingRight,r=d.paddingBottom;break;case"widget-all":i=a.top,n=a.left,s=a.right,r=a.bottom;break;case"widget-top":i=a.top,n=a.left,s=a.right,r=a.bottom+a.height/2;break;case"widget-left":i=a.top,n=a.left,s=a.right+a.width/2,r=a.bottom;break;case"widget-right":i=a.top,n=a.left+a.width/2,s=a.right,r=a.bottom;break;case"widget-bottom":i=a.top+a.height/2,n=a.left,s=a.right,r=a.bottom;break;case"widget-tab":{const e=a.tabBar.node.getBoundingClientRect().height;i=a.top,n=a.left,s=a.right,r=a.bottom+a.height-e;break}default:throw"unreachable"}return this.overlay.show({top:i,left:n,right:s,bottom:r}),o}_createTabBar(){let e=this._renderer.createTabBar(this._document);return gt.isGeneratedTabBarProperty.set(e,!0),"single-document"===this._mode&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){ee.postMessage(this,gt.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:i,currentTitle:n}=t;i&&i.owner.hide(),n&&n.owner.show(),(P.IS_EDGE||P.IS_IE)&&ee.flush(),ee.postMessage(this,gt.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:i,tab:n,clientX:s,clientY:r,offset:a}=t,d=new b,l=o(()=>i.owner,"factory");d.setData("application/vnd.lumino.widget-factory",l);let h=n.cloneNode(!0);a&&(h.style.top=`-${a.y}px`,h.style.left=`-${a.x}px`),this._drag=new re({document:this._document,mimeData:d,dragImage:h,proposedAction:"move",supportedActions:"move",source:this}),n.classList.add("lm-mod-hidden");let c=o(()=>{this._drag=null,n.classList.remove("lm-mod-hidden")},"cleanup");this._drag.start(s,r).then(c)}},"DockPanel"),n);var gt;!function(e){const t=class _Overlay{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(e){let t=this.node.style;t.top=`${e.top}px`,t.left=`${e.left}px`,t.right=`${e.right}px`,t.bottom=`${e.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(e){if(!this._hidden)return e<=0?(clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("lm-mod-hidden")):void(-1===this._timer&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},e)))}};o(t,"Overlay");let i=t;e.Overlay=i;const n=class _Renderer{createTabBar(e){let t=new lt({document:e});return t.addClass("lm-DockPanel-tabBar"),t}createHandle(){let e=document.createElement("div");return e.className="lm-DockPanel-handle",e}};o(n,"Renderer");let s=n;e.Renderer=s,e.defaultRenderer=new s}(pt||(pt={})),function(e){function t(e){if(e.isEmpty)return{main:null};let t=Array.from(e.widgets()),i=e.selectedWidgets().next().value,n=i?t.indexOf(i):-1;return{main:{type:"tab-area",widgets:t,currentIndex:n}}}function i(e,t,i,n){if(!R.hitTest(e.node,t,i))return{zone:"invalid",target:null};let s=e.layout;if(s.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===e.mode){let s=e.node.getBoundingClientRect(),r=t-s.left+1,o=i-s.top+1,a=s.right-t,d=s.bottom-i;switch(Math.min(o,a,d,r)){case o:if(o<n.top)return{zone:"root-top",target:null};break;case a:if(a<n.right)return{zone:"root-right",target:null};break;case d:if(d<n.bottom)return{zone:"root-bottom",target:null};break;case r:if(r<n.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}let r=s.hitTestTabAreas(t,i);if(!r)return{zone:"invalid",target:null};if("single-document"===e.mode)return{zone:"widget-all",target:r};let o=r.x-r.left+1,a=r.y-r.top+1,d=r.left+r.width-r.x,l=r.top+r.height-r.y;if(a<r.tabBar.node.getBoundingClientRect().height)return{zone:"widget-tab",target:r};let h,c=Math.round(r.width/3),u=Math.round(r.height/3);if(o>c&&d>c&&a>u&&l>u)return{zone:"widget-all",target:r};switch(o/=c,a/=u,d/=c,l/=u,Math.min(o,a,d,l)){case o:h="widget-left";break;case a:h="widget-top";break;case d:h="widget-right";break;case l:h="widget-bottom";break;default:throw"unreachable"}return{zone:h,target:r}}function n(e){return 0===e.titles.length?null:e.currentTitle?e.currentTitle.owner:e.titles[e.titles.length-1].owner}e.GOLDEN_RATIO=.618,e.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},e.LayoutModified=new J("layout-modified"),e.isGeneratedTabBarProperty=new ie({name:"isGeneratedTabBar",create:o(()=>!1,"create")}),o(t,"createSingleDocumentConfig"),e.createSingleDocumentConfig=t,o(i,"findDropTarget"),e.findDropTarget=i,o(n,"getDropRef"),e.getDropRef=n}(gt||(gt={}));const ft=class _GridLayout extends Ce{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new fe],this._columnSizers=[new fe],this._box=null,void 0!==e.rowCount&&vt.reallocSizers(this._rowSizers,e.rowCount),void 0!==e.columnCount&&vt.reallocSizers(this._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(this._rowSpacing=vt.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(this._columnSpacing=vt.clampValue(e.columnSpacing))}dispose(){for(const e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(vt.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(vt.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=vt.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=vt.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let i=this._rowSizers[e];i&&(t=vt.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let i=this._columnSizers[e];i&&(t=vt.clampValue(t),i.stretch!==t&&(i.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(const e of this._items)yield e.widget}addWidget(e){-1===d.findFirstIndex(this._items,t=>t.widget===e)&&(this._items.push(new Se(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=d.findFirstIndex(this._items,t=>t.widget===e);if(-1===t)return;let i=d.removeAt(this._items,t);this.parent&&this.detachWidget(e),i.dispose()}init(){super.init();for(const e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&ee.sendMessage(e,we.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&ee.sendMessage(e,we.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&ee.sendMessage(e,we.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&ee.sendMessage(e,we.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let a=0,d=this.rowCount;a<d;++a)this._rowSizers[a].minSize=0;for(let a=0,d=this.columnCount;a<d;++a)this._columnSizers[a].minSize=0;let e=this._items.filter(e=>!e.isHidden);for(let a=0,d=e.length;a<d;++a)e[a].fit();let t=this.rowCount-1,i=this.columnCount-1;e.sort(vt.rowSpanCmp);for(let a=0,d=e.length;a<d;++a){let i=e[a],n=_GridLayout.getCellConfig(i.widget),s=Math.min(n.row,t),r=Math.min(n.row+n.rowSpan-1,t);vt.distributeMin(this._rowSizers,s,r,i.minHeight)}e.sort(vt.columnSpanCmp);for(let a=0,d=e.length;a<d;++a){let t=e[a],n=_GridLayout.getCellConfig(t.widget),s=Math.min(n.column,i),r=Math.min(n.column+n.columnSpan-1,i);vt.distributeMin(this._columnSizers,s,r,t.minWidth)}if("set-no-constraint"===this.fitPolicy)return void ee.sendMessage(this.parent,we.Msg.UpdateRequest);let n=t*this._rowSpacing,s=i*this._columnSpacing;for(let a=0,d=this.rowCount;a<d;++a)n+=this._rowSizers[a].minSize;for(let a=0,d=this.columnCount;a<d;++a)s+=this._columnSizers[a].minSize;let r=this._box=R.boxSizing(this.parent.node);s+=r.horizontalSum,n+=r.verticalSum;let o=this.parent.node.style;o.minWidth=`${s}px`,o.minHeight=`${n}px`,this._dirty=!0,this.parent.parent&&ee.sendMessage(this.parent.parent,we.Msg.FitRequest),this._dirty&&ee.sendMessage(this.parent,we.Msg.UpdateRequest)}_update(e,t){this._dirty=!1,e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=R.boxSizing(this.parent.node));let i=this._box.paddingTop,n=this._box.paddingLeft,s=e-this._box.horizontalSum,r=t-this._box.verticalSum,o=this.rowCount-1,a=this.columnCount-1,d=o*this._rowSpacing,l=a*this._columnSpacing;_e.calc(this._rowSizers,Math.max(0,r-d)),_e.calc(this._columnSizers,Math.max(0,s-l));for(let h=0,c=i,u=this.rowCount;h<u;++h)this._rowStarts[h]=c,c+=this._rowSizers[h].size+this._rowSpacing;for(let h=0,c=n,u=this.columnCount;h<u;++h)this._columnStarts[h]=c,c+=this._columnSizers[h].size+this._columnSpacing;for(let h=0,c=this._items.length;h<c;++h){let e=this._items[h];if(e.isHidden)continue;let t=_GridLayout.getCellConfig(e.widget),i=Math.min(t.row,o),n=Math.min(t.column,a),s=Math.min(t.row+t.rowSpan-1,o),r=Math.min(t.column+t.columnSpan-1,a),d=this._columnStarts[n],l=this._rowStarts[i],c=this._columnStarts[r]+this._columnSizers[r].size-d,u=this._rowStarts[s]+this._rowSizers[s].size-l;e.update(d,l,c,u)}}};o(ft,"GridLayout");let _t=ft;var vt;!function(e){function t(e){return vt.cellConfigProperty.get(e)}function i(e,t){vt.cellConfigProperty.set(e,vt.normalizeConfig(t))}o(t,"getCellConfig"),e.getCellConfig=t,o(i,"setCellConfig"),e.setCellConfig=i}(_t||(_t={})),function(e){function t(e){return{row:Math.max(0,Math.floor(e.row||0)),column:Math.max(0,Math.floor(e.column||0)),rowSpan:Math.max(1,Math.floor(e.rowSpan||0)),columnSpan:Math.max(1,Math.floor(e.columnSpan||0))}}function i(e){return Math.max(0,Math.floor(e))}function n(t,i){let n=e.cellConfigProperty.get(t.widget),s=e.cellConfigProperty.get(i.widget);return n.rowSpan-s.rowSpan}function s(t,i){let n=e.cellConfigProperty.get(t.widget),s=e.cellConfigProperty.get(i.widget);return n.columnSpan-s.columnSpan}function r(e,t){for(t=Math.max(1,Math.floor(t));e.length<t;)e.push(new fe);e.length>t&&(e.length=t)}function a(e,t,i,n){if(i<t)return;if(t===i){let i=e[t];return void(i.minSize=Math.max(i.minSize,n))}let s=0;for(let o=t;o<=i;++o)s+=e[o].minSize;if(s>=n)return;let r=(n-s)/(i-t+1);for(let o=t;o<=i;++o)e[o].minSize+=r}function d(e){e.parent&&e.parent.layout instanceof _t&&e.parent.fit()}e.cellConfigProperty=new ie({name:"cellConfig",create:o(()=>({row:0,column:0,rowSpan:1,columnSpan:1}),"create"),changed:d}),o(t,"normalizeConfig"),e.normalizeConfig=t,o(i,"clampValue"),e.clampValue=i,o(n,"rowSpanCmp"),e.rowSpanCmp=n,o(s,"columnSpanCmp"),e.columnSpanCmp=s,o(r,"reallocSizers"),e.reallocSizers=r,o(a,"distributeMin"),e.distributeMin=a,o(d,"onChildCellConfigChanged")}(vt||(vt={}));const bt=class _MenuBar extends we{constructor(e={}){super({node:wt.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(we.Flag.DisallowLayout),this.renderer=e.renderer||_MenuBar.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&0===this._menus[e].items.length&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,i=!0){this._closeChildMenu();let n=this._menus.indexOf(t),s=Math.max(0,Math.min(e,this._menus.length));if(-1===n)return d.insert(this._menus,s,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),void(i&&this.update());s===this._menus.length&&s--,n!==s&&(d.move(this._menus,n,s),i&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let i=d.removeAt(this._menus,e);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(0!==this._menus.length){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let i=this._menus,n=this.renderer,s=this._activeIndex,r=this._tabFocusIndex>=0&&this._tabFocusIndex<i.length?this._tabFocusIndex:0,a=this._overflowIndex>-1?this._overflowIndex:i.length,d=0,l=!1;a=null!==this._overflowMenu?a-1:a;let h=new Array(a);for(let c=0;c<a;++c)h[c]=n.renderItem({title:i[c].title,active:c===s,tabbable:c===r,disabled:0===i[c].items.length,onfocus:o(()=>{this._tabFocusIndex=c,this.activeIndex=c},"onfocus")}),d+=this._menuItemSizes[c],i[c].title.label===this._overflowMenuOptions.title&&(l=!0,a--);if(this._overflowMenuOptions.isVisible)if(this._overflowIndex>-1&&!l){if(null===this._overflowMenu){const e=null!==(t=this._overflowMenuOptions.title)&&void 0!==t?t:"...";this._overflowMenu=new it({commands:new V}),this._overflowMenu.title.label=e,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let e=i.length-2;e>=a;e--){const t=this.menus[e];t.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:t}),this.removeMenu(t,!1)}h[a]=n.renderItem({title:this._overflowMenu.title,active:a===s&&0!==i[a].items.length,tabbable:a===r,disabled:0===i[a].items.length,onfocus:o(()=>{this._tabFocusIndex=a,this.activeIndex=a},"onfocus")}),a++}else if(null!==this._overflowMenu){let e=this._overflowMenu.items,t=this.node.offsetWidth,s=this._overflowMenu.items.length;for(let l=0;l<s;++l){let s=i.length-1-l;if(t-d>this._menuItemSizes[s]){let t=e[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(a,t,!1),h[a]=n.renderItem({title:t.title,active:!1,tabbable:a===r,disabled:0===i[a].items.length,onfocus:o(()=>{this._tabFocusIndex=a,this.activeIndex=a},"onfocus")}),a++}}0===this._overflowMenu.items.length&&(this.removeMenu(this._overflowMenu,!1),h.pop(),this._overflowMenu=null,this._overflowIndex=-1)}me.render(h,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,i=0,n=-1,s=e.length;if(0==this._menuItemSizes.length)for(let r=0;r<s;r++){let s=e[r];i+=s.offsetWidth,this._menuItemSizes.push(s.offsetWidth),i>t&&-1===n&&(n=r)}else for(let r=0;r<this._menuItemSizes.length;r++)if(i+=this._menuItemSizes[r],i>t){n=r;break}this._overflowIndex=n}_evtKeyDown(e){let t=e.keyCode;if(9===t)return void(this.activeIndex=-1);if(e.preventDefault(),e.stopPropagation(),13===t||32===t||38===t||40===t){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;return void this.openActiveMenu()}if(27===t)return this._closeChildMenu(),void this._focusItemAt(this.activeIndex);if(37===t||39===t){let e=37===t?-1:1,i=this._tabFocusIndex+e,n=this._menus.length;for(let t=0;t<n;t++){let s=(n+i+e*t)%n;if(this._menus[s].items.length)return void this._focusItemAt(s)}return}let i=N().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,s=wt.findMnemonic(this._menus,i,n);-1===s.index||s.multiple?-1!==s.index?(this.activeIndex=s.index,this._focusItemAt(this.activeIndex)):-1!==s.auto&&(this.activeIndex=s.auto,this._focusItemAt(this.activeIndex)):(this.activeIndex=s.index,this.openActiveMenu())}_evtMouseDown(e){if(!R.hitTest(this.node,e.clientX,e.clientY))return;e.stopPropagation(),e.stopImmediatePropagation();let t=d.findFirstIndex(this.contentNode.children,t=>R.hitTest(t,e.clientX,e.clientY));if(-1!==t){if(0===e.button)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();const i=this._positionForMenu(t);it.saveWindowData(),this.activeIndex=t,this._openChildMenu(i)}}else this._closeChildMenu()}_evtMouseMove(e){let t=d.findFirstIndex(this.contentNode.children,t=>R.hitTest(t,e.clientX,e.clientY));if(t===this._activeIndex)return;if(-1===t&&this._childMenu)return;const i=t>=0&&this._childMenu?this._positionForMenu(t):null;it.saveWindowData(),this.activeIndex=t,i&&this._openChildMenu(i)}_positionForMenu(e){let t=this.contentNode.children[e],{left:i,bottom:n}=t.getBoundingClientRect();return{top:n,left:i}}_evtFocusOut(e){this._childMenu||this.node.contains(e.relatedTarget)||(this.activeIndex=-1)}_focusItemAt(e){const t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t)return void this._closeChildMenu();let i=this._childMenu;if(i===t)return;this._childMenu=t,i?i.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,ee.sendMessage(this,we.Msg.UpdateRequest);let{left:n,top:s}=e;void 0!==n&&void 0!==s||({left:n,top:s}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),t.items.length>0&&t.open(n,s,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let i=this._activeIndex,n=this._menus.length;switch(t){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=0===i?n-1:i-1}this.openActiveMenu()}_onTitleChanged(){this.update()}};o(bt,"MenuBar");let yt=bt;var wt,xt;!function(e){const t=class _Renderer{renderItem(e){let t=this.createItemClass(e),i=this.createItemDataset(e),n=this.createItemARIA(e);return ce.li({className:t,dataset:i,...e.disabled?{}:{tabindex:e.tabbable?"0":"-1"},onfocus:e.onfocus,...n},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){let t=this.createIconClass(e);return ce.div({className:t},e.title.icon,e.title.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return ce.div({className:"lm-MenuBar-itemLabel"},t)}createItemClass(e){let t="lm-MenuBar-item";return e.title.className&&(t+=` ${e.title.className}`),e.active&&!e.disabled&&(t+=" lm-mod-active"),t}createItemDataset(e){return e.title.dataset}createItemARIA(e){return{role:"menuitem","aria-haspopup":"true","aria-disabled":e.disabled?"true":"false"}}createIconClass(e){let t="lm-MenuBar-itemIcon",i=e.title.iconClass;return i?`${t} ${i}`:t}formatLabel(e){let{label:t,mnemonic:i}=e.title;if(i<0||i>=t.length)return t;let n=t.slice(0,i),s=t.slice(i+1),r=t[i];return[n,ce.span({className:"lm-MenuBar-itemMnemonic"},r),s]}};o(t,"Renderer");let i=t;e.Renderer=i,e.defaultRenderer=new i}(bt||(yt={})),function(e){function t(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-MenuBar-content",e.appendChild(t),t.setAttribute("role","menubar"),e}function i(e,t,i){let n=-1,s=-1,r=!1,o=t.toUpperCase();for(let a=0,d=e.length;a<d;++a){let t=(a+i)%d,l=e[t].title;if(0===l.label.length)continue;let h=l.mnemonic;h>=0&&h<l.label.length?l.label[h].toUpperCase()===o&&(-1===n?n=t:r=!0):-1===s&&l.label[0].toUpperCase()===o&&(s=t)}return{index:n,multiple:r,auto:s}}o(t,"createNode"),e.createNode=t,o(i,"findMnemonic"),e.findMnemonic=i}(wt||(wt={})),function(e){function t(){let e=document.createElement("div"),t=document.createElement("div"),i=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div");return t.className="lm-ScrollBar-button",i.className="lm-ScrollBar-button",t.dataset.action="decrement",i.dataset.action="increment",n.className="lm-ScrollBar-track",s.className="lm-ScrollBar-thumb",n.appendChild(s),e.appendChild(t),e.appendChild(n),e.appendChild(i),e}function i(e,t){return e.thumbNode.contains(t)?"thumb":e.trackNode.contains(t)?"track":e.decrementNode.contains(t)?"decrement":e.incrementNode.contains(t)?"increment":null}o(t,"createNode"),e.createNode=t,o(i,"findPart"),e.findPart=i}(xt||(xt={}));const Mt=class _StackedLayout extends ke{constructor(e={}){super(e),this._dirty=!1,this._items=[],this._box=null,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:we.HiddenMode.Display}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this._hiddenMode=e,this.widgets.length>1&&this.widgets.forEach(e=>{e.hiddenMode=this._hiddenMode}))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===we.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=we.HiddenMode.Scale),t.hiddenMode=we.HiddenMode.Scale):t.hiddenMode=we.HiddenMode.Display,d.insert(this._items,e,new Se(t)),this.parent.isAttached&&ee.sendMessage(t,we.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&ee.sendMessage(t,we.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){d.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let i=d.removeAt(this._items,e);this.parent.isAttached&&ee.sendMessage(t,we.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ee.sendMessage(t,we.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===we.HiddenMode.Scale&&(t.hiddenMode=we.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=we.HiddenMode.Display)),i.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let s=0,r=this._items.length;s<r;++s){let i=this._items[s];i.isHidden||(i.fit(),e=Math.max(e,i.minWidth),t=Math.max(t,i.minHeight))}let i=this._box=R.boxSizing(this.parent.node);e+=i.horizontalSum,t+=i.verticalSum;let n=this.parent.node.style;n.minWidth=`${e}px`,n.minHeight=`${t}px`,this._dirty=!0,this.parent.parent&&ee.sendMessage(this.parent.parent,we.Msg.FitRequest),this._dirty&&ee.sendMessage(this.parent,we.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let i=0;for(let a=0,d=this._items.length;a<d;++a)i+=+!this._items[a].isHidden;if(0===i)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=R.boxSizing(this.parent.node));let n=this._box.paddingTop,s=this._box.paddingLeft,r=e-this._box.horizontalSum,o=t-this._box.verticalSum;for(let a=0,d=this._items.length;a<d;++a){let e=this._items[a];e.isHidden||(e.widget.node.style.zIndex=`${a}`,e.update(s,n,r,o))}}};o(Mt,"StackedLayout");let Ct=Mt;const At=class _StackedPanel extends Ne{constructor(e={}){super({layout:It.createLayout(e)}),this._widgetRemoved=new S(this),this.addClass("lm-StackedPanel")}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get widgetRemoved(){return this._widgetRemoved}onChildAdded(e){e.child.addClass("lm-StackedPanel-child")}onChildRemoved(e){e.child.removeClass("lm-StackedPanel-child"),this._widgetRemoved.emit(e.child)}};o(At,"StackedPanel");let St=At;var It;!function(e){function t(e){return e.layout||new Ct}o(t,"createLayout"),e.createLayout=t}(It||(It={}));let zt=(o(s=class extends we{constructor(e={}){super(),this._currentChanged=new S(this),this._addRequested=new S(this),this.addClass("lm-TabPanel"),this.tabBar=new lt(e),this.tabBar.addClass("lm-TabPanel-tabBar"),this.stackedPanel=new St,this.stackedPanel.addClass("lm-TabPanel-stackedPanel"),this.tabBar.tabMoved.connect(this._onTabMoved,this),this.tabBar.currentChanged.connect(this._onCurrentChanged,this),this.tabBar.tabCloseRequested.connect(this._onTabCloseRequested,this),this.tabBar.tabActivateRequested.connect(this._onTabActivateRequested,this),this.tabBar.addRequested.connect(this._onTabAddRequested,this),this.stackedPanel.widgetRemoved.connect(this._onWidgetRemoved,this),this._tabPlacement=e.tabPlacement||"top";let t=kt.directionFromPlacement(this._tabPlacement),i=kt.orientationFromPlacement(this._tabPlacement);this.tabBar.orientation=i,this.tabBar.dataset.placement=this._tabPlacement;let n=new je({direction:t,spacing:0});je.setStretch(this.tabBar,0),je.setStretch(this.stackedPanel,1),n.addWidget(this.tabBar),n.addWidget(this.stackedPanel),this.layout=n}get currentChanged(){return this._currentChanged}get currentIndex(){return this.tabBar.currentIndex}set currentIndex(e){this.tabBar.currentIndex=e}get currentWidget(){let e=this.tabBar.currentTitle;return e?e.owner:null}set currentWidget(e){this.tabBar.currentTitle=e?e.title:null}get tabsMovable(){return this.tabBar.tabsMovable}set tabsMovable(e){this.tabBar.tabsMovable=e}get addButtonEnabled(){return this.tabBar.addButtonEnabled}set addButtonEnabled(e){this.tabBar.addButtonEnabled=e}get tabPlacement(){return this._tabPlacement}set tabPlacement(e){if(this._tabPlacement===e)return;this._tabPlacement=e;let t=kt.directionFromPlacement(e),i=kt.orientationFromPlacement(e);this.tabBar.orientation=i,this.tabBar.dataset.placement=e,this.layout.direction=t}get addRequested(){return this._addRequested}get widgets(){return this.stackedPanel.widgets}addWidget(e){this.insertWidget(this.widgets.length,e)}insertWidget(e,t){t!==this.currentWidget&&t.hide(),this.stackedPanel.insertWidget(e,t),this.tabBar.insertTab(e,t.title),t.node.setAttribute("role","tabpanel");let i=this.tabBar.renderer;if(i instanceof lt.Renderer){let e=i.createTabKey({title:t.title,current:!1,zIndex:0});t.node.setAttribute("aria-labelledby",e)}}_onCurrentChanged(e,t){let{previousIndex:i,previousTitle:n,currentIndex:s,currentTitle:r}=t,o=n?n.owner:null,a=r?r.owner:null;o&&o.hide(),a&&a.show(),this._currentChanged.emit({previousIndex:i,previousWidget:o,currentIndex:s,currentWidget:a}),(P.IS_EDGE||P.IS_IE)&&ee.flush()}_onTabAddRequested(e,t){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabMoved(e,t){this.stackedPanel.insertWidget(t.toIndex,t.title.owner)}_onWidgetRemoved(e,t){t.node.removeAttribute("role"),t.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(t.title)}},"TabPanel"),s);var kt;!function(e){function t(e){return n[e]}function i(e){return s[e]}o(t,"orientationFromPlacement"),e.orientationFromPlacement=t,o(i,"directionFromPlacement"),e.directionFromPlacement=i;const n={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},s={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}}(kt||(kt={})),e.Msg=void 0,(e=>{const t=class _WAConflatableMessage extends J{constructor(e,t){super(t),a(this,"_wa"),this._wa=e}get wa(){return this._wa}conflate(e){return this._wa=e.wa,!0}};o(t,"WAConflatableMessage");let i=t;e.WAConflatableMessage=i;const n=class _WAActivateRequest extends i{constructor(e){super(e,_WAActivateRequest.type)}};o(n,"WAActivateRequest"),a(n,"type","wa-activate-request");let s=n;e.WAActivateRequest=s;const r=class _WALayoutChanged extends i{constructor(e){super(e,_WALayoutChanged.type)}};o(r,"WALayoutChanged"),a(r,"type","wa-layout-changed");let d=r;e.WALayoutChanged=d})(e.Msg||(e.Msg={}));const Et=class _WidgetAdapter extends we{constructor(e,i,n={},s=!1,r={}){super(),a(this,"_owner"),a(this,"_element"),a(this,"_widget"),a(this,"_widgetLayout"),a(this,"lparam",{}),a(this,"padding",0),a(this,"_width",0),a(this,"_height",0),a(this,"_ext"),a(this,"_closable"),this._owner=e,this._element=t.select(this.node),this.addClass("phosphor_WidgetAdapter"),this.title.label="",this.title.closable=!!s,this.title.caption=`Long description for: ${name}`,this._ext=r,this._closable="boolean"==typeof s?{canClose:(e,t)=>s}:s,i instanceof t.Widget?this._widget=i.target(this.node):this._widgetLayout=i,this.lparam=n}get widget(){return this._widget}get inputNode(){return this.node.getElementsByTagName("input")[0]}resizeAndRender(){this._widget&&(t.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(),this._owner&&ee.postMessage(this._owner,new e.Msg.WALayoutChanged(this)))}onActivateRequest(t){super.onActivateRequest(t),this._widget&&this.resizeAndRender(),this._owner&&ee.postMessage(this._owner,new e.Msg.WAActivateRequest(this))}onResize(e){super.onResize(e),this.node&&null!==this.node.offsetParent&&e.width>=0&&e.height>=0?(this._width=e.width,this._height=e.height,this.resizeAndRender()):this._widgetLayout}onCloseRequest(e){this._closable.canClose(this._widget,this)&&this.dispose()}};o(Et,"WidgetAdapter");let Tt=Et;const Lt=class _WidgetAdapterArray extends Array{constructor(e){super(...e)}static create(){return Object.create(_WidgetAdapterArray.prototype)}watchRendered(e,t){if(!t)return;const i=this.map(e=>({wa:e,w:e.widget,rc:e.widget.renderCount()})),n=setInterval(()=>{s()&&(clearInterval(n),t(e))},20);function s(){for(const e of i)if(e.wa.isVisible&&e.rc>=e.w.renderCount())return!1;return!0}o(s,"complete")}};o(Lt,"WidgetAdapterArray");let Dt=Lt;const Bt=class _PRenderer extends pt.Renderer{constructor(){super(),a(this,"_owner")}createTabBar(){const e=super.createTabBar();return e.tabsMovable=this._owner.tabsMovable,e}};o(Bt,"PRenderer");let Rt=Bt;const Pt=class _PDockPanel extends pt{constructor(e={}){e.renderer=e.renderer||new Rt,super(e),a(this,"_content"),a(this,"_contentMap"),this._renderer instanceof Rt&&(this._renderer._owner=this),this._content=Dt.create(),this._contentMap={}}appendContent(e){this._content.push(e),this._contentMap[e.widget.id()]=e}removeContent(e){const t=this._content.indexOf(e);t>=0&&this._content.splice(t,1),delete this._contentMap[e.widget.id()],e.dispose()}content(){return this._content}serializeWidget(e){if(e instanceof Tt)try{return{__id:e.widget.id()}}catch(t){return{exception:{message:t.message??"",stack:t.stack??[]}}}return null}deserializeWidget(e){let t=this._contentMap[e.__id];return t||(t=new Tt(void 0,e)),t}serializeITabAreaConfig(e,t){return{...e,widgets:e.widgets.map(e=>t?this.deserializeWidget(e):this.serializeWidget(e))}}serializeISplitAreaConfig(e,t){return{...e,children:e.children.map(e=>this.serializeAreaConfig(e,t))}}serializeAreaConfig(e,t){if(e)switch(e.type){case"tab-area":return this.serializeITabAreaConfig(e,t);case"split-area":return this.serializeISplitAreaConfig(e,t)}}saveLayout(){return{main:this.serializeAreaConfig(super.saveLayout().main,!1)}}restoreLayout(e){return super.restoreLayout({main:this.serializeAreaConfig(e.main,!0)})}};o(Pt,"PDockPanel");let Wt=Pt;const Ht=class _DockPanel extends t.HTMLWidget{constructor(){super(),a(this,"_dock",new Wt({mode:"multiple-document"})),a(this,"_layoutObj",null),a(this,"_pPlaceholder"),a(this,"_prevHideSingleTabs"),a(this,"_lazyLayoutChanged",t.Utility.debounce(async()=>{this.layoutChanged()},1e3)),a(this,"_prevActive"),this._tag="div",this._dock.id="p"+this.id(),ee.installMessageHook(this,this)}getWidgetAdapter(e){let t=null;return this._dock.content().some(i=>i.widget===e&&(t=i,!0)),t}addWidget(e,t,i="split-right",n,s,r=8){const o={mode:i,ref:this.getWidgetAdapter(n)},a=new Tt(this,e,{},s);return a.title.label=t,a.padding=r,this._dock.addWidget(a,o),this._dock.appendContent(a),this._dock.tabsMovable=!0,this}removeWidget(e){const t=this.getWidgetAdapter(e);return t&&(e.target(null),this._dock.removeContent(t)),this}isVisible(e){return this.getWidgetAdapter(e).isVisible}widgetAdapters(){return this._dock.content()}widgets(){return this._dock.content().map(e=>e.widget)}layout(e){return arguments.length?(this._dock.restoreLayout(e),this):this._dock.saveLayout()}layoutObj(e){return this._layoutObj=e,this}enter(e,t){super.enter(e,t),this._pPlaceholder=t.append("div"),we.attach(this._dock,this._pPlaceholder.node())}update(e,t){super.update(e,t),this._pPlaceholder.style("width",this.width()+"px").style("height",this.height()+"px").style("overflow","hidden"),t.select(".lm-Widget").style("width",this._pPlaceholder.node().clientWidth+"px").style("height",this.height()+"px"),this.widgets().forEach(e=>e.render())}exit(e,t){[...this.widgets()].forEach(e=>this.removeWidget(e)),we.detach(this._dock),super.exit(e,t)}render(e){const i=this;return null!==this._layoutObj&&(this.layout(this._layoutObj),this.layoutObj(null)),super.render(n=>{this._dock.content().watchRendered(this,e),this._dock.update(),setTimeout(()=>{const e=this.element().selectAll(".lm-Widget.lm-TabBar.lm-DockPanel-tabBar");let n=!1;e.each(function(){const e=t.select(this),s=e.node().childNodes[0].childNodes.length,r=i.hideSingleTabs()&&1===s;r!==e.classed("hide")&&(e.classed("hide",r),n=!0)}),n&&this._dock.fit()},0)})}refit(){this._dock.fit()}messageHook(e,t){return e===this&&this.processMessage(t),!0}processMessage(t){switch(t.type){case e.Msg.WAActivateRequest.type:const i=t.wa,n=i.widget;this._prevActive!==n&&(this._prevActive=n,this.childActivation(n,i));break;case e.Msg.WALayoutChanged.type:this._lazyLayoutChanged()}}active(){return this._prevActive}childActivation(e,t){}layoutChanged(){}};o(Ht,"DockPanel");let Nt=Ht;Nt.prototype._class+=" phosphor_DockPanel",Nt.prototype.publish("hideSingleTabs",!1,"boolean");const Ot=class _SplitPanel extends t.HTMLWidget{constructor(e="vertical"){super(),a(this,"_split"),a(this,"content",Dt.create()),this._split=new Fe({orientation:e}),this._tag="div",this._split.id="p"+this.id()}getWidgetAdapter(e){let t=null;return this.content.some(i=>i.widget===e&&(t=i,!0)),t}addWidget(e){const t=new Tt(this,e);return this._split.addWidget(t),this.content.push(t),this}relativeSizes(e){return arguments.length?(this._split.setRelativeSizes(e),this):this._split.relativeSizes()}enter(e,t){super.enter(e,t),we.attach(this._split,e)}update(e,t){super.update(e,t),t.select(".lm-Widget").style("width",this.width()+"px").style("height",this.height()+"px")}exit(e,t){we.detach(this._split),super.exit(e,t)}render(e){return super.render(t=>{this.content.watchRendered(this,e),this._split.update()})}};o(Ot,"SplitPanel");let Ft=Ot;Ft.prototype._class+=" phosphor_SplitPanel";const qt=class _TabPanel extends t.HTMLWidget{constructor(){super(),a(this,"_tab",new zt({tabPlacement:"top"})),a(this,"content",Dt.create()),a(this,"_prevActive"),this._tag="div",this._tab.id="p"+this.id()}getWidget(e){if(e instanceof Tt)return e.widget}getWidgetAdapter(e){let t=null;return this.content.some(i=>i.widget===e&&(t=i,!0)),t}addWidget(e,t,i={}){this._prevActive||(this._prevActive=e);const n=new Tt(this,e,void 0,void 0,i);return n.title.label=t,n.padding=8,this._tab.addWidget(n),this.content.push(n),this}removeWidget(e){const t=this.getWidgetAdapter(e);if(t){const i=this.content.indexOf(t);i>=0&&this.content.splice(i,1),e.target(null),t.dispose()}return this}enter(e,t){super.enter(e,t),we.attach(this._tab,e)}update(e,t){super.update(e,t),t.select(".lm-Widget").style("width",this.width()+"px").style("height",this.height()+"px")}exit(e,t){we.detach(this._tab),super.exit(e,t)}render(e){return super.render(t=>{this.content.watchRendered(this,e),this._tab.update()})}messageHook(e,t){return e===this&&this.processMessage(t),!0}processMessage(e){if("wa-activate-request"===e.type){const t=e.wa.widget;this._prevActive!==t&&(this._prevActive=t,this.childActivation(t))}}childActivation(e){}active(e){return arguments.length?(this._tab.currentWidget=this.getWidgetAdapter(e),this):this.getWidget(this._tab.currentWidget)}};o(qt,"TabPanel");let Kt=qt;Kt.prototype._class+=" phosphor_TabPanel",e.BUILD_VERSION="3.2.1",e.CommandPalette=Je,e.CommandRegistry=V,e.ContextMenu=rt,e.DockPanel=Nt,e.PKG_NAME="@hpcc-js/phosphor",e.PKG_VERSION="3.1.0",e.SplitPanel=Ft,e.TabPanel=Kt,e.WidgetAdapter=Tt,e.WidgetAdapterArray=Dt,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
67
2
|
//# sourceMappingURL=index.umd.cjs.map
|
|
68
|
-
|
|
3
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.lm-Widget{box-sizing:border-box;position:relative}.lm-Widget.lm-mod-hidden{display:none!important}.lm-CommandPalette{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-CommandPalette-search{flex:0 0 auto}.lm-CommandPalette-content{flex:1 1 auto;margin:0;padding:0;min-height:0;overflow:auto;list-style-type:none}.lm-CommandPalette-header{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.lm-CommandPalette-item{display:flex;flex-direction:row}.lm-CommandPalette-itemIcon{flex:0 0 auto}.lm-CommandPalette-itemContent{flex:1 1 auto;overflow:hidden}.lm-CommandPalette-itemShortcut{flex:0 0 auto}.lm-CommandPalette-itemLabel{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.lm-close-icon{border:1px solid transparent;background-color:transparent;position:absolute;z-index:1;right:3%;top:0;bottom:0;margin:auto;padding:7px 0;display:none;vertical-align:middle;outline:0;cursor:pointer}.lm-close-icon:after{content:"X";display:block;width:15px;height:15px;text-align:center;color:#000;font-weight:400;font-size:12px;cursor:pointer}.lm-DockPanel,.lm-DockPanel-widget{z-index:0}.lm-DockPanel-tabBar{z-index:1}.lm-DockPanel-handle{z-index:2}.lm-DockPanel-handle.lm-mod-hidden{display:none!important}.lm-DockPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.lm-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.lm-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.lm-DockPanel-handle[data-orientation=horizontal]:after{left:50%;min-width:8px;transform:translate(-50%)}.lm-DockPanel-handle[data-orientation=vertical]:after{top:50%;min-height:8px;transform:translateY(-50%)}.lm-DockPanel-overlay{z-index:3;box-sizing:border-box;pointer-events:none}.lm-DockPanel-overlay.lm-mod-hidden{display:none!important}.lm-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}.lm-Menu-content{margin:0;padding:0;display:table;list-style-type:none}.lm-Menu-item{display:table-row}.lm-Menu-item.lm-mod-hidden,.lm-Menu-item.lm-mod-collapsed{display:none!important}.lm-Menu-itemIcon,.lm-Menu-itemSubmenuIcon{display:table-cell;text-align:center}.lm-Menu-itemLabel{display:table-cell;text-align:left}.lm-Menu-itemShortcut{display:table-cell;text-align:right}.lm-MenuBar{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-MenuBar-content{margin:0;padding:0;display:flex;flex-direction:row;list-style-type:none}.lm-MenuBar-item{box-sizing:border-box}.lm-MenuBar-itemIcon,.lm-MenuBar-itemLabel{display:inline-block}.lm-ScrollBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-ScrollBar[data-orientation=horizontal]{flex-direction:row}.lm-ScrollBar[data-orientation=vertical]{flex-direction:column}.lm-ScrollBar-button{box-sizing:border-box;flex:0 0 auto}.lm-ScrollBar-track{box-sizing:border-box;position:relative;overflow:hidden;flex:1 1 auto}.lm-ScrollBar-thumb{box-sizing:border-box;position:absolute}.lm-SplitPanel-child{z-index:0}.lm-SplitPanel-handle{z-index:1}.lm-SplitPanel-handle.lm-mod-hidden{display:none!important}.lm-SplitPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle{cursor:ew-resize}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle{cursor:ns-resize}.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after{left:50%;min-width:8px;transform:translate(-50%)}.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after{top:50%;min-height:8px;transform:translateY(-50%)}.lm-TabBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lm-TabBar[data-orientation=horizontal]{flex-direction:row;align-items:flex-end}.lm-TabBar[data-orientation=vertical]{flex-direction:column;align-items:flex-end}.lm-TabBar-content{margin:0;padding:0;display:flex;flex:1 1 auto;list-style-type:none}.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content{flex-direction:row}.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content{flex-direction:column}.lm-TabBar-tab{display:flex;flex-direction:row;box-sizing:border-box;overflow:hidden;touch-action:none}.lm-TabBar-tabIcon,.lm-TabBar-tabCloseIcon{flex:0 0 auto}.lm-TabBar-tabLabel{flex:1 1 auto;overflow:hidden;white-space:nowrap}.lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box}.lm-TabBar-tab.lm-mod-hidden,.lm-TabBar-addButton.lm-mod-hidden{display:none!important}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab{position:relative}.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab{left:0;transition:left .15s ease}.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab{top:0;transition:top .15s ease}.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box;background:inherit}.lm-TabPanel-tabBar{z-index:1}.lm-TabPanel-stackedPanel{z-index:0}.phosphor_WidgetAdapter{border-left:1px solid #C0C0C0;border-right:1px solid #C0C0C0;border-bottom:1px solid #C0C0C0;background:#fff;min-width:64px;min-height:64px}.phosphor_WidgetAdapter.lm-DockPanel-widget{border-top:none;box-shadow:0 -1px #0003,1px 1px 2px #0003}.phosphor_WidgetAdapter.lm-SplitPanel-child{border:none}.lm-DockPanel-overlay{background:#fff9;border:1px dashed black;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.lm-TabBar{min-height:24px;max-height:24px}.lm-TabBar-content{min-width:0;min-height:0;align-items:flex-end}.lm-TabPanel-tabBar .lm-TabBar-content{border-bottom:1px solid #C0C0C0}.lm-TabBar-tab{padding:0 10px;background:#e5e5e5;border:1px solid #C0C0C0;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}.lm-TabBar-tab.lm-mod-current{background:#fff}.lm-TabBar-tab:hover:not(.lm-mod-current){background:#f0f0f0}.lm-TabBar-tab:first-child{margin-left:0}.lm-TabBar-tab.lm-mod-current{min-height:23px;max-height:23px;transform:translateY(1px)}.lm-TabBar-tabIcon,.lm-TabBar-tabLabel,.lm-TabBar-tabCloseIcon{display:inline-block}.lm-TabBar-tab.lm-mod-closable>.lm-TabBar-tabCloseIcon{margin-left:4px}.lm-TabBar-tab.lm-mod-closable>.lm-TabBar-tabCloseIcon:before{content:"";font-family:FontAwesome}.lm-TabBar-tab.lm-mod-drag-image{min-height:23px;max-height:23px;min-width:125px;border:none;box-shadow:1px 1px 2px #0000004d;transform:translate(-40%) translateY(-58%)}.lm-Widget.lm-TabBar.lm-DockPanel-tabBar.hide{min-height:1px!important;max-height:1px!important}.lm-Widget.lm-TabBar.lm-DockPanel-tabBar.hide .lm-TabBar-tab.lm-mod-current{display:none}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|