text: /**
   * @file better-dom.js
   * @overview better-dom: Live extension playground
   * @version 2.0.1 Fri, 17 Oct 2014 13:22:35 GMT
   * @copyright 2013-2014 Maksim Chemerisuk
   * @license MIT
   * @see https://github.com/chemerisuk/better-dom
   */
  !function(){"use strict";function a(){}function b(c){if(!(this instanceof b)){if(c){var d=c.__2000001__;return d?d:new b(c)}return new a}c&&(this[0]=c,c.__2000001__=this),this._={_handlers:[],_watchers:{},_extensions:[]}}function c(a,b){var c=arguments[2];void 0===c&&(c="$Element");var d="http://chemerisuk.github.io/better-dom/"+c+".html#"+a,e="invalid call `"+c+("DOM"===c?".":"#")+a+"(";e+=s.map.call(b,function(a){return String(a)}).join(", ")+")`;",this.message=e+" check "+d+" to verify the function arguments"}function d(a,b){c.call(this,a,b,"DOM")}function e(a){U.forEach(function(b){b(a,!0)}),s.each.call(a.children,e)}function f(a,c,d,e,f,g){if("number"==typeof a)return c.detail?c.detail[a]:void 0;if("string"!=typeof a)return a;if(9>l)switch(a){case"which":return c.keyCode;case"button":var h=c.button;return 1&h?1:2&h?3:4&h?2:0;case"pageX":return c.clientX+j.scrollLeft-j.clientLeft;case"pageY":return c.clientY+j.scrollTop-j.clientTop;case"preventDefault":return function(){return c.returnValue=!1};case"stopPropagation":return function(){return c.cancelBubble=!0}}switch(a){case"type":return d;case"defaultPrevented":return"defaultPrevented"in c?c.defaultPrevented:c.returnValue===!1;case"target":return b(f);case"currentTarget":return b(g);case"relatedTarget":return b(c.relatedTarget||c[(c.toElement===e?"from":"to")+"Element"])}var i=c[a];return"function"==typeof i?function(){return i.apply(c,arguments)}:i}function g(a,b,c,d,e,j){var k=e[0],m=ob[a],n=L(b,k),p=function(b){if(b=b||h.event,g.skip!==a&&(p._type!==o||b.srcUrn===a)){var m,q=b.target||b.srcElement||i,r=n?n(q):k;r&&(j&&e.off(a,c),m=d&&d.length?d.map(function(c){return f(c,b,a,k,q,r)}):b.detail?s.slice.call(b.detail,1):[],c.apply(e,m)===!1&&(9>l?b.returnValue=!1:b.preventDefault()))}};return m&&(p=m(p,a)||p),9>l&&!("on"+(p._type||a)in k)&&(p._type=o),p.type=b?a+" "+b:a,p.callback=c,p}var h=window,i=h.document,j=i.documentElement,k=h.navigator.userAgent,l=/*@cc_on @_jscript_version|@*/void 0,m=~k.indexOf("Android")&&k.indexOf("Chrome")<0,n=h.WebKitAnimationEvent?"-webkit-":"",o="dataavailable";b.prototype={constructor:function(a){return b(a&&1===a.nodeType?a:null)},toString:function(){var a=this[0];return a?"<"+a.tagName.toLowerCase()+">":""},version:"2.0.1"},a.prototype=new b;var p=new b(j),q=Array.prototype,r=i.getElementsByTagName("head")[0],s={computeStyle:function(a){return h.getComputedStyle?h.getComputedStyle(a):a.currentStyle},injectElement:function(a){return a&&1===a.nodeType?r.appendChild(a):void 0},every:q.every,each:q.forEach,filter:q.filter,map:q.map,slice:q.slice,isArray:Array.isArray,keys:Object.keys,safeInvoke:function(a,b,c,d){"string"==typeof b&&(b=a[b]);try{return b.call(a,c,d)}catch(e){return h.setTimeout(function(){throw e},1),!1}},register:function(c,d){d=d||function(){},Object.keys(c).forEach(function(e){var f=d(e)||function(){return this};b.prototype[e]=c[e],a.prototype[e]=f})}};c.prototype=new TypeError,d.prototype=new TypeError;var t=h.DOM;p.noConflict=function(){return h.DOM===p&&(h.DOM=t),p},h.DOM=p;var u={"(":1,")":2,"^":3,">":4,"+":5,"*":6,"`":7,"[":8,".":8,"#":8},v=/`[^`]*`|\[[^\]]*\]|\.[^()>^+*`[#]+|[^()>^+*`[#.]+|\^+|./g,w=/\s*([\w\-]+)(?:=((?:`([^`]*)`)|[^\s]*))?/g,x=/(\$+)(?:@(-)?(\d+)?)?/g,y=/\./g,z=/\$/g,A={"":""},B=function(a,b,c,d){var e=c&&c.indexOf('"')>=0?"'":'"';return"string"==typeof d?c=d:"string"!=typeof c&&(c=b)," "+b+"="+e+c+e},C=function(a,b){return function(c){var d=b?c.lastIndexOf("<"):c.indexOf(">");return c.substr(0,d)+a+c.substr(d)}},D=function(a){return A[a]||(A[a]="<"+a+"></"+a+">")},E=function(a,b){var c,d=Array(a);for(c=0;a>c;++c)d[c]=b.replace(x,function(b,d,e,f){var g=(e?a-c-1:c)+(f?+f:1);return(d+g).slice(-d.length).replace(z,"0")});return d};"area base br col hr img input link meta param command keygen source".split(" ").forEach(function(a){A[a]="<"+a+">"}),p.emmet=function(a,b){var c,e,f;if("string"!=typeof a)throw new d("emmet",arguments);if(b&&(a=p.format(a,b)),a in A)return A[a];var g=[],h=[];f=a.match(v),c=0,e=f.length;for(var i;e>c;){i=f[c++];var j=i[0],k=u[j];if(k){if("("!==i)for(var l=0,m="^"===j?i.length:1;m>l;++l)for(;g[0]!==j&&u[g[0]]>=k;){var n=g.shift();if(h.push(n),"^"===j&&">"===n)break}")"===i?g.shift():(("["===j||"`"===j)&&h.push(i.slice(1,-1)),"."===j&&h.push(i.substr(1).replace(y," ")),g.unshift(j))}else h.push(i)}c=e=f=void 0,h=h.concat(g),g=[],c=0,e=h.length;for(var o;e>c;){if(o=h[c++],o in u){var q=g.shift(),r=g.shift();switch("string"==typeof r&&(r=[D(r)]),o){case".":q=C(' class="'+q+'"');break;case"#":q=C(' id="'+q+'"');break;case"[":q=C(q.replace(w,B));break;case"*":r=E(+q,r.join(""));break;case"`":g.unshift(r),r=[q];break;default:q="string"==typeof q?D(q):q.join(""),">"===o?q=C(q,!0):r.push(q)}o="function"==typeof q?r.map(q):r}g.unshift(o)}return c=e=void 0,h=1===h.length?D(g[0]):g[0].join("")};var F=A,G=i.createElement("body"),H=function(a){return function(c,d){var e,f;if(c&&c in F)e=i.createElement(c),a&&(e=[new b(e)]);else for(c=c.trim(),c="<"===c[0]&&">"===c[c.length-1]?d?p.format(c,d):c:p.emmet(c,d),G.innerHTML=c,e=a?[]:null;f=G.firstChild;)if(G.removeChild(f),1===f.nodeType){if(!a){e=f;break}e.push(new b(f))}return a?e:b(e)}};p.create=H(""),p.createAll=H("All");var I,J=/^(\w*)(?:#([\w\-]+))?(?:\[([\w\-\=]+)\])?(?:\.([\w\-]+))?$/,K="m oM msM mozM webkitM".split(" ").reduce(function(a,b){var c=b+"atchesSelector";return a||j[c]&&c},null),L=function(a,b){if("string"!=typeof a)return null;var c=J.exec(a);return c&&(c[1]&&(c[1]=c[1].toLowerCase()),c[3]&&(c[3]=c[3].split("=")),c[4]&&(c[4]=" "+c[4]+" ")),function(d){var e,f,g,h;for(c||K||(h=(b||document).querySelectorAll(a));d&&1===d.nodeType;d=d.parentNode){if(c)g=!(c[1]&&d.nodeName.toLowerCase()!==c[1]||c[2]&&d.id!==c[2]||c[3]&&(c[3][1]?d.getAttribute(c[3][0])!==c[3][1]:!d.hasAttribute(c[3][0]))||c[4]&&!((" "+d.className+" ").indexOf(c[4])>=0));else if(K)g=d[K](a);else{e=0,f=h.length;for(var i;f>e;)if(i=h[e++],i===d)return i;e=f=void 0}if(g||!b||d===b)break}return g&&d}},M=/^(?:on|do)[A-Z]/,N=function(a,c,d,e){var f=d.hasOwnProperty("constructor")&&d.constructor,g=L(a);return function(a,h){var i=b(a);if(!~i._._extensions.indexOf(e)&&g(a)&&(i._._extensions.push(e),h===!0||c(i)!==!1)){var j=Object.keys(d).filter(function(a){var b=d[a];return M.exec(a)?(i[a]=function(){return b.apply(i,arguments)},i[a][0]=b,!h):void("constructor"!==a&&(i[a]=b))});f&&s.safeInvoke(i,f),j.forEach(function(a){delete i[a]})}}},O=[],P=function(){return!0},Q=function(){return!1};if(p.extend=function(a,c,e){if(2===arguments.length&&(e=c,c=!0),"boolean"==typeof c&&(c=c?P:Q),"function"==typeof e&&(e={constructor:e}),!e||"object"!=typeof e||"function"!=typeof c)throw new d("extend",arguments);if("*"===a)s.keys(e).forEach(function(a){b.prototype[a]=e[a]});else{var f=N(a,c,e,O.length);O.push(f),h.setTimeout(function(){s.each.call(i.querySelectorAll(a),f),p.importStyles(a,I)},1)}},10>l){var R=s.filter.call(i.scripts,function(a){return a.src.indexOf("better-dom-legacy.js")>=0});if(R.length<1)throw new Error("In order to use live extensions in IE < 10 you have to include extra files. See https://github.com/chemerisuk/better-dom#notes-about-old-ies for details.");I="-ms-behavior:url("+R[0].src.replace(".js",".htc")+") !important",i.attachEvent("on"+o,function(){var a=h.event;a.srcUrn===o&&O.forEach(function(b){b(a.srcElement)})})}else{var S="DOM2000001",T=p.extend;I=n+"animation-name:"+S+" !important;",I+=n+"animation-duration:1ms !important",p.extend=function(){p.importStyles("@"+n+"keyframes "+S,"from {opacity:.99} to {opacity:1}"),(p.extend=T).apply(p,arguments)},i.addEventListener(n?"webkitAnimationStart":"animationstart",function(a){a.animationName===S&&(O.forEach(function(b){b(a.target)}),a.stopImmediatePropagation())},!0)}var U=O,V=/\{([\w\-]+)\}/g;p.format=function(a,b){if("string"!=typeof a)throw new d("format",arguments);return b&&"object"==typeof b||(b={}),a.replace(V,function(a,c){return c in b?String(b[c]):a})},p.importScripts=function(){var a=Array.prototype.slice,b=a.call(arguments,0),c=function(){var a,e=b.shift(),f=typeof e;if("string"===f)a=i.createElement("script"),a.src=e,a.onload=c,a.async=!0,s.injectElement(a);else if("function"===f)e();else if(e)throw new d("importScripts",arguments)};c()};var W={get:{},set:{}},X=/\-./g,Y=/[A-Z]/g,Z=["Top","Right","Bottom","Left"],$=s.computeStyle(j),_=$.length?s.slice.call($,0):s.keys($).map(function(a){return a.replace(Y,function(a){return"-"+a.toLowerCase()})}),ab={font:["fontStyle","fontSize","/","lineHeight","fontFamily"],padding:Z.map(function(a){return"padding"+a}),margin:Z.map(function(a){return"margin"+a}),"border-width":Z.map(function(a){return"border"+a+"Width"}),"border-style":Z.map(function(a){return"border"+a+"Style"})};_.forEach(function(a){var b="-"===a[0]?a.substr(1,a.indexOf("-",1)-1):null,c=b?a.substr(b.length+2):a,d=a.replace(X,function(a){return a[1].toUpperCase()});d in $||(d=d[0].toLowerCase()+d.substr(1)),W.get[c]=function(a){return a[d]},W.set[c]=function(b,c){c="number"==typeof c?c+"px":c.toString(),b["cssText"in b?d:a]=c}})," float fill-opacity font-weight line-height opacity orphans widows z-index zoom ".split(" ").forEach(function(a){var b=a.replace(X,function(a){return a[1].toUpperCase()});"float"===a&&(b="cssFloat"in $?"cssFloat":"styleFloat",W.get[a]=function(a){return a[b]}),W.set[a]=function(c,d){c["cssText"in c?b:a]=d.toString()}}),s.keys(ab).forEach(function(a){var b=ab[a];W.get[a]=function(a){var c=[],d=function(b,d){return c.push("/"===b?b:a[b]),!c[d]};return b.some(d)?"":c.join(" ")},W.set[a]=function(c,d){d&&"cssText"in c?c.cssText+=";"+a+":"+d:b.forEach(function(a){return c[a]="number"==typeof d?d+"px":d.toString()})}});var bb=W,cb=s.injectElement(i.createElement("style")),db=cb.sheet||cb.styleSheet,eb=db.cssRules||db.rules,fb=function(a){var b=s.keys(a).reduce(function(b,c){var d=bb.set[c];return d?d(b,a[c]):b[c]=a[c],b},{});return s.keys(b).map(function(a){return a+":"+b[a]}).join(";")},gb=function(a){return function(b){try{db.cssRules?db.insertRule(b+"{"+a+"}",eb.length):db.addRule(b,a)}catch(c){}}};p.importStyles=function(a,b){if(b&&"object"==typeof b&&(b=fb(b)),"string"!=typeof a||"string"!=typeof b)throw new d("importStyles",arguments);a.split(",").forEach(gb(b))},p.mock=function(b,c){if(!b)return new a;var d=p.create(b,c);return e(d[0]),d};var hb=function(a){return function(d){if(a){if(d&&"string"!=typeof d)throw new c("children",arguments)}else if(d&&"number"!=typeof d)throw new c("child",arguments);var e=this[0],f=L(d),g=e.children;return 9>l&&(g=s.filter.call(g,function(a){return 1===a.nodeType})),a?(f&&(g=s.filter.call(g,f)),s.map.call(g,b)):(0>d&&(d=g.length+d),b(g[d]))}};s.register({child:hb(!1),children:hb(!0)},function(b){return"child"===b?function(){return new a}:function(){return[]}});var ib=/[\n\t\r]/g,jb=function(a,b){var d="contains"===a?"hasClass":a+"Class";return j.classList&&(b=function(b,c){return b[0].classList[a](c)}),"hasClass"===d||"toggleClass"===d?function(a,e){if("boolean"==typeof e&&"toggleClass"===d)return this[e?"addClass":"removeClass"](a),e;if("string"!=typeof a)throw new c(d,arguments);return b(this,a)}:function(){var a,e,f=arguments;a=0,e=f.length;for(var g;e>a;){if(g=f[a++],"string"!=typeof g)throw new c(d,arguments);b(this,g)}return a=e=void 0,this}};s.register({hasClass:jb("contains",function(a,b){return(" "+a[0].className+" ").replace(ib," ").indexOf(" "+b+" ")>=0}),addClass:jb("add",function(a,b){a.hasClass(b)||(a[0].className+=" "+b)}),removeClass:jb("remove",function(a,b){a[0].className=(" "+a[0].className+" ").replace(ib," ").replace(" "+b+" "," ").trim()}),toggleClass:jb("toggle",function(a,b){var c=a.hasClass(b);return c?a.removeClass(b):a[0].className+=" "+b,!c})},function(a){return"hasClass"===a||"toggleClass"===a?function(){return!1}:void 0}),s.register({clone:function(){var a=arguments[0];if(void 0===a&&(a=!0),"boolean"!=typeof a)throw new c("clone",arguments);var d,e=this[0];return 9>l?(d=p.create(e.outerHTML),a||d.set("innerHTML","")):d=new b(e.cloneNode(a)),d}},function(){return function(){return new a}}),s.register({contains:function(a){var d=this[0];if(a instanceof b){var e=a[0];return e===d?!0:d.contains?d.contains(e):16&d.compareDocumentPosition(e)}throw new c("contains",arguments)}},function(){return function(){return!1}}),s.register({css:function(a,b){var d,e,f,g=this,h=arguments.length,i=this[0],j=i.style,k=typeof a;if(1===h&&("string"===k||s.isArray(a)))return b=("string"===k?[a]:a).reduce(function(a,c){return d=bb.get[c],b=d?d(j):j[c],e||b||(j=s.computeStyle(i),b=d?d(j):j[c],e=!0),a[c]=b,a},{}),"string"===k?b[a]:b;if(f=function(a,b){var c=bb.set[a];"function"==typeof b&&(b=b.call(g,g.css(a))),null==b&&(b=""),c?c(j,b):j[a]="number"==typeof b?b+"px":b.toString()},1===h&&a&&"object"===k)s.keys(a).forEach(function(b){f(b,a[b])});else{if(2!==h||"string"!==k)throw new c("css",arguments);f(a,b)}return this}},function(){return function(a){return 1!==arguments.length||"string"!=typeof a&&!s.isArray(a)?this:void 0}}),s.register({defineProperty:function(a,b){var d=this,e=b.get,f=b.set;if("string"!=typeof a||"function"!=typeof e||"function"!=typeof f)throw new c("defineProperty",arguments);return Object.defineProperty(this[0],a,{get:function(){return e.call(d)},set:function(a){f.call(d,a)}}),this},defineAttribute:function(a,b){var d=this,e=this[0],f=b.get,g=b.set;if("string"!=typeof a||"function"!=typeof f||"function"!=typeof g)throw new c("defineAttribute",arguments);var h=e.getAttribute(a),i=9>l?a.toUpperCase():a,j=e.setAttribute,k=e.removeAttribute;return Object.defineProperty(e,a,{get:function(){var a=e.getAttribute(i,1);return f.call(d,a)},set:function(a){var b=g.call(d,a);null==b?k.call(e,i,1):j.call(e,i,b,1)}}),e.setAttribute=function(b,c,g){a===b?e[a]=f.call(d,c):j.call(e,b,c,g)},e.removeAttribute=function(b,c){a===b?e[a]=f.call(d,null):k.call(e,b,c)},e[a]=f.call(this,h),this}});var kb=i.getElementsByClassName?/^(?:(\w+)|\.([\w\-]+))$/:/^(?:(\w+))$/,lb=/'|\\/g,mb=function(a){return function(d){if("string"!=typeof d)throw new c("find"+a,arguments);var e,f,g,h,i=this[0],j=kb.exec(d);return j?(e=j[1]?i.getElementsByTagName(d):i.getElementsByClassName(j[2]),e&&!a&&(e=e[0])):(f=!0,g="DOM2000001",h=i,this!==p&&((f=i.getAttribute("id"))?g=f.replace(lb,"\\$&"):i.setAttribute("id",g),g="[id='"+g+"'] ",d=g+d.split(",").join(","+g)),e=s.safeInvoke(h,"querySelector"+a,d),f||i.removeAttribute("id")),a?s.map.call(e,b):b(e)}};s.register({find:mb(""),findAll:mb("All")},function(b){return"find"===b?function(){return new a}:function(){return[]}});var nb={};"onfocusin"in j?(nb.focus=function(a){a._type="focusin"},nb.blur=function(a){a._type="focusout"}):nb.focus=nb.blur=function(a){a.capturing=!0},i.createElement("input").validity&&(nb.invalid=function(a){a.capturing=!0}),9>l&&["submit","change","reset"].forEach(function(a){nb[a]=function(a){a._type=o}});var ob=nb,pb=g;s.register({fire:function(a){var b,d,e,f=this[0];if("string"!=typeof a)throw new c("fire",arguments);var g=ob[a],h={};return g&&(h=g(h)||h),d=h._type||a,9>l?(b=i.createEventObject(),b.detail=arguments,"on"+d in f||(d=o),d===o&&(b.srcUrn=a),f.fireEvent("on"+d,b),e=b.returnValue!==!1):(b=i.createEvent("HTMLEvents"),b.detail=arguments,b.initEvent(d,!0,!0),e=f.dispatchEvent(b)),e&&f[a]&&(pb.skip=a,s.safeInvoke(f,a),pb.skip=null),e}},function(){return function(){return!0}});var qb={get:{},set:{}},rb=document.createElement("body");"tabIndex readOnly maxLength cellSpacing cellPadding rowSpan colSpan useMap frameBorder contentEditable".split(" ").forEach(function(a){qb.get[a.toLowerCase()]=function(b){return b[a]}}),qb.get.style=function(a){return a.style.cssText},qb.set.style=function(a,b){a.style.cssText=b},qb.get.title=function(a){return a===j?i.title:a.title},qb.set.title=function(a,b){(a===j?i:a).title=b},qb.get.undefined=function(a){var b;switch(a.tagName){case"SELECT":return~a.selectedIndex?a.options[a.selectedIndex].value:"";case"OPTION":b=a.hasAttribute("value")?"value":"text";break;default:b=a.type&&"value"in a?"value":"innerHTML"}return a[b]},qb.set.value=function(a,b){"SELECT"===a.tagName?s.every.call(a.options,function(a){return!(a.selected=a.value===b)})&&(a.selectedIndex=-1):a[9>l&&"textarea"===a.type?"innerText":"value"]=b},qb.get.type=function(a){return a.getAttribute("type")||a.type},9>l&&(qb.get.textContent=function(a){return a.innerText},qb.set.textContent=function(a,b){a.innerText=b},qb.set.innerHTML=function(a,b){try{a.innerHTML=b}catch(c){a.innerText="",rb.innerHTML=b;for(var d;d=rb.firstChild;)a.appendChild(d)}});var sb=qb,tb=/[A-Z]/g,ub=function(a,b){b=b.replace(tb,function(a){return"-"+a.toLowerCase()});var c=a.getAttribute("data-"+b);if(null!=c&&"{"===c[0]&&"}"===c[c.length-1])try{c=JSON.parse(c)}catch(d){}return c};s.register({get:function(a){var b=this,d=this[0],e=sb.get[a];if(e)return e(d,a);if("string"==typeof a){if(a in d)return d[a];if("_"!==a[0])return d.getAttribute(a);var f=a.substr(1),g=this._;return f in g||(g[f]=ub(d,f)),g[f]}if(s.isArray(a))return a.reduce(function(a,c){return a[c]=b.get(c),a},{});throw new c("get",arguments)}},function(){return function(){return void 0}});var vb=function(a,d,e,f){return function(){var g=arguments[0];void 0===g&&(g="");var h=this[0];if(!(e||h.parentNode&&g!==p))return this;if("function"==typeof g&&(g=g.call(this)),"string"==typeof g)g&&(g=d?g.trim():p.create(g)[0]);else if(g instanceof b)g=g[0];else{if(!s.isArray(g))throw new c(a,arguments);g=g.reduce(function(a,b){return a.appendChild(b[0]),a},i.createDocumentFragment())}return g&&"string"==typeof g?h.insertAdjacentHTML(d,g):(g||!d)&&f(h,g),this}};s.register({after:vb("after","afterend",!1,function(a,b){a.parentNode.insertBefore(b,a.nextSibling)}),before:vb("before","beforebegin",!1,function(a,b){a.parentNode.insertBefore(b,a)}),prepend:vb("prepend","afterbegin",!0,function(a,b){a.insertBefore(b,a.firstChild)}),append:vb("append","beforeend",!0,function(a,b){a.appendChild(b)}),replace:vb("replace","",!1,function(a,b){a.parentNode.replaceChild(b,a)}),remove:vb("remove","",!1,function(a){a.parentNode.removeChild(a)})});var wb={};wb[":focus"]=function(a){return a===i.activeElement},wb[":hidden"]=function(a){if("true"===a.getAttribute("aria-hidden"))return!0;var b=s.computeStyle(a);return"hidden"===b.visibility||"none"===b.display},wb[":visible"]=function(a){return!wb[":hidden"](a)};var xb=wb;s.register({matches:function(a){if(!a||"string"!=typeof a)throw new c("matches",arguments);var b=xb[a]||L(a);return!!b(this[0],this)}},function(){return function(){return!1}}),s.register({off:function(a,b){if("string"!=typeof a)throw new c("off",arguments);var d=this[0];return this._._handlers=this._._handlers.filter(function(c){return a!==c.type||b&&b!==c.callback?!0:(a=c._type||c.type,void(9>l?d.detachEvent("on"+a,c):d.removeEventListener(a,c,!!c.capturing)))}),this}}),s.register({offset:function(){var a=this[0],b=j.clientTop,c=j.clientLeft,d=h.pageYOffset||j.scrollTop,e=h.pageXOffset||j.scrollLeft,f=a.getBoundingClientRect();return{top:f.top+d-b,left:f.left+e-c,right:f.right+e-c,bottom:f.bottom+d-b,width:f.right-f.left,height:f.bottom-f.top}}},function(){return function(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}});var yb=function(a){return function(b,d,e,f){var g=this;if("string"==typeof b){if("function"==typeof e&&(f=e,"string"==typeof d?e=null:(e=d,d=null)),"function"==typeof d&&(f=d,d=null,e=null),"function"!=typeof f)throw new c(a,arguments);var h=this[0],i=pb(b,d,f,e,this,"once"===a);i&&(9>l?h.attachEvent("on"+(i._type||b),i):h.addEventListener(i._type||b,i,!!i.capturing),this._._handlers.push(i))}else{if("object"!=typeof b)throw new c(a,arguments);s.isArray(b)?b.forEach(function(b){g[a](b,d,e,f)}):s.keys(b).forEach(function(c){g[a](c,b[c])})}return this}};s.register({on:yb("on"),once:yb("once")}),s.register({set:function(a,b){var d=this,e=this[0];if(1===arguments.length&&(b="function"==typeof a?a:null==a?"":String(a),"[object Object]"!==b)){var f=e.tagName;a="INPUT"===f||"TEXTAREA"===f||"SELECT"===f||"OPTION"===f?"value":"innerHTML"}var g,h=sb.set[a],i=this._._watchers[a];if((i||"function"==typeof b)&&(g=this.get(a)),"string"==typeof a)"_"===a[0]?this._[a.substr(1)]=b:("function"==typeof b&&(b=b.call(this,g)),h?h(e,b):null==b?e.removeAttribute(a):a in e?e[a]=b:e.setAttribute(a,b),(9>l||m)&&(e.className=e.className));else if(s.isArray(a))a.forEach(function(a){d.set(a,b)});else{if("object"!=typeof a)throw new c("set",arguments);s.keys(a).forEach(function(b){d.set(b,a[b])})}return i&&g!==b&&i.forEach(function(a){s.safeInvoke(d,a,b,g)}),this}});var zb=function(a,d,e){return function(f){if(f&&"string"!=typeof f)throw new c(a,arguments);var g=L(f),h=e?[]:null,i=this[0];for("closest"===a&&g||(i=i[d]);i;i=i[d])if(1===i.nodeType&&(!g||g(i))){if(!e)break;h.push(i)}return e?s.map.call(h,b):b(i)}};s.register({next:zb("next","nextSibling"),prev:zb("prev","previousSibling"),nextAll:zb("nextAll","nextSibling",!0),prevAll:zb("prevAll","previousSibling",!0),closest:zb("closest","parentNode")},function(b){return"All"===b.slice(-3)?function(){return[]}:function(){return new a}});var Ab=!(m||10>l),Bb=["timing-function","property","duration","delay"].map(function(a){return"transition-"+a}),Cb=n?"webkitTransitionEnd":"transitionend",Db=n?"webkitAnimationEnd":"animationend",Eb=function(a){var b=parseFloat(a)||0;return b&&"ms"!==a.slice(-2)?1e3*b:b},Fb=function(a){var b=bb.get["transition-delay"](a).split(","),c=bb.get["transition-duration"](a).split(",");return Math.max.apply(Math,c.map(function(a,c){return Eb(a)+(Eb(b[c])||0)}))},Gb=function(a,b,c,d,e){var f=Fb(c);if(!f)return!1;var g,h;return h=Bb.map(function(a,b){return bb.get[a](c).split(b?", ":/, (?!\d)/)}),g=h[1].indexOf("visibility"),0>g&&(g=h[2].indexOf("0s")),0>g&&(g=h[0].length),h[0][g]="linear",h[1][g]="visibility",h[d?2:3][g]="0s",h[d?3:2][g]=f+"ms",h.forEach(function(a,c){bb.set[Bb[c]](b,a.join(", "))}),a.addEventListener(Cb,function i(c){"visibility"===c.propertyName&&(c.stopPropagation(),a.removeEventListener(Cb,i,!0),b.willChange="",e())},!0),b.visibility=d?"inherit":"hidden",b.willChange=h[1].join(", "),!0},Hb=function(a,b,c,d,e,f){var g=Eb(bb.get["animation-duration"](c));return g?(a.addEventListener(Db,function h(c){c.animationName===d&&(c.stopPropagation(),a.removeEventListener(Db,h,!0),bb.set["animation-name"](b,""),f())},!0),bb.set["animation-direction"](b,e?"normal":"reverse"),bb.set["animation-name"](b,d),!0):!1},Ib=function(a,b){return function(d,e){var f=this;if("string"!=typeof d&&(e=d,d=null),e&&"function"!=typeof e)throw new c(a,arguments);var g=this[0],h=g.style,i=s.computeStyle(g),j=b,k=function(){if(String(j)===g.getAttribute("aria-hidden")){if(l)j&&d&&(h.visibility="hidden");else if(j){var a=i.display;"none"!==a&&(f._._display=a),h.display="none"}else h.display=f._._display||"inherit";e&&e.call(f)}},l=Ab&&g.offsetWidth;return"boolean"!=typeof j&&(j=!xb[":hidden"](g)),l&&(l=d?Hb(g,h,i,d,j,k):Gb(g,h,i,j,k)),h.visibility=j&&!d?"hidden":"inherit",this.set("aria-hidden",String(j)),l||k(),this}};s.register({show:Ib("show",!1),hide:Ib("hide",!0),toggle:Ib("toggle")}),s.register({watch:function(a,b){var c=this._._watchers;return c[a]||(c[a]=[]),c[a].push(b),this},unwatch:function(a,b){var c=this._._watchers;return c[a]&&(c[a]=c[a].filter(function(a){return a!==b})),this}})}();