diff --git a/examples/v0.2/index.html b/examples/v0.2/index.html index 051f2b3c5..36f1f71e7 100644 --- a/examples/v0.2/index.html +++ b/examples/v0.2/index.html @@ -261,7 +261,7 @@ } else if (x === 2) { config.halign = 'left'; config.value = [null, config.value, upDownSpinIMG]; - } else if (x === 3) { + } else if (x === 3 && !doAggregates) { config.halign = 'left'; var dateString = value = config.value.getFullYear() + '-' + leadingZeroIfNecessary(config.value.getMonth() + 1) + '-' + leadingZeroIfNecessary(config.value.getDay()); config.value = [null, dateString, downArrowIMG]; diff --git a/examples/v0.2/index.js b/examples/v0.2/index.js index ce5a96098..775c79459 100644 --- a/examples/v0.2/index.js +++ b/examples/v0.2/index.js @@ -1,5 +1,5 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o'+t.replace("mouse","")+""}),e.appendChild(n),t={},i.forEach(function(e){t[e]=n.getElementsByClassName(e)[0]})}return t},_addEvt:function(t){var e=this.testPanelItem&&this.testPanelItem[t];e&&e.classList.add("listening"),window.addEventListener(t,this._bound["on"+t])},_removeEvt:function(t){var e=this.testPanelItem&&this.testPanelItem[t];e&&e.classList.remove("listening"),window.removeEventListener(t,this._bound["on"+t])}};var a,u={shortStop:function(t){t.stopPropagation()},onwheel:function(t){this.index+=t[this.deltaProp],t.stopPropagation(),t.preventDefault()},onclick:function(t){var e=this.thumb.getBoundingClientRect(),i=t[this.oh.coordinate].thumb,div.finbar-vertical>.thumb{position:absolute;background-color:#d3d3d3;-webkit-box-shadow:0 0 1px #000;-moz-box-shadow:0 0 1px #000;box-shadow:0 0 1px #000;border-radius:4px;margin:2px;opacity:.4;transition:opacity .5s}div.finbar-horizontal>.thumb.hover,div.finbar-vertical>.thumb.hover{opacity:1;transition:opacity .5s}div.finbar-vertical{top:0;bottom:0;right:0;width:11px}div.finbar-vertical>.thumb{top:0;right:0;width:7px}div.finbar-horizontal{left:0;right:0;bottom:0;height:11px}div.finbar-horizontal>.thumb{left:0;bottom:0;height:7px}",e.exports=n},{"css-injector":3}],6:[function(t,e,i){"use strict";function n(t,e){var i=this;this.div=t,this._component=e,this.dragEndtime=Date.now(),this.canvas=document.createElement("canvas"),this.div.appendChild(this.canvas),this.canvas.style.outline="none",this.canvasCTX=this.canvas.getContext("2d"),this.gc=new u(this.canvasCTX),this.buffer=document.createElement("canvas"),this.bufferCTX=this.buffer.getContext("2d"),this.bufferGC=new u(this.bufferCTX),this.mouseLocation=new l.Point(-1,-1),this.dragstart=new l.Point(-1,-1),this.bounds=new l.Rectangle(0,0,0,0),this.hasMouse=!1,document.addEventListener("mousemove",function(t){(i.hasMouse||i.isDragging())&&i.finmousemove(t)}),document.addEventListener("mouseup",function(t){i.finmouseup(t)}),document.addEventListener("wheel",function(t){i.finwheelmoved(t)}),document.addEventListener("keydown",function(t){i.finkeydown(t)}),document.addEventListener("keyup",function(t){i.finkeyup(t)}),this.canvas.onmouseover=function(){i.hasMouse=!0},this.canvas.addEventListener("focus",function(t){i.finfocusgained(t)}),this.canvas.addEventListener("blur",function(t){i.finfocuslost(t)}),this.canvas.addEventListener("mousedown",function(t){i.finmousedown(t)}),this.canvas.addEventListener("mouseout",function(t){i.hasMouse=!1,i.finmouseout(t)}),this.canvas.addEventListener("click",function(t){i.finclick(t)}),this.canvas.addEventListener("contextmenu",function(t){return i.fincontextmenu(t),t.preventDefault(),!1}),a.addEventListener(this.canvas,"tap",function(t){i.fintap(t)}),a.addEventListener(this.canvas,"holdpulse",function(t){i.finholdpulse(t)}),a.addEventListener(this.canvas,"flick",function(t){i.finflick(t)}),a.addEventListener(this.canvas,"release",function(t){i.finrelease(t)}),a.addEventListener(this.canvas,"trackstart",function(t){i.fintrackstart(t)}),a.addEventListener(this.canvas,"track",function(t){i.fintrack(t)}),a.addEventListener(this.canvas,"trackend",function(t){i.fintrackend(t)}),this.canvas.setAttribute("tabindex",0),this.canvas.contentEditable=!0,this.resize(),this.beginResizing(),this.beginPainting()}function o(t){if(g){for(var e=0;ei;i++)t[i]=e;return t[27]=["ESC","ESCSHIFT"],t[192]=["`","~"],t[49]=["1","!"],t[50]=["2","@"],t[51]=["3","#"],t[52]=["4","$"],t[53]=["5","%"],t[54]=["6","^"],t[55]=["7","&"],t[56]=["8","*"],t[57]=["9","("],t[48]=["0",")"],t[189]=["-","_"],t[187]=["=","+"],t[8]=["DELETE","DELETESHIFT"],t[9]=["TAB","TABSHIFT"],t[81]=["q","Q"],t[87]=["w","W"],t[69]=["e","E"],t[82]=["r","R"],t[84]=["t","T"],t[89]=["y","Y"],t[85]=["u","U"],t[73]=["i","I"],t[79]=["o","O"],t[80]=["p","P"],t[219]=["[","{"],t[221]=["]","}"],t[220]=["\\","|"],t[220]=["CAPSLOCK","CAPSLOCKSHIFT"],t[65]=["a","A"],t[83]=["s","S"],t[68]=["d","D"],t[70]=["f","F"],t[71]=["g","G"],t[72]=["h","H"],t[74]=["j","J"],t[75]=["k","K"],t[76]=["l","L"],t[186]=[";",":"],t[222]=["'","|"],t[13]=["RETURN","RETURNSHIFT"],t[16]=["SHIFT","SHIFT"],t[90]=["z","Z"],t[88]=["x","X"],t[67]=["c","C"],t[86]=["v","V"],t[66]=["b","B"],t[78]=["n","N"],t[77]=["m","M"],t[188]=[",","<"],t[190]=[".",">"],t[191]=["/","?"],t[16]=["SHIFT","SHIFT"],t[17]=["CTRL","CTRLSHIFT"],t[18]=["ALT","ALTSHIFT"],t[91]=["COMMANDLEFT","COMMANDLEFTSHIFT"],t[32]=["SPACE","SPACESHIFT"],t[93]=["COMMANDRIGHT","COMMANDRIGHTSHIFT"],t[18]=["ALT","ALTSHIFT"],t[38]=["UP","UPSHIFT"],t[37]=["LEFT","LEFTSHIFT"],t[40]=["DOWN","DOWNSHIFT"],t[39]=["RIGHT","RIGHTSHIFT"],t[33]=["PAGEUP","PAGEUPSHIFT"],t[34]=["PAGEDOWN","PAGEDOWNSHIFT"],t[35]=["PAGERIGHT","PAGERIGHTSHIFT"],t[36]=["PAGELEFT","PAGELEFTSHIFT"],t}var l=t("rectangular"),a=t("./js/polymergestures.dev.js"),u=t("./js/GraphicsContext.js"),c=200,h=[],d=[],g=!0,f=!0,p=s();n.prototype={constructor:n.prototype.constructor,div:null,_component:null,gestures:a,canvas:null,canvasCTX:null,focuser:null,buffer:null,ctx:null,mouseLocation:null,holdPulseCount:-1,dragstart:null,origin:null,bounds:null,dirty:!1,size:null,mousedown:!1,dragging:!1,repeatKeyCount:0,repeatKey:null,repeatKeyStartTime:0,currentKeys:[],hasMouse:!1,lastDoubleClickTime:0,dragEndTime:0,lastRepaintTime:0,addEventListener:function(t,e){this.canvas.addEventListener(t,e)},stopPaintLoop:function(){g=!1},restartPaintLoop:function(){g||(g=!0,requestAnimationFrame(o))},stopResizeLoop:function(){f=!1},restartResizeLoop:function(){f||(f=!0,setInterval(r,200))},detached:function(){this.stopPainting(),this.stopResizing()},useHiDPI:function(){return this._component.resolveProperty("useHiDPI")},useBitBlit:function(){return this._component.resolveProperty("useBitBlit")},getFPS:function(){var t=this._component.resolveProperty("repaintIntervalRate");return t?parseInt(t):0},tickPaint:function(t){var e=this.getFPS();if(0!==e){var i=1e3/e,n=t-this.lastRepaintTime;n>i&&this.dirty&&(this.lastRepaintTime=t-n%i,this.paintNow())}},beginPainting:function(){var t=this;this.dirty=!0,this.tickPainter=function(e){t.tickPaint(e)},h.push(this)},stopPainting:function(){h.splice(h.indexOf(this),1)},beginResizing:function(){var t=this;this.tickResizer=function(){t.checksize()},d.push(this)},stopResizing:function(){d.splice(d.indexOf(this),1)},start:function(){this.beginPainting(),this.beginResizing()},stop:function(){this.stopPainting(),this.stopResizing()},checksize:function(){var t=this.div.getBoundingClientRect();(t.width!==this.size.width||t.height!==this.size.height)&&this.sizeChangedNotification()},sizeChangedNotification:function(){this.resize()},resize:function(){var t=this.size=this.div.getBoundingClientRect();this.canvas.width=this.buffer.width=t.width,this.canvas.height=this.buffer.height=t.height;var e=1,i=this.useBitBlit(),n=window.devicePixelRatio&&this.useHiDPI();if(n){var o=window.devicePixelRatio||1,r=this.canvasCTX.webkitBackingStorePixelRatio||this.canvasCTX.mozBackingStorePixelRatio||this.canvasCTX.msBackingStorePixelRatio||this.canvasCTX.oBackingStorePixelRatio||this.canvasCTX.backingStorePixelRatio||1;e=o/r}var s=this.canvas.getAttribute("width"),a=this.canvas.getAttribute("height");this.canvas.width=s*e,this.canvas.height=a*e,this.buffer.width=s*e,this.buffer.height=a*e,this.canvas.style.width=s+"px",this.canvas.style.height=a+"px",this.buffer.style.width=s+"px",this.buffer.style.height=a+"px",this.bufferCTX.scale(e,e),n&&!i&&this.canvasCTX.scale(e,e),this.bounds=new l.Rectangle(0,0,t.width,t.height);var u=this._component;u&&u.setBounds(this.bounds),this.resizeNotification(),this.paintNow()},resizeNotification:function(){},getBounds:function(){return this.bounds},paintNow:function(){var t=this;this.safePaintImmediately(function(e){e.clearRect(0,0,t.canvas.width,t.canvas.height);var i=t._component;i&&i._paint(e),t.dirty=!1})},safePaintImmediately:function(t){var e=this.useBitBlit(),i=e?this.bufferGC:this.gc;try{i.save(),t(i)}catch(n){console.error(n)}finally{i.restore()}e&&this.flushBuffer()},flushBuffer:function(){this.buffer.width>0&&this.buffer.height>0&&this.canvasCTX.drawImage(this.buffer,0,0)},dispatchNewEvent:function(t,e,i){return i={detail:i||{}},i.detail.primitiveEvent=t,this.canvas.dispatchEvent(new CustomEvent(e,i))},dispatchNewMouseKeysEvent:function(t,e,i){return i=i||{},i.mouse=this.mouseLocation,i.keys=this.currentKeys,this.dispatchNewEvent(t,e,i)},finmousemove:function(t){!this.isDragging()&&this.mousedown&&(this.beDragging(),this.dispatchNewMouseKeysEvent(t,"fin-canvas-dragstart",{isRightClick:this.isRightClick(t)}),this.dragstart=new l.Point(this.mouseLocation.x,this.mouseLocation.y)),this.mouseLocation=this.getLocal(t),this.isDragging()&&this.dispatchNewMouseKeysEvent(t,"fin-canvas-drag",{dragstart:this.dragstart,isRightClick:this.isRightClick(t)}),this.bounds.contains(this.mouseLocation)&&this.dispatchNewMouseKeysEvent(t,"fin-canvas-mousemove")},finmousedown:function(t){this.mouseLocation=this.getLocal(t),this.mousedown=!0,this.dispatchNewMouseKeysEvent(t,"fin-canvas-mousedown",{isRightClick:this.isRightClick(t)}),this.takeFocus()},finmouseup:function(t){this.isDragging()&&(this.dispatchNewMouseKeysEvent(t,"fin-canvas-dragend",{dragstart:this.dragstart,isRightClick:this.isRightClick(t)}),this.beNotDragging(),this.dragEndtime=Date.now()),this.mousedown=!1,this.dispatchNewMouseKeysEvent(t,"fin-canvas-mouseup",{isRightClick:this.isRightClick(t)})},finmouseout:function(t){this.mousedown||(this.mouseLocation=new l.Point(-1,-1)),this.dispatchNewMouseKeysEvent(t,"fin-canvas-mouseout")},finwheelmoved:function(t){!this.isDragging()&&this.hasFocus()&&(t.preventDefault(),this.dispatchNewMouseKeysEvent(t,"fin-canvas-wheelmoved",{isRightClick:this.isRightClick(t)}))},finclick:function(t){return Date.now()-this.lastClickTime<250?void this.findblclick(t):(this.mouseLocation=this.getLocal(t),this.dispatchNewMouseKeysEvent(t,"fin-canvas-click",{isRightClick:this.isRightClick(t)}),void(this.lastClickTime=Date.now()))},finrelease:function(t){this.holdPulseCount=0,this.mouseLocation=this.getLocal(t),this.dispatchNewMouseKeysEvent(t,"fin-canvas-release")},finflick:function(t){this.hasFocus()&&(this.mouseLocation=this.getLocal(t),this.dispatchNewMouseKeysEvent(t,"fin-canvas-flick",{isRightClick:this.isRightClick(t)}))},fintrackstart:function(t){this.hasFocus()&&(this.mouseLocation=this.getLocal(t),this.dispatchNewMouseKeysEvent(t,"fin-canvas-trackstart"))},fintrack:function(t){this.hasFocus()&&(this.mouseLocation=this.getLocal(t),this.dispatchNewMouseKeysEvent(t,"fin-canvas-track"))},fintrackend:function(t){this.mouseLocation=this.getLocal(t),this.dispatchNewMouseKeysEvent(t,"fin-canvas-trackend")},finhold:function(t){this.mouseLocation=this.getLocal(t),this.dispatchNewMouseKeysEvent(t,"fin-canvas-hold",{isRightClick:this.isRightClick(t)})},finholdpulse:function(t){this.mouseLocation=this.getLocal(t),this.dispatchNewMouseKeysEvent(t,"fin-canvas-holdpulse",{count:this.holdPulseCount++})},fintap:function(t){var e=this,i=Date.now(),n=i-this.lastDoubleClickTime;300>n||i-this.dragEndtime<100||setTimeout(function(){e._fintap(t)},180)},_fintap:function(t){var e=Date.now(),i=e-this.lastDoubleClickTime;300>i||this.dispatchNewMouseKeysEvent(t,"fin-canvas-tap",{isRightClick:this.isRightClick(t)})},findblclick:function(t){this.mouseLocation=this.getLocal(t),this.lastDoubleClickTime=Date.now(),this.dispatchNewMouseKeysEvent(t,"fin-canvas-dblclick",{isRightClick:this.isRightClick(t)})},getCharMap:function(){return p},finkeydown:function(t){if(this.hasFocus()){var e=t.shiftKey?p[t.keyCode][1]:p[t.keyCode][0];t.repeat?this.repeatKey===e?this.repeatKeyCount++:(this.repeatKey=e,this.repeatKeyStartTime=Date.now()):(this.repeatKey=null,this.repeatKeyCount=0,this.repeatKeyStartTime=0),-1===this.currentKeys.indexOf(e)&&this.currentKeys.push(e),this.dispatchNewEvent(t,"fin-canvas-keydown",{alt:t.altKey,ctrl:t.ctrlKey,"char":e,code:t.charCode,key:t.keyCode,meta:t.metaKey,repeatCount:this.repeatKeyCount,repeatStartTime:this.repeatKeyStartTime,shift:t.shiftKey,identifier:t.keyIdentifier,currentKeys:this.currentKeys.slice(0)})}},finkeyup:function(t){var e=t.shiftKey?p[t.keyCode][1]:p[t.keyCode][0];this.currentKeys.splice(this.currentKeys.indexOf(e),1),this.hasFocus()&&(this.repeatKeyCount=0,this.repeatKey=null,this.repeatKeyStartTime=0,this.dispatchNewEvent(t,"fin-canvas-keyup",{alt:t.altKey,ctrl:t.ctrlKey,"char":e,code:t.charCode,key:t.keyCode,meta:t.metaKey,repeat:t.repeat,shift:t.shiftKey,identifier:t.keyIdentifier,currentKeys:this.currentKeys.slice(0)}))},finfocusgained:function(t){this.dispatchNewEvent(t,"fin-canvas-focus-gained")},finfocuslost:function(t){this.dispatchNewEvent(t,"fin-canvas-focus-lost")},fincontextmenu:function(t){return t.ctrlKey&&-1===this.currentKeys.indexOf("CTRL")&&this.currentKeys.push("CTRL"),Date.now()-this.lastClickTime<250?void this.findblclick(t):(this.dispatchNewMouseKeysEvent(t,"fin-canvas-context-menu",{isRightClick:this.isRightClick(t)}),void(this.lastClickTime=Date.now()))},repaint:function(){var t=this.getFPS();this.dirty=!0,g&&0!==t||this.paintNow()},getMouseLocation:function(){return this.mouseLocation},getOrigin:function(){var t=this.canvas.getBoundingClientRect(),e=new l.Point(t.left,t.top);return e},getLocal:function(t){var e=this.canvas.getBoundingClientRect(),i=new l.Point(t.clientX-e.left,t.clientY-e.top);return i},hasFocus:function(){return document.activeElement===this.canvas},takeFocus:function(){var t=this;this.hasFocus()||setTimeout(function(){t.canvas.focus()},10)},beDragging:function(){this.dragging=!0,this.disableDocumentElementSelection()},beNotDragging:function(){this.dragging=!1,this.enableDocumentElementSelection()},isDragging:function(){return this.dragging},disableDocumentElementSelection:function(){var t=document.body.style;t.cssText=t.cssText+"-webkit-user-select: none"},enableDocumentElementSelection:function(){var t=document.body.style;t.cssText=t.cssText.replace("-webkit-user-select: none","")},setFocusable:function(t){this.focuser.style.display=t?"":"none"},isRightClick:function(t){var e;return t=t||window.event,"which"in t?e=3===t.which:"button"in t&&(e=2===t.button),e},dispatchEvent:function(t){return this.canvas.dispatchEvent(t)}},requestAnimationFrame(o),setInterval(r,c),e.exports=n},{"./js/GraphicsContext.js":7,"./js/polymergestures.dev.js":9,rectangular:30}],7:[function(t,e,i){"use strict";function n(t,e){function i(i){i in n.prototype||s.test(i)||("function"==typeof t[i]?r[i]=e?function(){return e(i,arguments,t[i].apply(t,arguments))}:t[i].bind(t):Object.defineProperty(r,i,{get:function(){var n=t[i];return e?e(i,"getter",n):n},set:function(n){t[i]=e?e(i,"setter",n):n}}))}this.gc=t;var r=this,s=/^webkit/;switch(typeof e){case"string":e=o.bind(void 0,e+".");break;case"boolean":e===!0&&(e=o.bind(void 0,"gc."));break;case"function":if(3!==e.length)throw"GraphicsContext: User-supplied API logger function does not accept three parameters.";break;default:e=!1}Object.keys(Object.getPrototypeOf(t)).forEach(i),Object.keys(t).forEach(i)}var o=t("./gc-console-logger");e.exports=n},{"./gc-console-logger":8}],8:[function(t,e,i){"use strict";function n(t,e,i,n){var r=n;switch("string"==typeof n&&(r='"'+r+'"'),e=t+e,i){case"getter":console.log(e,"=",r);break;case"setter":console.log(e,o,r);break;default:e+="("+Array.prototype.slice.call(i).join(", ")+")",void 0===r?console.log(e):console.log(e,o,r)}return n}var o="⟹";e.exports=n},{}],9:[function(t,e,i){!function(t){var e=!1,i=document.createElement("meta");if(i.createShadowRoot){var n=i.createShadowRoot(),o=document.createElement("span");n.appendChild(o),i.addEventListener("testpath",function(t){t.path&&(e=t.path[0]===o),t.stopPropagation()});var r=new CustomEvent("testpath",{bubbles:!0});document.head.appendChild(i),o.dispatchEvent(r),i.parentNode.removeChild(i),n=o=null}i=null;var s={shadow:function(t){return t?t.shadowRoot||t.webkitShadowRoot:void 0},canTarget:function(t){return t&&Boolean(t.elementFromPoint)},targetingShadow:function(t){var e=this.shadow(t);return this.canTarget(e)?e:void 0},olderShadow:function(t){var e=t.olderShadowRoot;if(!e){var i=t.querySelector("shadow");i&&(e=i.olderShadowRoot)}return e},allShadows:function(t){for(var e=[],i=this.shadow(t);i;)e.push(i),i=this.olderShadow(i);return e},searchRoot:function(t,e,i){var n,o;return t?(n=t.elementFromPoint(e,i),n?o=this.targetingShadow(n):t!==document&&(o=this.olderShadow(t)),this.searchRoot(o,e,i)||n):void 0},owner:function(t){if(!t)return document;for(var e=t;e.parentNode;)e=e.parentNode;return e.nodeType!=Node.DOCUMENT_NODE&&e.nodeType!=Node.DOCUMENT_FRAGMENT_NODE&&(e=document),e},findTarget:function(t){if(e&&t.path&&t.path.length)return t.path[0];var i=t.clientX,n=t.clientY,o=this.owner(t.target);return o.elementFromPoint(i,n)||(o=document),this.searchRoot(o,i,n)},findTouchAction:function(t){var i;if(e&&t.path&&t.path.length){for(var n=t.path,o=0;o=0?t=this.walk(t,o):e=this.walk(e,-o);t&&e&&t!==e;)t=t.parentNode||t.host,e=e.parentNode||e.host;return t},walk:function(t,e){for(var i=0;t&&e>i;i++)t=t.parentNode||t.host;return t},depth:function(t){for(var e=0;t;)e++,t=t.parentNode||t.host;return e},deepContains:function(t,e){var i=this.LCA(t,e);return i===t},insideNode:function(t,e,i){var n=t.getBoundingClientRect();return n.left<=e&&e<=n.right&&n.top<=i&&i<=n.bottom},path:function(t){var i;if(e&&t.path&&t.path.length)i=t.path;else{i=[];for(var n=this.findTarget(t);n;)i.push(n),n=n.parentNode||n.host}return i}};t.targetFinding=s,t.findTarget=s.findTarget.bind(s),t.deepContains=s.deepContains.bind(s),t.insideNode=s.insideNode}(i),function(){function t(t){return"html /deep/ "+e(t)}function e(t){return'[touch-action="'+t+'"]'}function i(t){return"{ -ms-touch-action: "+t+"; touch-action: "+t+";}"}var n=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]},"manipulation"],o="",r="string"==typeof document.head.style.touchAction,s=!window.ShadowDOMPolyfill&&document.head.createShadowRoot;if(r){n.forEach(function(n){String(n)===n?(o+=e(n)+i(n)+"\n",s&&(o+=t(n)+i(n)+"\n")):(o+=n.selectors.map(e)+i(n.rule)+"\n",s&&(o+=n.selectors.map(t)+i(n.rule)+"\n"))});var l=document.createElement("style");l.textContent=o,document.head.appendChild(l)}}(),function(t){var e=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],i=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],n=function(){ return function(){}},o={preventTap:n,makeBaseEvent:function(t,e){var i=document.createEvent("Event");return i.initEvent(t,e.bubbles||!1,e.cancelable||!1),i.preventTap=o.preventTap(i),i},makeGestureEvent:function(t,e){e=e||Object.create(null);for(var i,n=this.makeBaseEvent(t,e),o=0,r=Object.keys(e);o-1?this.values[i]=e:(this.keys.push(t),this.values.push(e))},has:function(t){return this.keys.indexOf(t)>-1},"delete":function(t){var e=this.keys.indexOf(t);e>-1&&(this.keys.splice(e,1),this.values.splice(e,1))},get:function(t){var e=this.keys.indexOf(t);return this.values[e]},clear:function(){this.keys.length=0,this.values.length=0},forEach:function(t,e){this.values.forEach(function(i,n){t.call(e,i,this.keys[n],this)},this)},pointers:function(){return this.keys.length}},t.PointerMap=e}(i),function(t){var e,i=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp","preventTap","tapPrevented","_source"],n=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0,function(){},!1],o="undefined"!=typeof SVGElementInstance,r=t.eventFactory,s={IS_IOS:!1,pointermap:new t.PointerMap,requiredGestures:new t.PointerMap,eventMap:Object.create(null),eventSources:Object.create(null),eventSourceList:[],gestures:[],dependencyMap:{down:{listeners:0,index:-1},up:{listeners:0,index:-1}},gestureQueue:[],registerSource:function(t,e){var i=e,n=i.events;n&&(n.forEach(function(t){i[t]&&(this.eventMap[t]=i[t].bind(i))},this),this.eventSources[t]=i,this.eventSourceList.push(i))},registerGesture:function(t,e){var i=Object.create(null);i.listeners=0,i.index=this.gestures.length;for(var n,o=0;oo&&(i=this.eventSourceList[o]);o++)i.register.call(i,t,e)},unregister:function(t){for(var e,i=this.eventSourceList.length,n=0;i>n&&(e=this.eventSourceList[n]);n++)e.unregister.call(e,t)},down:function(t){this.requiredGestures.set(t.pointerId,e),this.fireEvent("down",t)},move:function(t){t.type="move",this.fillGestureQueue(t)},up:function(t){this.fireEvent("up",t),this.requiredGestures["delete"](t.pointerId)},cancel:function(t){t.tapPrevented=!0,this.fireEvent("up",t),this.requiredGestures["delete"](t.pointerId)},addGestureDependency:function(t,e){var i=t._pgEvents;if(i&&e)for(var n,o,r,s=Object.keys(i),l=0;l0&&(n=this.dependencyMap[r],o=n?n.index:-1,e[o]=!0)},eventHandler:function(i){var n=i.type;if("touchstart"===n||"mousedown"===n||"pointerdown"===n||"MSPointerDown"===n)if(i._handledByPG||(e={}),this.IS_IOS){var o=i;if("touchstart"===n){var r=i.changedTouches[0];o={target:i.target,clientX:r.clientX,clientY:r.clientY,path:i.path}}for(var s,l=i.path||t.targetFinding.path(o),a=0;an&&(i=e[n]);n++)this.addEvent(t,i)},unlisten:function(t,e){for(var i,n=0,o=e.length;o>n&&(i=e[n]);n++)this.removeEvent(t,i)},addEvent:function(t,e){t.addEventListener(e,this.boundHandler)},removeEvent:function(t,e){t.removeEventListener(e,this.boundHandler)},makeEvent:function(t,e){var i=r.makePointerEvent(t,e);return i.preventDefault=e.preventDefault,i.tapPrevented=e.tapPrevented,i._target=i._target||e.target,i},fireEvent:function(t,e){var i=this.makeEvent(t,e);return this.dispatchEvent(i)},cloneEvent:function(t){for(var e,r=Object.create(null),s=0;s0&&t._pgListeners--,0===t._pgListeners&&s.unregister(t),t._pgEvents&&(t._pgEvents[i]>0?t._pgEvents[i]--:t._pgEvents[i]=0)),Boolean(n)},t.removeEventListener=function(e,i,n,o){n&&(t.deactivateGesture(e,i),e.removeEventListener(i,n,o))}}(i),function(t){var e=t.dispatcher,i=e.pointermap,n=25,o=[0,1,4,2],r=0,s=/Linux.*Firefox\//i,l=function(){if(s.test(navigator.userAgent))return!1;try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(t){return!1}}(),a={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup"],exposes:["down","up","move"],register:function(t){e.listen(t,this.events)},unregister:function(t){t.nodeType!==Node.DOCUMENT_NODE&&e.unlisten(t,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(t){for(var e,i=this.lastTouches,o=t.clientX,r=t.clientY,s=0,l=i.length;l>s&&(e=i[s]);s++){var a=Math.abs(o-e.x),u=Math.abs(r-e.y);if(n>=a&&n>=u)return!0}},prepareEvent:function(t){var i=e.cloneEvent(t);if(i.pointerId=this.POINTER_ID,i.isPrimary=!0,i.pointerType=this.POINTER_TYPE,i._source="mouse",!l){var n=t.type,s=o[t.which]||0;"mousedown"===n?r|=s:"mouseup"===n&&(r&=~s),i.buttons=r}return i},mousedown:function(n){if(!this.isEventSimulatedFromTouch(n)){var o=(i.has(this.POINTER_ID),this.prepareEvent(n));o.target=t.findTarget(n),i.set(this.POINTER_ID,o.target),e.down(o)}},mousemove:function(t){if(!this.isEventSimulatedFromTouch(t)){var n=i.get(this.POINTER_ID);if(n){var o=this.prepareEvent(t);o.target=n,0===(l?o.buttons:o.which)?(l||(r=o.buttons=0),e.cancel(o),this.cleanupMouse(o.buttons)):e.move(o)}}},mouseup:function(n){if(!this.isEventSimulatedFromTouch(n)){var o=this.prepareEvent(n);o.relatedTarget=t.findTarget(n),o.target=i.get(this.POINTER_ID),e.up(o),this.cleanupMouse(o.buttons)}},cleanupMouse:function(t){0===t&&i["delete"](this.POINTER_ID)}};t.mouseEvents=a}(i),function(t){var e=t.dispatcher,i=(t.targetFinding.allShadows.bind(t.targetFinding),e.pointermap),n=(Array.prototype.map.call.bind(Array.prototype.map),2500),o=25,r=200,s=20,l=!1,a={IS_IOS:!1,events:["touchstart","touchmove","touchend","touchcancel"],exposes:["down","up","move"],register:function(t,i){(this.IS_IOS?i:!i)&&e.listen(t,this.events)},unregister:function(t){this.IS_IOS||e.unlisten(t,this.events)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y"},touchActionToScrollType:function(t){var e=t,i=this.scrollTypes;return e===i.EMITTER?"none":e===i.XSCROLLER?"X":e===i.YSCROLLER?"Y":"XY"},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(t){return this.firstTouch===t.identifier},setPrimaryTouch:function(t){(0===i.pointers()||1===i.pointers()&&i.has(1))&&(this.firstTouch=t.identifier,this.firstXY={X:t.clientX,Y:t.clientY},this.firstTarget=t.target,this.scrolling=null,this.cancelResetClickCount())},removePrimaryPointer:function(t){t.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var t=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(t,r)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(t){var e=0;return("touchstart"===t||"touchmove"===t)&&(e=1),e},findTarget:function(e,n){if("touchstart"===this.currentTouchEvent.type){if(this.isPrimaryTouch(e)){var o={clientX:e.clientX,clientY:e.clientY,path:this.currentTouchEvent.path,target:this.currentTouchEvent.target};return t.findTarget(o)}return t.findTarget(e)}return i.get(n)},touchToPointer:function(t){var i=this.currentTouchEvent,n=e.cloneEvent(t),o=n.pointerId=t.identifier+2;n.target=this.findTarget(t,o),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.buttons=this.typeToButtons(i.type),n.width=t.webkitRadiusX||t.radiusX||0,n.height=t.webkitRadiusY||t.radiusY||0,n.pressure=t.webkitForce||t.force||.5,n.isPrimary=this.isPrimaryTouch(t),n.pointerType=this.POINTER_TYPE,n._source="touch";var r=this;return n.preventDefault=function(){r.scrolling=!1,r.firstXY=null,i.preventDefault()},n},processTouches:function(t,e){var n=t.changedTouches;this.currentTouchEvent=t;for(var o,r,s=0;s=u}return i}},findTouch:function(t,e){for(var i,n=0,o=t.length;o>n&&(i=t[n]);n++)if(i.identifier===e)return!0},vacuumTouches:function(t){var e=t.touches;if(i.pointers()>=e.length){var n=[];i.forEach(function(t,i){if(1!==i&&!this.findTouch(e,i-2)){var o=t;n.push(o)}},this),n.forEach(function(t){this.cancel(t),i["delete"](t.pointerId)},this)}},touchstart:function(t){this.vacuumTouches(t),this.setPrimaryTouch(t.changedTouches[0]),this.dedupSynthMouse(t),this.scrolling||(this.clickCount++,this.processTouches(t,this.down))},down:function(t){e.down(t)},touchmove:function(t){if(l)t.cancelable&&this.processTouches(t,this.move);else if(this.scrolling){if(this.firstXY){var e=t.changedTouches[0],i=e.clientX-this.firstXY.X,n=e.clientY-this.firstXY.Y,o=Math.sqrt(i*i+n*n);o>=s&&(this.touchcancel(t),this.scrolling=!0,this.firstXY=null)}}else null===this.scrolling&&this.shouldScroll(t)?this.scrolling=!0:(this.scrolling=!1,t.preventDefault(),this.processTouches(t,this.move))},move:function(t){e.move(t)},touchend:function(t){this.dedupSynthMouse(t),this.processTouches(t,this.up)},up:function(i){i.relatedTarget=t.findTarget(i),e.up(i)},cancel:function(t){e.cancel(t)},touchcancel:function(t){t._cancel=!0,this.processTouches(t,this.cancel)},cleanUpPointer:function(t){i["delete"](t.pointerId),this.removePrimaryPointer(t)},dedupSynthMouse:function(e){var i=t.mouseEvents.lastTouches,o=e.changedTouches[0];if(this.isPrimaryTouch(o)){var r={x:o.clientX,y:o.clientY};i.push(r);var s=function(t,e){var i=t.indexOf(e);i>-1&&t.splice(i,1)}.bind(null,i,r);setTimeout(s,n)}}},u=Event.prototype.stopImmediatePropagation||Event.prototype.stopPropagation;document.addEventListener("click",function(e){var i=e.clientX,n=e.clientY,r=function(t){var e=Math.abs(i-t.x),r=Math.abs(n-t.y);return o>=e&&o>=r},s=t.mouseEvents.lastTouches.some(r),l=t.targetFinding.path(e);if(s){for(var c=0;c0?1:-1},calcPositionDelta:function(t,e){var i=0,n=0;return t&&e&&(i=e.pageX-t.pageX,n=e.pageY-t.pageY),{x:i,y:n}},fireTrack:function(t,e,n){var o=n,r=this.calcPositionDelta(o.downEvent,e),s=this.calcPositionDelta(o.lastMoveEvent,e);if(s.x)o.xDirection=this.clampDir(s.x);else if("trackx"===t)return;if(s.y)o.yDirection=this.clampDir(s.y);else if("tracky"===t)return;var l={bubbles:!0,cancelable:!0,trackInfo:o.trackInfo,relatedTarget:e.relatedTarget,pointerType:e.pointerType,pointerId:e.pointerId,_source:"track"};"tracky"!==t&&(l.x=e.x,l.dx=r.x,l.ddx=s.x,l.clientX=e.clientX,l.pageX=e.pageX,l.screenX=e.screenX,l.xDirection=o.xDirection),"trackx"!==t&&(l.dy=r.y,l.ddy=s.y,l.y=e.y,l.clientY=e.clientY,l.pageY=e.pageY,l.screenY=e.screenY,l.yDirection=o.yDirection);var a=i.makeGestureEvent(t,l);o.downTarget.dispatchEvent(a)},down:function(t){if(t.isPrimary&&("mouse"===t.pointerType?1===t.buttons:!0)){var e={downEvent:t,downTarget:t.target,trackInfo:{},lastMoveEvent:null,xDirection:0,yDirection:0,tracking:!1};n.set(t.pointerId,e)}},move:function(t){var e=n.get(t.pointerId);if(e){if(!e.tracking){var i=this.calcPositionDelta(e.downEvent,t),o=i.x*i.x+i.y*i.y;o>this.WIGGLE_THRESHOLD&&(e.tracking=!0,e.lastMoveEvent=e.downEvent,this.fireTrack("trackstart",t,e))}e.tracking&&(this.fireTrack("track",t,e),this.fireTrack("trackx",t,e),this.fireTrack("tracky",t,e)),e.lastMoveEvent=t}},up:function(t){var e=n.get(t.pointerId);e&&(e.tracking&&this.fireTrack("trackend",t,e),n["delete"](t.pointerId))}};e.registerGesture("track",o)}(i),function(t){var e=t.dispatcher,i=t.eventFactory,n={HOLD_DELAY:200,WIGGLE_THRESHOLD:16,events:["down","move","up"],exposes:["hold","holdpulse","release"],heldPointer:null,holdJob:null,pulse:function(){var t=Date.now()-this.heldPointer.timeStamp,e=this.held?"holdpulse":"hold";this.fireHold(e,t),this.held=!0},cancel:function(){clearInterval(this.holdJob),this.held&&this.fireHold("release"),this.held=!1,this.heldPointer=null,this.target=null,this.holdJob=null},down:function(t){t.isPrimary&&!this.heldPointer&&(this.heldPointer=t,this.target=t.target,this.holdJob=setInterval(this.pulse.bind(this),this.HOLD_DELAY))},up:function(t){this.heldPointer&&this.heldPointer.pointerId===t.pointerId&&this.cancel()},move:function(t){if(this.heldPointer&&this.heldPointer.pointerId===t.pointerId){var e=t.clientX-this.heldPointer.clientX,i=t.clientY-this.heldPointer.clientY;e*e+i*i>this.WIGGLE_THRESHOLD&&this.cancel()}},fireHold:function(t,e){var n={bubbles:!0,cancelable:!0,pointerType:this.heldPointer.pointerType,pointerId:this.heldPointer.pointerId,x:this.heldPointer.clientX,y:this.heldPointer.clientY,_source:"hold"};e&&(n.holdTime=e);var o=i.makeGestureEvent(t,n);this.target.dispatchEvent(o)}};e.registerGesture("hold",n)}(i),function(t){var e=t.dispatcher,i=t.eventFactory,n=new t.PointerMap,o={events:["down","up"],exposes:["tap"],down:function(t){t.isPrimary&&!t.tapPrevented&&n.set(t.pointerId,{target:t.target,buttons:t.buttons,x:t.clientX,y:t.clientY})},shouldTap:function(t,e){var i=!0;return"mouse"===t.pointerType&&(i=1^t.buttons&&1&e.buttons),i&&!t.tapPrevented},up:function(e){var o=n.get(e.pointerId);if(o&&this.shouldTap(e,o)){var r=t.targetFinding.LCA(o.target,e.relatedTarget);if(r){var s=i.makeGestureEvent("tap",{bubbles:!0,cancelable:!0,x:e.clientX,y:e.clientY,detail:e.detail,pointerType:e.pointerType,pointerId:e.pointerId,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,_source:"tap"});r.dispatchEvent(s)}}n["delete"](e.pointerId)}};i.preventTap=function(t){return function(){t.tapPrevented=!0,n["delete"](t.pointerId)}},e.registerGesture("tap",o)}(i),function(t){var e=t.dispatcher,i=t.eventFactory,n=new t.PointerMap,o=180/Math.PI,r={events:["down","up","move","cancel"],exposes:["pinchstart","pinch","pinchend","rotate"],defaultActions:{pinch:"none",rotate:"none"},reference:{},down:function(e){if(n.set(e.pointerId,e),2==n.pointers()){var i=this.calcChord(),o=this.calcAngle(i);this.reference={angle:o,diameter:i.diameter,target:t.targetFinding.LCA(i.a.target,i.b.target)},this.firePinch("pinchstart",i.diameter,i)}},up:function(t){var e=n.get(t.pointerId),i=n.pointers();if(e){if(2===i){var o=this.calcChord();this.firePinch("pinchend",o.diameter,o)}n["delete"](t.pointerId)}},move:function(t){n.has(t.pointerId)&&(n.set(t.pointerId,t),n.pointers()>1&&this.calcPinchRotate())},cancel:function(t){this.up(t)},firePinch:function(t,e,n){var o=e/this.reference.diameter,r=i.makeGestureEvent(t,{bubbles:!0,cancelable:!0,scale:o,centerX:n.center.x,centerY:n.center.y,_source:"pinch"});this.reference.target.dispatchEvent(r)},fireRotate:function(t,e){var n=Math.round((t-this.reference.angle)%360),o=i.makeGestureEvent("rotate",{bubbles:!0,cancelable:!0,angle:n,centerX:e.center.x,centerY:e.center.y,_source:"pinch"});this.reference.target.dispatchEvent(o)},calcPinchRotate:function(){var t=this.calcChord(),e=t.diameter,i=this.calcAngle(t);e!=this.reference.diameter&&this.firePinch("pinch",e,t),i!=this.reference.angle&&this.fireRotate(i,t)},calcChord:function(){var t=[];n.forEach(function(e){t.push(e)});for(var e,i,o,r=0,s={a:t[0],b:t[1]},l=0;lr&&(r=o,s={a:a,b:c})}return e=Math.abs(s.a.clientX+s.b.clientX)/2,i=Math.abs(s.a.clientY+s.b.clientY)/2,s.center={x:e,y:i},s.diameter=r,s},calcAngle:function(t){var e=t.a.clientX-t.b.clientX,i=t.a.clientY-t.b.clientY;return(360+Math.atan2(i,e)*o)%360}};e.registerGesture("pinch",r)}(i)},{}],10:[function(t,e,i){"use strict";e.exports={JSDataSource:t("./js/DataSource"),DataSourceSorter:t("./js/DataSourceSorter"),DataSourceSorterComposite:t("./js/DataSourceSorterComposite"),DataSourceFilter:t("./js/DataSourceFilter"),DataSourceGlobalFilter:t("./js/DataSourceGlobalFilter"),DataSourceAggregator:t("./js/DataSourceAggregator"),util:{aggregations:t("./js/util/aggregations")}}},{"./js/DataSource":15,"./js/DataSourceAggregator":16,"./js/DataSourceFilter":17,"./js/DataSourceGlobalFilter":18,"./js/DataSourceSorter":20,"./js/DataSourceSorterComposite":21,"./js/util/aggregations":23}],11:[function(t,e,i){"use strict";var n=t("extend-me").Base,o=n.extend("DataNodeBase",{isNullObject:!1,INDENT:" ",initialize:function(t){this.label=t,this.data=[""],this.index=[],this.hasChildren=!1,this.depth=0,this.height=1,this.expanded=!1},getValue:function(t){return this.data[t]},toArray:function(t){this.depth=t,this.data[0]=this.computeDepthString()},computeDepthString:function(){return Array(this.depth+1).join(this.INDENT)+" "+this.label},computeHeight:function(){return 1},getIndex:function(){return this.index},computeAggregates:function(t){var e=this.getIndex();if(e.length){var i=Number(t.hasGroups()),n=this.data;n.length=i+t.aggregates.length;var o=t.sorterInstance;o.index=e,t.aggregates.forEach(function(t,e){n[i+e]=t(o)})}},buildView:function(t){t.addView(this)},toggleExpansionState:function(){}});e.exports=o},{"extend-me":4}],12:[function(t,e,i){"use strict";function n(t){return this.splice.bind(this,this.length,0).apply(this,t),this}var o=t("./util/Mappy"),r=t("./DataNodeBase"),s={"true":"▼","false":"▶"},l=r.extend("DataNodeGroup",{extendable:!0,initialize:function(t){this.children=new o},toArray:function(t){this.depth=t,this.children=this.children.values,this.children.forEach(function(e){e.toArray(t+1)}),this.data[0]=this.computeDepthString()},computeDepthString:function(){return Array(this.depth+1).join(this.INDENT)+s[this.expanded]+" "+this.label},getIndex:function(){return 0===this.index.length&&(this.index=this.computeIndex()),this.index},computeIndex:function(){var t=[];return t.append=n,this.children.forEach(function(e){t.append(e.getIndex())}),t},toggleExpansionState:function(t){this.expanded=!this.expanded,this.data[0]=this.computeDepthString(),this.expanded&&this.computeAggregates(t)},computeAggregates:function(t){r.prototype.computeAggregates.call(this,t),this.expanded&&this.children.forEach(function(e){e.computeAggregates(t)})},buildView:function(t){t.view.push(this),this.expanded&&this.children.forEach(function(e){e.buildView(t)})},computeHeight:function(){var t=1;return this.expanded&&this.children.forEach(function(e){t+=e.computeHeight()}),this.height=t}});e.exports=l},{"./DataNodeBase":11,"./util/Mappy":22}],13:[function(t,e,i){"use strict";var n=t("./DataNodeBase"),o=n.extend("DataNodeLeaf",{toArray:function(t){this.depth=t,this.data[0]=this.computeDepthString()},getIndex:function(){return this.index},buildView:function(t){t.addView(this)},computeHeight:function(){return 1}});e.exports=o},{"./DataNodeBase":11}],14:[function(t,e,i){"use strict";var n=t("./DataNodeGroup"),o=n.extend("DataNodeTree",{initialize:function(t){this.height=0,this.expanded=!0},toArray:function(){this.children=this.children.values,this.children.forEach(function(t){t.toArray(0)})},buildView:function(t){this.children.forEach(function(e){e.buildView(t)})},computeHeight:function(){var t=1;return this.children.forEach(function(e){t+=e.computeHeight()}),this.height=t}});e.exports=o},{"./DataNodeGroup":12}],15:[function(t,e,i){"use strict";function n(t,e){this.fields=e||r(t[0]),this.data=t}function o(t,e){throw new Error("DataSource."+t+": "+e)}function r(t){return Object.getOwnPropertyNames(t||[]).filter(function(t){return"__"!==t.substr(0,2)})}var s=t("./util/headerify");n.prototype={constructor:n.prototype.constructor,isNullObject:!1,getRow:function(t){return this.data[t]},getValue:function(t,e){var i=this.getRow(e);return i?i[this.fields[t]]:null},setValue:function(t,e,i){this.getRow(e)[this.fields[t]]=i},getRowCount:function(){return this.data.length},getColumnCount:function(){return this.getFields().length},getFields:function(){return this.fields},getHeaders:function(){return this.headers=this.headers||this.getDefaultHeaders().map(function(t){return s(t)})},getDefaultHeaders:function(){return this.getFields()},setFields:function(t){this.fields=t},setHeaders:function(t){t instanceof Array||o("setHeaders","param #1 `headers` not array"),this.headers=t},getGrandTotals:function(){},setData:function(t){this.data=t}},e.exports=n},{"./util/headerify":24}],16:[function(t,e,i){"use strict";function n(t){this.dataSource=t,this.tree=new l("Totals"),this.index=[],this.aggregates=[],this.headers=[],this.groupBys=[],this.view=[],this.sorterInstance={},this.presortGroups=!0,this.lastAggregate={},this.setAggregates({})}function o(t){return new u(t)}function r(t){return new a(t)}var s=t("./DataSourceSorter"),l=t("./DataNodeTree"),a=t("./DataNodeGroup"),u=t("./DataNodeLeaf"),c=t("./util/headerify");n.prototype={constructor:n.prototype.constructor,isNullObject:!1,setAggregates:function(t){this.lastAggregate=t,this.clearAggregations(),this.headers.length=0,this.hasGroups()&&this.headers.push("Tree");for(var e in t)this.addAggregate(e,t[e])},addAggregate:function(t,e){this.headers.push(c(t)),this.aggregates.push(e)},setGroupBys:function(t){var e=this.groupBys;e.length=0,t.forEach(function(t){e.push(t)}),this.setAggregates(this.lastAggregate)},addGroupBy:function(t){this.groupBys.push(t)},hasGroups:function(){return!!this.groupBys.length},hasAggregates:function(){return!!this.aggregates.length},apply:function(){this.buildGroupTree()},clearGroups:function(){this.groupBys.length=0},clearAggregations:function(){this.aggregates.length=0,this.headers.length=0},buildGroupTree:function(){var t=this.groupBys,e=t.length-1,i=this.dataSource,n=i.getRowCount(),a=this.tree=new l("Totals");this.presortGroups&&t.reverse().forEach(function(t){i=new s(i),i.sortOn(t)});for(var u=0;n>u;u++){var c=a;t.forEach(function(t,n){var s=i.getValue(t,u),l=n===e?o:r;c=c.children.getIfUndefined(s,l)}),c.index.push(u)}this.sorterInstance=new s(i),a.toArray(),a.computeAggregates(this),this.buildView()},addView:function(t){this.view.push(t)},buildView:function(){this.view.length=0,this.tree.computeHeight(),this.tree.buildView(this)},viewMakesSense:function(){return this.hasAggregates()},getValue:function(t,e){if(!this.viewMakesSense())return this.dataSource.getValue(t,e);var i=this.view[e];return i?i.getValue(t):null},setValue:function(t,e,i){return this.viewMakesSense()?void 0:this.dataSource.setValue(t,e,i)},getColumnCount:function(){return this.viewMakesSense()?this.getHeaders().length:this.dataSource.getColumnCount()},getRowCount:function(){return this.viewMakesSense()?this.view.length:this.dataSource.getRowCount()},click:function(t){var e=this.view[t];e.toggleExpansionState(this),this.buildView()},getHeaders:function(){return this.viewMakesSense()?this.headers:this.dataSource.getHeaders()},setHeaders:function(t){this.dataSource.setHeaders(t)},getFields:function(){return this.dataSource.getFields()},setFields:function(t){return this.dataSource.setFields(t)},getGrandTotals:function(){var t=this.tree;return[t.data]},getRow:function(t){if(!this.viewMakesSense())return this.dataSource.getRow(t);var e=this.view[t];return e?e:this.tree},setData:function(t){this.dataSource.setData(t),this.apply()}},e.exports=n},{"./DataNodeGroup":12,"./DataNodeLeaf":13,"./DataNodeTree":14,"./DataSourceSorter":20,"./util/headerify":24}],17:[function(t,e,i){"use strict";function n(t,e){var i=this;return!this.filters.find(function(n){return!n(i.dataSource.getValue(n.columnIndex,t),e,t)})}var o=t("./DataSourceIndexed"),r=o.extend("DataSourceFilter",{initialize:function(){this.filters=[]},add:function(t,e){e.columnIndex=t,this.filters.push(e)},clearAll:function(){this.filters.length=0,this.clearIndex()},applyAll:function(){this.filters.length?this.buildIndex(n):this.clearIndex()},getRowCount:function(){return this.filters.length?this.index.length:this.dataSource.getRowCount()},aliases:{set:"add"}});e.exports=r},{"./DataSourceIndexed":19}],18:[function(t,e,i){"use strict";function n(t,e){var i=this;return this.visibleColumnMap.find(function(n,o){var r=i.dataSource.getValue(n,t);return i.filter(r,e,t)})}var o=t("./DataSourceIndexed"),r=o.extend("DataSourceGlobalFilter",{set:function(t){this.filter=t},clear:function(){delete this.filter,this.clearIndex()},apply:function(t){if(this.filter){var e=this.visibleColumnMap=[];t.forEach(function(t){e.push(t.index)}),this.buildIndex(n)}else this.clearIndex()},getRowCount:function(){return this.filter?this.index.length:this.dataSource.getRowCount()}});e.exports=r},{"./DataSourceIndexed":19}],19:[function(t,e,i){"use strict";var n=t("extend-me").Base,o=n.extend("DataSourceIndexed",{isNullObject:!1,initialize:function(t){this.dataSource=t,this.index=[]},transposeY:function(t){return this.index.length?this.index[t]:t},getRow:function(t){return this.dataSource.getRow(this.transposeY(t))},getValue:function(t,e){return this.dataSource.getValue(t,this.transposeY(e))},setValue:function(t,e,i){this.dataSource.setValue(t,this.transposeY(e),i)},getRowCount:function(){return this.index.length||this.dataSource.getRowCount()},getColumnCount:function(){return this.dataSource.getColumnCount()},getFields:function(){return this.dataSource.getFields()},setFields:function(t){return this.dataSource.setFields(t)},setHeaders:function(t){return this.dataSource.setHeaders(t)},getHeaders:function(){return this.dataSource.getHeaders()},getGrandTotals:function(){return this.dataSource.getGrandTotals()},setData:function(t){return this.dataSource.setData(t)},clearIndex:function(){this.index.length=0},buildIndex:function(t){var e=this.dataSource.getRowCount(),i=this.index;this.clearIndex();for(var n=0;e>n;n++)(!t||t.call(this,n,this.dataSource.getRow(n)))&&i.push(n);return i}});e.exports=o},{"extend-me":4}],20:[function(t,e,i){"use strict";function n(t){return"function"==typeof t?t():t}var o=t("./DataSourceIndexed"),r=t("./util/stableSort"),s=o.extend("DataSourceSorter",{initialize:function(){this.descendingSort=!1},sortOn:function(t,e){function i(e){return n(o.dataSource.getValue(t,e))}switch(e){case 0:this.clearIndex();break;case void 0:case 1:case-1:var o=this;r.sort(this.buildIndex(),i,e)}}});e.exports=s},{"./DataSourceIndexed":19,"./util/stableSort":25}],21:[function(t,e,i){"use strict";var n=t("./DataSourceIndexed"),o=t("./DataSourceSorter"),r=n.extend("DataSourceSorterComposite",{initialize:function(){this.sorts=[],this.last=this.dataSource},getRow:function(t){return this.last.getRow(t)},sortOn:function(t,e){this.sorts.push([t,e])},applySorts:function(){var t=this.dataSource;this.sorts.forEach(function(e){t=new o(t),t.sortOn.apply(t,e)}),this.last=t},clearSorts:function(){this.sorts.length=0,this.last=this.dataSource},getValue:function(t,e){return this.last.getValue(t,e); -},setValue:function(t,e,i){this.last.setValue(t,e,i)}});e.exports=r},{"./DataSourceIndexed":19,"./DataSourceSorter":20}],22:[function(t,e,i){"use strict";function n(){this.keys=[],this.data={},this.values=[]}function o(t){var e=typeof t;switch(e){case"number":case"string":case"boolean":case"symbol":return l+e+"_"+t;case"undefined":return"UNDEFINED";case"object":if(null===t)return"NULL";case"function":return t.___finhash=t.___finhash||l+a++}}function r(t){return t}function s(t,e){if(e!=e||0===e)for(var i=t.length;i--&&!u(t[i],e););else i=[].indexOf.call(t,e);return i}n.prototype={constructor:n.prototype.constructor,set:function(t,e){var i=o(t);i in this.data||(this.keys.push(t),this.values.push(e)),this.data[i]=e},get:function(t){var e=o(t);return this.data[e]},getIfUndefined:function(t,e){var i=this.get(t);return void 0===i&&(i=e(t),this.set(t,i)),i},size:function(){return this.keys.length},clear:function(){this.keys.length=0,this.values.length=0,this.data={}},"delete":function(t){var e=o(t);if(void 0!==this.data[e]){var i=s(this.keys,t);this.keys.splice(i,1),this.values.splice(i,1),delete this.data[e]}},forEach:function(t){if("function"==typeof t){var e=this.keys,i=this;e.forEach(function(e){var n=i.get(e);t(n,e,i)})}},map:function(t){var e=this.keys,i=new n,o=this;return"function"!=typeof t&&(t=r),e.forEach(function(e){var n=o.get(e),r=t(n,e,o);i.set(e,r)}),i},copy:function(){var t=this.keys,e=new n,i=this;return t.forEach(function(t){var n=i.get(t);e.set(t,n)}),e}};var l=".~.#%_",a=0,u=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};e.exports=n},{}],23:[function(t,e,i){"use strict";function n(t){return t.getRowCount()}function o(t,e){for(var i=e.getRowCount(),n=0;i--;)n+=e.getValue(t,i);return n}function r(t,e,i,n){for(var o=n.getRowCount();o--;)i=e(i,n.getValue(t,o));return i}function s(t,e){return o(t,e)/e.getRowCount()}function l(t,e){return e.getValue(t,0)}function a(t,e){return e.getValue(t,e.getRowCount()-1)}function u(t,e){for(var i,n=e.getRowCount(),o=s(t,e),r=n,l=0;r--;l+=i*i)i=e.getValue(t,r)-o;return Math.sqrt(l/n)}e.exports={count:function(t){return n},sum:function(t){return o.bind(this,t)},min:function(t){return r.bind(this,t,Math.min,1/0)},max:function(t){return r.bind(this,t,Math.max,-(1/0))},avg:function(t){return s.bind(this,t)},first:function(t){return l.bind(this,t)},last:function(t){return a.bind(this,t)},stddev:function(t){return u.bind(this,t)}}},{}],24:[function(t,e,i){"use strict";function n(t){return(/[a-z]/.test(t)?t:t.toLowerCase()).replace(/[\s\-_]*([^\s\-_])([^\s\-_]+)/g,o).replace(/[A-Z]/g," $&").trim()}function o(t,e,i){return e.toUpperCase()+i}e.exports=n},{}],25:[function(t,e,i){"use strict";function n(t,e,i,n){var o=i[0],r=n[0];if(o===r)o=e?n[1]:i[1],r=e?i[1]:n[1];else{if(null===r)return-1;if(null===o)return 1}return t(o,r)}function o(t,e){return t-e}function r(t,e){return e-t}function s(t,e){return e>t?-1:1}function l(t,e){return t>e?-1:1}function a(t){return n.bind(this,"number"===t?o:s,!1)}function u(t){return n.bind(this,"number"===t?r:l,!0)}function c(t,e,i){var n,o;if(void 0===i&&(i=1),t.length){switch(i){case 0:return;case void 0:i=1;case 1:n=a(typeof e(0));break;case-1:n=u(typeof e(0))}var r=new Array(t.length);for(o=0;op&&t>=0||0===p&&0!==t||p>0&&0>=t;p=t>0?Math.min(50,t):Math.max(-50,t),n&&(clearInterval(f),f=setInterval(function(t){var e=i.scrollTop+p;0>p&&t>e||p>0&&e>t?(i.scrollTop=t,clearInterval(f)):i.scrollTop=e},125))}else clearInterval(f),p=0}function r(t){return Array.prototype.slice.call(t)}function s(t,e){return e.top<=t.y&&t.y<=e.bottom&&e.left<=t.x&&t.x<=e.right}function l(t,e){return"translate("+Math.floor(t+window.scrollX)+"px,"+Math.floor(e+window.scrollY)+"px)"}function a(t){var e=document.createTextNode(t);return document.createElement("a").appendChild(e).parentNode.innerHTML}function u(t,e){var i=e.label||"{label}";return t.forEach(function(n,o){var r=n.label||i,s=void 0!==n.htmlEncode&&n.htmlEncode||e.htmlEncode,l=document.createElement("div"),u=document.createElement("ul");if(n.models)Object.keys(n).forEach(function(t){"models"!==t&&(n.models[t]=n[t])}),t[o]=n=n.models;else{if(!(n instanceof Array))throw d("List [{1}] not an array of models (with or without additional properties) OR an object (with a `models` property containing an array of models).",o);n.models=n}n.forEach(function(t){var i=t.label||r,o=void 0!==t.htmlEncode&&t.htmlEncode||s,l="object"==typeof t?t:{label:t},c=C.call([l,n,e],i),h=document.createElement("li");h.innerHTML=o?a(c):c,u.appendChild(h)});var c=document.createElement("li");if(c.innerHTML=" ",u.appendChild(c),n.title){var h=document.createElement("div");h.innerHTML=s?a(n.title):n.title,l.appendChild(h)}l.appendChild(u),l.className=n.cssClassNames||e.cssClassNames||"dragon-list",n.element=u,n.container=l}),t}function c(t){var e=[];return t.forEach(function(t){var i=t.parentElement,n=i.parentElement,o=[];e.find(function(t){return t.element===i})||(r(i.querySelectorAll("li")).forEach(function(t){t!==i.lastElementChild&&o.push(t.innerHTML)}),o.element=i,o.container=n,e.push(o))}),e}function h(t){t.stopPropagation()}function d(){return"list-dragon: "+C.apply(this,Array.prototype.slice.call(arguments))}var g,f,p,v,m=t("css-injector"),C=t("templex"),w=null;v="div.dragon-list{position:relative;background-color:#fff}div.dragon-list>div,div.dragon-list>ul{position:absolute;left:0;right:0}div.dragon-list>div{text-align:center;background-color:#00796b;color:#fff;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);overflow:hidden;white-space:nowrap}div.dragon-list>ul{overflow-y:auto;bottom:0;margin:0;padding:0;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}div.dragon-list>ul>li,li.dragon-pop{white-space:nowrap;list-style-type:none;border:0 solid #f4f4f4;border-bottom:1px solid #e0e0e0;cursor:move;transition:border-top-width .2s}div.dragon-list>ul>li:last-child{height:0;border-bottom:none}li.dragon-pop{position:fixed;background-color:#fff;border:1px solid #e0e0e0;left:0;top:0;overflow-x:hidden;box-shadow:rgba(0,0,0,.188235) 0 10px 20px,rgba(0,0,0,.227451) 0 6px 6px}",n.prototype={addEvt:function(t,e,i,n){var o={handler:y[e].bind(t,this),element:i||window};return n||(this.bindings[e]=o),o.element.addEventListener(e,o.handler),o},removeEvt:function(t){var e=this.bindings[t];delete this.bindings[t],e.element.removeEventListener(t,e.handler)},removeAllEventListeners:function(){for(var t in this.bindings){var e=this.bindings[t];e.element.removeEventListener(t,e.handler)}this.items.forEach(function(t){t.handler&&t.element.removeEventListener("mousedown",t.handler)}),this.modelLists.forEach(function(t){t.element.removeEventListener("wheel",h)})},pointInListRects:function(t){return this.modelLists.find(function(e){var i=e.element.getBoundingClientRect();return i={left:window.scrollX+i.left,top:window.scrollY+i.top,right:window.scrollX+i.right,bottom:window.scrollY+i.bottom,width:i.width,height:i.height},e.rect=i,s(t,i)?(e.rect=i,!0):!1})},pointInItemRects:function(t,e,i){return this.items.find(function(n){var o=n.element;return o!==e&&o!==i&&s(t,n.rect)})},getAllItemBoundingRects:function(){var t,e=this.modelLists;this.items.forEach(function(i){var n=i.element,o=n.parentElement,r=e.find(function(t){return t.element===o});if(void 0===r.isDropTarget||"function"==typeof r.isDropTarget&&r.isDropTarget()||r.isDropTarget){var s=n.getBoundingClientRect(),l=s.bottom;n===o.lastElementChild?(l=o.getBoundingClientRect().bottom,l0&&(i.element.scrollTop>0&&(s=u-(i.rect.top+5))<0?o(s,0,i.element):i.element.scrollTop0?o(s,a,i.element):o());var c=t.pointInItemRects({x:e.clientX,y:t.rect.bottom+window.scrollY+r+i.element.scrollTop},this,t.drop);if(this.style[g]=l(t.rect.left-window.scrollX+n,t.rect.top-window.scrollY+r),c){var h=c.element;h.style.transition=w,h.style.borderTopWidth=t.drop.style.borderTopWidth,t.drop.style.borderTopWidth=null,t.drop=h}}},mouseup:function(t,e){o(),t.removeEvt("mousemove"),t.removeEvt("mouseup"),e.stopPropagation();var i=this.getBoundingClientRect();if(window.scrollX+i.left===t.rect.left&&window.scrollY+i.top===t.rect.top)t.reinsert(this);else{var n=t.drop.getBoundingClientRect();t.addEvt(this,"transitionend",this),this.style.transitionDuration=w,this.style.transitionProperty=g,this.style[g]=l(n.left-window.scrollX,n.top-window.scrollY)}},transitionend:function(t,e){if(e.propertyName===g){t.removeEvt("transitionend"),t.reinsert(this),this.style.transitionProperty=w;var i=t.modelLists[t.origin.list].splice(t.origin.item,1)[0],n=t.itemCoordinates(this);t.modelLists[n.list].splice(n.item,0,i),t.callback.dropped&&t.callback.dropped.call(this,t)}}};e.exports=n},{"css-injector":3,templex:32}],27:[function(t,e,i){!function(){function t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function i(){return 1}function n(t){d||"string"==typeof t||"number"==typeof t||(d=!0,console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! "+typeof t).stack))}function o(t){return this instanceof o?("number"==typeof t&&(t={max:t}),t||(t={}),this._max=t.max,(!this._max||"number"!=typeof this._max||this._max<=0)&&(this._max=1/0),this._lengthCalculator=t.length||i,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=i),this._allowStale=t.stale||!1,this._maxAge=t.maxAge||null,this._dispose=t.dispose,void this.reset()):new o(t)}function r(t,e,i){n(e);var o=t._cache[e];return o&&(s(t,o)?(c(t,o),t._allowStale||(o=void 0)):i&&l(t,o),o&&(o=o.value)),o}function s(t,e){if(!e||!e.maxAge&&!t._maxAge)return!1;var i=!1,n=Date.now()-e.now;return i=e.maxAge?n>e.maxAge:t._maxAge&&n>t._maxAge}function l(t,e){u(t,e),e.lu=t._mru++,t._lruList[e.lu]=e}function a(t){for(;t._lrut._max;)c(t,t._lruList[t._lru])}function u(t,e){for(delete t._lruList[e.lu];t._lru=t)&&(t=1/0),this._max=t,this._length>this._max&&a(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(o.prototype,"lengthCalculator",{set:function(t){if("function"!=typeof t){this._lengthCalculator=i,this._length=this._itemCount;for(var e in this._cache)this._cache[e].length=1}else{this._lengthCalculator=t,this._length=0;for(var e in this._cache)this._cache[e].length=this._lengthCalculator(this._cache[e].value),this._length+=this._cache[e].length}this._length>this._max&&a(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(o.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(o.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),o.prototype.forEach=function(t,e){e=e||this;for(var i=0,n=this._itemCount,o=this._mru-1;o>=0&&n>i;o--)if(this._lruList[o]){i++;var r=this._lruList[o];s(this,r)&&(c(this,r),this._allowStale||(r=void 0)),r&&t.call(e,r.value,r.key,this)}},o.prototype.keys=function(){for(var t=new Array(this._itemCount),e=0,i=this._mru-1;i>=0&&e=0&&e=0&&ethis._max?(c(this,this._cache[e]),!1):(this._dispose&&this._dispose(e,this._cache[e].value),this._cache[e].now=r,this._cache[e].maxAge=o,this._cache[e].value=i,this._length+=s-this._cache[e].length,this._cache[e].length=s,this.get(e),this._length>this._max&&a(this),!0);var l=new h(e,i,this._mru++,s,r,o);return l.length>this._max?(this._dispose&&this._dispose(e,i),!1):(this._length+=l.length,this._lruList[l.lu]=this._cache[e]=l,this._itemCount++,this._length>this._max&&a(this),!0)},o.prototype.has=function(e){if(n(e),!t(this._cache,e))return!1;var i=this._cache[e];return s(this,i)?!1:!0},o.prototype.get=function(t){return n(t),r(this,t,!0)},o.prototype.peek=function(t){return n(t),r(this,t,!1)},o.prototype.pop=function(){var t=this._lruList[this._lru];return c(this,t),t||null},o.prototype.del=function(t){n(t),c(this,this._cache[t])},o.prototype.load=function(t){this.reset();for(var e=Date.now(),i=t.length-1;i>=0;i--){var o=t[i];n(o.k);var r=o.e||0;if(0===r)this.set(o.k,o.v);else{var s=r-e;s>0&&this.set(o.k,o.v,s)}}}}()},{}],28:[function(t,e,i){!function(t,e){"object"==typeof i&&i&&"string"!=typeof i.nodeName?e(i):"function"==typeof define&&define.amd?define(["exports"],e):(t.Mustache={},e(t.Mustache))}(this,function(t){function e(t){return"function"==typeof t}function i(t){return p(t)?"array":typeof t}function n(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(t,e){return null!=t&&"object"==typeof t&&e in t}function r(t,e){return v.call(t,e)}function s(t){return!r(m,t)}function l(t){return String(t).replace(/[&<>"'`=\/]/g,function(t){return C[t]})}function a(e,i){function o(){if(m&&!C)for(;v.length;)delete f[v.pop()];else v=[];m=!1,C=!1}function r(t){if("string"==typeof t&&(t=t.split(y,2)),!p(t)||2!==t.length)throw new Error("Invalid tags: "+t);l=new RegExp(n(t[0])+"\\s*"),a=new RegExp("\\s*"+n(t[1])),d=new RegExp("\\s*"+n("}"+t[1]))}if(!e)return[];var l,a,d,g=[],f=[],v=[],m=!1,C=!1;r(i||t.tags);for(var E,R,A,M,P,D,T=new h(e);!T.eos();){if(E=T.pos,A=T.scanUntil(l))for(var k=0,F=A.length;F>k;++k)M=A.charAt(k),s(M)?v.push(f.length):C=!0,f.push(["text",M,E,E+1]),E+=1,"\n"===M&&o();if(!T.scan(l))break;if(m=!0,R=T.scan(b)||"name",T.scan(w),"="===R?(A=T.scanUntil(x),T.scan(x),T.scanUntil(a)):"{"===R?(A=T.scanUntil(d),T.scan(S),T.scanUntil(a),R="&"):A=T.scanUntil(a),!T.scan(a))throw new Error("Unclosed tag at "+T.pos);if(P=[R,A,E,T.pos],f.push(P),"#"===R||"^"===R)g.push(P);else if("/"===R){if(D=g.pop(),!D)throw new Error('Unopened section "'+A+'" at '+E);if(D[1]!==A)throw new Error('Unclosed section "'+D[1]+'" at '+E)}else"name"===R||"{"===R||"&"===R?C=!0:"="===R&&r(A)}if(D=g.pop())throw new Error('Unclosed section "'+D[1]+'" at '+T.pos);return c(u(f))}function u(t){for(var e,i,n=[],o=0,r=t.length;r>o;++o)e=t[o],e&&("text"===e[0]&&i&&"text"===i[0]?(i[1]+=e[1],i[3]=e[3]):(n.push(e),i=e));return n}function c(t){for(var e,i,n=[],o=n,r=[],s=0,l=t.length;l>s;++s)switch(e=t[s],e[0]){case"#":case"^":o.push(e),r.push(e),o=e[4]=[];break;case"/":i=r.pop(),i[5]=e[2],o=r.length>0?r[r.length-1][4]:n;break;default:o.push(e)}return n}function h(t){this.string=t,this.tail=t,this.pos=0}function d(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function g(){this.cache={}}var f=Object.prototype.toString,p=Array.isArray||function(t){return"[object Array]"===f.call(t)},v=RegExp.prototype.test,m=/\S/,C={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},w=/\s*/,y=/\s+/,x=/\s*=/,S=/\s*\}/,b=/#|\^|\/|>|\{|&|=|!/;h.prototype.eos=function(){return""===this.tail},h.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var i=e[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},h.prototype.scanUntil=function(t){var e,i=this.tail.search(t);switch(i){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=e.length,e},d.prototype.push=function(t){return new d(t,this)},d.prototype.lookup=function(t){var i,n=this.cache;if(n.hasOwnProperty(t))i=n[t];else{for(var r,s,l=this,a=!1;l;){if(t.indexOf(".")>0)for(i=l.view,r=t.split("."),s=0;null!=i&&sa;++a)s=void 0,o=t[a],r=o[0],"#"===r?s=this.renderSection(o,e,i,n):"^"===r?s=this.renderInverted(o,e,i,n):">"===r?s=this.renderPartial(o,e,i,n):"&"===r?s=this.unescapedValue(o,e):"name"===r?s=this.escapedValue(o,e):"text"===r&&(s=this.rawValue(o)),void 0!==s&&(l+=s);return l},g.prototype.renderSection=function(t,i,n,o){function r(t){return s.render(t,i,n)}var s=this,l="",a=i.lookup(t[1]);if(a){if(p(a))for(var u=0,c=a.length;c>u;++u)l+=this.renderTokens(t[4],i.push(a[u]),n,o);else if("object"==typeof a||"string"==typeof a||"number"==typeof a)l+=this.renderTokens(t[4],i.push(a),n,o);else if(e(a)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");a=a.call(i.view,o.slice(t[3],t[5]),r),null!=a&&(l+=a)}else l+=this.renderTokens(t[4],i,n,o);return l}},g.prototype.renderInverted=function(t,e,i,n){var o=e.lookup(t[1]);return!o||p(o)&&0===o.length?this.renderTokens(t[4],e,i,n):void 0},g.prototype.renderPartial=function(t,i,n){if(n){var o=e(n)?n(t[1]):n[t[1]];return null!=o?this.renderTokens(this.parse(o),i,n,o):void 0}},g.prototype.unescapedValue=function(t,e){var i=e.lookup(t[1]);return null!=i?i:void 0},g.prototype.escapedValue=function(e,i){var n=i.lookup(e[1]);return null!=n?t.escape(n):void 0},g.prototype.rawValue=function(t){return t[1]},t.name="mustache.js",t.version="2.2.1",t.tags=["{{","}}"];var E=new g;t.clearCache=function(){return E.clearCache()},t.parse=function(t,e){return E.parse(t,e)},t.render=function(t,e,n){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+i(t)+'" was given as the first argument for mustache#render(template, view, partials)');return E.render(t,e,n)},t.to_html=function(i,n,o,r){var s=t.render(i,n,o);return e(r)?void r(s):s},t.escape=l,t.Scanner=h,t.Context=d,t.Writer=g})},{}],29:[function(t,e,i){"use strict";function n(t){return t instanceof n?t:this instanceof n?(this.originalValue=t,void(this.o=t||{})):new n(t)}n.chain=function(t){var e=n(t);return e.chaining=!0,e},n.prototype={value:function(){return this.originalValue},each:function(t,e){var i=this.o;return Object.keys(i).forEach(function(e){t.call(this,i[e],e,i)},e||i),this},find:function(t,e){var i,n=this.o;return n&&(i=Object.keys(n).find(function(e){return t.call(this,n[e],e,n)},e||n),void 0!==i&&(i=n[i])),i},filter:function(t,e){var i=this.o,n=[];return i&&Object.keys(i).forEach(function(e){t.call(this,i[e],e,i)&&n.push(i[e])},e||i),n},map:function(t,e){var i=this.o,n=[];return i&&Object.keys(i).forEach(function(e){n.push(t.call(this,i[e],e,i))},e||i),n},reduce:function(t,e,i){var n=this.o;return n&&Object.keys(n).forEach(function(i,o){e=o||void 0!==e?t(e,n[i],i,n):n[i]},i||n),e},extend:function(t){var e=this.o;return Array.prototype.slice.call(arguments).forEach(function(t){if(t)for(var i in t)e[i]=t[i]}),this.chaining?this:e},extendOwn:function(t){var e=this.o;return Array.prototype.slice.call(arguments).forEach(function(t){n(t).each(function(t,i){e[i]=t})}),this.chaining?this:e}},Array.prototype.find||(Array.prototype.find=function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,i=Object(this),n=i.length>>>0,o=arguments[1],r=0;n>r;r++)if(e=i[r],t.call(o,e,r,i))return e}),e.exports=n},{}],30:[function(t,e,i){"use strict";function n(t,e){Object.defineProperty(this,t,{value:e,writable:!1,enumerable:!0,configurable:!1})}function o(t,e){n.call(this,"x",Number(t)||0),n.call(this,"y",Number(e)||0)}function r(t,e,i,r){t=Number(t)||0,e=Number(e)||0,i=Number(i)||0,r=Number(r)||0,0>i&&(t+=i,i=-i),0>r&&(e+=r,r=-r),n.call(this,"origin",new o(t,e)),n.call(this,"extent",new o(i,r)),n.call(this,"corner",new o(t+i,e+r)),n.call(this,"center",new o(t+i/2,e+r/2))}o.prototype={plus:function(t){return new o(this.x+t.x,this.y+t.y)},plusXY:function(t,e){return new o(this.x+(t||0),this.y+(e||0))},minus:function(t){return new o(this.x-t.x,this.y-t.y)},min:function(t){return new o(Math.min(this.x,t.x),Math.min(this.y,t.y))},max:function(t){return new o(Math.max(this.x,t.x),Math.max(this.y,t.y))},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){var e=!1;return t&&(e=this.x===t.x&&this.y===t.y),e},greaterThan:function(t){return this.x>t.x&&this.y>t.y},lessThan:function(t){return this.x=t.x&&this.y>=t.y},lessThanOrEqualTo:function(t){return this.x<=t.x&&this.y<=t.y},within:function(t){var e=t.origin.x,i=e+t.extent.x,n=t.origin.y,o=n+t.extent.y;return t.extent.x<0&&(e=i,i=t.origin.x),t.extent.y<0&&(n=o,o=t.origin.y),e<=this.x&&this.xi;i++)for(var o=this.origin.y,r=this.corner.y;r>o;o++)t.call(e,i,o)},intersect:function(t,e,i){var n=null,o=this.origin.max(t.origin),s=this.corner.min(t.corner),l=s.minus(o);return l.x>0&&l.y>0?n=new r(o.x,o.y,l.x,l.y):"function"==typeof e&&(n=e.call(i||this,t)),n},intersects:function(t){return t.corner.x>this.origin.x&&t.corner.y>this.origin.y&&t.origin.x=t?[t,e]:[e,t]}function n(t,e){return t[0]<=e[0]&&e[0]<=t[1]||t[0]<=e[1]&&e[1]<=t[1]||e[0]=o&&n>r?s.push([r+1,n]):o>i&&r>=n?s.push([i,o-1]):o>i&&n>r?(s.push([i,o-1]),s.push([r+1,n])):(i>r||o>n)&&s.push(t),s}function s(t,e){var i=Math.min(Math.min.apply(Math,t),Math.min.apply(Math,e)),n=Math.max(Math.max.apply(Math,t),Math.max.apply(Math,e));return[i,n]}e.prototype={select:function(t,e){this.storeState();var r=i(t,e),l=[0,1];return this.selection.forEach(function(t){n(t,r)||o(t,r)?r=s(t,r):l.push(t)}),l.push(r),l[1]=this.selection.length,this.selection.splice.apply(this.selection,l),this},deselect:function(t,e){var o=i(t,e),s=[0,0];return this.selection.forEach(function(t){if(n(t,o)){var e=r(t,o);s=s.concat(e)}else s.push(t)}),s[1]=this.selection.length,this.selection.splice.apply(this.selection,s),this},clear:function(){return this.states.length=0,this.selection.length=0,this},clearMostRecentSelection:function(){0!==this.states.length&&(this.selection=this.states.pop())},isSelected:function(t){return this.selection.some(function(e){return e[0]<=t&&t<=e[1]})},isEmpty:function(){return 0===this.selection.length},getSelections:function(){var t=[];return this.selection.forEach(function(e){for(var i=e[0];i<=e[1];i++)t.push(i)}),t.sort(function(t,e){return t-e}),t}},t.exports=e})("object"==typeof e&&e||(window.RangeSelectionModel={}),"object"==typeof e&&e.exports||(window.RangeSelectionModel.exports={}))||"object"==typeof e||(window.RangeSelectionModel=window.RangeSelectionModel.exports)},{}],32:[function(require,module,exports){function templex(t){var e=this instanceof Array?this:[this];return arguments.length>1&&e.unshift(arguments),t.replace(templex.regexp,templex.merger.bind(e))}templex.regexp=/\{(.*?)\}/g,templex["with"]=function(t,e){return"with(this["+t+"]){"+e+"}"},templex.cache=[],templex.deref=function(key){if(!(this.length in templex.cache)){for(var code="return eval(expr)",i=0;i1&&i.unshift(s.pop()),s=[s.join(" ")],i.length&&(s=s.concat(r(t,e,i,n))),s}function s(t,e,i,n){return r(t,e,l(i).split(" "),n)}function l(t){return t.toString().trim().replace(/\s\s+/g," ")}function a(t,e,i,n,o,r,s,l){l||(l=!0),r||(r=5),t.beginPath(),t.moveTo(e+r,i),t.lineTo(e+n-r,i),t.quadraticCurveTo(e+n,i,e+n,i+r),t.lineTo(e+n,i+o-r),t.quadraticCurveTo(e+n,i+o,e+n-r,i+o),t.lineTo(e+r,i+o),t.quadraticCurveTo(e,i+o,e,i+o-r),t.lineTo(e,i+r),t.quadraticCurveTo(e,i,e+r,i),t.closePath(),l&&t.stroke(),s&&t.fill(),t.closePath()}var u=t("extend-me").Base,c=u.extend("CellProvider",{initialize:function(){this.cellCache={},this.initializeCells()},getCell:function(t){var e=this.cellCache.simpleCellRenderer;return e.config=t,e},getColumnHeaderCell:function(t){var e=this.cellCache.simpleCellRenderer;return e.config=t,e},getRowHeaderCell:function(t){var e=this.cellCache.simpleCellRenderer;return e.config=t,e},paintButton:function(t,e){var i=e.value,n=e.x,o=e.y,r=e.bounds,s=r.x+2,l=r.y+2,u=r.width-3,c=r.height-3,h=c/2,d=t.createLinearGradient(s,l,s,l+c);e.mouseDown?(d.addColorStop(0,"#B5CBED"),d.addColorStop(1,"#4d74ea")):(d.addColorStop(0,"#ffffff"),d.addColorStop(1,"#aaaaaa")),t.fillStyle=d,t.strokeStyle="#000000",a(t,s,l,u,c,h,d,!0);var g=(u-e.getTextWidth(t,i))/2,f=(c-e.getTextHeight(t.font).descent)/2;"middle"!==t.textBaseline&&(t.textBaseline="middle"),t.fillStyle="#000000",e.backgroundColor="rgba(0,0,0,0)",t.fillText(i,s+g,l+f),e.buttonCells[n+","+o]=!0},defaultCellPaint:function(t,e){var i,o,r,s,l,a=e.value,u=e.bounds.x,c=e.bounds.y,h=e.bounds.width,d=e.bounds.height,g=e.headerTextWrapping,f=2,p=0===e.y;a&&a.constructor===Array&&(i=a[0],o=a[2],a=a[1],"object"==typeof a&&"HTMLImageElement"===a.constructor.name&&(r=a,a=null),i&&"IMG"!==i.nodeName&&(i=null),o&&"IMG"!==o.nodeName&&(o=null),r&&"IMG"!==r.nodeName&&(r=null)),a=n(e,a),t.font!==e.font&&(t.font=e.font),"left"!==t.textAlign&&(t.textAlign="left"),"middle"!==t.textBaseline&&(t.textBaseline="middle");var v;(e.backgroundColor||e.isSelected)&&(t.fillStyle=v=n(e,e.isSelected?e.backgroundSelectionColor:e.backgroundColor),t.fillRect(u,c,h,d));var m=n(e,e.isSelected?e.foregroundSelectionColor:e.color);t.fillStyle!==m&&(t.fillStyle=m,t.strokeStyle=m),p&&g?this.renderMultiLineText(t,u,c,d,h,e,a):this.renderSingleLineText(t,u,c,d,h,e,a);var C=0;if(i&&(l=Math.round((d-i.height)/2),t.drawImage(i,u+f,c+l),C=Math.max(i.width+2)),o&&h>1.75*d){l=Math.round((d-o.height)/2);var w=u+h-o.width;v?(t.fillStyle=v,t.fillRect(w,c,o.width,d)):t.clearRect(w,c,o.width,d),t.drawImage(o,w,c+l),C=Math.max(o.width+2)}r&&(l=Math.round((d-r.height)/2),s=Math.round((h-r.width)/2),t.drawImage(r,u+h-s-r.width,c+l),C=Math.max(r.width+2)),e.cellBorderThickness&&(t.beginPath(),t.rect(u,c,h,d),t.lineWidth=e.cellBorderThickness,t.strokeStyle=e.cellBorderStyle,t.stroke(),t.closePath()),e.minWidth=e.minWidth+2*C},renderMultiLineText:function(t,e,i,n,o,r,a){var u=s(t,r,a,o); -if(1===u.length)return this.renderSingleLineText(t,e,i,n,o,r,l(a));var c=r.cellPadding,h=0,d=r.voffset,g=r.halign,f=r.getTextHeight(r.font).height;switch(g){case"right":h=o-c;break;case"center":h=o/2;break;case"left":h=c}var p=0,v=Math.ceil(f/2);d+=Math.ceil((n-(u.length-1)*f)/2),h=Math.max(p,h),d=Math.max(v,d),t.save(),t.rect(e,i,o,n),t.clip(),t.textAlign=g;for(var m=0;m-1,this.selectionModel=new v,this.selectionModel.getGrid=function(){return n},this.cellEditors=Object.create(w),this.renderOverridesCache={},this.behavior=e(this),this.div.oncontextmenu=function(t){return t.preventDefault(),!1},this.clearMouseDown(),this.dragExtent=new h(0,0),this.numRows=0,this.numColumns=0,this.pluginsDo(function(t){t.installOn&&t.installOn(n)}),i=i||{},i.top=i.top||0,i.right=i.right||"-200px",i.bottom=i.bottom||0,i.left=i.left||0,this.initRenderer(),this.initCanvas(i),this.initScrollbars(),this.initGlobalCellEditors(),this.checkScrollbarVisibility(),document.body.addEventListener("copy",function(t){n.checkClipboardCopy(t)}),this.getCanvas().resize(),this.dialog=new C(this)}function o(t){var e=t.origin,i=t.corner,n=Math.min(e.x,i.x),o=Math.min(e.y,i.y),r=Math.max(e.x,i.x),s=Math.max(e.y,i.y),l=new d(n,o,r-n,s-o);return l}function r(){s(x);var t=document.createElement("paper-button");t.style.display="none",t.setAttribute("disabled",!0),document.body.appendChild(t);var e=window.getComputedStyle(t),i=document.createElement("section");i.style.display="none",i.setAttribute("hero",!0),document.body.appendChild(i);var n=window.getComputedStyle(document.querySelector("html")),o=window.getComputedStyle(document.querySelector("html, body")),r=window.getComputedStyle(i);x.columnHeaderBackgroundColor=e.color,x.rowHeaderBackgroundColor=e.color,x.topLeftBackgroundColor=e.color,x.lineColor=e.backgroundColor,x.backgroundColor2=o.backgroundColor,x.color=n.color,x.fontFamily=n.fontFamily,x.backgroundColor=r.backgroundColor,t.setAttribute("disabled",!1),t.setAttribute("secondary",!0),t.setAttribute("raised",!0),e=window.getComputedStyle(t),x.columnHeaderColor=e.color,x.rowHeaderColor=e.color,x.topLeftColor=e.color,x.backgroundSelectionColor=e.backgroundColor,x.foregroundSelectionColor=e.color,t.setAttribute("secondary",!1),t.setAttribute("warning",!0),x.columnHeaderForegroundSelectionColor=e.color,x.columnHeaderBackgroundSelectionColor=e.backgroundColor,x.rowHeaderForegroundSelectionColor=e.color,x.fixedColumnBackgroundSelectionColor=e.backgroundColor,("rgba(0, 0, 0, 0)"===x.columnHeaderBackgroundSelectionColor||"transparent"===x.lineColor)&&s(x),document.body.removeChild(t),document.body.removeChild(i)}function s(t){for(var e in t)t.hasOwnProperty(e)&&delete t[e]}function l(t){var e="function"==typeof t?t():t;return e||0===e?e:""}var a=t("extend-me"),u=t("finbars"),c=t("fincanvas"),h=t("rectangular").Point,d=t("rectangular").Rectangle,g=t("object-iterators"),f=t("./defaults"),p=t("./Renderer"),v=t("./SelectionModel"),m=t("./stylesheets"),C=t("./TableDialog"),w={},y=!1,x=Object.create(f),S=Object.create(x),b={};n.prototype={constructor:n.prototype.constructor,behavior:null,isWebkit:!0,mouseDown:[],dragExtent:null,vScrollValue:0,hScrollValue:0,rectangular:null,selectionModel:null,cellEditor:null,sbHScroller:null,sbVScroller:null,sbPrevVScrollValue:null,sbPrevHScrollValue:null,cellEditors:null,renderOverridesCache:{},hoverCell:null,scrollingNow:!1,lastEdgeSelection:null,setAttribute:function(t,e){this.div.setAttribute(t,e)},reset:function(){var t=this;this.lastEdgeSelection=[0,0],this.lnfProperties=Object.create(S),this.selectionModel=new v,this.selectionModel.getGrid=function(){return t},this.cellEditors=Object.create(w),this.renderOverridesCache={},this.clearMouseDown(),this.dragExtent=new h(0,0),this.numRows=0,this.numColumns=0,this.vScrollValue=0,this.hScrollValue=0,this.cellEditor=null,this.sbPrevVScrollValue=null,this.sbPrevHScrollValue=null,this.hoverCell=null,this.scrollingNow=!1,this.lastEdgeSelection=[0,0],this.getBehavior().reset(),this.getRenderer().reset(),this.getCanvas().resize(),this.behaviorChanged()},getProperties:function(){return this.getPrivateState()},_getProperties:function(){return this.lnfProperties},computeCellsBounds:function(){var t=this.getRenderer();t&&t.computeCellsBounds()},initCellEditor:function(t){w[t.alias]=t},initGlobalCellEditors:function(){if(!y){y=!0,r();var t=["Textfield","Choice","Color","Date","Slider","Spinner","Filter"],e=this;t.forEach(function(t){e.initCellEditor(new n.cellEditors[t])}),w["int"]=w.spinner,w["float"]=w.spinner,w.date=w.date,w.string=w.extfield;var i=document.createElement("div");this.div.appendChild(i)}},toggleColumnPicker:function(){this.getBehavior().toggleColumnPicker()},isHovered:function(t,e){var i=this.getHoverCell();return i?i.x===t&&i.y===e:!1},isColumnHovered:function(t){var e=this.getHoverCell();return e?e.x===t:!1},isRowResizeable:function(){return this.resolveProperty("rowResize")},isRowHovered:function(t){var e=this.getHoverCell();return e?e.y===t:!1},getHoverCell:function(){return this.hoverCell},setHoverCell:function(t){var e=this.hoverCell,i=new h(t.x,t.y);e&&e.equals(i)||(this.hoverCell=i,this.fireSyntheticOnCellEnterEvent(i),this.repaint())},addGlobalProperties:function(t){if(S)this._addGlobalProperties(t);else{var e=this;setTimeout(function(){e.addGlobalProperties(t)},10)}},_addGlobalProperties:function(t){g(t).each(function(t,e){S[e]=t})},addProperties:function(t){var e=this.getProperties();g(t).each(function(i,n){e[n]=t[n]}),this.refreshProperties()},refreshProperties:function(){this.checkScrollbarVisibility(),this.getBehavior().defaultRowHeight=null,this.isColumnAutosizing()&&this.getBehavior().autosizeAllColumns()},getPrivateState:function(){return this.getBehavior().getPrivateState()},setState:function(t){var e=this;this.getBehavior().setState(t),setTimeout(function(){e.behaviorChanged(),e.synchronizeScrollingBoundries()},100)},getState:function(){return this.getBehavior().getState()},getMouseDown:function(){var t=this.mouseDown.length-1;return 0>t?null:this.mouseDown[t]},popMouseDown:function(){0!==this.mouseDown.length&&(this.mouseDown.length=this.mouseDown.length-1)},clearMouseDown:function(){this.mouseDown=[new h(-1,-1)],this.dragExtent=null},setMouseDown:function(t){this.mouseDown.push(t)},getDragExtent:function(){return this.dragExtent},setDragExtent:function(t){this.dragExtent=t},pluginsDo:function(t){},getCellProvider:function(){var t=this.getBehavior().getCellProvider();return t},gridRenderedNotification:function(){this.updateRenderedSizes(),this.cellEditor&&this.cellEditor.gridRenderedNotification(),this.checkColumnAutosizing(),this.fireSyntheticGridRenderedEvent()},checkColumnAutosizing:function(){var t=this.getBehavior();t.autoSizeRowNumberColumn(),this.isColumnAutosizing()&&t.checkColumnAutosizing(!1)},updateRenderedSizes:function(){var t=this.getBehavior();t.setRenderedColumnCount(this.getVisibleColumns()+1),t.setRenderedRowCount(this.getVisibleRows()+1)},checkClipboardCopy:function(t){if(this.hasFocus()){t.preventDefault();var e=this.getSelectionAsTSV();t.clipboardData.setData("text/plain",e)}},hasSelections:function(){return this.getSelectionModel?this.getSelectionModel().hasSelections():void 0},getSelectionAsTSV:function(){var t=this.getSelectionModel();if(t.hasSelections()){var e=this.getSelectionMatrix();return e=e[e.length-1],this.getMatrixSelectionAsTSV(e)}return t.hasRowSelections()?this.getMatrixSelectionAsTSV(this.getRowSelectionMatrix()):t.hasColumnSelections()?this.getMatrixSelectionAsTSV(this.getColumnSelectionMatrix()):void 0},getMatrixSelectionAsTSV:function(t){if(t.length){var e=t.length,i=t[0].length,n=e*i,o=[];if(n>2e4)return alert("selection size is too big to copy to the paste buffer"),"";for(var r=0;i>r;r++){for(var s=0;e>s;s++)o.push(t[s][r]),e>s&&o.push(" ");i>r&&o.push("\n")}var l=o.join("");return l}return""},hasFocus:function(){return this.getCanvas().hasFocus()},clearSelections:function(){this.getSelectionModel().clear(),this.clearMouseDown()},clearMostRecentSelection:function(){this.getSelectionModel().clearMostRecentSelection()},clearMostRecentColumnSelection:function(){this.getSelectionModel().clearMostRecentColumnSelection()},clearMostRecentRowSelection:function(){this.getSelectionModel().clearMostRecentRowSelection()},select:function(t,e,i,n){0>t||0>e||this.getSelectionModel().select(t,e,i,n)},isSelected:function(t,e){return this.getSelectionModel().isSelected(t,e)},isCellSelectedInRow:function(t){var e=this.getSelectionModel(),i=e.isCellSelectedInRow(t);return i},isCellSelectedInColumn:function(t){var e=this.getSelectionModel(),i=e.isCellSelectedInColumn(t);return i},getSelectionModel:function(){return this.selectionModel},getBehavior:function(){return this.behavior},setBehavior:function(t){this.behavior=t,this.behavior.setGrid(this),this.behavior.changed=this.behaviorChanged.bind(this),this.behavior.shapeChanged=this.behaviorShapeChanged.bind(this),this.behavior.stateChanged=this.behaviorStateChanged.bind(this)},behaviorChanged:function(){(this.numColumns!==this.getColumnCount()||this.numRows!==this.getRowCount())&&(this.numColumns=this.getColumnCount(),this.numRows=this.getRowCount(),this.behaviorShapeChanged()),this.computeCellsBounds(),this.repaint()},getBounds:function(){var t=this.getRenderer();if(t)return t.getBounds()},resolveProperty:function(t){return this.getProperties()[t]},behaviorShapeChanged:function(){this.synchronizeScrollingBoundries()},behaviorStateChanged:function(){this.getRenderer().computeCellsBounds(),this.repaint()},repaint:function(){var t=this.resolveProperty("repaintImmediately"),e=this.getCanvas();e&&(t===!0?e.paintNow():e.repaint())},paintNow:function(){var t=this.getCanvas();t.paintNow()},useHiDPI:function(){return this.resolveProperty("useHiDPI")!==!1},initCanvas:function(t){var e=this,i=this.divCanvas=document.createElement("div");this.div.appendChild(i),this.canvas=new c(i,this.renderer);var n=i.style;n.position="absolute",n.top=t.top,n.right=t.right,n.bottom=t.bottom,n.left=t.left,this.canvas.resizeNotification=function(){e.resized()},this.addFinEventListener("fin-canvas-mousemove",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,e.delegateMouseMove(n)}}),this.addFinEventListener("fin-canvas-mousedown",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.keys=t.detail.keys,n.primitiveEvent=t,e.mouseDownState=n,e.delegateMouseDown(n),e.fireSyntheticMouseDownEvent(n),e.repaint()}}),this.addFinEventListener("fin-canvas-mouseup",function(t){if(!e.resolveProperty("readOnly")){e.dragging=!1,e.isScrollingNow()&&e.setScrollingNow(!1),e.columnDragAutoScrolling&&(e.columnDragAutoScrolling=!1);var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,e.delegateMouseUp(n),e.mouseDownState&&e.fireSyntheticButtonPressedEvent(e.mouseDownState),e.mouseDownState=null,e.fireSyntheticMouseUpEvent(n)}}),this.addFinEventListener("fin-canvas-dblclick",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,e.fireSyntheticDoubleClickEvent(n,t),e.delegateDoubleClick(n)}}),this.addFinEventListener("fin-canvas-tap",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,n.keys=t.detail.keys,e.fireSyntheticClickEvent(n),e.delegateTap(n)}}),this.addFinEventListener("fin-canvas-drag",function(t){if(!e.resolveProperty("readOnly")){e.dragging=!0;var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,e.delegateMouseDrag(n)}}),this.addFinEventListener("fin-canvas-keydown",function(t){e.resolveProperty("readOnly")||(e.fireSyntheticKeydownEvent(t),e.delegateKeyDown(t))}),this.addFinEventListener("fin-canvas-keyup",function(t){e.resolveProperty("readOnly")||(e.fireSyntheticKeyupEvent(t),e.delegateKeyUp(t))}),this.addFinEventListener("fin-canvas-track",function(t){if(!e.resolveProperty("readOnly")&&!e.dragging){var i=t.detail.primitiveEvent;Math.abs(i.dy)>Math.abs(i.dx)?i.yDirection>0?e.scrollVBy(-2):i.yDirection<-0&&e.scrollVBy(2):i.xDirection>0?e.scrollHBy(-1):i.xDirection<-0&&e.scrollHBy(1)}}),this.addFinEventListener("fin-canvas-wheelmoved",function(t){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t.detail.primitiveEvent,e.delegateWheelMoved(n)}),this.addFinEventListener("fin-canvas-mouseout",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t.detail.primitiveEvent,e.delegateMouseExit(n)}}),this.addFinEventListener("fin-canvas-context-menu",function(t){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t.detail.primitiveEvent,e.delegateContextMenu(n)}),this.div.removeAttribute("tabindex")},convertViewPointToDataPoint:function(t){return this.getBehavior().convertViewPointToDataPoint(t)},convertDataPointToViewPoint:function(t){return this.getBehavior().convertDataPointToViewPoint(t)},addFinEventListener:function(t,e){this.canvas.addEventListener(t,e)},setScrollingNow:function(t){this.scrollingNow=t},isScrollingNow:function(){return this.scrollingNow},overColumnDivider:function(t){var e=t.primitiveEvent.detail.mouse.x,i=this.getRenderer().overColumnDivider(e);return i},overRowDivider:function(t){var e=t.primitiveEvent.detail.mouse.y,i=this.getRenderer().overRowDivider(e);return i},beCursor:function(t){t||(t="default"),this.div.style.cursor=t},delegateWheelMoved:function(t){var e=this.getBehavior();e.onWheelMoved(this,t)},delegateMouseExit:function(t){var e=this.getBehavior();e.handleMouseExit(this,t)},delegateContextMenu:function(t){var e=this.getBehavior();e.onContextMenu(this,t)},delegateMouseMove:function(t){var e=this.getBehavior();e.onMouseMove(this,t)},delegateMouseDown:function(t){var e=this.getBehavior();e.handleMouseDown(this,t)},delegateMouseUp:function(t){var e=this.getBehavior();e.onMouseUp(this,t)},delegateTap:function(t){var e=this.getBehavior();e.onTap(this,t)},delegateMouseDrag:function(t){var e=this.getBehavior();e.onMouseDrag(this,t)},delegateDoubleClick:function(t){var e=this.getBehavior();e.onDoubleClick(this,t)},delegateHoldPulse:function(t){var e=this.getBehavior();e.onHoldPulse(this,t)},delegateKeyDown:function(t){var e=this.getBehavior();e.onKeyDown(this,t)},delegateKeyUp:function(t){var e=this.getBehavior();e.onKeyUp(this,t)},stopEditing:function(){this.cellEditor&&this.isEditing()&&(this.cellEditor.stopEditing&&this.cellEditor.stopEditing(),this.cellEditor=null)},registerCellEditor:function(t,e){this.cellEditors[t]=e},getDataBounds:function(){var t=200,e=this.canvas.bounds,i=new d(0,0,e.origin.x+e.extent.x-t,e.origin.y+e.extent.y);return i},getRowNumbersWidth:function(){return this.isShowRowNumbers()?this.getRenderer().getRowNumbersWidth():0},getCanvas:function(){return this.canvas},editAt:function(t,e){this.cellEditor=t;var i=e.gridCell,n=i.x,o=i.y;if(!(0>n||0>o)){var r=new h(n,o);this.setMouseDown(r),this.setDragExtent(new h(0,0)),t.grid=this,t.beginEditAt(r)}},isColumnVisible:function(t){var e=this.getRenderer().isColumnVisible(t);return e},isDataRowVisible:function(t){var e=this.getRenderer().isRowVisible(t);return e},isDataVisible:function(t,e){var i=this.isDataRowVisible(e)&&this.isColumnVisible(t);return i},insureModelColIsVisible:function(t,e){var i=this.getColumnCount()-1,n=t;return e>0&&n++,this.isColumnVisible(n)&&t!==i?!1:(this.scrollBy(e,0),!0)},insureModelRowIsVisible:function(t,e){var i=this.getRowCount()-1,n=t;return e>0&&n++,this.isDataRowVisible(n)&&t!==i?!1:(this.scrollBy(0,e),!0)},scrollBy:function(t,e){this.scrollHBy(t),this.scrollVBy(e)},scrollVBy:function(t){var e=this.sbVScroller.range.max,i=this.getVScrollValue(),n=Math.min(e,Math.max(0,i+t));n!==i&&this.setVScrollValue(n)},scrollHBy:function(t){var e=this.sbHScroller.range.max,i=this.getHScrollValue(),n=Math.min(e,Math.max(0,i+t));n!==i&&this.setHScrollValue(n)},getGridCellFromMousePoint:function(t){var e=this.getRenderer().getGridCellFromMousePoint(t);return e},getBoundsOfCell:function(t){var e=this.getRenderer().getBoundsOfCell(t),i=new d(e.x,e.y,e.width,e.height);return i},resized:function(){this.synchronizeScrollingBoundries()},cellClicked:function(t){var e=t.gridCell,i=this.getColumnCount(),n=this.getRowCount();if(!(e.x>i||e.y>n)){var o=this.getHoverCell(),r=this.getVScrollValue(),s=o.x;o.y<0&&(r=0),o=new h(s,o.y+r),this.getBehavior().cellClicked(o,t)}},setTotalsValueNotification:function(t,e,i,n){this.fireSyntheticSetTotalsValue(t,e,i,n)},fireSyntheticSetTotalsValue:function(t,e,i,n){var o=new CustomEvent("fin-set-totals-value",{detail:{x:t,y:e,value:i,area:n?"bottom":"top"}});this.canvas.dispatchEvent(o)},fireSyntheticEditorKeyUpEvent:function(t,e){var i=new CustomEvent("fin-editor-key-up",{detail:{input:t,keyEvent:e}});this.canvas.dispatchEvent(i)},fireSyntheticEditorKeyDownEvent:function(t,e){var i=new CustomEvent("fin-editor-key-down",{detail:{input:t,keyEvent:e}});this.canvas.dispatchEvent(i)},fireSyntheticEditorKeyPressEvent:function(t,e){var i=new CustomEvent("fin-editor-key-press",{detail:{input:t,keyEvent:e}});this.canvas.dispatchEvent(i)},fireSyntheticEditorDataChangeEvent:function(t,e,i){var n=new CustomEvent("fin-editor-data-change",{detail:{input:t,oldValue:e,newValue:i},cancelable:!0});return this.canvas.dispatchEvent(n)},fireSyntheticRowSelectionChangedEvent:function(){var t=new CustomEvent("fin-row-selection-changed",{detail:{rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(t)},fireSyntheticColumnSelectionChangedEvent:function(){var t=new CustomEvent("fin-column-selection-changed",{detail:{rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(t)},selectionChanged:function(){var t=this.getSelectedRows(),e=new CustomEvent("fin-selection-changed",{detail:{rows:t,columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(e)},getRowSelection:function(){function t(t,o){i[o]=l(n.getValue(e,t))}var e,i,n=this,o=this.getSelectionModel().getSelectedRows(),r=this.getColumnCount(),s={};for(e=0;r>e;e++)i=new Array(o.length),s[this.getField(e)]=i,o.forEach(t);return s},getRowSelectionMatrix:function(){function t(t,n){r[e][n]=l(i.getValue(e,t))}var e,i=this,n=this.getSelectionModel().getSelectedRows(),o=this.getColumnCount(),r=new Array(o);for(e=0;o>e;e++)r[e]=new Array(n.length),n.forEach(t);return r},getColumnSelectionMatrix:function(){var t=this.getSelectedColumns(),e=this.getRowCount(),i=new Array(t.length),n=this;return t.forEach(function(t,o){i[o]=new Array(e);for(var r=0;e>r;r++)i[o][r]=l(n.getValue(t,r))}),i},getColumnSelection:function(){var t=this.getSelectedColumns(),e={},i=this.getRowCount(),n=this;return t.forEach(function(t){var o=new Array(i);e[n.getField(t)]=o;for(var r=0;i>r;r++)o[r]=l(n.getValue(t,r))}),e},getSelection:function(){var t=this,e=this.getSelections(),i=new Array(e.length);return e.forEach(function(e,n){i[n]=t._getSelection(e)}),i},_getSelection:function(t){t=o(t);for(var e,i=t.extent.x+1,n=t.extent.y+1,r=t.origin.x,s=t.origin.y,a={},u=0;i>u;u++){var c=new Array(n);for(a[this.getField(u+r)]=c,e=0;n>e;e++)c[e]=l(this.getValue(r+u,s+e))}return a},getSelectionMatrix:function(){var t=this,e=this.getSelections(),i=new Array(e.length);return e.forEach(function(e,n){i[n]=t._getSelectionMatrix(e)}),i},_getSelectionMatrix:function(t){t=o(t);for(var e=t.extent.x+1,i=t.extent.y+1,n=t.origin.x,r=t.origin.y,s=[],a=0;e>a;a++){var u=new Array(i);s[a]=u;for(var c=0;i>c;c++)u[c]=l(this.getValue(n+a,r+c))}return s},fireSyntheticContextMenuEvent:function(t){t.gridCell=this.convertViewPointToDataPoint(t.gridCell);var e=new CustomEvent("fin-context-menu",{detail:{gridCell:t.gridCell,mousePoint:t.mousePoint,viewPoint:t.viewPoint,primitiveEvent:t.primitiveEvent,rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(e)},fireSyntheticMouseUpEvent:function(t){var e=new CustomEvent("fin-mouseup",{detail:{gridCell:t.gridCell,mousePoint:t.mousePoint,viewPoint:t.viewPoint,primitiveEvent:t.primitiveEvent,rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(e)},fireSyntheticMouseDownEvent:function(t){var e=new CustomEvent("fin-mousedown",{detail:{gridCell:t.gridCell,mousePoint:t.mousePoint,viewPoint:t.viewPoint,primitiveEvent:t.primitiveEvent,rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(e)},isViewableButton:function(t,e){return this.getRenderer().isViewableButton(t,e)},fireSyntheticButtonPressedEvent:function(t){var e=t.dataCell,i=t.gridCell;if(this.isViewableButton(e.x,e.y)){var n=new CustomEvent("fin-button-pressed",{detail:{gridCell:i}});this.canvas.dispatchEvent(n)}},fireSyntheticKeydownEvent:function(t){var e=new CustomEvent("fin-keydown",{detail:t.detail});this.canvas.dispatchEvent(e)},fireSyntheticKeyupEvent:function(t){var e=new CustomEvent("fin-keyup",{detail:t.detail});this.canvas.dispatchEvent(e)},fireSyntheticOnCellEnterEvent:function(t){var e={gridCell:t,time:Date.now(),grid:this},i=new CustomEvent("fin-cell-enter",{detail:e});this.canvas.dispatchEvent(i)},fireSyntheticGroupsChangedEvent:function(t){var e={groups:t,time:Date.now(),grid:this},i=new CustomEvent("fin-groups-changed",{detail:e});this.canvas.dispatchEvent(i)},fireSyntheticOnCellExitEvent:function(t){var e={gridCell:t,time:Date.now(),grid:this},i=new CustomEvent("fin-cell-exit",{detail:e});this.canvas.dispatchEvent(i)},fireSyntheticClickEvent:function(t){this.stopEditing();var e=t.gridCell,i={gridCell:e,mousePoint:t.mousePoint,keys:t.keys,primitiveEvent:t,time:Date.now(),grid:this};this.getBehavior().enhanceDoubleClickEvent(i);var n=new CustomEvent("fin-click",{detail:i});this.canvas.dispatchEvent(n)},fireSyntheticDoubleClickEvent:function(t){this.stopEditing();var e=t.gridCell,i=this.getBehavior(),n={gridCell:e,mousePoint:t.mousePoint,time:Date.now(),grid:this};i.enhanceDoubleClickEvent(t);var o=new CustomEvent("fin-double-click",{detail:n});i.cellDoubleClicked(e,t),this.canvas.dispatchEvent(o)},fireSyntheticGridRenderedEvent:function(){var t=new CustomEvent("fin-grid-rendered",{detail:{source:this,time:Date.now()}});this.canvas&&this.canvas.dispatchEvent(t)},fireScrollEvent:function(t,e,i){var n=new CustomEvent(t,{detail:{oldValue:e,value:i,time:Date.now()}});this.canvas.dispatchEvent(n)},setVScrollValue:function(t){t=Math.round(t);var e=this.sbVScroller.range.max;t=Math.min(e,Math.max(0,t));var i=this;if(t!==this.vScrollValue){this.getBehavior()._setScrollPositionY(t);var n=this.vScrollValue;this.vScrollValue=t,this.scrollValueChangedNotification(),setTimeout(function(){i.fireScrollEvent("fin-scroll-y",n,t)})}},getVScrollValue:function(){return this.vScrollValue},setHScrollValue:function(t){t=Math.round(t);var e=this.sbHScroller.range.max;t=Math.min(e,Math.max(0,t));var i=this;if(t!==this.hScrollValue){this.getBehavior()._setScrollPositionX(t);var n=this.hScrollValue;this.hScrollValue=t,this.scrollValueChangedNotification(),setTimeout(function(){i.fireScrollEvent("fin-scroll-x",n,t),i.synchronizeScrollingBoundries()})}},getHScrollValue:function(){return this.hScrollValue},takeFocus:function(){this.isEditing()?this.stopEditing():this.getCanvas().takeFocus()},editorTakeFocus:function(){return this.cellEditor?this.cellEditor.takeFocus():void 0},isEditing:function(){return this.cellEditor?this.cellEditor.isEditing:!1},initScrollbars:function(){var t=this,e=new u({orientation:"horizontal",onchange:t.setHScrollValue.bind(t),cssStylesheetReferenceElement:this.div}),i=new u({orientation:"vertical",onchange:t.setVScrollValue.bind(t),paging:{up:t.pageUp.bind(t),down:t.pageDown.bind(t)}});this.sbHScroller=e,this.sbVScroller=i;var n=this.resolveProperty("hScrollbarClassPrefix"),o=this.resolveProperty("vScrollbarClassPrefix");n&&""!==n&&(this.sbHScroller.classPrefix=n),o&&""!==o&&(this.sbVScroller.classPrefix=o),this.div.appendChild(e.bar),this.div.appendChild(i.bar),this.resizeScrollbars()},resizeScrollbars:function(){this.sbHScroller.shortenBy(this.sbVScroller).resize(),this.sbVScroller.resize()},setVScrollbarValues:function(t){this.sbVScroller.range={min:0,max:t}},setHScrollbarValues:function(t){this.sbHScroller.range={min:0,max:t}},scrollValueChangedNotification:function(){(this.hScrollValue!==this.sbPrevHScrollValue||this.vScrollValue!==this.sbPrevVScrollValue)&&(this.sbPrevHScrollValue=this.hScrollValue,this.sbPrevVScrollValue=this.vScrollValue,this.cellEditor&&this.cellEditor.scrollValueChangedNotification(),this.computeCellsBounds())},getValue:function(t,e){return this.getBehavior().getValue(t,e)},setValue:function(t,e,i){this.getBehavior().setValue(t,e,i)},getColumnAlignment:function(t){return this.getBehavior().getColumnAlignment(t)},synchronizeScrollingBoundries:function(){var t=this.getBehavior(),e=this.getFixedColumnCount(),i=this.getFixedRowCount(),n=this.getColumnCount(),o=this.getRowCount(),r=this.getBounds();if(r){for(var s=r.height-t.getFixedRowsMaxHeight()-15,l=r.width-200-t.getFixedColumnsMaxWidth()-15,a=0,u=0;n>a;a++){var c=this.getColumnWidth(n-a-1);if(u+=c,u>l)break}for(var h=0,d=0;o>h;h++){var g=this.getRowHeight(o-h-1);if(d+=g,d>s)break}var f=Math.max(0,n-e-a);this.setHScrollbarValues(f);var p=Math.max(0,o-i-h);this.setVScrollbarValues(p),this.setHScrollValue(Math.min(this.getHScrollValue(),f)),this.setVScrollValue(Math.min(this.getVScrollValue(),p)),this.computeCellsBounds(),this.repaint(),this.resizeScrollbars()}},getVisibleRows:function(){return this.getRenderer().getVisibleRows()},getVisibleColumns:function(){return this.getRenderer().getVisibleColumns()},initRenderer:function(){this.renderer=new p(this)},getRenderer:function(){return this.renderer},getColumnWidth:function(t){return this.getBehavior().getColumnWidth(t)},setColumnWidth:function(t,e){this.stopEditing(),this.getBehavior().setColumnWidth(t,e)},getColumnEdge:function(t){return this.getBehavior().getColumnEdge(t,this.getRenderer())},getFixedColumnsWidth:function(){return this.getBehavior().getFixedColumnsWidth()},getRowHeight:function(t){return this.getBehavior().getRowHeight(t)},setRowHeight:function(t,e){this.stopEditing(),this.getBehavior().setRowHeight(t,e)},getFixedRowsHeight:function(){return this.getBehavior().getFixedRowsHeight()},getColumnCount:function(){return this.getBehavior().getColumnCount()},getRowCount:function(){return this.getBehavior().getRowCount()},getFixedColumnCount:function(){return this.getBehavior().getFixedColumnCount()},getFixedRowCount:function(){return this.getBehavior().getFixedRowCount()},topLeftClicked:function(t){this.getBehavior().topLeftClicked(this,t)},rowHeaderClicked:function(t){this.getBehavior().rowHeaderClicked(this,t)},columnHeaderClicked:function(t){this.getBehavior().columnHeaderClicked(this,t)},_activateEditor:function(t){var e=t.gridCell;this.activateEditor(e.x,e.y)},activateEditor:function(t,e){if(this.isEditable()||this.isFilterRow(e)){var i=this.getCellEditorAt(t,e);if(i){var n=i.getEditorPoint();if(i){if(n.x===t&&n.y===e&&i.isEditing)return;this.isEditing()&&this.stopEditing(),event.gridCell={x:t,y:e},this.editAt(i,event)}}}},getCellEditorAt:function(t,e){return this.getBehavior()._getCellEditorAt(t,e)},toggleHiDPI:function(){this.useHiDPI()?this.removeAttribute("hidpi"):this.setAttribute("hidpi",null),this.canvas.resize()},getHiDPI:function(t){if(window.devicePixelRatio&&this.useHiDPI()){var e=window.devicePixelRatio||1,i=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1,n=e/i;return n}return 1},getRenderedWidth:function(t){return this.renderer.getRenderedWidth(t)},getRenderedHeight:function(t){return this.renderer.getRenderedHeight(t)},resolveCellEditor:function(t){return this.cellEditors[t]},updateCursor:function(){var t=this.getBehavior(),e=t.getCursorAt(-1,-1),i=this.getHoverCell();if(i&&i.x>-1&&i.y>-1){var n=i.x+this.getHScrollValue();e=t.getCursorAt(n,i.y+this.getVScrollValue())}this.beCursor(e)},repaintCell:function(t,e){this.getRenderer().repaintCell(t,e)},isDraggingColumn:function(){return!!this.renderOverridesCache.dragger},pageUp:function(){var t=this.getRenderer().getPageUpRow();return this.setVScrollValue(t),t},pageDown:function(){var t=this.getRenderer().getPageDownRow();return this.setVScrollValue(t),t},pageLeft:function(){console.log("page left")},pageRight:function(){console.log("page right")},getRenderedData:function(){var t,e=this.getBehavior(),i=this.getRenderer(),n=this.getColumnCount(),o=i.getVisibleRows(),r=new Array(n),s=new Array(o);return r.forEach(function(t,i){r[i]=e.getColumnId(i,0)}),s.forEach(function(i,n){ +},setValue:function(t,e,i){this.last.setValue(t,e,i)}});e.exports=r},{"./DataSourceIndexed":19,"./DataSourceSorter":20}],22:[function(t,e,i){"use strict";function n(){this.keys=[],this.data={},this.values=[]}function o(t){var e=typeof t;switch(e){case"number":case"string":case"boolean":case"symbol":return l+e+"_"+t;case"undefined":return"UNDEFINED";case"object":if(null===t)return"NULL";case"function":return t.___finhash=t.___finhash||l+a++}}function r(t){return t}function s(t,e){if(e!=e||0===e)for(var i=t.length;i--&&!u(t[i],e););else i=[].indexOf.call(t,e);return i}n.prototype={constructor:n.prototype.constructor,set:function(t,e){var i=o(t);i in this.data||(this.keys.push(t),this.values.push(e)),this.data[i]=e},get:function(t){var e=o(t);return this.data[e]},getIfUndefined:function(t,e){var i=this.get(t);return void 0===i&&(i=e(t),this.set(t,i)),i},size:function(){return this.keys.length},clear:function(){this.keys.length=0,this.values.length=0,this.data={}},"delete":function(t){var e=o(t);if(void 0!==this.data[e]){var i=s(this.keys,t);this.keys.splice(i,1),this.values.splice(i,1),delete this.data[e]}},forEach:function(t){if("function"==typeof t){var e=this.keys,i=this;e.forEach(function(e){var n=i.get(e);t(n,e,i)})}},map:function(t){var e=this.keys,i=new n,o=this;return"function"!=typeof t&&(t=r),e.forEach(function(e){var n=o.get(e),r=t(n,e,o);i.set(e,r)}),i},copy:function(){var t=this.keys,e=new n,i=this;return t.forEach(function(t){var n=i.get(t);e.set(t,n)}),e}};var l=".~.#%_",a=0,u=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};e.exports=n},{}],23:[function(t,e,i){"use strict";function n(t){return t.getRowCount()}function o(t,e){for(var i=e.getRowCount(),n=0;i--;)n+=e.getValue(t,i);return n}function r(t,e,i,n){for(var o=n.getRowCount();o--;)i=e(i,n.getValue(t,o));return i}function s(t,e){return o(t,e)/e.getRowCount()}function l(t,e){return e.getValue(t,0)}function a(t,e){return e.getValue(t,e.getRowCount()-1)}function u(t,e){for(var i,n=e.getRowCount(),o=s(t,e),r=n,l=0;r--;l+=i*i)i=e.getValue(t,r)-o;return Math.sqrt(l/n)}e.exports={count:function(t){return n},sum:function(t){return o.bind(this,t)},min:function(t){return r.bind(this,t,Math.min,1/0)},max:function(t){return r.bind(this,t,Math.max,-(1/0))},avg:function(t){return s.bind(this,t)},first:function(t){return l.bind(this,t)},last:function(t){return a.bind(this,t)},stddev:function(t){return u.bind(this,t)}}},{}],24:[function(t,e,i){"use strict";function n(t){return(/[a-z]/.test(t)?t:t.toLowerCase()).replace(/[\s\-_]*([^\s\-_])([^\s\-_]+)/g,o).replace(/[A-Z]/g," $&").trim()}function o(t,e,i){return e.toUpperCase()+i}e.exports=n},{}],25:[function(t,e,i){"use strict";function n(t,e,i,n){var o=i[0],r=n[0];if(o===r)o=e?n[1]:i[1],r=e?i[1]:n[1];else{if(null===r)return-1;if(null===o)return 1}return t(o,r)}function o(t,e){return t-e}function r(t,e){return e-t}function s(t,e){return e>t?-1:1}function l(t,e){return t>e?-1:1}function a(t){return n.bind(this,"number"===t?o:s,!1)}function u(t){return n.bind(this,"number"===t?r:l,!0)}function c(t,e,i){var n,o;if(void 0===i&&(i=1),t.length){switch(i){case 0:return;case void 0:i=1;case 1:n=a(typeof e(0));break;case-1:n=u(typeof e(0))}var r=new Array(t.length);for(o=0;op&&t>=0||0===p&&0!==t||p>0&&0>=t;p=t>0?Math.min(50,t):Math.max(-50,t),n&&(clearInterval(f),f=setInterval(function(t){var e=i.scrollTop+p;0>p&&t>e||p>0&&e>t?(i.scrollTop=t,clearInterval(f)):i.scrollTop=e},125))}else clearInterval(f),p=0}function r(t){return Array.prototype.slice.call(t)}function s(t,e){return e.top<=t.y&&t.y<=e.bottom&&e.left<=t.x&&t.x<=e.right}function l(t,e){return"translate("+Math.floor(t+window.scrollX)+"px,"+Math.floor(e+window.scrollY)+"px)"}function a(t){var e=document.createTextNode(t);return document.createElement("a").appendChild(e).parentNode.innerHTML}function u(t,e){var i=e.label||"{label}";return t.forEach(function(n,o){var r=n.label||i,s=void 0!==n.htmlEncode&&n.htmlEncode||e.htmlEncode,l=document.createElement("div"),u=document.createElement("ul");if(n.models)Object.keys(n).forEach(function(t){"models"!==t&&(n.models[t]=n[t])}),t[o]=n=n.models;else{if(!(n instanceof Array))throw d("List [{1}] not an array of models (with or without additional properties) OR an object (with a `models` property containing an array of models).",o);n.models=n}n.forEach(function(t){var i=t.label||r,o=void 0!==t.htmlEncode&&t.htmlEncode||s,l="object"==typeof t?t:{label:t},c=C.call([l,n,e],i),h=document.createElement("li");h.innerHTML=o?a(c):c,u.appendChild(h)});var c=document.createElement("li");if(c.innerHTML=" ",u.appendChild(c),n.title){var h=document.createElement("div");h.innerHTML=s?a(n.title):n.title,l.appendChild(h)}l.appendChild(u),l.className=n.cssClassNames||e.cssClassNames||"dragon-list",n.element=u,n.container=l}),t}function c(t){var e=[];return t.forEach(function(t){var i=t.parentElement,n=i.parentElement,o=[];e.find(function(t){return t.element===i})||(r(i.querySelectorAll("li")).forEach(function(t){t!==i.lastElementChild&&o.push(t.innerHTML)}),o.element=i,o.container=n,e.push(o))}),e}function h(t){t.stopPropagation()}function d(){return"list-dragon: "+C.apply(this,Array.prototype.slice.call(arguments))}var g,f,p,v,m=t("css-injector"),C=t("templex"),w=null;v="div.dragon-list{position:relative;background-color:#fff}div.dragon-list>div,div.dragon-list>ul{position:absolute;left:0;right:0}div.dragon-list>div{text-align:center;background-color:#00796b;color:#fff;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);overflow:hidden;white-space:nowrap}div.dragon-list>ul{overflow-y:auto;bottom:0;margin:0;padding:0;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}div.dragon-list>ul>li,li.dragon-pop{white-space:nowrap;list-style-type:none;border:0 solid #f4f4f4;border-bottom:1px solid #e0e0e0;cursor:move;transition:border-top-width .2s}div.dragon-list>ul>li:last-child{height:0;border-bottom:none}li.dragon-pop{position:fixed;background-color:#fff;border:1px solid #e0e0e0;left:0;top:0;overflow-x:hidden;box-shadow:rgba(0,0,0,.188235) 0 10px 20px,rgba(0,0,0,.227451) 0 6px 6px}",n.prototype={addEvt:function(t,e,i,n){var o={handler:y[e].bind(t,this),element:i||window};return n||(this.bindings[e]=o),o.element.addEventListener(e,o.handler),o},removeEvt:function(t){var e=this.bindings[t];delete this.bindings[t],e.element.removeEventListener(t,e.handler)},removeAllEventListeners:function(){for(var t in this.bindings){var e=this.bindings[t];e.element.removeEventListener(t,e.handler)}this.items.forEach(function(t){t.handler&&t.element.removeEventListener("mousedown",t.handler)}),this.modelLists.forEach(function(t){t.element.removeEventListener("wheel",h)})},pointInListRects:function(t){return this.modelLists.find(function(e){var i=e.element.getBoundingClientRect();return i={left:window.scrollX+i.left,top:window.scrollY+i.top,right:window.scrollX+i.right,bottom:window.scrollY+i.bottom,width:i.width,height:i.height},e.rect=i,s(t,i)?(e.rect=i,!0):!1})},pointInItemRects:function(t,e,i){return this.items.find(function(n){var o=n.element;return o!==e&&o!==i&&s(t,n.rect)})},getAllItemBoundingRects:function(){var t,e=this.modelLists;this.items.forEach(function(i){var n=i.element,o=n.parentElement,r=e.find(function(t){return t.element===o});if(void 0===r.isDropTarget||"function"==typeof r.isDropTarget&&r.isDropTarget()||r.isDropTarget){var s=n.getBoundingClientRect(),l=s.bottom;n===o.lastElementChild?(l=o.getBoundingClientRect().bottom,l0&&(i.element.scrollTop>0&&(s=u-(i.rect.top+5))<0?o(s,0,i.element):i.element.scrollTop0?o(s,a,i.element):o());var c=t.pointInItemRects({x:e.clientX,y:t.rect.bottom+window.scrollY+r+i.element.scrollTop},this,t.drop);if(this.style[g]=l(t.rect.left-window.scrollX+n,t.rect.top-window.scrollY+r),c){var h=c.element;h.style.transition=w,h.style.borderTopWidth=t.drop.style.borderTopWidth,t.drop.style.borderTopWidth=null,t.drop=h}}},mouseup:function(t,e){o(),t.removeEvt("mousemove"),t.removeEvt("mouseup"),e.stopPropagation();var i=this.getBoundingClientRect();if(window.scrollX+i.left===t.rect.left&&window.scrollY+i.top===t.rect.top)t.reinsert(this);else{var n=t.drop.getBoundingClientRect();t.addEvt(this,"transitionend",this),this.style.transitionDuration=w,this.style.transitionProperty=g,this.style[g]=l(n.left-window.scrollX,n.top-window.scrollY)}},transitionend:function(t,e){if(e.propertyName===g){t.removeEvt("transitionend"),t.reinsert(this),this.style.transitionProperty=w;var i=t.modelLists[t.origin.list].splice(t.origin.item,1)[0],n=t.itemCoordinates(this);t.modelLists[n.list].splice(n.item,0,i),t.callback.dropped&&t.callback.dropped.call(this,t)}}};e.exports=n},{"css-injector":3,templex:32}],27:[function(t,e,i){!function(){function t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function i(){return 1}function n(t){d||"string"==typeof t||"number"==typeof t||(d=!0,console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! "+typeof t).stack))}function o(t){return this instanceof o?("number"==typeof t&&(t={max:t}),t||(t={}),this._max=t.max,(!this._max||"number"!=typeof this._max||this._max<=0)&&(this._max=1/0),this._lengthCalculator=t.length||i,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=i),this._allowStale=t.stale||!1,this._maxAge=t.maxAge||null,this._dispose=t.dispose,void this.reset()):new o(t)}function r(t,e,i){n(e);var o=t._cache[e];return o&&(s(t,o)?(c(t,o),t._allowStale||(o=void 0)):i&&l(t,o),o&&(o=o.value)),o}function s(t,e){if(!e||!e.maxAge&&!t._maxAge)return!1;var i=!1,n=Date.now()-e.now;return i=e.maxAge?n>e.maxAge:t._maxAge&&n>t._maxAge}function l(t,e){u(t,e),e.lu=t._mru++,t._lruList[e.lu]=e}function a(t){for(;t._lrut._max;)c(t,t._lruList[t._lru])}function u(t,e){for(delete t._lruList[e.lu];t._lru=t)&&(t=1/0),this._max=t,this._length>this._max&&a(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(o.prototype,"lengthCalculator",{set:function(t){if("function"!=typeof t){this._lengthCalculator=i,this._length=this._itemCount;for(var e in this._cache)this._cache[e].length=1}else{this._lengthCalculator=t,this._length=0;for(var e in this._cache)this._cache[e].length=this._lengthCalculator(this._cache[e].value),this._length+=this._cache[e].length}this._length>this._max&&a(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(o.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(o.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),o.prototype.forEach=function(t,e){e=e||this;for(var i=0,n=this._itemCount,o=this._mru-1;o>=0&&n>i;o--)if(this._lruList[o]){i++;var r=this._lruList[o];s(this,r)&&(c(this,r),this._allowStale||(r=void 0)),r&&t.call(e,r.value,r.key,this)}},o.prototype.keys=function(){for(var t=new Array(this._itemCount),e=0,i=this._mru-1;i>=0&&e=0&&e=0&&ethis._max?(c(this,this._cache[e]),!1):(this._dispose&&this._dispose(e,this._cache[e].value),this._cache[e].now=r,this._cache[e].maxAge=o,this._cache[e].value=i,this._length+=s-this._cache[e].length,this._cache[e].length=s,this.get(e),this._length>this._max&&a(this),!0);var l=new h(e,i,this._mru++,s,r,o);return l.length>this._max?(this._dispose&&this._dispose(e,i),!1):(this._length+=l.length,this._lruList[l.lu]=this._cache[e]=l,this._itemCount++,this._length>this._max&&a(this),!0)},o.prototype.has=function(e){if(n(e),!t(this._cache,e))return!1;var i=this._cache[e];return s(this,i)?!1:!0},o.prototype.get=function(t){return n(t),r(this,t,!0)},o.prototype.peek=function(t){return n(t),r(this,t,!1)},o.prototype.pop=function(){var t=this._lruList[this._lru];return c(this,t),t||null},o.prototype.del=function(t){n(t),c(this,this._cache[t])},o.prototype.load=function(t){this.reset();for(var e=Date.now(),i=t.length-1;i>=0;i--){var o=t[i];n(o.k);var r=o.e||0;if(0===r)this.set(o.k,o.v);else{var s=r-e;s>0&&this.set(o.k,o.v,s)}}}}()},{}],28:[function(t,e,i){!function(t,e){"object"==typeof i&&i&&"string"!=typeof i.nodeName?e(i):"function"==typeof define&&define.amd?define(["exports"],e):(t.Mustache={},e(t.Mustache))}(this,function(t){function e(t){return"function"==typeof t}function i(t){return p(t)?"array":typeof t}function n(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(t,e){return null!=t&&"object"==typeof t&&e in t}function r(t,e){return v.call(t,e)}function s(t){return!r(m,t)}function l(t){return String(t).replace(/[&<>"'`=\/]/g,function(t){return C[t]})}function a(e,i){function o(){if(m&&!C)for(;v.length;)delete f[v.pop()];else v=[];m=!1,C=!1}function r(t){if("string"==typeof t&&(t=t.split(y,2)),!p(t)||2!==t.length)throw new Error("Invalid tags: "+t);l=new RegExp(n(t[0])+"\\s*"),a=new RegExp("\\s*"+n(t[1])),d=new RegExp("\\s*"+n("}"+t[1]))}if(!e)return[];var l,a,d,g=[],f=[],v=[],m=!1,C=!1;r(i||t.tags);for(var E,R,A,M,P,D,T=new h(e);!T.eos();){if(E=T.pos,A=T.scanUntil(l))for(var k=0,F=A.length;F>k;++k)M=A.charAt(k),s(M)?v.push(f.length):C=!0,f.push(["text",M,E,E+1]),E+=1,"\n"===M&&o();if(!T.scan(l))break;if(m=!0,R=T.scan(b)||"name",T.scan(w),"="===R?(A=T.scanUntil(x),T.scan(x),T.scanUntil(a)):"{"===R?(A=T.scanUntil(d),T.scan(S),T.scanUntil(a),R="&"):A=T.scanUntil(a),!T.scan(a))throw new Error("Unclosed tag at "+T.pos);if(P=[R,A,E,T.pos],f.push(P),"#"===R||"^"===R)g.push(P);else if("/"===R){if(D=g.pop(),!D)throw new Error('Unopened section "'+A+'" at '+E);if(D[1]!==A)throw new Error('Unclosed section "'+D[1]+'" at '+E)}else"name"===R||"{"===R||"&"===R?C=!0:"="===R&&r(A)}if(D=g.pop())throw new Error('Unclosed section "'+D[1]+'" at '+T.pos);return c(u(f))}function u(t){for(var e,i,n=[],o=0,r=t.length;r>o;++o)e=t[o],e&&("text"===e[0]&&i&&"text"===i[0]?(i[1]+=e[1],i[3]=e[3]):(n.push(e),i=e));return n}function c(t){for(var e,i,n=[],o=n,r=[],s=0,l=t.length;l>s;++s)switch(e=t[s],e[0]){case"#":case"^":o.push(e),r.push(e),o=e[4]=[];break;case"/":i=r.pop(),i[5]=e[2],o=r.length>0?r[r.length-1][4]:n;break;default:o.push(e)}return n}function h(t){this.string=t,this.tail=t,this.pos=0}function d(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function g(){this.cache={}}var f=Object.prototype.toString,p=Array.isArray||function(t){return"[object Array]"===f.call(t)},v=RegExp.prototype.test,m=/\S/,C={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},w=/\s*/,y=/\s+/,x=/\s*=/,S=/\s*\}/,b=/#|\^|\/|>|\{|&|=|!/;h.prototype.eos=function(){return""===this.tail},h.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var i=e[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},h.prototype.scanUntil=function(t){var e,i=this.tail.search(t);switch(i){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=e.length,e},d.prototype.push=function(t){return new d(t,this)},d.prototype.lookup=function(t){var i,n=this.cache;if(n.hasOwnProperty(t))i=n[t];else{for(var r,s,l=this,a=!1;l;){if(t.indexOf(".")>0)for(i=l.view,r=t.split("."),s=0;null!=i&&sa;++a)s=void 0,o=t[a],r=o[0],"#"===r?s=this.renderSection(o,e,i,n):"^"===r?s=this.renderInverted(o,e,i,n):">"===r?s=this.renderPartial(o,e,i,n):"&"===r?s=this.unescapedValue(o,e):"name"===r?s=this.escapedValue(o,e):"text"===r&&(s=this.rawValue(o)),void 0!==s&&(l+=s);return l},g.prototype.renderSection=function(t,i,n,o){function r(t){return s.render(t,i,n)}var s=this,l="",a=i.lookup(t[1]);if(a){if(p(a))for(var u=0,c=a.length;c>u;++u)l+=this.renderTokens(t[4],i.push(a[u]),n,o);else if("object"==typeof a||"string"==typeof a||"number"==typeof a)l+=this.renderTokens(t[4],i.push(a),n,o);else if(e(a)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");a=a.call(i.view,o.slice(t[3],t[5]),r),null!=a&&(l+=a)}else l+=this.renderTokens(t[4],i,n,o);return l}},g.prototype.renderInverted=function(t,e,i,n){var o=e.lookup(t[1]);return!o||p(o)&&0===o.length?this.renderTokens(t[4],e,i,n):void 0},g.prototype.renderPartial=function(t,i,n){if(n){var o=e(n)?n(t[1]):n[t[1]];return null!=o?this.renderTokens(this.parse(o),i,n,o):void 0}},g.prototype.unescapedValue=function(t,e){var i=e.lookup(t[1]);return null!=i?i:void 0},g.prototype.escapedValue=function(e,i){var n=i.lookup(e[1]);return null!=n?t.escape(n):void 0},g.prototype.rawValue=function(t){return t[1]},t.name="mustache.js",t.version="2.2.1",t.tags=["{{","}}"];var E=new g;t.clearCache=function(){return E.clearCache()},t.parse=function(t,e){return E.parse(t,e)},t.render=function(t,e,n){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+i(t)+'" was given as the first argument for mustache#render(template, view, partials)');return E.render(t,e,n)},t.to_html=function(i,n,o,r){var s=t.render(i,n,o);return e(r)?void r(s):s},t.escape=l,t.Scanner=h,t.Context=d,t.Writer=g})},{}],29:[function(t,e,i){"use strict";function n(t){return t instanceof n?t:this instanceof n?(this.originalValue=t,void(this.o=t||{})):new n(t)}n.chain=function(t){var e=n(t);return e.chaining=!0,e},n.prototype={value:function(){return this.originalValue},each:function(t,e){var i=this.o;return Object.keys(i).forEach(function(e){t.call(this,i[e],e,i)},e||i),this},find:function(t,e){var i,n=this.o;return n&&(i=Object.keys(n).find(function(e){return t.call(this,n[e],e,n)},e||n),void 0!==i&&(i=n[i])),i},filter:function(t,e){var i=this.o,n=[];return i&&Object.keys(i).forEach(function(e){t.call(this,i[e],e,i)&&n.push(i[e])},e||i),n},map:function(t,e){var i=this.o,n=[];return i&&Object.keys(i).forEach(function(e){n.push(t.call(this,i[e],e,i))},e||i),n},reduce:function(t,e,i){var n=this.o;return n&&Object.keys(n).forEach(function(i,o){e=o||void 0!==e?t(e,n[i],i,n):n[i]},i||n),e},extend:function(t){var e=this.o;return Array.prototype.slice.call(arguments).forEach(function(t){if(t)for(var i in t)e[i]=t[i]}),this.chaining?this:e},extendOwn:function(t){var e=this.o;return Array.prototype.slice.call(arguments).forEach(function(t){n(t).each(function(t,i){e[i]=t})}),this.chaining?this:e}},Array.prototype.find||(Array.prototype.find=function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,i=Object(this),n=i.length>>>0,o=arguments[1],r=0;n>r;r++)if(e=i[r],t.call(o,e,r,i))return e}),e.exports=n},{}],30:[function(t,e,i){"use strict";function n(t,e){Object.defineProperty(this,t,{value:e,writable:!1,enumerable:!0,configurable:!1})}function o(t,e){n.call(this,"x",Number(t)||0),n.call(this,"y",Number(e)||0)}function r(t,e,i,r){t=Number(t)||0,e=Number(e)||0,i=Number(i)||0,r=Number(r)||0,0>i&&(t+=i,i=-i),0>r&&(e+=r,r=-r),n.call(this,"origin",new o(t,e)),n.call(this,"extent",new o(i,r)),n.call(this,"corner",new o(t+i,e+r)),n.call(this,"center",new o(t+i/2,e+r/2))}o.prototype={plus:function(t){return new o(this.x+t.x,this.y+t.y)},plusXY:function(t,e){return new o(this.x+(t||0),this.y+(e||0))},minus:function(t){return new o(this.x-t.x,this.y-t.y)},min:function(t){return new o(Math.min(this.x,t.x),Math.min(this.y,t.y))},max:function(t){return new o(Math.max(this.x,t.x),Math.max(this.y,t.y))},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){var e=!1;return t&&(e=this.x===t.x&&this.y===t.y),e},greaterThan:function(t){return this.x>t.x&&this.y>t.y},lessThan:function(t){return this.x=t.x&&this.y>=t.y},lessThanOrEqualTo:function(t){return this.x<=t.x&&this.y<=t.y},within:function(t){var e=t.origin.x,i=e+t.extent.x,n=t.origin.y,o=n+t.extent.y;return t.extent.x<0&&(e=i,i=t.origin.x),t.extent.y<0&&(n=o,o=t.origin.y),e<=this.x&&this.xi;i++)for(var o=this.origin.y,r=this.corner.y;r>o;o++)t.call(e,i,o)},intersect:function(t,e,i){var n=null,o=this.origin.max(t.origin),s=this.corner.min(t.corner),l=s.minus(o);return l.x>0&&l.y>0?n=new r(o.x,o.y,l.x,l.y):"function"==typeof e&&(n=e.call(i||this,t)),n},intersects:function(t){return t.corner.x>this.origin.x&&t.corner.y>this.origin.y&&t.origin.x=t?[t,e]:[e,t]}function n(t,e){return t[0]<=e[0]&&e[0]<=t[1]||t[0]<=e[1]&&e[1]<=t[1]||e[0]=o&&n>r?s.push([r+1,n]):o>i&&r>=n?s.push([i,o-1]):o>i&&n>r?(s.push([i,o-1]),s.push([r+1,n])):(i>r||o>n)&&s.push(t),s}function s(t,e){var i=Math.min(Math.min.apply(Math,t),Math.min.apply(Math,e)),n=Math.max(Math.max.apply(Math,t),Math.max.apply(Math,e));return[i,n]}e.prototype={select:function(t,e){this.storeState();var r=i(t,e),l=[0,1];return this.selection.forEach(function(t){n(t,r)||o(t,r)?r=s(t,r):l.push(t)}),l.push(r),l[1]=this.selection.length,this.selection.splice.apply(this.selection,l),this},deselect:function(t,e){var o=i(t,e),s=[0,0];return this.selection.forEach(function(t){if(n(t,o)){var e=r(t,o);s=s.concat(e)}else s.push(t)}),s[1]=this.selection.length,this.selection.splice.apply(this.selection,s),this},clear:function(){return this.states.length=0,this.selection.length=0,this},clearMostRecentSelection:function(){0!==this.states.length&&(this.selection=this.states.pop())},isSelected:function(t){return this.selection.some(function(e){return e[0]<=t&&t<=e[1]})},isEmpty:function(){return 0===this.selection.length},getSelections:function(){var t=[];return this.selection.forEach(function(e){for(var i=e[0];i<=e[1];i++)t.push(i)}),t.sort(function(t,e){return t-e}),t}},t.exports=e})("object"==typeof e&&e||(window.RangeSelectionModel={}),"object"==typeof e&&e.exports||(window.RangeSelectionModel.exports={}))||"object"==typeof e||(window.RangeSelectionModel=window.RangeSelectionModel.exports)},{}],32:[function(require,module,exports){function templex(t){var e=this instanceof Array?this:[this];return arguments.length>1&&e.unshift(arguments),t.replace(templex.regexp,templex.merger.bind(e))}templex.regexp=/\{(.*?)\}/g,templex["with"]=function(t,e){return"with(this["+t+"]){"+e+"}"},templex.cache=[],templex.deref=function(key){if(!(this.length in templex.cache)){for(var code="return eval(expr)",i=0;i1&&i.unshift(s.pop()),s=[s.join(" ")],i.length&&(s=s.concat(r(t,e,i,n))),s}function s(t,e,i,n){return r(t,e,l(i).split(" "),n)}function l(t){return t.toString().trim().replace(/\s\s+/g," ")}function a(t,e,i,n,o,r,s,l){l||(l=!0),r||(r=5),t.beginPath(),t.moveTo(e+r,i),t.lineTo(e+n-r,i),t.quadraticCurveTo(e+n,i,e+n,i+r),t.lineTo(e+n,i+o-r),t.quadraticCurveTo(e+n,i+o,e+n-r,i+o),t.lineTo(e+r,i+o),t.quadraticCurveTo(e,i+o,e,i+o-r),t.lineTo(e,i+r),t.quadraticCurveTo(e,i,e+r,i),t.closePath(),l&&t.stroke(),s&&t.fill(),t.closePath()}var u=t("extend-me").Base,c=u.extend("CellProvider",{initialize:function(){this.cellCache={},this.initializeCells()},getCell:function(t){var e=this.cellCache.simpleCellRenderer;return e.config=t,e},getColumnHeaderCell:function(t){var e=this.cellCache.simpleCellRenderer;return e.config=t,e},getRowHeaderCell:function(t){var e=this.cellCache.simpleCellRenderer;return e.config=t,e},paintButton:function(t,e){var i=e.value,n=e.x,o=e.y,r=e.bounds,s=r.x+2,l=r.y+2,u=r.width-3,c=r.height-3,h=c/2,d=t.createLinearGradient(s,l,s,l+c);e.mouseDown?(d.addColorStop(0,"#B5CBED"),d.addColorStop(1,"#4d74ea")):(d.addColorStop(0,"#ffffff"),d.addColorStop(1,"#aaaaaa")),t.fillStyle=d,t.strokeStyle="#000000",a(t,s,l,u,c,h,d,!0);var g=(u-e.getTextWidth(t,i))/2,f=(c-e.getTextHeight(t.font).descent)/2;"middle"!==t.textBaseline&&(t.textBaseline="middle"),t.fillStyle="#000000",e.backgroundColor="rgba(0,0,0,0)",t.fillText(i,s+g,l+f),e.buttonCells[n+","+o]=!0},defaultCellPaint:function(t,e){var i,o,r,s,l,a=e.value,u=e.bounds.x,c=e.bounds.y,h=e.bounds.width,d=e.bounds.height,g=e.headerTextWrapping,f=2,p=0===e.y;a&&a.constructor===Array&&(i=a[0],o=a[2],a=a[1],a&&"object"==typeof a&&"HTMLImageElement"===a.constructor.name&&(r=a,a=null),i&&"IMG"!==i.nodeName&&(i=null),o&&"IMG"!==o.nodeName&&(o=null),r&&"IMG"!==r.nodeName&&(r=null)),a=n(e,a),t.font!==e.font&&(t.font=e.font),"left"!==t.textAlign&&(t.textAlign="left"),"middle"!==t.textBaseline&&(t.textBaseline="middle");var v;(e.backgroundColor||e.isSelected)&&(t.fillStyle=v=n(e,e.isSelected?e.backgroundSelectionColor:e.backgroundColor),t.fillRect(u,c,h,d));var m=n(e,e.isSelected?e.foregroundSelectionColor:e.color);t.fillStyle!==m&&(t.fillStyle=m,t.strokeStyle=m),p&&g?this.renderMultiLineText(t,u,c,d,h,e,a):this.renderSingleLineText(t,u,c,d,h,e,a);var C=0;if(i&&(l=Math.round((d-i.height)/2),t.drawImage(i,u+f,c+l),C=Math.max(i.width+2)),o&&h>1.75*d){l=Math.round((d-o.height)/2);var w=u+h-o.width;v?(t.fillStyle=v,t.fillRect(w,c,o.width,d)):t.clearRect(w,c,o.width,d),t.drawImage(o,w,c+l),C=Math.max(o.width+2)}r&&(l=Math.round((d-r.height)/2),s=Math.round((h-r.width)/2),t.drawImage(r,u+h-s-r.width,c+l),C=Math.max(r.width+2)),e.cellBorderThickness&&(t.beginPath(),t.rect(u,c,h,d),t.lineWidth=e.cellBorderThickness,t.strokeStyle=e.cellBorderStyle,t.stroke(),t.closePath()),e.minWidth=e.minWidth+2*C},renderMultiLineText:function(t,e,i,n,o,r,a){var u=s(t,r,a,o); +if(1===u.length)return this.renderSingleLineText(t,e,i,n,o,r,l(a));var c=r.cellPadding,h=0,d=r.voffset,g=r.halign,f=r.getTextHeight(r.font).height;switch(g){case"right":h=o-c;break;case"center":h=o/2;break;case"left":h=c}var p=0,v=Math.ceil(f/2);d+=Math.ceil((n-(u.length-1)*f)/2),h=Math.max(p,h),d=Math.max(v,d),t.save(),t.rect(e,i,o,n),t.clip(),t.textAlign=g;for(var m=0;m-1,this.selectionModel=new v,this.selectionModel.getGrid=function(){return n},this.cellEditors=Object.create(w),this.renderOverridesCache={},this.behavior=e(this),this.div.oncontextmenu=function(t){return t.preventDefault(),!1},this.clearMouseDown(),this.dragExtent=new h(0,0),this.numRows=0,this.numColumns=0,this.pluginsDo(function(t){t.installOn&&t.installOn(n)}),i=i||{},i.top=i.top||0,i.right=i.right||"-200px",i.bottom=i.bottom||0,i.left=i.left||0,this.initRenderer(),this.initCanvas(i),this.initScrollbars(),this.initGlobalCellEditors(),this.checkScrollbarVisibility(),document.body.addEventListener("copy",function(t){n.checkClipboardCopy(t)}),this.getCanvas().resize(),this.dialog=new C(this)}function o(t){var e=t.origin,i=t.corner,n=Math.min(e.x,i.x),o=Math.min(e.y,i.y),r=Math.max(e.x,i.x),s=Math.max(e.y,i.y),l=new d(n,o,r-n,s-o);return l}function r(){s(x);var t=document.createElement("paper-button");t.style.display="none",t.setAttribute("disabled",!0),document.body.appendChild(t);var e=window.getComputedStyle(t),i=document.createElement("section");i.style.display="none",i.setAttribute("hero",!0),document.body.appendChild(i);var n=window.getComputedStyle(document.querySelector("html")),o=window.getComputedStyle(document.querySelector("html, body")),r=window.getComputedStyle(i);x.columnHeaderBackgroundColor=e.color,x.rowHeaderBackgroundColor=e.color,x.topLeftBackgroundColor=e.color,x.lineColor=e.backgroundColor,x.backgroundColor2=o.backgroundColor,x.color=n.color,x.fontFamily=n.fontFamily,x.backgroundColor=r.backgroundColor,t.setAttribute("disabled",!1),t.setAttribute("secondary",!0),t.setAttribute("raised",!0),e=window.getComputedStyle(t),x.columnHeaderColor=e.color,x.rowHeaderColor=e.color,x.topLeftColor=e.color,x.backgroundSelectionColor=e.backgroundColor,x.foregroundSelectionColor=e.color,t.setAttribute("secondary",!1),t.setAttribute("warning",!0),x.columnHeaderForegroundSelectionColor=e.color,x.columnHeaderBackgroundSelectionColor=e.backgroundColor,x.rowHeaderForegroundSelectionColor=e.color,x.fixedColumnBackgroundSelectionColor=e.backgroundColor,("rgba(0, 0, 0, 0)"===x.columnHeaderBackgroundSelectionColor||"transparent"===x.lineColor)&&s(x),document.body.removeChild(t),document.body.removeChild(i)}function s(t){for(var e in t)t.hasOwnProperty(e)&&delete t[e]}function l(t){var e="function"==typeof t?t():t;return e||0===e?e:""}var a=t("extend-me"),u=t("finbars"),c=t("fincanvas"),h=t("rectangular").Point,d=t("rectangular").Rectangle,g=t("object-iterators"),f=t("./defaults"),p=t("./Renderer"),v=t("./SelectionModel"),m=t("./stylesheets"),C=t("./TableDialog"),w={},y=!1,x=Object.create(f),S=Object.create(x),b={};n.prototype={constructor:n.prototype.constructor,behavior:null,isWebkit:!0,mouseDown:[],dragExtent:null,vScrollValue:0,hScrollValue:0,rectangular:null,selectionModel:null,cellEditor:null,sbHScroller:null,sbVScroller:null,sbPrevVScrollValue:null,sbPrevHScrollValue:null,cellEditors:null,renderOverridesCache:{},hoverCell:null,scrollingNow:!1,lastEdgeSelection:null,setAttribute:function(t,e){this.div.setAttribute(t,e)},reset:function(){var t=this;this.lastEdgeSelection=[0,0],this.lnfProperties=Object.create(S),this.selectionModel=new v,this.selectionModel.getGrid=function(){return t},this.cellEditors=Object.create(w),this.renderOverridesCache={},this.clearMouseDown(),this.dragExtent=new h(0,0),this.numRows=0,this.numColumns=0,this.vScrollValue=0,this.hScrollValue=0,this.cellEditor=null,this.sbPrevVScrollValue=null,this.sbPrevHScrollValue=null,this.hoverCell=null,this.scrollingNow=!1,this.lastEdgeSelection=[0,0],this.getBehavior().reset(),this.getRenderer().reset(),this.getCanvas().resize(),this.behaviorChanged()},getProperties:function(){return this.getPrivateState()},_getProperties:function(){return this.lnfProperties},computeCellsBounds:function(){var t=this.getRenderer();t&&t.computeCellsBounds()},initCellEditor:function(t){w[t.alias]=t},initGlobalCellEditors:function(){if(!y){y=!0,r();var t=["Textfield","Choice","Color","Date","Slider","Spinner","Filter"],e=this;t.forEach(function(t){e.initCellEditor(new n.cellEditors[t])}),w["int"]=w.spinner,w["float"]=w.spinner,w.date=w.date,w.string=w.extfield;var i=document.createElement("div");this.div.appendChild(i)}},toggleColumnPicker:function(){this.getBehavior().toggleColumnPicker()},isHovered:function(t,e){var i=this.getHoverCell();return i?i.x===t&&i.y===e:!1},isColumnHovered:function(t){var e=this.getHoverCell();return e?e.x===t:!1},isRowResizeable:function(){return this.resolveProperty("rowResize")},isRowHovered:function(t){var e=this.getHoverCell();return e?e.y===t:!1},getHoverCell:function(){return this.hoverCell},setHoverCell:function(t){var e=this.hoverCell,i=new h(t.x,t.y);e&&e.equals(i)||(this.hoverCell=i,this.fireSyntheticOnCellEnterEvent(i),this.repaint())},addGlobalProperties:function(t){if(S)this._addGlobalProperties(t);else{var e=this;setTimeout(function(){e.addGlobalProperties(t)},10)}},_addGlobalProperties:function(t){g(t).each(function(t,e){S[e]=t})},addProperties:function(t){var e=this.getProperties();g(t).each(function(i,n){e[n]=t[n]}),this.refreshProperties()},refreshProperties:function(){this.checkScrollbarVisibility(),this.getBehavior().defaultRowHeight=null,this.isColumnAutosizing()&&this.getBehavior().autosizeAllColumns()},getPrivateState:function(){return this.getBehavior().getPrivateState()},setState:function(t){var e=this;this.getBehavior().setState(t),setTimeout(function(){e.behaviorChanged(),e.synchronizeScrollingBoundries()},100)},getState:function(){return this.getBehavior().getState()},getMouseDown:function(){var t=this.mouseDown.length-1;return 0>t?null:this.mouseDown[t]},popMouseDown:function(){0!==this.mouseDown.length&&(this.mouseDown.length=this.mouseDown.length-1)},clearMouseDown:function(){this.mouseDown=[new h(-1,-1)],this.dragExtent=null},setMouseDown:function(t){this.mouseDown.push(t)},getDragExtent:function(){return this.dragExtent},setDragExtent:function(t){this.dragExtent=t},pluginsDo:function(t){},getCellProvider:function(){var t=this.getBehavior().getCellProvider();return t},gridRenderedNotification:function(){this.updateRenderedSizes(),this.cellEditor&&this.cellEditor.gridRenderedNotification(),this.checkColumnAutosizing(),this.fireSyntheticGridRenderedEvent()},checkColumnAutosizing:function(){var t=this.getBehavior();t.autoSizeRowNumberColumn(),this.isColumnAutosizing()&&t.checkColumnAutosizing(!1)},updateRenderedSizes:function(){var t=this.getBehavior();t.setRenderedColumnCount(this.getVisibleColumns()+1),t.setRenderedRowCount(this.getVisibleRows()+1)},checkClipboardCopy:function(t){if(this.hasFocus()){t.preventDefault();var e=this.getSelectionAsTSV();t.clipboardData.setData("text/plain",e)}},hasSelections:function(){return this.getSelectionModel?this.getSelectionModel().hasSelections():void 0},getSelectionAsTSV:function(){var t=this.getSelectionModel();if(t.hasSelections()){var e=this.getSelectionMatrix();return e=e[e.length-1],this.getMatrixSelectionAsTSV(e)}return t.hasRowSelections()?this.getMatrixSelectionAsTSV(this.getRowSelectionMatrix()):t.hasColumnSelections()?this.getMatrixSelectionAsTSV(this.getColumnSelectionMatrix()):void 0},getMatrixSelectionAsTSV:function(t){if(t.length){var e=t.length,i=t[0].length,n=e*i,o=[];if(n>2e4)return alert("selection size is too big to copy to the paste buffer"),"";for(var r=0;i>r;r++){for(var s=0;e>s;s++)o.push(t[s][r]),e>s&&o.push(" ");i>r&&o.push("\n")}var l=o.join("");return l}return""},hasFocus:function(){return this.getCanvas().hasFocus()},clearSelections:function(){this.getSelectionModel().clear(),this.clearMouseDown()},clearMostRecentSelection:function(){this.getSelectionModel().clearMostRecentSelection()},clearMostRecentColumnSelection:function(){this.getSelectionModel().clearMostRecentColumnSelection()},clearMostRecentRowSelection:function(){this.getSelectionModel().clearMostRecentRowSelection()},select:function(t,e,i,n){0>t||0>e||this.getSelectionModel().select(t,e,i,n)},isSelected:function(t,e){return this.getSelectionModel().isSelected(t,e)},isCellSelectedInRow:function(t){var e=this.getSelectionModel(),i=e.isCellSelectedInRow(t);return i},isCellSelectedInColumn:function(t){var e=this.getSelectionModel(),i=e.isCellSelectedInColumn(t);return i},getSelectionModel:function(){return this.selectionModel},getBehavior:function(){return this.behavior},setBehavior:function(t){this.behavior=t,this.behavior.setGrid(this),this.behavior.changed=this.behaviorChanged.bind(this),this.behavior.shapeChanged=this.behaviorShapeChanged.bind(this),this.behavior.stateChanged=this.behaviorStateChanged.bind(this)},behaviorChanged:function(){(this.numColumns!==this.getColumnCount()||this.numRows!==this.getRowCount())&&(this.numColumns=this.getColumnCount(),this.numRows=this.getRowCount(),this.behaviorShapeChanged()),this.computeCellsBounds(),this.repaint()},getBounds:function(){var t=this.getRenderer();if(t)return t.getBounds()},resolveProperty:function(t){return this.getProperties()[t]},behaviorShapeChanged:function(){this.synchronizeScrollingBoundries()},behaviorStateChanged:function(){this.getRenderer().computeCellsBounds(),this.repaint()},repaint:function(){var t=this.resolveProperty("repaintImmediately"),e=this.getCanvas();e&&(t===!0?e.paintNow():e.repaint())},paintNow:function(){var t=this.getCanvas();t.paintNow()},useHiDPI:function(){return this.resolveProperty("useHiDPI")!==!1},initCanvas:function(t){var e=this,i=this.divCanvas=document.createElement("div");this.div.appendChild(i),this.canvas=new c(i,this.renderer);var n=i.style;n.position="absolute",n.top=t.top,n.right=t.right,n.bottom=t.bottom,n.left=t.left,this.canvas.resizeNotification=function(){e.resized()},this.addFinEventListener("fin-canvas-mousemove",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,e.delegateMouseMove(n)}}),this.addFinEventListener("fin-canvas-mousedown",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.keys=t.detail.keys,n.primitiveEvent=t,e.mouseDownState=n,e.delegateMouseDown(n),e.fireSyntheticMouseDownEvent(n),e.repaint()}}),this.addFinEventListener("fin-canvas-mouseup",function(t){if(!e.resolveProperty("readOnly")){e.dragging=!1,e.isScrollingNow()&&e.setScrollingNow(!1),e.columnDragAutoScrolling&&(e.columnDragAutoScrolling=!1);var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,e.delegateMouseUp(n),e.mouseDownState&&e.fireSyntheticButtonPressedEvent(e.mouseDownState),e.mouseDownState=null,e.fireSyntheticMouseUpEvent(n)}}),this.addFinEventListener("fin-canvas-dblclick",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,e.fireSyntheticDoubleClickEvent(n,t),e.delegateDoubleClick(n)}}),this.addFinEventListener("fin-canvas-tap",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,n.keys=t.detail.keys,e.fireSyntheticClickEvent(n),e.delegateTap(n)}}),this.addFinEventListener("fin-canvas-drag",function(t){if(!e.resolveProperty("readOnly")){e.dragging=!0;var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t,e.delegateMouseDrag(n)}}),this.addFinEventListener("fin-canvas-keydown",function(t){e.resolveProperty("readOnly")||(e.fireSyntheticKeydownEvent(t),e.delegateKeyDown(t))}),this.addFinEventListener("fin-canvas-keyup",function(t){e.resolveProperty("readOnly")||(e.fireSyntheticKeyupEvent(t),e.delegateKeyUp(t))}),this.addFinEventListener("fin-canvas-track",function(t){if(!e.resolveProperty("readOnly")&&!e.dragging){var i=t.detail.primitiveEvent;Math.abs(i.dy)>Math.abs(i.dx)?i.yDirection>0?e.scrollVBy(-2):i.yDirection<-0&&e.scrollVBy(2):i.xDirection>0?e.scrollHBy(-1):i.xDirection<-0&&e.scrollHBy(1)}}),this.addFinEventListener("fin-canvas-wheelmoved",function(t){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t.detail.primitiveEvent,e.delegateWheelMoved(n)}),this.addFinEventListener("fin-canvas-mouseout",function(t){if(!e.resolveProperty("readOnly")){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t.detail.primitiveEvent,e.delegateMouseExit(n)}}),this.addFinEventListener("fin-canvas-context-menu",function(t){var i=t.detail.mouse,n=e.getGridCellFromMousePoint(i);n.primitiveEvent=t.detail.primitiveEvent,e.delegateContextMenu(n)}),this.div.removeAttribute("tabindex")},convertViewPointToDataPoint:function(t){return this.getBehavior().convertViewPointToDataPoint(t)},convertDataPointToViewPoint:function(t){return this.getBehavior().convertDataPointToViewPoint(t)},addFinEventListener:function(t,e){this.canvas.addEventListener(t,e)},setScrollingNow:function(t){this.scrollingNow=t},isScrollingNow:function(){return this.scrollingNow},overColumnDivider:function(t){var e=t.primitiveEvent.detail.mouse.x,i=this.getRenderer().overColumnDivider(e);return i},overRowDivider:function(t){var e=t.primitiveEvent.detail.mouse.y,i=this.getRenderer().overRowDivider(e);return i},beCursor:function(t){t||(t="default"),this.div.style.cursor=t},delegateWheelMoved:function(t){var e=this.getBehavior();e.onWheelMoved(this,t)},delegateMouseExit:function(t){var e=this.getBehavior();e.handleMouseExit(this,t)},delegateContextMenu:function(t){var e=this.getBehavior();e.onContextMenu(this,t)},delegateMouseMove:function(t){var e=this.getBehavior();e.onMouseMove(this,t)},delegateMouseDown:function(t){var e=this.getBehavior();e.handleMouseDown(this,t)},delegateMouseUp:function(t){var e=this.getBehavior();e.onMouseUp(this,t)},delegateTap:function(t){var e=this.getBehavior();e.onTap(this,t)},delegateMouseDrag:function(t){var e=this.getBehavior();e.onMouseDrag(this,t)},delegateDoubleClick:function(t){var e=this.getBehavior();e.onDoubleClick(this,t)},delegateHoldPulse:function(t){var e=this.getBehavior();e.onHoldPulse(this,t)},delegateKeyDown:function(t){var e=this.getBehavior();e.onKeyDown(this,t)},delegateKeyUp:function(t){var e=this.getBehavior();e.onKeyUp(this,t)},stopEditing:function(){this.cellEditor&&this.isEditing()&&(this.cellEditor.stopEditing&&this.cellEditor.stopEditing(),this.cellEditor=null)},registerCellEditor:function(t,e){this.cellEditors[t]=e},getDataBounds:function(){var t=200,e=this.canvas.bounds,i=new d(0,0,e.origin.x+e.extent.x-t,e.origin.y+e.extent.y);return i},getRowNumbersWidth:function(){return this.isShowRowNumbers()?this.getRenderer().getRowNumbersWidth():0},getCanvas:function(){return this.canvas},editAt:function(t,e){this.cellEditor=t;var i=e.gridCell,n=i.x,o=i.y;if(!(0>n||0>o)){var r=new h(n,o);this.setMouseDown(r),this.setDragExtent(new h(0,0)),t.grid=this,t.beginEditAt(r)}},isColumnVisible:function(t){var e=this.getRenderer().isColumnVisible(t);return e},isDataRowVisible:function(t){var e=this.getRenderer().isRowVisible(t);return e},isDataVisible:function(t,e){var i=this.isDataRowVisible(e)&&this.isColumnVisible(t);return i},insureModelColIsVisible:function(t,e){var i=this.getColumnCount()-1,n=t;return e>0&&n++,this.isColumnVisible(n)&&t!==i?!1:(this.scrollBy(e,0),!0)},insureModelRowIsVisible:function(t,e){var i=this.getRowCount()-1,n=t;return e>0&&n++,this.isDataRowVisible(n)&&t!==i?!1:(this.scrollBy(0,e),!0)},scrollBy:function(t,e){this.scrollHBy(t),this.scrollVBy(e)},scrollVBy:function(t){var e=this.sbVScroller.range.max,i=this.getVScrollValue(),n=Math.min(e,Math.max(0,i+t));n!==i&&this.setVScrollValue(n)},scrollHBy:function(t){var e=this.sbHScroller.range.max,i=this.getHScrollValue(),n=Math.min(e,Math.max(0,i+t));n!==i&&this.setHScrollValue(n)},getGridCellFromMousePoint:function(t){var e=this.getRenderer().getGridCellFromMousePoint(t);return e},getBoundsOfCell:function(t){var e=this.getRenderer().getBoundsOfCell(t),i=new d(e.x,e.y,e.width,e.height);return i},resized:function(){this.synchronizeScrollingBoundries()},cellClicked:function(t){var e=t.gridCell,i=this.getColumnCount(),n=this.getRowCount();if(!(e.x>i||e.y>n)){var o=this.getHoverCell(),r=this.getVScrollValue(),s=o.x;o.y<0&&(r=0),o=new h(s,o.y+r),this.getBehavior().cellClicked(o,t)}},setTotalsValueNotification:function(t,e,i,n){this.fireSyntheticSetTotalsValue(t,e,i,n)},fireSyntheticSetTotalsValue:function(t,e,i,n){var o=new CustomEvent("fin-set-totals-value",{detail:{x:t,y:e,value:i,area:n?"bottom":"top"}});this.canvas.dispatchEvent(o)},fireSyntheticEditorKeyUpEvent:function(t,e){var i=new CustomEvent("fin-editor-key-up",{detail:{input:t,keyEvent:e}});this.canvas.dispatchEvent(i)},fireSyntheticEditorKeyDownEvent:function(t,e){var i=new CustomEvent("fin-editor-key-down",{detail:{input:t,keyEvent:e}});this.canvas.dispatchEvent(i)},fireSyntheticEditorKeyPressEvent:function(t,e){var i=new CustomEvent("fin-editor-key-press",{detail:{input:t,keyEvent:e}});this.canvas.dispatchEvent(i)},fireSyntheticEditorDataChangeEvent:function(t,e,i){var n=new CustomEvent("fin-editor-data-change",{detail:{input:t,oldValue:e,newValue:i},cancelable:!0});return this.canvas.dispatchEvent(n)},fireSyntheticRowSelectionChangedEvent:function(){var t=new CustomEvent("fin-row-selection-changed",{detail:{rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(t)},fireSyntheticColumnSelectionChangedEvent:function(){var t=new CustomEvent("fin-column-selection-changed",{detail:{rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(t)},selectionChanged:function(){var t=this.getSelectedRows(),e=new CustomEvent("fin-selection-changed",{detail:{rows:t,columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(e)},getRowSelection:function(){function t(t,o){i[o]=l(n.getValue(e,t))}var e,i,n=this,o=this.getSelectionModel().getSelectedRows(),r=this.getColumnCount(),s={};for(e=0;r>e;e++)i=new Array(o.length),s[this.getField(e)]=i,o.forEach(t);return s},getRowSelectionMatrix:function(){function t(t,n){r[e][n]=l(i.getValue(e,t))}var e,i=this,n=this.getSelectionModel().getSelectedRows(),o=this.getColumnCount(),r=new Array(o);for(e=0;o>e;e++)r[e]=new Array(n.length),n.forEach(t);return r},getColumnSelectionMatrix:function(){var t=this.getSelectedColumns(),e=this.getRowCount(),i=new Array(t.length),n=this;return t.forEach(function(t,o){i[o]=new Array(e);for(var r=0;e>r;r++)i[o][r]=l(n.getValue(t,r))}),i},getColumnSelection:function(){var t=this.getSelectedColumns(),e={},i=this.getRowCount(),n=this;return t.forEach(function(t){var o=new Array(i);e[n.getField(t)]=o;for(var r=0;i>r;r++)o[r]=l(n.getValue(t,r))}),e},getSelection:function(){var t=this,e=this.getSelections(),i=new Array(e.length);return e.forEach(function(e,n){i[n]=t._getSelection(e)}),i},_getSelection:function(t){t=o(t);for(var e,i=t.extent.x+1,n=t.extent.y+1,r=t.origin.x,s=t.origin.y,a={},u=0;i>u;u++){var c=new Array(n);for(a[this.getField(u+r)]=c,e=0;n>e;e++)c[e]=l(this.getValue(r+u,s+e))}return a},getSelectionMatrix:function(){var t=this,e=this.getSelections(),i=new Array(e.length);return e.forEach(function(e,n){i[n]=t._getSelectionMatrix(e)}),i},_getSelectionMatrix:function(t){t=o(t);for(var e=t.extent.x+1,i=t.extent.y+1,n=t.origin.x,r=t.origin.y,s=[],a=0;e>a;a++){var u=new Array(i);s[a]=u;for(var c=0;i>c;c++)u[c]=l(this.getValue(n+a,r+c))}return s},fireSyntheticContextMenuEvent:function(t){t.gridCell=this.convertViewPointToDataPoint(t.gridCell);var e=new CustomEvent("fin-context-menu",{detail:{gridCell:t.gridCell,mousePoint:t.mousePoint,viewPoint:t.viewPoint,primitiveEvent:t.primitiveEvent,rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(e)},fireSyntheticMouseUpEvent:function(t){var e=new CustomEvent("fin-mouseup",{detail:{gridCell:t.gridCell,mousePoint:t.mousePoint,viewPoint:t.viewPoint,primitiveEvent:t.primitiveEvent,rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(e)},fireSyntheticMouseDownEvent:function(t){var e=new CustomEvent("fin-mousedown",{detail:{gridCell:t.gridCell,mousePoint:t.mousePoint,viewPoint:t.viewPoint,primitiveEvent:t.primitiveEvent,rows:this.getSelectedRows(),columns:this.getSelectedColumns(),selections:this.getSelectionModel().getSelections()}});this.canvas.dispatchEvent(e)},isViewableButton:function(t,e){return this.getRenderer().isViewableButton(t,e)},fireSyntheticButtonPressedEvent:function(t){var e=t.dataCell,i=t.gridCell;if(this.isViewableButton(e.x,e.y)){var n=new CustomEvent("fin-button-pressed",{detail:{gridCell:i}});this.canvas.dispatchEvent(n)}},fireSyntheticKeydownEvent:function(t){var e=new CustomEvent("fin-keydown",{detail:t.detail});this.canvas.dispatchEvent(e)},fireSyntheticKeyupEvent:function(t){var e=new CustomEvent("fin-keyup",{detail:t.detail});this.canvas.dispatchEvent(e)},fireSyntheticOnCellEnterEvent:function(t){var e={gridCell:t,time:Date.now(),grid:this},i=new CustomEvent("fin-cell-enter",{detail:e});this.canvas.dispatchEvent(i)},fireSyntheticGroupsChangedEvent:function(t){var e={groups:t,time:Date.now(),grid:this},i=new CustomEvent("fin-groups-changed",{detail:e});this.canvas.dispatchEvent(i)},fireSyntheticOnCellExitEvent:function(t){var e={gridCell:t,time:Date.now(),grid:this},i=new CustomEvent("fin-cell-exit",{detail:e});this.canvas.dispatchEvent(i)},fireSyntheticClickEvent:function(t){this.stopEditing();var e=t.gridCell,i={gridCell:e,mousePoint:t.mousePoint,keys:t.keys,primitiveEvent:t,time:Date.now(),grid:this};this.getBehavior().enhanceDoubleClickEvent(i);var n=new CustomEvent("fin-click",{detail:i});this.canvas.dispatchEvent(n)},fireSyntheticDoubleClickEvent:function(t){this.stopEditing();var e=t.gridCell,i=this.getBehavior(),n={gridCell:e,mousePoint:t.mousePoint,time:Date.now(),grid:this};i.enhanceDoubleClickEvent(t);var o=new CustomEvent("fin-double-click",{detail:n});i.cellDoubleClicked(e,t),this.canvas.dispatchEvent(o)},fireSyntheticGridRenderedEvent:function(){var t=new CustomEvent("fin-grid-rendered",{detail:{source:this,time:Date.now()}});this.canvas&&this.canvas.dispatchEvent(t)},fireScrollEvent:function(t,e,i){var n=new CustomEvent(t,{detail:{oldValue:e,value:i,time:Date.now()}});this.canvas.dispatchEvent(n)},setVScrollValue:function(t){t=Math.round(t);var e=this.sbVScroller.range.max;t=Math.min(e,Math.max(0,t));var i=this;if(t!==this.vScrollValue){this.getBehavior()._setScrollPositionY(t);var n=this.vScrollValue;this.vScrollValue=t,this.scrollValueChangedNotification(),setTimeout(function(){i.fireScrollEvent("fin-scroll-y",n,t)})}},getVScrollValue:function(){return this.vScrollValue},setHScrollValue:function(t){t=Math.round(t);var e=this.sbHScroller.range.max;t=Math.min(e,Math.max(0,t));var i=this;if(t!==this.hScrollValue){this.getBehavior()._setScrollPositionX(t);var n=this.hScrollValue;this.hScrollValue=t,this.scrollValueChangedNotification(),setTimeout(function(){i.fireScrollEvent("fin-scroll-x",n,t),i.synchronizeScrollingBoundries()})}},getHScrollValue:function(){return this.hScrollValue},takeFocus:function(){this.isEditing()?this.stopEditing():this.getCanvas().takeFocus()},editorTakeFocus:function(){return this.cellEditor?this.cellEditor.takeFocus():void 0},isEditing:function(){return this.cellEditor?this.cellEditor.isEditing:!1},initScrollbars:function(){var t=this,e=new u({orientation:"horizontal",onchange:t.setHScrollValue.bind(t),cssStylesheetReferenceElement:this.div}),i=new u({orientation:"vertical",onchange:t.setVScrollValue.bind(t),paging:{up:t.pageUp.bind(t),down:t.pageDown.bind(t)}});this.sbHScroller=e,this.sbVScroller=i;var n=this.resolveProperty("hScrollbarClassPrefix"),o=this.resolveProperty("vScrollbarClassPrefix");n&&""!==n&&(this.sbHScroller.classPrefix=n),o&&""!==o&&(this.sbVScroller.classPrefix=o),this.div.appendChild(e.bar),this.div.appendChild(i.bar),this.resizeScrollbars()},resizeScrollbars:function(){this.sbHScroller.shortenBy(this.sbVScroller).resize(),this.sbVScroller.resize()},setVScrollbarValues:function(t){this.sbVScroller.range={min:0,max:t}},setHScrollbarValues:function(t){this.sbHScroller.range={min:0,max:t}},scrollValueChangedNotification:function(){(this.hScrollValue!==this.sbPrevHScrollValue||this.vScrollValue!==this.sbPrevVScrollValue)&&(this.sbPrevHScrollValue=this.hScrollValue,this.sbPrevVScrollValue=this.vScrollValue,this.cellEditor&&this.cellEditor.scrollValueChangedNotification(),this.computeCellsBounds())},getValue:function(t,e){return this.getBehavior().getValue(t,e)},setValue:function(t,e,i){this.getBehavior().setValue(t,e,i)},getColumnAlignment:function(t){return this.getBehavior().getColumnAlignment(t)},synchronizeScrollingBoundries:function(){var t=this.getBehavior(),e=this.getFixedColumnCount(),i=this.getFixedRowCount(),n=this.getColumnCount(),o=this.getRowCount(),r=this.getBounds();if(r){for(var s=r.height-t.getFixedRowsMaxHeight()-15,l=r.width-200-t.getFixedColumnsMaxWidth()-15,a=0,u=0;n>a;a++){var c=this.getColumnWidth(n-a-1);if(u+=c,u>l)break}for(var h=0,d=0;o>h;h++){var g=this.getRowHeight(o-h-1);if(d+=g,d>s)break}var f=Math.max(0,n-e-a);this.setHScrollbarValues(f);var p=1+Math.max(0,o-i-h);this.setVScrollbarValues(p),this.setHScrollValue(Math.min(this.getHScrollValue(),f)),this.setVScrollValue(Math.min(this.getVScrollValue(),p)),this.computeCellsBounds(),this.repaint(),this.resizeScrollbars()}},getVisibleRows:function(){return this.getRenderer().getVisibleRows()},getVisibleColumns:function(){return this.getRenderer().getVisibleColumns()},initRenderer:function(){this.renderer=new p(this)},getRenderer:function(){return this.renderer},getColumnWidth:function(t){return this.getBehavior().getColumnWidth(t)},setColumnWidth:function(t,e){this.stopEditing(),this.getBehavior().setColumnWidth(t,e)},getColumnEdge:function(t){return this.getBehavior().getColumnEdge(t,this.getRenderer())},getFixedColumnsWidth:function(){return this.getBehavior().getFixedColumnsWidth()},getRowHeight:function(t){return this.getBehavior().getRowHeight(t)},setRowHeight:function(t,e){this.stopEditing(),this.getBehavior().setRowHeight(t,e)},getFixedRowsHeight:function(){return this.getBehavior().getFixedRowsHeight()},getColumnCount:function(){return this.getBehavior().getColumnCount()},getRowCount:function(){return this.getBehavior().getRowCount()},getFixedColumnCount:function(){return this.getBehavior().getFixedColumnCount()},getFixedRowCount:function(){return this.getBehavior().getFixedRowCount()},topLeftClicked:function(t){this.getBehavior().topLeftClicked(this,t)},rowHeaderClicked:function(t){this.getBehavior().rowHeaderClicked(this,t)},columnHeaderClicked:function(t){this.getBehavior().columnHeaderClicked(this,t)},_activateEditor:function(t){var e=t.gridCell;this.activateEditor(e.x,e.y)},activateEditor:function(t,e){if(this.isEditable()||this.isFilterRow(e)){var i=this.getCellEditorAt(t,e);if(i){var n=i.getEditorPoint();if(i){if(n.x===t&&n.y===e&&i.isEditing)return;this.isEditing()&&this.stopEditing(),event.gridCell={x:t,y:e},this.editAt(i,event)}}}},getCellEditorAt:function(t,e){return this.getBehavior()._getCellEditorAt(t,e)},toggleHiDPI:function(){this.useHiDPI()?this.removeAttribute("hidpi"):this.setAttribute("hidpi",null),this.canvas.resize()},getHiDPI:function(t){if(window.devicePixelRatio&&this.useHiDPI()){var e=window.devicePixelRatio||1,i=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1,n=e/i;return n}return 1},getRenderedWidth:function(t){return this.renderer.getRenderedWidth(t)},getRenderedHeight:function(t){return this.renderer.getRenderedHeight(t)},resolveCellEditor:function(t){return this.cellEditors[t]},updateCursor:function(){var t=this.getBehavior(),e=t.getCursorAt(-1,-1),i=this.getHoverCell();if(i&&i.x>-1&&i.y>-1){var n=i.x+this.getHScrollValue();e=t.getCursorAt(n,i.y+this.getVScrollValue())}this.beCursor(e)},repaintCell:function(t,e){this.getRenderer().repaintCell(t,e)},isDraggingColumn:function(){return!!this.renderOverridesCache.dragger},pageUp:function(){var t=this.getRenderer().getPageUpRow();return this.setVScrollValue(t),t},pageDown:function(){var t=this.getRenderer().getPageDownRow();return this.setVScrollValue(t),t},pageLeft:function(){console.log("page left")},pageRight:function(){console.log("page right")},getRenderedData:function(){var t,e=this.getBehavior(),i=this.getRenderer(),n=this.getColumnCount(),o=i.getVisibleRows(),r=new Array(n),s=new Array(o);return r.forEach(function(t,i){r[i]=e.getColumnId(i,0)}),s.forEach(function(i,n){ t=s[n]={hierarchy:e.getFixedColumnValue(0,n)},r.forEach(function(i,o){t[i]=e.getValue(o,n)})}),s},getSelectedRow:function(){var t=this.getSelectionModel().getSelections();if(t.length){for(var e=this.getBehavior(),i=this.getColumnCount(),n=t[0].origin.y,o={},r=0;i>r;r++)o[e.getColumnId(r,0)]=e.getValue(r,n);return o}},fireRequestCellEdit:function(t,e){var i=new CustomEvent("fin-request-cell-edit",{cancelable:!0,detail:{value:e,gridCell:t,time:Date.now()}});return this.canvas.dispatchEvent(i)},fireBeforeCellEdit:function(t,e,i,n){var o=new CustomEvent("fin-before-cell-edit",{cancelable:!0,detail:{oldValue:e,newValue:i,gridCell:t,time:Date.now(),input:n,row:this.getRow(t.y)}}),r=this.canvas.dispatchEvent(o);return r},fireAfterCellEdit:function(t,e,i,n){var o=new CustomEvent("fin-after-cell-edit",{detail:{newValue:i,oldValue:e,gridCell:t,time:Date.now(),input:n,row:this.getRow(t.y)}});this.canvas.dispatchEvent(o)},autosizeColumn:function(t){var e=this.getBehavior().getColumn(t);e.checkColumnAutosizing(!0),this.computeCellsBounds()},setFocusable:function(t){this.getCanvas().setFocusable(t)},getVisibleColumnsCount:function(){return this.getRenderer().getVisibleColumnsCount()},getVisibleRowsCount:function(){return this.getRenderer().getVisibleRowsCount()},updateSize:function(){this.canvas.checksize()},stopPaintThread:function(){this.canvas.stopPaintThread()},stopResizeThread:function(){this.canvas.stopResizeThread()},restartResizeThread:function(){this.canvas.restartResizeThread()},restartPaintThread:function(){this.canvas.restartPaintThread()},swapColumns:function(t,e){this.getBehavior().swapColumns(t,e)},endDragColumnNotification:function(){this.getBehavior().endDragColumnNotification()},getFixedColumnsMaxWidth:function(){return this.getBehavior().getFixedColumnsMaxWidth()},isMouseDownInHeaderArea:function(){var t=this.getHeaderColumnCount(),e=this.getHeaderRowCount(),i=this.getMouseDown();return i.x-1,r=e.indexOf("SHIFT")>-1;o||r?(o&&(n?i.deselectColumn(t):i.selectColumn(t)),r&&(i.clear(),i.selectColumn(this.lastEdgeSelection[0],t))):(i.clear(),n||i.selectColumn(t)),n||r||(this.lastEdgeSelection[0]=t),this.repaint(),this.fireSyntheticColumnSelectionChangedEvent()},toggleSelectRow:function(t,e){var i=this.getFilterRowIndex()+1;if(!(i>t)){e=e||[];var n=this.isSingleRowSelectionMode(),o=this.getSelectionModel(),r=o.isRowSelected(t),s=e.indexOf("CTRL")>-1,l=e.indexOf("SHIFT")>-1;s||l?(s&&(r?o.deselectRow(t):(n&&o.clearRowSelection(),o.selectRow(t))),l&&(o.clear(),o.selectRow(this.lastEdgeSelection[1],t))):(o.clear(),r||o.selectRow(t)),r||l||(this.lastEdgeSelection[1]=t),this.repaint()}},selectViewportCell:function(t,e){var i=this.getHeaderRowCount(),n=this.getRenderer(),o=n.getVisibleColumns()[t],r=n.getVisibleRows()[e];this.clearSelections(),this.select(o,r+i,0,0),this.setMouseDown(this.newPoint(o,r+i)),this.setDragExtent(this.newPoint(0,0)),this.repaint()},selectToViewportCell:function(t,e){var i=this.getSelections();if(i&&0!==i.length){var n=this.getHeaderRowCount(),o=this.getRenderer(),r=o.getVisibleColumns()[t],s=o.getVisibleRows()[e]+n,l=i[0],a=l.origin;this.setDragExtent(this.newPoint(r-a.x,s-a.y)),this.select(a.x,a.y,r-a.x,s-a.y),this.repaint()}},selectFinalCellOfCurrentRow:function(){var t=this.getColumnCount()-1,e=this.getSelectedRows()[0],i=this.getHeaderRowCount();this.clearSelections(),this.scrollBy(this.getColumnCount(),0),this.select(t,e+i,0,0),this.setMouseDown(this.newPoint(t,e+i)),this.setDragExtent(this.newPoint(0,0)),this.repaint()},selectToFinalCellOfCurrentRow:function(){var t=this.getSelections();if(t&&0!==t.length){var e=t[0],i=e.origin,n=e.extent,o=this.getColumnCount();this.scrollBy(o,0),this.clearSelections(),this.select(i.x,i.y,o-i.x-1,n.y),this.repaint()}},selectFirstCellOfCurrentRow:function(){var t=0,e=this.getSelectedRows()[0],i=this.getHeaderRowCount();this.clearSelections(),this.setHScrollValue(0),this.select(t,e+i,0,0),this.setMouseDown(this.newPoint(t,e+i)),this.setDragExtent(this.newPoint(0,0)),this.repaint()},selectToFirstCellOfCurrentRow:function(){var t=this.getSelections();if(t&&0!==t.length){var e=t[0],i=e.origin,n=e.extent;this.clearSelections(),this.select(i.x,i.y,-i.x,n.y),this.setHScrollValue(0),this.repaint()}},selectFinalCell:function(){this.selectCell(this.getColumnCount()-1,this.getRowCount()-1),this.scrollBy(this.getColumnCount(),this.getRowCount()),this.repaint()},selectToFinalCell:function(){var t=this.getSelections();if(t&&0!==t.length){var e=t[0],i=e.origin,n=this.getColumnCount(),o=this.getRowCount();this.clearSelections(),this.select(i.x,i.y,n-i.x-1,o-i.y-1),this.scrollBy(n,o),this.repaint()}},isShowRowNumbers:function(){return this.resolveProperty("showRowNumbers")},isEditable:function(){return this.resolveProperty("editable")===!0},isShowFilterRow:function(){return this.resolveProperty("showFilterRow")},isShowHeaderRow:function(){return this.resolveProperty("showHeaderRow")},getHeaderRowCount:function(){return this.getBehavior().getHeaderRowCount()},isFilterRow:function(t){return t===this.getFilterRowIndex()},getFilterRowIndex:function(){return this.isShowFilterRow()?this.isShowHeaderRow()?1:0:-1},setGroups:function(t){this.getBehavior().setGroups(t)},filterClicked:function(t){this.activateEditor(t.gridCell.x,t.gridCell.y)},hasHierarchyColumn:function(){return this.getBehavior().hasHierarchyColumn()},isHierarchyColumn:function(t){return this.hasHierarchyColumn()?0===t:!1},checkScrollbarVisibility:function(){},isColumnOrRowSelected:function(){return this.getSelectionModel().isColumnOrRowSelected()},selectColumn:function(t,e){this.getSelectionModel().selectColumn(t,e)},selectRow:function(t,e){this.isSingleRowSelectionMode()?(this.getSelectionModel().clearRowSelection(),t=e):e=e||t;var i=Math.min(t,e),n=Math.max(t,e),o=this.getFilterRowIndex()+1;o>i||this.getSelectionModel().selectRow(i,n)},isRowNumberAutosizing:function(){return this.resolveProperty("rowNumberAutosizing")},isRowSelected:function(t){return this.getSelectionModel().isRowSelected(t)},isColumnSelected:function(t){return this.getSelectionModel().isColumnSelected(t)},lookupFeature:function(t){return this.getBehavior().lookupFeature(t)},getRow:function(t){return this.getBehavior().getRow(t)},getFieldName:function(t){return this.getBehavior().getFieldName(t)},getColumnIndex:function(t){return this.getBehavior().getColumnIndex(t)},isCellSelection:function(){return this.resolveProperty("cellSelection")===!0},isRowSelection:function(){return this.resolveProperty("rowSelection")===!0},isColumnSelection:function(){return this.resolveProperty("columnSelection")===!0},getComputedRow:function(t){return this.getBehavior().getComputedRow(t)},isColumnAutosizing:function(){return this.resolveProperty("columnAutosizing")===!0},setGlobalFilter:function(t){this.getBehavior().setGlobalFilter(t)},selectRowsFromCells:function(){var t=this.getSelectionModel();if(this.isSingleRowSelectionMode()){var e=t.getLastSelection();e?this.selectRow(null,e.corner.y):t.clearRowSelection()}else t.selectRowsFromCells()},selectColumnsFromCells:function(){this.getSelectionModel().selectColumnsFromCells()},getSelectedRows:function(){return this.getBehavior().getSelectedRows()},getSelectedColumns:function(){return this.getBehavior().getSelectedColumns()},getSelections:function(){return this.getBehavior().getSelections()},getLastSelectionType:function(){return this.getSelectionModel().getLastSelectionType()},isCellSelected:function(t,e){return this.getSelectionModel().isCellSelected(t,e)},isInCurrentSelectionRectangle:function(t,e){return this.getSelectionModel().isInCurrentSelectionRectangle(t,e)},selectAllRows:function(){this.getSelectionModel().selectAllRows()},areAllRowsSelected:function(){return this.getSelectionModel().areAllRowsSelected()},toggleSelectAllRows:function(){this.areAllRowsSelected()?this.getSelectionModel().clear():this.selectAllRows(),this.repaint()},getField:function(t){return this.getBehavior().getField(t)},isSingleRowSelectionMode:function(){return this.resolveProperty("singleRowSelectionMode")},newPoint:function(t,e){return new h(t,e)},newRectangle:function(t,e,i,n){return new d(t,e,i,n)},registerFilter:function(t){b[t.alias]=t},getFilterFor:function(t){return b.MyCustomFilter},resolveFilter:function(t){return b[t]}},e.exports=n},{"./Renderer":35,"./SelectionModel":36,"./TableDialog":37,"./defaults":56,"./stylesheets":76,"extend-me":4,finbars:5,fincanvas:6,"object-iterators":29,rectangular:30}],35:[function(t,e,i){"use strict";function n(t,e,i){var n=e.getColumnProperties(-1),o=n.rowHeader,r=s.checked;t.font=o.font,n.preferredWidth=r.width+7+o.getTextWidth(t,i+1)}var o=t("object-iterators"),r=t("extend-me").Base,s=t("../images"),l=r.extend("Renderer",{cell:{x:0,y:0,width:0,height:0},scrollHeight:0,viewHeight:0,reset:function(){this.bounds={width:0,height:0},this.columnEdges=[],this.columnEdgesIndexMap=[],this.renderedColumnMinWidths=[],this.rowEdges=[],this.rowEdgesIndexMap=[],this.visibleColumns=[],this.visibleRows=[],this.insertionBounds=[]},initialize:function(t){this.grid=t,this.reset()},computeCellsBounds:function(){var t,e,i,n,o,r,s,l,a,u,c=this.getGrid(),h=this.getScrollTop(),d=this.getScrollLeft(),g=this.getColumnCount(),f=this.getFixedColumnCount(),p=this.getRowCount(),v=this.getFixedRowCount(),m=this.getBehavior(),C=this.getBounds(),w=m.getDataModel().getBottomTotals().length,y=C.width||c.canvas.width,x=C.height-w*m.getDefaultRowHeight(),S=0,b=0,E=0,R=0,A=0;for(this.getColumnEdges().length=0,this.rowEdges.length=0,this.columnEdges[0]=0,this.rowEdges[0]=0,this.scrollHeight=0,this.visibleColumns.length=0,this.visibleRows.length=0,this.columnEdgesIndexMap=[],this.rowEdgesIndexMap=[],this.insertionBounds=[],c.isShowRowNumbers()&&(E--,this.columnEdges[-1]=-1),t=E;g>t&&(i=t,t>=f&&(i+=d,void 0===s&&(s=i),l=i),!(R>y||i>=g));t++)o=this.getColumnWidth(i),R+=o,this.columnEdges[t+1]=Math.round(R),this.visibleColumns[t]=i,this.columnEdgesIndexMap[i]=t,S=S+Math.round(o/2)+b,this.insertionBounds.push(S),b=Math.round(o/2);for(e=0;p>e&&(n=e,e>=v&&(n+=h,void 0===a&&(a=n),u=n),!(A>x||n>=p));e++)r=this.getRowHeight(n),A+=r,this.rowEdges[e+1]=Math.round(A),this.visibleRows[e]=n,this.rowEdgesIndexMap[n]=e;this.viewHeight=x,this.dataWindow=c.newRectangle(s,a,l-s,u-a)},resolveProperty:function(t){return this.getGrid().resolveProperty(t)},getGrid:function(){return this.grid},_paint:function(t){this.grid&&(this.renderGrid(t),this.getGrid().gridRenderedNotification())},getVisibleRowsCount:function(){return this.visibleRows.length-1},getVisibleScrollHeight:function(){var t=this.getGrid(),e=t.getFixedRowsHeight();return this.viewHeight-e},getVisibleRows:function(){return this.visibleRows},getVisibleColumnsCount:function(){return this.visibleColumns.length-1},getVisibleColumns:function(){return this.visibleColumns},overColumnDivider:function(t){t=Math.round(t);var e=this.getColumnEdges(),i=e.indexOf(t-1);return 0>i&&(i=e.indexOf(t)),0>i&&(i=e.indexOf(t-2)),0>i&&(i=e.indexOf(t+1)),0>i&&(i=e.indexOf(t-3)),i},overRowDivider:function(t){t=Math.round(t);var e=this.rowEdges.indexOf(t+1);return 0>e&&(e=this.rowEdges.indexOf(t)),0>e&&(e=this.rowEdges.indexOf(t-1)),e},getBoundsOfCell:function(t){return this._getBoundsOfCell(t.x,t.y)},_getBoundsOfCell:function(t,e){var i,n=!1,o=!1,r=this.cell,s=this.columnEdgesIndexMap[t];void 0===s&&(s=this.columnEdgesIndexMap[t-1],n=!0);var l,a,u,c=this.columnEdges[s],h=this.columnEdges[s+1],d=h-c;if(r.x=n?h:c,r.width=n?0:d,0>e){var g=this.getGrid(),f=g.getBehavior(),p=this.getBounds();u=f.getDefaultRowHeight(),l=p.height+e*u,a=l+u}else i=this.rowEdgesIndexMap[e],void 0===i&&(i=this.rowEdgesIndexMap[e-1],o=!0),l=this.rowEdges[i],a=this.rowEdges[i+1],u=a-l;return r.y=o?a:l,r.height=o?0:u,r},getColumnFromPixelX:function(t){for(var e=0,i=this.getGrid(),n=this.getFixedColumnCount(),o=i.getHScrollValue(),r=this.getColumnEdges(),s=1;st)return s>n&&(s+=o),s-1;return s>n&&(s+=o),s-1},getGridCellFromMousePoint:function(t){var e,i,n,o,r=this.getGrid(),s=r.getBehavior(),l=0,a=0,u=0,c=this.getColumnEdges(),h=this.getFixedColumnCount(),d=this.getFixedRowCount(),g=this.getScrollLeft(),f=this.getScrollTop();for(n=0;n=h&&(n+=g),o>=d&&(o+=f);var v=-1,m=s.getColumn(n);return m&&(v=m.index),{gridCell:r.newPoint(n,o),mousePoint:r.newPoint(e,i),viewPoint:p,dataCell:r.newPoint(v,o)}},isColumnVisible:function(t){var e=-1!==this.visibleColumns.indexOf(t);return e},getFinalVisableColumnBoundary:function(){var t=this.isLastColumnVisible(),e=t?2:1,i=this.getColumnEdges()[this.getColumnEdges().length-e],n=Math.min(i,this.getBounds().width-200);return n},isRowVisible:function(t){var e=-1!==this.visibleRows.indexOf(t);return e},isSelected:function(t,e){return this.getGrid().isSelected(t,e)},renderGrid:function(t){t.beginPath(),this.paintCells(t),this.paintGridlines(t),this.renderOverrides(t),this.renderFocusCell(t),t.closePath()},focusLineStep:[[5,5],[0,1,5,4],[0,2,5,3],[0,3,5,2],[0,4,5,1],[0,5,5,0],[1,5,4,0],[2,5,3,0],[3,5,2,0],[4,5,1,0]],renderFocusCell:function(t){t.beginPath(),this._renderFocusCell(t),t.closePath()},_renderFocusCell:function(t){var e=this.getGrid(),i=e.getSelectionModel().getSelections();if(i&&0!==i.length){var n=i[i.length-1],o=n.origin;if(-1!==o.x){var r=this.getVisibleColumns(),s=this.getVisibleRows(),l=r[r.length-1],a=s[s.length-1],u=n.extent,c=Math.min(o.x,o.x+u.x),h=Math.min(o.y,o.y+u.y);if(!(c>l||h>a)){var d=Math.max(o.x,o.x+u.x)+1;d=Math.min(d,1+l);var g=Math.max(o.y,o.y+u.y)+1;g=Math.min(g,1+a);var f=this._getBoundsOfCell(c,h),p=Math.round(void 0===f.x?e.getFixedColumnsWidth():f.x),v=Math.round(void 0===f.y?e.getFixedRowsHeight():f.y),m=this._getBoundsOfCell(d,g),C=Math.round(void 0===m.x?e.getFixedColumnsWidth():m.x),w=Math.round(void 0===m.y?e.getFixedRowsHeight():m.y),y=Math.min(p,C),x=Math.min(v,w),S=1+C-p,b=1+w-v;y===C&&(S=p-C),x===w&&(b=v-w),1>S*b||(t.rect(y,x,S,b),t.fillStyle=this.resolveProperty("selectionRegionOverlayColor"),t.fill(),t.lineWidth=1,t.strokeStyle=this.resolveProperty("selectionRegionOutlineColor"),t.stroke())}}}},renderOverrides:function(t){var e=this.getGrid(),i=e.renderOverridesCache;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];o&&this.renderOverride(t,o)}},renderOverride:function(t,e){var i=e.hdpiratio,n=e.startX,o=e.width+1,r=e.height,s=e.ctx,l=t.getImageData(n,0,Math.round(o*i),Math.round(r*i));s.putImageData(l,0,0),t.fillStyle=this.resolveProperty("backgroundColor2"),t.fillRect(Math.round(n/i),0,o,r)},isHovered:function(t,e){return this.getGrid().isHovered(t,e)},isRowHovered:function(t){return this.getGrid().isRowHovered(t)},isColumnHovered:function(t){return this.getGrid().isColumnHovered(t)},isCellSelectedInRow:function(t){return this.getGrid().isCellSelectedInRow(t)},isCellSelectedInColumn:function(t){return this.getGrid().isCellSelectedInColumn(t)},getScrollTop:function(){var t=this.getGrid().getVScrollValue();return t},getScrollLeft:function(){var t=this.getGrid().getHScrollValue();return t},getBehavior:function(){return this.getGrid().getBehavior()},getColumnEdges:function(){return this.columnEdges},getRowEdges:function(){return this.rowEdges},getRowHeight:function(t){var e=this.getBehavior().getRowHeight(t);return e},getColumnWidth:function(t){var e=this.getGrid().getColumnWidth(t);return e},isLastColumnVisible:function(){var t=this.getColumnCount()-1,e=-1!==this.visibleColumns.indexOf(t);return e},getRenderedWidth:function(t){return this.getColumnEdges()[t]},getRenderedHeight:function(t){return this.rowEdges[t]},getCanvas:function(){return this.getGrid().getCanvas()},isDraggingColumn:function(){return this.getGrid().isDraggingColumn()},getPageUpRow:function(){for(var t=this.getBehavior(),e=this.getVisibleScrollHeight(),i=this.getGrid().getFixedRowCount(),n=this.dataWindow.origin.y-i,o=0;e>o&&n>-1;)o+=t.getRowHeight(n),n--;return n+1},getPageDownRow:function(){var t=this.getGrid().getFixedRowCount(),e=this.dataWindow.corner.y-t-1;return e},getColumnCount:function(){return this.getGrid().getColumnCount()},getRowCount:function(){return this.getGrid().getRowCount()},getFixedColumnCount:function(){return this.getGrid().getFixedColumnCount()},getFixedRowCount:function(){return this.getGrid().getFixedRowCount()},getHeaderRowCount:function(){return this.getGrid().getHeaderRowCount()},getHeaderColumnCount:function(){return this.getGrid().getHeaderColumnCount()},paintCells:function(t){var e,i,o,r,s,l,a,u=this.getColumnEdges(),c=this.rowEdges,h=this.getVisibleColumns(),d=this.getVisibleRows(),g=this.getBehavior(),f=0,p=0,v=this.getBounds().height,m=this.getGrid().isShowRowNumbers()?-1:0,C=h.length;if(this.buttonCells={},C)for(o=m;C>o;o++,f+=a){for(s=h[o],this.renderedColumnMinWidths[s]=0,e=g.getColumnProperties(s).renderCellError,t.save(),a=u[o-m]-f,t.beginPath(),t.rect(f,p,a,v),t.clip(),r=0;r=0&&c>i,g=0>i,f=n.isFilterRow(i),p=n.isHierarchyColumn(e),v=n.isRowSelected(i),m=n.isColumnSelected(e),C=n.isCellSelected(e,i),w=n.isCellSelectedInColumn(e),y=n.isCellSelectedInRow(i),x=n.areAllRowsSelected();h&&-1===e||p?(v?(l=l.rowHeaderRowSelection,a=Object.create(l),a.isSelected=!0):(l=l.rowHeader,a=Object.create(l),a.isSelected=y),a.isUserDataArea=!1):d||g?(f?(l=l.filterProperties,a=Object.create(l),a.isSelected=!1):m?(l=l.columnHeaderColumnSelection,a=Object.create(l),a.isSelected=!0):(l=l.columnHeader,a=Object.create(l),a.isSelected=w),a.isUserDataArea=!1):p?(l=l.rowHeader,a=Object.create(l),a.isSelected=y):(a=Object.create(l),a.isSelected=C||v||m,a.isUserDataArea=!0);var S=i-c+1;-1===e?(0===i?a.value=[s.checkbox(x),"",null]:f?a.value=[s.filter(!1),"",null]:d||g?a.value="":a.value=[s.checkbox(v),S,null],a.halign="right"):(a.value=n.getValue(e,i),a.halign=n.getColumnAlignment(e)),a.isColumnHovered=this.isRowHovered(e,i),a.isRowHovered=this.isColumnHovered(e,i),a.bounds=this._getBoundsOfCell(e,i),a.isCellSelected=C,a.isRowSelected=v,a.isColumnSelected=m,a.isInCurrentSelectionRectangle=n.isInCurrentSelectionRectangle(e,i);var b=n.mouseDownState;if(b){var E=b.gridCell;a.mouseDown=E.x===e&&E.y===i}a.x=e,a.y=i,r.cellPropertiesPrePaintNotification(a);var R=r.getCellRenderer(a,e,i),A=r.getCellProperties(e,i);o(a).extendOwn(A),a.buttonCells=this.buttonCells,R.paint(t,a),this.renderedColumnMinWidths[e]=Math.max(a.minWidth||0,this.renderedColumnMinWidths[e]),u.preferredWidth=this.renderedColumnMinWidths[e]}},isViewableButton:function(t,e){var i=t+","+e;return this.buttonCells[i]===!0},getRowNumbersWidth:function(){var t=this.getColumnEdges();return 0===t.length?0:t[0]},startAnimator:function(){var t,e=this;t=function(){e.animate(),requestAnimationFrame(t)},requestAnimationFrame(t)},animate:function(){var t=this.getCanvas().canvasCTX;t.beginPath(),t.save(),this.renderFocusCell(t),t.restore(),t.closePath()},getBounds:function(){return this.bounds},setBounds:function(t){return this.bounds=t}});e.exports=l},{"../images":2,"extend-me":4,"object-iterators":29}],36:[function(t,e,i){"use strict";function n(){this.selections=[],this.flattenedX=[],this.flattenedY=[],this.rowSelectionModel=new o,this.columnSelectionModel=new o,this.setLastSelectionType("")}var o=t("sparse-boolean-array");n.prototype={allRowsSelected:!1,getGrid:function(){return null},getLastSelection:function(){var t=this.selections,e=t[t.length-1];return e},getLastSelectionType:function(){return this.lastSelectionType},setLastSelectionType:function(t){this.lastSelectionType=t},select:function(t,e,i,n){var o=this.getGrid().newRectangle(t,e,i,n);this.selections.push(o),this.flattenedX.push(o.flattenXAt(0)),this.flattenedY.push(o.flattenYAt(0)),this.setLastSelectionType("cell"),this.getGrid().selectionChanged()},toggleSelect:function(t,e,i,n){var o,r;o=this.selections.find(function(o,s){return r=s,o.origin.x===t&&o.origin.y===e&&o.extent.x===i&&o.extent.y===n}),o?(this.selections.splice(r,1),this.flattenedX.splice(r,1),this.flattenedY.splice(r,1),this.getGrid().selectionChanged()):this.select(t,e,i,n)},clearMostRecentSelection:function(){this.allRowsSelected=!1,this.selections.length=Math.max(0,this.selections.length-1),this.flattenedX.length=Math.max(0,this.flattenedX.length-1),this.flattenedY.length=Math.max(0,this.flattenedY.length-1)},clearMostRecentColumnSelection:function(){this.columnSelectionModel.clearMostRecentSelection(),this.setLastSelectionType("column")},clearMostRecentRowSelection:function(){this.rowSelectionModel.clearMostRecentSelection(),this.setLastSelectionType("row")},clearRowSelection:function(){this.rowSelectionModel.clear(),this.setLastSelectionType("row")},getSelections:function(){return this.selections},hasSelections:function(){return 0!==this.selections.length},hasRowSelections:function(){return!this.rowSelectionModel.isEmpty()},hasColumnSelections:function(){return!this.columnSelectionModel.isEmpty()},isCellSelectedInRow:function(t){return this._isCellSelected(this.flattenedX,0,t)},isCellSelectedInColumn:function(t){return this._isCellSelected(this.flattenedY,t,0)},isSelected:function(t,e){return this.isColumnSelected(t)||this.isRowSelected(e)||this._isCellSelected(this.selections,t,e)},isCellSelected:function(t,e){return this._isCellSelected(this.selections,t,e)},_isCellSelected:function(t,e,i){var n=this;return!!t.find(function(t){return n.rectangleContains(t,e,i)})},clear:function(){this.allRowsSelected=!1,this.selections.length=0,this.flattenedX.length=0,this.flattenedY.length=0,this.rowSelectionModel.clear(),this.columnSelectionModel.clear()},isRectangleSelected:function(t,e,i,n){return!!this.selections.find(function(o){return o.origin.x===t&&o.origin.y===e&&o.extent.x===i&&o.extent.y===n})},isColumnSelected:function(t){return this.columnSelectionModel.isSelected(t)},isRowSelected:function(t){return this.allRowsSelected||this.rowSelectionModel.isSelected(t)},selectColumn:function(t,e){this.columnSelectionModel.select(t,e),this.setLastSelectionType("column")},selectAllRows:function(){this.clear(),this.allRowsSelected=!0},areAllRowsSelected:function(){return this.allRowsSelected},selectRow:function(t,e){this.rowSelectionModel.select(t,e),this.setLastSelectionType("row")},deselectColumn:function(t,e){this.columnSelectionModel.deselect(t,e),this.setLastSelectionType("column")},deselectRow:function(t,e){this.rowSelectionModel.deselect(t,e),this.setLastSelectionType("row")},getSelectedRows:function(){if(this.areAllRowsSelected()){for(var t=this.getGrid(),e=t.getHeaderRowCount(),i=t.getRowCount()-e,n=new Array(i),o=0;i>o;o++)n[o]=o+e;return n}return this.rowSelectionModel.getSelections()},getSelectedColumns:function(){return this.columnSelectionModel.getSelections()},isColumnOrRowSelected:function(){return!this.columnSelectionModel.isEmpty()||!this.rowSelectionModel.isEmpty()},getFlattenedYs:function(){var t=[],e={};return this.selections.forEach(function(i){for(var n=i.origin.y,o=i.extent.y+1,r=0;o>r;r++){var s=r+n;e[s]||(t.push(s),e[s]=!0)}}),t.sort(function(t,e){return t-e}),t},selectRowsFromCells:function(t){t=t||0;var e=this.rowSelectionModel;this.allRowsSelected=!1,e.clear(),this.selections.forEach(function(i){var n=i.origin.y,o=i.extent.y;e.select(n+t,n+o+t)})},selectColumnsFromCells:function(t){t=t||0;var e=this.columnSelectionModel;e.clear(),this.selections.forEach(function(i){var n=i.origin.x,o=i.extent.x;e.select(n+t,n+o+t)})},isInCurrentSelectionRectangle:function(t,e){var i=this.selections[this.selections.length-1];return i&&this.rectangleContains(i,t,e)},rectangleContains:function(t,e,i){var n=t.origin.x,o=t.origin.y,r=n+t.extent.x,s=o+t.extent.y;t.extent.x<0&&(n=r,r=t.origin.x),t.extent.y<0&&(o=s,s=t.origin.y);var l=e>=n&&i>=o&&r>=e&&s>=i;return l}},e.exports=n},{"sparse-boolean-array":31}],37:[function(t,e,i){"use strict";var n=t("extend-me").Base,o=500,r=n.extend("TableDialog",{initialize:function(t){this.grid=t,this.initializeOverlaySurface(),this.openNow=!1},isOpen:function(){return this.openNow},open:function(){if(!this.isOpen()){this.openNow=!0;var t=this;this.overlay.style.backgroundColor=this.grid.resolveProperty("backgroundColor"),this.overlay.style.top="0%",this.overlay.style.right="0%",this.overlay.style.bottom="0%",this.overlay.style.left="0%",t.overlay.style.webkitTransition="",this.overlay.style.marginTop="15px",this.overlay.style.marginRight="35px",this.overlay.style.marginBottom="35px",this.overlay.style.marginLeft="15px",this.overlay.style.opacity=0,this.overlay.style.zIndex=100,this.closeTransition=function(){this.overlay.style.opacity=0},this._closer||(this._closer=function(e){var i=t.getCharFor(e.keyCode).toLowerCase(),n=t.grid.resolveProperty("editorActivationKeys");(n.indexOf(i)>-1||27===e.keyCode)&&(e.preventDefault(),t.close())}),requestAnimationFrame(function(){t.overlay.style.webkitTransition="opacity "+o+"ms ease-in",requestAnimationFrame(function(){document.addEventListener("keydown",t._closer,!1),t.overlay.style.opacity=.95})}),setTimeout(function(){t.overlay.focus()},100)}},openFrom:function(t){if(!this.isOpen()){this.openNow=!0;var e=this;this.overlay.style.backgroundColor=this.grid.resolveProperty("backgroundColor");var i=this.grid.div.getBoundingClientRect();e.overlay.style.webkitTransition="",this.overlay.style.top="0%",this.overlay.style.right="0%",this.overlay.style.bottom="0%",this.overlay.style.left="0%";var n=t.y+"px",r=i.width-(t.x+t.width)+"px",s=i.height-(t.y+t.height)+"px",l=t.x+"px";this.overlay.style.marginTop=n,this.overlay.style.marginRight=r,this.overlay.style.marginBottom=s,this.overlay.style.marginLeft=l,this.overlay.style.zIndex=100,this.overlay.style.opacity=1,this.closeTransition=function(){e.overlay.style.marginTop=n,e.overlay.style.marginRight=r,e.overlay.style.marginBottom=s,e.overlay.style.marginLeft=l},this._closer||(this._closer=function(t){var i=e.getCharFor(t.keyCode).toLowerCase(),n=e.grid.resolveProperty("editorActivationKeys");(n.indexOf(i)>-1||27===t.keyCode)&&(t.preventDefault(),e.close())}),requestAnimationFrame(function(){document.addEventListener("keydown",e._closer,!1),requestAnimationFrame(function(){requestAnimationFrame(function(){e.overlay.style.webkitTransition="margin-top "+o+"ms ease-in, margin-right "+o+"ms ease-in, margin-bottom "+o+"ms ease-in, margin-left "+o+"ms ease-in",e.overlay.style.marginTop="15px",e.overlay.style.marginRight="35px",e.overlay.style.marginBottom="35px",e.overlay.style.marginLeft="15px"})})}),setTimeout(function(){e.overlay.focus()},100)}},close:function(){this.openNow=!1,document.removeEventListener("keydown",this._closer,!1);var t=this;requestAnimationFrame(function(){t.closeTransition()}),setTimeout(function(){t.clear(),t.overlay.style.zIndex=-1e3,t.onClose&&(t.onClose(),t.onClose=void 0),t.grid.takeFocus()},o)},initializeOverlaySurface:function(){this.overlay=document.createElement("div"),this.overlay.setAttribute("tabindex",0),this.overlay.style.outline="none",this.overlay.style.boxShadow="0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22)",this.overlay.style.position="absolute",this.overlay.style.marginTop="0px",this.overlay.style.marginRight="0px",this.overlay.style.marginBottom="0px",this.overlay.style.marginLeft="0px",this.overlay.style.overflow="hidden",this.overlay.style.opacity=0,this.overlay.style.zIndex=10,this.grid.div.appendChild(this.overlay)},getCharFor:function(t){var e=this.grid.getCanvas().getCharMap();return e[t][0]},clear:function(){this.overlay.innerHTML=""},querySelector:function(t){var e=this.overlay.querySelector(t);return e},getAnimationTime:function(){return o}});e.exports=r},{"extend-me":4}],38:[function(t,e,i){"use strict";var n=t("object-iterators"),o=t("extend-me").Base,r=t("./Column"),s=t("../CellProvider"),l=["columnHeader","columnHeaderColumnSelection","filterProperties","rowHeader","rowHeaderRowSelection","rowNumbersProperties","treeColumnProperties","treeColumnPropertiesColumnSelection"],a=o.extend("Behavior",{initialize:function(t){t.setBehavior(this),this.initializeFeatureChain(t),this.getDataModel(),this.cellProvider=this.createCellProvider(),this.renderedColumnCount=30,this.renderedRowCount=60,this.dataUpdates={}},initializeFeatureChain:function(t){var e=this;this.features.forEach(function(t){e.setNextFeature(new t)}),this.featureChain.initializeOn(t)},features:[],tableState:null,grid:null,editorTypes:["choice","textfield","color","slider","spinner","date"],featureChain:null,dataModel:null,baseModel:null,scrollPositionX:0,scrollPositionY:0,featureMap:{},allColumns:[],columns:[],reset:function(){this.cellProvider=this.createCellProvider(),this.renderedColumnCount=30,this.renderedRowCount=60,this.dataUpdates={},this.clearColumns(),this.clearState(),this.getDataModel().reset(),this.createColumns()},clearColumns:function(){this.columns=[],this.allColumns=[],this.columns[-1]=this.newColumn(-1,""),this.columns[-2]=this.newColumn(-2,"Tree"),this.allColumns[-1]=this.columns[-1],this.allColumns[-2]=this.columns[-2]},getColumn:function(t){return this.columns[t]},getColumnId:function(t){return this.getColumn(t).label},newColumn:function(t,e){var i=this.createColumnProperties();return this.getPrivateState().columnProperties[t]=i,new r(this,t,e)},addColumn:function(t,e){var i=this.newColumn(t,e);return this.columns.push(i),this.allColumns.push(i),i},createColumns:function(){},createColumnProperties:function(){var t=this.getPrivateState(),e=Object.create(t);return e.rowNumbersProperties=Object.create(e,{foregroundSelectionColor:{configurable:!0,get:function(){return this.columnHeaderForegroundSelectionColor},set:function(t){this.columnHeaderForegroundSelectionColor=t}},backgroundSelectionColor:{configurable:!0,get:function(){return this.columnHeaderBackgroundSelectionColor},set:function(t){ this.columnHeaderBackgroundSelectionColor=t}}}),e.rowHeader=Object.create(e,{font:{configurable:!0,get:function(){return this.rowHeaderFont},set:function(t){this.rowHeaderFont=t}},color:{configurable:!0,get:function(){return this.rowHeaderColor},set:function(t){this.rowHeaderColor=t}},backgroundColor:{configurable:!0,get:function(){return this.rowHeaderBackgroundColor},set:function(t){this.rowHeaderBackgroundColor=t}},foregroundSelectionColor:{configurable:!0,get:function(){return this.rowHeaderForegroundSelectionColor},set:function(t){this.rowHeaderForegroundSelectionColor=t}},backgroundSelectionColor:{configurable:!0,get:function(){return this.rowHeaderBackgroundSelectionColor},set:function(t){this.rowHeaderBackgroundSelectionColor=t}}}),e.columnHeader=Object.create(e,{font:{configurable:!0,get:function(){return this.columnHeaderFont},set:function(t){this.columnHeaderFont=t}},color:{configurable:!0,get:function(){return this.columnHeaderColor},set:function(t){this.columnHeaderColor=t}},backgroundColor:{configurable:!0,get:function(){return this.columnHeaderBackgroundColor},set:function(t){this.columnHeaderBackgroundColor=t}},foregroundSelectionColor:{configurable:!0,get:function(){return this.columnHeaderForegroundSelectionColor},set:function(t){this.columnHeaderForegroundSelectionColor=t}},backgroundSelectionColor:{configurable:!0,get:function(){return this.columnHeaderBackgroundSelectionColor},set:function(t){this.columnHeaderBackgroundSelectionColor=t}}}),e.columnHeaderColumnSelection=Object.create(e.columnHeader,{foregroundSelectionColor:{configurable:!0,get:function(){return this.columnHeaderForegroundColumnSelectionColor},set:function(t){this.columnHeaderForegroundColumnSelectionColor=t}},backgroundSelectionColor:{configurable:!0,get:function(){return this.columnHeaderBackgroundColumnSelectionColor},set:function(t){this.columnHeaderBackgroundColumnSelectionColor=t}}}),e.rowHeaderRowSelection=Object.create(e.rowHeader,{foregroundSelectionColor:{configurable:!0,get:function(){return this.rowHeaderForegroundRowSelectionColor},set:function(t){this.rowHeaderForegroundRowSelectionColor=t}},backgroundSelectionColor:{configurable:!0,get:function(){return this.rowHeaderBackgroundRowSelectionColor},set:function(t){this.rowHeaderBackgroundRowSelectionColor=t}}}),e.filterProperties=Object.create(e,{font:{configurable:!0,get:function(){return this.filterFont},set:function(t){this.filterFont=t}},color:{configurable:!0,get:function(){return this.filterColor},set:function(t){this.filterColor=t}},backgroundColor:{configurable:!0,get:function(){return this.filterBackgroundColor},set:function(t){this.filterBackgroundColor=t}},foregroundSelectionColor:{configurable:!0,get:function(){return this.filterForegroundSelectionColor},set:function(t){this.filterForegroundSelectionColor=t}},backgroundSelectionColor:{configurable:!0,get:function(){return this.filterBackgroundSelectionColor},set:function(t){this.filterBackgroundSelectionColor=t}},cellBorderStyle:{configurable:!0,get:function(){return this.filterCellBorderStyle},set:function(t){this.filterCellBorderStyle=t}},cellBorderThickness:{configurable:!0,get:function(){return this.filterCellBorderThickness},set:function(t){this.filterCellBorderThickness=t}}}),e.treeColumnProperties=Object.create(e,{font:{configurable:!0,get:function(){return this.treeColumnFont},set:function(t){this.treeColumnFont=t}},color:{configurable:!0,get:function(){return this.treeColumnColor},set:function(t){this.treeColumnColor=t}},backgroundColor:{configurable:!0,get:function(){return this.treeColumnBackgroundColor},set:function(t){this.treeColumnBackgroundColor=t}},foregroundSelectionColor:{configurable:!0,get:function(){return this.treeColumnForegroundSelectionColor},set:function(t){this.treeColumnForegroundSelectionColor=t}},backgroundSelectionColor:{configurable:!0,get:function(){return this.treeColumnBackgroundSelectionColor},set:function(t){this.treeColumnBackgroundSelectionColor=t}}}),e.treeColumnPropertiesColumnSelection=Object.create(e.treeColumnProperties,{foregroundSelectionColor:{configurable:!0,get:function(){return this.treeColumnForegroundColumnSelectionColor},set:function(t){this.treeColumnForegroundColumnSelectionColor=t}},backgroundSelectionColor:{configurable:!0,get:function(){return this.treeColumnBackgroundColumnSelectionColor},set:function(t){this.treeColumnBackgroundColumnSelectionColor=t}}}),e},getColumnWidth:function(t){var e=this.getColumn(t);if(!e)return this.resolveProperty("defaultColumnWidth");var i=e.getWidth();return i},setColumnWidth:function(t,e){this.getColumn(t).setWidth(e),this.stateChanged()},getDataModel:function(){if(null===this.dataModel){var t=this.getDefaultDataModel();this.setDataModel(t)}return this.dataModel},getCellRenderer:function(t,e,i){return this.getColumn(e).getCellRenderer(t,i)},setDataModel:function(t){this.dataModel=t},setComplexFilter:function(t,e){var i=this.getColumn(t);i&&i.setComplexFilter(e)},getComplexFilter:function(t){var e=this.getColumn(t);return e?e.getComplexFilter():void 0},applyFilters:function(){},clearObjectProperties:function(t,e){for(var i in t)t.hasOwnProperty(i)&&(void 0===e||!e&&l.indexOf(i)>=0||e&&l.indexOf(i)<0)&&delete t[i]},getPrivateState:function(){return this.tableState||(this.tableState=this.getDefaultState()),this.tableState},getState:function(){var t=JSON.parse(JSON.stringify(this.getPrivateState()));return this.clearObjectProperties(t.columnProperties,!0),t},clearState:function(){this.tableState=null},getDefaultState:function(){var t=this.getGrid()._getProperties(),e=Object.create(t);return n(e).extendOwn({rowHeights:{},cellProperties:{},columnProperties:[]}),e},setState:function(t){if(!t.columnIndexes){var e=this.getFields();t.columnIndexes=[];for(var i=0;ii;i++)e+=this.getRowHeight(i);return e},getRowHeight:function(t){var e=this.getPrivateState();if(e.rowHeights){var i=e.rowHeights[t];if(i)return i}return this.getDefaultRowHeight()},getDefaultRowHeight:function(){return this.defaultRowHeight||(this.defaultRowHeight=this.resolveProperty("defaultRowHeight")),this.defaultRowHeight},setRowHeight:function(t,e){var i=this.getPrivateState();i.rowHeights[t]=Math.max(5,e),this.stateChanged()},getFixedRowsMaxHeight:function(){return this.getFixedRowsHeight()},getFixedColumnsWidth:function(){var t=this.getFixedColumnCount(),e=0;this.getGrid().isShowRowNumbers()&&(e=this.getColumnWidth(-1));for(var i=0;t>i;i++)e+=this.getColumnWidth(i);return e},getFixedColumnsMaxWidth:function(){var t=this.getFixedColumnsWidth();return t},_setScrollPositionY:function(t){this.setScrollPositionY(t),this.changed()},_setScrollPositionX:function(t){this.setScrollPositionX(t),this.changed()},setRenderedColumnCount:function(t){this.renderedColumnCount=t},setRenderedRowCount:function(t){this.renderedRowCount=t},_fixedRowClicked:function(t,e){var i=this.translateColumnIndex(this.getScrollPositionX()+e.gridCell.x-this.getFixedColumnCount()),n=this.grid.newPoint(i,e.gridCell.y);e.gridCell=n,this.fixedRowClicked(t,e)},_fixedColumnClicked:function(t,e){var i=this.grid.newPoint(e.gridCell.x,this.getScrollPositionY()+e.gridCell.y-this.getFixedRowCount());e.gridCell=i,this.fixedColumnClicked(t,e)},moveSingleSelect:function(t,e,i){this.featureChain&&(this.featureChain.moveSingleSelect(t,e,i),this.setCursor(t))},setCursor:function(t){t.updateCursor(),this.featureChain.setCursor(t)},onMouseMove:function(t,e){this.featureChain&&(this.featureChain.handleMouseMove(t,e),this.setCursor(t))},onTap:function(t,e){this.featureChain&&(this.featureChain.handleTap(t,e),this.setCursor(t))},onContextMenu:function(t,e){var i=t.fireSyntheticContextMenuEvent(e);i&&this.featureChain&&(this.featureChain.handleContextMenu(t,e),this.setCursor(t))},onWheelMoved:function(t,e){this.featureChain&&(this.featureChain.handleWheelMoved(t,e),this.setCursor(t))},onMouseUp:function(t,e){this.featureChain&&(this.featureChain.handleMouseUp(t,e),this.setCursor(t))},onMouseDrag:function(t,e){this.featureChain&&(this.featureChain.handleMouseDrag(t,e),this.setCursor(t))},onKeyDown:function(t,e){this.featureChain&&(this.featureChain.handleKeyDown(t,e),this.setCursor(t))},onKeyUp:function(t,e){this.featureChain&&(this.featureChain.handleKeyUp(t,e),this.setCursor(t))},onDoubleClick:function(t,e){this.featureChain&&(this.featureChain.handleDoubleClick(t,e),this.setCursor(t))},onHoldPulse:function(t,e){this.featureChain&&(this.featureChain.handleHoldPulse(t,e),this.setCursor(t))},toggleColumnPicker:function(){var t=this.grid.dialog,e=this;t.isOpen()?t.close():(this.buildColumnPicker(t.overlay),t.onClose=function(){e.updateFromColumnPicker(t.overlay)},t.open())},handleMouseDown:function(t,e){this.featureChain&&(this.featureChain.handleMouseDown(t,e),this.setCursor(t))},handleMouseExit:function(t,e){this.featureChain&&(this.featureChain.handleMouseExit(t,e),this.setCursor(t))},changed:function(){},shapeChanged:function(){},isColumnReorderable:function(){return!0},getColumnProperties:function(t){var e=this.columns[t];if(!e)return{isNull:!0};var i=e.getProperties();return i?i:{isNull:!0}},setColumnProperties:function(t,e){var i=this.getColumnProperties(t);n(i).extendOwn(e),this.changed()},getField:function(t){if(-1===t)return"tree";var e=this.getColumn(t);return e.getField()},getHeader:function(t){if(-1===t)return"Tree";var e=this.getColumn(t);return e.getHeader()},setColumnDescriptors:function(t){var e,i=t.visible,n=this.getPrivateState(),o=i.length,r=[];for(e=0;o>e;e++)r.push(i[e].id);n.columnIndexes=r,this.changed()},getHiddenColumnDescriptors:function(){for(var t=this.getPrivateState(),e=t.columnIndexes,i=[],n=this.getColumnCount(),o=0;n>o;o++)-1===e.indexOf(o)&&i.push({id:o,label:this.getHeader(o),field:this.getField(o)});return i},hideColumns:function(t){for(var e=this.getPrivateState(),i=e.columnIndexes,n=0;ns;s++)if(i=this.getValue(s),n=this.typeOf(i),o!==n){if(!r||"number"!=typeof i)return"mixed";o="float"}return o},typeOf:function(t){var e=typeof t;switch(e){case"object":return t.constructor.name.toLowerCase();case"number":return parseInt(t)===t?"int":"float";default:return e}},getProperties:function(){return this.behavior.getPrivateState().columnProperties[this.index]},setProperties:function(t){var e=this.behavior.getPrivateState().columnProperties[this.index];this.clearObjectProperties(e,!1),o(e).extendOwn(t)},toggleSort:function(t){this.dataModel.toggleSort(this.index,t)},getCellEditorAt:function(t,e){return this.dataModel.getCellEditorAt(this.index,e)},getHeader:function(){return this.label},getField:function(){return this.dataModel.getFields()[this.index]}},e.exports=n},{"object-iterators":29}],40:[function(t,e,i){"use strict";function n(t,e){this.setComponent(e),this.setGrid(t)}n.prototype={constructor:n.prototype.constructor,component:null,grid:null,getGrid:function(){return this.grid},setGrid:function(t){this.grid=t,this.getComponent().setGrid(t)},getBehavior:function(){return this.getGrid().getBehavior()},changed:function(){this.getBehavior().changed()},getPrivateState:function(){return this.getGrid().getPrivateState()},applyState:function(){},setComponent:function(t){this.component=t},getComponent:function(){return this.component},setGlobalFilter:function(t){return this.getComponent().setGlobalFilter(t)},getData:function(){return this.getComponent().getData()},getValue:function(t,e){return this.getComponent().getValue(t,e)},setValue:function(t,e,i){this.getComponent().setValue(t,e,i)},getColumnCount:function(){return this.getComponent().getColumnCount()},applyFilters:function(){return this.getComponent().applyFilters()},getRowCount:function(){return this.getComponent().getRowCount()},getCellRenderer:function(t,e,i,n,o){return this.getComponent().getCellRenderer(t,e,i,n,o)},getRowHeight:function(t){return this.getComponent().getRowHeight(t)},getColumnEdge:function(t,e){return this.getComponent().getColumnEdge(t,e)},getColumnWidth:function(t){return this.getComponent().getColumnWidth(t)},setColumnWidth:function(t,e){this.getComponent().setColumnWidth(t,e)},toggleSort:function(t,e){this.getComponent().toggleSort(t,e)},getColumnProperties:function(t){return this.getComponent().getColumnProperties(t)},setColumnProperties:function(t,e){this.getComponent().setColumnProperties(t,e)},getHeaders:function(){return this.getComponent().getHeaders()},getFields:function(){return this.getComponent().getFields()},setFields:function(t){this.getComponent().setFields(t)},getCellProperties:function(t,e){return this.getComponent().getCellProperties(t,e)},setCellProperties:function(t,e,i){this.getComponent().setCellProperties(t,e,i)},getRow:function(t){return this.getComponent().getRow(t)},getTopTotals:function(){return this.getComponent().getTopTotals()},setTopTotals:function(t){this.getComponent().setTopTotals(t)},getBottomTotals:function(){return this.getComponent().getBottomTotals()},setBottomTotals:function(t){this.getComponent().setBottomTotals(t)},setData:function(t){return this.getComponent().setData(t)},hasHierarchyColumn:function(){return this.getComponent().hasHierarchyColumn()},setHeaders:function(t){return this.getComponent().setHeaders(t)},cellClicked:function(t,e){return this.getComponent().cellClicked(t,e)},getAvailableGroups:function(){return this.getComponent().getAvailableGroups()},getGroups:function(){return this.getComponent().getGroups()},setGroups:function(t){this.getComponent().setGroups(t)},getHiddenColumns:function(){return this.getComponent().getHiddenColumns()},getVisibleColumns:function(){return this.getComponent().getVisibleColumns()},setAggregates:function(t){return this.getComponent().setAggregates(t)},reset:function(){this.getComponent().reset()},getCellEditorAt:function(t,e){return this.getComponent().getCellEditorAt(t,e)}},e.exports=n},{}],41:[function(t,e,i){"use strict";var n=t("list-dragon"),o=t("./Behavior"),r=t("./DataModelDecorator"),s=t("../dataModels/JSON"),l=t("../features/index"),a=t("../stylesheets"),u=t("hyper-analytics").util.aggregations,c=o.extend("behaviors.JSON",{initialize:function(t,e){this.setData(e)},features:[l.CellSelection,l.KeyPaging,l.ColumnPicker,l.ColumnResizing,l.RowResizing,l.Filters,l.RowSelection,l.ColumnSelection,l.ColumnMoving,l.ColumnSorting,l.CellEditing,l.CellClick,l.OnHover],aggregations:u,createColumns:function(){var t=this.getDataModel(),e=t.getColumnCount(),i=t.getHeaders(),n=t.getFields();this.clearColumns();for(var o=0;e>o;o++){var r=i[o],s=this.addColumn(o,r),l=s.getProperties();l.field=n[o],l.header=r,l.complexFilter=null}},getDefaultDataModel:function(){var t=new s,e=new r(this.getGrid(),t);return e.setComponent(t),e},applyFilters:function(){this.dataModel.applyFilters()},setHeaders:function(t){this.getDataModel().setHeaders(t)},getHeaders:function(){return this.getDataModel().getHeaders()},setFields:function(t){this.getDataModel().setFields(t),this.createColumns()},getFields:function(){return this.getDataModel().getFields()},setData:function(t){this.getDataModel().setData(t),this.createColumns();var e=this;this.getGrid().isColumnAutosizing()?(setTimeout(function(){e.autosizeAllColumns()},100),e.changed()):setTimeout(function(){e.allColumns[-1].checkColumnAutosizing(!0),e.changed()})},getData:function(){return this.getDataModel().getData()},setTopTotals:function(t){this.getDataModel().setTopTotals(t)},getTopTotals:function(){return this.getDataModel().getTopTotals()},setBottomTotals:function(t){this.getDataModel().setBottomTotals(t)},getBottomTotals:function(){return this.getDataModel().getBottomTotals()},setColumns:function(t){this.getDataModel().setColumns(t)},enhanceDoubleClickEvent:function(t){t.row=this.getRow(t.gridCell.y)},setDataProvider:function(t){this.getDataModel().setDataProvider(t)},hasHierarchyColumn:function(){return this.getDataModel().hasHierarchyColumn()},getColumnAlignment:function(t){return 0===t&&this.hasHierarchyColumn()?"left":"center"},getRowSelectionMatrix:function(t){return this.getDataModel().getRowSelectionMatrix(t)},getColumnSelectionMatrix:function(t){return this.getDataModel().getColumnSelectionMatrix(t)},getSelectionMatrix:function(t){return this.getDataModel().getSelectionMatrix(t)},getRowSelection:function(){var t=this.getSelectedRows();return this.getDataModel().getRowSelection(t)},getColumnSelection:function(){var t=this.getSelectedColumns();return this.getDataModel().getColumnSelection(t)},getSelection:function(){var t=this.getSelections();return this.getDataModel().getSelection(t)},buildColumnPicker:function(t){if(!this.isColumnReorderable())return!1;var e={cssStylesheetReferenceElement:t},i={models:this.getGroups(),title:"Groups"},o={models:this.getAvailableGroups(),title:"Available Groups"},r={models:this.getHiddenColumns(),title:"Hidden Columns"},s={models:this.getVisibleColumns(),title:"Visible Columns"},l=new n([i,o],e),u=new n([r,s],e),c=[l,u];return a("list-dragon",t),c.forEach(function(e){e.modelLists.forEach(function(e){t.appendChild(e.container)})}),t.lists={group:i.models,availableGroups:o.models,hidden:r.models,visible:s.models},!0},getGroups:function(){return this.getDataModel().getGroups()},getAvailableGroups:function(){return this.getDataModel().getAvailableGroups()},getHiddenColumns:function(){return this.getDataModel().getHiddenColumns()},getVisibleColumns:function(){return this.getDataModel().getVisibleColumns()},setColumnDescriptors:function(t){var e=this.columns[0];this.columns.length=0,e&&"Tree"===e.label&&this.columns.push(e);for(var i=0;it?"0"+t:t+""},s=n.extend("Date",{alias:"date",template:function(){},setEditorValue:function(t){t&&"Date"===t.constructor.name&&(t=t.getFullYear()+"-"+r(t.getMonth()+1)+"-"+r(t.getDay())),this.getInput().value=t+""},getEditorValue:function(){var t=this.getInput().value;return t=o(t)}});e.exports=s},{"./Simple":49}],48:[function(t,e,i){"use strict";var n=t("./CellEditor"),o=n.extend("Filter",{alias:"filter",initialize:function(){var t=document.createElement("div"),e=t.style;e.position="absolute",e.top=0,e.left=0,e.right=0,e.bottom=0,e.marginTop="44px",e.marginBottom="44px";var i=document.createElement("table");t.appendChild(i),e=i.style,e.position="absolute",e.width="100%",e.height="100%";var n=document.createElement("tr"),o=document.createElement("td");i.appendChild(n),n.appendChild(o),this.title=document.createElement("div"),this.title.innerHTML="Filter Editor",this.dialog=document.createElement("div"),this.content=o,this.buttons=document.createElement("div"),e=this.dialog.style,e.position="absolute",e.top=0,e.left=0,e.right=0,e.bottom=0,e.whiteSpace="nowrap",e=this.title.style,e.position="absolute",e.top=0,e.left=0,e.right=0,e.bottom="100%",e.marginBottom="-44px",e.whiteSpace="nowrap",e.textAlign="center",e.padding="11px",e=this.content.style,e.textAlign="center",e=this.buttons.style,e.top="0%",e.position="absolute",e.top="100%",e.left=0,e.right=0,e.bottom=0,e.marginTop="-44px",e.whiteSpace="nowrap",e.textAlign="center",e.padding="8px",this.dialog.appendChild(this.title),this.dialog.appendChild(t),this.dialog.appendChild(this.buttons),this.ok=document.createElement("button"),this.ok.style.borderRadius="2px",this.cancel=document.createElement("button"),this.cancel.style.marginLeft="5px",this.cancel.style.borderRadius="2px",this.clear=document.createElement("button"),this.clear.style.marginLeft="5px",this.clear.style.borderRadius="2px",this.ok.innerHTML="ok",this.cancel.innerHTML="cancel",this.clear.innerHTML="clear",this.buttons.appendChild(this.ok),this.buttons.appendChild(this.cancel),this.buttons.appendChild(this.clear);var r=this;this.ok.onclick=function(){r.okPressed()},this.cancel.onclick=function(){r.cancelPressed()},this.clear.onclick=function(){r.clearPressed()}},okPressed:function(){var t=this.getGrid().dialog;t.onOkPressed()},cancelPressed:function(){var t=this.getGrid().dialog;t.onCancelPressed()},clearPressed:function(){var t=this.getGrid().dialog;t.onClearPressed()},beginEditAt:function(t){var e=this.getGrid(),i=e.getBehavior(),n=e.dialog,o=i.getColumnId(t.x);this.title.innerHTML="filter for '"+o+"' column";var r=e.getFilterFor(t.x);if(n.isOpen())n.close();else{n.clear(),n.overlay.appendChild(this.dialog),this.template=r.template+"";var s=this.getHTML();this.content.innerHTML=s,n.onOkPressed=function(){r.onOk(n),i.setComplexFilter(t.x,{type:r.alias,state:r.getState()}),n.close(),i.applyFilters(),i.changed()},n.onCancelPressed=function(){r.onCancel&&r.onCancel(n),n.close(),r=void 0},n.onClearPressed=function(){r.onClear&&r.onClear(n),i.setComplexFilter(t.x,void 0),n.close(),i.applyFilters(),i.changed()};var l=e._getBoundsOfCell(t.x,t.y),a=e.div.getBoundingClientRect().left-e.divCanvas.getBoundingClientRect().left; -l.x=l.x-a,n.openFrom(l);var u=i.getComplexFilter(t.x);u&&r.setState(u.state),setTimeout(function(){r.onShow&&r.onShow(n)},n.getAnimationTime()+10)}}});e.exports=o},{"./CellEditor":44}],49:[function(t,e,i){"use strict";var n=t("./CellEditor.js"),o=n.extend("Simple",{input:null,alias:"simple",initialize:function(){this.editorPoint={x:0,y:0}},initializeInput:function(t){var e=this;t.addEventListener("keyup",function(t){!t||13!==t.keyCode&&27!==t.keyCode&&8!==t.keyCode||(t.preventDefault(),8===t.keyCode?e.clearStopEditing():27===t.keyCode?e.cancelEditing():e.stopEditing(),e.getGrid().repaint(),e.getGrid().takeFocus()),e.getGrid().fireSyntheticEditorKeyUpEvent(e,t)}),t.addEventListener("keydown",function(t){e.getGrid().fireSyntheticEditorKeyDownEvent(e,t)}),t.addEventListener("keypress",function(t){console.log("keypress",t.keyCode),e.getGrid().fireSyntheticEditorKeyPressEvent(e,t)}),t.style.position="absolute",t.style.display="none",t.style.border="solid 2px black",t.style.outline=0,t.style.padding=0,t.style.zIndex=1e3,t.style.boxShadow="white 0px 0px 1px 1px"},getEditorValue:function(){var t=this.getInput().value;return t},setEditorValue:function(t){this.getInput().value=t+""},clearStopEditing:function(){this.setEditorValue(""),this.stopEditing()},cancelEditing:function(){this.isEditing&&(this.getInput().value=null,this.isEditing=!1,this.hideEditor())},showEditor:function(){this.getInput().style.display="inline"},hideEditor:function(){this.getInput().style.display="none"},takeFocus:function(){var t=this;setTimeout(function(){t.input.focus(),t.selectAll()},300)},selectAll:function(){},originOffset:function(){return[0,0]},setBounds:function(t){var e=this.originOffset(),i="translate("+(t.x-1+e[0])+"px,"+(t.y-1+e[1])+"px)",n=this.getInput();n.style.boxSizing="border-box",n.style.webkitTransform=i,n.style.MozTransform=i,n.style.msTransform=i,n.style.OTransform=i,n.style.width=t.width+2+"px",n.style.height=t.height+2+"px"},saveEditorValue:function(){var t=this.getEditorPoint(),e=this.getEditorValue();if(e!==this.initialValue){parseFloat(this.initialValue)===this.initialValue&&(e=parseFloat(e));var i=this.getGrid().fireBeforeCellEdit(t,this.initialValue,e,this);i&&(this.getBehavior().setValue(t.x,t.y,e),this.getGrid().fireAfterCellEdit(t,this.initialValue,e,this))}},_moveEditor:function(){var t=this.getGrid(),e=this.getEditorPoint(),i=t._getBoundsOfCell(e.x,e.y),n=t.div.getBoundingClientRect().left-t.divCanvas.getBoundingClientRect().left;i.x=i.x-n,this.setBounds(i)},moveEditor:function(){this._moveEditor(),this.takeFocus()},beginEditAt:function(t){this.isAdded||(this.isAdded=!0,this.grid.div.appendChild(this.getInput())),this.setEditorPoint(t);var e=this.getBehavior(),i=e.getValue(t.x,t.y);"Array"===i.constructor.name&&(i=i[1]);var n=this.grid.fireRequestCellEdit(t,i);n&&(this.initialValue=i,this.setEditorValue(i),this.isEditing=!0,this.setCheckEditorPositionFlag(),this.checkEditor())},checkEditor:function(){if(this.checkEditorPositionFlag&&(this.checkEditorPositionFlag=!1,this.isEditing)){var t=this.getEditorPoint();this.grid.isDataVisible(t.x,t.y)?(this.moveEditor(),this.showEditor()):this.hideEditor()}},getInput:function(){return this.input||(this.input=this.getDefaultInput()),this.input},getDefaultInput:function(){var t=document.createElement("DIV");t.innerHTML=this.getHTML();var e=t.firstChild;return this.initializeInput(e),e},updateView:function(){var t=this.getInput(),e=t.parentNode,i=this.getDefaultInput();this.input=i,e.replaceChild(i,t)},showDropdown:function(t){var e;e=document.createEvent("MouseEvents"),e.initMouseEvent("mousedown",!0,!0,window),t.dispatchEvent(e)}});e.exports=o},{"./CellEditor.js":44}],50:[function(t,e,i){"use strict";var n=t("./Simple"),o=n.extend("Slider",{alias:"slider",template:function(){}});e.exports=o},{"./Simple":49}],51:[function(t,e,i){"use strict";var n=t("./Simple"),o=n.extend("Spinner",{alias:"spinner",template:function(){}});e.exports=o},{"./Simple":49}],52:[function(t,e,i){"use strict";var n=t("./Simple"),o=n.extend("Textfield",{alias:"textfield",template:function(){},selectAll:function(){this.input.setSelectionRange(0,this.input.value.length)}});e.exports=o},{"./Simple":49}],53:[function(t,e,i){"use strict";e.exports={CellEditor:t("./CellEditor"),Textfield:t("./Textfield"),Choice:t("./Choice"),Color:t("./Color"),Date:t("./Date"),Slider:t("./Slider"),Spinner:t("./Spinner"),Filter:t("./Filter")}},{"./CellEditor":44,"./Choice":45,"./Color":46,"./Date":47,"./Filter":48,"./Slider":50,"./Spinner":51,"./Textfield":52}],54:[function(t,e,i){"use strict";var n=t("extend-me").Base,o="A".charCodeAt(0),r=n.extend("DataModel",{next:null,grid:null,setGrid:function(t){this.grid=t},getGrid:function(){return this.grid},getBehavior:function(){return this.getGrid().getBehavior()},changed:function(){this.getBehavior().changed()},getPrivateState:function(){return this.getGrid().getPrivateState()},applyState:function(){},alphaFor:function(t){var e=Math.floor(t/26),i=t%26,n="";return e>0&&(n+=this.alpha(e-1)),n+=this.alpha(i)},alpha:function(t){return String.fromCharCode(o+t)},getCellEditorAt:function(t,e){}});e.exports=r},{"extend-me":4}],55:[function(t,e,i){"use strict";function n(t){return"function"==typeof t?t():t}function o(t){return function(e){return e=n(e),(e+"").toLowerCase().search(t.toLowerCase())>-1}}var r=t("hyper-analytics"),s=t("./DataModel"),l=t("../../images"),a="▲",u="▼",c={isNullObject:function(){return!0},getFields:function(){return[]},getHeaders:function(){return[]},getColumnCount:function(){return 0},getRowCount:function(){return 0},getAggregateTotals:function(){return[]},hasAggregates:function(){return!1},hasGroups:function(){return!1},getRow:function(){return null}},h=s.extend("dataModels.JSON",{source:c,preglobalfilter:c,prefilter:c,presorter:c,analytics:c,postfilter:c,postsorter:c,topTotals:[],bottomTotals:[],hasAggregates:function(){return this.analytics.hasAggregates()},hasGroups:function(){return this.analytics.hasGroups()},getDataSource:function(){return this.analytics},getFilterSource:function(){return this.prefilter},getSortingSource:function(){return this.presorter},getData:function(){return this.source.data},getValue:function(t,e){var i,n=this.hasHierarchyColumn(),o=this.getGrid(),r=o.getHeaderRowCount();return n&&-2===t&&(t=0),r>e?i=this.getHeaderRowValue(t,e):(n&&(e+=1),i=this.getDataSource().getValue(t,e-r))},getHeaderRowValue:function(t,e){var i;if(void 0===e)i=this.getHeaders()[Math.max(t,0)];else if(0>e){var n=this.getBottomTotals();i=n[n.length+e][t]}else{var o=this.getGrid(),r=o.isShowFilterRow(),s=o.isShowHeaderRow(),a=(r?1:0)+(s?1:0);if(e>=a)i=this.getTopTotals()[e-a][t];else{if(!s||0!==e){i=this.getFilter(t);var u=l.filter(i.length);return[null,i,u]}i=this.getHeaders()[t];var c=this.getSortImageForColumn(t);c&&(i=c+i)}}return i},setValue:function(t,e,i){var n=this.hasHierarchyColumn(),o=this.getGrid(),r=o.getHeaderRowCount();if(n){if(-2===t)return;t+=1}r>e?this.setHeaderRowValue(t,e,i):n?e+=1:this.getDataSource().setValue(t,e-r,i),this.changed()},setHeaderRowValue:function(t,e,i){if(void 0===i)return this._setHeader(t,e);var n=this.getGrid(),o=n.isShowFilterRow(),r=n.isShowHeaderRow(),s=o&&r,l=(o?1:0)+(r?1:0);if(e>=l)this.getTopTotals()[e-l][t]=i;else{if(-1===t)return;if(s){if(0===e)return this._setHeader(t,i);this.setFilter(t,i)}else{if(!o)return this._setHeader(t,i);this.setFilter(t,i)}}return""},getColumnProperties:function(t){var e=this.getBehavior().allColumns[t];return e?e.getProperties():void 0},getFilter:function(t){var e=this.getColumnProperties(t);return e?e.filter||"":""},getComplexFilter:function(t){var e=this.getColumnProperties(t);if(!e)return"";var i=e.complexFilter;if(i){var o=this.getGrid().resolveFilter(i.type);o.setState(i.state);var r=o.create();return function(t){var e=n(t);return r(e)}}},setFilter:function(t,e){var i=this.getColumnProperties(t);i.filter=e,this.applyAnalytics()},getColumnCount:function(){return this.analytics.getColumnCount()},getRowCount:function(){var t=this.getGrid(),e=this.getDataSource().getRowCount();return e+=t.getHeaderRowCount()},getHeaders:function(){return this.analytics.getHeaders()},setHeaders:function(t){this.getDataSource().setHeaders(t)},setFields:function(t){this.getDataSource().setFields(t)},getFields:function(){return this.getDataSource().getFields()},setData:function(t){this.source=new r.JSDataSource(t),this.preglobalfilter=new r.DataSourceGlobalFilter(this.source),this.prefilter=new r.DataSourceFilter(this.preglobalfilter),this.presorter=new r.DataSourceSorterComposite(this.prefilter),this.analytics=new r.DataSourceAggregator(this.presorter),this.applyAnalytics()},setTopTotals:function(t){this.topTotals=t},getTopTotals:function(){return this.hasAggregates()?this.getDataSource().getAggregateTotals():this.topTotals},setBottomTotals:function(t){this.bottomTotals=t},getBottomTotals:function(){return this.hasAggregates()?this.getDataSource().getAggregateTotals():this.bottomTotals},setGroups:function(t){this.analytics.setGroupBys(t),this.applyAnalytics(),this.getGrid().fireSyntheticGroupsChangedEvent(this.getGroups())},getGroups:function(){for(var t=this.getHeaders().slice(0),e=this.getFields().slice(0),i=this.analytics.groupBys,n=[],o=0;or;r++){var s=t[r].index,l=this.getFilter(s),a=this.getComplexFilter(s);a?i.add(s-n,a):l.length>0&&i.add(s-n,o(l))}i.applyAll()},toggleSort:function(t,e){this.incrementSortState(t,e),this.applyAnalytics()},incrementSortState:function(t,e){t++;var i=this.getPrivateState(),n=e.indexOf("CTRL")>-1;i.sorts=i.sorts||[];var o=i.sorts.indexOf(t);-1===o&&(o=i.sorts.indexOf(-1*t)),o>-1?i.sorts[o]>0?i.sorts[o]=-1*i.sorts[o]:i.sorts.splice(o,1):n||0===i.sorts.length?i.sorts.unshift(t):(i.sorts.length=0,i.sorts.unshift(t)),i.sorts.length>3&&(i.sorts.length=3)},applySorts:function(){var t=this.getSortingSource(),e=this.getPrivateState().sorts,i=this.hasAggregates()?1:0;if(e&&0!==e.length)for(var n=0;nn&&(n=i.indexOf(-1*t),e=!1),0>n)return null;var o=i.length-n,r=e?a:u;return o+r+" "},cellClicked:function(t,e){if(this.hasAggregates()&&0===e.gridCell.x){var i=this.getGrid(),n=i.getHeaderRowCount(),o=e.gridCell.y-n+1;this.analytics.click(o),this.changed()}},getRow:function(t){var e=this.getGrid(),i=e.getHeaderRowCount();if(i>t&&!this.hasAggregates()){var n=this.getTopTotals();return n[t-(i-n.length)]}return this.getDataSource().getRow(t-i)},buildRow:function(t){var e=this.getColumnCount(),i=[].concat(this.getFields()),n={};this.hasAggregates()&&(n.tree=this.getValue(-2,t),i.shift());for(var o=0;e>o;o++)n[i[o]]=this.getValue(o,t);return n},getComputedRow:function(t){for(var e=this.getRowContextFunction([t]),i=this.getFields(),n={},o=0;o=o&&i.x>=r?t.cellClicked(e):this.next&&this.next.handleTap(t,e)}});e.exports=o},{"./Feature.js":67}],59:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("CellEditing",{alias:"CellEditing",handleDoubleClick:function(t,e){var i=t.resolveProperty("editOnDoubleClick");this.checkActivateEditor(t,e,i)?t._activateEditor(e):this.next&&this.next.handleDoubleClick(t,e)},handleTap:function(t,e){var i=t.resolveProperty("editOnDoubleClick");this.checkActivateEditor(t,e,!i)?t._activateEditor(e):this.next&&this.next.handleTap(t,e)},handleHoldPulse:function(t,e){var i=t.resolveProperty("editOnDoubleClick");this.checkActivateEditor(t,e,!i)?t._activateEditor(e):this.next&&this.next.handleHoldPulse(t,e)},checkActivateEditor:function(t,e,i){var n=t.getBehavior(),o=n.getHeaderRowCount(),r=n.getHeaderColumnCount(),s=e.gridCell,l=t.isFilterRow(s.y),a=i&&s.x>=r&&(l||s.y>=o);return a}});e.exports=o},{"./Feature.js":67}],60:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("CellSelection",{alias:"CellSelection",currentDrag:null,lastDragCell:null,sbLastAuto:0,sbAutoStart:0,handleMouseUp:function(t,e){this.dragging&&(this.dragging=!1),this.next&&this.next.handleMouseUp(t,e)},handleMouseDown:function(t,e){var i=e.primitiveEvent.detail.isRightClick,n=t.getBehavior(),o=e.gridCell,r=e.viewPoint,s=o.x,l=o.y,a=n.getHeaderRowCount(),u=n.getHeaderColumnCount(),c=n.getColumnCount(),h=r.x>=c,d=a>l||u>s;if(!t.isCellSelection()||i||d||h)this.next&&this.next.handleMouseDown(t,e);else{var g=t.getFixedColumnCount(),f=t.getFixedRowCount();r.xn.origin.x+n.extent.x&&(o=1),this.currentDrag.y>n.origin.y+n.extent.y&&(r=1);var c=o,h=r;a&&(c=0),u&&(h=0),this.lastDragCell=i.plusXY(c,h),t.scrollBy(o,r),this.handleMouseDragCellSelection(t,i,[]),t.repaint(),setTimeout(this.scrollDrag.bind(this,t),25)}},extendSelection:function(t,e,i){var n=-1!==i.indexOf("CTRL"),o=-1!==i.indexOf("SHIFT"),r=t.getMouseDown(),s=e.x,l=e.y;if(!(0>s||0>l)){if(s===r.x&&l===r.y)return t.clearMostRecentSelection(),t.popMouseDown(),void t.repaint();n||o||t.clearSelections(),o?(t.clearMostRecentSelection(),t.select(r.x,r.y,s-r.x+1,l-r.y+1),t.setDragExtent(t.newPoint(s-r.x+1,l-r.y))):(t.select(s,l,0,0),t.setMouseDown(t.newPoint(s,l)),t.setDragExtent(t.newPoint(0,0))),t.repaint()}},handleDOWNSHIFT:function(t){this.moveShiftSelect(t,0,1)},handleUPSHIFT:function(t){this.moveShiftSelect(t,0,-1)},handleLEFTSHIFT:function(t){this.moveShiftSelect(t,-1,0)},handleRIGHTSHIFT:function(t){this.moveShiftSelect(t,1,0)},handleDOWN:function(t,e){e.primitiveEvent.preventDefault();var i=this.getAutoScrollAcceleration();this.moveSingleSelect(t,0,i)},handleUP:function(t,e){e.primitiveEvent.preventDefault();var i=this.getAutoScrollAcceleration();this.moveSingleSelect(t,0,-i)},handleLEFT:function(t){this.moveSingleSelect(t,-1,0)},handleRIGHT:function(t){this.moveSingleSelect(t,1,0)},getAutoScrollAcceleration:function(){var t=1,e=this.getAutoScrollDuration()/2e3;return t=Math.max(1,Math.floor(e*e*e*e))},setAutoScrollStartTime:function(){this.sbAutoStart=Date.now()},pingAutoScroll:function(){var t=Date.now();t-this.sbLastAuto>500&&this.setAutoScrollStartTime(),this.sbLastAuto=Date.now()},getAutoScrollDuration:function(){return Date.now()-this.sbLastAuto>500?0:Date.now()-this.sbAutoStart},moveShiftSelect:function(t,e,i){var n=t.getColumnCount()-1,o=t.getRowCount()-1,r=t.getVisibleColumns()-1,s=t.getVisibleRows()-1;t.resolveProperty("scrollingEnabled")||(n=Math.min(n,r),o=Math.min(o,s));var l=t.getMouseDown(),a=t.getDragExtent(),u=a.x+e,c=a.y+i;u=Math.min(n-l.x,Math.max(-l.x,u)),c=Math.min(o-l.y,Math.max(-l.y,c)),t.clearMostRecentSelection(),t.select(l.x,l.y,u,c),t.setDragExtent(t.newPoint(u,c)),t.insureModelColIsVisible(u+l.x,e)&&this.pingAutoScroll(),t.insureModelRowIsVisible(c+l.y,i)&&this.pingAutoScroll(),t.repaint()},moveSingleSelect:function(t,e,i){var n=t.getColumnCount()-1,o=t.getRowCount()-1,r=t.getVisibleColumnsCount()-1,s=t.getVisibleRowsCount()-1,l=t.getHeaderRowCount(),a=t.getHeaderColumnCount();t.resolveProperty("scrollingEnabled")||(n=Math.min(n,r),o=Math.min(o,s));var u=t.getMouseDown().plus(t.getDragExtent()),c=u.x+e,h=u.y+i;c=Math.min(n,Math.max(a,c)),h=Math.min(o,Math.max(l,h)),t.clearSelections(),t.select(c,h,0,0),t.setMouseDown(t.newPoint(c,h)),t.setDragExtent(t.newPoint(0,0)),t.insureModelColIsVisible(c,e)&&this.pingAutoScroll(),t.insureModelRowIsVisible(h,i)&&this.pingAutoScroll(),t.repaint()}});e.exports=o},{"./Feature.js":67}],61:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnAutosizing",{alias:"ColumnAutosizing",handleDoubleClick:function(t,e){var i=t.getHeaderRowCount(),n=e.gridCell;n.y<=i?t.autosizeColumn(n.x):this.next&&this.next.handleDoubleClick(t,e)}});e.exports=o},{"./Feature.js":67}],62:[function(t,e,i){"use strict";var n,o,r,s,l=t("./Feature.js"),a=150,u=l.extend("ColumnMoving",{alias:"ColumnMoving",floaterAnimationQueue:[],columnDragAutoScrollingRight:!1,columnDragAutoScrollingLeft:!1,dragArmed:!1,dragging:!1,dragCol:-1,dragOffset:0,initializeOn:function(t){this.isFloatingNow=!1,this.initializeAnimationSupport(t),this.next&&this.next.initializeOn(t)},initializeAnimationSupport:function(t){n||(n=document.createElement("canvas"),n.setAttribute("width","0px"),n.setAttribute("height","0px"),document.body.appendChild(n),o=n.getContext("2d")),r||(r=document.createElement("canvas"),r.setAttribute("width","0px"),r.setAttribute("height","0px"),document.body.appendChild(r),s=r.getContext("2d"))},getCanDragCursorName:function(){return"-webkit-grab"},getDraggingCursorName:function(){return"-webkit-grabbing"},handleMouseDrag:function(t,e){var i,n=e.gridCell,o=Math.abs(e.primitiveEvent.detail.dragstart.x-e.primitiveEvent.detail.mouse.x);return 10>o?void(this.next&&this.next.handleMouseDrag(t,e)):(this.isHeaderRow(t,e)&&this.dragArmed&&!this.dragging?(this.dragging=!0,this.dragCol=n.x,this.dragOffset=e.mousePoint.x,this.detachChain(),i=e.primitiveEvent.detail.mouse.x-this.dragOffset,this.createDragColumn(t,i,this.dragCol)):this.next&&this.next.handleMouseDrag(t,e),void(this.dragging&&(i=e.primitiveEvent.detail.mouse.x-this.dragOffset,this.dragColumn(t,i))))},handleMouseDown:function(t,e){t.getBehavior().isColumnReorderable()&&this.isHeaderRow(t,e)&&-1!==e.gridCell.x&&(this.dragArmed=!0,this.cursor=this.getDraggingCursorName(),t.clearSelections()),this.next&&this.next.handleMouseDown(t,e)},handleMouseUp:function(t,e){if(this.dragging){this.cursor=null;var i=this;this.endDragColumn(t),setTimeout(function(){i.attachChain()},200)}this.dragCol=-1,this.dragging=!1,this.dragArmed=!1,this.cursor=null,t.repaint(),this.next&&this.next.handleMouseUp(t,e)},handleMouseMove:function(t,e){!this.dragging&&e.mousePoint.y<5&&0===e.viewPoint.y?this.cursor=this.getCanDragCursorName():this.cursor=null,this.next&&this.next.handleMouseMove(t,e),this.isHeaderRow(t,e)&&this.dragging&&(this.cursor=this.getDraggingCursorName())},floatColumnTo:function(t,e){this.floatingNow=!0;var i,n,o=t.getRenderer(),r=o.getColumnEdges(),s=t.getHScrollValue(),l=t.renderOverridesCache.floater.columnIndex,a=t.renderOverridesCache.dragger.columnIndex,u=t.renderOverridesCache.dragger.hdpiratio,c=t.getFixedColumnCount(),h=t.getColumnWidth(a),d=t.getColumnWidth(l),g=t.getVisibleColumnsCount(),f=0,p=0;a>=c&&(f=s),l>=c&&(p=s),e?(i=r[Math.min(g,a-f)],n=r[Math.min(g,l-p)],t.renderOverridesCache.dragger.startX=(i+d)*u,t.renderOverridesCache.floater.startX=i*u):(n=r[Math.min(g,l-p)],i=n+h,t.renderOverridesCache.dragger.startX=n*u,t.renderOverridesCache.floater.startX=i*u),t.swapColumns(a,l),t.renderOverridesCache.dragger.columnIndex=l,t.renderOverridesCache.floater.columnIndex=a,this.floaterAnimationQueue.unshift(this.doColumnMoveAnimation(t,n,i)),this.doFloaterAnimation(t)},doColumnMoveAnimation:function(t,e,i){var n=this;return function(){var o=r;o.style.display="inline",n.setCrossBrowserProperty(o,"transform","translate("+e+"px, 0px)"),requestAnimationFrame(function(){n.setCrossBrowserProperty(o,"transition",(n.isWebkit?"-webkit-":"")+"transform "+a+"ms ease"),n.setCrossBrowserProperty(o,"transform","translate("+i+"px, -2px)")}),t.repaint(),setTimeout(function(){n.setCrossBrowserProperty(o,"transition",""),t.renderOverridesCache.floater=null,t.repaint(),n.doFloaterAnimation(t),requestAnimationFrame(function(){o.style.display="none",n.isFloatingNow=!1})},a+50)}},doFloaterAnimation:function(t){if(0===this.floaterAnimationQueue.length)return this.floatingNow=!1,void t.repaint();var e=this.floaterAnimationQueue.pop();e()},createFloatColumn:function(t,e){var i=t.getFixedColumnCount(),n=t.getHScrollValue();i>e&&(n=0);var o=t.getRenderer(),l=o.getColumnEdges(),a=t.getColumnWidth(e),u=t.div.clientHeight,c=r,h=c.style,d=t.div.getBoundingClientRect();h.top=d.top-2+"px",h.left=d.left+"px",h.position="fixed";var g=t.getHiDPI(s);c.setAttribute("width",Math.round(a*g)+"px"),c.setAttribute("height",Math.round(u*g)+"px"),h.boxShadow="0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)",h.width=a+"px",h.height=u+"px",h.borderTop="1px solid "+o.resolveProperty("lineColor"),h.backgroundColor=o.resolveProperty("backgroundColor");var f=l[e-n];f*=g,s.scale(g,g),t.renderOverridesCache.floater={columnIndex:e,ctx:s,startX:f,width:a,height:u,hdpiratio:g},h.zIndex="4",this.setCrossBrowserProperty(c,"transform","translate("+f+"px, -2px)"),h.cursor=this.getDraggingCursorName(),t.repaint()},setCrossBrowserProperty:function(t,e,i){var n=e[0].toUpperCase()+e.substr(1);this.setProp(t,"webkit"+n,i),this.setProp(t,"Moz"+n,i),this.setProp(t,"ms"+n,i),this.setProp(t,"O"+n,i),this.setProp(t,e,i)},setProp:function(t,e,i){e in t.style&&(t.style[e]=i)},createDragColumn:function(t,e,i){var r=t.getFixedColumnCount(),s=t.getHScrollValue();r>i&&(s=0);var l=t.getRenderer(),a=l.getColumnEdges(),u=t.getHiDPI(o),c=t.getColumnWidth(i),h=t.div.clientHeight,d=n,g=t.div.getBoundingClientRect(),f=d.style;f.top=g.top+"px",f.left=g.left+"px",f.position="fixed",f.opacity=.85,f.boxShadow="0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22)",f.borderTop="1px solid "+l.resolveProperty("lineColor"),f.backgroundColor=t.renderer.resolveProperty("backgroundColor"),d.setAttribute("width",Math.round(c*u)+"px"),d.setAttribute("height",Math.round(h*u)+"px"),f.width=c+"px",f.height=h+"px";var p=a[i-s];p*=u,o.scale(u,u),t.renderOverridesCache.dragger={columnIndex:i,ctx:o,startX:p,width:c,height:h,hdpiratio:u},this.setCrossBrowserProperty(d,"transform","translate("+e+"px, -5px)"),f.zIndex="5",f.cursor=this.getDraggingCursorName(),t.repaint()},dragColumn:function(t,e){var i=this,r=this.columnDragAutoScrollingRight||this.columnDragAutoScrollingLeft,s=t.getHiDPI(o),l=t.renderOverridesCache.dragger.columnIndex,u=t.renderOverridesCache.dragger.width,c=0,h=t.renderer.getFinalVisableColumnBoundary()-u;e=Math.min(e,h+15),e=Math.max(c-15,e);var d=c>e&&0!==l,g=e>h,f=n;this.setCrossBrowserProperty(f,"transition",(i.isWebkit?"-webkit-":"")+"transform 0ms ease, box-shadow "+a+"ms ease"),this.setCrossBrowserProperty(f,"transform","translate("+e+"px, -10px)"),requestAnimationFrame(function(){f.style.display="inline"});var p=t.renderer.getColumnFromPixelX(e+f.width/2/s);d&&(p=0),g&&(p=t.getColumnCount()-1);var v=l>p;if(v=v||p-l>=1,!v||g||r){if(c-10>e&&this.checkAutoScrollToLeft(t,e),e>c-10&&(this.columnDragAutoScrollingLeft=!1),g||e>h+10)return void this.checkAutoScrollToRight(t,e);h+10>e&&(this.columnDragAutoScrollingRight=!1)}else{var m=p>l;if(this.isFloatingNow)return;this.isFloatingNow=!0,this.createFloatColumn(t,p),this.floatColumnTo(t,m)}},checkAutoScrollToRight:function(t,e){this.columnDragAutoScrollingRight||(this.columnDragAutoScrollingRight=!0,this._checkAutoScrollToRight(t,e))},_checkAutoScrollToRight:function(t,e){if(this.columnDragAutoScrollingRight){var i=t.getHScrollValue();if(t.dragging&&!(i>t.sbHScrollConfig.rangeStop-2)){var n=t.renderOverridesCache.dragger.columnIndex;t.scrollBy(1,0);var o=n+1;console.log(o,n),t.swapColumns(o,n),t.renderOverridesCache.dragger.columnIndex=o,setTimeout(this._checkAutoScrollToRight.bind(this,t,e),250)}}},checkAutoScrollToLeft:function(t,e){this.columnDragAutoScrollingLeft||(this.columnDragAutoScrollingLeft=!0,this._checkAutoScrollToLeft(t,e))},_checkAutoScrollToLeft:function(t,e){if(this.columnDragAutoScrollingLeft){var i=t.getHScrollValue();if(t.dragging&&!(1>i)){var n=t.renderOverridesCache.dragger.columnIndex;t.swapColumns(n+i,n+i-1),t.scrollBy(-1,0),setTimeout(this._checkAutoScrollToLeft.bind(this,t,e),250)}}},endDragColumn:function(t){var e=t.getFixedColumnCount(),i=t.getHScrollValue(),o=t.renderOverridesCache.dragger.columnIndex;e>o&&(i=0);var r=t.getRenderer(),s=r.getColumnEdges(),l=this,u=s[o-i],c=n;l.setCrossBrowserProperty(c,"transition",(l.isWebkit?"-webkit-":"")+"transform "+a+"ms ease, box-shadow "+a+"ms ease"),l.setCrossBrowserProperty(c,"transform","translate("+u+"px, -1px)"),c.style.boxShadow="0px 0px 0px #888888",setTimeout(function(){t.renderOverridesCache.dragger=null,t.repaint(),requestAnimationFrame(function(){c.style.display="none",t.endDragColumnNotification()})},a+50)},isHeaderRow:function(t,e){var i=e.viewPoint,n=0===i.y;return n}});e.exports=u},{"./Feature.js":67}],63:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnPicker",{alias:"ColumnPicker",handleKeyUp:function(t,e){var i=e.detail["char"].toLowerCase(),n=t.resolveProperty("editorActivationKeys");n.indexOf(i)>-1&&t.toggleColumnPicker()}});e.exports=o},{"./Feature.js":67}],64:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnResizing",{alias:"ColumnResizing",dragIndex:-2,dragStart:-1,dragIndexStartingSize:-1,getMouseValue:function(t){return t.primitiveEvent.detail.mouse.x},getGridCellValue:function(t){return t.y},getScrollValue:function(t){return t.getHScrollValue()},getAreaSize:function(t,e){ -return t.getColumnWidth(e)},setAreaSize:function(t,e,i){t.setColumnWidth(e,i)},getPreviousAbsoluteSize:function(t,e){return t.getRenderedWidth(e)},overAreaDivider:function(t,e){return t.overColumnDivider(e)},isFirstFixedOtherArea:function(t,e){return this.isFirstFixedRow(t,e)},getCursorName:function(){return"col-resize"},handleMouseDrag:function(t,e){if(this.dragIndex>-2){var i=this.getMouseValue(e),n=this.getScrollValue(t);this.dragIndex-1&&this.isFirstFixedOtherArea(t,e)){var o=this.getScrollValue(t);n-2){this.cursor=null,this.dragIndex=-2,e.primitiveEvent.stopPropagation();var n=this;t.synchronizeScrollingBoundries(),setTimeout(function(){n.attachChain()},200)}else this.next&&this.next.handleMouseUp(t,e)},handleMouseMove:function(t,e){this.dragIndex>-2||(this.cursor=null,this.next&&this.next.handleMouseMove(t,e),this.checkForAreaResizeCursorChange(t,e))},checkForAreaResizeCursorChange:function(t,e){var i=this.isEnabled(t);i&&this.overAreaDivider(t,e)>-1&&this.isFirstFixedOtherArea(t,e)?this.cursor=this.getCursorName():this.cursor=null},getFixedAreaCount:function(t){var e=t.getFixedColumnCount()+(t.isShowRowNumbers()?1:0)+(t.hasHierarchyColumn()?1:0);return e},handleDoubleClick:function(t,e){var i=this.isEnabled(t),n=this.overAreaDivider(t,e)>-1,o=t.getHeaderRowCount(),r=e.gridCell;i&&n&&r.y<=o?t.autosizeColumn(r.x-1):this.next&&this.next.handleDoubleClick(t,e)},isEnabled:function(t){return!0}});e.exports=o},{"./Feature.js":67}],65:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnSelection",{alias:"ColumnSelection",currentDrag:null,lastDragCell:null,sbLastAuto:0,sbAutoStart:0,handleMouseUp:function(t,e){return this.dragging&&(this.dragging=!1),this.next?void this.next.handleMouseUp(t,e):void 0},handleMouseDown:function(t,e){if((!t.isColumnSelection()||e.mousePoint.y<5)&&this.next)return void this.next.handleMouseDown(t,e);var i=e.primitiveEvent.detail.isRightClick,n=e.gridCell,o=e.viewPoint,r=n.x,s=n.y,l=t.isShowHeaderRow()&&0===s&&-1!==r;if(i||!l)this.next&&this.next.handleMouseDown(t,e);else{var a=t.getFixedColumnCount();o.xi.origin.x+i.extent.x&&(n=1);var u=n,c=o;l&&(u=0),a&&(c=0),this.lastDragCell=e.plusXY(u,c),t.scrollBy(n,o),this.handleMouseDragCellSelection(t,e,[]),t.repaint(),setTimeout(this.scrollDrag.bind(this,t),25)}},extendSelection:function(t,e,i){t.stopEditing();var n=-1!==i.indexOf("SHIFT"),o=t.getMouseDown(),r=e.x,s=e.y;0>r||0>s||(n?(t.clearMostRecentColumnSelection(),t.selectColumn(r,o.x),t.setDragExtent(t.newPoint(r-o.x,0))):(t.toggleSelectColumn(r,i),t.setMouseDown(t.newPoint(r,s)),t.setDragExtent(t.newPoint(0,0))),t.repaint())},handleDOWNSHIFT:function(t){},handleUPSHIFT:function(t){},handleLEFTSHIFT:function(t){this.moveShiftSelect(t,-1)},handleRIGHTSHIFT:function(t){this.moveShiftSelect(t,1)},handleDOWN:function(t){},handleUP:function(t){},handleLEFT:function(t){this.moveSingleSelect(t,-1)},handleRIGHT:function(t){this.moveSingleSelect(t,1)},getAutoScrollAcceleration:function(){var t=1,e=this.getAutoScrollDuration()/2e3;return t=Math.max(1,Math.floor(e*e*e*e))},setAutoScrollStartTime:function(){this.sbAutoStart=Date.now()},pingAutoScroll:function(){var t=Date.now();t-this.sbLastAuto>500&&this.setAutoScrollStartTime(),this.sbLastAuto=Date.now()},getAutoScrollDuration:function(){return Date.now()-this.sbLastAuto>500?0:Date.now()-this.sbAutoStart},moveShiftSelect:function(t,e){var i=t.getColumnCount()-1,n=t.getVisibleColumns()-1;t.resolveProperty("scrollingEnabled")||(i=Math.min(i,n));var o=t.getMouseDown(),r=t.getDragExtent(),s=r.x+e;s=Math.min(i-o.x,Math.max(-o.x,s)),t.clearMostRecentColumnSelection(),t.selectColumn(o.x,o.x+s),t.setDragExtent(t.newPoint(s,0)),t.insureModelColIsVisible(s+o.x,e)&&this.pingAutoScroll(),t.repaint()},moveSingleSelect:function(t,e){var i=t.getColumnCount()-1,n=t.getVisibleColumnsCount()-1;t.resolveProperty("scrollingEnabled")||(i=Math.min(i,n));var o=t.getMouseDown().plus(t.getDragExtent()),r=o.x+e;r=Math.min(i,Math.max(0,r)),t.clearSelections(),t.selectColumn(r),t.setMouseDown(t.newPoint(r,0)),t.setDragExtent(t.newPoint(0,0)),t.insureModelColIsVisible(r,e)&&this.pingAutoScroll(),t.repaint()},isColumnDragging:function(t){var e=t.lookupFeature("ColumnMoving");if(!e)return!1;var i=e.dragging&&!this.dragging;return i}});e.exports=o},{"./Feature.js":67}],66:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnSorting",{alias:"ColumnSorting",handleDoubleClick:function(t,e){var i=e.gridCell;if(t.isShowHeaderRow()&&0===i.y&&-1!==i.x){var n=e.primitiveEvent.detail.keys;t.toggleSort(i.x,n)}else this.next&&this.next.handleDoubleClick(t,e)},handleMouseMove:function(t,e){var i=e.gridCell.y;this.isFixedRow(t,e)&&1>i?this.cursor="pointer":this.cursor=null,this.next&&this.next.handleMouseMove(t,e)}});e.exports=o},{"./Feature.js":67}],67:[function(t,e,i){"use strict";var n=t("extend-me").Base,o=n.extend("Feature",{next:null,detached:null,cursor:null,currentHoverCell:null,setNext:function(t){this.next?this.next.setNext(t):(this.next=t,this.detached=t)},detachChain:function(){this.next=null},attachChain:function(){this.next=this.detached},handleMouseMove:function(t,e){this.next&&this.next.handleMouseMove(t,e)},handleMouseExit:function(t,e){this.next&&this.next.handleMouseExit(t,e)},handleMouseEnter:function(t,e){this.next&&this.next.handleMouseEnter(t,e)},handleMouseDown:function(t,e){this.next&&this.next.handleMouseDown(t,e)},handleMouseUp:function(t,e){this.next&&this.next.handleMouseUp(t,e)},handleKeyDown:function(t,e){this.next&&this.next.handleKeyDown(t,e)},handleKeyUp:function(t,e){this.next&&this.next.handleKeyUp(t,e)},handleWheelMoved:function(t,e){this.next&&this.next.handleWheelMoved(t,e)},handleDoubleClick:function(t,e){this.next&&this.next.handleDoubleClick(t,e)},handleHoldPulse:function(t,e){this.next&&this.next.handleHoldPulse(t,e)},handleTap:function(t,e){this.next&&this.next.handleTap(t,e)},handleMouseDrag:function(t,e){this.next&&this.next.handleMouseDrag(t,e)},handleContextMenu:function(t,e){this.next&&this.next.handleContextMenu(t,e)},moveSingleSelect:function(t,e,i){this.next&&this.next.moveSingleSelect(t,e,i)},isFixedRow:function(t,e){var i=e.viewPoint,n=i.yr;if(t.isRowSelection()&&!i&&l){var a=t.getFixedRowCount();o.yi.origin.y+i.extent.y&&(o=1);var u=n,c=o;l&&(u=0),a&&(c=0),this.lastDragCell=e.plusXY(u,c),t.scrollBy(n,o),this.handleMouseDragCellSelection(t,e,[]),t.repaint(),setTimeout(this.scrollDrag.bind(this,t),25)}},extendSelection:function(t,e,i){t.stopEditing();var n=-1!==i.indexOf("SHIFT"),o=t.getMouseDown(),r=e.x,s=e.y;0>r||0>s||(n?(t.clearMostRecentRowSelection(),t.selectRow(s,o.y),t.setDragExtent(t.newPoint(0,s-o.y))):(t.toggleSelectRow(s,i),t.setMouseDown(t.newPoint(r,s)),t.setDragExtent(t.newPoint(0,0))),t.repaint())},handleDOWNSHIFT:function(t){this.moveShiftSelect(t,1)},handleUPSHIFT:function(t){this.moveShiftSelect(t,-1)},handleLEFTSHIFT:function(t){},handleRIGHTSHIFT:function(t){},handleDOWN:function(t){this.moveSingleSelect(t,1)},handleUP:function(t){this.moveSingleSelect(t,-1)},handleLEFT:function(t){},handleRIGHT:function(t){var e=t.getMouseDown().plus(t.getDragExtent()),i=t.getColumnCount()-1,n=t.getHeaderColumnCount()+t.getHScrollValue(),o=e.y;n=Math.min(i,n),t.clearSelections(),t.select(n,o,0,0),t.setMouseDown(t.newPoint(n,o)),t.setDragExtent(t.newPoint(0,0)),t.repaint()},getAutoScrollAcceleration:function(){var t=1,e=this.getAutoScrollDuration()/2e3;return t=Math.max(1,Math.floor(e*e*e*e))},setAutoScrollStartTime:function(){this.sbAutoStart=Date.now()},pingAutoScroll:function(){var t=Date.now();t-this.sbLastAuto>500&&this.setAutoScrollStartTime(),this.sbLastAuto=Date.now()},getAutoScrollDuration:function(){return Date.now()-this.sbLastAuto>500?0:Date.now()-this.sbAutoStart},moveShiftSelect:function(t,e){var i=t.getRowCount()-1,n=t.getVisibleRows()-1;t.resolveProperty("scrollingEnabled")||(i=Math.min(i,n));var o=t.getMouseDown(),r=t.getDragExtent(),s=r.y+e;s=Math.min(i-o.y,Math.max(-o.y,s)),t.clearMostRecentRowSelection(),t.selectRow(o.y,o.y+s),t.setDragExtent(t.newPoint(0,s)),t.insureModelRowIsVisible(s+o.y,e)&&this.pingAutoScroll(),t.fireSyntheticRowSelectionChangedEvent(),t.repaint()},moveSingleSelect:function(t,e){var i=t.getRowCount()-1,n=t.getVisibleRowsCount()-1;t.resolveProperty("scrollingEnabled")||(i=Math.min(i,n));var o=t.getMouseDown().plus(t.getDragExtent()),r=o.y+e;r=Math.min(i,Math.max(0,r)),t.clearSelections(),t.selectRow(r),t.setMouseDown(t.newPoint(0,r)),t.setDragExtent(t.newPoint(0,0)),t.insureModelRowIsVisible(r,e)&&this.pingAutoScroll(),t.fireSyntheticRowSelectionChangedEvent(),t.repaint()},isSingleRowSelection:function(){return!0}});e.exports=o},{"./Feature.js":67}],73:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ThumbwheelScrolling",{alias:"ThumbwheelScrolling",handleWheelMoved:function(t,e){if(t.resolveProperty("scrollingEnabled")){var i=e.primitiveEvent,n=i.wheelDeltaY||-i.deltaY,o=i.wheelDeltaX||-i.deltaX;n>0?t.scrollBy(0,-1):-0>n?t.scrollBy(0,1):o>0?t.scrollBy(-1,0):-0>o&&t.scrollBy(1,0)}}});e.exports=o},{"./Feature.js":67}],74:[function(t,e,i){"use strict";e.exports={Feature:t("./Feature"),CellClick:t("./CellClick"),CellEditing:t("./CellEditing"),CellSelection:t("./CellSelection"),ColumnAutosizing:t("./ColumnAutosizing"),ColumnMoving:t("./ColumnMoving"),ColumnResizing:t("./ColumnResizing"),ColumnSelection:t("./ColumnSelection"),ColumnSorting:t("./ColumnSorting"),Filters:t("./Filters"),KeyPaging:t("./KeyPaging"),OnHover:t("./OnHover"),ColumnPicker:t("./ColumnPicker"),RowResizing:t("./RowResizing"),RowSelection:t("./RowSelection"),ThumbwheelScrolling:t("./ThumbwheelScrolling")}},{"./CellClick":58,"./CellEditing":59,"./CellSelection":60,"./ColumnAutosizing":61,"./ColumnMoving":62,"./ColumnPicker":63,"./ColumnResizing":64,"./ColumnSelection":65,"./ColumnSorting":66,"./Feature":67,"./Filters":68,"./KeyPaging":69,"./OnHover":70,"./RowResizing":71,"./RowSelection":72,"./ThumbwheelScrolling":73}],75:[function(t,e,i){"use strict";function n(t,e,i,n,r,s){t.fillStyle="#FFD500",t.fill(),t.strokeStyle=t.createPattern(o.caution,"repeat"),t.lineWidth=5,t.beginPath(),t.moveTo(i,n),t.lineTo(i+r,n),t.lineTo(i+r,n+s),t.lineTo(i,n+s),t.lineTo(i,n),t.stroke(),t.beginPath(),t.rect(i,n,r-2,s),t.clip(),t.fillStyle="#A00",t.textAlign="start",t.textBaseline="middle",t.font='bold 6pt "arial narrow", verdana, geneva',t.fillText(e,i+4,n+s/2+.5)}var o=t("../images");e.exports=n},{"../images":2}],76:[function(t,e,i){"use strict";function n(t,e){o(r[t],t,e)}var o=t("css-injector"),r={grid:["div#grid-container {"," position: relative;"," display: inline-block;"," -webkit-user-select: none;"," -moz-user-select: none;"," -ms-user-select: none;"," -o-user-select: none;"," user-select: none;"," overflow: hidden; }","visible { opacity: 0.75; }","hidden { opacity: 0.0; }","editor {"," position: absolute;"," display: none;"," border: solid 2px black;"," outline: 0;"," padding: 0;"," z-index: 1000; }"],"list-dragon":["div.dragon-list, li.dragon-pop {"," font-family: Roboto, sans-serif;"," text-transform: capitalize; }","div.dragon-list {"," position: absolute;"," top: 4%;"," left: 4%;"," height: 92%;"," width: 20%; }","div.dragon-list:nth-child(2) { left: 28%; }","div.dragon-list:nth-child(3) { left: 52%; }","div.dragon-list:nth-child(4) { left: 76%; }","div.dragon-list > div, div.dragon-list > ul > li, li.dragon-pop { line-height: 46px; }","div.dragon-list > ul { top: 46px; }","div.dragon-list > ul > li:not(:last-child)::before, li.dragon-pop::before {"," content: '\\2b24';"," color: #b6b6b6;"," font-size: 30px;"," margin: 8px 14px 8px 8px; }","li.dragon-pop { opacity:.8; }"]};e.exports=n},{"css-injector":3}]},{},[57]); \ No newline at end of file +l.x=l.x-a,n.openFrom(l);var u=i.getComplexFilter(t.x);u&&r.setState(u.state),setTimeout(function(){r.onShow&&r.onShow(n)},n.getAnimationTime()+10)}}});e.exports=o},{"./CellEditor":44}],49:[function(t,e,i){"use strict";var n=t("./CellEditor.js"),o=n.extend("Simple",{input:null,alias:"simple",initialize:function(){this.editorPoint={x:0,y:0}},initializeInput:function(t){var e=this;t.addEventListener("keyup",function(t){!t||13!==t.keyCode&&27!==t.keyCode&&8!==t.keyCode||(t.preventDefault(),8===t.keyCode?e.clearStopEditing():27===t.keyCode?e.cancelEditing():e.stopEditing(),e.getGrid().repaint(),e.getGrid().takeFocus()),e.getGrid().fireSyntheticEditorKeyUpEvent(e,t)}),t.addEventListener("keydown",function(t){e.getGrid().fireSyntheticEditorKeyDownEvent(e,t)}),t.addEventListener("keypress",function(t){console.log("keypress",t.keyCode),e.getGrid().fireSyntheticEditorKeyPressEvent(e,t)}),t.style.position="absolute",t.style.display="none",t.style.border="solid 2px black",t.style.outline=0,t.style.padding=0,t.style.zIndex=1e3,t.style.boxShadow="white 0px 0px 1px 1px"},getEditorValue:function(){var t=this.getInput().value;return t},setEditorValue:function(t){this.getInput().value=t+""},clearStopEditing:function(){this.setEditorValue(""),this.stopEditing()},cancelEditing:function(){this.isEditing&&(this.getInput().value=null,this.isEditing=!1,this.hideEditor())},showEditor:function(){this.getInput().style.display="inline"},hideEditor:function(){this.getInput().style.display="none"},takeFocus:function(){var t=this;setTimeout(function(){t.input.focus(),t.selectAll()},300)},selectAll:function(){},originOffset:function(){return[0,0]},setBounds:function(t){var e=this.originOffset(),i="translate("+(t.x-1+e[0])+"px,"+(t.y-1+e[1])+"px)",n=this.getInput();n.style.boxSizing="border-box",n.style.webkitTransform=i,n.style.MozTransform=i,n.style.msTransform=i,n.style.OTransform=i,n.style.width=t.width+2+"px",n.style.height=t.height+2+"px"},saveEditorValue:function(){var t=this.getEditorPoint(),e=this.getEditorValue();if(e!==this.initialValue){parseFloat(this.initialValue)===this.initialValue&&(e=parseFloat(e));var i=this.getGrid().fireBeforeCellEdit(t,this.initialValue,e,this);i&&(this.getBehavior().setValue(t.x,t.y,e),this.getGrid().fireAfterCellEdit(t,this.initialValue,e,this))}},_moveEditor:function(){var t=this.getGrid(),e=this.getEditorPoint(),i=t._getBoundsOfCell(e.x,e.y),n=t.div.getBoundingClientRect().left-t.divCanvas.getBoundingClientRect().left;i.x=i.x-n,this.setBounds(i)},moveEditor:function(){this._moveEditor(),this.takeFocus()},beginEditAt:function(t){this.isAdded||(this.isAdded=!0,this.grid.div.appendChild(this.getInput())),this.setEditorPoint(t);var e=this.getBehavior(),i=e.getValue(t.x,t.y);"Array"===i.constructor.name&&(i=i[1]);var n=this.grid.fireRequestCellEdit(t,i);n&&(this.initialValue=i,this.setEditorValue(i),this.isEditing=!0,this.setCheckEditorPositionFlag(),this.checkEditor())},checkEditor:function(){if(this.checkEditorPositionFlag&&(this.checkEditorPositionFlag=!1,this.isEditing)){var t=this.getEditorPoint();this.grid.isDataVisible(t.x,t.y)?(this.moveEditor(),this.showEditor()):this.hideEditor()}},getInput:function(){return this.input||(this.input=this.getDefaultInput()),this.input},getDefaultInput:function(){var t=document.createElement("DIV");t.innerHTML=this.getHTML();var e=t.firstChild;return this.initializeInput(e),e},updateView:function(){var t=this.getInput(),e=t.parentNode,i=this.getDefaultInput();this.input=i,e.replaceChild(i,t)},showDropdown:function(t){var e;e=document.createEvent("MouseEvents"),e.initMouseEvent("mousedown",!0,!0,window),t.dispatchEvent(e)}});e.exports=o},{"./CellEditor.js":44}],50:[function(t,e,i){"use strict";var n=t("./Simple"),o=n.extend("Slider",{alias:"slider",template:function(){}});e.exports=o},{"./Simple":49}],51:[function(t,e,i){"use strict";var n=t("./Simple"),o=n.extend("Spinner",{alias:"spinner",template:function(){}});e.exports=o},{"./Simple":49}],52:[function(t,e,i){"use strict";var n=t("./Simple"),o=n.extend("Textfield",{alias:"textfield",template:function(){},selectAll:function(){this.input.setSelectionRange(0,this.input.value.length)}});e.exports=o},{"./Simple":49}],53:[function(t,e,i){"use strict";e.exports={CellEditor:t("./CellEditor"),Textfield:t("./Textfield"),Choice:t("./Choice"),Color:t("./Color"),Date:t("./Date"),Slider:t("./Slider"),Spinner:t("./Spinner"),Filter:t("./Filter")}},{"./CellEditor":44,"./Choice":45,"./Color":46,"./Date":47,"./Filter":48,"./Slider":50,"./Spinner":51,"./Textfield":52}],54:[function(t,e,i){"use strict";var n=t("extend-me").Base,o="A".charCodeAt(0),r=n.extend("DataModel",{next:null,grid:null,setGrid:function(t){this.grid=t},getGrid:function(){return this.grid},getBehavior:function(){return this.getGrid().getBehavior()},changed:function(){this.getBehavior().changed()},getPrivateState:function(){return this.getGrid().getPrivateState()},applyState:function(){},alphaFor:function(t){var e=Math.floor(t/26),i=t%26,n="";return e>0&&(n+=this.alpha(e-1)),n+=this.alpha(i)},alpha:function(t){return String.fromCharCode(o+t)},getCellEditorAt:function(t,e){}});e.exports=r},{"extend-me":4}],55:[function(t,e,i){"use strict";function n(t){return"function"==typeof t?t():t}function o(t){return function(e){return e=n(e),(e+"").toLowerCase().search(t.toLowerCase())>-1}}var r=t("hyper-analytics"),s=t("./DataModel"),l=t("../../images"),a="▲",u="▼",c={isNullObject:function(){return!0},getFields:function(){return[]},getHeaders:function(){return[]},getColumnCount:function(){return 0},getRowCount:function(){return 0},getAggregateTotals:function(){return[]},hasAggregates:function(){return!1},hasGroups:function(){return!1},getRow:function(){return null}},h=s.extend("dataModels.JSON",{source:c,preglobalfilter:c,prefilter:c,presorter:c,analytics:c,postfilter:c,postsorter:c,topTotals:[],bottomTotals:[],hasAggregates:function(){return this.analytics.hasAggregates()},hasGroups:function(){return this.analytics.hasGroups()},getDataSource:function(){return this.analytics},getFilterSource:function(){return this.prefilter},getSortingSource:function(){return this.presorter},getData:function(){return this.source.data},getValue:function(t,e){var i,n=this.hasHierarchyColumn(),o=this.getGrid(),r=o.getHeaderRowCount();return n&&-2===t&&(t=0),r>e?i=this.getHeaderRowValue(t,e):(n&&(e+=1),i=this.getDataSource().getValue(t,e-r))},getHeaderRowValue:function(t,e){var i;if(void 0===e)i=this.getHeaders()[Math.max(t,0)];else if(0>e){var n=this.getBottomTotals();i=n[n.length+e][t]}else{var o=this.getGrid(),r=o.isShowFilterRow(),s=o.isShowHeaderRow(),a=(r?1:0)+(s?1:0);if(e>=a)i=this.getTopTotals()[e-a][t];else{if(!s||0!==e){i=this.getFilter(t);var u=l.filter(i.length);return[null,i,u]}i=this.getHeaders()[t];var c=this.getSortImageForColumn(t);c&&(i=c+i)}}return i},setValue:function(t,e,i){var n=this.hasHierarchyColumn(),o=this.getGrid(),r=o.getHeaderRowCount();if(n){if(-2===t)return;t+=1}r>e?this.setHeaderRowValue(t,e,i):n?e+=1:this.getDataSource().setValue(t,e-r,i),this.changed()},setHeaderRowValue:function(t,e,i){if(void 0===i)return this._setHeader(t,e);var n=this.getGrid(),o=n.isShowFilterRow(),r=n.isShowHeaderRow(),s=o&&r,l=(o?1:0)+(r?1:0);if(e>=l)this.getTopTotals()[e-l][t]=i;else{if(-1===t)return;if(s){if(0===e)return this._setHeader(t,i);this.setFilter(t,i)}else{if(!o)return this._setHeader(t,i);this.setFilter(t,i)}}return""},getColumnProperties:function(t){var e=this.getBehavior().allColumns[t];return e?e.getProperties():void 0},getFilter:function(t){var e=this.getColumnProperties(t);return e?e.filter||"":""},getComplexFilter:function(t){var e=this.getColumnProperties(t);if(!e)return"";var i=e.complexFilter;if(i){var o=this.getGrid().resolveFilter(i.type);o.setState(i.state);var r=o.create();return function(t){var e=n(t);return r(e)}}},setFilter:function(t,e){var i=this.getColumnProperties(t);i.filter=e,this.applyAnalytics()},getColumnCount:function(){return this.analytics.getColumnCount()},getRowCount:function(){var t=this.getGrid(),e=this.getDataSource().getRowCount();return e+=t.getHeaderRowCount()},getHeaders:function(){return this.analytics.getHeaders()},setHeaders:function(t){this.getDataSource().setHeaders(t)},setFields:function(t){this.getDataSource().setFields(t)},getFields:function(){return this.getDataSource().getFields()},setData:function(t){this.source=new r.JSDataSource(t),this.preglobalfilter=new r.DataSourceGlobalFilter(this.source),this.prefilter=new r.DataSourceFilter(this.preglobalfilter),this.presorter=new r.DataSourceSorterComposite(this.prefilter),this.analytics=new r.DataSourceAggregator(this.presorter),this.applyAnalytics()},setTopTotals:function(t){this.topTotals=t},getTopTotals:function(){return this.hasAggregates()?this.getDataSource().getGrandTotals():this.topTotals},setBottomTotals:function(t){this.bottomTotals=t},getBottomTotals:function(){return this.hasAggregates()?this.getDataSource().getGrandTotals():this.bottomTotals},setGroups:function(t){this.analytics.setGroupBys(t),this.applyAnalytics(),this.getGrid().fireSyntheticGroupsChangedEvent(this.getGroups())},getGroups:function(){for(var t=this.getHeaders().slice(0),e=this.getFields().slice(0),i=this.analytics.groupBys,n=[],o=0;or;r++){var s=t[r].index,l=this.getFilter(s),a=this.getComplexFilter(s);a?i.add(s-n,a):l.length>0&&i.add(s-n,o(l))}i.applyAll()},toggleSort:function(t,e){this.incrementSortState(t,e),this.applyAnalytics()},incrementSortState:function(t,e){t++;var i=this.getPrivateState(),n=e.indexOf("CTRL")>-1;i.sorts=i.sorts||[];var o=i.sorts.indexOf(t);-1===o&&(o=i.sorts.indexOf(-1*t)),o>-1?i.sorts[o]>0?i.sorts[o]=-1*i.sorts[o]:i.sorts.splice(o,1):n||0===i.sorts.length?i.sorts.unshift(t):(i.sorts.length=0,i.sorts.unshift(t)),i.sorts.length>3&&(i.sorts.length=3)},applySorts:function(){var t=this.getSortingSource(),e=this.getPrivateState().sorts,i=this.hasAggregates()?1:0;if(e&&0!==e.length)for(var n=0;nn&&(n=i.indexOf(-1*t),e=!1),0>n)return null;var o=i.length-n,r=e?a:u;return o+r+" "},cellClicked:function(t,e){if(this.hasAggregates()&&0===e.gridCell.x){var i=this.getGrid(),n=i.getHeaderRowCount(),o=e.gridCell.y-n+1;this.analytics.click(o),this.changed()}},getRow:function(t){var e=this.getGrid(),i=e.getHeaderRowCount();if(i>t&&!this.hasAggregates()){var n=this.getTopTotals();return n[t-(i-n.length)]}return this.getDataSource().getRow(t-i)},buildRow:function(t){var e=this.getColumnCount(),i=[].concat(this.getFields()),n={};this.hasAggregates()&&(n.tree=this.getValue(-2,t),i.shift());for(var o=0;e>o;o++)n[i[o]]=this.getValue(o,t);return n},getComputedRow:function(t){for(var e=this.getRowContextFunction([t]),i=this.getFields(),n={},o=0;o=o&&i.x>=r?t.cellClicked(e):this.next&&this.next.handleTap(t,e)}});e.exports=o},{"./Feature.js":67}],59:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("CellEditing",{alias:"CellEditing",handleDoubleClick:function(t,e){var i=t.resolveProperty("editOnDoubleClick");this.checkActivateEditor(t,e,i)?t._activateEditor(e):this.next&&this.next.handleDoubleClick(t,e)},handleTap:function(t,e){var i=t.resolveProperty("editOnDoubleClick");this.checkActivateEditor(t,e,!i)?t._activateEditor(e):this.next&&this.next.handleTap(t,e)},handleHoldPulse:function(t,e){var i=t.resolveProperty("editOnDoubleClick");this.checkActivateEditor(t,e,!i)?t._activateEditor(e):this.next&&this.next.handleHoldPulse(t,e)},checkActivateEditor:function(t,e,i){var n=t.getBehavior(),o=n.getHeaderRowCount(),r=n.getHeaderColumnCount(),s=e.gridCell,l=t.isFilterRow(s.y),a=i&&s.x>=r&&(l||s.y>=o);return a}});e.exports=o},{"./Feature.js":67}],60:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("CellSelection",{alias:"CellSelection",currentDrag:null,lastDragCell:null,sbLastAuto:0,sbAutoStart:0,handleMouseUp:function(t,e){this.dragging&&(this.dragging=!1),this.next&&this.next.handleMouseUp(t,e)},handleMouseDown:function(t,e){var i=e.primitiveEvent.detail.isRightClick,n=t.getBehavior(),o=e.gridCell,r=e.viewPoint,s=o.x,l=o.y,a=n.getHeaderRowCount(),u=n.getHeaderColumnCount(),c=n.getColumnCount(),h=r.x>=c,d=a>l||u>s;if(!t.isCellSelection()||i||d||h)this.next&&this.next.handleMouseDown(t,e);else{var g=t.getFixedColumnCount(),f=t.getFixedRowCount();r.xn.origin.x+n.extent.x&&(o=1),this.currentDrag.y>n.origin.y+n.extent.y&&(r=1);var c=o,h=r;a&&(c=0),u&&(h=0),this.lastDragCell=i.plusXY(c,h),t.scrollBy(o,r),this.handleMouseDragCellSelection(t,i,[]),t.repaint(),setTimeout(this.scrollDrag.bind(this,t),25)}},extendSelection:function(t,e,i){var n=-1!==i.indexOf("CTRL"),o=-1!==i.indexOf("SHIFT"),r=t.getMouseDown(),s=e.x,l=e.y;if(!(0>s||0>l)){if(s===r.x&&l===r.y)return t.clearMostRecentSelection(),t.popMouseDown(),void t.repaint();n||o||t.clearSelections(),o?(t.clearMostRecentSelection(),t.select(r.x,r.y,s-r.x+1,l-r.y+1),t.setDragExtent(t.newPoint(s-r.x+1,l-r.y))):(t.select(s,l,0,0),t.setMouseDown(t.newPoint(s,l)),t.setDragExtent(t.newPoint(0,0))),t.repaint()}},handleDOWNSHIFT:function(t){this.moveShiftSelect(t,0,1)},handleUPSHIFT:function(t){this.moveShiftSelect(t,0,-1)},handleLEFTSHIFT:function(t){this.moveShiftSelect(t,-1,0)},handleRIGHTSHIFT:function(t){this.moveShiftSelect(t,1,0)},handleDOWN:function(t,e){e.primitiveEvent.preventDefault();var i=this.getAutoScrollAcceleration();this.moveSingleSelect(t,0,i)},handleUP:function(t,e){e.primitiveEvent.preventDefault();var i=this.getAutoScrollAcceleration();this.moveSingleSelect(t,0,-i)},handleLEFT:function(t){this.moveSingleSelect(t,-1,0)},handleRIGHT:function(t){this.moveSingleSelect(t,1,0)},getAutoScrollAcceleration:function(){var t=1,e=this.getAutoScrollDuration()/2e3;return t=Math.max(1,Math.floor(e*e*e*e))},setAutoScrollStartTime:function(){this.sbAutoStart=Date.now()},pingAutoScroll:function(){var t=Date.now();t-this.sbLastAuto>500&&this.setAutoScrollStartTime(),this.sbLastAuto=Date.now()},getAutoScrollDuration:function(){return Date.now()-this.sbLastAuto>500?0:Date.now()-this.sbAutoStart},moveShiftSelect:function(t,e,i){var n=t.getColumnCount()-1,o=t.getRowCount()-1,r=t.getVisibleColumns()-1,s=t.getVisibleRows()-1;t.resolveProperty("scrollingEnabled")||(n=Math.min(n,r),o=Math.min(o,s));var l=t.getMouseDown(),a=t.getDragExtent(),u=a.x+e,c=a.y+i;u=Math.min(n-l.x,Math.max(-l.x,u)),c=Math.min(o-l.y,Math.max(-l.y,c)),t.clearMostRecentSelection(),t.select(l.x,l.y,u,c),t.setDragExtent(t.newPoint(u,c)),t.insureModelColIsVisible(u+l.x,e)&&this.pingAutoScroll(),t.insureModelRowIsVisible(c+l.y,i)&&this.pingAutoScroll(),t.repaint()},moveSingleSelect:function(t,e,i){var n=t.getColumnCount()-1,o=t.getRowCount()-1,r=t.getVisibleColumnsCount()-1,s=t.getVisibleRowsCount()-1,l=t.getHeaderRowCount(),a=t.getHeaderColumnCount();t.resolveProperty("scrollingEnabled")||(n=Math.min(n,r),o=Math.min(o,s));var u=t.getMouseDown().plus(t.getDragExtent()),c=u.x+e,h=u.y+i;c=Math.min(n,Math.max(a,c)),h=Math.min(o,Math.max(l,h)),t.clearSelections(),t.select(c,h,0,0),t.setMouseDown(t.newPoint(c,h)),t.setDragExtent(t.newPoint(0,0)),t.insureModelColIsVisible(c,e)&&this.pingAutoScroll(),t.insureModelRowIsVisible(h,i)&&this.pingAutoScroll(),t.repaint()}});e.exports=o},{"./Feature.js":67}],61:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnAutosizing",{alias:"ColumnAutosizing",handleDoubleClick:function(t,e){var i=t.getHeaderRowCount(),n=e.gridCell;n.y<=i?t.autosizeColumn(n.x):this.next&&this.next.handleDoubleClick(t,e)}});e.exports=o},{"./Feature.js":67}],62:[function(t,e,i){"use strict";var n,o,r,s,l=t("./Feature.js"),a=150,u=l.extend("ColumnMoving",{alias:"ColumnMoving",floaterAnimationQueue:[],columnDragAutoScrollingRight:!1,columnDragAutoScrollingLeft:!1,dragArmed:!1,dragging:!1,dragCol:-1,dragOffset:0,initializeOn:function(t){this.isFloatingNow=!1,this.initializeAnimationSupport(t),this.next&&this.next.initializeOn(t)},initializeAnimationSupport:function(t){n||(n=document.createElement("canvas"),n.setAttribute("width","0px"),n.setAttribute("height","0px"),document.body.appendChild(n),o=n.getContext("2d")),r||(r=document.createElement("canvas"),r.setAttribute("width","0px"),r.setAttribute("height","0px"),document.body.appendChild(r),s=r.getContext("2d"))},getCanDragCursorName:function(){return"-webkit-grab"},getDraggingCursorName:function(){return"-webkit-grabbing"},handleMouseDrag:function(t,e){var i,n=e.gridCell,o=Math.abs(e.primitiveEvent.detail.dragstart.x-e.primitiveEvent.detail.mouse.x);return 10>o?void(this.next&&this.next.handleMouseDrag(t,e)):(this.isHeaderRow(t,e)&&this.dragArmed&&!this.dragging?(this.dragging=!0,this.dragCol=n.x,this.dragOffset=e.mousePoint.x,this.detachChain(),i=e.primitiveEvent.detail.mouse.x-this.dragOffset,this.createDragColumn(t,i,this.dragCol)):this.next&&this.next.handleMouseDrag(t,e),void(this.dragging&&(i=e.primitiveEvent.detail.mouse.x-this.dragOffset,this.dragColumn(t,i))))},handleMouseDown:function(t,e){t.getBehavior().isColumnReorderable()&&this.isHeaderRow(t,e)&&-1!==e.gridCell.x&&(this.dragArmed=!0,this.cursor=this.getDraggingCursorName(),t.clearSelections()),this.next&&this.next.handleMouseDown(t,e)},handleMouseUp:function(t,e){if(this.dragging){this.cursor=null;var i=this;this.endDragColumn(t),setTimeout(function(){i.attachChain()},200)}this.dragCol=-1,this.dragging=!1,this.dragArmed=!1,this.cursor=null,t.repaint(),this.next&&this.next.handleMouseUp(t,e)},handleMouseMove:function(t,e){!this.dragging&&e.mousePoint.y<5&&0===e.viewPoint.y?this.cursor=this.getCanDragCursorName():this.cursor=null,this.next&&this.next.handleMouseMove(t,e),this.isHeaderRow(t,e)&&this.dragging&&(this.cursor=this.getDraggingCursorName())},floatColumnTo:function(t,e){this.floatingNow=!0;var i,n,o=t.getRenderer(),r=o.getColumnEdges(),s=t.getHScrollValue(),l=t.renderOverridesCache.floater.columnIndex,a=t.renderOverridesCache.dragger.columnIndex,u=t.renderOverridesCache.dragger.hdpiratio,c=t.getFixedColumnCount(),h=t.getColumnWidth(a),d=t.getColumnWidth(l),g=t.getVisibleColumnsCount(),f=0,p=0;a>=c&&(f=s),l>=c&&(p=s),e?(i=r[Math.min(g,a-f)],n=r[Math.min(g,l-p)],t.renderOverridesCache.dragger.startX=(i+d)*u,t.renderOverridesCache.floater.startX=i*u):(n=r[Math.min(g,l-p)],i=n+h,t.renderOverridesCache.dragger.startX=n*u,t.renderOverridesCache.floater.startX=i*u),t.swapColumns(a,l),t.renderOverridesCache.dragger.columnIndex=l,t.renderOverridesCache.floater.columnIndex=a,this.floaterAnimationQueue.unshift(this.doColumnMoveAnimation(t,n,i)),this.doFloaterAnimation(t)},doColumnMoveAnimation:function(t,e,i){var n=this;return function(){var o=r;o.style.display="inline",n.setCrossBrowserProperty(o,"transform","translate("+e+"px, 0px)"),requestAnimationFrame(function(){n.setCrossBrowserProperty(o,"transition",(n.isWebkit?"-webkit-":"")+"transform "+a+"ms ease"),n.setCrossBrowserProperty(o,"transform","translate("+i+"px, -2px)")}),t.repaint(),setTimeout(function(){n.setCrossBrowserProperty(o,"transition",""),t.renderOverridesCache.floater=null,t.repaint(),n.doFloaterAnimation(t),requestAnimationFrame(function(){o.style.display="none",n.isFloatingNow=!1})},a+50)}},doFloaterAnimation:function(t){if(0===this.floaterAnimationQueue.length)return this.floatingNow=!1,void t.repaint();var e=this.floaterAnimationQueue.pop();e()},createFloatColumn:function(t,e){var i=t.getFixedColumnCount(),n=t.getHScrollValue();i>e&&(n=0);var o=t.getRenderer(),l=o.getColumnEdges(),a=t.getColumnWidth(e),u=t.div.clientHeight,c=r,h=c.style,d=t.div.getBoundingClientRect();h.top=d.top-2+"px",h.left=d.left+"px",h.position="fixed";var g=t.getHiDPI(s);c.setAttribute("width",Math.round(a*g)+"px"),c.setAttribute("height",Math.round(u*g)+"px"),h.boxShadow="0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)",h.width=a+"px",h.height=u+"px",h.borderTop="1px solid "+o.resolveProperty("lineColor"),h.backgroundColor=o.resolveProperty("backgroundColor");var f=l[e-n];f*=g,s.scale(g,g),t.renderOverridesCache.floater={columnIndex:e,ctx:s,startX:f,width:a,height:u,hdpiratio:g},h.zIndex="4",this.setCrossBrowserProperty(c,"transform","translate("+f+"px, -2px)"),h.cursor=this.getDraggingCursorName(),t.repaint()},setCrossBrowserProperty:function(t,e,i){var n=e[0].toUpperCase()+e.substr(1);this.setProp(t,"webkit"+n,i),this.setProp(t,"Moz"+n,i),this.setProp(t,"ms"+n,i),this.setProp(t,"O"+n,i),this.setProp(t,e,i)},setProp:function(t,e,i){e in t.style&&(t.style[e]=i)},createDragColumn:function(t,e,i){var r=t.getFixedColumnCount(),s=t.getHScrollValue();r>i&&(s=0);var l=t.getRenderer(),a=l.getColumnEdges(),u=t.getHiDPI(o),c=t.getColumnWidth(i),h=t.div.clientHeight,d=n,g=t.div.getBoundingClientRect(),f=d.style;f.top=g.top+"px",f.left=g.left+"px",f.position="fixed",f.opacity=.85,f.boxShadow="0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22)",f.borderTop="1px solid "+l.resolveProperty("lineColor"),f.backgroundColor=t.renderer.resolveProperty("backgroundColor"),d.setAttribute("width",Math.round(c*u)+"px"),d.setAttribute("height",Math.round(h*u)+"px"),f.width=c+"px",f.height=h+"px";var p=a[i-s];p*=u,o.scale(u,u),t.renderOverridesCache.dragger={columnIndex:i,ctx:o,startX:p,width:c,height:h,hdpiratio:u},this.setCrossBrowserProperty(d,"transform","translate("+e+"px, -5px)"),f.zIndex="5",f.cursor=this.getDraggingCursorName(),t.repaint()},dragColumn:function(t,e){var i=this,r=this.columnDragAutoScrollingRight||this.columnDragAutoScrollingLeft,s=t.getHiDPI(o),l=t.renderOverridesCache.dragger.columnIndex,u=t.renderOverridesCache.dragger.width,c=0,h=t.renderer.getFinalVisableColumnBoundary()-u;e=Math.min(e,h+15),e=Math.max(c-15,e);var d=c>e&&0!==l,g=e>h,f=n;this.setCrossBrowserProperty(f,"transition",(i.isWebkit?"-webkit-":"")+"transform 0ms ease, box-shadow "+a+"ms ease"),this.setCrossBrowserProperty(f,"transform","translate("+e+"px, -10px)"),requestAnimationFrame(function(){f.style.display="inline"});var p=t.renderer.getColumnFromPixelX(e+f.width/2/s);d&&(p=0),g&&(p=t.getColumnCount()-1);var v=l>p;if(v=v||p-l>=1,!v||g||r){if(c-10>e&&this.checkAutoScrollToLeft(t,e),e>c-10&&(this.columnDragAutoScrollingLeft=!1),g||e>h+10)return void this.checkAutoScrollToRight(t,e);h+10>e&&(this.columnDragAutoScrollingRight=!1)}else{var m=p>l;if(this.isFloatingNow)return;this.isFloatingNow=!0,this.createFloatColumn(t,p),this.floatColumnTo(t,m)}},checkAutoScrollToRight:function(t,e){this.columnDragAutoScrollingRight||(this.columnDragAutoScrollingRight=!0,this._checkAutoScrollToRight(t,e))},_checkAutoScrollToRight:function(t,e){if(this.columnDragAutoScrollingRight){var i=t.getHScrollValue();if(t.dragging&&!(i>t.sbHScrollConfig.rangeStop-2)){var n=t.renderOverridesCache.dragger.columnIndex;t.scrollBy(1,0);var o=n+1;console.log(o,n),t.swapColumns(o,n),t.renderOverridesCache.dragger.columnIndex=o,setTimeout(this._checkAutoScrollToRight.bind(this,t,e),250)}}},checkAutoScrollToLeft:function(t,e){this.columnDragAutoScrollingLeft||(this.columnDragAutoScrollingLeft=!0,this._checkAutoScrollToLeft(t,e))},_checkAutoScrollToLeft:function(t,e){if(this.columnDragAutoScrollingLeft){var i=t.getHScrollValue();if(t.dragging&&!(1>i)){var n=t.renderOverridesCache.dragger.columnIndex;t.swapColumns(n+i,n+i-1),t.scrollBy(-1,0),setTimeout(this._checkAutoScrollToLeft.bind(this,t,e),250)}}},endDragColumn:function(t){var e=t.getFixedColumnCount(),i=t.getHScrollValue(),o=t.renderOverridesCache.dragger.columnIndex;e>o&&(i=0);var r=t.getRenderer(),s=r.getColumnEdges(),l=this,u=s[o-i],c=n;l.setCrossBrowserProperty(c,"transition",(l.isWebkit?"-webkit-":"")+"transform "+a+"ms ease, box-shadow "+a+"ms ease"),l.setCrossBrowserProperty(c,"transform","translate("+u+"px, -1px)"),c.style.boxShadow="0px 0px 0px #888888",setTimeout(function(){t.renderOverridesCache.dragger=null,t.repaint(),requestAnimationFrame(function(){c.style.display="none",t.endDragColumnNotification()})},a+50)},isHeaderRow:function(t,e){var i=e.viewPoint,n=0===i.y;return n}});e.exports=u},{"./Feature.js":67}],63:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnPicker",{alias:"ColumnPicker",handleKeyUp:function(t,e){var i=e.detail["char"].toLowerCase(),n=t.resolveProperty("editorActivationKeys");n.indexOf(i)>-1&&t.toggleColumnPicker()}});e.exports=o},{"./Feature.js":67}],64:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnResizing",{alias:"ColumnResizing",dragIndex:-2,dragStart:-1,dragIndexStartingSize:-1,getMouseValue:function(t){return t.primitiveEvent.detail.mouse.x},getGridCellValue:function(t){return t.y},getScrollValue:function(t){return t.getHScrollValue()},getAreaSize:function(t,e){return t.getColumnWidth(e); +},setAreaSize:function(t,e,i){t.setColumnWidth(e,i)},getPreviousAbsoluteSize:function(t,e){return t.getRenderedWidth(e)},overAreaDivider:function(t,e){return t.overColumnDivider(e)},isFirstFixedOtherArea:function(t,e){return this.isFirstFixedRow(t,e)},getCursorName:function(){return"col-resize"},handleMouseDrag:function(t,e){if(this.dragIndex>-2){var i=this.getMouseValue(e),n=this.getScrollValue(t);this.dragIndex-1&&this.isFirstFixedOtherArea(t,e)){var o=this.getScrollValue(t);n-2){this.cursor=null,this.dragIndex=-2,e.primitiveEvent.stopPropagation();var n=this;t.synchronizeScrollingBoundries(),setTimeout(function(){n.attachChain()},200)}else this.next&&this.next.handleMouseUp(t,e)},handleMouseMove:function(t,e){this.dragIndex>-2||(this.cursor=null,this.next&&this.next.handleMouseMove(t,e),this.checkForAreaResizeCursorChange(t,e))},checkForAreaResizeCursorChange:function(t,e){var i=this.isEnabled(t);i&&this.overAreaDivider(t,e)>-1&&this.isFirstFixedOtherArea(t,e)?this.cursor=this.getCursorName():this.cursor=null},getFixedAreaCount:function(t){var e=t.getFixedColumnCount()+(t.isShowRowNumbers()?1:0)+(t.hasHierarchyColumn()?1:0);return e},handleDoubleClick:function(t,e){var i=this.isEnabled(t),n=this.overAreaDivider(t,e)>-1,o=t.getHeaderRowCount(),r=e.gridCell;i&&n&&r.y<=o?t.autosizeColumn(r.x-1):this.next&&this.next.handleDoubleClick(t,e)},isEnabled:function(t){return!0}});e.exports=o},{"./Feature.js":67}],65:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnSelection",{alias:"ColumnSelection",currentDrag:null,lastDragCell:null,sbLastAuto:0,sbAutoStart:0,handleMouseUp:function(t,e){return this.dragging&&(this.dragging=!1),this.next?void this.next.handleMouseUp(t,e):void 0},handleMouseDown:function(t,e){if((!t.isColumnSelection()||e.mousePoint.y<5)&&this.next)return void this.next.handleMouseDown(t,e);var i=e.primitiveEvent.detail.isRightClick,n=e.gridCell,o=e.viewPoint,r=n.x,s=n.y,l=t.isShowHeaderRow()&&0===s&&-1!==r;if(i||!l)this.next&&this.next.handleMouseDown(t,e);else{var a=t.getFixedColumnCount();o.xi.origin.x+i.extent.x&&(n=1);var u=n,c=o;l&&(u=0),a&&(c=0),this.lastDragCell=e.plusXY(u,c),t.scrollBy(n,o),this.handleMouseDragCellSelection(t,e,[]),t.repaint(),setTimeout(this.scrollDrag.bind(this,t),25)}},extendSelection:function(t,e,i){t.stopEditing();var n=-1!==i.indexOf("SHIFT"),o=t.getMouseDown(),r=e.x,s=e.y;0>r||0>s||(n?(t.clearMostRecentColumnSelection(),t.selectColumn(r,o.x),t.setDragExtent(t.newPoint(r-o.x,0))):(t.toggleSelectColumn(r,i),t.setMouseDown(t.newPoint(r,s)),t.setDragExtent(t.newPoint(0,0))),t.repaint())},handleDOWNSHIFT:function(t){},handleUPSHIFT:function(t){},handleLEFTSHIFT:function(t){this.moveShiftSelect(t,-1)},handleRIGHTSHIFT:function(t){this.moveShiftSelect(t,1)},handleDOWN:function(t){},handleUP:function(t){},handleLEFT:function(t){this.moveSingleSelect(t,-1)},handleRIGHT:function(t){this.moveSingleSelect(t,1)},getAutoScrollAcceleration:function(){var t=1,e=this.getAutoScrollDuration()/2e3;return t=Math.max(1,Math.floor(e*e*e*e))},setAutoScrollStartTime:function(){this.sbAutoStart=Date.now()},pingAutoScroll:function(){var t=Date.now();t-this.sbLastAuto>500&&this.setAutoScrollStartTime(),this.sbLastAuto=Date.now()},getAutoScrollDuration:function(){return Date.now()-this.sbLastAuto>500?0:Date.now()-this.sbAutoStart},moveShiftSelect:function(t,e){var i=t.getColumnCount()-1,n=t.getVisibleColumns()-1;t.resolveProperty("scrollingEnabled")||(i=Math.min(i,n));var o=t.getMouseDown(),r=t.getDragExtent(),s=r.x+e;s=Math.min(i-o.x,Math.max(-o.x,s)),t.clearMostRecentColumnSelection(),t.selectColumn(o.x,o.x+s),t.setDragExtent(t.newPoint(s,0)),t.insureModelColIsVisible(s+o.x,e)&&this.pingAutoScroll(),t.repaint()},moveSingleSelect:function(t,e){var i=t.getColumnCount()-1,n=t.getVisibleColumnsCount()-1;t.resolveProperty("scrollingEnabled")||(i=Math.min(i,n));var o=t.getMouseDown().plus(t.getDragExtent()),r=o.x+e;r=Math.min(i,Math.max(0,r)),t.clearSelections(),t.selectColumn(r),t.setMouseDown(t.newPoint(r,0)),t.setDragExtent(t.newPoint(0,0)),t.insureModelColIsVisible(r,e)&&this.pingAutoScroll(),t.repaint()},isColumnDragging:function(t){var e=t.lookupFeature("ColumnMoving");if(!e)return!1;var i=e.dragging&&!this.dragging;return i}});e.exports=o},{"./Feature.js":67}],66:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ColumnSorting",{alias:"ColumnSorting",handleDoubleClick:function(t,e){var i=e.gridCell;if(t.isShowHeaderRow()&&0===i.y&&-1!==i.x){var n=e.primitiveEvent.detail.keys;t.toggleSort(i.x,n)}else this.next&&this.next.handleDoubleClick(t,e)},handleMouseMove:function(t,e){var i=e.gridCell.y;this.isFixedRow(t,e)&&1>i?this.cursor="pointer":this.cursor=null,this.next&&this.next.handleMouseMove(t,e)}});e.exports=o},{"./Feature.js":67}],67:[function(t,e,i){"use strict";var n=t("extend-me").Base,o=n.extend("Feature",{next:null,detached:null,cursor:null,currentHoverCell:null,setNext:function(t){this.next?this.next.setNext(t):(this.next=t,this.detached=t)},detachChain:function(){this.next=null},attachChain:function(){this.next=this.detached},handleMouseMove:function(t,e){this.next&&this.next.handleMouseMove(t,e)},handleMouseExit:function(t,e){this.next&&this.next.handleMouseExit(t,e)},handleMouseEnter:function(t,e){this.next&&this.next.handleMouseEnter(t,e)},handleMouseDown:function(t,e){this.next&&this.next.handleMouseDown(t,e)},handleMouseUp:function(t,e){this.next&&this.next.handleMouseUp(t,e)},handleKeyDown:function(t,e){this.next&&this.next.handleKeyDown(t,e)},handleKeyUp:function(t,e){this.next&&this.next.handleKeyUp(t,e)},handleWheelMoved:function(t,e){this.next&&this.next.handleWheelMoved(t,e)},handleDoubleClick:function(t,e){this.next&&this.next.handleDoubleClick(t,e)},handleHoldPulse:function(t,e){this.next&&this.next.handleHoldPulse(t,e)},handleTap:function(t,e){this.next&&this.next.handleTap(t,e)},handleMouseDrag:function(t,e){this.next&&this.next.handleMouseDrag(t,e)},handleContextMenu:function(t,e){this.next&&this.next.handleContextMenu(t,e)},moveSingleSelect:function(t,e,i){this.next&&this.next.moveSingleSelect(t,e,i)},isFixedRow:function(t,e){var i=e.viewPoint,n=i.yr;if(t.isRowSelection()&&!i&&l){var a=t.getFixedRowCount();o.yi.origin.y+i.extent.y&&(o=1);var u=n,c=o;l&&(u=0),a&&(c=0),this.lastDragCell=e.plusXY(u,c),t.scrollBy(n,o),this.handleMouseDragCellSelection(t,e,[]),t.repaint(),setTimeout(this.scrollDrag.bind(this,t),25)}},extendSelection:function(t,e,i){t.stopEditing();var n=-1!==i.indexOf("SHIFT"),o=t.getMouseDown(),r=e.x,s=e.y;0>r||0>s||(n?(t.clearMostRecentRowSelection(),t.selectRow(s,o.y),t.setDragExtent(t.newPoint(0,s-o.y))):(t.toggleSelectRow(s,i),t.setMouseDown(t.newPoint(r,s)),t.setDragExtent(t.newPoint(0,0))),t.repaint())},handleDOWNSHIFT:function(t){this.moveShiftSelect(t,1)},handleUPSHIFT:function(t){this.moveShiftSelect(t,-1)},handleLEFTSHIFT:function(t){},handleRIGHTSHIFT:function(t){},handleDOWN:function(t){this.moveSingleSelect(t,1)},handleUP:function(t){this.moveSingleSelect(t,-1)},handleLEFT:function(t){},handleRIGHT:function(t){var e=t.getMouseDown().plus(t.getDragExtent()),i=t.getColumnCount()-1,n=t.getHeaderColumnCount()+t.getHScrollValue(),o=e.y;n=Math.min(i,n),t.clearSelections(),t.select(n,o,0,0),t.setMouseDown(t.newPoint(n,o)),t.setDragExtent(t.newPoint(0,0)),t.repaint()},getAutoScrollAcceleration:function(){var t=1,e=this.getAutoScrollDuration()/2e3;return t=Math.max(1,Math.floor(e*e*e*e))},setAutoScrollStartTime:function(){this.sbAutoStart=Date.now()},pingAutoScroll:function(){var t=Date.now();t-this.sbLastAuto>500&&this.setAutoScrollStartTime(),this.sbLastAuto=Date.now()},getAutoScrollDuration:function(){return Date.now()-this.sbLastAuto>500?0:Date.now()-this.sbAutoStart},moveShiftSelect:function(t,e){var i=t.getRowCount()-1,n=t.getVisibleRows()-1;t.resolveProperty("scrollingEnabled")||(i=Math.min(i,n));var o=t.getMouseDown(),r=t.getDragExtent(),s=r.y+e;s=Math.min(i-o.y,Math.max(-o.y,s)),t.clearMostRecentRowSelection(),t.selectRow(o.y,o.y+s),t.setDragExtent(t.newPoint(0,s)),t.insureModelRowIsVisible(s+o.y,e)&&this.pingAutoScroll(),t.fireSyntheticRowSelectionChangedEvent(),t.repaint()},moveSingleSelect:function(t,e){var i=t.getRowCount()-1,n=t.getVisibleRowsCount()-1;t.resolveProperty("scrollingEnabled")||(i=Math.min(i,n));var o=t.getMouseDown().plus(t.getDragExtent()),r=o.y+e;r=Math.min(i,Math.max(0,r)),t.clearSelections(),t.selectRow(r),t.setMouseDown(t.newPoint(0,r)),t.setDragExtent(t.newPoint(0,0)),t.insureModelRowIsVisible(r,e)&&this.pingAutoScroll(),t.fireSyntheticRowSelectionChangedEvent(),t.repaint()},isSingleRowSelection:function(){return!0}});e.exports=o},{"./Feature.js":67}],73:[function(t,e,i){"use strict";var n=t("./Feature.js"),o=n.extend("ThumbwheelScrolling",{alias:"ThumbwheelScrolling",handleWheelMoved:function(t,e){if(t.resolveProperty("scrollingEnabled")){var i=e.primitiveEvent,n=i.wheelDeltaY||-i.deltaY,o=i.wheelDeltaX||-i.deltaX;n>0?t.scrollBy(0,-1):-0>n?t.scrollBy(0,1):o>0?t.scrollBy(-1,0):-0>o&&t.scrollBy(1,0)}}});e.exports=o},{"./Feature.js":67}],74:[function(t,e,i){"use strict";e.exports={Feature:t("./Feature"),CellClick:t("./CellClick"),CellEditing:t("./CellEditing"),CellSelection:t("./CellSelection"),ColumnAutosizing:t("./ColumnAutosizing"),ColumnMoving:t("./ColumnMoving"),ColumnResizing:t("./ColumnResizing"),ColumnSelection:t("./ColumnSelection"),ColumnSorting:t("./ColumnSorting"),Filters:t("./Filters"),KeyPaging:t("./KeyPaging"),OnHover:t("./OnHover"),ColumnPicker:t("./ColumnPicker"),RowResizing:t("./RowResizing"),RowSelection:t("./RowSelection"),ThumbwheelScrolling:t("./ThumbwheelScrolling")}},{"./CellClick":58,"./CellEditing":59,"./CellSelection":60,"./ColumnAutosizing":61,"./ColumnMoving":62,"./ColumnPicker":63,"./ColumnResizing":64,"./ColumnSelection":65,"./ColumnSorting":66,"./Feature":67,"./Filters":68,"./KeyPaging":69,"./OnHover":70,"./RowResizing":71,"./RowSelection":72,"./ThumbwheelScrolling":73}],75:[function(t,e,i){"use strict";function n(t,e,i,n,r,s){t.fillStyle="#FFD500",t.fill(),t.strokeStyle=t.createPattern(o.caution,"repeat"),t.lineWidth=5,t.beginPath(),t.moveTo(i,n),t.lineTo(i+r,n),t.lineTo(i+r,n+s),t.lineTo(i,n+s),t.lineTo(i,n),t.stroke(),t.beginPath(),t.rect(i,n,r-2,s),t.clip(),t.fillStyle="#A00",t.textAlign="start",t.textBaseline="middle",t.font='bold 6pt "arial narrow", verdana, geneva',t.fillText(e,i+4,n+s/2+.5)}var o=t("../images");e.exports=n},{"../images":2}],76:[function(t,e,i){"use strict";function n(t,e){o(r[t],t,e)}var o=t("css-injector"),r={grid:["div#grid-container {"," position: relative;"," display: inline-block;"," -webkit-user-select: none;"," -moz-user-select: none;"," -ms-user-select: none;"," -o-user-select: none;"," user-select: none;"," overflow: hidden; }","visible { opacity: 0.75; }","hidden { opacity: 0.0; }","editor {"," position: absolute;"," display: none;"," border: solid 2px black;"," outline: 0;"," padding: 0;"," z-index: 1000; }"],"list-dragon":["div.dragon-list, li.dragon-pop {"," font-family: Roboto, sans-serif;"," text-transform: capitalize; }","div.dragon-list {"," position: absolute;"," top: 4%;"," left: 4%;"," height: 92%;"," width: 20%; }","div.dragon-list:nth-child(2) { left: 28%; }","div.dragon-list:nth-child(3) { left: 52%; }","div.dragon-list:nth-child(4) { left: 76%; }","div.dragon-list > div, div.dragon-list > ul > li, li.dragon-pop { line-height: 46px; }","div.dragon-list > ul { top: 46px; }","div.dragon-list > ul > li:not(:last-child)::before, li.dragon-pop::before {"," content: '\\2b24';"," color: #b6b6b6;"," font-size: 30px;"," margin: 8px 14px 8px 8px; }","li.dragon-pop { opacity:.8; }"]};e.exports=n},{"css-injector":3}]},{},[57]); \ No newline at end of file