Skip to content

Instantly share code, notes, and snippets.

@amiorin
Created July 13, 2013 14:48
Show Gist options
  • Save amiorin/5990971 to your computer and use it in GitHub Desktop.
Save amiorin/5990971 to your computer and use it in GitHub Desktop.
requirebin sketch
'use strict';
var $ = require('jquery2');
var Bacon = require('baconjs');
$.fn.asEventStream = Bacon.$.asEventStream;
var _ = require('lodash');
var button = function(options) {
var opts = _.defaults(options, {
rate: 10,
delay: 300,
value: true
});
var $el = opts.$el,
rate = opts.rate,
delay = opts.delay,
value = opts.value,
period = 1000 / rate,
cnt = delay / period;
var initialStatus = {
mousedown: false,
counter: cnt,
value: false
};
var mousedown = $el.asEventStream('mousedown').map('mousedown'),
mouseup = $(document).asEventStream('mouseup').map('mouseup'),
repeat = Bacon.interval(period, 'tick'),
merged = Bacon.mergeAll(mousedown, mouseup, repeat);
var statusProperty = merged.scan(initialStatus, function(status, event) {
if (event === 'mousedown') {
status.mousedown = true;
status.value = true;
return status;
} else if (event === 'mouseup') {
status.mousedown = false;
status.value = false;
return status;
} else if (event === 'tick') {
if (status.counter === 0 && status.mousedown) {
status.value = true;
return status;
} else if (status.mousedown) {
status.counter -= 1;
status.value = false;
return status;
} else {
status.counter = cnt;
return status;
}
}
});
var isTrue = function(status) {
return status.value === true;
};
return statusProperty.filter(isTrue).map(value).changes();
};
var plusOnes = button({
$el: $(document),
value: +1
});
var score = plusOnes.scan(0, function(sum, value) {
return sum + value;
});
score.assign($('body'), 'text');
require=function(t,e,n){function r(n,o){if(!e[n]){if(!t[n]){var u="function"==typeof require&&require;if(!o&&u)return u(n,!0);if(i)return i(n,!0);throw Error("Cannot find module '"+n+"'")}var a=e[n]={exports:{}};t[n][0].call(a.exports,function(e){var i=t[n][1][e];return r(i?i:e)},a,a.exports)}return e[n].exports}for(var i="function"==typeof require&&require,o=0;n.length>o;o++)r(n[o]);return r}({jquery2:[function(t,e){e.exports=t("l/114/")},{}],"l/114/":[function(t,e){(function(){(function(t,n){function r(t){var e=t.length,n=ue.type(t);return ue.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||"function"!==n&&(0===e||"number"==typeof e&&e>0&&e-1 in t)}function i(t){var e=ge[t]={};return ue.each(t.match(se)||[],function(t,n){e[n]=!0}),e}function o(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ue.expando+Math.random()}function u(t,e,r){var i;if(r===n&&1===t.nodeType)if(i="data-"+e.replace(be,"-$1").toLowerCase(),r=t.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:ye.test(r)?JSON.parse(r):r}catch(o){}me.set(t,e,r)}else r=n;return r}function a(){return!0}function s(){return!1}function c(){try{return U.activeElement}catch(t){}}function l(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function f(t,e,n){if(ue.isFunction(e))return ue.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return ue.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(Ae.test(e))return ue.filter(e,t,n);e=ue.filter(e,t)}return ue.grep(t,function(t){return ne.call(e,t)>=0!==n})}function p(t,e){return ue.nodeName(t,"table")&&ue.nodeName(1===e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function h(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function d(t){var e=Be.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function g(t,e){for(var n=t.length,r=0;n>r;r++)ve.set(t[r],"globalEval",!e||ve.get(e[r],"globalEval"))}function m(t,e){var n,r,i,o,u,a,s,c;if(1===e.nodeType){if(ve.hasData(t)&&(o=ve.access(t),u=ve.set(e,o),c=o.events)){delete u.handle,u.events={};for(i in c)for(n=0,r=c[i].length;r>n;n++)ue.event.add(e,i,c[i][n])}me.hasData(t)&&(a=me.access(t),s=ue.extend({},a),me.set(e,s))}}function v(t,e){var r=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return e===n||e&&ue.nodeName(t,e)?ue.merge([t],r):r}function y(t,e){var n=e.nodeName.toLowerCase();"input"===n&&Pe.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function b(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),r=e,i=tn.length;i--;)if(e=tn[i]+n,e in t)return e;return r}function x(t,e){return t=e||t,"none"===ue.css(t,"display")||!ue.contains(t.ownerDocument,t)}function w(e){return t.getComputedStyle(e,null)}function C(t,e){for(var n,r,i,o=[],u=0,a=t.length;a>u;u++)r=t[u],r.style&&(o[u]=ve.get(r,"olddisplay"),n=r.style.display,e?(o[u]||"none"!==n||(r.style.display=""),""===r.style.display&&x(r)&&(o[u]=ve.access(r,"olddisplay",N(r.nodeName)))):o[u]||(i=x(r),(n&&"none"!==n||!i)&&ve.set(r,"olddisplay",i?n:ue.css(r,"display"))));for(u=0;a>u;u++)r=t[u],r.style&&(e&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=e?o[u]||"":"none"));return t}function T(t,e,n){var r=Xe.exec(e);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):e}function k(t,e,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===e?1:0,u=0;4>o;o+=2)"margin"===n&&(u+=ue.css(t,n+Ze[o],!0,i)),r?("content"===n&&(u-=ue.css(t,"padding"+Ze[o],!0,i)),"margin"!==n&&(u-=ue.css(t,"border"+Ze[o]+"Width",!0,i))):(u+=ue.css(t,"padding"+Ze[o],!0,i),"padding"!==n&&(u+=ue.css(t,"border"+Ze[o]+"Width",!0,i)));return u}function E(t,e,n){var r=!0,i="width"===e?t.offsetWidth:t.offsetHeight,o=w(t),u=ue.support.boxSizing&&"border-box"===ue.css(t,"boxSizing",!1,o);if(0>=i||null==i){if(i=$e(t,e,o),(0>i||null==i)&&(i=t.style[e]),Ye.test(i))return i;r=u&&(ue.support.boxSizingReliable||i===t.style[e]),i=parseFloat(i)||0}return i+k(t,e,n||(u?"border":"content"),r,o)+"px"}function N(t){var e=U,n=Ge[t];return n||(n=j(t,e),"none"!==n&&n||(ze=(ze||ue("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(e.documentElement),e=(ze[0].contentWindow||ze[0].contentDocument).document,e.write("<!doctype html><html><body>"),e.close(),n=j(t,e),ze.detach()),Ge[t]=n),n}function j(t,e){var n=ue(e.createElement(t)).appendTo(e.body),r=ue.css(n[0],"display");return n.remove(),r}function S(t,e,n,r){var i;if(ue.isArray(e))ue.each(e,function(e,i){n||nn.test(t)?r(t,i):S(t+"["+("object"==typeof i?e:"")+"]",i,n,r)});else if(n||"object"!==ue.type(e))r(t,e);else for(i in e)S(t+"["+i+"]",e[i],n,r)}function A(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(se)||[];if(ue.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function _(t,e,r,i){function o(s){var c;return u[s]=!0,ue.each(t[s]||[],function(t,s){var l=s(e,r,i);return"string"!=typeof l||a||u[l]?a?!(c=l):n:(e.dataTypes.unshift(l),o(l),!1)}),c}var u={},a=t===xn;return o(e.dataTypes[0])||!u["*"]&&o("*")}function D(t,e){var r,i,o=ue.ajaxSettings.flatOptions||{};for(r in e)e[r]!==n&&((o[r]?t:i||(i={}))[r]=e[r]);return i&&ue.extend(!0,t,i),t}function q(t,e,r){for(var i,o,u,a,s=t.contents,c=t.dataTypes;"*"===c[0];)c.shift(),i===n&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(o in s)if(s[o]&&s[o].test(i)){c.unshift(o);break}if(c[0]in r)u=c[0];else{for(o in r){if(!c[0]||t.converters[o+" "+c[0]]){u=o;break}a||(a=o)}u=u||a}return u?(u!==c[0]&&c.unshift(u),r[u]):n}function O(t,e,n,r){var i,o,u,a,s,c={},l=t.dataTypes.slice();if(l[1])for(u in t.converters)c[u.toLowerCase()]=t.converters[u];for(o=l.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!s&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),s=o,o=l.shift())if("*"===o)o=s;else if("*"!==s&&s!==o){if(u=c[s+" "+o]||c["* "+o],!u)for(i in c)if(a=i.split(" "),a[1]===o&&(u=c[s+" "+a[0]]||c["* "+a[0]])){u===!0?u=c[i]:c[i]!==!0&&(o=a[0],l.unshift(a[1]));break}if(u!==!0)if(u&&t["throws"])e=u(e);else try{e=u(e)}catch(f){return{state:"parsererror",error:u?f:"No conversion from "+s+" to "+o}}}return{state:"success",data:e}}function L(){return setTimeout(function(){An=n}),An=ue.now()}function H(t,e,n){for(var r,i=(Hn[e]||[]).concat(Hn["*"]),o=0,u=i.length;u>o;o++)if(r=i[o].call(n,e,t))return r}function M(t,e,n){var r,i,o=0,u=Ln.length,a=ue.Deferred().always(function(){delete s.elem}),s=function(){if(i)return!1;for(var e=An||L(),n=Math.max(0,c.startTime+c.duration-e),r=n/c.duration||0,o=1-r,u=0,s=c.tweens.length;s>u;u++)c.tweens[u].run(o);return a.notifyWith(t,[c,o,n]),1>o&&s?n:(a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:ue.extend({},e),opts:ue.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:An||L(),duration:n.duration,tweens:[],createTween:function(e,n){var r=ue.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(r),r},stop:function(e){var n=0,r=e?c.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)c.tweens[n].run(1);return e?a.resolveWith(t,[c,e]):a.rejectWith(t,[c,e]),this}}),l=c.props;for(P(l,c.opts.specialEasing);u>o;o++)if(r=Ln[o].call(c,t,l,c.opts))return r;return ue.map(l,H,c),ue.isFunction(c.opts.start)&&c.opts.start.call(t,c),ue.fx.timer(ue.extend(s,{elem:t,anim:c,queue:c.opts.queue})),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}function P(t,e){var n,r,i,o,u;for(n in t)if(r=ue.camelCase(n),i=e[r],o=t[n],ue.isArray(o)&&(i=o[1],o=t[n]=o[0]),n!==r&&(t[r]=o,delete t[n]),u=ue.cssHooks[r],u&&"expand"in u){o=u.expand(o),delete t[r];for(n in o)n in t||(t[n]=o[n],e[n]=i)}else e[r]=i}function F(t,e,r){var i,o,u,a,s,c,l=this,f={},p=t.style,h=t.nodeType&&x(t),d=ve.get(t,"fxshow");r.queue||(s=ue._queueHooks(t,"fx"),null==s.unqueued&&(s.unqueued=0,c=s.empty.fire,s.empty.fire=function(){s.unqueued||c()}),s.unqueued++,l.always(function(){l.always(function(){s.unqueued--,ue.queue(t,"fx").length||s.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(r.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===ue.css(t,"display")&&"none"===ue.css(t,"float")&&(p.display="inline-block")),r.overflow&&(p.overflow="hidden",l.always(function(){p.overflow=r.overflow[0],p.overflowX=r.overflow[1],p.overflowY=r.overflow[2]}));for(i in e)if(o=e[i],Dn.exec(o)){if(delete e[i],u=u||"toggle"===o,o===(h?"hide":"show")){if("show"!==o||!d||d[i]===n)continue;h=!0}f[i]=d&&d[i]||ue.style(t,i)}if(!ue.isEmptyObject(f)){d?"hidden"in d&&(h=d.hidden):d=ve.access(t,"fxshow",{}),u&&(d.hidden=!h),h?ue(t).show():l.done(function(){ue(t).hide()}),l.done(function(){var e;ve.remove(t,"fxshow");for(e in f)ue.style(t,e,f[e])});for(i in f)a=H(h?d[i]:0,i,l),i in d||(d[i]=a.start,h&&(a.end=a.start,a.start="width"===i||"height"===i?1:0))}}function I(t,e,n,r,i){return new I.prototype.init(t,e,n,r,i)}function B(t,e){var n,r={height:t},i=0;for(e=e?1:0;4>i;i+=2-e)n=Ze[i],r["margin"+n]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function R(t){return ue.isWindow(t)?t:9===t.nodeType&&t.defaultView}var W,$,z=typeof n,V=t.location,U=t.document,X=U.documentElement,Y=t.jQuery,J=t.$,G={},Q=[],K="2.0.3",Z=Q.concat,te=Q.push,ee=Q.slice,ne=Q.indexOf,re=G.toString,ie=G.hasOwnProperty,oe=K.trim,ue=function(t,e){return new ue.fn.init(t,e,W)},ae=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,se=/\S+/g,ce=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,le=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,fe=/^-ms-/,pe=/-([\da-z])/gi,he=function(t,e){return e.toUpperCase()},de=function(){U.removeEventListener("DOMContentLoaded",de,!1),t.removeEventListener("load",de,!1),ue.ready()};ue.fn=ue.prototype={jquery:K,constructor:ue,init:function(t,e,r){var i,o;if(!t)return this;if("string"==typeof t){if(i="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:ce.exec(t),!i||!i[1]&&e)return!e||e.jquery?(e||r).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof ue?e[0]:e,ue.merge(this,ue.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:U,!0)),le.test(i[1])&&ue.isPlainObject(e))for(i in e)ue.isFunction(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return o=U.getElementById(i[2]),o&&o.parentNode&&(this.length=1,this[0]=o),this.context=U,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):ue.isFunction(t)?r.ready(t):(t.selector!==n&&(this.selector=t.selector,this.context=t.context),ue.makeArray(t,this))},selector:"",length:0,toArray:function(){return ee.call(this)},get:function(t){return null==t?this.toArray():0>t?this[this.length+t]:this[t]},pushStack:function(t){var e=ue.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return ue.each(this,t,e)},ready:function(t){return ue.ready.promise().done(t),this},slice:function(){return this.pushStack(ee.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},map:function(t){return this.pushStack(ue.map(this,function(e,n){return t.call(e,n,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:te,sort:[].sort,splice:[].splice},ue.fn.init.prototype=ue.fn,ue.extend=ue.fn.extend=function(){var t,e,r,i,o,u,a=arguments[0]||{},s=1,c=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[1]||{},s=2),"object"==typeof a||ue.isFunction(a)||(a={}),c===s&&(a=this,--s);c>s;s++)if(null!=(t=arguments[s]))for(e in t)r=a[e],i=t[e],a!==i&&(l&&i&&(ue.isPlainObject(i)||(o=ue.isArray(i)))?(o?(o=!1,u=r&&ue.isArray(r)?r:[]):u=r&&ue.isPlainObject(r)?r:{},a[e]=ue.extend(l,u,i)):i!==n&&(a[e]=i));return a},ue.extend({expando:"jQuery"+(K+Math.random()).replace(/\D/g,""),noConflict:function(e){return t.$===ue&&(t.$=J),e&&t.jQuery===ue&&(t.jQuery=Y),ue},isReady:!1,readyWait:1,holdReady:function(t){t?ue.readyWait++:ue.ready(!0)},ready:function(t){(t===!0?--ue.readyWait:ue.isReady)||(ue.isReady=!0,t!==!0&&--ue.readyWait>0||($.resolveWith(U,[ue]),ue.fn.trigger&&ue(U).trigger("ready").off("ready")))},isFunction:function(t){return"function"===ue.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?G[re.call(t)]||"object":typeof t},isPlainObject:function(t){if("object"!==ue.type(t)||t.nodeType||ue.isWindow(t))return!1;try{if(t.constructor&&!ie.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}return!0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},error:function(t){throw Error(t)},parseHTML:function(t,e,n){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(n=e,e=!1),e=e||U;var r=le.exec(t),i=!n&&[];return r?[e.createElement(r[1])]:(r=ue.buildFragment([t],e,i),i&&ue(i).remove(),ue.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(t){var e,r;if(!t||"string"!=typeof t)return null;try{r=new DOMParser,e=r.parseFromString(t,"text/xml")}catch(i){e=n}return(!e||e.getElementsByTagName("parsererror").length)&&ue.error("Invalid XML: "+t),e},noop:function(){},globalEval:function(t){var e,n=eval;t=ue.trim(t),t&&(1===t.indexOf("use strict")?(e=U.createElement("script"),e.text=t,U.head.appendChild(e).parentNode.removeChild(e)):n(t))},camelCase:function(t){return t.replace(fe,"ms-").replace(pe,he)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,n){var i,o=0,u=t.length,a=r(t);if(n){if(a)for(;u>o&&(i=e.apply(t[o],n),i!==!1);o++);else for(o in t)if(i=e.apply(t[o],n),i===!1)break}else if(a)for(;u>o&&(i=e.call(t[o],o,t[o]),i!==!1);o++);else for(o in t)if(i=e.call(t[o],o,t[o]),i===!1)break;return t},trim:function(t){return null==t?"":oe.call(t)},makeArray:function(t,e){var n=e||[];return null!=t&&(r(Object(t))?ue.merge(n,"string"==typeof t?[t]:t):te.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:ne.call(e,t,n)},merge:function(t,e){var r=e.length,i=t.length,o=0;if("number"==typeof r)for(;r>o;o++)t[i++]=e[o];else for(;e[o]!==n;)t[i++]=e[o++];return t.length=i,t},grep:function(t,e,n){var r,i=[],o=0,u=t.length;for(n=!!n;u>o;o++)r=!!e(t[o],o),n!==r&&i.push(t[o]);return i},map:function(t,e,n){var i,o=0,u=t.length,a=r(t),s=[];if(a)for(;u>o;o++)i=e(t[o],o,n),null!=i&&(s[s.length]=i);else for(o in t)i=e(t[o],o,n),null!=i&&(s[s.length]=i);return Z.apply([],s)},guid:1,proxy:function(t,e){var r,i,o;return"string"==typeof e&&(r=t[e],e=t,t=r),ue.isFunction(t)?(i=ee.call(arguments,2),o=function(){return t.apply(e||this,i.concat(ee.call(arguments)))},o.guid=t.guid=t.guid||ue.guid++,o):n},access:function(t,e,r,i,o,u,a){var s=0,c=t.length,l=null==r;if("object"===ue.type(r)){o=!0;for(s in r)ue.access(t,e,s,r[s],!0,u,a)}else if(i!==n&&(o=!0,ue.isFunction(i)||(a=!0),l&&(a?(e.call(t,i),e=null):(l=e,e=function(t,e,n){return l.call(ue(t),n)})),e))for(;c>s;s++)e(t[s],r,a?i:i.call(t[s],s,e(t[s],r)));return o?t:l?e.call(t):c?e(t[0],r):u},now:Date.now,swap:function(t,e,n,r){var i,o,u={};for(o in e)u[o]=t.style[o],t.style[o]=e[o];i=n.apply(t,r||[]);for(o in e)t.style[o]=u[o];return i}}),ue.ready.promise=function(e){return $||($=ue.Deferred(),"complete"===U.readyState?setTimeout(ue.ready):(U.addEventListener("DOMContentLoaded",de,!1),t.addEventListener("load",de,!1))),$.promise(e)},ue.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){G["[object "+e+"]"]=e.toLowerCase()}),W=ue(U),function(t,e){function n(t,e,n,r){var i,o,u,a,s,c,l,f,d,g;if((e?e.ownerDocument||e:B)!==q&&D(e),e=e||q,n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=e.nodeType)&&9!==a)return[];if(L&&!r){if(i=be.exec(t))if(u=i[1]){if(9===a){if(o=e.getElementById(u),!o||!o.parentNode)return n;if(o.id===u)return n.push(o),n}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(u))&&F(e,o)&&o.id===u)return n.push(o),n}else{if(i[2])return te.apply(n,e.getElementsByTagName(t)),n;if((u=i[3])&&T.getElementsByClassName&&e.getElementsByClassName)return te.apply(n,e.getElementsByClassName(u)),n}if(T.qsa&&(!H||!H.test(t))){if(f=l=I,d=e,g=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(c=p(t),(l=e.getAttribute("id"))?f=l.replace(Ce,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+h(c[s]);d=he.test(t)&&e.parentNode||e,g=c.join(",")}if(g)try{return te.apply(n,d.querySelectorAll(g)),n}catch(m){}finally{l||e.removeAttribute("id")}}}return w(t.replace(le,"$1"),e,n,r)}function r(){function t(n,r){return e.push(n+=" ")>E.cacheLength&&delete t[e.shift()],t[n]=r}var e=[];return t}function i(t){return t[I]=!0,t}function o(t){var e=q.createElement("div");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function u(t,e){for(var n=t.split("|"),r=t.length;r--;)E.attrHandle[n[r]]=e}function a(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||J)-(~t.sourceIndex||J);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function s(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function c(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function l(t){return i(function(e){return e=+e,i(function(n,r){for(var i,o=t([],n.length,e),u=o.length;u--;)n[i=o[u]]&&(n[i]=!(r[i]=n[i]))})})}function f(){}function p(t,e){var r,i,o,u,a,s,c,l=z[t+" "];if(l)return e?0:l.slice(0);for(a=t,s=[],c=E.preFilter;a;){(!r||(i=fe.exec(a)))&&(i&&(a=a.slice(i[0].length)||a),s.push(o=[])),r=!1,(i=pe.exec(a))&&(r=i.shift(),o.push({value:r,type:i[0].replace(le," ")}),a=a.slice(r.length));for(u in E.filter)!(i=ve[u].exec(a))||c[u]&&!(i=c[u](i))||(r=i.shift(),o.push({value:r,type:u,matches:i}),a=a.slice(r.length));if(!r)break}return e?a.length:a?n.error(t):z(t,s).slice(0)}function h(t){for(var e=0,n=t.length,r="";n>e;e++)r+=t[e].value;return r}function d(t,e,n){var r=e.dir,i=n&&"parentNode"===r,o=W++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||i)return t(e,n,o)}:function(e,n,u){var a,s,c,l=R+" "+o;if(u){for(;e=e[r];)if((1===e.nodeType||i)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||i)if(c=e[I]||(e[I]={}),(s=c[r])&&s[0]===l){if((a=s[1])===!0||a===k)return a===!0}else if(s=c[r]=[l],s[1]=t(e,n,u)||k,s[1]===!0)return!0}}function g(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function m(t,e,n,r,i){for(var o,u=[],a=0,s=t.length,c=null!=e;s>a;a++)(o=t[a])&&(!n||n(o,r,i))&&(u.push(o),c&&e.push(a));return u}function v(t,e,n,r,o,u){return r&&!r[I]&&(r=v(r)),o&&!o[I]&&(o=v(o,u)),i(function(i,u,a,s){var c,l,f,p=[],h=[],d=u.length,g=i||x(e||"*",a.nodeType?[a]:a,[]),v=!t||!i&&e?g:m(g,p,t,a,s),y=n?o||(i?t:d||r)?[]:u:v;if(n&&n(v,y,a,s),r)for(c=m(y,h),r(c,[],a,s),l=c.length;l--;)(f=c[l])&&(y[h[l]]=!(v[h[l]]=f));if(i){if(o||t){if(o){for(c=[],l=y.length;l--;)(f=y[l])&&c.push(v[l]=f);o(null,y=[],c,s)}for(l=y.length;l--;)(f=y[l])&&(c=o?ne.call(i,f):p[l])>-1&&(i[c]=!(u[c]=f))}}else y=m(y===u?y.splice(d,y.length):y),o?o(null,u,y,s):te.apply(u,y)})}function y(t){for(var e,n,r,i=t.length,o=E.relative[t[0].type],u=o||E.relative[" "],a=o?1:0,s=d(function(t){return t===e},u,!0),c=d(function(t){return ne.call(e,t)>-1},u,!0),l=[function(t,n,r){return!o&&(r||n!==A)||((e=n).nodeType?s(t,n,r):c(t,n,r))}];i>a;a++)if(n=E.relative[t[a].type])l=[d(g(l),n)];else{if(n=E.filter[t[a].type].apply(null,t[a].matches),n[I]){for(r=++a;i>r&&!E.relative[t[r].type];r++);return v(a>1&&g(l),a>1&&h(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(le,"$1"),n,r>a&&y(t.slice(a,r)),i>r&&y(t=t.slice(r)),i>r&&h(t))}l.push(n)}return g(l)}function b(t,e){var r=0,o=e.length>0,u=t.length>0,a=function(i,a,s,c,l){var f,p,h,d=[],g=0,v="0",y=i&&[],b=null!=l,x=A,w=i||u&&E.find.TAG("*",l&&a.parentNode||a),C=R+=null==x?1:Math.random()||.1;for(b&&(A=a!==q&&a,k=r);null!=(f=w[v]);v++){if(u&&f){for(p=0;h=t[p++];)if(h(f,a,s)){c.push(f);break}b&&(R=C,k=++r)}o&&((f=!h&&f)&&g--,i&&y.push(f))}if(g+=v,o&&v!==g){for(p=0;h=e[p++];)h(y,d,a,s);if(i){if(g>0)for(;v--;)y[v]||d[v]||(d[v]=K.call(c));d=m(d)}te.apply(c,d),b&&!i&&d.length>0&&g+e.length>1&&n.uniqueSort(c)}return b&&(R=C,A=x),y};return o?i(a):a}function x(t,e,r){for(var i=0,o=e.length;o>i;i++)n(t,e[i],r);return r}function w(t,e,n,r){var i,o,u,a,s,c=p(t);if(!r&&1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(u=o[0]).type&&T.getById&&9===e.nodeType&&L&&E.relative[o[1].type]){if(e=(E.find.ID(u.matches[0].replace(Te,ke),e)||[])[0],!e)return n;t=t.slice(o.shift().value.length)}for(i=ve.needsContext.test(t)?0:o.length;i--&&(u=o[i],!E.relative[a=u.type]);)if((s=E.find[a])&&(r=s(u.matches[0].replace(Te,ke),he.test(o[0].type)&&e.parentNode||e))){if(o.splice(i,1),t=r.length&&h(o),!t)return te.apply(n,r),n;break}}return S(t,c)(r,e,!L,n,he.test(t)),n}var C,T,k,E,N,j,S,A,_,D,q,O,L,H,M,P,F,I="sizzle"+-new Date,B=t.document,R=0,W=0,$=r(),z=r(),V=r(),U=!1,X=function(t,e){return t===e?(U=!0,0):0},Y=typeof e,J=1<<31,G={}.hasOwnProperty,Q=[],K=Q.pop,Z=Q.push,te=Q.push,ee=Q.slice,ne=Q.indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},re="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ie="[\\x20\\t\\r\\n\\f]",oe="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ae=oe.replace("w","w#"),se="\\["+ie+"*("+oe+")"+ie+"*(?:([*^$|!~]?=)"+ie+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+ae+")|)|)"+ie+"*\\]",ce=":("+oe+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+se.replace(3,8)+")*)|.*)\\)|)",le=RegExp("^"+ie+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ie+"+$","g"),fe=RegExp("^"+ie+"*,"+ie+"*"),pe=RegExp("^"+ie+"*([>+~]|"+ie+")"+ie+"*"),he=RegExp(ie+"*[+~]"),de=RegExp("="+ie+"*([^\\]'\"]*)"+ie+"*\\]","g"),ge=RegExp(ce),me=RegExp("^"+ae+"$"),ve={ID:RegExp("^#("+oe+")"),CLASS:RegExp("^\\.("+oe+")"),TAG:RegExp("^("+oe.replace("w","w*")+")"),ATTR:RegExp("^"+se),PSEUDO:RegExp("^"+ce),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ie+"*(even|odd|(([+-]|)(\\d*)n|)"+ie+"*(?:([+-]|)"+ie+"*(\\d+)|))"+ie+"*\\)|)","i"),bool:RegExp("^(?:"+re+")$","i"),needsContext:RegExp("^"+ie+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ie+"*((?:-\\d)?\\d*)"+ie+"*\\)|)(?=[^-]|$)","i")},ye=/^[^{]+\{\s*\[native \w/,be=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xe=/^(?:input|select|textarea|button)$/i,we=/^h\d$/i,Ce=/'|\\/g,Te=RegExp("\\\\([\\da-f]{1,6}"+ie+"?|("+ie+")|.)","ig"),ke=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{te.apply(Q=ee.call(B.childNodes),B.childNodes),Q[B.childNodes.length].nodeType}catch(Ee){te={apply:Q.length?function(t,e){Z.apply(t,ee.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}j=n.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1},T=n.support={},D=n.setDocument=function(t){var n=t?t.ownerDocument||t:B,r=n.defaultView;return n!==q&&9===n.nodeType&&n.documentElement?(q=n,O=n.documentElement,L=!j(n),r&&r.attachEvent&&r!==r.top&&r.attachEvent("onbeforeunload",function(){D()}),T.attributes=o(function(t){return t.className="i",!t.getAttribute("className")}),T.getElementsByTagName=o(function(t){return t.appendChild(n.createComment("")),!t.getElementsByTagName("*").length}),T.getElementsByClassName=o(function(t){return t.innerHTML="<div class='a'></div><div class='a i'></div>",t.firstChild.className="i",2===t.getElementsByClassName("i").length}),T.getById=o(function(t){return O.appendChild(t).id=I,!n.getElementsByName||!n.getElementsByName(I).length}),T.getById?(E.find.ID=function(t,e){if(typeof e.getElementById!==Y&&L){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},E.filter.ID=function(t){var e=t.replace(Te,ke);return function(t){return t.getAttribute("id")===e}}):(delete E.find.ID,E.filter.ID=function(t){var e=t.replace(Te,ke);return function(t){var n=typeof t.getAttributeNode!==Y&&t.getAttributeNode("id");return n&&n.value===e}}),E.find.TAG=T.getElementsByTagName?function(t,n){return typeof n.getElementsByTagName!==Y?n.getElementsByTagName(t):e}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},E.find.CLASS=T.getElementsByClassName&&function(t,n){return typeof n.getElementsByClassName!==Y&&L?n.getElementsByClassName(t):e},M=[],H=[],(T.qsa=ye.test(n.querySelectorAll))&&(o(function(t){t.innerHTML="<select><option selected=''></option></select>",t.querySelectorAll("[selected]").length||H.push("\\["+ie+"*(?:value|"+re+")"),t.querySelectorAll(":checked").length||H.push(":checked")}),o(function(t){var e=n.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("t",""),t.querySelectorAll("[t^='']").length&&H.push("[*^$]="+ie+"*(?:''|\"\")"),t.querySelectorAll(":enabled").length||H.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),H.push(",.*:")})),(T.matchesSelector=ye.test(P=O.webkitMatchesSelector||O.mozMatchesSelector||O.oMatchesSelector||O.msMatchesSelector))&&o(function(t){T.disconnectedMatch=P.call(t,"div"),P.call(t,"[s!='']:x"),M.push("!=",ce)}),H=H.length&&RegExp(H.join("|")),M=M.length&&RegExp(M.join("|")),F=ye.test(O.contains)||O.compareDocumentPosition?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},X=O.compareDocumentPosition?function(t,e){if(t===e)return U=!0,0;var r=e.compareDocumentPosition&&t.compareDocumentPosition&&t.compareDocumentPosition(e);return r?1&r||!T.sortDetached&&e.compareDocumentPosition(t)===r?t===n||F(B,t)?-1:e===n||F(B,e)?1:_?ne.call(_,t)-ne.call(_,e):0:4&r?-1:1:t.compareDocumentPosition?-1:1}:function(t,e){var r,i=0,o=t.parentNode,u=e.parentNode,s=[t],c=[e];if(t===e)return U=!0,0;if(!o||!u)return t===n?-1:e===n?1:o?-1:u?1:_?ne.call(_,t)-ne.call(_,e):0;if(o===u)return a(t,e);for(r=t;r=r.parentNode;)s.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;s[i]===c[i];)i++;return i?a(s[i],c[i]):s[i]===B?-1:c[i]===B?1:0},n):q},n.matches=function(t,e){return n(t,null,null,e)},n.matchesSelector=function(t,e){if((t.ownerDocument||t)!==q&&D(t),e=e.replace(de,"='$1']"),!(!T.matchesSelector||!L||M&&M.test(e)||H&&H.test(e)))try{var r=P.call(t,e);if(r||T.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return n(e,q,null,[t]).length>0},n.contains=function(t,e){return(t.ownerDocument||t)!==q&&D(t),F(t,e)},n.attr=function(t,n){(t.ownerDocument||t)!==q&&D(t);var r=E.attrHandle[n.toLowerCase()],i=r&&G.call(E.attrHandle,n.toLowerCase())?r(t,n,!L):e;return i===e?T.attributes||!L?t.getAttribute(n):(i=t.getAttributeNode(n))&&i.specified?i.value:null:i},n.error=function(t){throw Error("Syntax error, unrecognized expression: "+t)},n.uniqueSort=function(t){var e,n=[],r=0,i=0;if(U=!T.detectDuplicates,_=!T.sortStable&&t.slice(0),t.sort(X),U){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)t.splice(n[r],1)}return t},N=n.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=N(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r];r++)n+=N(e);return n},E=n.selectors={cacheLength:50,createPseudo:i,match:ve,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Te,ke),t[3]=(t[4]||t[5]||"").replace(Te,ke),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||n.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&n.error(t[0]),t},PSEUDO:function(t){var n,r=!t[5]&&t[2];return ve.CHILD.test(t[0])?null:(t[3]&&t[4]!==e?t[2]=t[4]:r&&ge.test(r)&&(n=p(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(t[0]=t[0].slice(0,n),t[2]=r.slice(0,n)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Te,ke).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=$[t+" "];return e||(e=RegExp("(^|"+ie+")"+t+"("+ie+"|$)"))&&$(t,function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==Y&&t.getAttribute("class")||"")})},ATTR:function(t,e,r){return function(i){var o=n.attr(i,t);return null==o?"!="===e:e?(o+="","="===e?o===r:"!="===e?o!==r:"^="===e?r&&0===o.indexOf(r):"*="===e?r&&o.indexOf(r)>-1:"$="===e?r&&o.slice(-r.length)===r:"~="===e?(" "+o+" ").indexOf(r)>-1:"|="===e?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,s){var c,l,f,p,h,d,g=o!==u?"nextSibling":"previousSibling",m=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!s&&!a;if(m){if(o){for(;g;){for(f=e;f=f[g];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;d=g="only"===t&&!d&&"nextSibling"}return!0}if(d=[u?m.firstChild:m.lastChild],u&&y){for(l=m[I]||(m[I]={}),c=l[t]||[],h=c[0]===R&&c[1],p=c[0]===R&&c[2],f=h&&m.childNodes[h];f=++h&&f&&f[g]||(p=h=0)||d.pop();)if(1===f.nodeType&&++p&&f===e){l[t]=[R,h,p];break}}else if(y&&(c=(e[I]||(e[I]={}))[t])&&c[0]===R)p=c[1];else for(;(f=++h&&f&&f[g]||(p=h=0)||d.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++p||(y&&((f[I]||(f[I]={}))[t]=[R,p]),f!==e)););return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(t,e){var r,o=E.pseudos[t]||E.setFilters[t.toLowerCase()]||n.error("unsupported pseudo: "+t);return o[I]?o(e):o.length>1?(r=[t,t,"",e],E.setFilters.hasOwnProperty(t.toLowerCase())?i(function(t,n){for(var r,i=o(t,e),u=i.length;u--;)r=ne.call(t,i[u]),t[r]=!(n[r]=i[u])}):function(t){return o(t,0,r)}):o}},pseudos:{not:i(function(t){var e=[],n=[],r=S(t.replace(le,"$1"));return r[I]?i(function(t,e,n,i){for(var o,u=r(t,null,i,[]),a=t.length;a--;)(o=u[a])&&(t[a]=!(e[a]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),!n.pop()}}),has:i(function(t){return function(e){return n(t,e).length>0}}),contains:i(function(t){return function(e){return(e.textContent||e.innerText||N(e)).indexOf(t)>-1}}),lang:i(function(t){return me.test(t||"")||n.error("unsupported lang: "+t),t=t.replace(Te,ke).toLowerCase(),function(e){var n;do if(n=L?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===O},focus:function(t){return t===q.activeElement&&(!q.hasFocus||q.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeName>"@"||3===t.nodeType||4===t.nodeType)return!1;return!0},parent:function(t){return!E.pseudos.empty(t)},header:function(t){return we.test(t.nodeName)},input:function(t){return xe.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||e.toLowerCase()===t.type)},first:l(function(){return[0]}),last:l(function(t,e){return[e-1]
}),eq:l(function(t,e,n){return[0>n?n+e:n]}),even:l(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:l(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:l(function(t,e,n){for(var r=0>n?n+e:n;--r>=0;)t.push(r);return t}),gt:l(function(t,e,n){for(var r=0>n?n+e:n;e>++r;)t.push(r);return t})}},E.pseudos.nth=E.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})E.pseudos[C]=s(C);for(C in{submit:!0,reset:!0})E.pseudos[C]=c(C);f.prototype=E.filters=E.pseudos,E.setFilters=new f,S=n.compile=function(t,e){var n,r=[],i=[],o=V[t+" "];if(!o){for(e||(e=p(t)),n=e.length;n--;)o=y(e[n]),o[I]?r.push(o):i.push(o);o=V(t,b(i,r))}return o},T.sortStable=I.split("").sort(X).join("")===I,T.detectDuplicates=U,D(),T.sortDetached=o(function(t){return 1&t.compareDocumentPosition(q.createElement("div"))}),o(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||u("type|href|height|width",function(t,n,r){return r?e:t.getAttribute(n,"type"===n.toLowerCase()?1:2)}),T.attributes&&o(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||u("value",function(t,n,r){return r||"input"!==t.nodeName.toLowerCase()?e:t.defaultValue}),o(function(t){return null==t.getAttribute("disabled")})||u(re,function(t,n,r){var i;return r?e:(i=t.getAttributeNode(n))&&i.specified?i.value:t[n]===!0?n.toLowerCase():null}),ue.find=n,ue.expr=n.selectors,ue.expr[":"]=ue.expr.pseudos,ue.unique=n.uniqueSort,ue.text=n.getText,ue.isXMLDoc=n.isXML,ue.contains=n.contains}(t);var ge={};ue.Callbacks=function(t){t="string"==typeof t?ge[t]||i(t):ue.extend({},t);var e,r,o,u,a,s,c=[],l=!t.once&&[],f=function(n){for(e=t.memory&&n,r=!0,s=u||0,u=0,a=c.length,o=!0;c&&a>s;s++)if(c[s].apply(n[0],n[1])===!1&&t.stopOnFalse){e=!1;break}o=!1,c&&(l?l.length&&f(l.shift()):e?c=[]:p.disable())},p={add:function(){if(c){var n=c.length;(function r(e){ue.each(e,function(e,n){var i=ue.type(n);"function"===i?t.unique&&p.has(n)||c.push(n):n&&n.length&&"string"!==i&&r(n)})})(arguments),o?a=c.length:e&&(u=n,f(e))}return this},remove:function(){return c&&ue.each(arguments,function(t,e){for(var n;(n=ue.inArray(e,c,n))>-1;)c.splice(n,1),o&&(a>=n&&a--,s>=n&&s--)}),this},has:function(t){return t?ue.inArray(t,c)>-1:!(!c||!c.length)},empty:function(){return c=[],a=0,this},disable:function(){return c=l=e=n,this},disabled:function(){return!c},lock:function(){return l=n,e||p.disable(),this},locked:function(){return!l},fireWith:function(t,e){return!c||r&&!l||(e=e||[],e=[t,e.slice?e.slice():e],o?l.push(e):f(e)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!r}};return p},ue.extend({Deferred:function(t){var e=[["resolve","done",ue.Callbacks("once memory"),"resolved"],["reject","fail",ue.Callbacks("once memory"),"rejected"],["notify","progress",ue.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return ue.Deferred(function(n){ue.each(e,function(e,o){var u=o[0],a=ue.isFunction(t[e])&&t[e];i[o[1]](function(){var t=a&&a.apply(this,arguments);t&&ue.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[u+"With"](this===r?n.promise():this,a?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?ue.extend(t,r):r}},i={};return r.pipe=r.then,ue.each(e,function(t,o){var u=o[2],a=o[3];r[o[1]]=u.add,a&&u.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=u.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,r,i=0,o=ee.call(arguments),u=o.length,a=1!==u||t&&ue.isFunction(t.promise)?u:0,s=1===a?t:ue.Deferred(),c=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?ee.call(arguments):i,r===e?s.notifyWith(n,r):--a||s.resolveWith(n,r)}};if(u>1)for(e=Array(u),n=Array(u),r=Array(u);u>i;i++)o[i]&&ue.isFunction(o[i].promise)?o[i].promise().done(c(i,r,o)).fail(s.reject).progress(c(i,n,e)):--a;return a||s.resolveWith(r,o),s.promise()}}),ue.support=function(e){var n=U.createElement("input"),r=U.createDocumentFragment(),i=U.createElement("div"),o=U.createElement("select"),u=o.appendChild(U.createElement("option"));return n.type?(n.type="checkbox",e.checkOn=""!==n.value,e.optSelected=u.selected,e.reliableMarginRight=!0,e.boxSizingReliable=!0,e.pixelPosition=!1,n.checked=!0,e.noCloneChecked=n.cloneNode(!0).checked,o.disabled=!0,e.optDisabled=!u.disabled,n=U.createElement("input"),n.value="t",n.type="radio",e.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),e.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,e.focusinBubbles="onfocusin"in t,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",e.clearCloneStyle="content-box"===i.style.backgroundClip,ue(function(){var n,r,o="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",u=U.getElementsByTagName("body")[0];u&&(n=U.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",ue.swap(u,null!=u.style.zoom?{zoom:1}:{},function(){e.boxSizing=4===i.offsetWidth}),t.getComputedStyle&&(e.pixelPosition="1%"!==(t.getComputedStyle(i,null)||{}).top,e.boxSizingReliable="4px"===(t.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(U.createElement("div")),r.style.cssText=i.style.cssText=o,r.style.marginRight=r.style.width="0",i.style.width="1px",e.reliableMarginRight=!parseFloat((t.getComputedStyle(r,null)||{}).marginRight)),u.removeChild(n))}),e):e}({});var me,ve,ye=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,be=/([A-Z])/g;o.uid=1,o.accepts=function(t){return t.nodeType?1===t.nodeType||9===t.nodeType:!0},o.prototype={key:function(t){if(!o.accepts(t))return 0;var e={},n=t[this.expando];if(!n){n=o.uid++;try{e[this.expando]={value:n},Object.defineProperties(t,e)}catch(r){e[this.expando]=n,ue.extend(t,e)}}return this.cache[n]||(this.cache[n]={}),n},set:function(t,e,n){var r,i=this.key(t),o=this.cache[i];if("string"==typeof e)o[e]=n;else if(ue.isEmptyObject(o))ue.extend(this.cache[i],e);else for(r in e)o[r]=e[r];return o},get:function(t,e){var r=this.cache[this.key(t)];return e===n?r:r[e]},access:function(t,e,r){var i;return e===n||e&&"string"==typeof e&&r===n?(i=this.get(t,e),i!==n?i:this.get(t,ue.camelCase(e))):(this.set(t,e,r),r!==n?r:e)},remove:function(t,e){var r,i,o,u=this.key(t),a=this.cache[u];if(e===n)this.cache[u]={};else{ue.isArray(e)?i=e.concat(e.map(ue.camelCase)):(o=ue.camelCase(e),e in a?i=[e,o]:(i=o,i=i in a?[i]:i.match(se)||[])),r=i.length;for(;r--;)delete a[i[r]]}},hasData:function(t){return!ue.isEmptyObject(this.cache[t[this.expando]]||{})},discard:function(t){t[this.expando]&&delete this.cache[t[this.expando]]}},me=new o,ve=new o,ue.extend({acceptData:o.accepts,hasData:function(t){return me.hasData(t)||ve.hasData(t)},data:function(t,e,n){return me.access(t,e,n)},removeData:function(t,e){me.remove(t,e)},_data:function(t,e,n){return ve.access(t,e,n)},_removeData:function(t,e){ve.remove(t,e)}}),ue.fn.extend({data:function(t,e){var r,i,o=this[0],a=0,s=null;if(t===n){if(this.length&&(s=me.get(o),1===o.nodeType&&!ve.get(o,"hasDataAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=ue.camelCase(i.slice(5)),u(o,i,s[i]));ve.set(o,"hasDataAttrs",!0)}return s}return"object"==typeof t?this.each(function(){me.set(this,t)}):ue.access(this,function(e){var r,i=ue.camelCase(t);if(o&&e===n){if(r=me.get(o,t),r!==n)return r;if(r=me.get(o,i),r!==n)return r;if(r=u(o,i,n),r!==n)return r}else this.each(function(){var r=me.get(this,i);me.set(this,i,e),-1!==t.indexOf("-")&&r!==n&&me.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){me.remove(this,t)})}}),ue.extend({queue:function(t,e,r){var i;return t?(e=(e||"fx")+"queue",i=ve.get(t,e),r&&(!i||ue.isArray(r)?i=ve.access(t,e,ue.makeArray(r)):i.push(r)),i||[]):n},dequeue:function(t,e){e=e||"fx";var n=ue.queue(t,e),r=n.length,i=n.shift(),o=ue._queueHooks(t,e),u=function(){ue.dequeue(t,e)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,u,o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return ve.get(t,n)||ve.access(t,n,{empty:ue.Callbacks("once memory").add(function(){ve.remove(t,[e+"queue",n])})})}}),ue.fn.extend({queue:function(t,e){var r=2;return"string"!=typeof t&&(e=t,t="fx",r--),r>arguments.length?ue.queue(this[0],t):e===n?this:this.each(function(){var n=ue.queue(this,t,e);ue._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&ue.dequeue(this,t)})},dequeue:function(t){return this.each(function(){ue.dequeue(this,t)})},delay:function(t,e){return t=ue.fx?ue.fx.speeds[t]||t:t,e=e||"fx",this.queue(e,function(e,n){var r=setTimeout(e,t);n.stop=function(){clearTimeout(r)}})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var r,i=1,o=ue.Deferred(),u=this,a=this.length,s=function(){--i||o.resolveWith(u,[u])};for("string"!=typeof t&&(e=t,t=n),t=t||"fx";a--;)r=ve.get(u[a],t+"queueHooks"),r&&r.empty&&(i++,r.empty.add(s));return s(),o.promise(e)}});var xe,we,Ce=/[\t\r\n\f]/g,Te=/\r/g,ke=/^(?:input|select|textarea|button)$/i;ue.fn.extend({attr:function(t,e){return ue.access(this,ue.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){ue.removeAttr(this,t)})},prop:function(t,e){return ue.access(this,ue.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[ue.propFix[t]||t]})},addClass:function(t){var e,n,r,i,o,u=0,a=this.length,s="string"==typeof t&&t;if(ue.isFunction(t))return this.each(function(e){ue(this).addClass(t.call(this,e,this.className))});if(s)for(e=(t||"").match(se)||[];a>u;u++)if(n=this[u],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Ce," "):" ")){for(o=0;i=e[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=ue.trim(r)}return this},removeClass:function(t){var e,n,r,i,o,u=0,a=this.length,s=0===arguments.length||"string"==typeof t&&t;if(ue.isFunction(t))return this.each(function(e){ue(this).removeClass(t.call(this,e,this.className))});if(s)for(e=(t||"").match(se)||[];a>u;u++)if(n=this[u],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Ce," "):"")){for(o=0;i=e[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=t?ue.trim(r):""}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):ue.isFunction(t)?this.each(function(n){ue(this).toggleClass(t.call(this,n,this.className,e),e)}):this.each(function(){if("string"===n)for(var e,r=0,i=ue(this),o=t.match(se)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else(n===z||"boolean"===n)&&(this.className&&ve.set(this,"__className__",this.className),this.className=this.className||t===!1?"":ve.get(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Ce," ").indexOf(e)>=0)return!0;return!1},val:function(t){var e,r,i,o=this[0];{if(arguments.length)return i=ue.isFunction(t),this.each(function(r){var o;1===this.nodeType&&(o=i?t.call(this,r,ue(this).val()):t,null==o?o="":"number"==typeof o?o+="":ue.isArray(o)&&(o=ue.map(o,function(t){return null==t?"":t+""})),e=ue.valHooks[this.type]||ue.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&e.set(this,o,"value")!==n||(this.value=o))});if(o)return e=ue.valHooks[o.type]||ue.valHooks[o.nodeName.toLowerCase()],e&&"get"in e&&(r=e.get(o,"value"))!==n?r:(r=o.value,"string"==typeof r?r.replace(Te,""):null==r?"":r)}}}),ue.extend({valHooks:{option:{get:function(t){var e=t.attributes.value;return!e||e.specified?t.value:t.text}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||0>i,u=o?null:[],a=o?i+1:r.length,s=0>i?a:o?i:0;a>s;s++)if(n=r[s],!(!n.selected&&s!==i||(ue.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&ue.nodeName(n.parentNode,"optgroup"))){if(e=ue(n).val(),o)return e;u.push(e)}return u},set:function(t,e){for(var n,r,i=t.options,o=ue.makeArray(e),u=i.length;u--;)r=i[u],(r.selected=ue.inArray(ue(r).val(),o)>=0)&&(n=!0);return n||(t.selectedIndex=-1),o}}},attr:function(t,e,r){var i,o,u=t.nodeType;if(t&&3!==u&&8!==u&&2!==u)return typeof t.getAttribute===z?ue.prop(t,e,r):(1===u&&ue.isXMLDoc(t)||(e=e.toLowerCase(),i=ue.attrHooks[e]||(ue.expr.match.bool.test(e)?we:xe)),r===n?i&&"get"in i&&null!==(o=i.get(t,e))?o:(o=ue.find.attr(t,e),null==o?n:o):null!==r?i&&"set"in i&&(o=i.set(t,r,e))!==n?o:(t.setAttribute(e,r+""),r):(ue.removeAttr(t,e),n))},removeAttr:function(t,e){var n,r,i=0,o=e&&e.match(se);if(o&&1===t.nodeType)for(;n=o[i++];)r=ue.propFix[n]||n,ue.expr.match.bool.test(n)&&(t[r]=!1),t.removeAttribute(n)},attrHooks:{type:{set:function(t,e){if(!ue.support.radioValue&&"radio"===e&&ue.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,r){var i,o,u,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return u=1!==a||!ue.isXMLDoc(t),u&&(e=ue.propFix[e]||e,o=ue.propHooks[e]),r!==n?o&&"set"in o&&(i=o.set(t,r,e))!==n?i:t[e]=r:o&&"get"in o&&null!==(i=o.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){return t.hasAttribute("tabindex")||ke.test(t.nodeName)||t.href?t.tabIndex:-1}}}}),we={set:function(t,e,n){return e===!1?ue.removeAttr(t,n):t.setAttribute(n,n),n}},ue.each(ue.expr.match.bool.source.match(/\w+/g),function(t,e){var r=ue.expr.attrHandle[e]||ue.find.attr;ue.expr.attrHandle[e]=function(t,e,i){var o=ue.expr.attrHandle[e],u=i?n:(ue.expr.attrHandle[e]=n)!=r(t,e,i)?e.toLowerCase():null;return ue.expr.attrHandle[e]=o,u}}),ue.support.optSelected||(ue.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null}}),ue.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ue.propFix[this.toLowerCase()]=this}),ue.each(["radio","checkbox"],function(){ue.valHooks[this]={set:function(t,e){return ue.isArray(e)?t.checked=ue.inArray(ue(t).val(),e)>=0:n}},ue.support.checkOn||(ue.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Ee=/^key/,Ne=/^(?:mouse|contextmenu)|click/,je=/^(?:focusinfocus|focusoutblur)$/,Se=/^([^.]*)(?:\.(.+)|)$/;ue.event={global:{},add:function(t,e,r,i,o){var u,a,s,c,l,f,p,h,d,g,m,v=ve.get(t);if(v){for(r.handler&&(u=r,r=u.handler,o=u.selector),r.guid||(r.guid=ue.guid++),(c=v.events)||(c=v.events={}),(a=v.handle)||(a=v.handle=function(t){return typeof ue===z||t&&ue.event.triggered===t.type?n:ue.event.dispatch.apply(a.elem,arguments)},a.elem=t),e=(e||"").match(se)||[""],l=e.length;l--;)s=Se.exec(e[l])||[],d=m=s[1],g=(s[2]||"").split(".").sort(),d&&(p=ue.event.special[d]||{},d=(o?p.delegateType:p.bindType)||d,p=ue.event.special[d]||{},f=ue.extend({type:d,origType:m,data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&ue.expr.match.needsContext.test(o),namespace:g.join(".")},u),(h=c[d])||(h=c[d]=[],h.delegateCount=0,p.setup&&p.setup.call(t,i,g,a)!==!1||t.addEventListener&&t.addEventListener(d,a,!1)),p.add&&(p.add.call(t,f),f.handler.guid||(f.handler.guid=r.guid)),o?h.splice(h.delegateCount++,0,f):h.push(f),ue.event.global[d]=!0);t=null}},remove:function(t,e,n,r,i){var o,u,a,s,c,l,f,p,h,d,g,m=ve.hasData(t)&&ve.get(t);if(m&&(s=m.events)){for(e=(e||"").match(se)||[""],c=e.length;c--;)if(a=Se.exec(e[c])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){for(f=ue.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,p=s[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=p.length;o--;)l=p[o],!i&&g!==l.origType||n&&n.guid!==l.guid||a&&!a.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(p.splice(o,1),l.selector&&p.delegateCount--,f.remove&&f.remove.call(t,l));u&&!p.length&&(f.teardown&&f.teardown.call(t,d,m.handle)!==!1||ue.removeEvent(t,h,m.handle),delete s[h])}else for(h in s)ue.event.remove(t,h+e[c],n,r,!0);ue.isEmptyObject(s)&&(delete m.handle,ve.remove(t,"events"))}},trigger:function(e,r,i,o){var u,a,s,c,l,f,p,h=[i||U],d=ie.call(e,"type")?e.type:e,g=ie.call(e,"namespace")?e.namespace.split("."):[];if(a=s=i=i||U,3!==i.nodeType&&8!==i.nodeType&&!je.test(d+ue.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),l=0>d.indexOf(":")&&"on"+d,e=e[ue.expando]?e:new ue.Event(d,"object"==typeof e&&e),e.isTrigger=o?2:3,e.namespace=g.join("."),e.namespace_re=e.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=n,e.target||(e.target=i),r=null==r?[e]:ue.makeArray(r,[e]),p=ue.event.special[d]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!ue.isWindow(i)){for(c=p.delegateType||d,je.test(c+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),s=a;s===(i.ownerDocument||U)&&h.push(s.defaultView||s.parentWindow||t)}for(u=0;(a=h[u++])&&!e.isPropagationStopped();)e.type=u>1?c:p.bindType||d,f=(ve.get(a,"events")||{})[e.type]&&ve.get(a,"handle"),f&&f.apply(a,r),f=l&&a[l],f&&ue.acceptData(a)&&f.apply&&f.apply(a,r)===!1&&e.preventDefault();return e.type=d,o||e.isDefaultPrevented()||p._default&&p._default.apply(h.pop(),r)!==!1||!ue.acceptData(i)||l&&ue.isFunction(i[d])&&!ue.isWindow(i)&&(s=i[l],s&&(i[l]=null),ue.event.triggered=d,i[d](),ue.event.triggered=n,s&&(i[l]=s)),e.result}},dispatch:function(t){t=ue.event.fix(t);var e,r,i,o,u,a=[],s=ee.call(arguments),c=(ve.get(this,"events")||{})[t.type]||[],l=ue.event.special[t.type]||{};if(s[0]=t,t.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,t)!==!1){for(a=ue.event.handlers.call(this,t,c),e=0;(o=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,r=0;(u=o.handlers[r++])&&!t.isImmediatePropagationStopped();)(!t.namespace_re||t.namespace_re.test(u.namespace))&&(t.handleObj=u,t.data=u.data,i=((ue.event.special[u.origType]||{}).handle||u.handler).apply(o.elem,s),i!==n&&(t.result=i)===!1&&(t.preventDefault(),t.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(t,e){var r,i,o,u,a=[],s=e.delegateCount,c=t.target;if(s&&c.nodeType&&(!t.button||"click"!==t.type))for(;c!==this;c=c.parentNode||this)if(c.disabled!==!0||"click"!==t.type){for(i=[],r=0;s>r;r++)u=e[r],o=u.selector+" ",i[o]===n&&(i[o]=u.needsContext?ue(o,this).index(c)>=0:ue.find(o,this,null,[c]).length),i[o]&&i.push(u);i.length&&a.push({elem:c,handlers:i})}return e.length>s&&a.push({elem:this,handlers:e.slice(s)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var r,i,o,u=e.button;return null==t.pageX&&null!=e.clientX&&(r=t.target.ownerDocument||U,i=r.documentElement,o=r.body,t.pageX=e.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),t.pageY=e.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),t.which||u===n||(t.which=1&u?1:2&u?3:4&u?2:0),t}},fix:function(t){if(t[ue.expando])return t;var e,n,r,i=t.type,o=t,u=this.fixHooks[i];for(u||(this.fixHooks[i]=u=Ne.test(i)?this.mouseHooks:Ee.test(i)?this.keyHooks:{}),r=u.props?this.props.concat(u.props):this.props,t=new ue.Event(o),e=r.length;e--;)n=r[e],t[n]=o[n];return t.target||(t.target=U),3===t.target.nodeType&&(t.target=t.target.parentNode),u.filter?u.filter(t,o):t},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==c()&&this.focus?(this.focus(),!1):n},delegateType:"focusin"},blur:{trigger:function(){return this===c()&&this.blur?(this.blur(),!1):n},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&ue.nodeName(this,"input")?(this.click(),!1):n},_default:function(t){return ue.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){t.result!==n&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n,r){var i=ue.extend(new ue.Event,n,{type:t,isSimulated:!0,originalEvent:{}});r?ue.event.trigger(i,null,e):ue.event.dispatch.call(e,i),i.isDefaultPrevented()&&n.preventDefault()}},ue.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)},ue.Event=function(t,e){return this instanceof ue.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||t.getPreventDefault&&t.getPreventDefault()?a:s):this.type=t,e&&ue.extend(this,e),this.timeStamp=t&&t.timeStamp||ue.now(),this[ue.expando]=!0,n):new ue.Event(t,e)},ue.Event.prototype={isDefaultPrevented:s,isPropagationStopped:s,isImmediatePropagationStopped:s,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=a,t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=a,t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=a,this.stopPropagation()}},ue.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(t,e){ue.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;return(!i||i!==r&&!ue.contains(r,i))&&(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}}),ue.support.focusinBubbles||ue.each({focus:"focusin",blur:"focusout"},function(t,e){var n=0,r=function(t){ue.event.simulate(e,t.target,ue.event.fix(t),!0)};ue.event.special[e]={setup:function(){0===n++&&U.addEventListener(t,r,!0)},teardown:function(){0===--n&&U.removeEventListener(t,r,!0)}}}),ue.fn.extend({on:function(t,e,r,i,o){var u,a;if("object"==typeof t){"string"!=typeof e&&(r=r||e,e=n);for(a in t)this.on(a,e,r,t[a],o);return this}if(null==r&&null==i?(i=e,r=e=n):null==i&&("string"==typeof e?(i=r,r=n):(i=r,r=e,e=n)),i===!1)i=s;else if(!i)return this;return 1===o&&(u=i,i=function(t){return ue().off(t),u.apply(this,arguments)},i.guid=u.guid||(u.guid=ue.guid++)),this.each(function(){ue.event.add(this,t,i,r,e)})},one:function(t,e,n,r){return this.on(t,e,n,r,1)},off:function(t,e,r){var i,o;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,ue(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return(e===!1||"function"==typeof e)&&(r=e,e=n),r===!1&&(r=s),this.each(function(){ue.event.remove(this,t,r,e)})},trigger:function(t,e){return this.each(function(){ue.event.trigger(t,e,this)})},triggerHandler:function(t,e){var r=this[0];return r?ue.event.trigger(t,e,r,!0):n}});var Ae=/^.[^:#\[\.,]*$/,_e=/^(?:parents|prev(?:Until|All))/,De=ue.expr.match.needsContext,qe={children:!0,contents:!0,next:!0,prev:!0};ue.fn.extend({find:function(t){var e,n=[],r=this,i=r.length;if("string"!=typeof t)return this.pushStack(ue(t).filter(function(){for(e=0;i>e;e++)if(ue.contains(r[e],this))return!0}));for(e=0;i>e;e++)ue.find(t,r[e],n);return n=this.pushStack(i>1?ue.unique(n):n),n.selector=this.selector?this.selector+" "+t:t,n},has:function(t){var e=ue(t,this),n=e.length;return this.filter(function(){for(var t=0;n>t;t++)if(ue.contains(this,e[t]))return!0})},not:function(t){return this.pushStack(f(this,t||[],!0))},filter:function(t){return this.pushStack(f(this,t||[],!1))},is:function(t){return!!f(this,"string"==typeof t&&De.test(t)?ue(t):t||[],!1).length},closest:function(t,e){for(var n,r=0,i=this.length,o=[],u=De.test(t)||"string"!=typeof t?ue(t,e||this.context):0;i>r;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(11>n.nodeType&&(u?u.index(n)>-1:1===n.nodeType&&ue.find.matchesSelector(n,t))){n=o.push(n);break}return this.pushStack(o.length>1?ue.unique(o):o)},index:function(t){return t?"string"==typeof t?ne.call(ue(t),this[0]):ne.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){var n="string"==typeof t?ue(t,e):ue.makeArray(t&&t.nodeType?[t]:t),r=ue.merge(this.get(),n);return this.pushStack(ue.unique(r))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),ue.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return ue.dir(t,"parentNode")},parentsUntil:function(t,e,n){return ue.dir(t,"parentNode",n)},next:function(t){return l(t,"nextSibling")},prev:function(t){return l(t,"previousSibling")},nextAll:function(t){return ue.dir(t,"nextSibling")},prevAll:function(t){return ue.dir(t,"previousSibling")},nextUntil:function(t,e,n){return ue.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return ue.dir(t,"previousSibling",n)},siblings:function(t){return ue.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return ue.sibling(t.firstChild)},contents:function(t){return t.contentDocument||ue.merge([],t.childNodes)}},function(t,e){ue.fn[t]=function(n,r){var i=ue.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=ue.filter(r,i)),this.length>1&&(qe[t]||ue.unique(i),_e.test(t)&&i.reverse()),this.pushStack(i)}}),ue.extend({filter:function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?ue.find.matchesSelector(r,t)?[r]:[]:ue.find.matches(t,ue.grep(e,function(t){return 1===t.nodeType}))},dir:function(t,e,r){for(var i=[],o=r!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&ue(t).is(r))break;i.push(t)}return i},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}});var Oe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Le=/<([\w:]+)/,He=/<|&#?\w+;/,Me=/<(?:script|style|link)/i,Pe=/^(?:checkbox|radio)$/i,Fe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ie=/^$|\/(?:java|ecma)script/i,Be=/^true\/(.*)/,Re=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,We={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};We.optgroup=We.option,We.tbody=We.tfoot=We.colgroup=We.caption=We.thead,We.th=We.td,ue.fn.extend({text:function(t){return ue.access(this,function(t){return t===n?ue.text(this):this.empty().append((this[0]&&this[0].ownerDocument||U).createTextNode(t))},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=p(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=p(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,r=t?ue.filter(t,this):this,i=0;null!=(n=r[i]);i++)e||1!==n.nodeType||ue.cleanData(v(n)),n.parentNode&&(e&&ue.contains(n.ownerDocument,n)&&g(v(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(ue.cleanData(v(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return ue.clone(this,t,e)})},html:function(t){return ue.access(this,function(t){var e=this[0]||{},r=0,i=this.length;if(t===n&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Me.test(t)&&!We[(Le.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Oe,"<$1></$2>");try{for(;i>r;r++)e=this[r]||{},1===e.nodeType&&(ue.cleanData(v(e,!1)),e.innerHTML=t);e=0}catch(o){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=ue.map(this,function(t){return[t.nextSibling,t.parentNode]}),e=0;return this.domManip(arguments,function(n){var r=t[e++],i=t[e++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),ue(this).remove(),i.insertBefore(n,r))},!0),e?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e,n){t=Z.apply([],t);var r,i,o,u,a,s,c=0,l=this.length,f=this,p=l-1,g=t[0],m=ue.isFunction(g);if(m||!(1>=l||"string"!=typeof g||ue.support.checkClone)&&Fe.test(g))return this.each(function(r){var i=f.eq(r);m&&(t[0]=g.call(this,r,i.html())),i.domManip(t,e,n)});if(l&&(r=ue.buildFragment(t,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=ue.map(v(r,"script"),h),u=o.length;l>c;c++)a=r,c!==p&&(a=ue.clone(a,!0,!0),u&&ue.merge(o,v(a,"script"))),e.call(this[c],a,c);if(u)for(s=o[o.length-1].ownerDocument,ue.map(o,d),c=0;u>c;c++)a=o[c],Ie.test(a.type||"")&&!ve.access(a,"globalEval")&&ue.contains(s,a)&&(a.src?ue._evalUrl(a.src):ue.globalEval(a.textContent.replace(Re,"")))}return this}}),ue.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){ue.fn[t]=function(t){for(var n,r=[],i=ue(t),o=i.length-1,u=0;o>=u;u++)n=u===o?this:this.clone(!0),ue(i[u])[e](n),te.apply(r,n.get());return this.pushStack(r)}}),ue.extend({clone:function(t,e,n){var r,i,o,u,a=t.cloneNode(!0),s=ue.contains(t.ownerDocument,t);if(!(ue.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||ue.isXMLDoc(t)))for(u=v(a),o=v(t),r=0,i=o.length;i>r;r++)y(o[r],u[r]);if(e)if(n)for(o=o||v(t),u=u||v(a),r=0,i=o.length;i>r;r++)m(o[r],u[r]);else m(t,a);return u=v(a,"script"),u.length>0&&g(u,!s&&v(t,"script")),a},buildFragment:function(t,e,n,r){for(var i,o,u,a,s,c,l=0,f=t.length,p=e.createDocumentFragment(),h=[];f>l;l++)if(i=t[l],i||0===i)if("object"===ue.type(i))ue.merge(h,i.nodeType?[i]:i);else if(He.test(i)){for(o=o||p.appendChild(e.createElement("div")),u=(Le.exec(i)||["",""])[1].toLowerCase(),a=We[u]||We._default,o.innerHTML=a[1]+i.replace(Oe,"<$1></$2>")+a[2],c=a[0];c--;)o=o.lastChild;ue.merge(h,o.childNodes),o=p.firstChild,o.textContent=""}else h.push(e.createTextNode(i));for(p.textContent="",l=0;i=h[l++];)if((!r||-1===ue.inArray(i,r))&&(s=ue.contains(i.ownerDocument,i),o=v(p.appendChild(i),"script"),s&&g(o),n))for(c=0;i=o[c++];)Ie.test(i.type||"")&&n.push(i);return p},cleanData:function(t){for(var e,r,i,u,a,s,c=ue.event.special,l=0;(r=t[l])!==n;l++){if(o.accepts(r)&&(a=r[ve.expando],a&&(e=ve.cache[a]))){if(i=Object.keys(e.events||{}),i.length)for(s=0;(u=i[s])!==n;s++)c[u]?ue.event.remove(r,u):ue.removeEvent(r,u,e.handle);ve.cache[a]&&delete ve.cache[a]}delete me.cache[r[me.expando]]}},_evalUrl:function(t){return ue.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),ue.fn.extend({wrapAll:function(t){var e;return ue.isFunction(t)?this.each(function(e){ue(this).wrapAll(t.call(this,e))}):(this[0]&&(e=ue(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this)},wrapInner:function(t){return ue.isFunction(t)?this.each(function(e){ue(this).wrapInner(t.call(this,e))}):this.each(function(){var e=ue(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=ue.isFunction(t);return this.each(function(n){ue(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){ue.nodeName(this,"body")||ue(this).replaceWith(this.childNodes)}).end()}});var $e,ze,Ve=/^(none|table(?!-c[ea]).+)/,Ue=/^margin/,Xe=RegExp("^("+ae+")(.*)$","i"),Ye=RegExp("^("+ae+")(?!px)[a-z%]+$","i"),Je=RegExp("^([+-])=("+ae+")","i"),Ge={BODY:"block"},Qe={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:0,fontWeight:400},Ze=["Top","Right","Bottom","Left"],tn=["Webkit","O","Moz","ms"];
ue.fn.extend({css:function(t,e){return ue.access(this,function(t,e,r){var i,o,u={},a=0;if(ue.isArray(e)){for(i=w(t),o=e.length;o>a;a++)u[e[a]]=ue.css(t,e[a],!1,i);return u}return r!==n?ue.style(t,e,r):ue.css(t,e)},t,e,arguments.length>1)},show:function(){return C(this,!0)},hide:function(){return C(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){x(this)?ue(this).show():ue(this).hide()})}}),ue.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=$e(t,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(t,e,r,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,u,a,s=ue.camelCase(e),c=t.style;return e=ue.cssProps[s]||(ue.cssProps[s]=b(c,s)),a=ue.cssHooks[e]||ue.cssHooks[s],r===n?a&&"get"in a&&(o=a.get(t,!1,i))!==n?o:c[e]:(u=typeof r,"string"===u&&(o=Je.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(ue.css(t,e)),u="number"),null==r||"number"===u&&isNaN(r)||("number"!==u||ue.cssNumber[s]||(r+="px"),ue.support.clearCloneStyle||""!==r||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&(r=a.set(t,r,i))===n||(c[e]=r)),n)}},css:function(t,e,r,i){var o,u,a,s=ue.camelCase(e);return e=ue.cssProps[s]||(ue.cssProps[s]=b(t.style,s)),a=ue.cssHooks[e]||ue.cssHooks[s],a&&"get"in a&&(o=a.get(t,!0,r)),o===n&&(o=$e(t,e,i)),"normal"===o&&e in Ke&&(o=Ke[e]),""===r||r?(u=parseFloat(o),r===!0||ue.isNumeric(u)?u||0:o):o}}),$e=function(t,e,r){var i,o,u,a=r||w(t),s=a?a.getPropertyValue(e)||a[e]:n,c=t.style;return a&&(""!==s||ue.contains(t.ownerDocument,t)||(s=ue.style(t,e)),Ye.test(s)&&Ue.test(e)&&(i=c.width,o=c.minWidth,u=c.maxWidth,c.minWidth=c.maxWidth=c.width=s,s=a.width,c.width=i,c.minWidth=o,c.maxWidth=u)),s},ue.each(["height","width"],function(t,e){ue.cssHooks[e]={get:function(t,r,i){return r?0===t.offsetWidth&&Ve.test(ue.css(t,"display"))?ue.swap(t,Qe,function(){return E(t,e,i)}):E(t,e,i):n},set:function(t,n,r){var i=r&&w(t);return T(t,n,r?k(t,e,r,ue.support.boxSizing&&"border-box"===ue.css(t,"boxSizing",!1,i),i):0)}}}),ue(function(){ue.support.reliableMarginRight||(ue.cssHooks.marginRight={get:function(t,e){return e?ue.swap(t,{display:"inline-block"},$e,[t,"marginRight"]):n}}),!ue.support.pixelPosition&&ue.fn.position&&ue.each(["top","left"],function(t,e){ue.cssHooks[e]={get:function(t,r){return r?(r=$e(t,e),Ye.test(r)?ue(t).position()[e]+"px":r):n}}})}),ue.expr&&ue.expr.filters&&(ue.expr.filters.hidden=function(t){return 0>=t.offsetWidth&&0>=t.offsetHeight},ue.expr.filters.visible=function(t){return!ue.expr.filters.hidden(t)}),ue.each({margin:"",padding:"",border:"Width"},function(t,e){ue.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[t+Ze[r]+e]=o[r]||o[r-2]||o[0];return i}},Ue.test(t)||(ue.cssHooks[t+e].set=T)});var en=/%20/g,nn=/\[\]$/,rn=/\r?\n/g,on=/^(?:submit|button|image|reset|file)$/i,un=/^(?:input|select|textarea|keygen)/i;ue.fn.extend({serialize:function(){return ue.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ue.prop(this,"elements");return t?ue.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ue(this).is(":disabled")&&un.test(this.nodeName)&&!on.test(t)&&(this.checked||!Pe.test(t))}).map(function(t,e){var n=ue(this).val();return null==n?null:ue.isArray(n)?ue.map(n,function(t){return{name:e.name,value:t.replace(rn,"\r\n")}}):{name:e.name,value:n.replace(rn,"\r\n")}}).get()}}),ue.param=function(t,e){var r,i=[],o=function(t,e){e=ue.isFunction(e)?e():null==e?"":e,i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(e===n&&(e=ue.ajaxSettings&&ue.ajaxSettings.traditional),ue.isArray(t)||t.jquery&&!ue.isPlainObject(t))ue.each(t,function(){o(this.name,this.value)});else for(r in t)S(r,t[r],e,o);return i.join("&").replace(en,"+")},ue.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){ue.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),ue.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}});var an,sn,cn=ue.now(),ln=/\?/,fn=/#.*$/,pn=/([?&])_=[^&]*/,hn=/^(.*?):[ \t]*([^\r\n]*)$/gm,dn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,gn=/^(?:GET|HEAD)$/,mn=/^\/\//,vn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,yn=ue.fn.load,bn={},xn={},wn="*/".concat("*");try{sn=V.href}catch(Cn){sn=U.createElement("a"),sn.href="",sn=sn.href}an=vn.exec(sn.toLowerCase())||[],ue.fn.load=function(t,e,r){if("string"!=typeof t&&yn)return yn.apply(this,arguments);var i,o,u,a=this,s=t.indexOf(" ");return s>=0&&(i=t.slice(s),t=t.slice(0,s)),ue.isFunction(e)?(r=e,e=n):e&&"object"==typeof e&&(o="POST"),a.length>0&&ue.ajax({url:t,type:o,dataType:"html",data:e}).done(function(t){u=arguments,a.html(i?ue("<div>").append(ue.parseHTML(t)).find(i):t)}).complete(r&&function(t,e){a.each(r,u||[t.responseText,e,t])}),this},ue.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){ue.fn[e]=function(t){return this.on(e,t)}}),ue.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:sn,type:"GET",isLocal:dn.test(an[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ue.parseJSON,"text xml":ue.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?D(D(t,ue.ajaxSettings),e):D(ue.ajaxSettings,t)},ajaxPrefilter:A(bn),ajaxTransport:A(xn),ajax:function(t,e){function r(t,e,r,a){var c,f,y,b,w,T=e;2!==x&&(x=2,s&&clearTimeout(s),i=n,u=a||"",C.readyState=t>0?4:0,c=t>=200&&300>t||304===t,r&&(b=q(p,C,r)),b=O(p,b,C,c),c?(p.ifModified&&(w=C.getResponseHeader("Last-Modified"),w&&(ue.lastModified[o]=w),w=C.getResponseHeader("etag"),w&&(ue.etag[o]=w)),204===t||"HEAD"===p.type?T="nocontent":304===t?T="notmodified":(T=b.state,f=b.data,y=b.error,c=!y)):(y=T,(t||!T)&&(T="error",0>t&&(t=0))),C.status=t,C.statusText=(e||T)+"",c?g.resolveWith(h,[f,T,C]):g.rejectWith(h,[C,T,y]),C.statusCode(v),v=n,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?f:y]),m.fireWith(h,[C,T]),l&&(d.trigger("ajaxComplete",[C,p]),--ue.active||ue.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=n),e=e||{};var i,o,u,a,s,c,l,f,p=ue.ajaxSetup({},e),h=p.context||p,d=p.context&&(h.nodeType||h.jquery)?ue(h):ue.event,g=ue.Deferred(),m=ue.Callbacks("once memory"),v=p.statusCode||{},y={},b={},x=0,w="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(2===x){if(!a)for(a={};e=hn.exec(u);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===x?u:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return x||(t=b[n]=b[n]||t,y[t]=e),this},overrideMimeType:function(t){return x||(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>x)for(e in t)v[e]=[v[e],t[e]];else C.always(t[C.status]);return this},abort:function(t){var e=t||w;return i&&i.abort(e),r(0,e),this}};if(g.promise(C).complete=m.add,C.success=C.done,C.error=C.fail,p.url=((t||p.url||sn)+"").replace(fn,"").replace(mn,an[1]+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=ue.trim(p.dataType||"*").toLowerCase().match(se)||[""],null==p.crossDomain&&(c=vn.exec(p.url.toLowerCase()),p.crossDomain=!(!c||c[1]===an[1]&&c[2]===an[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(an[3]||("http:"===an[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=ue.param(p.data,p.traditional)),_(bn,p,e,C),2===x)return C;l=p.global,l&&0===ue.active++&&ue.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!gn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(ln.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=pn.test(o)?o.replace(pn,"$1_="+cn++):o+(ln.test(o)?"&":"?")+"_="+cn++)),p.ifModified&&(ue.lastModified[o]&&C.setRequestHeader("If-Modified-Since",ue.lastModified[o]),ue.etag[o]&&C.setRequestHeader("If-None-Match",ue.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||e.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+wn+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)C.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(h,C,p)===!1||2===x))return C.abort();w="abort";for(f in{success:1,error:1,complete:1})C[f](p[f]);if(i=_(xn,p,e,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{x=1,i.send(y,r)}catch(T){if(!(2>x))throw T;r(-1,T)}}else r(-1,"No Transport");return C},getJSON:function(t,e,n){return ue.get(t,e,n,"json")},getScript:function(t,e){return ue.get(t,n,e,"script")}}),ue.each(["get","post"],function(t,e){ue[e]=function(t,r,i,o){return ue.isFunction(r)&&(o=o||i,i=r,r=n),ue.ajax({url:t,type:e,dataType:o,data:r,success:i})}}),ue.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return ue.globalEval(t),t}}}),ue.ajaxPrefilter("script",function(t){t.cache===n&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),ue.ajaxTransport("script",function(t){if(t.crossDomain){var e,n;return{send:function(r,i){e=ue("<script>").prop({async:!0,charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),U.head.appendChild(e[0])},abort:function(){n&&n()}}}});var Tn=[],kn=/(=)\?(?=&|$)|\?\?/;ue.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Tn.pop()||ue.expando+"_"+cn++;return this[t]=!0,t}}),ue.ajaxPrefilter("json jsonp",function(e,r,i){var o,u,a,s=e.jsonp!==!1&&(kn.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&kn.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(o=e.jsonpCallback=ue.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(kn,"$1"+o):e.jsonp!==!1&&(e.url+=(ln.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return a||ue.error(o+" was not called"),a[0]},e.dataTypes[0]="json",u=t[o],t[o]=function(){a=arguments},i.always(function(){t[o]=u,e[o]&&(e.jsonpCallback=r.jsonpCallback,Tn.push(o)),a&&ue.isFunction(u)&&u(a[0]),a=u=n}),"script"):n}),ue.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(t){}};var En=ue.ajaxSettings.xhr(),Nn={0:200,1223:204},jn=0,Sn={};t.ActiveXObject&&ue(t).on("unload",function(){for(var t in Sn)Sn[t]();Sn=n}),ue.support.cors=!!En&&"withCredentials"in En,ue.support.ajax=En=!!En,ue.ajaxTransport(function(t){var e;return ue.support.cors||En&&!t.crossDomain?{send:function(r,i){var o,u,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)a.setRequestHeader(o,r[o]);e=function(t){return function(){e&&(delete Sn[u],e=a.onload=a.onerror=null,"abort"===t?a.abort():"error"===t?i(a.status||404,a.statusText):i(Nn[a.status]||a.status,a.statusText,"string"==typeof a.responseText?{text:a.responseText}:n,a.getAllResponseHeaders()))}},a.onload=e(),a.onerror=e("error"),e=Sn[u=jn++]=e("abort"),a.send(t.hasContent&&t.data||null)},abort:function(){e&&e()}}:n});var An,_n,Dn=/^(?:toggle|show|hide)$/,qn=RegExp("^(?:([+-])=|)("+ae+")([a-z%]*)$","i"),On=/queueHooks$/,Ln=[F],Hn={"*":[function(t,e){var n=this.createTween(t,e),r=n.cur(),i=qn.exec(e),o=i&&i[3]||(ue.cssNumber[t]?"":"px"),u=(ue.cssNumber[t]||"px"!==o&&+r)&&qn.exec(ue.css(n.elem,t)),a=1,s=20;if(u&&u[3]!==o){o=o||u[3],i=i||[],u=+r||1;do a=a||".5",u/=a,ue.style(n.elem,t,u+o);while(a!==(a=n.cur()/r)&&1!==a&&--s)}return i&&(u=n.start=+u||+r||0,n.unit=o,n.end=i[1]?u+(i[1]+1)*i[2]:+i[2]),n}]};ue.Animation=ue.extend(M,{tweener:function(t,e){ue.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var n,r=0,i=t.length;i>r;r++)n=t[r],Hn[n]=Hn[n]||[],Hn[n].unshift(e)},prefilter:function(t,e){e?Ln.unshift(t):Ln.push(t)}}),ue.Tween=I,I.prototype={constructor:I,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||"swing",this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ue.cssNumber[n]?"":"px")},cur:function(){var t=I.propHooks[this.prop];return t&&t.get?t.get(this):I.propHooks._default.get(this)},run:function(t){var e,n=I.propHooks[this.prop];return this.pos=e=this.options.duration?ue.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):I.propHooks._default.set(this),this}},I.prototype.init.prototype=I.prototype,I.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=ue.css(t.elem,t.prop,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){ue.fx.step[t.prop]?ue.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[ue.cssProps[t.prop]]||ue.cssHooks[t.prop])?ue.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},ue.each(["toggle","show","hide"],function(t,e){var n=ue.fn[e];ue.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(B(e,!0),t,r,i)}}),ue.fn.extend({fadeTo:function(t,e,n,r){return this.filter(x).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=ue.isEmptyObject(t),o=ue.speed(e,n,r),u=function(){var e=M(this,ue.extend({},t),o);(i||ve.get(this,"finish"))&&e.stop(!0)};return u.finish=u,i||o.queue===!1?this.each(u):this.queue(o.queue,u)},stop:function(t,e,r){var i=function(t){var e=t.stop;delete t.stop,e(r)};return"string"!=typeof t&&(r=e,e=t,t=n),e&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,n=null!=t&&t+"queueHooks",o=ue.timers,u=ve.get(this);if(n)u[n]&&u[n].stop&&i(u[n]);else for(n in u)u[n]&&u[n].stop&&On.test(n)&&i(u[n]);for(n=o.length;n--;)o[n].elem!==this||null!=t&&o[n].queue!==t||(o[n].anim.stop(r),e=!1,o.splice(n,1));(e||!r)&&ue.dequeue(this,t)})},finish:function(t){return t!==!1&&(t=t||"fx"),this.each(function(){var e,n=ve.get(this),r=n[t+"queue"],i=n[t+"queueHooks"],o=ue.timers,u=r?r.length:0;for(n.finish=!0,ue.queue(this,t,[]),i&&i.stop&&i.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;u>e;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish})}}),ue.each({slideDown:B("show"),slideUp:B("hide"),slideToggle:B("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){ue.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}}),ue.speed=function(t,e,n){var r=t&&"object"==typeof t?ue.extend({},t):{complete:n||!n&&e||ue.isFunction(t)&&t,duration:t,easing:n&&e||e&&!ue.isFunction(e)&&e};return r.duration=ue.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in ue.fx.speeds?ue.fx.speeds[r.duration]:ue.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){ue.isFunction(r.old)&&r.old.call(this),r.queue&&ue.dequeue(this,r.queue)},r},ue.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},ue.timers=[],ue.fx=I.prototype.init,ue.fx.tick=function(){var t,e=ue.timers,r=0;for(An=ue.now();e.length>r;r++)t=e[r],t()||e[r]!==t||e.splice(r--,1);e.length||ue.fx.stop(),An=n},ue.fx.timer=function(t){t()&&ue.timers.push(t)&&ue.fx.start()},ue.fx.interval=13,ue.fx.start=function(){_n||(_n=setInterval(ue.fx.tick,ue.fx.interval))},ue.fx.stop=function(){clearInterval(_n),_n=null},ue.fx.speeds={slow:600,fast:200,_default:400},ue.fx.step={},ue.expr&&ue.expr.filters&&(ue.expr.filters.animated=function(t){return ue.grep(ue.timers,function(e){return t===e.elem}).length}),ue.fn.offset=function(t){if(arguments.length)return t===n?this:this.each(function(e){ue.offset.setOffset(this,t,e)});var e,r,i=this[0],o={top:0,left:0},u=i&&i.ownerDocument;if(u)return e=u.documentElement,ue.contains(e,i)?(typeof i.getBoundingClientRect!==z&&(o=i.getBoundingClientRect()),r=R(u),{top:o.top+r.pageYOffset-e.clientTop,left:o.left+r.pageXOffset-e.clientLeft}):o},ue.offset={setOffset:function(t,e,n){var r,i,o,u,a,s,c,l=ue.css(t,"position"),f=ue(t),p={};"static"===l&&(t.style.position="relative"),a=f.offset(),o=ue.css(t,"top"),s=ue.css(t,"left"),c=("absolute"===l||"fixed"===l)&&(o+s).indexOf("auto")>-1,c?(r=f.position(),u=r.top,i=r.left):(u=parseFloat(o)||0,i=parseFloat(s)||0),ue.isFunction(e)&&(e=e.call(t,n,a)),null!=e.top&&(p.top=e.top-a.top+u),null!=e.left&&(p.left=e.left-a.left+i),"using"in e?e.using.call(t,p):f.css(p)}},ue.fn.extend({position:function(){if(this[0]){var t,e,n=this[0],r={top:0,left:0};return"fixed"===ue.css(n,"position")?e=n.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),ue.nodeName(t[0],"html")||(r=t.offset()),r.top+=ue.css(t[0],"borderTopWidth",!0),r.left+=ue.css(t[0],"borderLeftWidth",!0)),{top:e.top-r.top-ue.css(n,"marginTop",!0),left:e.left-r.left-ue.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||X;t&&!ue.nodeName(t,"html")&&"static"===ue.css(t,"position");)t=t.offsetParent;return t||X})}}),ue.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,r){var i="pageYOffset"===r;ue.fn[e]=function(o){return ue.access(this,function(e,o,u){var a=R(e);return u===n?a?a[r]:e[o]:(a?a.scrollTo(i?t.pageXOffset:u,i?u:t.pageYOffset):e[o]=u,n)},e,o,arguments.length,null)}}),ue.each({Height:"height",Width:"width"},function(t,e){ue.each({padding:"inner"+t,content:e,"":"outer"+t},function(r,i){ue.fn[i]=function(i,o){var u=arguments.length&&(r||"boolean"!=typeof i),a=r||(i===!0||o===!0?"margin":"border");return ue.access(this,function(e,r,i){var o;return ue.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):i===n?ue.css(e,r,a):ue.style(e,r,i,a)},e,u?i:n,u,null)}})}),ue.fn.size=function(){return this.length},ue.fn.andSelf=ue.fn.addBack,"object"==typeof e&&e&&"object"==typeof e.exports?e.exports=ue:"function"==typeof define&&define.amd&&define("jquery",[],function(){return ue})})(window)})()},{}]},{},[]),require=function(t,e,n){function r(n,o){if(!e[n]){if(!t[n]){var u="function"==typeof require&&require;if(!o&&u)return u(n,!0);if(i)return i(n,!0);throw Error("Cannot find module '"+n+"'")}var a=e[n]={exports:{}};t[n][0].call(a.exports,function(e){var i=t[n][1][e];return r(i?i:e)},a,a.exports)}return e[n].exports}for(var i="function"==typeof require&&require,o=0;n.length>o;o++)r(n[o]);return r}({baconjs:[function(t,e){e.exports=t("dJIpNJ")},{}],dJIpNJ:[function(t,e){(function(){var n,r,i,o,u,a,s,c,l,f,p,h,d,g,m,v,y,b,x,w,C,T,k,E,N,j,S,A,_,D,q,O,L,H,M,P,F,I,B,R,W,$,z,V,U,X,Y,J,G,Q,K,Z,te=[].slice,ee={}.hasOwnProperty,ne=function(t,e){function n(){this.constructor=t}for(var r in e)ee.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},re=function(t,e){return function(){return t.apply(e,arguments)}};e!==void 0&&null!==e?(e.exports=n={},n.Bacon=n):("function"==typeof t&&null!=t.amd&&define("bacon",[],function(){return n}),this.Bacon=n={}),n.fromBinder=function(t,e){return null==e&&(e=G.id),new c(function(r){var i;return i=t(function(){var t,o,u,a,c,l,f;for(t=arguments.length>=1?te.call(arguments,0):[],a=e.apply(null,t),a instanceof Array&&G.last(a)instanceof s||(a=[a]),f=[],c=0,l=a.length;l>c;c++)o=a[c],u=r(o=V(o)),u===n.noMore||o.isEnd()?null!=i?f.push(i()):f.push(n.scheduler.setTimeout(function(){return i()},0)):f.push(void 0);return f})})},n.$={asEventStream:function(t,e,r){var i,o=this;return L(e)&&(i=[e,null],r=i[0],e=i[1]),n.fromBinder(function(n){return o.on(t,e,n),function(){return o.off(t,e,n)}},r)}},null!=(Q="undefined"!=typeof jQuery&&null!==jQuery?jQuery:"undefined"!=typeof Zepto&&null!==Zepto?Zepto:null)&&(Q.fn.asEventStream=n.$.asEventStream),n.fromEventTarget=function(t,e,r){var i,o,u,a,s,c;return i=null!=(u=t.addEventListener)?u:null!=(a=t.addListener)?a:t.bind,o=null!=(s=t.removeEventListener)?s:null!=(c=t.removeListener)?c:t.unbind,n.fromBinder(function(n){return i.call(t,e,n),function(){return o.call(t,e,n)}},r)},n.fromPromise=function(t,e){return n.fromBinder(function(n){return t.then(n,function(t){return n(new a(t))}),function(){return e?"function"==typeof t.abort?t.abort():void 0:void 0}},function(t){return[t,A()]})},n.noMore=["<no-more>"],n.more=["<more>"],n.later=function(t,e){return n.sequentially(t,[e])},n.sequentially=function(t,e){var r;return r=0,n.fromPoll(t,function(){var t;return t=e[r++],e.length>r?t:r===e.length?[t,A()]:A()})},n.repeatedly=function(t,e){var r;return r=0,n.fromPoll(t,function(){return e[r++%e.length]})},M=function(t){return function(){var e,r,i;return r=arguments[0],e=arguments.length>=2?te.call(arguments,1):[],i=W(t,[function(t,e){return r.apply(null,te.call(t).concat([e]))}]),n.combineAsArray(e).flatMap(i)}},n.fromCallback=M(function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],n.fromBinder(function(n){return P(e,t)(n),R},function(t){return[t,A()]})}),n.fromNodeCallback=M(function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],n.fromBinder(function(n){return P(e,t)(n),R},function(t,e){return t?[new a(t),A()]:[e,A()]})}),n.fromPoll=function(t,e){return n.fromBinder(function(e){var r;return r=n.scheduler.setInterval(e,t),function(){return n.scheduler.clearInterval(r)}},e)},n.interval=function(t,e){return null==e&&(e={}),n.fromPoll(t,function(){return B(e)})},n.constant=function(t){return new d($([t],q),!0)},n.never=function(){return n.fromArray([])},n.once=function(t){return n.fromArray([t])},n.fromArray=function(t){return new c($(t,V))},$=function(t,e){return function(n){var r,i,o;for(i=0,o=t.length;o>i;i++)r=t[i],n(e(r));return n(A()),R}},n.mergeAll=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],e instanceof Array||(e=[e].concat(t)),G.fold(e,n.never(),function(t,e){return t.merge(e)})},n.zipAsArray=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],e instanceof Array||(e=[e].concat(t)),n.zipWith(e,Array)},n.zipWith=function(){var t,e,r,i;return r=arguments[0],t=arguments[1],e=arguments.length>=3?te.call(arguments,2):[],L(r)&&(i=[[t].concat(e),r],r=i[0],t=i[1]),n.when(r,t)},n.combineAsArray=function(){var t,e,r,i;return r=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],r instanceof Array||(r=[r].concat(t)),r.length?(i=function(){var t,n,i;for(i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(p);return i}(),new d(function(t){var o,u,a,s,c,l,f,p,d,g,m,y;for(g=!1,d=function(){var t,n,i;for(i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(R);return i}(),p=function(){var t,e,n;for(e=0,n=d.length;n>e;e++)t=d[e],t();return g=!0},a=function(){var t,n,i;for(i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(!1);return i}(),o=function(){var e;return G.all(a)?(e=t(A()),e===n.noMore&&p(),e):void 0},c=!1,u=function(e,r){return function(u){var a,s;return u.isEnd()?(e(),o(),n.noMore):u.isError()?(a=t(u),a===n.noMore&&p(),a):(r(u.value),G.all(G.map(function(t){return t.isDefined},i))?c&&u.isInitial()?n.more:(c=!0,s=function(){var t,e,n,r;for(r=[],e=0,n=i.length;n>e;e++)t=i[e],r.push(t.get()());return r},a=t(u.apply(s)),a===n.noMore&&p(),a):n.more)}},l=function(t){return u(function(){return a[t]=!0},function(e){return i[t]=new v(e)})},s=m=0,y=r.length;y>m;s=++m)f=r[s],f instanceof h||(f=n.constant(f)),g||(d[s]=f.subscribeInternal(l(s)));return p})):n.constant([])},n.onValues=function(){var t,e,r;return e=arguments.length>=2?te.call(arguments,0,r=arguments.length-1):(r=0,[]),t=arguments[r++],n.combineAsArray(e).onValues(t)},n.combineWith=function(){var t,e;return t=arguments[0],e=arguments.length>=2?te.call(arguments,1):[],n.combineAsArray(e).map(function(e){return t.apply(null,e)})},n.combineTemplate=function(t){var e,r,i,o,u,a,s,c,l,f;return s=[],f=[],a=function(t){return t[t.length-1]},l=function(t,e,n){return a(t)[e]=n},e=function(t,e){return function(n,r){return l(n,t,r[e])}},u=function(t,e){return function(n){return l(n,t,e)}},c=function(t){return t instanceof Array?[]:{}},i=function(t,n){var r,i;return n instanceof h?(f.push(n),s.push(e(t,f.length-1))):n===Object(n)&&"function"!=typeof n?(i=function(t){return function(e){var r;return r=c(n),l(e,t,r),e.push(r)}},r=function(t){return t.pop()},s.push(i(t)),o(n),s.push(r)):s.push(u(t,n))},o=function(t){return G.each(t,i)},o(t),r=function(e){var n,r,i,o,u;for(i=c(t),n=[i],o=0,u=s.length;u>o;o++)r=s[o],r(n,e);return i},n.combineAsArray(f).map(r)},s=function(){function t(){}return t.prototype.isEvent=function(){return!0},t.prototype.isEnd=function(){return!1},t.prototype.isInitial=function(){return!1},t.prototype.isNext=function(){return!1},t.prototype.isError=function(){return!1},t.prototype.hasValue=function(){return!1},t.prototype.filter=function(){return!0},t}(),f=function(t){function e(t){var e=this;this.value=L(t)?function(){var n;return n=t(),e.value=G.always(n),n}:G.always(t)}return ne(e,t),e.prototype.isNext=function(){return!0},e.prototype.hasValue=function(){return!0},e.prototype.fmap=function(t){var e=this;return this.apply(function(){return t(e.value())})},e.prototype.apply=function(t){return new e(t)},e.prototype.filter=function(t){return t(this.value())},e.prototype.describe=function(){return this.value()},e}(s),l=function(t){function e(){return K=e.__super__.constructor.apply(this,arguments)}return ne(e,t),e.prototype.isInitial=function(){return!0},e.prototype.isNext=function(){return!1},e.prototype.apply=function(t){return new e(t)},e.prototype.toNext=function(){return new f(this.value)},e}(f),u=function(t){function e(){return Z=e.__super__.constructor.apply(this,arguments)}return ne(e,t),e.prototype.isEnd=function(){return!0},e.prototype.fmap=function(){return this},e.prototype.apply=function(){return this},e.prototype.describe=function(){return"<end>"},e}(s),a=function(t){function e(t){this.error=t}return ne(e,t),e.prototype.isError=function(){return!0},e.prototype.fmap=function(){return this},e.prototype.apply=function(){return this},e.prototype.describe=function(){return"<error> "+this.error},e}(s),h=function(){function t(){this.combine=re(this.combine,this),this.flatMapLatest=re(this.flatMapLatest,this),this.fold=re(this.fold,this),this.scan=re(this.scan,this),this.assign=this.onValue}return t.prototype.onValue=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],e=P(e,t),this.subscribe(function(t){return t.hasValue()?e(t.value()):void 0})},t.prototype.onValues=function(t){return this.onValue(function(e){return t.apply(null,e)})},t.prototype.onError=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],e=P(e,t),this.subscribe(function(t){return t.isError()?e(t.error):void 0})},t.prototype.onEnd=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],e=P(e,t),this.subscribe(function(t){return t.isEnd()?e():void 0})},t.prototype.errors=function(){return this.filter(function(){return!1})},t.prototype.filter=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],S(this,e,t,function(t){return this.withHandler(function(e){return e.filter(t)?this.push(e):n.more})})},t.prototype.takeWhile=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],S(this,e,t,function(t){return this.withHandler(function(e){return e.filter(t)?this.push(e):(this.push(A()),n.noMore)})})},t.prototype.endOnError=function(){return this.withHandler(function(t){return t.isError()?(this.push(t),this.push(A())):this.push(t)})},t.prototype.take=function(t){return 0>=t?n.never():this.withHandler(function(e){return e.hasValue()?(t--,t>0?this.push(e):(0===t&&this.push(e),this.push(A()),n.noMore)):this.push(e)})},t.prototype.map=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],e instanceof d?e.sampledBy(this,_):S(this,e,t,function(t){return this.withHandler(function(e){return this.push(e.fmap(t))})})},t.prototype.mapError=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],e=P(e,t),this.withHandler(function(t){return t.isError()?this.push(B(e(t.error))):this.push(t)})},t.prototype.mapEnd=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],e=P(e,t),this.withHandler(function(t){return t.isEnd()?(this.push(B(e(t))),this.push(A()),n.noMore):this.push(t)})},t.prototype.doAction=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],e=P(e,t),this.withHandler(function(t){return t.hasValue()&&e(t.value()),this.push(t)})},t.prototype.skip=function(t){return this.withHandler(function(e){return e.hasValue()?t>0?(t--,n.more):this.push(e):this.push(e)})},t.prototype.skipDuplicates=function(t){return null==t&&(t=function(t,e){return t===e}),this.withStateMachine(p,function(e,n){return n.hasValue()?e!==p&&t(e.get(),n.value())?[e,[]]:[new v(n.value()),[n]]:[e,[n]]})},t.prototype.skipErrors=function(){return this.withHandler(function(t){return t.isError()?n.more:this.push(t)})},t.prototype.withStateMachine=function(t,e){var r;return r=t,this.withHandler(function(t){var i,o,u,a,s,c,l;for(i=e(r,t),o=i[0],a=i[1],r=o,s=n.more,c=0,l=a.length;l>c;c++)if(u=a[c],s=this.push(u),s===n.noMore)return s;return s})},t.prototype.scan=function(t,e){var r,i,o=this;return e=z(e),r=Y(t),i=function(t){var i,u,a,s;return i=!1,s=R,u=n.more,a=function(){return i?void 0:(i=!0,r.forEach(function(e){return u=t(q(e)),u===n.noMore?(s(),s=R):void 0}))},s=o.subscribe(function(o){return o.hasValue()?i&&o.isInitial()?n.more:(i=!0,r=new v(e(r.getOrElse(void 0),o.value())),t(o.apply(G.always(r.get())))):(o.isEnd()&&(u=a()),u!==n.noMore?t(o):void 0)}),a(),s},new d(i)},t.prototype.fold=function(t,e){return this.scan(t,e).sampledBy(this.filter(!1).mapEnd().toProperty())},t.prototype.zip=function(t,e){return null==e&&(e=Array),n.zipWith([this,t],e)},t.prototype.diff=function(t,e){return e=z(e),this.scan([t],function(t,n){return[n,e(t[0],n)]}).filter(function(t){return 2===t.length}).map(function(t){return t[1]})},t.prototype.flatMap=function(e,r){var i;return e=F(e),i=this,new c(function(o){var u,a,s,c,f,p;return a=[],s=!1,p=function(){},f=function(){var t,e,n;for(p(),e=0,n=a.length;n>e;e++)t=a[e],t();return a=[]},u=function(){return s&&0===a.length?o(A()):void 0},c=function(i){var c,p,h,d,g;return i.isEnd()?(s=!0,u()):i.isError()?o(i):r&&a.length?n.more:(c=e(i.value()),c instanceof t||(c=n.once(c)),g=void 0,p=!1,d=function(){return null!=g&&G.remove(g,a),u()},h=function(t){var e;return t.isEnd()?(d(),p=!0,n.noMore):(t instanceof l&&(t=t.toNext()),e=o(t),e===n.noMore&&f(),e)},g=c.subscribe(h),p?void 0:a.push(g))},p=i.subscribe(c),f})},t.prototype.flatMapFirst=function(t){return this.flatMap(t,!0)},t.prototype.flatMapLatest=function(t){var e;return t=F(t),e=this.toEventStream(),e.flatMap(function(n){return t(n).takeUntil(e)
})},t.prototype.not=function(){return this.map(function(t){return!t})},t.prototype.log=function(){var t;return t=arguments.length>=1?te.call(arguments,0):[],this.subscribe(function(e){return"undefined"!=typeof console&&null!==console?"function"==typeof console.log?console.log.apply(console,te.call(t).concat([e.describe()])):void 0:void 0}),this},t.prototype.slidingWindow=function(t,e){return null==e&&(e=0),this.scan([],function(e,n){return e.concat([n]).slice(-t)}).filter(function(t){return t.length>=e})},t.prototype.combine=function(t,e){var r;return r=z(e),n.combineAsArray(this,t).map(function(t){return r(t[0],t[1])})},t.prototype.decode=function(t){return this.combine(n.combineTemplate(t),function(t,e){return e[t]})},t}(),h.prototype.reduce=h.prototype.fold,c=function(t){function e(t){this.takeUntil=re(this.takeUntil,this);var n;e.__super__.constructor.call(this),T(t),n=new o(t),this.subscribe=n.subscribe,this.subscribeInternal=this.subscribe,this.hasSubscribers=n.hasSubscribers}return ne(e,t),e.prototype.delay=function(t){return this.flatMap(function(e){return n.later(t,e)})},e.prototype.debounce=function(t){return this.flatMapLatest(function(e){return n.later(t,e)})},e.prototype.debounceImmediate=function(t){return this.flatMapFirst(function(e){return n.once(e).concat(n.later(t).filter(!1))})},e.prototype.throttle=function(t){return this.bufferWithTime(t).map(function(t){return t[t.length-1]})},e.prototype.bufferWithTime=function(t){return this.bufferWithTimeOrCount(t,Number.MAX_VALUE)},e.prototype.bufferWithCount=function(t){return this.bufferWithTimeOrCount(void 0,t)},e.prototype.bufferWithTimeOrCount=function(t,e){var n;return n=function(n){return n.values.length===e?n.flush():void 0!==t?n.schedule():void 0},this.buffer(t,n,n)},e.prototype.buffer=function(t,e,r){var i,o,u;return null==e&&(e=function(){}),null==r&&(r=function(){}),i={scheduled:!1,end:null,values:[],flush:function(){var t;if(this.scheduled=!1,this.values.length>0){if(t=this.push(B(this.values)),this.values=[],null!=this.end)return this.push(this.end);if(t!==n.noMore)return r(this)}else if(null!=this.end)return this.push(this.end)},schedule:function(){var e=this;return this.scheduled?void 0:(this.scheduled=!0,t(function(){return e.flush()}))}},u=n.more,L(t)||(o=t,t=function(t){return n.scheduler.setTimeout(t,o)}),this.withHandler(function(t){return i.push=this.push,t.isError()?u=this.push(t):t.isEnd()?(i.end=t,i.scheduled||i.flush()):(i.values.push(t.value()),e(i)),u})},e.prototype.merge=function(t){var r;return C(t),r=this,new e(function(e){var i,o,u,a,s,c;return a=R,s=R,c=!1,u=function(){return a(),s(),c=!0},i=0,o=function(t){var r;return t.isEnd()?(i++,2===i?e(A()):n.more):(r=e(t),r===n.noMore&&u(),r)},a=r.subscribe(o),c||(s=t.subscribe(o)),u})},e.prototype.toProperty=function(t){return 0===arguments.length&&(t=p),this.scan(t,H)},e.prototype.toEventStream=function(){return this},e.prototype.concat=function(t){var n;return n=this,new e(function(e){var r;return r=n.subscribe(function(n){return n.isEnd()?r=t.subscribe(e):e(n)}),function(){return r()}})},e.prototype.takeUntil=function(t){var e;return e=t.toEventStream().skipErrors().map(!0).toProperty(!1),e.combine(this,function(t,e){return{value:e,stopped:t}}).takeWhile(function(t){var e;return e=t.stopped,!e}).changes().map(function(t){var e;return e=t.value})},e.prototype.skipUntil=function(t){var e;return e=t.map(!0).toProperty(!1).take(2),e.sampledBy(this,function(t,e){return{val:e,started:t}}).filter(function(t){var e;return e=t.started}).map(function(t){var e;return e=t.val})},e.prototype.skipWhile=function(){var t,e;return e=arguments[0],t=arguments.length>=2?te.call(arguments,1):[],S(this,e,t,function(t){return this.skipUntil(this.filter(G.negate(t)))})},e.prototype.awaiting=function(t){return this.map(!0).merge(t.map(!1)).toProperty(!1)},e.prototype.startWith=function(t){return n.once(t).concat(this)},e.prototype.withHandler=function(t){var n;return n=new o(this.subscribe,t),new e(n.subscribe)},e.prototype.withSubscribe=function(t){return new e(t)},e}(h),d=function(t){function e(t,r){this.toEventStream=re(this.toEventStream,this),this.toProperty=re(this.toProperty,this),this.changes=re(this.changes,this),this.sample=re(this.sample,this);var i=this;e.__super__.constructor.call(this),this.subscribeInternal=r===!0?t:new g(t,r).subscribe,this.sampledBy=function(n,r){var o,u;return o=null!=r?(r=z(r),function(t,e){return r(t.value(),e.value())}):function(t){return t.value()},u=p,t=function(t){var e,r,a,s;return s=!1,r=R,a=R,e=function(){return r(),a(),s=!0},r=i.subscribeInternal(function(e){return e.hasValue()?u=new v(e):e.isError()?t(e):void 0}),a=n.subscribe(function(e){return e.hasValue()?u.forEach(function(n){return t(e.apply(function(){return o(n,e)}))}):(e.isEnd()&&r(),t(e))}),e},n instanceof e?new e(t):new c(t)},this.subscribe=function(t){var e,r,o,u,a;return o=n.more,e=function(){function e(){}return e.prototype.set=function(t){return this.event=t},e.prototype.send=function(){var e;return e=this.event,this.event=null,null!=e&&o!==n.noMore&&(o=t(e),o===n.noMore)?u():void 0},e}(),a=new e,r=new e,u=R,u=i.subscribeInternal(function(e){return e.isError()?o!==n.noMore&&(o=t(e)):(e.hasValue()?a.set(e):e.isEnd()&&r.set(e),m.onDone(function(){return a.send(),r.send()})),o}),function(){return o=n.noMore,u()}}}return ne(e,t),e.prototype.sample=function(t){return this.sampledBy(n.interval(t,{}))},e.prototype.changes=function(){var t=this;return new c(function(e){return t.subscribe(function(t){return t.isInitial()?void 0:e(t)})})},e.prototype.withHandler=function(t){return new e(this.subscribeInternal,t)},e.prototype.withSubscribe=function(t){return new e(t)},e.prototype.toProperty=function(){return k(arguments),this},e.prototype.toEventStream=function(){var t=this;return new c(function(e){return t.subscribe(function(t){return t.isInitial()&&(t=t.toNext()),e(t)})})},e.prototype.and=function(t){return this.combine(t,function(t,e){return t&&e})},e.prototype.or=function(t){return this.combine(t,function(t,e){return t||e})},e.prototype.delay=function(t){return this.delayChanges(function(e){return e.delay(t)})},e.prototype.debounce=function(t){return this.delayChanges(function(e){return e.debounce(t)})},e.prototype.throttle=function(t){return this.delayChanges(function(e){return e.throttle(t)})},e.prototype.delayChanges=function(t){return y(this,t(this.changes()))},e.prototype.takeUntil=function(t){var e;return e=this.changes().takeUntil(t),y(this,e)},e}(h),S=function(t,e,n,r){var i;return e instanceof d?(i=e.sampledBy(t,function(t,e){return[t,e]}),r.apply(i,[function(t){var e,n;return e=t[0],n=t[1],e}]).map(function(t){var e,n;return e=t[0],n=t[1]})):(e=P(e,n),r.apply(t,[e]))},y=function(t,e){var r;return r=function(t){var e;return e=p,t.subscribe(function(t){return t.hasValue()&&(e=new v(t.value())),n.noMore}),e},e.toProperty(r(t))},o=function(){function t(t,e){var r,i,o,u,a,s,c,l,f,p=this;null==t&&(t=function(){return R}),c=[],a=null,u=!1,i=!1,this.hasSubscribers=function(){return c.length>0},o=null,l=R,s=function(t){return c=G.without(t,c)},f=null,r=function(){var t,e,n,r,i;if(null!=f){for(e=f,f=null,i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(t());return i}},this.push=function(t){var e,i,l,f,h,d;if(u)return a=(a||[]).concat([t]),n.more;if(t!==o){t.isError()&&(o=t),l=!1;try{for(u=!0,f=c,h=0,d=f.length;d>h;h++)i=f[h],e=i.sink(t),(e===n.noMore||t.isEnd())&&s(i);l=!0}finally{u=!1,l||(a=null)}for(l=!0;null!=a?a.length:void 0;)t=G.head(a),a=G.tail(a),p.push(t);return r(t),p.hasSubscribers()?n.more:n.noMore}},null==e&&(e=function(t){return this.push(t)}),this.handleEvent=function(t){return t.isEnd()&&(i=!0),e.apply(p,[t])},this.subscribe=function(e){var n;return i?(e(A()),R):(T(e),n={sink:e},c=c.concat(n),1===c.length&&(l=t(p.handleEvent)),T(l),function(){return s(n),p.hasSubscribers()?void 0:l()})}}return t}(),g=function(t){function e(t,r){var i,o,u,a=this;e.__super__.constructor.call(this,t,r),i=p,u=this.push,t=this.subscribe,o=!1,this.push=function(t){return t.isEnd()&&(o=!0),t.hasValue()&&(i=new v(t.value())),m.inTransaction(function(){return u.apply(a,[t])})},this.subscribe=function(e){var r,u,s;return r=!1,s=function(){return a.hasSubscribers()||o},u=i.filter(s).map(function(t){return e(q(t))}),u.getOrElse(n.more)===n.noMore?R:o?(e(A()),R):t.apply(a,[e])}}return ne(e,t),e}(o),m=function(){var t,e,n,r;return r=[],n=!1,e=function(t){return n?r.push(t):t()},t=function(t){var e,i,o,u,a;if(n)return t();n=!0;try{o=t()}finally{n=!1}for(i=r,r=[],u=0,a=i.length;a>u;u++)e=i[u],e();return o},{onDone:e,inTransaction:t}}(),r=function(t){function e(){var t,r,i,o,u,s,c,l;i=void 0,s=[],t=!1,r=function(t){return function(e){return e.isEnd()?(l(t),n.noMore):i(e)}},c=function(){var t,e,n,r;for(r=[],e=0,n=s.length;n>e;e++)t=s[e],r.push("function"==typeof t.unsub?t.unsub():void 0);return r},u=function(t){return t.unsub=t.input.subscribe(r(t.input))},l=function(t){var e,n,r,i;for(e=r=0,i=s.length;i>r;e=++r)if(n=s[e],n.input===t)return"function"==typeof n.unsub&&n.unsub(),s.splice(e,1),void 0},o=function(t){var e,n,r,o,a;for(i=t,n=[],a=N(s),r=0,o=a.length;o>r;r++)e=a[r],u(e);return c},e.__super__.constructor.call(this,o),this.plug=function(e){var n;if(!t)return n={input:e},s.push(n),null!=i&&u(n),function(){return l(e)}},this.push=function(t){return"function"==typeof i?i(B(t)):void 0},this.error=function(t){return"function"==typeof i?i(new a(t)):void 0},this.end=function(){return t=!0,c(),"function"==typeof i?i(A()):void 0}}return ne(e,t),e}(c),n.when=function(){var t,e,r,i,o,u,a,s,l,f,p,g,m,v,y,x,w,C;if(f=arguments.length>=1?te.call(arguments,0):[],0===f.length)return n.never();for(u=f.length,m="when: expecting arguments in the form (Observable+,function)+",b(m,0===u%2),g=[],l=[],r=0;u>r;){for(s=G.toArray(f[r]),e=f[r+1],a={f:L(e)?e:function(){return e},ixs:[]},v=0,x=s.length;x>v;v++){for(p=s[v],b(p instanceof h,m),i=g.indexOf(p),0>i&&(g.push(p),i=g.length-1),C=a.ixs,y=0,w=C.length;w>y;y++)o=C[y],o.index===i&&o.count++;a.ixs.push({index:i,count:1})}l.push(a),r+=2}return t=function(){function t(t){var e,n;n=[],e=!1,this.subscribe=t.subscribe,this.markEnded=function(){return e=!0},t instanceof d?(this.consume=function(){return n[0]},this.push=function(t){return n=[t]},this.mayHave=function(){return!0},this.hasAtLeast=function(){return n.length}):(this.consume=function(){return n.shift()},this.push=function(t){return n.push(t)},this.mayHave=function(t){return!e||n.length>=t},this.hasAtLeast=function(t){return n.length>=t})}return t}(),g=G.map(function(e){return new t(e)},g),new c(function(t){var e,i,o;return i=function(t){return G.all(t.ixs,function(t){return g[t.index].hasAtLeast(t.count)})},e=function(t){return G.any(t.ixs,function(t){return!g[t.index].mayHave(t.count)})},o=function(o,u){return function(a){return o.subscribe(function(o){var s,c,f,p,h;if(o.isEnd())g[u].markEnded(),G.all(l,e)&&(c=n.noMore,t(A()));else if(o.isError())c=t(o);else for(g[u].push(o.value()),p=0,h=l.length;h>p;p++)if(s=l[p],i(s)){f=s.f.apply(s,function(){var t,e,n,i;for(n=s.ixs,i=[],t=0,e=n.length;e>t;t++)r=n[t],i.push(g[r.index].consume());return i}()),c=t(B(f));break}return c===n.noMore&&a(),c||n.more})}},j.apply(null,function(){var t,e,n;for(n=[],r=t=0,e=g.length;e>t;r=++t)p=g[r],n.push(o(p,r));return n}())})},n.update=function(){var t,e,r,i;for(e=arguments[0],i=arguments.length>=2?te.call(arguments,1):[],r=function(t){return function(){var e;return e=arguments.length>=1?te.call(arguments,0):[],function(n){return t.apply(null,[n].concat(e))}}},t=i.length-1;t>0;)i[t]instanceof Function||(i[t]=function(t){return function(){return t}}(i[t])),i[t]=r(i[t]),t-=2;return n.when.apply(n,i).scan(e,function(t,e){return e(t)})},j=function(){var t;return t=arguments.length>=1?te.call(arguments,0):[],new i(t).unsubscribe},i=function(){function t(t){var e,n,r;for(null==t&&(t=[]),this.empty=re(this.empty,this),this.unsubscribe=re(this.unsubscribe,this),this.add=re(this.add,this),this.unsubscribed=!1,this.subscriptions=[],this.starting=[],n=0,r=t.length;r>n;n++)e=t[n],this.add(e)}return t.prototype.add=function(t){var e,n,r,i=this;if(!this.unsubscribed)return e=!1,n=R,this.starting.push(t),r=function(){return n(),e=!0,i.remove(n),G.remove(t,i.starting)},n=t(this.unsubscribe,r),this.unsubscribed||e||this.subscriptions.push(n),G.remove(t,this.starting),n},t.prototype.remove=function(t){return this.unsubscribed?void 0:G.remove(t,this.subscriptions)},t.prototype.unsubscribe=function(){var t,e,n,r;if(!this.unsubscribed){for(this.unsubscribed=!0,r=this.subscriptions,e=0,n=r.length;n>e;e++)t=r[e],t();return this.subscriptions=[],this.starting=[]}},t.prototype.empty=function(){return!this.subscriptions.length&&!this.starting.length},t}(),v=function(){function t(t){this.value=t}return t.prototype.getOrElse=function(){return this.value},t.prototype.get=function(){return this.value},t.prototype.filter=function(e){return e(this.value)?new t(this.value):p},t.prototype.map=function(e){return new t(e(this.value))},t.prototype.forEach=function(t){return t(this.value)},t.prototype.isDefined=!0,t.prototype.toArray=function(){return[this.value]},t}(),p={getOrElse:function(t){return t},filter:function(){return p},map:function(){return p},forEach:function(){},isDefined:!1,toArray:function(){return[]}},n.EventStream=c,n.Property=d,n.Observable=h,n.Bus=r,n.Initial=l,n.Next=f,n.End=u,n.Error=a,R=function(){},H=function(t,e){return e},_=function(t){return t},q=function(t){return new l(G.always(t))},B=function(t){return new f(G.always(t))},A=function(){return new u},V=function(t){return t instanceof s?t:B(t)},N=function(t){return t.slice(0)},D=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){var n,r,i,o;for(n=i=0,o=t.length;o>i;n=++i)if(r=t[n],e===r)return n;return-1},b=function(t,e){if(!e)throw t},w=function(t){return b("not an event : "+t,t instanceof s&&t.isEvent())},C=function(t){return b("not an EventStream : "+t,t instanceof c)},T=function(t){return b("not a function : "+t,L(t))},L=function(t){return"function"==typeof t},x=function(t){return b("not an array : "+t,t instanceof Array)},k=function(t){return b("no arguments supported",0===t.length)},E=function(t){return b("not a string : "+t,"string"==typeof t)},I=function(t,e,n){return E(e),void 0===n&&(n=[]),function(r){return t[e].apply(t,n.concat([r]))}},W=function(t,e){return function(){var n;return n=arguments.length>=1?te.call(arguments,0):[],t.apply(null,e.concat(n))}},F=function(t){return t instanceof h&&(t=G.always(t)),T(t),t},P=function(t,e){return L(t)?e.length?W(t,e):t:O(t)?U(t,e):"object"==typeof t&&e.length?I(t,G.head(e),G.tail(e)):G.always(t)},O=function(t){return"string"==typeof t&&t.length>1&&"."===t.charAt(0)},n.isFieldKey=O,U=function(t,e){var n,r;return r=t.slice(1).split("."),n=G.map(J(e),r),function(e){var r,i;for(r=0,i=n.length;i>r;r++)t=n[r],e=t(e);return e}},J=function(t){return function(e){return function(n){var r;return null==n?void 0:(r=n[e],L(r)?r.apply(n,t):r)}}},X=function(t){return t.slice(1)},z=function(t){var e;return L(t)?t:O(t)?(e=X(t),function(t,n){return t[e](n)}):b("not a function or a field key: "+t,!1)},Y=function(t){return t instanceof v||t===p?t:new v(t)},"undefined"!=typeof define&&null!==define&&null!=define.amd&&"function"==typeof define&&define(function(){return n}),G={head:function(t){return t[0]},always:function(t){return function(){return t}},negate:function(t){return function(e){return!t(e)}},empty:function(t){return 0===t.length},tail:function(t){return t.slice(1,t.length)},filter:function(t,e){var n,r,i,o;for(n=[],i=0,o=e.length;o>i;i++)r=e[i],t(r)&&n.push(r);return n},map:function(t,e){var n,r,i,o;for(o=[],r=0,i=e.length;i>r;r++)n=e[r],o.push(t(n));return o},each:function(t,e){var n,r,i;i=[];for(n in t)r=t[n],i.push(e(n,r));return i},toArray:function(t){return t instanceof Array?t:[t]},contains:function(t,e){return-1!==D(t,e)},id:function(t){return t},last:function(t){return t[t.length-1]},all:function(t,e){var n,r,i;for(null==e&&(e=G.id),r=0,i=t.length;i>r;r++)if(n=t[r],!e(n))return!1;return!0},any:function(t,e){var n,r,i;for(null==e&&(e=G.id),r=0,i=t.length;i>r;r++)if(n=t[r],e(n))return!0;return!1},without:function(t,e){return G.filter(function(e){return e!==t},e)},remove:function(t,e){var n;return n=D(e,t),n>=0?e.splice(n,1):void 0},fold:function(t,e,n){var r,i,o;for(i=0,o=t.length;o>i;i++)r=t[i],e=n(e,r);return e}},n._=G,n.scheduler={setTimeout:function(t,e){return setTimeout(t,e)},setInterval:function(t,e){return setInterval(t,e)},clearInterval:function(t){return clearInterval(t)},now:function(){return(new Date).getTime()}}}).call(this)},{}]},{},[]),require=function(t,e,n){function r(n,o){if(!e[n]){if(!t[n]){var u="function"==typeof require&&require;if(!o&&u)return u(n,!0);if(i)return i(n,!0);throw Error("Cannot find module '"+n+"'")}var a=e[n]={exports:{}};t[n][0].call(a.exports,function(e){var i=t[n][1][e];return r(i?i:e)},a,a.exports)}return e[n].exports}for(var i="function"==typeof require&&require,o=0;n.length>o;o++)r(n[o]);return r}({lodash:[function(t,e){e.exports=t("Sw/oFh")},{}],"Sw/oFh":[function(t,e,n){(function(t){(function(r){function i(t,e,n){for(var r=(n||0)-1,i=t.length;i>++r;)if(t[r]===e)return r;return-1}function o(t,e){var n=typeof e;if(t=t.cache,"boolean"==n||null==e)return t[e];"number"!=n&&"string"!=n&&(n="object");var r="number"==n?e:C+e;return t=t[n]||(t[n]={}),"object"==n?t[r]&&i(t[r],e)>-1?0:-1:t[r]?0:-1}function u(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:C+t,i=e[n]||(e[n]={});"object"==n?(i[r]||(i[r]=[])).push(t)==this.array.length&&(e[n]=!1):i[r]=!0}}function a(t){return t.charCodeAt(0)}function s(t,e){var n=t.index,r=e.index;if(t=t.criteria,e=e.criteria,t!==e){if(t>e||t===v)return 1;if(e>t||e===v)return-1}return r>n?-1:1}function c(t){var e=-1,n=t.length,r=p();r["false"]=r["null"]=r["true"]=r.undefined=!1;var i=p();for(i.array=t,i.cache=r,i.push=u;n>++e;)i.push(t[e]);return r.object===!1?(d(i),null):i}function l(t){return"\\"+Q[t]}function f(){return y.pop()||[]}function p(){return b.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,leading:!1,maxWait:0,"null":!1,number:null,object:null,push:null,string:null,trailing:!1,"true":!1,undefined:!1,value:null}}function h(t){t.length=0,k>y.length&&y.push(t)}function d(t){var e=t.cache;e&&d(e),t.array=t.cache=t.criteria=t.object=t.number=t.string=t.value=null,k>b.length&&b.push(t)}function g(t,e,n){e||(e=0),n===v&&(n=t?t.length:0);for(var r=-1,i=n-e||0,o=Array(0>i?0:i);i>++r;)o[r]=t[e+r];return o}function m(t){function e(t){return t&&"object"==typeof t&&!Sr(t)&&sr.call(t,"__wrapped__")?t:new n(t)}function n(t){this.__wrapped__=t}function u(t,e,n,r){function i(){var r=arguments,c=u?this:e;if(o||(t=e[a]),n.length&&(r=r.length?(r=Tr.call(r),s?r.concat(n):n.concat(r)):n),this instanceof i){c=y(t.prototype);var l=t.apply(c,r);return me(l)?l:c}return t.apply(c,r)}var o=ge(t),u=!n,a=e;if(u){var s=r;n=e}else if(!o){if(!r)throw new Qn;e=t}return i}function y(t){return me(t)?dr(t):{}}function b(t){return Dr[t]}function k(){var t=(t=e.indexOf)===tn?i:t;return t}function Q(t){return function(n,r,i,o){return"boolean"!=typeof r&&null!=r&&(o=i,i=o&&o[r]===n?v:r,r=!1),null!=i&&(i=e.createCallback(i,o)),t(n,r,i,o)}}function K(t){var e,n;return t&&pr.call(t)==U&&(e=t.constructor,!ge(e)||e instanceof e)?(Hr(t,function(t,e){n=e}),n===v||sr.call(t,n)):!1}function te(t){return qr[t]}function ne(t){return pr.call(t)==B}function re(t,n,r,i,o,u){var a=t;if("boolean"!=typeof n&&null!=n&&(i=r,r=n,n=!1),"function"==typeof r){if(r=i===v?r:e.createCallback(r,i,1),a=r(a),a!==v)return a;a=t}var s=me(a);if(s){var c=pr.call(a);if(!J[c])return a;var l=Sr(a)}if(!s||!n)return s?l?g(a):Or({},a):a;var p=Nr[c];switch(c){case W:case $:return new p(+a);case V:case Y:return new p(a);case X:return p(a.source,_.exec(a))}var d=!o;o||(o=f()),u||(u=f());for(var m=o.length;m--;)if(o[m]==t)return u[m];return a=l?p(a.length):{},l&&(sr.call(t,"index")&&(a.index=t.index),sr.call(t,"input")&&(a.input=t.input)),o.push(t),u.push(a),(l?He:Mr)(t,function(t,e){a[e]=re(t,n,r,v,o,u)}),d&&(h(o),h(u)),a}function ie(t,e,n){return re(t,!0,e,n)}function oe(t,n,r){var i;return n=e.createCallback(n,r),Mr(t,function(t,e,r){return n(t,e,r)?(i=e,!1):v}),i}function ue(t){var e=[];return Hr(t,function(t,n){ge(t)&&e.push(n)}),e.sort()}function ae(t,e){return t?sr.call(t,e):!1}function se(t){for(var e=-1,n=_r(t),r=n.length,i={};r>++e;){var o=n[e];i[t[o]]=o}return i}function ce(t){return t===!0||t===!1||pr.call(t)==W}function le(t){return t?"object"==typeof t&&pr.call(t)==$:!1}function fe(t){return t?1===t.nodeType:!1}function pe(t){var e=!0;if(!t)return e;var n=pr.call(t),r=t.length;return n==R||n==Y||n==B||n==U&&"number"==typeof r&&ge(t.splice)?!r:(Mr(t,function(){return e=!1}),e)}function he(t,n,r,i,o,u){var a=r===w;if("function"==typeof r&&!a){r=e.createCallback(r,i,2);var s=r(t,n);if(s!==v)return!!s}if(t===n)return 0!==t||1/t==1/n;var c=typeof t,l=typeof n;if(t===t&&(!t||"function"!=c&&"object"!=c)&&(!n||"function"!=l&&"object"!=l))return!1;if(null==t||null==n)return t===n;var p=pr.call(t),d=pr.call(n);if(p==B&&(p=U),d==B&&(d=U),p!=d)return!1;switch(p){case W:case $:return+t==+n;case V:return t!=+t?n!=+n:0==t?1/t==1/n:t==+n;case X:case Y:return t==Gn(n)}var g=p==R;if(!g){if(sr.call(t,"__wrapped__ ")||sr.call(n,"__wrapped__"))return he(t.__wrapped__||t,n.__wrapped__||n,r,i,o,u);if(p!=U)return!1;var m=t.constructor,y=n.constructor;if(m!=y&&!(ge(m)&&m instanceof m&&ge(y)&&y instanceof y))return!1}var b=!o;o||(o=f()),u||(u=f());for(var x=o.length;x--;)if(o[x]==t)return u[x]==n;var C=0;if(s=!0,o.push(t),u.push(n),g){if(x=t.length,C=n.length,s=C==t.length,!s&&!a)return s;for(;C--;){var T=x,k=n[C];if(a)for(;T--&&!(s=he(t[T],k,r,i,o,u)););else if(!(s=he(t[C],k,r,i,o,u)))break}return s}return Hr(n,function(e,n,a){return sr.call(a,n)?(C++,s=sr.call(t,n)&&he(t[n],e,r,i,o,u)):v}),s&&!a&&Hr(t,function(t,e,n){return sr.call(n,e)?s=--C>-1:v}),b&&(h(o),h(u)),s}function de(t){return mr(t)&&!vr(parseFloat(t))}function ge(t){return"function"==typeof t}function me(t){return!(!t||!G[typeof t])}function ve(t){return be(t)&&t!=+t}function ye(t){return null===t}function be(t){return"number"==typeof t||pr.call(t)==V}function xe(t){return t?"object"==typeof t&&pr.call(t)==X:!1}function we(t){return"string"==typeof t||pr.call(t)==Y}function Ce(t){return t===v}function Te(t,n,r){var i=arguments,o=0,u=2;if(!me(t))return t;if(r===w)var a=i[3],s=i[4],c=i[5];else{var l=!0;s=f(),c=f(),"number"!=typeof r&&(u=i.length),u>3&&"function"==typeof i[u-2]?a=e.createCallback(i[--u-1],i[u--],2):u>2&&"function"==typeof i[u-1]&&(a=i[--u])}for(;u>++o;)(Sr(i[o])?He:Mr)(i[o],function(e,n){var r,i,o=e,u=t[n];if(e&&((i=Sr(e))||Pr(e))){for(var l=s.length;l--;)if(r=s[l]==e){u=c[l];break}if(!r){var f;a&&(o=a(u,e),(f=o!==v)&&(u=o)),f||(u=i?Sr(u)?u:[]:Pr(u)?u:{}),s.push(e),c.push(u),f||(u=Te(u,e,w,a,s,c))}}else a&&(o=a(u,e),o===v&&(o=e)),o!==v&&(u=o);t[n]=u});return l&&(h(s),h(c)),t}function ke(t,n,r){var i=k(),o="function"==typeof n,u={};if(o)n=e.createCallback(n,r);else var a=ir.apply(Kn,Tr.call(arguments,1));return Hr(t,function(t,e,r){(o?!n(t,e,r):0>i(a,e))&&(u[e]=t)}),u}function Ee(t){for(var e=-1,n=_r(t),r=n.length,i=Wn(r);r>++e;){var o=n[e];i[e]=[o,t[o]]}return i}function Ne(t,n,r){var i={};if("function"!=typeof n)for(var o=-1,u=ir.apply(Kn,Tr.call(arguments,1)),a=me(t)?u.length:0;a>++o;){var s=u[o];s in t&&(i[s]=t[s])}else n=e.createCallback(n,r),Hr(t,function(t,e,r){n(t,e,r)&&(i[e]=t)});return i}function je(t,n,r,i){var o=Sr(t);if(n=e.createCallback(n,i,4),null==r)if(o)r=[];else{var u=t&&t.constructor,a=u&&u.prototype;r=y(a)}return(o?He:Mr)(t,function(t,e,i){return n(r,t,e,i)}),r}function Se(t){for(var e=-1,n=_r(t),r=n.length,i=Wn(r);r>++e;)i[e]=t[n[e]];return i}function Ae(t){for(var e=-1,n=ir.apply(Kn,Tr.call(arguments,1)),r=n.length,i=Wn(r);r>++e;)i[e]=t[n[e]];return i}function _e(t,e,n){var r=-1,i=k(),o=t?t.length:0,u=!1;return n=(0>n?br(0,o+n):n)||0,o&&"number"==typeof o?u=(we(t)?t.indexOf(e,n):i(t,e,n))>-1:Mr(t,function(t){return++r>=n?!(u=t===e):v}),u}function De(t,n,r){var i={};return n=e.createCallback(n,r),He(t,function(t,e,r){e=Gn(n(t,e,r)),sr.call(i,e)?i[e]++:i[e]=1}),i}function qe(t,n,r){var i=!0;n=e.createCallback(n,r);var o=-1,u=t?t.length:0;if("number"==typeof u)for(;u>++o&&(i=!!n(t[o],o,t)););else Mr(t,function(t,e,r){return i=!!n(t,e,r)});return i}function Oe(t,n,r){var i=[];n=e.createCallback(n,r);var o=-1,u=t?t.length:0;if("number"==typeof u)for(;u>++o;){var a=t[o];n(a,o,t)&&i.push(a)}else Mr(t,function(t,e,r){n(t,e,r)&&i.push(t)});return i}function Le(t,n,r){n=e.createCallback(n,r);var i=-1,o=t?t.length:0;if("number"!=typeof o){var u;return Mr(t,function(t,e,r){return n(t,e,r)?(u=t,!1):v}),u}for(;o>++i;){var a=t[i];if(n(a,i,t))return a}}function He(t,n,r){var i=-1,o=t?t.length:0;if(n=n&&r===v?n:e.createCallback(n,r),"number"==typeof o)for(;o>++i&&n(t[i],i,t)!==!1;);else Mr(t,n);return t}function Me(t,n,r){var i={};return n=e.createCallback(n,r),He(t,function(t,e,r){e=Gn(n(t,e,r)),(sr.call(i,e)?i[e]:i[e]=[]).push(t)}),i}function Pe(t,e){var n=Tr.call(arguments,2),r=-1,i="function"==typeof e,o=t?t.length:0,u=Wn("number"==typeof o?o:0);return He(t,function(t){u[++r]=(i?e:t[e]).apply(t,n)}),u}function Fe(t,n,r){var i=-1,o=t?t.length:0;if(n=e.createCallback(n,r),"number"==typeof o)for(var u=Wn(o);o>++i;)u[i]=n(t[i],i,t);else u=[],Mr(t,function(t,e,r){u[++i]=n(t,e,r)});return u}function Ie(t,n,r){var i=-1/0,o=i;if(!n&&Sr(t))for(var u=-1,s=t.length;s>++u;){var c=t[u];c>o&&(o=c)}else n=!n&&we(t)?a:e.createCallback(n,r),He(t,function(t,e,r){var u=n(t,e,r);u>i&&(i=u,o=t)});return o}function Be(t,n,r){var i=1/0,o=i;if(!n&&Sr(t))for(var u=-1,s=t.length;s>++u;){var c=t[u];o>c&&(o=c)}else n=!n&&we(t)?a:e.createCallback(n,r),He(t,function(t,e,r){var u=n(t,e,r);i>u&&(i=u,o=t)});return o}function Re(t,e){var n=-1,r=t?t.length:0;if("number"==typeof r)for(var i=Wn(r);r>++n;)i[n]=t[n][e];return i||Fe(t,e)}function We(t,n,r,i){if(!t)return r;var o=3>arguments.length;n=e.createCallback(n,i,4);var u=-1,a=t.length;if("number"==typeof a)for(o&&(r=t[++u]);a>++u;)r=n(r,t[u],u,t);else Mr(t,function(t,e,i){r=o?(o=!1,t):n(r,t,e,i)});return r}function $e(t,n,r,i){var o=t,u=t?t.length:0,a=3>arguments.length;if("number"!=typeof u){var s=_r(t);u=s.length}return n=e.createCallback(n,i,4),He(t,function(t,e,i){e=s?s[--u]:--u,r=a?(a=!1,o[e]):n(r,o[e],e,i)}),r}function ze(t,n,r){return n=e.createCallback(n,r),Oe(t,function(t,e,r){return!n(t,e,r)})}function Ve(t){var e=-1,n=t?t.length:0,r=Wn("number"==typeof n?n:0);return He(t,function(t){var n=or(Cr()*(++e+1));r[e]=r[n],r[n]=t}),r}function Ue(t){var e=t?t.length:0;return"number"==typeof e?e:_r(t).length}function Xe(t,n,r){var i;n=e.createCallback(n,r);var o=-1,u=t?t.length:0;if("number"==typeof u)for(;u>++o&&!(i=n(t[o],o,t)););else Mr(t,function(t,e,r){return!(i=n(t,e,r))});return!!i}function Ye(t,n,r){var i=-1,o=t?t.length:0,u=Wn("number"==typeof o?o:0);for(n=e.createCallback(n,r),He(t,function(t,e,r){var o=u[++i]=p();o.criteria=n(t,e,r),o.index=i,o.value=t}),o=u.length,u.sort(s);o--;){var a=u[o];u[o]=a.value,d(a)}return u}function Je(t){return t&&"number"==typeof t.length?g(t):Se(t)}function Ge(t){for(var e=-1,n=t?t.length:0,r=[];n>++e;){var i=t[e];i&&r.push(i)}return r}function Qe(t){var e=-1,n=k(),r=t?t.length:0,u=ir.apply(Kn,Tr.call(arguments,1)),a=[],s=r>=T&&n===i;if(s){var l=c(u);l?(n=o,u=l):s=!1}for(;r>++e;){var f=t[e];0>n(u,f)&&a.push(f)}return s&&d(u),a}function Ke(t,n,r){var i=-1,o=t?t.length:0;for(n=e.createCallback(n,r);o>++i;)if(n(t[i],i,t))return i;return-1}function Ze(t,n,r){if(t){var i=0,o=t.length;if("number"!=typeof n&&null!=n){var u=-1;for(n=e.createCallback(n,r);o>++u&&n(t[u],u,t);)i++}else if(i=n,null==i||r)return t[0];return g(t,0,xr(br(0,i),o))}}function tn(t,e,n){if("number"==typeof n){var r=t?t.length:0;n=0>n?br(0,r+n):n||0}else if(n){var o=sn(t,e);return t[o]===e?o:-1}return t?i(t,e,n):-1}function en(t,n,r){if(!t)return[];var i=0,o=t.length;if("number"!=typeof n&&null!=n){var u=o;for(n=e.createCallback(n,r);u--&&n(t[u],u,t);)i++}else i=null==n||r?1:n||i;return g(t,0,xr(br(0,o-i),o))}function nn(t){for(var e=arguments,n=e.length,r=-1,u=f(),a=-1,s=k(),l=t?t.length:0,p=[],g=f();n>++r;){var m=e[r];u[r]=s===i&&(m?m.length:0)>=T&&c(r?e[r]:g)}t:for(;l>++a;){var v=u[0];if(m=t[a],0>(v?o(v,m):s(g,m))){for(r=n,(v||g).push(m);--r;)if(v=u[r],0>(v?o(v,m):s(e[r],m)))continue t;p.push(m)}}for(;n--;)v=u[n],v&&d(v);return h(u),h(g),p}function rn(t,n,r){if(t){var i=0,o=t.length;if("number"!=typeof n&&null!=n){var u=o;for(n=e.createCallback(n,r);u--&&n(t[u],u,t);)i++}else if(i=n,null==i||r)return t[o-1];return g(t,br(0,o-i))}}function on(t,e,n){var r=t?t.length:0;for("number"==typeof n&&(r=(0>n?br(0,r+n):xr(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function un(t,e,n){t=+t||0,n=+n||1,null==e&&(e=t,t=0);for(var r=-1,i=br(0,nr((e-t)/n)),o=Wn(i);i>++r;)o[r]=t,t+=n;return o}function an(t,n,r){if("number"!=typeof n&&null!=n){var i=0,o=-1,u=t?t.length:0;for(n=e.createCallback(n,r);u>++o&&n(t[o],o,t);)i++}else i=null==n||r?1:br(0,n);return g(t,i)}function sn(t,n,r,i){var o=0,u=t?t.length:o;for(r=r?e.createCallback(r,i,1):_n,n=r(n);u>o;){var a=o+u>>>1;n>r(t[a])?o=a+1:u=a}return o}function cn(t){return Sr(t)||(arguments[0]=t?Tr.call(t):Kn),Br(ir.apply(Kn,arguments))}function ln(t){for(var e=-1,n=t?Ie(Re(t,"length")):0,r=Wn(0>n?0:n);n>++e;)r[e]=Re(t,e);return r}function fn(t){return Qe(t,Tr.call(arguments,1))}function pn(t){return t?ln(arguments):[]}function hn(t,e){for(var n=-1,r=t?t.length:0,i={};r>++n;){var o=t[n];e?i[o]=e[n]:i[o[0]]=o[1]}return i}function dn(t,e){return 1>t?e():function(){return 1>--t?e.apply(this,arguments):v}}function gn(t,e){return jr.fastBind||hr&&arguments.length>2?hr.call.apply(hr,arguments):u(t,e,Tr.call(arguments,2))}function mn(t){for(var e=arguments.length>1?ir.apply(Kn,Tr.call(arguments,1)):ue(t),n=-1,r=e.length;r>++n;){var i=e[n];t[i]=gn(t[i],t)}return t}function vn(t,e){return u(t,e,Tr.call(arguments,2),w)}function yn(){var t=arguments;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function bn(t,e,n){if(null==t)return _n;var r=typeof t;if("function"!=r){if("object"!=r)return function(e){return e[t]};var i=_r(t);return function(e){for(var n=i.length,r=!1;n--&&(r=he(e[i[n]],t[i[n]],w)););return r}}return e===v||q&&!q.test(ur.call(t))?t:1===n?function(n){return t.call(e,n)}:2===n?function(n,r){return t.call(e,n,r)}:4===n?function(n,r,i,o){return t.call(e,n,r,i,o)}:function(n,r,i){return t.call(e,n,r,i)}}function xn(t,e,n){function r(){rr(p),rr(h),c=0,p=h=null}function i(){var e=d&&(!g||c>1);r(),e&&(f!==!1&&(l=new zn),a=t.apply(s,u))}function o(){r(),(d||f!==e)&&(l=new zn,a=t.apply(s,u))}var u,a,s,c=0,l=0,f=!1,p=null,h=null,d=!0;if(e=br(0,e||0),n===!0){var g=!0;d=!1}else me(n)&&(g=n.leading,f="maxWait"in n&&br(e,n.maxWait||0),d="trailing"in n?n.trailing:d);return function(){if(u=arguments,s=this,c++,rr(h),f===!1)g&&2>c&&(a=t.apply(s,u));else{var n=new zn;p||g||(l=n);var r=f-(n-l);0>=r?(rr(p),p=null,l=n,a=t.apply(s,u)):p||(p=fr(o,r))}return e!==f&&(h=fr(i,e)),a}}function wn(t){var e=Tr.call(arguments,1);return fr(function(){t.apply(v,e)},1)}function Cn(t,e){var n=Tr.call(arguments,2);return fr(function(){t.apply(v,n)},e)}function Tn(t,e){function n(){var r=n.cache,i=C+(e?e.apply(this,arguments):arguments[0]);return sr.call(r,i)?r[i]:r[i]=t.apply(this,arguments)}return n.cache={},n}function kn(t){var e,n;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function En(t){return u(t,Tr.call(arguments,1))}function Nn(t){return u(t,Tr.call(arguments,1),null,w)}function jn(t,e,n){var r=!0,i=!0;n===!1?r=!1:me(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),n=p(),n.leading=r,n.maxWait=e,n.trailing=i;var o=xn(t,e,n);return d(n),o}function Sn(t,e){return function(){var n=[t];return cr.apply(n,arguments),e.apply(this,n)}}function An(t){return null==t?"":Gn(t).replace(M,b)
}function _n(t){return t}function Dn(t){He(ue(t),function(r){var i=e[r]=t[r];e.prototype[r]=function(){var t=this.__wrapped__,r=[t];cr.apply(r,arguments);var o=i.apply(e,r);return t&&"object"==typeof t&&t===o?this:new n(o)}})}function qn(){return t._=tr,this}function On(t,e){null==t&&null==e&&(e=1),t=+t||0,null==e?(e=t,t=0):e=+e||0;var n=Cr();return t%1||e%1?t+xr(n*(e-t+parseFloat("1e-"+((n+"").length-1))),e):t+or(n*(e-t+1))}function Ln(t,e){var n=t?t[e]:v;return ge(n)?t[e]():n}function Hn(t,n,r){var i=e.templateSettings;t||(t=""),r=Lr({},r,i);var o,u=Lr({},r.imports,i.imports),a=_r(u),s=Se(u),c=0,f=r.interpolate||H,p="__p += '",h=Jn((r.escape||H).source+"|"+f.source+"|"+(f===D?A:H).source+"|"+(r.evaluate||H).source+"|$","g");t.replace(h,function(e,n,r,i,u,a){return r||(r=i),p+=t.slice(c,a).replace(P,l),n&&(p+="' +\n__e("+n+") +\n'"),u&&(o=!0,p+="';\n"+u+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=a+e.length,e}),p+="';\n";var d=r.variable,g=d;g||(d="obj",p="with ("+d+") {\n"+p+"\n}\n"),p=(o?p.replace(E,""):p).replace(N,"$1").replace(j,"$1;"),p="function("+d+") {\n"+(g?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var m="\n/*\n//@ sourceURL="+(r.sourceURL||"/lodash/template/source["+I++ +"]")+"\n*/";try{var y=Vn(a,"return "+p+m).apply(v,s)}catch(b){throw b.source=p,b}return n?y(n):(y.source=p,y)}function Mn(t,n,r){t=(t=+t)>-1?t:0;var i=-1,o=Wn(t);for(n=e.createCallback(n,r,1);t>++i;)o[i]=n(i);return o}function Pn(t){return null==t?"":Gn(t).replace(S,te)}function Fn(t){var e=++x;return Gn(null==t?"":t)+e}function In(t,e){return e(t),t}function Bn(){return Gn(this.__wrapped__)}function Rn(){return this.__wrapped__}t=t?ee.defaults(r.Object(),t,ee.pick(r,F)):r;var Wn=t.Array,$n=t.Boolean,zn=t.Date,Vn=t.Function,Un=t.Math,Xn=t.Number,Yn=t.Object,Jn=t.RegExp,Gn=t.String,Qn=t.TypeError,Kn=[],Zn=Yn.prototype;Gn.prototype;var tr=t._,er=Jn("^"+Gn(Zn.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),nr=Un.ceil,rr=t.clearTimeout,ir=Kn.concat,or=Un.floor,ur=Vn.prototype.toString,ar=er.test(ar=Yn.getPrototypeOf)&&ar,sr=Zn.hasOwnProperty,cr=Kn.push,lr=(Zn.propertyIsEnumerable,t.setImmediate),fr=t.setTimeout,pr=Zn.toString,hr=er.test(hr=pr.bind)&&hr,dr=er.test(dr=Yn.create)&&dr,gr=er.test(gr=Wn.isArray)&&gr,mr=t.isFinite,vr=t.isNaN,yr=er.test(yr=Yn.keys)&&yr,br=Un.max,xr=Un.min,wr=t.parseInt,Cr=Un.random,Tr=Kn.slice,kr=er.test(t.attachEvent),Er=hr&&!/\n|true/.test(hr+kr),Nr={};Nr[R]=Wn,Nr[W]=$n,Nr[$]=zn,Nr[z]=Vn,Nr[U]=Yn,Nr[V]=Xn,Nr[X]=Jn,Nr[Y]=Gn,n.prototype=e.prototype;var jr=e.support={};jr.fastBind=hr&&!Er,e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:D,variable:"",imports:{_:e}};var Sr=gr,Ar=function(t){var e,n=t,r=[];if(!n)return r;if(!G[typeof t])return r;for(e in n)sr.call(n,e)&&r.push(e);return r},_r=yr?function(t){return me(t)?yr(t):[]}:Ar,Dr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qr=se(Dr),Or=function(t,n,r){var i,o=t,u=o;if(!o)return u;var a=arguments,s=0,c="number"==typeof r?2:a.length;if(c>3&&"function"==typeof a[c-2])var l=e.createCallback(a[--c-1],a[c--],2);else c>2&&"function"==typeof a[c-1]&&(l=a[--c]);for(;c>++s;)if(o=a[s],o&&G[typeof o])for(var f=-1,p=G[typeof o]&&_r(o),h=p?p.length:0;h>++f;)i=p[f],u[i]=l?l(u[i],o[i]):o[i];return u},Lr=function(t,e,n){var r,i=t,o=i;if(!i)return o;for(var u=arguments,a=0,s="number"==typeof n?2:u.length;s>++a;)if(i=u[a],i&&G[typeof i])for(var c=-1,l=G[typeof i]&&_r(i),f=l?l.length:0;f>++c;)r=l[c],o[r]===v&&(o[r]=i[r]);return o},Hr=function(t,n,r){var i,o=t,u=o;if(!o)return u;if(!G[typeof o])return u;n=n&&r===v?n:e.createCallback(n,r);for(i in o)if(n(o[i],i,t)===!1)return u;return u},Mr=function(t,n,r){var i,o=t,u=o;if(!o)return u;if(!G[typeof o])return u;n=n&&r===v?n:e.createCallback(n,r);for(var a=-1,s=G[typeof o]&&_r(o),c=s?s.length:0;c>++a;)if(i=s[a],n(o[i],i,t)===!1)return u;return u},Pr=function(t){if(!t||pr.call(t)!=U)return!1;var e=t.valueOf,n="function"==typeof e&&(n=ar(e))&&ar(n);return n?t==n||ar(t)==n:K(t)},Fr=Oe,Ir=Q(function Ir(t,e,n){for(var r=-1,i=t?t.length:0,o=[];i>++r;){var u=t[r];n&&(u=n(u,r,t)),Sr(u)?cr.apply(o,e?u:Ir(u)):o.push(u)}return o}),Br=Q(function(t,e,n){var r=-1,u=k(),a=t?t.length:0,s=[],l=!e&&a>=T&&u===i,p=n||l?f():s;if(l){var g=c(p);g?(u=o,p=g):(l=!1,p=n?p:(h(p),s))}for(;a>++r;){var m=t[r],v=n?n(m,r,t):m;(e?!r||p[p.length-1]!==v:0>u(p,v))&&((n||l)&&p.push(v),s.push(m))}return l?(h(p.array),d(p)):n&&h(p),s});Er&&Z&&"function"==typeof lr&&(wn=gn(lr,t));var Rr=8==wr(O+"08")?wr:function(t,e){return wr(we(t)?t.replace(L,""):t,e||0)};return e.after=dn,e.assign=Or,e.at=Ae,e.bind=gn,e.bindAll=mn,e.bindKey=vn,e.compact=Ge,e.compose=yn,e.countBy=De,e.createCallback=bn,e.debounce=xn,e.defaults=Lr,e.defer=wn,e.delay=Cn,e.difference=Qe,e.filter=Oe,e.flatten=Ir,e.forEach=He,e.forIn=Hr,e.forOwn=Mr,e.functions=ue,e.groupBy=Me,e.initial=en,e.intersection=nn,e.invert=se,e.invoke=Pe,e.keys=_r,e.map=Fe,e.max=Ie,e.memoize=Tn,e.merge=Te,e.min=Be,e.omit=ke,e.once=kn,e.pairs=Ee,e.partial=En,e.partialRight=Nn,e.pick=Ne,e.pluck=Re,e.range=un,e.reject=ze,e.rest=an,e.shuffle=Ve,e.sortBy=Ye,e.tap=In,e.throttle=jn,e.times=Mn,e.toArray=Je,e.transform=je,e.union=cn,e.uniq=Br,e.unzip=ln,e.values=Se,e.where=Fr,e.without=fn,e.wrap=Sn,e.zip=pn,e.zipObject=hn,e.collect=Fe,e.drop=an,e.each=He,e.extend=Or,e.methods=ue,e.object=hn,e.select=Oe,e.tail=an,e.unique=Br,Dn(e),e.chain=e,e.prototype.chain=function(){return this},e.clone=re,e.cloneDeep=ie,e.contains=_e,e.escape=An,e.every=qe,e.find=Le,e.findIndex=Ke,e.findKey=oe,e.has=ae,e.identity=_n,e.indexOf=tn,e.isArguments=ne,e.isArray=Sr,e.isBoolean=ce,e.isDate=le,e.isElement=fe,e.isEmpty=pe,e.isEqual=he,e.isFinite=de,e.isFunction=ge,e.isNaN=ve,e.isNull=ye,e.isNumber=be,e.isObject=me,e.isPlainObject=Pr,e.isRegExp=xe,e.isString=we,e.isUndefined=Ce,e.lastIndexOf=on,e.mixin=Dn,e.noConflict=qn,e.parseInt=Rr,e.random=On,e.reduce=We,e.reduceRight=$e,e.result=Ln,e.runInContext=m,e.size=Ue,e.some=Xe,e.sortedIndex=sn,e.template=Hn,e.unescape=Pn,e.uniqueId=Fn,e.all=qe,e.any=Xe,e.detect=Le,e.findWhere=Le,e.foldl=We,e.foldr=$e,e.include=_e,e.inject=We,Mr(e,function(t,n){e.prototype[n]||(e.prototype[n]=function(){var n=[this.__wrapped__];return cr.apply(n,arguments),t.apply(e,n)})}),e.first=Ze,e.last=rn,e.take=Ze,e.head=Ze,Mr(e,function(t,r){e.prototype[r]||(e.prototype[r]=function(e,r){var i=t(this.__wrapped__,e,r);return null==e||r&&"function"!=typeof e?i:new n(i)})}),e.VERSION="1.3.1",e.prototype.toString=Bn,e.prototype.value=Rn,e.prototype.valueOf=Rn,He(["join","pop","shift"],function(t){var n=Kn[t];e.prototype[t]=function(){return n.apply(this.__wrapped__,arguments)}}),He(["push","reverse","sort","unshift"],function(t){var n=Kn[t];e.prototype[t]=function(){return n.apply(this.__wrapped__,arguments),this}}),He(["concat","slice","splice"],function(t){var r=Kn[t];e.prototype[t]=function(){return new n(r.apply(this.__wrapped__,arguments))}}),e}var v,y=[],b=[],x=0,w={},C=+new Date+"",T=75,k=40,E=/\b__p \+= '';/g,N=/\b(__p \+=) '' \+/g,j=/(__e\(.*?\)|\b__t\)) \+\n'';/g,S=/&(?:amp|lt|gt|quot|#39);/g,A=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_=/\w*$/,D=/<%=([\s\S]+?)%>/g,q=(q=/\bthis\b/)&&q.test(m)&&q,O=" \f \n\r\u2028\u2029 ᠎              ",L=RegExp("^["+O+"]*0+(?=.$)"),H=/($^)/,M=/[&<>"']/g,P=/['\n\r\t\u2028\u2029\\]/g,F=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setImmediate","setTimeout"],I=0,B="[object Arguments]",R="[object Array]",W="[object Boolean]",$="[object Date]",z="[object Function]",V="[object Number]",U="[object Object]",X="[object RegExp]",Y="[object String]",J={};J[z]=!1,J[B]=J[R]=J[W]=J[$]=J[V]=J[U]=J[X]=J[Y]=!0;var G={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Q={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=G[typeof n]&&n,Z=G[typeof e]&&e&&e.exports==K&&e,te=G[typeof t]&&t;!te||te.global!==te&&te.window!==te||(r=te);var ee=m();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(r._=ee,define(function(){return ee})):K&&!K.nodeType?Z?(Z.exports=ee)._=ee:K._=ee:r._=ee})(this)})(self)},{}]},{},[]);var $=require("jquery2"),Bacon=require("baconjs");$.fn.asEventStream=Bacon.$.asEventStream;var _=require("lodash"),button=function(t){var e=_.defaults(t,{rate:10,delay:300,value:!0}),n=e.$el,r=e.rate,i=e.delay,o=e.value,u=1e3/r,a=i/u,s={mousedown:!1,counter:a,value:!1},c=n.asEventStream("mousedown").map("mousedown"),l=$(document).asEventStream("mouseup").map("mouseup"),f=Bacon.interval(u,"tick"),p=Bacon.mergeAll(c,l,f),h=p.scan(s,function(t,e){return"mousedown"===e?(t.mousedown=!0,t.value=!0,t):"mouseup"===e?(t.mousedown=!1,t.value=!1,t):"tick"===e?0===t.counter&&t.mousedown?(t.value=!0,t):t.mousedown?(t.counter-=1,t.value=!1,t):(t.counter=a,t):void 0}),d=function(t){return t.value===!0};return h.filter(d).map(o).changes()},plusOnes=button({$el:$(document),value:1}),score=plusOnes.scan(0,function(t,e){return t+e});score.assign($("body"),"text");
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment