define(["require","exports"],function(t,e){"use strict";function n(e){if(null===e)e=document.documentElement;else if(!function(t){switch((t=getComputedStyle(t)).overflowX){case"auto":case"scroll":return 1}switch(t.overflowY){case"auto":case"scroll":return 1}}(e))return;return{scrollIntoView:function(t){t.right>e.scrollLeft+e.clientWidth&&(e.scrollLeft=t.right-e.clientWidth),t.left<e.scrollLeft&&(e.scrollLeft=t.left),t.bottom>e.scrollTop+e.clientHeight&&(e.scrollTop=t.bottom-e.clientHeight),t.top<e.scrollTop&&(e.scrollTop=t.top)}}}Object.defineProperty(e,"__esModule",{value:!0}),e.applyFocusBehavior=function(t){var e;null===t.onmousedown&&(e=!1,t.onmousedown=function(){e=!0},t.onmouseup=function(){e=!1},t.onfocus=function(){var t;e?this.select():(t=this.value.length,this.setSelectionRange(t,t))})},e.setClass=function(t,e,o){var n,s;void 0!==t.classList?o?t.classList.add(e):t.classList.remove(e):(s=(n=t.className.split(" ")).indexOf(e),o?s<0?n.push(e):n=void 0:s<0?n=void 0:n.splice(s,1),void 0!==n&&(t.className=n.join(" ")))},e.scrollIntoView=function(t){for(;t instanceof HTMLElement;){var e=function(t,e){if(void 0===e)return{left:t.offsetLeft,top:t.offsetTop,right:t.offsetLeft+t.offsetWidth+t.scrollWidth-t.clientWidth,bottom:t.offsetTop+t.offsetHeight+t.scrollHeight-t.clientHeight};var o=t.offsetLeft+t.clientLeft,t=t.offsetTop+t.clientTop;return{left:o+e.left,top:t+e.top,right:o+e.right,bottom:t+e.bottom}}(t,e),o=n(t.offsetParent);if(void 0!==o){o.scrollIntoView(e);break}t=t.offsetParent}},e.captureMouseEvents=function(o){var n=!1;function s(t){return o(t),n=!0,t.stopPropagation(),t.preventDefault(),!1}addEventListener("mousemove",s,!0),addEventListener("mouseup",function t(e){if(removeEventListener("mousemove",s,!0),removeEventListener("mouseup",t,!0),n)return o(void 0),e.stopPropagation(),e.preventDefault(),!1},!0)}});