path
stringlengths
5
304
repo_name
stringlengths
6
79
content
stringlengths
27
1.05M
ajax/libs/aui/5.4.3/aui/js/aui-dependencies.js
extend1994/cdnjs
(function(t,e){function i(t){var e=fe[t]={};return G.each(t.split(ee),function(t,i){e[i]=!0}),e}function n(t,i,n){if(n===e&&1===t.nodeType){var r="data-"+i.replace(me,"-$1").toLowerCase();if(n=t.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:ge.test(n)?G.parseJSON(n):n}catch(a){}G.data(t,i,n)}else n=e}return n}function r(t){var e;for(e in t)if(("data"!==e||!G.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function a(){return!1}function s(){return!0}function o(t){return!t||!t.parentNode||11===t.parentNode.nodeType}function l(t,e){do t=t[e];while(t&&1!==t.nodeType);return t}function u(t,e,i){if(e=e||0,G.isFunction(e))return G.grep(t,function(t,n){var r=!!e.call(t,n,t);return r===i});if(e.nodeType)return G.grep(t,function(t){return t===e===i});if("string"==typeof e){var n=G.grep(t,function(t){return 1===t.nodeType});if(Le.test(e))return G.filter(e,n,!i);e=G.filter(e,n)}return G.grep(t,function(t){return G.inArray(t,e)>=0===i})}function c(t){var e=Oe.split("|"),i=t.createDocumentFragment();if(i.createElement)for(;e.length;)i.createElement(e.pop());return i}function h(t,e){return t.getElementsByTagName(e)[0]||t.appendChild(t.ownerDocument.createElement(e))}function d(t,e){if(1===e.nodeType&&G.hasData(t)){var i,n,r,a=G._data(t),s=G._data(e,a),o=a.events;if(o){delete s.handle,s.events={};for(i in o)for(n=0,r=o[i].length;r>n;n++)G.event.add(e,i,o[i][n])}s.data&&(s.data=G.extend({},s.data))}}function p(t,e){var i;1===e.nodeType&&(e.clearAttributes&&e.clearAttributes(),e.mergeAttributes&&e.mergeAttributes(t),i=e.nodeName.toLowerCase(),"object"===i?(e.parentNode&&(e.outerHTML=t.outerHTML),G.support.html5Clone&&t.innerHTML&&!G.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)):"input"===i&&Ve.test(t.type)?(e.defaultChecked=e.checked=t.checked,e.value!==t.value&&(e.value=t.value)):"option"===i?e.selected=t.defaultSelected:"input"===i||"textarea"===i?e.defaultValue=t.defaultValue:"script"===i&&e.text!==t.text&&(e.text=t.text),e.removeAttribute(G.expando))}function f(t){return t.getElementsByTagName!==e?t.getElementsByTagName("*"):t.querySelectorAll!==e?t.querySelectorAll("*"):[]}function g(t){Ve.test(t.type)&&(t.defaultChecked=t.checked)}function m(t,e){if(e in t)return e;for(var i=e.charAt(0).toUpperCase()+e.slice(1),n=e,r=vi.length;r--;)if(e=vi[r]+i,e in t)return e;return n}function v(t,e){return t=e||t,"none"===G.css(t,"display")||!G.contains(t.ownerDocument,t)}function y(t,e){for(var i,n,r=[],a=0,s=t.length;s>a;a++)i=t[a],i.style&&(r[a]=G._data(i,"olddisplay"),e?(r[a]||"none"!==i.style.display||(i.style.display=""),""===i.style.display&&v(i)&&(r[a]=G._data(i,"olddisplay",_(i.nodeName)))):(n=ii(i,"display"),r[a]||"none"===n||G._data(i,"olddisplay",n)));for(a=0;s>a;a++)i=t[a],i.style&&(e&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=e?r[a]||"":"none"));return t}function b(t,e,i){var n=ci.exec(e);return n?Math.max(0,n[1]-(i||0))+(n[2]||"px"):e}function x(t,e,i,n){for(var r=i===(n?"border":"content")?4:"width"===e?1:0,a=0;4>r;r+=2)"margin"===i&&(a+=G.css(t,i+mi[r],!0)),n?("content"===i&&(a-=parseFloat(ii(t,"padding"+mi[r]))||0),"margin"!==i&&(a-=parseFloat(ii(t,"border"+mi[r]+"Width"))||0)):(a+=parseFloat(ii(t,"padding"+mi[r]))||0,"padding"!==i&&(a+=parseFloat(ii(t,"border"+mi[r]+"Width"))||0));return a}function w(t,e,i){var n="width"===e?t.offsetWidth:t.offsetHeight,r=!0,a=G.support.boxSizing&&"border-box"===G.css(t,"boxSizing");if(0>=n||null==n){if(n=ii(t,e),(0>n||null==n)&&(n=t.style[e]),hi.test(n))return n;r=a&&(G.support.boxSizingReliable||n===t.style[e]),n=parseFloat(n)||0}return n+x(t,e,i||(a?"border":"content"),r)+"px"}function _(t){if(pi[t])return pi[t];var e=G("<"+t+">").appendTo(H.body),i=e.css("display");return e.remove(),("none"===i||""===i)&&(ni=H.body.appendChild(ni||G.extend(H.createElement("iframe"),{frameBorder:0,width:0,height:0})),ri&&ni.createElement||(ri=(ni.contentWindow||ni.contentDocument).document,ri.write("<!doctype html><html><body>"),ri.close()),e=ri.body.appendChild(ri.createElement(t)),i=ii(e,"display"),H.body.removeChild(ni)),pi[t]=i,i}function k(t,e,i,n){var r;if(G.isArray(e))G.each(e,function(e,r){i||xi.test(t)?n(t,r):k(t+"["+("object"==typeof r?e:"")+"]",r,i,n)});else if(i||"object"!==G.type(e))n(t,e);else for(r in e)k(t+"["+r+"]",e[r],i,n)}function S(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r,a,s=e.toLowerCase().split(ee),o=0,l=s.length;if(G.isFunction(i))for(;l>o;o++)n=s[o],a=/^\+/.test(n),a&&(n=n.substr(1)||"*"),r=t[n]=t[n]||[],r[a?"unshift":"push"](i)}}function A(t,i,n,r,a,s){a=a||i.dataTypes[0],s=s||{},s[a]=!0;for(var o,l=t[a],u=0,c=l?l.length:0,h=t===Li;c>u&&(h||!o);u++)o=l[u](i,n,r),"string"==typeof o&&(!h||s[o]?o=e:(i.dataTypes.unshift(o),o=A(t,i,n,r,o,s)));return!h&&o||s["*"]||(o=A(t,i,n,r,"*",s)),o}function D(t,i){var n,r,a=G.ajaxSettings.flatOptions||{};for(n in i)i[n]!==e&&((a[n]?t:r||(r={}))[n]=i[n]);r&&G.extend(!0,t,r)}function C(t,i,n){var r,a,s,o,l=t.contents,u=t.dataTypes,c=t.responseFields;for(a in c)a in n&&(i[c[a]]=n[a]);for(;"*"===u[0];)u.shift(),r===e&&(r=t.mimeType||i.getResponseHeader("content-type"));if(r)for(a in l)if(l[a]&&l[a].test(r)){u.unshift(a);break}if(u[0]in n)s=u[0];else{for(a in n){if(!u[0]||t.converters[a+" "+u[0]]){s=a;break}o||(o=a)}s=s||o}return s?(s!==u[0]&&u.unshift(s),n[s]):e}function T(t,e){var i,n,r,a,s=t.dataTypes.slice(),o=s[0],l={},u=0;if(t.dataFilter&&(e=t.dataFilter(e,t.dataType)),s[1])for(i in t.converters)l[i.toLowerCase()]=t.converters[i];for(;r=s[++u];)if("*"!==r){if("*"!==o&&o!==r){if(i=l[o+" "+r]||l["* "+r],!i)for(n in l)if(a=n.split(" "),a[1]===r&&(i=l[o+" "+a[0]]||l["* "+a[0]])){i===!0?i=l[n]:l[n]!==!0&&(r=a[0],s.splice(u--,0,r));break}if(i!==!0)if(i&&t["throws"])e=i(e);else try{e=i(e)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+o+" to "+r}}}o=r}return{state:"success",data:e}}function M(){try{return new t.XMLHttpRequest}catch(e){}}function N(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function P(){return setTimeout(function(){Ui=e},0),Ui=G.now()}function J(t,e){G.each(e,function(e,i){for(var n=(Zi[e]||[]).concat(Zi["*"]),r=0,a=n.length;a>r;r++)if(n[r].call(t,e,i))return})}function $(t,e,i){var n,r=0,a=Gi.length,s=G.Deferred().always(function(){delete o.elem}),o=function(){for(var e=Ui||P(),i=Math.max(0,l.startTime+l.duration-e),n=i/l.duration||0,r=1-n,a=0,o=l.tweens.length;o>a;a++)l.tweens[a].run(r);return s.notifyWith(t,[l,r,i]),1>r&&o?i:(s.resolveWith(t,[l]),!1)},l=s.promise({elem:t,props:G.extend({},e),opts:G.extend(!0,{specialEasing:{}},i),originalProperties:e,originalOptions:i,startTime:Ui||P(),duration:i.duration,tweens:[],createTween:function(e,i){var n=G.Tween(t,l.opts,e,i,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){for(var i=0,n=e?l.tweens.length:0;n>i;i++)l.tweens[i].run(1);return e?s.resolveWith(t,[l,e]):s.rejectWith(t,[l,e]),this}}),u=l.props;for(E(u,l.opts.specialEasing);a>r;r++)if(n=Gi[r].call(l,t,u,l.opts))return n;return J(l,u),G.isFunction(l.opts.start)&&l.opts.start.call(t,l),G.fx.timer(G.extend(o,{anim:l,queue:l.opts.queue,elem:t})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function E(t,e){var i,n,r,a,s;for(i in t)if(n=G.camelCase(i),r=e[n],a=t[i],G.isArray(a)&&(r=a[1],a=t[i]=a[0]),i!==n&&(t[n]=a,delete t[i]),s=G.cssHooks[n],s&&"expand"in s){a=s.expand(a),delete t[n];for(i in a)i in t||(t[i]=a[i],e[i]=r)}else e[n]=r}function I(t,e,i){var n,r,a,s,o,l,u,c,h,d=this,p=t.style,f={},g=[],m=t.nodeType&&v(t);i.queue||(c=G._queueHooks(t,"fx"),null==c.unqueued&&(c.unqueued=0,h=c.empty.fire,c.empty.fire=function(){c.unqueued||h()}),c.unqueued++,d.always(function(){d.always(function(){c.unqueued--,G.queue(t,"fx").length||c.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(i.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===G.css(t,"display")&&"none"===G.css(t,"float")&&(G.support.inlineBlockNeedsLayout&&"inline"!==_(t.nodeName)?p.zoom=1:p.display="inline-block")),i.overflow&&(p.overflow="hidden",G.support.shrinkWrapBlocks||d.done(function(){p.overflow=i.overflow[0],p.overflowX=i.overflow[1],p.overflowY=i.overflow[2]}));for(n in e)if(a=e[n],Vi.exec(a)){if(delete e[n],l=l||"toggle"===a,a===(m?"hide":"show"))continue;g.push(n)}if(s=g.length){o=G._data(t,"fxshow")||G._data(t,"fxshow",{}),"hidden"in o&&(m=o.hidden),l&&(o.hidden=!m),m?G(t).show():d.done(function(){G(t).hide()}),d.done(function(){var e;G.removeData(t,"fxshow",!0);for(e in f)G.style(t,e,f[e])});for(n=0;s>n;n++)r=g[n],u=d.createTween(r,m?o[r]:0),f[r]=o[r]||G.style(t,r),r in o||(o[r]=u.start,m&&(u.end=u.start,u.start="width"===r||"height"===r?1:0))}}function L(t,e,i,n,r){return new L.prototype.init(t,e,i,n,r)}function j(t,e){var i,n={height:t},r=0;for(e=e?1:0;4>r;r+=2-e)i=mi[r],n["margin"+i]=n["padding"+i]=t;return e&&(n.opacity=n.width=t),n}function F(t){return G.isWindow(t)?t:9===t.nodeType?t.defaultView||t.parentWindow:!1}var O,R,H=t.document,B=t.location,z=t.navigator,Y=t.jQuery,W=t.$,q=Array.prototype.push,U=Array.prototype.slice,X=Array.prototype.indexOf,V=Object.prototype.toString,K=Object.prototype.hasOwnProperty,Q=String.prototype.trim,G=function(t,e){return new G.fn.init(t,e,O)},Z=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,te=/\S/,ee=/\s+/,ie=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ne=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,re=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ae=/^[\],:{}\s]*$/,se=/(?:^|:|,)(?:\s*\[)+/g,oe=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,le=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ue=/^-ms-/,ce=/-([\da-z])/gi,he=function(t,e){return(e+"").toUpperCase()},de=function(){H.addEventListener?(H.removeEventListener("DOMContentLoaded",de,!1),G.ready()):"complete"===H.readyState&&(H.detachEvent("onreadystatechange",de),G.ready())},pe={};G.fn=G.prototype={constructor:G,init:function(t,i,n){var r,a,s;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if("string"==typeof t){if(r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:ne.exec(t),!r||!r[1]&&i)return!i||i.jquery?(i||n).find(t):this.constructor(i).find(t);if(r[1])return i=i instanceof G?i[0]:i,s=i&&i.nodeType?i.ownerDocument||i:H,t=G.parseHTML(r[1],s,!0),re.test(r[1])&&G.isPlainObject(i)&&this.attr.call(t,i,!0),G.merge(this,t);if(a=H.getElementById(r[2]),a&&a.parentNode){if(a.id!==r[2])return n.find(t);this.length=1,this[0]=a}return this.context=H,this.selector=t,this}return G.isFunction(t)?n.ready(t):(t.selector!==e&&(this.selector=t.selector,this.context=t.context),G.makeArray(t,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return U.call(this)},get:function(t){return null==t?this.toArray():0>t?this[this.length+t]:this[t]},pushStack:function(t,e,i){var n=G.merge(this.constructor(),t);return n.prevObject=this,n.context=this.context,"find"===e?n.selector=this.selector+(this.selector?" ":"")+i:e&&(n.selector=this.selector+"."+e+"("+i+")"),n},each:function(t,e){return G.each(this,t,e)},ready:function(t){return G.ready.promise().done(t),this},eq:function(t){return t=+t,-1===t?this.slice(t):this.slice(t,t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(U.apply(this,arguments),"slice",U.call(arguments).join(","))},map:function(t){return this.pushStack(G.map(this,function(e,i){return t.call(e,i,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:q,sort:[].sort,splice:[].splice},G.fn.init.prototype=G.fn,G.extend=G.fn.extend=function(){var t,i,n,r,a,s,o=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l=2),"object"==typeof o||G.isFunction(o)||(o={}),u===l&&(o=this,--l);u>l;l++)if(null!=(t=arguments[l]))for(i in t)n=o[i],r=t[i],o!==r&&(c&&r&&(G.isPlainObject(r)||(a=G.isArray(r)))?(a?(a=!1,s=n&&G.isArray(n)?n:[]):s=n&&G.isPlainObject(n)?n:{},o[i]=G.extend(c,s,r)):r!==e&&(o[i]=r));return o},G.extend({noConflict:function(e){return t.$===G&&(t.$=W),e&&t.jQuery===G&&(t.jQuery=Y),G},isReady:!1,readyWait:1,holdReady:function(t){t?G.readyWait++:G.ready(!0)},ready:function(t){if(t===!0?!--G.readyWait:!G.isReady){if(!H.body)return setTimeout(G.ready,1);G.isReady=!0,t!==!0&&--G.readyWait>0||(R.resolveWith(H,[G]),G.fn.trigger&&G(H).trigger("ready").off("ready"))}},isFunction:function(t){return"function"===G.type(t)},isArray:Array.isArray||function(t){return"array"===G.type(t)},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+"":pe[V.call(t)]||"object"},isPlainObject:function(t){if(!t||"object"!==G.type(t)||t.nodeType||G.isWindow(t))return!1;try{if(t.constructor&&!K.call(t,"constructor")&&!K.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(i){return!1}var n;for(n in t);return n===e||K.call(t,n)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},error:function(t){throw Error(t)},parseHTML:function(t,e,i){var n;return t&&"string"==typeof t?("boolean"==typeof e&&(i=e,e=0),e=e||H,(n=re.exec(t))?[e.createElement(n[1])]:(n=G.buildFragment([t],e,i?null:[]),G.merge([],(n.cacheable?G.clone(n.fragment):n.fragment).childNodes))):null},parseJSON:function(i){return i&&"string"==typeof i?(i=G.trim(i),t.JSON&&t.JSON.parse?t.JSON.parse(i):ae.test(i.replace(oe,"@").replace(le,"]").replace(se,""))?Function("return "+i)():(G.error("Invalid JSON: "+i),e)):null},parseXML:function(i){var n,r;if(!i||"string"!=typeof i)return null;try{t.DOMParser?(r=new DOMParser,n=r.parseFromString(i,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(i))}catch(a){n=e}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||G.error("Invalid XML: "+i),n},noop:function(){},globalEval:function(e){e&&te.test(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(ue,"ms-").replace(ce,he)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,i,n){var r,a=0,s=t.length,o=s===e||G.isFunction(t);if(n)if(o){for(r in t)if(i.apply(t[r],n)===!1)break}else for(;s>a&&i.apply(t[a++],n)!==!1;);else if(o){for(r in t)if(i.call(t[r],r,t[r])===!1)break}else for(;s>a&&i.call(t[a],a,t[a++])!==!1;);return t},trim:Q&&!Q.call("\ufeff\u00a0")?function(t){return null==t?"":Q.call(t)}:function(t){return null==t?"":(t+"").replace(ie,"")},makeArray:function(t,e){var i,n=e||[];return null!=t&&(i=G.type(t),null==t.length||"string"===i||"function"===i||"regexp"===i||G.isWindow(t)?q.call(n,t):G.merge(n,t)),n},inArray:function(t,e,i){var n;if(e){if(X)return X.call(e,t,i);for(n=e.length,i=i?0>i?Math.max(0,n+i):i:0;n>i;i++)if(i in e&&e[i]===t)return i}return-1},merge:function(t,i){var n=i.length,r=t.length,a=0;if("number"==typeof n)for(;n>a;a++)t[r++]=i[a];else for(;i[a]!==e;)t[r++]=i[a++];return t.length=r,t},grep:function(t,e,i){var n,r=[],a=0,s=t.length;for(i=!!i;s>a;a++)n=!!e(t[a],a),i!==n&&r.push(t[a]);return r},map:function(t,i,n){var r,a,s=[],o=0,l=t.length,u=t instanceof G||l!==e&&"number"==typeof l&&(l>0&&t[0]&&t[l-1]||0===l||G.isArray(t));if(u)for(;l>o;o++)r=i(t[o],o,n),null!=r&&(s[s.length]=r);else for(a in t)r=i(t[a],a,n),null!=r&&(s[s.length]=r);return s.concat.apply([],s)},guid:1,proxy:function(t,i){var n,r,a;return"string"==typeof i&&(n=t[i],i=t,t=n),G.isFunction(t)?(r=U.call(arguments,2),a=function(){return t.apply(i,r.concat(U.call(arguments)))},a.guid=t.guid=t.guid||G.guid++,a):e},access:function(t,i,n,r,a,s,o){var l,u=null==n,c=0,h=t.length;if(n&&"object"==typeof n){for(c in n)G.access(t,i,c,n[c],1,s,r);a=1}else if(r!==e){if(l=o===e&&G.isFunction(r),u&&(l?(l=i,i=function(t,e,i){return l.call(G(t),i)}):(i.call(t,r),i=null)),i)for(;h>c;c++)i(t[c],n,l?r.call(t[c],c,i(t[c],n)):r,o);a=1}return a?t:u?i.call(t):h?i(t[0],n):s},now:function(){return(new Date).getTime()}}),G.ready.promise=function(e){if(!R)if(R=G.Deferred(),"complete"===H.readyState)setTimeout(G.ready,1);else if(H.addEventListener)H.addEventListener("DOMContentLoaded",de,!1),t.addEventListener("load",G.ready,!1);else{H.attachEvent("onreadystatechange",de),t.attachEvent("onload",G.ready);var i=!1;try{i=null==t.frameElement&&H.documentElement}catch(n){}i&&i.doScroll&&function r(){if(!G.isReady){try{i.doScroll("left")}catch(t){return setTimeout(r,50)}G.ready()}}()}return R.promise(e)},G.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(t,e){pe["[object "+e+"]"]=e.toLowerCase()}),O=G(H);var fe={};G.Callbacks=function(t){t="string"==typeof t?fe[t]||i(t):G.extend({},t);var n,r,a,s,o,l,u=[],c=!t.once&&[],h=function(e){for(n=t.memory&&e,r=!0,l=s||0,s=0,o=u.length,a=!0;u&&o>l;l++)if(u[l].apply(e[0],e[1])===!1&&t.stopOnFalse){n=!1;break}a=!1,u&&(c?c.length&&h(c.shift()):n?u=[]:d.disable())},d={add:function(){if(u){var e=u.length;(function i(e){G.each(e,function(e,n){var r=G.type(n);"function"===r?t.unique&&d.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),a?o=u.length:n&&(s=e,h(n))}return this},remove:function(){return u&&G.each(arguments,function(t,e){for(var i;(i=G.inArray(e,u,i))>-1;)u.splice(i,1),a&&(o>=i&&o--,l>=i&&l--)}),this},has:function(t){return G.inArray(t,u)>-1},empty:function(){return u=[],this},disable:function(){return u=c=n=e,this},disabled:function(){return!u},lock:function(){return c=e,n||d.disable(),this},locked:function(){return!c},fireWith:function(t,e){return e=e||[],e=[t,e.slice?e.slice():e],!u||r&&!c||(a?c.push(e):h(e)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!r}};return d},G.extend({Deferred:function(t){var e=[["resolve","done",G.Callbacks("once memory"),"resolved"],["reject","fail",G.Callbacks("once memory"),"rejected"],["notify","progress",G.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var t=arguments;return G.Deferred(function(i){G.each(e,function(e,n){var a=n[0],s=t[e];r[n[1]](G.isFunction(s)?function(){var t=s.apply(this,arguments);t&&G.isFunction(t.promise)?t.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[a+"With"](this===r?i:this,[t])}:i[a])}),t=null}).promise()},promise:function(t){return null!=t?G.extend(t,n):n}},r={};return n.pipe=n.then,G.each(e,function(t,a){var s=a[2],o=a[3];n[a[1]]=s.add,o&&s.add(function(){i=o},e[1^t][2].disable,e[2][2].lock),r[a[0]]=s.fire,r[a[0]+"With"]=s.fireWith}),n.promise(r),t&&t.call(r,r),r},when:function(t){var e,i,n,r=0,a=U.call(arguments),s=a.length,o=1!==s||t&&G.isFunction(t.promise)?s:0,l=1===o?t:G.Deferred(),u=function(t,i,n){return function(r){i[t]=this,n[t]=arguments.length>1?U.call(arguments):r,n===e?l.notifyWith(i,n):--o||l.resolveWith(i,n)}};if(s>1)for(e=Array(s),i=Array(s),n=Array(s);s>r;r++)a[r]&&G.isFunction(a[r].promise)?a[r].promise().done(u(r,n,a)).fail(l.reject).progress(u(r,i,e)):--o;return o||l.resolveWith(n,a),l.promise()}}),G.support=function(){var i,n,r,a,s,o,l,u,c,h,d,p=H.createElement("div");if(p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0],!n||!r||!n.length)return{};a=H.createElement("select"),s=a.appendChild(H.createElement("option")),o=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",i={leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:"on"===o.value,optSelected:s.selected,getSetAttribute:"t"!==p.className,enctype:!!H.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==H.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===H.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},o.checked=!0,i.noCloneChecked=o.cloneNode(!0).checked,a.disabled=!0,i.optDisabled=!s.disabled;try{delete p.test}catch(f){i.deleteExpando=!1}if(!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",d=function(){i.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",d)),o=H.createElement("input"),o.value="t",o.setAttribute("type","radio"),i.radioValue="t"===o.value,o.setAttribute("checked","checked"),o.setAttribute("name","t"),p.appendChild(o),l=H.createDocumentFragment(),l.appendChild(p.lastChild),i.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,i.appendChecked=o.checked,l.removeChild(o),l.appendChild(p),p.attachEvent)for(c in{submit:!0,change:!0,focusin:!0})u="on"+c,h=u in p,h||(p.setAttribute(u,"return;"),h="function"==typeof p[u]),i[c+"Bubbles"]=h;return G(function(){var n,r,a,s,o="padding:0;margin:0;border:0;display:block;overflow:hidden;",l=H.getElementsByTagName("body")[0];l&&(n=H.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",l.insertBefore(n,l.firstChild),r=H.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=r.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",h=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",i.reliableHiddenOffsets=h&&0===a[0].offsetHeight,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",i.boxSizing=4===r.offsetWidth,i.doesNotIncludeMarginInBodyOffset=1!==l.offsetTop,t.getComputedStyle&&(i.pixelPosition="1%"!==(t.getComputedStyle(r,null)||{}).top,i.boxSizingReliable="4px"===(t.getComputedStyle(r,null)||{width:"4px"}).width,s=H.createElement("div"),s.style.cssText=r.style.cssText=o,s.style.marginRight=s.style.width="0",r.style.width="1px",r.appendChild(s),i.reliableMarginRight=!parseFloat((t.getComputedStyle(s,null)||{}).marginRight)),r.style.zoom!==e&&(r.innerHTML="",r.style.cssText=o+"width:1px;padding:1px;display:inline;zoom:1",i.inlineBlockNeedsLayout=3===r.offsetWidth,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",i.shrinkWrapBlocks=3!==r.offsetWidth,n.style.zoom=1),l.removeChild(n),n=r=a=s=null)}),l.removeChild(p),n=r=a=s=o=l=p=null,i}();var ge=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,me=/([A-Z])/g;G.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(G.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(t){return t=t.nodeType?G.cache[t[G.expando]]:t[G.expando],!!t&&!r(t)},data:function(t,i,n,r){if(G.acceptData(t)){var a,s,o=G.expando,l="string"==typeof i,u=t.nodeType,c=u?G.cache:t,h=u?t[o]:t[o]&&o;if(h&&c[h]&&(r||c[h].data)||!l||n!==e)return h||(u?t[o]=h=G.deletedIds.pop()||G.guid++:h=o),c[h]||(c[h]={},u||(c[h].toJSON=G.noop)),("object"==typeof i||"function"==typeof i)&&(r?c[h]=G.extend(c[h],i):c[h].data=G.extend(c[h].data,i)),a=c[h],r||(a.data||(a.data={}),a=a.data),n!==e&&(a[G.camelCase(i)]=n),l?(s=a[i],null==s&&(s=a[G.camelCase(i)])):s=a,s}},removeData:function(t,e,i){if(G.acceptData(t)){var n,a,s,o=t.nodeType,l=o?G.cache:t,u=o?t[G.expando]:G.expando;if(l[u]){if(e&&(n=i?l[u]:l[u].data)){G.isArray(e)||(e in n?e=[e]:(e=G.camelCase(e),e=e in n?[e]:e.split(" ")));for(a=0,s=e.length;s>a;a++)delete n[e[a]];if(!(i?r:G.isEmptyObject)(n))return}(i||(delete l[u].data,r(l[u])))&&(o?G.cleanData([t],!0):G.support.deleteExpando||l!=l.window?delete l[u]:l[u]=null)}}},_data:function(t,e,i){return G.data(t,e,i,!0)},acceptData:function(t){var e=t.nodeName&&G.noData[t.nodeName.toLowerCase()];return!e||e!==!0&&t.getAttribute("classid")===e}}),G.fn.extend({data:function(t,i){var r,a,s,o,l,u=this[0],c=0,h=null;if(t===e){if(this.length&&(h=G.data(u),1===u.nodeType&&!G._data(u,"parsedAttrs"))){for(s=u.attributes,l=s.length;l>c;c++)o=s[c].name,o.indexOf("data-")||(o=G.camelCase(o.substring(5)),n(u,o,h[o]));G._data(u,"parsedAttrs",!0)}return h}return"object"==typeof t?this.each(function(){G.data(this,t)}):(r=t.split(".",2),r[1]=r[1]?"."+r[1]:"",a=r[1]+"!",G.access(this,function(i){return i===e?(h=this.triggerHandler("getData"+a,[r[0]]),h===e&&u&&(h=G.data(u,t),h=n(u,t,h)),h===e&&r[1]?this.data(r[0]):h):(r[1]=i,this.each(function(){var e=G(this);e.triggerHandler("setData"+a,r),G.data(this,t,i),e.triggerHandler("changeData"+a,r)}),e)},null,i,arguments.length>1,null,!1))},removeData:function(t){return this.each(function(){G.removeData(this,t)})}}),G.extend({queue:function(t,i,n){var r;return t?(i=(i||"fx")+"queue",r=G._data(t,i),n&&(!r||G.isArray(n)?r=G._data(t,i,G.makeArray(n)):r.push(n)),r||[]):e},dequeue:function(t,e){e=e||"fx";var i=G.queue(t,e),n=i.length,r=i.shift(),a=G._queueHooks(t,e),s=function(){G.dequeue(t,e)};"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete a.stop,r.call(t,s,a)),!n&&a&&a.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return G._data(t,i)||G._data(t,i,{empty:G.Callbacks("once memory").add(function(){G.removeData(t,e+"queue",!0),G.removeData(t,i,!0)})})}}),G.fn.extend({queue:function(t,i){var n=2;return"string"!=typeof t&&(i=t,t="fx",n--),n>arguments.length?G.queue(this[0],t):i===e?this:this.each(function(){var e=G.queue(this,t,i);G._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&G.dequeue(this,t)})},dequeue:function(t){return this.each(function(){G.dequeue(this,t)})},delay:function(t,e){return t=G.fx?G.fx.speeds[t]||t:t,e=e||"fx",this.queue(e,function(e,i){var n=setTimeout(e,t);i.stop=function(){clearTimeout(n)}})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,i){var n,r=1,a=G.Deferred(),s=this,o=this.length,l=function(){--r||a.resolveWith(s,[s])};for("string"!=typeof t&&(i=t,t=e),t=t||"fx";o--;)n=G._data(s[o],t+"queueHooks"),n&&n.empty&&(r++,n.empty.add(l));return l(),a.promise(i)}});var ve,ye,be,xe=/[\t\r\n]/g,we=/\r/g,_e=/^(?:button|input)$/i,ke=/^(?:button|input|object|select|textarea)$/i,Se=/^a(?:rea|)$/i,Ae=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,De=G.support.getSetAttribute;G.fn.extend({attr:function(t,e){return G.access(this,G.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){G.removeAttr(this,t)})},prop:function(t,e){return G.access(this,G.prop,t,e,arguments.length>1)},removeProp:function(t){return t=G.propFix[t]||t,this.each(function(){try{this[t]=e,delete this[t]}catch(i){}})},addClass:function(t){var e,i,n,r,a,s,o;if(G.isFunction(t))return this.each(function(e){G(this).addClass(t.call(this,e,this.className))});if(t&&"string"==typeof t)for(e=t.split(ee),i=0,n=this.length;n>i;i++)if(r=this[i],1===r.nodeType)if(r.className||1!==e.length){for(a=" "+r.className+" ",s=0,o=e.length;o>s;s++)0>a.indexOf(" "+e[s]+" ")&&(a+=e[s]+" ");r.className=G.trim(a)}else r.className=t;return this},removeClass:function(t){var i,n,r,a,s,o,l;if(G.isFunction(t))return this.each(function(e){G(this).removeClass(t.call(this,e,this.className))});if(t&&"string"==typeof t||t===e)for(i=(t||"").split(ee),o=0,l=this.length;l>o;o++)if(r=this[o],1===r.nodeType&&r.className){for(n=(" "+r.className+" ").replace(xe," "),a=0,s=i.length;s>a;a++)for(;n.indexOf(" "+i[a]+" ")>=0;)n=n.replace(" "+i[a]+" "," ");r.className=t?G.trim(n):""}return this},toggleClass:function(t,e){var i=typeof t,n="boolean"==typeof e;return G.isFunction(t)?this.each(function(i){G(this).toggleClass(t.call(this,i,this.className,e),e)}):this.each(function(){if("string"===i)for(var r,a=0,s=G(this),o=e,l=t.split(ee);r=l[a++];)o=n?o:!s.hasClass(r),s[o?"addClass":"removeClass"](r);else("undefined"===i||"boolean"===i)&&(this.className&&G._data(this,"__className__",this.className),this.className=this.className||t===!1?"":G._data(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",i=0,n=this.length;n>i;i++)if(1===this[i].nodeType&&(" "+this[i].className+" ").replace(xe," ").indexOf(e)>=0)return!0;return!1},val:function(t){var i,n,r,a=this[0];{if(arguments.length)return r=G.isFunction(t),this.each(function(n){var a,s=G(this);1===this.nodeType&&(a=r?t.call(this,n,s.val()):t,null==a?a="":"number"==typeof a?a+="":G.isArray(a)&&(a=G.map(a,function(t){return null==t?"":t+""})),i=G.valHooks[this.type]||G.valHooks[this.nodeName.toLowerCase()],i&&"set"in i&&i.set(this,a,"value")!==e||(this.value=a))});if(a)return i=G.valHooks[a.type]||G.valHooks[a.nodeName.toLowerCase()],i&&"get"in i&&(n=i.get(a,"value"))!==e?n:(n=a.value,"string"==typeof n?n.replace(we,""):null==n?"":n)}}}),G.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,i,n=t.options,r=t.selectedIndex,a="select-one"===t.type||0>r,s=a?null:[],o=a?r+1:n.length,l=0>r?o:a?r:0;o>l;l++)if(i=n[l],!(!i.selected&&l!==r||(G.support.optDisabled?i.disabled:null!==i.getAttribute("disabled"))||i.parentNode.disabled&&G.nodeName(i.parentNode,"optgroup"))){if(e=G(i).val(),a)return e;s.push(e)}return s},set:function(t,e){var i=G.makeArray(e);return G(t).find("option").each(function(){this.selected=G.inArray(G(this).val(),i)>=0}),i.length||(t.selectedIndex=-1),i}}},attrFn:{},attr:function(t,i,n,r){var a,s,o,l=t.nodeType;if(t&&3!==l&&8!==l&&2!==l)return r&&G.isFunction(G.fn[i])?G(t)[i](n):t.getAttribute===e?G.prop(t,i,n):(o=1!==l||!G.isXMLDoc(t),o&&(i=i.toLowerCase(),s=G.attrHooks[i]||(Ae.test(i)?ye:ve)),n!==e?null===n?(G.removeAttr(t,i),e):s&&"set"in s&&o&&(a=s.set(t,n,i))!==e?a:(t.setAttribute(i,n+""),n):s&&"get"in s&&o&&null!==(a=s.get(t,i))?a:(a=t.getAttribute(i),null===a?e:a))},removeAttr:function(t,e){var i,n,r,a,s=0;if(e&&1===t.nodeType)for(n=e.split(ee);n.length>s;s++)r=n[s],r&&(i=G.propFix[r]||r,a=Ae.test(r),a||G.attr(t,r,""),t.removeAttribute(De?r:i),a&&i in t&&(t[i]=!1))},attrHooks:{type:{set:function(t,e){if(_e.test(t.nodeName)&&t.parentNode)G.error("type property can't be changed");else if(!G.support.radioValue&&"radio"===e&&G.nodeName(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}},value:{get:function(t,e){return ve&&G.nodeName(t,"button")?ve.get(t,e):e in t?t.value:null},set:function(t,i,n){return ve&&G.nodeName(t,"button")?ve.set(t,i,n):(t.value=i,e)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(t,i,n){var r,a,s,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o)return s=1!==o||!G.isXMLDoc(t),s&&(i=G.propFix[i]||i,a=G.propHooks[i]),n!==e?a&&"set"in a&&(r=a.set(t,n,i))!==e?r:t[i]=n:a&&"get"in a&&null!==(r=a.get(t,i))?r:t[i]},propHooks:{tabIndex:{get:function(t){var i=t.getAttributeNode("tabindex");return i&&i.specified?parseInt(i.value,10):ke.test(t.nodeName)||Se.test(t.nodeName)&&t.href?0:e}}}}),ye={get:function(t,i){var n,r=G.prop(t,i);return r===!0||"boolean"!=typeof r&&(n=t.getAttributeNode(i))&&n.nodeValue!==!1?i.toLowerCase():e},set:function(t,e,i){var n;return e===!1?G.removeAttr(t,i):(n=G.propFix[i]||i,n in t&&(t[n]=!0),t.setAttribute(i,i.toLowerCase())),i}},De||(be={name:!0,id:!0,coords:!0},ve=G.valHooks.button={get:function(t,i){var n;return n=t.getAttributeNode(i),n&&(be[i]?""!==n.value:n.specified)?n.value:e},set:function(t,e,i){var n=t.getAttributeNode(i);return n||(n=H.createAttribute(i),t.setAttributeNode(n)),n.value=e+""}},G.each(["width","height"],function(t,i){G.attrHooks[i]=G.extend(G.attrHooks[i],{set:function(t,n){return""===n?(t.setAttribute(i,"auto"),n):e}})}),G.attrHooks.contenteditable={get:ve.get,set:function(t,e,i){""===e&&(e="false"),ve.set(t,e,i) }}),G.support.hrefNormalized||G.each(["href","src","width","height"],function(t,i){G.attrHooks[i]=G.extend(G.attrHooks[i],{get:function(t){var n=t.getAttribute(i,2);return null===n?e:n}})}),G.support.style||(G.attrHooks.style={get:function(t){return t.style.cssText.toLowerCase()||e},set:function(t,e){return t.style.cssText=e+""}}),G.support.optSelected||(G.propHooks.selected=G.extend(G.propHooks.selected,{get:function(t){var e=t.parentNode;return e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex),null}})),G.support.enctype||(G.propFix.enctype="encoding"),G.support.checkOn||G.each(["radio","checkbox"],function(){G.valHooks[this]={get:function(t){return null===t.getAttribute("value")?"on":t.value}}}),G.each(["radio","checkbox"],function(){G.valHooks[this]=G.extend(G.valHooks[this],{set:function(t,i){return G.isArray(i)?t.checked=G.inArray(G(t).val(),i)>=0:e}})});var Ce=/^(?:textarea|input|select)$/i,Te=/^([^\.]*|)(?:\.(.+)|)$/,Me=/(?:^|\s)hover(\.\S+|)\b/,Ne=/^key/,Pe=/^(?:mouse|contextmenu)|click/,Je=/^(?:focusinfocus|focusoutblur)$/,$e=function(t){return G.event.special.hover?t:t.replace(Me,"mouseenter$1 mouseleave$1")};G.event={add:function(t,i,n,r,a){var s,o,l,u,c,h,d,p,f,g,m;if(3!==t.nodeType&&8!==t.nodeType&&i&&n&&(s=G._data(t))){for(n.handler&&(f=n,n=f.handler,a=f.selector),n.guid||(n.guid=G.guid++),l=s.events,l||(s.events=l={}),o=s.handle,o||(s.handle=o=function(t){return G===e||t&&G.event.triggered===t.type?e:G.event.dispatch.apply(o.elem,arguments)},o.elem=t),i=G.trim($e(i)).split(" "),u=0;i.length>u;u++)c=Te.exec(i[u])||[],h=c[1],d=(c[2]||"").split(".").sort(),m=G.event.special[h]||{},h=(a?m.delegateType:m.bindType)||h,m=G.event.special[h]||{},p=G.extend({type:h,origType:c[1],data:r,handler:n,guid:n.guid,selector:a,needsContext:a&&G.expr.match.needsContext.test(a),namespace:d.join(".")},f),g=l[h],g||(g=l[h]=[],g.delegateCount=0,m.setup&&m.setup.call(t,r,d,o)!==!1||(t.addEventListener?t.addEventListener(h,o,!1):t.attachEvent&&t.attachEvent("on"+h,o))),m.add&&(m.add.call(t,p),p.handler.guid||(p.handler.guid=n.guid)),a?g.splice(g.delegateCount++,0,p):g.push(p),G.event.global[h]=!0;t=null}},global:{},remove:function(t,e,i,n,r){var a,s,o,l,u,c,h,d,p,f,g,m=G.hasData(t)&&G._data(t);if(m&&(d=m.events)){for(e=G.trim($e(e||"")).split(" "),a=0;e.length>a;a++)if(s=Te.exec(e[a])||[],o=l=s[1],u=s[2],o){for(p=G.event.special[o]||{},o=(n?p.delegateType:p.bindType)||o,f=d[o]||[],c=f.length,u=u?RegExp("(^|\\.)"+u.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=0;f.length>h;h++)g=f[h],!r&&l!==g.origType||i&&i.guid!==g.guid||u&&!u.test(g.namespace)||n&&n!==g.selector&&("**"!==n||!g.selector)||(f.splice(h--,1),g.selector&&f.delegateCount--,p.remove&&p.remove.call(t,g));0===f.length&&c!==f.length&&(p.teardown&&p.teardown.call(t,u,m.handle)!==!1||G.removeEvent(t,o,m.handle),delete d[o])}else for(o in d)G.event.remove(t,o+e[a],i,n,!0);G.isEmptyObject(d)&&(delete m.handle,G.removeData(t,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(i,n,r,a){if(!r||3!==r.nodeType&&8!==r.nodeType){var s,o,l,u,c,h,d,p,f,g,m=i.type||i,v=[];if(!Je.test(m+G.event.triggered)&&(m.indexOf("!")>=0&&(m=m.slice(0,-1),o=!0),m.indexOf(".")>=0&&(v=m.split("."),m=v.shift(),v.sort()),r&&!G.event.customEvent[m]||G.event.global[m]))if(i="object"==typeof i?i[G.expando]?i:new G.Event(m,i):new G.Event(m),i.type=m,i.isTrigger=!0,i.exclusive=o,i.namespace=v.join("."),i.namespace_re=i.namespace?RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=0>m.indexOf(":")?"on"+m:"",r){if(i.result=e,i.target||(i.target=r),n=null!=n?G.makeArray(n):[],n.unshift(i),d=G.event.special[m]||{},!d.trigger||d.trigger.apply(r,n)!==!1){if(f=[[r,d.bindType||m]],!a&&!d.noBubble&&!G.isWindow(r)){for(g=d.delegateType||m,u=Je.test(g+m)?r:r.parentNode,c=r;u;u=u.parentNode)f.push([u,g]),c=u;c===(r.ownerDocument||H)&&f.push([c.defaultView||c.parentWindow||t,g])}for(l=0;f.length>l&&!i.isPropagationStopped();l++)u=f[l][0],i.type=f[l][1],p=(G._data(u,"events")||{})[i.type]&&G._data(u,"handle"),p&&p.apply(u,n),p=h&&u[h],p&&G.acceptData(u)&&p.apply&&p.apply(u,n)===!1&&i.preventDefault();return i.type=m,a||i.isDefaultPrevented()||d._default&&d._default.apply(r.ownerDocument,n)!==!1||"click"===m&&G.nodeName(r,"a")||!G.acceptData(r)||h&&r[m]&&("focus"!==m&&"blur"!==m||0!==i.target.offsetWidth)&&!G.isWindow(r)&&(c=r[h],c&&(r[h]=null),G.event.triggered=m,r[m](),G.event.triggered=e,c&&(r[h]=c)),i.result}}else{s=G.cache;for(l in s)s[l].events&&s[l].events[m]&&G.event.trigger(i,n,s[l].handle.elem,!0)}}},dispatch:function(i){i=G.event.fix(i||t.event);var n,r,a,s,o,l,u,c,h,d=(G._data(this,"events")||{})[i.type]||[],p=d.delegateCount,f=U.call(arguments),g=!i.exclusive&&!i.namespace,m=G.event.special[i.type]||{},v=[];if(f[0]=i,i.delegateTarget=this,!m.preDispatch||m.preDispatch.call(this,i)!==!1){if(p&&(!i.button||"click"!==i.type))for(a=i.target;a!=this;a=a.parentNode||this)if(a.disabled!==!0||"click"!==i.type){for(o={},u=[],n=0;p>n;n++)c=d[n],h=c.selector,o[h]===e&&(o[h]=c.needsContext?G(h,this).index(a)>=0:G.find(h,this,null,[a]).length),o[h]&&u.push(c);u.length&&v.push({elem:a,matches:u})}for(d.length>p&&v.push({elem:this,matches:d.slice(p)}),n=0;v.length>n&&!i.isPropagationStopped();n++)for(l=v[n],i.currentTarget=l.elem,r=0;l.matches.length>r&&!i.isImmediatePropagationStopped();r++)c=l.matches[r],(g||!i.namespace&&!c.namespace||i.namespace_re&&i.namespace_re.test(c.namespace))&&(i.data=c.data,i.handleObj=c,s=((G.event.special[c.origType]||{}).handle||c.handler).apply(l.elem,f),s!==e&&(i.result=s,s===!1&&(i.preventDefault(),i.stopPropagation())));return m.postDispatch&&m.postDispatch.call(this,i),i.result}},props:"attrChange attrName relatedNode srcElement 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 fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,i){var n,r,a,s=i.button,o=i.fromElement;return null==t.pageX&&null!=i.clientX&&(n=t.target.ownerDocument||H,r=n.documentElement,a=n.body,t.pageX=i.clientX+(r&&r.scrollLeft||a&&a.scrollLeft||0)-(r&&r.clientLeft||a&&a.clientLeft||0),t.pageY=i.clientY+(r&&r.scrollTop||a&&a.scrollTop||0)-(r&&r.clientTop||a&&a.clientTop||0)),!t.relatedTarget&&o&&(t.relatedTarget=o===t.target?i.toElement:o),t.which||s===e||(t.which=1&s?1:2&s?3:4&s?2:0),t}},fix:function(t){if(t[G.expando])return t;var e,i,n=t,r=G.event.fixHooks[t.type]||{},a=r.props?this.props.concat(r.props):this.props;for(t=G.Event(n),e=a.length;e;)i=a[--e],t[i]=n[i];return t.target||(t.target=n.srcElement||H),3===t.target.nodeType&&(t.target=t.target.parentNode),t.metaKey=!!t.metaKey,r.filter?r.filter(t,n):t},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(t,e,i){G.isWindow(this)&&(this.onbeforeunload=i)},teardown:function(t,e){this.onbeforeunload===e&&(this.onbeforeunload=null)}}},simulate:function(t,e,i,n){var r=G.extend(new G.Event,i,{type:t,isSimulated:!0,originalEvent:{}});n?G.event.trigger(r,null,e):G.event.dispatch.call(e,r),r.isDefaultPrevented()&&i.preventDefault()}},G.event.handle=G.event.dispatch,G.removeEvent=H.removeEventListener?function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i,!1)}:function(t,i,n){var r="on"+i;t.detachEvent&&(t[r]===e&&(t[r]=null),t.detachEvent(r,n))},G.Event=function(t,i){return this instanceof G.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||t.returnValue===!1||t.getPreventDefault&&t.getPreventDefault()?s:a):this.type=t,i&&G.extend(this,i),this.timeStamp=t&&t.timeStamp||G.now(),this[G.expando]=!0,e):new G.Event(t,i)},G.Event.prototype={preventDefault:function(){this.isDefaultPrevented=s;var t=this.originalEvent;t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=s;var t=this.originalEvent;t&&(t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=s,this.stopPropagation()},isDefaultPrevented:a,isPropagationStopped:a,isImmediatePropagationStopped:a},G.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(t,e){G.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=this,r=t.relatedTarget,a=t.handleObj;return a.selector,(!r||r!==n&&!G.contains(n,r))&&(t.type=a.origType,i=a.handler.apply(this,arguments),t.type=e),i}}}),G.support.submitBubbles||(G.event.special.submit={setup:function(){return G.nodeName(this,"form")?!1:(G.event.add(this,"click._submit keypress._submit",function(t){var i=t.target,n=G.nodeName(i,"input")||G.nodeName(i,"button")?i.form:e;n&&!G._data(n,"_submit_attached")&&(G.event.add(n,"submit._submit",function(t){t._submit_bubble=!0}),G._data(n,"_submit_attached",!0))}),e)},postDispatch:function(t){t._submit_bubble&&(delete t._submit_bubble,this.parentNode&&!t.isTrigger&&G.event.simulate("submit",this.parentNode,t,!0))},teardown:function(){return G.nodeName(this,"form")?!1:(G.event.remove(this,"._submit"),e)}}),G.support.changeBubbles||(G.event.special.change={setup:function(){return Ce.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(G.event.add(this,"propertychange._change",function(t){"checked"===t.originalEvent.propertyName&&(this._just_changed=!0)}),G.event.add(this,"click._change",function(t){this._just_changed&&!t.isTrigger&&(this._just_changed=!1),G.event.simulate("change",this,t,!0)})),!1):(G.event.add(this,"beforeactivate._change",function(t){var e=t.target;Ce.test(e.nodeName)&&!G._data(e,"_change_attached")&&(G.event.add(e,"change._change",function(t){!this.parentNode||t.isSimulated||t.isTrigger||G.event.simulate("change",this.parentNode,t,!0)}),G._data(e,"_change_attached",!0))}),e)},handle:function(t){var i=t.target;return this!==i||t.isSimulated||t.isTrigger||"radio"!==i.type&&"checkbox"!==i.type?t.handleObj.handler.apply(this,arguments):e},teardown:function(){return G.event.remove(this,"._change"),!Ce.test(this.nodeName)}}),G.support.focusinBubbles||G.each({focus:"focusin",blur:"focusout"},function(t,e){var i=0,n=function(t){G.event.simulate(e,t.target,G.event.fix(t),!0)};G.event.special[e]={setup:function(){0===i++&&H.addEventListener(t,n,!0)},teardown:function(){0===--i&&H.removeEventListener(t,n,!0)}}}),G.fn.extend({on:function(t,i,n,r,s){var o,l;if("object"==typeof t){"string"!=typeof i&&(n=n||i,i=e);for(l in t)this.on(l,i,n,t[l],s);return this}if(null==n&&null==r?(r=i,n=i=e):null==r&&("string"==typeof i?(r=n,n=e):(r=n,n=i,i=e)),r===!1)r=a;else if(!r)return this;return 1===s&&(o=r,r=function(t){return G().off(t),o.apply(this,arguments)},r.guid=o.guid||(o.guid=G.guid++)),this.each(function(){G.event.add(this,t,r,n,i)})},one:function(t,e,i,n){return this.on(t,e,i,n,1)},off:function(t,i,n){var r,s;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,G(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(s in t)this.off(s,i,t[s]);return this}return(i===!1||"function"==typeof i)&&(n=i,i=e),n===!1&&(n=a),this.each(function(){G.event.remove(this,t,n,i)})},bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},live:function(t,e,i){return G(this.context).on(t,this.selector,e,i),this},die:function(t,e){return G(this.context).off(t,this.selector||"**",e),this},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},trigger:function(t,e){return this.each(function(){G.event.trigger(t,e,this)})},triggerHandler:function(t,i){return this[0]?G.event.trigger(t,i,this[0],!0):e},toggle:function(t){var e=arguments,i=t.guid||G.guid++,n=0,r=function(i){var r=(G._data(this,"lastToggle"+t.guid)||0)%n;return G._data(this,"lastToggle"+t.guid,r+1),i.preventDefault(),e[r].apply(this,arguments)||!1};for(r.guid=i;e.length>n;)e[n++].guid=i;return this.click(r)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),G.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){G.fn[e]=function(t,i){return null==i&&(i=t,t=null),arguments.length>0?this.on(e,null,t,i):this.trigger(e)},Ne.test(e)&&(G.event.fixHooks[e]=G.event.keyHooks),Pe.test(e)&&(G.event.fixHooks[e]=G.event.mouseHooks)}),function(t,e){function i(t,e,i,n){i=i||[],e=e||P;var r,a,s,o,l=e.nodeType;if(!t||"string"!=typeof t)return i;if(1!==l&&9!==l)return[];if(s=w(e),!s&&!n&&(r=ie.exec(t)))if(o=r[1]){if(9===l){if(a=e.getElementById(o),!a||!a.parentNode)return i;if(a.id===o)return i.push(a),i}else if(e.ownerDocument&&(a=e.ownerDocument.getElementById(o))&&_(e,a)&&a.id===o)return i.push(a),i}else{if(r[2])return L.apply(i,j.call(e.getElementsByTagName(t),0)),i;if((o=r[3])&&de&&e.getElementsByClassName)return L.apply(i,j.call(e.getElementsByClassName(o),0)),i}return g(t.replace(Q,"$1"),e,i,n,s)}function n(t){return function(e){var i=e.nodeName.toLowerCase();return"input"===i&&e.type===t}}function r(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}function a(t){return O(function(e){return e=+e,O(function(i,n){for(var r,a=t([],i.length,e),s=a.length;s--;)i[r=a[s]]&&(i[r]=!(n[r]=i[r]))})})}function s(t,e,i){if(t===e)return i;for(var n=t.nextSibling;n;){if(n===e)return-1;n=n.nextSibling}return 1}function o(t,e){var n,r,a,s,o,l,u,c=B[M][t+" "];if(c)return e?0:c.slice(0);for(o=t,l=[],u=b.preFilter;o;){(!n||(r=Z.exec(o)))&&(r&&(o=o.slice(r[0].length)||o),l.push(a=[])),n=!1,(r=te.exec(o))&&(a.push(n=new N(r.shift())),o=o.slice(n.length),n.type=r[0].replace(Q," "));for(s in b.filter)!(r=oe[s].exec(o))||u[s]&&!(r=u[s](r))||(a.push(n=new N(r.shift())),o=o.slice(n.length),n.type=s,n.matches=r);if(!n)break}return e?o.length:o?i.error(t):B(t,l).slice(0)}function l(t,e,i){var n=e.dir,r=i&&"parentNode"===e.dir,a=E++;return e.first?function(e,i,a){for(;e=e[n];)if(r||1===e.nodeType)return t(e,i,a)}:function(e,i,s){if(s){for(;e=e[n];)if((r||1===e.nodeType)&&t(e,i,s))return e}else for(var o,l=$+" "+a+" ",u=l+v;e=e[n];)if(r||1===e.nodeType){if((o=e[M])===u)return e.sizset;if("string"==typeof o&&0===o.indexOf(l)){if(e.sizset)return e}else{if(e[M]=u,t(e,i,s))return e.sizset=!0,e;e.sizset=!1}}}}function u(t){return t.length>1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function c(t,e,i,n,r){for(var a,s=[],o=0,l=t.length,u=null!=e;l>o;o++)(a=t[o])&&(!i||i(a,n,r))&&(s.push(a),u&&e.push(o));return s}function h(t,e,i,n,r,a){return n&&!n[M]&&(n=h(n)),r&&!r[M]&&(r=h(r,a)),O(function(a,s,o,l){var u,h,d,p=[],g=[],m=s.length,v=a||f(e||"*",o.nodeType?[o]:o,[]),y=!t||!a&&e?v:c(v,p,t,o,l),b=i?r||(a?t:m||n)?[]:s:y;if(i&&i(y,b,o,l),n)for(u=c(b,g),n(u,[],o,l),h=u.length;h--;)(d=u[h])&&(b[g[h]]=!(y[g[h]]=d));if(a){if(r||t){if(r){for(u=[],h=b.length;h--;)(d=b[h])&&u.push(y[h]=d);r(null,b=[],u,l)}for(h=b.length;h--;)(d=b[h])&&(u=r?F.call(a,d):p[h])>-1&&(a[u]=!(s[u]=d))}}else b=c(b===s?b.splice(m,b.length):b),r?r(null,s,b,l):L.apply(s,b)})}function d(t){for(var e,i,n,r=t.length,a=b.relative[t[0].type],s=a||b.relative[" "],o=a?1:0,c=l(function(t){return t===e},s,!0),p=l(function(t){return F.call(e,t)>-1},s,!0),f=[function(t,i,n){return!a&&(n||i!==D)||((e=i).nodeType?c(t,i,n):p(t,i,n))}];r>o;o++)if(i=b.relative[t[o].type])f=[l(u(f),i)];else{if(i=b.filter[t[o].type].apply(null,t[o].matches),i[M]){for(n=++o;r>n&&!b.relative[t[n].type];n++);return h(o>1&&u(f),o>1&&t.slice(0,o-1).join("").replace(Q,"$1"),i,n>o&&d(t.slice(o,n)),r>n&&d(t=t.slice(n)),r>n&&t.join(""))}f.push(i)}return u(f)}function p(t,e){var n=e.length>0,r=t.length>0,a=function(s,o,l,u,h){var d,p,f,g=[],m=0,y="0",x=s&&[],w=null!=h,_=D,k=s||r&&b.find.TAG("*",h&&o.parentNode||o),S=$+=null==_?1:Math.E;for(w&&(D=o!==P&&o,v=a.el);null!=(d=k[y]);y++){if(r&&d){for(p=0;f=t[p];p++)if(f(d,o,l)){u.push(d);break}w&&($=S,v=++a.el)}n&&((d=!f&&d)&&m--,s&&x.push(d))}if(m+=y,n&&y!==m){for(p=0;f=e[p];p++)f(x,g,o,l);if(s){if(m>0)for(;y--;)x[y]||g[y]||(g[y]=I.call(u));g=c(g)}L.apply(u,g),w&&!s&&g.length>0&&m+e.length>1&&i.uniqueSort(u)}return w&&($=S,D=_),x};return a.el=0,n?O(a):a}function f(t,e,n){for(var r=0,a=e.length;a>r;r++)i(t,e[r],n);return n}function g(t,e,i,n,r){var a,s,l,u,c,h=o(t);if(h.length,!n&&1===h.length){if(s=h[0]=h[0].slice(0),s.length>2&&"ID"===(l=s[0]).type&&9===e.nodeType&&!r&&b.relative[s[1].type]){if(e=b.find.ID(l.matches[0].replace(se,""),e,r)[0],!e)return i;t=t.slice(s.shift().length)}for(a=oe.POS.test(t)?-1:s.length-1;a>=0&&(l=s[a],!b.relative[u=l.type]);a--)if((c=b.find[u])&&(n=c(l.matches[0].replace(se,""),ne.test(s[0].type)&&e.parentNode||e,r))){if(s.splice(a,1),t=n.length&&s.join(""),!t)return L.apply(i,j.call(n,0)),i;break}}return k(t,h)(n,e,r,i,ne.test(t)),i}function m(){}var v,y,b,x,w,_,k,S,A,D,C=!0,T="undefined",M=("sizcache"+Math.random()).replace(".",""),N=String,P=t.document,J=P.documentElement,$=0,E=0,I=[].pop,L=[].push,j=[].slice,F=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(this[e]===t)return e;return-1},O=function(t,e){return t[M]=null==e||e,t},R=function(){var t={},e=[];return O(function(i,n){return e.push(i)>b.cacheLength&&delete t[e.shift()],t[i+" "]=n},t)},H=R(),B=R(),z=R(),Y="[\\x20\\t\\r\\n\\f]",W="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",q=W.replace("w","w#"),U="([*^$|!~]?=)",X="\\["+Y+"*("+W+")"+Y+"*(?:"+U+Y+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+q+")|)|)"+Y+"*\\]",V=":("+W+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+X+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Y+"*((?:-\\d)?\\d*)"+Y+"*\\)|)(?=[^-]|$)",Q=RegExp("^"+Y+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Y+"+$","g"),Z=RegExp("^"+Y+"*,"+Y+"*"),te=RegExp("^"+Y+"*([\\x20\\t\\r\\n\\f>+~])"+Y+"*"),ee=RegExp(V),ie=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,ne=/[\x20\t\r\n\f]*[+~]/,re=/h\d/i,ae=/input|select|textarea|button/i,se=/\\(?!\\)/g,oe={ID:RegExp("^#("+W+")"),CLASS:RegExp("^\\.("+W+")"),NAME:RegExp("^\\[name=['\"]?("+W+")['\"]?\\]"),TAG:RegExp("^("+W.replace("w","w*")+")"),ATTR:RegExp("^"+X),PSEUDO:RegExp("^"+V),POS:RegExp(K,"i"),CHILD:RegExp("^:(only|nth|first|last)-child(?:\\("+Y+"*(even|odd|(([+-]|)(\\d*)n|)"+Y+"*(?:([+-]|)"+Y+"*(\\d+)|))"+Y+"*\\)|)","i"),needsContext:RegExp("^"+Y+"*[>+~]|"+K,"i")},le=function(t){var e=P.createElement("div");try{return t(e)}catch(i){return!1}finally{e=null}},ue=le(function(t){return t.appendChild(P.createComment("")),!t.getElementsByTagName("*").length}),ce=le(function(t){return t.innerHTML="<a href='#'></a>",t.firstChild&&typeof t.firstChild.getAttribute!==T&&"#"===t.firstChild.getAttribute("href")}),he=le(function(t){t.innerHTML="<select></select>";var e=typeof t.lastChild.getAttribute("multiple");return"boolean"!==e&&"string"!==e}),de=le(function(t){return t.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",t.getElementsByClassName&&t.getElementsByClassName("e").length?(t.lastChild.className="e",2===t.getElementsByClassName("e").length):!1}),pe=le(function(t){t.id=M+0,t.innerHTML="<a name='"+M+"'></a><div name='"+M+"'></div>",J.insertBefore(t,J.firstChild);var e=P.getElementsByName&&P.getElementsByName(M).length===2+P.getElementsByName(M+0).length;return y=!P.getElementById(M),J.removeChild(t),e});try{j.call(J.childNodes,0)[0].nodeType}catch(fe){j=function(t){for(var e,i=[];e=this[t];t++)i.push(e);return i}}i.matches=function(t,e){return i(t,null,null,e)},i.matchesSelector=function(t,e){return i(e,null,null,[t]).length>0},x=i.getText=function(t){var e,i="",n=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=x(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[n];n++)i+=x(e);return i},w=i.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1},_=i.contains=J.contains?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!!(n&&1===n.nodeType&&i.contains&&i.contains(n))}:J.compareDocumentPosition?function(t,e){return e&&!!(16&t.compareDocumentPosition(e))}:function(t,e){for(;e=e.parentNode;)if(e===t)return!0;return!1},i.attr=function(t,e){var i,n=w(t);return n||(e=e.toLowerCase()),(i=b.attrHandle[e])?i(t):n||he?t.getAttribute(e):(i=t.getAttributeNode(e),i?"boolean"==typeof t[e]?t[e]?e:null:i.specified?i.value:null:null)},b=i.selectors={cacheLength:50,createPseudo:O,match:oe,attrHandle:ce?{}:{href:function(t){return t.getAttribute("href",2)},type:function(t){return t.getAttribute("type")}},find:{ID:y?function(t,e,i){if(typeof e.getElementById!==T&&!i){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}}:function(t,i,n){if(typeof i.getElementById!==T&&!n){var r=i.getElementById(t);return r?r.id===t||typeof r.getAttributeNode!==T&&r.getAttributeNode("id").value===t?[r]:e:[]}},TAG:ue?function(t,i){return typeof i.getElementsByTagName!==T?i.getElementsByTagName(t):e}:function(t,e){var i=e.getElementsByTagName(t);if("*"===t){for(var n,r=[],a=0;n=i[a];a++)1===n.nodeType&&r.push(n);return r}return i},NAME:pe&&function(t,i){return typeof i.getElementsByName!==T?i.getElementsByName(name):e},CLASS:de&&function(t,i,n){return typeof i.getElementsByClassName===T||n?e:i.getElementsByClassName(t)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(se,""),t[3]=(t[4]||t[5]||"").replace(se,""),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1]?(t[2]||i.error(t[0]),t[3]=+(t[3]?t[4]+(t[5]||1):2*("even"===t[2]||"odd"===t[2])),t[4]=+(t[6]+t[7]||"odd"===t[2])):t[2]&&i.error(t[0]),t},PSEUDO:function(t){var e,i;return oe.CHILD.test(t[0])?null:(t[3]?t[2]=t[3]:(e=t[4])&&(ee.test(e)&&(i=o(e,!0))&&(i=e.indexOf(")",e.length-i)-e.length)&&(e=e.slice(0,i),t[0]=t[0].slice(0,i)),t[2]=e),t.slice(0,3))}},filter:{ID:y?function(t){return t=t.replace(se,""),function(e){return e.getAttribute("id")===t}}:function(t){return t=t.replace(se,""),function(e){var i=typeof e.getAttributeNode!==T&&e.getAttributeNode("id");return i&&i.value===t}},TAG:function(t){return"*"===t?function(){return!0}:(t=t.replace(se,"").toLowerCase(),function(e){return e.nodeName&&e.nodeName.toLowerCase()===t})},CLASS:function(t){var e=H[M][t+" "];return e||(e=RegExp("(^|"+Y+")"+t+"("+Y+"|$)"))&&H(t,function(t){return e.test(t.className||typeof t.getAttribute!==T&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var a=i.attr(r,t);return null==a?"!="===e:e?(a+="","="===e?a===n:"!="===e?a!==n:"^="===e?n&&0===a.indexOf(n):"*="===e?n&&a.indexOf(n)>-1:"$="===e?n&&a.substr(a.length-n.length)===n:"~="===e?(" "+a+" ").indexOf(n)>-1:"|="===e?a===n||a.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(t,e,i,n){return"nth"===t?function(t){var e,r,a=t.parentNode;if(1===i&&0===n)return!0;if(a)for(r=0,e=a.firstChild;e&&(1!==e.nodeType||(r++,t!==e));e=e.nextSibling);return r-=n,r===i||0===r%i&&r/i>=0}:function(e){var i=e;switch(t){case"only":case"first":for(;i=i.previousSibling;)if(1===i.nodeType)return!1;if("first"===t)return!0;i=e;case"last":for(;i=i.nextSibling;)if(1===i.nodeType)return!1;return!0}}},PSEUDO:function(t,e){var n,r=b.pseudos[t]||b.setFilters[t.toLowerCase()]||i.error("unsupported pseudo: "+t);return r[M]?r(e):r.length>1?(n=[t,t,"",e],b.setFilters.hasOwnProperty(t.toLowerCase())?O(function(t,i){for(var n,a=r(t,e),s=a.length;s--;)n=F.call(t,a[s]),t[n]=!(i[n]=a[s])}):function(t){return r(t,0,n)}):r}},pseudos:{not:O(function(t){var e=[],i=[],n=k(t.replace(Q,"$1"));return n[M]?O(function(t,e,i,r){for(var a,s=n(t,null,r,[]),o=t.length;o--;)(a=s[o])&&(t[o]=!(e[o]=a))}):function(t,r,a){return e[0]=t,n(e,null,a,i),!i.pop()}}),has:O(function(t){return function(e){return i(t,e).length>0}}),contains:O(function(t){return function(e){return(e.textContent||e.innerText||x(e)).indexOf(t)>-1}}),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},parent:function(t){return!b.pseudos.empty(t)},empty:function(t){var e;for(t=t.firstChild;t;){if(t.nodeName>"@"||3===(e=t.nodeType)||4===e)return!1;t=t.nextSibling}return!0},header:function(t){return re.test(t.nodeName)},text:function(t){var e,i;return"input"===t.nodeName.toLowerCase()&&"text"===(e=t.type)&&(null==(i=t.getAttribute("type"))||i.toLowerCase()===e)},radio:n("radio"),checkbox:n("checkbox"),file:n("file"),password:n("password"),image:n("image"),submit:r("submit"),reset:r("reset"),button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},input:function(t){return ae.test(t.nodeName)},focus:function(t){var e=t.ownerDocument;return t===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},active:function(t){return t===t.ownerDocument.activeElement},first:a(function(){return[0]}),last:a(function(t,e){return[e-1]}),eq:a(function(t,e,i){return[0>i?i+e:i]}),even:a(function(t,e){for(var i=0;e>i;i+=2)t.push(i);return t}),odd:a(function(t,e){for(var i=1;e>i;i+=2)t.push(i);return t}),lt:a(function(t,e,i){for(var n=0>i?i+e:i;--n>=0;)t.push(n);return t}),gt:a(function(t,e,i){for(var n=0>i?i+e:i;e>++n;)t.push(n);return t})}},S=J.compareDocumentPosition?function(t,e){return t===e?(A=!0,0):(t.compareDocumentPosition&&e.compareDocumentPosition?4&t.compareDocumentPosition(e):t.compareDocumentPosition)?-1:1}:function(t,e){if(t===e)return A=!0,0;if(t.sourceIndex&&e.sourceIndex)return t.sourceIndex-e.sourceIndex;var i,n,r=[],a=[],o=t.parentNode,l=e.parentNode,u=o;if(o===l)return s(t,e);if(!o)return-1;if(!l)return 1;for(;u;)r.unshift(u),u=u.parentNode;for(u=l;u;)a.unshift(u),u=u.parentNode;i=r.length,n=a.length;for(var c=0;i>c&&n>c;c++)if(r[c]!==a[c])return s(r[c],a[c]);return c===i?s(t,a[c],-1):s(r[c],e,1)},[0,0].sort(S),C=!A,i.uniqueSort=function(t){var e,i=[],n=1,r=0;if(A=C,t.sort(S),A){for(;e=t[n];n++)e===t[n-1]&&(r=i.push(n));for(;r--;)t.splice(i[r],1)}return t},i.error=function(t){throw Error("Syntax error, unrecognized expression: "+t)},k=i.compile=function(t,e){var i,n=[],r=[],a=z[M][t+" "];if(!a){for(e||(e=o(t)),i=e.length;i--;)a=d(e[i]),a[M]?n.push(a):r.push(a);a=z(t,p(r,n))}return a},P.querySelectorAll&&function(){var t,e=g,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,a=[":focus"],s=[":active"],l=J.matchesSelector||J.mozMatchesSelector||J.webkitMatchesSelector||J.oMatchesSelector||J.msMatchesSelector;le(function(t){t.innerHTML="<select><option selected=''></option></select>",t.querySelectorAll("[selected]").length||a.push("\\["+Y+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),t.querySelectorAll(":checked").length||a.push(":checked")}),le(function(t){t.innerHTML="<p test=''></p>",t.querySelectorAll("[test^='']").length&&a.push("[*^$]="+Y+"*(?:\"\"|'')"),t.innerHTML="<input type='hidden'/>",t.querySelectorAll(":enabled").length||a.push(":enabled",":disabled")}),a=RegExp(a.join("|")),g=function(t,i,r,s,l){if(!s&&!l&&!a.test(t)){var u,c,h=!0,d=M,p=i,f=9===i.nodeType&&t;if(1===i.nodeType&&"object"!==i.nodeName.toLowerCase()){for(u=o(t),(h=i.getAttribute("id"))?d=h.replace(n,"\\$&"):i.setAttribute("id",d),d="[id='"+d+"'] ",c=u.length;c--;)u[c]=d+u[c].join("");p=ne.test(t)&&i.parentNode||i,f=u.join(",")}if(f)try{return L.apply(r,j.call(p.querySelectorAll(f),0)),r}catch(g){}finally{h||i.removeAttribute("id")}}return e(t,i,r,s,l)},l&&(le(function(e){t=l.call(e,"div");try{l.call(e,"[test!='']:sizzle"),s.push("!=",V)}catch(i){}}),s=RegExp(s.join("|")),i.matchesSelector=function(e,n){if(n=n.replace(r,"='$1']"),!w(e)&&!s.test(n)&&!a.test(n))try{var o=l.call(e,n);if(o||t||e.document&&11!==e.document.nodeType)return o}catch(u){}return i(n,null,null,[e]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,i.attr=G.attr,G.find=i,G.expr=i.selectors,G.expr[":"]=G.expr.pseudos,G.unique=i.uniqueSort,G.text=i.getText,G.isXMLDoc=i.isXML,G.contains=i.contains}(t);var Ee=/Until$/,Ie=/^(?:parents|prev(?:Until|All))/,Le=/^.[^:#\[\.,]*$/,je=G.expr.match.needsContext,Fe={children:!0,contents:!0,next:!0,prev:!0};G.fn.extend({find:function(t){var e,i,n,r,a,s,o=this;if("string"!=typeof t)return G(t).filter(function(){for(e=0,i=o.length;i>e;e++)if(G.contains(o[e],this))return!0});for(s=this.pushStack("","find",t),e=0,i=this.length;i>e;e++)if(n=s.length,G.find(t,this[e],s),e>0)for(r=n;s.length>r;r++)for(a=0;n>a;a++)if(s[a]===s[r]){s.splice(r--,1);break}return s},has:function(t){var e,i=G(t,this),n=i.length;return this.filter(function(){for(e=0;n>e;e++)if(G.contains(this,i[e]))return!0})},not:function(t){return this.pushStack(u(this,t,!1),"not",t)},filter:function(t){return this.pushStack(u(this,t,!0),"filter",t)},is:function(t){return!!t&&("string"==typeof t?je.test(t)?G(t,this.context).index(this[0])>=0:G.filter(t,this).length>0:this.filter(t).length>0)},closest:function(t,e){for(var i,n=0,r=this.length,a=[],s=je.test(t)||"string"!=typeof t?G(t,e||this.context):0;r>n;n++)for(i=this[n];i&&i.ownerDocument&&i!==e&&11!==i.nodeType;){if(s?s.index(i)>-1:G.find.matchesSelector(i,t)){a.push(i);break}i=i.parentNode}return a=a.length>1?G.unique(a):a,this.pushStack(a,"closest",t)},index:function(t){return t?"string"==typeof t?G.inArray(this[0],G(t)):G.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(t,e){var i="string"==typeof t?G(t,e):G.makeArray(t&&t.nodeType?[t]:t),n=G.merge(this.get(),i);return this.pushStack(o(i[0])||o(n[0])?n:G.unique(n))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),G.fn.andSelf=G.fn.addBack,G.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return G.dir(t,"parentNode")},parentsUntil:function(t,e,i){return G.dir(t,"parentNode",i)},next:function(t){return l(t,"nextSibling")},prev:function(t){return l(t,"previousSibling")},nextAll:function(t){return G.dir(t,"nextSibling")},prevAll:function(t){return G.dir(t,"previousSibling")},nextUntil:function(t,e,i){return G.dir(t,"nextSibling",i)},prevUntil:function(t,e,i){return G.dir(t,"previousSibling",i)},siblings:function(t){return G.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return G.sibling(t.firstChild)},contents:function(t){return G.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:G.merge([],t.childNodes)}},function(t,e){G.fn[t]=function(i,n){var r=G.map(this,e,i);return Ee.test(t)||(n=i),n&&"string"==typeof n&&(r=G.filter(n,r)),r=this.length>1&&!Fe[t]?G.unique(r):r,this.length>1&&Ie.test(t)&&(r=r.reverse()),this.pushStack(r,t,U.call(arguments).join(","))}}),G.extend({filter:function(t,e,i){return i&&(t=":not("+t+")"),1===e.length?G.find.matchesSelector(e[0],t)?[e[0]]:[]:G.find.matches(t,e)},dir:function(t,i,n){for(var r=[],a=t[i];a&&9!==a.nodeType&&(n===e||1!==a.nodeType||!G(a).is(n));)1===a.nodeType&&r.push(a),a=a[i];return r},sibling:function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i}});var Oe="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Re=/ jQuery\d+="(?:null|\d+)"/g,He=/^\s+/,Be=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ze=/<([\w:]+)/,Ye=/<tbody/i,We=/<|&#?\w+;/,qe=/<(?:script|style|link)/i,Ue=/<(?:script|object|embed|option|style)/i,Xe=RegExp("<(?:"+Oe+")[\\s/>]","i"),Ve=/^(?:checkbox|radio)$/,Ke=/checked\s*(?:[^=]|=\s*.checked.)/i,Qe=/\/(java|ecma)script/i,Ge=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Ze={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},ti=c(H),ei=ti.appendChild(H.createElement("div")); Ze.optgroup=Ze.option,Ze.tbody=Ze.tfoot=Ze.colgroup=Ze.caption=Ze.thead,Ze.th=Ze.td,G.support.htmlSerialize||(Ze._default=[1,"X<div>","</div>"]),G.fn.extend({text:function(t){return G.access(this,function(t){return t===e?G.text(this):this.empty().append((this[0]&&this[0].ownerDocument||H).createTextNode(t))},null,t,arguments.length)},wrapAll:function(t){if(G.isFunction(t))return this.each(function(e){G(this).wrapAll(t.call(this,e))});if(this[0]){var e=G(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return G.isFunction(t)?this.each(function(e){G(this).wrapInner(t.call(this,e))}):this.each(function(){var e=G(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=G.isFunction(t);return this.each(function(i){G(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(){return this.parent().each(function(){G.nodeName(this,"body")||G(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(t){(1===this.nodeType||11===this.nodeType)&&this.appendChild(t)})},prepend:function(){return this.domManip(arguments,!0,function(t){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(t,this.firstChild)})},before:function(){if(!o(this[0]))return this.domManip(arguments,!1,function(t){this.parentNode.insertBefore(t,this)});if(arguments.length){var t=G.clean(arguments);return this.pushStack(G.merge(t,this),"before",this.selector)}},after:function(){if(!o(this[0]))return this.domManip(arguments,!1,function(t){this.parentNode.insertBefore(t,this.nextSibling)});if(arguments.length){var t=G.clean(arguments);return this.pushStack(G.merge(this,t),"after",this.selector)}},remove:function(t,e){for(var i,n=0;null!=(i=this[n]);n++)(!t||G.filter(t,[i]).length)&&(e||1!==i.nodeType||(G.cleanData(i.getElementsByTagName("*")),G.cleanData([i])),i.parentNode&&i.parentNode.removeChild(i));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)for(1===t.nodeType&&G.cleanData(t.getElementsByTagName("*"));t.firstChild;)t.removeChild(t.firstChild);return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return G.clone(this,t,e)})},html:function(t){return G.access(this,function(t){var i=this[0]||{},n=0,r=this.length;if(t===e)return 1===i.nodeType?i.innerHTML.replace(Re,""):e;if(!("string"!=typeof t||qe.test(t)||!G.support.htmlSerialize&&Xe.test(t)||!G.support.leadingWhitespace&&He.test(t)||Ze[(ze.exec(t)||["",""])[1].toLowerCase()])){t=t.replace(Be,"<$1></$2>");try{for(;r>n;n++)i=this[n]||{},1===i.nodeType&&(G.cleanData(i.getElementsByTagName("*")),i.innerHTML=t);i=0}catch(a){}}i&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(t){return o(this[0])?this.length?this.pushStack(G(G.isFunction(t)?t():t),"replaceWith",t):this:G.isFunction(t)?this.each(function(e){var i=G(this),n=i.html();i.replaceWith(t.call(this,e,n))}):("string"!=typeof t&&(t=G(t).detach()),this.each(function(){var e=this.nextSibling,i=this.parentNode;G(this).remove(),e?G(e).before(t):G(i).append(t)}))},detach:function(t){return this.remove(t,!0)},domManip:function(t,i,n){t=[].concat.apply([],t);var r,a,s,o,l=0,u=t[0],c=[],d=this.length;if(!G.support.checkClone&&d>1&&"string"==typeof u&&Ke.test(u))return this.each(function(){G(this).domManip(t,i,n)});if(G.isFunction(u))return this.each(function(r){var a=G(this);t[0]=u.call(this,r,i?a.html():e),a.domManip(t,i,n)});if(this[0]){if(r=G.buildFragment(t,this,c),s=r.fragment,a=s.firstChild,1===s.childNodes.length&&(s=a),a)for(i=i&&G.nodeName(a,"tr"),o=r.cacheable||d-1;d>l;l++)n.call(i&&G.nodeName(this[l],"table")?h(this[l],"tbody"):this[l],l===o?s:G.clone(s,!0,!0));s=a=null,c.length&&G.each(c,function(t,e){e.src?G.ajax?G.ajax({url:e.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):G.error("no ajax"):G.globalEval((e.text||e.textContent||e.innerHTML||"").replace(Ge,"")),e.parentNode&&e.parentNode.removeChild(e)})}return this}}),G.buildFragment=function(t,i,n){var r,a,s,o=t[0];return i=i||H,i=!i.nodeType&&i[0]||i,i=i.ownerDocument||i,!(1===t.length&&"string"==typeof o&&512>o.length&&i===H&&"<"===o.charAt(0))||Ue.test(o)||!G.support.checkClone&&Ke.test(o)||!G.support.html5Clone&&Xe.test(o)||(a=!0,r=G.fragments[o],s=r!==e),r||(r=i.createDocumentFragment(),G.clean(t,i,r,n),a&&(G.fragments[o]=s&&r)),{fragment:r,cacheable:a}},G.fragments={},G.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){G.fn[t]=function(i){var n,r=0,a=[],s=G(i),o=s.length,l=1===this.length&&this[0].parentNode;if((null==l||l&&11===l.nodeType&&1===l.childNodes.length)&&1===o)return s[e](this[0]),this;for(;o>r;r++)n=(r>0?this.clone(!0):this).get(),G(s[r])[e](n),a=a.concat(n);return this.pushStack(a,t,s.selector)}}),G.extend({clone:function(t,e,i){var n,r,a,s;if(G.support.html5Clone||G.isXMLDoc(t)||!Xe.test("<"+t.nodeName+">")?s=t.cloneNode(!0):(ei.innerHTML=t.outerHTML,ei.removeChild(s=ei.firstChild)),!(G.support.noCloneEvent&&G.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||G.isXMLDoc(t)))for(p(t,s),n=f(t),r=f(s),a=0;n[a];++a)r[a]&&p(n[a],r[a]);if(e&&(d(t,s),i))for(n=f(t),r=f(s),a=0;n[a];++a)d(n[a],r[a]);return n=r=null,s},clean:function(t,i,n,r){var a,s,o,l,u,h,d,p,f,m,v,y=i===H&&ti,b=[];for(i&&i.createDocumentFragment!==e||(i=H),a=0;null!=(o=t[a]);a++)if("number"==typeof o&&(o+=""),o){if("string"==typeof o)if(We.test(o)){for(y=y||c(i),d=i.createElement("div"),y.appendChild(d),o=o.replace(Be,"<$1></$2>"),l=(ze.exec(o)||["",""])[1].toLowerCase(),u=Ze[l]||Ze._default,h=u[0],d.innerHTML=u[1]+o+u[2];h--;)d=d.lastChild;if(!G.support.tbody)for(p=Ye.test(o),f="table"!==l||p?"<table>"!==u[1]||p?[]:d.childNodes:d.firstChild&&d.firstChild.childNodes,s=f.length-1;s>=0;--s)G.nodeName(f[s],"tbody")&&!f[s].childNodes.length&&f[s].parentNode.removeChild(f[s]);!G.support.leadingWhitespace&&He.test(o)&&d.insertBefore(i.createTextNode(He.exec(o)[0]),d.firstChild),o=d.childNodes,d.parentNode.removeChild(d)}else o=i.createTextNode(o);o.nodeType?b.push(o):G.merge(b,o)}if(d&&(o=d=y=null),!G.support.appendChecked)for(a=0;null!=(o=b[a]);a++)G.nodeName(o,"input")?g(o):o.getElementsByTagName!==e&&G.grep(o.getElementsByTagName("input"),g);if(n)for(m=function(t){return!t.type||Qe.test(t.type)?r?r.push(t.parentNode?t.parentNode.removeChild(t):t):n.appendChild(t):e},a=0;null!=(o=b[a]);a++)G.nodeName(o,"script")&&m(o)||(n.appendChild(o),o.getElementsByTagName!==e&&(v=G.grep(G.merge([],o.getElementsByTagName("script")),m),b.splice.apply(b,[a+1,0].concat(v)),a+=v.length));return b},cleanData:function(t,e){for(var i,n,r,a,s=0,o=G.expando,l=G.cache,u=G.support.deleteExpando,c=G.event.special;null!=(r=t[s]);s++)if((e||G.acceptData(r))&&(n=r[o],i=n&&l[n])){if(i.events)for(a in i.events)c[a]?G.event.remove(r,a):G.removeEvent(r,a,i.handle);l[n]&&(delete l[n],u?delete r[o]:r.removeAttribute?r.removeAttribute(o):r[o]=null,G.deletedIds.push(n))}}}),function(){var t,e;G.uaMatch=function(t){t=t.toLowerCase();var e=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||0>t.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}},t=G.uaMatch(z.userAgent),e={},t.browser&&(e[t.browser]=!0,e.version=t.version),e.chrome?e.webkit=!0:e.webkit&&(e.safari=!0),G.browser=e,G.sub=function(){function t(e,i){return new t.fn.init(e,i)}G.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(i,n){return n&&n instanceof G&&!(n instanceof t)&&(n=t(n)),G.fn.init.call(this,i,n,e)},t.fn.init.prototype=t.fn;var e=t(H);return t}}();var ii,ni,ri,ai=/alpha\([^)]*\)/i,si=/opacity=([^)]*)/,oi=/^(top|right|bottom|left)$/,li=/^(none|table(?!-c[ea]).+)/,ui=/^margin/,ci=RegExp("^("+Z+")(.*)$","i"),hi=RegExp("^("+Z+")(?!px)[a-z%]+$","i"),di=RegExp("^([-+])=("+Z+")","i"),pi={BODY:"block"},fi={position:"absolute",visibility:"hidden",display:"block"},gi={letterSpacing:0,fontWeight:400},mi=["Top","Right","Bottom","Left"],vi=["Webkit","O","Moz","ms"],yi=G.fn.toggle;G.fn.extend({css:function(t,i){return G.access(this,function(t,i,n){return n!==e?G.style(t,i,n):G.css(t,i)},t,i,arguments.length>1)},show:function(){return y(this,!0)},hide:function(){return y(this)},toggle:function(t,e){var i="boolean"==typeof t;return G.isFunction(t)&&G.isFunction(e)?yi.apply(this,arguments):this.each(function(){(i?t:v(this))?G(this).show():G(this).hide()})}}),G.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=ii(t,"opacity");return""===i?"1":i}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":G.support.cssFloat?"cssFloat":"styleFloat"},style:function(t,i,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var a,s,o,l=G.camelCase(i),u=t.style;if(i=G.cssProps[l]||(G.cssProps[l]=m(u,l)),o=G.cssHooks[i]||G.cssHooks[l],n===e)return o&&"get"in o&&(a=o.get(t,!1,r))!==e?a:u[i];if(s=typeof n,"string"===s&&(a=di.exec(n))&&(n=(a[1]+1)*a[2]+parseFloat(G.css(t,i)),s="number"),!(null==n||"number"===s&&isNaN(n)||("number"!==s||G.cssNumber[l]||(n+="px"),o&&"set"in o&&(n=o.set(t,n,r))===e)))try{u[i]=n}catch(c){}}},css:function(t,i,n,r){var a,s,o,l=G.camelCase(i);return i=G.cssProps[l]||(G.cssProps[l]=m(t.style,l)),o=G.cssHooks[i]||G.cssHooks[l],o&&"get"in o&&(a=o.get(t,!0,r)),a===e&&(a=ii(t,i)),"normal"===a&&i in gi&&(a=gi[i]),n||r!==e?(s=parseFloat(a),n||G.isNumeric(s)?s||0:a):a},swap:function(t,e,i){var n,r,a={};for(r in e)a[r]=t.style[r],t.style[r]=e[r];n=i.call(t);for(r in e)t.style[r]=a[r];return n}}),t.getComputedStyle?ii=function(e,i){var n,r,a,s,o=t.getComputedStyle(e,null),l=e.style;return o&&(n=o.getPropertyValue(i)||o[i],""!==n||G.contains(e.ownerDocument,e)||(n=G.style(e,i)),hi.test(n)&&ui.test(i)&&(r=l.width,a=l.minWidth,s=l.maxWidth,l.minWidth=l.maxWidth=l.width=n,n=o.width,l.width=r,l.minWidth=a,l.maxWidth=s)),n}:H.documentElement.currentStyle&&(ii=function(t,e){var i,n,r=t.currentStyle&&t.currentStyle[e],a=t.style;return null==r&&a&&a[e]&&(r=a[e]),hi.test(r)&&!oi.test(e)&&(i=a.left,n=t.runtimeStyle&&t.runtimeStyle.left,n&&(t.runtimeStyle.left=t.currentStyle.left),a.left="fontSize"===e?"1em":r,r=a.pixelLeft+"px",a.left=i,n&&(t.runtimeStyle.left=n)),""===r?"auto":r}),G.each(["height","width"],function(t,i){G.cssHooks[i]={get:function(t,n,r){return n?0===t.offsetWidth&&li.test(ii(t,"display"))?G.swap(t,fi,function(){return w(t,i,r)}):w(t,i,r):e},set:function(t,e,n){return b(t,e,n?x(t,i,n,G.support.boxSizing&&"border-box"===G.css(t,"boxSizing")):0)}}}),G.support.opacity||(G.cssHooks.opacity={get:function(t,e){return si.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var i=t.style,n=t.currentStyle,r=G.isNumeric(e)?"alpha(opacity="+100*e+")":"",a=n&&n.filter||i.filter||"";i.zoom=1,e>=1&&""===G.trim(a.replace(ai,""))&&i.removeAttribute&&(i.removeAttribute("filter"),n&&!n.filter)||(i.filter=ai.test(a)?a.replace(ai,r):a+" "+r)}}),G(function(){G.support.reliableMarginRight||(G.cssHooks.marginRight={get:function(t,i){return G.swap(t,{display:"inline-block"},function(){return i?ii(t,"marginRight"):e})}}),!G.support.pixelPosition&&G.fn.position&&G.each(["top","left"],function(t,e){G.cssHooks[e]={get:function(t,i){if(i){var n=ii(t,e);return hi.test(n)?G(t).position()[e]+"px":n}}}})}),G.expr&&G.expr.filters&&(G.expr.filters.hidden=function(t){return 0===t.offsetWidth&&0===t.offsetHeight||!G.support.reliableHiddenOffsets&&"none"===(t.style&&t.style.display||ii(t,"display"))},G.expr.filters.visible=function(t){return!G.expr.filters.hidden(t)}),G.each({margin:"",padding:"",border:"Width"},function(t,e){G.cssHooks[t+e]={expand:function(i){var n,r="string"==typeof i?i.split(" "):[i],a={};for(n=0;4>n;n++)a[t+mi[n]+e]=r[n]||r[n-2]||r[0];return a}},ui.test(t)||(G.cssHooks[t+e].set=b)});var bi=/%20/g,xi=/\[\]$/,wi=/\r?\n/g,_i=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ki=/^(?:select|textarea)/i;G.fn.extend({serialize:function(){return G.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?G.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ki.test(this.nodeName)||_i.test(this.type))}).map(function(t,e){var i=G(this).val();return null==i?null:G.isArray(i)?G.map(i,function(t){return{name:e.name,value:t.replace(wi,"\r\n")}}):{name:e.name,value:i.replace(wi,"\r\n")}}).get()}}),G.param=function(t,i){var n,r=[],a=function(t,e){e=G.isFunction(e)?e():null==e?"":e,r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(i===e&&(i=G.ajaxSettings&&G.ajaxSettings.traditional),G.isArray(t)||t.jquery&&!G.isPlainObject(t))G.each(t,function(){a(this.name,this.value)});else for(n in t)k(n,t[n],i,a);return r.join("&").replace(bi,"+")};var Si,Ai,Di=/#.*$/,Ci=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ti=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Mi=/^(?:GET|HEAD)$/,Ni=/^\/\//,Pi=/\?/,Ji=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,$i=/([?&])_=[^&]*/,Ei=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Ii=G.fn.load,Li={},ji={},Fi=["*/"]+["*"];try{Ai=B.href}catch(Oi){Ai=H.createElement("a"),Ai.href="",Ai=Ai.href}Si=Ei.exec(Ai.toLowerCase())||[],G.fn.load=function(t,i,n){if("string"!=typeof t&&Ii)return Ii.apply(this,arguments);if(!this.length)return this;var r,a,s,o=this,l=t.indexOf(" ");return l>=0&&(r=t.slice(l,t.length),t=t.slice(0,l)),G.isFunction(i)?(n=i,i=e):i&&"object"==typeof i&&(a="POST"),G.ajax({url:t,type:a,dataType:"html",data:i,complete:function(t,e){n&&o.each(n,s||[t.responseText,e,t])}}).done(function(t){s=arguments,o.html(r?G("<div>").append(t.replace(Ji,"")).find(r):t)}),this},G.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(t,e){G.fn[e]=function(t){return this.on(e,t)}}),G.each(["get","post"],function(t,i){G[i]=function(t,n,r,a){return G.isFunction(n)&&(a=a||r,r=n,n=e),G.ajax({type:i,url:t,data:n,success:r,dataType:a})}}),G.extend({getScript:function(t,i){return G.get(t,e,i,"script")},getJSON:function(t,e,i){return G.get(t,e,i,"json")},ajaxSetup:function(t,e){return e?D(t,G.ajaxSettings):(e=t,t=G.ajaxSettings),D(t,e),t},ajaxSettings:{url:Ai,isLocal:Ti.test(Si[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Fi},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":t.String,"text html":!0,"text json":G.parseJSON,"text xml":G.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:S(Li),ajaxTransport:S(ji),ajax:function(t,i){function n(t,i,n,s){var u,h,y,b,w,k=i;2!==x&&(x=2,l&&clearTimeout(l),o=e,a=s||"",_.readyState=t>0?4:0,n&&(b=C(d,_,n)),t>=200&&300>t||304===t?(d.ifModified&&(w=_.getResponseHeader("Last-Modified"),w&&(G.lastModified[r]=w),w=_.getResponseHeader("Etag"),w&&(G.etag[r]=w)),304===t?(k="notmodified",u=!0):(u=T(d,b),k=u.state,h=u.data,y=u.error,u=!y)):(y=k,(!k||t)&&(k="error",0>t&&(t=0))),_.status=t,_.statusText=(i||k)+"",u?g.resolveWith(p,[h,k,_]):g.rejectWith(p,[_,k,y]),_.statusCode(v),v=e,c&&f.trigger("ajax"+(u?"Success":"Error"),[_,d,u?h:y]),m.fireWith(p,[_,k]),c&&(f.trigger("ajaxComplete",[_,d]),--G.active||G.event.trigger("ajaxStop")))}"object"==typeof t&&(i=t,t=e),i=i||{};var r,a,s,o,l,u,c,h,d=G.ajaxSetup({},i),p=d.context||d,f=p!==d&&(p.nodeType||p instanceof G)?G(p):G.event,g=G.Deferred(),m=G.Callbacks("once memory"),v=d.statusCode||{},y={},b={},x=0,w="canceled",_={readyState:0,setRequestHeader:function(t,e){if(!x){var i=t.toLowerCase();t=b[i]=b[i]||t,y[t]=e}return this},getAllResponseHeaders:function(){return 2===x?a:null},getResponseHeader:function(t){var i;if(2===x){if(!s)for(s={};i=Ci.exec(a);)s[i[1].toLowerCase()]=i[2];i=s[t.toLowerCase()]}return i===e?null:i},overrideMimeType:function(t){return x||(d.mimeType=t),this},abort:function(t){return t=t||w,o&&o.abort(t),n(0,t),this}};if(g.promise(_),_.success=_.done,_.error=_.fail,_.complete=m.add,_.statusCode=function(t){if(t){var e;if(2>x)for(e in t)v[e]=[v[e],t[e]];else e=t[_.status],_.always(e)}return this},d.url=((t||d.url)+"").replace(Di,"").replace(Ni,Si[1]+"//"),d.dataTypes=G.trim(d.dataType||"*").toLowerCase().split(ee),null==d.crossDomain&&(u=Ei.exec(d.url.toLowerCase()),d.crossDomain=!(!u||u[1]===Si[1]&&u[2]===Si[2]&&(u[3]||("http:"===u[1]?80:443))==(Si[3]||("http:"===Si[1]?80:443)))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=G.param(d.data,d.traditional)),A(Li,d,i,_),2===x)return _;if(c=d.global,d.type=d.type.toUpperCase(),d.hasContent=!Mi.test(d.type),c&&0===G.active++&&G.event.trigger("ajaxStart"),!d.hasContent&&(d.data&&(d.url+=(Pi.test(d.url)?"&":"?")+d.data,delete d.data),r=d.url,d.cache===!1)){var k=G.now(),S=d.url.replace($i,"$1_="+k);d.url=S+(S===d.url?(Pi.test(d.url)?"&":"?")+"_="+k:"")}(d.data&&d.hasContent&&d.contentType!==!1||i.contentType)&&_.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(r=r||d.url,G.lastModified[r]&&_.setRequestHeader("If-Modified-Since",G.lastModified[r]),G.etag[r]&&_.setRequestHeader("If-None-Match",G.etag[r])),_.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Fi+"; q=0.01":""):d.accepts["*"]);for(h in d.headers)_.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(d.beforeSend.call(p,_,d)===!1||2===x))return _.abort();w="abort";for(h in{success:1,error:1,complete:1})_[h](d[h]);if(o=A(ji,d,i,_)){_.readyState=1,c&&f.trigger("ajaxSend",[_,d]),d.async&&d.timeout>0&&(l=setTimeout(function(){_.abort("timeout")},d.timeout));try{x=1,o.send(y,n)}catch(D){if(!(2>x))throw D;n(-1,D)}}else n(-1,"No Transport");return _},active:0,lastModified:{},etag:{}});var Ri=[],Hi=/\?/,Bi=/(=)\?(?=&|$)|\?\?/,zi=G.now();G.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ri.pop()||G.expando+"_"+zi++;return this[t]=!0,t}}),G.ajaxPrefilter("json jsonp",function(i,n,r){var a,s,o,l=i.data,u=i.url,c=i.jsonp!==!1,h=c&&Bi.test(u),d=c&&!h&&"string"==typeof l&&!(i.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bi.test(l);return"jsonp"===i.dataTypes[0]||h||d?(a=i.jsonpCallback=G.isFunction(i.jsonpCallback)?i.jsonpCallback():i.jsonpCallback,s=t[a],h?i.url=u.replace(Bi,"$1"+a):d?i.data=l.replace(Bi,"$1"+a):c&&(i.url+=(Hi.test(u)?"&":"?")+i.jsonp+"="+a),i.converters["script json"]=function(){return o||G.error(a+" was not called"),o[0]},i.dataTypes[0]="json",t[a]=function(){o=arguments},r.always(function(){t[a]=s,i[a]&&(i.jsonpCallback=n.jsonpCallback,Ri.push(a)),o&&G.isFunction(s)&&s(o[0]),o=s=e}),"script"):e}),G.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(t){return G.globalEval(t),t}}}),G.ajaxPrefilter("script",function(t){t.cache===e&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)}),G.ajaxTransport("script",function(t){if(t.crossDomain){var i,n=H.head||H.getElementsByTagName("head")[0]||H.documentElement;return{send:function(r,a){i=H.createElement("script"),i.async="async",t.scriptCharset&&(i.charset=t.scriptCharset),i.src=t.url,i.onload=i.onreadystatechange=function(t,r){(r||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,n&&i.parentNode&&n.removeChild(i),i=e,r||a(200,"success"))},n.insertBefore(i,n.firstChild)},abort:function(){i&&i.onload(0,1)}}}});var Yi,Wi=t.ActiveXObject?function(){for(var t in Yi)Yi[t](0,1)}:!1,qi=0;G.ajaxSettings.xhr=t.ActiveXObject?function(){return!this.isLocal&&M()||N()}:M,function(t){G.extend(G.support,{ajax:!!t,cors:!!t&&"withCredentials"in t})}(G.ajaxSettings.xhr()),G.support.ajax&&G.ajaxTransport(function(i){if(!i.crossDomain||G.support.cors){var n;return{send:function(r,a){var s,o,l=i.xhr();if(i.username?l.open(i.type,i.url,i.async,i.username,i.password):l.open(i.type,i.url,i.async),i.xhrFields)for(o in i.xhrFields)l[o]=i.xhrFields[o];i.mimeType&&l.overrideMimeType&&l.overrideMimeType(i.mimeType),i.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");try{for(o in r)l.setRequestHeader(o,r[o])}catch(u){}l.send(i.hasContent&&i.data||null),n=function(t,r){var o,u,c,h,d;try{if(n&&(r||4===l.readyState))if(n=e,s&&(l.onreadystatechange=G.noop,Wi&&delete Yi[s]),r)4!==l.readyState&&l.abort();else{o=l.status,c=l.getAllResponseHeaders(),h={},d=l.responseXML,d&&d.documentElement&&(h.xml=d);try{h.text=l.responseText}catch(p){}try{u=l.statusText}catch(p){u=""}o||!i.isLocal||i.crossDomain?1223===o&&(o=204):o=h.text?200:404}}catch(f){r||a(-1,f)}h&&a(o,u,h,c)},i.async?4===l.readyState?setTimeout(n,0):(s=++qi,Wi&&(Yi||(Yi={},G(t).unload(Wi)),Yi[s]=n),l.onreadystatechange=n):n()},abort:function(){n&&n(0,1)}}}});var Ui,Xi,Vi=/^(?:toggle|show|hide)$/,Ki=RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Qi=/queueHooks$/,Gi=[I],Zi={"*":[function(t,e){var i,n,r=this.createTween(t,e),a=Ki.exec(e),s=r.cur(),o=+s||0,l=1,u=20;if(a){if(i=+a[2],n=a[3]||(G.cssNumber[t]?"":"px"),"px"!==n&&o){o=G.css(r.elem,t,!0)||i||1;do l=l||".5",o/=l,G.style(r.elem,t,o+n);while(l!==(l=r.cur()/s)&&1!==l&&--u)}r.unit=n,r.start=o,r.end=a[1]?o+(a[1]+1)*i:i}return r}]};G.Animation=G.extend($,{tweener:function(t,e){G.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var i,n=0,r=t.length;r>n;n++)i=t[n],Zi[i]=Zi[i]||[],Zi[i].unshift(e)},prefilter:function(t,e){e?Gi.unshift(t):Gi.push(t)}}),G.Tween=L,L.prototype={constructor:L,init:function(t,e,i,n,r,a){this.elem=t,this.prop=i,this.easing=r||"swing",this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=a||(G.cssNumber[i]?"":"px")},cur:function(){var t=L.propHooks[this.prop];return t&&t.get?t.get(this):L.propHooks._default.get(this)},run:function(t){var e,i=L.propHooks[this.prop];return this.pos=e=this.options.duration?G.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),i&&i.set?i.set(this):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=G.css(t.elem,t.prop,!1,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){G.fx.step[t.prop]?G.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[G.cssProps[t.prop]]||G.cssHooks[t.prop])?G.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},G.each(["toggle","show","hide"],function(t,e){var i=G.fn[e];G.fn[e]=function(n,r,a){return null==n||"boolean"==typeof n||!t&&G.isFunction(n)&&G.isFunction(r)?i.apply(this,arguments):this.animate(j(e,!0),n,r,a)}}),G.fn.extend({fadeTo:function(t,e,i,n){return this.filter(v).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var r=G.isEmptyObject(t),a=G.speed(e,i,n),s=function(){var e=$(this,G.extend({},t),a);r&&e.stop(!0)};return r||a.queue===!1?this.each(s):this.queue(a.queue,s)},stop:function(t,i,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=i,i=t,t=e),i&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",a=G.timers,s=G._data(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&Qi.test(i)&&r(s[i]);for(i=a.length;i--;)a[i].elem!==this||null!=t&&a[i].queue!==t||(a[i].anim.stop(n),e=!1,a.splice(i,1));(e||!n)&&G.dequeue(this,t)})}}),G.each({slideDown:j("show"),slideUp:j("hide"),slideToggle:j("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){G.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}}),G.speed=function(t,e,i){var n=t&&"object"==typeof t?G.extend({},t):{complete:i||!i&&e||G.isFunction(t)&&t,duration:t,easing:i&&e||e&&!G.isFunction(e)&&e};return n.duration=G.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in G.fx.speeds?G.fx.speeds[n.duration]:G.fx.speeds._default,(null==n.queue||n.queue===!0)&&(n.queue="fx"),n.old=n.complete,n.complete=function(){G.isFunction(n.old)&&n.old.call(this),n.queue&&G.dequeue(this,n.queue)},n},G.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},G.timers=[],G.fx=L.prototype.init,G.fx.tick=function(){var t,i=G.timers,n=0;for(Ui=G.now();i.length>n;n++)t=i[n],t()||i[n]!==t||i.splice(n--,1);i.length||G.fx.stop(),Ui=e},G.fx.timer=function(t){t()&&G.timers.push(t)&&!Xi&&(Xi=setInterval(G.fx.tick,G.fx.interval))},G.fx.interval=13,G.fx.stop=function(){clearInterval(Xi),Xi=null},G.fx.speeds={slow:600,fast:200,_default:400},G.fx.step={},G.expr&&G.expr.filters&&(G.expr.filters.animated=function(t){return G.grep(G.timers,function(e){return t===e.elem}).length});var tn=/^(?:body|html)$/i;G.fn.offset=function(t){if(arguments.length)return t===e?this:this.each(function(e){G.offset.setOffset(this,t,e)});var i,n,r,a,s,o,l,u={top:0,left:0},c=this[0],h=c&&c.ownerDocument;if(h)return(n=h.body)===c?G.offset.bodyOffset(c):(i=h.documentElement,G.contains(i,c)?(c.getBoundingClientRect!==e&&(u=c.getBoundingClientRect()),r=F(h),a=i.clientTop||n.clientTop||0,s=i.clientLeft||n.clientLeft||0,o=r.pageYOffset||i.scrollTop,l=r.pageXOffset||i.scrollLeft,{top:u.top+o-a,left:u.left+l-s}):u)},G.offset={bodyOffset:function(t){var e=t.offsetTop,i=t.offsetLeft;return G.support.doesNotIncludeMarginInBodyOffset&&(e+=parseFloat(G.css(t,"marginTop"))||0,i+=parseFloat(G.css(t,"marginLeft"))||0),{top:e,left:i}},setOffset:function(t,e,i){var n=G.css(t,"position");"static"===n&&(t.style.position="relative");var r,a,s=G(t),o=s.offset(),l=G.css(t,"top"),u=G.css(t,"left"),c=("absolute"===n||"fixed"===n)&&G.inArray("auto",[l,u])>-1,h={},d={};c?(d=s.position(),r=d.top,a=d.left):(r=parseFloat(l)||0,a=parseFloat(u)||0),G.isFunction(e)&&(e=e.call(t,i,o)),null!=e.top&&(h.top=e.top-o.top+r),null!=e.left&&(h.left=e.left-o.left+a),"using"in e?e.using.call(t,h):s.css(h)}},G.fn.extend({position:function(){if(this[0]){var t=this[0],e=this.offsetParent(),i=this.offset(),n=tn.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(G.css(t,"marginTop"))||0,i.left-=parseFloat(G.css(t,"marginLeft"))||0,n.top+=parseFloat(G.css(e[0],"borderTopWidth"))||0,n.left+=parseFloat(G.css(e[0],"borderLeftWidth"))||0,{top:i.top-n.top,left:i.left-n.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||H.body;t&&!tn.test(t.nodeName)&&"static"===G.css(t,"position");)t=t.offsetParent;return t||H.body})}}),G.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var n=/Y/.test(i);G.fn[t]=function(r){return G.access(this,function(t,r,a){var s=F(t);return a===e?s?i in s?s[i]:s.document.documentElement[r]:t[r]:(s?s.scrollTo(n?G(s).scrollLeft():a,n?a:G(s).scrollTop()):t[r]=a,e)},t,r,arguments.length,null)}}),G.each({Height:"height",Width:"width"},function(t,i){G.each({padding:"inner"+t,content:i,"":"outer"+t},function(n,r){G.fn[r]=function(r,a){var s=arguments.length&&(n||"boolean"!=typeof r),o=n||(r===!0||a===!0?"margin":"border");return G.access(this,function(i,n,r){var a;return G.isWindow(i)?i.document.documentElement["client"+t]:9===i.nodeType?(a=i.documentElement,Math.max(i.body["scroll"+t],a["scroll"+t],i.body["offset"+t],a["offset"+t],a["client"+t])):r===e?G.css(i,n,r,o):G.style(i,n,r,o)},i,s?r:e,s,null)}})}),t.jQuery=t.$=G,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return G})})(window),function(t){var e,i,n="0.3.4",r="hasOwnProperty",a=/[\.\/]/,s="*",o=function(){},l=function(t,e){return t-e},u={n:{}},c=function(t,n){var r,a=i,s=Array.prototype.slice.call(arguments,2),o=c.listeners(t),u=0,h=[],d={},p=[],f=e;e=t,i=0;for(var g=0,m=o.length;m>g;g++)"zIndex"in o[g]&&(h.push(o[g].zIndex),0>o[g].zIndex&&(d[o[g].zIndex]=o[g]));for(h.sort(l);0>h[u];)if(r=d[h[u++]],p.push(r.apply(n,s)),i)return i=a,p;for(g=0;m>g;g++)if(r=o[g],"zIndex"in r)if(r.zIndex==h[u]){if(p.push(r.apply(n,s)),i)break;do if(u++,r=d[h[u]],r&&p.push(r.apply(n,s)),i)break;while(r)}else d[r.zIndex]=r;else if(p.push(r.apply(n,s)),i)break;return i=a,e=f,p.length?p:null};c.listeners=function(t){var e,i,n,r,o,l,c,h,d=t.split(a),p=u,f=[p],g=[];for(r=0,o=d.length;o>r;r++){for(h=[],l=0,c=f.length;c>l;l++)for(p=f[l].n,i=[p[d[r]],p[s]],n=2;n--;)e=i[n],e&&(h.push(e),g=g.concat(e.f||[]));f=h}return g},c.on=function(t,e){for(var i=t.split(a),n=u,r=0,s=i.length;s>r;r++)n=n.n,!n[i[r]]&&(n[i[r]]={n:{}}),n=n[i[r]];for(n.f=n.f||[],r=0,s=n.f.length;s>r;r++)if(n.f[r]==e)return o;return n.f.push(e),function(t){+t==+t&&(e.zIndex=+t)}},c.stop=function(){i=1},c.nt=function(t){return t?RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},c.off=c.unbind=function(t,e){var i,n,o,l,c,h,d,p=t.split(a),f=[u];for(l=0,c=p.length;c>l;l++)for(h=0;f.length>h;h+=o.length-2){if(o=[h,1],i=f[h].n,p[l]!=s)i[p[l]]&&o.push(i[p[l]]);else for(n in i)i[r](n)&&o.push(i[n]);f.splice.apply(f,o)}for(l=0,c=f.length;c>l;l++)for(i=f[l];i.n;){if(e){if(i.f){for(h=0,d=i.f.length;d>h;h++)if(i.f[h]==e){i.f.splice(h,1);break}!i.f.length&&delete i.f}for(n in i.n)if(i.n[r](n)&&i.n[n].f){var g=i.n[n].f;for(h=0,d=g.length;d>h;h++)if(g[h]==e){g.splice(h,1);break}!g.length&&delete i.n[n].f}}else{delete i.f;for(n in i.n)i.n[r](n)&&i.n[n].f&&delete i.n[n].f}i=i.n}},c.once=function(t,e){var i=function(){var n=e.apply(this,arguments);return c.unbind(t,i),n};return c.on(t,i)},c.version=n,c.toString=function(){return"You are running Eve "+n},"undefined"!=typeof module&&module.exports?module.exports=c:"undefined"!=typeof define?define("eve",[],function(){return c}):t.eve=c}(this),window.eve||"function"!=typeof define||"function"!=typeof require||(window.eve=require("eve")),function(){function t(e){if(t.is(e,"function"))return y?e():eve.on("raphael.DOMload",e);if(t.is(e,W))return t._engine.create[C](t,e.splice(0,3+t.is(e[0],z))).add(e);var i=Array.prototype.slice.call(arguments,0);if(t.is(i[i.length-1],"function")){var n=i.pop();return y?n.call(t._engine.create[C](t,i)):eve.on("raphael.DOMload",function(){n.call(t._engine.create[C](t,i))})}return t._engine.create[C](t,arguments)}function e(t){if(Object(t)!==t)return t;var i=new t.constructor;for(var n in t)t[k](n)&&(i[n]=e(t[n]));return i}function i(t,e){for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return t.push(t.splice(i,1)[0])}function n(t,e,n){function r(){var a=Array.prototype.slice.call(arguments,0),s=a.join("\u2400"),o=r.cache=r.cache||{},l=r.count=r.count||[];return o[k](s)?(i(l,s),n?n(o[s]):o[s]):(l.length>=1e3&&delete o[l.shift()],l.push(s),o[s]=t[C](e,a),n?n(o[s]):o[s])}return r}function r(){return this.hex}function a(t,e){for(var i=[],n=0,r=t.length;r-2*!e>n;n+=2){var a=[{x:+t[n-2],y:+t[n-1]},{x:+t[n],y:+t[n+1]},{x:+t[n+2],y:+t[n+3]},{x:+t[n+4],y:+t[n+5]}];e?n?r-4==n?a[3]={x:+t[0],y:+t[1]}:r-2==n&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[r-2],y:+t[r-1]}:r-4==n?a[3]=a[2]:n||(a[0]={x:+t[n],y:+t[n+1]}),i.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return i}function s(t,e,i,n,r){var a=-3*e+9*i-9*n+3*r,s=t*a+6*e-12*i+6*n;return t*s-3*e+3*i}function o(t,e,i,n,r,a,o,l,u){null==u&&(u=1),u=u>1?1:0>u?0:u;for(var c=u/2,h=12,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,g=0;h>g;g++){var m=c*d[g]+c,v=s(m,t,i,r,o),y=s(m,e,n,a,l),b=v*v+y*y;f+=p[g]*j.sqrt(b)}return c*f }function l(t,e,i,n,r,a,s,l,u){if(!(0>u||u>o(t,e,i,n,r,a,s,l))){var c,h=1,d=h/2,p=h-d,f=.01;for(c=o(t,e,i,n,r,a,s,l,p);R(c-u)>f;)d/=2,p+=(u>c?1:-1)*d,c=o(t,e,i,n,r,a,s,l,p);return p}}function u(t,e,i,n,r,a,s,o){if(!(F(t,i)<O(r,s)||O(t,i)>F(r,s)||F(e,n)<O(a,o)||O(e,n)>F(a,o))){var l=(t*n-e*i)*(r-s)-(t-i)*(r*o-a*s),u=(t*n-e*i)*(a-o)-(e-n)*(r*o-a*s),c=(t-i)*(a-o)-(e-n)*(r-s);if(c){var h=l/c,d=u/c,p=+h.toFixed(2),f=+d.toFixed(2);if(!(+O(t,i).toFixed(2)>p||p>+F(t,i).toFixed(2)||+O(r,s).toFixed(2)>p||p>+F(r,s).toFixed(2)||+O(e,n).toFixed(2)>f||f>+F(e,n).toFixed(2)||+O(a,o).toFixed(2)>f||f>+F(a,o).toFixed(2)))return{x:h,y:d}}}}function c(e,i,n){var r=t.bezierBBox(e),a=t.bezierBBox(i);if(!t.isBBoxIntersect(r,a))return n?0:[];for(var s=o.apply(0,e),l=o.apply(0,i),c=~~(s/5),h=~~(l/5),d=[],p=[],f={},g=n?0:[],m=0;c+1>m;m++){var v=t.findDotsAtSegment.apply(t,e.concat(m/c));d.push({x:v.x,y:v.y,t:m/c})}for(m=0;h+1>m;m++)v=t.findDotsAtSegment.apply(t,i.concat(m/h)),p.push({x:v.x,y:v.y,t:m/h});for(m=0;c>m;m++)for(var y=0;h>y;y++){var b=d[m],x=d[m+1],w=p[y],_=p[y+1],k=.001>R(x.x-b.x)?"y":"x",S=.001>R(_.x-w.x)?"y":"x",A=u(b.x,b.y,x.x,x.y,w.x,w.y,_.x,_.y);if(A){if(f[A.x.toFixed(4)]==A.y.toFixed(4))continue;f[A.x.toFixed(4)]=A.y.toFixed(4);var D=b.t+R((A[k]-b[k])/(x[k]-b[k]))*(x.t-b.t),C=w.t+R((A[S]-w[S])/(_[S]-w[S]))*(_.t-w.t);D>=0&&1>=D&&C>=0&&1>=C&&(n?g++:g.push({x:A.x,y:A.y,t1:D,t2:C}))}}return g}function h(e,i,n){e=t._path2curve(e),i=t._path2curve(i);for(var r,a,s,o,l,u,h,d,p,f,g=n?0:[],m=0,v=e.length;v>m;m++){var y=e[m];if("M"==y[0])r=l=y[1],a=u=y[2];else{"C"==y[0]?(p=[r,a].concat(y.slice(1)),r=p[6],a=p[7]):(p=[r,a,r,a,l,u,l,u],r=l,a=u);for(var b=0,x=i.length;x>b;b++){var w=i[b];if("M"==w[0])s=h=w[1],o=d=w[2];else{"C"==w[0]?(f=[s,o].concat(w.slice(1)),s=f[6],o=f[7]):(f=[s,o,s,o,h,d,h,d],s=h,o=d);var _=c(p,f,n);if(n)g+=_;else{for(var k=0,S=_.length;S>k;k++)_[k].segment1=m,_[k].segment2=b,_[k].bez1=p,_[k].bez2=f;g=g.concat(_)}}}}}return g}function d(t,e,i,n,r,a){null!=t?(this.a=+t,this.b=+e,this.c=+i,this.d=+n,this.e=+r,this.f=+a):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function p(){return this.x+P+this.y+P+this.width+" \u00d7 "+this.height}function f(t,e,i,n,r,a){function s(t){return((h*t+c)*t+u)*t}function o(t,e){var i=l(t,e);return((f*i+p)*i+d)*i}function l(t,e){var i,n,r,a,o,l;for(r=t,l=0;8>l;l++){if(a=s(r)-t,e>R(a))return r;if(o=(3*h*r+2*c)*r+u,1e-6>R(o))break;r-=a/o}if(i=0,n=1,r=t,i>r)return i;if(r>n)return n;for(;n>i;){if(a=s(r),e>R(a-t))return r;t>a?i=r:n=r,r=(n-i)/2+i}return r}var u=3*e,c=3*(n-e)-u,h=1-u-c,d=3*i,p=3*(r-i)-d,f=1-d-p;return o(t,1/(200*a))}function g(t,e){var i=[],n={};if(this.ms=e,this.times=1,t){for(var r in t)t[k](r)&&(n[Q(r)]=t[r],i.push(Q(r)));i.sort(ue)}this.anim=n,this.top=i[i.length-1],this.percents=i}function m(e,i,n,r,a,s){n=Q(n);var o,l,u,c,h,p,g=e.ms,m={},v={},y={};if(r)for(w=0,_=ai.length;_>w;w++){var b=ai[w];if(b.el.id==i.id&&b.anim==e){b.percent!=n?(ai.splice(w,1),u=1):l=b,i.attr(b.totalOrigin);break}}else r=+v;for(var w=0,_=e.percents.length;_>w;w++){if(e.percents[w]==n||e.percents[w]>r*e.top){n=e.percents[w],h=e.percents[w-1]||0,g=g/e.top*(n-h),c=e.percents[w+1],o=e.anim[n];break}r&&i.attr(e.anim[e.percents[w]])}if(o){if(l)l.initstatus=r,l.start=new Date-l.ms*r;else{for(var S in o)if(o[k](S)&&(ee[k](S)||i.paper.customAttributes[k](S)))switch(m[S]=i.attr(S),null==m[S]&&(m[S]=te[S]),v[S]=o[S],ee[S]){case z:y[S]=(v[S]-m[S])/g;break;case"colour":m[S]=t.getRGB(m[S]);var A=t.getRGB(v[S]);y[S]={r:(A.r-m[S].r)/g,g:(A.g-m[S].g)/g,b:(A.b-m[S].b)/g};break;case"path":var D=Ee(m[S],v[S]),C=D[1];for(m[S]=D[0],y[S]=[],w=0,_=m[S].length;_>w;w++){y[S][w]=[0];for(var M=1,N=m[S][w].length;N>M;M++)y[S][w][M]=(C[w][M]-m[S][w][M])/g}break;case"transform":var P=i._,E=Oe(P[S],v[S]);if(E)for(m[S]=E.from,v[S]=E.to,y[S]=[],y[S].real=!0,w=0,_=m[S].length;_>w;w++)for(y[S][w]=[m[S][w][0]],M=1,N=m[S][w].length;N>M;M++)y[S][w][M]=(v[S][w][M]-m[S][w][M])/g;else{var I=i.matrix||new d,L={_:{transform:P.transform},getBBox:function(){return i.getBBox(1)}};m[S]=[I.a,I.b,I.c,I.d,I.e,I.f],je(L,v[S]),v[S]=L._.transform,y[S]=[(L.matrix.a-I.a)/g,(L.matrix.b-I.b)/g,(L.matrix.c-I.c)/g,(L.matrix.d-I.d)/g,(L.matrix.e-I.e)/g,(L.matrix.f-I.f)/g]}break;case"csv":var j=J(o[S])[$](x),F=J(m[S])[$](x);if("clip-rect"==S)for(m[S]=F,y[S]=[],w=F.length;w--;)y[S][w]=(j[w]-m[S][w])/g;v[S]=j;break;default:for(j=[][T](o[S]),F=[][T](m[S]),y[S]=[],w=i.paper.customAttributes[S].length;w--;)y[S][w]=((j[w]||0)-(F[w]||0))/g}var O=o.easing,R=t.easing_formulas[O];if(!R)if(R=J(O).match(V),R&&5==R.length){var H=R;R=function(t){return f(t,+H[1],+H[2],+H[3],+H[4],g)}}else R=he;if(p=o.start||e.start||+new Date,b={anim:e,percent:n,timestamp:p,start:p+(e.del||0),status:0,initstatus:r||0,stop:!1,ms:g,easing:R,from:m,diff:y,to:v,el:i,callback:o.callback,prev:h,next:c,repeat:s||e.times,origin:i.attr(),totalOrigin:a},ai.push(b),r&&!l&&!u&&(b.stop=!0,b.start=new Date-g*r,1==ai.length))return oi();u&&(b.start=new Date-b.ms*r),1==ai.length&&si(oi)}eve("raphael.anim.start."+i.id,i,e)}}function v(t){for(var e=0;ai.length>e;e++)ai[e].el.paper==t&&ai.splice(e--,1)}t.version="2.1.0",t.eve=eve;var y,b,x=/[, ]+/,w={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},_=/\{(\d+)\}/g,k="hasOwnProperty",S={doc:document,win:window},A={was:Object.prototype[k].call(S.win,"Raphael"),is:S.win.Raphael},D=function(){this.ca=this.customAttributes={}},C="apply",T="concat",M="createTouch"in S.doc,N="",P=" ",J=String,$="split",E="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[$](P),I={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},L=J.prototype.toLowerCase,j=Math,F=j.max,O=j.min,R=j.abs,H=j.pow,B=j.PI,z="number",Y="string",W="array",q=Object.prototype.toString,U=(t._ISURL=/^url\(['"]?([^\)]+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),X={NaN:1,Infinity:1,"-Infinity":1},V=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,K=j.round,Q=parseFloat,G=parseInt,Z=J.prototype.toUpperCase,te=t._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0},ee=t._availableAnimAttrs={blur:z,"clip-rect":"csv",cx:z,cy:z,fill:"colour","fill-opacity":z,"font-size":z,height:z,opacity:z,path:"path",r:z,rx:z,ry:z,stroke:"colour","stroke-opacity":z,"stroke-width":z,transform:"transform",width:z,x:z,y:z},ie=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,ne={hs:1,rg:1},re=/,?([achlmqrstvxz]),?/gi,ae=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,se=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,oe=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,le=(t._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),ue=function(t,e){return Q(t)-Q(e)},ce=function(){},he=function(t){return t},de=t._rectPath=function(t,e,i,n,r){return r?[["M",t+r,e],["l",i-2*r,0],["a",r,r,0,0,1,r,r],["l",0,n-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-i,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-n],["a",r,r,0,0,1,r,-r],["z"]]:[["M",t,e],["l",i,0],["l",0,n],["l",-i,0],["z"]]},pe=function(t,e,i,n){return null==n&&(n=i),[["M",t,e],["m",0,-n],["a",i,n,0,1,1,0,2*n],["a",i,n,0,1,1,0,-2*n],["z"]]},fe=t._getPath={path:function(t){return t.attr("path")},circle:function(t){var e=t.attrs;return pe(e.cx,e.cy,e.r)},ellipse:function(t){var e=t.attrs;return pe(e.cx,e.cy,e.rx,e.ry)},rect:function(t){var e=t.attrs;return de(e.x,e.y,e.width,e.height,e.r)},image:function(t){var e=t.attrs;return de(e.x,e.y,e.width,e.height)},text:function(t){var e=t._getBBox();return de(e.x,e.y,e.width,e.height)}},ge=t.mapPath=function(t,e){if(!e)return t;var i,n,r,a,s,o,l;for(t=Ee(t),r=0,s=t.length;s>r;r++)for(l=t[r],a=1,o=l.length;o>a;a+=2)i=e.x(l[a],l[a+1]),n=e.y(l[a],l[a+1]),l[a]=i,l[a+1]=n;return t};if(t._g=S,t.type=S.win.SVGAngle||S.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==t.type){var me,ve=S.doc.createElement("div");if(ve.innerHTML='<v:shape adj="1"/>',me=ve.firstChild,me.style.behavior="url(#default#VML)",!me||"object"!=typeof me.adj)return t.type=N;ve=null}t.svg=!(t.vml="VML"==t.type),t._Paper=D,t.fn=b=D.prototype=t.prototype,t._id=0,t._oid=0,t.is=function(t,e){return e=L.call(e),"finite"==e?!X[k](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||q.call(t).slice(8,-1).toLowerCase()==e},t.angle=function(e,i,n,r,a,s){if(null==a){var o=e-n,l=i-r;return o||l?(180+180*j.atan2(-l,-o)/B+360)%360:0}return t.angle(e,i,a,s)-t.angle(n,r,a,s)},t.rad=function(t){return t%360*B/180},t.deg=function(t){return 180*t/B%360},t.snapTo=function(e,i,n){if(n=t.is(n,"finite")?n:10,t.is(e,W)){for(var r=e.length;r--;)if(n>=R(e[r]-i))return e[r]}else{e=+e;var a=i%e;if(n>a)return i-a;if(a>e-n)return i-a+e}return i},t.createUUID=function(t,e){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(t,e).toUpperCase()}}(/[xy]/g,function(t){var e=0|16*j.random(),i="x"==t?e:8|3&e;return i.toString(16)}),t.setWindow=function(e){eve("raphael.setWindow",t,S.win,e),S.win=e,S.doc=S.win.document,t._engine.initWin&&t._engine.initWin(S.win)};var ye=function(e){if(t.vml){var i,r=/^\s+|\s+$/g;try{var a=new ActiveXObject("htmlfile");a.write("<body>"),a.close(),i=a.body}catch(s){i=createPopup().document.body}var o=i.createTextRange();ye=n(function(t){try{i.style.color=J(t).replace(r,N);var e=o.queryCommandValue("ForeColor");return e=(255&e)<<16|65280&e|(16711680&e)>>>16,"#"+("000000"+e.toString(16)).slice(-6)}catch(n){return"none"}})}else{var l=S.doc.createElement("i");l.title="Rapha\u00ebl Colour Picker",l.style.display="none",S.doc.body.appendChild(l),ye=n(function(t){return l.style.color=t,S.doc.defaultView.getComputedStyle(l,N).getPropertyValue("color")})}return ye(e)},be=function(){return"hsb("+[this.h,this.s,this.b]+")"},xe=function(){return"hsl("+[this.h,this.s,this.l]+")"},we=function(){return this.hex},_e=function(e,i,n){if(null==i&&t.is(e,"object")&&"r"in e&&"g"in e&&"b"in e&&(n=e.b,i=e.g,e=e.r),null==i&&t.is(e,Y)){var r=t.getRGB(e);e=r.r,i=r.g,n=r.b}return(e>1||i>1||n>1)&&(e/=255,i/=255,n/=255),[e,i,n]},ke=function(e,i,n,r){e*=255,i*=255,n*=255;var a={r:e,g:i,b:n,hex:t.rgb(e,i,n),toString:we};return t.is(r,"finite")&&(a.opacity=r),a};t.color=function(e){var i;return t.is(e,"object")&&"h"in e&&"s"in e&&"b"in e?(i=t.hsb2rgb(e),e.r=i.r,e.g=i.g,e.b=i.b,e.hex=i.hex):t.is(e,"object")&&"h"in e&&"s"in e&&"l"in e?(i=t.hsl2rgb(e),e.r=i.r,e.g=i.g,e.b=i.b,e.hex=i.hex):(t.is(e,"string")&&(e=t.getRGB(e)),t.is(e,"object")&&"r"in e&&"g"in e&&"b"in e?(i=t.rgb2hsl(e),e.h=i.h,e.s=i.s,e.l=i.l,i=t.rgb2hsb(e),e.v=i.b):(e={hex:"none"},e.r=e.g=e.b=e.h=e.s=e.v=e.l=-1)),e.toString=we,e},t.hsb2rgb=function(t,e,i,n){this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(i=t.b,e=t.s,t=t.h,n=t.o),t*=360;var r,a,s,o,l;return t=t%360/60,l=i*e,o=l*(1-R(t%2-1)),r=a=s=i-l,t=~~t,r+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],ke(r,a,s,n)},t.hsl2rgb=function(t,e,i,n){this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(i=t.l,e=t.s,t=t.h),(t>1||e>1||i>1)&&(t/=360,e/=100,i/=100),t*=360;var r,a,s,o,l;return t=t%360/60,l=2*e*(.5>i?i:1-i),o=l*(1-R(t%2-1)),r=a=s=i-l/2,t=~~t,r+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],ke(r,a,s,n)},t.rgb2hsb=function(t,e,i){i=_e(t,e,i),t=i[0],e=i[1],i=i[2];var n,r,a,s;return a=F(t,e,i),s=a-O(t,e,i),n=0==s?null:a==t?(e-i)/s:a==e?(i-t)/s+2:(t-e)/s+4,n=60*((n+360)%6)/360,r=0==s?0:s/a,{h:n,s:r,b:a,toString:be}},t.rgb2hsl=function(t,e,i){i=_e(t,e,i),t=i[0],e=i[1],i=i[2];var n,r,a,s,o,l;return s=F(t,e,i),o=O(t,e,i),l=s-o,n=0==l?null:s==t?(e-i)/l:s==e?(i-t)/l+2:(t-e)/l+4,n=60*((n+360)%6)/360,a=(s+o)/2,r=0==l?0:.5>a?l/(2*a):l/(2-2*a),{h:n,s:r,l:a,toString:xe}},t._path2string=function(){return this.join(",").replace(re,"$1")},t._preload=function(t,e){var i=S.doc.createElement("img");i.style.cssText="position:absolute;left:-9999em;top:-9999em",i.onload=function(){e.call(this),this.onload=null,S.doc.body.removeChild(this)},i.onerror=function(){S.doc.body.removeChild(this)},S.doc.body.appendChild(i),i.src=t},t.getRGB=n(function(e){if(!e||(e=J(e)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:r};if("none"==e)return{r:-1,g:-1,b:-1,hex:"none",toString:r};!(ne[k](e.toLowerCase().substring(0,2))||"#"==e.charAt())&&(e=ye(e));var i,n,a,s,o,l,u=e.match(U);return u?(u[2]&&(a=G(u[2].substring(5),16),n=G(u[2].substring(3,5),16),i=G(u[2].substring(1,3),16)),u[3]&&(a=G((o=u[3].charAt(3))+o,16),n=G((o=u[3].charAt(2))+o,16),i=G((o=u[3].charAt(1))+o,16)),u[4]&&(l=u[4][$](ie),i=Q(l[0]),"%"==l[0].slice(-1)&&(i*=2.55),n=Q(l[1]),"%"==l[1].slice(-1)&&(n*=2.55),a=Q(l[2]),"%"==l[2].slice(-1)&&(a*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(s=Q(l[3])),l[3]&&"%"==l[3].slice(-1)&&(s/=100)),u[5]?(l=u[5][$](ie),i=Q(l[0]),"%"==l[0].slice(-1)&&(i*=2.55),n=Q(l[1]),"%"==l[1].slice(-1)&&(n*=2.55),a=Q(l[2]),"%"==l[2].slice(-1)&&(a*=2.55),("deg"==l[0].slice(-3)||"\u00b0"==l[0].slice(-1))&&(i/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(s=Q(l[3])),l[3]&&"%"==l[3].slice(-1)&&(s/=100),t.hsb2rgb(i,n,a,s)):u[6]?(l=u[6][$](ie),i=Q(l[0]),"%"==l[0].slice(-1)&&(i*=2.55),n=Q(l[1]),"%"==l[1].slice(-1)&&(n*=2.55),a=Q(l[2]),"%"==l[2].slice(-1)&&(a*=2.55),("deg"==l[0].slice(-3)||"\u00b0"==l[0].slice(-1))&&(i/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(s=Q(l[3])),l[3]&&"%"==l[3].slice(-1)&&(s/=100),t.hsl2rgb(i,n,a,s)):(u={r:i,g:n,b:a,toString:r},u.hex="#"+(16777216|a|n<<8|i<<16).toString(16).slice(1),t.is(s,"finite")&&(u.opacity=s),u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:r}},t),t.hsb=n(function(e,i,n){return t.hsb2rgb(e,i,n).hex}),t.hsl=n(function(e,i,n){return t.hsl2rgb(e,i,n).hex}),t.rgb=n(function(t,e,i){return"#"+(16777216|i|e<<8|t<<16).toString(16).slice(1)}),t.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},i=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,0>=e.s&&(this.getColor.start={h:0,s:1,b:e.b})),i.hex},t.getColor.reset=function(){delete this.start},t.parsePathString=function(e){if(!e)return null;var i=Se(e);if(i.arr)return De(i.arr);var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[];return t.is(e,W)&&t.is(e[0],W)&&(r=De(e)),r.length||J(e).replace(ae,function(t,e,i){var a=[],s=e.toLowerCase();if(i.replace(oe,function(t,e){e&&a.push(+e)}),"m"==s&&a.length>2&&(r.push([e][T](a.splice(0,2))),s="l",e="m"==e?"l":"L"),"r"==s)r.push([e][T](a));else for(;a.length>=n[s]&&(r.push([e][T](a.splice(0,n[s]))),n[s]););}),r.toString=t._path2string,i.arr=De(r),r},t.parseTransformString=n(function(e){if(!e)return null;var i=[];return t.is(e,W)&&t.is(e[0],W)&&(i=De(e)),i.length||J(e).replace(se,function(t,e,n){var r=[];L.call(e),n.replace(oe,function(t,e){e&&r.push(+e)}),i.push([e][T](r))}),i.toString=t._path2string,i});var Se=function(t){var e=Se.ps=Se.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var i in e)e[k](i)&&i!=t&&(e[i].sleep--,!e[i].sleep&&delete e[i])}),e[t]};t.findDotsAtSegment=function(t,e,i,n,r,a,s,o,l){var u=1-l,c=H(u,3),h=H(u,2),d=l*l,p=d*l,f=c*t+3*h*l*i+3*u*l*l*r+p*s,g=c*e+3*h*l*n+3*u*l*l*a+p*o,m=t+2*l*(i-t)+d*(r-2*i+t),v=e+2*l*(n-e)+d*(a-2*n+e),y=i+2*l*(r-i)+d*(s-2*r+i),b=n+2*l*(a-n)+d*(o-2*a+n),x=u*t+l*i,w=u*e+l*n,_=u*r+l*s,k=u*a+l*o,S=90-180*j.atan2(m-y,v-b)/B;return(m>y||b>v)&&(S+=180),{x:f,y:g,m:{x:m,y:v},n:{x:y,y:b},start:{x:x,y:w},end:{x:_,y:k},alpha:S}},t.bezierBBox=function(e,i,n,r,a,s,o,l){t.is(e,"array")||(e=[e,i,n,r,a,s,o,l]);var u=$e.apply(null,e);return{x:u.min.x,y:u.min.y,x2:u.max.x,y2:u.max.y,width:u.max.x-u.min.x,height:u.max.y-u.min.y}},t.isPointInsideBBox=function(t,e,i){return e>=t.x&&t.x2>=e&&i>=t.y&&t.y2>=i},t.isBBoxIntersect=function(e,i){var n=t.isPointInsideBBox;return n(i,e.x,e.y)||n(i,e.x2,e.y)||n(i,e.x,e.y2)||n(i,e.x2,e.y2)||n(e,i.x,i.y)||n(e,i.x2,i.y)||n(e,i.x,i.y2)||n(e,i.x2,i.y2)||(e.x<i.x2&&e.x>i.x||i.x<e.x2&&i.x>e.x)&&(e.y<i.y2&&e.y>i.y||i.y<e.y2&&i.y>e.y)},t.pathIntersection=function(t,e){return h(t,e)},t.pathIntersectionNumber=function(t,e){return h(t,e,1)},t.isPointInsidePath=function(e,i,n){var r=t.pathBBox(e);return t.isPointInsideBBox(r,i,n)&&1==h(e,[["M",i,n],["H",r.x2+10]],1)%2},t._removedFactory=function(t){return function(){eve("raphael.log",null,"Rapha\u00ebl: you are calling to method \u201c"+t+"\u201d of removed object",t)}};var Ae=t.pathBBox=function(t){var i=Se(t);if(i.bbox)return i.bbox;if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};t=Ee(t);for(var n,r=0,a=0,s=[],o=[],l=0,u=t.length;u>l;l++)if(n=t[l],"M"==n[0])r=n[1],a=n[2],s.push(r),o.push(a);else{var c=$e(r,a,n[1],n[2],n[3],n[4],n[5],n[6]);s=s[T](c.min.x,c.max.x),o=o[T](c.min.y,c.max.y),r=n[5],a=n[6]}var h=O[C](0,s),d=O[C](0,o),p=F[C](0,s),f=F[C](0,o),g={x:h,y:d,x2:p,y2:f,width:p-h,height:f-d};return i.bbox=e(g),g},De=function(i){var n=e(i);return n.toString=t._path2string,n},Ce=t._pathToRelative=function(e){var i=Se(e);if(i.rel)return De(i.rel);t.is(e,W)&&t.is(e&&e[0],W)||(e=t.parsePathString(e));var n=[],r=0,a=0,s=0,o=0,l=0;"M"==e[0][0]&&(r=e[0][1],a=e[0][2],s=r,o=a,l++,n.push(["M",r,a]));for(var u=l,c=e.length;c>u;u++){var h=n[u]=[],d=e[u];if(d[0]!=L.call(d[0]))switch(h[0]=L.call(d[0]),h[0]){case"a":h[1]=d[1],h[2]=d[2],h[3]=d[3],h[4]=d[4],h[5]=d[5],h[6]=+(d[6]-r).toFixed(3),h[7]=+(d[7]-a).toFixed(3);break;case"v":h[1]=+(d[1]-a).toFixed(3);break;case"m":s=d[1],o=d[2];default:for(var p=1,f=d.length;f>p;p++)h[p]=+(d[p]-(p%2?r:a)).toFixed(3)}else{h=n[u]=[],"m"==d[0]&&(s=d[1]+r,o=d[2]+a);for(var g=0,m=d.length;m>g;g++)n[u][g]=d[g]}var v=n[u].length;switch(n[u][0]){case"z":r=s,a=o;break;case"h":r+=+n[u][v-1];break;case"v":a+=+n[u][v-1];break;default:r+=+n[u][v-2],a+=+n[u][v-1]}}return n.toString=t._path2string,i.rel=De(n),n},Te=t._pathToAbsolute=function(e){var i=Se(e);if(i.abs)return De(i.abs);if(t.is(e,W)&&t.is(e&&e[0],W)||(e=t.parsePathString(e)),!e||!e.length)return[["M",0,0]];var n=[],r=0,s=0,o=0,l=0,u=0;"M"==e[0][0]&&(r=+e[0][1],s=+e[0][2],o=r,l=s,u++,n[0]=["M",r,s]);for(var c,h,d=3==e.length&&"M"==e[0][0]&&"R"==e[1][0].toUpperCase()&&"Z"==e[2][0].toUpperCase(),p=u,f=e.length;f>p;p++){if(n.push(c=[]),h=e[p],h[0]!=Z.call(h[0]))switch(c[0]=Z.call(h[0]),c[0]){case"A":c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5],c[6]=+(h[6]+r),c[7]=+(h[7]+s);break;case"V":c[1]=+h[1]+s;break;case"H":c[1]=+h[1]+r;break;case"R":for(var g=[r,s][T](h.slice(1)),m=2,v=g.length;v>m;m++)g[m]=+g[m]+r,g[++m]=+g[m]+s;n.pop(),n=n[T](a(g,d));break;case"M":o=+h[1]+r,l=+h[2]+s;default:for(m=1,v=h.length;v>m;m++)c[m]=+h[m]+(m%2?r:s)}else if("R"==h[0])g=[r,s][T](h.slice(1)),n.pop(),n=n[T](a(g,d)),c=["R"][T](h.slice(-2));else for(var y=0,b=h.length;b>y;y++)c[y]=h[y];switch(c[0]){case"Z":r=o,s=l;break;case"H":r=c[1];break;case"V":s=c[1];break;case"M":o=c[c.length-2],l=c[c.length-1];default:r=c[c.length-2],s=c[c.length-1]}}return n.toString=t._path2string,i.abs=De(n),n},Me=function(t,e,i,n){return[t,e,i,n,i,n]},Ne=function(t,e,i,n,r,a){var s=1/3,o=2/3;return[s*t+o*i,s*e+o*n,s*r+o*i,s*a+o*n,r,a]},Pe=function(t,e,i,r,a,s,o,l,u,c){var h,d=120*B/180,p=B/180*(+a||0),f=[],g=n(function(t,e,i){var n=t*j.cos(i)-e*j.sin(i),r=t*j.sin(i)+e*j.cos(i);return{x:n,y:r}});if(c)S=c[0],A=c[1],_=c[2],k=c[3];else{h=g(t,e,-p),t=h.x,e=h.y,h=g(l,u,-p),l=h.x,u=h.y;var m=(j.cos(B/180*a),j.sin(B/180*a),(t-l)/2),v=(e-u)/2,y=m*m/(i*i)+v*v/(r*r);y>1&&(y=j.sqrt(y),i=y*i,r=y*r);var b=i*i,x=r*r,w=(s==o?-1:1)*j.sqrt(R((b*x-b*v*v-x*m*m)/(b*v*v+x*m*m))),_=w*i*v/r+(t+l)/2,k=w*-r*m/i+(e+u)/2,S=j.asin(((e-k)/r).toFixed(9)),A=j.asin(((u-k)/r).toFixed(9));S=_>t?B-S:S,A=_>l?B-A:A,0>S&&(S=2*B+S),0>A&&(A=2*B+A),o&&S>A&&(S-=2*B),!o&&A>S&&(A-=2*B)}var D=A-S;if(R(D)>d){var C=A,M=l,N=u;A=S+d*(o&&A>S?1:-1),l=_+i*j.cos(A),u=k+r*j.sin(A),f=Pe(l,u,i,r,a,0,o,M,N,[A,C,_,k])}D=A-S;var P=j.cos(S),J=j.sin(S),E=j.cos(A),I=j.sin(A),L=j.tan(D/4),F=4/3*i*L,O=4/3*r*L,H=[t,e],z=[t+F*J,e-O*P],Y=[l+F*I,u-O*E],W=[l,u];if(z[0]=2*H[0]-z[0],z[1]=2*H[1]-z[1],c)return[z,Y,W][T](f);f=[z,Y,W][T](f).join()[$](",");for(var q=[],U=0,X=f.length;X>U;U++)q[U]=U%2?g(f[U-1],f[U],p).y:g(f[U],f[U+1],p).x;return q},Je=function(t,e,i,n,r,a,s,o,l){var u=1-l;return{x:H(u,3)*t+3*H(u,2)*l*i+3*u*l*l*r+H(l,3)*s,y:H(u,3)*e+3*H(u,2)*l*n+3*u*l*l*a+H(l,3)*o}},$e=n(function(t,e,i,n,r,a,s,o){var l,u=r-2*i+t-(s-2*r+i),c=2*(i-t)-2*(r-i),h=t-i,d=(-c+j.sqrt(c*c-4*u*h))/2/u,p=(-c-j.sqrt(c*c-4*u*h))/2/u,f=[e,o],g=[t,s];return R(d)>"1e12"&&(d=.5),R(p)>"1e12"&&(p=.5),d>0&&1>d&&(l=Je(t,e,i,n,r,a,s,o,d),g.push(l.x),f.push(l.y)),p>0&&1>p&&(l=Je(t,e,i,n,r,a,s,o,p),g.push(l.x),f.push(l.y)),u=a-2*n+e-(o-2*a+n),c=2*(n-e)-2*(a-n),h=e-n,d=(-c+j.sqrt(c*c-4*u*h))/2/u,p=(-c-j.sqrt(c*c-4*u*h))/2/u,R(d)>"1e12"&&(d=.5),R(p)>"1e12"&&(p=.5),d>0&&1>d&&(l=Je(t,e,i,n,r,a,s,o,d),g.push(l.x),f.push(l.y)),p>0&&1>p&&(l=Je(t,e,i,n,r,a,s,o,p),g.push(l.x),f.push(l.y)),{min:{x:O[C](0,g),y:O[C](0,f)},max:{x:F[C](0,g),y:F[C](0,f)}}}),Ee=t._path2curve=n(function(t,e){var i=!e&&Se(t);if(!e&&i.curve)return De(i.curve);for(var n=Te(t),r=e&&Te(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=(function(t,e){var i,n;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][T](Pe[C](0,[e.x,e.y][T](t.slice(1))));break;case"S":i=e.x+(e.x-(e.bx||e.x)),n=e.y+(e.y-(e.by||e.y)),t=["C",i,n][T](t.slice(1));break;case"T":e.qx=e.x+(e.x-(e.qx||e.x)),e.qy=e.y+(e.y-(e.qy||e.y)),t=["C"][T](Ne(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][T](Ne(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][T](Me(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][T](Me(e.x,e.y,t[1],e.y));break;case"V":t=["C"][T](Me(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][T](Me(e.x,e.y,e.X,e.Y))}return t}),l=function(t,e){if(t[e].length>7){t[e].shift();for(var i=t[e];i.length;)t.splice(e++,0,["C"][T](i.splice(0,6)));t.splice(e,1),h=F(n.length,r&&r.length||0)}},u=function(t,e,i,a,s){t&&e&&"M"==t[s][0]&&"M"!=e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),i.bx=0,i.by=0,i.x=t[s][1],i.y=t[s][2],h=F(n.length,r&&r.length||0))},c=0,h=F(n.length,r&&r.length||0);h>c;c++){n[c]=o(n[c],a),l(n,c),r&&(r[c]=o(r[c],s)),r&&l(r,c),u(n,r,a,s,c),u(r,n,s,a,c);var d=n[c],p=r&&r[c],f=d.length,g=r&&p.length;a.x=d[f-2],a.y=d[f-1],a.bx=Q(d[f-4])||a.x,a.by=Q(d[f-3])||a.y,s.bx=r&&(Q(p[g-4])||s.x),s.by=r&&(Q(p[g-3])||s.y),s.x=r&&p[g-2],s.y=r&&p[g-1]}return r||(i.curve=De(n)),r?[n,r]:n},null,De),Ie=(t._parseDots=n(function(e){for(var i=[],n=0,r=e.length;r>n;n++){var a={},s=e[n].match(/^([^:]*):?([\d\.]*)/);if(a.color=t.getRGB(s[1]),a.color.error)return null;a.color=a.color.hex,s[2]&&(a.offset=s[2]+"%"),i.push(a)}for(n=1,r=i.length-1;r>n;n++)if(!i[n].offset){for(var o=Q(i[n-1].offset||0),l=0,u=n+1;r>u;u++)if(i[u].offset){l=i[u].offset;break}l||(l=100,u=r),l=Q(l);for(var c=(l-o)/(u-n+1);u>n;n++)o+=c,i[n].offset=o+"%"}return i}),t._tear=function(t,e){t==e.top&&(e.top=t.prev),t==e.bottom&&(e.bottom=t.next),t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next)}),Le=(t._tofront=function(t,e){e.top!==t&&(Ie(t,e),t.next=null,t.prev=e.top,e.top.next=t,e.top=t)},t._toback=function(t,e){e.bottom!==t&&(Ie(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},t._insertafter=function(t,e,i){Ie(t,i),e==i.top&&(i.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},t._insertbefore=function(t,e,i){Ie(t,i),e==i.bottom&&(i.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},t.toMatrix=function(t,e){var i=Ae(t),n={_:{transform:N},getBBox:function(){return i}};return je(n,e),n.matrix}),je=(t.transformPath=function(t,e){return ge(t,Le(t,e))},t._extractTransform=function(e,i){if(null==i)return e._.transform;i=J(i).replace(/\.{3}|\u2026/g,e._.transform||N);var n=t.parseTransformString(i),r=0,a=0,s=0,o=1,l=1,u=e._,c=new d;if(u.transform=n||[],n)for(var h=0,p=n.length;p>h;h++){var f,g,m,v,y,b=n[h],x=b.length,w=J(b[0]).toLowerCase(),_=b[0]!=w,k=_?c.invert():0;"t"==w&&3==x?_?(f=k.x(0,0),g=k.y(0,0),m=k.x(b[1],b[2]),v=k.y(b[1],b[2]),c.translate(m-f,v-g)):c.translate(b[1],b[2]):"r"==w?2==x?(y=y||e.getBBox(1),c.rotate(b[1],y.x+y.width/2,y.y+y.height/2),r+=b[1]):4==x&&(_?(m=k.x(b[2],b[3]),v=k.y(b[2],b[3]),c.rotate(b[1],m,v)):c.rotate(b[1],b[2],b[3]),r+=b[1]):"s"==w?2==x||3==x?(y=y||e.getBBox(1),c.scale(b[1],b[x-1],y.x+y.width/2,y.y+y.height/2),o*=b[1],l*=b[x-1]):5==x&&(_?(m=k.x(b[3],b[4]),v=k.y(b[3],b[4]),c.scale(b[1],b[2],m,v)):c.scale(b[1],b[2],b[3],b[4]),o*=b[1],l*=b[2]):"m"==w&&7==x&&c.add(b[1],b[2],b[3],b[4],b[5],b[6]),u.dirtyT=1,e.matrix=c}e.matrix=c,u.sx=o,u.sy=l,u.deg=r,u.dx=a=c.e,u.dy=s=c.f,1==o&&1==l&&!r&&u.bbox?(u.bbox.x+=+a,u.bbox.y+=+s):u.dirtyT=1}),Fe=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},Oe=t._equaliseTransform=function(e,i){i=J(i).replace(/\.{3}|\u2026/g,e),e=t.parseTransformString(e)||[],i=t.parseTransformString(i)||[];for(var n,r,a,s,o=F(e.length,i.length),l=[],u=[],c=0;o>c;c++){if(a=e[c]||Fe(i[c]),s=i[c]||Fe(a),a[0]!=s[0]||"r"==a[0].toLowerCase()&&(a[2]!=s[2]||a[3]!=s[3])||"s"==a[0].toLowerCase()&&(a[3]!=s[3]||a[4]!=s[4]))return;for(l[c]=[],u[c]=[],n=0,r=F(a.length,s.length);r>n;n++)n in a&&(l[c][n]=a[n]),n in s&&(u[c][n]=s[n])}return{from:l,to:u}};t._getContainer=function(e,i,n,r){var a;return a=null!=r||t.is(e,"object")?e:S.doc.getElementById(e),null!=a?a.tagName?null==i?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:i,height:n}:{container:1,x:e,y:i,width:n,height:r}:void 0},t.pathToRelative=Ce,t._engine={},t.path2curve=Ee,t.matrix=function(t,e,i,n,r,a){return new d(t,e,i,n,r,a)},function(e){function i(t){return t[0]*t[0]+t[1]*t[1]}function n(t){var e=j.sqrt(i(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}e.add=function(t,e,i,n,r,a){var s,o,l,u,c=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],p=[[t,i,r],[e,n,a],[0,0,1]];for(t&&t instanceof d&&(p=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),s=0;3>s;s++)for(o=0;3>o;o++){for(u=0,l=0;3>l;l++)u+=h[s][l]*p[l][o];c[s][o]=u}this.a=c[0][0],this.b=c[1][0],this.c=c[0][1],this.d=c[1][1],this.e=c[0][2],this.f=c[1][2]},e.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new d(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},e.clone=function(){return new d(this.a,this.b,this.c,this.d,this.e,this.f)},e.translate=function(t,e){this.add(1,0,0,1,t,e)},e.scale=function(t,e,i,n){null==e&&(e=t),(i||n)&&this.add(1,0,0,1,i,n),this.add(t,0,0,e,0,0),(i||n)&&this.add(1,0,0,1,-i,-n)},e.rotate=function(e,i,n){e=t.rad(e),i=i||0,n=n||0;var r=+j.cos(e).toFixed(9),a=+j.sin(e).toFixed(9);this.add(r,a,-a,r,i,n),this.add(1,0,0,1,-i,-n)},e.x=function(t,e){return t*this.a+e*this.c+this.e},e.y=function(t,e){return t*this.b+e*this.d+this.f},e.get=function(t){return+this[J.fromCharCode(97+t)].toFixed(4)},e.toString=function(){return t.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},e.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},e.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},e.split=function(){var e={};e.dx=this.e,e.dy=this.f;var r=[[this.a,this.c],[this.b,this.d]];e.scalex=j.sqrt(i(r[0])),n(r[0]),e.shear=r[0][0]*r[1][0]+r[0][1]*r[1][1],r[1]=[r[1][0]-r[0][0]*e.shear,r[1][1]-r[0][1]*e.shear],e.scaley=j.sqrt(i(r[1])),n(r[1]),e.shear/=e.scaley;var a=-r[0][1],s=r[1][1];return 0>s?(e.rotate=t.deg(j.acos(s)),0>a&&(e.rotate=360-e.rotate)):e.rotate=t.deg(j.asin(a)),e.isSimple=!(+e.shear.toFixed(9)||e.scalex.toFixed(9)!=e.scaley.toFixed(9)&&e.rotate),e.isSuperSimple=!+e.shear.toFixed(9)&&e.scalex.toFixed(9)==e.scaley.toFixed(9)&&!e.rotate,e.noRotation=!+e.shear.toFixed(9)&&!e.rotate,e},e.toTransformString=function(t){var e=t||this[$]();return e.isSimple?(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[e.dx,e.dy]:N)+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:N)+(e.rotate?"r"+[e.rotate,0,0]:N)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(d.prototype);var Re=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);b.safari="Apple Computer, Inc."==navigator.vendor&&(Re&&4>Re[1]||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&Re&&8>Re[1]?function(){var t=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){t.remove()})}:ce;for(var He=function(){this.returnValue=!1},Be=function(){return this.originalEvent.preventDefault()},ze=function(){this.cancelBubble=!0},Ye=function(){return this.originalEvent.stopPropagation()},We=function(){return S.doc.addEventListener?function(t,e,i,n){var r=M&&I[e]?I[e]:e,a=function(r){var a=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,s=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft,o=r.clientX+s,l=r.clientY+a;if(M&&I[k](e))for(var u=0,c=r.targetTouches&&r.targetTouches.length;c>u;u++)if(r.targetTouches[u].target==t){var h=r;r=r.targetTouches[u],r.originalEvent=h,r.preventDefault=Be,r.stopPropagation=Ye;break}return i.call(n,r,o,l)};return t.addEventListener(r,a,!1),function(){return t.removeEventListener(r,a,!1),!0}}:S.doc.attachEvent?function(t,e,i,n){var r=function(t){t=t||S.win.event;var e=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,r=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft,a=t.clientX+r,s=t.clientY+e;return t.preventDefault=t.preventDefault||He,t.stopPropagation=t.stopPropagation||ze,i.call(n,t,a,s) };t.attachEvent("on"+e,r);var a=function(){return t.detachEvent("on"+e,r),!0};return a}:void 0}(),qe=[],Ue=function(t){for(var e,i=t.clientX,n=t.clientY,r=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,a=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft,s=qe.length;s--;){if(e=qe[s],M){for(var o,l=t.touches.length;l--;)if(o=t.touches[l],o.identifier==e.el._drag.id){i=o.clientX,n=o.clientY,(t.originalEvent?t.originalEvent:t).preventDefault();break}}else t.preventDefault();var u,c=e.el.node,h=c.nextSibling,d=c.parentNode,p=c.style.display;S.win.opera&&d.removeChild(c),c.style.display="none",u=e.el.paper.getElementByPoint(i,n),c.style.display=p,S.win.opera&&(h?d.insertBefore(c,h):d.appendChild(c)),u&&eve("raphael.drag.over."+e.el.id,e.el,u),i+=a,n+=r,eve("raphael.drag.move."+e.el.id,e.move_scope||e.el,i-e.el._drag.x,n-e.el._drag.y,i,n,t)}},Xe=function(e){t.unmousemove(Ue).unmouseup(Xe);for(var i,n=qe.length;n--;)i=qe[n],i.el._drag={},eve("raphael.drag.end."+i.el.id,i.end_scope||i.start_scope||i.move_scope||i.el,e);qe=[]},Ve=t.el={},Ke=E.length;Ke--;)(function(e){t[e]=Ve[e]=function(i,n){return t.is(i,"function")&&(this.events=this.events||[],this.events.push({name:e,f:i,unbind:We(this.shape||this.node||S.doc,e,i,n||this)})),this},t["un"+e]=Ve["un"+e]=function(t){for(var i=this.events||[],n=i.length;n--;)if(i[n].name==e&&i[n].f==t)return i[n].unbind(),i.splice(n,1),!i.length&&delete this.events,this;return this}})(E[Ke]);Ve.data=function(e,i){var n=le[this.id]=le[this.id]||{};if(1==arguments.length){if(t.is(e,"object")){for(var r in e)e[k](r)&&this.data(r,e[r]);return this}return eve("raphael.data.get."+this.id,this,n[e],e),n[e]}return n[e]=i,eve("raphael.data.set."+this.id,this,i,e),this},Ve.removeData=function(t){return null==t?le[this.id]={}:le[this.id]&&delete le[this.id][t],this},Ve.hover=function(t,e,i,n){return this.mouseover(t,i).mouseout(e,n||i)},Ve.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var Qe=[];Ve.drag=function(e,i,n,r,a,s){function o(o){(o.originalEvent||o).preventDefault();var l=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,u=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft;this._drag.x=o.clientX+u,this._drag.y=o.clientY+l,this._drag.id=o.identifier,!qe.length&&t.mousemove(Ue).mouseup(Xe),qe.push({el:this,move_scope:r,start_scope:a,end_scope:s}),i&&eve.on("raphael.drag.start."+this.id,i),e&&eve.on("raphael.drag.move."+this.id,e),n&&eve.on("raphael.drag.end."+this.id,n),eve("raphael.drag.start."+this.id,a||r||this,o.clientX+u,o.clientY+l,o)}return this._drag={},Qe.push({el:this,start:o}),this.mousedown(o),this},Ve.onDragOver=function(t){t?eve.on("raphael.drag.over."+this.id,t):eve.unbind("raphael.drag.over."+this.id)},Ve.undrag=function(){for(var e=Qe.length;e--;)Qe[e].el==this&&(this.unmousedown(Qe[e].start),Qe.splice(e,1),eve.unbind("raphael.drag.*."+this.id));!Qe.length&&t.unmousemove(Ue).unmouseup(Xe)},b.circle=function(e,i,n){var r=t._engine.circle(this,e||0,i||0,n||0);return this.__set__&&this.__set__.push(r),r},b.rect=function(e,i,n,r,a){var s=t._engine.rect(this,e||0,i||0,n||0,r||0,a||0);return this.__set__&&this.__set__.push(s),s},b.ellipse=function(e,i,n,r){var a=t._engine.ellipse(this,e||0,i||0,n||0,r||0);return this.__set__&&this.__set__.push(a),a},b.path=function(e){e&&!t.is(e,Y)&&!t.is(e[0],W)&&(e+=N);var i=t._engine.path(t.format[C](t,arguments),this);return this.__set__&&this.__set__.push(i),i},b.image=function(e,i,n,r,a){var s=t._engine.image(this,e||"about:blank",i||0,n||0,r||0,a||0);return this.__set__&&this.__set__.push(s),s},b.text=function(e,i,n){var r=t._engine.text(this,e||0,i||0,J(n));return this.__set__&&this.__set__.push(r),r},b.set=function(e){!t.is(e,"array")&&(e=Array.prototype.splice.call(arguments,0,arguments.length));var i=new ui(e);return this.__set__&&this.__set__.push(i),i},b.setStart=function(t){this.__set__=t||this.set()},b.setFinish=function(){var t=this.__set__;return delete this.__set__,t},b.setSize=function(e,i){return t._engine.setSize.call(this,e,i)},b.setViewBox=function(e,i,n,r,a){return t._engine.setViewBox.call(this,e,i,n,r,a)},b.top=b.bottom=null,b.raphael=t;var Ge=function(t){var e=t.getBoundingClientRect(),i=t.ownerDocument,n=i.body,r=i.documentElement,a=r.clientTop||n.clientTop||0,s=r.clientLeft||n.clientLeft||0,o=e.top+(S.win.pageYOffset||r.scrollTop||n.scrollTop)-a,l=e.left+(S.win.pageXOffset||r.scrollLeft||n.scrollLeft)-s;return{y:o,x:l}};b.getElementByPoint=function(t,e){var i=this,n=i.canvas,r=S.doc.elementFromPoint(t,e);if(S.win.opera&&"svg"==r.tagName){var a=Ge(n),s=n.createSVGRect();s.x=t-a.x,s.y=e-a.y,s.width=s.height=1;var o=n.getIntersectionList(s,null);o.length&&(r=o[o.length-1])}if(!r)return null;for(;r.parentNode&&r!=n.parentNode&&!r.raphael;)r=r.parentNode;return r==i.canvas.parentNode&&(r=n),r=r&&r.raphael?i.getById(r.raphaelid):null},b.getById=function(t){for(var e=this.bottom;e;){if(e.id==t)return e;e=e.next}return null},b.forEach=function(t,e){for(var i=this.bottom;i;){if(t.call(e,i)===!1)return this;i=i.next}return this},b.getElementsByPoint=function(t,e){var i=this.set();return this.forEach(function(n){n.isPointInside(t,e)&&i.push(n)}),i},Ve.isPointInside=function(e,i){var n=this.realPath=this.realPath||fe[this.type](this);return t.isPointInsidePath(n,e,i)},Ve.getBBox=function(t){if(this.removed)return{};var e=this._;return t?((e.dirty||!e.bboxwt)&&(this.realPath=fe[this.type](this),e.bboxwt=Ae(this.realPath),e.bboxwt.toString=p,e.dirty=0),e.bboxwt):((e.dirty||e.dirtyT||!e.bbox)&&((e.dirty||!this.realPath)&&(e.bboxwt=0,this.realPath=fe[this.type](this)),e.bbox=Ae(ge(this.realPath,this.matrix)),e.bbox.toString=p,e.dirty=e.dirtyT=0),e.bbox)},Ve.clone=function(){if(this.removed)return null;var t=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(t),t},Ve.glow=function(t){if("text"==this.type)return null;t=t||{};var e={width:(t.width||10)+(+this.attr("stroke-width")||1),fill:t.fill||!1,opacity:t.opacity||.5,offsetx:t.offsetx||0,offsety:t.offsety||0,color:t.color||"#000"},i=e.width/2,n=this.paper,r=n.set(),a=this.realPath||fe[this.type](this);a=this.matrix?ge(a,this.matrix):a;for(var s=1;i+1>s;s++)r.push(n.path(a).attr({stroke:e.color,fill:e.fill?e.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/i*s).toFixed(3),opacity:+(e.opacity/i).toFixed(3)}));return r.insertBefore(this).translate(e.offsetx,e.offsety)};var Ze=function(e,i,n,r,a,s,u,c,h){return null==h?o(e,i,n,r,a,s,u,c):t.findDotsAtSegment(e,i,n,r,a,s,u,c,l(e,i,n,r,a,s,u,c,h))},ti=function(e,i){return function(n,r,a){n=Ee(n);for(var s,o,l,u,c,h="",d={},p=0,f=0,g=n.length;g>f;f++){if(l=n[f],"M"==l[0])s=+l[1],o=+l[2];else{if(u=Ze(s,o,l[1],l[2],l[3],l[4],l[5],l[6]),p+u>r){if(i&&!d.start){if(c=Ze(s,o,l[1],l[2],l[3],l[4],l[5],l[6],r-p),h+=["C"+c.start.x,c.start.y,c.m.x,c.m.y,c.x,c.y],a)return h;d.start=h,h=["M"+c.x,c.y+"C"+c.n.x,c.n.y,c.end.x,c.end.y,l[5],l[6]].join(),p+=u,s=+l[5],o=+l[6];continue}if(!e&&!i)return c=Ze(s,o,l[1],l[2],l[3],l[4],l[5],l[6],r-p),{x:c.x,y:c.y,alpha:c.alpha}}p+=u,s=+l[5],o=+l[6]}h+=l.shift()+l}return d.end=h,c=e?p:i?d:t.findDotsAtSegment(s,o,l[0],l[1],l[2],l[3],l[4],l[5],1),c.alpha&&(c={x:c.x,y:c.y,alpha:c.alpha}),c}},ei=ti(1),ii=ti(),ni=ti(0,1);t.getTotalLength=ei,t.getPointAtLength=ii,t.getSubpath=function(t,e,i){if(1e-6>this.getTotalLength(t)-i)return ni(t,e).end;var n=ni(t,i,1);return e?ni(n,e).end:n},Ve.getTotalLength=function(){return"path"==this.type?this.node.getTotalLength?this.node.getTotalLength():ei(this.attrs.path):void 0},Ve.getPointAtLength=function(t){return"path"==this.type?ii(this.attrs.path,t):void 0},Ve.getSubpath=function(e,i){return"path"==this.type?t.getSubpath(this.attrs.path,e,i):void 0};var ri=t.easing_formulas={linear:function(t){return t},"<":function(t){return H(t,1.7)},">":function(t){return H(t,.48)},"<>":function(t){var e=.48-t/1.04,i=j.sqrt(.1734+e*e),n=i-e,r=H(R(n),1/3)*(0>n?-1:1),a=-i-e,s=H(R(a),1/3)*(0>a?-1:1),o=r+s+.5;return 3*(1-o)*o*o+o*o*o},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:H(2,-10*t)*j.sin((t-.075)*2*B/.3)+1},bounce:function(t){var e,i=7.5625,n=2.75;return 1/n>t?e=i*t*t:2/n>t?(t-=1.5/n,e=i*t*t+.75):2.5/n>t?(t-=2.25/n,e=i*t*t+.9375):(t-=2.625/n,e=i*t*t+.984375),e}};ri.easeIn=ri["ease-in"]=ri["<"],ri.easeOut=ri["ease-out"]=ri[">"],ri.easeInOut=ri["ease-in-out"]=ri["<>"],ri["back-in"]=ri.backIn,ri["back-out"]=ri.backOut;var ai=[],si=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},oi=function(){for(var e=+new Date,i=0;ai.length>i;i++){var n=ai[i];if(!n.el.removed&&!n.paused){var r,a,s=e-n.start,o=n.ms,l=n.easing,u=n.from,c=n.diff,h=n.to,d=(n.t,n.el),p={},f={};if(n.initstatus?(s=(n.initstatus*n.anim.top-n.prev)/(n.percent-n.prev)*o,n.status=n.initstatus,delete n.initstatus,n.stop&&ai.splice(i--,1)):n.status=(n.prev+(n.percent-n.prev)*(s/o))/n.anim.top,!(0>s))if(o>s){var g=l(s/o);for(var v in u)if(u[k](v)){switch(ee[v]){case z:r=+u[v]+g*o*c[v];break;case"colour":r="rgb("+[li(K(u[v].r+g*o*c[v].r)),li(K(u[v].g+g*o*c[v].g)),li(K(u[v].b+g*o*c[v].b))].join(",")+")";break;case"path":r=[];for(var y=0,b=u[v].length;b>y;y++){r[y]=[u[v][y][0]];for(var x=1,w=u[v][y].length;w>x;x++)r[y][x]=+u[v][y][x]+g*o*c[v][y][x];r[y]=r[y].join(P)}r=r.join(P);break;case"transform":if(c[v].real)for(r=[],y=0,b=u[v].length;b>y;y++)for(r[y]=[u[v][y][0]],x=1,w=u[v][y].length;w>x;x++)r[y][x]=u[v][y][x]+g*o*c[v][y][x];else{var _=function(t){return+u[v][t]+g*o*c[v][t]};r=[["m",_(0),_(1),_(2),_(3),_(4),_(5)]]}break;case"csv":if("clip-rect"==v)for(r=[],y=4;y--;)r[y]=+u[v][y]+g*o*c[v][y];break;default:var S=[][T](u[v]);for(r=[],y=d.paper.customAttributes[v].length;y--;)r[y]=+S[y]+g*o*c[v][y]}p[v]=r}d.attr(p),function(t,e,i){setTimeout(function(){eve("raphael.anim.frame."+t,e,i)})}(d.id,d,n.anim)}else{if(function(e,i,n){setTimeout(function(){eve("raphael.anim.frame."+i.id,i,n),eve("raphael.anim.finish."+i.id,i,n),t.is(e,"function")&&e.call(i)})}(n.callback,d,n.anim),d.attr(h),ai.splice(i--,1),n.repeat>1&&!n.next){for(a in h)h[k](a)&&(f[a]=n.totalOrigin[a]);n.el.attr(f),m(n.anim,n.el,n.anim.percents[0],null,n.totalOrigin,n.repeat-1)}n.next&&!n.stop&&m(n.anim,n.el,n.next,null,n.totalOrigin,n.repeat)}}}t.svg&&d&&d.paper&&d.paper.safari(),ai.length&&si(oi)},li=function(t){return t>255?255:0>t?0:t};Ve.animateWith=function(e,i,n,r,a,s){var o=this;if(o.removed)return s&&s.call(o),o;var l=n instanceof g?n:t.animation(n,r,a,s);m(l,o,l.percents[0],null,o.attr());for(var u=0,c=ai.length;c>u;u++)if(ai[u].anim==i&&ai[u].el==e){ai[c-1].start=ai[u].start;break}return o},Ve.onAnimation=function(t){return t?eve.on("raphael.anim.frame."+this.id,t):eve.unbind("raphael.anim.frame."+this.id),this},g.prototype.delay=function(t){var e=new g(this.anim,this.ms);return e.times=this.times,e.del=+t||0,e},g.prototype.repeat=function(t){var e=new g(this.anim,this.ms);return e.del=this.del,e.times=j.floor(F(t,0))||1,e},t.animation=function(e,i,n,r){if(e instanceof g)return e;(t.is(n,"function")||!n)&&(r=r||n||null,n=null),e=Object(e),i=+i||0;var a,s,o={};for(s in e)e[k](s)&&Q(s)!=s&&Q(s)+"%"!=s&&(a=!0,o[s]=e[s]);return a?(n&&(o.easing=n),r&&(o.callback=r),new g({100:o},i)):new g(e,i)},Ve.animate=function(e,i,n,r){var a=this;if(a.removed)return r&&r.call(a),a;var s=e instanceof g?e:t.animation(e,i,n,r);return m(s,a,s.percents[0],null,a.attr()),a},Ve.setTime=function(t,e){return t&&null!=e&&this.status(t,O(e,t.ms)/t.ms),this},Ve.status=function(t,e){var i,n,r=[],a=0;if(null!=e)return m(t,this,-1,O(e,1)),this;for(i=ai.length;i>a;a++)if(n=ai[a],n.el.id==this.id&&(!t||n.anim==t)){if(t)return n.status;r.push({anim:n.anim,status:n.status})}return t?0:r},Ve.pause=function(t){for(var e=0;ai.length>e;e++)ai[e].el.id!=this.id||t&&ai[e].anim!=t||eve("raphael.anim.pause."+this.id,this,ai[e].anim)!==!1&&(ai[e].paused=!0);return this},Ve.resume=function(t){for(var e=0;ai.length>e;e++)if(ai[e].el.id==this.id&&(!t||ai[e].anim==t)){var i=ai[e];eve("raphael.anim.resume."+this.id,this,i.anim)!==!1&&(delete i.paused,this.status(i.anim,i.status))}return this},Ve.stop=function(t){for(var e=0;ai.length>e;e++)ai[e].el.id!=this.id||t&&ai[e].anim!=t||eve("raphael.anim.stop."+this.id,this,ai[e].anim)!==!1&&ai.splice(e--,1);return this},eve.on("raphael.remove",v),eve.on("raphael.clear",v),Ve.toString=function(){return"Rapha\u00ebl\u2019s object"};var ui=function(t){if(this.items=[],this.length=0,this.type="set",t)for(var e=0,i=t.length;i>e;e++)!t[e]||t[e].constructor!=Ve.constructor&&t[e].constructor!=ui||(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)},ci=ui.prototype;ci.push=function(){for(var t,e,i=0,n=arguments.length;n>i;i++)t=arguments[i],!t||t.constructor!=Ve.constructor&&t.constructor!=ui||(e=this.items.length,this[e]=this.items[e]=t,this.length++);return this},ci.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},ci.forEach=function(t,e){for(var i=0,n=this.items.length;n>i;i++)if(t.call(e,this.items[i],i)===!1)return this;return this};for(var hi in Ve)Ve[k](hi)&&(ci[hi]=function(t){return function(){var e=arguments;return this.forEach(function(i){i[t][C](i,e)})}}(hi));ci.attr=function(e,i){if(e&&t.is(e,W)&&t.is(e[0],"object"))for(var n=0,r=e.length;r>n;n++)this.items[n].attr(e[n]);else for(var a=0,s=this.items.length;s>a;a++)this.items[a].attr(e,i);return this},ci.clear=function(){for(;this.length;)this.pop()},ci.splice=function(t,e){t=0>t?F(this.length+t,0):t,e=F(0,O(this.length-t,e));var i,n=[],r=[],a=[];for(i=2;arguments.length>i;i++)a.push(arguments[i]);for(i=0;e>i;i++)r.push(this[t+i]);for(;this.length-t>i;i++)n.push(this[t+i]);var s=a.length;for(i=0;s+n.length>i;i++)this.items[t+i]=this[t+i]=s>i?a[i]:n[i-s];for(i=this.items.length=this.length-=e-s;this[i];)delete this[i++];return new ui(r)},ci.exclude=function(t){for(var e=0,i=this.length;i>e;e++)if(this[e]==t)return this.splice(e,1),!0},ci.animate=function(e,i,n,r){(t.is(n,"function")||!n)&&(r=n||null);var a,s,o=this.items.length,l=o,u=this;if(!o)return this;r&&(s=function(){!--o&&r.call(u)}),n=t.is(n,Y)?n:s;var c=t.animation(e,i,n,s);for(a=this.items[--l].animate(c);l--;)this.items[l]&&!this.items[l].removed&&this.items[l].animateWith(a,c,c);return this},ci.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},ci.getBBox=function(){for(var t=[],e=[],i=[],n=[],r=this.items.length;r--;)if(!this.items[r].removed){var a=this.items[r].getBBox();t.push(a.x),e.push(a.y),i.push(a.x+a.width),n.push(a.y+a.height)}return t=O[C](0,t),e=O[C](0,e),i=F[C](0,i),n=F[C](0,n),{x:t,y:e,x2:i,y2:n,width:i-t,height:n-e}},ci.clone=function(t){t=new ui;for(var e=0,i=this.items.length;i>e;e++)t.push(this.items[e].clone());return t},ci.toString=function(){return"Rapha\u00ebl\u2018s set"},t.registerFont=function(t){if(!t.face)return t;this.fonts=this.fonts||{};var e={w:t.w,face:{},glyphs:{}},i=t.face["font-family"];for(var n in t.face)t.face[k](n)&&(e.face[n]=t.face[n]);if(this.fonts[i]?this.fonts[i].push(e):this.fonts[i]=[e],!t.svg){e.face["units-per-em"]=G(t.face["units-per-em"],10);for(var r in t.glyphs)if(t.glyphs[k](r)){var a=t.glyphs[r];if(e.glyphs[r]={w:a.w,k:{},d:a.d&&"M"+a.d.replace(/[mlcxtrv]/g,function(t){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[t]||"M"})+"z"},a.k)for(var s in a.k)a[k](s)&&(e.glyphs[r].k[s]=a.k[s])}}return t},b.getFont=function(e,i,n,r){if(r=r||"normal",n=n||"normal",i=+i||{normal:400,bold:700,lighter:300,bolder:800}[i]||400,t.fonts){var a=t.fonts[e];if(!a){var s=RegExp("(^|\\s)"+e.replace(/[^\w\d\s+!~.:_-]/g,N)+"(\\s|$)","i");for(var o in t.fonts)if(t.fonts[k](o)&&s.test(o)){a=t.fonts[o];break}}var l;if(a)for(var u=0,c=a.length;c>u&&(l=a[u],l.face["font-weight"]!=i||l.face["font-style"]!=n&&l.face["font-style"]||l.face["font-stretch"]!=r);u++);return l}},b.print=function(e,i,n,r,a,s,o){s=s||"middle",o=F(O(o||0,1),-1);var l,u=J(n)[$](N),c=0,h=0,d=N;if(t.is(r,n)&&(r=this.getFont(r)),r){l=(a||16)/r.face["units-per-em"];for(var p=r.face.bbox[$](x),f=+p[0],g=p[3]-p[1],m=0,v=+p[1]+("baseline"==s?g+ +r.face.descent:g/2),y=0,b=u.length;b>y;y++){if("\n"==u[y])c=0,_=0,h=0,m+=g;else{var w=h&&r.glyphs[u[y-1]]||{},_=r.glyphs[u[y]];c+=h?(w.w||r.w)+(w.k&&w.k[u[y]]||0)+r.w*o:0,h=1}_&&_.d&&(d+=t.transformPath(_.d,["t",c*l,m*l,"s",l,l,f,v,"t",(e-f)/l,(i-v)/l]))}}return this.path(d).attr({fill:"#000",stroke:"none"})},b.add=function(e){if(t.is(e,"array"))for(var i,n=this.set(),r=0,a=e.length;a>r;r++)i=e[r]||{},w[k](i.type)&&n.push(this[i.type]().attr(i));return n},t.format=function(e,i){var n=t.is(i,W)?[0][T](i):arguments;return e&&t.is(e,Y)&&n.length-1&&(e=e.replace(_,function(t,e){return null==n[++e]?N:n[e]})),e||N},t.fullfill=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,i=function(t,i,n){var r=n;return i.replace(e,function(t,e,i,n,a){e=e||n,r&&(e in r&&(r=r[e]),"function"==typeof r&&a&&(r=r()))}),r=(null==r||r==n?t:r)+""};return function(e,n){return(e+"").replace(t,function(t,e){return i(t,e,n)})}}(),t.ninja=function(){return A.was?S.win.Raphael=A.is:delete Raphael,t},t.st=ci,function(e,i,n){function r(){/in/.test(e.readyState)?setTimeout(r,9):t.eve("raphael.DOMload")}null==e.readyState&&e.addEventListener&&(e.addEventListener(i,n=function(){e.removeEventListener(i,n,!1),e.readyState="complete"},!1),e.readyState="loading"),r()}(document,"DOMContentLoaded"),A.was?S.win.Raphael=t:Raphael=t,eve.on("raphael.DOMload",function(){y=!0})}(),window.Raphael&&window.Raphael.svg&&function(t){var e="hasOwnProperty",i=String,n=parseFloat,r=parseInt,a=Math,s=a.max,o=a.abs,l=a.pow,u=/[, ]+/,c=t.eve,h="",d=" ",p="http://www.w3.org/1999/xlink",f={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},g={};t.toString=function(){return"Your browser supports SVG.\nYou are running Rapha\u00ebl "+this.version};var m=function(n,r){if(r){"string"==typeof n&&(n=m(n));for(var a in r)r[e](a)&&("xlink:"==a.substring(0,6)?n.setAttributeNS(p,a.substring(6),i(r[a])):n.setAttribute(a,i(r[a])))}else n=t._g.doc.createElementNS("http://www.w3.org/2000/svg",n),n.style&&(n.style.webkitTapHighlightColor="rgba(0,0,0,0)");return n},v=function(e,r){var u="linear",c=e.id+r,d=.5,p=.5,f=e.node,g=e.paper,v=f.style,y=t._g.doc.getElementById(c);if(!y){if(r=i(r).replace(t._radial_gradient,function(t,e,i){if(u="radial",e&&i){d=n(e),p=n(i);var r=2*(p>.5)-1;l(d-.5,2)+l(p-.5,2)>.25&&(p=a.sqrt(.25-l(d-.5,2))*r+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*r)}return h}),r=r.split(/\s*\-\s*/),"linear"==u){var b=r.shift();if(b=-n(b),isNaN(b))return null;var x=[0,0,a.cos(t.rad(b)),a.sin(t.rad(b))],w=1/(s(o(x[2]),o(x[3]))||1);x[2]*=w,x[3]*=w,0>x[2]&&(x[0]=-x[2],x[2]=0),0>x[3]&&(x[1]=-x[3],x[3]=0)}var _=t._parseDots(r);if(!_)return null;if(c=c.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&c!=e.gradient.id&&(g.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){y=m(u+"Gradient",{id:c}),e.gradient=y,m(y,"radial"==u?{fx:d,fy:p}:{x1:x[0],y1:x[1],x2:x[2],y2:x[3],gradientTransform:e.matrix.invert()}),g.defs.appendChild(y);for(var k=0,S=_.length;S>k;k++)y.appendChild(m("stop",{offset:_[k].offset?_[k].offset:k?"100%":"0%","stop-color":_[k].color||"#fff"}))}}return m(f,{fill:"url(#"+c+")",opacity:1,"fill-opacity":1}),v.fill=h,v.opacity=1,v.fillOpacity=1,1},y=function(t){var e=t.getBBox(1);m(t.pattern,{patternTransform:t.matrix.invert()+" translate("+e.x+","+e.y+")"})},b=function(n,r,a){if("path"==n.type){for(var s,o,l,u,c,d=i(r).toLowerCase().split("-"),p=n.paper,v=a?"end":"start",y=n.node,b=n.attrs,x=b["stroke-width"],w=d.length,_="classic",k=3,S=3,A=5;w--;)switch(d[w]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":_=d[w];break;case"wide":S=5;break;case"narrow":S=2;break;case"long":k=5;break;case"short":k=2}if("open"==_?(k+=2,S+=2,A+=2,l=1,u=a?4:1,c={fill:"none",stroke:b.stroke}):(u=l=k/2,c={fill:b.stroke,stroke:"none"}),n._.arrows?a?(n._.arrows.endPath&&g[n._.arrows.endPath]--,n._.arrows.endMarker&&g[n._.arrows.endMarker]--):(n._.arrows.startPath&&g[n._.arrows.startPath]--,n._.arrows.startMarker&&g[n._.arrows.startMarker]--):n._.arrows={},"none"!=_){var D="raphael-marker-"+_,C="raphael-marker-"+v+_+k+S;t._g.doc.getElementById(D)?g[D]++:(p.defs.appendChild(m(m("path"),{"stroke-linecap":"round",d:f[_],id:D})),g[D]=1);var T,M=t._g.doc.getElementById(C);M?(g[C]++,T=M.getElementsByTagName("use")[0]):(M=m(m("marker"),{id:C,markerHeight:S,markerWidth:k,orient:"auto",refX:u,refY:S/2}),T=m(m("use"),{"xlink:href":"#"+D,transform:(a?"rotate(180 "+k/2+" "+S/2+") ":h)+"scale("+k/A+","+S/A+")","stroke-width":(1/((k/A+S/A)/2)).toFixed(4)}),M.appendChild(T),p.defs.appendChild(M),g[C]=1),m(T,c);var N=l*("diamond"!=_&&"oval"!=_);a?(s=n._.arrows.startdx*x||0,o=t.getTotalLength(b.path)-N*x):(s=N*x,o=t.getTotalLength(b.path)-(n._.arrows.enddx*x||0)),c={},c["marker-"+v]="url(#"+C+")",(o||s)&&(c.d=Raphael.getSubpath(b.path,s,o)),m(y,c),n._.arrows[v+"Path"]=D,n._.arrows[v+"Marker"]=C,n._.arrows[v+"dx"]=N,n._.arrows[v+"Type"]=_,n._.arrows[v+"String"]=r}else a?(s=n._.arrows.startdx*x||0,o=t.getTotalLength(b.path)-s):(s=0,o=t.getTotalLength(b.path)-(n._.arrows.enddx*x||0)),n._.arrows[v+"Path"]&&m(y,{d:Raphael.getSubpath(b.path,s,o)}),delete n._.arrows[v+"Path"],delete n._.arrows[v+"Marker"],delete n._.arrows[v+"dx"],delete n._.arrows[v+"Type"],delete n._.arrows[v+"String"];for(c in g)if(g[e](c)&&!g[c]){var P=t._g.doc.getElementById(c);P&&P.parentNode.removeChild(P)}}},x={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},w=function(t,e,n){if(e=x[i(e).toLowerCase()]){for(var r=t.attrs["stroke-width"]||"1",a={round:r,square:r,butt:0}[t.attrs["stroke-linecap"]||n["stroke-linecap"]]||0,s=[],o=e.length;o--;)s[o]=e[o]*r+(o%2?1:-1)*a;m(t.node,{"stroke-dasharray":s.join(",")})}},_=function(n,a){var l=n.node,c=n.attrs,d=l.style.visibility;l.style.visibility="hidden";for(var f in a)if(a[e](f)){if(!t._availableAttrs[e](f))continue;var g=a[f];switch(c[f]=g,f){case"blur":n.blur(g);break;case"href":case"title":case"target":var x=l.parentNode;if("a"!=x.tagName.toLowerCase()){var _=m("a");x.insertBefore(_,l),_.appendChild(l),x=_}"target"==f?x.setAttributeNS(p,"show","blank"==g?"new":g):x.setAttributeNS(p,f,g);break;case"cursor":l.style.cursor=g;break;case"transform":n.transform(g);break;case"arrow-start":b(n,g);break;case"arrow-end":b(n,g,1);break;case"clip-rect":var k=i(g).split(u);if(4==k.length){n.clip&&n.clip.parentNode.parentNode.removeChild(n.clip.parentNode);var A=m("clipPath"),D=m("rect");A.id=t.createUUID(),m(D,{x:k[0],y:k[1],width:k[2],height:k[3]}),A.appendChild(D),n.paper.defs.appendChild(A),m(l,{"clip-path":"url(#"+A.id+")"}),n.clip=D}if(!g){var C=l.getAttribute("clip-path");if(C){var T=t._g.doc.getElementById(C.replace(/(^url\(#|\)$)/g,h));T&&T.parentNode.removeChild(T),m(l,{"clip-path":h}),delete n.clip}}break;case"path":"path"==n.type&&(m(l,{d:g?c.path=t._pathToAbsolute(g):"M0,0"}),n._.dirty=1,n._.arrows&&("startString"in n._.arrows&&b(n,n._.arrows.startString),"endString"in n._.arrows&&b(n,n._.arrows.endString,1)));break;case"width":if(l.setAttribute(f,g),n._.dirty=1,!c.fx)break;f="x",g=c.x;case"x":c.fx&&(g=-c.x-(c.width||0));case"rx":if("rx"==f&&"rect"==n.type)break;case"cx":l.setAttribute(f,g),n.pattern&&y(n),n._.dirty=1;break;case"height":if(l.setAttribute(f,g),n._.dirty=1,!c.fy)break;f="y",g=c.y;case"y":c.fy&&(g=-c.y-(c.height||0));case"ry":if("ry"==f&&"rect"==n.type)break;case"cy":l.setAttribute(f,g),n.pattern&&y(n),n._.dirty=1;break;case"r":"rect"==n.type?m(l,{rx:g,ry:g}):l.setAttribute(f,g),n._.dirty=1;break;case"src":"image"==n.type&&l.setAttributeNS(p,"href",g);break;case"stroke-width":(1!=n._.sx||1!=n._.sy)&&(g/=s(o(n._.sx),o(n._.sy))||1),n.paper._vbSize&&(g*=n.paper._vbSize),l.setAttribute(f,g),c["stroke-dasharray"]&&w(n,c["stroke-dasharray"],a),n._.arrows&&("startString"in n._.arrows&&b(n,n._.arrows.startString),"endString"in n._.arrows&&b(n,n._.arrows.endString,1));break;case"stroke-dasharray":w(n,g,a);break;case"fill":var M=i(g).match(t._ISURL);if(M){A=m("pattern");var N=m("image");A.id=t.createUUID(),m(A,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(N,{x:0,y:0,"xlink:href":M[1]}),A.appendChild(N),function(e){t._preload(M[1],function(){var t=this.offsetWidth,i=this.offsetHeight;m(e,{width:t,height:i}),m(N,{width:t,height:i}),n.paper.safari()})}(A),n.paper.defs.appendChild(A),m(l,{fill:"url(#"+A.id+")"}),n.pattern=A,n.pattern&&y(n);break}var P=t.getRGB(g);if(P.error){if(("circle"==n.type||"ellipse"==n.type||"r"!=i(g).charAt())&&v(n,g)){if("opacity"in c||"fill-opacity"in c){var J=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h));if(J){var $=J.getElementsByTagName("stop");m($[$.length-1],{"stop-opacity":("opacity"in c?c.opacity:1)*("fill-opacity"in c?c["fill-opacity"]:1)})}}c.gradient=g,c.fill="none";break}}else delete a.gradient,delete c.gradient,!t.is(c.opacity,"undefined")&&t.is(a.opacity,"undefined")&&m(l,{opacity:c.opacity}),!t.is(c["fill-opacity"],"undefined")&&t.is(a["fill-opacity"],"undefined")&&m(l,{"fill-opacity":c["fill-opacity"]});P[e]("opacity")&&m(l,{"fill-opacity":P.opacity>1?P.opacity/100:P.opacity});case"stroke":P=t.getRGB(g),l.setAttribute(f,P.hex),"stroke"==f&&P[e]("opacity")&&m(l,{"stroke-opacity":P.opacity>1?P.opacity/100:P.opacity}),"stroke"==f&&n._.arrows&&("startString"in n._.arrows&&b(n,n._.arrows.startString),"endString"in n._.arrows&&b(n,n._.arrows.endString,1));break;case"gradient":("circle"==n.type||"ellipse"==n.type||"r"!=i(g).charAt())&&v(n,g);break;case"opacity":c.gradient&&!c[e]("stroke-opacity")&&m(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(c.gradient){J=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h)),J&&($=J.getElementsByTagName("stop"),m($[$.length-1],{"stop-opacity":g}));break}default:"font-size"==f&&(g=r(g,10)+"px");var E=f.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[E]=g,n._.dirty=1,l.setAttribute(f,g)}}S(n,a),l.style.visibility=d},k=1.2,S=function(n,a){if("text"==n.type&&(a[e]("text")||a[e]("font")||a[e]("font-size")||a[e]("x")||a[e]("y"))){var s=n.attrs,o=n.node,l=o.firstChild?r(t._g.doc.defaultView.getComputedStyle(o.firstChild,h).getPropertyValue("font-size"),10):10;if(a[e]("text")){for(s.text=a.text;o.firstChild;)o.removeChild(o.firstChild);for(var u,c=i(a.text).split("\n"),d=[],p=0,f=c.length;f>p;p++)u=m("tspan"),p&&m(u,{dy:l*k,x:s.x}),u.appendChild(t._g.doc.createTextNode(c[p])),o.appendChild(u),d[p]=u}else for(d=o.getElementsByTagName("tspan"),p=0,f=d.length;f>p;p++)p?m(d[p],{dy:l*k,x:s.x}):m(d[0],{dy:0});m(o,{x:s.x,y:s.y}),n._.dirty=1;var g=n._getBBox(),v=s.y-(g.y+g.height/2);v&&t.is(v,"finite")&&m(d[0],{dy:v})}},A=function(e,i){this[0]=this.node=e,e.raphael=!0,this.id=t._oid++,e.raphaelid=this.id,this.matrix=t.matrix(),this.realPath=null,this.paper=i,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!i.bottom&&(i.bottom=this),this.prev=i.top,i.top&&(i.top.next=this),i.top=this,this.next=null},D=t.el;A.prototype=D,D.constructor=A,t._engine.path=function(t,e){var i=m("path");e.canvas&&e.canvas.appendChild(i);var n=new A(i,e);return n.type="path",_(n,{fill:"none",stroke:"#000",path:t}),n},D.rotate=function(t,e,r){if(this.removed)return this;if(t=i(t).split(u),t.length-1&&(e=n(t[1]),r=n(t[2])),t=n(t[0]),null==r&&(e=r),null==e||null==r){var a=this.getBBox(1);e=a.x+a.width/2,r=a.y+a.height/2}return this.transform(this._.transform.concat([["r",t,e,r]])),this},D.scale=function(t,e,r,a){if(this.removed)return this;if(t=i(t).split(u),t.length-1&&(e=n(t[1]),r=n(t[2]),a=n(t[3])),t=n(t[0]),null==e&&(e=t),null==a&&(r=a),null==r||null==a)var s=this.getBBox(1);return r=null==r?s.x+s.width/2:r,a=null==a?s.y+s.height/2:a,this.transform(this._.transform.concat([["s",t,e,r,a]])),this},D.translate=function(t,e){return this.removed?this:(t=i(t).split(u),t.length-1&&(e=n(t[1])),t=n(t[0])||0,e=+e||0,this.transform(this._.transform.concat([["t",t,e]])),this)},D.transform=function(i){var n=this._;if(null==i)return n.transform;if(t._extractTransform(this,i),this.clip&&m(this.clip,{transform:this.matrix.invert()}),this.pattern&&y(this),this.node&&m(this.node,{transform:this.matrix}),1!=n.sx||1!=n.sy){var r=this.attrs[e]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":r})}return this},D.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},D.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},D.remove=function(){if(!this.removed&&this.node.parentNode){var e=this.paper;e.__set__&&e.__set__.exclude(this),c.unbind("raphael.*.*."+this.id),this.gradient&&e.defs.removeChild(this.gradient),t._tear(this,e),"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var i in this)this[i]="function"==typeof this[i]?t._removedFactory(i):null;this.removed=!0}},D._getBBox=function(){if("none"==this.node.style.display){this.show();var t=!0}var e={};try{e=this.node.getBBox()}catch(i){}finally{e=e||{}}return t&&this.hide(),e},D.attr=function(i,n){if(this.removed)return this;if(null==i){var r={};for(var a in this.attrs)this.attrs[e](a)&&(r[a]=this.attrs[a]);return r.gradient&&"none"==r.fill&&(r.fill=r.gradient)&&delete r.gradient,r.transform=this._.transform,r}if(null==n&&t.is(i,"string")){if("fill"==i&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==i)return this._.transform;for(var s=i.split(u),o={},l=0,h=s.length;h>l;l++)i=s[l],o[i]=i in this.attrs?this.attrs[i]:t.is(this.paper.customAttributes[i],"function")?this.paper.customAttributes[i].def:t._availableAttrs[i];return h-1?o:o[s[0]]}if(null==n&&t.is(i,"array")){for(o={},l=0,h=i.length;h>l;l++)o[i[l]]=this.attr(i[l]);return o}if(null!=n){var d={};d[i]=n}else null!=i&&t.is(i,"object")&&(d=i);for(var p in d)c("raphael.attr."+p+"."+this.id,this,d[p]);for(p in this.paper.customAttributes)if(this.paper.customAttributes[e](p)&&d[e](p)&&t.is(this.paper.customAttributes[p],"function")){var f=this.paper.customAttributes[p].apply(this,[].concat(d[p]));this.attrs[p]=d[p];for(var g in f)f[e](g)&&(d[g]=f[g])}return _(this,d),this},D.toFront=function(){if(this.removed)return this;"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.appendChild(this.node.parentNode):this.node.parentNode.appendChild(this.node);var e=this.paper;return e.top!=this&&t._tofront(this,e),this},D.toBack=function(){if(this.removed)return this;var e=this.node.parentNode;return"a"==e.tagName.toLowerCase()?e.parentNode.insertBefore(this.node.parentNode,this.node.parentNode.parentNode.firstChild):e.firstChild!=this.node&&e.insertBefore(this.node,this.node.parentNode.firstChild),t._toback(this,this.paper),this.paper,this},D.insertAfter=function(e){if(this.removed)return this;var i=e.node||e[e.length-1].node;return i.nextSibling?i.parentNode.insertBefore(this.node,i.nextSibling):i.parentNode.appendChild(this.node),t._insertafter(this,e,this.paper),this},D.insertBefore=function(e){if(this.removed)return this;var i=e.node||e[0].node;return i.parentNode.insertBefore(this.node,i),t._insertbefore(this,e,this.paper),this},D.blur=function(e){var i=this;if(0!==+e){var n=m("filter"),r=m("feGaussianBlur");i.attrs.blur=e,n.id=t.createUUID(),m(r,{stdDeviation:+e||1.5}),n.appendChild(r),i.paper.defs.appendChild(n),i._blur=n,m(i.node,{filter:"url(#"+n.id+")"})}else i._blur&&(i._blur.parentNode.removeChild(i._blur),delete i._blur,delete i.attrs.blur),i.node.removeAttribute("filter")},t._engine.circle=function(t,e,i,n){var r=m("circle");t.canvas&&t.canvas.appendChild(r); var a=new A(r,t);return a.attrs={cx:e,cy:i,r:n,fill:"none",stroke:"#000"},a.type="circle",m(r,a.attrs),a},t._engine.rect=function(t,e,i,n,r,a){var s=m("rect");t.canvas&&t.canvas.appendChild(s);var o=new A(s,t);return o.attrs={x:e,y:i,width:n,height:r,r:a||0,rx:a||0,ry:a||0,fill:"none",stroke:"#000"},o.type="rect",m(s,o.attrs),o},t._engine.ellipse=function(t,e,i,n,r){var a=m("ellipse");t.canvas&&t.canvas.appendChild(a);var s=new A(a,t);return s.attrs={cx:e,cy:i,rx:n,ry:r,fill:"none",stroke:"#000"},s.type="ellipse",m(a,s.attrs),s},t._engine.image=function(t,e,i,n,r,a){var s=m("image");m(s,{x:i,y:n,width:r,height:a,preserveAspectRatio:"none"}),s.setAttributeNS(p,"href",e),t.canvas&&t.canvas.appendChild(s);var o=new A(s,t);return o.attrs={x:i,y:n,width:r,height:a,src:e},o.type="image",o},t._engine.text=function(e,i,n,r){var a=m("text");e.canvas&&e.canvas.appendChild(a);var s=new A(a,e);return s.attrs={x:i,y:n,"text-anchor":"middle",text:r,font:t._availableAttrs.font,stroke:"none",fill:"#000"},s.type="text",_(s,s.attrs),s},t._engine.setSize=function(t,e){return this.width=t||this.width,this.height=e||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},t._engine.create=function(){var e=t._getContainer.apply(0,arguments),i=e&&e.container,n=e.x,r=e.y,a=e.width,s=e.height;if(!i)throw Error("SVG container not found.");var o,l=m("svg"),u="overflow:hidden;";return n=n||0,r=r||0,a=a||512,s=s||342,m(l,{height:s,version:1.1,width:a,xmlns:"http://www.w3.org/2000/svg"}),1==i?(l.style.cssText=u+"position:absolute;left:"+n+"px;top:"+r+"px",t._g.doc.body.appendChild(l),o=1):(l.style.cssText=u+"position:relative",i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l)),i=new t._Paper,i.width=a,i.height=s,i.canvas=l,i.clear(),i._left=i._top=0,o&&(i.renderfix=function(){}),i.renderfix(),i},t._engine.setViewBox=function(t,e,i,n,r){c("raphael.setViewBox",this,this._viewBox,[t,e,i,n,r]);var a,o,l=s(i/this.width,n/this.height),u=this.top,h=r?"meet":"xMinYMin";for(null==t?(this._vbSize&&(l=1),delete this._vbSize,a="0 0 "+this.width+d+this.height):(this._vbSize=l,a=t+d+e+d+i+d+n),m(this.canvas,{viewBox:a,preserveAspectRatio:h});l&&u;)o="stroke-width"in u.attrs?u.attrs["stroke-width"]:1,u.attr({"stroke-width":o}),u._.dirty=1,u._.dirtyT=1,u=u.prev;return this._viewBox=[t,e,i,n,!!r],this},t.prototype.renderfix=function(){var t,e=this.canvas,i=e.style;try{t=e.getScreenCTM()||e.createSVGMatrix()}catch(n){t=e.createSVGMatrix()}var r=-t.e%1,a=-t.f%1;(r||a)&&(r&&(this._left=(this._left+r)%1,i.left=this._left+"px"),a&&(this._top=(this._top+a)%1,i.top=this._top+"px"))},t.prototype.clear=function(){t.eve("raphael.clear",this);for(var e=this.canvas;e.firstChild;)e.removeChild(e.firstChild);this.bottom=this.top=null,(this.desc=m("desc")).appendChild(t._g.doc.createTextNode("Created with Rapha\u00ebl "+t.version)),e.appendChild(this.desc),e.appendChild(this.defs=m("defs"))},t.prototype.remove=function(){c("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null};var C=t.st;for(var T in D)D[e](T)&&!C[e](T)&&(C[T]=function(t){return function(){var e=arguments;return this.forEach(function(i){i[t].apply(i,e)})}}(T))}(window.Raphael),window.Raphael&&window.Raphael.vml&&function(t){var e="hasOwnProperty",i=String,n=parseFloat,r=Math,a=r.round,s=r.max,o=r.min,l=r.abs,u="fill",c=/[, ]+/,h=t.eve,d=" progid:DXImageTransform.Microsoft",p=" ",f="",g={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},m=/([clmz]),?([^clmz]*)/gi,v=/ progid:\S+Blur\([^\)]+\)/g,y=/-?[^,\s-]+/g,b="position:absolute;left:0;top:0;width:1px;height:1px",x=21600,w={path:1,rect:1,image:1},_={circle:1,ellipse:1},k=function(e){var n=/[ahqstv]/gi,r=t._pathToAbsolute;if(i(e).match(n)&&(r=t._path2curve),n=/[clmz]/g,r==t._pathToAbsolute&&!i(e).match(n)){var s=i(e).replace(m,function(t,e,i){var n=[],r="m"==e.toLowerCase(),s=g[e];return i.replace(y,function(t){r&&2==n.length&&(s+=n+g["m"==e?"l":"L"],n=[]),n.push(a(t*x))}),s+n});return s}var o,l,u=r(e);s=[];for(var c=0,h=u.length;h>c;c++){o=u[c],l=u[c][0].toLowerCase(),"z"==l&&(l="x");for(var d=1,v=o.length;v>d;d++)l+=a(o[d]*x)+(d!=v-1?",":f);s.push(l)}return s.join(p)},S=function(e,i,n){var r=t.matrix();return r.rotate(-e,.5,.5),{dx:r.x(i,n),dy:r.y(i,n)}},A=function(t,e,i,n,r,a){var s=t._,o=t.matrix,c=s.fillpos,h=t.node,d=h.style,f=1,g="",m=x/e,v=x/i;if(d.visibility="hidden",e&&i){if(h.coordsize=l(m)+p+l(v),d.rotation=a*(0>e*i?-1:1),a){var y=S(a,n,r);n=y.dx,r=y.dy}if(0>e&&(g+="x"),0>i&&(g+=" y")&&(f=-1),d.flip=g,h.coordorigin=n*-m+p+r*-v,c||s.fillsize){var b=h.getElementsByTagName(u);b=b&&b[0],h.removeChild(b),c&&(y=S(a,o.x(c[0],c[1]),o.y(c[0],c[1])),b.position=y.dx*f+p+y.dy*f),s.fillsize&&(b.size=s.fillsize[0]*l(e)+p+s.fillsize[1]*l(i)),h.appendChild(b)}d.visibility="visible"}};t.toString=function(){return"Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\u00ebl "+this.version};var D=function(t,e,n){for(var r=i(e).toLowerCase().split("-"),a=n?"end":"start",s=r.length,o="classic",l="medium",u="medium";s--;)switch(r[s]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":o=r[s];break;case"wide":case"narrow":u=r[s];break;case"long":case"short":l=r[s]}var c=t.node.getElementsByTagName("stroke")[0];c[a+"arrow"]=o,c[a+"arrowlength"]=l,c[a+"arrowwidth"]=u},C=function(r,l){r.attrs=r.attrs||{};var h=r.node,d=r.attrs,g=h.style,m=w[r.type]&&(l.x!=d.x||l.y!=d.y||l.width!=d.width||l.height!=d.height||l.cx!=d.cx||l.cy!=d.cy||l.rx!=d.rx||l.ry!=d.ry||l.r!=d.r),v=_[r.type]&&(d.cx!=l.cx||d.cy!=l.cy||d.r!=l.r||d.rx!=l.rx||d.ry!=l.ry),y=r;for(var b in l)l[e](b)&&(d[b]=l[b]);if(m&&(d.path=t._getPath[r.type](r),r._.dirty=1),l.href&&(h.href=l.href),l.title&&(h.title=l.title),l.target&&(h.target=l.target),l.cursor&&(g.cursor=l.cursor),"blur"in l&&r.blur(l.blur),(l.path&&"path"==r.type||m)&&(h.path=k(~i(d.path).toLowerCase().indexOf("r")?t._pathToAbsolute(d.path):d.path),"image"==r.type&&(r._.fillpos=[d.x,d.y],r._.fillsize=[d.width,d.height],A(r,1,1,0,0,0))),"transform"in l&&r.transform(l.transform),v){var S=+d.cx,C=+d.cy,M=+d.rx||+d.r||0,N=+d.ry||+d.r||0;h.path=t.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",a((S-M)*x),a((C-N)*x),a((S+M)*x),a((C+N)*x),a(S*x))}if("clip-rect"in l){var J=i(l["clip-rect"]).split(c);if(4==J.length){J[2]=+J[2]+ +J[0],J[3]=+J[3]+ +J[1];var $=h.clipRect||t._g.doc.createElement("div"),E=$.style;E.clip=t.format("rect({1}px {2}px {3}px {0}px)",J),h.clipRect||(E.position="absolute",E.top=0,E.left=0,E.width=r.paper.width+"px",E.height=r.paper.height+"px",h.parentNode.insertBefore($,h),$.appendChild(h),h.clipRect=$)}l["clip-rect"]||h.clipRect&&(h.clipRect.style.clip="auto")}if(r.textpath){var I=r.textpath.style;l.font&&(I.font=l.font),l["font-family"]&&(I.fontFamily='"'+l["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,f)+'"'),l["font-size"]&&(I.fontSize=l["font-size"]),l["font-weight"]&&(I.fontWeight=l["font-weight"]),l["font-style"]&&(I.fontStyle=l["font-style"])}if("arrow-start"in l&&D(y,l["arrow-start"]),"arrow-end"in l&&D(y,l["arrow-end"],1),null!=l.opacity||null!=l["stroke-width"]||null!=l.fill||null!=l.src||null!=l.stroke||null!=l["stroke-width"]||null!=l["stroke-opacity"]||null!=l["fill-opacity"]||null!=l["stroke-dasharray"]||null!=l["stroke-miterlimit"]||null!=l["stroke-linejoin"]||null!=l["stroke-linecap"]){var L=h.getElementsByTagName(u),j=!1;if(L=L&&L[0],!L&&(j=L=P(u)),"image"==r.type&&l.src&&(L.src=l.src),l.fill&&(L.on=!0),(null==L.on||"none"==l.fill||null===l.fill)&&(L.on=!1),L.on&&l.fill){var F=i(l.fill).match(t._ISURL);if(F){L.parentNode==h&&h.removeChild(L),L.rotate=!0,L.src=F[1],L.type="tile";var O=r.getBBox(1);L.position=O.x+p+O.y,r._.fillpos=[O.x,O.y],t._preload(F[1],function(){r._.fillsize=[this.offsetWidth,this.offsetHeight]})}else L.color=t.getRGB(l.fill).hex,L.src=f,L.type="solid",t.getRGB(l.fill).error&&(y.type in{circle:1,ellipse:1}||"r"!=i(l.fill).charAt())&&T(y,l.fill,L)&&(d.fill="none",d.gradient=l.fill,L.rotate=!1)}if("fill-opacity"in l||"opacity"in l){var R=((+d["fill-opacity"]+1||2)-1)*((+d.opacity+1||2)-1)*((+t.getRGB(l.fill).o+1||2)-1);R=o(s(R,0),1),L.opacity=R,L.src&&(L.color="none")}h.appendChild(L);var H=h.getElementsByTagName("stroke")&&h.getElementsByTagName("stroke")[0],B=!1;!H&&(B=H=P("stroke")),(l.stroke&&"none"!=l.stroke||l["stroke-width"]||null!=l["stroke-opacity"]||l["stroke-dasharray"]||l["stroke-miterlimit"]||l["stroke-linejoin"]||l["stroke-linecap"])&&(H.on=!0),("none"==l.stroke||null===l.stroke||null==H.on||0==l.stroke||0==l["stroke-width"])&&(H.on=!1);var z=t.getRGB(l.stroke);H.on&&l.stroke&&(H.color=z.hex),R=((+d["stroke-opacity"]+1||2)-1)*((+d.opacity+1||2)-1)*((+z.o+1||2)-1);var Y=.75*(n(l["stroke-width"])||1);if(R=o(s(R,0),1),null==l["stroke-width"]&&(Y=d["stroke-width"]),l["stroke-width"]&&(H.weight=Y),Y&&1>Y&&(R*=Y)&&(H.weight=1),H.opacity=R,l["stroke-linejoin"]&&(H.joinstyle=l["stroke-linejoin"]||"miter"),H.miterlimit=l["stroke-miterlimit"]||8,l["stroke-linecap"]&&(H.endcap="butt"==l["stroke-linecap"]?"flat":"square"==l["stroke-linecap"]?"square":"round"),l["stroke-dasharray"]){var W={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};H.dashstyle=W[e](l["stroke-dasharray"])?W[l["stroke-dasharray"]]:f}B&&h.appendChild(H)}if("text"==y.type){y.paper.canvas.style.display=f;var q=y.paper.span,U=100,X=d.font&&d.font.match(/\d+(?:\.\d*)?(?=px)/);g=q.style,d.font&&(g.font=d.font),d["font-family"]&&(g.fontFamily=d["font-family"]),d["font-weight"]&&(g.fontWeight=d["font-weight"]),d["font-style"]&&(g.fontStyle=d["font-style"]),X=n(d["font-size"]||X&&X[0])||10,g.fontSize=X*U+"px",y.textpath.string&&(q.innerHTML=i(y.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var V=q.getBoundingClientRect();y.W=d.w=(V.right-V.left)/U,y.H=d.h=(V.bottom-V.top)/U,y.X=d.x,y.Y=d.y+y.H/2,("x"in l||"y"in l)&&(y.path.v=t.format("m{0},{1}l{2},{1}",a(d.x*x),a(d.y*x),a(d.x*x)+1));for(var K=["x","y","text","font","font-family","font-weight","font-style","font-size"],Q=0,G=K.length;G>Q;Q++)if(K[Q]in l){y._.dirty=1;break}switch(d["text-anchor"]){case"start":y.textpath.style["v-text-align"]="left",y.bbx=y.W/2;break;case"end":y.textpath.style["v-text-align"]="right",y.bbx=-y.W/2;break;default:y.textpath.style["v-text-align"]="center",y.bbx=0}y.textpath.style["v-text-kern"]=!0}},T=function(e,a,s){e.attrs=e.attrs||{};var o=(e.attrs,Math.pow),l="linear",u=".5 .5";if(e.attrs.gradient=a,a=i(a).replace(t._radial_gradient,function(t,e,i){return l="radial",e&&i&&(e=n(e),i=n(i),o(e-.5,2)+o(i-.5,2)>.25&&(i=r.sqrt(.25-o(e-.5,2))*(2*(i>.5)-1)+.5),u=e+p+i),f}),a=a.split(/\s*\-\s*/),"linear"==l){var c=a.shift();if(c=-n(c),isNaN(c))return null}var h=t._parseDots(a);if(!h)return null;if(e=e.shape||e.node,h.length){e.removeChild(s),s.on=!0,s.method="none",s.color=h[0].color,s.color2=h[h.length-1].color;for(var d=[],g=0,m=h.length;m>g;g++)h[g].offset&&d.push(h[g].offset+p+h[g].color);s.colors=d.length?d.join():"0% "+s.color,"radial"==l?(s.type="gradientTitle",s.focus="100%",s.focussize="0 0",s.focusposition=u,s.angle=0):(s.type="gradient",s.angle=(270-c)%360),e.appendChild(s)}return 1},M=function(e,i){this[0]=this.node=e,e.raphael=!0,this.id=t._oid++,e.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=i,this.matrix=t.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!i.bottom&&(i.bottom=this),this.prev=i.top,i.top&&(i.top.next=this),i.top=this,this.next=null},N=t.el;M.prototype=N,N.constructor=M,N.transform=function(e){if(null==e)return this._.transform;var n,r=this.paper._viewBoxShift,a=r?"s"+[r.scale,r.scale]+"-1-1t"+[r.dx,r.dy]:f;r&&(n=e=i(e).replace(/\.{3}|\u2026/g,this._.transform||f)),t._extractTransform(this,a+e);var s,o=this.matrix.clone(),l=this.skew,u=this.node,c=~i(this.attrs.fill).indexOf("-"),h=!i(this.attrs.fill).indexOf("url(");if(o.translate(-.5,-.5),h||c||"image"==this.type)if(l.matrix="1 0 0 1",l.offset="0 0",s=o.split(),c&&s.noRotation||!s.isSimple){u.style.filter=o.toFilter();var d=this.getBBox(),g=this.getBBox(1),m=d.x-g.x,v=d.y-g.y;u.coordorigin=m*-x+p+v*-x,A(this,1,1,m,v,0)}else u.style.filter=f,A(this,s.scalex,s.scaley,s.dx,s.dy,s.rotate);else u.style.filter=f,l.matrix=i(o),l.offset=o.offset();return n&&(this._.transform=n),this},N.rotate=function(t,e,r){if(this.removed)return this;if(null!=t){if(t=i(t).split(c),t.length-1&&(e=n(t[1]),r=n(t[2])),t=n(t[0]),null==r&&(e=r),null==e||null==r){var a=this.getBBox(1);e=a.x+a.width/2,r=a.y+a.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",t,e,r]])),this}},N.translate=function(t,e){return this.removed?this:(t=i(t).split(c),t.length-1&&(e=n(t[1])),t=n(t[0])||0,e=+e||0,this._.bbox&&(this._.bbox.x+=t,this._.bbox.y+=e),this.transform(this._.transform.concat([["t",t,e]])),this)},N.scale=function(t,e,r,a){if(this.removed)return this;if(t=i(t).split(c),t.length-1&&(e=n(t[1]),r=n(t[2]),a=n(t[3]),isNaN(r)&&(r=null),isNaN(a)&&(a=null)),t=n(t[0]),null==e&&(e=t),null==a&&(r=a),null==r||null==a)var s=this.getBBox(1);return r=null==r?s.x+s.width/2:r,a=null==a?s.y+s.height/2:a,this.transform(this._.transform.concat([["s",t,e,r,a]])),this._.dirtyT=1,this},N.hide=function(){return!this.removed&&(this.node.style.display="none"),this},N.show=function(){return!this.removed&&(this.node.style.display=f),this},N._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},N.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),t.eve.unbind("raphael.*.*."+this.id),t._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;this.removed=!0}},N.attr=function(i,n){if(this.removed)return this;if(null==i){var r={};for(var a in this.attrs)this.attrs[e](a)&&(r[a]=this.attrs[a]);return r.gradient&&"none"==r.fill&&(r.fill=r.gradient)&&delete r.gradient,r.transform=this._.transform,r}if(null==n&&t.is(i,"string")){if(i==u&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var s=i.split(c),o={},l=0,d=s.length;d>l;l++)i=s[l],o[i]=i in this.attrs?this.attrs[i]:t.is(this.paper.customAttributes[i],"function")?this.paper.customAttributes[i].def:t._availableAttrs[i];return d-1?o:o[s[0]]}if(this.attrs&&null==n&&t.is(i,"array")){for(o={},l=0,d=i.length;d>l;l++)o[i[l]]=this.attr(i[l]);return o}var p;null!=n&&(p={},p[i]=n),null==n&&t.is(i,"object")&&(p=i);for(var f in p)h("raphael.attr."+f+"."+this.id,this,p[f]);if(p){for(f in this.paper.customAttributes)if(this.paper.customAttributes[e](f)&&p[e](f)&&t.is(this.paper.customAttributes[f],"function")){var g=this.paper.customAttributes[f].apply(this,[].concat(p[f]));this.attrs[f]=p[f];for(var m in g)g[e](m)&&(p[m]=g[m])}p.text&&"text"==this.type&&(this.textpath.string=p.text),C(this,p)}return this},N.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&t._tofront(this,this.paper),this},N.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),t._toback(this,this.paper)),this)},N.insertAfter=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[e.length-1]),e.node.nextSibling?e.node.parentNode.insertBefore(this.node,e.node.nextSibling):e.node.parentNode.appendChild(this.node),t._insertafter(this,e,this.paper),this)},N.insertBefore=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[0]),e.node.parentNode.insertBefore(this.node,e.node),t._insertbefore(this,e,this.paper),this)},N.blur=function(e){var i=this.node.runtimeStyle,n=i.filter;n=n.replace(v,f),0!==+e?(this.attrs.blur=e,i.filter=n+p+d+".Blur(pixelradius="+(+e||1.5)+")",i.margin=t.format("-{0}px 0 0 -{0}px",a(+e||1.5))):(i.filter=n,i.margin=0,delete this.attrs.blur)},t._engine.path=function(t,e){var i=P("shape");i.style.cssText=b,i.coordsize=x+p+x,i.coordorigin=e.coordorigin;var n=new M(i,e),r={fill:"none",stroke:"#000"};t&&(r.path=t),n.type="path",n.path=[],n.Path=f,C(n,r),e.canvas.appendChild(i);var a=P("skew");return a.on=!0,i.appendChild(a),n.skew=a,n.transform(f),n},t._engine.rect=function(e,i,n,r,a,s){var o=t._rectPath(i,n,r,a,s),l=e.path(o),u=l.attrs;return l.X=u.x=i,l.Y=u.y=n,l.W=u.width=r,l.H=u.height=a,u.r=s,u.path=o,l.type="rect",l},t._engine.ellipse=function(t,e,i,n,r){var a=t.path();return a.attrs,a.X=e-n,a.Y=i-r,a.W=2*n,a.H=2*r,a.type="ellipse",C(a,{cx:e,cy:i,rx:n,ry:r}),a},t._engine.circle=function(t,e,i,n){var r=t.path();return r.attrs,r.X=e-n,r.Y=i-n,r.W=r.H=2*n,r.type="circle",C(r,{cx:e,cy:i,r:n}),r},t._engine.image=function(e,i,n,r,a,s){var o=t._rectPath(n,r,a,s),l=e.path(o).attr({stroke:"none"}),c=l.attrs,h=l.node,d=h.getElementsByTagName(u)[0];return c.src=i,l.X=c.x=n,l.Y=c.y=r,l.W=c.width=a,l.H=c.height=s,c.path=o,l.type="image",d.parentNode==h&&h.removeChild(d),d.rotate=!0,d.src=i,d.type="tile",l._.fillpos=[n,r],l._.fillsize=[a,s],h.appendChild(d),A(l,1,1,0,0,0),l},t._engine.text=function(e,n,r,s){var o=P("shape"),l=P("path"),u=P("textpath");n=n||0,r=r||0,s=s||"",l.v=t.format("m{0},{1}l{2},{1}",a(n*x),a(r*x),a(n*x)+1),l.textpathok=!0,u.string=i(s),u.on=!0,o.style.cssText=b,o.coordsize=x+p+x,o.coordorigin="0 0";var c=new M(o,e),h={fill:"#000",stroke:"none",font:t._availableAttrs.font,text:s};c.shape=o,c.path=l,c.textpath=u,c.type="text",c.attrs.text=i(s),c.attrs.x=n,c.attrs.y=r,c.attrs.w=1,c.attrs.h=1,C(c,h),o.appendChild(u),o.appendChild(l),e.canvas.appendChild(o);var d=P("skew");return d.on=!0,o.appendChild(d),c.skew=d,c.transform(f),c},t._engine.setSize=function(e,i){var n=this.canvas.style;return this.width=e,this.height=i,e==+e&&(e+="px"),i==+i&&(i+="px"),n.width=e,n.height=i,n.clip="rect(0 "+e+" "+i+" 0)",this._viewBox&&t._engine.setViewBox.apply(this,this._viewBox),this},t._engine.setViewBox=function(e,i,n,r,a){t.eve("raphael.setViewBox",this,this._viewBox,[e,i,n,r,a]);var o,l,u=this.width,c=this.height,h=1/s(n/u,r/c);return a&&(o=c/r,l=u/n,u>n*o&&(e-=(u-n*o)/2/o),c>r*l&&(i-=(c-r*l)/2/l)),this._viewBox=[e,i,n,r,!!a],this._viewBoxShift={dx:-e,dy:-i,scale:h},this.forEach(function(t){t.transform("...")}),this};var P;t._engine.initWin=function(t){var e=t.document;e.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!e.namespaces.rvml&&e.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),P=function(t){return e.createElement("<rvml:"+t+' class="rvml">')}}catch(i){P=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initWin(t._g.win),t._engine.create=function(){var e=t._getContainer.apply(0,arguments),i=e.container,n=e.height,r=e.width,a=e.x,s=e.y;if(!i)throw Error("VML container not found.");var o=new t._Paper,l=o.canvas=t._g.doc.createElement("div"),u=l.style;return a=a||0,s=s||0,r=r||512,n=n||342,o.width=r,o.height=n,r==+r&&(r+="px"),n==+n&&(n+="px"),o.coordsize=1e3*x+p+1e3*x,o.coordorigin="0 0",o.span=t._g.doc.createElement("span"),o.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",l.appendChild(o.span),u.cssText=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",r,n),1==i?(t._g.doc.body.appendChild(l),u.left=a+"px",u.top=s+"px",u.position="absolute"):i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),o.renderfix=function(){},o},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerHTML=f,this.span=t._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},t.prototype.remove=function(){t.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;return!0};var J=t.st;for(var $ in N)N[e]($)&&!J[e]($)&&(J[$]=function(t){return function(){var e=arguments;return this.forEach(function(i){i[t].apply(i,e)})}}($))}(window.Raphael),function(t,e){function i(e,i){var r=e.nodeName.toLowerCase();if("area"===r){var a,s=e.parentNode,o=s.name;return e.href&&o&&"map"===s.nodeName.toLowerCase()?(a=t("img[usemap=#"+o+"]")[0],!!a&&n(a)):!1}return(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"==r?e.href||i:i)&&n(e)}function n(e){return!t(e).parents().andSelf().filter(function(){return"hidden"===t.curCSS(this,"visibility")||t.expr.filters.hidden(this)}).length}t.ui=t.ui||{},t.ui.version||(t.extend(t.ui,{version:"1.8.24",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),t.fn.extend({propAttr:t.fn.prop||t.fn.attr,_focus:t.fn.focus,focus:function(e,i){return"number"==typeof e?this.each(function(){var n=this;setTimeout(function(){t(n).focus(),i&&i.call(n)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;return e=t.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.curCSS(this,"position",1))&&/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var n,r,a=t(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(r=parseInt(a.css("zIndex"),10),!isNaN(r)&&0!==r))return r;a=a.parent()}return 0},disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(i,n){function r(e,i,n,r){return t.each(a,function(){i-=parseFloat(t.curCSS(e,"padding"+this,!0))||0,n&&(i-=parseFloat(t.curCSS(e,"border"+this+"Width",!0))||0),r&&(i-=parseFloat(t.curCSS(e,"margin"+this,!0))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],s=n.toLowerCase(),o={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+n]=function(i){return i===e?o["inner"+n].call(this):this.each(function(){t(this).css(s,r(this,i)+"px")})},t.fn["outer"+n]=function(e,i){return"number"!=typeof e?o["outer"+n].call(this,e):this.each(function(){t(this).css(s,r(this,e,!0,i)+"px")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,n){return!!t.data(e,n[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var n=t.attr(e,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(e,!r)}}),t(function(){var e=document.body,i=e.appendChild(i=document.createElement("div"));i.offsetHeight,t.extend(i.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),t.support.minHeight=100===i.offsetHeight,t.support.selectstart="onselectstart"in i,e.removeChild(i).style.display="none"}),t.curCSS||(t.curCSS=t.css),t.extend(t.ui,{plugin:{add:function(e,i,n){var r=t.ui[e].prototype;for(var a in n)r.plugins[a]=r.plugins[a]||[],r.plugins[a].push([i,n[a]])},call:function(t,e,i){var n=t.plugins[e];if(n&&t.element[0].parentNode)for(var r=0;n.length>r;r++)t.options[n[r][0]]&&n[r][1].apply(t.element,i)}},contains:function(t,e){return document.compareDocumentPosition?16&t.compareDocumentPosition(e):t!==e&&t.contains(e)},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",r=!1;return e[n]>0?!0:(e[n]=1,r=e[n]>0,e[n]=0,r)},isOverAxis:function(t,e,i){return t>e&&e+i>t},isOver:function(e,i,n,r,a,s){return t.ui.isOverAxis(e,n,a)&&t.ui.isOverAxis(i,r,s)}}))}(jQuery),function(t,e){if(t.cleanData){var i=t.cleanData;t.cleanData=function(e){for(var n,r=0;null!=(n=e[r]);r++)try{t(n).triggerHandler("remove")}catch(a){}i(e)}}else{var n=t.fn.remove;t.fn.remove=function(e,i){return this.each(function(){return i||(!e||t.filter(e,[this]).length)&&t("*",this).add([this]).each(function(){try{t(this).triggerHandler("remove")}catch(e){}}),n.call(t(this),e,i)})}}t.widget=function(e,i,n){var r,a=e.split(".")[0];e=e.split(".")[1],r=a+"-"+e,n||(n=i,i=t.Widget),t.expr[":"][r]=function(i){return!!t.data(i,e)},t[a]=t[a]||{},t[a][e]=function(t,e){arguments.length&&this._createWidget(t,e)};var s=new i;s.options=t.extend(!0,{},s.options),t[a][e].prototype=t.extend(!0,s,{namespace:a,widgetName:e,widgetEventPrefix:t[a][e].prototype.widgetEventPrefix||e,widgetBaseClass:r},n),t.widget.bridge(e,t[a][e])},t.widget.bridge=function(i,n){t.fn[i]=function(r){var a="string"==typeof r,s=Array.prototype.slice.call(arguments,1),o=this;return r=!a&&s.length?t.extend.apply(null,[!0,r].concat(s)):r,a&&"_"===r.charAt(0)?o:(a?this.each(function(){var n=t.data(this,i),a=n&&t.isFunction(n[r])?n[r].apply(n,s):n;return a!==n&&a!==e?(o=a,!1):e}):this.each(function(){var e=t.data(this,i);e?e.option(r||{})._init():t.data(this,i,new n(r,this))}),o)}},t.Widget=function(t,e){arguments.length&&this._createWidget(t,e)},t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(e,i){t.data(i,this.widgetName,this),this.element=t(i),this.options=t.extend(!0,{},this.options,this._getCreateOptions(),e);var n=this;this.element.bind("remove."+this.widgetName,function(){n.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return t.metadata&&t.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(i,n){var r=i;if(0===arguments.length)return t.extend({},this.options);if("string"==typeof i){if(n===e)return this.options[i];r={},r[i]=n}return this._setOptions(r),this},_setOptions:function(e){var i=this;return t.each(e,function(t,e){i._setOption(t,e)}),this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&this.widget()[e?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",e),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(e,i,n){var r,a,s=this.options[e];if(n=n||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(r in a)r in i||(i[r]=a[r]);return this.element.trigger(i,n),!(t.isFunction(s)&&s.call(this.element[0],i,n)===!1||i.isDefaultPrevented())}}}(jQuery),function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,r=1==i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return r&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return n._mouseMove(t)},this._mouseUpDelegate=function(t){return n._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return!t.browser.msie||document.documentMode>=9||e.button?this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted):this._mouseUp(e)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target==this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(t){t.widget("ui.draggable",t.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){"original"!=this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){return this.element.data("draggable")?(this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this):undefined},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(e),this.handle?(i.iframeFix&&t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),i.containment&&this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0) },_mouseDrag:function(e,i){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var n=this._uiHash();if(this._trigger("drag",e,n)===!1)return this._mouseUp({}),!1;this.position=n.position}return this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=!1;t.ui.ddmanager&&!this.options.dropBehaviour&&(i=t.ui.ddmanager.drop(this,e)),this.dropped&&(i=this.dropped,this.dropped=!1);for(var n=this.element[0],r=!1;n&&(n=n.parentNode);)n==document&&(r=!0);if(!r&&"original"===this.options.helper)return!1;if("invalid"==this.options.revert&&!i||"valid"==this.options.revert&&i||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)){var a=this;t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){a._trigger("stop",e)!==!1&&a._clear()})}else this._trigger("stop",e)!==!1&&this._clear();return!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){var i=this.options.handle&&t(this.options.handle,this.element).length?!1:!0;return t(this.options.handle,this.element).find("*").andSelf().each(function(){this==e.target&&(i=!0)}),i},_createHelper:function(e){var i=this.options,n=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"==i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"==i.appendTo?this.element[0].parentNode:i.appendTo),n[0]==this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.browser.msie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),("document"==e.containment||"window"==e.containment)&&(this.containment=["document"==e.containment?0:t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"==e.containment?0:t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"==e.containment?0:t(window).scrollLeft())+t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==e.containment?0:t(window).scrollTop())+(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(e.containment)||e.containment.constructor==Array)e.containment.constructor==Array&&(this.containment=e.containment);else{var i=t(e.containment),n=i[0];if(!n)return;i.offset();var r="hidden"!=t(n).css("overflow");this.containment=[(parseInt(t(n).css("borderLeftWidth"),10)||0)+(parseInt(t(n).css("paddingLeft"),10)||0),(parseInt(t(n).css("borderTopWidth"),10)||0)+(parseInt(t(n).css("paddingTop"),10)||0),(r?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(t(n).css("borderLeftWidth"),10)||0)-(parseInt(t(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(r?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(t(n).css("borderTopWidth"),10)||0)-(parseInt(t(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i}},_convertPositionTo:function(e,i){i||(i=this.position);var n="absolute"==e?1:-1,r=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),a=/(html|body)/i.test(r[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-(t.browser.safari&&526>t.browser.version&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollTop():a?0:r.scrollTop())*n),left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-(t.browser.safari&&526>t.browser.version&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():a?0:r.scrollLeft())*n)}},_generatePosition:function(e){var i=this.options,n="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(n[0].tagName),a=e.pageX,s=e.pageY;if(this.originalPosition){var o;if(this.containment){if(this.relative_container){var l=this.relative_container.offset();o=[this.containment[0]+l.left,this.containment[1]+l.top,this.containment[2]+l.left,this.containment[3]+l.top]}else o=this.containment;e.pageX-this.offset.click.left<o[0]&&(a=o[0]+this.offset.click.left),e.pageY-this.offset.click.top<o[1]&&(s=o[1]+this.offset.click.top),e.pageX-this.offset.click.left>o[2]&&(a=o[2]+this.offset.click.left),e.pageY-this.offset.click.top>o[3]&&(s=o[3]+this.offset.click.top)}if(i.grid){var u=i.grid[1]?this.originalPageY+Math.round((s-this.originalPageY)/i.grid[1])*i.grid[1]:this.originalPageY;s=o?u-this.offset.click.top<o[1]||u-this.offset.click.top>o[3]?u-this.offset.click.top<o[1]?u+i.grid[1]:u-i.grid[1]:u:u;var c=i.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/i.grid[0])*i.grid[0]:this.originalPageX;a=o?c-this.offset.click.left<o[0]||c-this.offset.click.left>o[2]?c-this.offset.click.left<o[0]?c+i.grid[0]:c-i.grid[0]:c:c}}return{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(t.browser.safari&&526>t.browser.version&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollTop():r?0:n.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(t.browser.safari&&526>t.browser.version&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollLeft():r?0:n.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]==this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,n){return n=n||this._uiHash(),t.ui.plugin.call(this,e,[i,n]),"drag"==e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.extend(t.ui.draggable,{version:"1.8.24"}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var n=t(this).data("draggable"),r=n.options,a=t.extend({},i,{item:n.element});n.sortables=[],t(r.connectToSortable).each(function(){var i=t.data(this,"sortable");i&&!i.options.disabled&&(n.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var n=t(this).data("draggable"),r=t.extend({},i,{item:n.element});t.each(n.sortables,function(){this.instance.isOver?(this.instance.isOver=0,n.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"==n.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,r))})},drag:function(e,i){var n=t(this).data("draggable"),r=this;t.each(n.sortables,function(){this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(r).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=n.offset.click.top,this.instance.offset.click.left=n.offset.click.left,this.instance.offset.parent.left-=n.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=n.offset.parent.top-this.instance.offset.parent.top,n._trigger("toSortable",e),n.dropped=this.instance.element,n.currentItem=n.element,this.instance.fromOutside=n),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),n._trigger("fromSortable",e),n.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var n=t(i.helper),r=t(this).data("draggable").options;n.css("opacity")&&(r._opacity=n.css("opacity")),n.css("opacity",r.opacity)},stop:function(e,i){var n=t(this).data("draggable").options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("draggable");e.scrollParent[0]!=document&&"HTML"!=e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("draggable"),n=i.options,r=!1;i.scrollParent[0]!=document&&"HTML"!=i.scrollParent[0].tagName?(n.axis&&"x"==n.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<n.scrollSensitivity?i.scrollParent[0].scrollTop=r=i.scrollParent[0].scrollTop+n.scrollSpeed:e.pageY-i.overflowOffset.top<n.scrollSensitivity&&(i.scrollParent[0].scrollTop=r=i.scrollParent[0].scrollTop-n.scrollSpeed)),n.axis&&"y"==n.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<n.scrollSensitivity?i.scrollParent[0].scrollLeft=r=i.scrollParent[0].scrollLeft+n.scrollSpeed:e.pageX-i.overflowOffset.left<n.scrollSensitivity&&(i.scrollParent[0].scrollLeft=r=i.scrollParent[0].scrollLeft-n.scrollSpeed))):(n.axis&&"x"==n.axis||(e.pageY-t(document).scrollTop()<n.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<n.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+n.scrollSpeed))),n.axis&&"y"==n.axis||(e.pageX-t(document).scrollLeft()<n.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<n.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+n.scrollSpeed)))),r!==!1&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!=String?i.snap.items||":data(draggable)":i.snap).each(function(){var i=t(this),n=i.offset();this!=e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:n.top,left:n.left})})},drag:function(e,i){for(var n=t(this).data("draggable"),r=n.options,a=r.snapTolerance,s=i.offset.left,o=s+n.helperProportions.width,l=i.offset.top,u=l+n.helperProportions.height,c=n.snapElements.length-1;c>=0;c--){var h=n.snapElements[c].left,d=h+n.snapElements[c].width,p=n.snapElements[c].top,f=p+n.snapElements[c].height;if(s>h-a&&d+a>s&&l>p-a&&f+a>l||s>h-a&&d+a>s&&u>p-a&&f+a>u||o>h-a&&d+a>o&&l>p-a&&f+a>l||o>h-a&&d+a>o&&u>p-a&&f+a>u){if("inner"!=r.snapMode){var g=a>=Math.abs(p-u),m=a>=Math.abs(f-l),v=a>=Math.abs(h-o),y=a>=Math.abs(d-s);g&&(i.position.top=n._convertPositionTo("relative",{top:p-n.helperProportions.height,left:0}).top-n.margins.top),m&&(i.position.top=n._convertPositionTo("relative",{top:f,left:0}).top-n.margins.top),v&&(i.position.left=n._convertPositionTo("relative",{top:0,left:h-n.helperProportions.width}).left-n.margins.left),y&&(i.position.left=n._convertPositionTo("relative",{top:0,left:d}).left-n.margins.left)}var b=g||m||v||y;if("outer"!=r.snapMode){var g=a>=Math.abs(p-l),m=a>=Math.abs(f-u),v=a>=Math.abs(h-s),y=a>=Math.abs(d-o);g&&(i.position.top=n._convertPositionTo("relative",{top:p,left:0}).top-n.margins.top),m&&(i.position.top=n._convertPositionTo("relative",{top:f-n.helperProportions.height,left:0}).top-n.margins.top),v&&(i.position.left=n._convertPositionTo("relative",{top:0,left:h}).left-n.margins.left),y&&(i.position.left=n._convertPositionTo("relative",{top:0,left:d-n.helperProportions.width}).left-n.margins.left)}!n.snapElements[c].snapping&&(g||m||v||y||b)&&n.options.snap.snap&&n.options.snap.snap.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[c].item})),n.snapElements[c].snapping=g||m||v||y||b}else n.snapElements[c].snapping&&n.options.snap.release&&n.options.snap.release.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[c].item})),n.snapElements[c].snapping=!1}}}),t.ui.plugin.add("draggable","stack",{start:function(){var e=t(this).data("draggable").options,i=t.makeArray(t(e.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});if(i.length){var n=parseInt(i[0].style.zIndex)||0;t(i).each(function(t){this.style.zIndex=n+t}),this[0].style.zIndex=n+i.length}}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var n=t(i.helper),r=t(this).data("draggable").options;n.css("zIndex")&&(r._zIndex=n.css("zIndex")),n.css("zIndex",r.zIndex)},stop:function(e,i){var n=t(this).data("draggable").options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}})}(jQuery),function(t){t.widget("ui.sortable",t.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){t.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget()[i?"addClass":"removeClass"]("ui-sortable-disabled")):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var n=this;if(this.reverting)return!1;if(this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(e);var r=null,a=this;if(t(e.target).parents().each(function(){return t.data(this,n.widgetName+"-item")==a?(r=t(this),!1):undefined}),t.data(e.target,n.widgetName+"-item")==a&&(r=t(e.target)),!r)return!1;if(this.options.handle&&!i){var s=!1;if(t(this.options.handle,r).find("*").andSelf().each(function(){this==e.target&&(s=!0)}),!s)return!1}return this.currentItem=r,this._removeCurrentsFromItems(),!0},_mouseStart:function(e,i,n){var r=this.options,a=this;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&(t("body").css("cursor")&&(this._storedCursor=t("body").css("cursor")),t("body").css("cursor",r.cursor)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(var s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",e,a._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){if(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll){var i=this.options,n=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<i.scrollSensitivity?this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop+i.scrollSpeed:e.pageY-this.overflowOffset.top<i.scrollSensitivity&&(this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop-i.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<i.scrollSensitivity?this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft+i.scrollSpeed:e.pageX-this.overflowOffset.left<i.scrollSensitivity&&(this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft-i.scrollSpeed)):(e.pageY-t(document).scrollTop()<i.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-i.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<i.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+i.scrollSpeed)),e.pageX-t(document).scrollLeft()<i.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-i.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<i.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+i.scrollSpeed))),n!==!1&&t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)}this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(var r=this.items.length-1;r>=0;r--){var a=this.items[r],s=a.item[0],o=this._intersectsWithPointer(a);if(o&&a.instance===this.currentContainer&&s!=this.currentItem[0]&&this.placeholder[1==o?"next":"prev"]()[0]!=s&&!t.ui.contains(this.placeholder[0],s)&&("semi-dynamic"==this.options.type?!t.ui.contains(this.element[0],s):!0)){if(this.direction=1==o?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(a))break;this._rearrange(e,a),this._trigger("change",e,this._uiHash());break}}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var n=this,r=n.placeholder.offset();n.reverting=!0,t(this.helper).animate({left:r.left-this.offset.parent.left-n.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:r.top-this.offset.parent.top-n.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){n._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){var e=this;if(this.dragging){this._mouseUp({target:null}),"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("deactivate",null,e._uiHash(this)),this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",null,e._uiHash(this)),this.containers[i].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[-=_](.+)/);i&&n.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!n.length&&e.key&&n.push(e.key+"="),n.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},i.each(function(){n.push(t(e.item||this).attr(e.attribute||"id")||"")}),n},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,n=this.positionAbs.top,r=n+this.helperProportions.height,a=t.left,s=a+t.width,o=t.top,l=o+t.height,u=this.offset.click.top,c=this.offset.click.left,h=n+u>o&&l>n+u&&e+c>a&&s>e+c;return"pointer"==this.options.tolerance||this.options.forcePointerForContainers||"pointer"!=this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?h:e+this.helperProportions.width/2>a&&s>i-this.helperProportions.width/2&&n+this.helperProportions.height/2>o&&l>r-this.helperProportions.height/2},_intersectsWithPointer:function(e){var i="x"===this.options.axis||t.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),n="y"===this.options.axis||t.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),r=i&&n,a=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return r?this.floating?s&&"right"==s||"down"==a?2:1:a&&("down"==a?2:1):!1},_intersectsWithSides:function(e){var i=t.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),n=t.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),r=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"==a&&n||"left"==a&&!n:r&&("down"==r&&i||"up"==r&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor==String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i=[],n=[],r=this._connectWith();if(r&&e)for(var a=r.length-1;a>=0;a--)for(var s=t(r[a]),o=s.length-1;o>=0;o--){var l=t.data(s[o],this.widgetName);l&&l!=this&&!l.options.disabled&&n.push([t.isFunction(l.options.items)?l.options.items.call(l.element):t(l.options.items,l.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),l])}n.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var a=n.length-1;a>=0;a--)n[a][0].each(function(){i.push(this)});return t(i)},_removeCurrentsFromItems:function(){for(var t=this.currentItem.find(":data("+this.widgetName+"-item)"),e=0;this.items.length>e;e++)for(var i=0;t.length>i;i++)t[i]==this.items[e].item[0]&&this.items.splice(e,1)},_refreshItems:function(e){this.items=[],this.containers=[this];var i=this.items,n=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],r=this._connectWith();if(r&&this.ready)for(var a=r.length-1;a>=0;a--)for(var s=t(r[a]),o=s.length-1;o>=0;o--){var l=t.data(s[o],this.widgetName);l&&l!=this&&!l.options.disabled&&(n.push([t.isFunction(l.options.items)?l.options.items.call(l.element[0],e,{item:this.currentItem}):t(l.options.items,l.element),l]),this.containers.push(l))}for(var a=n.length-1;a>=0;a--)for(var u=n[a][1],c=n[a][0],o=0,h=c.length;h>o;o++){var d=t(c[o]);d.data(this.widgetName+"-item",u),i.push({item:d,instance:u,width:0,height:0,left:0,top:0})}},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var i=this.items.length-1;i>=0;i--){var n=this.items[i];if(n.instance==this.currentContainer||!this.currentContainer||n.item[0]==this.currentItem[0]){var r=this.options.toleranceElement?t(this.options.toleranceElement,n.item):n.item;e||(n.width=r.outerWidth(),n.height=r.outerHeight());var a=r.offset();n.left=a.left,n.top=a.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var i=this.containers.length-1;i>=0;i--){var a=this.containers[i].element.offset();this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}return this},_createPlaceholder:function(e){var i=e||this,n=i.options;if(!n.placeholder||n.placeholder.constructor==String){var r=n.placeholder;n.placeholder={element:function(){var e=t(document.createElement(i.currentItem[0].nodeName)).addClass(r||i.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return r||(e.style.visibility="hidden"),e},update:function(t,e){(!r||n.forcePlaceholderSize)&&(e.height()||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}}i.placeholder=t(n.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),n.placeholder.update(i,i.placeholder)},_contactContainers:function(e){for(var i=null,n=null,r=this.containers.length-1;r>=0;r--)if(!t.ui.contains(this.currentItem[0],this.containers[r].element[0]))if(this._intersectsWith(this.containers[r].containerCache)){if(i&&t.ui.contains(this.containers[r].element[0],i.element[0]))continue;i=this.containers[r],n=r}else this.containers[r].containerCache.over&&(this.containers[r]._trigger("out",e,this._uiHash(this)),this.containers[r].containerCache.over=0);if(i)if(1===this.containers.length)this.containers[n]._trigger("over",e,this._uiHash(this)),this.containers[n].containerCache.over=1;else if(this.currentContainer!=this.containers[n]){for(var a=1e4,s=null,o=this.positionAbs[this.containers[n].floating?"left":"top"],l=this.items.length-1;l>=0;l--)if(t.ui.contains(this.containers[n].element[0],this.items[l].item[0])){var u=this.containers[n].floating?this.items[l].item.offset().left:this.items[l].item.offset().top;a>Math.abs(u-o)&&(a=Math.abs(u-o),s=this.items[l],this.direction=u-o>0?"down":"up")}if(!s&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[n],s?this._rearrange(e,s,null,!0):this._rearrange(e,null,this.containers[n].element,!0),this._trigger("change",e,this._uiHash()),this.containers[n]._trigger("change",e,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[n]._trigger("over",e,this._uiHash(this)),this.containers[n].containerCache.over=1}},_createHelper:function(e){var i=this.options,n=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"==i.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||t("parent"!=i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(""==n[0].style.width||i.forceHelperSize)&&n.width(this.currentItem.width()),(""==n[0].style.height||i.forceHelperSize)&&n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.browser.msie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)} },_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),("document"==e.containment||"window"==e.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),!/^(document|window|parent)$/.test(e.containment)){var i=t(e.containment)[0],n=t(e.containment).offset(),r="hidden"!=t(i).css("overflow");this.containment=[n.left+(parseInt(t(i).css("borderLeftWidth"),10)||0)+(parseInt(t(i).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(t(i).css("borderTopWidth"),10)||0)+(parseInt(t(i).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t(i).css("borderLeftWidth"),10)||0)-(parseInt(t(i).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t(i).css("borderTopWidth"),10)||0)-(parseInt(t(i).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,i){i||(i=this.position);var n="absolute"==e?1:-1,r=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),a=/(html|body)/i.test(r[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-(t.browser.safari&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollTop():a?0:r.scrollTop())*n),left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-(t.browser.safari&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():a?0:r.scrollLeft())*n)}},_generatePosition:function(e){var i=this.options,n="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(n[0].tagName);"relative"!=this.cssPosition||this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());var a=e.pageX,s=e.pageY;if(this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),i.grid)){var o=this.originalPageY+Math.round((s-this.originalPageY)/i.grid[1])*i.grid[1];s=this.containment?o-this.offset.click.top<this.containment[1]||o-this.offset.click.top>this.containment[3]?o-this.offset.click.top<this.containment[1]?o+i.grid[1]:o-i.grid[1]:o:o;var l=this.originalPageX+Math.round((a-this.originalPageX)/i.grid[0])*i.grid[0];a=this.containment?l-this.offset.click.left<this.containment[0]||l-this.offset.click.left>this.containment[2]?l-this.offset.click.left<this.containment[0]?l+i.grid[0]:l-i.grid[0]:l:l}return{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(t.browser.safari&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollTop():r?0:n.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(t.browser.safari&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollLeft():r?0:n.scrollLeft())}},_rearrange:function(t,e,i,n){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"==this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var r=this,a=this.counter;window.setTimeout(function(){a==r.counter&&r.refreshPositions(!n)},0)},_clear:function(e,i){this.reverting=!1;var n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]==this.currentItem[0]){for(var r in this._storedCSS)("auto"==this._storedCSS[r]||"static"==this._storedCSS[r])&&(this._storedCSS[r]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!i&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev==this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent==this.currentItem.parent()[0]||i||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(i||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer))));for(var r=this.containers.length-1;r>=0;r--)i||n.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over&&(n.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over=0);if(this._storedCursor&&t("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!i){this._trigger("beforeStop",e,this._uiHash());for(var r=0;n.length>r;r++)n[r].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(i||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null,!i){for(var r=0;n.length>r;r++)n[r].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.extend(t.ui.sortable,{version:"1.8.24"})}(jQuery);
app/components/build/CommentsList.js
fotinakis/buildkite-frontend
import React from 'react'; import Relay from 'react-relay/classic'; class CommentsList extends React.PureComponent { render() { return ( <span>Comments</span> ); } } export default Relay.createContainer(CommentsList, { fragments: { viewer: () => Relay.QL` fragment on Viewer { user { name } } `, build: () => Relay.QL` fragment on Build { id } ` } });
src/components/AddTaskForm.js
mejarc/i-got-time
import React, { Component } from 'react'; // renders a text input, a number input, and a button. // receives an onSubmit function from parent component // sends a call to that function with the form inputs' values // on form submit const AddTaskForm = ({ onSubmit }) => { let input, select; return ( <div> <form onSubmit={(e) => { onSubmit(input.value, select.value)}}> <label>Task<input ref={node => { input = node }} required /></label> <label>Duration<input ref={node => { select = node }} type="number" min="5" max="15" step="5" required value="10" /></label> <button>Add Task</button> </form> </div> ) }; export default AddTaskForm;
packages/react-error-overlay/src/containers/StackFrame.js
GreenGremlin/create-react-app
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* @flow */ import React, { Component } from 'react'; import CodeBlock from './StackFrameCodeBlock'; import { getPrettyURL } from '../utils/getPrettyURL'; import { darkGray } from '../styles'; import type { StackFrame as StackFrameType } from '../utils/stack-frame'; import type { ErrorLocation } from '../utils/parseCompileError'; const linkStyle = { fontSize: '0.9em', marginBottom: '0.9em', }; const anchorStyle = { textDecoration: 'none', color: darkGray, cursor: 'pointer', }; const codeAnchorStyle = { cursor: 'pointer', }; const toggleStyle = { marginBottom: '1.5em', color: darkGray, cursor: 'pointer', border: 'none', display: 'block', width: '100%', textAlign: 'left', background: '#fff', fontFamily: 'Consolas, Menlo, monospace', fontSize: '1em', padding: '0px', lineHeight: '1.5', }; type Props = {| frame: StackFrameType, contextSize: number, critical: boolean, showCode: boolean, editorHandler: (errorLoc: ErrorLocation) => void, |}; type State = {| compiled: boolean, |}; class StackFrame extends Component<Props, State> { state = { compiled: false, }; toggleCompiled = () => { this.setState(state => ({ compiled: !state.compiled, })); }; getErrorLocation(): ErrorLocation | null { const { _originalFileName: fileName, _originalLineNumber: lineNumber, } = this.props.frame; // Unknown file if (!fileName) { return null; } // e.g. "/path-to-my-app/webpack/bootstrap eaddeb46b67d75e4dfc1" const isInternalWebpackBootstrapCode = fileName.trim().indexOf(' ') !== -1; if (isInternalWebpackBootstrapCode) { return null; } // Code is in a real file return { fileName, lineNumber: lineNumber || 1 }; } editorHandler = () => { const errorLoc = this.getErrorLocation(); if (!errorLoc) { return; } this.props.editorHandler(errorLoc); }; onKeyDown = (e: SyntheticKeyboardEvent<>) => { if (e.key === 'Enter') { this.editorHandler(); } }; render() { const { frame, contextSize, critical, showCode } = this.props; const { fileName, lineNumber, columnNumber, _scriptCode: scriptLines, _originalFileName: sourceFileName, _originalLineNumber: sourceLineNumber, _originalColumnNumber: sourceColumnNumber, _originalScriptCode: sourceLines, } = frame; const functionName = frame.getFunctionName(); const compiled = this.state.compiled; const url = getPrettyURL( sourceFileName, sourceLineNumber, sourceColumnNumber, fileName, lineNumber, columnNumber, compiled ); let codeBlockProps = null; if (showCode) { if ( compiled && scriptLines && scriptLines.length !== 0 && lineNumber != null ) { codeBlockProps = { lines: scriptLines, lineNum: lineNumber, columnNum: columnNumber, contextSize, main: critical, }; } else if ( !compiled && sourceLines && sourceLines.length !== 0 && sourceLineNumber != null ) { codeBlockProps = { lines: sourceLines, lineNum: sourceLineNumber, columnNum: sourceColumnNumber, contextSize, main: critical, }; } } const canOpenInEditor = this.getErrorLocation() !== null && this.props.editorHandler !== null; return ( <div> <div>{functionName}</div> <div style={linkStyle}> <span style={canOpenInEditor ? anchorStyle : null} onClick={canOpenInEditor ? this.editorHandler : null} onKeyDown={canOpenInEditor ? this.onKeyDown : null} tabIndex={canOpenInEditor ? '0' : null} > {url} </span> </div> {codeBlockProps && ( <span> <span onClick={canOpenInEditor ? this.editorHandler : null} style={canOpenInEditor ? codeAnchorStyle : null} > <CodeBlock {...codeBlockProps} /> </span> <button style={toggleStyle} onClick={this.toggleCompiled}> {'View ' + (compiled ? 'source' : 'compiled')} </button> </span> )} </div> ); } } export default StackFrame;
pootle/static/js/auth/containers/Auth.js
translate/pootle
/* * Copyright (C) Pootle contributors. * * This file is a part of the Pootle project. It is distributed under the GPL3 * or later license. See the LICENSE file for a copy of the license and the * AUTHORS file for copyright and authorship information. */ import React from 'react'; import { connect } from 'react-redux'; import { gotoScreen, requestPasswordReset } from '../actions'; import AccountActivation from '../components/AccountActivation'; import AccountInactive from '../components/AccountInactive'; import AuthWindow from '../components/AuthWindow'; import EmailConfirmation from '../components/EmailConfirmation'; import RequestPasswordResetForm from '../components/RequestPasswordResetForm'; import RequestPasswordResetSent from '../components/RequestPasswordResetSent'; import PasswordResetForm from '../components/PasswordResetForm'; import SignInPanel from '../components/SignInPanel'; import SignUpForm from '../components/SignUpForm'; import SocialAuthError from '../components/SocialAuthError'; import SocialVerification from '../components/SocialVerification'; const Auth = React.createClass({ propTypes: { // Optionally overrides state initPasswordReset: React.PropTypes.object, initialScreen: React.PropTypes.string, canContact: React.PropTypes.bool.isRequired, canRegister: React.PropTypes.bool.isRequired, dispatch: React.PropTypes.func.isRequired, onClose: React.PropTypes.func.isRequired, screen: React.PropTypes.string.isRequired, socialAuthProviders: React.PropTypes.array.isRequired, socialError: React.PropTypes.object, tokenFailed: React.PropTypes.bool, }, getDefaultProps() { return { initPasswordReset: null, tokenFailed: false, }; }, /* Lifecycle */ componentWillMount() { if (this.props.initialScreen) { this.props.dispatch(gotoScreen(this.props.initialScreen)); } if (this.props.initPasswordReset) { this.props.dispatch(requestPasswordReset(this.props.initPasswordReset)); } }, componentWillReceiveProps(nextProps) { if (nextProps.redirectTo !== null) { const currentLocation = window.location.pathname + window.location.hash; if (currentLocation !== nextProps.redirectTo) { window.location = nextProps.redirectTo; } else { window.location.reload(); } } }, /* Layout */ getScreen(screenName, props) { // FIXME: use react-router switch (screenName) { case 'signIn': { const hasSocialAuth = props.socialAuthProviders.length !== 0; return { title: hasSocialAuth ? gettext('Sign In With...') : gettext('Sign In'), content: SignInPanel, }; } case 'inactive': return { title: gettext('Account Inactive'), content: AccountInactive, }; case 'signUp': return { title: gettext('Sign Up'), content: SignUpForm, }; case 'activation': return { title: gettext('Account Activation'), content: AccountActivation, }; case 'emailConfirmation': return { title: gettext('Email Confirmation'), content: EmailConfirmation, }; case 'requestPasswordReset': return { title: gettext('Reset Your Password'), content: RequestPasswordResetForm, }; case 'requestPasswordResetSent': return { title: gettext('Reset Your Password'), content: RequestPasswordResetSent, }; case 'passwordReset': return { title: gettext('Reset Your Password'), content: PasswordResetForm, }; case 'socialAuthError': return { title: gettext('Oops...'), content: SocialAuthError, }; case 'socialVerification': return { title: gettext('Social Verification'), content: SocialVerification, }; default: break; } return {}; }, render() { const currentScreen = this.getScreen(this.props.screen, this.props); const ContentComponent = currentScreen.content; return ( <AuthWindow canContact={this.props.canContact} title={currentScreen.title} onClose={this.props.onClose} > <ContentComponent canRegister={this.props.canRegister} onClose={this.props.onClose} socialAuthProviders={this.props.socialAuthProviders} socialError={this.props.socialError} tokenFailed={this.props.tokenFailed} {...this.props} /> </AuthWindow> ); }, }); export default connect(state => state.auth)(Auth);
installer/frontend/trail.js
mxinden/tectonic-installer
import _ from 'lodash'; import React from 'react'; import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable'; import { commitPhases } from './actions'; import { PLATFORM_TYPE, DRY_RUN } from './cluster-config'; import { CertificateAuthority } from './components/certificate-authority'; import { ClusterType } from './components/cluster-type'; import { DryRun } from './components/dry-run'; import { Etcd } from './components/etcd'; import { SubmitDefinition } from './components/submit-definition'; import { Success } from './components/success'; import { TF_PowerOn } from './components/tf-poweron'; import { Users } from './components/users'; import { BM_ClusterInfo } from './components/bm-cluster-info'; import { BM_Controllers, BM_Workers } from './components/bm-nodeforms'; import { BM_Credentials } from './components/bm-credentials'; import { BM_Hostname } from './components/bm-hostname'; import { BM_Matchbox } from './components/bm-matchbox'; import { BM_NetworkConfig } from './components/bm-network-config'; import { BM_SSHKeys } from './components/bm-sshkeys'; import { AWS_CloudCredentials } from './components/aws-cloud-credentials'; import { AWS_ClusterInfo } from './components/aws-cluster-info'; import { AWS_DefineNodes } from './components/aws-define-nodes'; import { AWS_SubmitKeys } from './components/aws-submit-keys'; import { AWS_VPC } from './components/aws-vpc'; import { AWS_TF, BARE_METAL_TF, isSupported, } from './platforms'; // Common pages const certificateAuthorityPage = { path: '/define/certificate-authority', component: CertificateAuthority, title: 'Certificate Authority', }; const clusterTypePage = { path: '/define/cluster-type', component: ClusterType, title: 'Platform', hideSave: true, showRestore: true, }; const dryRunPage = { path: '/define/advanced', component: DryRun, title: 'Download Assets', }; const etcdPage = { path: '/define/etcd', component: Etcd, title: 'etcd Connection', }; const submitDefinitionPage = { path: '/define/submit', component: SubmitDefinition, title: 'Submit', hidePager: true, }; const successPage = { path: '/boot/complete', component: Success, title: 'Installation Complete', hidePager: true, hideSave: true, }; const TFPowerOnPage = { path: '/boot/tf/poweron', component: TF_PowerOn, title: 'Start Installation', }; const usersPage = { path: '/define/users', component: Users, title: 'Console Login', }; // Baremetal pages const bmClusterInfoPage = { path: '/define/cluster-info', component: BM_ClusterInfo, title: 'Cluster Info', }; const bmControllersPage = { path: '/define/controllers', component: BM_Controllers, title: 'Define Masters', }; const bmCredentialsPage = { path: '/define/credentials', component: BM_Credentials, title: 'Matchbox Credentials', }; const bmHostnamePage = { path: '/define/hostname', component: BM_Hostname, title: 'Cluster DNS', }; const bmMatchboxPage = { path: '/define/matchbox', component: BM_Matchbox, title: 'Matchbox Address', }; const bmNetworkConfigPage = { path: '/define/network-config', component: BM_NetworkConfig, title: 'Network Configuration', }; const bmSshKeysPage = { path: '/define/ssh-keys', component: BM_SSHKeys, title: 'SSH Key', }; const bmWorkersPage = { path: '/define/workers', component: BM_Workers, title: 'Define Workers', }; // AWS pages const awsClusterInfoPage = { path: '/define/aws/cluster-info', component: AWS_ClusterInfo, title: 'Cluster Info', }; const awsCloudCredentialsPage = { path: '/define/aws/cloud-credentials', component: AWS_CloudCredentials, title: 'AWS Credentials', }; const awsDefineNodesPage = { path: '/define/aws/nodes', component: AWS_DefineNodes, title: 'Define Nodes', }; const awsSubmitKeysPage = { path: '/define/aws/keys', component: AWS_SubmitKeys, title: 'SSH Key', }; const awsVPCPage = { path: '/define/aws/vpc', component: AWS_VPC, title: 'Networking', }; // This component is never visible! const loadingPage = { path: '/', component: React.createElement('div'), title: 'Tectonic', }; export const sections = new Map([ ['loading', [ loadingPage, ]], ['choose', [ clusterTypePage, ]], ['defineBaremetal', [ bmClusterInfoPage, bmHostnamePage, certificateAuthorityPage, bmMatchboxPage, bmCredentialsPage, bmNetworkConfigPage, bmControllersPage, bmWorkersPage, etcdPage, bmSshKeysPage, usersPage, submitDefinitionPage, ]], ['defineAWS', [ awsCloudCredentialsPage, awsClusterInfoPage, certificateAuthorityPage, awsSubmitKeysPage, awsDefineNodesPage, awsVPCPage, usersPage, submitDefinitionPage, ]], ['bootBaremetalTF', [ TFPowerOnPage, successPage, ]], ['bootAWSTF', [ TFPowerOnPage, successPage, ]], ['bootDryRun', [ dryRunPage, ]], ]); // Lets us do 'sections.defineAWS' instead of using sections.get('defineAWS') sections.forEach((v, k) => { sections[k] = v; }); // A Trail is an immutable representation of the navigation options available to a user. // Navigation involves // - moving from one page to the next page // - moving from one page to some previous pages // - presenting a (possibly disabled) list of all pages export class Trail { constructor(trailSections, whitelist, opts={}) { this.canReset = opts.canReset; this.sections = trailSections; const sectionPages = this.sections.reduce((ls, l) => ls.concat(l), []); sectionPages.forEach(p => { if (!p.component) { throw new Error(`${p.title} has no component`); } }); this._pages = !whitelist ? sectionPages : sectionPages.filter(p => whitelist.includes(p)); this.ixByPage = this._pages.reduce((m, v, ix) => m.set(v, ix), ImmutableMap()); this.pageByPath = this._pages.reduce((m, v) => m.set(v.path, v), ImmutableMap()); } sectionFor(page) { return _.find(this.sections, s => s.includes(page)); } navigable(page) { return this.ixByPage.has(page); } // Given a path, return a "better" path for this trail. Will not navigate to that path. fixPath(path, state) { const page = this.pageByPath.get(path); if (!page) { return this._pages[0].path; } // If the NEXT button on a previous page is disabled, you // shouldn't be able to see this page. Show the first page, before // or including this one, that won't allow forward navigation. const pred = this._pages.find(p => { return p === page || !(p.component.canNavigateForward ? p.component.canNavigateForward(state) : true); }); return pred.path; } // Returns -1, 0, or 1, if a is before, the same as, or after b in the trail cmp(a, b) { return this.ixByPage.get(a) - this.ixByPage.get(b); } canNavigateForward(pageA, pageB, state) { const a = this.ixByPage.get(pageA); const b = this.ixByPage.get(pageB); if (!_.isFinite(a) || !_.isFinite(b)) { return false; } const start = Math.min(a, b); const end = Math.max(a, b); for (let i = start; i < end; i++) { const component = this._pages[i].component; if (!component.canNavigateForward) { continue; } if (!component.canNavigateForward(state)) { return false; } } return true; } // Returns the previous page in the trail if that page exists previousFrom(page) { const myIx = this.ixByPage.get(page); return this._pages[myIx - 1]; } // Returns the next page in the trail if that exists nextFrom(page) { const myIx = this.ixByPage.get(page); return this._pages[myIx + 1]; } } const doingStuff = ImmutableSet([commitPhases.REQUESTED, commitPhases.WAITING]); const platformToSection = { [AWS_TF]: { choose: new Trail([sections.choose, sections.defineAWS]), define: new Trail([sections.defineAWS], [submitDefinitionPage]), boot: new Trail([sections.bootAWSTF]), }, [BARE_METAL_TF]: { choose: new Trail([sections.choose, sections.defineBaremetal]), define: new Trail([sections.defineBaremetal], [submitDefinitionPage]), boot: new Trail([sections.bootBaremetalTF]), }, }; export const trail = ({cluster, clusterConfig, commitState}) => { let platform = clusterConfig[PLATFORM_TYPE]; const { ready } = cluster; if (platform === '') { return new Trail([sections.loading]); } if (!isSupported(platform)) { return new Trail([sections.choose]); } const { phase } = commitState; const submitted = ready || (phase === commitPhases.SUCCEEDED); if (submitted) { if (clusterConfig[DRY_RUN]) { return new Trail([sections.bootDryRun], null, {canReset: true}); } return platformToSection[platform].boot; } if (doingStuff.has(phase)) { return platformToSection[platform].define; } return platformToSection[platform].choose; }; export const getAllRoutes = () => { // No components have the same path, so this is safe. // If a user guesses an invalid URL, they could get in a weird state. Oh well. let routes = []; _.each(sections, v => { _.each(v, o => { routes.push(o); }); }); return routes; };
src/svg-icons/communication/stay-current-landscape.js
ichiohta/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let CommunicationStayCurrentLandscape = (props) => ( <SvgIcon {...props}> <path d="M1.01 7L1 17c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2H3c-1.1 0-1.99.9-1.99 2zM19 7v10H5V7h14z"/> </SvgIcon> ); CommunicationStayCurrentLandscape = pure(CommunicationStayCurrentLandscape); CommunicationStayCurrentLandscape.displayName = 'CommunicationStayCurrentLandscape'; CommunicationStayCurrentLandscape.muiName = 'SvgIcon'; export default CommunicationStayCurrentLandscape;
frontend/test/app/components/ExperimentCardList-test.js
mathjazz/testpilot
import React from 'react'; import { assert, expect } from 'chai'; import sinon from 'sinon'; import { shallow } from 'enzyme'; import ExperimentCardList from '../../../src/app/components/ExperimentCardList'; describe('app/components/ExperimentCardList', () => { let props, subject; beforeEach(() => { props = { experiments: [ { slug: 'foo' }, { slug: 'bat' } ], isExperimentEnabled: sinon.spy(() => false), // required by ExperimentRowCard {...this.props} hasAddon: true, eventCategory: 'test category', getExperimentLastSeen: sinon.spy(), sendToGA: sinon.spy(), navigateTo: sinon.spy() }; subject = shallow(<ExperimentCardList {...props} />); }); it('renders a loading screen if no experiments are available', () => { subject.setProps({ experiments: [] }); expect(subject.find('Loading')).to.have.property('length', 1); }); it('renders ExperimentRowCards for each experiment', () => { expect(subject.find('ExperimentRowCard')).to.have.length(props.experiments.length); }); it('respects an exception if specified', () => { subject.setProps({ except: props.experiments[0].slug }); expect(subject.find('ExperimentRowCard')).to.have.length(props.experiments.length - 1); }); });
techCurriculum/ui/solutions/2.5/src/App.js
jennybkim/engineeringessentials
/** * Copyright 2017 Goldman Sachs. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. **/ import React from 'react'; import Title from './components/Title'; function App() { return ( <div> <Title /> </div> ); } export default App;
packages/material-ui-icons/src/SettingsOverscanRounded.js
kybarg/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M11.62 5.99L10 8h4l-1.6-2.01c-.2-.25-.58-.25-.78 0zM18 10v4l2.01-1.6c.25-.2.25-.58 0-.78L18 10zM6 10l-2.01 1.62c-.25.2-.25.58 0 .78L6 14v-4zm8 6h-4l1.62 2.01c.2.25.58.25.78 0L14 16zm7-13H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 16.01H4c-.55 0-1-.45-1-1V5.99c0-.55.45-1 1-1h16c.55 0 1 .45 1 1v12.02c0 .55-.45 1-1 1z" /> , 'SettingsOverscanRounded');
app/containers/users/detail.js
DeividasK/my-future-ai
import React from 'react' import { Link } from 'react-router' import { connect } from 'react-redux' import { firebaseConnect, helpers } from 'react-redux-firebase' import { Container, Row, Col, InputGroup, Input, InputGroupButton, Button } from 'reactstrap' import { injectIntl } from 'react-intl' import PrimaryGoalsList from 'components/lists/primary-goals-list' import PageHeading from 'components/helper/PageHeading' import Loading from 'components/helper/Loading' import BackButton from 'components/buttons/back' import DH from 'utils/DatabaseHelper' import TH from 'utils/TranslationHelper' @firebaseConnect((props) => ([ { path: `users/${props.params.id}`, type: 'once' }, DH.getUserGoalsPath(props.params.id, { storeAs: `user_${props.params.id}_goals` }) ])) @connect(({ firebase }, props) => ({ user: helpers.dataToJS(firebase, `users/${props.params.id}`), goals: helpers.dataToJS(firebase, `user_${props.params.id}_goals`), })) class UserContainer extends React.Component { render () { const { user, goals, intl: { formatMessage } } = this.props if (user === undefined) { return <Loading /> } return ( <div className="user-detail"> <PageHeading>{ user.displayName }</PageHeading> <img src={ user.avatarUrl } /> <p className="mt-3"><b>{ formatMessage(TH.primaryGoals) }</b></p> <PrimaryGoalsList items={ goals } /> <BackButton action={ this.props.router.goBack } /> </div> ) } } export default injectIntl(UserContainer)
ajax/libs/highstock/4.2.7/highstock.src.js
sufuf3/cdnjs
// ==ClosureCompiler== // @compilation_level SIMPLE_OPTIMIZATIONS /** * @license Highstock JS v4.2.7 (2016-09-21) * * (c) 2009-2016 Torstein Honsi * * License: www.highcharts.com/license */ (function (root, factory) { if (typeof module === 'object' && module.exports) { module.exports = root.document ? factory(root) : factory; } else { root.Highcharts = factory(root); } }(typeof window !== 'undefined' ? window : this, function (win) { // eslint-disable-line no-undef // encapsulated variables var UNDEFINED, doc = win.document, math = Math, mathRound = math.round, mathFloor = math.floor, mathCeil = math.ceil, mathMax = math.max, mathMin = math.min, mathAbs = math.abs, mathCos = math.cos, mathSin = math.sin, mathPI = math.PI, deg2rad = mathPI * 2 / 360, // some variables userAgent = (win.navigator && win.navigator.userAgent) || '', isOpera = win.opera, isMS = /(msie|trident|edge)/i.test(userAgent) && !isOpera, docMode8 = doc && doc.documentMode === 8, isWebKit = !isMS && /AppleWebKit/.test(userAgent), isFirefox = /Firefox/.test(userAgent), isTouchDevice = /(Mobile|Android|Windows Phone)/.test(userAgent), SVG_NS = 'http://www.w3.org/2000/svg', hasSVG = doc && doc.createElementNS && !!doc.createElementNS(SVG_NS, 'svg').createSVGRect, hasBidiBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4, // issue #38 useCanVG = doc && !hasSVG && !isMS && !!doc.createElement('canvas').getContext, Renderer, hasTouch, symbolSizes = {}, idCounter = 0, garbageBin, defaultOptions, dateFormat, // function pathAnim, timeUnits, noop = function () {}, charts = [], chartCount = 0, PRODUCT = 'Highstock', VERSION = '4.2.7', // some constants for frequently used strings DIV = 'div', ABSOLUTE = 'absolute', RELATIVE = 'relative', HIDDEN = 'hidden', PREFIX = 'highcharts-', VISIBLE = 'visible', PX = 'px', NONE = 'none', M = 'M', L = 'L', numRegex = /[0-9]/g, NORMAL_STATE = '', HOVER_STATE = 'hover', SELECT_STATE = 'select', marginNames = ['plotTop', 'marginRight', 'marginBottom', 'plotLeft'], // Object for extending Axis AxisPlotLineOrBandExtension, // constants for attributes STROKE_WIDTH = 'stroke-width', // time methods, changed based on whether or not UTC is used Date, // Allow using a different Date class makeTime, timezoneOffset, getTimezoneOffset, getMinutes, getHours, getDay, getDate, getMonth, getFullYear, setMilliseconds, setSeconds, setMinutes, setHours, setDate, setMonth, setFullYear, // lookup over the types and the associated classes seriesTypes = {}, Highcharts; /** * Provide error messages for debugging, with links to online explanation */ function error(code, stop) { var msg = 'Highcharts error #' + code + ': www.highcharts.com/errors/' + code; if (stop) { throw new Error(msg); } // else ... if (win.console) { console.log(msg); // eslint-disable-line no-console } } // The Highcharts namespace Highcharts = win.Highcharts ? error(16, true) : { win: win }; Highcharts.seriesTypes = seriesTypes; var timers = [], getStyle, // Previous adapter functions inArray, each, grep, offset, map, addEvent, removeEvent, fireEvent, animate, stop; /** * An animator object. One instance applies to one property (attribute or style prop) * on one element. * * @param {object} elem The element to animate. May be a DOM element or a Highcharts SVGElement wrapper. * @param {object} options Animation options, including duration, easing, step and complete. * @param {object} prop The property to animate. */ function Fx(elem, options, prop) { this.options = options; this.elem = elem; this.prop = prop; } Fx.prototype = { /** * Animating a path definition on SVGElement * @returns {undefined} */ dSetter: function () { var start = this.paths[0], end = this.paths[1], ret = [], now = this.now, i = start.length, startVal; if (now === 1) { // land on the final path without adjustment points appended in the ends ret = this.toD; } else if (i === end.length && now < 1) { while (i--) { startVal = parseFloat(start[i]); ret[i] = isNaN(startVal) ? // a letter instruction like M or L start[i] : now * (parseFloat(end[i] - startVal)) + startVal; } } else { // if animation is finished or length not matching, land on right value ret = end; } this.elem.attr('d', ret); }, /** * Update the element with the current animation step * @returns {undefined} */ update: function () { var elem = this.elem, prop = this.prop, // if destroyed, it is null now = this.now, step = this.options.step; // Animation setter defined from outside if (this[prop + 'Setter']) { this[prop + 'Setter'](); // Other animations on SVGElement } else if (elem.attr) { if (elem.element) { elem.attr(prop, now); } // HTML styles, raw HTML content like container size } else { elem.style[prop] = now + this.unit; } if (step) { step.call(elem, now, this); } }, /** * Run an animation */ run: function (from, to, unit) { var self = this, timer = function (gotoEnd) { return timer.stopped ? false : self.step(gotoEnd); }, i; this.startTime = +new Date(); this.start = from; this.end = to; this.unit = unit; this.now = this.start; this.pos = 0; timer.elem = this.elem; if (timer() && timers.push(timer) === 1) { timer.timerId = setInterval(function () { for (i = 0; i < timers.length; i++) { if (!timers[i]()) { timers.splice(i--, 1); } } if (!timers.length) { clearInterval(timer.timerId); } }, 13); } }, /** * Run a single step in the animation * @param {Boolean} gotoEnd Whether to go to then endpoint of the animation after abort * @returns {Boolean} True if animation continues */ step: function (gotoEnd) { var t = +new Date(), ret, done, options = this.options, elem = this.elem, complete = options.complete, duration = options.duration, curAnim = options.curAnim, i; if (elem.attr && !elem.element) { // #2616, element including flag is destroyed ret = false; } else if (gotoEnd || t >= duration + this.startTime) { this.now = this.end; this.pos = 1; this.update(); curAnim[this.prop] = true; done = true; for (i in curAnim) { if (curAnim[i] !== true) { done = false; } } if (done && complete) { complete.call(elem); } ret = false; } else { this.pos = options.easing((t - this.startTime) / duration); this.now = this.start + ((this.end - this.start) * this.pos); this.update(); ret = true; } return ret; }, /** * Prepare start and end values so that the path can be animated one to one */ initPath: function (elem, fromD, toD) { fromD = fromD || ''; var shift, startX = elem.startX, endX = elem.endX, bezier = fromD.indexOf('C') > -1, numParams = bezier ? 7 : 3, fullLength, slice, i, start = fromD.split(' '), end = toD.slice(), // copy isArea = elem.isArea, positionFactor = isArea ? 2 : 1, reverse; /** * In splines make move points have six parameters like bezier curves */ function sixify(arr) { i = arr.length; while (i--) { if (arr[i] === M || arr[i] === L) { arr.splice(i + 1, 0, arr[i + 1], arr[i + 2], arr[i + 1], arr[i + 2]); } } } /** * Insert an array at the given position of another array */ function insertSlice(arr, subArr, index) { [].splice.apply( arr, [index, 0].concat(subArr) ); } /** * If shifting points, prepend a dummy point to the end path. */ function prepend(arr, other) { while (arr.length < fullLength) { // Move to, line to or curve to? arr[0] = other[fullLength - arr.length]; // Prepend a copy of the first point insertSlice(arr, arr.slice(0, numParams), 0); // For areas, the bottom path goes back again to the left, so we need // to append a copy of the last point. if (isArea) { insertSlice(arr, arr.slice(arr.length - numParams), arr.length); i--; } } arr[0] = 'M'; } /** * Copy and append last point until the length matches the end length */ function append(arr, other) { var i = (fullLength - arr.length) / numParams; while (i > 0 && i--) { // Pull out the slice that is going to be appended or inserted. In a line graph, // the positionFactor is 1, and the last point is sliced out. In an area graph, // the positionFactor is 2, causing the middle two points to be sliced out, since // an area path starts at left, follows the upper path then turns and follows the // bottom back. slice = arr.slice().splice( (arr.length / positionFactor) - numParams, numParams * positionFactor ); // Move to, line to or curve to? slice[0] = other[fullLength - numParams - (i * numParams)]; // Disable first control point if (bezier) { slice[numParams - 6] = slice[numParams - 2]; slice[numParams - 5] = slice[numParams - 1]; } // Now insert the slice, either in the middle (for areas) or at the end (for lines) insertSlice(arr, slice, arr.length / positionFactor); if (isArea) { i--; } } } if (bezier) { sixify(start); sixify(end); } // For sideways animation, find out how much we need to shift to get the start path Xs // to match the end path Xs. if (startX && endX) { for (i = 0; i < startX.length; i++) { if (startX[i] === endX[0]) { // Moving left, new points coming in on right shift = i; break; } else if (startX[0] === endX[endX.length - startX.length + i]) { // Moving right shift = i; reverse = true; break; } } if (shift === undefined) { start = []; } } if (start.length && Highcharts.isNumber(shift)) { // The common target length for the start and end array, where both // arrays are padded in opposite ends fullLength = end.length + shift * positionFactor * numParams; if (!reverse) { prepend(end, start); append(start, end); } else { prepend(start, end); append(end, start); } } return [start, end]; } }; // End of Fx prototype /** * Extend an object with the members of another * @param {Object} a The object to be extended * @param {Object} b The object to add to the first one */ var extend = Highcharts.extend = function (a, b) { var n; if (!a) { a = {}; } for (n in b) { a[n] = b[n]; } return a; }; /** * Deep merge two or more objects and return a third object. If the first argument is * true, the contents of the second object is copied into the first object. * Previously this function redirected to jQuery.extend(true), but this had two limitations. * First, it deep merged arrays, which lead to workarounds in Highcharts. Second, * it copied properties from extended prototypes. */ function merge() { var i, args = arguments, len, ret = {}, doCopy = function (copy, original) { var value, key; // An object is replacing a primitive if (typeof copy !== 'object') { copy = {}; } for (key in original) { if (original.hasOwnProperty(key)) { value = original[key]; // Copy the contents of objects, but not arrays or DOM nodes if (Highcharts.isObject(value, true) && key !== 'renderTo' && typeof value.nodeType !== 'number') { copy[key] = doCopy(copy[key] || {}, value); // Primitives and arrays are copied over directly } else { copy[key] = original[key]; } } } return copy; }; // If first argument is true, copy into the existing object. Used in setOptions. if (args[0] === true) { ret = args[1]; args = Array.prototype.slice.call(args, 2); } // For each argument, extend the return len = args.length; for (i = 0; i < len; i++) { ret = doCopy(ret, args[i]); } return ret; } /** * Shortcut for parseInt * @param {Object} s * @param {Number} mag Magnitude */ function pInt(s, mag) { return parseInt(s, mag || 10); } /** * Check for string * @param {Object} s */ function isString(s) { return typeof s === 'string'; } /** * Check for array * @param {Object} obj */ function isArray(obj) { var str = Object.prototype.toString.call(obj); return str === '[object Array]' || str === '[object Array Iterator]'; } /** * Check for object * @param {Object} obj * @param {Boolean} strict Also checks that the object is not an array */ var isObject = Highcharts.isObject = function (obj, strict) { //debugger; return obj && typeof obj === 'object' && (!strict || !isArray(obj)); }; /** * Check for number * @param {Object} n */ var isNumber = Highcharts.isNumber = function isNumber(n) { return typeof n === 'number' && !isNaN(n); }; /** * Remove last occurence of an item from an array * @param {Array} arr * @param {Mixed} item */ function erase(arr, item) { var i = arr.length; while (i--) { if (arr[i] === item) { arr.splice(i, 1); break; } } //return arr; } /** * Returns true if the object is not null or undefined. * @param {Object} obj */ function defined(obj) { return obj !== UNDEFINED && obj !== null; } /** * Set or get an attribute or an object of attributes. Can't use jQuery attr because * it attempts to set expando properties on the SVG element, which is not allowed. * * @param {Object} elem The DOM element to receive the attribute(s) * @param {String|Object} prop The property or an abject of key-value pairs * @param {String} value The value if a single property is set */ function attr(elem, prop, value) { var key, ret; // if the prop is a string if (isString(prop)) { // set the value if (defined(value)) { elem.setAttribute(prop, value); // get the value } else if (elem && elem.getAttribute) { // elem not defined when printing pie demo... ret = elem.getAttribute(prop); } // else if prop is defined, it is a hash of key/value pairs } else if (defined(prop) && isObject(prop)) { for (key in prop) { elem.setAttribute(key, prop[key]); } } return ret; } /** * Check if an element is an array, and if not, make it into an array. */ function splat(obj) { return isArray(obj) ? obj : [obj]; } /** * Set a timeout if the delay is given, otherwise perform the function synchronously * @param {Function} fn The function to perform * @param {Number} delay Delay in milliseconds * @param {Ojbect} context The context * @returns {Nubmer} An identifier for the timeout */ function syncTimeout(fn, delay, context) { if (delay) { return setTimeout(fn, delay, context); } fn.call(0, context); } /** * Return the first value that is defined. */ var pick = Highcharts.pick = function () { var args = arguments, i, arg, length = args.length; for (i = 0; i < length; i++) { arg = args[i]; if (arg !== UNDEFINED && arg !== null) { return arg; } } }; /** * Set CSS on a given element * @param {Object} el * @param {Object} styles Style object with camel case property names */ function css(el, styles) { if (isMS && !hasSVG) { // #2686 if (styles && styles.opacity !== UNDEFINED) { styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')'; } } extend(el.style, styles); } /** * Utility function to create element with attributes and styles * @param {Object} tag * @param {Object} attribs * @param {Object} styles * @param {Object} parent * @param {Object} nopad */ function createElement(tag, attribs, styles, parent, nopad) { var el = doc.createElement(tag); if (attribs) { extend(el, attribs); } if (nopad) { css(el, { padding: 0, border: 'none', margin: 0 }); } if (styles) { css(el, styles); } if (parent) { parent.appendChild(el); } return el; } /** * Extend a prototyped class by new members * @param {Object} parent * @param {Object} members */ function extendClass(Parent, members) { var object = function () { }; object.prototype = new Parent(); extend(object.prototype, members); return object; } /** * Pad a string to a given length by adding 0 to the beginning * @param {Number} number * @param {Number} length */ function pad(number, length, padder) { return new Array((length || 2) + 1 - String(number).length).join(padder || 0) + number; } /** * Return a length based on either the integer value, or a percentage of a base. */ function relativeLength(value, base) { return (/%$/).test(value) ? base * parseFloat(value) / 100 : parseFloat(value); } /** * Wrap a method with extended functionality, preserving the original function * @param {Object} obj The context object that the method belongs to * @param {String} method The name of the method to extend * @param {Function} func A wrapper function callback. This function is called with the same arguments * as the original function, except that the original function is unshifted and passed as the first * argument. */ var wrap = Highcharts.wrap = function (obj, method, func) { var proceed = obj[method]; obj[method] = function () { var args = Array.prototype.slice.call(arguments); args.unshift(proceed); return func.apply(this, args); }; }; function getTZOffset(timestamp) { return ((getTimezoneOffset && getTimezoneOffset(timestamp)) || timezoneOffset || 0) * 60000; } /** * Based on http://www.php.net/manual/en/function.strftime.php * @param {String} format * @param {Number} timestamp * @param {Boolean} capitalize */ dateFormat = function (format, timestamp, capitalize) { if (!defined(timestamp) || isNaN(timestamp)) { return defaultOptions.lang.invalidDate || ''; } format = pick(format, '%Y-%m-%d %H:%M:%S'); var date = new Date(timestamp - getTZOffset(timestamp)), key, // used in for constuct below // get the basic time values hours = date[getHours](), day = date[getDay](), dayOfMonth = date[getDate](), month = date[getMonth](), fullYear = date[getFullYear](), lang = defaultOptions.lang, langWeekdays = lang.weekdays, shortWeekdays = lang.shortWeekdays, // List all format keys. Custom formats can be added from the outside. replacements = extend({ // Day 'a': shortWeekdays ? shortWeekdays[day] : langWeekdays[day].substr(0, 3), // Short weekday, like 'Mon' 'A': langWeekdays[day], // Long weekday, like 'Monday' 'd': pad(dayOfMonth), // Two digit day of the month, 01 to 31 'e': pad(dayOfMonth, 2, ' '), // Day of the month, 1 through 31 'w': day, // Week (none implemented) //'W': weekNumber(), // Month 'b': lang.shortMonths[month], // Short month, like 'Jan' 'B': lang.months[month], // Long month, like 'January' 'm': pad(month + 1), // Two digit month number, 01 through 12 // Year 'y': fullYear.toString().substr(2, 2), // Two digits year, like 09 for 2009 'Y': fullYear, // Four digits year, like 2009 // Time 'H': pad(hours), // Two digits hours in 24h format, 00 through 23 'k': hours, // Hours in 24h format, 0 through 23 'I': pad((hours % 12) || 12), // Two digits hours in 12h format, 00 through 11 'l': (hours % 12) || 12, // Hours in 12h format, 1 through 12 'M': pad(date[getMinutes]()), // Two digits minutes, 00 through 59 'p': hours < 12 ? 'AM' : 'PM', // Upper case AM or PM 'P': hours < 12 ? 'am' : 'pm', // Lower case AM or PM 'S': pad(date.getSeconds()), // Two digits seconds, 00 through 59 'L': pad(mathRound(timestamp % 1000), 3) // Milliseconds (naming from Ruby) }, Highcharts.dateFormats); // do the replaces for (key in replacements) { while (format.indexOf('%' + key) !== -1) { // regex would do it in one line, but this is faster format = format.replace('%' + key, typeof replacements[key] === 'function' ? replacements[key](timestamp) : replacements[key]); } } // Optionally capitalize the string and return return capitalize ? format.substr(0, 1).toUpperCase() + format.substr(1) : format; }; /** * Format a single variable. Similar to sprintf, without the % prefix. */ function formatSingle(format, val) { var floatRegex = /f$/, decRegex = /\.([0-9])/, lang = defaultOptions.lang, decimals; if (floatRegex.test(format)) { // float decimals = format.match(decRegex); decimals = decimals ? decimals[1] : -1; if (val !== null) { val = Highcharts.numberFormat( val, decimals, lang.decimalPoint, format.indexOf(',') > -1 ? lang.thousandsSep : '' ); } } else { val = dateFormat(format, val); } return val; } /** * Format a string according to a subset of the rules of Python's String.format method. */ function format(str, ctx) { var splitter = '{', isInside = false, segment, valueAndFormat, path, i, len, ret = [], val, index; while ((index = str.indexOf(splitter)) !== -1) { segment = str.slice(0, index); if (isInside) { // we're on the closing bracket looking back valueAndFormat = segment.split(':'); path = valueAndFormat.shift().split('.'); // get first and leave format len = path.length; val = ctx; // Assign deeper paths for (i = 0; i < len; i++) { val = val[path[i]]; } // Format the replacement if (valueAndFormat.length) { val = formatSingle(valueAndFormat.join(':'), val); } // Push the result and advance the cursor ret.push(val); } else { ret.push(segment); } str = str.slice(index + 1); // the rest isInside = !isInside; // toggle splitter = isInside ? '}' : '{'; // now look for next matching bracket } ret.push(str); return ret.join(''); } /** * Get the magnitude of a number */ function getMagnitude(num) { return math.pow(10, mathFloor(math.log(num) / math.LN10)); } /** * Take an interval and normalize it to multiples of 1, 2, 2.5 and 5 * @param {Number} interval * @param {Array} multiples * @param {Number} magnitude * @param {Object} options */ function normalizeTickInterval(interval, multiples, magnitude, allowDecimals, preventExceed) { var normalized, i, retInterval = interval; // round to a tenfold of 1, 2, 2.5 or 5 magnitude = pick(magnitude, 1); normalized = interval / magnitude; // multiples for a linear scale if (!multiples) { multiples = [1, 2, 2.5, 5, 10]; // the allowDecimals option if (allowDecimals === false) { if (magnitude === 1) { multiples = [1, 2, 5, 10]; } else if (magnitude <= 0.1) { multiples = [1 / magnitude]; } } } // normalize the interval to the nearest multiple for (i = 0; i < multiples.length; i++) { retInterval = multiples[i]; if ((preventExceed && retInterval * magnitude >= interval) || // only allow tick amounts smaller than natural (!preventExceed && (normalized <= (multiples[i] + (multiples[i + 1] || multiples[i])) / 2))) { break; } } // multiply back to the correct magnitude retInterval *= magnitude; return retInterval; } /** * Utility method that sorts an object array and keeping the order of equal items. * ECMA script standard does not specify the behaviour when items are equal. */ function stableSort(arr, sortFunction) { var length = arr.length, sortValue, i; // Add index to each item for (i = 0; i < length; i++) { arr[i].safeI = i; // stable sort index } arr.sort(function (a, b) { sortValue = sortFunction(a, b); return sortValue === 0 ? a.safeI - b.safeI : sortValue; }); // Remove index from items for (i = 0; i < length; i++) { delete arr[i].safeI; // stable sort index } } /** * Non-recursive method to find the lowest member of an array. Math.min raises a maximum * call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This * method is slightly slower, but safe. */ function arrayMin(data) { var i = data.length, min = data[0]; while (i--) { if (data[i] < min) { min = data[i]; } } return min; } /** * Non-recursive method to find the lowest member of an array. Math.min raises a maximum * call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This * method is slightly slower, but safe. */ function arrayMax(data) { var i = data.length, max = data[0]; while (i--) { if (data[i] > max) { max = data[i]; } } return max; } /** * Utility method that destroys any SVGElement or VMLElement that are properties on the given object. * It loops all properties and invokes destroy if there is a destroy method. The property is * then delete'ed. * @param {Object} The object to destroy properties on * @param {Object} Exception, do not destroy this property, only delete it. */ function destroyObjectProperties(obj, except) { var n; for (n in obj) { // If the object is non-null and destroy is defined if (obj[n] && obj[n] !== except && obj[n].destroy) { // Invoke the destroy obj[n].destroy(); } // Delete the property from the object. delete obj[n]; } } /** * Discard an element by moving it to the bin and delete * @param {Object} The HTML node to discard */ function discardElement(element) { // create a garbage bin element, not part of the DOM if (!garbageBin) { garbageBin = createElement(DIV); } // move the node and empty bin if (element) { garbageBin.appendChild(element); } garbageBin.innerHTML = ''; } /** * Fix JS round off float errors * @param {Number} num */ function correctFloat(num, prec) { return parseFloat( num.toPrecision(prec || 14) ); } /** * Set the global animation to either a given value, or fall back to the * given chart's animation option * @param {Object} animation * @param {Object} chart */ function setAnimation(animation, chart) { chart.renderer.globalAnimation = pick(animation, chart.animation); } /** * Get the animation in object form, where a disabled animation is always * returned with duration: 0 */ function animObject(animation) { return isObject(animation) ? merge(animation) : { duration: animation ? 500 : 0 }; } /** * The time unit lookup */ timeUnits = { millisecond: 1, second: 1000, minute: 60000, hour: 3600000, day: 24 * 3600000, week: 7 * 24 * 3600000, month: 28 * 24 * 3600000, year: 364 * 24 * 3600000 }; /** * Format a number and return a string based on input settings * @param {Number} number The input number to format * @param {Number} decimals The amount of decimals * @param {String} decimalPoint The decimal point, defaults to the one given in the lang options * @param {String} thousandsSep The thousands separator, defaults to the one given in the lang options */ Highcharts.numberFormat = function (number, decimals, decimalPoint, thousandsSep) { number = +number || 0; decimals = +decimals; var lang = defaultOptions.lang, origDec = (number.toString().split('.')[1] || '').length, decimalComponent, strinteger, thousands, absNumber = Math.abs(number), ret; if (decimals === -1) { decimals = Math.min(origDec, 20); // Preserve decimals. Not huge numbers (#3793). } else if (!isNumber(decimals)) { decimals = 2; } // A string containing the positive integer component of the number strinteger = String(pInt(absNumber.toFixed(decimals))); // Leftover after grouping into thousands. Can be 0, 1 or 3. thousands = strinteger.length > 3 ? strinteger.length % 3 : 0; // Language decimalPoint = pick(decimalPoint, lang.decimalPoint); thousandsSep = pick(thousandsSep, lang.thousandsSep); // Start building the return ret = number < 0 ? '-' : ''; // Add the leftover after grouping into thousands. For example, in the number 42 000 000, // this line adds 42. ret += thousands ? strinteger.substr(0, thousands) + thousandsSep : ''; // Add the remaining thousands groups, joined by the thousands separator ret += strinteger.substr(thousands).replace(/(\d{3})(?=\d)/g, '$1' + thousandsSep); // Add the decimal point and the decimal component if (decimals) { // Get the decimal component, and add power to avoid rounding errors with float numbers (#4573) decimalComponent = Math.abs(absNumber - strinteger + Math.pow(10, -Math.max(decimals, origDec) - 1)); ret += decimalPoint + decimalComponent.toFixed(decimals).slice(2); } return ret; }; /** * Easing definition * @param {Number} pos Current position, ranging from 0 to 1 */ Math.easeInOutSine = function (pos) { return -0.5 * (Math.cos(Math.PI * pos) - 1); }; /** * Internal method to return CSS value for given element and property */ getStyle = function (el, prop) { var style; // For width and height, return the actual inner pixel size (#4913) if (prop === 'width') { return Math.min(el.offsetWidth, el.scrollWidth) - getStyle(el, 'padding-left') - getStyle(el, 'padding-right'); } else if (prop === 'height') { return Math.min(el.offsetHeight, el.scrollHeight) - getStyle(el, 'padding-top') - getStyle(el, 'padding-bottom'); } // Otherwise, get the computed style style = win.getComputedStyle(el, undefined); return style && pInt(style.getPropertyValue(prop)); }; /** * Return the index of an item in an array, or -1 if not found */ inArray = function (item, arr) { return arr.indexOf ? arr.indexOf(item) : [].indexOf.call(arr, item); }; /** * Filter an array */ grep = function (elements, callback) { return [].filter.call(elements, callback); }; /** * Map an array */ map = function (arr, fn) { var results = [], i = 0, len = arr.length; for (; i < len; i++) { results[i] = fn.call(arr[i], arr[i], i, arr); } return results; }; /** * Get the element's offset position, corrected by overflow:auto. */ offset = function (el) { var docElem = doc.documentElement, box = el.getBoundingClientRect(); return { top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) }; }; /** * Stop running animation. * A possible extension to this would be to stop a single property, when * we want to continue animating others. Then assign the prop to the timer * in the Fx.run method, and check for the prop here. This would be an improvement * in all cases where we stop the animation from .attr. Instead of stopping * everything, we can just stop the actual attributes we're setting. */ stop = function (el) { var i = timers.length; // Remove timers related to this element (#4519) while (i--) { if (timers[i].elem === el) { timers[i].stopped = true; // #4667 } } }; /** * Utility for iterating over an array. * @param {Array} arr * @param {Function} fn */ each = function (arr, fn) { // modern browsers return Array.prototype.forEach.call(arr, fn); }; /** * Add an event listener */ addEvent = function (el, type, fn) { var events = el.hcEvents = el.hcEvents || {}; function wrappedFn(e) { e.target = e.srcElement || win; // #2820 fn.call(el, e); } // Handle DOM events in modern browsers if (el.addEventListener) { el.addEventListener(type, fn, false); // Handle old IE implementation } else if (el.attachEvent) { if (!el.hcEventsIE) { el.hcEventsIE = {}; } // Link wrapped fn with original fn, so we can get this in removeEvent el.hcEventsIE[fn.toString()] = wrappedFn; el.attachEvent('on' + type, wrappedFn); } if (!events[type]) { events[type] = []; } events[type].push(fn); }; /** * Remove event added with addEvent */ removeEvent = function (el, type, fn) { var events, hcEvents = el.hcEvents, index; function removeOneEvent(type, fn) { if (el.removeEventListener) { el.removeEventListener(type, fn, false); } else if (el.attachEvent) { fn = el.hcEventsIE[fn.toString()]; el.detachEvent('on' + type, fn); } } function removeAllEvents() { var types, len, n; if (!el.nodeName) { return; // break on non-DOM events } if (type) { types = {}; types[type] = true; } else { types = hcEvents; } for (n in types) { if (hcEvents[n]) { len = hcEvents[n].length; while (len--) { removeOneEvent(n, hcEvents[n][len]); } } } } if (hcEvents) { if (type) { events = hcEvents[type] || []; if (fn) { index = inArray(fn, events); if (index > -1) { events.splice(index, 1); hcEvents[type] = events; } removeOneEvent(type, fn); } else { removeAllEvents(); hcEvents[type] = []; } } else { removeAllEvents(); el.hcEvents = {}; } } }; /** * Fire an event on a custom object */ fireEvent = function (el, type, eventArguments, defaultFunction) { var e, hcEvents = el.hcEvents, events, len, i, fn; eventArguments = eventArguments || {}; if (doc.createEvent && (el.dispatchEvent || el.fireEvent)) { e = doc.createEvent('Events'); e.initEvent(type, true, true); e.target = el; extend(e, eventArguments); if (el.dispatchEvent) { el.dispatchEvent(e); } else { el.fireEvent(type, e); } } else if (hcEvents) { events = hcEvents[type] || []; len = events.length; // Attach a simple preventDefault function to skip default handler if called. // The built-in defaultPrevented property is not overwritable (#5112) if (!eventArguments.preventDefault) { eventArguments.preventDefault = function () { eventArguments.defaultPrevented = true; }; } eventArguments.target = el; // If the type is not set, we're running a custom event (#2297). If it is set, // we're running a browser event, and setting it will cause en error in // IE8 (#2465). if (!eventArguments.type) { eventArguments.type = type; } for (i = 0; i < len; i++) { fn = events[i]; // If the event handler return false, prevent the default handler from executing if (fn && fn.call(el, eventArguments) === false) { eventArguments.preventDefault(); } } } // Run the default if not prevented if (defaultFunction && !eventArguments.defaultPrevented) { defaultFunction(eventArguments); } }; /** * The global animate method, which uses Fx to create individual animators. */ animate = function (el, params, opt) { var start, unit = '', end, fx, args, prop; if (!isObject(opt)) { // Number or undefined/null args = arguments; opt = { duration: args[2], easing: args[3], complete: args[4] }; } if (!isNumber(opt.duration)) { opt.duration = 400; } opt.easing = typeof opt.easing === 'function' ? opt.easing : (Math[opt.easing] || Math.easeInOutSine); opt.curAnim = merge(params); for (prop in params) { fx = new Fx(el, opt, prop); end = null; if (prop === 'd') { fx.paths = fx.initPath( el, el.d, params.d ); fx.toD = params.d; start = 0; end = 1; } else if (el.attr) { start = el.attr(prop); } else { start = parseFloat(getStyle(el, prop)) || 0; if (prop !== 'opacity') { unit = 'px'; } } if (!end) { end = params[prop]; } if (end.match && end.match('px')) { end = end.replace(/px/g, ''); // #4351 } fx.run(start, end, unit); } }; /** * Register Highcharts as a plugin in jQuery */ if (win.jQuery) { win.jQuery.fn.highcharts = function () { var args = [].slice.call(arguments); if (this[0]) { // this[0] is the renderTo div // Create the chart if (args[0]) { new Highcharts[ // eslint-disable-line no-new isString(args[0]) ? args.shift() : 'Chart' // Constructor defaults to Chart ](this[0], args[0], args[1]); return this; } // When called without parameters or with the return argument, return an existing chart return charts[attr(this[0], 'data-highcharts-chart')]; } }; } /** * Compatibility section to add support for legacy IE. This can be removed if old IE * support is not needed. */ if (doc && !doc.defaultView) { getStyle = function (el, prop) { var val, alias = { width: 'clientWidth', height: 'clientHeight' }[prop]; if (el.style[prop]) { return pInt(el.style[prop]); } if (prop === 'opacity') { prop = 'filter'; } // Getting the rendered width and height if (alias) { el.style.zoom = 1; return Math.max(el[alias] - 2 * getStyle(el, 'padding'), 0); } val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b) { return b.toUpperCase(); })]; if (prop === 'filter') { val = val.replace( /alpha\(opacity=([0-9]+)\)/, function (a, b) { return b / 100; } ); } return val === '' ? 1 : pInt(val); }; } if (!Array.prototype.forEach) { each = function (arr, fn) { // legacy var i = 0, len = arr.length; for (; i < len; i++) { if (fn.call(arr[i], arr[i], i, arr) === false) { return i; } } }; } if (!Array.prototype.indexOf) { inArray = function (item, arr) { var len, i = 0; if (arr) { len = arr.length; for (; i < len; i++) { if (arr[i] === item) { return i; } } } return -1; }; } if (!Array.prototype.filter) { grep = function (elements, fn) { var ret = [], i = 0, length = elements.length; for (; i < length; i++) { if (fn(elements[i], i)) { ret.push(elements[i]); } } return ret; }; } //--- End compatibility section --- // Expose utilities Highcharts.Fx = Fx; Highcharts.inArray = inArray; Highcharts.each = each; Highcharts.grep = grep; Highcharts.offset = offset; Highcharts.map = map; Highcharts.addEvent = addEvent; Highcharts.removeEvent = removeEvent; Highcharts.fireEvent = fireEvent; Highcharts.animate = animate; Highcharts.animObject = animObject; Highcharts.stop = stop; /* **************************************************************************** * Handle the options * *****************************************************************************/ defaultOptions = { colors: ['#7cb5ec', '#434348', '#90ed7d', '#f7a35c', '#8085e9', '#f15c80', '#e4d354', '#2b908f', '#f45b5b', '#91e8e1'], symbols: ['circle', 'diamond', 'square', 'triangle', 'triangle-down'], lang: { loading: 'Loading...', months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // invalidDate: '', decimalPoint: '.', numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'], // SI prefixes used in axis labels resetZoom: 'Reset zoom', resetZoomTitle: 'Reset zoom level 1:1', thousandsSep: ' ' }, global: { useUTC: true, //timezoneOffset: 0, canvasToolsURL: 'http://code.highcharts.com/modules/canvas-tools.js', VMLRadialGradientURL: 'http://code.highcharts.com/stock/4.2.7/gfx/vml-radial-gradient.png' }, chart: { //animation: true, //alignTicks: false, //reflow: true, //className: null, //events: { load, selection }, //margin: [null], //marginTop: null, //marginRight: null, //marginBottom: null, //marginLeft: null, borderColor: '#4572A7', //borderWidth: 0, borderRadius: 0, defaultSeriesType: 'line', ignoreHiddenSeries: true, //inverted: false, //shadow: false, spacing: [10, 10, 15, 10], //spacingTop: 10, //spacingRight: 10, //spacingBottom: 15, //spacingLeft: 10, //style: { // fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', // default font // fontSize: '12px' //}, backgroundColor: '#FFFFFF', //plotBackgroundColor: null, plotBorderColor: '#C0C0C0', //plotBorderWidth: 0, //plotShadow: false, //zoomType: '' resetZoomButton: { theme: { zIndex: 20 }, position: { align: 'right', x: -10, //verticalAlign: 'top', y: 10 } // relativeTo: 'plot' }, width: null, height: null }, title: { text: 'Chart title', align: 'center', // floating: false, margin: 15, // x: 0, // verticalAlign: 'top', // y: null, style: { color: '#333333', fontSize: '18px' }, widthAdjust: -44 }, subtitle: { text: '', align: 'center', // floating: false // x: 0, // verticalAlign: 'top', // y: null, style: { color: '#555555' }, widthAdjust: -44 }, plotOptions: { line: { // base series options allowPointSelect: false, showCheckbox: false, animation: { duration: 1000 }, //connectNulls: false, //cursor: 'default', //clip: true, //dashStyle: null, //enableMouseTracking: true, events: {}, //legendIndex: 0, //linecap: 'round', lineWidth: 2, //shadow: false, // stacking: null, marker: { //enabled: true, //symbol: null, lineWidth: 0, radius: 4, lineColor: '#FFFFFF', //fillColor: null, states: { // states for a single point hover: { enabled: true, lineWidthPlus: 1, radiusPlus: 2 }, select: { fillColor: '#FFFFFF', lineColor: '#000000', lineWidth: 2 } } }, point: { events: {} }, dataLabels: { align: 'center', // defer: true, // enabled: false, formatter: function () { return this.y === null ? '' : Highcharts.numberFormat(this.y, -1); }, style: { color: 'contrast', fontSize: '11px', fontWeight: 'bold', textShadow: '0 0 6px contrast, 0 0 3px contrast' }, verticalAlign: 'bottom', // above singular point x: 0, y: 0, // backgroundColor: undefined, // borderColor: undefined, // borderRadius: undefined, // borderWidth: undefined, padding: 5 // shadow: false }, cropThreshold: 300, // draw points outside the plot area when the number of points is less than this pointRange: 0, //pointStart: 0, //pointInterval: 1, //showInLegend: null, // auto: true for standalone series, false for linked series softThreshold: true, states: { // states for the entire series hover: { //enabled: false, lineWidthPlus: 1, marker: { // lineWidth: base + 1, // radius: base + 1 }, halo: { size: 10, opacity: 0.25 } }, select: { marker: {} } }, stickyTracking: true, //tooltip: { //pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y}</b>' //valueDecimals: null, //xDateFormat: '%A, %b %e, %Y', //valuePrefix: '', //ySuffix: '' //} turboThreshold: 1000 // zIndex: null } }, labels: { //items: [], style: { //font: defaultFont, position: ABSOLUTE, color: '#3E576F' } }, legend: { enabled: true, align: 'center', //floating: false, layout: 'horizontal', labelFormatter: function () { return this.name; }, //borderWidth: 0, borderColor: '#909090', borderRadius: 0, navigation: { // animation: true, activeColor: '#274b6d', // arrowSize: 12 inactiveColor: '#CCC' // style: {} // text styles }, // margin: 20, // reversed: false, shadow: false, // backgroundColor: null, /*style: { padding: '5px' },*/ itemStyle: { color: '#333333', fontSize: '12px', fontWeight: 'bold' }, itemHoverStyle: { //cursor: 'pointer', removed as of #601 color: '#000' }, itemHiddenStyle: { color: '#CCC' }, itemCheckboxStyle: { position: ABSOLUTE, width: '13px', // for IE precision height: '13px' }, // itemWidth: undefined, // symbolRadius: 0, // symbolWidth: 16, symbolPadding: 5, verticalAlign: 'bottom', // width: undefined, x: 0, y: 0, title: { //text: null, style: { fontWeight: 'bold' } } }, loading: { // hideDuration: 100, labelStyle: { fontWeight: 'bold', position: RELATIVE, top: '45%' }, // showDuration: 0, style: { position: ABSOLUTE, backgroundColor: 'white', opacity: 0.5, textAlign: 'center' } }, tooltip: { enabled: true, animation: hasSVG, //crosshairs: null, backgroundColor: 'rgba(249, 249, 249, .85)', borderWidth: 1, borderRadius: 3, dateTimeLabelFormats: { millisecond: '%A, %b %e, %H:%M:%S.%L', second: '%A, %b %e, %H:%M:%S', minute: '%A, %b %e, %H:%M', hour: '%A, %b %e, %H:%M', day: '%A, %b %e, %Y', week: 'Week from %A, %b %e, %Y', month: '%B %Y', year: '%Y' }, footerFormat: '', //formatter: defaultFormatter, headerFormat: '<span style="font-size: 10px">{point.key}</span><br/>', pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y}</b><br/>', shadow: true, //shape: 'callout', //shared: false, snap: isTouchDevice ? 25 : 10, style: { color: '#333333', cursor: 'default', fontSize: '12px', padding: '8px', pointerEvents: 'none', // #1686 http://caniuse.com/#feat=pointer-events whiteSpace: 'nowrap' } //xDateFormat: '%A, %b %e, %Y', //valueDecimals: null, //valuePrefix: '', //valueSuffix: '' }, credits: { enabled: true, text: 'Highcharts.com', href: 'http://www.highcharts.com', position: { align: 'right', x: -10, verticalAlign: 'bottom', y: -5 }, style: { cursor: 'pointer', color: '#909090', fontSize: '9px' } } }; /** * Set the time methods globally based on the useUTC option. Time method can be either * local time or UTC (default). */ function setTimeMethods() { var globalOptions = defaultOptions.global, useUTC = globalOptions.useUTC, GET = useUTC ? 'getUTC' : 'get', SET = useUTC ? 'setUTC' : 'set'; Date = globalOptions.Date || win.Date; timezoneOffset = useUTC && globalOptions.timezoneOffset; getTimezoneOffset = useUTC && globalOptions.getTimezoneOffset; makeTime = function (year, month, date, hours, minutes, seconds) { var d; if (useUTC) { d = Date.UTC.apply(0, arguments); d += getTZOffset(d); } else { d = new Date( year, month, pick(date, 1), pick(hours, 0), pick(minutes, 0), pick(seconds, 0) ).getTime(); } return d; }; getMinutes = GET + 'Minutes'; getHours = GET + 'Hours'; getDay = GET + 'Day'; getDate = GET + 'Date'; getMonth = GET + 'Month'; getFullYear = GET + 'FullYear'; setMilliseconds = SET + 'Milliseconds'; setSeconds = SET + 'Seconds'; setMinutes = SET + 'Minutes'; setHours = SET + 'Hours'; setDate = SET + 'Date'; setMonth = SET + 'Month'; setFullYear = SET + 'FullYear'; } /** * Merge the default options with custom options and return the new options structure * @param {Object} options The new custom options */ function setOptions(options) { // Copy in the default options defaultOptions = merge(true, defaultOptions, options); // Apply UTC setTimeMethods(); return defaultOptions; } /** * Get the updated default options. Until 3.0.7, merely exposing defaultOptions for outside modules * wasn't enough because the setOptions method created a new object. */ function getOptions() { return defaultOptions; } // Series defaults var defaultPlotOptions = defaultOptions.plotOptions, defaultSeriesOptions = defaultPlotOptions.line; // set the default time methods setTimeMethods(); /** * Handle color operations. The object methods are chainable. * @param {String} input The input color in either rbga or hex format */ function Color(input) { // Backwards compatibility, allow instanciation without new if (!(this instanceof Color)) { return new Color(input); } // Initialize this.init(input); } Color.prototype = { // Collection of parsers. This can be extended from the outside by pushing parsers // to Highcharts.Colors.prototype.parsers. parsers: [{ // RGBA color regex: /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/, parse: function (result) { return [pInt(result[1]), pInt(result[2]), pInt(result[3]), parseFloat(result[4], 10)]; } }, { // HEX color regex: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/, parse: function (result) { return [pInt(result[1], 16), pInt(result[2], 16), pInt(result[3], 16), 1]; } }, { // RGB color regex: /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/, parse: function (result) { return [pInt(result[1]), pInt(result[2]), pInt(result[3]), 1]; } }], /** * Parse the input color to rgba array * @param {String} input */ init: function (input) { var result, rgba, i, parser; this.input = input; // Gradients if (input && input.stops) { this.stops = map(input.stops, function (stop) { return new Color(stop[1]); }); // Solid colors } else { i = this.parsers.length; while (i-- && !rgba) { parser = this.parsers[i]; result = parser.regex.exec(input); if (result) { rgba = parser.parse(result); } } } this.rgba = rgba || []; }, /** * Return the color a specified format * @param {String} format */ get: function (format) { var input = this.input, rgba = this.rgba, ret; if (this.stops) { ret = merge(input); ret.stops = [].concat(ret.stops); each(this.stops, function (stop, i) { ret.stops[i] = [ret.stops[i][0], stop.get(format)]; }); // it's NaN if gradient colors on a column chart } else if (rgba && isNumber(rgba[0])) { if (format === 'rgb' || (!format && rgba[3] === 1)) { ret = 'rgb(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ')'; } else if (format === 'a') { ret = rgba[3]; } else { ret = 'rgba(' + rgba.join(',') + ')'; } } else { ret = input; } return ret; }, /** * Brighten the color * @param {Number} alpha */ brighten: function (alpha) { var i, rgba = this.rgba; if (this.stops) { each(this.stops, function (stop) { stop.brighten(alpha); }); } else if (isNumber(alpha) && alpha !== 0) { for (i = 0; i < 3; i++) { rgba[i] += pInt(alpha * 255); if (rgba[i] < 0) { rgba[i] = 0; } if (rgba[i] > 255) { rgba[i] = 255; } } } return this; }, /** * Set the color's opacity to a given alpha value * @param {Number} alpha */ setOpacity: function (alpha) { this.rgba[3] = alpha; return this; } }; /** * A wrapper object for SVG elements */ function SVGElement() {} SVGElement.prototype = { // Default base for animation opacity: 1, // For labels, these CSS properties are applied to the <text> node directly textProps: ['direction', 'fontSize', 'fontWeight', 'fontFamily', 'fontStyle', 'color', 'lineHeight', 'width', 'textDecoration', 'textOverflow', 'textShadow'], /** * Initialize the SVG renderer * @param {Object} renderer * @param {String} nodeName */ init: function (renderer, nodeName) { var wrapper = this; wrapper.element = nodeName === 'span' ? createElement(nodeName) : doc.createElementNS(SVG_NS, nodeName); wrapper.renderer = renderer; }, /** * Animate a given attribute * @param {Object} params * @param {Number} options Options include duration, easing, step and complete * @param {Function} complete Function to perform at the end of animation */ animate: function (params, options, complete) { var animOptions = pick(options, this.renderer.globalAnimation, true); stop(this); // stop regardless of animation actually running, or reverting to .attr (#607) if (animOptions) { if (complete) { // allows using a callback with the global animation without overwriting it animOptions.complete = complete; } animate(this, params, animOptions); } else { this.attr(params, null, complete); } return this; }, /** * Build an SVG gradient out of a common JavaScript configuration object */ colorGradient: function (color, prop, elem) { var renderer = this.renderer, colorObject, gradName, gradAttr, radAttr, gradients, gradientObject, stops, stopColor, stopOpacity, radialReference, n, id, key = [], value; // Apply linear or radial gradients if (color.linearGradient) { gradName = 'linearGradient'; } else if (color.radialGradient) { gradName = 'radialGradient'; } if (gradName) { gradAttr = color[gradName]; gradients = renderer.gradients; stops = color.stops; radialReference = elem.radialReference; // Keep < 2.2 kompatibility if (isArray(gradAttr)) { color[gradName] = gradAttr = { x1: gradAttr[0], y1: gradAttr[1], x2: gradAttr[2], y2: gradAttr[3], gradientUnits: 'userSpaceOnUse' }; } // Correct the radial gradient for the radial reference system if (gradName === 'radialGradient' && radialReference && !defined(gradAttr.gradientUnits)) { radAttr = gradAttr; // Save the radial attributes for updating gradAttr = merge(gradAttr, renderer.getRadialAttr(radialReference, radAttr), { gradientUnits: 'userSpaceOnUse' } ); } // Build the unique key to detect whether we need to create a new element (#1282) for (n in gradAttr) { if (n !== 'id') { key.push(n, gradAttr[n]); } } for (n in stops) { key.push(stops[n]); } key = key.join(','); // Check if a gradient object with the same config object is created within this renderer if (gradients[key]) { id = gradients[key].attr('id'); } else { // Set the id and create the element gradAttr.id = id = PREFIX + idCounter++; gradients[key] = gradientObject = renderer.createElement(gradName) .attr(gradAttr) .add(renderer.defs); gradientObject.radAttr = radAttr; // The gradient needs to keep a list of stops to be able to destroy them gradientObject.stops = []; each(stops, function (stop) { var stopObject; if (stop[1].indexOf('rgba') === 0) { colorObject = Color(stop[1]); stopColor = colorObject.get('rgb'); stopOpacity = colorObject.get('a'); } else { stopColor = stop[1]; stopOpacity = 1; } stopObject = renderer.createElement('stop').attr({ offset: stop[0], 'stop-color': stopColor, 'stop-opacity': stopOpacity }).add(gradientObject); // Add the stop element to the gradient gradientObject.stops.push(stopObject); }); } // Set the reference to the gradient object value = 'url(' + renderer.url + '#' + id + ')'; elem.setAttribute(prop, value); elem.gradient = key; // Allow the color to be concatenated into tooltips formatters etc. (#2995) color.toString = function () { return value; }; } }, /** * Apply a polyfill to the text-stroke CSS property, by copying the text element * and apply strokes to the copy. * * Contrast checks at http://jsfiddle.net/highcharts/43soe9m1/2/ */ applyTextShadow: function (textShadow) { var elem = this.element, tspans, hasContrast = textShadow.indexOf('contrast') !== -1, styles = {}, forExport = this.renderer.forExport, // IE10 and IE11 report textShadow in elem.style even though it doesn't work. Check // this again with new IE release. In exports, the rendering is passed to PhantomJS. supports = forExport || (elem.style.textShadow !== UNDEFINED && !isMS); // When the text shadow is set to contrast, use dark stroke for light text and vice versa if (hasContrast) { styles.textShadow = textShadow = textShadow.replace(/contrast/g, this.renderer.getContrast(elem.style.fill)); } // Safari with retina displays as well as PhantomJS bug (#3974). Firefox does not tolerate this, // it removes the text shadows. if (isWebKit || forExport) { styles.textRendering = 'geometricPrecision'; } /* Selective side-by-side testing in supported browser (http://jsfiddle.net/highcharts/73L1ptrh/) if (elem.textContent.indexOf('2.') === 0) { elem.style['text-shadow'] = 'none'; supports = false; } // */ // No reason to polyfill, we've got native support if (supports) { this.css(styles); // Apply altered textShadow or textRendering workaround } else { this.fakeTS = true; // Fake text shadow // In order to get the right y position of the clones, // copy over the y setter this.ySetter = this.xSetter; tspans = [].slice.call(elem.getElementsByTagName('tspan')); each(textShadow.split(/\s?,\s?/g), function (textShadow) { var firstChild = elem.firstChild, color, strokeWidth; textShadow = textShadow.split(' '); color = textShadow[textShadow.length - 1]; // Approximately tune the settings to the text-shadow behaviour strokeWidth = textShadow[textShadow.length - 2]; if (strokeWidth) { each(tspans, function (tspan, y) { var clone; // Let the first line start at the correct X position if (y === 0) { tspan.setAttribute('x', elem.getAttribute('x')); y = elem.getAttribute('y'); tspan.setAttribute('y', y || 0); if (y === null) { elem.setAttribute('y', 0); } } // Create the clone and apply shadow properties clone = tspan.cloneNode(1); attr(clone, { 'class': PREFIX + 'text-shadow', 'fill': color, 'stroke': color, 'stroke-opacity': 1 / mathMax(pInt(strokeWidth), 3), 'stroke-width': strokeWidth, 'stroke-linejoin': 'round' }); elem.insertBefore(clone, firstChild); }); } }); } }, /** * Set or get a given attribute * @param {Object|String} hash * @param {Mixed|Undefined} val */ attr: function (hash, val, complete) { var key, value, element = this.element, hasSetSymbolSize, ret = this, skipAttr, setter; // single key-value pair if (typeof hash === 'string' && val !== UNDEFINED) { key = hash; hash = {}; hash[key] = val; } // used as a getter: first argument is a string, second is undefined if (typeof hash === 'string') { ret = (this[hash + 'Getter'] || this._defaultGetter).call(this, hash, element); // setter } else { for (key in hash) { value = hash[key]; skipAttr = false; if (this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(key)) { if (!hasSetSymbolSize) { this.symbolAttr(hash); hasSetSymbolSize = true; } skipAttr = true; } if (this.rotation && (key === 'x' || key === 'y')) { this.doTransform = true; } if (!skipAttr) { setter = this[key + 'Setter'] || this._defaultSetter; setter.call(this, value, key, element); // Let the shadow follow the main element if (this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(key)) { this.updateShadows(key, value, setter); } } } // Update transform. Do this outside the loop to prevent redundant updating for batch setting // of attributes. if (this.doTransform) { this.updateTransform(); this.doTransform = false; } } // In accordance with animate, run a complete callback if (complete) { complete(); } return ret; }, /** * Update the shadow elements with new attributes * @param {String} key The attribute name * @param {String|Number} value The value of the attribute * @param {Function} setter The setter function, inherited from the parent wrapper * @returns {undefined} */ updateShadows: function (key, value, setter) { var shadows = this.shadows, i = shadows.length; while (i--) { setter.call( shadows[i], key === 'height' ? Math.max(value - (shadows[i].cutHeight || 0), 0) : key === 'd' ? this.d : value, key, shadows[i] ); } }, /** * Add a class name to an element */ addClass: function (className) { var element = this.element, currentClassName = attr(element, 'class') || ''; if (currentClassName.indexOf(className) === -1) { attr(element, 'class', currentClassName + ' ' + className); } return this; }, /* hasClass and removeClass are not (yet) needed hasClass: function (className) { return attr(this.element, 'class').indexOf(className) !== -1; }, removeClass: function (className) { attr(this.element, 'class', attr(this.element, 'class').replace(className, '')); return this; }, */ /** * If one of the symbol size affecting parameters are changed, * check all the others only once for each call to an element's * .attr() method * @param {Object} hash */ symbolAttr: function (hash) { var wrapper = this; each(['x', 'y', 'r', 'start', 'end', 'width', 'height', 'innerR', 'anchorX', 'anchorY'], function (key) { wrapper[key] = pick(hash[key], wrapper[key]); }); wrapper.attr({ d: wrapper.renderer.symbols[wrapper.symbolName]( wrapper.x, wrapper.y, wrapper.width, wrapper.height, wrapper ) }); }, /** * Apply a clipping path to this object * @param {String} id */ clip: function (clipRect) { return this.attr('clip-path', clipRect ? 'url(' + this.renderer.url + '#' + clipRect.id + ')' : NONE); }, /** * Calculate the coordinates needed for drawing a rectangle crisply and return the * calculated attributes * @param {Number} strokeWidth * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height */ crisp: function (rect) { var wrapper = this, key, attribs = {}, normalizer, strokeWidth = wrapper.strokeWidth || 0; normalizer = mathRound(strokeWidth) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors // normalize for crisp edges rect.x = mathFloor(rect.x || wrapper.x || 0) + normalizer; rect.y = mathFloor(rect.y || wrapper.y || 0) + normalizer; rect.width = mathFloor((rect.width || wrapper.width || 0) - 2 * normalizer); rect.height = mathFloor((rect.height || wrapper.height || 0) - 2 * normalizer); rect.strokeWidth = strokeWidth; for (key in rect) { if (wrapper[key] !== rect[key]) { // only set attribute if changed wrapper[key] = attribs[key] = rect[key]; } } return attribs; }, /** * Set styles for the element * @param {Object} styles */ css: function (styles) { var elemWrapper = this, oldStyles = elemWrapper.styles, newStyles = {}, elem = elemWrapper.element, textWidth, n, serializedCss = '', hyphenate, hasNew = !oldStyles; // convert legacy if (styles && styles.color) { styles.fill = styles.color; } // Filter out existing styles to increase performance (#2640) if (oldStyles) { for (n in styles) { if (styles[n] !== oldStyles[n]) { newStyles[n] = styles[n]; hasNew = true; } } } if (hasNew) { textWidth = elemWrapper.textWidth = (styles && styles.width && elem.nodeName.toLowerCase() === 'text' && pInt(styles.width)) || elemWrapper.textWidth; // #3501 // Merge the new styles with the old ones if (oldStyles) { styles = extend( oldStyles, newStyles ); } // store object elemWrapper.styles = styles; if (textWidth && (useCanVG || (!hasSVG && elemWrapper.renderer.forExport))) { delete styles.width; } // serialize and set style attribute if (isMS && !hasSVG) { css(elemWrapper.element, styles); } else { hyphenate = function (a, b) { return '-' + b.toLowerCase(); }; for (n in styles) { serializedCss += n.replace(/([A-Z])/g, hyphenate) + ':' + styles[n] + ';'; } attr(elem, 'style', serializedCss); // #1881 } // re-build text if (textWidth && elemWrapper.added) { elemWrapper.renderer.buildText(elemWrapper); } } return elemWrapper; }, /** * Add an event listener * @param {String} eventType * @param {Function} handler */ on: function (eventType, handler) { var svgElement = this, element = svgElement.element; // touch if (hasTouch && eventType === 'click') { element.ontouchstart = function (e) { svgElement.touchEventFired = Date.now(); e.preventDefault(); handler.call(element, e); }; element.onclick = function (e) { if (userAgent.indexOf('Android') === -1 || Date.now() - (svgElement.touchEventFired || 0) > 1100) { // #2269 handler.call(element, e); } }; } else { // simplest possible event model for internal use element['on' + eventType] = handler; } return this; }, /** * Set the coordinates needed to draw a consistent radial gradient across * pie slices regardless of positioning inside the chart. The format is * [centerX, centerY, diameter] in pixels. */ setRadialReference: function (coordinates) { var existingGradient = this.renderer.gradients[this.element.gradient]; this.element.radialReference = coordinates; // On redrawing objects with an existing gradient, the gradient needs // to be repositioned (#3801) if (existingGradient && existingGradient.radAttr) { existingGradient.animate( this.renderer.getRadialAttr( coordinates, existingGradient.radAttr ) ); } return this; }, /** * Move an object and its children by x and y values * @param {Number} x * @param {Number} y */ translate: function (x, y) { return this.attr({ translateX: x, translateY: y }); }, /** * Invert a group, rotate and flip */ invert: function () { var wrapper = this; wrapper.inverted = true; wrapper.updateTransform(); return wrapper; }, /** * Private method to update the transform attribute based on internal * properties */ updateTransform: function () { var wrapper = this, translateX = wrapper.translateX || 0, translateY = wrapper.translateY || 0, scaleX = wrapper.scaleX, scaleY = wrapper.scaleY, inverted = wrapper.inverted, rotation = wrapper.rotation, element = wrapper.element, transform; // flipping affects translate as adjustment for flipping around the group's axis if (inverted) { translateX += wrapper.attr('width'); translateY += wrapper.attr('height'); } // Apply translate. Nearly all transformed elements have translation, so instead // of checking for translate = 0, do it always (#1767, #1846). transform = ['translate(' + translateX + ',' + translateY + ')']; // apply rotation if (inverted) { transform.push('rotate(90) scale(-1,1)'); } else if (rotation) { // text rotation transform.push('rotate(' + rotation + ' ' + (element.getAttribute('x') || 0) + ' ' + (element.getAttribute('y') || 0) + ')'); // Delete bBox memo when the rotation changes //delete wrapper.bBox; } // apply scale if (defined(scaleX) || defined(scaleY)) { transform.push('scale(' + pick(scaleX, 1) + ' ' + pick(scaleY, 1) + ')'); } if (transform.length) { element.setAttribute('transform', transform.join(' ')); } }, /** * Bring the element to the front */ toFront: function () { var element = this.element; element.parentNode.appendChild(element); return this; }, /** * Break down alignment options like align, verticalAlign, x and y * to x and y relative to the chart. * * @param {Object} alignOptions * @param {Boolean} alignByTranslate * @param {String[Object} box The box to align to, needs a width and height. When the * box is a string, it refers to an object in the Renderer. For example, when * box is 'spacingBox', it refers to Renderer.spacingBox which holds width, height * x and y properties. * */ align: function (alignOptions, alignByTranslate, box) { var align, vAlign, x, y, attribs = {}, alignTo, renderer = this.renderer, alignedObjects = renderer.alignedObjects; // First call on instanciate if (alignOptions) { this.alignOptions = alignOptions; this.alignByTranslate = alignByTranslate; if (!box || isString(box)) { // boxes other than renderer handle this internally this.alignTo = alignTo = box || 'renderer'; erase(alignedObjects, this); // prevent duplicates, like legendGroup after resize alignedObjects.push(this); box = null; // reassign it below } // When called on resize, no arguments are supplied } else { alignOptions = this.alignOptions; alignByTranslate = this.alignByTranslate; alignTo = this.alignTo; } box = pick(box, renderer[alignTo], renderer); // Assign variables align = alignOptions.align; vAlign = alignOptions.verticalAlign; x = (box.x || 0) + (alignOptions.x || 0); // default: left align y = (box.y || 0) + (alignOptions.y || 0); // default: top align // Align if (align === 'right' || align === 'center') { x += (box.width - (alignOptions.width || 0)) / { right: 1, center: 2 }[align]; } attribs[alignByTranslate ? 'translateX' : 'x'] = mathRound(x); // Vertical align if (vAlign === 'bottom' || vAlign === 'middle') { y += (box.height - (alignOptions.height || 0)) / ({ bottom: 1, middle: 2 }[vAlign] || 1); } attribs[alignByTranslate ? 'translateY' : 'y'] = mathRound(y); // Animate only if already placed this[this.placed ? 'animate' : 'attr'](attribs); this.placed = true; this.alignAttr = attribs; return this; }, /** * Get the bounding box (width, height, x and y) for the element */ getBBox: function (reload, rot) { var wrapper = this, bBox, // = wrapper.bBox, renderer = wrapper.renderer, width, height, rotation, rad, element = wrapper.element, styles = wrapper.styles, textStr = wrapper.textStr, textShadow, elemStyle = element.style, toggleTextShadowShim, cache = renderer.cache, cacheKeys = renderer.cacheKeys, cacheKey; rotation = pick(rot, wrapper.rotation); rad = rotation * deg2rad; if (textStr !== UNDEFINED) { cacheKey = // Since numbers are monospaced, and numerical labels appear a lot in a chart, // we assume that a label of n characters has the same bounding box as others // of the same length. textStr.toString().replace(numRegex, '0') + // Properties that affect bounding box ['', rotation || 0, styles && styles.fontSize, element.style.width].join(','); } if (cacheKey && !reload) { bBox = cache[cacheKey]; } // No cache found if (!bBox) { // SVG elements if (element.namespaceURI === SVG_NS || renderer.forExport) { try { // Fails in Firefox if the container has display: none. // When the text shadow shim is used, we need to hide the fake shadows // to get the correct bounding box (#3872) toggleTextShadowShim = this.fakeTS && function (display) { each(element.querySelectorAll('.' + PREFIX + 'text-shadow'), function (tspan) { tspan.style.display = display; }); }; // Workaround for #3842, Firefox reporting wrong bounding box for shadows if (isFirefox && elemStyle.textShadow) { textShadow = elemStyle.textShadow; elemStyle.textShadow = ''; } else if (toggleTextShadowShim) { toggleTextShadowShim(NONE); } bBox = element.getBBox ? // SVG: use extend because IE9 is not allowed to change width and height in case // of rotation (below) extend({}, element.getBBox()) : // Canvas renderer and legacy IE in export mode { width: element.offsetWidth, height: element.offsetHeight }; // #3842 if (textShadow) { elemStyle.textShadow = textShadow; } else if (toggleTextShadowShim) { toggleTextShadowShim(''); } } catch (e) {} // If the bBox is not set, the try-catch block above failed. The other condition // is for Opera that returns a width of -Infinity on hidden elements. if (!bBox || bBox.width < 0) { bBox = { width: 0, height: 0 }; } // VML Renderer or useHTML within SVG } else { bBox = wrapper.htmlGetBBox(); } // True SVG elements as well as HTML elements in modern browsers using the .useHTML option // need to compensated for rotation if (renderer.isSVG) { width = bBox.width; height = bBox.height; // Workaround for wrong bounding box in IE9 and IE10 (#1101, #1505, #1669, #2568) if (isMS && styles && styles.fontSize === '11px' && height.toPrecision(3) === '16.9') { bBox.height = height = 14; } // Adjust for rotated text if (rotation) { bBox.width = mathAbs(height * mathSin(rad)) + mathAbs(width * mathCos(rad)); bBox.height = mathAbs(height * mathCos(rad)) + mathAbs(width * mathSin(rad)); } } // Cache it. When loading a chart in a hidden iframe in Firefox and IE/Edge, the // bounding box height is 0, so don't cache it (#5620). if (cacheKey && bBox.height > 0) { // Rotate (#4681) while (cacheKeys.length > 250) { delete cache[cacheKeys.shift()]; } if (!cache[cacheKey]) { cacheKeys.push(cacheKey); } cache[cacheKey] = bBox; } } return bBox; }, /** * Show the element */ show: function (inherit) { return this.attr({ visibility: inherit ? 'inherit' : VISIBLE }); }, /** * Hide the element */ hide: function () { return this.attr({ visibility: HIDDEN }); }, fadeOut: function (duration) { var elemWrapper = this; elemWrapper.animate({ opacity: 0 }, { duration: duration || 150, complete: function () { elemWrapper.attr({ y: -9999 }); // #3088, assuming we're only using this for tooltips } }); }, /** * Add the element * @param {Object|Undefined} parent Can be an element, an element wrapper or undefined * to append the element to the renderer.box. */ add: function (parent) { var renderer = this.renderer, element = this.element, inserted; if (parent) { this.parentGroup = parent; } // mark as inverted this.parentInverted = parent && parent.inverted; // build formatted text if (this.textStr !== undefined) { renderer.buildText(this); } // Mark as added this.added = true; // If we're adding to renderer root, or other elements in the group // have a z index, we need to handle it if (!parent || parent.handleZ || this.zIndex) { inserted = this.zIndexSetter(); } // If zIndex is not handled, append at the end if (!inserted) { (parent ? parent.element : renderer.box).appendChild(element); } // fire an event for internal hooks if (this.onAdd) { this.onAdd(); } return this; }, /** * Removes a child either by removeChild or move to garbageBin. * Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not. */ safeRemoveChild: function (element) { var parentNode = element.parentNode; if (parentNode) { parentNode.removeChild(element); } }, /** * Destroy the element and element wrapper */ destroy: function () { var wrapper = this, element = wrapper.element || {}, shadows = wrapper.shadows, parentToClean = wrapper.renderer.isSVG && element.nodeName === 'SPAN' && wrapper.parentGroup, grandParent, key, i; // remove events element.onclick = element.onmouseout = element.onmouseover = element.onmousemove = element.point = null; stop(wrapper); // stop running animations if (wrapper.clipPath) { wrapper.clipPath = wrapper.clipPath.destroy(); } // Destroy stops in case this is a gradient object if (wrapper.stops) { for (i = 0; i < wrapper.stops.length; i++) { wrapper.stops[i] = wrapper.stops[i].destroy(); } wrapper.stops = null; } // remove element wrapper.safeRemoveChild(element); // destroy shadows if (shadows) { each(shadows, function (shadow) { wrapper.safeRemoveChild(shadow); }); } // In case of useHTML, clean up empty containers emulating SVG groups (#1960, #2393, #2697). while (parentToClean && parentToClean.div && parentToClean.div.childNodes.length === 0) { grandParent = parentToClean.parentGroup; wrapper.safeRemoveChild(parentToClean.div); delete parentToClean.div; parentToClean = grandParent; } // remove from alignObjects if (wrapper.alignTo) { erase(wrapper.renderer.alignedObjects, wrapper); } for (key in wrapper) { delete wrapper[key]; } return null; }, /** * Add a shadow to the element. Must be done after the element is added to the DOM * @param {Boolean|Object} shadowOptions */ shadow: function (shadowOptions, group, cutOff) { var shadows = [], i, shadow, element = this.element, strokeWidth, shadowWidth, shadowElementOpacity, // compensate for inverted plot area transform; if (shadowOptions) { shadowWidth = pick(shadowOptions.width, 3); shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth; transform = this.parentInverted ? '(-1,-1)' : '(' + pick(shadowOptions.offsetX, 1) + ', ' + pick(shadowOptions.offsetY, 1) + ')'; for (i = 1; i <= shadowWidth; i++) { shadow = element.cloneNode(0); strokeWidth = (shadowWidth * 2) + 1 - (2 * i); attr(shadow, { 'isShadow': 'true', 'stroke': shadowOptions.color || 'black', 'stroke-opacity': shadowElementOpacity * i, 'stroke-width': strokeWidth, 'transform': 'translate' + transform, 'fill': NONE }); if (cutOff) { attr(shadow, 'height', mathMax(attr(shadow, 'height') - strokeWidth, 0)); shadow.cutHeight = strokeWidth; } if (group) { group.element.appendChild(shadow); } else { element.parentNode.insertBefore(shadow, element); } shadows.push(shadow); } this.shadows = shadows; } return this; }, xGetter: function (key) { if (this.element.nodeName === 'circle') { key = { x: 'cx', y: 'cy' }[key] || key; } return this._defaultGetter(key); }, /** * Get the current value of an attribute or pseudo attribute, used mainly * for animation. */ _defaultGetter: function (key) { var ret = pick(this[key], this.element ? this.element.getAttribute(key) : null, 0); if (/^[\-0-9\.]+$/.test(ret)) { // is numerical ret = parseFloat(ret); } return ret; }, dSetter: function (value, key, element) { if (value && value.join) { // join path value = value.join(' '); } if (/(NaN| {2}|^$)/.test(value)) { value = 'M 0 0'; } element.setAttribute(key, value); this[key] = value; }, dashstyleSetter: function (value) { var i, strokeWidth = this['stroke-width']; // If "inherit", like maps in IE, assume 1 (#4981). With HC5 and the new strokeWidth // function, we should be able to use that instead. if (strokeWidth === 'inherit') { strokeWidth = 1; } value = value && value.toLowerCase(); if (value) { value = value .replace('shortdashdotdot', '3,1,1,1,1,1,') .replace('shortdashdot', '3,1,1,1') .replace('shortdot', '1,1,') .replace('shortdash', '3,1,') .replace('longdash', '8,3,') .replace(/dot/g, '1,3,') .replace('dash', '4,3,') .replace(/,$/, '') .split(','); // ending comma i = value.length; while (i--) { value[i] = pInt(value[i]) * strokeWidth; } value = value.join(',') .replace(/NaN/g, 'none'); // #3226 this.element.setAttribute('stroke-dasharray', value); } }, alignSetter: function (value) { this.element.setAttribute('text-anchor', { left: 'start', center: 'middle', right: 'end' }[value]); }, titleSetter: function (value) { var titleNode = this.element.getElementsByTagName('title')[0]; if (!titleNode) { titleNode = doc.createElementNS(SVG_NS, 'title'); this.element.appendChild(titleNode); } // Remove text content if it exists if (titleNode.firstChild) { titleNode.removeChild(titleNode.firstChild); } titleNode.appendChild( doc.createTextNode( (String(pick(value), '')).replace(/<[^>]*>/g, '') // #3276, #3895 ) ); }, textSetter: function (value) { if (value !== this.textStr) { // Delete bBox memo when the text changes delete this.bBox; this.textStr = value; if (this.added) { this.renderer.buildText(this); } } }, fillSetter: function (value, key, element) { if (typeof value === 'string') { element.setAttribute(key, value); } else if (value) { this.colorGradient(value, key, element); } }, visibilitySetter: function (value, key, element) { // IE9-11 doesn't handle visibilty:inherit well, so we remove the attribute instead (#2881, #3909) if (value === 'inherit') { element.removeAttribute(key); } else { element.setAttribute(key, value); } }, zIndexSetter: function (value, key) { var renderer = this.renderer, parentGroup = this.parentGroup, parentWrapper = parentGroup || renderer, parentNode = parentWrapper.element || renderer.box, childNodes, otherElement, otherZIndex, element = this.element, inserted, run = this.added, i; if (defined(value)) { element.zIndex = value; // So we can read it for other elements in the group value = +value; if (this[key] === value) { // Only update when needed (#3865) run = false; } this[key] = value; } // Insert according to this and other elements' zIndex. Before .add() is called, // nothing is done. Then on add, or by later calls to zIndexSetter, the node // is placed on the right place in the DOM. if (run) { value = this.zIndex; if (value && parentGroup) { parentGroup.handleZ = true; } childNodes = parentNode.childNodes; for (i = 0; i < childNodes.length && !inserted; i++) { otherElement = childNodes[i]; otherZIndex = otherElement.zIndex; if (otherElement !== element && ( // Insert before the first element with a higher zIndex pInt(otherZIndex) > value || // If no zIndex given, insert before the first element with a zIndex (!defined(value) && defined(otherZIndex)) )) { parentNode.insertBefore(element, otherElement); inserted = true; } } if (!inserted) { parentNode.appendChild(element); } } return inserted; }, _defaultSetter: function (value, key, element) { element.setAttribute(key, value); } }; // Some shared setters and getters SVGElement.prototype.yGetter = SVGElement.prototype.xGetter; SVGElement.prototype.translateXSetter = SVGElement.prototype.translateYSetter = SVGElement.prototype.rotationSetter = SVGElement.prototype.verticalAlignSetter = SVGElement.prototype.scaleXSetter = SVGElement.prototype.scaleYSetter = function (value, key) { this[key] = value; this.doTransform = true; }; // These setters both set the key on the instance itself plus as an attribute SVGElement.prototype.opacitySetter = SVGElement.prototype.displaySetter = function (value, key, element) { this[key] = value; element.setAttribute(key, value); }; // WebKit and Batik have problems with a stroke-width of zero, so in this case we remove the // stroke attribute altogether. #1270, #1369, #3065, #3072. SVGElement.prototype['stroke-widthSetter'] = SVGElement.prototype.strokeSetter = function (value, key, element) { this[key] = value; // Only apply the stroke attribute if the stroke width is defined and larger than 0 if (this.stroke && this['stroke-width']) { this.strokeWidth = this['stroke-width']; SVGElement.prototype.fillSetter.call(this, this.stroke, 'stroke', element); // use prototype as instance may be overridden element.setAttribute('stroke-width', this['stroke-width']); this.hasStroke = true; } else if (key === 'stroke-width' && value === 0 && this.hasStroke) { element.removeAttribute('stroke'); this.hasStroke = false; } }; /** * The default SVG renderer */ var SVGRenderer = function () { this.init.apply(this, arguments); }; SVGRenderer.prototype = { Element: SVGElement, /** * Initialize the SVGRenderer * @param {Object} container * @param {Number} width * @param {Number} height * @param {Boolean} forExport */ init: function (container, width, height, style, forExport, allowHTML) { var renderer = this, boxWrapper, element, desc; boxWrapper = renderer.createElement('svg') .attr({ version: '1.1' }) .css(this.getStyle(style)); element = boxWrapper.element; container.appendChild(element); // For browsers other than IE, add the namespace attribute (#1978) if (container.innerHTML.indexOf('xmlns') === -1) { attr(element, 'xmlns', SVG_NS); } // object properties renderer.isSVG = true; renderer.box = element; renderer.boxWrapper = boxWrapper; renderer.alignedObjects = []; // Page url used for internal references. #24, #672, #1070 renderer.url = (isFirefox || isWebKit) && doc.getElementsByTagName('base').length ? win.location.href .replace(/#.*?$/, '') // remove the hash .replace(/([\('\)])/g, '\\$1') // escape parantheses and quotes .replace(/ /g, '%20') : // replace spaces (needed for Safari only) ''; // Add description desc = this.createElement('desc').add(); desc.element.appendChild(doc.createTextNode('Created with ' + PRODUCT + ' ' + VERSION)); renderer.defs = this.createElement('defs').add(); renderer.allowHTML = allowHTML; renderer.forExport = forExport; renderer.gradients = {}; // Object where gradient SvgElements are stored renderer.cache = {}; // Cache for numerical bounding boxes renderer.cacheKeys = []; renderer.imgCount = 0; renderer.setSize(width, height, false); // Issue 110 workaround: // In Firefox, if a div is positioned by percentage, its pixel position may land // between pixels. The container itself doesn't display this, but an SVG element // inside this container will be drawn at subpixel precision. In order to draw // sharp lines, this must be compensated for. This doesn't seem to work inside // iframes though (like in jsFiddle). var subPixelFix, rect; if (isFirefox && container.getBoundingClientRect) { renderer.subPixelFix = subPixelFix = function () { css(container, { left: 0, top: 0 }); rect = container.getBoundingClientRect(); css(container, { left: (mathCeil(rect.left) - rect.left) + PX, top: (mathCeil(rect.top) - rect.top) + PX }); }; // run the fix now subPixelFix(); // run it on resize addEvent(win, 'resize', subPixelFix); } }, getStyle: function (style) { this.style = extend({ fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif', // default font fontSize: '12px' }, style); return this.style; }, /** * Detect whether the renderer is hidden. This happens when one of the parent elements * has display: none. #608. */ isHidden: function () { return !this.boxWrapper.getBBox().width; }, /** * Destroys the renderer and its allocated members. */ destroy: function () { var renderer = this, rendererDefs = renderer.defs; renderer.box = null; renderer.boxWrapper = renderer.boxWrapper.destroy(); // Call destroy on all gradient elements destroyObjectProperties(renderer.gradients || {}); renderer.gradients = null; // Defs are null in VMLRenderer // Otherwise, destroy them here. if (rendererDefs) { renderer.defs = rendererDefs.destroy(); } // Remove sub pixel fix handler // We need to check that there is a handler, otherwise all functions that are registered for event 'resize' are removed // See issue #982 if (renderer.subPixelFix) { removeEvent(win, 'resize', renderer.subPixelFix); } renderer.alignedObjects = null; return null; }, /** * Create a wrapper for an SVG element * @param {Object} nodeName */ createElement: function (nodeName) { var wrapper = new this.Element(); wrapper.init(this, nodeName); return wrapper; }, /** * Dummy function for use in canvas renderer */ draw: function () {}, /** * Get converted radial gradient attributes */ getRadialAttr: function (radialReference, gradAttr) { return { cx: (radialReference[0] - radialReference[2] / 2) + gradAttr.cx * radialReference[2], cy: (radialReference[1] - radialReference[2] / 2) + gradAttr.cy * radialReference[2], r: gradAttr.r * radialReference[2] }; }, /** * Parse a simple HTML string into SVG tspans * * @param {Object} textNode The parent text SVG node */ buildText: function (wrapper) { var textNode = wrapper.element, renderer = this, forExport = renderer.forExport, textStr = pick(wrapper.textStr, '').toString(), hasMarkup = textStr.indexOf('<') !== -1, lines, childNodes = textNode.childNodes, styleRegex, hrefRegex, wasTooLong, parentX = attr(textNode, 'x'), textStyles = wrapper.styles, width = wrapper.textWidth, textLineHeight = textStyles && textStyles.lineHeight, textShadow = textStyles && textStyles.textShadow, ellipsis = textStyles && textStyles.textOverflow === 'ellipsis', i = childNodes.length, tempParent = width && !wrapper.added && this.box, getLineHeight = function (tspan) { return textLineHeight ? pInt(textLineHeight) : renderer.fontMetrics( /(px|em)$/.test(tspan && tspan.style.fontSize) ? tspan.style.fontSize : ((textStyles && textStyles.fontSize) || renderer.style.fontSize || 12), tspan ).h; }, unescapeAngleBrackets = function (inputStr) { return inputStr.replace(/&lt;/g, '<').replace(/&gt;/g, '>'); }; /// remove old text while (i--) { textNode.removeChild(childNodes[i]); } // Skip tspans, add text directly to text node. The forceTSpan is a hook // used in text outline hack. if (!hasMarkup && !textShadow && !ellipsis && !width && textStr.indexOf(' ') === -1) { textNode.appendChild(doc.createTextNode(unescapeAngleBrackets(textStr))); // Complex strings, add more logic } else { styleRegex = /<.*style="([^"]+)".*>/; hrefRegex = /<.*href="(http[^"]+)".*>/; if (tempParent) { tempParent.appendChild(textNode); // attach it to the DOM to read offset width } if (hasMarkup) { lines = textStr .replace(/<(b|strong)>/g, '<span style="font-weight:bold">') .replace(/<(i|em)>/g, '<span style="font-style:italic">') .replace(/<a/g, '<span') .replace(/<\/(b|strong|i|em|a)>/g, '</span>') .split(/<br.*?>/g); } else { lines = [textStr]; } // Trim empty lines (#5261) lines = grep(lines, function (line) { return line !== ''; }); // build the lines each(lines, function buildTextLines(line, lineNo) { var spans, spanNo = 0; line = line .replace(/^\s+|\s+$/g, '') // Trim to prevent useless/costly process on the spaces (#5258) .replace(/<span/g, '|||<span') .replace(/<\/span>/g, '</span>|||'); spans = line.split('|||'); each(spans, function buildTextSpans(span) { if (span !== '' || spans.length === 1) { var attributes = {}, tspan = doc.createElementNS(SVG_NS, 'tspan'), spanStyle; // #390 if (styleRegex.test(span)) { spanStyle = span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2'); attr(tspan, 'style', spanStyle); } if (hrefRegex.test(span) && !forExport) { // Not for export - #1529 attr(tspan, 'onclick', 'location.href=\"' + span.match(hrefRegex)[1] + '\"'); css(tspan, { cursor: 'pointer' }); } span = unescapeAngleBrackets(span.replace(/<(.|\n)*?>/g, '') || ' '); // Nested tags aren't supported, and cause crash in Safari (#1596) if (span !== ' ') { // add the text node tspan.appendChild(doc.createTextNode(span)); if (!spanNo) { // first span in a line, align it to the left if (lineNo && parentX !== null) { attributes.x = parentX; } } else { attributes.dx = 0; // #16 } // add attributes attr(tspan, attributes); // Append it textNode.appendChild(tspan); // first span on subsequent line, add the line height if (!spanNo && lineNo) { // allow getting the right offset height in exporting in IE if (!hasSVG && forExport) { css(tspan, { display: 'block' }); } // Set the line height based on the font size of either // the text element or the tspan element attr( tspan, 'dy', getLineHeight(tspan) ); } /*if (width) { renderer.breakText(wrapper, width); }*/ // Check width and apply soft breaks or ellipsis if (width) { var words = span.replace(/([^\^])-/g, '$1- ').split(' '), // #1273 noWrap = textStyles.whiteSpace === 'nowrap', hasWhiteSpace = spans.length > 1 || lineNo || (words.length > 1 && !noWrap), tooLong, actualWidth, rest = [], dy = getLineHeight(tspan), softLineNo = 1, rotation = wrapper.rotation, wordStr = span, // for ellipsis cursor = wordStr.length, // binary search cursor bBox; while ((hasWhiteSpace || ellipsis) && (words.length || rest.length)) { wrapper.rotation = 0; // discard rotation when computing box bBox = wrapper.getBBox(true); actualWidth = bBox.width; // Old IE cannot measure the actualWidth for SVG elements (#2314) if (!hasSVG && renderer.forExport) { actualWidth = renderer.measureSpanWidth(tspan.firstChild.data, wrapper.styles); } tooLong = actualWidth > width; // For ellipsis, do a binary search for the correct string length if (wasTooLong === undefined) { wasTooLong = tooLong; // First time } if (ellipsis && wasTooLong) { cursor /= 2; if (wordStr === '' || (!tooLong && cursor < 0.5)) { words = []; // All ok, break out } else { wordStr = span.substring(0, wordStr.length + (tooLong ? -1 : 1) * mathCeil(cursor)); words = [wordStr + (width > 3 ? '\u2026' : '')]; tspan.removeChild(tspan.firstChild); } // Looping down, this is the first word sequence that is not too long, // so we can move on to build the next line. } else if (!tooLong || words.length === 1) { words = rest; rest = []; if (words.length && !noWrap) { softLineNo++; tspan = doc.createElementNS(SVG_NS, 'tspan'); attr(tspan, { dy: dy, x: parentX }); if (spanStyle) { // #390 attr(tspan, 'style', spanStyle); } textNode.appendChild(tspan); } if (actualWidth > width) { // a single word is pressing it out width = actualWidth; } } else { // append to existing line tspan tspan.removeChild(tspan.firstChild); rest.unshift(words.pop()); } if (words.length) { tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-'))); } } wrapper.rotation = rotation; } spanNo++; } } }); }); if (wasTooLong) { wrapper.attr('title', wrapper.textStr); } if (tempParent) { tempParent.removeChild(textNode); // attach it to the DOM to read offset width } // Apply the text shadow if (textShadow && wrapper.applyTextShadow) { wrapper.applyTextShadow(textShadow); } } }, /* breakText: function (wrapper, width) { var bBox = wrapper.getBBox(), node = wrapper.element, textLength = node.textContent.length, pos = mathRound(width * textLength / bBox.width), // try this position first, based on average character width increment = 0, finalPos; if (bBox.width > width) { while (finalPos === undefined) { textLength = node.getSubStringLength(0, pos); if (textLength <= width) { if (increment === -1) { finalPos = pos; } else { increment = 1; } } else { if (increment === 1) { finalPos = pos - 1; } else { increment = -1; } } pos += increment; } } console.log('width', width, 'stringWidth', node.getSubStringLength(0, finalPos)) }, */ /** * Returns white for dark colors and black for bright colors */ getContrast: function (color) { color = Color(color).rgba; return color[0] + color[1] + color[2] > 384 ? '#000000' : '#FFFFFF'; }, /** * Create a button with preset states * @param {String} text * @param {Number} x * @param {Number} y * @param {Function} callback * @param {Object} normalState * @param {Object} hoverState * @param {Object} pressedState */ button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) { var label = this.label(text, x, y, shape, null, null, null, null, 'button'), curState = 0, stateOptions, stateStyle, normalStyle, hoverStyle, pressedStyle, disabledStyle, verticalGradient = { x1: 0, y1: 0, x2: 0, y2: 1 }; // Normal state - prepare the attributes normalState = merge({ 'stroke-width': 1, stroke: '#CCCCCC', fill: { linearGradient: verticalGradient, stops: [ [0, '#FEFEFE'], [1, '#F6F6F6'] ] }, r: 2, padding: 5, style: { color: 'black' } }, normalState); normalStyle = normalState.style; delete normalState.style; // Hover state hoverState = merge(normalState, { stroke: '#68A', fill: { linearGradient: verticalGradient, stops: [ [0, '#FFF'], [1, '#ACF'] ] } }, hoverState); hoverStyle = hoverState.style; delete hoverState.style; // Pressed state pressedState = merge(normalState, { stroke: '#68A', fill: { linearGradient: verticalGradient, stops: [ [0, '#9BD'], [1, '#CDF'] ] } }, pressedState); pressedStyle = pressedState.style; delete pressedState.style; // Disabled state disabledState = merge(normalState, { style: { color: '#CCC' } }, disabledState); disabledStyle = disabledState.style; delete disabledState.style; // Add the events. IE9 and IE10 need mouseover and mouseout to funciton (#667). addEvent(label.element, isMS ? 'mouseover' : 'mouseenter', function () { if (curState !== 3) { label.attr(hoverState) .css(hoverStyle); } }); addEvent(label.element, isMS ? 'mouseout' : 'mouseleave', function () { if (curState !== 3) { stateOptions = [normalState, hoverState, pressedState][curState]; stateStyle = [normalStyle, hoverStyle, pressedStyle][curState]; label.attr(stateOptions) .css(stateStyle); } }); label.setState = function (state) { label.state = curState = state; if (!state) { label.attr(normalState) .css(normalStyle); } else if (state === 2) { label.attr(pressedState) .css(pressedStyle); } else if (state === 3) { label.attr(disabledState) .css(disabledStyle); } }; return label .on('click', function (e) { if (curState !== 3) { callback.call(label, e); } }) .attr(normalState) .css(extend({ cursor: 'default' }, normalStyle)); }, /** * Make a straight line crisper by not spilling out to neighbour pixels * @param {Array} points * @param {Number} width */ crispLine: function (points, width) { // points format: [M, 0, 0, L, 100, 0] // normalize to a crisp line if (points[1] === points[4]) { // Substract due to #1129. Now bottom and left axis gridlines behave the same. points[1] = points[4] = mathRound(points[1]) - (width % 2 / 2); } if (points[2] === points[5]) { points[2] = points[5] = mathRound(points[2]) + (width % 2 / 2); } return points; }, /** * Draw a path * @param {Array} path An SVG path in array form */ path: function (path) { var attr = { fill: NONE }; if (isArray(path)) { attr.d = path; } else if (isObject(path)) { // attributes extend(attr, path); } return this.createElement('path').attr(attr); }, /** * Draw and return an SVG circle * @param {Number} x The x position * @param {Number} y The y position * @param {Number} r The radius */ circle: function (x, y, r) { var attr = isObject(x) ? x : { x: x, y: y, r: r }, wrapper = this.createElement('circle'); // Setting x or y translates to cx and cy wrapper.xSetter = wrapper.ySetter = function (value, key, element) { element.setAttribute('c' + key, value); }; return wrapper.attr(attr); }, /** * Draw and return an arc * @param {Number} x X position * @param {Number} y Y position * @param {Number} r Radius * @param {Number} innerR Inner radius like used in donut charts * @param {Number} start Starting angle * @param {Number} end Ending angle */ arc: function (x, y, r, innerR, start, end) { var arc; if (isObject(x)) { y = x.y; r = x.r; innerR = x.innerR; start = x.start; end = x.end; x = x.x; } // Arcs are defined as symbols for the ability to set // attributes in attr and animate arc = this.symbol('arc', x || 0, y || 0, r || 0, r || 0, { innerR: innerR || 0, start: start || 0, end: end || 0 }); arc.r = r; // #959 return arc; }, /** * Draw and return a rectangle * @param {Number} x Left position * @param {Number} y Top position * @param {Number} width * @param {Number} height * @param {Number} r Border corner radius * @param {Number} strokeWidth A stroke width can be supplied to allow crisp drawing */ rect: function (x, y, width, height, r, strokeWidth) { r = isObject(x) ? x.r : r; var wrapper = this.createElement('rect'), attribs = isObject(x) ? x : x === UNDEFINED ? {} : { x: x, y: y, width: mathMax(width, 0), height: mathMax(height, 0) }; if (strokeWidth !== UNDEFINED) { wrapper.strokeWidth = strokeWidth; attribs = wrapper.crisp(attribs); } if (r) { attribs.r = r; } wrapper.rSetter = function (value, key, element) { attr(element, { rx: value, ry: value }); }; return wrapper.attr(attribs); }, /** * Resize the box and re-align all aligned elements * @param {Object} width * @param {Object} height * @param {Boolean} animate * */ setSize: function (width, height, animate) { var renderer = this, alignedObjects = renderer.alignedObjects, i = alignedObjects.length; renderer.width = width; renderer.height = height; renderer.boxWrapper[pick(animate, true) ? 'animate' : 'attr']({ width: width, height: height }); while (i--) { alignedObjects[i].align(); } }, /** * Create a group * @param {String} name The group will be given a class name of 'highcharts-{name}'. * This can be used for styling and scripting. */ g: function (name) { var elem = this.createElement('g'); return defined(name) ? elem.attr({ 'class': PREFIX + name }) : elem; }, /** * Display an image * @param {String} src * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height */ image: function (src, x, y, width, height) { var attribs = { preserveAspectRatio: NONE }, elemWrapper; // optional properties if (arguments.length > 1) { extend(attribs, { x: x, y: y, width: width, height: height }); } elemWrapper = this.createElement('image').attr(attribs); // set the href in the xlink namespace if (elemWrapper.element.setAttributeNS) { elemWrapper.element.setAttributeNS('http://www.w3.org/1999/xlink', 'href', src); } else { // could be exporting in IE // using href throws "not supported" in ie7 and under, requries regex shim to fix later elemWrapper.element.setAttribute('hc-svg-href', src); } return elemWrapper; }, /** * Draw a symbol out of pre-defined shape paths from the namespace 'symbol' object. * * @param {Object} symbol * @param {Object} x * @param {Object} y * @param {Object} radius * @param {Object} options */ symbol: function (symbol, x, y, width, height, options) { var ren = this, obj, // get the symbol definition function symbolFn = this.symbols[symbol], // check if there's a path defined for this symbol path = symbolFn && symbolFn( mathRound(x), mathRound(y), width, height, options ), imageRegex = /^url\((.*?)\)$/, imageSrc, imageSize, centerImage; if (path) { obj = this.path(path); // expando properties for use in animate and attr extend(obj, { symbolName: symbol, x: x, y: y, width: width, height: height }); if (options) { extend(obj, options); } // image symbols } else if (imageRegex.test(symbol)) { // On image load, set the size and position centerImage = function (img, size) { if (img.element) { // it may be destroyed in the meantime (#1390) img.attr({ width: size[0], height: size[1] }); if (!img.alignByTranslate) { // #185 img.translate( mathRound((width - size[0]) / 2), // #1378 mathRound((height - size[1]) / 2) ); } } }; imageSrc = symbol.match(imageRegex)[1]; imageSize = symbolSizes[imageSrc] || (options && options.width && options.height && [options.width, options.height]); // Ireate the image synchronously, add attribs async obj = this.image(imageSrc) .attr({ x: x, y: y }); obj.isImg = true; if (imageSize) { centerImage(obj, imageSize); } else { // Initialize image to be 0 size so export will still function if there's no cached sizes. obj.attr({ width: 0, height: 0 }); // Create a dummy JavaScript image to get the width and height. Due to a bug in IE < 8, // the created element must be assigned to a variable in order to load (#292). createElement('img', { onload: function () { var chart = charts[ren.chartIndex]; // Special case for SVGs on IE11, the width is not accessible until the image is // part of the DOM (#2854). if (this.width === 0) { css(this, { position: ABSOLUTE, top: '-999em' }); doc.body.appendChild(this); } // Center the image centerImage(obj, symbolSizes[imageSrc] = [this.width, this.height]); // Clean up after #2854 workaround. if (this.parentNode) { this.parentNode.removeChild(this); } // Fire the load event when all external images are loaded ren.imgCount--; if (!ren.imgCount && chart && chart.onload) { chart.onload(); } }, src: imageSrc }); this.imgCount++; } } return obj; }, /** * An extendable collection of functions for defining symbol paths. */ symbols: { 'circle': function (x, y, w, h) { var cpw = 0.166 * w; return [ M, x + w / 2, y, 'C', x + w + cpw, y, x + w + cpw, y + h, x + w / 2, y + h, 'C', x - cpw, y + h, x - cpw, y, x + w / 2, y, 'Z' ]; }, 'square': function (x, y, w, h) { return [ M, x, y, L, x + w, y, x + w, y + h, x, y + h, 'Z' ]; }, 'triangle': function (x, y, w, h) { return [ M, x + w / 2, y, L, x + w, y + h, x, y + h, 'Z' ]; }, 'triangle-down': function (x, y, w, h) { return [ M, x, y, L, x + w, y, x + w / 2, y + h, 'Z' ]; }, 'diamond': function (x, y, w, h) { return [ M, x + w / 2, y, L, x + w, y + h / 2, x + w / 2, y + h, x, y + h / 2, 'Z' ]; }, 'arc': function (x, y, w, h, options) { var start = options.start, radius = options.r || w || h, end = options.end - 0.001, // to prevent cos and sin of start and end from becoming equal on 360 arcs (related: #1561) innerRadius = options.innerR, open = options.open, cosStart = mathCos(start), sinStart = mathSin(start), cosEnd = mathCos(end), sinEnd = mathSin(end), longArc = options.end - start < mathPI ? 0 : 1; return [ M, x + radius * cosStart, y + radius * sinStart, 'A', // arcTo radius, // x radius radius, // y radius 0, // slanting longArc, // long or short arc 1, // clockwise x + radius * cosEnd, y + radius * sinEnd, open ? M : L, x + innerRadius * cosEnd, y + innerRadius * sinEnd, 'A', // arcTo innerRadius, // x radius innerRadius, // y radius 0, // slanting longArc, // long or short arc 0, // clockwise x + innerRadius * cosStart, y + innerRadius * sinStart, open ? '' : 'Z' // close ]; }, /** * Callout shape used for default tooltips, also used for rounded rectangles in VML */ callout: function (x, y, w, h, options) { var arrowLength = 6, halfDistance = 6, r = mathMin((options && options.r) || 0, w, h), safeDistance = r + halfDistance, anchorX = options && options.anchorX, anchorY = options && options.anchorY, path; path = [ 'M', x + r, y, 'L', x + w - r, y, // top side 'C', x + w, y, x + w, y, x + w, y + r, // top-right corner 'L', x + w, y + h - r, // right side 'C', x + w, y + h, x + w, y + h, x + w - r, y + h, // bottom-right corner 'L', x + r, y + h, // bottom side 'C', x, y + h, x, y + h, x, y + h - r, // bottom-left corner 'L', x, y + r, // left side 'C', x, y, x, y, x + r, y // top-right corner ]; if (anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace right side path.splice(13, 3, 'L', x + w, anchorY - halfDistance, x + w + arrowLength, anchorY, x + w, anchorY + halfDistance, x + w, y + h - r ); } else if (anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace left side path.splice(33, 3, 'L', x, anchorY + halfDistance, x - arrowLength, anchorY, x, anchorY - halfDistance, x, y + r ); } else if (anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace bottom path.splice(23, 3, 'L', anchorX + halfDistance, y + h, anchorX, y + h + arrowLength, anchorX - halfDistance, y + h, x + r, y + h ); } else if (anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace top path.splice(3, 3, 'L', anchorX - halfDistance, y, anchorX, y - arrowLength, anchorX + halfDistance, y, w - r, y ); } return path; } }, /** * Define a clipping rectangle * @param {String} id * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height */ clipRect: function (x, y, width, height) { var wrapper, id = PREFIX + idCounter++, clipPath = this.createElement('clipPath').attr({ id: id }).add(this.defs); wrapper = this.rect(x, y, width, height, 0).add(clipPath); wrapper.id = id; wrapper.clipPath = clipPath; wrapper.count = 0; return wrapper; }, /** * Add text to the SVG object * @param {String} str * @param {Number} x Left position * @param {Number} y Top position * @param {Boolean} useHTML Use HTML to render the text */ text: function (str, x, y, useHTML) { // declare variables var renderer = this, fakeSVG = useCanVG || (!hasSVG && renderer.forExport), wrapper, attr = {}; if (useHTML && (renderer.allowHTML || !renderer.forExport)) { return renderer.html(str, x, y); } attr.x = Math.round(x || 0); // X is always needed for line-wrap logic if (y) { attr.y = Math.round(y); } if (str || str === 0) { attr.text = str; } wrapper = renderer.createElement('text') .attr(attr); // Prevent wrapping from creating false offsetWidths in export in legacy IE (#1079, #1063) if (fakeSVG) { wrapper.css({ position: ABSOLUTE }); } if (!useHTML) { wrapper.xSetter = function (value, key, element) { var tspans = element.getElementsByTagName('tspan'), tspan, parentVal = element.getAttribute(key), i; for (i = 0; i < tspans.length; i++) { tspan = tspans[i]; // If the x values are equal, the tspan represents a linebreak if (tspan.getAttribute(key) === parentVal) { tspan.setAttribute(key, value); } } element.setAttribute(key, value); }; } return wrapper; }, /** * Utility to return the baseline offset and total line height from the font size */ fontMetrics: function (fontSize, elem) { var lineHeight, baseline, style; fontSize = fontSize || this.style.fontSize; if (!fontSize && elem && win.getComputedStyle) { elem = elem.element || elem; // SVGElement style = win.getComputedStyle(elem, ''); fontSize = style && style.fontSize; // #4309, the style doesn't exist inside a hidden iframe in Firefox } fontSize = /px/.test(fontSize) ? pInt(fontSize) : /em/.test(fontSize) ? parseFloat(fontSize) * 12 : 12; // Empirical values found by comparing font size and bounding box height. // Applies to the default font family. http://jsfiddle.net/highcharts/7xvn7/ lineHeight = fontSize < 24 ? fontSize + 3 : mathRound(fontSize * 1.2); baseline = mathRound(lineHeight * 0.8); return { h: lineHeight, b: baseline, f: fontSize }; }, /** * Correct X and Y positioning of a label for rotation (#1764) */ rotCorr: function (baseline, rotation, alterY) { var y = baseline; if (rotation && alterY) { y = mathMax(y * mathCos(rotation * deg2rad), 4); } return { x: (-baseline / 3) * mathSin(rotation * deg2rad), y: y }; }, /** * Add a label, a text item that can hold a colored or gradient background * as well as a border and shadow. * @param {string} str * @param {Number} x * @param {Number} y * @param {String} shape * @param {Number} anchorX In case the shape has a pointer, like a flag, this is the * coordinates it should be pinned to * @param {Number} anchorY * @param {Boolean} baseline Whether to position the label relative to the text baseline, * like renderer.text, or to the upper border of the rectangle. * @param {String} className Class name for the group */ label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) { var renderer = this, wrapper = renderer.g(className), text = renderer.text('', 0, 0, useHTML) .attr({ zIndex: 1 }), //.add(wrapper), box, bBox, alignFactor = 0, padding = 3, paddingLeft = 0, width, height, wrapperX, wrapperY, crispAdjust = 0, deferredAttr = {}, baselineOffset, hasBGImage = /^url\((.*?)\)$/.test(shape), needsBox = hasBGImage, updateBoxSize, updateTextPadding, boxAttr; /** * This function runs after the label is added to the DOM (when the bounding box is * available), and after the text of the label is updated to detect the new bounding * box and reflect it in the border box. */ updateBoxSize = function () { var boxX, boxY, style = text.element.style; bBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && defined(text.textStr) && text.getBBox(); //#3295 && 3514 box failure when string equals 0 wrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft; wrapper.height = (height || bBox.height || 0) + 2 * padding; // update the label-scoped y offset baselineOffset = padding + renderer.fontMetrics(style && style.fontSize, text).b; if (needsBox) { if (!box) { // create the border box if it is not already present boxX = crispAdjust; boxY = (baseline ? -baselineOffset : 0) + crispAdjust; wrapper.box = box = renderer.symbols[shape] || hasBGImage ? // Symbol definition exists (#5324) renderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) : renderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]); if (!box.isImg) { // #4324, fill "none" causes it to be ignored by mouse events in IE box.attr('fill', NONE); } box.add(wrapper); } // apply the box attributes if (!box.isImg) { // #1630 box.attr(extend({ width: mathRound(wrapper.width), height: mathRound(wrapper.height) }, deferredAttr)); } deferredAttr = null; } }; /** * This function runs after setting text or padding, but only if padding is changed */ updateTextPadding = function () { var styles = wrapper.styles, textAlign = styles && styles.textAlign, x = paddingLeft + padding, y; // determin y based on the baseline y = baseline ? 0 : baselineOffset; // compensate for alignment if (defined(width) && bBox && (textAlign === 'center' || textAlign === 'right')) { x += { center: 0.5, right: 1 }[textAlign] * (width - bBox.width); } // update if anything changed if (x !== text.x || y !== text.y) { text.attr('x', x); if (y !== UNDEFINED) { text.attr('y', y); } } // record current values text.x = x; text.y = y; }; /** * Set a box attribute, or defer it if the box is not yet created * @param {Object} key * @param {Object} value */ boxAttr = function (key, value) { if (box) { box.attr(key, value); } else { deferredAttr[key] = value; } }; /** * After the text element is added, get the desired size of the border box * and add it before the text in the DOM. */ wrapper.onAdd = function () { text.add(wrapper); wrapper.attr({ text: (str || str === 0) ? str : '', // alignment is available now // #3295: 0 not rendered if given as a value x: x, y: y }); if (box && defined(anchorX)) { wrapper.attr({ anchorX: anchorX, anchorY: anchorY }); } }; /* * Add specific attribute setters. */ // only change local variables wrapper.widthSetter = function (value) { width = value; }; wrapper.heightSetter = function (value) { height = value; }; wrapper.paddingSetter = function (value) { if (defined(value) && value !== padding) { padding = wrapper.padding = value; updateTextPadding(); } }; wrapper.paddingLeftSetter = function (value) { if (defined(value) && value !== paddingLeft) { paddingLeft = value; updateTextPadding(); } }; // change local variable and prevent setting attribute on the group wrapper.alignSetter = function (value) { value = { left: 0, center: 0.5, right: 1 }[value]; if (value !== alignFactor) { alignFactor = value; if (bBox) { // Bounding box exists, means we're dynamically changing wrapper.attr({ x: wrapperX }); // #5134 } } }; // apply these to the box and the text alike wrapper.textSetter = function (value) { if (value !== UNDEFINED) { text.textSetter(value); } updateBoxSize(); updateTextPadding(); }; // apply these to the box but not to the text wrapper['stroke-widthSetter'] = function (value, key) { if (value) { needsBox = true; } crispAdjust = value % 2 / 2; boxAttr(key, value); }; wrapper.strokeSetter = wrapper.fillSetter = wrapper.rSetter = function (value, key) { if (key === 'fill' && value) { needsBox = true; } boxAttr(key, value); }; wrapper.anchorXSetter = function (value, key) { anchorX = value; boxAttr(key, mathRound(value) - crispAdjust - wrapperX); }; wrapper.anchorYSetter = function (value, key) { anchorY = value; boxAttr(key, value - wrapperY); }; // rename attributes wrapper.xSetter = function (value) { wrapper.x = value; // for animation getter if (alignFactor) { value -= alignFactor * ((width || bBox.width) + 2 * padding); } wrapperX = mathRound(value); wrapper.attr('translateX', wrapperX); }; wrapper.ySetter = function (value) { wrapperY = wrapper.y = mathRound(value); wrapper.attr('translateY', wrapperY); }; // Redirect certain methods to either the box or the text var baseCss = wrapper.css; return extend(wrapper, { /** * Pick up some properties and apply them to the text instead of the wrapper */ css: function (styles) { if (styles) { var textStyles = {}; styles = merge(styles); // create a copy to avoid altering the original object (#537) each(wrapper.textProps, function (prop) { if (styles[prop] !== UNDEFINED) { textStyles[prop] = styles[prop]; delete styles[prop]; } }); text.css(textStyles); } return baseCss.call(wrapper, styles); }, /** * Return the bounding box of the box, not the group */ getBBox: function () { return { width: bBox.width + 2 * padding, height: bBox.height + 2 * padding, x: bBox.x - padding, y: bBox.y - padding }; }, /** * Apply the shadow to the box */ shadow: function (b) { if (box) { box.shadow(b); } return wrapper; }, /** * Destroy and release memory. */ destroy: function () { // Added by button implementation removeEvent(wrapper.element, 'mouseenter'); removeEvent(wrapper.element, 'mouseleave'); if (text) { text = text.destroy(); } if (box) { box = box.destroy(); } // Call base implementation to destroy the rest SVGElement.prototype.destroy.call(wrapper); // Release local pointers (#1298) wrapper = renderer = updateBoxSize = updateTextPadding = boxAttr = null; } }); } }; // end SVGRenderer // general renderer Renderer = SVGRenderer; // extend SvgElement for useHTML option extend(SVGElement.prototype, { /** * Apply CSS to HTML elements. This is used in text within SVG rendering and * by the VML renderer */ htmlCss: function (styles) { var wrapper = this, element = wrapper.element, textWidth = styles && element.tagName === 'SPAN' && styles.width; if (textWidth) { delete styles.width; wrapper.textWidth = textWidth; wrapper.updateTransform(); } if (styles && styles.textOverflow === 'ellipsis') { styles.whiteSpace = 'nowrap'; styles.overflow = 'hidden'; } wrapper.styles = extend(wrapper.styles, styles); css(wrapper.element, styles); return wrapper; }, /** * VML and useHTML method for calculating the bounding box based on offsets * @param {Boolean} refresh Whether to force a fresh value from the DOM or to * use the cached value * * @return {Object} A hash containing values for x, y, width and height */ htmlGetBBox: function () { var wrapper = this, element = wrapper.element; // faking getBBox in exported SVG in legacy IE // faking getBBox in exported SVG in legacy IE (is this a duplicate of the fix for #1079?) if (element.nodeName === 'text') { element.style.position = ABSOLUTE; } return { x: element.offsetLeft, y: element.offsetTop, width: element.offsetWidth, height: element.offsetHeight }; }, /** * VML override private method to update elements based on internal * properties based on SVG transform */ htmlUpdateTransform: function () { // aligning non added elements is expensive if (!this.added) { this.alignOnAdd = true; return; } var wrapper = this, renderer = wrapper.renderer, elem = wrapper.element, translateX = wrapper.translateX || 0, translateY = wrapper.translateY || 0, x = wrapper.x || 0, y = wrapper.y || 0, align = wrapper.textAlign || 'left', alignCorrection = { left: 0, center: 0.5, right: 1 }[align], shadows = wrapper.shadows, styles = wrapper.styles; // apply translate css(elem, { marginLeft: translateX, marginTop: translateY }); if (shadows) { // used in labels/tooltip each(shadows, function (shadow) { css(shadow, { marginLeft: translateX + 1, marginTop: translateY + 1 }); }); } // apply inversion if (wrapper.inverted) { // wrapper is a group each(elem.childNodes, function (child) { renderer.invertChild(child, elem); }); } if (elem.tagName === 'SPAN') { var rotation = wrapper.rotation, baseline, textWidth = pInt(wrapper.textWidth), whiteSpace = styles && styles.whiteSpace, currentTextTransform = [rotation, align, elem.innerHTML, wrapper.textWidth, wrapper.textAlign].join(','); if (currentTextTransform !== wrapper.cTT) { // do the calculations and DOM access only if properties changed baseline = renderer.fontMetrics(elem.style.fontSize).b; // Renderer specific handling of span rotation if (defined(rotation)) { wrapper.setSpanRotation(rotation, alignCorrection, baseline); } // Reset multiline/ellipsis in order to read width (#4928, #5417) css(elem, { width: '', whiteSpace: whiteSpace || 'nowrap' }); // Update textWidth if (elem.offsetWidth > textWidth && /[ \-]/.test(elem.textContent || elem.innerText)) { // #983, #1254 css(elem, { width: textWidth + PX, display: 'block', whiteSpace: whiteSpace || 'normal' // #3331 }); } wrapper.getSpanCorrection(elem.offsetWidth, baseline, alignCorrection, rotation, align); } // apply position with correction css(elem, { left: (x + (wrapper.xCorr || 0)) + PX, top: (y + (wrapper.yCorr || 0)) + PX }); // force reflow in webkit to apply the left and top on useHTML element (#1249) if (isWebKit) { baseline = elem.offsetHeight; // assigned to baseline for lint purpose } // record current text transform wrapper.cTT = currentTextTransform; } }, /** * Set the rotation of an individual HTML span */ setSpanRotation: function (rotation, alignCorrection, baseline) { var rotationStyle = {}, cssTransformKey = isMS ? '-ms-transform' : isWebKit ? '-webkit-transform' : isFirefox ? 'MozTransform' : isOpera ? '-o-transform' : ''; rotationStyle[cssTransformKey] = rotationStyle.transform = 'rotate(' + rotation + 'deg)'; rotationStyle[cssTransformKey + (isFirefox ? 'Origin' : '-origin')] = rotationStyle.transformOrigin = (alignCorrection * 100) + '% ' + baseline + 'px'; css(this.element, rotationStyle); }, /** * Get the correction in X and Y positioning as the element is rotated. */ getSpanCorrection: function (width, baseline, alignCorrection) { this.xCorr = -width * alignCorrection; this.yCorr = -baseline; } }); // Extend SvgRenderer for useHTML option. extend(SVGRenderer.prototype, { /** * Create HTML text node. This is used by the VML renderer as well as the SVG * renderer through the useHTML option. * * @param {String} str * @param {Number} x * @param {Number} y */ html: function (str, x, y) { var wrapper = this.createElement('span'), element = wrapper.element, renderer = wrapper.renderer, isSVG = renderer.isSVG, addSetters = function (element, style) { // These properties are set as attributes on the SVG group, and as // identical CSS properties on the div. (#3542) each(['display', 'opacity', 'visibility'], function (prop) { wrap(element, prop + 'Setter', function (proceed, value, key, elem) { proceed.call(this, value, key, elem); style[key] = value; }); }); }; // Text setter wrapper.textSetter = function (value) { if (value !== element.innerHTML) { delete this.bBox; } element.innerHTML = this.textStr = value; wrapper.htmlUpdateTransform(); }; // Add setters for the element itself (#4938) if (isSVG) { // #4938, only for HTML within SVG addSetters(wrapper, wrapper.element.style); } // Various setters which rely on update transform wrapper.xSetter = wrapper.ySetter = wrapper.alignSetter = wrapper.rotationSetter = function (value, key) { if (key === 'align') { key = 'textAlign'; // Do not overwrite the SVGElement.align method. Same as VML. } wrapper[key] = value; wrapper.htmlUpdateTransform(); }; // Set the default attributes wrapper .attr({ text: str, x: mathRound(x), y: mathRound(y) }) .css({ position: ABSOLUTE, fontFamily: this.style.fontFamily, fontSize: this.style.fontSize }); // Keep the whiteSpace style outside the wrapper.styles collection element.style.whiteSpace = 'nowrap'; // Use the HTML specific .css method wrapper.css = wrapper.htmlCss; // This is specific for HTML within SVG if (isSVG) { wrapper.add = function (svgGroupWrapper) { var htmlGroup, container = renderer.box.parentNode, parentGroup, parents = []; this.parentGroup = svgGroupWrapper; // Create a mock group to hold the HTML elements if (svgGroupWrapper) { htmlGroup = svgGroupWrapper.div; if (!htmlGroup) { // Read the parent chain into an array and read from top down parentGroup = svgGroupWrapper; while (parentGroup) { parents.push(parentGroup); // Move up to the next parent group parentGroup = parentGroup.parentGroup; } // Ensure dynamically updating position when any parent is translated each(parents.reverse(), function (parentGroup) { var htmlGroupStyle, cls = attr(parentGroup.element, 'class'); if (cls) { cls = { className: cls }; } // else null // Create a HTML div and append it to the parent div to emulate // the SVG group structure htmlGroup = parentGroup.div = parentGroup.div || createElement(DIV, cls, { position: ABSOLUTE, left: (parentGroup.translateX || 0) + PX, top: (parentGroup.translateY || 0) + PX, display: parentGroup.display, opacity: parentGroup.opacity, // #5075 pointerEvents: parentGroup.styles && parentGroup.styles.pointerEvents // #5595 }, htmlGroup || container); // the top group is appended to container // Shortcut htmlGroupStyle = htmlGroup.style; // Set listeners to update the HTML div's position whenever the SVG group // position is changed extend(parentGroup, { translateXSetter: function (value, key) { htmlGroupStyle.left = value + PX; parentGroup[key] = value; parentGroup.doTransform = true; }, translateYSetter: function (value, key) { htmlGroupStyle.top = value + PX; parentGroup[key] = value; parentGroup.doTransform = true; } }); addSetters(parentGroup, htmlGroupStyle); }); } } else { htmlGroup = container; } htmlGroup.appendChild(element); // Shared with VML: wrapper.added = true; if (wrapper.alignOnAdd) { wrapper.htmlUpdateTransform(); } return wrapper; }; } return wrapper; } }); /* **************************************************************************** * * * START OF INTERNET EXPLORER <= 8 SPECIFIC CODE * * * * For applications and websites that don't need IE support, like platform * * targeted mobile apps and web apps, this code can be removed. * * * *****************************************************************************/ /** * @constructor */ var VMLRenderer, VMLElement; if (!hasSVG && !useCanVG) { /** * The VML element wrapper. */ VMLElement = { /** * Initialize a new VML element wrapper. It builds the markup as a string * to minimize DOM traffic. * @param {Object} renderer * @param {Object} nodeName */ init: function (renderer, nodeName) { var wrapper = this, markup = ['<', nodeName, ' filled="f" stroked="f"'], style = ['position: ', ABSOLUTE, ';'], isDiv = nodeName === DIV; // divs and shapes need size if (nodeName === 'shape' || isDiv) { style.push('left:0;top:0;width:1px;height:1px;'); } style.push('visibility: ', isDiv ? HIDDEN : VISIBLE); markup.push(' style="', style.join(''), '"/>'); // create element with default attributes and style if (nodeName) { markup = isDiv || nodeName === 'span' || nodeName === 'img' ? markup.join('') : renderer.prepVML(markup); wrapper.element = createElement(markup); } wrapper.renderer = renderer; }, /** * Add the node to the given parent * @param {Object} parent */ add: function (parent) { var wrapper = this, renderer = wrapper.renderer, element = wrapper.element, box = renderer.box, inverted = parent && parent.inverted, // get the parent node parentNode = parent ? parent.element || parent : box; if (parent) { this.parentGroup = parent; } // if the parent group is inverted, apply inversion on all children if (inverted) { // only on groups renderer.invertChild(element, parentNode); } // append it parentNode.appendChild(element); // align text after adding to be able to read offset wrapper.added = true; if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) { wrapper.updateTransform(); } // fire an event for internal hooks if (wrapper.onAdd) { wrapper.onAdd(); } return wrapper; }, /** * VML always uses htmlUpdateTransform */ updateTransform: SVGElement.prototype.htmlUpdateTransform, /** * Set the rotation of a span with oldIE's filter */ setSpanRotation: function () { // Adjust for alignment and rotation. Rotation of useHTML content is not yet implemented // but it can probably be implemented for Firefox 3.5+ on user request. FF3.5+ // has support for CSS3 transform. The getBBox method also needs to be updated // to compensate for the rotation, like it currently does for SVG. // Test case: http://jsfiddle.net/highcharts/Ybt44/ var rotation = this.rotation, costheta = mathCos(rotation * deg2rad), sintheta = mathSin(rotation * deg2rad); css(this.element, { filter: rotation ? ['progid:DXImageTransform.Microsoft.Matrix(M11=', costheta, ', M12=', -sintheta, ', M21=', sintheta, ', M22=', costheta, ', sizingMethod=\'auto expand\')'].join('') : NONE }); }, /** * Get the positioning correction for the span after rotating. */ getSpanCorrection: function (width, baseline, alignCorrection, rotation, align) { var costheta = rotation ? mathCos(rotation * deg2rad) : 1, sintheta = rotation ? mathSin(rotation * deg2rad) : 0, height = pick(this.elemHeight, this.element.offsetHeight), quad, nonLeft = align && align !== 'left'; // correct x and y this.xCorr = costheta < 0 && -width; this.yCorr = sintheta < 0 && -height; // correct for baseline and corners spilling out after rotation quad = costheta * sintheta < 0; this.xCorr += sintheta * baseline * (quad ? 1 - alignCorrection : alignCorrection); this.yCorr -= costheta * baseline * (rotation ? (quad ? alignCorrection : 1 - alignCorrection) : 1); // correct for the length/height of the text if (nonLeft) { this.xCorr -= width * alignCorrection * (costheta < 0 ? -1 : 1); if (rotation) { this.yCorr -= height * alignCorrection * (sintheta < 0 ? -1 : 1); } css(this.element, { textAlign: align }); } }, /** * Converts a subset of an SVG path definition to its VML counterpart. Takes an array * as the parameter and returns a string. */ pathToVML: function (value) { // convert paths var i = value.length, path = []; while (i--) { // Multiply by 10 to allow subpixel precision. // Substracting half a pixel seems to make the coordinates // align with SVG, but this hasn't been tested thoroughly if (isNumber(value[i])) { path[i] = mathRound(value[i] * 10) - 5; } else if (value[i] === 'Z') { // close the path path[i] = 'x'; } else { path[i] = value[i]; // When the start X and end X coordinates of an arc are too close, // they are rounded to the same value above. In this case, substract or // add 1 from the end X and Y positions. #186, #760, #1371, #1410. if (value.isArc && (value[i] === 'wa' || value[i] === 'at')) { // Start and end X if (path[i + 5] === path[i + 7]) { path[i + 7] += value[i + 7] > value[i + 5] ? 1 : -1; } // Start and end Y if (path[i + 6] === path[i + 8]) { path[i + 8] += value[i + 8] > value[i + 6] ? 1 : -1; } } } } // Loop up again to handle path shortcuts (#2132) /*while (i++ < path.length) { if (path[i] === 'H') { // horizontal line to path[i] = 'L'; path.splice(i + 2, 0, path[i - 1]); } else if (path[i] === 'V') { // vertical line to path[i] = 'L'; path.splice(i + 1, 0, path[i - 2]); } }*/ return path.join(' ') || 'x'; }, /** * Set the element's clipping to a predefined rectangle * * @param {String} id The id of the clip rectangle */ clip: function (clipRect) { var wrapper = this, clipMembers, cssRet; if (clipRect) { clipMembers = clipRect.members; erase(clipMembers, wrapper); // Ensure unique list of elements (#1258) clipMembers.push(wrapper); wrapper.destroyClip = function () { erase(clipMembers, wrapper); }; cssRet = clipRect.getCSS(wrapper); } else { if (wrapper.destroyClip) { wrapper.destroyClip(); } cssRet = { clip: docMode8 ? 'inherit' : 'rect(auto)' }; // #1214 } return wrapper.css(cssRet); }, /** * Set styles for the element * @param {Object} styles */ css: SVGElement.prototype.htmlCss, /** * Removes a child either by removeChild or move to garbageBin. * Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not. */ safeRemoveChild: function (element) { // discardElement will detach the node from its parent before attaching it // to the garbage bin. Therefore it is important that the node is attached and have parent. if (element.parentNode) { discardElement(element); } }, /** * Extend element.destroy by removing it from the clip members array */ destroy: function () { if (this.destroyClip) { this.destroyClip(); } return SVGElement.prototype.destroy.apply(this); }, /** * Add an event listener. VML override for normalizing event parameters. * @param {String} eventType * @param {Function} handler */ on: function (eventType, handler) { // simplest possible event model for internal use this.element['on' + eventType] = function () { var evt = win.event; evt.target = evt.srcElement; handler(evt); }; return this; }, /** * In stacked columns, cut off the shadows so that they don't overlap */ cutOffPath: function (path, length) { var len; path = path.split(/[ ,]/); len = path.length; if (len === 9 || len === 11) { path[len - 4] = path[len - 2] = pInt(path[len - 2]) - 10 * length; } return path.join(' '); }, /** * Apply a drop shadow by copying elements and giving them different strokes * @param {Boolean|Object} shadowOptions */ shadow: function (shadowOptions, group, cutOff) { var shadows = [], i, element = this.element, renderer = this.renderer, shadow, elemStyle = element.style, markup, path = element.path, strokeWidth, modifiedPath, shadowWidth, shadowElementOpacity; // some times empty paths are not strings if (path && typeof path.value !== 'string') { path = 'x'; } modifiedPath = path; if (shadowOptions) { shadowWidth = pick(shadowOptions.width, 3); shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth; for (i = 1; i <= 3; i++) { strokeWidth = (shadowWidth * 2) + 1 - (2 * i); // Cut off shadows for stacked column items if (cutOff) { modifiedPath = this.cutOffPath(path.value, strokeWidth + 0.5); } markup = ['<shape isShadow="true" strokeweight="', strokeWidth, '" filled="false" path="', modifiedPath, '" coordsize="10 10" style="', element.style.cssText, '" />']; shadow = createElement(renderer.prepVML(markup), null, { left: pInt(elemStyle.left) + pick(shadowOptions.offsetX, 1), top: pInt(elemStyle.top) + pick(shadowOptions.offsetY, 1) } ); if (cutOff) { shadow.cutOff = strokeWidth + 1; } // apply the opacity markup = ['<stroke color="', shadowOptions.color || 'black', '" opacity="', shadowElementOpacity * i, '"/>']; createElement(renderer.prepVML(markup), null, null, shadow); // insert it if (group) { group.element.appendChild(shadow); } else { element.parentNode.insertBefore(shadow, element); } // record it shadows.push(shadow); } this.shadows = shadows; } return this; }, updateShadows: noop, // Used in SVG only setAttr: function (key, value) { if (docMode8) { // IE8 setAttribute bug this.element[key] = value; } else { this.element.setAttribute(key, value); } }, classSetter: function (value) { // IE8 Standards mode has problems retrieving the className unless set like this this.element.className = value; }, dashstyleSetter: function (value, key, element) { var strokeElem = element.getElementsByTagName('stroke')[0] || createElement(this.renderer.prepVML(['<stroke/>']), null, null, element); strokeElem[key] = value || 'solid'; this[key] = value; /* because changing stroke-width will change the dash length and cause an epileptic effect */ }, dSetter: function (value, key, element) { var i, shadows = this.shadows; value = value || []; this.d = value.join && value.join(' '); // used in getter for animation element.path = value = this.pathToVML(value); // update shadows if (shadows) { i = shadows.length; while (i--) { shadows[i].path = shadows[i].cutOff ? this.cutOffPath(value, shadows[i].cutOff) : value; } } this.setAttr(key, value); }, fillSetter: function (value, key, element) { var nodeName = element.nodeName; if (nodeName === 'SPAN') { // text color element.style.color = value; } else if (nodeName !== 'IMG') { // #1336 element.filled = value !== NONE; this.setAttr('fillcolor', this.renderer.color(value, element, key, this)); } }, 'fill-opacitySetter': function (value, key, element) { createElement( this.renderer.prepVML(['<', key.split('-')[0], ' opacity="', value, '"/>']), null, null, element ); }, opacitySetter: noop, // Don't bother - animation is too slow and filters introduce artifacts rotationSetter: function (value, key, element) { var style = element.style; this[key] = style[key] = value; // style is for #1873 // Correction for the 1x1 size of the shape container. Used in gauge needles. style.left = -mathRound(mathSin(value * deg2rad) + 1) + PX; style.top = mathRound(mathCos(value * deg2rad)) + PX; }, strokeSetter: function (value, key, element) { this.setAttr('strokecolor', this.renderer.color(value, element, key, this)); }, 'stroke-widthSetter': function (value, key, element) { element.stroked = !!value; // VML "stroked" attribute this[key] = value; // used in getter, issue #113 if (isNumber(value)) { value += PX; } this.setAttr('strokeweight', value); }, titleSetter: function (value, key) { this.setAttr(key, value); }, visibilitySetter: function (value, key, element) { // Handle inherited visibility if (value === 'inherit') { value = VISIBLE; } // Let the shadow follow the main element if (this.shadows) { each(this.shadows, function (shadow) { shadow.style[key] = value; }); } // Instead of toggling the visibility CSS property, move the div out of the viewport. // This works around #61 and #586 if (element.nodeName === 'DIV') { value = value === HIDDEN ? '-999em' : 0; // In order to redraw, IE7 needs the div to be visible when tucked away // outside the viewport. So the visibility is actually opposite of // the expected value. This applies to the tooltip only. if (!docMode8) { element.style[key] = value ? VISIBLE : HIDDEN; } key = 'top'; } element.style[key] = value; }, displaySetter: function (value, key, element) { element.style[key] = value; }, xSetter: function (value, key, element) { this[key] = value; // used in getter if (key === 'x') { key = 'left'; } else if (key === 'y') { key = 'top'; }/* else { value = mathMax(0, value); // don't set width or height below zero (#311) }*/ // clipping rectangle special if (this.updateClipping) { this[key] = value; // the key is now 'left' or 'top' for 'x' and 'y' this.updateClipping(); } else { // normal element.style[key] = value; } }, zIndexSetter: function (value, key, element) { element.style[key] = value; } }; VMLElement['stroke-opacitySetter'] = VMLElement['fill-opacitySetter']; Highcharts.VMLElement = VMLElement = extendClass(SVGElement, VMLElement); // Some shared setters VMLElement.prototype.ySetter = VMLElement.prototype.widthSetter = VMLElement.prototype.heightSetter = VMLElement.prototype.xSetter; /** * The VML renderer */ var VMLRendererExtension = { // inherit SVGRenderer Element: VMLElement, isIE8: userAgent.indexOf('MSIE 8.0') > -1, /** * Initialize the VMLRenderer * @param {Object} container * @param {Number} width * @param {Number} height */ init: function (container, width, height, style) { var renderer = this, boxWrapper, box, css; renderer.alignedObjects = []; boxWrapper = renderer.createElement(DIV) .css(extend(this.getStyle(style), { position: 'relative' })); box = boxWrapper.element; container.appendChild(boxWrapper.element); // generate the containing box renderer.isVML = true; renderer.box = box; renderer.boxWrapper = boxWrapper; renderer.gradients = {}; renderer.cache = {}; // Cache for numerical bounding boxes renderer.cacheKeys = []; renderer.imgCount = 0; renderer.setSize(width, height, false); // The only way to make IE6 and IE7 print is to use a global namespace. However, // with IE8 the only way to make the dynamic shapes visible in screen and print mode // seems to be to add the xmlns attribute and the behaviour style inline. if (!doc.namespaces.hcv) { doc.namespaces.add('hcv', 'urn:schemas-microsoft-com:vml'); // Setup default CSS (#2153, #2368, #2384) css = 'hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke' + '{ behavior:url(#default#VML); display: inline-block; } '; try { doc.createStyleSheet().cssText = css; } catch (e) { doc.styleSheets[0].cssText += css; } } }, /** * Detect whether the renderer is hidden. This happens when one of the parent elements * has display: none */ isHidden: function () { return !this.box.offsetWidth; }, /** * Define a clipping rectangle. In VML it is accomplished by storing the values * for setting the CSS style to all associated members. * * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height */ clipRect: function (x, y, width, height) { // create a dummy element var clipRect = this.createElement(), isObj = isObject(x); // mimic a rectangle with its style object for automatic updating in attr return extend(clipRect, { members: [], count: 0, left: (isObj ? x.x : x) + 1, top: (isObj ? x.y : y) + 1, width: (isObj ? x.width : width) - 1, height: (isObj ? x.height : height) - 1, getCSS: function (wrapper) { var element = wrapper.element, nodeName = element.nodeName, isShape = nodeName === 'shape', inverted = wrapper.inverted, rect = this, top = rect.top - (isShape ? element.offsetTop : 0), left = rect.left, right = left + rect.width, bottom = top + rect.height, ret = { clip: 'rect(' + mathRound(inverted ? left : top) + 'px,' + mathRound(inverted ? bottom : right) + 'px,' + mathRound(inverted ? right : bottom) + 'px,' + mathRound(inverted ? top : left) + 'px)' }; // issue 74 workaround if (!inverted && docMode8 && nodeName === 'DIV') { extend(ret, { width: right + PX, height: bottom + PX }); } return ret; }, // used in attr and animation to update the clipping of all members updateClipping: function () { each(clipRect.members, function (member) { if (member.element) { // Deleted series, like in stock/members/series-remove demo. Should be removed from members, but this will do. member.css(clipRect.getCSS(member)); } }); } }); }, /** * Take a color and return it if it's a string, make it a gradient if it's a * gradient configuration object, and apply opacity. * * @param {Object} color The color or config object */ color: function (color, elem, prop, wrapper) { var renderer = this, colorObject, regexRgba = /^rgba/, markup, fillType, ret = NONE; // Check for linear or radial gradient if (color && color.linearGradient) { fillType = 'gradient'; } else if (color && color.radialGradient) { fillType = 'pattern'; } if (fillType) { var stopColor, stopOpacity, gradient = color.linearGradient || color.radialGradient, x1, y1, x2, y2, opacity1, opacity2, color1, color2, fillAttr = '', stops = color.stops, firstStop, lastStop, colors = [], addFillNode = function () { // Add the fill subnode. When colors attribute is used, the meanings of opacity and o:opacity2 // are reversed. markup = ['<fill colors="' + colors.join(',') + '" opacity="', opacity2, '" o:opacity2="', opacity1, '" type="', fillType, '" ', fillAttr, 'focus="100%" method="any" />']; createElement(renderer.prepVML(markup), null, null, elem); }; // Extend from 0 to 1 firstStop = stops[0]; lastStop = stops[stops.length - 1]; if (firstStop[0] > 0) { stops.unshift([ 0, firstStop[1] ]); } if (lastStop[0] < 1) { stops.push([ 1, lastStop[1] ]); } // Compute the stops each(stops, function (stop, i) { if (regexRgba.test(stop[1])) { colorObject = Color(stop[1]); stopColor = colorObject.get('rgb'); stopOpacity = colorObject.get('a'); } else { stopColor = stop[1]; stopOpacity = 1; } // Build the color attribute colors.push((stop[0] * 100) + '% ' + stopColor); // Only start and end opacities are allowed, so we use the first and the last if (!i) { opacity1 = stopOpacity; color2 = stopColor; } else { opacity2 = stopOpacity; color1 = stopColor; } }); // Apply the gradient to fills only. if (prop === 'fill') { // Handle linear gradient angle if (fillType === 'gradient') { x1 = gradient.x1 || gradient[0] || 0; y1 = gradient.y1 || gradient[1] || 0; x2 = gradient.x2 || gradient[2] || 0; y2 = gradient.y2 || gradient[3] || 0; fillAttr = 'angle="' + (90 - math.atan( (y2 - y1) / // y vector (x2 - x1) // x vector ) * 180 / mathPI) + '"'; addFillNode(); // Radial (circular) gradient } else { var r = gradient.r, sizex = r * 2, sizey = r * 2, cx = gradient.cx, cy = gradient.cy, radialReference = elem.radialReference, bBox, applyRadialGradient = function () { if (radialReference) { bBox = wrapper.getBBox(); cx += (radialReference[0] - bBox.x) / bBox.width - 0.5; cy += (radialReference[1] - bBox.y) / bBox.height - 0.5; sizex *= radialReference[2] / bBox.width; sizey *= radialReference[2] / bBox.height; } fillAttr = 'src="' + defaultOptions.global.VMLRadialGradientURL + '" ' + 'size="' + sizex + ',' + sizey + '" ' + 'origin="0.5,0.5" ' + 'position="' + cx + ',' + cy + '" ' + 'color2="' + color2 + '" '; addFillNode(); }; // Apply radial gradient if (wrapper.added) { applyRadialGradient(); } else { // We need to know the bounding box to get the size and position right wrapper.onAdd = applyRadialGradient; } // The fill element's color attribute is broken in IE8 standards mode, so we // need to set the parent shape's fillcolor attribute instead. ret = color1; } // Gradients are not supported for VML stroke, return the first color. #722. } else { ret = stopColor; } // If the color is an rgba color, split it and add a fill node // to hold the opacity component } else if (regexRgba.test(color) && elem.tagName !== 'IMG') { colorObject = Color(color); wrapper[prop + '-opacitySetter'](colorObject.get('a'), prop, elem); ret = colorObject.get('rgb'); } else { var propNodes = elem.getElementsByTagName(prop); // 'stroke' or 'fill' node if (propNodes.length) { propNodes[0].opacity = 1; propNodes[0].type = 'solid'; } ret = color; } return ret; }, /** * Take a VML string and prepare it for either IE8 or IE6/IE7. * @param {Array} markup A string array of the VML markup to prepare */ prepVML: function (markup) { var vmlStyle = 'display:inline-block;behavior:url(#default#VML);', isIE8 = this.isIE8; markup = markup.join(''); if (isIE8) { // add xmlns and style inline markup = markup.replace('/>', ' xmlns="urn:schemas-microsoft-com:vml" />'); if (markup.indexOf('style="') === -1) { markup = markup.replace('/>', ' style="' + vmlStyle + '" />'); } else { markup = markup.replace('style="', 'style="' + vmlStyle); } } else { // add namespace markup = markup.replace('<', '<hcv:'); } return markup; }, /** * Create rotated and aligned text * @param {String} str * @param {Number} x * @param {Number} y */ text: SVGRenderer.prototype.html, /** * Create and return a path element * @param {Array} path */ path: function (path) { var attr = { // subpixel precision down to 0.1 (width and height = 1px) coordsize: '10 10' }; if (isArray(path)) { attr.d = path; } else if (isObject(path)) { // attributes extend(attr, path); } // create the shape return this.createElement('shape').attr(attr); }, /** * Create and return a circle element. In VML circles are implemented as * shapes, which is faster than v:oval * @param {Number} x * @param {Number} y * @param {Number} r */ circle: function (x, y, r) { var circle = this.symbol('circle'); if (isObject(x)) { r = x.r; y = x.y; x = x.x; } circle.isCircle = true; // Causes x and y to mean center (#1682) circle.r = r; return circle.attr({ x: x, y: y }); }, /** * Create a group using an outer div and an inner v:group to allow rotating * and flipping. A simple v:group would have problems with positioning * child HTML elements and CSS clip. * * @param {String} name The name of the group */ g: function (name) { var wrapper, attribs; // set the class name if (name) { attribs = { 'className': PREFIX + name, 'class': PREFIX + name }; } // the div to hold HTML and clipping wrapper = this.createElement(DIV).attr(attribs); return wrapper; }, /** * VML override to create a regular HTML image * @param {String} src * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height */ image: function (src, x, y, width, height) { var obj = this.createElement('img') .attr({ src: src }); if (arguments.length > 1) { obj.attr({ x: x, y: y, width: width, height: height }); } return obj; }, /** * For rectangles, VML uses a shape for rect to overcome bugs and rotation problems */ createElement: function (nodeName) { return nodeName === 'rect' ? this.symbol(nodeName) : SVGRenderer.prototype.createElement.call(this, nodeName); }, /** * In the VML renderer, each child of an inverted div (group) is inverted * @param {Object} element * @param {Object} parentNode */ invertChild: function (element, parentNode) { var ren = this, parentStyle = parentNode.style, imgStyle = element.tagName === 'IMG' && element.style; // #1111 css(element, { flip: 'x', left: pInt(parentStyle.width) - (imgStyle ? pInt(imgStyle.top) : 1), top: pInt(parentStyle.height) - (imgStyle ? pInt(imgStyle.left) : 1), rotation: -90 }); // Recursively invert child elements, needed for nested composite shapes like box plots and error bars. #1680, #1806. each(element.childNodes, function (child) { ren.invertChild(child, element); }); }, /** * Symbol definitions that override the parent SVG renderer's symbols * */ symbols: { // VML specific arc function arc: function (x, y, w, h, options) { var start = options.start, end = options.end, radius = options.r || w || h, innerRadius = options.innerR, cosStart = mathCos(start), sinStart = mathSin(start), cosEnd = mathCos(end), sinEnd = mathSin(end), ret; if (end - start === 0) { // no angle, don't show it. return ['x']; } ret = [ 'wa', // clockwise arc to x - radius, // left y - radius, // top x + radius, // right y + radius, // bottom x + radius * cosStart, // start x y + radius * sinStart, // start y x + radius * cosEnd, // end x y + radius * sinEnd // end y ]; if (options.open && !innerRadius) { ret.push( 'e', M, x, // - innerRadius, y// - innerRadius ); } ret.push( 'at', // anti clockwise arc to x - innerRadius, // left y - innerRadius, // top x + innerRadius, // right y + innerRadius, // bottom x + innerRadius * cosEnd, // start x y + innerRadius * sinEnd, // start y x + innerRadius * cosStart, // end x y + innerRadius * sinStart, // end y 'x', // finish path 'e' // close ); ret.isArc = true; return ret; }, // Add circle symbol path. This performs significantly faster than v:oval. circle: function (x, y, w, h, wrapper) { if (wrapper) { w = h = 2 * wrapper.r; } // Center correction, #1682 if (wrapper && wrapper.isCircle) { x -= w / 2; y -= h / 2; } // Return the path return [ 'wa', // clockwisearcto x, // left y, // top x + w, // right y + h, // bottom x + w, // start x y + h / 2, // start y x + w, // end x y + h / 2, // end y //'x', // finish path 'e' // close ]; }, /** * Add rectangle symbol path which eases rotation and omits arcsize problems * compared to the built-in VML roundrect shape. When borders are not rounded, * use the simpler square path, else use the callout path without the arrow. */ rect: function (x, y, w, h, options) { return SVGRenderer.prototype.symbols[ !defined(options) || !options.r ? 'square' : 'callout' ].call(0, x, y, w, h, options); } } }; Highcharts.VMLRenderer = VMLRenderer = function () { this.init.apply(this, arguments); }; VMLRenderer.prototype = merge(SVGRenderer.prototype, VMLRendererExtension); // general renderer Renderer = VMLRenderer; } // This method is used with exporting in old IE, when emulating SVG (see #2314) SVGRenderer.prototype.measureSpanWidth = function (text, styles) { var measuringSpan = doc.createElement('span'), offsetWidth, textNode = doc.createTextNode(text); measuringSpan.appendChild(textNode); css(measuringSpan, styles); this.box.appendChild(measuringSpan); offsetWidth = measuringSpan.offsetWidth; discardElement(measuringSpan); // #2463 return offsetWidth; }; /* **************************************************************************** * * * END OF INTERNET EXPLORER <= 8 SPECIFIC CODE * * * *****************************************************************************/ /* **************************************************************************** * * * START OF ANDROID < 3 SPECIFIC CODE. THIS CAN BE REMOVED IF YOU'RE NOT * * TARGETING THAT SYSTEM. * * * *****************************************************************************/ var CanVGRenderer, CanVGController; /** * Downloads a script and executes a callback when done. * @param {String} scriptLocation * @param {Function} callback */ function getScript(scriptLocation, callback) { var head = doc.getElementsByTagName('head')[0], script = doc.createElement('script'); script.type = 'text/javascript'; script.src = scriptLocation; script.onload = callback; head.appendChild(script); } if (useCanVG) { /** * The CanVGRenderer is empty from start to keep the source footprint small. * When requested, the CanVGController downloads the rest of the source packaged * together with the canvg library. */ Highcharts.CanVGRenderer = CanVGRenderer = function () { // Override the global SVG namespace to fake SVG/HTML that accepts CSS SVG_NS = 'http://www.w3.org/1999/xhtml'; }; /** * Start with an empty symbols object. This is needed when exporting is used (exporting.src.js will add a few symbols), but * the implementation from SvgRenderer will not be merged in until first render. */ CanVGRenderer.prototype.symbols = {}; /** * Handles on demand download of canvg rendering support. */ CanVGController = (function () { // List of renderering calls var deferredRenderCalls = []; /** * When downloaded, we are ready to draw deferred charts. */ function drawDeferred() { var callLength = deferredRenderCalls.length, callIndex; // Draw all pending render calls for (callIndex = 0; callIndex < callLength; callIndex++) { deferredRenderCalls[callIndex](); } // Clear the list deferredRenderCalls = []; } return { push: function (func, scriptLocation) { // Only get the script once if (deferredRenderCalls.length === 0) { getScript(scriptLocation, drawDeferred); } // Register render call deferredRenderCalls.push(func); } }; }()); Renderer = CanVGRenderer; } // end CanVGRenderer /* **************************************************************************** * * * END OF ANDROID < 3 SPECIFIC CODE * * * *****************************************************************************/ /** * The Tick class */ function Tick(axis, pos, type, noLabel) { this.axis = axis; this.pos = pos; this.type = type || ''; this.isNew = true; if (!type && !noLabel) { this.addLabel(); } } Tick.prototype = { /** * Write the tick label */ addLabel: function () { var tick = this, axis = tick.axis, options = axis.options, chart = axis.chart, categories = axis.categories, names = axis.names, pos = tick.pos, labelOptions = options.labels, str, tickPositions = axis.tickPositions, isFirst = pos === tickPositions[0], isLast = pos === tickPositions[tickPositions.length - 1], value = categories ? pick(categories[pos], names[pos], pos) : pos, label = tick.label, tickPositionInfo = tickPositions.info, dateTimeLabelFormat; // Set the datetime label format. If a higher rank is set for this position, use that. If not, // use the general format. if (axis.isDatetimeAxis && tickPositionInfo) { dateTimeLabelFormat = options.dateTimeLabelFormats[tickPositionInfo.higherRanks[pos] || tickPositionInfo.unitName]; } // set properties for access in render method tick.isFirst = isFirst; tick.isLast = isLast; // get the string str = axis.labelFormatter.call({ axis: axis, chart: chart, isFirst: isFirst, isLast: isLast, dateTimeLabelFormat: dateTimeLabelFormat, value: axis.isLog ? correctFloat(axis.lin2log(value)) : value }); // prepare CSS //css = width && { width: mathMax(1, mathRound(width - 2 * (labelOptions.padding || 10))) + PX }; // first call if (!defined(label)) { tick.label = label = defined(str) && labelOptions.enabled ? chart.renderer.text( str, 0, 0, labelOptions.useHTML ) //.attr(attr) // without position absolute, IE export sometimes is wrong .css(merge(labelOptions.style)) .add(axis.labelGroup) : null; tick.labelLength = label && label.getBBox().width; // Un-rotated length tick.rotation = 0; // Base value to detect change for new calls to getBBox // update } else if (label) { label.attr({ text: str }); } }, /** * Get the offset height or width of the label */ getLabelSize: function () { return this.label ? this.label.getBBox()[this.axis.horiz ? 'height' : 'width'] : 0; }, /** * Handle the label overflow by adjusting the labels to the left and right edge, or * hide them if they collide into the neighbour label. */ handleOverflow: function (xy) { var axis = this.axis, pxPos = xy.x, chartWidth = axis.chart.chartWidth, spacing = axis.chart.spacing, leftBound = pick(axis.labelLeft, mathMin(axis.pos, spacing[3])), rightBound = pick(axis.labelRight, mathMax(axis.pos + axis.len, chartWidth - spacing[1])), label = this.label, rotation = this.rotation, factor = { left: 0, center: 0.5, right: 1 }[axis.labelAlign], labelWidth = label.getBBox().width, slotWidth = axis.getSlotWidth(), modifiedSlotWidth = slotWidth, xCorrection = factor, goRight = 1, leftPos, rightPos, textWidth, css = {}; // Check if the label overshoots the chart spacing box. If it does, move it. // If it now overshoots the slotWidth, add ellipsis. if (!rotation) { leftPos = pxPos - factor * labelWidth; rightPos = pxPos + (1 - factor) * labelWidth; if (leftPos < leftBound) { modifiedSlotWidth = xy.x + modifiedSlotWidth * (1 - factor) - leftBound; } else if (rightPos > rightBound) { modifiedSlotWidth = rightBound - xy.x + modifiedSlotWidth * factor; goRight = -1; } modifiedSlotWidth = mathMin(slotWidth, modifiedSlotWidth); // #4177 if (modifiedSlotWidth < slotWidth && axis.labelAlign === 'center') { xy.x += goRight * (slotWidth - modifiedSlotWidth - xCorrection * (slotWidth - mathMin(labelWidth, modifiedSlotWidth))); } // If the label width exceeds the available space, set a text width to be // picked up below. Also, if a width has been set before, we need to set a new // one because the reported labelWidth will be limited by the box (#3938). if (labelWidth > modifiedSlotWidth || (axis.autoRotation && label.styles.width)) { textWidth = modifiedSlotWidth; } // Add ellipsis to prevent rotated labels to be clipped against the edge of the chart } else if (rotation < 0 && pxPos - factor * labelWidth < leftBound) { textWidth = mathRound(pxPos / mathCos(rotation * deg2rad) - leftBound); } else if (rotation > 0 && pxPos + factor * labelWidth > rightBound) { textWidth = mathRound((chartWidth - pxPos) / mathCos(rotation * deg2rad)); } if (textWidth) { css.width = textWidth; if (!axis.options.labels.style.textOverflow) { css.textOverflow = 'ellipsis'; } label.css(css); } }, /** * Get the x and y position for ticks and labels */ getPosition: function (horiz, pos, tickmarkOffset, old) { var axis = this.axis, chart = axis.chart, cHeight = (old && chart.oldChartHeight) || chart.chartHeight; return { x: horiz ? axis.translate(pos + tickmarkOffset, null, null, old) + axis.transB : axis.left + axis.offset + (axis.opposite ? ((old && chart.oldChartWidth) || chart.chartWidth) - axis.right - axis.left : 0), y: horiz ? cHeight - axis.bottom + axis.offset - (axis.opposite ? axis.height : 0) : cHeight - axis.translate(pos + tickmarkOffset, null, null, old) - axis.transB }; }, /** * Get the x, y position of the tick label */ getLabelPosition: function (x, y, label, horiz, labelOptions, tickmarkOffset, index, step) { var axis = this.axis, transA = axis.transA, reversed = axis.reversed, staggerLines = axis.staggerLines, rotCorr = axis.tickRotCorr || { x: 0, y: 0 }, yOffset = labelOptions.y, line; if (!defined(yOffset)) { if (axis.side === 0) { yOffset = label.rotation ? -8 : -label.getBBox().height; } else if (axis.side === 2) { yOffset = rotCorr.y + 8; } else { // #3140, #3140 yOffset = mathCos(label.rotation * deg2rad) * (rotCorr.y - label.getBBox(false, 0).height / 2); } } x = x + labelOptions.x + rotCorr.x - (tickmarkOffset && horiz ? tickmarkOffset * transA * (reversed ? -1 : 1) : 0); y = y + yOffset - (tickmarkOffset && !horiz ? tickmarkOffset * transA * (reversed ? 1 : -1) : 0); // Correct for staggered labels if (staggerLines) { line = (index / (step || 1) % staggerLines); if (axis.opposite) { line = staggerLines - line - 1; } y += line * (axis.labelOffset / staggerLines); } return { x: x, y: mathRound(y) }; }, /** * Extendible method to return the path of the marker */ getMarkPath: function (x, y, tickLength, tickWidth, horiz, renderer) { return renderer.crispLine([ M, x, y, L, x + (horiz ? 0 : -tickLength), y + (horiz ? tickLength : 0) ], tickWidth); }, /** * Put everything in place * * @param index {Number} * @param old {Boolean} Use old coordinates to prepare an animation into new position */ render: function (index, old, opacity) { var tick = this, axis = tick.axis, options = axis.options, chart = axis.chart, renderer = chart.renderer, horiz = axis.horiz, type = tick.type, label = tick.label, pos = tick.pos, labelOptions = options.labels, gridLine = tick.gridLine, gridPrefix = type ? type + 'Grid' : 'grid', tickPrefix = type ? type + 'Tick' : 'tick', gridLineWidth = options[gridPrefix + 'LineWidth'], gridLineColor = options[gridPrefix + 'LineColor'], dashStyle = options[gridPrefix + 'LineDashStyle'], tickSize = axis.tickSize(tickPrefix), tickColor = options[tickPrefix + 'Color'], gridLinePath, mark = tick.mark, markPath, step = /*axis.labelStep || */labelOptions.step, attribs, show = true, tickmarkOffset = axis.tickmarkOffset, xy = tick.getPosition(horiz, pos, tickmarkOffset, old), x = xy.x, y = xy.y, reverseCrisp = ((horiz && x === axis.pos + axis.len) || (!horiz && y === axis.pos)) ? -1 : 1; // #1480, #1687 opacity = pick(opacity, 1); this.isActive = true; // create the grid line if (gridLineWidth) { gridLinePath = axis.getPlotLinePath(pos + tickmarkOffset, gridLineWidth * reverseCrisp, old, true); if (gridLine === UNDEFINED) { attribs = { stroke: gridLineColor, 'stroke-width': gridLineWidth }; if (dashStyle) { attribs.dashstyle = dashStyle; } if (!type) { attribs.zIndex = 1; } if (old) { attribs.opacity = 0; } tick.gridLine = gridLine = gridLineWidth ? renderer.path(gridLinePath) .attr(attribs).add(axis.gridGroup) : null; } // If the parameter 'old' is set, the current call will be followed // by another call, therefore do not do any animations this time if (!old && gridLine && gridLinePath) { gridLine[tick.isNew ? 'attr' : 'animate']({ d: gridLinePath, opacity: opacity }); } } // create the tick mark if (tickSize) { if (axis.opposite) { tickSize[0] = -tickSize[0]; } markPath = tick.getMarkPath(x, y, tickSize[0], tickSize[1] * reverseCrisp, horiz, renderer); if (mark) { // updating mark.animate({ d: markPath, opacity: opacity }); } else { // first time tick.mark = renderer.path( markPath ).attr({ stroke: tickColor, 'stroke-width': tickSize[1], opacity: opacity }).add(axis.axisGroup); } } // the label is created on init - now move it into place if (label && isNumber(x)) { label.xy = xy = tick.getLabelPosition(x, y, label, horiz, labelOptions, tickmarkOffset, index, step); // Apply show first and show last. If the tick is both first and last, it is // a single centered tick, in which case we show the label anyway (#2100). if ((tick.isFirst && !tick.isLast && !pick(options.showFirstLabel, 1)) || (tick.isLast && !tick.isFirst && !pick(options.showLastLabel, 1))) { show = false; // Handle label overflow and show or hide accordingly } else if (horiz && !axis.isRadial && !labelOptions.step && !labelOptions.rotation && !old && opacity !== 0) { tick.handleOverflow(xy); } // apply step if (step && index % step) { // show those indices dividable by step show = false; } // Set the new position, and show or hide if (show && isNumber(xy.y)) { xy.opacity = opacity; label[tick.isNew ? 'attr' : 'animate'](xy); } else { stop(label); // #5332 label.attr('y', -9999); // #1338 } tick.isNew = false; } }, /** * Destructor for the tick prototype */ destroy: function () { destroyObjectProperties(this, this.axis); } }; /** * The object wrapper for plot lines and plot bands * @param {Object} options */ Highcharts.PlotLineOrBand = function (axis, options) { this.axis = axis; if (options) { this.options = options; this.id = options.id; } }; Highcharts.PlotLineOrBand.prototype = { /** * Render the plot line or plot band. If it is already existing, * move it. */ render: function () { var plotLine = this, axis = plotLine.axis, horiz = axis.horiz, options = plotLine.options, optionsLabel = options.label, label = plotLine.label, width = options.width, to = options.to, from = options.from, isBand = defined(from) && defined(to), value = options.value, dashStyle = options.dashStyle, svgElem = plotLine.svgElem, path = [], addEvent, eventType, color = options.color, zIndex = pick(options.zIndex, 0), events = options.events, attribs = {}, renderer = axis.chart.renderer, log2lin = axis.log2lin; // logarithmic conversion if (axis.isLog) { from = log2lin(from); to = log2lin(to); value = log2lin(value); } // plot line if (width) { path = axis.getPlotLinePath(value, width); attribs = { stroke: color, 'stroke-width': width }; if (dashStyle) { attribs.dashstyle = dashStyle; } } else if (isBand) { // plot band path = axis.getPlotBandPath(from, to, options); if (color) { attribs.fill = color; } if (options.borderWidth) { attribs.stroke = options.borderColor; attribs['stroke-width'] = options.borderWidth; } } else { return; } // zIndex attribs.zIndex = zIndex; // common for lines and bands if (svgElem) { if (path) { svgElem.show(); svgElem.animate({ d: path }); } else { svgElem.hide(); if (label) { plotLine.label = label = label.destroy(); } } } else if (path && path.length) { plotLine.svgElem = svgElem = renderer.path(path) .attr(attribs).add(); // events if (events) { addEvent = function (eventType) { svgElem.on(eventType, function (e) { events[eventType].apply(plotLine, [e]); }); }; for (eventType in events) { addEvent(eventType); } } } // the plot band/line label if (optionsLabel && defined(optionsLabel.text) && path && path.length && axis.width > 0 && axis.height > 0 && !path.flat) { // apply defaults optionsLabel = merge({ align: horiz && isBand && 'center', x: horiz ? !isBand && 4 : 10, verticalAlign: !horiz && isBand && 'middle', y: horiz ? isBand ? 16 : 10 : isBand ? 6 : -4, rotation: horiz && !isBand && 90 }, optionsLabel); this.renderLabel(optionsLabel, path, isBand, zIndex); } else if (label) { // move out of sight label.hide(); } // chainable return plotLine; }, /** * Render and align label for plot line or band. */ renderLabel: function (optionsLabel, path, isBand, zIndex) { var plotLine = this, label = plotLine.label, renderer = plotLine.axis.chart.renderer, attribs, xs, ys, x, y; // add the SVG element if (!label) { attribs = { align: optionsLabel.textAlign || optionsLabel.align, rotation: optionsLabel.rotation }; attribs.zIndex = zIndex; plotLine.label = label = renderer.text( optionsLabel.text, 0, 0, optionsLabel.useHTML ) .attr(attribs) .css(optionsLabel.style) .add(); } // get the bounding box and align the label // #3000 changed to better handle choice between plotband or plotline xs = [path[1], path[4], (isBand ? path[6] : path[1])]; ys = [path[2], path[5], (isBand ? path[7] : path[2])]; x = arrayMin(xs); y = arrayMin(ys); label.align(optionsLabel, false, { x: x, y: y, width: arrayMax(xs) - x, height: arrayMax(ys) - y }); label.show(); }, /** * Remove the plot line or band */ destroy: function () { // remove it from the lookup erase(this.axis.plotLinesAndBands, this); delete this.axis; destroyObjectProperties(this); } }; /** * Object with members for extending the Axis prototype */ AxisPlotLineOrBandExtension = { /** * Create the path for a plot band */ getPlotBandPath: function (from, to) { var toPath = this.getPlotLinePath(to, null, null, true), path = this.getPlotLinePath(from, null, null, true); if (path && toPath) { // Flat paths don't need labels (#3836) path.flat = path.toString() === toPath.toString(); path.push( toPath[4], toPath[5], toPath[1], toPath[2] ); } else { // outside the axis area path = null; } return path; }, addPlotBand: function (options) { return this.addPlotBandOrLine(options, 'plotBands'); }, addPlotLine: function (options) { return this.addPlotBandOrLine(options, 'plotLines'); }, /** * Add a plot band or plot line after render time * * @param options {Object} The plotBand or plotLine configuration object */ addPlotBandOrLine: function (options, coll) { var obj = new Highcharts.PlotLineOrBand(this, options).render(), userOptions = this.userOptions; if (obj) { // #2189 // Add it to the user options for exporting and Axis.update if (coll) { userOptions[coll] = userOptions[coll] || []; userOptions[coll].push(options); } this.plotLinesAndBands.push(obj); } return obj; }, /** * Remove a plot band or plot line from the chart by id * @param {Object} id */ removePlotBandOrLine: function (id) { var plotLinesAndBands = this.plotLinesAndBands, options = this.options, userOptions = this.userOptions, i = plotLinesAndBands.length; while (i--) { if (plotLinesAndBands[i].id === id) { plotLinesAndBands[i].destroy(); } } each([options.plotLines || [], userOptions.plotLines || [], options.plotBands || [], userOptions.plotBands || []], function (arr) { i = arr.length; while (i--) { if (arr[i].id === id) { erase(arr, arr[i]); } } }); } }; /** * Create a new axis object * @param {Object} chart * @param {Object} options */ var Axis = Highcharts.Axis = function () { this.init.apply(this, arguments); }; Axis.prototype = { /** * Default options for the X axis - the Y axis has extended defaults */ defaultOptions: { // allowDecimals: null, // alternateGridColor: null, // categories: [], dateTimeLabelFormats: { millisecond: '%H:%M:%S.%L', second: '%H:%M:%S', minute: '%H:%M', hour: '%H:%M', day: '%e. %b', week: '%e. %b', month: '%b \'%y', year: '%Y' }, endOnTick: false, gridLineColor: '#D8D8D8', // gridLineDashStyle: 'solid', // gridLineWidth: 0, // reversed: false, labels: { enabled: true, // rotation: 0, // align: 'center', // step: null, style: { color: '#606060', cursor: 'default', fontSize: '11px' }, x: 0 //y: undefined /*formatter: function () { return this.value; },*/ }, lineColor: '#C0D0E0', lineWidth: 1, //linkedTo: null, //max: undefined, //min: undefined, minPadding: 0.01, maxPadding: 0.01, //minRange: null, minorGridLineColor: '#E0E0E0', // minorGridLineDashStyle: null, minorGridLineWidth: 1, minorTickColor: '#A0A0A0', //minorTickInterval: null, minorTickLength: 2, minorTickPosition: 'outside', // inside or outside //minorTickWidth: 0, //opposite: false, //offset: 0, //plotBands: [{ // events: {}, // zIndex: 1, // labels: { align, x, verticalAlign, y, style, rotation, textAlign } //}], //plotLines: [{ // events: {} // dashStyle: {} // zIndex: // labels: { align, x, verticalAlign, y, style, rotation, textAlign } //}], //reversed: false, // showFirstLabel: true, // showLastLabel: true, startOfWeek: 1, startOnTick: false, tickColor: '#C0D0E0', //tickInterval: null, tickLength: 10, tickmarkPlacement: 'between', // on or between tickPixelInterval: 100, tickPosition: 'outside', //tickWidth: 1, title: { //text: null, align: 'middle', // low, middle or high //margin: 0 for horizontal, 10 for vertical axes, //rotation: 0, //side: 'outside', style: { color: '#707070' } //x: 0, //y: 0 }, type: 'linear' // linear, logarithmic or datetime //visible: true }, /** * This options set extends the defaultOptions for Y axes */ defaultYAxisOptions: { endOnTick: true, gridLineWidth: 1, tickPixelInterval: 72, showLastLabel: true, labels: { x: -8 }, lineWidth: 0, maxPadding: 0.05, minPadding: 0.05, startOnTick: true, //tickWidth: 0, title: { rotation: 270, text: 'Values' }, stackLabels: { enabled: false, //align: dynamic, //y: dynamic, //x: dynamic, //verticalAlign: dynamic, //textAlign: dynamic, //rotation: 0, formatter: function () { return Highcharts.numberFormat(this.total, -1); }, style: merge(defaultPlotOptions.line.dataLabels.style, { color: '#000000' }) } }, /** * These options extend the defaultOptions for left axes */ defaultLeftAxisOptions: { labels: { x: -15 }, title: { rotation: 270 } }, /** * These options extend the defaultOptions for right axes */ defaultRightAxisOptions: { labels: { x: 15 }, title: { rotation: 90 } }, /** * These options extend the defaultOptions for bottom axes */ defaultBottomAxisOptions: { labels: { autoRotation: [-45], x: 0 // overflow: undefined, // staggerLines: null }, title: { rotation: 0 } }, /** * These options extend the defaultOptions for top axes */ defaultTopAxisOptions: { labels: { autoRotation: [-45], x: 0 // overflow: undefined // staggerLines: null }, title: { rotation: 0 } }, /** * Initialize the axis */ init: function (chart, userOptions) { var isXAxis = userOptions.isX, axis = this; axis.chart = chart; // Flag, is the axis horizontal axis.horiz = chart.inverted ? !isXAxis : isXAxis; // Flag, isXAxis axis.isXAxis = isXAxis; axis.coll = axis.coll || (isXAxis ? 'xAxis' : 'yAxis'); axis.opposite = userOptions.opposite; // needed in setOptions axis.side = userOptions.side || (axis.horiz ? (axis.opposite ? 0 : 2) : // top : bottom (axis.opposite ? 1 : 3)); // right : left axis.setOptions(userOptions); var options = this.options, type = options.type, isDatetimeAxis = type === 'datetime'; axis.labelFormatter = options.labels.formatter || axis.defaultLabelFormatter; // can be overwritten by dynamic format // Flag, stagger lines or not axis.userOptions = userOptions; //axis.axisTitleMargin = UNDEFINED,// = options.title.margin, axis.minPixelPadding = 0; axis.reversed = options.reversed; axis.visible = options.visible !== false; axis.zoomEnabled = options.zoomEnabled !== false; // Initial categories axis.hasNames = type === 'category' || options.categories === true; axis.categories = options.categories || axis.hasNames; axis.names = axis.names || []; // Preserve on update (#3830) // Elements //axis.axisGroup = UNDEFINED; //axis.gridGroup = UNDEFINED; //axis.axisTitle = UNDEFINED; //axis.axisLine = UNDEFINED; // Shorthand types axis.isLog = type === 'logarithmic'; axis.isDatetimeAxis = isDatetimeAxis; // Flag, if axis is linked to another axis axis.isLinked = defined(options.linkedTo); // Linked axis. //axis.linkedParent = UNDEFINED; // Tick positions //axis.tickPositions = UNDEFINED; // array containing predefined positions // Tick intervals //axis.tickInterval = UNDEFINED; //axis.minorTickInterval = UNDEFINED; // Major ticks axis.ticks = {}; axis.labelEdge = []; // Minor ticks axis.minorTicks = {}; // List of plotLines/Bands axis.plotLinesAndBands = []; // Alternate bands axis.alternateBands = {}; // Axis metrics //axis.left = UNDEFINED; //axis.top = UNDEFINED; //axis.width = UNDEFINED; //axis.height = UNDEFINED; //axis.bottom = UNDEFINED; //axis.right = UNDEFINED; //axis.transA = UNDEFINED; //axis.transB = UNDEFINED; //axis.oldTransA = UNDEFINED; axis.len = 0; //axis.oldMin = UNDEFINED; //axis.oldMax = UNDEFINED; //axis.oldUserMin = UNDEFINED; //axis.oldUserMax = UNDEFINED; //axis.oldAxisLength = UNDEFINED; axis.minRange = axis.userMinRange = options.minRange || options.maxZoom; axis.range = options.range; axis.offset = options.offset || 0; // Dictionary for stacks axis.stacks = {}; axis.oldStacks = {}; axis.stacksTouched = 0; // Min and max in the data //axis.dataMin = UNDEFINED, //axis.dataMax = UNDEFINED, // The axis range axis.max = null; axis.min = null; // User set min and max //axis.userMin = UNDEFINED, //axis.userMax = UNDEFINED, // Crosshair options axis.crosshair = pick(options.crosshair, splat(chart.options.tooltip.crosshairs)[isXAxis ? 0 : 1], false); // Run Axis var eventType, events = axis.options.events; // Register if (inArray(axis, chart.axes) === -1) { // don't add it again on Axis.update() if (isXAxis) { // #2713 chart.axes.splice(chart.xAxis.length, 0, axis); } else { chart.axes.push(axis); } chart[axis.coll].push(axis); } axis.series = axis.series || []; // populated by Series // inverted charts have reversed xAxes as default if (chart.inverted && isXAxis && axis.reversed === UNDEFINED) { axis.reversed = true; } axis.removePlotBand = axis.removePlotBandOrLine; axis.removePlotLine = axis.removePlotBandOrLine; // register event listeners for (eventType in events) { addEvent(axis, eventType, events[eventType]); } // extend logarithmic axis if (axis.isLog) { axis.val2lin = axis.log2lin; axis.lin2val = axis.lin2log; } }, /** * Merge and set options */ setOptions: function (userOptions) { this.options = merge( this.defaultOptions, this.coll === 'yAxis' && this.defaultYAxisOptions, [this.defaultTopAxisOptions, this.defaultRightAxisOptions, this.defaultBottomAxisOptions, this.defaultLeftAxisOptions][this.side], merge( defaultOptions[this.coll], // if set in setOptions (#1053) userOptions ) ); }, /** * The default label formatter. The context is a special config object for the label. */ defaultLabelFormatter: function () { var axis = this.axis, value = this.value, categories = axis.categories, dateTimeLabelFormat = this.dateTimeLabelFormat, numericSymbols = defaultOptions.lang.numericSymbols, i = numericSymbols && numericSymbols.length, multi, ret, formatOption = axis.options.labels.format, // make sure the same symbol is added for all labels on a linear axis numericSymbolDetector = axis.isLog ? value : axis.tickInterval; if (formatOption) { ret = format(formatOption, this); } else if (categories) { ret = value; } else if (dateTimeLabelFormat) { // datetime axis ret = dateFormat(dateTimeLabelFormat, value); } else if (i && numericSymbolDetector >= 1000) { // Decide whether we should add a numeric symbol like k (thousands) or M (millions). // If we are to enable this in tooltip or other places as well, we can move this // logic to the numberFormatter and enable it by a parameter. while (i-- && ret === UNDEFINED) { multi = Math.pow(1000, i + 1); if (numericSymbolDetector >= multi && (value * 10) % multi === 0 && numericSymbols[i] !== null && value !== 0) { // #5480 ret = Highcharts.numberFormat(value / multi, -1) + numericSymbols[i]; } } } if (ret === UNDEFINED) { if (mathAbs(value) >= 10000) { // add thousands separators ret = Highcharts.numberFormat(value, -1); } else { // small numbers ret = Highcharts.numberFormat(value, -1, UNDEFINED, ''); // #2466 } } return ret; }, /** * Get the minimum and maximum for the series of each axis */ getSeriesExtremes: function () { var axis = this, chart = axis.chart; axis.hasVisibleSeries = false; // Reset properties in case we're redrawing (#3353) axis.dataMin = axis.dataMax = axis.threshold = null; axis.softThreshold = !axis.isXAxis; if (axis.buildStacks) { axis.buildStacks(); } // loop through this axis' series each(axis.series, function (series) { if (series.visible || !chart.options.chart.ignoreHiddenSeries) { var seriesOptions = series.options, xData, threshold = seriesOptions.threshold, seriesDataMin, seriesDataMax; axis.hasVisibleSeries = true; // Validate threshold in logarithmic axes if (axis.isLog && threshold <= 0) { threshold = null; } // Get dataMin and dataMax for X axes if (axis.isXAxis) { xData = series.xData; if (xData.length) { // If xData contains values which is not numbers, then filter them out. // To prevent performance hit, we only do this after we have already // found seriesDataMin because in most cases all data is valid. #5234. seriesDataMin = arrayMin(xData); if (!isNumber(seriesDataMin) && !(seriesDataMin instanceof Date)) { // Date for #5010 xData = grep(xData, function (x) { return isNumber(x); }); seriesDataMin = arrayMin(xData); // Do it again with valid data } axis.dataMin = mathMin(pick(axis.dataMin, xData[0]), seriesDataMin); axis.dataMax = mathMax(pick(axis.dataMax, xData[0]), arrayMax(xData)); } // Get dataMin and dataMax for Y axes, as well as handle stacking and processed data } else { // Get this particular series extremes series.getExtremes(); seriesDataMax = series.dataMax; seriesDataMin = series.dataMin; // Get the dataMin and dataMax so far. If percentage is used, the min and max are // always 0 and 100. If seriesDataMin and seriesDataMax is null, then series // doesn't have active y data, we continue with nulls if (defined(seriesDataMin) && defined(seriesDataMax)) { axis.dataMin = mathMin(pick(axis.dataMin, seriesDataMin), seriesDataMin); axis.dataMax = mathMax(pick(axis.dataMax, seriesDataMax), seriesDataMax); } // Adjust to threshold if (defined(threshold)) { axis.threshold = threshold; } // If any series has a hard threshold, it takes precedence if (!seriesOptions.softThreshold || axis.isLog) { axis.softThreshold = false; } } } }); }, /** * Translate from axis value to pixel position on the chart, or back * */ translate: function (val, backwards, cvsCoord, old, handleLog, pointPlacement) { var axis = this.linkedParent || this, // #1417 sign = 1, cvsOffset = 0, localA = old ? axis.oldTransA : axis.transA, localMin = old ? axis.oldMin : axis.min, returnValue, minPixelPadding = axis.minPixelPadding, doPostTranslate = (axis.isOrdinal || axis.isBroken || (axis.isLog && handleLog)) && axis.lin2val; if (!localA) { localA = axis.transA; } // In vertical axes, the canvas coordinates start from 0 at the top like in // SVG. if (cvsCoord) { sign *= -1; // canvas coordinates inverts the value cvsOffset = axis.len; } // Handle reversed axis if (axis.reversed) { sign *= -1; cvsOffset -= sign * (axis.sector || axis.len); } // From pixels to value if (backwards) { // reverse translation val = val * sign + cvsOffset; val -= minPixelPadding; returnValue = val / localA + localMin; // from chart pixel to value if (doPostTranslate) { // log and ordinal axes returnValue = axis.lin2val(returnValue); } // From value to pixels } else { if (doPostTranslate) { // log and ordinal axes val = axis.val2lin(val); } if (pointPlacement === 'between') { pointPlacement = 0.5; } returnValue = sign * (val - localMin) * localA + cvsOffset + (sign * minPixelPadding) + (isNumber(pointPlacement) ? localA * pointPlacement * axis.pointRange : 0); } return returnValue; }, /** * Utility method to translate an axis value to pixel position. * @param {Number} value A value in terms of axis units * @param {Boolean} paneCoordinates Whether to return the pixel coordinate relative to the chart * or just the axis/pane itself. */ toPixels: function (value, paneCoordinates) { return this.translate(value, false, !this.horiz, null, true) + (paneCoordinates ? 0 : this.pos); }, /* * Utility method to translate a pixel position in to an axis value * @param {Number} pixel The pixel value coordinate * @param {Boolean} paneCoordiantes Whether the input pixel is relative to the chart or just the * axis/pane itself. */ toValue: function (pixel, paneCoordinates) { return this.translate(pixel - (paneCoordinates ? 0 : this.pos), true, !this.horiz, null, true); }, /** * Create the path for a plot line that goes from the given value on * this axis, across the plot to the opposite side * @param {Number} value * @param {Number} lineWidth Used for calculation crisp line * @param {Number] old Use old coordinates (for resizing and rescaling) */ getPlotLinePath: function (value, lineWidth, old, force, translatedValue) { var axis = this, chart = axis.chart, axisLeft = axis.left, axisTop = axis.top, x1, y1, x2, y2, cHeight = (old && chart.oldChartHeight) || chart.chartHeight, cWidth = (old && chart.oldChartWidth) || chart.chartWidth, skip, transB = axis.transB, /** * Check if x is between a and b. If not, either move to a/b or skip, * depending on the force parameter. */ between = function (x, a, b) { if (x < a || x > b) { if (force) { x = mathMin(mathMax(a, x), b); } else { skip = true; } } return x; }; translatedValue = pick(translatedValue, axis.translate(value, null, null, old)); x1 = x2 = mathRound(translatedValue + transB); y1 = y2 = mathRound(cHeight - translatedValue - transB); if (!isNumber(translatedValue)) { // no min or max skip = true; } else if (axis.horiz) { y1 = axisTop; y2 = cHeight - axis.bottom; x1 = x2 = between(x1, axisLeft, axisLeft + axis.width); } else { x1 = axisLeft; x2 = cWidth - axis.right; y1 = y2 = between(y1, axisTop, axisTop + axis.height); } return skip && !force ? null : chart.renderer.crispLine([M, x1, y1, L, x2, y2], lineWidth || 1); }, /** * Set the tick positions of a linear axis to round values like whole tens or every five. */ getLinearTickPositions: function (tickInterval, min, max) { var pos, lastPos, roundedMin = correctFloat(mathFloor(min / tickInterval) * tickInterval), roundedMax = correctFloat(mathCeil(max / tickInterval) * tickInterval), tickPositions = []; // For single points, add a tick regardless of the relative position (#2662) if (min === max && isNumber(min)) { return [min]; } // Populate the intermediate values pos = roundedMin; while (pos <= roundedMax) { // Place the tick on the rounded value tickPositions.push(pos); // Always add the raw tickInterval, not the corrected one. pos = correctFloat(pos + tickInterval); // If the interval is not big enough in the current min - max range to actually increase // the loop variable, we need to break out to prevent endless loop. Issue #619 if (pos === lastPos) { break; } // Record the last value lastPos = pos; } return tickPositions; }, /** * Return the minor tick positions. For logarithmic axes, reuse the same logic * as for major ticks. */ getMinorTickPositions: function () { var axis = this, options = axis.options, tickPositions = axis.tickPositions, minorTickInterval = axis.minorTickInterval, minorTickPositions = [], pos, i, pointRangePadding = axis.pointRangePadding || 0, min = axis.min - pointRangePadding, // #1498 max = axis.max + pointRangePadding, // #1498 range = max - min, len; // If minor ticks get too dense, they are hard to read, and may cause long running script. So we don't draw them. if (range && range / minorTickInterval < axis.len / 3) { // #3875 if (axis.isLog) { len = tickPositions.length; for (i = 1; i < len; i++) { minorTickPositions = minorTickPositions.concat( axis.getLogTickPositions(minorTickInterval, tickPositions[i - 1], tickPositions[i], true) ); } } else if (axis.isDatetimeAxis && options.minorTickInterval === 'auto') { // #1314 minorTickPositions = minorTickPositions.concat( axis.getTimeTicks( axis.normalizeTimeTickInterval(minorTickInterval), min, max, options.startOfWeek ) ); } else { for (pos = min + (tickPositions[0] - min) % minorTickInterval; pos <= max; pos += minorTickInterval) { minorTickPositions.push(pos); } } } if (minorTickPositions.length !== 0) { // don't change the extremes, when there is no minor ticks axis.trimTicks(minorTickPositions, options.startOnTick, options.endOnTick); // #3652 #3743 #1498 } return minorTickPositions; }, /** * Adjust the min and max for the minimum range. Keep in mind that the series data is * not yet processed, so we don't have information on data cropping and grouping, or * updated axis.pointRange or series.pointRange. The data can't be processed until * we have finally established min and max. */ adjustForMinRange: function () { var axis = this, options = axis.options, min = axis.min, max = axis.max, zoomOffset, spaceAvailable = axis.dataMax - axis.dataMin >= axis.minRange, closestDataRange, i, distance, xData, loopLength, minArgs, maxArgs, minRange; // Set the automatic minimum range based on the closest point distance if (axis.isXAxis && axis.minRange === UNDEFINED && !axis.isLog) { if (defined(options.min) || defined(options.max)) { axis.minRange = null; // don't do this again } else { // Find the closest distance between raw data points, as opposed to // closestPointRange that applies to processed points (cropped and grouped) each(axis.series, function (series) { xData = series.xData; loopLength = series.xIncrement ? 1 : xData.length - 1; for (i = loopLength; i > 0; i--) { distance = xData[i] - xData[i - 1]; if (closestDataRange === UNDEFINED || distance < closestDataRange) { closestDataRange = distance; } } }); axis.minRange = mathMin(closestDataRange * 5, axis.dataMax - axis.dataMin); } } // if minRange is exceeded, adjust if (max - min < axis.minRange) { minRange = axis.minRange; zoomOffset = (minRange - max + min) / 2; // if min and max options have been set, don't go beyond it minArgs = [min - zoomOffset, pick(options.min, min - zoomOffset)]; if (spaceAvailable) { // if space is available, stay within the data range minArgs[2] = axis.isLog ? axis.log2lin(axis.dataMin) : axis.dataMin; } min = arrayMax(minArgs); maxArgs = [min + minRange, pick(options.max, min + minRange)]; if (spaceAvailable) { // if space is availabe, stay within the data range maxArgs[2] = axis.isLog ? axis.log2lin(axis.dataMax) : axis.dataMax; } max = arrayMin(maxArgs); // now if the max is adjusted, adjust the min back if (max - min < minRange) { minArgs[0] = max - minRange; minArgs[1] = pick(options.min, max - minRange); min = arrayMax(minArgs); } } // Record modified extremes axis.min = min; axis.max = max; }, /** * Find the closestPointRange across all series */ getClosest: function () { var ret; if (this.categories) { ret = 1; } else { each(this.series, function (series) { var seriesClosest = series.closestPointRange; if (!series.noSharedTooltip && defined(seriesClosest)) { ret = defined(ret) ? mathMin(ret, seriesClosest) : seriesClosest; } }); } return ret; }, /** * When a point name is given and no x, search for the name in the existing categories, * or if categories aren't provided, search names or create a new category (#2522). */ nameToX: function (point) { var explicitCategories = isArray(this.categories), names = explicitCategories ? this.categories : this.names, nameX = point.options.x, x; point.series.requireSorting = false; if (!defined(nameX)) { nameX = this.options.nameToX === false ? point.series.autoIncrement() : inArray(point.name, names); } if (nameX === -1) { // The name is not found in currenct categories if (!explicitCategories) { x = names.length; } } else { x = nameX; } // Write the last point's name to the names array this.names[x] = point.name; return x; }, /** * When changes have been done to series data, update the axis.names. */ updateNames: function () { var axis = this; if (this.names.length > 0) { this.names.length = 0; this.minRange = undefined; each(this.series || [], function (series) { // When adding a series, points are not yet generated if (!series.processedXData) { series.processData(); series.generatePoints(); } each(series.points, function (point, i) { var x; if (point.options && point.options.x === undefined) { x = axis.nameToX(point); if (x !== point.x) { point.x = x; series.xData[i] = x; } } }); }); } }, /** * Update translation information */ setAxisTranslation: function (saveOld) { var axis = this, range = axis.max - axis.min, pointRange = axis.axisPointRange || 0, closestPointRange, minPointOffset = 0, pointRangePadding = 0, linkedParent = axis.linkedParent, ordinalCorrection, hasCategories = !!axis.categories, transA = axis.transA, isXAxis = axis.isXAxis; // Adjust translation for padding. Y axis with categories need to go through the same (#1784). if (isXAxis || hasCategories || pointRange) { if (linkedParent) { minPointOffset = linkedParent.minPointOffset; pointRangePadding = linkedParent.pointRangePadding; } else { // Get the closest points closestPointRange = axis.getClosest(); each(axis.series, function (series) { var seriesPointRange = hasCategories ? 1 : (isXAxis ? pick(series.options.pointRange, closestPointRange, 0) : (axis.axisPointRange || 0)), // #2806 pointPlacement = series.options.pointPlacement; pointRange = mathMax(pointRange, seriesPointRange); if (!axis.single) { // minPointOffset is the value padding to the left of the axis in order to make // room for points with a pointRange, typically columns. When the pointPlacement option // is 'between' or 'on', this padding does not apply. minPointOffset = mathMax( minPointOffset, isString(pointPlacement) ? 0 : seriesPointRange / 2 ); // Determine the total padding needed to the length of the axis to make room for the // pointRange. If the series' pointPlacement is 'on', no padding is added. pointRangePadding = mathMax( pointRangePadding, pointPlacement === 'on' ? 0 : seriesPointRange ); } }); } // Record minPointOffset and pointRangePadding ordinalCorrection = axis.ordinalSlope && closestPointRange ? axis.ordinalSlope / closestPointRange : 1; // #988, #1853 axis.minPointOffset = minPointOffset = minPointOffset * ordinalCorrection; axis.pointRangePadding = pointRangePadding = pointRangePadding * ordinalCorrection; // pointRange means the width reserved for each point, like in a column chart axis.pointRange = mathMin(pointRange, range); // closestPointRange means the closest distance between points. In columns // it is mostly equal to pointRange, but in lines pointRange is 0 while closestPointRange // is some other value if (isXAxis) { axis.closestPointRange = closestPointRange; } } // Secondary values if (saveOld) { axis.oldTransA = transA; } axis.translationSlope = axis.transA = transA = axis.len / ((range + pointRangePadding) || 1); axis.transB = axis.horiz ? axis.left : axis.bottom; // translation addend axis.minPixelPadding = transA * minPointOffset; }, minFromRange: function () { return this.max - this.range; }, /** * Set the tick positions to round values and optionally extend the extremes * to the nearest tick */ setTickInterval: function (secondPass) { var axis = this, chart = axis.chart, options = axis.options, isLog = axis.isLog, log2lin = axis.log2lin, isDatetimeAxis = axis.isDatetimeAxis, isXAxis = axis.isXAxis, isLinked = axis.isLinked, maxPadding = options.maxPadding, minPadding = options.minPadding, length, linkedParentExtremes, tickIntervalOption = options.tickInterval, minTickInterval, tickPixelIntervalOption = options.tickPixelInterval, categories = axis.categories, threshold = axis.threshold, softThreshold = axis.softThreshold, thresholdMin, thresholdMax, hardMin, hardMax; if (!isDatetimeAxis && !categories && !isLinked) { this.getTickAmount(); } // Min or max set either by zooming/setExtremes or initial options hardMin = pick(axis.userMin, options.min); hardMax = pick(axis.userMax, options.max); // Linked axis gets the extremes from the parent axis if (isLinked) { axis.linkedParent = chart[axis.coll][options.linkedTo]; linkedParentExtremes = axis.linkedParent.getExtremes(); axis.min = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin); axis.max = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax); if (options.type !== axis.linkedParent.options.type) { error(11, 1); // Can't link axes of different type } // Initial min and max from the extreme data values } else { // Adjust to hard threshold if (!softThreshold && defined(threshold)) { if (axis.dataMin >= threshold) { thresholdMin = threshold; minPadding = 0; } else if (axis.dataMax <= threshold) { thresholdMax = threshold; maxPadding = 0; } } axis.min = pick(hardMin, thresholdMin, axis.dataMin); axis.max = pick(hardMax, thresholdMax, axis.dataMax); } if (isLog) { if (!secondPass && mathMin(axis.min, pick(axis.dataMin, axis.min)) <= 0) { // #978 error(10, 1); // Can't plot negative values on log axis } // The correctFloat cures #934, float errors on full tens. But it // was too aggressive for #4360 because of conversion back to lin, // therefore use precision 15. axis.min = correctFloat(log2lin(axis.min), 15); axis.max = correctFloat(log2lin(axis.max), 15); } // handle zoomed range if (axis.range && defined(axis.max)) { axis.userMin = axis.min = hardMin = mathMax(axis.min, axis.minFromRange()); // #618 axis.userMax = hardMax = axis.max; axis.range = null; // don't use it when running setExtremes } // Hook for Highstock Scroller. Consider combining with beforePadding. fireEvent(axis, 'foundExtremes'); // Hook for adjusting this.min and this.max. Used by bubble series. if (axis.beforePadding) { axis.beforePadding(); } // adjust min and max for the minimum range axis.adjustForMinRange(); // Pad the values to get clear of the chart's edges. To avoid tickInterval taking the padding // into account, we do this after computing tick interval (#1337). if (!categories && !axis.axisPointRange && !axis.usePercentage && !isLinked && defined(axis.min) && defined(axis.max)) { length = axis.max - axis.min; if (length) { if (!defined(hardMin) && minPadding) { axis.min -= length * minPadding; } if (!defined(hardMax) && maxPadding) { axis.max += length * maxPadding; } } } // Stay within floor and ceiling if (isNumber(options.floor)) { axis.min = mathMax(axis.min, options.floor); } if (isNumber(options.ceiling)) { axis.max = mathMin(axis.max, options.ceiling); } // When the threshold is soft, adjust the extreme value only if // the data extreme and the padded extreme land on either side of the threshold. For example, // a series of [0, 1, 2, 3] would make the yAxis add a tick for -1 because of the // default minPadding and startOnTick options. This is prevented by the softThreshold // option. if (softThreshold && defined(axis.dataMin)) { threshold = threshold || 0; if (!defined(hardMin) && axis.min < threshold && axis.dataMin >= threshold) { axis.min = threshold; } else if (!defined(hardMax) && axis.max > threshold && axis.dataMax <= threshold) { axis.max = threshold; } } // get tickInterval if (axis.min === axis.max || axis.min === undefined || axis.max === undefined) { axis.tickInterval = 1; } else if (isLinked && !tickIntervalOption && tickPixelIntervalOption === axis.linkedParent.options.tickPixelInterval) { axis.tickInterval = tickIntervalOption = axis.linkedParent.tickInterval; } else { axis.tickInterval = pick( tickIntervalOption, this.tickAmount ? ((axis.max - axis.min) / mathMax(this.tickAmount - 1, 1)) : undefined, categories ? // for categoried axis, 1 is default, for linear axis use tickPix 1 : // don't let it be more than the data range (axis.max - axis.min) * tickPixelIntervalOption / mathMax(axis.len, tickPixelIntervalOption) ); } // Now we're finished detecting min and max, crop and group series data. This // is in turn needed in order to find tick positions in ordinal axes. if (isXAxis && !secondPass) { each(axis.series, function (series) { series.processData(axis.min !== axis.oldMin || axis.max !== axis.oldMax); }); } // set the translation factor used in translate function axis.setAxisTranslation(true); // hook for ordinal axes and radial axes if (axis.beforeSetTickPositions) { axis.beforeSetTickPositions(); } // hook for extensions, used in Highstock ordinal axes if (axis.postProcessTickInterval) { axis.tickInterval = axis.postProcessTickInterval(axis.tickInterval); } // In column-like charts, don't cramp in more ticks than there are points (#1943, #4184) if (axis.pointRange && !tickIntervalOption) { axis.tickInterval = mathMax(axis.pointRange, axis.tickInterval); } // Before normalizing the tick interval, handle minimum tick interval. This applies only if tickInterval is not defined. minTickInterval = pick(options.minTickInterval, axis.isDatetimeAxis && axis.closestPointRange); if (!tickIntervalOption && axis.tickInterval < minTickInterval) { axis.tickInterval = minTickInterval; } // for linear axes, get magnitude and normalize the interval if (!isDatetimeAxis && !isLog && !tickIntervalOption) { axis.tickInterval = normalizeTickInterval( axis.tickInterval, null, getMagnitude(axis.tickInterval), // If the tick interval is between 0.5 and 5 and the axis max is in the order of // thousands, chances are we are dealing with years. Don't allow decimals. #3363. pick(options.allowDecimals, !(axis.tickInterval > 0.5 && axis.tickInterval < 5 && axis.max > 1000 && axis.max < 9999)), !!this.tickAmount ); } // Prevent ticks from getting so close that we can't draw the labels if (!this.tickAmount) { axis.tickInterval = axis.unsquish(); } this.setTickPositions(); }, /** * Now we have computed the normalized tickInterval, get the tick positions */ setTickPositions: function () { var options = this.options, tickPositions, tickPositionsOption = options.tickPositions, tickPositioner = options.tickPositioner, startOnTick = options.startOnTick, endOnTick = options.endOnTick, single; // Set the tickmarkOffset this.tickmarkOffset = (this.categories && options.tickmarkPlacement === 'between' && this.tickInterval === 1) ? 0.5 : 0; // #3202 // get minorTickInterval this.minorTickInterval = options.minorTickInterval === 'auto' && this.tickInterval ? this.tickInterval / 5 : options.minorTickInterval; // Find the tick positions this.tickPositions = tickPositions = tickPositionsOption && tickPositionsOption.slice(); // Work on a copy (#1565) if (!tickPositions) { if (this.isDatetimeAxis) { tickPositions = this.getTimeTicks( this.normalizeTimeTickInterval(this.tickInterval, options.units), this.min, this.max, options.startOfWeek, this.ordinalPositions, this.closestPointRange, true ); } else if (this.isLog) { tickPositions = this.getLogTickPositions(this.tickInterval, this.min, this.max); } else { tickPositions = this.getLinearTickPositions(this.tickInterval, this.min, this.max); } // Too dense ticks, keep only the first and last (#4477) if (tickPositions.length > this.len) { tickPositions = [tickPositions[0], tickPositions.pop()]; } this.tickPositions = tickPositions; // Run the tick positioner callback, that allows modifying auto tick positions. if (tickPositioner) { tickPositioner = tickPositioner.apply(this, [this.min, this.max]); if (tickPositioner) { this.tickPositions = tickPositions = tickPositioner; } } } if (!this.isLinked) { // reset min/max or remove extremes based on start/end on tick this.trimTicks(tickPositions, startOnTick, endOnTick); // When there is only one point, or all points have the same value on this axis, then min // and max are equal and tickPositions.length is 0 or 1. In this case, add some padding // in order to center the point, but leave it with one tick. #1337. if (this.min === this.max && defined(this.min) && !this.tickAmount) { // Substract half a unit (#2619, #2846, #2515, #3390) single = true; this.min -= 0.5; this.max += 0.5; } this.single = single; if (!tickPositionsOption && !tickPositioner) { this.adjustTickAmount(); } } }, /** * Handle startOnTick and endOnTick by either adapting to padding min/max or rounded min/max */ trimTicks: function (tickPositions, startOnTick, endOnTick) { var roundedMin = tickPositions[0], roundedMax = tickPositions[tickPositions.length - 1], minPointOffset = this.minPointOffset || 0; if (startOnTick) { this.min = roundedMin; } else { while (this.min - minPointOffset > tickPositions[0]) { tickPositions.shift(); } } if (endOnTick) { this.max = roundedMax; } else { while (this.max + minPointOffset < tickPositions[tickPositions.length - 1]) { tickPositions.pop(); } } // If no tick are left, set one tick in the middle (#3195) if (tickPositions.length === 0 && defined(roundedMin)) { tickPositions.push((roundedMax + roundedMin) / 2); } }, /** * Check if there are multiple axes in the same pane * @returns {Boolean} There are other axes */ alignToOthers: function () { var others = {}, // Whether there is another axis to pair with this one hasOther, options = this.options; if (this.chart.options.chart.alignTicks !== false && options.alignTicks !== false) { each(this.chart[this.coll], function (axis) { var otherOptions = axis.options, horiz = axis.horiz, key = [ horiz ? otherOptions.left : otherOptions.top, otherOptions.width, otherOptions.height, otherOptions.pane ].join(','); if (axis.series.length) { // #4442 if (others[key]) { hasOther = true; // #4201 } else { others[key] = 1; } } }); } return hasOther; }, /** * Set the max ticks of either the x and y axis collection */ getTickAmount: function () { var options = this.options, tickAmount = options.tickAmount, tickPixelInterval = options.tickPixelInterval; if (!defined(options.tickInterval) && this.len < tickPixelInterval && !this.isRadial && !this.isLog && options.startOnTick && options.endOnTick) { tickAmount = 2; } if (!tickAmount && this.alignToOthers()) { // Add 1 because 4 tick intervals require 5 ticks (including first and last) tickAmount = mathCeil(this.len / tickPixelInterval) + 1; } // For tick amounts of 2 and 3, compute five ticks and remove the intermediate ones. This // prevents the axis from adding ticks that are too far away from the data extremes. if (tickAmount < 4) { this.finalTickAmt = tickAmount; tickAmount = 5; } this.tickAmount = tickAmount; }, /** * When using multiple axes, adjust the number of ticks to match the highest * number of ticks in that group */ adjustTickAmount: function () { var tickInterval = this.tickInterval, tickPositions = this.tickPositions, tickAmount = this.tickAmount, finalTickAmt = this.finalTickAmt, currentTickAmount = tickPositions && tickPositions.length, i, len; if (currentTickAmount < tickAmount) { while (tickPositions.length < tickAmount) { tickPositions.push(correctFloat( tickPositions[tickPositions.length - 1] + tickInterval )); } this.transA *= (currentTickAmount - 1) / (tickAmount - 1); this.max = tickPositions[tickPositions.length - 1]; // We have too many ticks, run second pass to try to reduce ticks } else if (currentTickAmount > tickAmount) { this.tickInterval *= 2; this.setTickPositions(); } // The finalTickAmt property is set in getTickAmount if (defined(finalTickAmt)) { i = len = tickPositions.length; while (i--) { if ( (finalTickAmt === 3 && i % 2 === 1) || // Remove every other tick (finalTickAmt <= 2 && i > 0 && i < len - 1) // Remove all but first and last ) { tickPositions.splice(i, 1); } } this.finalTickAmt = UNDEFINED; } }, /** * Set the scale based on data min and max, user set min and max or options * */ setScale: function () { var axis = this, isDirtyData, isDirtyAxisLength; axis.oldMin = axis.min; axis.oldMax = axis.max; axis.oldAxisLength = axis.len; // set the new axisLength axis.setAxisSize(); //axisLength = horiz ? axisWidth : axisHeight; isDirtyAxisLength = axis.len !== axis.oldAxisLength; // is there new data? each(axis.series, function (series) { if (series.isDirtyData || series.isDirty || series.xAxis.isDirty) { // when x axis is dirty, we need new data extremes for y as well isDirtyData = true; } }); // do we really need to go through all this? if (isDirtyAxisLength || isDirtyData || axis.isLinked || axis.forceRedraw || axis.userMin !== axis.oldUserMin || axis.userMax !== axis.oldUserMax || axis.alignToOthers()) { if (axis.resetStacks) { axis.resetStacks(); } axis.forceRedraw = false; // get data extremes if needed axis.getSeriesExtremes(); // get fixed positions based on tickInterval axis.setTickInterval(); // record old values to decide whether a rescale is necessary later on (#540) axis.oldUserMin = axis.userMin; axis.oldUserMax = axis.userMax; // Mark as dirty if it is not already set to dirty and extremes have changed. #595. if (!axis.isDirty) { axis.isDirty = isDirtyAxisLength || axis.min !== axis.oldMin || axis.max !== axis.oldMax; } } else if (axis.cleanStacks) { axis.cleanStacks(); } }, /** * Set the extremes and optionally redraw * @param {Number} newMin * @param {Number} newMax * @param {Boolean} redraw * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration * @param {Object} eventArguments * */ setExtremes: function (newMin, newMax, redraw, animation, eventArguments) { var axis = this, chart = axis.chart; redraw = pick(redraw, true); // defaults to true each(axis.series, function (serie) { delete serie.kdTree; }); // Extend the arguments with min and max eventArguments = extend(eventArguments, { min: newMin, max: newMax }); // Fire the event fireEvent(axis, 'setExtremes', eventArguments, function () { // the default event handler axis.userMin = newMin; axis.userMax = newMax; axis.eventArgs = eventArguments; if (redraw) { chart.redraw(animation); } }); }, /** * Overridable method for zooming chart. Pulled out in a separate method to allow overriding * in stock charts. */ zoom: function (newMin, newMax) { var dataMin = this.dataMin, dataMax = this.dataMax, options = this.options, min = mathMin(dataMin, pick(options.min, dataMin)), max = mathMax(dataMax, pick(options.max, dataMax)); // Prevent pinch zooming out of range. Check for defined is for #1946. #1734. if (!this.allowZoomOutside) { if (defined(dataMin) && newMin <= min) { newMin = min; } if (defined(dataMax) && newMax >= max) { newMax = max; } } // In full view, displaying the reset zoom button is not required this.displayBtn = newMin !== UNDEFINED || newMax !== UNDEFINED; // Do it this.setExtremes( newMin, newMax, false, UNDEFINED, { trigger: 'zoom' } ); return true; }, /** * Update the axis metrics */ setAxisSize: function () { var chart = this.chart, options = this.options, offsetLeft = options.offsetLeft || 0, offsetRight = options.offsetRight || 0, horiz = this.horiz, width = pick(options.width, chart.plotWidth - offsetLeft + offsetRight), height = pick(options.height, chart.plotHeight), top = pick(options.top, chart.plotTop), left = pick(options.left, chart.plotLeft + offsetLeft), percentRegex = /%$/; // Check for percentage based input values. Rounding fixes problems with // column overflow and plot line filtering (#4898, #4899) if (percentRegex.test(height)) { height = Math.round(parseFloat(height) / 100 * chart.plotHeight); } if (percentRegex.test(top)) { top = Math.round(parseFloat(top) / 100 * chart.plotHeight + chart.plotTop); } // Expose basic values to use in Series object and navigator this.left = left; this.top = top; this.width = width; this.height = height; this.bottom = chart.chartHeight - height - top; this.right = chart.chartWidth - width - left; // Direction agnostic properties this.len = mathMax(horiz ? width : height, 0); // mathMax fixes #905 this.pos = horiz ? left : top; // distance from SVG origin }, /** * Get the actual axis extremes */ getExtremes: function () { var axis = this, isLog = axis.isLog, lin2log = axis.lin2log; return { min: isLog ? correctFloat(lin2log(axis.min)) : axis.min, max: isLog ? correctFloat(lin2log(axis.max)) : axis.max, dataMin: axis.dataMin, dataMax: axis.dataMax, userMin: axis.userMin, userMax: axis.userMax }; }, /** * Get the zero plane either based on zero or on the min or max value. * Used in bar and area plots */ getThreshold: function (threshold) { var axis = this, isLog = axis.isLog, lin2log = axis.lin2log, realMin = isLog ? lin2log(axis.min) : axis.min, realMax = isLog ? lin2log(axis.max) : axis.max; if (threshold === null) { threshold = realMin; } else if (realMin > threshold) { threshold = realMin; } else if (realMax < threshold) { threshold = realMax; } return axis.translate(threshold, 0, 1, 0, 1); }, /** * Compute auto alignment for the axis label based on which side the axis is on * and the given rotation for the label */ autoLabelAlign: function (rotation) { var ret, angle = (pick(rotation, 0) - (this.side * 90) + 720) % 360; if (angle > 15 && angle < 165) { ret = 'right'; } else if (angle > 195 && angle < 345) { ret = 'left'; } else { ret = 'center'; } return ret; }, /** * Get the tick length and width for the axis. * @param {String} prefix 'tick' or 'minorTick' * @returns {Array} An array of tickLength and tickWidth */ tickSize: function (prefix) { var options = this.options, tickLength = options[prefix + 'Length'], tickWidth = pick(options[prefix + 'Width'], prefix === 'tick' && this.isXAxis ? 1 : 0); // X axis defaults to 1 if (tickWidth && tickLength) { // Negate the length if (options[prefix + 'Position'] === 'inside') { tickLength = -tickLength; } return [tickLength, tickWidth]; } }, /** * Return the size of the labels */ labelMetrics: function () { return this.chart.renderer.fontMetrics( this.options.labels.style.fontSize, this.ticks[0] && this.ticks[0].label ); }, /** * Prevent the ticks from getting so close we can't draw the labels. On a horizontal * axis, this is handled by rotating the labels, removing ticks and adding ellipsis. * On a vertical axis remove ticks and add ellipsis. */ unsquish: function () { var labelOptions = this.options.labels, horiz = this.horiz, tickInterval = this.tickInterval, newTickInterval = tickInterval, slotSize = this.len / (((this.categories ? 1 : 0) + this.max - this.min) / tickInterval), rotation, rotationOption = labelOptions.rotation, labelMetrics = this.labelMetrics(), step, bestScore = Number.MAX_VALUE, autoRotation, // Return the multiple of tickInterval that is needed to avoid collision getStep = function (spaceNeeded) { var step = spaceNeeded / (slotSize || 1); step = step > 1 ? mathCeil(step) : 1; return step * tickInterval; }; if (horiz) { autoRotation = !labelOptions.staggerLines && !labelOptions.step && ( // #3971 defined(rotationOption) ? [rotationOption] : slotSize < pick(labelOptions.autoRotationLimit, 80) && labelOptions.autoRotation ); if (autoRotation) { // Loop over the given autoRotation options, and determine which gives the best score. The // best score is that with the lowest number of steps and a rotation closest to horizontal. each(autoRotation, function (rot) { var score; if (rot === rotationOption || (rot && rot >= -90 && rot <= 90)) { // #3891 step = getStep(mathAbs(labelMetrics.h / mathSin(deg2rad * rot))); score = step + mathAbs(rot / 360); if (score < bestScore) { bestScore = score; rotation = rot; newTickInterval = step; } } }); } } else if (!labelOptions.step) { // #4411 newTickInterval = getStep(labelMetrics.h); } this.autoRotation = autoRotation; this.labelRotation = pick(rotation, rotationOption); return newTickInterval; }, /** * Get the general slot width for this axis. This may change between the pre-render (from Axis.getOffset) * and the final tick rendering and placement (#5086). */ getSlotWidth: function () { var chart = this.chart, horiz = this.horiz, labelOptions = this.options.labels, slotCount = Math.max(this.tickPositions.length - (this.categories ? 0 : 1), 1), marginLeft = chart.margin[3]; return (horiz && (labelOptions.step || 0) < 2 && !labelOptions.rotation && // #4415 ((this.staggerLines || 1) * chart.plotWidth) / slotCount) || (!horiz && ((marginLeft && (marginLeft - chart.spacing[3])) || chart.chartWidth * 0.33)); // #1580, #1931 }, /** * Render the axis labels and determine whether ellipsis or rotation need to be applied */ renderUnsquish: function () { var chart = this.chart, renderer = chart.renderer, tickPositions = this.tickPositions, ticks = this.ticks, labelOptions = this.options.labels, horiz = this.horiz, slotWidth = this.getSlotWidth(), innerWidth = mathMax(1, mathRound(slotWidth - 2 * (labelOptions.padding || 5))), attr = {}, labelMetrics = this.labelMetrics(), textOverflowOption = labelOptions.style.textOverflow, css, maxLabelLength = 0, label, i, pos; // Set rotation option unless it is "auto", like in gauges if (!isString(labelOptions.rotation)) { attr.rotation = labelOptions.rotation || 0; // #4443 } // Get the longest label length each(tickPositions, function (tick) { tick = ticks[tick]; if (tick && tick.labelLength > maxLabelLength) { maxLabelLength = tick.labelLength; } }); this.maxLabelLength = maxLabelLength; // Handle auto rotation on horizontal axis if (this.autoRotation) { // Apply rotation only if the label is too wide for the slot, and // the label is wider than its height. if (maxLabelLength > innerWidth && maxLabelLength > labelMetrics.h) { attr.rotation = this.labelRotation; } else { this.labelRotation = 0; } // Handle word-wrap or ellipsis on vertical axis } else if (slotWidth) { // For word-wrap or ellipsis css = { width: innerWidth + PX }; if (!textOverflowOption) { css.textOverflow = 'clip'; // On vertical axis, only allow word wrap if there is room for more lines. i = tickPositions.length; while (!horiz && i--) { pos = tickPositions[i]; label = ticks[pos].label; if (label) { // Reset ellipsis in order to get the correct bounding box (#4070) if (label.styles.textOverflow === 'ellipsis') { label.css({ textOverflow: 'clip' }); // Set the correct width in order to read the bounding box height (#4678, #5034) } else if (ticks[pos].labelLength > slotWidth) { label.css({ width: slotWidth + 'px' }); } if (label.getBBox().height > this.len / tickPositions.length - (labelMetrics.h - labelMetrics.f)) { label.specCss = { textOverflow: 'ellipsis' }; } } } } } // Add ellipsis if the label length is significantly longer than ideal if (attr.rotation) { css = { width: (maxLabelLength > chart.chartHeight * 0.5 ? chart.chartHeight * 0.33 : chart.chartHeight) + PX }; if (!textOverflowOption) { css.textOverflow = 'ellipsis'; } } // Set the explicit or automatic label alignment this.labelAlign = labelOptions.align || this.autoLabelAlign(this.labelRotation); if (this.labelAlign) { attr.align = this.labelAlign; } // Apply general and specific CSS each(tickPositions, function (pos) { var tick = ticks[pos], label = tick && tick.label; if (label) { label.attr(attr); // This needs to go before the CSS in old IE (#4502) if (css) { label.css(merge(css, label.specCss)); } delete label.specCss; tick.rotation = attr.rotation; } }); // Note: Why is this not part of getLabelPosition? this.tickRotCorr = renderer.rotCorr(labelMetrics.b, this.labelRotation || 0, this.side !== 0); }, /** * Return true if the axis has associated data */ hasData: function () { return this.hasVisibleSeries || (defined(this.min) && defined(this.max) && !!this.tickPositions); }, /** * Render the tick labels to a preliminary position to get their sizes */ getOffset: function () { var axis = this, chart = axis.chart, renderer = chart.renderer, options = axis.options, tickPositions = axis.tickPositions, ticks = axis.ticks, horiz = axis.horiz, side = axis.side, invertedSide = chart.inverted ? [1, 0, 3, 2][side] : side, hasData, showAxis, titleOffset = 0, titleOffsetOption, titleMargin = 0, axisTitleOptions = options.title, labelOptions = options.labels, labelOffset = 0, // reset labelOffsetPadded, opposite = axis.opposite, axisOffset = chart.axisOffset, clipOffset = chart.clipOffset, clip, directionFactor = [-1, 1, 1, -1][side], n, textAlign, axisParent = axis.axisParent, // Used in color axis lineHeightCorrection, tickSize = this.tickSize('tick'); // For reuse in Axis.render hasData = axis.hasData(); axis.showAxis = showAxis = hasData || pick(options.showEmpty, true); // Set/reset staggerLines axis.staggerLines = axis.horiz && labelOptions.staggerLines; // Create the axisGroup and gridGroup elements on first iteration if (!axis.axisGroup) { axis.gridGroup = renderer.g('grid') .attr({ zIndex: options.gridZIndex || 1 }) .add(axisParent); axis.axisGroup = renderer.g('axis') .attr({ zIndex: options.zIndex || 2 }) .add(axisParent); axis.labelGroup = renderer.g('axis-labels') .attr({ zIndex: labelOptions.zIndex || 7 }) .addClass(PREFIX + axis.coll.toLowerCase() + '-labels') .add(axisParent); } if (hasData || axis.isLinked) { // Generate ticks each(tickPositions, function (pos) { if (!ticks[pos]) { ticks[pos] = new Tick(axis, pos); } else { ticks[pos].addLabel(); // update labels depending on tick interval } }); axis.renderUnsquish(); // Left side must be align: right and right side must have align: left for labels if (labelOptions.reserveSpace !== false && (side === 0 || side === 2 || { 1: 'left', 3: 'right' }[side] === axis.labelAlign || axis.labelAlign === 'center')) { each(tickPositions, function (pos) { // get the highest offset labelOffset = mathMax( ticks[pos].getLabelSize(), labelOffset ); }); } if (axis.staggerLines) { labelOffset *= axis.staggerLines; axis.labelOffset = labelOffset * (axis.opposite ? -1 : 1); } } else { // doesn't have data for (n in ticks) { ticks[n].destroy(); delete ticks[n]; } } if (axisTitleOptions && axisTitleOptions.text && axisTitleOptions.enabled !== false) { if (!axis.axisTitle) { textAlign = axisTitleOptions.textAlign; if (!textAlign) { textAlign = (horiz ? { low: 'left', middle: 'center', high: 'right' } : { low: opposite ? 'right' : 'left', middle: 'center', high: opposite ? 'left' : 'right' })[axisTitleOptions.align]; } axis.axisTitle = renderer.text( axisTitleOptions.text, 0, 0, axisTitleOptions.useHTML ) .attr({ zIndex: 7, rotation: axisTitleOptions.rotation || 0, align: textAlign }) .addClass(PREFIX + this.coll.toLowerCase() + '-title') .css(axisTitleOptions.style) .add(axis.axisGroup); axis.axisTitle.isNew = true; } if (showAxis) { titleOffset = axis.axisTitle.getBBox()[horiz ? 'height' : 'width']; titleOffsetOption = axisTitleOptions.offset; titleMargin = defined(titleOffsetOption) ? 0 : pick(axisTitleOptions.margin, horiz ? 5 : 10); } // hide or show the title depending on whether showEmpty is set axis.axisTitle[showAxis ? 'show' : 'hide'](true); } // handle automatic or user set offset axis.offset = directionFactor * pick(options.offset, axisOffset[side]); axis.tickRotCorr = axis.tickRotCorr || { x: 0, y: 0 }; // polar if (side === 0) { lineHeightCorrection = -axis.labelMetrics().h; } else if (side === 2) { lineHeightCorrection = axis.tickRotCorr.y; } else { lineHeightCorrection = 0; } // Find the padded label offset labelOffsetPadded = Math.abs(labelOffset) + titleMargin; if (labelOffset) { labelOffsetPadded -= lineHeightCorrection; labelOffsetPadded += directionFactor * (horiz ? pick(labelOptions.y, axis.tickRotCorr.y + directionFactor * 8) : labelOptions.x); } axis.axisTitleMargin = pick(titleOffsetOption, labelOffsetPadded); axisOffset[side] = mathMax( axisOffset[side], axis.axisTitleMargin + titleOffset + directionFactor * axis.offset, labelOffsetPadded, // #3027 hasData && tickPositions.length && tickSize ? tickSize[0] : 0 // #4866 ); // Decide the clipping needed to keep the graph inside the plot area and axis lines clip = options.offset ? 0 : mathFloor(options.lineWidth / 2) * 2; // #4308, #4371 clipOffset[invertedSide] = mathMax(clipOffset[invertedSide], clip); }, /** * Get the path for the axis line */ getLinePath: function (lineWidth) { var chart = this.chart, opposite = this.opposite, offset = this.offset, horiz = this.horiz, lineLeft = this.left + (opposite ? this.width : 0) + offset, lineTop = chart.chartHeight - this.bottom - (opposite ? this.height : 0) + offset; if (opposite) { lineWidth *= -1; // crispify the other way - #1480, #1687 } return chart.renderer .crispLine([ M, horiz ? this.left : lineLeft, horiz ? lineTop : this.top, L, horiz ? chart.chartWidth - this.right : lineLeft, horiz ? lineTop : chart.chartHeight - this.bottom ], lineWidth); }, /** * Position the title */ getTitlePosition: function () { // compute anchor points for each of the title align options var horiz = this.horiz, axisLeft = this.left, axisTop = this.top, axisLength = this.len, axisTitleOptions = this.options.title, margin = horiz ? axisLeft : axisTop, opposite = this.opposite, offset = this.offset, xOption = axisTitleOptions.x || 0, yOption = axisTitleOptions.y || 0, fontSize = this.chart.renderer.fontMetrics(axisTitleOptions.style.fontSize).f, // the position in the length direction of the axis alongAxis = { low: margin + (horiz ? 0 : axisLength), middle: margin + axisLength / 2, high: margin + (horiz ? axisLength : 0) }[axisTitleOptions.align], // the position in the perpendicular direction of the axis offAxis = (horiz ? axisTop + this.height : axisLeft) + (horiz ? 1 : -1) * // horizontal axis reverses the margin (opposite ? -1 : 1) * // so does opposite axes this.axisTitleMargin + (this.side === 2 ? fontSize : 0); return { x: horiz ? alongAxis + xOption : offAxis + (opposite ? this.width : 0) + offset + xOption, y: horiz ? offAxis + yOption - (opposite ? this.height : 0) + offset : alongAxis + yOption }; }, /** * Render the axis */ render: function () { var axis = this, chart = axis.chart, renderer = chart.renderer, options = axis.options, isLog = axis.isLog, lin2log = axis.lin2log, isLinked = axis.isLinked, tickPositions = axis.tickPositions, axisTitle = axis.axisTitle, ticks = axis.ticks, minorTicks = axis.minorTicks, alternateBands = axis.alternateBands, stackLabelOptions = options.stackLabels, alternateGridColor = options.alternateGridColor, tickmarkOffset = axis.tickmarkOffset, lineWidth = options.lineWidth, linePath, hasRendered = chart.hasRendered, slideInTicks = hasRendered && isNumber(axis.oldMin), showAxis = axis.showAxis, animation = animObject(renderer.globalAnimation), from, to; // Reset axis.labelEdge.length = 0; //axis.justifyToPlot = overflow === 'justify'; axis.overlap = false; // Mark all elements inActive before we go over and mark the active ones each([ticks, minorTicks, alternateBands], function (coll) { var pos; for (pos in coll) { coll[pos].isActive = false; } }); // If the series has data draw the ticks. Else only the line and title if (axis.hasData() || isLinked) { // minor ticks if (axis.minorTickInterval && !axis.categories) { each(axis.getMinorTickPositions(), function (pos) { if (!minorTicks[pos]) { minorTicks[pos] = new Tick(axis, pos, 'minor'); } // render new ticks in old position if (slideInTicks && minorTicks[pos].isNew) { minorTicks[pos].render(null, true); } minorTicks[pos].render(null, false, 1); }); } // Major ticks. Pull out the first item and render it last so that // we can get the position of the neighbour label. #808. if (tickPositions.length) { // #1300 each(tickPositions, function (pos, i) { // linked axes need an extra check to find out if if (!isLinked || (pos >= axis.min && pos <= axis.max)) { if (!ticks[pos]) { ticks[pos] = new Tick(axis, pos); } // render new ticks in old position if (slideInTicks && ticks[pos].isNew) { ticks[pos].render(i, true, 0.1); } ticks[pos].render(i); } }); // In a categorized axis, the tick marks are displayed between labels. So // we need to add a tick mark and grid line at the left edge of the X axis. if (tickmarkOffset && (axis.min === 0 || axis.single)) { if (!ticks[-1]) { ticks[-1] = new Tick(axis, -1, null, true); } ticks[-1].render(-1); } } // alternate grid color if (alternateGridColor) { each(tickPositions, function (pos, i) { to = tickPositions[i + 1] !== UNDEFINED ? tickPositions[i + 1] + tickmarkOffset : axis.max - tickmarkOffset; if (i % 2 === 0 && pos < axis.max && to <= axis.max + (chart.polar ? -tickmarkOffset : tickmarkOffset)) { // #2248, #4660 if (!alternateBands[pos]) { alternateBands[pos] = new Highcharts.PlotLineOrBand(axis); } from = pos + tickmarkOffset; // #949 alternateBands[pos].options = { from: isLog ? lin2log(from) : from, to: isLog ? lin2log(to) : to, color: alternateGridColor }; alternateBands[pos].render(); alternateBands[pos].isActive = true; } }); } // custom plot lines and bands if (!axis._addedPlotLB) { // only first time each((options.plotLines || []).concat(options.plotBands || []), function (plotLineOptions) { axis.addPlotBandOrLine(plotLineOptions); }); axis._addedPlotLB = true; } } // end if hasData // Remove inactive ticks each([ticks, minorTicks, alternateBands], function (coll) { var pos, i, forDestruction = [], delay = animation.duration, destroyInactiveItems = function () { i = forDestruction.length; while (i--) { // When resizing rapidly, the same items may be destroyed in different timeouts, // or the may be reactivated if (coll[forDestruction[i]] && !coll[forDestruction[i]].isActive) { coll[forDestruction[i]].destroy(); delete coll[forDestruction[i]]; } } }; for (pos in coll) { if (!coll[pos].isActive) { // Render to zero opacity coll[pos].render(pos, false, 0); coll[pos].isActive = false; forDestruction.push(pos); } } // When the objects are finished fading out, destroy them syncTimeout( destroyInactiveItems, coll === alternateBands || !chart.hasRendered || !delay ? 0 : delay ); }); // Static items. As the axis group is cleared on subsequent calls // to render, these items are added outside the group. // axis line if (lineWidth) { linePath = axis.getLinePath(lineWidth); if (!axis.axisLine) { axis.axisLine = renderer.path(linePath) .attr({ stroke: options.lineColor, 'stroke-width': lineWidth, zIndex: 7 }) .add(axis.axisGroup); } else { axis.axisLine.animate({ d: linePath }); } // show or hide the line depending on options.showEmpty axis.axisLine[showAxis ? 'show' : 'hide'](true); } if (axisTitle && showAxis) { axisTitle[axisTitle.isNew ? 'attr' : 'animate']( axis.getTitlePosition() ); axisTitle.isNew = false; } // Stacked totals: if (stackLabelOptions && stackLabelOptions.enabled) { axis.renderStackTotals(); } // End stacked totals axis.isDirty = false; }, /** * Redraw the axis to reflect changes in the data or axis extremes */ redraw: function () { if (this.visible) { // render the axis this.render(); // move plot lines and bands each(this.plotLinesAndBands, function (plotLine) { plotLine.render(); }); } // mark associated series as dirty and ready for redraw each(this.series, function (series) { series.isDirty = true; }); }, /** * Destroys an Axis instance. */ destroy: function (keepEvents) { var axis = this, stacks = axis.stacks, stackKey, plotLinesAndBands = axis.plotLinesAndBands, i; // Remove the events if (!keepEvents) { removeEvent(axis); } // Destroy each stack total for (stackKey in stacks) { destroyObjectProperties(stacks[stackKey]); stacks[stackKey] = null; } // Destroy collections each([axis.ticks, axis.minorTicks, axis.alternateBands], function (coll) { destroyObjectProperties(coll); }); i = plotLinesAndBands.length; while (i--) { // #1975 plotLinesAndBands[i].destroy(); } // Destroy properties each(['stackTotalGroup', 'axisLine', 'axisTitle', 'axisGroup', 'gridGroup', 'labelGroup', 'cross'], function (prop) { if (axis[prop]) { axis[prop] = axis[prop].destroy(); } }); this._addedPlotLB = this.chart._labelPanes = this.ordinalSlope = undefined; // #1611, #2887, #4314, #5316 }, /** * Draw the crosshair * * @param {Object} e The event arguments from the modified pointer event * @param {Object} point The Point object */ drawCrosshair: function (e, point) { var path, options = this.crosshair, pos, attribs, categorized, strokeWidth; // Use last available event when updating non-snapped crosshairs without // mouse interaction (#5287) if (!e) { e = this.cross && this.cross.e; } if ( // Disabled in options !this.crosshair || // Snap ((defined(point) || !pick(options.snap, true)) === false) ) { this.hideCrosshair(); } else { // Get the path if (!pick(options.snap, true)) { pos = (this.horiz ? e.chartX - this.pos : this.len - e.chartY + this.pos); } else if (defined(point)) { pos = this.isXAxis ? point.plotX : this.len - point.plotY; // #3834 } if (this.isRadial) { path = this.getPlotLinePath(this.isXAxis ? point.x : pick(point.stackY, point.y)) || null; // #3189 } else { path = this.getPlotLinePath(null, null, null, null, pos) || null; // #3189 } if (path === null) { this.hideCrosshair(); return; } categorized = this.categories && !this.isRadial; strokeWidth = pick(options.width, (categorized ? this.transA : 1)); // Draw the cross if (this.cross) { this.cross .attr({ d: path, visibility: 'visible', 'stroke-width': strokeWidth // #4737 }); } else { attribs = { 'pointer-events': 'none', // #5259 'stroke-width': strokeWidth, stroke: options.color || (categorized ? 'rgba(155,200,255,0.2)' : '#C0C0C0'), zIndex: pick(options.zIndex, 2) }; if (options.dashStyle) { attribs.dashstyle = options.dashStyle; } this.cross = this.chart.renderer.path(path).attr(attribs).add(); } this.cross.e = e; } }, /** * Hide the crosshair. */ hideCrosshair: function () { if (this.cross) { this.cross.hide(); } } }; // end Axis extend(Axis.prototype, AxisPlotLineOrBandExtension); /** * Set the tick positions to a time unit that makes sense, for example * on the first of each month or on every Monday. Return an array * with the time positions. Used in datetime axes as well as for grouping * data on a datetime axis. * * @param {Object} normalizedInterval The interval in axis values (ms) and the count * @param {Number} min The minimum in axis values * @param {Number} max The maximum in axis values * @param {Number} startOfWeek */ Axis.prototype.getTimeTicks = function (normalizedInterval, min, max, startOfWeek) { var tickPositions = [], i, higherRanks = {}, useUTC = defaultOptions.global.useUTC, minYear, // used in months and years as a basis for Date.UTC() minDate = new Date(min - getTZOffset(min)), interval = normalizedInterval.unitRange, count = normalizedInterval.count; if (defined(min)) { // #1300 minDate[setMilliseconds](interval >= timeUnits.second ? 0 : // #3935 count * mathFloor(minDate.getMilliseconds() / count)); // #3652, #3654 if (interval >= timeUnits.second) { // second minDate[setSeconds](interval >= timeUnits.minute ? 0 : // #3935 count * mathFloor(minDate.getSeconds() / count)); } if (interval >= timeUnits.minute) { // minute minDate[setMinutes](interval >= timeUnits.hour ? 0 : count * mathFloor(minDate[getMinutes]() / count)); } if (interval >= timeUnits.hour) { // hour minDate[setHours](interval >= timeUnits.day ? 0 : count * mathFloor(minDate[getHours]() / count)); } if (interval >= timeUnits.day) { // day minDate[setDate](interval >= timeUnits.month ? 1 : count * mathFloor(minDate[getDate]() / count)); } if (interval >= timeUnits.month) { // month minDate[setMonth](interval >= timeUnits.year ? 0 : count * mathFloor(minDate[getMonth]() / count)); minYear = minDate[getFullYear](); } if (interval >= timeUnits.year) { // year minYear -= minYear % count; minDate[setFullYear](minYear); } // week is a special case that runs outside the hierarchy if (interval === timeUnits.week) { // get start of current week, independent of count minDate[setDate](minDate[getDate]() - minDate[getDay]() + pick(startOfWeek, 1)); } // get tick positions i = 1; if (timezoneOffset || getTimezoneOffset) { minDate = minDate.getTime(); minDate = new Date(minDate + getTZOffset(minDate)); } minYear = minDate[getFullYear](); var time = minDate.getTime(), minMonth = minDate[getMonth](), minDateDate = minDate[getDate](), variableDayLength = !useUTC || !!getTimezoneOffset, // #4951 localTimezoneOffset = (timeUnits.day + (useUTC ? getTZOffset(minDate) : minDate.getTimezoneOffset() * 60 * 1000) ) % timeUnits.day; // #950, #3359 // iterate and add tick positions at appropriate values while (time < max) { tickPositions.push(time); // if the interval is years, use Date.UTC to increase years if (interval === timeUnits.year) { time = makeTime(minYear + i * count, 0); // if the interval is months, use Date.UTC to increase months } else if (interval === timeUnits.month) { time = makeTime(minYear, minMonth + i * count); // if we're using global time, the interval is not fixed as it jumps // one hour at the DST crossover } else if (variableDayLength && (interval === timeUnits.day || interval === timeUnits.week)) { time = makeTime(minYear, minMonth, minDateDate + i * count * (interval === timeUnits.day ? 1 : 7)); // else, the interval is fixed and we use simple addition } else { time += interval * count; } i++; } // push the last time tickPositions.push(time); // mark new days if the time is dividible by day (#1649, #1760) each(grep(tickPositions, function (time) { return interval <= timeUnits.hour && time % timeUnits.day === localTimezoneOffset; }), function (time) { higherRanks[time] = 'day'; }); } // record information on the chosen unit - for dynamic label formatter tickPositions.info = extend(normalizedInterval, { higherRanks: higherRanks, totalRange: interval * count }); return tickPositions; }; /** * Get a normalized tick interval for dates. Returns a configuration object with * unit range (interval), count and name. Used to prepare data for getTimeTicks. * Previously this logic was part of getTimeTicks, but as getTimeTicks now runs * of segments in stock charts, the normalizing logic was extracted in order to * prevent it for running over again for each segment having the same interval. * #662, #697. */ Axis.prototype.normalizeTimeTickInterval = function (tickInterval, unitsOption) { var units = unitsOption || [[ 'millisecond', // unit name [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples ], [ 'second', [1, 2, 5, 10, 15, 30] ], [ 'minute', [1, 2, 5, 10, 15, 30] ], [ 'hour', [1, 2, 3, 4, 6, 8, 12] ], [ 'day', [1, 2] ], [ 'week', [1, 2] ], [ 'month', [1, 2, 3, 4, 6] ], [ 'year', null ]], unit = units[units.length - 1], // default unit is years interval = timeUnits[unit[0]], multiples = unit[1], count, i; // loop through the units to find the one that best fits the tickInterval for (i = 0; i < units.length; i++) { unit = units[i]; interval = timeUnits[unit[0]]; multiples = unit[1]; if (units[i + 1]) { // lessThan is in the middle between the highest multiple and the next unit. var lessThan = (interval * multiples[multiples.length - 1] + timeUnits[units[i + 1][0]]) / 2; // break and keep the current unit if (tickInterval <= lessThan) { break; } } } // prevent 2.5 years intervals, though 25, 250 etc. are allowed if (interval === timeUnits.year && tickInterval < 5 * interval) { multiples = [1, 2, 5]; } // get the count count = normalizeTickInterval( tickInterval / interval, multiples, unit[0] === 'year' ? mathMax(getMagnitude(tickInterval / interval), 1) : 1 // #1913, #2360 ); return { unitRange: interval, count: count, unitName: unit[0] }; }; /** * Methods defined on the Axis prototype */ /** * Set the tick positions of a logarithmic axis */ Axis.prototype.getLogTickPositions = function (interval, min, max, minor) { var axis = this, options = axis.options, axisLength = axis.len, lin2log = axis.lin2log, log2lin = axis.log2lin, // Since we use this method for both major and minor ticks, // use a local variable and return the result positions = []; // Reset if (!minor) { axis._minorAutoInterval = null; } // First case: All ticks fall on whole logarithms: 1, 10, 100 etc. if (interval >= 0.5) { interval = mathRound(interval); positions = axis.getLinearTickPositions(interval, min, max); // Second case: We need intermediary ticks. For example // 1, 2, 4, 6, 8, 10, 20, 40 etc. } else if (interval >= 0.08) { var roundedMin = mathFloor(min), intermediate, i, j, len, pos, lastPos, break2; if (interval > 0.3) { intermediate = [1, 2, 4]; } else if (interval > 0.15) { // 0.2 equals five minor ticks per 1, 10, 100 etc intermediate = [1, 2, 4, 6, 8]; } else { // 0.1 equals ten minor ticks per 1, 10, 100 etc intermediate = [1, 2, 3, 4, 5, 6, 7, 8, 9]; } for (i = roundedMin; i < max + 1 && !break2; i++) { len = intermediate.length; for (j = 0; j < len && !break2; j++) { pos = log2lin(lin2log(i) * intermediate[j]); if (pos > min && (!minor || lastPos <= max) && lastPos !== UNDEFINED) { // #1670, lastPos is #3113 positions.push(lastPos); } if (lastPos > max) { break2 = true; } lastPos = pos; } } // Third case: We are so deep in between whole logarithmic values that // we might as well handle the tick positions like a linear axis. For // example 1.01, 1.02, 1.03, 1.04. } else { var realMin = lin2log(min), realMax = lin2log(max), tickIntervalOption = options[minor ? 'minorTickInterval' : 'tickInterval'], filteredTickIntervalOption = tickIntervalOption === 'auto' ? null : tickIntervalOption, tickPixelIntervalOption = options.tickPixelInterval / (minor ? 5 : 1), totalPixelLength = minor ? axisLength / axis.tickPositions.length : axisLength; interval = pick( filteredTickIntervalOption, axis._minorAutoInterval, (realMax - realMin) * tickPixelIntervalOption / (totalPixelLength || 1) ); interval = normalizeTickInterval( interval, null, getMagnitude(interval) ); positions = map(axis.getLinearTickPositions( interval, realMin, realMax ), log2lin); if (!minor) { axis._minorAutoInterval = interval / 5; } } // Set the axis-level tickInterval variable if (!minor) { axis.tickInterval = interval; } return positions; }; Axis.prototype.log2lin = function (num) { return math.log(num) / math.LN10; }; Axis.prototype.lin2log = function (num) { return math.pow(10, num); }; /** * The tooltip object * @param {Object} chart The chart instance * @param {Object} options Tooltip options */ var Tooltip = Highcharts.Tooltip = function () { this.init.apply(this, arguments); }; Tooltip.prototype = { init: function (chart, options) { var borderWidth = options.borderWidth, style = options.style, padding = pInt(style.padding); // Save the chart and options this.chart = chart; this.options = options; // Keep track of the current series //this.currentSeries = UNDEFINED; // List of crosshairs this.crosshairs = []; // Current values of x and y when animating this.now = { x: 0, y: 0 }; // The tooltip is initially hidden this.isHidden = true; // create the label this.label = chart.renderer.label('', 0, 0, options.shape || 'callout', null, null, options.useHTML, null, 'tooltip') .attr({ padding: padding, fill: options.backgroundColor, 'stroke-width': borderWidth, r: options.borderRadius, zIndex: 8, display: 'none' // #2301, #2657, #3532, #5570 }) .css(style) .css({ padding: 0 }) // Remove it from VML, the padding is applied as an attribute instead (#1117) .add(); // When using canVG the shadow shows up as a gray circle // even if the tooltip is hidden. if (!useCanVG) { this.label.shadow(options.shadow); } // Public property for getting the shared state. this.shared = options.shared; }, /** * Destroy the tooltip and its elements. */ destroy: function () { // Destroy and clear local variables if (this.label) { this.label = this.label.destroy(); } clearTimeout(this.hideTimer); clearTimeout(this.tooltipTimeout); }, /** * Provide a soft movement for the tooltip * * @param {Number} x * @param {Number} y * @private */ move: function (x, y, anchorX, anchorY) { var tooltip = this, now = tooltip.now, animate = tooltip.options.animation !== false && !tooltip.isHidden && // When we get close to the target position, abort animation and land on the right place (#3056) (mathAbs(x - now.x) > 1 || mathAbs(y - now.y) > 1), skipAnchor = tooltip.followPointer || tooltip.len > 1; // Get intermediate values for animation extend(now, { x: animate ? (2 * now.x + x) / 3 : x, y: animate ? (now.y + y) / 2 : y, anchorX: skipAnchor ? UNDEFINED : animate ? (2 * now.anchorX + anchorX) / 3 : anchorX, anchorY: skipAnchor ? UNDEFINED : animate ? (now.anchorY + anchorY) / 2 : anchorY }); // Move to the intermediate value tooltip.label.attr(now); // Run on next tick of the mouse tracker if (animate) { // Never allow two timeouts clearTimeout(this.tooltipTimeout); // Set the fixed interval ticking for the smooth tooltip this.tooltipTimeout = setTimeout(function () { // The interval function may still be running during destroy, so check that the chart is really there before calling. if (tooltip) { tooltip.move(x, y, anchorX, anchorY); } }, 32); } }, /** * Hide the tooltip */ hide: function (delay) { var tooltip = this; clearTimeout(this.hideTimer); // disallow duplicate timers (#1728, #1766) delay = pick(delay, this.options.hideDelay, 500); if (!this.isHidden) { this.hideTimer = syncTimeout(function () { tooltip.label[delay ? 'fadeOut' : 'hide'](); tooltip.isHidden = true; }, delay); } }, /** * Extendable method to get the anchor position of the tooltip * from a point or set of points */ getAnchor: function (points, mouseEvent) { var ret, chart = this.chart, inverted = chart.inverted, plotTop = chart.plotTop, plotLeft = chart.plotLeft, plotX = 0, plotY = 0, yAxis, xAxis; points = splat(points); // Pie uses a special tooltipPos ret = points[0].tooltipPos; // When tooltip follows mouse, relate the position to the mouse if (this.followPointer && mouseEvent) { if (mouseEvent.chartX === UNDEFINED) { mouseEvent = chart.pointer.normalize(mouseEvent); } ret = [ mouseEvent.chartX - chart.plotLeft, mouseEvent.chartY - plotTop ]; } // When shared, use the average position if (!ret) { each(points, function (point) { yAxis = point.series.yAxis; xAxis = point.series.xAxis; plotX += point.plotX + (!inverted && xAxis ? xAxis.left - plotLeft : 0); plotY += (point.plotLow ? (point.plotLow + point.plotHigh) / 2 : point.plotY) + (!inverted && yAxis ? yAxis.top - plotTop : 0); // #1151 }); plotX /= points.length; plotY /= points.length; ret = [ inverted ? chart.plotWidth - plotY : plotX, this.shared && !inverted && points.length > 1 && mouseEvent ? mouseEvent.chartY - plotTop : // place shared tooltip next to the mouse (#424) inverted ? chart.plotHeight - plotX : plotY ]; } return map(ret, mathRound); }, /** * Place the tooltip in a chart without spilling over * and not covering the point it self. */ getPosition: function (boxWidth, boxHeight, point) { var chart = this.chart, distance = this.distance, ret = {}, h = point.h || 0, // #4117 swapped, first = ['y', chart.chartHeight, boxHeight, point.plotY + chart.plotTop, chart.plotTop, chart.plotTop + chart.plotHeight], second = ['x', chart.chartWidth, boxWidth, point.plotX + chart.plotLeft, chart.plotLeft, chart.plotLeft + chart.plotWidth], // The far side is right or bottom preferFarSide = !this.followPointer && pick(point.ttBelow, !chart.inverted === !!point.negative), // #4984 /** * Handle the preferred dimension. When the preferred dimension is tooltip * on top or bottom of the point, it will look for space there. */ firstDimension = function (dim, outerSize, innerSize, point, min, max) { var roomLeft = innerSize < point - distance, roomRight = point + distance + innerSize < outerSize, alignedLeft = point - distance - innerSize, alignedRight = point + distance; if (preferFarSide && roomRight) { ret[dim] = alignedRight; } else if (!preferFarSide && roomLeft) { ret[dim] = alignedLeft; } else if (roomLeft) { ret[dim] = mathMin(max - innerSize, alignedLeft - h < 0 ? alignedLeft : alignedLeft - h); } else if (roomRight) { ret[dim] = mathMax(min, alignedRight + h + innerSize > outerSize ? alignedRight : alignedRight + h); } else { return false; } }, /** * Handle the secondary dimension. If the preferred dimension is tooltip * on top or bottom of the point, the second dimension is to align the tooltip * above the point, trying to align center but allowing left or right * align within the chart box. */ secondDimension = function (dim, outerSize, innerSize, point) { var retVal; // Too close to the edge, return false and swap dimensions if (point < distance || point > outerSize - distance) { retVal = false; // Align left/top } else if (point < innerSize / 2) { ret[dim] = 1; // Align right/bottom } else if (point > outerSize - innerSize / 2) { ret[dim] = outerSize - innerSize - 2; // Align center } else { ret[dim] = point - innerSize / 2; } return retVal; }, /** * Swap the dimensions */ swap = function (count) { var temp = first; first = second; second = temp; swapped = count; }, run = function () { if (firstDimension.apply(0, first) !== false) { if (secondDimension.apply(0, second) === false && !swapped) { swap(true); run(); } } else if (!swapped) { swap(true); run(); } else { ret.x = ret.y = 0; } }; // Under these conditions, prefer the tooltip on the side of the point if (chart.inverted || this.len > 1) { swap(); } run(); return ret; }, /** * In case no user defined formatter is given, this will be used. Note that the context * here is an object holding point, series, x, y etc. */ defaultFormatter: function (tooltip) { var items = this.points || splat(this), s; // build the header s = [tooltip.tooltipFooterHeaderFormatter(items[0])]; //#3397: abstraction to enable formatting of footer and header // build the values s = s.concat(tooltip.bodyFormatter(items)); // footer s.push(tooltip.tooltipFooterHeaderFormatter(items[0], true)); //#3397: abstraction to enable formatting of footer and header return s.join(''); }, /** * Refresh the tooltip's text and position. * @param {Object} point */ refresh: function (point, mouseEvent) { var tooltip = this, chart = tooltip.chart, label = tooltip.label, options = tooltip.options, x, y, anchor, textConfig = {}, text, pointConfig = [], formatter = options.formatter || tooltip.defaultFormatter, hoverPoints = chart.hoverPoints, borderColor, shared = tooltip.shared, currentSeries; clearTimeout(this.hideTimer); // get the reference point coordinates (pie charts use tooltipPos) tooltip.followPointer = splat(point)[0].series.tooltipOptions.followPointer; anchor = tooltip.getAnchor(point, mouseEvent); x = anchor[0]; y = anchor[1]; // shared tooltip, array is sent over if (shared && !(point.series && point.series.noSharedTooltip)) { // hide previous hoverPoints and set new chart.hoverPoints = point; if (hoverPoints) { each(hoverPoints, function (point) { point.setState(); }); } each(point, function (item) { item.setState(HOVER_STATE); pointConfig.push(item.getLabelConfig()); }); textConfig = { x: point[0].category, y: point[0].y }; textConfig.points = pointConfig; this.len = pointConfig.length; point = point[0]; // single point tooltip } else { textConfig = point.getLabelConfig(); } text = formatter.call(textConfig, tooltip); // register the current series currentSeries = point.series; this.distance = pick(currentSeries.tooltipOptions.distance, 16); // update the inner HTML if (text === false) { this.hide(); } else { // show it if (tooltip.isHidden) { stop(label); label.attr({ opacity: 1, display: 'block' }).show(); } // update text label.attr({ text: text }); // set the stroke color of the box borderColor = options.borderColor || point.color || currentSeries.color || '#606060'; label.attr({ stroke: borderColor }); tooltip.updatePosition({ plotX: x, plotY: y, negative: point.negative, ttBelow: point.ttBelow, h: anchor[2] || 0 }); this.isHidden = false; } fireEvent(chart, 'tooltipRefresh', { text: text, x: x + chart.plotLeft, y: y + chart.plotTop, borderColor: borderColor }); }, /** * Find the new position and perform the move */ updatePosition: function (point) { var chart = this.chart, label = this.label, pos = (this.options.positioner || this.getPosition).call( this, label.width, label.height, point ); // do the move this.move( mathRound(pos.x), mathRound(pos.y || 0), // can be undefined (#3977) point.plotX + chart.plotLeft, point.plotY + chart.plotTop ); }, /** * Get the best X date format based on the closest point range on the axis. */ getXDateFormat: function (point, options, xAxis) { var xDateFormat, dateTimeLabelFormats = options.dateTimeLabelFormats, closestPointRange = xAxis && xAxis.closestPointRange, n, blank = '01-01 00:00:00.000', strpos = { millisecond: 15, second: 12, minute: 9, hour: 6, day: 3 }, date, lastN = 'millisecond'; // for sub-millisecond data, #4223 if (closestPointRange) { date = dateFormat('%m-%d %H:%M:%S.%L', point.x); for (n in timeUnits) { // If the range is exactly one week and we're looking at a Sunday/Monday, go for the week format if (closestPointRange === timeUnits.week && +dateFormat('%w', point.x) === xAxis.options.startOfWeek && date.substr(6) === blank.substr(6)) { n = 'week'; break; } // The first format that is too great for the range if (timeUnits[n] > closestPointRange) { n = lastN; break; } // If the point is placed every day at 23:59, we need to show // the minutes as well. #2637. if (strpos[n] && date.substr(strpos[n]) !== blank.substr(strpos[n])) { break; } // Weeks are outside the hierarchy, only apply them on Mondays/Sundays like in the first condition if (n !== 'week') { lastN = n; } } if (n) { xDateFormat = dateTimeLabelFormats[n]; } } else { xDateFormat = dateTimeLabelFormats.day; } return xDateFormat || dateTimeLabelFormats.year; // #2546, 2581 }, /** * Format the footer/header of the tooltip * #3397: abstraction to enable formatting of footer and header */ tooltipFooterHeaderFormatter: function (labelConfig, isFooter) { var footOrHead = isFooter ? 'footer' : 'header', series = labelConfig.series, tooltipOptions = series.tooltipOptions, xDateFormat = tooltipOptions.xDateFormat, xAxis = series.xAxis, isDateTime = xAxis && xAxis.options.type === 'datetime' && isNumber(labelConfig.key), formatString = tooltipOptions[footOrHead + 'Format']; // Guess the best date format based on the closest point distance (#568, #3418) if (isDateTime && !xDateFormat) { xDateFormat = this.getXDateFormat(labelConfig, tooltipOptions, xAxis); } // Insert the footer date format if any if (isDateTime && xDateFormat) { formatString = formatString.replace('{point.key}', '{point.key:' + xDateFormat + '}'); } return format(formatString, { point: labelConfig, series: series }); }, /** * Build the body (lines) of the tooltip by iterating over the items and returning one entry for each item, * abstracting this functionality allows to easily overwrite and extend it. */ bodyFormatter: function (items) { return map(items, function (item) { var tooltipOptions = item.series.tooltipOptions; return (tooltipOptions.pointFormatter || item.point.tooltipFormatter).call(item.point, tooltipOptions.pointFormat); }); } }; var hoverChartIndex; // Global flag for touch support hasTouch = doc && doc.documentElement.ontouchstart !== UNDEFINED; /** * The mouse tracker object. All methods starting with "on" are primary DOM event handlers. * Subsequent methods should be named differently from what they are doing. * @param {Object} chart The Chart instance * @param {Object} options The root options object */ var Pointer = Highcharts.Pointer = function (chart, options) { this.init(chart, options); }; Pointer.prototype = { /** * Initialize Pointer */ init: function (chart, options) { var chartOptions = options.chart, chartEvents = chartOptions.events, zoomType = useCanVG ? '' : chartOptions.zoomType, inverted = chart.inverted, zoomX, zoomY; // Store references this.options = options; this.chart = chart; // Zoom status this.zoomX = zoomX = /x/.test(zoomType); this.zoomY = zoomY = /y/.test(zoomType); this.zoomHor = (zoomX && !inverted) || (zoomY && inverted); this.zoomVert = (zoomY && !inverted) || (zoomX && inverted); this.hasZoom = zoomX || zoomY; // Do we need to handle click on a touch device? this.runChartClick = chartEvents && !!chartEvents.click; this.pinchDown = []; this.lastValidTouch = {}; if (Highcharts.Tooltip && options.tooltip.enabled) { chart.tooltip = new Tooltip(chart, options.tooltip); this.followTouchMove = pick(options.tooltip.followTouchMove, true); } this.setDOMEvents(); }, /** * Add crossbrowser support for chartX and chartY * @param {Object} e The event object in standard browsers */ normalize: function (e, chartPosition) { var chartX, chartY, ePos; // IE normalizing e = e || win.event; if (!e.target) { e.target = e.srcElement; } // iOS (#2757) ePos = e.touches ? (e.touches.length ? e.touches.item(0) : e.changedTouches[0]) : e; // Get mouse position if (!chartPosition) { this.chartPosition = chartPosition = offset(this.chart.container); } // chartX and chartY if (ePos.pageX === UNDEFINED) { // IE < 9. #886. chartX = mathMax(e.x, e.clientX - chartPosition.left); // #2005, #2129: the second case is // for IE10 quirks mode within framesets chartY = e.y; } else { chartX = ePos.pageX - chartPosition.left; chartY = ePos.pageY - chartPosition.top; } return extend(e, { chartX: mathRound(chartX), chartY: mathRound(chartY) }); }, /** * Get the click position in terms of axis values. * * @param {Object} e A pointer event */ getCoordinates: function (e) { var coordinates = { xAxis: [], yAxis: [] }; each(this.chart.axes, function (axis) { coordinates[axis.isXAxis ? 'xAxis' : 'yAxis'].push({ axis: axis, value: axis.toValue(e[axis.horiz ? 'chartX' : 'chartY']) }); }); return coordinates; }, /** * With line type charts with a single tracker, get the point closest to the mouse. * Run Point.onMouseOver and display tooltip for the point or points. */ runPointActions: function (e) { var pointer = this, chart = pointer.chart, series = chart.series, tooltip = chart.tooltip, shared = tooltip ? tooltip.shared : false, followPointer, updatePosition = true, hoverPoint = chart.hoverPoint, hoverSeries = chart.hoverSeries, i, anchor, noSharedTooltip, stickToHoverSeries, directTouch, kdpoints = [], kdpointT; // For hovering over the empty parts of the plot area (hoverSeries is undefined). // If there is one series with point tracking (combo chart), don't go to nearest neighbour. if (!shared && !hoverSeries) { for (i = 0; i < series.length; i++) { if (series[i].directTouch || !series[i].options.stickyTracking) { series = []; } } } // If it has a hoverPoint and that series requires direct touch (like columns, #3899), or we're on // a noSharedTooltip series among shared tooltip series (#4546), use the hoverPoint . Otherwise, // search the k-d tree. stickToHoverSeries = hoverSeries && (shared ? hoverSeries.noSharedTooltip : hoverSeries.directTouch); if (stickToHoverSeries && hoverPoint) { kdpoints = [hoverPoint]; // Handle shared tooltip or cases where a series is not yet hovered } else { // When we have non-shared tooltip and sticky tracking is disabled, // search for the closest point only on hovered series: #5533, #5476 if (!shared && hoverSeries && !hoverSeries.options.stickyTracking) { series = [hoverSeries]; } // Find nearest points on all series each(series, function (s) { // Skip hidden series noSharedTooltip = s.noSharedTooltip && shared; directTouch = !shared && s.directTouch; if (s.visible && !noSharedTooltip && !directTouch && pick(s.options.enableMouseTracking, true)) { // #3821 kdpointT = s.searchPoint(e, !noSharedTooltip && s.kdDimensions === 1); // #3828 if (kdpointT && kdpointT.series) { // Point.series becomes null when reset and before redraw (#5197) kdpoints.push(kdpointT); } } }); // Sort kdpoints by distance to mouse pointer kdpoints.sort(function (p1, p2) { var isCloserX = p1.distX - p2.distX, isCloser = p1.dist - p2.dist, isAbove = p1.series.group.zIndex > p2.series.group.zIndex ? -1 : 1; // We have two points which are not in the same place on xAxis and shared tooltip: if (isCloserX !== 0) { return isCloserX; } // Points are not exactly in the same place on x/yAxis: if (isCloser !== 0) { return isCloser; } // The same xAxis and yAxis position, sort by z-index: return isAbove; }); } // Remove points with different x-positions, required for shared tooltip and crosshairs (#4645): if (shared) { i = kdpoints.length; while (i--) { if (kdpoints[i].clientX !== kdpoints[0].clientX || kdpoints[i].series.noSharedTooltip) { kdpoints.splice(i, 1); } } } // Refresh tooltip for kdpoint if new hover point or tooltip was hidden // #3926, #4200 if (kdpoints[0] && (kdpoints[0] !== pointer.hoverPoint || (tooltip && tooltip.isHidden))) { // Draw tooltip if necessary if (shared && !kdpoints[0].series.noSharedTooltip) { // Do mouseover on all points (#3919, #3985, #4410) for (i = 0; i >= 0; i--) { kdpoints[i].onMouseOver(e, kdpoints[i] !== ((hoverSeries && hoverSeries.directTouch && hoverPoint) || kdpoints[0])); } // Make sure that the hoverPoint and hoverSeries are stored for events (e.g. click), #5622 if (hoverSeries && hoverSeries.directTouch && hoverPoint && hoverPoint !== kdpoints[0]) { hoverPoint.onMouseOver(e, false); } if (kdpoints.length && tooltip) { // Keep the order of series in tooltip: tooltip.refresh(kdpoints.sort(function (p1, p2) { return p1.series.index - p2.series.index; }), e); } } else { if (tooltip) { tooltip.refresh(kdpoints[0], e); } if (!hoverSeries || !hoverSeries.directTouch) { // #4448 kdpoints[0].onMouseOver(e); } } pointer.prevKDPoint = kdpoints[0]; updatePosition = false; } // Update positions (regardless of kdpoint or hoverPoint) if (updatePosition) { followPointer = hoverSeries && hoverSeries.tooltipOptions.followPointer; if (tooltip && followPointer && !tooltip.isHidden) { anchor = tooltip.getAnchor([{}], e); tooltip.updatePosition({ plotX: anchor[0], plotY: anchor[1] }); } } // Start the event listener to pick up the tooltip and crosshairs if (!pointer._onDocumentMouseMove) { pointer._onDocumentMouseMove = function (e) { if (charts[hoverChartIndex]) { charts[hoverChartIndex].pointer.onDocumentMouseMove(e); } }; addEvent(doc, 'mousemove', pointer._onDocumentMouseMove); } // Crosshair. For each hover point, loop over axes and draw cross if that point // belongs to the axis (#4927). each(shared ? kdpoints : [pick(hoverPoint, kdpoints[0])], function drawPointCrosshair(point) { // #5269 each(chart.axes, function drawAxisCrosshair(axis) { // In case of snap = false, point is undefined, and we draw the crosshair anyway (#5066) if (!point || point.series && point.series[axis.coll] === axis) { // #5658 axis.drawCrosshair(e, point); } }); }); }, /** * Reset the tracking by hiding the tooltip, the hover series state and the hover point * * @param allowMove {Boolean} Instead of destroying the tooltip altogether, allow moving it if possible */ reset: function (allowMove, delay) { var pointer = this, chart = pointer.chart, hoverSeries = chart.hoverSeries, hoverPoint = chart.hoverPoint, hoverPoints = chart.hoverPoints, tooltip = chart.tooltip, tooltipPoints = tooltip && tooltip.shared ? hoverPoints : hoverPoint; // Check if the points have moved outside the plot area (#1003, #4736, #5101) if (allowMove && tooltipPoints) { each(splat(tooltipPoints), function (point) { if (point.series.isCartesian && point.plotX === undefined) { allowMove = false; } }); } // Just move the tooltip, #349 if (allowMove) { if (tooltip && tooltipPoints) { tooltip.refresh(tooltipPoints); if (hoverPoint) { // #2500 hoverPoint.setState(hoverPoint.state, true); each(chart.axes, function (axis) { if (axis.crosshair) { axis.drawCrosshair(null, hoverPoint); } }); } } // Full reset } else { if (hoverPoint) { hoverPoint.onMouseOut(); } if (hoverPoints) { each(hoverPoints, function (point) { point.setState(); }); } if (hoverSeries) { hoverSeries.onMouseOut(); } if (tooltip) { tooltip.hide(delay); } if (pointer._onDocumentMouseMove) { removeEvent(doc, 'mousemove', pointer._onDocumentMouseMove); pointer._onDocumentMouseMove = null; } // Remove crosshairs each(chart.axes, function (axis) { axis.hideCrosshair(); }); pointer.hoverX = pointer.prevKDPoint = chart.hoverPoints = chart.hoverPoint = null; } }, /** * Scale series groups to a certain scale and translation */ scaleGroups: function (attribs, clip) { var chart = this.chart, seriesAttribs; // Scale each series each(chart.series, function (series) { seriesAttribs = attribs || series.getPlotBox(); // #1701 if (series.xAxis && series.xAxis.zoomEnabled) { series.group.attr(seriesAttribs); if (series.markerGroup) { series.markerGroup.attr(seriesAttribs); series.markerGroup.clip(clip ? chart.clipRect : null); } if (series.dataLabelsGroup) { series.dataLabelsGroup.attr(seriesAttribs); } } }); // Clip chart.clipRect.attr(clip || chart.clipBox); }, /** * Start a drag operation */ dragStart: function (e) { var chart = this.chart; // Record the start position chart.mouseIsDown = e.type; chart.cancelClick = false; chart.mouseDownX = this.mouseDownX = e.chartX; chart.mouseDownY = this.mouseDownY = e.chartY; }, /** * Perform a drag operation in response to a mousemove event while the mouse is down */ drag: function (e) { var chart = this.chart, chartOptions = chart.options.chart, chartX = e.chartX, chartY = e.chartY, zoomHor = this.zoomHor, zoomVert = this.zoomVert, plotLeft = chart.plotLeft, plotTop = chart.plotTop, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, clickedInside, size, selectionMarker = this.selectionMarker, mouseDownX = this.mouseDownX, mouseDownY = this.mouseDownY, panKey = chartOptions.panKey && e[chartOptions.panKey + 'Key']; // If the device supports both touch and mouse (like IE11), and we are touch-dragging // inside the plot area, don't handle the mouse event. #4339. if (selectionMarker && selectionMarker.touch) { return; } // If the mouse is outside the plot area, adjust to cooordinates // inside to prevent the selection marker from going outside if (chartX < plotLeft) { chartX = plotLeft; } else if (chartX > plotLeft + plotWidth) { chartX = plotLeft + plotWidth; } if (chartY < plotTop) { chartY = plotTop; } else if (chartY > plotTop + plotHeight) { chartY = plotTop + plotHeight; } // determine if the mouse has moved more than 10px this.hasDragged = Math.sqrt( Math.pow(mouseDownX - chartX, 2) + Math.pow(mouseDownY - chartY, 2) ); if (this.hasDragged > 10) { clickedInside = chart.isInsidePlot(mouseDownX - plotLeft, mouseDownY - plotTop); // make a selection if (chart.hasCartesianSeries && (this.zoomX || this.zoomY) && clickedInside && !panKey) { if (!selectionMarker) { this.selectionMarker = selectionMarker = chart.renderer.rect( plotLeft, plotTop, zoomHor ? 1 : plotWidth, zoomVert ? 1 : plotHeight, 0 ) .attr({ fill: chartOptions.selectionMarkerFill || 'rgba(69,114,167,0.25)', zIndex: 7 }) .add(); } } // adjust the width of the selection marker if (selectionMarker && zoomHor) { size = chartX - mouseDownX; selectionMarker.attr({ width: mathAbs(size), x: (size > 0 ? 0 : size) + mouseDownX }); } // adjust the height of the selection marker if (selectionMarker && zoomVert) { size = chartY - mouseDownY; selectionMarker.attr({ height: mathAbs(size), y: (size > 0 ? 0 : size) + mouseDownY }); } // panning if (clickedInside && !selectionMarker && chartOptions.panning) { chart.pan(e, chartOptions.panning); } } }, /** * On mouse up or touch end across the entire document, drop the selection. */ drop: function (e) { var pointer = this, chart = this.chart, hasPinched = this.hasPinched; if (this.selectionMarker) { var selectionData = { originalEvent: e, // #4890 xAxis: [], yAxis: [] }, selectionBox = this.selectionMarker, selectionLeft = selectionBox.attr ? selectionBox.attr('x') : selectionBox.x, selectionTop = selectionBox.attr ? selectionBox.attr('y') : selectionBox.y, selectionWidth = selectionBox.attr ? selectionBox.attr('width') : selectionBox.width, selectionHeight = selectionBox.attr ? selectionBox.attr('height') : selectionBox.height, runZoom; // a selection has been made if (this.hasDragged || hasPinched) { // record each axis' min and max each(chart.axes, function (axis) { if (axis.zoomEnabled && defined(axis.min) && (hasPinched || pointer[{ xAxis: 'zoomX', yAxis: 'zoomY' }[axis.coll]])) { // #859, #3569 var horiz = axis.horiz, minPixelPadding = e.type === 'touchend' ? axis.minPixelPadding : 0, // #1207, #3075 selectionMin = axis.toValue((horiz ? selectionLeft : selectionTop) + minPixelPadding), selectionMax = axis.toValue((horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight) - minPixelPadding); selectionData[axis.coll].push({ axis: axis, min: mathMin(selectionMin, selectionMax), // for reversed axes max: mathMax(selectionMin, selectionMax) }); runZoom = true; } }); if (runZoom) { fireEvent(chart, 'selection', selectionData, function (args) { chart.zoom(extend(args, hasPinched ? { animation: false } : null)); }); } } this.selectionMarker = this.selectionMarker.destroy(); // Reset scaling preview if (hasPinched) { this.scaleGroups(); } } // Reset all if (chart) { // it may be destroyed on mouse up - #877 css(chart.container, { cursor: chart._cursor }); chart.cancelClick = this.hasDragged > 10; // #370 chart.mouseIsDown = this.hasDragged = this.hasPinched = false; this.pinchDown = []; } }, onContainerMouseDown: function (e) { e = this.normalize(e); // issue #295, dragging not always working in Firefox if (e.preventDefault) { e.preventDefault(); } this.dragStart(e); }, onDocumentMouseUp: function (e) { if (charts[hoverChartIndex]) { charts[hoverChartIndex].pointer.drop(e); } }, /** * Special handler for mouse move that will hide the tooltip when the mouse leaves the plotarea. * Issue #149 workaround. The mouseleave event does not always fire. */ onDocumentMouseMove: function (e) { var chart = this.chart, chartPosition = this.chartPosition; e = this.normalize(e, chartPosition); // If we're outside, hide the tooltip if (chartPosition && !this.inClass(e.target, 'highcharts-tracker') && !chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) { this.reset(); } }, /** * When mouse leaves the container, hide the tooltip. */ onContainerMouseLeave: function (e) { var chart = charts[hoverChartIndex]; if (chart && (e.relatedTarget || e.toElement)) { // #4886, MS Touch end fires mouseleave but with no related target chart.pointer.reset(); chart.pointer.chartPosition = null; // also reset the chart position, used in #149 fix } }, // The mousemove, touchmove and touchstart event handler onContainerMouseMove: function (e) { var chart = this.chart; if (!defined(hoverChartIndex) || !charts[hoverChartIndex] || !charts[hoverChartIndex].mouseIsDown) { hoverChartIndex = chart.index; } e = this.normalize(e); e.returnValue = false; // #2251, #3224 if (chart.mouseIsDown === 'mousedown') { this.drag(e); } // Show the tooltip and run mouse over events (#977) if ((this.inClass(e.target, 'highcharts-tracker') || chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) && !chart.openMenu) { this.runPointActions(e); } }, /** * Utility to detect whether an element has, or has a parent with, a specific * class name. Used on detection of tracker objects and on deciding whether * hovering the tooltip should cause the active series to mouse out. */ inClass: function (element, className) { var elemClassName; while (element) { elemClassName = attr(element, 'class'); if (elemClassName) { if (elemClassName.indexOf(className) !== -1) { return true; } if (elemClassName.indexOf(PREFIX + 'container') !== -1) { return false; } } element = element.parentNode; } }, onTrackerMouseOut: function (e) { var series = this.chart.hoverSeries, relatedTarget = e.relatedTarget || e.toElement; if (series && relatedTarget && !series.options.stickyTracking && // #4886 !this.inClass(relatedTarget, PREFIX + 'tooltip') && !this.inClass(relatedTarget, PREFIX + 'series-' + series.index)) { // #2499, #4465 series.onMouseOut(); } }, onContainerClick: function (e) { var chart = this.chart, hoverPoint = chart.hoverPoint, plotLeft = chart.plotLeft, plotTop = chart.plotTop; e = this.normalize(e); if (!chart.cancelClick) { // On tracker click, fire the series and point events. #783, #1583 if (hoverPoint && this.inClass(e.target, PREFIX + 'tracker')) { // the series click event fireEvent(hoverPoint.series, 'click', extend(e, { point: hoverPoint })); // the point click event if (chart.hoverPoint) { // it may be destroyed (#1844) hoverPoint.firePointEvent('click', e); } // When clicking outside a tracker, fire a chart event } else { extend(e, this.getCoordinates(e)); // fire a click event in the chart if (chart.isInsidePlot(e.chartX - plotLeft, e.chartY - plotTop)) { fireEvent(chart, 'click', e); } } } }, /** * Set the JS DOM events on the container and document. This method should contain * a one-to-one assignment between methods and their handlers. Any advanced logic should * be moved to the handler reflecting the event's name. */ setDOMEvents: function () { var pointer = this, container = pointer.chart.container; container.onmousedown = function (e) { pointer.onContainerMouseDown(e); }; container.onmousemove = function (e) { pointer.onContainerMouseMove(e); }; container.onclick = function (e) { pointer.onContainerClick(e); }; addEvent(container, 'mouseleave', pointer.onContainerMouseLeave); if (chartCount === 1) { addEvent(doc, 'mouseup', pointer.onDocumentMouseUp); } if (hasTouch) { container.ontouchstart = function (e) { pointer.onContainerTouchStart(e); }; container.ontouchmove = function (e) { pointer.onContainerTouchMove(e); }; if (chartCount === 1) { addEvent(doc, 'touchend', pointer.onDocumentTouchEnd); } } }, /** * Destroys the Pointer object and disconnects DOM events. */ destroy: function () { var prop; removeEvent(this.chart.container, 'mouseleave', this.onContainerMouseLeave); if (!chartCount) { removeEvent(doc, 'mouseup', this.onDocumentMouseUp); removeEvent(doc, 'touchend', this.onDocumentTouchEnd); } // memory and CPU leak clearInterval(this.tooltipTimeout); for (prop in this) { this[prop] = null; } } }; /* Support for touch devices */ extend(Highcharts.Pointer.prototype, { /** * Run translation operations */ pinchTranslate: function (pinchDown, touches, transform, selectionMarker, clip, lastValidTouch) { if (this.zoomHor || this.pinchHor) { this.pinchTranslateDirection(true, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch); } if (this.zoomVert || this.pinchVert) { this.pinchTranslateDirection(false, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch); } }, /** * Run translation operations for each direction (horizontal and vertical) independently */ pinchTranslateDirection: function (horiz, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch, forcedScale) { var chart = this.chart, xy = horiz ? 'x' : 'y', XY = horiz ? 'X' : 'Y', sChartXY = 'chart' + XY, wh = horiz ? 'width' : 'height', plotLeftTop = chart['plot' + (horiz ? 'Left' : 'Top')], selectionWH, selectionXY, clipXY, scale = forcedScale || 1, inverted = chart.inverted, bounds = chart.bounds[horiz ? 'h' : 'v'], singleTouch = pinchDown.length === 1, touch0Start = pinchDown[0][sChartXY], touch0Now = touches[0][sChartXY], touch1Start = !singleTouch && pinchDown[1][sChartXY], touch1Now = !singleTouch && touches[1][sChartXY], outOfBounds, transformScale, scaleKey, setScale = function () { if (!singleTouch && mathAbs(touch0Start - touch1Start) > 20) { // Don't zoom if fingers are too close on this axis scale = forcedScale || mathAbs(touch0Now - touch1Now) / mathAbs(touch0Start - touch1Start); } clipXY = ((plotLeftTop - touch0Now) / scale) + touch0Start; selectionWH = chart['plot' + (horiz ? 'Width' : 'Height')] / scale; }; // Set the scale, first pass setScale(); selectionXY = clipXY; // the clip position (x or y) is altered if out of bounds, the selection position is not // Out of bounds if (selectionXY < bounds.min) { selectionXY = bounds.min; outOfBounds = true; } else if (selectionXY + selectionWH > bounds.max) { selectionXY = bounds.max - selectionWH; outOfBounds = true; } // Is the chart dragged off its bounds, determined by dataMin and dataMax? if (outOfBounds) { // Modify the touchNow position in order to create an elastic drag movement. This indicates // to the user that the chart is responsive but can't be dragged further. touch0Now -= 0.8 * (touch0Now - lastValidTouch[xy][0]); if (!singleTouch) { touch1Now -= 0.8 * (touch1Now - lastValidTouch[xy][1]); } // Set the scale, second pass to adapt to the modified touchNow positions setScale(); } else { lastValidTouch[xy] = [touch0Now, touch1Now]; } // Set geometry for clipping, selection and transformation if (!inverted) { clip[xy] = clipXY - plotLeftTop; clip[wh] = selectionWH; } scaleKey = inverted ? (horiz ? 'scaleY' : 'scaleX') : 'scale' + XY; transformScale = inverted ? 1 / scale : scale; selectionMarker[wh] = selectionWH; selectionMarker[xy] = selectionXY; transform[scaleKey] = scale; transform['translate' + XY] = (transformScale * plotLeftTop) + (touch0Now - (transformScale * touch0Start)); }, /** * Handle touch events with two touches */ pinch: function (e) { var self = this, chart = self.chart, pinchDown = self.pinchDown, touches = e.touches, touchesLength = touches.length, lastValidTouch = self.lastValidTouch, hasZoom = self.hasZoom, selectionMarker = self.selectionMarker, transform = {}, fireClickEvent = touchesLength === 1 && ((self.inClass(e.target, PREFIX + 'tracker') && chart.runTrackerClick) || self.runChartClick), clip = {}; // Don't initiate panning until the user has pinched. This prevents us from // blocking page scrolling as users scroll down a long page (#4210). if (touchesLength > 1) { self.initiated = true; } // On touch devices, only proceed to trigger click if a handler is defined if (hasZoom && self.initiated && !fireClickEvent) { e.preventDefault(); } // Normalize each touch map(touches, function (e) { return self.normalize(e); }); // Register the touch start position if (e.type === 'touchstart') { each(touches, function (e, i) { pinchDown[i] = { chartX: e.chartX, chartY: e.chartY }; }); lastValidTouch.x = [pinchDown[0].chartX, pinchDown[1] && pinchDown[1].chartX]; lastValidTouch.y = [pinchDown[0].chartY, pinchDown[1] && pinchDown[1].chartY]; // Identify the data bounds in pixels each(chart.axes, function (axis) { if (axis.zoomEnabled) { var bounds = chart.bounds[axis.horiz ? 'h' : 'v'], minPixelPadding = axis.minPixelPadding, min = axis.toPixels(pick(axis.options.min, axis.dataMin)), max = axis.toPixels(pick(axis.options.max, axis.dataMax)), absMin = mathMin(min, max), absMax = mathMax(min, max); // Store the bounds for use in the touchmove handler bounds.min = mathMin(axis.pos, absMin - minPixelPadding); bounds.max = mathMax(axis.pos + axis.len, absMax + minPixelPadding); } }); self.res = true; // reset on next move // Event type is touchmove, handle panning and pinching } else if (pinchDown.length) { // can be 0 when releasing, if touchend fires first // Set the marker if (!selectionMarker) { self.selectionMarker = selectionMarker = extend({ destroy: noop, touch: true }, chart.plotBox); } self.pinchTranslate(pinchDown, touches, transform, selectionMarker, clip, lastValidTouch); self.hasPinched = hasZoom; // Scale and translate the groups to provide visual feedback during pinching self.scaleGroups(transform, clip); // Optionally move the tooltip on touchmove if (!hasZoom && self.followTouchMove && touchesLength === 1) { this.runPointActions(self.normalize(e)); } else if (self.res) { self.res = false; this.reset(false, 0); } } }, /** * General touch handler shared by touchstart and touchmove. */ touch: function (e, start) { var chart = this.chart, hasMoved, pinchDown; hoverChartIndex = chart.index; if (e.touches.length === 1) { e = this.normalize(e); if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop) && !chart.openMenu) { // Run mouse events and display tooltip etc if (start) { this.runPointActions(e); } // Android fires touchmove events after the touchstart even if the // finger hasn't moved, or moved only a pixel or two. In iOS however, // the touchmove doesn't fire unless the finger moves more than ~4px. // So we emulate this behaviour in Android by checking how much it // moved, and cancelling on small distances. #3450. if (e.type === 'touchmove') { pinchDown = this.pinchDown; hasMoved = pinchDown[0] ? Math.sqrt( // #5266 Math.pow(pinchDown[0].chartX - e.chartX, 2) + Math.pow(pinchDown[0].chartY - e.chartY, 2) ) >= 4 : false; } if (pick(hasMoved, true)) { this.pinch(e); } } else if (start) { // Hide the tooltip on touching outside the plot area (#1203) this.reset(); } } else if (e.touches.length === 2) { this.pinch(e); } }, onContainerTouchStart: function (e) { this.touch(e, true); }, onContainerTouchMove: function (e) { this.touch(e); }, onDocumentTouchEnd: function (e) { if (charts[hoverChartIndex]) { charts[hoverChartIndex].pointer.drop(e); } } }); if (win.PointerEvent || win.MSPointerEvent) { // The touches object keeps track of the points being touched at all times var touches = {}, hasPointerEvent = !!win.PointerEvent, getWebkitTouches = function () { var key, fake = []; fake.item = function (i) { return this[i]; }; for (key in touches) { if (touches.hasOwnProperty(key)) { fake.push({ pageX: touches[key].pageX, pageY: touches[key].pageY, target: touches[key].target }); } } return fake; }, translateMSPointer = function (e, method, wktype, func) { var p; if ((e.pointerType === 'touch' || e.pointerType === e.MSPOINTER_TYPE_TOUCH) && charts[hoverChartIndex]) { func(e); p = charts[hoverChartIndex].pointer; p[method]({ type: wktype, target: e.currentTarget, preventDefault: noop, touches: getWebkitTouches() }); } }; /** * Extend the Pointer prototype with methods for each event handler and more */ extend(Pointer.prototype, { onContainerPointerDown: function (e) { translateMSPointer(e, 'onContainerTouchStart', 'touchstart', function (e) { touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY, target: e.currentTarget }; }); }, onContainerPointerMove: function (e) { translateMSPointer(e, 'onContainerTouchMove', 'touchmove', function (e) { touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY }; if (!touches[e.pointerId].target) { touches[e.pointerId].target = e.currentTarget; } }); }, onDocumentPointerUp: function (e) { translateMSPointer(e, 'onDocumentTouchEnd', 'touchend', function (e) { delete touches[e.pointerId]; }); }, /** * Add or remove the MS Pointer specific events */ batchMSEvents: function (fn) { fn(this.chart.container, hasPointerEvent ? 'pointerdown' : 'MSPointerDown', this.onContainerPointerDown); fn(this.chart.container, hasPointerEvent ? 'pointermove' : 'MSPointerMove', this.onContainerPointerMove); fn(doc, hasPointerEvent ? 'pointerup' : 'MSPointerUp', this.onDocumentPointerUp); } }); // Disable default IE actions for pinch and such on chart element wrap(Pointer.prototype, 'init', function (proceed, chart, options) { proceed.call(this, chart, options); if (this.hasZoom) { // #4014 css(chart.container, { '-ms-touch-action': NONE, 'touch-action': NONE }); } }); // Add IE specific touch events to chart wrap(Pointer.prototype, 'setDOMEvents', function (proceed) { proceed.apply(this); if (this.hasZoom || this.followTouchMove) { this.batchMSEvents(addEvent); } }); // Destroy MS events also wrap(Pointer.prototype, 'destroy', function (proceed) { this.batchMSEvents(removeEvent); proceed.call(this); }); } /** * The overview of the chart's series */ var Legend = Highcharts.Legend = function (chart, options) { this.init(chart, options); }; Legend.prototype = { /** * Initialize the legend */ init: function (chart, options) { var legend = this, itemStyle = options.itemStyle, padding, itemMarginTop = options.itemMarginTop || 0; this.options = options; if (!options.enabled) { return; } legend.itemStyle = itemStyle; legend.itemHiddenStyle = merge(itemStyle, options.itemHiddenStyle); legend.itemMarginTop = itemMarginTop; legend.padding = padding = pick(options.padding, 8); legend.initialItemX = padding; legend.initialItemY = padding - 5; // 5 is the number of pixels above the text legend.maxItemWidth = 0; legend.chart = chart; legend.itemHeight = 0; legend.symbolWidth = pick(options.symbolWidth, 16); legend.pages = []; // Render it legend.render(); // move checkboxes addEvent(legend.chart, 'endResize', function () { legend.positionCheckboxes(); }); }, /** * Set the colors for the legend item * @param {Object} item A Series or Point instance * @param {Object} visible Dimmed or colored */ colorizeItem: function (item, visible) { var legend = this, options = legend.options, legendItem = item.legendItem, legendLine = item.legendLine, legendSymbol = item.legendSymbol, hiddenColor = legend.itemHiddenStyle.color, textColor = visible ? options.itemStyle.color : hiddenColor, symbolColor = visible ? (item.legendColor || item.color || '#CCC') : hiddenColor, markerOptions = item.options && item.options.marker, symbolAttr = { fill: symbolColor }, key, val; if (legendItem) { legendItem.css({ fill: textColor, color: textColor }); // color for #1553, oldIE } if (legendLine) { legendLine.attr({ stroke: symbolColor }); } if (legendSymbol) { // Apply marker options if (markerOptions && legendSymbol.isMarker) { // #585 symbolAttr.stroke = symbolColor; markerOptions = item.convertAttribs(markerOptions); for (key in markerOptions) { val = markerOptions[key]; if (val !== UNDEFINED) { symbolAttr[key] = val; } } } legendSymbol.attr(symbolAttr); } }, /** * Position the legend item * @param {Object} item A Series or Point instance */ positionItem: function (item) { var legend = this, options = legend.options, symbolPadding = options.symbolPadding, ltr = !options.rtl, legendItemPos = item._legendItemPos, itemX = legendItemPos[0], itemY = legendItemPos[1], checkbox = item.checkbox, legendGroup = item.legendGroup; if (legendGroup && legendGroup.element) { legendGroup.translate( ltr ? itemX : legend.legendWidth - itemX - 2 * symbolPadding - 4, itemY ); } if (checkbox) { checkbox.x = itemX; checkbox.y = itemY; } }, /** * Destroy a single legend item * @param {Object} item The series or point */ destroyItem: function (item) { var checkbox = item.checkbox; // destroy SVG elements each(['legendItem', 'legendLine', 'legendSymbol', 'legendGroup'], function (key) { if (item[key]) { item[key] = item[key].destroy(); } }); if (checkbox) { discardElement(item.checkbox); } }, /** * Destroys the legend. */ destroy: function () { var legend = this, legendGroup = legend.group, box = legend.box; if (box) { legend.box = box.destroy(); } if (legendGroup) { legend.group = legendGroup.destroy(); } }, /** * Position the checkboxes after the width is determined */ positionCheckboxes: function (scrollOffset) { var alignAttr = this.group.alignAttr, translateY, clipHeight = this.clipHeight || this.legendHeight, titleHeight = this.titleHeight; if (alignAttr) { translateY = alignAttr.translateY; each(this.allItems, function (item) { var checkbox = item.checkbox, top; if (checkbox) { top = translateY + titleHeight + checkbox.y + (scrollOffset || 0) + 3; css(checkbox, { left: (alignAttr.translateX + item.checkboxOffset + checkbox.x - 20) + PX, top: top + PX, display: top > translateY - 6 && top < translateY + clipHeight - 6 ? '' : NONE }); } }); } }, /** * Render the legend title on top of the legend */ renderTitle: function () { var options = this.options, padding = this.padding, titleOptions = options.title, titleHeight = 0, bBox; if (titleOptions.text) { if (!this.title) { this.title = this.chart.renderer.label(titleOptions.text, padding - 3, padding - 4, null, null, null, null, null, 'legend-title') .attr({ zIndex: 1 }) .css(titleOptions.style) .add(this.group); } bBox = this.title.getBBox(); titleHeight = bBox.height; this.offsetWidth = bBox.width; // #1717 this.contentGroup.attr({ translateY: titleHeight }); } this.titleHeight = titleHeight; }, /** * Set the legend item text */ setText: function (item) { var options = this.options; item.legendItem.attr({ text: options.labelFormat ? format(options.labelFormat, item) : options.labelFormatter.call(item) }); }, /** * Render a single specific legend item * @param {Object} item A series or point */ renderItem: function (item) { var legend = this, chart = legend.chart, renderer = chart.renderer, options = legend.options, horizontal = options.layout === 'horizontal', symbolWidth = legend.symbolWidth, symbolPadding = options.symbolPadding, itemStyle = legend.itemStyle, itemHiddenStyle = legend.itemHiddenStyle, padding = legend.padding, itemDistance = horizontal ? pick(options.itemDistance, 20) : 0, ltr = !options.rtl, itemHeight, widthOption = options.width, itemMarginBottom = options.itemMarginBottom || 0, itemMarginTop = legend.itemMarginTop, initialItemX = legend.initialItemX, bBox, itemWidth, li = item.legendItem, series = item.series && item.series.drawLegendSymbol ? item.series : item, seriesOptions = series.options, showCheckbox = legend.createCheckboxForItem && seriesOptions && seriesOptions.showCheckbox, useHTML = options.useHTML; if (!li) { // generate it once, later move it // Generate the group box // A group to hold the symbol and text. Text is to be appended in Legend class. item.legendGroup = renderer.g('legend-item') .attr({ zIndex: 1 }) .add(legend.scrollGroup); // Generate the list item text and add it to the group item.legendItem = li = renderer.text( '', ltr ? symbolWidth + symbolPadding : -symbolPadding, legend.baseline || 0, useHTML ) .css(merge(item.visible ? itemStyle : itemHiddenStyle)) // merge to prevent modifying original (#1021) .attr({ align: ltr ? 'left' : 'right', zIndex: 2 }) .add(item.legendGroup); // Get the baseline for the first item - the font size is equal for all if (!legend.baseline) { legend.fontMetrics = renderer.fontMetrics(itemStyle.fontSize, li); legend.baseline = legend.fontMetrics.f + 3 + itemMarginTop; li.attr('y', legend.baseline); } // Draw the legend symbol inside the group box series.drawLegendSymbol(legend, item); if (legend.setItemEvents) { legend.setItemEvents(item, li, useHTML, itemStyle, itemHiddenStyle); } // add the HTML checkbox on top if (showCheckbox) { legend.createCheckboxForItem(item); } } // Colorize the items legend.colorizeItem(item, item.visible); // Always update the text legend.setText(item); // calculate the positions for the next line bBox = li.getBBox(); itemWidth = item.checkboxOffset = options.itemWidth || item.legendItemWidth || symbolWidth + symbolPadding + bBox.width + itemDistance + (showCheckbox ? 20 : 0); legend.itemHeight = itemHeight = mathRound(item.legendItemHeight || bBox.height); // if the item exceeds the width, start a new line if (horizontal && legend.itemX - initialItemX + itemWidth > (widthOption || (chart.chartWidth - 2 * padding - initialItemX - options.x))) { legend.itemX = initialItemX; legend.itemY += itemMarginTop + legend.lastLineHeight + itemMarginBottom; legend.lastLineHeight = 0; // reset for next line (#915, #3976) } // If the item exceeds the height, start a new column /*if (!horizontal && legend.itemY + options.y + itemHeight > chart.chartHeight - spacingTop - spacingBottom) { legend.itemY = legend.initialItemY; legend.itemX += legend.maxItemWidth; legend.maxItemWidth = 0; }*/ // Set the edge positions legend.maxItemWidth = mathMax(legend.maxItemWidth, itemWidth); legend.lastItemY = itemMarginTop + legend.itemY + itemMarginBottom; legend.lastLineHeight = mathMax(itemHeight, legend.lastLineHeight); // #915 // cache the position of the newly generated or reordered items item._legendItemPos = [legend.itemX, legend.itemY]; // advance if (horizontal) { legend.itemX += itemWidth; } else { legend.itemY += itemMarginTop + itemHeight + itemMarginBottom; legend.lastLineHeight = itemHeight; } // the width of the widest item legend.offsetWidth = widthOption || mathMax( (horizontal ? legend.itemX - initialItemX - itemDistance : itemWidth) + padding, legend.offsetWidth ); }, /** * Get all items, which is one item per series for normal series and one item per point * for pie series. */ getAllItems: function () { var allItems = []; each(this.chart.series, function (series) { var seriesOptions = series.options; // Handle showInLegend. If the series is linked to another series, defaults to false. if (!pick(seriesOptions.showInLegend, !defined(seriesOptions.linkedTo) ? UNDEFINED : false, true)) { return; } // use points or series for the legend item depending on legendType allItems = allItems.concat( series.legendItems || (seriesOptions.legendType === 'point' ? series.data : series) ); }); return allItems; }, /** * Adjust the chart margins by reserving space for the legend on only one side * of the chart. If the position is set to a corner, top or bottom is reserved * for horizontal legends and left or right for vertical ones. */ adjustMargins: function (margin, spacing) { var chart = this.chart, options = this.options, // Use the first letter of each alignment option in order to detect the side alignment = options.align.charAt(0) + options.verticalAlign.charAt(0) + options.layout.charAt(0); // #4189 - use charAt(x) notation instead of [x] for IE7 if (!options.floating) { each([ /(lth|ct|rth)/, /(rtv|rm|rbv)/, /(rbh|cb|lbh)/, /(lbv|lm|ltv)/ ], function (alignments, side) { if (alignments.test(alignment) && !defined(margin[side])) { // Now we have detected on which side of the chart we should reserve space for the legend chart[marginNames[side]] = mathMax( chart[marginNames[side]], chart.legend[(side + 1) % 2 ? 'legendHeight' : 'legendWidth'] + [1, -1, -1, 1][side] * options[(side % 2) ? 'x' : 'y'] + pick(options.margin, 12) + spacing[side] ); } }); } }, /** * Render the legend. This method can be called both before and after * chart.render. If called after, it will only rearrange items instead * of creating new ones. */ render: function () { var legend = this, chart = legend.chart, renderer = chart.renderer, legendGroup = legend.group, allItems, display, legendWidth, legendHeight, box = legend.box, options = legend.options, padding = legend.padding, legendBorderWidth = options.borderWidth, legendBackgroundColor = options.backgroundColor; legend.itemX = legend.initialItemX; legend.itemY = legend.initialItemY; legend.offsetWidth = 0; legend.lastItemY = 0; if (!legendGroup) { legend.group = legendGroup = renderer.g('legend') .attr({ zIndex: 7 }) .add(); legend.contentGroup = renderer.g() .attr({ zIndex: 1 }) // above background .add(legendGroup); legend.scrollGroup = renderer.g() .add(legend.contentGroup); } legend.renderTitle(); // add each series or point allItems = legend.getAllItems(); // sort by legendIndex stableSort(allItems, function (a, b) { return ((a.options && a.options.legendIndex) || 0) - ((b.options && b.options.legendIndex) || 0); }); // reversed legend if (options.reversed) { allItems.reverse(); } legend.allItems = allItems; legend.display = display = !!allItems.length; // render the items legend.lastLineHeight = 0; each(allItems, function (item) { legend.renderItem(item); }); // Get the box legendWidth = (options.width || legend.offsetWidth) + padding; legendHeight = legend.lastItemY + legend.lastLineHeight + legend.titleHeight; legendHeight = legend.handleOverflow(legendHeight); legendHeight += padding; // Draw the border and/or background if (legendBorderWidth || legendBackgroundColor) { if (!box) { legend.box = box = renderer.rect( 0, 0, legendWidth, legendHeight, options.borderRadius, legendBorderWidth || 0 ).attr({ stroke: options.borderColor, 'stroke-width': legendBorderWidth || 0, fill: legendBackgroundColor || NONE }) .add(legendGroup) .shadow(options.shadow); box.isNew = true; } else if (legendWidth > 0 && legendHeight > 0) { box[box.isNew ? 'attr' : 'animate']( box.crisp({ width: legendWidth, height: legendHeight }) ); box.isNew = false; } // hide the border if no items box[display ? 'show' : 'hide'](); } legend.legendWidth = legendWidth; legend.legendHeight = legendHeight; // Now that the legend width and height are established, put the items in the // final position each(allItems, function (item) { legend.positionItem(item); }); // 1.x compatibility: positioning based on style /*var props = ['left', 'right', 'top', 'bottom'], prop, i = 4; while (i--) { prop = props[i]; if (options.style[prop] && options.style[prop] !== 'auto') { options[i < 2 ? 'align' : 'verticalAlign'] = prop; options[i < 2 ? 'x' : 'y'] = pInt(options.style[prop]) * (i % 2 ? -1 : 1); } }*/ if (display) { legendGroup.align(extend({ width: legendWidth, height: legendHeight }, options), true, 'spacingBox'); } if (!chart.isResizing) { this.positionCheckboxes(); } }, /** * Set up the overflow handling by adding navigation with up and down arrows below the * legend. */ handleOverflow: function (legendHeight) { var legend = this, chart = this.chart, renderer = chart.renderer, options = this.options, optionsY = options.y, alignTop = options.verticalAlign === 'top', spaceHeight = chart.spacingBox.height + (alignTop ? -optionsY : optionsY) - this.padding, maxHeight = options.maxHeight, clipHeight, clipRect = this.clipRect, navOptions = options.navigation, animation = pick(navOptions.animation, true), arrowSize = navOptions.arrowSize || 12, nav = this.nav, pages = this.pages, padding = this.padding, lastY, allItems = this.allItems, clipToHeight = function (height) { clipRect.attr({ height: height }); // useHTML if (legend.contentGroup.div) { legend.contentGroup.div.style.clip = 'rect(' + padding + 'px,9999px,' + (padding + height) + 'px,0)'; } }; // Adjust the height if (options.layout === 'horizontal') { spaceHeight /= 2; } if (maxHeight) { spaceHeight = mathMin(spaceHeight, maxHeight); } // Reset the legend height and adjust the clipping rectangle pages.length = 0; if (legendHeight > spaceHeight && navOptions.enabled !== false) { this.clipHeight = clipHeight = mathMax(spaceHeight - 20 - this.titleHeight - padding, 0); this.currentPage = pick(this.currentPage, 1); this.fullHeight = legendHeight; // Fill pages with Y positions so that the top of each a legend item defines // the scroll top for each page (#2098) each(allItems, function (item, i) { var y = item._legendItemPos[1], h = mathRound(item.legendItem.getBBox().height), len = pages.length; if (!len || (y - pages[len - 1] > clipHeight && (lastY || y) !== pages[len - 1])) { pages.push(lastY || y); len++; } if (i === allItems.length - 1 && y + h - pages[len - 1] > clipHeight) { pages.push(y); } if (y !== lastY) { lastY = y; } }); // Only apply clipping if needed. Clipping causes blurred legend in PDF export (#1787) if (!clipRect) { clipRect = legend.clipRect = renderer.clipRect(0, padding, 9999, 0); legend.contentGroup.clip(clipRect); } clipToHeight(clipHeight); // Add navigation elements if (!nav) { this.nav = nav = renderer.g().attr({ zIndex: 1 }).add(this.group); this.up = renderer.symbol('triangle', 0, 0, arrowSize, arrowSize) .on('click', function () { legend.scroll(-1, animation); }) .add(nav); this.pager = renderer.text('', 15, 10) .css(navOptions.style) .add(nav); this.down = renderer.symbol('triangle-down', 0, 0, arrowSize, arrowSize) .on('click', function () { legend.scroll(1, animation); }) .add(nav); } // Set initial position legend.scroll(0); legendHeight = spaceHeight; } else if (nav) { clipToHeight(chart.chartHeight); nav.hide(); this.scrollGroup.attr({ translateY: 1 }); this.clipHeight = 0; // #1379 } return legendHeight; }, /** * Scroll the legend by a number of pages * @param {Object} scrollBy * @param {Object} animation */ scroll: function (scrollBy, animation) { var pages = this.pages, pageCount = pages.length, currentPage = this.currentPage + scrollBy, clipHeight = this.clipHeight, navOptions = this.options.navigation, activeColor = navOptions.activeColor, inactiveColor = navOptions.inactiveColor, pager = this.pager, padding = this.padding, scrollOffset; // When resizing while looking at the last page if (currentPage > pageCount) { currentPage = pageCount; } if (currentPage > 0) { if (animation !== UNDEFINED) { setAnimation(animation, this.chart); } this.nav.attr({ translateX: padding, translateY: clipHeight + this.padding + 7 + this.titleHeight, visibility: VISIBLE }); this.up.attr({ fill: currentPage === 1 ? inactiveColor : activeColor }) .css({ cursor: currentPage === 1 ? 'default' : 'pointer' }); pager.attr({ text: currentPage + '/' + pageCount }); this.down.attr({ x: 18 + this.pager.getBBox().width, // adjust to text width fill: currentPage === pageCount ? inactiveColor : activeColor }) .css({ cursor: currentPage === pageCount ? 'default' : 'pointer' }); scrollOffset = -pages[currentPage - 1] + this.initialItemY; this.scrollGroup.animate({ translateY: scrollOffset }); this.currentPage = currentPage; this.positionCheckboxes(scrollOffset); } } }; /* * LegendSymbolMixin */ var LegendSymbolMixin = Highcharts.LegendSymbolMixin = { /** * Get the series' symbol in the legend * * @param {Object} legend The legend object * @param {Object} item The series (this) or point */ drawRectangle: function (legend, item) { var symbolHeight = legend.options.symbolHeight || legend.fontMetrics.f; item.legendSymbol = this.chart.renderer.rect( 0, legend.baseline - symbolHeight + 1, // #3988 legend.symbolWidth, symbolHeight, legend.options.symbolRadius || 0 ).attr({ zIndex: 3 }).add(item.legendGroup); }, /** * Get the series' symbol in the legend. This method should be overridable to create custom * symbols through Highcharts.seriesTypes[type].prototype.drawLegendSymbols. * * @param {Object} legend The legend object */ drawLineMarker: function (legend) { var options = this.options, markerOptions = options.marker, radius, legendSymbol, symbolWidth = legend.symbolWidth, renderer = this.chart.renderer, legendItemGroup = this.legendGroup, verticalCenter = legend.baseline - mathRound(legend.fontMetrics.b * 0.3), attr; // Draw the line if (options.lineWidth) { attr = { 'stroke-width': options.lineWidth }; if (options.dashStyle) { attr.dashstyle = options.dashStyle; } this.legendLine = renderer.path([ M, 0, verticalCenter, L, symbolWidth, verticalCenter ]) .attr(attr) .add(legendItemGroup); } // Draw the marker if (markerOptions && markerOptions.enabled !== false) { radius = markerOptions.radius; this.legendSymbol = legendSymbol = renderer.symbol( this.symbol, (symbolWidth / 2) - radius, verticalCenter - radius, 2 * radius, 2 * radius, markerOptions ) .add(legendItemGroup); legendSymbol.isMarker = true; } } }; // Workaround for #2030, horizontal legend items not displaying in IE11 Preview, // and for #2580, a similar drawing flaw in Firefox 26. // Explore if there's a general cause for this. The problem may be related // to nested group elements, as the legend item texts are within 4 group elements. if (/Trident\/7\.0/.test(userAgent) || isFirefox) { wrap(Legend.prototype, 'positionItem', function (proceed, item) { var legend = this, runPositionItem = function () { // If chart destroyed in sync, this is undefined (#2030) if (item._legendItemPos) { proceed.call(legend, item); } }; // Do it now, for export and to get checkbox placement runPositionItem(); // Do it after to work around the core issue setTimeout(runPositionItem); }); } /** * The Chart class * @param {String|Object} renderTo The DOM element to render to, or its id * @param {Object} options * @param {Function} callback Function to run when the chart has loaded */ var Chart = Highcharts.Chart = function () { this.getArgs.apply(this, arguments); }; Highcharts.chart = function (a, b, c) { return new Chart(a, b, c); }; Chart.prototype = { /** * Hook for modules */ callbacks: [], /** * Handle the arguments passed to the constructor * @returns {Array} Arguments without renderTo */ getArgs: function () { var args = [].slice.call(arguments); // Remove the optional first argument, renderTo, and // set it on this. if (isString(args[0]) || args[0].nodeName) { this.renderTo = args.shift(); } this.init(args[0], args[1]); }, /** * Initialize the chart */ init: function (userOptions, callback) { // Handle regular options var options, seriesOptions = userOptions.series; // skip merging data points to increase performance userOptions.series = null; options = merge(defaultOptions, userOptions); // do the merge options.series = userOptions.series = seriesOptions; // set back the series data this.userOptions = userOptions; var optionsChart = options.chart; // Create margin & spacing array this.margin = this.splashArray('margin', optionsChart); this.spacing = this.splashArray('spacing', optionsChart); var chartEvents = optionsChart.events; //this.runChartClick = chartEvents && !!chartEvents.click; this.bounds = { h: {}, v: {} }; // Pixel data bounds for touch zoom this.callback = callback; this.isResizing = 0; this.options = options; //chartTitleOptions = UNDEFINED; //chartSubtitleOptions = UNDEFINED; this.axes = []; this.series = []; this.hasCartesianSeries = optionsChart.showAxes; //this.axisOffset = UNDEFINED; //this.maxTicks = UNDEFINED; // handle the greatest amount of ticks on grouped axes //this.inverted = UNDEFINED; //this.loadingShown = UNDEFINED; //this.container = UNDEFINED; //this.chartWidth = UNDEFINED; //this.chartHeight = UNDEFINED; //this.marginRight = UNDEFINED; //this.marginBottom = UNDEFINED; //this.containerWidth = UNDEFINED; //this.containerHeight = UNDEFINED; //this.oldChartWidth = UNDEFINED; //this.oldChartHeight = UNDEFINED; //this.renderTo = UNDEFINED; //this.renderToClone = UNDEFINED; //this.spacingBox = UNDEFINED //this.legend = UNDEFINED; // Elements //this.chartBackground = UNDEFINED; //this.plotBackground = UNDEFINED; //this.plotBGImage = UNDEFINED; //this.plotBorder = UNDEFINED; //this.loadingDiv = UNDEFINED; //this.loadingSpan = UNDEFINED; var chart = this, eventType; // Add the chart to the global lookup chart.index = charts.length; charts.push(chart); chartCount++; // Set up auto resize if (optionsChart.reflow !== false) { addEvent(chart, 'load', function () { chart.initReflow(); }); } // Chart event handlers if (chartEvents) { for (eventType in chartEvents) { addEvent(chart, eventType, chartEvents[eventType]); } } chart.xAxis = []; chart.yAxis = []; // Expose methods and variables chart.animation = useCanVG ? false : pick(optionsChart.animation, true); chart.pointCount = chart.colorCounter = chart.symbolCounter = 0; chart.firstRender(); }, /** * Initialize an individual series, called internally before render time */ initSeries: function (options) { var chart = this, optionsChart = chart.options.chart, type = options.type || optionsChart.type || optionsChart.defaultSeriesType, series, constr = seriesTypes[type]; // No such series type if (!constr) { error(17, true); } series = new constr(); series.init(this, options); return series; }, /** * Check whether a given point is within the plot area * * @param {Number} plotX Pixel x relative to the plot area * @param {Number} plotY Pixel y relative to the plot area * @param {Boolean} inverted Whether the chart is inverted */ isInsidePlot: function (plotX, plotY, inverted) { var x = inverted ? plotY : plotX, y = inverted ? plotX : plotY; return x >= 0 && x <= this.plotWidth && y >= 0 && y <= this.plotHeight; }, /** * Redraw legend, axes or series based on updated data * * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration */ redraw: function (animation) { var chart = this, axes = chart.axes, series = chart.series, pointer = chart.pointer, legend = chart.legend, redrawLegend = chart.isDirtyLegend, hasStackedSeries, hasDirtyStacks, hasCartesianSeries = chart.hasCartesianSeries, isDirtyBox = chart.isDirtyBox, seriesLength = series.length, i = seriesLength, serie, renderer = chart.renderer, isHiddenChart = renderer.isHidden(), afterRedraw = []; setAnimation(animation, chart); if (isHiddenChart) { chart.cloneRenderTo(); } // Adjust title layout (reflow multiline text) chart.layOutTitles(); // link stacked series while (i--) { serie = series[i]; if (serie.options.stacking) { hasStackedSeries = true; if (serie.isDirty) { hasDirtyStacks = true; break; } } } if (hasDirtyStacks) { // mark others as dirty i = seriesLength; while (i--) { serie = series[i]; if (serie.options.stacking) { serie.isDirty = true; } } } // Handle updated data in the series each(series, function (serie) { if (serie.isDirty) { if (serie.options.legendType === 'point') { if (serie.updateTotals) { serie.updateTotals(); } redrawLegend = true; } } if (serie.isDirtyData) { fireEvent(serie, 'updatedData'); } }); // handle added or removed series if (redrawLegend && legend.options.enabled) { // series or pie points are added or removed // draw legend graphics legend.render(); chart.isDirtyLegend = false; } // reset stacks if (hasStackedSeries) { chart.getStacks(); } if (hasCartesianSeries) { if (!chart.isResizing) { // reset maxTicks chart.maxTicks = null; // set axes scales each(axes, function (axis) { axis.updateNames(); axis.setScale(); }); } } chart.getMargins(); // #3098 if (hasCartesianSeries) { // If one axis is dirty, all axes must be redrawn (#792, #2169) each(axes, function (axis) { if (axis.isDirty) { isDirtyBox = true; } }); // redraw axes each(axes, function (axis) { // Fire 'afterSetExtremes' only if extremes are set var key = axis.min + ',' + axis.max; if (axis.extKey !== key) { // #821, #4452 axis.extKey = key; afterRedraw.push(function () { // prevent a recursive call to chart.redraw() (#1119) fireEvent(axis, 'afterSetExtremes', extend(axis.eventArgs, axis.getExtremes())); // #747, #751 delete axis.eventArgs; }); } if (isDirtyBox || hasStackedSeries) { axis.redraw(); } }); } // the plot areas size has changed if (isDirtyBox) { chart.drawChartBox(); } // redraw affected series each(series, function (serie) { if (serie.isDirty && serie.visible && (!serie.isCartesian || serie.xAxis)) { // issue #153 serie.redraw(); } }); // move tooltip or reset if (pointer) { pointer.reset(true); } // redraw if canvas renderer.draw(); // fire the event fireEvent(chart, 'redraw'); if (isHiddenChart) { chart.cloneRenderTo(true); } // Fire callbacks that are put on hold until after the redraw each(afterRedraw, function (callback) { callback.call(); }); }, /** * Get an axis, series or point object by id. * @param id {String} The id as given in the configuration options */ get: function (id) { var chart = this, axes = chart.axes, series = chart.series; var i, j, points; // search axes for (i = 0; i < axes.length; i++) { if (axes[i].options.id === id) { return axes[i]; } } // search series for (i = 0; i < series.length; i++) { if (series[i].options.id === id) { return series[i]; } } // search points for (i = 0; i < series.length; i++) { points = series[i].points || []; for (j = 0; j < points.length; j++) { if (points[j].id === id) { return points[j]; } } } return null; }, /** * Create the Axis instances based on the config options */ getAxes: function () { var chart = this, options = this.options, xAxisOptions = options.xAxis = splat(options.xAxis || {}), yAxisOptions = options.yAxis = splat(options.yAxis || {}), optionsArray; // make sure the options are arrays and add some members each(xAxisOptions, function (axis, i) { axis.index = i; axis.isX = true; }); each(yAxisOptions, function (axis, i) { axis.index = i; }); // concatenate all axis options into one array optionsArray = xAxisOptions.concat(yAxisOptions); each(optionsArray, function (axisOptions) { new Axis(chart, axisOptions); // eslint-disable-line no-new }); }, /** * Get the currently selected points from all series */ getSelectedPoints: function () { var points = []; each(this.series, function (serie) { points = points.concat(grep(serie.points || [], function (point) { return point.selected; })); }); return points; }, /** * Get the currently selected series */ getSelectedSeries: function () { return grep(this.series, function (serie) { return serie.selected; }); }, /** * Show the title and subtitle of the chart * * @param titleOptions {Object} New title options * @param subtitleOptions {Object} New subtitle options * */ setTitle: function (titleOptions, subtitleOptions, redraw) { var chart = this, options = chart.options, chartTitleOptions, chartSubtitleOptions; chartTitleOptions = options.title = merge(options.title, titleOptions); chartSubtitleOptions = options.subtitle = merge(options.subtitle, subtitleOptions); // add title and subtitle each([ ['title', titleOptions, chartTitleOptions], ['subtitle', subtitleOptions, chartSubtitleOptions] ], function (arr) { var name = arr[0], title = chart[name], titleOptions = arr[1], chartTitleOptions = arr[2]; if (title && titleOptions) { chart[name] = title = title.destroy(); // remove old } if (chartTitleOptions && chartTitleOptions.text && !title) { chart[name] = chart.renderer.text( chartTitleOptions.text, 0, 0, chartTitleOptions.useHTML ) .attr({ align: chartTitleOptions.align, 'class': PREFIX + name, zIndex: chartTitleOptions.zIndex || 4 }) .css(chartTitleOptions.style) .add(); } }); chart.layOutTitles(redraw); }, /** * Lay out the chart titles and cache the full offset height for use in getMargins */ layOutTitles: function (redraw) { var titleOffset = 0, title = this.title, subtitle = this.subtitle, options = this.options, titleOptions = options.title, subtitleOptions = options.subtitle, requiresDirtyBox, renderer = this.renderer, spacingBox = this.spacingBox; if (title) { title .css({ width: (titleOptions.width || spacingBox.width + titleOptions.widthAdjust) + PX }) .align(extend({ y: renderer.fontMetrics(titleOptions.style.fontSize, title).b - 3 }, titleOptions), false, spacingBox); if (!titleOptions.floating && !titleOptions.verticalAlign) { titleOffset = title.getBBox().height; } } if (subtitle) { subtitle .css({ width: (subtitleOptions.width || spacingBox.width + subtitleOptions.widthAdjust) + PX }) .align(extend({ y: titleOffset + (titleOptions.margin - 13) + renderer.fontMetrics(subtitleOptions.style.fontSize, title).b }, subtitleOptions), false, spacingBox); if (!subtitleOptions.floating && !subtitleOptions.verticalAlign) { titleOffset = mathCeil(titleOffset + subtitle.getBBox().height); } } requiresDirtyBox = this.titleOffset !== titleOffset; this.titleOffset = titleOffset; // used in getMargins if (!this.isDirtyBox && requiresDirtyBox) { this.isDirtyBox = requiresDirtyBox; // Redraw if necessary (#2719, #2744) if (this.hasRendered && pick(redraw, true) && this.isDirtyBox) { this.redraw(); } } }, /** * Get chart width and height according to options and container size */ getChartSize: function () { var chart = this, optionsChart = chart.options.chart, widthOption = optionsChart.width, heightOption = optionsChart.height, renderTo = chart.renderToClone || chart.renderTo; // Get inner width and height if (!defined(widthOption)) { chart.containerWidth = getStyle(renderTo, 'width'); } if (!defined(heightOption)) { chart.containerHeight = getStyle(renderTo, 'height'); } chart.chartWidth = mathMax(0, widthOption || chart.containerWidth || 600); // #1393, 1460 chart.chartHeight = mathMax(0, pick(heightOption, // the offsetHeight of an empty container is 0 in standard browsers, but 19 in IE7: chart.containerHeight > 19 ? chart.containerHeight : 400)); }, /** * Create a clone of the chart's renderTo div and place it outside the viewport to allow * size computation on chart.render and chart.redraw */ cloneRenderTo: function (revert) { var clone = this.renderToClone, container = this.container; // Destroy the clone and bring the container back to the real renderTo div if (revert) { if (clone) { while (clone.childNodes.length) { // #5231 this.renderTo.appendChild(clone.firstChild); } discardElement(clone); delete this.renderToClone; } // Set up the clone } else { if (container && container.parentNode === this.renderTo) { this.renderTo.removeChild(container); // do not clone this } this.renderToClone = clone = this.renderTo.cloneNode(0); css(clone, { position: ABSOLUTE, top: '-9999px', display: 'block' // #833 }); if (clone.style.setProperty) { // #2631 clone.style.setProperty('display', 'block', 'important'); } doc.body.appendChild(clone); if (container) { clone.appendChild(container); } } }, /** * Get the containing element, determine the size and create the inner container * div to hold the chart */ getContainer: function () { var chart = this, container, options = chart.options, optionsChart = options.chart, chartWidth, chartHeight, renderTo = chart.renderTo, indexAttrName = 'data-highcharts-chart', oldChartIndex, Ren, containerId = 'highcharts-' + idCounter++; if (!renderTo) { chart.renderTo = renderTo = optionsChart.renderTo; } if (isString(renderTo)) { chart.renderTo = renderTo = doc.getElementById(renderTo); } // Display an error if the renderTo is wrong if (!renderTo) { error(13, true); } // If the container already holds a chart, destroy it. The check for hasRendered is there // because web pages that are saved to disk from the browser, will preserve the data-highcharts-chart // attribute and the SVG contents, but not an interactive chart. So in this case, // charts[oldChartIndex] will point to the wrong chart if any (#2609). oldChartIndex = pInt(attr(renderTo, indexAttrName)); if (isNumber(oldChartIndex) && charts[oldChartIndex] && charts[oldChartIndex].hasRendered) { charts[oldChartIndex].destroy(); } // Make a reference to the chart from the div attr(renderTo, indexAttrName, chart.index); // remove previous chart renderTo.innerHTML = ''; // If the container doesn't have an offsetWidth, it has or is a child of a node // that has display:none. We need to temporarily move it out to a visible // state to determine the size, else the legend and tooltips won't render // properly. The allowClone option is used in sparklines as a micro optimization, // saving about 1-2 ms each chart. if (!optionsChart.skipClone && !renderTo.offsetWidth) { chart.cloneRenderTo(); } // get the width and height chart.getChartSize(); chartWidth = chart.chartWidth; chartHeight = chart.chartHeight; // create the inner container chart.container = container = createElement(DIV, { className: PREFIX + 'container' + (optionsChart.className ? ' ' + optionsChart.className : ''), id: containerId }, extend({ position: RELATIVE, overflow: HIDDEN, // needed for context menu (avoid scrollbars) and // content overflow in IE width: chartWidth + PX, height: chartHeight + PX, textAlign: 'left', lineHeight: 'normal', // #427 zIndex: 0, // #1072 '-webkit-tap-highlight-color': 'rgba(0,0,0,0)' }, optionsChart.style), chart.renderToClone || renderTo ); // cache the cursor (#1650) chart._cursor = container.style.cursor; // Initialize the renderer Ren = Highcharts[optionsChart.renderer] || Renderer; chart.renderer = new Ren( container, chartWidth, chartHeight, optionsChart.style, optionsChart.forExport, options.exporting && options.exporting.allowHTML ); if (useCanVG) { // If we need canvg library, extend and configure the renderer // to get the tracker for translating mouse events chart.renderer.create(chart, container, chartWidth, chartHeight); } // Add a reference to the charts index chart.renderer.chartIndex = chart.index; }, /** * Calculate margins by rendering axis labels in a preliminary position. Title, * subtitle and legend have already been rendered at this stage, but will be * moved into their final positions */ getMargins: function (skipAxes) { var chart = this, spacing = chart.spacing, margin = chart.margin, titleOffset = chart.titleOffset; chart.resetMargins(); // Adjust for title and subtitle if (titleOffset && !defined(margin[0])) { chart.plotTop = mathMax(chart.plotTop, titleOffset + chart.options.title.margin + spacing[0]); } // Adjust for legend if (chart.legend.display) { chart.legend.adjustMargins(margin, spacing); } // adjust for scroller if (chart.extraBottomMargin) { chart.marginBottom += chart.extraBottomMargin; } if (chart.extraTopMargin) { chart.plotTop += chart.extraTopMargin; } if (!skipAxes) { this.getAxisMargins(); } }, getAxisMargins: function () { var chart = this, axisOffset = chart.axisOffset = [0, 0, 0, 0], // top, right, bottom, left margin = chart.margin; // pre-render axes to get labels offset width if (chart.hasCartesianSeries) { each(chart.axes, function (axis) { if (axis.visible) { axis.getOffset(); } }); } // Add the axis offsets each(marginNames, function (m, side) { if (!defined(margin[side])) { chart[m] += axisOffset[side]; } }); chart.setChartSize(); }, /** * Resize the chart to its container if size is not explicitly set */ reflow: function (e) { var chart = this, optionsChart = chart.options.chart, renderTo = chart.renderTo, hasUserWidth = defined(optionsChart.width), width = optionsChart.width || getStyle(renderTo, 'width'), height = optionsChart.height || getStyle(renderTo, 'height'), target = e ? e.target : win; // Width and height checks for display:none. Target is doc in IE8 and Opera, // win in Firefox, Chrome and IE9. if (!hasUserWidth && !chart.isPrinting && width && height && (target === win || target === doc)) { // #1093 if (width !== chart.containerWidth || height !== chart.containerHeight) { clearTimeout(chart.reflowTimeout); // When called from window.resize, e is set, else it's called directly (#2224) chart.reflowTimeout = syncTimeout(function () { if (chart.container) { // It may have been destroyed in the meantime (#1257) chart.setSize(undefined, undefined, false); } }, e ? 100 : 0); } chart.containerWidth = width; chart.containerHeight = height; } }, /** * Add the event handlers necessary for auto resizing */ initReflow: function () { var chart = this, reflow = function (e) { chart.reflow(e); }; addEvent(win, 'resize', reflow); addEvent(chart, 'destroy', function () { removeEvent(win, 'resize', reflow); }); }, /** * Resize the chart to a given width and height * @param {Number} width * @param {Number} height * @param {Object|Boolean} animation */ setSize: function (width, height, animation) { var chart = this, renderer = chart.renderer, globalAnimation; // Handle the isResizing counter chart.isResizing += 1; // set the animation for the current process setAnimation(animation, chart); chart.oldChartHeight = chart.chartHeight; chart.oldChartWidth = chart.chartWidth; if (width !== undefined) { chart.options.chart.width = width; } if (height !== undefined) { chart.options.chart.height = height; } chart.getChartSize(); // Resize the container with the global animation applied if enabled (#2503) globalAnimation = renderer.globalAnimation; (globalAnimation ? animate : css)(chart.container, { width: chart.chartWidth + PX, height: chart.chartHeight + PX }, globalAnimation); chart.setChartSize(true); renderer.setSize(chart.chartWidth, chart.chartHeight, animation); // handle axes chart.maxTicks = null; each(chart.axes, function (axis) { axis.isDirty = true; axis.setScale(); }); // make sure non-cartesian series are also handled each(chart.series, function (serie) { serie.isDirty = true; }); chart.isDirtyLegend = true; // force legend redraw chart.isDirtyBox = true; // force redraw of plot and chart border chart.layOutTitles(); // #2857 chart.getMargins(); chart.redraw(animation); chart.oldChartHeight = null; fireEvent(chart, 'resize'); // Fire endResize and set isResizing back. If animation is disabled, fire without delay syncTimeout(function () { if (chart) { fireEvent(chart, 'endResize', null, function () { chart.isResizing -= 1; }); } }, animObject(globalAnimation).duration); }, /** * Set the public chart properties. This is done before and after the pre-render * to determine margin sizes */ setChartSize: function (skipAxes) { var chart = this, inverted = chart.inverted, renderer = chart.renderer, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, optionsChart = chart.options.chart, spacing = chart.spacing, clipOffset = chart.clipOffset, clipX, clipY, plotLeft, plotTop, plotWidth, plotHeight, plotBorderWidth; chart.plotLeft = plotLeft = mathRound(chart.plotLeft); chart.plotTop = plotTop = mathRound(chart.plotTop); chart.plotWidth = plotWidth = mathMax(0, mathRound(chartWidth - plotLeft - chart.marginRight)); chart.plotHeight = plotHeight = mathMax(0, mathRound(chartHeight - plotTop - chart.marginBottom)); chart.plotSizeX = inverted ? plotHeight : plotWidth; chart.plotSizeY = inverted ? plotWidth : plotHeight; chart.plotBorderWidth = optionsChart.plotBorderWidth || 0; // Set boxes used for alignment chart.spacingBox = renderer.spacingBox = { x: spacing[3], y: spacing[0], width: chartWidth - spacing[3] - spacing[1], height: chartHeight - spacing[0] - spacing[2] }; chart.plotBox = renderer.plotBox = { x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight }; plotBorderWidth = 2 * mathFloor(chart.plotBorderWidth / 2); clipX = mathCeil(mathMax(plotBorderWidth, clipOffset[3]) / 2); clipY = mathCeil(mathMax(plotBorderWidth, clipOffset[0]) / 2); chart.clipBox = { x: clipX, y: clipY, width: mathFloor(chart.plotSizeX - mathMax(plotBorderWidth, clipOffset[1]) / 2 - clipX), height: mathMax(0, mathFloor(chart.plotSizeY - mathMax(plotBorderWidth, clipOffset[2]) / 2 - clipY)) }; if (!skipAxes) { each(chart.axes, function (axis) { axis.setAxisSize(); axis.setAxisTranslation(); }); } }, /** * Initial margins before auto size margins are applied */ resetMargins: function () { var chart = this; each(marginNames, function (m, side) { chart[m] = pick(chart.margin[side], chart.spacing[side]); }); chart.axisOffset = [0, 0, 0, 0]; // top, right, bottom, left chart.clipOffset = [0, 0, 0, 0]; }, /** * Draw the borders and backgrounds for chart and plot area */ drawChartBox: function () { var chart = this, optionsChart = chart.options.chart, renderer = chart.renderer, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, chartBackground = chart.chartBackground, plotBackground = chart.plotBackground, plotBorder = chart.plotBorder, plotBGImage = chart.plotBGImage, chartBorderWidth = optionsChart.borderWidth || 0, chartBackgroundColor = optionsChart.backgroundColor, plotBackgroundColor = optionsChart.plotBackgroundColor, plotBackgroundImage = optionsChart.plotBackgroundImage, plotBorderWidth = optionsChart.plotBorderWidth || 0, mgn, bgAttr, plotLeft = chart.plotLeft, plotTop = chart.plotTop, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, plotBox = chart.plotBox, clipRect = chart.clipRect, clipBox = chart.clipBox; // Chart area mgn = chartBorderWidth + (optionsChart.shadow ? 8 : 0); if (chartBorderWidth || chartBackgroundColor) { if (!chartBackground) { bgAttr = { fill: chartBackgroundColor || NONE }; if (chartBorderWidth) { // #980 bgAttr.stroke = optionsChart.borderColor; bgAttr['stroke-width'] = chartBorderWidth; } chart.chartBackground = renderer.rect(mgn / 2, mgn / 2, chartWidth - mgn, chartHeight - mgn, optionsChart.borderRadius, chartBorderWidth) .attr(bgAttr) .addClass(PREFIX + 'background') .add() .shadow(optionsChart.shadow); } else { // resize chartBackground.animate( chartBackground.crisp({ width: chartWidth - mgn, height: chartHeight - mgn }) ); } } // Plot background if (plotBackgroundColor) { if (!plotBackground) { chart.plotBackground = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0) .attr({ fill: plotBackgroundColor }) .add() .shadow(optionsChart.plotShadow); } else { plotBackground.animate(plotBox); } } if (plotBackgroundImage) { if (!plotBGImage) { chart.plotBGImage = renderer.image(plotBackgroundImage, plotLeft, plotTop, plotWidth, plotHeight) .add(); } else { plotBGImage.animate(plotBox); } } // Plot clip if (!clipRect) { chart.clipRect = renderer.clipRect(clipBox); } else { clipRect.animate({ width: clipBox.width, height: clipBox.height }); } // Plot area border if (plotBorderWidth) { if (!plotBorder) { chart.plotBorder = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0, -plotBorderWidth) .attr({ stroke: optionsChart.plotBorderColor, 'stroke-width': plotBorderWidth, fill: NONE, zIndex: 1 }) .add(); } else { plotBorder.strokeWidth = -plotBorderWidth; plotBorder.animate( plotBorder.crisp({ x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight }) //#3282 plotBorder should be negative ); } } // reset chart.isDirtyBox = false; }, /** * Detect whether a certain chart property is needed based on inspecting its options * and series. This mainly applies to the chart.invert property, and in extensions to * the chart.angular and chart.polar properties. */ propFromSeries: function () { var chart = this, optionsChart = chart.options.chart, klass, seriesOptions = chart.options.series, i, value; each(['inverted', 'angular', 'polar'], function (key) { // The default series type's class klass = seriesTypes[optionsChart.type || optionsChart.defaultSeriesType]; // Get the value from available chart-wide properties value = ( chart[key] || // 1. it is set before optionsChart[key] || // 2. it is set in the options (klass && klass.prototype[key]) // 3. it's default series class requires it ); // 4. Check if any the chart's series require it i = seriesOptions && seriesOptions.length; while (!value && i--) { klass = seriesTypes[seriesOptions[i].type]; if (klass && klass.prototype[key]) { value = true; } } // Set the chart property chart[key] = value; }); }, /** * Link two or more series together. This is done initially from Chart.render, * and after Chart.addSeries and Series.remove. */ linkSeries: function () { var chart = this, chartSeries = chart.series; // Reset links each(chartSeries, function (series) { series.linkedSeries.length = 0; }); // Apply new links each(chartSeries, function (series) { var linkedTo = series.options.linkedTo; if (isString(linkedTo)) { if (linkedTo === ':previous') { linkedTo = chart.series[series.index - 1]; } else { linkedTo = chart.get(linkedTo); } if (linkedTo && linkedTo.linkedParent !== series) { // #3341 avoid mutual linking linkedTo.linkedSeries.push(series); series.linkedParent = linkedTo; series.visible = pick(series.options.visible, linkedTo.options.visible, series.visible); // #3879 } } }); }, /** * Render series for the chart */ renderSeries: function () { each(this.series, function (serie) { serie.translate(); serie.render(); }); }, /** * Render labels for the chart */ renderLabels: function () { var chart = this, labels = chart.options.labels; if (labels.items) { each(labels.items, function (label) { var style = extend(labels.style, label.style), x = pInt(style.left) + chart.plotLeft, y = pInt(style.top) + chart.plotTop + 12; // delete to prevent rewriting in IE delete style.left; delete style.top; chart.renderer.text( label.html, x, y ) .attr({ zIndex: 2 }) .css(style) .add(); }); } }, /** * Render all graphics for the chart */ render: function () { var chart = this, axes = chart.axes, renderer = chart.renderer, options = chart.options, tempWidth, tempHeight, redoHorizontal, redoVertical; // Title chart.setTitle(); // Legend chart.legend = new Legend(chart, options.legend); // Get stacks if (chart.getStacks) { chart.getStacks(); } // Get chart margins chart.getMargins(true); chart.setChartSize(); // Record preliminary dimensions for later comparison tempWidth = chart.plotWidth; tempHeight = chart.plotHeight = chart.plotHeight - 21; // 21 is the most common correction for X axis labels // Get margins by pre-rendering axes each(axes, function (axis) { axis.setScale(); }); chart.getAxisMargins(); // If the plot area size has changed significantly, calculate tick positions again redoHorizontal = tempWidth / chart.plotWidth > 1.1; redoVertical = tempHeight / chart.plotHeight > 1.05; // Height is more sensitive if (redoHorizontal || redoVertical) { chart.maxTicks = null; // reset for second pass each(axes, function (axis) { if ((axis.horiz && redoHorizontal) || (!axis.horiz && redoVertical)) { axis.setTickInterval(true); // update to reflect the new margins } }); chart.getMargins(); // second pass to check for new labels } // Draw the borders and backgrounds chart.drawChartBox(); // Axes if (chart.hasCartesianSeries) { each(axes, function (axis) { if (axis.visible) { axis.render(); } }); } // The series if (!chart.seriesGroup) { chart.seriesGroup = renderer.g('series-group') .attr({ zIndex: 3 }) .add(); } chart.renderSeries(); // Labels chart.renderLabels(); // Credits chart.showCredits(options.credits); // Set flag chart.hasRendered = true; }, /** * Show chart credits based on config options */ showCredits: function (credits) { if (credits.enabled && !this.credits) { this.credits = this.renderer.text( credits.text, 0, 0 ) .on('click', function () { if (credits.href) { win.location.href = credits.href; } }) .attr({ align: credits.position.align, zIndex: 8 }) .css(credits.style) .add() .align(credits.position); } }, /** * Clean up memory usage */ destroy: function () { var chart = this, axes = chart.axes, series = chart.series, container = chart.container, i, parentNode = container && container.parentNode; // fire the chart.destoy event fireEvent(chart, 'destroy'); // Delete the chart from charts lookup array charts[chart.index] = UNDEFINED; chartCount--; chart.renderTo.removeAttribute('data-highcharts-chart'); // remove events removeEvent(chart); // ==== Destroy collections: // Destroy axes i = axes.length; while (i--) { axes[i] = axes[i].destroy(); } // Destroy each series i = series.length; while (i--) { series[i] = series[i].destroy(); } // ==== Destroy chart properties: each(['title', 'subtitle', 'chartBackground', 'plotBackground', 'plotBGImage', 'plotBorder', 'seriesGroup', 'clipRect', 'credits', 'pointer', 'scroller', 'rangeSelector', 'legend', 'resetZoomButton', 'tooltip', 'renderer'], function (name) { var prop = chart[name]; if (prop && prop.destroy) { chart[name] = prop.destroy(); } }); // remove container and all SVG if (container) { // can break in IE when destroyed before finished loading container.innerHTML = ''; removeEvent(container); if (parentNode) { discardElement(container); } } // clean it all up for (i in chart) { delete chart[i]; } }, /** * VML namespaces can't be added until after complete. Listening * for Perini's doScroll hack is not enough. */ isReadyToRender: function () { var chart = this; // Note: win == win.top is required if ((!hasSVG && (win == win.top && doc.readyState !== 'complete')) || (useCanVG && !win.canvg)) { // eslint-disable-line eqeqeq if (useCanVG) { // Delay rendering until canvg library is downloaded and ready CanVGController.push(function () { chart.firstRender(); }, chart.options.global.canvasToolsURL); } else { doc.attachEvent('onreadystatechange', function () { doc.detachEvent('onreadystatechange', chart.firstRender); if (doc.readyState === 'complete') { chart.firstRender(); } }); } return false; } return true; }, /** * Prepare for first rendering after all data are loaded */ firstRender: function () { var chart = this, options = chart.options; // Check whether the chart is ready to render if (!chart.isReadyToRender()) { return; } // Create the container chart.getContainer(); // Run an early event after the container and renderer are established fireEvent(chart, 'init'); chart.resetMargins(); chart.setChartSize(); // Set the common chart properties (mainly invert) from the given series chart.propFromSeries(); // get axes chart.getAxes(); // Initialize the series each(options.series || [], function (serieOptions) { chart.initSeries(serieOptions); }); chart.linkSeries(); // Run an event after axes and series are initialized, but before render. At this stage, // the series data is indexed and cached in the xData and yData arrays, so we can access // those before rendering. Used in Highstock. fireEvent(chart, 'beforeRender'); // depends on inverted and on margins being set if (Highcharts.Pointer) { chart.pointer = new Pointer(chart, options); } chart.render(); // add canvas chart.renderer.draw(); // Fire the load event if there are no external images if (!chart.renderer.imgCount && chart.onload) { chart.onload(); } // If the chart was rendered outside the top container, put it back in (#3679) chart.cloneRenderTo(true); }, /** * On chart load */ onload: function () { var chart = this; // Run callbacks each([this.callback].concat(this.callbacks), function (fn) { if (fn && chart.index !== undefined) { // Chart destroyed in its own callback (#3600) fn.apply(chart, [chart]); } }); fireEvent(chart, 'load'); // Don't run again this.onload = null; }, /** * Creates arrays for spacing and margin from given options. */ splashArray: function (target, options) { var oVar = options[target], tArray = isObject(oVar) ? oVar : [oVar, oVar, oVar, oVar]; return [pick(options[target + 'Top'], tArray[0]), pick(options[target + 'Right'], tArray[1]), pick(options[target + 'Bottom'], tArray[2]), pick(options[target + 'Left'], tArray[3])]; } }; // end Chart var CenteredSeriesMixin = Highcharts.CenteredSeriesMixin = { /** * Get the center of the pie based on the size and center options relative to the * plot area. Borrowed by the polar and gauge series types. */ getCenter: function () { var options = this.options, chart = this.chart, slicingRoom = 2 * (options.slicedOffset || 0), handleSlicingRoom, plotWidth = chart.plotWidth - 2 * slicingRoom, plotHeight = chart.plotHeight - 2 * slicingRoom, centerOption = options.center, positions = [pick(centerOption[0], '50%'), pick(centerOption[1], '50%'), options.size || '100%', options.innerSize || 0], smallestSize = mathMin(plotWidth, plotHeight), i, value; for (i = 0; i < 4; ++i) { value = positions[i]; handleSlicingRoom = i < 2 || (i === 2 && /%$/.test(value)); // i == 0: centerX, relative to width // i == 1: centerY, relative to height // i == 2: size, relative to smallestSize // i == 3: innerSize, relative to size positions[i] = relativeLength(value, [plotWidth, plotHeight, smallestSize, positions[2]][i]) + (handleSlicingRoom ? slicingRoom : 0); } // innerSize cannot be larger than size (#3632) if (positions[3] > positions[2]) { positions[3] = positions[2]; } return positions; } }; /** * The Point object and prototype. Inheritable and used as base for PiePoint */ var Point = function () {}; Point.prototype = { /** * Initialize the point * @param {Object} series The series object containing this point * @param {Object} options The data in either number, array or object format */ init: function (series, options, x) { var point = this, colors; point.series = series; point.color = series.color; // #3445 point.applyOptions(options, x); point.pointAttr = {}; if (series.options.colorByPoint) { colors = series.options.colors || series.chart.options.colors; point.color = point.color || colors[series.colorCounter++]; // loop back to zero if (series.colorCounter === colors.length) { series.colorCounter = 0; } } series.chart.pointCount++; return point; }, /** * Apply the options containing the x and y data and possible some extra properties. * This is called on point init or from point.update. * * @param {Object} options */ applyOptions: function (options, x) { var point = this, series = point.series, pointValKey = series.options.pointValKey || series.pointValKey; options = Point.prototype.optionsToObject.call(this, options); // copy options directly to point extend(point, options); point.options = point.options ? extend(point.options, options) : options; // Since options are copied into the Point instance, some accidental options must be shielded (#5681) if (options.group) { delete point.group; } // For higher dimension series types. For instance, for ranges, point.y is mapped to point.low. if (pointValKey) { point.y = point[pointValKey]; } point.isNull = pick( point.isValid && !point.isValid(), point.x === null || !isNumber(point.y, true) ); // #3571, check for NaN // If no x is set by now, get auto incremented value. All points must have an // x value, however the y value can be null to create a gap in the series if ('name' in point && x === undefined && series.xAxis && series.xAxis.hasNames) { point.x = series.xAxis.nameToX(point); } if (point.x === undefined && series) { if (x === undefined) { point.x = series.autoIncrement(point); } else { point.x = x; } } return point; }, /** * Transform number or array configs into objects */ optionsToObject: function (options) { var ret = {}, series = this.series, keys = series.options.keys, pointArrayMap = keys || series.pointArrayMap || ['y'], valueCount = pointArrayMap.length, firstItemType, i = 0, j = 0; if (isNumber(options) || options === null) { ret[pointArrayMap[0]] = options; } else if (isArray(options)) { // with leading x value if (!keys && options.length > valueCount) { firstItemType = typeof options[0]; if (firstItemType === 'string') { ret.name = options[0]; } else if (firstItemType === 'number') { ret.x = options[0]; } i++; } while (j < valueCount) { if (!keys || options[i] !== undefined) { // Skip undefined positions for keys ret[pointArrayMap[j]] = options[i]; } i++; j++; } } else if (typeof options === 'object') { ret = options; // This is the fastest way to detect if there are individual point dataLabels that need // to be considered in drawDataLabels. These can only occur in object configs. if (options.dataLabels) { series._hasPointLabels = true; } // Same approach as above for markers if (options.marker) { series._hasPointMarkers = true; } } return ret; }, /** * Destroy a point to clear memory. Its reference still stays in series.data. */ destroy: function () { var point = this, series = point.series, chart = series.chart, hoverPoints = chart.hoverPoints, prop; chart.pointCount--; if (hoverPoints) { point.setState(); erase(hoverPoints, point); if (!hoverPoints.length) { chart.hoverPoints = null; } } if (point === chart.hoverPoint) { point.onMouseOut(); } // remove all events if (point.graphic || point.dataLabel) { // removeEvent and destroyElements are performance expensive removeEvent(point); point.destroyElements(); } if (point.legendItem) { // pies have legend items chart.legend.destroyItem(point); } for (prop in point) { point[prop] = null; } }, /** * Destroy SVG elements associated with the point */ destroyElements: function () { var point = this, props = ['graphic', 'dataLabel', 'dataLabelUpper', 'connector', 'shadowGroup'], prop, i = 6; while (i--) { prop = props[i]; if (point[prop]) { point[prop] = point[prop].destroy(); } } }, /** * Return the configuration hash needed for the data label and tooltip formatters */ getLabelConfig: function () { return { x: this.category, y: this.y, color: this.color, key: this.name || this.category, series: this.series, point: this, percentage: this.percentage, total: this.total || this.stackTotal }; }, /** * Extendable method for formatting each point's tooltip line * * @return {String} A string to be concatenated in to the common tooltip text */ tooltipFormatter: function (pointFormat) { // Insert options for valueDecimals, valuePrefix, and valueSuffix var series = this.series, seriesTooltipOptions = series.tooltipOptions, valueDecimals = pick(seriesTooltipOptions.valueDecimals, ''), valuePrefix = seriesTooltipOptions.valuePrefix || '', valueSuffix = seriesTooltipOptions.valueSuffix || ''; // Loop over the point array map and replace unformatted values with sprintf formatting markup each(series.pointArrayMap || ['y'], function (key) { key = '{point.' + key; // without the closing bracket if (valuePrefix || valueSuffix) { pointFormat = pointFormat.replace(key + '}', valuePrefix + key + '}' + valueSuffix); } pointFormat = pointFormat.replace(key + '}', key + ':,.' + valueDecimals + 'f}'); }); return format(pointFormat, { point: this, series: this.series }); }, /** * Fire an event on the Point object. * @param {String} eventType * @param {Object} eventArgs Additional event arguments * @param {Function} defaultFunction Default event handler */ firePointEvent: function (eventType, eventArgs, defaultFunction) { var point = this, series = this.series, seriesOptions = series.options; // load event handlers on demand to save time on mouseover/out if (seriesOptions.point.events[eventType] || (point.options && point.options.events && point.options.events[eventType])) { this.importEvents(); } // add default handler if in selection mode if (eventType === 'click' && seriesOptions.allowPointSelect) { defaultFunction = function (event) { // Control key is for Windows, meta (= Cmd key) for Mac, Shift for Opera if (point.select) { // Could be destroyed by prior event handlers (#2911) point.select(null, event.ctrlKey || event.metaKey || event.shiftKey); } }; } fireEvent(this, eventType, eventArgs, defaultFunction); }, visible: true }; /** * @classDescription The base function which all other series types inherit from. The data in the series is stored * in various arrays. * * - First, series.options.data contains all the original config options for * each point whether added by options or methods like series.addPoint. * - Next, series.data contains those values converted to points, but in case the series data length * exceeds the cropThreshold, or if the data is grouped, series.data doesn't contain all the points. It * only contains the points that have been created on demand. * - Then there's series.points that contains all currently visible point objects. In case of cropping, * the cropped-away points are not part of this array. The series.points array starts at series.cropStart * compared to series.data and series.options.data. If however the series data is grouped, these can't * be correlated one to one. * - series.xData and series.processedXData contain clean x values, equivalent to series.data and series.points. * - series.yData and series.processedYData contain clean x values, equivalent to series.data and series.points. * * @param {Object} chart * @param {Object} options */ var Series = Highcharts.Series = function () {}; Series.prototype = { isCartesian: true, type: 'line', pointClass: Point, sorted: true, // requires the data to be sorted requireSorting: true, pointAttrToOptions: { // mapping between SVG attributes and the corresponding options stroke: 'lineColor', 'stroke-width': 'lineWidth', fill: 'fillColor', r: 'radius' }, directTouch: false, axisTypes: ['xAxis', 'yAxis'], colorCounter: 0, parallelArrays: ['x', 'y'], // each point's x and y values are stored in this.xData and this.yData init: function (chart, options) { var series = this, eventType, events, chartSeries = chart.series, sortByIndex = function (a, b) { return pick(a.options.index, a._i) - pick(b.options.index, b._i); }; series.chart = chart; series.options = options = series.setOptions(options); // merge with plotOptions series.linkedSeries = []; // bind the axes series.bindAxes(); // set some variables extend(series, { name: options.name, state: NORMAL_STATE, pointAttr: {}, visible: options.visible !== false, // true by default selected: options.selected === true // false by default }); // special if (useCanVG) { options.animation = false; } // register event listeners events = options.events; for (eventType in events) { addEvent(series, eventType, events[eventType]); } if ( (events && events.click) || (options.point && options.point.events && options.point.events.click) || options.allowPointSelect ) { chart.runTrackerClick = true; } series.getColor(); series.getSymbol(); // Set the data each(series.parallelArrays, function (key) { series[key + 'Data'] = []; }); series.setData(options.data, false); // Mark cartesian if (series.isCartesian) { chart.hasCartesianSeries = true; } // Register it in the chart chartSeries.push(series); series._i = chartSeries.length - 1; // Sort series according to index option (#248, #1123, #2456) stableSort(chartSeries, sortByIndex); if (this.yAxis) { stableSort(this.yAxis.series, sortByIndex); } each(chartSeries, function (series, i) { series.index = i; series.name = series.name || 'Series ' + (i + 1); }); }, /** * Set the xAxis and yAxis properties of cartesian series, and register the series * in the axis.series array */ bindAxes: function () { var series = this, seriesOptions = series.options, chart = series.chart, axisOptions; each(series.axisTypes || [], function (AXIS) { // repeat for xAxis and yAxis each(chart[AXIS], function (axis) { // loop through the chart's axis objects axisOptions = axis.options; // apply if the series xAxis or yAxis option mathches the number of the // axis, or if undefined, use the first axis if ((seriesOptions[AXIS] === axisOptions.index) || (seriesOptions[AXIS] !== UNDEFINED && seriesOptions[AXIS] === axisOptions.id) || (seriesOptions[AXIS] === UNDEFINED && axisOptions.index === 0)) { // register this series in the axis.series lookup axis.series.push(series); // set this series.xAxis or series.yAxis reference series[AXIS] = axis; // mark dirty for redraw axis.isDirty = true; } }); // The series needs an X and an Y axis if (!series[AXIS] && series.optionalAxis !== AXIS) { error(18, true); } }); }, /** * For simple series types like line and column, the data values are held in arrays like * xData and yData for quick lookup to find extremes and more. For multidimensional series * like bubble and map, this can be extended with arrays like zData and valueData by * adding to the series.parallelArrays array. */ updateParallelArrays: function (point, i) { var series = point.series, args = arguments, fn = isNumber(i) ? // Insert the value in the given position function (key) { var val = key === 'y' && series.toYData ? series.toYData(point) : point[key]; series[key + 'Data'][i] = val; } : // Apply the method specified in i with the following arguments as arguments function (key) { Array.prototype[i].apply(series[key + 'Data'], Array.prototype.slice.call(args, 2)); }; each(series.parallelArrays, fn); }, /** * Return an auto incremented x value based on the pointStart and pointInterval options. * This is only used if an x value is not given for the point that calls autoIncrement. */ autoIncrement: function () { var options = this.options, xIncrement = this.xIncrement, date, pointInterval, pointIntervalUnit = options.pointIntervalUnit; xIncrement = pick(xIncrement, options.pointStart, 0); this.pointInterval = pointInterval = pick(this.pointInterval, options.pointInterval, 1); // Added code for pointInterval strings if (pointIntervalUnit) { date = new Date(xIncrement); if (pointIntervalUnit === 'day') { date = +date[setDate](date[getDate]() + pointInterval); } else if (pointIntervalUnit === 'month') { date = +date[setMonth](date[getMonth]() + pointInterval); } else if (pointIntervalUnit === 'year') { date = +date[setFullYear](date[getFullYear]() + pointInterval); } pointInterval = date - xIncrement; } this.xIncrement = xIncrement + pointInterval; return xIncrement; }, /** * Set the series options by merging from the options tree * @param {Object} itemOptions */ setOptions: function (itemOptions) { var chart = this.chart, chartOptions = chart.options, plotOptions = chartOptions.plotOptions, userOptions = chart.userOptions || {}, userPlotOptions = userOptions.plotOptions || {}, typeOptions = plotOptions[this.type], options, zones; this.userOptions = itemOptions; // General series options take precedence over type options because otherwise, default // type options like column.animation would be overwritten by the general option. // But issues have been raised here (#3881), and the solution may be to distinguish // between default option and userOptions like in the tooltip below. options = merge( typeOptions, plotOptions.series, itemOptions ); // The tooltip options are merged between global and series specific options this.tooltipOptions = merge( defaultOptions.tooltip, defaultOptions.plotOptions[this.type].tooltip, userOptions.tooltip, userPlotOptions.series && userPlotOptions.series.tooltip, userPlotOptions[this.type] && userPlotOptions[this.type].tooltip, itemOptions.tooltip ); // Delete marker object if not allowed (#1125) if (typeOptions.marker === null) { delete options.marker; } // Handle color zones this.zoneAxis = options.zoneAxis; zones = this.zones = (options.zones || []).slice(); if ((options.negativeColor || options.negativeFillColor) && !options.zones) { zones.push({ value: options[this.zoneAxis + 'Threshold'] || options.threshold || 0, color: options.negativeColor, fillColor: options.negativeFillColor }); } if (zones.length) { // Push one extra zone for the rest if (defined(zones[zones.length - 1].value)) { zones.push({ color: this.color, fillColor: this.fillColor }); } } return options; }, getCyclic: function (prop, value, defaults) { var i, userOptions = this.userOptions, indexName = '_' + prop + 'Index', counterName = prop + 'Counter'; if (!value) { if (defined(userOptions[indexName])) { // after Series.update() i = userOptions[indexName]; } else { userOptions[indexName] = i = this.chart[counterName] % defaults.length; this.chart[counterName] += 1; } value = defaults[i]; } this[prop] = value; }, /** * Get the series' color */ getColor: function () { if (this.options.colorByPoint) { this.options.color = null; // #4359, selected slice got series.color even when colorByPoint was set. } else { this.getCyclic('color', this.options.color || defaultPlotOptions[this.type].color, this.chart.options.colors); } }, /** * Get the series' symbol */ getSymbol: function () { var seriesMarkerOption = this.options.marker; this.getCyclic('symbol', seriesMarkerOption.symbol, this.chart.options.symbols); // don't substract radius in image symbols (#604) if (/^url/.test(this.symbol)) { seriesMarkerOption.radius = 0; } }, drawLegendSymbol: LegendSymbolMixin.drawLineMarker, /** * Replace the series data with a new set of data * @param {Object} data * @param {Object} redraw */ setData: function (data, redraw, animation, updatePoints) { var series = this, oldData = series.points, oldDataLength = (oldData && oldData.length) || 0, dataLength, options = series.options, chart = series.chart, firstPoint = null, xAxis = series.xAxis, i, turboThreshold = options.turboThreshold, pt, xData = this.xData, yData = this.yData, pointArrayMap = series.pointArrayMap, valueCount = pointArrayMap && pointArrayMap.length; data = data || []; dataLength = data.length; redraw = pick(redraw, true); // If the point count is the same as is was, just run Point.update which is // cheaper, allows animation, and keeps references to points. if (updatePoints !== false && dataLength && oldDataLength === dataLength && !series.cropped && !series.hasGroupedData && series.visible) { each(data, function (point, i) { // .update doesn't exist on a linked, hidden series (#3709) if (oldData[i].update && point !== options.data[i]) { oldData[i].update(point, false, null, false); } }); } else { // Reset properties series.xIncrement = null; series.colorCounter = 0; // for series with colorByPoint (#1547) // Update parallel arrays each(this.parallelArrays, function (key) { series[key + 'Data'].length = 0; }); // In turbo mode, only one- or twodimensional arrays of numbers are allowed. The // first value is tested, and we assume that all the rest are defined the same // way. Although the 'for' loops are similar, they are repeated inside each // if-else conditional for max performance. if (turboThreshold && dataLength > turboThreshold) { // find the first non-null point i = 0; while (firstPoint === null && i < dataLength) { firstPoint = data[i]; i++; } if (isNumber(firstPoint)) { // assume all points are numbers for (i = 0; i < dataLength; i++) { xData[i] = this.autoIncrement(); yData[i] = data[i]; } } else if (isArray(firstPoint)) { // assume all points are arrays if (valueCount) { // [x, low, high] or [x, o, h, l, c] for (i = 0; i < dataLength; i++) { pt = data[i]; xData[i] = pt[0]; yData[i] = pt.slice(1, valueCount + 1); } } else { // [x, y] for (i = 0; i < dataLength; i++) { pt = data[i]; xData[i] = pt[0]; yData[i] = pt[1]; } } } else { error(12); // Highcharts expects configs to be numbers or arrays in turbo mode } } else { for (i = 0; i < dataLength; i++) { if (data[i] !== UNDEFINED) { // stray commas in oldIE pt = { series: series }; series.pointClass.prototype.applyOptions.apply(pt, [data[i]]); series.updateParallelArrays(pt, i); } } } // Forgetting to cast strings to numbers is a common caveat when handling CSV or JSON if (isString(yData[0])) { error(14, true); } series.data = []; series.options.data = series.userOptions.data = data; // destroy old points i = oldDataLength; while (i--) { if (oldData[i] && oldData[i].destroy) { oldData[i].destroy(); } } // reset minRange (#878) if (xAxis) { xAxis.minRange = xAxis.userMinRange; } // redraw series.isDirty = series.isDirtyData = chart.isDirtyBox = true; animation = false; } // Typically for pie series, points need to be processed and generated // prior to rendering the legend if (options.legendType === 'point') { this.processData(); this.generatePoints(); } if (redraw) { chart.redraw(animation); } }, /** * Process the data by cropping away unused data points if the series is longer * than the crop threshold. This saves computing time for lage series. */ processData: function (force) { var series = this, processedXData = series.xData, // copied during slice operation below processedYData = series.yData, dataLength = processedXData.length, croppedData, cropStart = 0, cropped, distance, closestPointRange, xAxis = series.xAxis, i, // loop variable options = series.options, cropThreshold = options.cropThreshold, getExtremesFromAll = series.getExtremesFromAll || options.getExtremesFromAll, // #4599 isCartesian = series.isCartesian, xExtremes, val2lin = xAxis && xAxis.val2lin, isLog = xAxis && xAxis.isLog, min, max; // If the series data or axes haven't changed, don't go through this. Return false to pass // the message on to override methods like in data grouping. if (isCartesian && !series.isDirty && !xAxis.isDirty && !series.yAxis.isDirty && !force) { return false; } if (xAxis) { xExtremes = xAxis.getExtremes(); // corrected for log axis (#3053) min = xExtremes.min; max = xExtremes.max; } // optionally filter out points outside the plot area if (isCartesian && series.sorted && !getExtremesFromAll && (!cropThreshold || dataLength > cropThreshold || series.forceCrop)) { // it's outside current extremes if (processedXData[dataLength - 1] < min || processedXData[0] > max) { processedXData = []; processedYData = []; // only crop if it's actually spilling out } else if (processedXData[0] < min || processedXData[dataLength - 1] > max) { croppedData = this.cropData(series.xData, series.yData, min, max); processedXData = croppedData.xData; processedYData = croppedData.yData; cropStart = croppedData.start; cropped = true; } } // Find the closest distance between processed points i = processedXData.length || 1; while (--i) { distance = isLog ? val2lin(processedXData[i]) - val2lin(processedXData[i - 1]) : processedXData[i] - processedXData[i - 1]; if (distance > 0 && (closestPointRange === UNDEFINED || distance < closestPointRange)) { closestPointRange = distance; // Unsorted data is not supported by the line tooltip, as well as data grouping and // navigation in Stock charts (#725) and width calculation of columns (#1900) } else if (distance < 0 && series.requireSorting) { error(15); } } // Record the properties series.cropped = cropped; // undefined or true series.cropStart = cropStart; series.processedXData = processedXData; series.processedYData = processedYData; series.closestPointRange = closestPointRange; }, /** * Iterate over xData and crop values between min and max. Returns object containing crop start/end * cropped xData with corresponding part of yData, dataMin and dataMax within the cropped range */ cropData: function (xData, yData, min, max) { var dataLength = xData.length, cropStart = 0, cropEnd = dataLength, cropShoulder = pick(this.cropShoulder, 1), // line-type series need one point outside i, j; // iterate up to find slice start for (i = 0; i < dataLength; i++) { if (xData[i] >= min) { cropStart = mathMax(0, i - cropShoulder); break; } } // proceed to find slice end for (j = i; j < dataLength; j++) { if (xData[j] > max) { cropEnd = j + cropShoulder; break; } } return { xData: xData.slice(cropStart, cropEnd), yData: yData.slice(cropStart, cropEnd), start: cropStart, end: cropEnd }; }, /** * Generate the data point after the data has been processed by cropping away * unused points and optionally grouped in Highcharts Stock. */ generatePoints: function () { var series = this, options = series.options, dataOptions = options.data, data = series.data, dataLength, processedXData = series.processedXData, processedYData = series.processedYData, pointClass = series.pointClass, processedDataLength = processedXData.length, cropStart = series.cropStart || 0, cursor, hasGroupedData = series.hasGroupedData, point, points = [], i; if (!data && !hasGroupedData) { var arr = []; arr.length = dataOptions.length; data = series.data = arr; } for (i = 0; i < processedDataLength; i++) { cursor = cropStart + i; if (!hasGroupedData) { if (data[cursor]) { point = data[cursor]; } else if (dataOptions[cursor] !== UNDEFINED) { // #970 data[cursor] = point = (new pointClass()).init(series, dataOptions[cursor], processedXData[i]); } points[i] = point; } else { // splat the y data in case of ohlc data array points[i] = (new pointClass()).init(series, [processedXData[i]].concat(splat(processedYData[i]))); points[i].dataGroup = series.groupMap[i]; } points[i].index = cursor; // For faster access in Point.update } // Hide cropped-away points - this only runs when the number of points is above cropThreshold, or when // swithching view from non-grouped data to grouped data (#637) if (data && (processedDataLength !== (dataLength = data.length) || hasGroupedData)) { for (i = 0; i < dataLength; i++) { if (i === cropStart && !hasGroupedData) { // when has grouped data, clear all points i += processedDataLength; } if (data[i]) { data[i].destroyElements(); data[i].plotX = UNDEFINED; // #1003 } } } series.data = data; series.points = points; }, /** * Calculate Y extremes for visible data */ getExtremes: function (yData) { var xAxis = this.xAxis, yAxis = this.yAxis, xData = this.processedXData, yDataLength, activeYData = [], activeCounter = 0, xExtremes = xAxis.getExtremes(), // #2117, need to compensate for log X axis xMin = xExtremes.min, xMax = xExtremes.max, validValue, withinRange, x, y, i, j; yData = yData || this.stackedYData || this.processedYData || []; yDataLength = yData.length; for (i = 0; i < yDataLength; i++) { x = xData[i]; y = yData[i]; // For points within the visible range, including the first point outside the // visible range, consider y extremes validValue = (isNumber(y, true) || isArray(y)) && (!yAxis.isLog || (y.length || y > 0)); withinRange = this.getExtremesFromAll || this.options.getExtremesFromAll || this.cropped || ((xData[i + 1] || x) >= xMin && (xData[i - 1] || x) <= xMax); if (validValue && withinRange) { j = y.length; if (j) { // array, like ohlc or range data while (j--) { if (y[j] !== null) { activeYData[activeCounter++] = y[j]; } } } else { activeYData[activeCounter++] = y; } } } this.dataMin = arrayMin(activeYData); this.dataMax = arrayMax(activeYData); }, /** * Translate data points from raw data values to chart specific positioning data * needed later in drawPoints, drawGraph and drawTracker. */ translate: function () { if (!this.processedXData) { // hidden series this.processData(); } this.generatePoints(); var series = this, options = series.options, stacking = options.stacking, xAxis = series.xAxis, categories = xAxis.categories, yAxis = series.yAxis, points = series.points, dataLength = points.length, hasModifyValue = !!series.modifyValue, i, pointPlacement = options.pointPlacement, dynamicallyPlaced = pointPlacement === 'between' || isNumber(pointPlacement), threshold = options.threshold, stackThreshold = options.startFromThreshold ? threshold : 0, plotX, plotY, lastPlotX, stackIndicator, closestPointRangePx = Number.MAX_VALUE; // Translate each point for (i = 0; i < dataLength; i++) { var point = points[i], xValue = point.x, yValue = point.y, yBottom = point.low, stack = stacking && yAxis.stacks[(series.negStacks && yValue < (stackThreshold ? 0 : threshold) ? '-' : '') + series.stackKey], pointStack, stackValues; // Discard disallowed y values for log axes (#3434) if (yAxis.isLog && yValue !== null && yValue <= 0) { point.isNull = true; } // Get the plotX translation point.plotX = plotX = correctFloat( // #5236 mathMin(mathMax(-1e5, xAxis.translate(xValue, 0, 0, 0, 1, pointPlacement, this.type === 'flags')), 1e5) // #3923 ); // Calculate the bottom y value for stacked series if (stacking && series.visible && !point.isNull && stack && stack[xValue]) { stackIndicator = series.getStackIndicator(stackIndicator, xValue, series.index); pointStack = stack[xValue]; stackValues = pointStack.points[stackIndicator.key]; yBottom = stackValues[0]; yValue = stackValues[1]; if (yBottom === stackThreshold && stackIndicator.key === stack[xValue].base) { yBottom = pick(threshold, yAxis.min); } if (yAxis.isLog && yBottom <= 0) { // #1200, #1232 yBottom = null; } point.total = point.stackTotal = pointStack.total; point.percentage = pointStack.total && (point.y / pointStack.total * 100); point.stackY = yValue; // Place the stack label pointStack.setOffset(series.pointXOffset || 0, series.barW || 0); } // Set translated yBottom or remove it point.yBottom = defined(yBottom) ? yAxis.translate(yBottom, 0, 1, 0, 1) : null; // general hook, used for Highstock compare mode if (hasModifyValue) { yValue = series.modifyValue(yValue, point); } // Set the the plotY value, reset it for redraws point.plotY = plotY = (typeof yValue === 'number' && yValue !== Infinity) ? mathMin(mathMax(-1e5, yAxis.translate(yValue, 0, 1, 0, 1)), 1e5) : // #3201 UNDEFINED; point.isInside = plotY !== UNDEFINED && plotY >= 0 && plotY <= yAxis.len && // #3519 plotX >= 0 && plotX <= xAxis.len; // Set client related positions for mouse tracking point.clientX = dynamicallyPlaced ? correctFloat(xAxis.translate(xValue, 0, 0, 0, 1, pointPlacement)) : plotX; // #1514, #5383, #5518 point.negative = point.y < (threshold || 0); // some API data point.category = categories && categories[point.x] !== UNDEFINED ? categories[point.x] : point.x; // Determine auto enabling of markers (#3635, #5099) if (!point.isNull) { if (lastPlotX !== undefined) { closestPointRangePx = mathMin(closestPointRangePx, mathAbs(plotX - lastPlotX)); } lastPlotX = plotX; } } series.closestPointRangePx = closestPointRangePx; }, /** * Return the series points with null points filtered out */ getValidPoints: function (points, insideOnly) { var chart = this.chart; return grep(points || this.points || [], function isValidPoint(point) { // #3916, #5029 if (insideOnly && !chart.isInsidePlot(point.plotX, point.plotY, chart.inverted)) { // #5085 return false; } return !point.isNull; }); }, /** * Set the clipping for the series. For animated series it is called twice, first to initiate * animating the clip then the second time without the animation to set the final clip. */ setClip: function (animation) { var chart = this.chart, options = this.options, renderer = chart.renderer, inverted = chart.inverted, seriesClipBox = this.clipBox, clipBox = seriesClipBox || chart.clipBox, sharedClipKey = this.sharedClipKey || ['_sharedClip', animation && animation.duration, animation && animation.easing, clipBox.height, options.xAxis, options.yAxis].join(','), // #4526 clipRect = chart[sharedClipKey], markerClipRect = chart[sharedClipKey + 'm']; // If a clipping rectangle with the same properties is currently present in the chart, use that. if (!clipRect) { // When animation is set, prepare the initial positions if (animation) { clipBox.width = 0; chart[sharedClipKey + 'm'] = markerClipRect = renderer.clipRect( -99, // include the width of the first marker inverted ? -chart.plotLeft : -chart.plotTop, 99, inverted ? chart.chartWidth : chart.chartHeight ); } chart[sharedClipKey] = clipRect = renderer.clipRect(clipBox); // Create hashmap for series indexes clipRect.count = { length: 0 }; } if (animation) { if (!clipRect.count[this.index]) { clipRect.count[this.index] = true; clipRect.count.length += 1; } } if (options.clip !== false) { this.group.clip(animation || seriesClipBox ? clipRect : chart.clipRect); this.markerGroup.clip(markerClipRect); this.sharedClipKey = sharedClipKey; } // Remove the shared clipping rectangle when all series are shown if (!animation) { if (clipRect.count[this.index]) { delete clipRect.count[this.index]; clipRect.count.length -= 1; } if (clipRect.count.length === 0 && sharedClipKey && chart[sharedClipKey]) { if (!seriesClipBox) { chart[sharedClipKey] = chart[sharedClipKey].destroy(); } if (chart[sharedClipKey + 'm']) { chart[sharedClipKey + 'm'] = chart[sharedClipKey + 'm'].destroy(); } } } }, /** * Animate in the series */ animate: function (init) { var series = this, chart = series.chart, clipRect, animation = animObject(series.options.animation), sharedClipKey; // Initialize the animation. Set up the clipping rectangle. if (init) { series.setClip(animation); // Run the animation } else { sharedClipKey = this.sharedClipKey; clipRect = chart[sharedClipKey]; if (clipRect) { clipRect.animate({ width: chart.plotSizeX }, animation); } if (chart[sharedClipKey + 'm']) { chart[sharedClipKey + 'm'].animate({ width: chart.plotSizeX + 99 }, animation); } // Delete this function to allow it only once series.animate = null; } }, /** * This runs after animation to land on the final plot clipping */ afterAnimate: function () { this.setClip(); fireEvent(this, 'afterAnimate'); }, /** * Draw the markers */ drawPoints: function () { var series = this, pointAttr, points = series.points, chart = series.chart, plotX, plotY, i, point, radius, symbol, isImage, graphic, options = series.options, seriesMarkerOptions = options.marker, seriesPointAttr = series.pointAttr[''], pointMarkerOptions, hasPointMarker, enabled, isInside, markerGroup = series.markerGroup, xAxis = series.xAxis, globallyEnabled = pick( seriesMarkerOptions.enabled, xAxis.isRadial, series.closestPointRangePx > 2 * seriesMarkerOptions.radius ); if (seriesMarkerOptions.enabled !== false || series._hasPointMarkers) { i = points.length; while (i--) { point = points[i]; plotX = mathFloor(point.plotX); // #1843 plotY = point.plotY; graphic = point.graphic; pointMarkerOptions = point.marker || {}; hasPointMarker = !!point.marker; enabled = (globallyEnabled && pointMarkerOptions.enabled === UNDEFINED) || pointMarkerOptions.enabled; isInside = point.isInside; // only draw the point if y is defined if (enabled && isNumber(plotY) && point.y !== null) { // shortcuts pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || seriesPointAttr; radius = pointAttr.r; symbol = pick(pointMarkerOptions.symbol, series.symbol); isImage = symbol.indexOf('url') === 0; if (graphic) { // update graphic[isInside ? 'show' : 'hide'](true) // Since the marker group isn't clipped, each individual marker must be toggled .attr(pointAttr) // #4759 .animate(extend({ x: plotX - radius, y: plotY - radius }, graphic.symbolName ? { // don't apply to image symbols #507 width: 2 * radius, height: 2 * radius } : {})); } else if (isInside && (radius > 0 || isImage)) { point.graphic = graphic = chart.renderer.symbol( symbol, plotX - radius, plotY - radius, 2 * radius, 2 * radius, hasPointMarker ? pointMarkerOptions : seriesMarkerOptions ) .attr(pointAttr) .add(markerGroup); } } else if (graphic) { point.graphic = graphic.destroy(); // #1269 } } } }, /** * Convert state properties from API naming conventions to SVG attributes * * @param {Object} options API options object * @param {Object} base1 SVG attribute object to inherit from * @param {Object} base2 Second level SVG attribute object to inherit from */ convertAttribs: function (options, base1, base2, base3) { var conversion = this.pointAttrToOptions, attr, option, obj = {}; options = options || {}; base1 = base1 || {}; base2 = base2 || {}; base3 = base3 || {}; for (attr in conversion) { option = conversion[attr]; obj[attr] = pick(options[option], base1[attr], base2[attr], base3[attr]); } return obj; }, /** * Get the state attributes. Each series type has its own set of attributes * that are allowed to change on a point's state change. Series wide attributes are stored for * all series, and additionally point specific attributes are stored for all * points with individual marker options. If such options are not defined for the point, * a reference to the series wide attributes is stored in point.pointAttr. */ getAttribs: function () { var series = this, seriesOptions = series.options, normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions, stateOptions = normalOptions.states, stateOptionsHover = stateOptions[HOVER_STATE], pointStateOptionsHover, seriesColor = series.color, seriesNegativeColor = series.options.negativeColor, normalDefaults = { stroke: seriesColor, fill: seriesColor }, points = series.points || [], // #927 i, j, threshold, point, seriesPointAttr = [], pointAttr, pointAttrToOptions = series.pointAttrToOptions, hasPointSpecificOptions = series.hasPointSpecificOptions, defaultLineColor = normalOptions.lineColor, defaultFillColor = normalOptions.fillColor, turboThreshold = seriesOptions.turboThreshold, zones = series.zones, zoneAxis = series.zoneAxis || 'y', zoneColor, attr, key; // series type specific modifications if (seriesOptions.marker) { // line, spline, area, areaspline, scatter // if no hover radius is given, default to normal radius + 2 stateOptionsHover.radius = +stateOptionsHover.radius || +normalOptions.radius + +stateOptionsHover.radiusPlus; stateOptionsHover.lineWidth = stateOptionsHover.lineWidth || normalOptions.lineWidth + stateOptionsHover.lineWidthPlus; } else { // column, bar, pie // if no hover color is given, brighten the normal color stateOptionsHover.color = stateOptionsHover.color || Color(stateOptionsHover.color || seriesColor) .brighten(stateOptionsHover.brightness).get(); // if no hover negativeColor is given, brighten the normal negativeColor stateOptionsHover.negativeColor = stateOptionsHover.negativeColor || Color(stateOptionsHover.negativeColor || seriesNegativeColor) .brighten(stateOptionsHover.brightness).get(); } // general point attributes for the series normal state seriesPointAttr[NORMAL_STATE] = series.convertAttribs(normalOptions, normalDefaults); // HOVER_STATE and SELECT_STATE states inherit from normal state except the default radius each([HOVER_STATE, SELECT_STATE], function (state) { seriesPointAttr[state] = series.convertAttribs(stateOptions[state], seriesPointAttr[NORMAL_STATE]); }); // set it series.pointAttr = seriesPointAttr; // Generate the point-specific attribute collections if specific point // options are given. If not, create a referance to the series wide point // attributes i = points.length; if (!turboThreshold || i < turboThreshold || hasPointSpecificOptions) { while (i--) { point = points[i]; normalOptions = (point.options && point.options.marker) || point.options; if (normalOptions && normalOptions.enabled === false) { normalOptions.radius = 0; } zoneColor = null; if (zones.length) { j = 0; threshold = zones[j]; while (point[zoneAxis] >= threshold.value) { threshold = zones[++j]; } point.color = point.fillColor = zoneColor = pick(threshold.color, series.color); // #3636, #4267, #4430 - inherit color from series, when color is undefined } hasPointSpecificOptions = seriesOptions.colorByPoint || point.color; // #868 // check if the point has specific visual options if (point.options) { for (key in pointAttrToOptions) { if (defined(normalOptions[pointAttrToOptions[key]])) { hasPointSpecificOptions = true; } } } // a specific marker config object is defined for the individual point: // create it's own attribute collection if (hasPointSpecificOptions) { normalOptions = normalOptions || {}; pointAttr = []; stateOptions = normalOptions.states || {}; // reassign for individual point pointStateOptionsHover = stateOptions[HOVER_STATE] = stateOptions[HOVER_STATE] || {}; // Handle colors for column and pies if (!seriesOptions.marker || (point.negative && !pointStateOptionsHover.fillColor && !stateOptionsHover.fillColor)) { // column, bar, point or negative threshold for series with markers (#3636) // If no hover color is given, brighten the normal color. #1619, #2579 pointStateOptionsHover[series.pointAttrToOptions.fill] = pointStateOptionsHover.color || (!point.options.color && stateOptionsHover[(point.negative && seriesNegativeColor ? 'negativeColor' : 'color')]) || Color(point.color) .brighten(pointStateOptionsHover.brightness || stateOptionsHover.brightness) .get(); } // normal point state inherits series wide normal state attr = { color: point.color }; // #868 if (!defaultFillColor) { // Individual point color or negative color markers (#2219) attr.fillColor = point.color; } if (!defaultLineColor) { attr.lineColor = point.color; // Bubbles take point color, line markers use white } // Color is explicitly set to null or undefined (#1288, #4068) if (normalOptions.hasOwnProperty('color') && !normalOptions.color) { delete normalOptions.color; } // When zone is set, but series.states.hover.color is not set, apply zone color on hover, #4670: if (zoneColor && !stateOptionsHover.fillColor) { pointStateOptionsHover.fillColor = zoneColor; } pointAttr[NORMAL_STATE] = series.convertAttribs(extend(attr, normalOptions), seriesPointAttr[NORMAL_STATE]); // inherit from point normal and series hover pointAttr[HOVER_STATE] = series.convertAttribs( stateOptions[HOVER_STATE], seriesPointAttr[HOVER_STATE], pointAttr[NORMAL_STATE] ); // inherit from point normal and series hover pointAttr[SELECT_STATE] = series.convertAttribs( stateOptions[SELECT_STATE], seriesPointAttr[SELECT_STATE], pointAttr[NORMAL_STATE] ); // no marker config object is created: copy a reference to the series-wide // attribute collection } else { pointAttr = seriesPointAttr; } point.pointAttr = pointAttr; } } }, /** * Clear DOM objects and free up memory */ destroy: function () { var series = this, chart = series.chart, issue134 = /AppleWebKit\/533/.test(userAgent), destroy, i, data = series.data || [], point, prop, axis; // add event hook fireEvent(series, 'destroy'); // remove all events removeEvent(series); // erase from axes each(series.axisTypes || [], function (AXIS) { axis = series[AXIS]; if (axis) { erase(axis.series, series); axis.isDirty = axis.forceRedraw = true; } }); // remove legend items if (series.legendItem) { series.chart.legend.destroyItem(series); } // destroy all points with their elements i = data.length; while (i--) { point = data[i]; if (point && point.destroy) { point.destroy(); } } series.points = null; // Clear the animation timeout if we are destroying the series during initial animation clearTimeout(series.animationTimeout); // Destroy all SVGElements associated to the series for (prop in series) { if (series[prop] instanceof SVGElement && !series[prop].survive) { // Survive provides a hook for not destroying // issue 134 workaround destroy = issue134 && prop === 'group' ? 'hide' : 'destroy'; series[prop][destroy](); } } // remove from hoverSeries if (chart.hoverSeries === series) { chart.hoverSeries = null; } erase(chart.series, series); // clear all members for (prop in series) { delete series[prop]; } }, /** * Get the graph path */ getGraphPath: function (points, nullsAsZeroes, connectCliffs) { var series = this, options = series.options, step = options.step, reversed, graphPath = [], xMap = [], gap; points = points || series.points; // Bottom of a stack is reversed reversed = points.reversed; if (reversed) { points.reverse(); } // Reverse the steps (#5004) step = { right: 1, center: 2 }[step] || (step && 3); if (step && reversed) { step = 4 - step; } // Remove invalid points, especially in spline (#5015) if (options.connectNulls && !nullsAsZeroes && !connectCliffs) { points = this.getValidPoints(points); } // Build the line each(points, function (point, i) { var plotX = point.plotX, plotY = point.plotY, lastPoint = points[i - 1], pathToPoint; // the path to this point from the previous if ((point.leftCliff || (lastPoint && lastPoint.rightCliff)) && !connectCliffs) { gap = true; // ... and continue } // Line series, nullsAsZeroes is not handled if (point.isNull && !defined(nullsAsZeroes) && i > 0) { gap = !options.connectNulls; // Area series, nullsAsZeroes is set } else if (point.isNull && !nullsAsZeroes) { gap = true; } else { if (i === 0 || gap) { pathToPoint = [M, point.plotX, point.plotY]; } else if (series.getPointSpline) { // generate the spline as defined in the SplineSeries object pathToPoint = series.getPointSpline(points, point, i); } else if (step) { if (step === 1) { // right pathToPoint = [ L, lastPoint.plotX, plotY ]; } else if (step === 2) { // center pathToPoint = [ L, (lastPoint.plotX + plotX) / 2, lastPoint.plotY, L, (lastPoint.plotX + plotX) / 2, plotY ]; } else { pathToPoint = [ L, plotX, lastPoint.plotY ]; } pathToPoint.push(L, plotX, plotY); } else { // normal line to next point pathToPoint = [ L, plotX, plotY ]; } // Prepare for animation. When step is enabled, there are two path nodes for each x value. xMap.push(point.x); if (step) { xMap.push(point.x); } graphPath.push.apply(graphPath, pathToPoint); gap = false; } }); graphPath.xMap = xMap; series.graphPath = graphPath; return graphPath; }, /** * Draw the actual graph */ drawGraph: function () { var series = this, options = this.options, props = [['graph', options.lineColor || this.color, options.dashStyle]], lineWidth = options.lineWidth, roundCap = options.linecap !== 'square', graphPath = (this.gappedPath || this.getGraphPath).call(this), zones = this.zones; each(zones, function (threshold, i) { props.push(['zoneGraph' + i, threshold.color || series.color, threshold.dashStyle || options.dashStyle]); }); // Draw the graph each(props, function (prop, i) { var graphKey = prop[0], graph = series[graphKey], attribs; if (graph) { graph.endX = graphPath.xMap; graph.animate({ d: graphPath }); } else if (lineWidth && graphPath.length) { // #1487 attribs = { stroke: prop[1], 'stroke-width': lineWidth, fill: 'none', zIndex: 1 // #1069 }; if (prop[2]) { attribs.dashstyle = prop[2]; } else if (roundCap) { attribs['stroke-linecap'] = attribs['stroke-linejoin'] = 'round'; } graph = series[graphKey] = series.chart.renderer.path(graphPath) .attr(attribs) .add(series.group) .shadow((i < 2) && options.shadow); // add shadow to normal series (0) or to first zone (1) #3932 } // Helpers for animation if (graph) { graph.startX = graphPath.xMap; //graph.shiftUnit = options.step ? 2 : 1; graph.isArea = graphPath.isArea; // For arearange animation } }); }, /** * Clip the graphs into the positive and negative coloured graphs */ applyZones: function () { var series = this, chart = this.chart, renderer = chart.renderer, zones = this.zones, translatedFrom, translatedTo, clips = this.clips || [], clipAttr, graph = this.graph, area = this.area, chartSizeMax = mathMax(chart.chartWidth, chart.chartHeight), axis = this[(this.zoneAxis || 'y') + 'Axis'], extremes, reversed, inverted = chart.inverted, horiz, pxRange, pxPosMin, pxPosMax, ignoreZones = false; if (zones.length && (graph || area) && axis && axis.min !== UNDEFINED) { reversed = axis.reversed; horiz = axis.horiz; // The use of the Color Threshold assumes there are no gaps // so it is safe to hide the original graph and area if (graph) { graph.hide(); } if (area) { area.hide(); } // Create the clips extremes = axis.getExtremes(); each(zones, function (threshold, i) { translatedFrom = reversed ? (horiz ? chart.plotWidth : 0) : (horiz ? 0 : axis.toPixels(extremes.min)); translatedFrom = mathMin(mathMax(pick(translatedTo, translatedFrom), 0), chartSizeMax); translatedTo = mathMin(mathMax(mathRound(axis.toPixels(pick(threshold.value, extremes.max), true)), 0), chartSizeMax); if (ignoreZones) { translatedFrom = translatedTo = axis.toPixels(extremes.max); } pxRange = Math.abs(translatedFrom - translatedTo); pxPosMin = mathMin(translatedFrom, translatedTo); pxPosMax = mathMax(translatedFrom, translatedTo); if (axis.isXAxis) { clipAttr = { x: inverted ? pxPosMax : pxPosMin, y: 0, width: pxRange, height: chartSizeMax }; if (!horiz) { clipAttr.x = chart.plotHeight - clipAttr.x; } } else { clipAttr = { x: 0, y: inverted ? pxPosMax : pxPosMin, width: chartSizeMax, height: pxRange }; if (horiz) { clipAttr.y = chart.plotWidth - clipAttr.y; } } /// VML SUPPPORT if (inverted && renderer.isVML) { if (axis.isXAxis) { clipAttr = { x: 0, y: reversed ? pxPosMin : pxPosMax, height: clipAttr.width, width: chart.chartWidth }; } else { clipAttr = { x: clipAttr.y - chart.plotLeft - chart.spacingBox.x, y: 0, width: clipAttr.height, height: chart.chartHeight }; } } /// END OF VML SUPPORT if (clips[i]) { clips[i].animate(clipAttr); } else { clips[i] = renderer.clipRect(clipAttr); if (graph) { series['zoneGraph' + i].clip(clips[i]); } if (area) { series['zoneArea' + i].clip(clips[i]); } } // if this zone extends out of the axis, ignore the others ignoreZones = threshold.value > extremes.max; }); this.clips = clips; } }, /** * Initialize and perform group inversion on series.group and series.markerGroup */ invertGroups: function () { var series = this, chart = series.chart; // Pie, go away (#1736) if (!series.xAxis) { return; } // A fixed size is needed for inversion to work function setInvert() { var size = { width: series.yAxis.len, height: series.xAxis.len }; each(['group', 'markerGroup'], function (groupName) { if (series[groupName]) { series[groupName].attr(size).invert(); } }); } addEvent(chart, 'resize', setInvert); // do it on resize addEvent(series, 'destroy', function () { removeEvent(chart, 'resize', setInvert); }); // Do it now setInvert(); // do it now // On subsequent render and redraw, just do setInvert without setting up events again series.invertGroups = setInvert; }, /** * General abstraction for creating plot groups like series.group, series.dataLabelsGroup and * series.markerGroup. On subsequent calls, the group will only be adjusted to the updated plot size. */ plotGroup: function (prop, name, visibility, zIndex, parent) { var group = this[prop], isNew = !group; // Generate it on first call if (isNew) { this[prop] = group = this.chart.renderer.g(name) .attr({ zIndex: zIndex || 0.1 // IE8 and pointer logic use this }) .add(parent); group.addClass('highcharts-series-' + this.index); } // Place it on first and subsequent (redraw) calls group.attr({ visibility: visibility })[isNew ? 'attr' : 'animate'](this.getPlotBox()); return group; }, /** * Get the translation and scale for the plot area of this series */ getPlotBox: function () { var chart = this.chart, xAxis = this.xAxis, yAxis = this.yAxis; // Swap axes for inverted (#2339) if (chart.inverted) { xAxis = yAxis; yAxis = this.xAxis; } return { translateX: xAxis ? xAxis.left : chart.plotLeft, translateY: yAxis ? yAxis.top : chart.plotTop, scaleX: 1, // #1623 scaleY: 1 }; }, /** * Render the graph and markers */ render: function () { var series = this, chart = series.chart, group, options = series.options, // Animation doesn't work in IE8 quirks when the group div is hidden, // and looks bad in other oldIE animDuration = !!series.animate && chart.renderer.isSVG && animObject(options.animation).duration, visibility = series.visible ? 'inherit' : 'hidden', // #2597 zIndex = options.zIndex, hasRendered = series.hasRendered, chartSeriesGroup = chart.seriesGroup; // the group group = series.plotGroup( 'group', 'series', visibility, zIndex, chartSeriesGroup ); series.markerGroup = series.plotGroup( 'markerGroup', 'markers', visibility, zIndex, chartSeriesGroup ); // initiate the animation if (animDuration) { series.animate(true); } // cache attributes for shapes series.getAttribs(); // SVGRenderer needs to know this before drawing elements (#1089, #1795) group.inverted = series.isCartesian ? chart.inverted : false; // draw the graph if any if (series.drawGraph) { series.drawGraph(); series.applyZones(); } each(series.points, function (point) { if (point.redraw) { point.redraw(); } }); // draw the data labels (inn pies they go before the points) if (series.drawDataLabels) { series.drawDataLabels(); } // draw the points if (series.visible) { series.drawPoints(); } // draw the mouse tracking area if (series.drawTracker && series.options.enableMouseTracking !== false) { series.drawTracker(); } // Handle inverted series and tracker groups if (chart.inverted) { series.invertGroups(); } // Initial clipping, must be defined after inverting groups for VML. Applies to columns etc. (#3839). if (options.clip !== false && !series.sharedClipKey && !hasRendered) { group.clip(chart.clipRect); } // Run the animation if (animDuration) { series.animate(); } // Call the afterAnimate function on animation complete (but don't overwrite the animation.complete option // which should be available to the user). if (!hasRendered) { series.animationTimeout = syncTimeout(function () { series.afterAnimate(); }, animDuration); } series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see // (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see series.hasRendered = true; }, /** * Redraw the series after an update in the axes. */ redraw: function () { var series = this, chart = series.chart, wasDirty = series.isDirty || series.isDirtyData, // cache it here as it is set to false in render, but used after group = series.group, xAxis = series.xAxis, yAxis = series.yAxis; // reposition on resize if (group) { if (chart.inverted) { group.attr({ width: chart.plotWidth, height: chart.plotHeight }); } group.animate({ translateX: pick(xAxis && xAxis.left, chart.plotLeft), translateY: pick(yAxis && yAxis.top, chart.plotTop) }); } series.translate(); series.render(); if (wasDirty) { // #3868, #3945 delete this.kdTree; } }, /** * KD Tree && PointSearching Implementation */ kdDimensions: 1, kdAxisArray: ['clientX', 'plotY'], searchPoint: function (e, compareX) { var series = this, xAxis = series.xAxis, yAxis = series.yAxis, inverted = series.chart.inverted; return this.searchKDTree({ clientX: inverted ? xAxis.len - e.chartY + xAxis.pos : e.chartX - xAxis.pos, plotY: inverted ? yAxis.len - e.chartX + yAxis.pos : e.chartY - yAxis.pos }, compareX); }, buildKDTree: function () { var series = this, dimensions = series.kdDimensions; // Internal function function _kdtree(points, depth, dimensions) { var axis, median, length = points && points.length; if (length) { // alternate between the axis axis = series.kdAxisArray[depth % dimensions]; // sort point array points.sort(function (a, b) { return a[axis] - b[axis]; }); median = Math.floor(length / 2); // build and return nod return { point: points[median], left: _kdtree(points.slice(0, median), depth + 1, dimensions), right: _kdtree(points.slice(median + 1), depth + 1, dimensions) }; } } // Start the recursive build process with a clone of the points array and null points filtered out (#3873) function startRecursive() { series.kdTree = _kdtree( series.getValidPoints( null, !series.directTouch // For line-type series restrict to plot area, but column-type series not (#3916, #4511) ), dimensions, dimensions ); } delete series.kdTree; // For testing tooltips, don't build async syncTimeout(startRecursive, series.options.kdNow ? 0 : 1); }, searchKDTree: function (point, compareX) { var series = this, kdX = this.kdAxisArray[0], kdY = this.kdAxisArray[1], kdComparer = compareX ? 'distX' : 'dist'; // Set the one and two dimensional distance on the point object function setDistance(p1, p2) { var x = (defined(p1[kdX]) && defined(p2[kdX])) ? Math.pow(p1[kdX] - p2[kdX], 2) : null, y = (defined(p1[kdY]) && defined(p2[kdY])) ? Math.pow(p1[kdY] - p2[kdY], 2) : null, r = (x || 0) + (y || 0); p2.dist = defined(r) ? Math.sqrt(r) : Number.MAX_VALUE; p2.distX = defined(x) ? Math.sqrt(x) : Number.MAX_VALUE; } function _search(search, tree, depth, dimensions) { var point = tree.point, axis = series.kdAxisArray[depth % dimensions], tdist, sideA, sideB, ret = point, nPoint1, nPoint2; setDistance(search, point); // Pick side based on distance to splitting point tdist = search[axis] - point[axis]; sideA = tdist < 0 ? 'left' : 'right'; sideB = tdist < 0 ? 'right' : 'left'; // End of tree if (tree[sideA]) { nPoint1 = _search(search, tree[sideA], depth + 1, dimensions); ret = (nPoint1[kdComparer] < ret[kdComparer] ? nPoint1 : point); } if (tree[sideB]) { // compare distance to current best to splitting point to decide wether to check side B or not if (Math.sqrt(tdist * tdist) < ret[kdComparer]) { nPoint2 = _search(search, tree[sideB], depth + 1, dimensions); ret = (nPoint2[kdComparer] < ret[kdComparer] ? nPoint2 : ret); } } return ret; } if (!this.kdTree) { this.buildKDTree(); } if (this.kdTree) { return _search(point, this.kdTree, this.kdDimensions, this.kdDimensions); } } }; // end Series prototype /** * The class for stack items */ function StackItem(axis, options, isNegative, x, stackOption) { var inverted = axis.chart.inverted; this.axis = axis; // Tells if the stack is negative this.isNegative = isNegative; // Save the options to be able to style the label this.options = options; // Save the x value to be able to position the label later this.x = x; // Initialize total value this.total = null; // This will keep each points' extremes stored by series.index and point index this.points = {}; // Save the stack option on the series configuration object, and whether to treat it as percent this.stack = stackOption; this.leftCliff = 0; this.rightCliff = 0; // The align options and text align varies on whether the stack is negative and // if the chart is inverted or not. // First test the user supplied value, then use the dynamic. this.alignOptions = { align: options.align || (inverted ? (isNegative ? 'left' : 'right') : 'center'), verticalAlign: options.verticalAlign || (inverted ? 'middle' : (isNegative ? 'bottom' : 'top')), y: pick(options.y, inverted ? 4 : (isNegative ? 14 : -6)), x: pick(options.x, inverted ? (isNegative ? -6 : 6) : 0) }; this.textAlign = options.textAlign || (inverted ? (isNegative ? 'right' : 'left') : 'center'); } StackItem.prototype = { destroy: function () { destroyObjectProperties(this, this.axis); }, /** * Renders the stack total label and adds it to the stack label group. */ render: function (group) { var options = this.options, formatOption = options.format, str = formatOption ? format(formatOption, this) : options.formatter.call(this); // format the text in the label // Change the text to reflect the new total and set visibility to hidden in case the serie is hidden if (this.label) { this.label.attr({ text: str, visibility: 'hidden' }); // Create new label } else { this.label = this.axis.chart.renderer.text(str, null, null, options.useHTML) // dummy positions, actual position updated with setOffset method in columnseries .css(options.style) // apply style .attr({ align: this.textAlign, // fix the text-anchor rotation: options.rotation, // rotation visibility: HIDDEN // hidden until setOffset is called }) .add(group); // add to the labels-group } }, /** * Sets the offset that the stack has from the x value and repositions the label. */ setOffset: function (xOffset, xWidth) { var stackItem = this, axis = stackItem.axis, chart = axis.chart, inverted = chart.inverted, reversed = axis.reversed, neg = (this.isNegative && !reversed) || (!this.isNegative && reversed), // #4056 y = axis.translate(axis.usePercentage ? 100 : this.total, 0, 0, 0, 1), // stack value translated mapped to chart coordinates yZero = axis.translate(0), // stack origin h = mathAbs(y - yZero), // stack height x = chart.xAxis[0].translate(this.x) + xOffset, // stack x position plotHeight = chart.plotHeight, stackBox = { // this is the box for the complete stack x: inverted ? (neg ? y : y - h) : x, y: inverted ? plotHeight - x - xWidth : (neg ? (plotHeight - y - h) : plotHeight - y), width: inverted ? h : xWidth, height: inverted ? xWidth : h }, label = this.label, alignAttr; if (label) { label.align(this.alignOptions, null, stackBox); // align the label to the box // Set visibility (#678) alignAttr = label.alignAttr; label[this.options.crop === false || chart.isInsidePlot(alignAttr.x, alignAttr.y) ? 'show' : 'hide'](true); } } }; /** * Generate stacks for each series and calculate stacks total values */ Chart.prototype.getStacks = function () { var chart = this; // reset stacks for each yAxis each(chart.yAxis, function (axis) { if (axis.stacks && axis.hasVisibleSeries) { axis.oldStacks = axis.stacks; } }); each(chart.series, function (series) { if (series.options.stacking && (series.visible === true || chart.options.chart.ignoreHiddenSeries === false)) { series.stackKey = series.type + pick(series.options.stack, ''); } }); }; // Stacking methods defined on the Axis prototype /** * Build the stacks from top down */ Axis.prototype.buildStacks = function () { var axisSeries = this.series, series, reversedStacks = pick(this.options.reversedStacks, true), len = axisSeries.length, i; if (!this.isXAxis) { this.usePercentage = false; i = len; while (i--) { axisSeries[reversedStacks ? i : len - i - 1].setStackedPoints(); } i = len; while (i--) { series = axisSeries[reversedStacks ? i : len - i - 1]; if (series.setStackCliffs) { series.setStackCliffs(); } } // Loop up again to compute percent stack if (this.usePercentage) { for (i = 0; i < len; i++) { axisSeries[i].setPercentStacks(); } } } }; Axis.prototype.renderStackTotals = function () { var axis = this, chart = axis.chart, renderer = chart.renderer, stacks = axis.stacks, stackKey, oneStack, stackCategory, stackTotalGroup = axis.stackTotalGroup; // Create a separate group for the stack total labels if (!stackTotalGroup) { axis.stackTotalGroup = stackTotalGroup = renderer.g('stack-labels') .attr({ visibility: VISIBLE, zIndex: 6 }) .add(); } // plotLeft/Top will change when y axis gets wider so we need to translate the // stackTotalGroup at every render call. See bug #506 and #516 stackTotalGroup.translate(chart.plotLeft, chart.plotTop); // Render each stack total for (stackKey in stacks) { oneStack = stacks[stackKey]; for (stackCategory in oneStack) { oneStack[stackCategory].render(stackTotalGroup); } } }; /** * Set all the stacks to initial states and destroy unused ones. */ Axis.prototype.resetStacks = function () { var stacks = this.stacks, type, i; if (!this.isXAxis) { for (type in stacks) { for (i in stacks[type]) { // Clean up memory after point deletion (#1044, #4320) if (stacks[type][i].touched < this.stacksTouched) { stacks[type][i].destroy(); delete stacks[type][i]; // Reset stacks } else { stacks[type][i].total = null; stacks[type][i].cum = 0; } } } } }; Axis.prototype.cleanStacks = function () { var stacks, type, i; if (!this.isXAxis) { if (this.oldStacks) { stacks = this.stacks = this.oldStacks; } // reset stacks for (type in stacks) { for (i in stacks[type]) { stacks[type][i].cum = stacks[type][i].total; } } } }; // Stacking methods defnied for Series prototype /** * Adds series' points value to corresponding stack */ Series.prototype.setStackedPoints = function () { if (!this.options.stacking || (this.visible !== true && this.chart.options.chart.ignoreHiddenSeries !== false)) { return; } var series = this, xData = series.processedXData, yData = series.processedYData, stackedYData = [], yDataLength = yData.length, seriesOptions = series.options, threshold = seriesOptions.threshold, stackThreshold = seriesOptions.startFromThreshold ? threshold : 0, stackOption = seriesOptions.stack, stacking = seriesOptions.stacking, stackKey = series.stackKey, negKey = '-' + stackKey, negStacks = series.negStacks, yAxis = series.yAxis, stacks = yAxis.stacks, oldStacks = yAxis.oldStacks, stackIndicator, isNegative, stack, other, key, pointKey, i, x, y; yAxis.stacksTouched += 1; // loop over the non-null y values and read them into a local array for (i = 0; i < yDataLength; i++) { x = xData[i]; y = yData[i]; stackIndicator = series.getStackIndicator(stackIndicator, x, series.index); pointKey = stackIndicator.key; // Read stacked values into a stack based on the x value, // the sign of y and the stack key. Stacking is also handled for null values (#739) isNegative = negStacks && y < (stackThreshold ? 0 : threshold); key = isNegative ? negKey : stackKey; // Create empty object for this stack if it doesn't exist yet if (!stacks[key]) { stacks[key] = {}; } // Initialize StackItem for this x if (!stacks[key][x]) { if (oldStacks[key] && oldStacks[key][x]) { stacks[key][x] = oldStacks[key][x]; stacks[key][x].total = null; } else { stacks[key][x] = new StackItem(yAxis, yAxis.options.stackLabels, isNegative, x, stackOption); } } // If the StackItem doesn't exist, create it first stack = stacks[key][x]; if (y !== null) { stack.points[pointKey] = stack.points[series.index] = [pick(stack.cum, stackThreshold)]; // Record the base of the stack if (!defined(stack.cum)) { stack.base = pointKey; } stack.touched = yAxis.stacksTouched; // In area charts, if there are multiple points on the same X value, let the // area fill the full span of those points if (stackIndicator.index > 0 && series.singleStacks === false) { stack.points[pointKey][0] = stack.points[series.index + ',' + x + ',0'][0]; } } // Add value to the stack total if (stacking === 'percent') { // Percent stacked column, totals are the same for the positive and negative stacks other = isNegative ? stackKey : negKey; if (negStacks && stacks[other] && stacks[other][x]) { other = stacks[other][x]; stack.total = other.total = mathMax(other.total, stack.total) + mathAbs(y) || 0; // Percent stacked areas } else { stack.total = correctFloat(stack.total + (mathAbs(y) || 0)); } } else { stack.total = correctFloat(stack.total + (y || 0)); } stack.cum = pick(stack.cum, stackThreshold) + (y || 0); if (y !== null) { stack.points[pointKey].push(stack.cum); stackedYData[i] = stack.cum; } } if (stacking === 'percent') { yAxis.usePercentage = true; } this.stackedYData = stackedYData; // To be used in getExtremes // Reset old stacks yAxis.oldStacks = {}; }; /** * Iterate over all stacks and compute the absolute values to percent */ Series.prototype.setPercentStacks = function () { var series = this, stackKey = series.stackKey, stacks = series.yAxis.stacks, processedXData = series.processedXData, stackIndicator; each([stackKey, '-' + stackKey], function (key) { var i = processedXData.length, x, stack, pointExtremes, totalFactor; while (i--) { x = processedXData[i]; stackIndicator = series.getStackIndicator(stackIndicator, x, series.index); stack = stacks[key] && stacks[key][x]; pointExtremes = stack && stack.points[stackIndicator.key]; if (pointExtremes) { totalFactor = stack.total ? 100 / stack.total : 0; pointExtremes[0] = correctFloat(pointExtremes[0] * totalFactor); // Y bottom value pointExtremes[1] = correctFloat(pointExtremes[1] * totalFactor); // Y value series.stackedYData[i] = pointExtremes[1]; } } }); }; /** * Get stack indicator, according to it's x-value, to determine points with the same x-value */ Series.prototype.getStackIndicator = function (stackIndicator, x, index) { if (!defined(stackIndicator) || stackIndicator.x !== x) { stackIndicator = { x: x, index: 0 }; } else { stackIndicator.index++; } stackIndicator.key = [index, x, stackIndicator.index].join(','); return stackIndicator; }; // Extend the Chart prototype for dynamic methods extend(Chart.prototype, { /** * Add a series dynamically after time * * @param {Object} options The config options * @param {Boolean} redraw Whether to redraw the chart after adding. Defaults to true. * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration * * @return {Object} series The newly created series object */ addSeries: function (options, redraw, animation) { var series, chart = this; if (options) { redraw = pick(redraw, true); // defaults to true fireEvent(chart, 'addSeries', { options: options }, function () { series = chart.initSeries(options); chart.isDirtyLegend = true; // the series array is out of sync with the display chart.linkSeries(); if (redraw) { chart.redraw(animation); } }); } return series; }, /** * Add an axis to the chart * @param {Object} options The axis option * @param {Boolean} isX Whether it is an X axis or a value axis */ addAxis: function (options, isX, redraw, animation) { var key = isX ? 'xAxis' : 'yAxis', chartOptions = this.options, userOptions = merge(options, { index: this[key].length, isX: isX }); new Axis(this, userOptions); // eslint-disable-line no-new // Push the new axis options to the chart options chartOptions[key] = splat(chartOptions[key] || {}); chartOptions[key].push(userOptions); if (pick(redraw, true)) { this.redraw(animation); } }, /** * Dim the chart and show a loading text or symbol * @param {String} str An optional text to show in the loading label instead of the default one */ showLoading: function (str) { var chart = this, options = chart.options, loadingDiv = chart.loadingDiv, loadingOptions = options.loading, setLoadingSize = function () { if (loadingDiv) { css(loadingDiv, { left: chart.plotLeft + PX, top: chart.plotTop + PX, width: chart.plotWidth + PX, height: chart.plotHeight + PX }); } }; // create the layer at the first call if (!loadingDiv) { chart.loadingDiv = loadingDiv = createElement(DIV, { className: PREFIX + 'loading' }, extend(loadingOptions.style, { zIndex: 10, display: NONE }), chart.container); chart.loadingSpan = createElement( 'span', null, loadingOptions.labelStyle, loadingDiv ); addEvent(chart, 'redraw', setLoadingSize); // #1080 } // update text chart.loadingSpan.innerHTML = str || options.lang.loading; // show it if (!chart.loadingShown) { css(loadingDiv, { opacity: 0, display: '' }); animate(loadingDiv, { opacity: loadingOptions.style.opacity }, { duration: loadingOptions.showDuration || 0 }); chart.loadingShown = true; } setLoadingSize(); }, /** * Hide the loading layer */ hideLoading: function () { var options = this.options, loadingDiv = this.loadingDiv; if (loadingDiv) { animate(loadingDiv, { opacity: 0 }, { duration: options.loading.hideDuration || 100, complete: function () { css(loadingDiv, { display: NONE }); } }); } this.loadingShown = false; } }); // extend the Point prototype for dynamic methods extend(Point.prototype, { /** * Update the point with new options (typically x/y data) and optionally redraw the series. * * @param {Object} options Point options as defined in the series.data array * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration * */ update: function (options, redraw, animation, runEvent) { var point = this, series = point.series, graphic = point.graphic, i, chart = series.chart, seriesOptions = series.options; redraw = pick(redraw, true); function update() { point.applyOptions(options); // Update visuals if (point.y === null && graphic) { // #4146 point.graphic = graphic.destroy(); } if (isObject(options, true)) { // Defer the actual redraw until getAttribs has been called (#3260) point.redraw = function () { if (graphic && graphic.element) { if (options && options.marker && options.marker.symbol) { point.graphic = graphic.destroy(); } } if (options && options.dataLabels && point.dataLabel) { // #2468 point.dataLabel = point.dataLabel.destroy(); } point.redraw = null; }; } // record changes in the parallel arrays i = point.index; series.updateParallelArrays(point, i); // Record the options to options.data. If there is an object from before, // use point options, otherwise use raw options. (#4701) seriesOptions.data[i] = isObject(seriesOptions.data[i], true) ? point.options : options; // redraw series.isDirty = series.isDirtyData = true; if (!series.fixedBox && series.hasCartesianSeries) { // #1906, #2320 chart.isDirtyBox = true; } if (seriesOptions.legendType === 'point') { // #1831, #1885 chart.isDirtyLegend = true; } if (redraw) { chart.redraw(animation); } } // Fire the event with a default handler of doing the update if (runEvent === false) { // When called from setData update(); } else { point.firePointEvent('update', { options: options }, update); } }, /** * Remove a point and optionally redraw the series and if necessary the axes * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration */ remove: function (redraw, animation) { this.series.removePoint(inArray(this, this.series.data), redraw, animation); } }); // Extend the series prototype for dynamic methods extend(Series.prototype, { /** * Add a point dynamically after chart load time * @param {Object} options Point options as given in series.data * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call * @param {Boolean} shift If shift is true, a point is shifted off the start * of the series as one is appended to the end. * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration */ addPoint: function (options, redraw, shift, animation) { var series = this, seriesOptions = series.options, data = series.data, chart = series.chart, names = series.xAxis && series.xAxis.names, dataOptions = seriesOptions.data, point, isInTheMiddle, xData = series.xData, i, x; // Optional redraw, defaults to true redraw = pick(redraw, true); // Get options and push the point to xData, yData and series.options. In series.generatePoints // the Point instance will be created on demand and pushed to the series.data array. point = { series: series }; series.pointClass.prototype.applyOptions.apply(point, [options]); x = point.x; // Get the insertion point i = xData.length; if (series.requireSorting && x < xData[i - 1]) { isInTheMiddle = true; while (i && xData[i - 1] > x) { i--; } } series.updateParallelArrays(point, 'splice', i, 0, 0); // insert undefined item series.updateParallelArrays(point, i); // update it if (names && point.name) { names[x] = point.name; } dataOptions.splice(i, 0, options); if (isInTheMiddle) { series.data.splice(i, 0, null); series.processData(); } // Generate points to be added to the legend (#1329) if (seriesOptions.legendType === 'point') { series.generatePoints(); } // Shift the first point off the parallel arrays if (shift) { if (data[0] && data[0].remove) { data[0].remove(false); } else { data.shift(); series.updateParallelArrays(point, 'shift'); dataOptions.shift(); } } // redraw series.isDirty = true; series.isDirtyData = true; if (redraw) { series.getAttribs(); // #1937 chart.redraw(animation); // Animation is set anyway on redraw, #5665 } }, /** * Remove a point (rendered or not), by index */ removePoint: function (i, redraw, animation) { var series = this, data = series.data, point = data[i], points = series.points, chart = series.chart, remove = function () { if (points && points.length === data.length) { // #4935 points.splice(i, 1); } data.splice(i, 1); series.options.data.splice(i, 1); series.updateParallelArrays(point || { series: series }, 'splice', i, 1); if (point) { point.destroy(); } // redraw series.isDirty = true; series.isDirtyData = true; if (redraw) { chart.redraw(); } }; setAnimation(animation, chart); redraw = pick(redraw, true); // Fire the event with a default handler of removing the point if (point) { point.firePointEvent('remove', null, remove); } else { remove(); } }, /** * Remove a series and optionally redraw the chart * * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration */ remove: function (redraw, animation, withEvent) { var series = this, chart = series.chart; function remove() { // Destroy elements series.destroy(); // Redraw chart.isDirtyLegend = chart.isDirtyBox = true; chart.linkSeries(); if (pick(redraw, true)) { chart.redraw(animation); } } // Fire the event with a default handler of removing the point if (withEvent !== false) { fireEvent(series, 'remove', null, remove); } else { remove(); } }, /** * Update the series with a new set of options */ update: function (newOptions, redraw) { var series = this, chart = this.chart, // must use user options when changing type because this.options is merged // in with type specific plotOptions oldOptions = this.userOptions, oldType = this.type, proto = seriesTypes[oldType].prototype, preserve = ['group', 'markerGroup', 'dataLabelsGroup'], n; // If we're changing type or zIndex, create new groups (#3380, #3404) if ((newOptions.type && newOptions.type !== oldType) || newOptions.zIndex !== undefined) { preserve.length = 0; } // Make sure groups are not destroyed (#3094) each(preserve, function (prop) { preserve[prop] = series[prop]; delete series[prop]; }); // Do the merge, with some forced options newOptions = merge(oldOptions, { animation: false, index: this.index, pointStart: this.xData[0] // when updating after addPoint }, { data: this.options.data }, newOptions); // Destroy the series and delete all properties. Reinsert all methods // and properties from the new type prototype (#2270, #3719) this.remove(false, null, false); for (n in proto) { this[n] = UNDEFINED; } extend(this, seriesTypes[newOptions.type || oldType].prototype); // Re-register groups (#3094) each(preserve, function (prop) { series[prop] = preserve[prop]; }); this.init(chart, newOptions); chart.linkSeries(); // Links are lost in this.remove (#3028) if (pick(redraw, true)) { chart.redraw(false); } } }); // Extend the Axis.prototype for dynamic methods extend(Axis.prototype, { /** * Update the axis with a new options structure */ update: function (newOptions, redraw) { var chart = this.chart; newOptions = chart.options[this.coll][this.options.index] = merge(this.userOptions, newOptions); this.destroy(true); this.init(chart, extend(newOptions, { events: UNDEFINED })); chart.isDirtyBox = true; if (pick(redraw, true)) { chart.redraw(); } }, /** * Remove the axis from the chart */ remove: function (redraw) { var chart = this.chart, key = this.coll, // xAxis or yAxis axisSeries = this.series, i = axisSeries.length; // Remove associated series (#2687) while (i--) { if (axisSeries[i]) { axisSeries[i].remove(false); } } // Remove the axis erase(chart.axes, this); erase(chart[key], this); chart.options[key].splice(this.options.index, 1); each(chart[key], function (axis, i) { // Re-index, #1706 axis.options.index = i; }); this.destroy(); chart.isDirtyBox = true; if (pick(redraw, true)) { chart.redraw(); } }, /** * Update the axis title by options */ setTitle: function (newTitleOptions, redraw) { this.update({ title: newTitleOptions }, redraw); }, /** * Set new axis categories and optionally redraw * @param {Array} categories * @param {Boolean} redraw */ setCategories: function (categories, redraw) { this.update({ categories: categories }, redraw); } }); /** * LineSeries object */ var LineSeries = extendClass(Series); seriesTypes.line = LineSeries; /** * Set the default options for area */ defaultPlotOptions.area = merge(defaultSeriesOptions, { softThreshold: false, threshold: 0 // trackByArea: false, // lineColor: null, // overrides color, but lets fillColor be unaltered // fillOpacity: 0.75, // fillColor: null }); /** * AreaSeries object */ var AreaSeries = extendClass(Series, { type: 'area', singleStacks: false, /** * Return an array of stacked points, where null and missing points are replaced by * dummy points in order for gaps to be drawn correctly in stacks. */ getStackPoints: function () { var series = this, segment = [], keys = [], xAxis = this.xAxis, yAxis = this.yAxis, stack = yAxis.stacks[this.stackKey], pointMap = {}, points = this.points, seriesIndex = series.index, yAxisSeries = yAxis.series, seriesLength = yAxisSeries.length, visibleSeries, upOrDown = pick(yAxis.options.reversedStacks, true) ? 1 : -1, i, x; if (this.options.stacking) { // Create a map where we can quickly look up the points by their X value. for (i = 0; i < points.length; i++) { pointMap[points[i].x] = points[i]; } // Sort the keys (#1651) for (x in stack) { if (stack[x].total !== null) { // nulled after switching between grouping and not (#1651, #2336) keys.push(x); } } keys.sort(function (a, b) { return a - b; }); visibleSeries = map(yAxisSeries, function () { return this.visible; }); each(keys, function (x, idx) { var y = 0, stackPoint, stackedValues; if (pointMap[x] && !pointMap[x].isNull) { segment.push(pointMap[x]); // Find left and right cliff. -1 goes left, 1 goes right. each([-1, 1], function (direction) { var nullName = direction === 1 ? 'rightNull' : 'leftNull', cliffName = direction === 1 ? 'rightCliff' : 'leftCliff', cliff = 0, otherStack = stack[keys[idx + direction]]; // If there is a stack next to this one, to the left or to the right... if (otherStack) { i = seriesIndex; while (i >= 0 && i < seriesLength) { // Can go either up or down, depending on reversedStacks stackPoint = otherStack.points[i]; if (!stackPoint) { // If the next point in this series is missing, mark the point // with point.leftNull or point.rightNull = true. if (i === seriesIndex) { pointMap[x][nullName] = true; // If there are missing points in the next stack in any of the // series below this one, we need to substract the missing values // and add a hiatus to the left or right. } else if (visibleSeries[i]) { stackedValues = stack[x].points[i]; if (stackedValues) { cliff -= stackedValues[1] - stackedValues[0]; } } } // When reversedStacks is true, loop up, else loop down i += upOrDown; } } pointMap[x][cliffName] = cliff; }); // There is no point for this X value in this series, so we // insert a dummy point in order for the areas to be drawn // correctly. } else { // Loop down the stack to find the series below this one that has // a value (#1991) i = seriesIndex; while (i >= 0 && i < seriesLength) { stackPoint = stack[x].points[i]; if (stackPoint) { y = stackPoint[1]; break; } // When reversedStacks is true, loop up, else loop down i += upOrDown; } y = yAxis.toPixels(y, true); segment.push({ isNull: true, plotX: xAxis.toPixels(x, true), plotY: y, yBottom: y }); } }); } return segment; }, getGraphPath: function (points) { var getGraphPath = Series.prototype.getGraphPath, graphPath, options = this.options, stacking = options.stacking, yAxis = this.yAxis, topPath, //topPoints = [], bottomPath, bottomPoints = [], graphPoints = [], seriesIndex = this.index, i, areaPath, plotX, stacks = yAxis.stacks[this.stackKey], threshold = options.threshold, translatedThreshold = yAxis.getThreshold(options.threshold), isNull, yBottom, connectNulls = options.connectNulls || stacking === 'percent', /** * To display null points in underlying stacked series, this series graph must be * broken, and the area also fall down to fill the gap left by the null point. #2069 */ addDummyPoints = function (i, otherI, side) { var point = points[i], stackedValues = stacking && stacks[point.x].points[seriesIndex], nullVal = point[side + 'Null'] || 0, cliffVal = point[side + 'Cliff'] || 0, top, bottom, isNull = true; if (cliffVal || nullVal) { top = (nullVal ? stackedValues[0] : stackedValues[1]) + cliffVal; bottom = stackedValues[0] + cliffVal; isNull = !!nullVal; } else if (!stacking && points[otherI] && points[otherI].isNull) { top = bottom = threshold; } // Add to the top and bottom line of the area if (top !== undefined) { graphPoints.push({ plotX: plotX, plotY: top === null ? translatedThreshold : yAxis.getThreshold(top), isNull: isNull }); bottomPoints.push({ plotX: plotX, plotY: bottom === null ? translatedThreshold : yAxis.getThreshold(bottom), doCurve: false // #1041, gaps in areaspline areas }); } }; // Find what points to use points = points || this.points; // Fill in missing points if (stacking) { points = this.getStackPoints(); } for (i = 0; i < points.length; i++) { isNull = points[i].isNull; plotX = pick(points[i].rectPlotX, points[i].plotX); yBottom = pick(points[i].yBottom, translatedThreshold); if (!isNull || connectNulls) { if (!connectNulls) { addDummyPoints(i, i - 1, 'left'); } if (!(isNull && !stacking && connectNulls)) { // Skip null point when stacking is false and connectNulls true graphPoints.push(points[i]); bottomPoints.push({ x: i, plotX: plotX, plotY: yBottom }); } if (!connectNulls) { addDummyPoints(i, i + 1, 'right'); } } } topPath = getGraphPath.call(this, graphPoints, true, true); bottomPoints.reversed = true; bottomPath = getGraphPath.call(this, bottomPoints, true, true); if (bottomPath.length) { bottomPath[0] = L; } areaPath = topPath.concat(bottomPath); graphPath = getGraphPath.call(this, graphPoints, false, connectNulls); // TODO: don't set leftCliff and rightCliff when connectNulls? areaPath.xMap = topPath.xMap; this.areaPath = areaPath; return graphPath; }, /** * Draw the graph and the underlying area. This method calls the Series base * function and adds the area. The areaPath is calculated in the getSegmentPath * method called from Series.prototype.drawGraph. */ drawGraph: function () { // Define or reset areaPath this.areaPath = []; // Call the base method Series.prototype.drawGraph.apply(this); // Define local variables var series = this, areaPath = this.areaPath, options = this.options, zones = this.zones, props = [['area', this.color, options.fillColor]]; // area name, main color, fill color each(zones, function (threshold, i) { props.push(['zoneArea' + i, threshold.color || series.color, threshold.fillColor || options.fillColor]); }); each(props, function (prop) { var areaKey = prop[0], area = series[areaKey], attr; // Create or update the area if (area) { // update area.endX = areaPath.xMap; area.animate({ d: areaPath }); } else { // create attr = { fill: prop[2] || prop[1], zIndex: 0 // #1069 }; if (!prop[2]) { attr['fill-opacity'] = pick(options.fillOpacity, 0.75); } area = series[areaKey] = series.chart.renderer.path(areaPath) .attr(attr) .add(series.group); area.isArea = true; } area.startX = areaPath.xMap; area.shiftUnit = options.step ? 2 : 1; }); }, drawLegendSymbol: LegendSymbolMixin.drawRectangle }); seriesTypes.area = AreaSeries; /** * Set the default options for spline */ defaultPlotOptions.spline = merge(defaultSeriesOptions); /** * SplineSeries object */ var SplineSeries = extendClass(Series, { type: 'spline', /** * Get the spline segment from a given point's previous neighbour to the given point */ getPointSpline: function (points, point, i) { var smoothing = 1.5, // 1 means control points midway between points, 2 means 1/3 from the point, 3 is 1/4 etc denom = smoothing + 1, plotX = point.plotX, plotY = point.plotY, lastPoint = points[i - 1], nextPoint = points[i + 1], leftContX, leftContY, rightContX, rightContY, ret; function doCurve(otherPoint) { return otherPoint && !otherPoint.isNull && otherPoint.doCurve !== false; } // Find control points if (doCurve(lastPoint) && doCurve(nextPoint)) { var lastX = lastPoint.plotX, lastY = lastPoint.plotY, nextX = nextPoint.plotX, nextY = nextPoint.plotY, correction = 0; leftContX = (smoothing * plotX + lastX) / denom; leftContY = (smoothing * plotY + lastY) / denom; rightContX = (smoothing * plotX + nextX) / denom; rightContY = (smoothing * plotY + nextY) / denom; // Have the two control points make a straight line through main point if (rightContX !== leftContX) { // #5016, division by zero correction = ((rightContY - leftContY) * (rightContX - plotX)) / (rightContX - leftContX) + plotY - rightContY; } leftContY += correction; rightContY += correction; // to prevent false extremes, check that control points are between // neighbouring points' y values if (leftContY > lastY && leftContY > plotY) { leftContY = mathMax(lastY, plotY); rightContY = 2 * plotY - leftContY; // mirror of left control point } else if (leftContY < lastY && leftContY < plotY) { leftContY = mathMin(lastY, plotY); rightContY = 2 * plotY - leftContY; } if (rightContY > nextY && rightContY > plotY) { rightContY = mathMax(nextY, plotY); leftContY = 2 * plotY - rightContY; } else if (rightContY < nextY && rightContY < plotY) { rightContY = mathMin(nextY, plotY); leftContY = 2 * plotY - rightContY; } // record for drawing in next point point.rightContX = rightContX; point.rightContY = rightContY; } // Visualize control points for debugging /* if (leftContX) { this.chart.renderer.circle(leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop, 2) .attr({ stroke: 'red', 'stroke-width': 2, fill: 'none', zIndex: 9 }) .add(); this.chart.renderer.path(['M', leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop, 'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop]) .attr({ stroke: 'red', 'stroke-width': 2, zIndex: 9 }) .add(); } if (rightContX) { this.chart.renderer.circle(rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop, 2) .attr({ stroke: 'green', 'stroke-width': 2, fill: 'none', zIndex: 9 }) .add(); this.chart.renderer.path(['M', rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop, 'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop]) .attr({ stroke: 'green', 'stroke-width': 2, zIndex: 9 }) .add(); } // */ ret = [ 'C', pick(lastPoint.rightContX, lastPoint.plotX), pick(lastPoint.rightContY, lastPoint.plotY), pick(leftContX, plotX), pick(leftContY, plotY), plotX, plotY ]; lastPoint.rightContX = lastPoint.rightContY = null; // reset for updating series later return ret; } }); seriesTypes.spline = SplineSeries; /** * Set the default options for areaspline */ defaultPlotOptions.areaspline = merge(defaultPlotOptions.area); /** * AreaSplineSeries object */ var areaProto = AreaSeries.prototype, AreaSplineSeries = extendClass(SplineSeries, { type: 'areaspline', getStackPoints: areaProto.getStackPoints, getGraphPath: areaProto.getGraphPath, setStackCliffs: areaProto.setStackCliffs, drawGraph: areaProto.drawGraph, drawLegendSymbol: LegendSymbolMixin.drawRectangle }); seriesTypes.areaspline = AreaSplineSeries; /** * Set the default options for column */ defaultPlotOptions.column = merge(defaultSeriesOptions, { borderColor: '#FFFFFF', //borderWidth: 1, borderRadius: 0, //colorByPoint: undefined, groupPadding: 0.2, //grouping: true, marker: null, // point options are specified in the base options pointPadding: 0.1, //pointWidth: null, minPointLength: 0, cropThreshold: 50, // when there are more points, they will not animate out of the chart on xAxis.setExtremes pointRange: null, // null means auto, meaning 1 in a categorized axis and least distance between points if not categories states: { hover: { brightness: 0.1, shadow: false, halo: false }, select: { color: '#C0C0C0', borderColor: '#000000', shadow: false } }, dataLabels: { align: null, // auto verticalAlign: null, // auto y: null }, softThreshold: false, startFromThreshold: true, // false doesn't work well: http://jsfiddle.net/highcharts/hz8fopan/14/ stickyTracking: false, tooltip: { distance: 6 }, threshold: 0 }); /** * ColumnSeries object */ var ColumnSeries = extendClass(Series, { type: 'column', pointAttrToOptions: { // mapping between SVG attributes and the corresponding options stroke: 'borderColor', fill: 'color', r: 'borderRadius' }, cropShoulder: 0, directTouch: true, // When tooltip is not shared, this series (and derivatives) requires direct touch/hover. KD-tree does not apply. trackerGroups: ['group', 'dataLabelsGroup'], negStacks: true, // use separate negative stacks, unlike area stacks where a negative // point is substracted from previous (#1910) /** * Initialize the series */ init: function () { Series.prototype.init.apply(this, arguments); var series = this, chart = series.chart; // if the series is added dynamically, force redraw of other // series affected by a new column if (chart.hasRendered) { each(chart.series, function (otherSeries) { if (otherSeries.type === series.type) { otherSeries.isDirty = true; } }); } }, /** * Return the width and x offset of the columns adjusted for grouping, groupPadding, pointPadding, * pointWidth etc. */ getColumnMetrics: function () { var series = this, options = series.options, xAxis = series.xAxis, yAxis = series.yAxis, reversedXAxis = xAxis.reversed, stackKey, stackGroups = {}, columnCount = 0; // Get the total number of column type series. // This is called on every series. Consider moving this logic to a // chart.orderStacks() function and call it on init, addSeries and removeSeries if (options.grouping === false) { columnCount = 1; } else { each(series.chart.series, function (otherSeries) { var otherOptions = otherSeries.options, otherYAxis = otherSeries.yAxis, columnIndex; if (otherSeries.type === series.type && otherSeries.visible && yAxis.len === otherYAxis.len && yAxis.pos === otherYAxis.pos) { // #642, #2086 if (otherOptions.stacking) { stackKey = otherSeries.stackKey; if (stackGroups[stackKey] === UNDEFINED) { stackGroups[stackKey] = columnCount++; } columnIndex = stackGroups[stackKey]; } else if (otherOptions.grouping !== false) { // #1162 columnIndex = columnCount++; } otherSeries.columnIndex = columnIndex; } }); } var categoryWidth = mathMin( mathAbs(xAxis.transA) * (xAxis.ordinalSlope || options.pointRange || xAxis.closestPointRange || xAxis.tickInterval || 1), // #2610 xAxis.len // #1535 ), groupPadding = categoryWidth * options.groupPadding, groupWidth = categoryWidth - 2 * groupPadding, pointOffsetWidth = groupWidth / columnCount, pointWidth = mathMin( options.maxPointWidth || xAxis.len, pick(options.pointWidth, pointOffsetWidth * (1 - 2 * options.pointPadding)) ), pointPadding = (pointOffsetWidth - pointWidth) / 2, colIndex = (series.columnIndex || 0) + (reversedXAxis ? 1 : 0), // #1251, #3737 pointXOffset = pointPadding + (groupPadding + colIndex * pointOffsetWidth - (categoryWidth / 2)) * (reversedXAxis ? -1 : 1); // Save it for reading in linked series (Error bars particularly) series.columnMetrics = { width: pointWidth, offset: pointXOffset }; return series.columnMetrics; }, /** * Make the columns crisp. The edges are rounded to the nearest full pixel. */ crispCol: function (x, y, w, h) { var chart = this.chart, borderWidth = this.borderWidth, xCrisp = -(borderWidth % 2 ? 0.5 : 0), yCrisp = borderWidth % 2 ? 0.5 : 1, right, bottom, fromTop; if (chart.inverted && chart.renderer.isVML) { yCrisp += 1; } // Horizontal. We need to first compute the exact right edge, then round it // and compute the width from there. right = Math.round(x + w) + xCrisp; x = Math.round(x) + xCrisp; w = right - x; // Vertical bottom = Math.round(y + h) + yCrisp; fromTop = mathAbs(y) <= 0.5 && bottom > 0.5; // #4504, #4656 y = Math.round(y) + yCrisp; h = bottom - y; // Top edges are exceptions if (fromTop && h) { // #5146 y -= 1; h += 1; } return { x: x, y: y, width: w, height: h }; }, /** * Translate each point to the plot area coordinate system and find shape positions */ translate: function () { var series = this, chart = series.chart, options = series.options, borderWidth = series.borderWidth = pick( options.borderWidth, series.closestPointRange * series.xAxis.transA < 2 ? 0 : 1 // #3635 ), yAxis = series.yAxis, threshold = options.threshold, translatedThreshold = series.translatedThreshold = yAxis.getThreshold(threshold), minPointLength = pick(options.minPointLength, 5), metrics = series.getColumnMetrics(), pointWidth = metrics.width, seriesBarW = series.barW = mathMax(pointWidth, 1 + 2 * borderWidth), // postprocessed for border width pointXOffset = series.pointXOffset = metrics.offset; if (chart.inverted) { translatedThreshold -= 0.5; // #3355 } // When the pointPadding is 0, we want the columns to be packed tightly, so we allow individual // columns to have individual sizes. When pointPadding is greater, we strive for equal-width // columns (#2694). if (options.pointPadding) { seriesBarW = mathCeil(seriesBarW); } Series.prototype.translate.apply(series); // Record the new values each(series.points, function (point) { var yBottom = mathMin(pick(point.yBottom, translatedThreshold), 9e4), // #3575 safeDistance = 999 + mathAbs(yBottom), plotY = mathMin(mathMax(-safeDistance, point.plotY), yAxis.len + safeDistance), // Don't draw too far outside plot area (#1303, #2241, #4264) barX = point.plotX + pointXOffset, barW = seriesBarW, barY = mathMin(plotY, yBottom), up, barH = mathMax(plotY, yBottom) - barY; // Handle options.minPointLength if (mathAbs(barH) < minPointLength) { if (minPointLength) { barH = minPointLength; up = (!yAxis.reversed && !point.negative) || (yAxis.reversed && point.negative); barY = mathAbs(barY - translatedThreshold) > minPointLength ? // stacked yBottom - minPointLength : // keep position translatedThreshold - (up ? minPointLength : 0); // #1485, #4051 } } // Cache for access in polar point.barX = barX; point.pointWidth = pointWidth; // Fix the tooltip on center of grouped columns (#1216, #424, #3648) point.tooltipPos = chart.inverted ? [yAxis.len + yAxis.pos - chart.plotLeft - plotY, series.xAxis.len - barX - barW / 2, barH] : [barX + barW / 2, plotY + yAxis.pos - chart.plotTop, barH]; // Register shape type and arguments to be used in drawPoints point.shapeType = 'rect'; point.shapeArgs = series.crispCol.apply( series, point.isNull ? [point.plotX, yAxis.len / 2, 0, 0] : // #3169, drilldown from null must have a position to work from [barX, barY, barW, barH] ); }); }, getSymbol: noop, /** * Use a solid rectangle like the area series types */ drawLegendSymbol: LegendSymbolMixin.drawRectangle, /** * Columns have no graph */ drawGraph: noop, /** * Draw the columns. For bars, the series.group is rotated, so the same coordinates * apply for columns and bars. This method is inherited by scatter series. * */ drawPoints: function () { var series = this, chart = this.chart, options = series.options, renderer = chart.renderer, animationLimit = options.animationLimit || 250, shapeArgs, pointAttr; // draw the columns each(series.points, function (point) { var plotY = point.plotY, graphic = point.graphic, borderAttr; if (isNumber(plotY) && point.y !== null) { shapeArgs = point.shapeArgs; borderAttr = defined(series.borderWidth) ? { 'stroke-width': series.borderWidth } : {}; pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || series.pointAttr[NORMAL_STATE]; if (graphic) { // update stop(graphic); graphic.attr(borderAttr).attr(pointAttr)[chart.pointCount < animationLimit ? 'animate' : 'attr'](merge(shapeArgs)); // #4267 } else { point.graphic = graphic = renderer[point.shapeType](shapeArgs) .attr(borderAttr) .attr(pointAttr) .add(point.group || series.group) .shadow(options.shadow, null, options.stacking && !options.borderRadius); } } else if (graphic) { point.graphic = graphic.destroy(); // #1269 } }); }, /** * Animate the column heights one by one from zero * @param {Boolean} init Whether to initialize the animation or run it */ animate: function (init) { var series = this, yAxis = this.yAxis, options = series.options, inverted = this.chart.inverted, attr = {}, translatedThreshold; if (hasSVG) { // VML is too slow anyway if (init) { attr.scaleY = 0.001; translatedThreshold = mathMin(yAxis.pos + yAxis.len, mathMax(yAxis.pos, yAxis.toPixels(options.threshold))); if (inverted) { attr.translateX = translatedThreshold - yAxis.len; } else { attr.translateY = translatedThreshold; } series.group.attr(attr); } else { // run the animation attr[inverted ? 'translateX' : 'translateY'] = yAxis.pos; series.group.animate(attr, extend(animObject(series.options.animation), { // Do the scale synchronously to ensure smooth updating (#5030) step: function (val, fx) { series.group.attr({ scaleY: mathMax(0.001, fx.pos) // #5250 }); } })); // delete this function to allow it only once series.animate = null; } } }, /** * Remove this series from the chart */ remove: function () { var series = this, chart = series.chart; // column and bar series affects other series of the same type // as they are either stacked or grouped if (chart.hasRendered) { each(chart.series, function (otherSeries) { if (otherSeries.type === series.type) { otherSeries.isDirty = true; } }); } Series.prototype.remove.apply(series, arguments); } }); seriesTypes.column = ColumnSeries; /** * Set the default options for bar */ defaultPlotOptions.bar = merge(defaultPlotOptions.column); /** * The Bar series class */ var BarSeries = extendClass(ColumnSeries, { type: 'bar', inverted: true }); seriesTypes.bar = BarSeries; /** * Set the default options for scatter */ defaultPlotOptions.scatter = merge(defaultSeriesOptions, { lineWidth: 0, marker: { enabled: true // Overrides auto-enabling in line series (#3647) }, tooltip: { headerFormat: '<span style="color:{point.color}">\u25CF</span> <span style="font-size: 10px;"> {series.name}</span><br/>', pointFormat: 'x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>' } }); /** * The scatter series class */ var ScatterSeries = extendClass(Series, { type: 'scatter', sorted: false, requireSorting: false, noSharedTooltip: true, trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'], takeOrdinalPosition: false, // #2342 kdDimensions: 2, drawGraph: function () { if (this.options.lineWidth) { Series.prototype.drawGraph.call(this); } } }); seriesTypes.scatter = ScatterSeries; /** * Set the default options for pie */ defaultPlotOptions.pie = merge(defaultSeriesOptions, { borderColor: '#FFFFFF', borderWidth: 1, center: [null, null], clip: false, colorByPoint: true, // always true for pies dataLabels: { // align: null, // connectorWidth: 1, // connectorColor: point.color, // connectorPadding: 5, distance: 30, enabled: true, formatter: function () { // #2945 return this.y === null ? undefined : this.point.name; }, // softConnector: true, x: 0 // y: 0 }, ignoreHiddenPoint: true, //innerSize: 0, legendType: 'point', marker: null, // point options are specified in the base options size: null, showInLegend: false, slicedOffset: 10, states: { hover: { brightness: 0.1, shadow: false } }, stickyTracking: false, tooltip: { followPointer: true } }); /** * Extended point object for pies */ var PiePoint = extendClass(Point, { /** * Initiate the pie slice */ init: function () { Point.prototype.init.apply(this, arguments); var point = this, toggleSlice; point.name = pick(point.name, 'Slice'); // add event listener for select toggleSlice = function (e) { point.slice(e.type === 'select'); }; addEvent(point, 'select', toggleSlice); addEvent(point, 'unselect', toggleSlice); return point; }, /** * Toggle the visibility of the pie slice * @param {Boolean} vis Whether to show the slice or not. If undefined, the * visibility is toggled */ setVisible: function (vis, redraw) { var point = this, series = point.series, chart = series.chart, ignoreHiddenPoint = series.options.ignoreHiddenPoint; redraw = pick(redraw, ignoreHiddenPoint); if (vis !== point.visible) { // If called without an argument, toggle visibility point.visible = point.options.visible = vis = vis === UNDEFINED ? !point.visible : vis; series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data // Show and hide associated elements. This is performed regardless of redraw or not, // because chart.redraw only handles full series. each(['graphic', 'dataLabel', 'connector', 'shadowGroup'], function (key) { if (point[key]) { point[key][vis ? 'show' : 'hide'](true); } }); if (point.legendItem) { chart.legend.colorizeItem(point, vis); } // #4170, hide halo after hiding point if (!vis && point.state === 'hover') { point.setState(''); } // Handle ignore hidden slices if (ignoreHiddenPoint) { series.isDirty = true; } if (redraw) { chart.redraw(); } } }, /** * Set or toggle whether the slice is cut out from the pie * @param {Boolean} sliced When undefined, the slice state is toggled * @param {Boolean} redraw Whether to redraw the chart. True by default. */ slice: function (sliced, redraw, animation) { var point = this, series = point.series, chart = series.chart, translation; setAnimation(animation, chart); // redraw is true by default redraw = pick(redraw, true); // if called without an argument, toggle point.sliced = point.options.sliced = sliced = defined(sliced) ? sliced : !point.sliced; series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data translation = sliced ? point.slicedTranslation : { translateX: 0, translateY: 0 }; point.graphic.animate(translation); if (point.shadowGroup) { point.shadowGroup.animate(translation); } }, haloPath: function (size) { var shapeArgs = this.shapeArgs, chart = this.series.chart; return this.sliced || !this.visible ? [] : this.series.chart.renderer.symbols.arc(chart.plotLeft + shapeArgs.x, chart.plotTop + shapeArgs.y, shapeArgs.r + size, shapeArgs.r + size, { innerR: this.shapeArgs.r, start: shapeArgs.start, end: shapeArgs.end }); } }); /** * The Pie series class */ var PieSeries = { type: 'pie', isCartesian: false, pointClass: PiePoint, requireSorting: false, directTouch: true, noSharedTooltip: true, trackerGroups: ['group', 'dataLabelsGroup'], axisTypes: [], pointAttrToOptions: { // mapping between SVG attributes and the corresponding options stroke: 'borderColor', 'stroke-width': 'borderWidth', fill: 'color' }, /** * Animate the pies in */ animate: function (init) { var series = this, points = series.points, startAngleRad = series.startAngleRad; if (!init) { each(points, function (point) { var graphic = point.graphic, args = point.shapeArgs; if (graphic) { // start values graphic.attr({ r: point.startR || (series.center[3] / 2), // animate from inner radius (#779) start: startAngleRad, end: startAngleRad }); // animate graphic.animate({ r: args.r, start: args.start, end: args.end }, series.options.animation); } }); // delete this function to allow it only once series.animate = null; } }, /** * Recompute total chart sum and update percentages of points. */ updateTotals: function () { var i, total = 0, points = this.points, len = points.length, point, ignoreHiddenPoint = this.options.ignoreHiddenPoint; // Get the total sum for (i = 0; i < len; i++) { point = points[i]; // Disallow negative values (#1530, #3623, #5322) if (point.y < 0) { point.y = null; } total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y; } this.total = total; // Set each point's properties for (i = 0; i < len; i++) { point = points[i]; point.percentage = (total > 0 && (point.visible || !ignoreHiddenPoint)) ? point.y / total * 100 : 0; point.total = total; } }, /** * Extend the generatePoints method by adding total and percentage properties to each point */ generatePoints: function () { Series.prototype.generatePoints.call(this); this.updateTotals(); }, /** * Do translation for pie slices */ translate: function (positions) { this.generatePoints(); var series = this, cumulative = 0, precision = 1000, // issue #172 options = series.options, slicedOffset = options.slicedOffset, connectorOffset = slicedOffset + options.borderWidth, start, end, angle, startAngle = options.startAngle || 0, startAngleRad = series.startAngleRad = mathPI / 180 * (startAngle - 90), endAngleRad = series.endAngleRad = mathPI / 180 * ((pick(options.endAngle, startAngle + 360)) - 90), circ = endAngleRad - startAngleRad, //2 * mathPI, points = series.points, radiusX, // the x component of the radius vector for a given point radiusY, labelDistance = options.dataLabels.distance, ignoreHiddenPoint = options.ignoreHiddenPoint, i, len = points.length, point; // Get positions - either an integer or a percentage string must be given. // If positions are passed as a parameter, we're in a recursive loop for adjusting // space for data labels. if (!positions) { series.center = positions = series.getCenter(); } // utility for getting the x value from a given y, used for anticollision logic in data labels series.getX = function (y, left) { angle = math.asin(mathMin((y - positions[1]) / (positions[2] / 2 + labelDistance), 1)); return positions[0] + (left ? -1 : 1) * (mathCos(angle) * (positions[2] / 2 + labelDistance)); }; // Calculate the geometry for each point for (i = 0; i < len; i++) { point = points[i]; // set start and end angle start = startAngleRad + (cumulative * circ); if (!ignoreHiddenPoint || point.visible) { cumulative += point.percentage / 100; } end = startAngleRad + (cumulative * circ); // set the shape point.shapeType = 'arc'; point.shapeArgs = { x: positions[0], y: positions[1], r: positions[2] / 2, innerR: positions[3] / 2, start: mathRound(start * precision) / precision, end: mathRound(end * precision) / precision }; // The angle must stay within -90 and 270 (#2645) angle = (end + start) / 2; if (angle > 1.5 * mathPI) { angle -= 2 * mathPI; } else if (angle < -mathPI / 2) { angle += 2 * mathPI; } // Center for the sliced out slice point.slicedTranslation = { translateX: mathRound(mathCos(angle) * slicedOffset), translateY: mathRound(mathSin(angle) * slicedOffset) }; // set the anchor point for tooltips radiusX = mathCos(angle) * positions[2] / 2; radiusY = mathSin(angle) * positions[2] / 2; point.tooltipPos = [ positions[0] + radiusX * 0.7, positions[1] + radiusY * 0.7 ]; point.half = angle < -mathPI / 2 || angle > mathPI / 2 ? 1 : 0; point.angle = angle; // set the anchor point for data labels connectorOffset = mathMin(connectorOffset, labelDistance / 2); // #1678 point.labelPos = [ positions[0] + radiusX + mathCos(angle) * labelDistance, // first break of connector positions[1] + radiusY + mathSin(angle) * labelDistance, // a/a positions[0] + radiusX + mathCos(angle) * connectorOffset, // second break, right outside pie positions[1] + radiusY + mathSin(angle) * connectorOffset, // a/a positions[0] + radiusX, // landing point for connector positions[1] + radiusY, // a/a labelDistance < 0 ? // alignment 'center' : point.half ? 'right' : 'left', // alignment angle // center angle ]; } }, drawGraph: null, /** * Draw the data points */ drawPoints: function () { var series = this, chart = series.chart, renderer = chart.renderer, groupTranslation, //center, graphic, //group, shadow = series.options.shadow, shadowGroup, pointAttr, shapeArgs, attr; if (shadow && !series.shadowGroup) { series.shadowGroup = renderer.g('shadow') .add(series.group); } // draw the slices each(series.points, function (point) { if (point.y !== null) { graphic = point.graphic; shapeArgs = point.shapeArgs; shadowGroup = point.shadowGroup; pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE]; if (!pointAttr.stroke) { pointAttr.stroke = pointAttr.fill; } // put the shadow behind all points if (shadow && !shadowGroup) { shadowGroup = point.shadowGroup = renderer.g('shadow') .add(series.shadowGroup); } // if the point is sliced, use special translation, else use plot area traslation groupTranslation = point.sliced ? point.slicedTranslation : { translateX: 0, translateY: 0 }; //group.translate(groupTranslation[0], groupTranslation[1]); if (shadowGroup) { shadowGroup.attr(groupTranslation); } // draw the slice if (graphic) { graphic .setRadialReference(series.center) .attr(pointAttr) .animate(extend(shapeArgs, groupTranslation)); } else { attr = { 'stroke-linejoin': 'round' }; if (!point.visible) { attr.visibility = 'hidden'; } point.graphic = graphic = renderer[point.shapeType](shapeArgs) .setRadialReference(series.center) .attr(pointAttr) .attr(attr) .attr(groupTranslation) .add(series.group) .shadow(shadow, shadowGroup); } } }); }, searchPoint: noop, /** * Utility for sorting data labels */ sortByAngle: function (points, sign) { points.sort(function (a, b) { return a.angle !== undefined && (b.angle - a.angle) * sign; }); }, /** * Use a simple symbol from LegendSymbolMixin */ drawLegendSymbol: LegendSymbolMixin.drawRectangle, /** * Use the getCenter method from drawLegendSymbol */ getCenter: CenteredSeriesMixin.getCenter, /** * Pies don't have point marker symbols */ getSymbol: noop }; PieSeries = extendClass(Series, PieSeries); seriesTypes.pie = PieSeries; /** * Draw the data labels */ Series.prototype.drawDataLabels = function () { var series = this, seriesOptions = series.options, cursor = seriesOptions.cursor, options = seriesOptions.dataLabels, points = series.points, pointOptions, generalOptions, hasRendered = series.hasRendered || 0, str, dataLabelsGroup, defer = pick(options.defer, true), renderer = series.chart.renderer; if (options.enabled || series._hasPointLabels) { // Process default alignment of data labels for columns if (series.dlProcessOptions) { series.dlProcessOptions(options); } // Create a separate group for the data labels to avoid rotation dataLabelsGroup = series.plotGroup( 'dataLabelsGroup', 'data-labels', defer && !hasRendered ? 'hidden' : 'visible', // #5133 options.zIndex || 6 ); if (defer) { dataLabelsGroup.attr({ opacity: +hasRendered }); // #3300 if (!hasRendered) { addEvent(series, 'afterAnimate', function () { if (series.visible) { // #2597, #3023, #3024 dataLabelsGroup.show(true); } dataLabelsGroup[seriesOptions.animation ? 'animate' : 'attr']({ opacity: 1 }, { duration: 200 }); }); } } // Make the labels for each point generalOptions = options; each(points, function (point) { var enabled, dataLabel = point.dataLabel, labelConfig, attr, name, rotation, connector = point.connector, isNew = true, style, moreStyle = {}; // Determine if each data label is enabled pointOptions = point.dlOptions || (point.options && point.options.dataLabels); // dlOptions is used in treemaps enabled = pick(pointOptions && pointOptions.enabled, generalOptions.enabled) && point.y !== null; // #2282, #4641 // If the point is outside the plot area, destroy it. #678, #820 if (dataLabel && !enabled) { point.dataLabel = dataLabel.destroy(); // Individual labels are disabled if the are explicitly disabled // in the point options, or if they fall outside the plot area. } else if (enabled) { // Create individual options structure that can be extended without // affecting others options = merge(generalOptions, pointOptions); style = options.style; rotation = options.rotation; // Get the string labelConfig = point.getLabelConfig(); str = options.format ? format(options.format, labelConfig) : options.formatter.call(labelConfig, options); // Determine the color style.color = pick(options.color, style.color, series.color, 'black'); // update existing label if (dataLabel) { if (defined(str)) { dataLabel .attr({ text: str }); isNew = false; } else { // #1437 - the label is shown conditionally point.dataLabel = dataLabel = dataLabel.destroy(); if (connector) { point.connector = connector.destroy(); } } // create new label } else if (defined(str)) { attr = { //align: align, fill: options.backgroundColor, stroke: options.borderColor, 'stroke-width': options.borderWidth, r: options.borderRadius || 0, rotation: rotation, padding: options.padding, zIndex: 1 }; // Get automated contrast color if (style.color === 'contrast') { moreStyle.color = options.inside || options.distance < 0 || !!seriesOptions.stacking ? renderer.getContrast(point.color || series.color) : '#000000'; } if (cursor) { moreStyle.cursor = cursor; } // Remove unused attributes (#947) for (name in attr) { if (attr[name] === UNDEFINED) { delete attr[name]; } } dataLabel = point.dataLabel = renderer[rotation ? 'text' : 'label']( // labels don't support rotation str, 0, -9999, options.shape, null, null, options.useHTML ) .attr(attr) .css(extend(style, moreStyle)) .add(dataLabelsGroup) .shadow(options.shadow); } if (dataLabel) { // Now the data label is created and placed at 0,0, so we need to align it series.alignDataLabel(point, dataLabel, options, null, isNew); } } }); } }; /** * Align each individual data label */ Series.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) { var chart = this.chart, inverted = chart.inverted, plotX = pick(point.plotX, -9999), plotY = pick(point.plotY, -9999), bBox = dataLabel.getBBox(), baseline = chart.renderer.fontMetrics(options.style.fontSize).b, rotation = options.rotation, normRotation, negRotation, align = options.align, rotCorr, // rotation correction // Math.round for rounding errors (#2683), alignTo to allow column labels (#2700) visible = this.visible && (point.series.forceDL || chart.isInsidePlot(plotX, mathRound(plotY), inverted) || (alignTo && chart.isInsidePlot(plotX, inverted ? alignTo.x + 1 : alignTo.y + alignTo.height - 1, inverted))), alignAttr, // the final position; justify = pick(options.overflow, 'justify') === 'justify'; if (visible) { // The alignment box is a singular point alignTo = extend({ x: inverted ? chart.plotWidth - plotY : plotX, y: mathRound(inverted ? chart.plotHeight - plotX : plotY), width: 0, height: 0 }, alignTo); // Add the text size for alignment calculation extend(options, { width: bBox.width, height: bBox.height }); // Allow a hook for changing alignment in the last moment, then do the alignment if (rotation) { justify = false; // Not supported for rotated text rotCorr = chart.renderer.rotCorr(baseline, rotation); // #3723 alignAttr = { x: alignTo.x + options.x + alignTo.width / 2 + rotCorr.x, y: alignTo.y + options.y + { top: 0, middle: 0.5, bottom: 1 }[options.verticalAlign] * alignTo.height }; dataLabel[isNew ? 'attr' : 'animate'](alignAttr) .attr({ // #3003 align: align }); // Compensate for the rotated label sticking out on the sides normRotation = (rotation + 720) % 360; negRotation = normRotation > 180 && normRotation < 360; if (align === 'left') { alignAttr.y -= negRotation ? bBox.height : 0; } else if (align === 'center') { alignAttr.x -= bBox.width / 2; alignAttr.y -= bBox.height / 2; } else if (align === 'right') { alignAttr.x -= bBox.width; alignAttr.y -= negRotation ? 0 : bBox.height; } } else { dataLabel.align(options, null, alignTo); alignAttr = dataLabel.alignAttr; } // Handle justify or crop if (justify) { this.justifyDataLabel(dataLabel, options, alignAttr, bBox, alignTo, isNew); // Now check that the data label is within the plot area } else if (pick(options.crop, true)) { visible = chart.isInsidePlot(alignAttr.x, alignAttr.y) && chart.isInsidePlot(alignAttr.x + bBox.width, alignAttr.y + bBox.height); } // When we're using a shape, make it possible with a connector or an arrow pointing to thie point if (options.shape && !rotation) { dataLabel.attr({ anchorX: point.plotX, anchorY: point.plotY }); } } // Show or hide based on the final aligned position if (!visible) { stop(dataLabel); dataLabel.attr({ y: -9999 }); dataLabel.placed = false; // don't animate back in } }; /** * If data labels fall partly outside the plot area, align them back in, in a way that * doesn't hide the point. */ Series.prototype.justifyDataLabel = function (dataLabel, options, alignAttr, bBox, alignTo, isNew) { var chart = this.chart, align = options.align, verticalAlign = options.verticalAlign, off, justified, padding = dataLabel.box ? 0 : (dataLabel.padding || 0); // Off left off = alignAttr.x + padding; if (off < 0) { if (align === 'right') { options.align = 'left'; } else { options.x = -off; } justified = true; } // Off right off = alignAttr.x + bBox.width - padding; if (off > chart.plotWidth) { if (align === 'left') { options.align = 'right'; } else { options.x = chart.plotWidth - off; } justified = true; } // Off top off = alignAttr.y + padding; if (off < 0) { if (verticalAlign === 'bottom') { options.verticalAlign = 'top'; } else { options.y = -off; } justified = true; } // Off bottom off = alignAttr.y + bBox.height - padding; if (off > chart.plotHeight) { if (verticalAlign === 'top') { options.verticalAlign = 'bottom'; } else { options.y = chart.plotHeight - off; } justified = true; } if (justified) { dataLabel.placed = !isNew; dataLabel.align(options, null, alignTo); } }; /** * Override the base drawDataLabels method by pie specific functionality */ if (seriesTypes.pie) { seriesTypes.pie.prototype.drawDataLabels = function () { var series = this, data = series.data, point, chart = series.chart, options = series.options.dataLabels, connectorPadding = pick(options.connectorPadding, 10), connectorWidth = pick(options.connectorWidth, 1), plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, connector, connectorPath, softConnector = pick(options.softConnector, true), distanceOption = options.distance, seriesCenter = series.center, radius = seriesCenter[2] / 2, centerY = seriesCenter[1], outside = distanceOption > 0, dataLabel, dataLabelWidth, labelPos, labelHeight, halves = [// divide the points into right and left halves for anti collision [], // right [] // left ], x, y, visibility, rankArr, i, j, overflow = [0, 0, 0, 0], // top, right, bottom, left sort = function (a, b) { return b.y - a.y; }; // get out if not enabled if (!series.visible || (!options.enabled && !series._hasPointLabels)) { return; } // run parent method Series.prototype.drawDataLabels.apply(series); each(data, function (point) { if (point.dataLabel && point.visible) { // #407, #2510 // Arrange points for detection collision halves[point.half].push(point); // Reset positions (#4905) point.dataLabel._pos = null; } }); /* Loop over the points in each half, starting from the top and bottom * of the pie to detect overlapping labels. */ i = 2; while (i--) { var slots = [], slotsLength, usedSlots = [], points = halves[i], pos, bottom, length = points.length, slotIndex; if (!length) { continue; } // Sort by angle series.sortByAngle(points, i - 0.5); // Assume equal label heights on either hemisphere (#2630) j = labelHeight = 0; while (!labelHeight && points[j]) { // #1569 labelHeight = points[j] && points[j].dataLabel && (points[j].dataLabel.getBBox().height || 21); // 21 is for #968 j++; } // Only do anti-collision when we are outside the pie and have connectors (#856) if (distanceOption > 0) { // Build the slots bottom = mathMin(centerY + radius + distanceOption, chart.plotHeight); for (pos = mathMax(0, centerY - radius - distanceOption); pos <= bottom; pos += labelHeight) { slots.push(pos); } slotsLength = slots.length; /* Visualize the slots if (!series.slotElements) { series.slotElements = []; } if (i === 1) { series.slotElements.forEach(function (elem) { elem.destroy(); }); series.slotElements.length = 0; } slots.forEach(function (pos, no) { var slotX = series.getX(pos, i) + chart.plotLeft - (i ? 100 : 0), slotY = pos + chart.plotTop; if (isNumber(slotX)) { series.slotElements.push(chart.renderer.rect(slotX, slotY - 7, 100, labelHeight, 1) .attr({ 'stroke-width': 1, stroke: 'silver', fill: 'rgba(0,0,255,0.1)' }) .add()); series.slotElements.push(chart.renderer.text('Slot '+ no, slotX, slotY + 4) .attr({ fill: 'silver' }).add()); } }); // */ // if there are more values than available slots, remove lowest values if (length > slotsLength) { // create an array for sorting and ranking the points within each quarter rankArr = [].concat(points); rankArr.sort(sort); j = length; while (j--) { rankArr[j].rank = j; } j = length; while (j--) { if (points[j].rank >= slotsLength) { points.splice(j, 1); } } length = points.length; } // The label goes to the nearest open slot, but not closer to the edge than // the label's index. for (j = 0; j < length; j++) { point = points[j]; labelPos = point.labelPos; var closest = 9999, distance, slotI; // find the closest slot index for (slotI = 0; slotI < slotsLength; slotI++) { distance = mathAbs(slots[slotI] - labelPos[1]); if (distance < closest) { closest = distance; slotIndex = slotI; } } // if that slot index is closer to the edges of the slots, move it // to the closest appropriate slot if (slotIndex < j && slots[j] !== null) { // cluster at the top slotIndex = j; } else if (slotsLength < length - j + slotIndex && slots[j] !== null) { // cluster at the bottom slotIndex = slotsLength - length + j; while (slots[slotIndex] === null) { // make sure it is not taken slotIndex++; } } else { // Slot is taken, find next free slot below. In the next run, the next slice will find the // slot above these, because it is the closest one while (slots[slotIndex] === null) { // make sure it is not taken slotIndex++; } } usedSlots.push({ i: slotIndex, y: slots[slotIndex] }); slots[slotIndex] = null; // mark as taken } // sort them in order to fill in from the top usedSlots.sort(sort); } // now the used slots are sorted, fill them up sequentially for (j = 0; j < length; j++) { var slot, naturalY; point = points[j]; labelPos = point.labelPos; dataLabel = point.dataLabel; visibility = point.visible === false ? HIDDEN : 'inherit'; naturalY = labelPos[1]; if (distanceOption > 0) { slot = usedSlots.pop(); slotIndex = slot.i; // if the slot next to currrent slot is free, the y value is allowed // to fall back to the natural position y = slot.y; if ((naturalY > y && slots[slotIndex + 1] !== null) || (naturalY < y && slots[slotIndex - 1] !== null)) { y = mathMin(mathMax(0, naturalY), chart.plotHeight); } } else { y = naturalY; } // get the x - use the natural x position for first and last slot, to prevent the top // and botton slice connectors from touching each other on either side x = options.justify ? seriesCenter[0] + (i ? -1 : 1) * (radius + distanceOption) : series.getX(y === centerY - radius - distanceOption || y === centerY + radius + distanceOption ? naturalY : y, i); // Record the placement and visibility dataLabel._attr = { visibility: visibility, align: labelPos[6] }; dataLabel._pos = { x: x + options.x + ({ left: connectorPadding, right: -connectorPadding }[labelPos[6]] || 0), y: y + options.y - 10 // 10 is for the baseline (label vs text) }; dataLabel.connX = x; dataLabel.connY = y; // Detect overflowing data labels if (this.options.size === null) { dataLabelWidth = dataLabel.width; // Overflow left if (x - dataLabelWidth < connectorPadding) { overflow[3] = mathMax(mathRound(dataLabelWidth - x + connectorPadding), overflow[3]); // Overflow right } else if (x + dataLabelWidth > plotWidth - connectorPadding) { overflow[1] = mathMax(mathRound(x + dataLabelWidth - plotWidth + connectorPadding), overflow[1]); } // Overflow top if (y - labelHeight / 2 < 0) { overflow[0] = mathMax(mathRound(-y + labelHeight / 2), overflow[0]); // Overflow left } else if (y + labelHeight / 2 > plotHeight) { overflow[2] = mathMax(mathRound(y + labelHeight / 2 - plotHeight), overflow[2]); } } } // for each point } // for each half // Do not apply the final placement and draw the connectors until we have verified // that labels are not spilling over. if (arrayMax(overflow) === 0 || this.verifyDataLabelOverflow(overflow)) { // Place the labels in the final position this.placeDataLabels(); // Draw the connectors if (outside && connectorWidth) { each(this.points, function (point) { connector = point.connector; labelPos = point.labelPos; dataLabel = point.dataLabel; if (dataLabel && dataLabel._pos && point.visible) { visibility = dataLabel._attr.visibility; x = dataLabel.connX; y = dataLabel.connY; connectorPath = softConnector ? [ M, x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label 'C', x, y, // first break, next to the label 2 * labelPos[2] - labelPos[4], 2 * labelPos[3] - labelPos[5], labelPos[2], labelPos[3], // second break L, labelPos[4], labelPos[5] // base ] : [ M, x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label L, labelPos[2], labelPos[3], // second break L, labelPos[4], labelPos[5] // base ]; if (connector) { connector.animate({ d: connectorPath }); connector.attr('visibility', visibility); } else { point.connector = connector = series.chart.renderer.path(connectorPath).attr({ 'stroke-width': connectorWidth, stroke: options.connectorColor || point.color || '#606060', visibility: visibility //zIndex: 0 // #2722 (reversed) }) .add(series.dataLabelsGroup); } } else if (connector) { point.connector = connector.destroy(); } }); } } }; /** * Perform the final placement of the data labels after we have verified that they * fall within the plot area. */ seriesTypes.pie.prototype.placeDataLabels = function () { each(this.points, function (point) { var dataLabel = point.dataLabel, _pos; if (dataLabel && point.visible) { _pos = dataLabel._pos; if (_pos) { dataLabel.attr(dataLabel._attr); dataLabel[dataLabel.moved ? 'animate' : 'attr'](_pos); dataLabel.moved = true; } else if (dataLabel) { dataLabel.attr({ y: -9999 }); } } }); }; seriesTypes.pie.prototype.alignDataLabel = noop; /** * Verify whether the data labels are allowed to draw, or we should run more translation and data * label positioning to keep them inside the plot area. Returns true when data labels are ready * to draw. */ seriesTypes.pie.prototype.verifyDataLabelOverflow = function (overflow) { var center = this.center, options = this.options, centerOption = options.center, minSize = options.minSize || 80, newSize = minSize, ret; // Handle horizontal size and center if (centerOption[0] !== null) { // Fixed center newSize = mathMax(center[2] - mathMax(overflow[1], overflow[3]), minSize); } else { // Auto center newSize = mathMax( center[2] - overflow[1] - overflow[3], // horizontal overflow minSize ); center[0] += (overflow[3] - overflow[1]) / 2; // horizontal center } // Handle vertical size and center if (centerOption[1] !== null) { // Fixed center newSize = mathMax(mathMin(newSize, center[2] - mathMax(overflow[0], overflow[2])), minSize); } else { // Auto center newSize = mathMax( mathMin( newSize, center[2] - overflow[0] - overflow[2] // vertical overflow ), minSize ); center[1] += (overflow[0] - overflow[2]) / 2; // vertical center } // If the size must be decreased, we need to run translate and drawDataLabels again if (newSize < center[2]) { center[2] = newSize; center[3] = Math.min(relativeLength(options.innerSize || 0, newSize), newSize); // #3632 this.translate(center); if (this.drawDataLabels) { this.drawDataLabels(); } // Else, return true to indicate that the pie and its labels is within the plot area } else { ret = true; } return ret; }; } if (seriesTypes.column) { /** * Override the basic data label alignment by adjusting for the position of the column */ seriesTypes.column.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) { var inverted = this.chart.inverted, series = point.series, dlBox = point.dlBox || point.shapeArgs, // data label box for alignment below = pick(point.below, point.plotY > pick(this.translatedThreshold, series.yAxis.len)), // point.below is used in range series inside = pick(options.inside, !!this.options.stacking), // draw it inside the box? overshoot; // Align to the column itself, or the top of it if (dlBox) { // Area range uses this method but not alignTo alignTo = merge(dlBox); if (alignTo.y < 0) { alignTo.height += alignTo.y; alignTo.y = 0; } overshoot = alignTo.y + alignTo.height - series.yAxis.len; if (overshoot > 0) { alignTo.height -= overshoot; } if (inverted) { alignTo = { x: series.yAxis.len - alignTo.y - alignTo.height, y: series.xAxis.len - alignTo.x - alignTo.width, width: alignTo.height, height: alignTo.width }; } // Compute the alignment box if (!inside) { if (inverted) { alignTo.x += below ? 0 : alignTo.width; alignTo.width = 0; } else { alignTo.y += below ? alignTo.height : 0; alignTo.height = 0; } } } // When alignment is undefined (typically columns and bars), display the individual // point below or above the point depending on the threshold options.align = pick( options.align, !inverted || inside ? 'center' : below ? 'right' : 'left' ); options.verticalAlign = pick( options.verticalAlign, inverted || inside ? 'middle' : below ? 'top' : 'bottom' ); // Call the parent method Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew); }; } /** * Highcharts module to hide overlapping data labels. This module is included in Highcharts. */ (function (H) { var Chart = H.Chart, each = H.each, pick = H.pick, addEvent = H.addEvent; // Collect potensial overlapping data labels. Stack labels probably don't need to be // considered because they are usually accompanied by data labels that lie inside the columns. Chart.prototype.callbacks.push(function (chart) { function collectAndHide() { var labels = []; each(chart.series, function (series) { var dlOptions = series.options.dataLabels, collections = series.dataLabelCollections || ['dataLabel']; // Range series have two collections if ((dlOptions.enabled || series._hasPointLabels) && !dlOptions.allowOverlap && series.visible) { // #3866 each(collections, function (coll) { each(series.points, function (point) { if (point[coll]) { point[coll].labelrank = pick(point.labelrank, point.shapeArgs && point.shapeArgs.height); // #4118 labels.push(point[coll]); } }); }); } }); chart.hideOverlappingLabels(labels); } // Do it now ... collectAndHide(); // ... and after each chart redraw addEvent(chart, 'redraw', collectAndHide); }); /** * Hide overlapping labels. Labels are moved and faded in and out on zoom to provide a smooth * visual imression. */ Chart.prototype.hideOverlappingLabels = function (labels) { var len = labels.length, label, i, j, label1, label2, isIntersecting, pos1, pos2, parent1, parent2, padding, intersectRect = function (x1, y1, w1, h1, x2, y2, w2, h2) { return !( x2 > x1 + w1 || x2 + w2 < x1 || y2 > y1 + h1 || y2 + h2 < y1 ); }; // Mark with initial opacity for (i = 0; i < len; i++) { label = labels[i]; if (label) { label.oldOpacity = label.opacity; label.newOpacity = 1; } } // Prevent a situation in a gradually rising slope, that each label // will hide the previous one because the previous one always has // lower rank. labels.sort(function (a, b) { return (b.labelrank || 0) - (a.labelrank || 0); }); // Detect overlapping labels for (i = 0; i < len; i++) { label1 = labels[i]; for (j = i + 1; j < len; ++j) { label2 = labels[j]; if (label1 && label2 && label1.placed && label2.placed && label1.newOpacity !== 0 && label2.newOpacity !== 0) { pos1 = label1.alignAttr; pos2 = label2.alignAttr; parent1 = label1.parentGroup; // Different panes have different positions parent2 = label2.parentGroup; padding = 2 * (label1.box ? 0 : label1.padding); // Substract the padding if no background or border (#4333) isIntersecting = intersectRect( pos1.x + parent1.translateX, pos1.y + parent1.translateY, label1.width - padding, label1.height - padding, pos2.x + parent2.translateX, pos2.y + parent2.translateY, label2.width - padding, label2.height - padding ); if (isIntersecting) { (label1.labelrank < label2.labelrank ? label1 : label2).newOpacity = 0; } } } } // Hide or show each(labels, function (label) { var complete, newOpacity; if (label) { newOpacity = label.newOpacity; if (label.oldOpacity !== newOpacity && label.placed) { // Make sure the label is completely hidden to avoid catching clicks (#4362) if (newOpacity) { label.show(true); } else { complete = function () { label.hide(); }; } // Animate or set the opacity label.alignAttr.opacity = newOpacity; label[label.isOld ? 'animate' : 'attr'](label.alignAttr, null, complete); } label.isOld = true; } }); }; }(Highcharts)); /** * TrackerMixin for points and graphs */ var TrackerMixin = Highcharts.TrackerMixin = { drawTrackerPoint: function () { var series = this, chart = series.chart, pointer = chart.pointer, cursor = series.options.cursor, css = cursor && { cursor: cursor }, onMouseOver = function (e) { var target = e.target, point; while (target && !point) { point = target.point; target = target.parentNode; } if (point !== UNDEFINED && point !== chart.hoverPoint) { // undefined on graph in scatterchart point.onMouseOver(e); } }; // Add reference to the point each(series.points, function (point) { if (point.graphic) { point.graphic.element.point = point; } if (point.dataLabel) { point.dataLabel.element.point = point; } }); // Add the event listeners, we need to do this only once if (!series._hasTracking) { each(series.trackerGroups, function (key) { if (series[key]) { // we don't always have dataLabelsGroup series[key] .addClass(PREFIX + 'tracker') .on('mouseover', onMouseOver) .on('mouseout', function (e) { pointer.onTrackerMouseOut(e); }) .css(css); if (hasTouch) { series[key].on('touchstart', onMouseOver); } } }); series._hasTracking = true; } }, /** * Draw the tracker object that sits above all data labels and markers to * track mouse events on the graph or points. For the line type charts * the tracker uses the same graphPath, but with a greater stroke width * for better control. */ drawTrackerGraph: function () { var series = this, options = series.options, trackByArea = options.trackByArea, trackerPath = [].concat(trackByArea ? series.areaPath : series.graphPath), trackerPathLength = trackerPath.length, chart = series.chart, pointer = chart.pointer, renderer = chart.renderer, snap = chart.options.tooltip.snap, tracker = series.tracker, cursor = options.cursor, css = cursor && { cursor: cursor }, i, onMouseOver = function () { if (chart.hoverSeries !== series) { series.onMouseOver(); } }, /* * Empirical lowest possible opacities for TRACKER_FILL for an element to stay invisible but clickable * IE6: 0.002 * IE7: 0.002 * IE8: 0.002 * IE9: 0.00000000001 (unlimited) * IE10: 0.0001 (exporting only) * FF: 0.00000000001 (unlimited) * Chrome: 0.000001 * Safari: 0.000001 * Opera: 0.00000000001 (unlimited) */ TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.0001 : 0.002) + ')'; // Extend end points. A better way would be to use round linecaps, // but those are not clickable in VML. if (trackerPathLength && !trackByArea) { i = trackerPathLength + 1; while (i--) { if (trackerPath[i] === M) { // extend left side trackerPath.splice(i + 1, 0, trackerPath[i + 1] - snap, trackerPath[i + 2], L); } if ((i && trackerPath[i] === M) || i === trackerPathLength) { // extend right side trackerPath.splice(i, 0, L, trackerPath[i - 2] + snap, trackerPath[i - 1]); } } } // handle single points /*for (i = 0; i < singlePoints.length; i++) { singlePoint = singlePoints[i]; trackerPath.push(M, singlePoint.plotX - snap, singlePoint.plotY, L, singlePoint.plotX + snap, singlePoint.plotY); }*/ // draw the tracker if (tracker) { tracker.attr({ d: trackerPath }); } else { // create series.tracker = renderer.path(trackerPath) .attr({ 'stroke-linejoin': 'round', // #1225 visibility: series.visible ? VISIBLE : HIDDEN, stroke: TRACKER_FILL, fill: trackByArea ? TRACKER_FILL : NONE, 'stroke-width': options.lineWidth + (trackByArea ? 0 : 2 * snap), zIndex: 2 }) .add(series.group); // The tracker is added to the series group, which is clipped, but is covered // by the marker group. So the marker group also needs to capture events. each([series.tracker, series.markerGroup], function (tracker) { tracker.addClass(PREFIX + 'tracker') .on('mouseover', onMouseOver) .on('mouseout', function (e) { pointer.onTrackerMouseOut(e); }) .css(css); if (hasTouch) { tracker.on('touchstart', onMouseOver); } }); } } }; /* End TrackerMixin */ /** * Add tracking event listener to the series group, so the point graphics * themselves act as trackers */ if (seriesTypes.column) { ColumnSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint; } if (seriesTypes.pie) { seriesTypes.pie.prototype.drawTracker = TrackerMixin.drawTrackerPoint; } if (seriesTypes.scatter) { ScatterSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint; } /* * Extend Legend for item events */ extend(Legend.prototype, { setItemEvents: function (item, legendItem, useHTML, itemStyle, itemHiddenStyle) { var legend = this; // Set the events on the item group, or in case of useHTML, the item itself (#1249) (useHTML ? legendItem : item.legendGroup).on('mouseover', function () { item.setState(HOVER_STATE); legendItem.css(legend.options.itemHoverStyle); }) .on('mouseout', function () { legendItem.css(item.visible ? itemStyle : itemHiddenStyle); item.setState(); }) .on('click', function (event) { var strLegendItemClick = 'legendItemClick', fnLegendItemClick = function () { if (item.setVisible) { item.setVisible(); } }; // Pass over the click/touch event. #4. event = { browserEvent: event }; // click the name or symbol if (item.firePointEvent) { // point item.firePointEvent(strLegendItemClick, event, fnLegendItemClick); } else { fireEvent(item, strLegendItemClick, event, fnLegendItemClick); } }); }, createCheckboxForItem: function (item) { var legend = this; item.checkbox = createElement('input', { type: 'checkbox', checked: item.selected, defaultChecked: item.selected // required by IE7 }, legend.options.itemCheckboxStyle, legend.chart.container); addEvent(item.checkbox, 'click', function (event) { var target = event.target; fireEvent( item.series || item, 'checkboxClick', { // #3712 checked: target.checked, item: item }, function () { item.select(); } ); }); } }); /* * Add pointer cursor to legend itemstyle in defaultOptions */ defaultOptions.legend.itemStyle.cursor = 'pointer'; /* * Extend the Chart object with interaction */ extend(Chart.prototype, { /** * Display the zoom button */ showResetZoom: function () { var chart = this, lang = defaultOptions.lang, btnOptions = chart.options.chart.resetZoomButton, theme = btnOptions.theme, states = theme.states, alignTo = btnOptions.relativeTo === 'chart' ? null : 'plotBox'; function zoomOut() { chart.zoomOut(); } this.resetZoomButton = chart.renderer.button(lang.resetZoom, null, null, zoomOut, theme, states && states.hover) .attr({ align: btnOptions.position.align, title: lang.resetZoomTitle }) .add() .align(btnOptions.position, false, alignTo); }, /** * Zoom out to 1:1 */ zoomOut: function () { var chart = this; fireEvent(chart, 'selection', { resetSelection: true }, function () { chart.zoom(); }); }, /** * Zoom into a given portion of the chart given by axis coordinates * @param {Object} event */ zoom: function (event) { var chart = this, hasZoomed, pointer = chart.pointer, displayButton = false, resetZoomButton; // If zoom is called with no arguments, reset the axes if (!event || event.resetSelection) { each(chart.axes, function (axis) { hasZoomed = axis.zoom(); }); } else { // else, zoom in on all axes each(event.xAxis.concat(event.yAxis), function (axisData) { var axis = axisData.axis, isXAxis = axis.isXAxis; // don't zoom more than minRange if (pointer[isXAxis ? 'zoomX' : 'zoomY'] || pointer[isXAxis ? 'pinchX' : 'pinchY']) { hasZoomed = axis.zoom(axisData.min, axisData.max); if (axis.displayBtn) { displayButton = true; } } }); } // Show or hide the Reset zoom button resetZoomButton = chart.resetZoomButton; if (displayButton && !resetZoomButton) { chart.showResetZoom(); } else if (!displayButton && isObject(resetZoomButton)) { chart.resetZoomButton = resetZoomButton.destroy(); } // Redraw if (hasZoomed) { chart.redraw( pick(chart.options.chart.animation, event && event.animation, chart.pointCount < 100) // animation ); } }, /** * Pan the chart by dragging the mouse across the pane. This function is called * on mouse move, and the distance to pan is computed from chartX compared to * the first chartX position in the dragging operation. */ pan: function (e, panning) { var chart = this, hoverPoints = chart.hoverPoints, doRedraw; // remove active points for shared tooltip if (hoverPoints) { each(hoverPoints, function (point) { point.setState(); }); } each(panning === 'xy' ? [1, 0] : [1], function (isX) { // xy is used in maps var axis = chart[isX ? 'xAxis' : 'yAxis'][0], horiz = axis.horiz, mousePos = e[horiz ? 'chartX' : 'chartY'], mouseDown = horiz ? 'mouseDownX' : 'mouseDownY', startPos = chart[mouseDown], halfPointRange = (axis.pointRange || 0) / 2, extremes = axis.getExtremes(), newMin = axis.toValue(startPos - mousePos, true) + halfPointRange, newMax = axis.toValue(startPos + axis.len - mousePos, true) - halfPointRange, goingLeft = startPos > mousePos; // #3613 if (axis.series.length && (goingLeft || newMin > mathMin(extremes.dataMin, extremes.min)) && (!goingLeft || newMax < mathMax(extremes.dataMax, extremes.max))) { axis.setExtremes(newMin, newMax, false, false, { trigger: 'pan' }); doRedraw = true; } chart[mouseDown] = mousePos; // set new reference for next run }); if (doRedraw) { chart.redraw(false); } css(chart.container, { cursor: 'move' }); } }); /* * Extend the Point object with interaction */ extend(Point.prototype, { /** * Toggle the selection status of a point * @param {Boolean} selected Whether to select or unselect the point. * @param {Boolean} accumulate Whether to add to the previous selection. By default, * this happens if the control key (Cmd on Mac) was pressed during clicking. */ select: function (selected, accumulate) { var point = this, series = point.series, chart = series.chart; selected = pick(selected, !point.selected); // fire the event with the default handler point.firePointEvent(selected ? 'select' : 'unselect', { accumulate: accumulate }, function () { point.selected = point.options.selected = selected; series.options.data[inArray(point, series.data)] = point.options; point.setState(selected && SELECT_STATE); // unselect all other points unless Ctrl or Cmd + click if (!accumulate) { each(chart.getSelectedPoints(), function (loopPoint) { if (loopPoint.selected && loopPoint !== point) { loopPoint.selected = loopPoint.options.selected = false; series.options.data[inArray(loopPoint, series.data)] = loopPoint.options; loopPoint.setState(NORMAL_STATE); loopPoint.firePointEvent('unselect'); } }); } }); }, /** * Runs on mouse over the point * * @param {Object} e The event arguments * @param {Boolean} byProximity Falsy for kd points that are closest to the mouse, or to * actually hovered points. True for other points in shared tooltip. */ onMouseOver: function (e, byProximity) { var point = this, series = point.series, chart = series.chart, tooltip = chart.tooltip, hoverPoint = chart.hoverPoint; if (chart.hoverSeries !== series) { series.onMouseOver(); } // set normal state to previous series if (hoverPoint && hoverPoint !== point) { hoverPoint.onMouseOut(); } if (point.series) { // It may have been destroyed, #4130 // trigger the event point.firePointEvent('mouseOver'); // update the tooltip if (tooltip && (!tooltip.shared || series.noSharedTooltip)) { tooltip.refresh(point, e); } // hover this point.setState(HOVER_STATE); if (!byProximity) { chart.hoverPoint = point; } } }, /** * Runs on mouse out from the point */ onMouseOut: function () { var chart = this.series.chart, hoverPoints = chart.hoverPoints; this.firePointEvent('mouseOut'); if (!hoverPoints || inArray(this, hoverPoints) === -1) { // #887, #2240 this.setState(); chart.hoverPoint = null; } }, /** * Import events from the series' and point's options. Only do it on * demand, to save processing time on hovering. */ importEvents: function () { if (!this.hasImportedEvents) { var point = this, options = merge(point.series.options.point, point.options), events = options.events, eventType; point.events = events; for (eventType in events) { addEvent(point, eventType, events[eventType]); } this.hasImportedEvents = true; } }, /** * Set the point's state * @param {String} state */ setState: function (state, move) { var point = this, plotX = mathFloor(point.plotX), // #4586 plotY = point.plotY, series = point.series, stateOptions = series.options.states, markerOptions = defaultPlotOptions[series.type].marker && series.options.marker, normalDisabled = markerOptions && !markerOptions.enabled, markerStateOptions = markerOptions && markerOptions.states[state], stateDisabled = markerStateOptions && markerStateOptions.enabled === false, stateMarkerGraphic = series.stateMarkerGraphic, pointMarker = point.marker || {}, chart = series.chart, radius, halo = series.halo, haloOptions, newSymbol, pointAttr; state = state || NORMAL_STATE; // empty string pointAttr = point.pointAttr[state] || series.pointAttr[state]; if ( // already has this state (state === point.state && !move) || // selected points don't respond to hover (point.selected && state !== SELECT_STATE) || // series' state options is disabled (stateOptions[state] && stateOptions[state].enabled === false) || // general point marker's state options is disabled (state && (stateDisabled || (normalDisabled && markerStateOptions.enabled === false))) || // individual point marker's state options is disabled (state && pointMarker.states && pointMarker.states[state] && pointMarker.states[state].enabled === false) // #1610 ) { return; } // apply hover styles to the existing point if (point.graphic) { radius = markerOptions && point.graphic.symbolName && pointAttr.r; point.graphic.attr(merge( pointAttr, radius ? { // new symbol attributes (#507, #612) x: plotX - radius, y: plotY - radius, width: 2 * radius, height: 2 * radius } : {} )); // Zooming in from a range with no markers to a range with markers if (stateMarkerGraphic) { stateMarkerGraphic.hide(); } } else { // if a graphic is not applied to each point in the normal state, create a shared // graphic for the hover state if (state && markerStateOptions) { radius = markerStateOptions.radius; newSymbol = pointMarker.symbol || series.symbol; // If the point has another symbol than the previous one, throw away the // state marker graphic and force a new one (#1459) if (stateMarkerGraphic && stateMarkerGraphic.currentSymbol !== newSymbol) { stateMarkerGraphic = stateMarkerGraphic.destroy(); } // Add a new state marker graphic if (!stateMarkerGraphic) { if (newSymbol) { series.stateMarkerGraphic = stateMarkerGraphic = chart.renderer.symbol( newSymbol, plotX - radius, plotY - radius, 2 * radius, 2 * radius ) .attr(pointAttr) .add(series.markerGroup); stateMarkerGraphic.currentSymbol = newSymbol; } // Move the existing graphic } else { stateMarkerGraphic[move ? 'animate' : 'attr']({ // #1054 x: plotX - radius, y: plotY - radius }); } } if (stateMarkerGraphic) { stateMarkerGraphic[state && chart.isInsidePlot(plotX, plotY, chart.inverted) ? 'show' : 'hide'](); // #2450 stateMarkerGraphic.element.point = point; // #4310 } } // Show me your halo haloOptions = stateOptions[state] && stateOptions[state].halo; if (haloOptions && haloOptions.size) { if (!halo) { series.halo = halo = chart.renderer.path() .add(chart.seriesGroup); } halo.attr(extend({ 'fill': point.color || series.color, 'fill-opacity': haloOptions.opacity, 'zIndex': -1 // #4929, IE8 added halo above everything }, haloOptions.attributes))[move ? 'animate' : 'attr']({ d: point.haloPath(haloOptions.size) }); } else if (halo) { halo.attr({ d: [] }); } point.state = state; }, /** * Get the circular path definition for the halo * @param {Number} size The radius of the circular halo * @returns {Array} The path definition */ haloPath: function (size) { var series = this.series, chart = series.chart, plotBox = series.getPlotBox(), inverted = chart.inverted, plotX = Math.floor(this.plotX); return chart.renderer.symbols.circle( plotBox.translateX + (inverted ? series.yAxis.len - this.plotY : plotX) - size, plotBox.translateY + (inverted ? series.xAxis.len - plotX : this.plotY) - size, size * 2, size * 2 ); } }); /* * Extend the Series object with interaction */ extend(Series.prototype, { /** * Series mouse over handler */ onMouseOver: function () { var series = this, chart = series.chart, hoverSeries = chart.hoverSeries; // set normal state to previous series if (hoverSeries && hoverSeries !== series) { hoverSeries.onMouseOut(); } // trigger the event, but to save processing time, // only if defined if (series.options.events.mouseOver) { fireEvent(series, 'mouseOver'); } // hover this series.setState(HOVER_STATE); chart.hoverSeries = series; }, /** * Series mouse out handler */ onMouseOut: function () { // trigger the event only if listeners exist var series = this, options = series.options, chart = series.chart, tooltip = chart.tooltip, hoverPoint = chart.hoverPoint; chart.hoverSeries = null; // #182, set to null before the mouseOut event fires // trigger mouse out on the point, which must be in this series if (hoverPoint) { hoverPoint.onMouseOut(); } // fire the mouse out event if (series && options.events.mouseOut) { fireEvent(series, 'mouseOut'); } // hide the tooltip if (tooltip && !options.stickyTracking && (!tooltip.shared || series.noSharedTooltip)) { tooltip.hide(); } // set normal state series.setState(); }, /** * Set the state of the graph */ setState: function (state) { var series = this, options = series.options, graph = series.graph, stateOptions = options.states, lineWidth = options.lineWidth, attribs, i = 0; state = state || NORMAL_STATE; if (series.state !== state) { series.state = state; if (stateOptions[state] && stateOptions[state].enabled === false) { return; } if (state) { lineWidth = stateOptions[state].lineWidth || lineWidth + (stateOptions[state].lineWidthPlus || 0); // #4035 } if (graph && !graph.dashstyle) { // hover is turned off for dashed lines in VML attribs = { 'stroke-width': lineWidth }; // use attr because animate will cause any other animation on the graph to stop graph.attr(attribs); while (series['zoneGraph' + i]) { series['zoneGraph' + i].attr(attribs); i = i + 1; } } } }, /** * Set the visibility of the graph * * @param vis {Boolean} True to show the series, false to hide. If UNDEFINED, * the visibility is toggled. */ setVisible: function (vis, redraw) { var series = this, chart = series.chart, legendItem = series.legendItem, showOrHide, ignoreHiddenSeries = chart.options.chart.ignoreHiddenSeries, oldVisibility = series.visible; // if called without an argument, toggle visibility series.visible = vis = series.options.visible = series.userOptions.visible = vis === undefined ? !oldVisibility : vis; // #5618 showOrHide = vis ? 'show' : 'hide'; // show or hide elements each(['group', 'dataLabelsGroup', 'markerGroup', 'tracker'], function (key) { if (series[key]) { series[key][showOrHide](); } }); // hide tooltip (#1361) if (chart.hoverSeries === series || (chart.hoverPoint && chart.hoverPoint.series) === series) { series.onMouseOut(); } if (legendItem) { chart.legend.colorizeItem(series, vis); } // rescale or adapt to resized chart series.isDirty = true; // in a stack, all other series are affected if (series.options.stacking) { each(chart.series, function (otherSeries) { if (otherSeries.options.stacking && otherSeries.visible) { otherSeries.isDirty = true; } }); } // show or hide linked series each(series.linkedSeries, function (otherSeries) { otherSeries.setVisible(vis, false); }); if (ignoreHiddenSeries) { chart.isDirtyBox = true; } if (redraw !== false) { chart.redraw(); } fireEvent(series, showOrHide); }, /** * Show the graph */ show: function () { this.setVisible(true); }, /** * Hide the graph */ hide: function () { this.setVisible(false); }, /** * Set the selected state of the graph * * @param selected {Boolean} True to select the series, false to unselect. If * UNDEFINED, the selection state is toggled. */ select: function (selected) { var series = this; // if called without an argument, toggle series.selected = selected = (selected === UNDEFINED) ? !series.selected : selected; if (series.checkbox) { series.checkbox.checked = selected; } fireEvent(series, selected ? 'select' : 'unselect'); }, drawTracker: TrackerMixin.drawTrackerGraph }); /* **************************************************************************** * Start ordinal axis logic * *****************************************************************************/ wrap(Series.prototype, 'init', function (proceed) { var series = this, xAxis; // call the original function proceed.apply(this, Array.prototype.slice.call(arguments, 1)); xAxis = series.xAxis; // Destroy the extended ordinal index on updated data if (xAxis && xAxis.options.ordinal) { addEvent(series, 'updatedData', function () { delete xAxis.ordinalIndex; }); } }); /** * In an ordinal axis, there might be areas with dense consentrations of points, then large * gaps between some. Creating equally distributed ticks over this entire range * may lead to a huge number of ticks that will later be removed. So instead, break the * positions up in segments, find the tick positions for each segment then concatenize them. * This method is used from both data grouping logic and X axis tick position logic. */ wrap(Axis.prototype, 'getTimeTicks', function (proceed, normalizedInterval, min, max, startOfWeek, positions, closestDistance, findHigherRanks) { var start = 0, end, segmentPositions, higherRanks = {}, hasCrossedHigherRank, info, posLength, outsideMax, groupPositions = [], lastGroupPosition = -Number.MAX_VALUE, tickPixelIntervalOption = this.options.tickPixelInterval; // The positions are not always defined, for example for ordinal positions when data // has regular interval (#1557, #2090) if ((!this.options.ordinal && !this.options.breaks) || !positions || positions.length < 3 || min === UNDEFINED) { return proceed.call(this, normalizedInterval, min, max, startOfWeek); } // Analyze the positions array to split it into segments on gaps larger than 5 times // the closest distance. The closest distance is already found at this point, so // we reuse that instead of computing it again. posLength = positions.length; for (end = 0; end < posLength; end++) { outsideMax = end && positions[end - 1] > max; if (positions[end] < min) { // Set the last position before min start = end; } if (end === posLength - 1 || positions[end + 1] - positions[end] > closestDistance * 5 || outsideMax) { // For each segment, calculate the tick positions from the getTimeTicks utility // function. The interval will be the same regardless of how long the segment is. if (positions[end] > lastGroupPosition) { // #1475 segmentPositions = proceed.call(this, normalizedInterval, positions[start], positions[end], startOfWeek); // Prevent duplicate groups, for example for multiple segments within one larger time frame (#1475) while (segmentPositions.length && segmentPositions[0] <= lastGroupPosition) { segmentPositions.shift(); } if (segmentPositions.length) { lastGroupPosition = segmentPositions[segmentPositions.length - 1]; } groupPositions = groupPositions.concat(segmentPositions); } // Set start of next segment start = end + 1; } if (outsideMax) { break; } } // Get the grouping info from the last of the segments. The info is the same for // all segments. info = segmentPositions.info; // Optionally identify ticks with higher rank, for example when the ticks // have crossed midnight. if (findHigherRanks && info.unitRange <= timeUnits.hour) { end = groupPositions.length - 1; // Compare points two by two for (start = 1; start < end; start++) { if (dateFormat('%d', groupPositions[start]) !== dateFormat('%d', groupPositions[start - 1])) { higherRanks[groupPositions[start]] = 'day'; hasCrossedHigherRank = true; } } // If the complete array has crossed midnight, we want to mark the first // positions also as higher rank if (hasCrossedHigherRank) { higherRanks[groupPositions[0]] = 'day'; } info.higherRanks = higherRanks; } // Save the info groupPositions.info = info; // Don't show ticks within a gap in the ordinal axis, where the space between // two points is greater than a portion of the tick pixel interval if (findHigherRanks && defined(tickPixelIntervalOption)) { // check for squashed ticks var length = groupPositions.length, i = length, itemToRemove, translated, translatedArr = [], lastTranslated, medianDistance, distance, distances = []; // Find median pixel distance in order to keep a reasonably even distance between // ticks (#748) while (i--) { translated = this.translate(groupPositions[i]); if (lastTranslated) { distances[i] = lastTranslated - translated; } translatedArr[i] = lastTranslated = translated; } distances.sort(); medianDistance = distances[mathFloor(distances.length / 2)]; if (medianDistance < tickPixelIntervalOption * 0.6) { medianDistance = null; } // Now loop over again and remove ticks where needed i = groupPositions[length - 1] > max ? length - 1 : length; // #817 lastTranslated = undefined; while (i--) { translated = translatedArr[i]; distance = lastTranslated - translated; // Remove ticks that are closer than 0.6 times the pixel interval from the one to the right, // but not if it is close to the median distance (#748). if (lastTranslated && distance < tickPixelIntervalOption * 0.8 && (medianDistance === null || distance < medianDistance * 0.8)) { // Is this a higher ranked position with a normal position to the right? if (higherRanks[groupPositions[i]] && !higherRanks[groupPositions[i + 1]]) { // Yes: remove the lower ranked neighbour to the right itemToRemove = i + 1; lastTranslated = translated; // #709 } else { // No: remove this one itemToRemove = i; } groupPositions.splice(itemToRemove, 1); } else { lastTranslated = translated; } } } return groupPositions; }); // Extend the Axis prototype extend(Axis.prototype, { /** * Calculate the ordinal positions before tick positions are calculated. */ beforeSetTickPositions: function () { var axis = this, len, ordinalPositions = [], useOrdinal = false, dist, extremes = axis.getExtremes(), min = extremes.min, max = extremes.max, minIndex, maxIndex, slope, hasBreaks = axis.isXAxis && !!axis.options.breaks, isOrdinal = axis.options.ordinal, ignoreHiddenSeries = axis.chart.options.chart.ignoreHiddenSeries, i; // apply the ordinal logic if (isOrdinal || hasBreaks) { // #4167 YAxis is never ordinal ? each(axis.series, function (series, i) { if ((!ignoreHiddenSeries || series.visible !== false) && (series.takeOrdinalPosition !== false || hasBreaks)) { // concatenate the processed X data into the existing positions, or the empty array ordinalPositions = ordinalPositions.concat(series.processedXData); len = ordinalPositions.length; // remove duplicates (#1588) ordinalPositions.sort(function (a, b) { return a - b; // without a custom function it is sorted as strings }); if (len) { i = len - 1; while (i--) { if (ordinalPositions[i] === ordinalPositions[i + 1]) { ordinalPositions.splice(i, 1); } } } } }); // cache the length len = ordinalPositions.length; // Check if we really need the overhead of mapping axis data against the ordinal positions. // If the series consist of evenly spaced data any way, we don't need any ordinal logic. if (len > 2) { // two points have equal distance by default dist = ordinalPositions[1] - ordinalPositions[0]; i = len - 1; while (i-- && !useOrdinal) { if (ordinalPositions[i + 1] - ordinalPositions[i] !== dist) { useOrdinal = true; } } // When zooming in on a week, prevent axis padding for weekends even though the data within // the week is evenly spaced. if (!axis.options.keepOrdinalPadding && (ordinalPositions[0] - min > dist || max - ordinalPositions[ordinalPositions.length - 1] > dist)) { useOrdinal = true; } } // Record the slope and offset to compute the linear values from the array index. // Since the ordinal positions may exceed the current range, get the start and // end positions within it (#719, #665b) if (useOrdinal) { // Register axis.ordinalPositions = ordinalPositions; // This relies on the ordinalPositions being set. Use mathMax and mathMin to prevent // padding on either sides of the data. minIndex = axis.val2lin(mathMax(min, ordinalPositions[0]), true); maxIndex = mathMax(axis.val2lin(mathMin(max, ordinalPositions[ordinalPositions.length - 1]), true), 1); // #3339 // Set the slope and offset of the values compared to the indices in the ordinal positions axis.ordinalSlope = slope = (max - min) / (maxIndex - minIndex); axis.ordinalOffset = min - (minIndex * slope); } else { axis.ordinalPositions = axis.ordinalSlope = axis.ordinalOffset = UNDEFINED; } } axis.isOrdinal = isOrdinal && useOrdinal; // #3818, #4196, #4926 axis.groupIntervalFactor = null; // reset for next run }, /** * Translate from a linear axis value to the corresponding ordinal axis position. If there * are no gaps in the ordinal axis this will be the same. The translated value is the value * that the point would have if the axis were linear, using the same min and max. * * @param Number val The axis value * @param Boolean toIndex Whether to return the index in the ordinalPositions or the new value */ val2lin: function (val, toIndex) { var axis = this, ordinalPositions = axis.ordinalPositions, ret; if (!ordinalPositions) { ret = val; } else { var ordinalLength = ordinalPositions.length, i, distance, ordinalIndex; // first look for an exact match in the ordinalpositions array i = ordinalLength; while (i--) { if (ordinalPositions[i] === val) { ordinalIndex = i; break; } } // if that failed, find the intermediate position between the two nearest values i = ordinalLength - 1; while (i--) { if (val > ordinalPositions[i] || i === 0) { // interpolate distance = (val - ordinalPositions[i]) / (ordinalPositions[i + 1] - ordinalPositions[i]); // something between 0 and 1 ordinalIndex = i + distance; break; } } ret = toIndex ? ordinalIndex : axis.ordinalSlope * (ordinalIndex || 0) + axis.ordinalOffset; } return ret; }, /** * Translate from linear (internal) to axis value * * @param Number val The linear abstracted value * @param Boolean fromIndex Translate from an index in the ordinal positions rather than a value */ lin2val: function (val, fromIndex) { var axis = this, ordinalPositions = axis.ordinalPositions, ret; if (!ordinalPositions) { // the visible range contains only equally spaced values ret = val; } else { var ordinalSlope = axis.ordinalSlope, ordinalOffset = axis.ordinalOffset, i = ordinalPositions.length - 1, linearEquivalentLeft, linearEquivalentRight, distance; // Handle the case where we translate from the index directly, used only // when panning an ordinal axis if (fromIndex) { if (val < 0) { // out of range, in effect panning to the left val = ordinalPositions[0]; } else if (val > i) { // out of range, panning to the right val = ordinalPositions[i]; } else { // split it up i = mathFloor(val); distance = val - i; // the decimal } // Loop down along the ordinal positions. When the linear equivalent of i matches // an ordinal position, interpolate between the left and right values. } else { while (i--) { linearEquivalentLeft = (ordinalSlope * i) + ordinalOffset; if (val >= linearEquivalentLeft) { linearEquivalentRight = (ordinalSlope * (i + 1)) + ordinalOffset; distance = (val - linearEquivalentLeft) / (linearEquivalentRight - linearEquivalentLeft); // something between 0 and 1 break; } } } // If the index is within the range of the ordinal positions, return the associated // or interpolated value. If not, just return the value ret = distance !== UNDEFINED && ordinalPositions[i] !== UNDEFINED ? ordinalPositions[i] + (distance ? distance * (ordinalPositions[i + 1] - ordinalPositions[i]) : 0) : val; } return ret; }, /** * Get the ordinal positions for the entire data set. This is necessary in chart panning * because we need to find out what points or data groups are available outside the * visible range. When a panning operation starts, if an index for the given grouping * does not exists, it is created and cached. This index is deleted on updated data, so * it will be regenerated the next time a panning operation starts. */ getExtendedPositions: function () { var axis = this, chart = axis.chart, grouping = axis.series[0].currentDataGrouping, ordinalIndex = axis.ordinalIndex, key = grouping ? grouping.count + grouping.unitName : 'raw', extremes = axis.getExtremes(), fakeAxis, fakeSeries; // If this is the first time, or the ordinal index is deleted by updatedData, // create it. if (!ordinalIndex) { ordinalIndex = axis.ordinalIndex = {}; } if (!ordinalIndex[key]) { // Create a fake axis object where the extended ordinal positions are emulated fakeAxis = { series: [], chart: chart, getExtremes: function () { return { min: extremes.dataMin, max: extremes.dataMax }; }, options: { ordinal: true }, val2lin: Axis.prototype.val2lin // #2590 }; // Add the fake series to hold the full data, then apply processData to it each(axis.series, function (series) { fakeSeries = { xAxis: fakeAxis, xData: series.xData, chart: chart, destroyGroupedData: noop }; fakeSeries.options = { dataGrouping: grouping ? { enabled: true, forced: true, approximation: 'open', // doesn't matter which, use the fastest units: [[grouping.unitName, [grouping.count]]] } : { enabled: false } }; series.processData.apply(fakeSeries); fakeAxis.series.push(fakeSeries); }); // Run beforeSetTickPositions to compute the ordinalPositions axis.beforeSetTickPositions.apply(fakeAxis); // Cache it ordinalIndex[key] = fakeAxis.ordinalPositions; } return ordinalIndex[key]; }, /** * Find the factor to estimate how wide the plot area would have been if ordinal * gaps were included. This value is used to compute an imagined plot width in order * to establish the data grouping interval. * * A real world case is the intraday-candlestick * example. Without this logic, it would show the correct data grouping when viewing * a range within each day, but once moving the range to include the gap between two * days, the interval would include the cut-away night hours and the data grouping * would be wrong. So the below method tries to compensate by identifying the most * common point interval, in this case days. * * An opposite case is presented in issue #718. We have a long array of daily data, * then one point is appended one hour after the last point. We expect the data grouping * not to change. * * In the future, if we find cases where this estimation doesn't work optimally, we * might need to add a second pass to the data grouping logic, where we do another run * with a greater interval if the number of data groups is more than a certain fraction * of the desired group count. */ getGroupIntervalFactor: function (xMin, xMax, series) { var i, processedXData = series.processedXData, len = processedXData.length, distances = [], median, groupIntervalFactor = this.groupIntervalFactor; // Only do this computation for the first series, let the other inherit it (#2416) if (!groupIntervalFactor) { // Register all the distances in an array for (i = 0; i < len - 1; i++) { distances[i] = processedXData[i + 1] - processedXData[i]; } // Sort them and find the median distances.sort(function (a, b) { return a - b; }); median = distances[mathFloor(len / 2)]; // Compensate for series that don't extend through the entire axis extent. #1675. xMin = mathMax(xMin, processedXData[0]); xMax = mathMin(xMax, processedXData[len - 1]); this.groupIntervalFactor = groupIntervalFactor = (len * median) / (xMax - xMin); } // Return the factor needed for data grouping return groupIntervalFactor; }, /** * Make the tick intervals closer because the ordinal gaps make the ticks spread out or cluster */ postProcessTickInterval: function (tickInterval) { // Problem: http://jsfiddle.net/highcharts/FQm4E/1/ // This is a case where this algorithm doesn't work optimally. In this case, the // tick labels are spread out per week, but all the gaps reside within weeks. So // we have a situation where the labels are courser than the ordinal gaps, and // thus the tick interval should not be altered var ordinalSlope = this.ordinalSlope, ret; if (ordinalSlope) { if (!this.options.breaks) { ret = tickInterval / (ordinalSlope / this.closestPointRange); } else { ret = this.closestPointRange; } } else { ret = tickInterval; } return ret; } }); // Extending the Chart.pan method for ordinal axes wrap(Chart.prototype, 'pan', function (proceed, e) { var chart = this, xAxis = chart.xAxis[0], chartX = e.chartX, runBase = false; if (xAxis.options.ordinal && xAxis.series.length) { var mouseDownX = chart.mouseDownX, extremes = xAxis.getExtremes(), dataMax = extremes.dataMax, min = extremes.min, max = extremes.max, trimmedRange, hoverPoints = chart.hoverPoints, closestPointRange = xAxis.closestPointRange, pointPixelWidth = xAxis.translationSlope * (xAxis.ordinalSlope || closestPointRange), movedUnits = (mouseDownX - chartX) / pointPixelWidth, // how many ordinal units did we move? extendedAxis = { ordinalPositions: xAxis.getExtendedPositions() }, // get index of all the chart's points ordinalPositions, searchAxisLeft, lin2val = xAxis.lin2val, val2lin = xAxis.val2lin, searchAxisRight; if (!extendedAxis.ordinalPositions) { // we have an ordinal axis, but the data is equally spaced runBase = true; } else if (mathAbs(movedUnits) > 1) { // Remove active points for shared tooltip if (hoverPoints) { each(hoverPoints, function (point) { point.setState(); }); } if (movedUnits < 0) { searchAxisLeft = extendedAxis; searchAxisRight = xAxis.ordinalPositions ? xAxis : extendedAxis; } else { searchAxisLeft = xAxis.ordinalPositions ? xAxis : extendedAxis; searchAxisRight = extendedAxis; } // In grouped data series, the last ordinal position represents the grouped data, which is // to the left of the real data max. If we don't compensate for this, we will be allowed // to pan grouped data series passed the right of the plot area. ordinalPositions = searchAxisRight.ordinalPositions; if (dataMax > ordinalPositions[ordinalPositions.length - 1]) { ordinalPositions.push(dataMax); } // Get the new min and max values by getting the ordinal index for the current extreme, // then add the moved units and translate back to values. This happens on the // extended ordinal positions if the new position is out of range, else it happens // on the current x axis which is smaller and faster. chart.fixedRange = max - min; trimmedRange = xAxis.toFixedRange(null, null, lin2val.apply(searchAxisLeft, [ val2lin.apply(searchAxisLeft, [min, true]) + movedUnits, // the new index true // translate from index ]), lin2val.apply(searchAxisRight, [ val2lin.apply(searchAxisRight, [max, true]) + movedUnits, // the new index true // translate from index ]) ); // Apply it if it is within the available data range if (trimmedRange.min >= mathMin(extremes.dataMin, min) && trimmedRange.max <= mathMax(dataMax, max)) { xAxis.setExtremes(trimmedRange.min, trimmedRange.max, true, false, { trigger: 'pan' }); } chart.mouseDownX = chartX; // set new reference for next run css(chart.container, { cursor: 'move' }); } } else { runBase = true; } // revert to the linear chart.pan version if (runBase) { // call the original function proceed.apply(this, Array.prototype.slice.call(arguments, 1)); } }); /** * Extend getGraphPath by identifying gaps in the ordinal data so that we can draw a gap in the * line or area */ Series.prototype.gappedPath = function () { var gapSize = this.options.gapSize, points = this.points.slice(), i = points.length - 1; if (gapSize && i > 0) { // #5008 // extension for ordinal breaks while (i--) { if (points[i + 1].x - points[i].x > this.closestPointRange * gapSize) { points.splice( // insert after this one i + 1, 0, { isNull: true } ); } } } // Call base method //return proceed.call(this, points, a, b); return this.getGraphPath(points); }; /* **************************************************************************** * End ordinal axis logic * *****************************************************************************/ /** * Highstock JS v4.2.7 (2016-09-21) * Highcharts Broken Axis module * * License: www.highcharts.com/license */ (function (factory) { factory(Highcharts); }(function (H) { 'use strict'; var pick = H.pick, wrap = H.wrap, each = H.each, extend = H.extend, fireEvent = H.fireEvent, Axis = H.Axis, Series = H.Series; function stripArguments() { return Array.prototype.slice.call(arguments, 1); } extend(Axis.prototype, { isInBreak: function (brk, val) { var ret, repeat = brk.repeat || Infinity, from = brk.from, length = brk.to - brk.from, test = (val >= from ? (val - from) % repeat : repeat - ((from - val) % repeat)); if (!brk.inclusive) { ret = test < length && test !== 0; } else { ret = test <= length; } return ret; }, isInAnyBreak: function (val, testKeep) { var breaks = this.options.breaks, i = breaks && breaks.length, inbrk, keep, ret; if (i) { while (i--) { if (this.isInBreak(breaks[i], val)) { inbrk = true; if (!keep) { keep = pick(breaks[i].showPoints, this.isXAxis ? false : true); } } } if (inbrk && testKeep) { ret = inbrk && !keep; } else { ret = inbrk; } } return ret; } }); wrap(Axis.prototype, 'setTickPositions', function (proceed) { proceed.apply(this, Array.prototype.slice.call(arguments, 1)); if (this.options.breaks) { var axis = this, tickPositions = this.tickPositions, info = this.tickPositions.info, newPositions = [], i; for (i = 0; i < tickPositions.length; i++) { if (!axis.isInAnyBreak(tickPositions[i])) { newPositions.push(tickPositions[i]); } } this.tickPositions = newPositions; this.tickPositions.info = info; } }); wrap(Axis.prototype, 'init', function (proceed, chart, userOptions) { // Force Axis to be not-ordinal when breaks are defined if (userOptions.breaks && userOptions.breaks.length) { userOptions.ordinal = false; } proceed.call(this, chart, userOptions); if (this.options.breaks) { var axis = this; axis.isBroken = true; this.val2lin = function (val) { var nval = val, brk, i; for (i = 0; i < axis.breakArray.length; i++) { brk = axis.breakArray[i]; if (brk.to <= val) { nval -= brk.len; } else if (brk.from >= val) { break; } else if (axis.isInBreak(brk, val)) { nval -= (val - brk.from); break; } } return nval; }; this.lin2val = function (val) { var nval = val, brk, i; for (i = 0; i < axis.breakArray.length; i++) { brk = axis.breakArray[i]; if (brk.from >= nval) { break; } else if (brk.to < nval) { nval += brk.len; } else if (axis.isInBreak(brk, nval)) { nval += brk.len; } } return nval; }; this.setExtremes = function (newMin, newMax, redraw, animation, eventArguments) { // If trying to set extremes inside a break, extend it to before and after the break ( #3857 ) while (this.isInAnyBreak(newMin)) { newMin -= this.closestPointRange; } while (this.isInAnyBreak(newMax)) { newMax -= this.closestPointRange; } Axis.prototype.setExtremes.call(this, newMin, newMax, redraw, animation, eventArguments); }; this.setAxisTranslation = function (saveOld) { Axis.prototype.setAxisTranslation.call(this, saveOld); var breaks = axis.options.breaks, breakArrayT = [], // Temporary one breakArray = [], length = 0, inBrk, repeat, brk, min = axis.userMin || axis.min, max = axis.userMax || axis.max, start, i, j; // Min & max check (#4247) for (i in breaks) { brk = breaks[i]; repeat = brk.repeat || Infinity; if (axis.isInBreak(brk, min)) { min += (brk.to % repeat) - (min % repeat); } if (axis.isInBreak(brk, max)) { max -= (max % repeat) - (brk.from % repeat); } } // Construct an array holding all breaks in the axis for (i in breaks) { brk = breaks[i]; start = brk.from; repeat = brk.repeat || Infinity; while (start - repeat > min) { start -= repeat; } while (start < min) { start += repeat; } for (j = start; j < max; j += repeat) { breakArrayT.push({ value: j, move: 'in' }); breakArrayT.push({ value: j + (brk.to - brk.from), move: 'out', size: brk.breakSize }); } } breakArrayT.sort(function (a, b) { var ret; if (a.value === b.value) { ret = (a.move === 'in' ? 0 : 1) - (b.move === 'in' ? 0 : 1); } else { ret = a.value - b.value; } return ret; }); // Simplify the breaks inBrk = 0; start = min; for (i in breakArrayT) { brk = breakArrayT[i]; inBrk += (brk.move === 'in' ? 1 : -1); if (inBrk === 1 && brk.move === 'in') { start = brk.value; } if (inBrk === 0) { breakArray.push({ from: start, to: brk.value, len: brk.value - start - (brk.size || 0) }); length += brk.value - start - (brk.size || 0); } } axis.breakArray = breakArray; fireEvent(axis, 'afterBreaks'); axis.transA *= ((max - axis.min) / (max - min - length)); axis.min = min; axis.max = max; }; } }); wrap(Series.prototype, 'generatePoints', function (proceed) { proceed.apply(this, stripArguments(arguments)); var series = this, xAxis = series.xAxis, yAxis = series.yAxis, points = series.points, point, i = points.length, connectNulls = series.options.connectNulls, nullGap; if (xAxis && yAxis && (xAxis.options.breaks || yAxis.options.breaks)) { while (i--) { point = points[i]; nullGap = point.y === null && connectNulls === false; // respect nulls inside the break (#4275) if (!nullGap && (xAxis.isInAnyBreak(point.x, true) || yAxis.isInAnyBreak(point.y, true))) { points.splice(i, 1); if (this.data[i]) { this.data[i].destroyElements(); // removes the graphics for this point if they exist } } } } }); function drawPointsWrapped(proceed) { proceed.apply(this); this.drawBreaks(this.xAxis, ['x']); this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y'])); } H.Series.prototype.drawBreaks = function (axis, keys) { var series = this, points = series.points, breaks, threshold, eventName, y; each(keys, function (key) { breaks = axis.breakArray || []; threshold = axis.isXAxis ? axis.min : pick(series.options.threshold, axis.min); each(points, function (point) { y = pick(point['stack' + key.toUpperCase()], point[key]); each(breaks, function (brk) { eventName = false; if ((threshold < brk.from && y > brk.to) || (threshold > brk.from && y < brk.from)) { eventName = 'pointBreak'; } else if ((threshold < brk.from && y > brk.from && y < brk.to) || (threshold > brk.from && y > brk.to && y < brk.from)) { // point falls inside the break eventName = 'pointInBreak'; } if (eventName) { fireEvent(axis, eventName, { point: point, brk: brk }); } }); }); }); }; wrap(H.seriesTypes.column.prototype, 'drawPoints', drawPointsWrapped); wrap(H.Series.prototype, 'drawPoints', drawPointsWrapped); })); /* **************************************************************************** * Start data grouping module * ******************************************************************************/ var DATA_GROUPING = 'dataGrouping', seriesProto = Series.prototype, baseProcessData = seriesProto.processData, baseGeneratePoints = seriesProto.generatePoints, baseDestroy = seriesProto.destroy, commonOptions = { approximation: 'average', // average, open, high, low, close, sum //enabled: null, // (true for stock charts, false for basic), //forced: undefined, groupPixelWidth: 2, // the first one is the point or start value, the second is the start value if we're dealing with range, // the third one is the end value if dealing with a range dateTimeLabelFormats: { millisecond: ['%A, %b %e, %H:%M:%S.%L', '%A, %b %e, %H:%M:%S.%L', '-%H:%M:%S.%L'], second: ['%A, %b %e, %H:%M:%S', '%A, %b %e, %H:%M:%S', '-%H:%M:%S'], minute: ['%A, %b %e, %H:%M', '%A, %b %e, %H:%M', '-%H:%M'], hour: ['%A, %b %e, %H:%M', '%A, %b %e, %H:%M', '-%H:%M'], day: ['%A, %b %e, %Y', '%A, %b %e', '-%A, %b %e, %Y'], week: ['Week from %A, %b %e, %Y', '%A, %b %e', '-%A, %b %e, %Y'], month: ['%B %Y', '%B', '-%B %Y'], year: ['%Y', '%Y', '-%Y'] } // smoothed = false, // enable this for navigator series only }, specificOptions = { // extends common options line: {}, spline: {}, area: {}, areaspline: {}, column: { approximation: 'sum', groupPixelWidth: 10 }, arearange: { approximation: 'range' }, areasplinerange: { approximation: 'range' }, columnrange: { approximation: 'range', groupPixelWidth: 10 }, candlestick: { approximation: 'ohlc', groupPixelWidth: 10 }, ohlc: { approximation: 'ohlc', groupPixelWidth: 5 } }, // units are defined in a separate array to allow complete overriding in case of a user option defaultDataGroupingUnits = [ [ 'millisecond', // unit name [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples ], [ 'second', [1, 2, 5, 10, 15, 30] ], [ 'minute', [1, 2, 5, 10, 15, 30] ], [ 'hour', [1, 2, 3, 4, 6, 8, 12] ], [ 'day', [1] ], [ 'week', [1] ], [ 'month', [1, 3, 6] ], [ 'year', null ] ], /** * Define the available approximation types. The data grouping approximations takes an array * or numbers as the first parameter. In case of ohlc, four arrays are sent in as four parameters. * Each array consists only of numbers. In case null values belong to the group, the property * .hasNulls will be set to true on the array. */ approximations = { sum: function (arr) { var len = arr.length, ret; // 1. it consists of nulls exclusively if (!len && arr.hasNulls) { ret = null; // 2. it has a length and real values } else if (len) { ret = 0; while (len--) { ret += arr[len]; } } // 3. it has zero length, so just return undefined // => doNothing() return ret; }, average: function (arr) { var len = arr.length, ret = approximations.sum(arr); // If we have a number, return it divided by the length. If not, return // null or undefined based on what the sum method finds. if (isNumber(ret) && len) { ret = ret / len; } return ret; }, open: function (arr) { return arr.length ? arr[0] : (arr.hasNulls ? null : UNDEFINED); }, high: function (arr) { return arr.length ? arrayMax(arr) : (arr.hasNulls ? null : UNDEFINED); }, low: function (arr) { return arr.length ? arrayMin(arr) : (arr.hasNulls ? null : UNDEFINED); }, close: function (arr) { return arr.length ? arr[arr.length - 1] : (arr.hasNulls ? null : UNDEFINED); }, // ohlc and range are special cases where a multidimensional array is input and an array is output ohlc: function (open, high, low, close) { open = approximations.open(open); high = approximations.high(high); low = approximations.low(low); close = approximations.close(close); if (isNumber(open) || isNumber(high) || isNumber(low) || isNumber(close)) { return [open, high, low, close]; } // else, return is undefined }, range: function (low, high) { low = approximations.low(low); high = approximations.high(high); if (isNumber(low) || isNumber(high)) { return [low, high]; } // else, return is undefined } }; /** * Takes parallel arrays of x and y data and groups the data into intervals defined by groupPositions, a collection * of starting x values for each group. */ seriesProto.groupData = function (xData, yData, groupPositions, approximation) { var series = this, data = series.data, dataOptions = series.options.data, groupedXData = [], groupedYData = [], groupMap = [], dataLength = xData.length, pointX, pointY, groupedY, handleYData = !!yData, // when grouping the fake extended axis for panning, we don't need to consider y values = [[], [], [], []], approximationFn = typeof approximation === 'function' ? approximation : approximations[approximation], pointArrayMap = series.pointArrayMap, pointArrayMapLength = pointArrayMap && pointArrayMap.length, i, pos = 0, start = 0; // Start with the first point within the X axis range (#2696) for (i = 0; i <= dataLength; i++) { if (xData[i] >= groupPositions[0]) { break; } } for (i; i <= dataLength; i++) { // when a new group is entered, summarize and initiate the previous group while ((groupPositions[pos + 1] !== undefined && xData[i] >= groupPositions[pos + 1]) || i === dataLength) { // get the last group // get group x and y pointX = groupPositions[pos]; series.dataGroupInfo = { start: start, length: values[0].length }; groupedY = approximationFn.apply(series, values); // push the grouped data if (groupedY !== UNDEFINED) { groupedXData.push(pointX); groupedYData.push(groupedY); groupMap.push(series.dataGroupInfo); } // reset the aggregate arrays start = i; values[0] = []; values[1] = []; values[2] = []; values[3] = []; // Advance on the group positions pos += 1; // don't loop beyond the last group if (i === dataLength) { break; } } // break out if (i === dataLength) { break; } // for each raw data point, push it to an array that contains all values for this specific group if (pointArrayMap) { var index = series.cropStart + i, point = (data && data[index]) || series.pointClass.prototype.applyOptions.apply({ series: series }, [dataOptions[index]]), j, val; for (j = 0; j < pointArrayMapLength; j++) { val = point[pointArrayMap[j]]; if (isNumber(val)) { values[j].push(val); } else if (val === null) { values[j].hasNulls = true; } } } else { pointY = handleYData ? yData[i] : null; if (isNumber(pointY)) { values[0].push(pointY); } else if (pointY === null) { values[0].hasNulls = true; } } } return [groupedXData, groupedYData, groupMap]; }; /** * Extend the basic processData method, that crops the data to the current zoom * range, with data grouping logic. */ seriesProto.processData = function () { var series = this, chart = series.chart, options = series.options, dataGroupingOptions = options[DATA_GROUPING], groupingEnabled = series.allowDG !== false && dataGroupingOptions && pick(dataGroupingOptions.enabled, chart.options._stock), hasGroupedData, skip; // run base method series.forceCrop = groupingEnabled; // #334 series.groupPixelWidth = null; // #2110 series.hasProcessed = true; // #2692 // skip if processData returns false or if grouping is disabled (in that order) or #5493 skip = baseProcessData.apply(series, arguments) === false || !groupingEnabled || !series.visible; if (!skip) { series.destroyGroupedData(); var i, processedXData = series.processedXData, processedYData = series.processedYData, plotSizeX = chart.plotSizeX, xAxis = series.xAxis, ordinal = xAxis.options.ordinal, groupPixelWidth = series.groupPixelWidth = xAxis.getGroupPixelWidth && xAxis.getGroupPixelWidth(); // Execute grouping if the amount of points is greater than the limit defined in groupPixelWidth if (groupPixelWidth) { hasGroupedData = true; series.isDirty = true; // force recreation of point instances in series.translate, #5699 var extremes = xAxis.getExtremes(), xMin = extremes.min, xMax = extremes.max, groupIntervalFactor = (ordinal && xAxis.getGroupIntervalFactor(xMin, xMax, series)) || 1, interval = (groupPixelWidth * (xMax - xMin) / plotSizeX) * groupIntervalFactor, groupPositions = xAxis.getTimeTicks( xAxis.normalizeTimeTickInterval(interval, dataGroupingOptions.units || defaultDataGroupingUnits), Math.min(xMin, processedXData[0]), // Processed data may extend beyond axis (#4907) Math.max(xMax, processedXData[processedXData.length - 1]), xAxis.options.startOfWeek, processedXData, series.closestPointRange ), groupedData = seriesProto.groupData.apply(series, [processedXData, processedYData, groupPositions, dataGroupingOptions.approximation]), groupedXData = groupedData[0], groupedYData = groupedData[1]; // prevent the smoothed data to spill out left and right, and make // sure data is not shifted to the left if (dataGroupingOptions.smoothed) { i = groupedXData.length - 1; groupedXData[i] = Math.min(groupedXData[i], xMax); while (i-- && i > 0) { groupedXData[i] += interval / 2; } groupedXData[0] = Math.max(groupedXData[0], xMin); } // record what data grouping values were used series.currentDataGrouping = groupPositions.info; series.closestPointRange = groupPositions.info.totalRange; series.groupMap = groupedData[2]; // Make sure the X axis extends to show the first group (#2533) if (defined(groupedXData[0]) && groupedXData[0] < xAxis.dataMin) { if (xAxis.min === xAxis.dataMin) { xAxis.min = groupedXData[0]; } xAxis.dataMin = groupedXData[0]; } // set series props series.processedXData = groupedXData; series.processedYData = groupedYData; } else { series.currentDataGrouping = series.groupMap = null; } series.hasGroupedData = hasGroupedData; } }; /** * Destroy the grouped data points. #622, #740 */ seriesProto.destroyGroupedData = function () { var groupedData = this.groupedData; // clear previous groups each(groupedData || [], function (point, i) { if (point) { groupedData[i] = point.destroy ? point.destroy() : null; } }); this.groupedData = null; }; /** * Override the generatePoints method by adding a reference to grouped data */ seriesProto.generatePoints = function () { baseGeneratePoints.apply(this); // record grouped data in order to let it be destroyed the next time processData runs this.destroyGroupedData(); // #622 this.groupedData = this.hasGroupedData ? this.points : null; }; /** * Override point prototype to throw a warning when trying to update grouped points */ wrap(Point.prototype, 'update', function (proceed) { if (this.dataGroup) { error(24); } else { proceed.apply(this, [].slice.call(arguments, 1)); } }); /** * Extend the original method, make the tooltip's header reflect the grouped range */ wrap(Tooltip.prototype, 'tooltipFooterHeaderFormatter', function (proceed, labelConfig, isFooter) { var tooltip = this, series = labelConfig.series, options = series.options, tooltipOptions = series.tooltipOptions, dataGroupingOptions = options.dataGrouping, xDateFormat = tooltipOptions.xDateFormat, xDateFormatEnd, xAxis = series.xAxis, currentDataGrouping, dateTimeLabelFormats, labelFormats, formattedKey; // apply only to grouped series if (xAxis && xAxis.options.type === 'datetime' && dataGroupingOptions && isNumber(labelConfig.key)) { // set variables currentDataGrouping = series.currentDataGrouping; dateTimeLabelFormats = dataGroupingOptions.dateTimeLabelFormats; // if we have grouped data, use the grouping information to get the right format if (currentDataGrouping) { labelFormats = dateTimeLabelFormats[currentDataGrouping.unitName]; if (currentDataGrouping.count === 1) { xDateFormat = labelFormats[0]; } else { xDateFormat = labelFormats[1]; xDateFormatEnd = labelFormats[2]; } // if not grouped, and we don't have set the xDateFormat option, get the best fit, // so if the least distance between points is one minute, show it, but if the // least distance is one day, skip hours and minutes etc. } else if (!xDateFormat && dateTimeLabelFormats) { xDateFormat = tooltip.getXDateFormat(labelConfig, tooltipOptions, xAxis); } // now format the key formattedKey = dateFormat(xDateFormat, labelConfig.key); if (xDateFormatEnd) { formattedKey += dateFormat(xDateFormatEnd, labelConfig.key + currentDataGrouping.totalRange - 1); } // return the replaced format return format(tooltipOptions[(isFooter ? 'footer' : 'header') + 'Format'], { point: extend(labelConfig.point, { key: formattedKey }), series: series }); } // else, fall back to the regular formatter return proceed.call(tooltip, labelConfig, isFooter); }); /** * Extend the series destroyer */ seriesProto.destroy = function () { var series = this, groupedData = series.groupedData || [], i = groupedData.length; while (i--) { if (groupedData[i]) { groupedData[i].destroy(); } } baseDestroy.apply(series); }; // Handle default options for data grouping. This must be set at runtime because some series types are // defined after this. wrap(seriesProto, 'setOptions', function (proceed, itemOptions) { var options = proceed.call(this, itemOptions), type = this.type, plotOptions = this.chart.options.plotOptions, defaultOptions = defaultPlotOptions[type].dataGrouping; if (specificOptions[type]) { // #1284 if (!defaultOptions) { defaultOptions = merge(commonOptions, specificOptions[type]); } options.dataGrouping = merge( defaultOptions, plotOptions.series && plotOptions.series.dataGrouping, // #1228 plotOptions[type].dataGrouping, // Set by the StockChart constructor itemOptions.dataGrouping ); } if (this.chart.options._stock) { this.requireSorting = true; } return options; }); /** * When resetting the scale reset the hasProccessed flag to avoid taking previous data grouping * of neighbour series into accound when determining group pixel width (#2692). */ wrap(Axis.prototype, 'setScale', function (proceed) { proceed.call(this); each(this.series, function (series) { series.hasProcessed = false; }); }); /** * Get the data grouping pixel width based on the greatest defined individual width * of the axis' series, and if whether one of the axes need grouping. */ Axis.prototype.getGroupPixelWidth = function () { var series = this.series, len = series.length, i, groupPixelWidth = 0, doGrouping = false, dataLength, dgOptions; // If multiple series are compared on the same x axis, give them the same // group pixel width (#334) i = len; while (i--) { dgOptions = series[i].options.dataGrouping; if (dgOptions) { groupPixelWidth = mathMax(groupPixelWidth, dgOptions.groupPixelWidth); } } // If one of the series needs grouping, apply it to all (#1634) i = len; while (i--) { dgOptions = series[i].options.dataGrouping; if (dgOptions && series[i].hasProcessed) { // #2692 dataLength = (series[i].processedXData || series[i].data).length; // Execute grouping if the amount of points is greater than the limit defined in groupPixelWidth if (series[i].groupPixelWidth || dataLength > (this.chart.plotSizeX / groupPixelWidth) || (dataLength && dgOptions.forced)) { doGrouping = true; } } } return doGrouping ? groupPixelWidth : 0; }; /** * Force data grouping on all the axis' series. */ Axis.prototype.setDataGrouping = function (dataGrouping, redraw) { var i; redraw = pick(redraw, true); if (!dataGrouping) { dataGrouping = { forced: false, units: null }; } // Axis is instantiated, update all series if (this instanceof Axis) { i = this.series.length; while (i--) { this.series[i].update({ dataGrouping: dataGrouping }, false); } // Axis not yet instanciated, alter series options } else { each(this.chart.options.series, function (seriesOptions) { seriesOptions.dataGrouping = dataGrouping; }, false); } if (redraw) { this.chart.redraw(); } }; /* **************************************************************************** * End data grouping module * ******************************************************************************/ /* **************************************************************************** * Start OHLC series code * *****************************************************************************/ // 1 - Set default options defaultPlotOptions.ohlc = merge(defaultPlotOptions.column, { lineWidth: 1, tooltip: { pointFormat: '<span style="color:{point.color}">\u25CF</span> <b> {series.name}</b><br/>' + 'Open: {point.open}<br/>' + 'High: {point.high}<br/>' + 'Low: {point.low}<br/>' + 'Close: {point.close}<br/>' }, states: { hover: { lineWidth: 3 } }, threshold: null //upColor: undefined }); // 2 - Create the OHLCSeries object var OHLCSeries = extendClass(seriesTypes.column, { type: 'ohlc', pointArrayMap: ['open', 'high', 'low', 'close'], // array point configs are mapped to this toYData: function (point) { // return a plain array for speedy calculation return [point.open, point.high, point.low, point.close]; }, pointValKey: 'high', pointAttrToOptions: { // mapping between SVG attributes and the corresponding options stroke: 'color', 'stroke-width': 'lineWidth' }, upColorProp: 'stroke', /** * Postprocess mapping between options and SVG attributes */ getAttribs: function () { seriesTypes.column.prototype.getAttribs.apply(this, arguments); var series = this, options = series.options, stateOptions = options.states, upColor = options.upColor || series.color, seriesDownPointAttr = merge(series.pointAttr), upColorProp = series.upColorProp; seriesDownPointAttr[''][upColorProp] = upColor; seriesDownPointAttr.hover[upColorProp] = stateOptions.hover.upColor || upColor; seriesDownPointAttr.select[upColorProp] = stateOptions.select.upColor || upColor; each(series.points, function (point) { if (point.open < point.close && !point.options.color) { point.pointAttr = seriesDownPointAttr; } }); }, /** * Translate data points from raw values x and y to plotX and plotY */ translate: function () { var series = this, yAxis = series.yAxis, hasModifyValue = !!series.modifyValue, translatedOLC = ['plotOpen', 'yBottom', 'plotClose']; seriesTypes.column.prototype.translate.apply(series); // Do the translation each(series.points, function (point) { each([point.open, point.low, point.close], function (value, i) { if (value !== null) { if (hasModifyValue) { value = series.modifyValue(value); } point[translatedOLC[i]] = yAxis.toPixels(value, true); } }); }); }, /** * Draw the data points */ drawPoints: function () { var series = this, points = series.points, chart = series.chart, pointAttr, plotOpen, plotClose, crispCorr, halfWidth, path, graphic, crispX; each(points, function (point) { if (point.plotY !== UNDEFINED) { graphic = point.graphic; pointAttr = point.pointAttr[point.selected ? 'selected' : ''] || series.pointAttr[NORMAL_STATE]; // crisp vector coordinates crispCorr = (pointAttr['stroke-width'] % 2) / 2; crispX = mathRound(point.plotX) - crispCorr; // #2596 halfWidth = mathRound(point.shapeArgs.width / 2); // the vertical stem path = [ 'M', crispX, mathRound(point.yBottom), 'L', crispX, mathRound(point.plotY) ]; // open if (point.open !== null) { plotOpen = mathRound(point.plotOpen) + crispCorr; path.push( 'M', crispX, plotOpen, 'L', crispX - halfWidth, plotOpen ); } // close if (point.close !== null) { plotClose = mathRound(point.plotClose) + crispCorr; path.push( 'M', crispX, plotClose, 'L', crispX + halfWidth, plotClose ); } // create and/or update the graphic if (graphic) { graphic .attr(pointAttr) // #3897 .animate({ d: path }); } else { point.graphic = chart.renderer.path(path) .attr(pointAttr) .add(series.group); } } }); }, /** * Disable animation */ animate: null }); seriesTypes.ohlc = OHLCSeries; /* **************************************************************************** * End OHLC series code * *****************************************************************************/ /* **************************************************************************** * Start Candlestick series code * *****************************************************************************/ // 1 - set default options defaultPlotOptions.candlestick = merge(defaultPlotOptions.column, { lineColor: 'black', lineWidth: 1, states: { hover: { lineWidth: 2 } }, tooltip: defaultPlotOptions.ohlc.tooltip, threshold: null, upColor: 'white' // upLineColor: null }); // 2 - Create the CandlestickSeries object var CandlestickSeries = extendClass(OHLCSeries, { type: 'candlestick', /** * One-to-one mapping from options to SVG attributes */ pointAttrToOptions: { // mapping between SVG attributes and the corresponding options fill: 'color', stroke: 'lineColor', 'stroke-width': 'lineWidth' }, upColorProp: 'fill', /** * Postprocess mapping between options and SVG attributes */ getAttribs: function () { seriesTypes.ohlc.prototype.getAttribs.apply(this, arguments); var series = this, options = series.options, stateOptions = options.states, upLineColor = options.upLineColor || options.lineColor, hoverStroke = stateOptions.hover.upLineColor || upLineColor, selectStroke = stateOptions.select.upLineColor || upLineColor; // Add custom line color for points going up (close > open). // Fill is handled by OHLCSeries' getAttribs. each(series.points, function (point) { if (point.open < point.close) { // If an individual line color is set, we need to merge the // point attributes, because they are shared between all up // points by inheritance from OHCLSeries. if (point.lineColor) { point.pointAttr = merge(point.pointAttr); upLineColor = point.lineColor; } point.pointAttr[''].stroke = upLineColor; point.pointAttr.hover.stroke = hoverStroke; point.pointAttr.select.stroke = selectStroke; } }); }, /** * Draw the data points */ drawPoints: function () { var series = this, //state = series.state, points = series.points, chart = series.chart, pointAttr, seriesPointAttr = series.pointAttr[''], plotOpen, plotClose, topBox, bottomBox, hasTopWhisker, hasBottomWhisker, crispCorr, crispX, graphic, path, halfWidth; each(points, function (point) { graphic = point.graphic; if (point.plotY !== UNDEFINED) { pointAttr = point.pointAttr[point.selected ? 'selected' : ''] || seriesPointAttr; // crisp vector coordinates crispCorr = (pointAttr['stroke-width'] % 2) / 2; crispX = mathRound(point.plotX) - crispCorr; // #2596 plotOpen = point.plotOpen; plotClose = point.plotClose; topBox = math.min(plotOpen, plotClose); bottomBox = math.max(plotOpen, plotClose); halfWidth = mathRound(point.shapeArgs.width / 2); hasTopWhisker = mathRound(topBox) !== mathRound(point.plotY); hasBottomWhisker = bottomBox !== point.yBottom; topBox = mathRound(topBox) + crispCorr; bottomBox = mathRound(bottomBox) + crispCorr; // Create the path. Due to a bug in Chrome 49, the path is first instanciated // with no values, then the values pushed. For unknown reasons, instanciated // the path array with all the values would lead to a crash when updating // frequently (#5193). path = []; path.push( 'M', crispX - halfWidth, bottomBox, 'L', crispX - halfWidth, topBox, 'L', crispX + halfWidth, topBox, 'L', crispX + halfWidth, bottomBox, 'Z', // Use a close statement to ensure a nice rectangle #2602 'M', crispX, topBox, 'L', crispX, hasTopWhisker ? mathRound(point.plotY) : topBox, // #460, #2094 'M', crispX, bottomBox, 'L', crispX, hasBottomWhisker ? mathRound(point.yBottom) : bottomBox // #460, #2094 ); if (graphic) { graphic .attr(pointAttr) // #3897 .animate({ d: path }); } else { point.graphic = chart.renderer.path(path) .attr(pointAttr) .add(series.group) .shadow(series.options.shadow); } } }); } }); seriesTypes.candlestick = CandlestickSeries; /* **************************************************************************** * End Candlestick series code * *****************************************************************************/ /* **************************************************************************** * Start Flags series code * *****************************************************************************/ var symbols = SVGRenderer.prototype.symbols; // 1 - set default options defaultPlotOptions.flags = merge(defaultPlotOptions.column, { fillColor: 'white', lineWidth: 1, pointRange: 0, // #673 //radius: 2, shape: 'flag', stackDistance: 12, states: { hover: { lineColor: 'black', fillColor: '#FCFFC5' } }, style: { fontSize: '11px', fontWeight: 'bold', textAlign: 'center' }, tooltip: { pointFormat: '{point.text}<br/>' }, threshold: null, y: -30 }); // 2 - Create the CandlestickSeries object seriesTypes.flags = extendClass(seriesTypes.column, { type: 'flags', sorted: false, noSharedTooltip: true, allowDG: false, takeOrdinalPosition: false, // #1074 trackerGroups: ['markerGroup'], forceCrop: true, /** * Inherit the initialization from base Series */ init: Series.prototype.init, /** * One-to-one mapping from options to SVG attributes */ pointAttrToOptions: { // mapping between SVG attributes and the corresponding options fill: 'fillColor', stroke: 'color', 'stroke-width': 'lineWidth', r: 'radius' }, /** * Extend the translate method by placing the point on the related series */ translate: function () { seriesTypes.column.prototype.translate.apply(this); var series = this, options = series.options, chart = series.chart, points = series.points, cursor = points.length - 1, point, lastPoint, optionsOnSeries = options.onSeries, onSeries = optionsOnSeries && chart.get(optionsOnSeries), onKey = options.onKey || 'y', step = onSeries && onSeries.options.step, onData = onSeries && onSeries.points, i = onData && onData.length, xAxis = series.xAxis, xAxisExt = xAxis.getExtremes(), xOffset = 0, leftPoint, lastX, rightPoint, currentDataGrouping; // relate to a master series if (onSeries && onSeries.visible && i) { xOffset = (onSeries.pointXOffset || 0) + (onSeries.barW || 0) / 2; currentDataGrouping = onSeries.currentDataGrouping; lastX = onData[i - 1].x + (currentDataGrouping ? currentDataGrouping.totalRange : 0); // #2374 // sort the data points points.sort(function (a, b) { return (a.x - b.x); }); onKey = 'plot' + onKey[0].toUpperCase() + onKey.substr(1); while (i-- && points[cursor]) { point = points[cursor]; leftPoint = onData[i]; if (leftPoint.x <= point.x && leftPoint[onKey] !== undefined) { if (point.x <= lastX) { // #803 point.plotY = leftPoint[onKey]; // interpolate between points, #666 if (leftPoint.x < point.x && !step) { rightPoint = onData[i + 1]; if (rightPoint && rightPoint[onKey] !== UNDEFINED) { point.plotY += ((point.x - leftPoint.x) / (rightPoint.x - leftPoint.x)) * // the distance ratio, between 0 and 1 (rightPoint[onKey] - leftPoint[onKey]); // the y distance } } } cursor--; i++; // check again for points in the same x position if (cursor < 0) { break; } } } } // Add plotY position and handle stacking each(points, function (point, i) { var stackIndex; // Undefined plotY means the point is either on axis, outside series range or hidden series. // If the series is outside the range of the x axis it should fall through with // an undefined plotY, but then we must remove the shapeArgs (#847). if (point.plotY === UNDEFINED) { if (point.x >= xAxisExt.min && point.x <= xAxisExt.max) { // we're inside xAxis range point.plotY = chart.chartHeight - xAxis.bottom - (xAxis.opposite ? xAxis.height : 0) + xAxis.offset - chart.plotTop; } else { point.shapeArgs = {}; // 847 } } point.plotX += xOffset; // #2049 // if multiple flags appear at the same x, order them into a stack lastPoint = points[i - 1]; if (lastPoint && lastPoint.plotX === point.plotX) { if (lastPoint.stackIndex === UNDEFINED) { lastPoint.stackIndex = 0; } stackIndex = lastPoint.stackIndex + 1; } point.stackIndex = stackIndex; // #3639 }); }, /** * Draw the markers */ drawPoints: function () { var series = this, pointAttr, seriesPointAttr = series.pointAttr[''], points = series.points, chart = series.chart, renderer = chart.renderer, plotX, plotY, options = series.options, optionsY = options.y, shape, i, point, graphic, stackIndex, anchorX, anchorY, outsideRight, yAxis = series.yAxis, text; i = points.length; while (i--) { point = points[i]; outsideRight = point.plotX > series.xAxis.len; plotX = point.plotX; if (plotX > 0) { // #3119 plotX -= pick(point.lineWidth, options.lineWidth) % 2; // #4285 } stackIndex = point.stackIndex; shape = point.options.shape || options.shape; plotY = point.plotY; if (plotY !== UNDEFINED) { plotY = point.plotY + optionsY - (stackIndex !== UNDEFINED && stackIndex * options.stackDistance); } anchorX = stackIndex ? UNDEFINED : point.plotX; // skip connectors for higher level stacked points anchorY = stackIndex ? UNDEFINED : point.plotY; graphic = point.graphic; // only draw the point if y is defined and the flag is within the visible area if (plotY !== UNDEFINED && plotX >= 0 && !outsideRight) { // shortcuts pointAttr = point.pointAttr[point.selected ? 'select' : ''] || seriesPointAttr; text = pick(point.options.title, options.title, 'A'); if (graphic) { // update graphic.attr({ text: text // first apply text, so text will be centered later }).attr({ x: plotX, y: plotY, r: pointAttr.r, anchorX: anchorX, anchorY: anchorY }); } else { graphic = point.graphic = renderer.label( text, plotX, plotY, shape, anchorX, anchorY, options.useHTML ) .css(merge(options.style, point.style)) .attr(pointAttr) .attr({ align: shape === 'flag' ? 'left' : 'center', width: options.width, height: options.height }) .add(series.markerGroup) .shadow(options.shadow); } // Set the tooltip anchor position point.tooltipPos = chart.inverted ? [yAxis.len + yAxis.pos - chart.plotLeft - plotY, series.xAxis.len - plotX] : [plotX, plotY]; } else if (graphic) { point.graphic = graphic.destroy(); } } }, /** * Extend the column trackers with listeners to expand and contract stacks */ drawTracker: function () { var series = this, points = series.points; TrackerMixin.drawTrackerPoint.apply(this); // Bring each stacked flag up on mouse over, this allows readability of vertically // stacked elements as well as tight points on the x axis. #1924. each(points, function (point) { var graphic = point.graphic; if (graphic) { addEvent(graphic.element, 'mouseover', function () { // Raise this point if (point.stackIndex > 0 && !point.raised) { point._y = graphic.y; graphic.attr({ y: point._y - 8 }); point.raised = true; } // Revert other raised points each(points, function (otherPoint) { if (otherPoint !== point && otherPoint.raised && otherPoint.graphic) { otherPoint.graphic.attr({ y: otherPoint._y }); otherPoint.raised = false; } }); }); } }); }, /** * Disable animation */ animate: noop, buildKDTree: noop, setClip: noop }); // create the flag icon with anchor symbols.flag = function (x, y, w, h, options) { var anchorX = (options && options.anchorX) || x, anchorY = (options && options.anchorY) || y; return [ 'M', anchorX, anchorY, 'L', x, y + h, x, y, x + w, y, x + w, y + h, x, y + h, 'Z' ]; }; // create the circlepin and squarepin icons with anchor each(['circle', 'square'], function (shape) { symbols[shape + 'pin'] = function (x, y, w, h, options) { var anchorX = options && options.anchorX, anchorY = options && options.anchorY, path, labelTopOrBottomY; // For single-letter flags, make sure circular flags are not taller than their width if (shape === 'circle' && h > w) { x -= mathRound((h - w) / 2); w = h; } path = symbols[shape](x, y, w, h); if (anchorX && anchorY) { // if the label is below the anchor, draw the connecting line from the top edge of the label // otherwise start drawing from the bottom edge labelTopOrBottomY = (y > anchorY) ? y : y + h; path.push('M', anchorX, labelTopOrBottomY, 'L', anchorX, anchorY); } return path; }; }); // The symbol callbacks are generated on the SVGRenderer object in all browsers. Even // VML browsers need this in order to generate shapes in export. Now share // them with the VMLRenderer. if (Renderer === Highcharts.VMLRenderer) { each(['flag', 'circlepin', 'squarepin'], function (shape) { VMLRenderer.prototype.symbols[shape] = symbols[shape]; }); } /* **************************************************************************** * End Flags series code * *****************************************************************************/ var defaultScrollbarOptions = { //enabled: true height: isTouchDevice ? 20 : 14, barBackgroundColor: '#bfc8d1', barBorderRadius: 0, barBorderWidth: 1, barBorderColor: '#bfc8d1', buttonArrowColor: '#666', buttonBackgroundColor: '#ebe7e8', buttonBorderColor: '#bbb', buttonBorderRadius: 0, buttonBorderWidth: 1, //showFull: true, margin: 10, minWidth: 6, rifleColor: '#666', zIndex: 3, step: 0.2, //size: null, trackBackgroundColor: '#eeeeee', trackBorderColor: '#eeeeee', trackBorderWidth: 1, // trackBorderRadius: 0 liveRedraw: hasSVG && !isTouchDevice }; defaultOptions.scrollbar = merge(true, defaultScrollbarOptions, defaultOptions.scrollbar); /** * The Scrollbar class * @param {Object} renderer * @param {Object} options * @param {Object} chart */ function Scrollbar(renderer, options, chart) { this.scrollbarButtons = []; this.renderer = renderer; this.userOptions = options; this.options = merge(defaultScrollbarOptions, options); this.chart = chart; this.size = pick(this.options.size, this.options.height); // backward compatibility // Init this.render(); this.initEvents(); this.addEvents(); } Scrollbar.prototype = { /** * Render scrollbar with all required items. */ render: function () { var scroller = this, renderer = scroller.renderer, options = scroller.options, strokeWidth = options.trackBorderWidth, scrollbarStrokeWidth = options.barBorderWidth, size = scroller.size, group; // Draw the scrollbar group: scroller.group = group = renderer.g(PREFIX + 'scrollbar').attr({ zIndex: options.zIndex, translateY: -99999 }).add(); // Draw the scrollbar track: scroller.track = renderer.rect().attr({ height: size, width: size, y: -strokeWidth % 2 / 2, x: -strokeWidth % 2 / 2, 'stroke-width': strokeWidth, fill: options.trackBackgroundColor, stroke: options.trackBorderColor, r: options.trackBorderRadius || 0 }).add(group); // Draw the scrollbar itself: scroller.scrollbarGroup = renderer.g().add(group); scroller.scrollbar = renderer.rect().attr({ height: size, width: size, y: -scrollbarStrokeWidth % 2 / 2, x: -scrollbarStrokeWidth % 2 / 2, 'stroke-width': scrollbarStrokeWidth, fill: options.barBackgroundColor, stroke: options.barBorderColor, r: options.barBorderRadius || 0 }).add(scroller.scrollbarGroup); // Draw the scrollbat rifles: scroller.scrollbarRifles = renderer.path(scroller.swapXY([ M, -3, size / 4, L, -3, 2 * size / 3, M, 0, size / 4, L, 0, 2 * size / 3, M, 3, size / 4, L, 3, 2 * size / 3 ], options.vertical)).attr({ stroke: options.rifleColor, 'stroke-width': 1 }).add(scroller.scrollbarGroup); // Draw the buttons: scroller.drawScrollbarButton(0); scroller.drawScrollbarButton(1); }, /** * Position the scrollbar, method called from a parent with defined dimensions * @param {Number} x - x-position on the chart * @param {Number} y - y-position on the chart * @param {Number} width - width of the scrollbar * @param {Number} height - height of the scorllbar */ position: function (x, y, width, height) { var scroller = this, options = scroller.options, vertical = options.vertical, xOffset = height, yOffset = 0, method = scroller.rendered ? 'animate' : 'attr'; scroller.x = x; scroller.y = y + options.trackBorderWidth; scroller.width = width; // width with buttons scroller.height = height; scroller.xOffset = xOffset; scroller.yOffset = yOffset; // If Scrollbar is a vertical type, swap options: if (vertical) { scroller.width = scroller.yOffset = width = yOffset = scroller.size; scroller.xOffset = xOffset = 0; scroller.barWidth = height - width * 2; // width without buttons scroller.x = x = x + scroller.options.margin; } else { scroller.height = scroller.xOffset = height = xOffset = scroller.size; scroller.barWidth = width - height * 2; // width without buttons scroller.y = scroller.y + scroller.options.margin; } // Set general position for a group: scroller.group[method]({ translateX: x, translateY: scroller.y }); // Resize background/track: scroller.track[method]({ width: width, height: height }); // Move right/bottom button ot it's place: scroller.scrollbarButtons[1].attr({ translateX: vertical ? 0 : width - xOffset, translateY: vertical ? height - yOffset : 0 }); }, /** * Draw the scrollbar buttons with arrows * @param {Number} index 0 is left, 1 is right */ drawScrollbarButton: function (index) { var scroller = this, renderer = scroller.renderer, scrollbarButtons = scroller.scrollbarButtons, options = scroller.options, size = scroller.size, group; group = renderer.g().add(scroller.group); scrollbarButtons.push(group); // Button rect: renderer.rect( -0.5, -0.5, size + 1, // +1 to compensate for crispifying in rect method size + 1, options.buttonBorderRadius, options.buttonBorderWidth ).attr({ stroke: options.buttonBorderColor, 'stroke-width': options.buttonBorderWidth, fill: options.buttonBackgroundColor }).add(group); // Button arrow: renderer.path(scroller.swapXY([ 'M', size / 2 + (index ? -1 : 1), size / 2 - 3, 'L', size / 2 + (index ? -1 : 1), size / 2 + 3, 'L', size / 2 + (index ? 2 : -2), size / 2 ], options.vertical)).attr({ fill: options.buttonArrowColor }).add(group); }, /** * When we have vertical scrollbar, rifles are rotated, the same for arrow in buttons: * @param {Array} path - path to be rotated * @param {Boolean} vertical - if vertical scrollbar, swap x-y values */ swapXY: function (path, vertical) { var i, len = path.length, temp; if (vertical) { for (i = 0; i < len; i += 3) { temp = path[i + 1]; path[i + 1] = path[i + 2]; path[i + 2] = temp; } } return path; }, /** * Set scrollbar size, with a given scale. * @param {Number} from - scale (0-1) where bar should start * @param {Number} to - scale (0-1) where bar should end */ setRange: function (from, to) { var scroller = this, options = scroller.options, vertical = options.vertical, minWidth = options.minWidth, fullWidth = scroller.barWidth, fromPX, toPX, newPos, newSize, newRiflesPos, method = this.rendered && !this.hasDragged ? 'animate' : 'attr'; if (!defined(fullWidth)) { return; } from = Math.max(from, 0); fromPX = fullWidth * from; toPX = fullWidth * Math.min(to, 1); scroller.calculatedWidth = newSize = correctFloat(toPX - fromPX); // We need to recalculate position, if minWidth is used if (newSize < minWidth) { fromPX = (fullWidth - minWidth + newSize) * from; newSize = minWidth; } newPos = Math.floor(fromPX + scroller.xOffset + scroller.yOffset); newRiflesPos = newSize / 2 - 0.5; // -0.5 -> rifle line width / 2 // Store current position: scroller.from = from; scroller.to = to; if (!vertical) { scroller.scrollbarGroup[method]({ translateX: newPos }); scroller.scrollbar[method]({ width: newSize }); scroller.scrollbarRifles[method]({ translateX: newRiflesPos }); scroller.scrollbarLeft = newPos; scroller.scrollbarTop = 0; } else { scroller.scrollbarGroup[method]({ translateY: newPos }); scroller.scrollbar[method]({ height: newSize }); scroller.scrollbarRifles[method]({ translateY: newRiflesPos }); scroller.scrollbarTop = newPos; scroller.scrollbarLeft = 0; } if (newSize <= 12) { scroller.scrollbarRifles.hide(); } else { scroller.scrollbarRifles.show(true); } // Show or hide the scrollbar based on the showFull setting if (options.showFull === false) { if (from <= 0 && to >= 1) { scroller.group.hide(); } else { scroller.group.show(); } } scroller.rendered = true; }, /** * Init events methods, so we have an access to the Scrollbar itself */ initEvents: function () { var scroller = this; /** * Event handler for the mouse move event. */ scroller.mouseMoveHandler = function (e) { var normalizedEvent = scroller.chart.pointer.normalize(e), options = scroller.options, direction = options.vertical ? 'chartY' : 'chartX', initPositions = scroller.initPositions, scrollPosition, chartPosition, change; // In iOS, a mousemove event with e.pageX === 0 is fired when holding the finger // down in the center of the scrollbar. This should be ignored. if (scroller.grabbedCenter && (!e.touches || e.touches[0][direction] !== 0)) { // #4696, scrollbar failed on Android chartPosition = scroller.cursorToScrollbarPosition(normalizedEvent)[direction]; scrollPosition = scroller[direction]; change = chartPosition - scrollPosition; scroller.hasDragged = true; scroller.updatePosition(initPositions[0] + change, initPositions[1] + change); if (scroller.hasDragged) { fireEvent(scroller, 'changed', { from: scroller.from, to: scroller.to, trigger: 'scrollbar', DOMType: e.type, DOMEvent: e }); } } }; /** * Event handler for the mouse up event. */ scroller.mouseUpHandler = function (e) { if (scroller.hasDragged) { fireEvent(scroller, 'changed', { from: scroller.from, to: scroller.to, trigger: 'scrollbar', DOMType: e.type, DOMEvent: e }); } scroller.grabbedCenter = scroller.hasDragged = scroller.chartX = scroller.chartY = null; }; scroller.mouseDownHandler = function (e) { var normalizedEvent = scroller.chart.pointer.normalize(e), mousePosition = scroller.cursorToScrollbarPosition(normalizedEvent); scroller.chartX = mousePosition.chartX; scroller.chartY = mousePosition.chartY; scroller.initPositions = [scroller.from, scroller.to]; scroller.grabbedCenter = true; }; scroller.buttonToMinClick = function (e) { var range = correctFloat(scroller.to - scroller.from) * scroller.options.step; scroller.updatePosition(correctFloat(scroller.from - range), correctFloat(scroller.to - range)); fireEvent(scroller, 'changed', { from: scroller.from, to: scroller.to, trigger: 'scrollbar', DOMEvent: e }); }; scroller.buttonToMaxClick = function (e) { var range = (scroller.to - scroller.from) * scroller.options.step; scroller.updatePosition(scroller.from + range, scroller.to + range); fireEvent(scroller, 'changed', { from: scroller.from, to: scroller.to, trigger: 'scrollbar', DOMEvent: e }); }; scroller.trackClick = function (e) { var normalizedEvent = scroller.chart.pointer.normalize(e), range = scroller.to - scroller.from, top = scroller.y + scroller.scrollbarTop, left = scroller.x + scroller.scrollbarLeft; if ((scroller.options.vertical && normalizedEvent.chartY > top) || (!scroller.options.vertical && normalizedEvent.chartX > left)) { // On the top or on the left side of the track: scroller.updatePosition(scroller.from + range, scroller.to + range); } else { // On the bottom or the right side of the track: scroller.updatePosition(scroller.from - range, scroller.to - range); } fireEvent(scroller, 'changed', { from: scroller.from, to: scroller.to, trigger: 'scrollbar', DOMEvent: e }); }; }, /** * Get normalized (0-1) cursor position over the scrollbar * @param {Event} normalizedEvent - normalized event, with chartX and chartY values * @return {Object} Local position {chartX, chartY} */ cursorToScrollbarPosition: function (normalizedEvent) { var scroller = this, options = scroller.options, minWidthDifference = options.minWidth > scroller.calculatedWidth ? options.minWidth : 0; // minWidth distorts translation return { chartX: (normalizedEvent.chartX - scroller.x - scroller.xOffset) / (scroller.barWidth - minWidthDifference), chartY: (normalizedEvent.chartY - scroller.y - scroller.yOffset) / (scroller.barWidth - minWidthDifference) }; }, /** * Update position option in the Scrollbar, with normalized 0-1 scale */ updatePosition: function (from, to) { if (to > 1) { from = correctFloat(1 - correctFloat(to - from)); to = 1; } if (from < 0) { to = correctFloat(to - from); from = 0; } this.from = from; this.to = to; }, /** * Set up the mouse and touch events for the Scrollbar */ addEvents: function () { var buttonsOrder = this.options.inverted ? [1, 0] : [0, 1], buttons = this.scrollbarButtons, bar = this.scrollbarGroup.element, track = this.track.element, mouseDownHandler = this.mouseDownHandler, mouseMoveHandler = this.mouseMoveHandler, mouseUpHandler = this.mouseUpHandler, _events; // Mouse events _events = [ [buttons[buttonsOrder[0]].element, 'click', this.buttonToMinClick], [buttons[buttonsOrder[1]].element, 'click', this.buttonToMaxClick], [track, 'click', this.trackClick], [bar, 'mousedown', mouseDownHandler], [doc, 'mousemove', mouseMoveHandler], [doc, 'mouseup', mouseUpHandler] ]; // Touch events if (hasTouch) { _events.push( [bar, 'touchstart', mouseDownHandler], [doc, 'touchmove', mouseMoveHandler], [doc, 'touchend', mouseUpHandler] ); } // Add them all each(_events, function (args) { addEvent.apply(null, args); }); this._events = _events; }, /** * Removes the event handlers attached previously with addEvents. */ removeEvents: function () { each(this._events, function (args) { removeEvent.apply(null, args); }); this._events = UNDEFINED; }, /** * Destroys allocated elements. */ destroy: function () { var scroller = this; // Disconnect events added in addEvents scroller.removeEvents(); // Destroy properties each([scroller.track, scroller.scrollbarRifles, scroller.scrollbar, scroller.scrollbarGroup, scroller.group], function (prop) { if (prop && prop.destroy) { prop = prop.destroy(); } }); // Destroy elements in collection destroyObjectProperties(scroller.scrollbarButtons); } }; /** * Wrap axis initialization and create scrollbar if enabled: */ wrap(Axis.prototype, 'init', function (proceed) { var axis = this; proceed.apply(axis, [].slice.call(arguments, 1)); if (axis.options.scrollbar && axis.options.scrollbar.enabled) { // Predefined options: axis.options.scrollbar.vertical = !axis.horiz; axis.options.startOnTick = axis.options.endOnTick = false; axis.scrollbar = new Scrollbar(axis.chart.renderer, axis.options.scrollbar, axis.chart); addEvent(axis.scrollbar, 'changed', function (e) { var unitedMin = Math.min(pick(axis.options.min, axis.min), axis.min, axis.dataMin), unitedMax = Math.max(pick(axis.options.max, axis.max), axis.max, axis.dataMax), range = unitedMax - unitedMin, to, from; if ((axis.horiz && !axis.reversed) || (!axis.horiz && axis.reversed)) { to = unitedMin + range * this.to; from = unitedMin + range * this.from; } else { // y-values in browser are reversed, but this also applies for reversed horizontal axis: to = unitedMin + range * (1 - this.from); from = unitedMin + range * (1 - this.to); } axis.setExtremes(from, to, true, false, e); }); } }); /** * Wrap rendering axis, and update scrollbar if one is created: */ wrap(Axis.prototype, 'render', function (proceed) { var axis = this, scrollMin = Math.min(pick(axis.options.min, axis.min), axis.min, axis.dataMin), scrollMax = Math.max(pick(axis.options.max, axis.max), axis.max, axis.dataMax), scrollbar = axis.scrollbar, from, to; proceed.apply(axis, [].slice.call(arguments, 1)); if (scrollbar) { if (axis.horiz) { scrollbar.position( axis.left, axis.top + axis.height + axis.offset + 2 + (axis.opposite ? 0 : axis.axisTitleMargin), axis.width, axis.height ); } else { scrollbar.position( axis.left + axis.width + 2 + axis.offset + (axis.opposite ? axis.axisTitleMargin : 0), axis.top, axis.width, axis.height ); } if (isNaN(scrollMin) || isNaN(scrollMax) || !defined(axis.min) || !defined(axis.max)) { scrollbar.setRange(0, 0); // default action: when there is not extremes on the axis, but scrollbar exists, make it full size } else { from = (axis.min - scrollMin) / (scrollMax - scrollMin); to = (axis.max - scrollMin) / (scrollMax - scrollMin); if ((axis.horiz && !axis.reversed) || (!axis.horiz && axis.reversed)) { scrollbar.setRange(from, to); } else { scrollbar.setRange(1 - to, 1 - from); // inverse vertical axis } } } }); /** * Make space for a scrollbar */ wrap(Axis.prototype, 'getOffset', function (proceed) { var axis = this, index = axis.horiz ? 2 : 1, scrollbar = axis.scrollbar; proceed.apply(axis, [].slice.call(arguments, 1)); if (scrollbar) { axis.chart.axisOffset[index] += scrollbar.size + scrollbar.options.margin; } }); /** * Destroy scrollbar when connected to the specific axis */ wrap(Axis.prototype, 'destroy', function (proceed) { if (this.scrollbar) { this.scrollbar = this.scrollbar.destroy(); } proceed.apply(this, [].slice.call(arguments, 1)); }); Highcharts.Scrollbar = Scrollbar; /* **************************************************************************** * Start Navigator code * *****************************************************************************/ var units = [].concat(defaultDataGroupingUnits), // copy defaultSeriesType, // Finding the min or max of a set of variables where we don't know if they are defined, // is a pattern that is repeated several places in Highcharts. Consider making this // a global utility method. numExt = function (extreme) { var numbers = grep(arguments, isNumber); if (numbers.length) { return Math[extreme].apply(0, numbers); } }; // add more resolution to units units[4] = ['day', [1, 2, 3, 4]]; // allow more days units[5] = ['week', [1, 2, 3]]; // allow more weeks defaultSeriesType = seriesTypes.areaspline === UNDEFINED ? 'line' : 'areaspline'; extend(defaultOptions, { navigator: { //enabled: true, handles: { backgroundColor: '#ebe7e8', borderColor: '#b2b1b6' }, height: 40, margin: 25, maskFill: 'rgba(128,179,236,0.3)', maskInside: true, outlineColor: '#b2b1b6', outlineWidth: 1, series: { type: defaultSeriesType, color: '#4572A7', compare: null, fillOpacity: 0.05, dataGrouping: { approximation: 'average', enabled: true, groupPixelWidth: 2, smoothed: true, units: units }, dataLabels: { enabled: false, zIndex: 2 // #1839 }, id: PREFIX + 'navigator-series', lineColor: null, // Allow color setting while disallowing default candlestick setting (#4602) lineWidth: 1, marker: { enabled: false }, pointRange: 0, shadow: false, threshold: null }, //top: undefined, xAxis: { tickWidth: 0, lineWidth: 0, gridLineColor: '#EEE', gridLineWidth: 1, tickPixelInterval: 200, labels: { align: 'left', style: { color: '#888' }, x: 3, y: -4 }, crosshair: false }, yAxis: { gridLineWidth: 0, startOnTick: false, endOnTick: false, minPadding: 0.1, maxPadding: 0.1, labels: { enabled: false }, crosshair: false, title: { text: null }, tickWidth: 0 } } }); /** * The Navigator class * @param {Object} chart */ function Navigator(chart) { var chartOptions = chart.options, navigatorOptions = chartOptions.navigator, navigatorEnabled = navigatorOptions.enabled, scrollbarOptions = chartOptions.scrollbar, scrollbarEnabled = scrollbarOptions.enabled, height = navigatorEnabled ? navigatorOptions.height : 0, scrollbarHeight = scrollbarEnabled ? scrollbarOptions.height : 0; this.handles = []; this.elementsToDestroy = []; // Array containing the elements to destroy when Navigator is destroyed this.chart = chart; this.setBaseSeries(); this.height = height; this.scrollbarHeight = scrollbarHeight; this.scrollbarEnabled = scrollbarEnabled; this.navigatorEnabled = navigatorEnabled; this.navigatorOptions = navigatorOptions; this.outlineHeight = height + scrollbarHeight; // Run scroller this.init(); } Navigator.prototype = { /** * Draw one of the handles on the side of the zoomed range in the navigator * @param {Number} x The x center for the handle * @param {Number} index 0 for left and 1 for right */ drawHandle: function (x, index) { var scroller = this, chart = scroller.chart, renderer = chart.renderer, elementsToDestroy = scroller.elementsToDestroy, handles = scroller.handles, handlesOptions = scroller.navigatorOptions.handles, attr = { fill: handlesOptions.backgroundColor, stroke: handlesOptions.borderColor, 'stroke-width': 1 }, tempElem; // create the elements if (!scroller.rendered) { // the group handles[index] = renderer.g('navigator-handle-' + ['left', 'right'][index]) .css({ cursor: 'ew-resize' }) .attr({ zIndex: 10 - index }) // zIndex = 3 for right handle, 4 for left / 10 - #2908 .add(); // the rectangle tempElem = renderer.rect(-4.5, 0, 9, 16, 0, 1) .attr(attr) .add(handles[index]); elementsToDestroy.push(tempElem); // the rifles tempElem = renderer .path([ 'M', -1.5, 4, 'L', -1.5, 12, 'M', 0.5, 4, 'L', 0.5, 12 ]).attr(attr) .add(handles[index]); elementsToDestroy.push(tempElem); } // Place it handles[index][scroller.rendered && !scroller.hasDragged ? 'animate' : 'attr']({ translateX: scroller.scrollerLeft + scroller.scrollbarHeight + parseInt(x, 10), translateY: scroller.top + scroller.height / 2 - 8 }); }, /** * Render the navigator * @param {Number} min X axis value minimum * @param {Number} max X axis value maximum * @param {Number} pxMin Pixel value minimum * @param {Number} pxMax Pixel value maximum */ render: function (min, max, pxMin, pxMax) { var scroller = this, chart = scroller.chart, renderer = chart.renderer, navigatorLeft, navigatorWidth, scrollerLeft, scrollerWidth, navigatorGroup = scroller.navigatorGroup, scrollbarHeight = scroller.scrollbarHeight, xAxis = scroller.xAxis, navigatorOptions = scroller.navigatorOptions, height = scroller.height, top = scroller.top, navigatorEnabled = scroller.navigatorEnabled, outlineWidth = navigatorOptions.outlineWidth, halfOutline = outlineWidth / 2, zoomedMin, zoomedMax, outlineHeight = scroller.outlineHeight, outlineTop = top + halfOutline, rendered = scroller.rendered, verb; // Don't render the navigator until we have data (#486, #4202, #5172). Don't redraw while moving the handles (#4703). if (!isNumber(min) || !isNumber(max) || (scroller.hasDragged && !defined(pxMin))) { return; } scroller.navigatorLeft = navigatorLeft = pick( xAxis.left, chart.plotLeft + scrollbarHeight // in case of scrollbar only, without navigator ); scroller.navigatorWidth = navigatorWidth = pick(xAxis.len, chart.plotWidth - 2 * scrollbarHeight); scroller.scrollerLeft = scrollerLeft = navigatorLeft - scrollbarHeight; scroller.scrollerWidth = scrollerWidth = scrollerWidth = navigatorWidth + 2 * scrollbarHeight; // Get the pixel position of the handles pxMin = pick(pxMin, xAxis.translate(min)); pxMax = pick(pxMax, xAxis.translate(max)); if (!isNumber(pxMin) || mathAbs(pxMin) === Infinity) { // Verify (#1851, #2238) pxMin = 0; pxMax = scrollerWidth; } // Are we below the minRange? (#2618) if (xAxis.translate(pxMax, true) - xAxis.translate(pxMin, true) < chart.xAxis[0].minRange) { return; } // handles are allowed to cross, but never exceed the plot area scroller.zoomedMax = mathMin(mathMax(pxMin, pxMax, 0), navigatorWidth); scroller.zoomedMin = mathMin(mathMax(scroller.fixedWidth ? scroller.zoomedMax - scroller.fixedWidth : mathMin(pxMin, pxMax), 0), navigatorWidth); scroller.range = scroller.zoomedMax - scroller.zoomedMin; zoomedMax = mathRound(scroller.zoomedMax); zoomedMin = mathRound(scroller.zoomedMin); if (!rendered) { if (navigatorEnabled) { // draw the navigator group scroller.navigatorGroup = navigatorGroup = renderer.g('navigator') .attr({ zIndex: 3 }) .add(); scroller.leftShade = renderer.rect() .attr({ fill: navigatorOptions.maskFill }).add(navigatorGroup); if (navigatorOptions.maskInside) { scroller.leftShade.css({ cursor: 'ew-resize' }); } else { scroller.rightShade = renderer.rect() .attr({ fill: navigatorOptions.maskFill }).add(navigatorGroup); } scroller.outline = renderer.path() .attr({ 'stroke-width': outlineWidth, stroke: navigatorOptions.outlineColor }) .add(navigatorGroup); } } // place elements verb = rendered && !scroller.hasDragged ? 'animate' : 'attr'; if (navigatorEnabled) { scroller.leftShade[verb](navigatorOptions.maskInside ? { x: navigatorLeft + zoomedMin, y: top, width: zoomedMax - zoomedMin, height: height } : { x: navigatorLeft, y: top, width: zoomedMin, height: height }); if (scroller.rightShade) { scroller.rightShade[verb]({ x: navigatorLeft + zoomedMax, y: top, width: navigatorWidth - zoomedMax, height: height }); } scroller.outline[verb]({ d: [ M, scrollerLeft, outlineTop, // left L, navigatorLeft + zoomedMin - halfOutline, outlineTop, // upper left of zoomed range navigatorLeft + zoomedMin - halfOutline, outlineTop + outlineHeight, // lower left of z.r. L, navigatorLeft + zoomedMax - halfOutline, outlineTop + outlineHeight, // lower right of z.r. L, navigatorLeft + zoomedMax - halfOutline, outlineTop, // upper right of z.r. scrollerLeft + scrollerWidth, outlineTop // right ].concat(navigatorOptions.maskInside ? [ M, navigatorLeft + zoomedMin + halfOutline, outlineTop, // upper left of zoomed range L, navigatorLeft + zoomedMax - halfOutline, outlineTop // upper right of z.r. ] : []) }); // draw handles scroller.drawHandle(zoomedMin + halfOutline, 0); scroller.drawHandle(zoomedMax + halfOutline, 1); } if (scroller.scrollbar) { scroller.scrollbar.hasDragged = scroller.hasDragged; // Keep scale 0-1 scroller.scrollbar.position( scroller.scrollerLeft, scroller.top + (navigatorEnabled ? scroller.height : -scroller.scrollbarHeight), scroller.scrollerWidth, scroller.scrollbarHeight ); scroller.scrollbar.setRange( zoomedMin / navigatorWidth, zoomedMax / navigatorWidth ); } scroller.rendered = true; }, /** * Set up the mouse and touch events for the navigator */ addEvents: function () { var chart = this.chart, container = chart.container, mouseDownHandler = this.mouseDownHandler, mouseMoveHandler = this.mouseMoveHandler, mouseUpHandler = this.mouseUpHandler, _events; // Mouse events _events = [ [container, 'mousedown', mouseDownHandler], [container, 'mousemove', mouseMoveHandler], [doc, 'mouseup', mouseUpHandler] ]; // Touch events if (hasTouch) { _events.push( [container, 'touchstart', mouseDownHandler], [container, 'touchmove', mouseMoveHandler], [doc, 'touchend', mouseUpHandler] ); } // Add them all each(_events, function (args) { addEvent.apply(null, args); }); this._events = _events; // Data events if (this.series) { addEvent(this.series.xAxis, 'foundExtremes', function () { chart.scroller.modifyNavigatorAxisExtremes(); }); } addEvent(chart, 'redraw', function () { // Move the scrollbar after redraw, like after data updata even if axes don't redraw var scroller = this.scroller, xAxis = scroller && scroller.baseSeries && scroller.baseSeries.xAxis; if (xAxis) { scroller.render(xAxis.min, xAxis.max); } }); }, /** * Removes the event handlers attached previously with addEvents. */ removeEvents: function () { each(this._events, function (args) { removeEvent.apply(null, args); }); this._events = UNDEFINED; this.removeBaseSeriesEvents(); }, removeBaseSeriesEvents: function () { if (this.navigatorEnabled && this.baseSeries && this.baseSeries.xAxis && this.navigatorOptions.adaptToUpdatedData !== false) { removeEvent(this.baseSeries, 'updatedData', this.updatedDataHandler); removeEvent(this.baseSeries.xAxis, 'foundExtremes', this.modifyBaseAxisExtremes); } }, /** * Initiate the Navigator object */ init: function () { var scroller = this, chart = scroller.chart, xAxis, yAxis, scrollbarHeight = scroller.scrollbarHeight, navigatorOptions = scroller.navigatorOptions, height = scroller.height, top = scroller.top, dragOffset, baseSeries = scroller.baseSeries; /** * Event handler for the mouse down event. */ scroller.mouseDownHandler = function (e) { e = chart.pointer.normalize(e); var zoomedMin = scroller.zoomedMin, zoomedMax = scroller.zoomedMax, top = scroller.top, scrollerLeft = scroller.scrollerLeft, scrollerWidth = scroller.scrollerWidth, navigatorLeft = scroller.navigatorLeft, navigatorWidth = scroller.navigatorWidth, scrollbarPad = scroller.scrollbarPad || 0, range = scroller.range, chartX = e.chartX, chartY = e.chartY, baseXAxis = chart.xAxis[0], fixedMax, ext, handleSensitivity = isTouchDevice ? 10 : 7, left; if (chartY > top && chartY < top + height) { // we're vertically inside the navigator // grab the left handle if (math.abs(chartX - zoomedMin - navigatorLeft) < handleSensitivity) { scroller.grabbedLeft = true; scroller.otherHandlePos = zoomedMax; scroller.fixedExtreme = baseXAxis.max; chart.fixedRange = null; // grab the right handle } else if (math.abs(chartX - zoomedMax - navigatorLeft) < handleSensitivity) { scroller.grabbedRight = true; scroller.otherHandlePos = zoomedMin; scroller.fixedExtreme = baseXAxis.min; chart.fixedRange = null; // grab the zoomed range } else if (chartX > navigatorLeft + zoomedMin - scrollbarPad && chartX < navigatorLeft + zoomedMax + scrollbarPad) { scroller.grabbedCenter = chartX; scroller.fixedWidth = range; dragOffset = chartX - zoomedMin; // shift the range by clicking on shaded areas } else if (chartX > scrollerLeft && chartX < scrollerLeft + scrollerWidth) { left = chartX - navigatorLeft - range / 2; if (left < 0) { left = 0; } else if (left + range >= navigatorWidth) { left = navigatorWidth - range; fixedMax = scroller.getUnionExtremes().dataMax; // #2293, #3543 } if (left !== zoomedMin) { // it has actually moved scroller.fixedWidth = range; // #1370 ext = xAxis.toFixedRange(left, left + range, null, fixedMax); baseXAxis.setExtremes( ext.min, ext.max, true, null, // auto animation { trigger: 'navigator' } ); } } } }; /** * Event handler for the mouse move event. */ scroller.mouseMoveHandler = function (e) { var scrollbarHeight = scroller.scrollbarHeight, navigatorLeft = scroller.navigatorLeft, navigatorWidth = scroller.navigatorWidth, scrollerLeft = scroller.scrollerLeft, scrollerWidth = scroller.scrollerWidth, range = scroller.range, chartX; // In iOS, a mousemove event with e.pageX === 0 is fired when holding the finger // down in the center of the scrollbar. This should be ignored. if (!e.touches || e.touches[0].pageX !== 0) { // #4696, scrollbar failed on Android e = chart.pointer.normalize(e); chartX = e.chartX; // validation for handle dragging if (chartX < navigatorLeft) { chartX = navigatorLeft; } else if (chartX > scrollerLeft + scrollerWidth - scrollbarHeight) { chartX = scrollerLeft + scrollerWidth - scrollbarHeight; } // drag left handle if (scroller.grabbedLeft) { scroller.hasDragged = true; scroller.render(0, 0, chartX - navigatorLeft, scroller.otherHandlePos); // drag right handle } else if (scroller.grabbedRight) { scroller.hasDragged = true; scroller.render(0, 0, scroller.otherHandlePos, chartX - navigatorLeft); // drag scrollbar or open area in navigator } else if (scroller.grabbedCenter) { scroller.hasDragged = true; if (chartX < dragOffset) { // outside left chartX = dragOffset; } else if (chartX > navigatorWidth + dragOffset - range) { // outside right chartX = navigatorWidth + dragOffset - range; } scroller.render(0, 0, chartX - dragOffset, chartX - dragOffset + range); } if (scroller.hasDragged && scroller.scrollbar && scroller.scrollbar.options.liveRedraw) { e.DOMType = e.type; // DOMType is for IE8 because it can't read type async setTimeout(function () { scroller.mouseUpHandler(e); }, 0); } } }; /** * Event handler for the mouse up event. */ scroller.mouseUpHandler = function (e) { var ext, fixedMin, fixedMax, DOMEvent = e.DOMEvent || e; if (scroller.hasDragged || e.trigger === 'scrollbar') { // When dragging one handle, make sure the other one doesn't change if (scroller.zoomedMin === scroller.otherHandlePos) { fixedMin = scroller.fixedExtreme; } else if (scroller.zoomedMax === scroller.otherHandlePos) { fixedMax = scroller.fixedExtreme; } // Snap to right edge (#4076) if (scroller.zoomedMax === scroller.navigatorWidth) { fixedMax = scroller.getUnionExtremes().dataMax; } ext = xAxis.toFixedRange(scroller.zoomedMin, scroller.zoomedMax, fixedMin, fixedMax); if (defined(ext.min)) { chart.xAxis[0].setExtremes( ext.min, ext.max, true, scroller.hasDragged ? false : null, // Run animation when clicking buttons, scrollbar track etc, but not when dragging handles or scrollbar { trigger: 'navigator', triggerOp: 'navigator-drag', DOMEvent: DOMEvent // #1838 } ); } } if (e.DOMType !== 'mousemove') { scroller.grabbedLeft = scroller.grabbedRight = scroller.grabbedCenter = scroller.fixedWidth = scroller.fixedExtreme = scroller.otherHandlePos = scroller.hasDragged = dragOffset = null; } }; var xAxisIndex = chart.xAxis.length, yAxisIndex = chart.yAxis.length; // make room below the chart chart.extraBottomMargin = scroller.outlineHeight + navigatorOptions.margin; if (scroller.navigatorEnabled) { // an x axis is required for scrollbar also scroller.xAxis = xAxis = new Axis(chart, merge({ // inherit base xAxis' break and ordinal options breaks: baseSeries && baseSeries.xAxis.options.breaks, ordinal: baseSeries && baseSeries.xAxis.options.ordinal }, navigatorOptions.xAxis, { id: 'navigator-x-axis', isX: true, type: 'datetime', index: xAxisIndex, height: height, offset: 0, offsetLeft: scrollbarHeight, offsetRight: -scrollbarHeight, keepOrdinalPadding: true, // #2436 startOnTick: false, endOnTick: false, minPadding: 0, maxPadding: 0, zoomEnabled: false })); scroller.yAxis = yAxis = new Axis(chart, merge(navigatorOptions.yAxis, { id: 'navigator-y-axis', alignTicks: false, height: height, offset: 0, index: yAxisIndex, zoomEnabled: false })); // If we have a base series, initialize the navigator series if (baseSeries || navigatorOptions.series.data) { scroller.addBaseSeries(); // If not, set up an event to listen for added series } else if (chart.series.length === 0) { wrap(chart, 'redraw', function (proceed, animation) { // We've got one, now add it as base and reset chart.redraw if (chart.series.length > 0 && !scroller.series) { scroller.setBaseSeries(); chart.redraw = proceed; // reset } proceed.call(chart, animation); }); } // in case of scrollbar only, fake an x axis to get translation } else { scroller.xAxis = xAxis = { translate: function (value, reverse) { var axis = chart.xAxis[0], ext = axis.getExtremes(), scrollTrackWidth = chart.plotWidth - 2 * scrollbarHeight, min = numExt('min', axis.options.min, ext.dataMin), valueRange = numExt('max', axis.options.max, ext.dataMax) - min; return reverse ? // from pixel to value (value * valueRange / scrollTrackWidth) + min : // from value to pixel scrollTrackWidth * (value - min) / valueRange; }, toFixedRange: Axis.prototype.toFixedRange }; } // Initialize the scrollbar if (chart.options.scrollbar.enabled) { scroller.scrollbar = new Scrollbar( chart.renderer, merge(chart.options.scrollbar, { margin: scroller.navigatorEnabled ? 0 : 10 }), chart ); addEvent(scroller.scrollbar, 'changed', function (e) { var range = scroller.navigatorWidth, to = range * this.to, from = range * this.from; scroller.hasDragged = scroller.scrollbar.hasDragged; scroller.render(0, 0, from, to); if (chart.options.scrollbar.liveRedraw || e.DOMType !== 'mousemove') { setTimeout(function () { scroller.mouseUpHandler(e); }); } }); } // Add data events scroller.addBaseSeriesEvents(); /** * For stock charts, extend the Chart.getMargins method so that we can set the final top position * of the navigator once the height of the chart, including the legend, is determined. #367. */ wrap(chart, 'getMargins', function (proceed) { var legend = this.legend, legendOptions = legend.options; proceed.apply(this, [].slice.call(arguments, 1)); // Compute the top position scroller.top = top = scroller.navigatorOptions.top || this.chartHeight - scroller.height - scroller.scrollbarHeight - this.spacing[2] - (legendOptions.verticalAlign === 'bottom' && legendOptions.enabled && !legendOptions.floating ? legend.legendHeight + pick(legendOptions.margin, 10) : 0); if (xAxis && yAxis) { // false if navigator is disabled (#904) xAxis.options.top = yAxis.options.top = top; xAxis.setAxisSize(); yAxis.setAxisSize(); } }); scroller.addEvents(); }, /** * Get the union data extremes of the chart - the outer data extremes of the base * X axis and the navigator axis. */ getUnionExtremes: function (returnFalseOnNoBaseSeries) { var baseAxis = this.chart.xAxis[0], navAxis = this.xAxis, navAxisOptions = navAxis.options, baseAxisOptions = baseAxis.options, ret; if (!returnFalseOnNoBaseSeries || baseAxis.dataMin !== null) { ret = { dataMin: pick( // #4053 navAxisOptions && navAxisOptions.min, numExt( 'min', baseAxisOptions.min, baseAxis.dataMin, navAxis.dataMin, navAxis.min ) ), dataMax: pick( navAxisOptions && navAxisOptions.max, numExt( 'max', baseAxisOptions.max, baseAxis.dataMax, navAxis.dataMax, navAxis.max ) ) }; } return ret; }, /** * Set the base series. With a bit of modification we should be able to make * this an API method to be called from the outside */ setBaseSeries: function (baseSeriesOption) { var chart = this.chart; baseSeriesOption = baseSeriesOption || chart.options.navigator.baseSeries; // If we're resetting, remove the existing series if (this.series) { this.removeBaseSeriesEvents(); this.series.remove(); } // Set the new base series this.baseSeries = chart.series[baseSeriesOption] || (typeof baseSeriesOption === 'string' && chart.get(baseSeriesOption)) || chart.series[0]; // When run after render, this.xAxis already exists if (this.xAxis) { this.addBaseSeries(); } }, addBaseSeries: function () { var baseSeries = this.baseSeries, baseOptions = baseSeries ? baseSeries.options : {}, baseData = baseOptions.data, mergedNavSeriesOptions, navigatorSeriesOptions = this.navigatorOptions.series, navigatorData; // remove it to prevent merging one by one navigatorData = navigatorSeriesOptions.data; this.hasNavigatorData = !!navigatorData; // Merge the series options mergedNavSeriesOptions = merge(baseOptions, navigatorSeriesOptions, { enableMouseTracking: false, group: 'nav', // for columns padXAxis: false, xAxis: 'navigator-x-axis', yAxis: 'navigator-y-axis', name: 'Navigator', showInLegend: false, stacking: false, // We only allow one series anyway (#4823) isInternal: true, visible: true }); // Set the data. Do a slice to avoid mutating the navigator options from base series (#4923). mergedNavSeriesOptions.data = navigatorData || baseData.slice(0); // Add the series this.series = this.chart.initSeries(mergedNavSeriesOptions); this.addBaseSeriesEvents(); }, addBaseSeriesEvents: function () { var baseSeries = this.baseSeries; // Respond to updated data in the base series. // Abort if lazy-loading data from the server. if (baseSeries && baseSeries.xAxis && this.navigatorOptions.adaptToUpdatedData !== false) { addEvent(baseSeries, 'updatedData', this.updatedDataHandler); addEvent(baseSeries.xAxis, 'foundExtremes', this.modifyBaseAxisExtremes); // Survive Series.update() baseSeries.userOptions.events = extend(baseSeries.userOptions.event, { updatedData: this.updatedDataHandler }); } }, /** * Set the scroller x axis extremes to reflect the total. The navigator extremes * should always be the extremes of the union of all series in the chart as * well as the navigator series. */ modifyNavigatorAxisExtremes: function () { var xAxis = this.xAxis, unionExtremes; if (xAxis.getExtremes) { unionExtremes = this.getUnionExtremes(true); if (unionExtremes && (unionExtremes.dataMin !== xAxis.min || unionExtremes.dataMax !== xAxis.max)) { xAxis.min = unionExtremes.dataMin; xAxis.max = unionExtremes.dataMax; } } }, /** * Hook to modify the base axis extremes with information from the Navigator */ modifyBaseAxisExtremes: function () { if (!this.chart.scroller.baseSeries || !this.chart.scroller.baseSeries.xAxis) { return; } var baseXAxis = this, scroller = baseXAxis.chart.scroller, baseExtremes = baseXAxis.getExtremes(), baseMin = baseExtremes.min, baseMax = baseExtremes.max, baseDataMin = baseExtremes.dataMin, baseDataMax = baseExtremes.dataMax, range = baseMax - baseMin, stickToMin = scroller.stickToMin, stickToMax = scroller.stickToMax, newMax, newMin, navigatorSeries = scroller.series, hasSetExtremes = !!baseXAxis.setExtremes, // When the extremes have been set by range selector button, don't stick to min or max. // The range selector buttons will handle the extremes. (#5489) unmutable = baseXAxis.eventArgs && baseXAxis.eventArgs.trigger === 'rangeSelectorButton'; if (!unmutable) { // If the zoomed range is already at the min, move it to the right as new data // comes in if (stickToMin) { newMin = baseDataMin; newMax = newMin + range; } // If the zoomed range is already at the max, move it to the right as new data // comes in if (stickToMax) { newMax = baseDataMax; if (!stickToMin) { // if stickToMin is true, the new min value is set above newMin = mathMax(newMax - range, navigatorSeries && navigatorSeries.xData ? navigatorSeries.xData[0] : -Number.MAX_VALUE); } } // Update the extremes if (hasSetExtremes && (stickToMin || stickToMax)) { if (isNumber(newMin)) { baseXAxis.min = baseXAxis.userMin = newMin; baseXAxis.max = baseXAxis.userMax = newMax; } } } // Reset scroller.stickToMin = scroller.stickToMax = null; }, /** * Handler for updated data on the base series. When data is modified, the navigator series * must reflect it. This is called from the Chart.redraw function before axis and series * extremes are computed. */ updatedDataHandler: function () { var scroller = this.chart.scroller, baseSeries = scroller.baseSeries, navigatorSeries = scroller.series; // Detect whether the zoomed area should stick to the minimum or maximum. If the current // axis minimum falls outside the new updated dataset, we must adjust. scroller.stickToMin = isNumber(baseSeries.xAxis.min) && (baseSeries.xAxis.min <= baseSeries.xData[0]); // If the scrollbar is scrolled all the way to the right, keep right as new data // comes in. scroller.stickToMax = Math.round(scroller.zoomedMax) >= Math.round(scroller.navigatorWidth); // Set the navigator series data to the new data of the base series if (navigatorSeries && !scroller.hasNavigatorData) { navigatorSeries.options.pointStart = baseSeries.xData[0]; navigatorSeries.setData(baseSeries.options.data, false, null, false); // #5414 } }, /** * Destroys allocated elements. */ destroy: function () { var scroller = this; // Disconnect events added in addEvents scroller.removeEvents(); // Destroy properties each([scroller.scrollbar, scroller.xAxis, scroller.yAxis, scroller.leftShade, scroller.rightShade, scroller.outline], function (prop) { if (prop && prop.destroy) { prop.destroy(); } }); scroller.xAxis = scroller.yAxis = scroller.leftShade = scroller.rightShade = scroller.outline = null; // Destroy elements in collection each([scroller.handles, scroller.elementsToDestroy], function (coll) { destroyObjectProperties(coll); }); } }; Highcharts.Navigator = Navigator; /** * For Stock charts, override selection zooming with some special features because * X axis zooming is already allowed by the Navigator and Range selector. */ wrap(Axis.prototype, 'zoom', function (proceed, newMin, newMax) { var chart = this.chart, chartOptions = chart.options, zoomType = chartOptions.chart.zoomType, previousZoom, navigator = chartOptions.navigator, rangeSelector = chartOptions.rangeSelector, ret; if (this.isXAxis && ((navigator && navigator.enabled) || (rangeSelector && rangeSelector.enabled))) { // For x only zooming, fool the chart.zoom method not to create the zoom button // because the property already exists if (zoomType === 'x') { chart.resetZoomButton = 'blocked'; // For y only zooming, ignore the X axis completely } else if (zoomType === 'y') { ret = false; // For xy zooming, record the state of the zoom before zoom selection, then when // the reset button is pressed, revert to this state } else if (zoomType === 'xy') { previousZoom = this.previousZoom; if (defined(newMin)) { this.previousZoom = [this.min, this.max]; } else if (previousZoom) { newMin = previousZoom[0]; newMax = previousZoom[1]; delete this.previousZoom; } } } return ret !== UNDEFINED ? ret : proceed.call(this, newMin, newMax); }); // Initialize scroller for stock charts wrap(Chart.prototype, 'init', function (proceed, options, callback) { addEvent(this, 'beforeRender', function () { var options = this.options; if (options.navigator.enabled || options.scrollbar.enabled) { this.scroller = new Navigator(this); } }); proceed.call(this, options, callback); }); // Pick up badly formatted point options to addPoint wrap(Series.prototype, 'addPoint', function (proceed, options, redraw, shift, animation) { var turboThreshold = this.options.turboThreshold; if (turboThreshold && this.xData.length > turboThreshold && isObject(options, true) && this.chart.scroller) { error(20, true); } proceed.call(this, options, redraw, shift, animation); }); /* **************************************************************************** * End Navigator code * *****************************************************************************/ /* **************************************************************************** * Start Range Selector code * *****************************************************************************/ extend(defaultOptions, { rangeSelector: { // allButtonsEnabled: false, // enabled: true, // buttons: {Object} // buttonSpacing: 0, buttonTheme: { width: 28, height: 18, fill: '#f7f7f7', padding: 2, r: 0, 'stroke-width': 0, style: { color: '#444', cursor: 'pointer', fontWeight: 'normal' }, zIndex: 7, // #484, #852 states: { hover: { fill: '#e7e7e7' }, select: { fill: '#e7f0f9', style: { color: 'black', fontWeight: 'bold' } } } }, height: 35, // reserved space for buttons and input inputPosition: { align: 'right' }, // inputDateFormat: '%b %e, %Y', // inputEditDateFormat: '%Y-%m-%d', // inputEnabled: true, // inputStyle: {}, labelStyle: { color: '#666' } // selected: undefined } }); defaultOptions.lang = merge(defaultOptions.lang, { rangeSelectorZoom: 'Zoom', rangeSelectorFrom: 'From', rangeSelectorTo: 'To' }); /** * The object constructor for the range selector * @param {Object} chart */ function RangeSelector(chart) { // Run RangeSelector this.init(chart); } RangeSelector.prototype = { /** * The method to run when one of the buttons in the range selectors is clicked * @param {Number} i The index of the button * @param {Object} rangeOptions * @param {Boolean} redraw */ clickButton: function (i, redraw) { var rangeSelector = this, selected = rangeSelector.selected, chart = rangeSelector.chart, buttons = rangeSelector.buttons, rangeOptions = rangeSelector.buttonOptions[i], baseAxis = chart.xAxis[0], unionExtremes = (chart.scroller && chart.scroller.getUnionExtremes()) || baseAxis || {}, dataMin = unionExtremes.dataMin, dataMax = unionExtremes.dataMax, newMin, newMax = baseAxis && mathRound(mathMin(baseAxis.max, pick(dataMax, baseAxis.max))), // #1568 now, type = rangeOptions.type, baseXAxisOptions, range = rangeOptions._range, rangeMin, year, minSetting, rangeSetting, ctx, dataGrouping = rangeOptions.dataGrouping; if (dataMin === null || dataMax === null || // chart has no data, base series is removed i === rangeSelector.selected) { // same button is clicked twice return; } // Set the fixed range before range is altered chart.fixedRange = range; // Apply dataGrouping associated to button if (dataGrouping) { this.forcedDataGrouping = true; Axis.prototype.setDataGrouping.call(baseAxis || { chart: this.chart }, dataGrouping, false); } // Apply range if (type === 'month' || type === 'year') { if (!baseAxis) { // This is set to the user options and picked up later when the axis is instantiated // so that we know the min and max. range = rangeOptions; } else { ctx = { range: rangeOptions, max: newMax, dataMin: dataMin, dataMax: dataMax }; newMin = baseAxis.minFromRange.call(ctx); if (isNumber(ctx.newMax)) { newMax = ctx.newMax; } } // Fixed times like minutes, hours, days } else if (range) { newMin = mathMax(newMax - range, dataMin); newMax = mathMin(newMin + range, dataMax); } else if (type === 'ytd') { // On user clicks on the buttons, or a delayed action running from the beforeRender // event (below), the baseAxis is defined. if (baseAxis) { // When "ytd" is the pre-selected button for the initial view, its calculation // is delayed and rerun in the beforeRender event (below). When the series // are initialized, but before the chart is rendered, we have access to the xData // array (#942). if (dataMax === UNDEFINED) { dataMin = Number.MAX_VALUE; dataMax = Number.MIN_VALUE; each(chart.series, function (series) { var xData = series.xData; // reassign it to the last item dataMin = mathMin(xData[0], dataMin); dataMax = mathMax(xData[xData.length - 1], dataMax); }); redraw = false; } now = new Date(dataMax); year = now.getFullYear(); newMin = rangeMin = mathMax(dataMin || 0, Date.UTC(year, 0, 1)); now = now.getTime(); newMax = mathMin(dataMax || now, now); // "ytd" is pre-selected. We don't yet have access to processed point and extremes data // (things like pointStart and pointInterval are missing), so we delay the process (#942) } else { addEvent(chart, 'beforeRender', function () { rangeSelector.clickButton(i); }); return; } } else if (type === 'all' && baseAxis) { newMin = dataMin; newMax = dataMax; } // Deselect previous button if (buttons[selected]) { buttons[selected].setState(0); } // Select this button if (buttons[i]) { buttons[i].setState(2); rangeSelector.lastSelected = i; } // Update the chart if (!baseAxis) { // Axis not yet instanciated. Temporarily set min and range // options and remove them on chart load (#4317). baseXAxisOptions = splat(chart.options.xAxis)[0]; rangeSetting = baseXAxisOptions.range; baseXAxisOptions.range = range; minSetting = baseXAxisOptions.min; baseXAxisOptions.min = rangeMin; rangeSelector.setSelected(i); addEvent(chart, 'load', function resetMinAndRange() { baseXAxisOptions.range = rangeSetting; baseXAxisOptions.min = minSetting; }); } else { // Existing axis object. Set extremes after render time. baseAxis.setExtremes( newMin, newMax, pick(redraw, 1), null, // auto animation { trigger: 'rangeSelectorButton', rangeSelectorButton: rangeOptions } ); rangeSelector.setSelected(i); } }, /** * Set the selected option. This method only sets the internal flag, it doesn't * update the buttons or the actual zoomed range. */ setSelected: function (selected) { this.selected = this.options.selected = selected; }, /** * The default buttons for pre-selecting time frames */ defaultButtons: [{ type: 'month', count: 1, text: '1m' }, { type: 'month', count: 3, text: '3m' }, { type: 'month', count: 6, text: '6m' }, { type: 'ytd', text: 'YTD' }, { type: 'year', count: 1, text: '1y' }, { type: 'all', text: 'All' }], /** * Initialize the range selector */ init: function (chart) { var rangeSelector = this, options = chart.options.rangeSelector, buttonOptions = options.buttons || [].concat(rangeSelector.defaultButtons), selectedOption = options.selected, blurInputs = rangeSelector.blurInputs = function () { var minInput = rangeSelector.minInput, maxInput = rangeSelector.maxInput; if (minInput && minInput.blur) { //#3274 in some case blur is not defined fireEvent(minInput, 'blur'); //#3274 } if (maxInput && maxInput.blur) { //#3274 in some case blur is not defined fireEvent(maxInput, 'blur'); //#3274 } }; rangeSelector.chart = chart; rangeSelector.options = options; rangeSelector.buttons = []; chart.extraTopMargin = options.height; rangeSelector.buttonOptions = buttonOptions; addEvent(chart.container, 'mousedown', blurInputs); addEvent(chart, 'resize', blurInputs); // Extend the buttonOptions with actual range each(buttonOptions, rangeSelector.computeButtonRange); // zoomed range based on a pre-selected button index if (selectedOption !== UNDEFINED && buttonOptions[selectedOption]) { this.clickButton(selectedOption, false); } addEvent(chart, 'load', function () { // If a data grouping is applied to the current button, release it when extremes change addEvent(chart.xAxis[0], 'setExtremes', function (e) { if (this.max - this.min !== chart.fixedRange && e.trigger !== 'rangeSelectorButton' && e.trigger !== 'updatedData' && rangeSelector.forcedDataGrouping) { this.setDataGrouping(false, false); } }); // Normalize the pressed button whenever a new range is selected addEvent(chart.xAxis[0], 'afterSetExtremes', function () { rangeSelector.updateButtonStates(true); }); }); }, /** * Dynamically update the range selector buttons after a new range has been set */ updateButtonStates: function (updating) { var rangeSelector = this, chart = this.chart, baseAxis = chart.xAxis[0], unionExtremes = (chart.scroller && chart.scroller.getUnionExtremes()) || baseAxis, dataMin = unionExtremes.dataMin, dataMax = unionExtremes.dataMax, selected = rangeSelector.selected, allButtonsEnabled = rangeSelector.options.allButtonsEnabled, buttons = rangeSelector.buttons; if (updating && chart.fixedRange !== mathRound(baseAxis.max - baseAxis.min)) { if (buttons[selected]) { buttons[selected].setState(0); } rangeSelector.setSelected(null); } each(rangeSelector.buttonOptions, function (rangeOptions, i) { var actualRange = mathRound(baseAxis.max - baseAxis.min), range = rangeOptions._range, type = rangeOptions.type, count = rangeOptions.count || 1, // Disable buttons where the range exceeds what is allowed in the current view isTooGreatRange = range > dataMax - dataMin, // Disable buttons where the range is smaller than the minimum range isTooSmallRange = range < baseAxis.minRange, // Disable the All button if we're already showing all isAllButAlreadyShowingAll = rangeOptions.type === 'all' && baseAxis.max - baseAxis.min >= dataMax - dataMin && buttons[i].state !== 2, // Set a button on export isSelectedForExport = chart.renderer.forExport && i === selected, isSameRange = range === actualRange, hasNoData = !baseAxis.hasVisibleSeries; // Months and years have a variable range so we check the extremes if ((type === 'month' || type === 'year') && (actualRange >= { month: 28, year: 365 }[type] * 24 * 36e5 * count) && (actualRange <= { month: 31, year: 366 }[type] * 24 * 36e5 * count)) { isSameRange = true; } // The new zoom area happens to match the range for a button - mark it selected. // This happens when scrolling across an ordinal gap. It can be seen in the intraday // demos when selecting 1h and scroll across the night gap. if (isSelectedForExport || (isSameRange && i !== selected) && i === rangeSelector.lastSelected) { rangeSelector.setSelected(i); buttons[i].setState(2); } else if (!allButtonsEnabled && (isTooGreatRange || isTooSmallRange || isAllButAlreadyShowingAll || hasNoData)) { buttons[i].setState(3); } else if (buttons[i].state === 3) { buttons[i].setState(0); } }); }, /** * Compute and cache the range for an individual button */ computeButtonRange: function (rangeOptions) { var type = rangeOptions.type, count = rangeOptions.count || 1, // these time intervals have a fixed number of milliseconds, as opposed // to month, ytd and year fixedTimes = { millisecond: 1, second: 1000, minute: 60 * 1000, hour: 3600 * 1000, day: 24 * 3600 * 1000, week: 7 * 24 * 3600 * 1000 }; // Store the range on the button object if (fixedTimes[type]) { rangeOptions._range = fixedTimes[type] * count; } else if (type === 'month' || type === 'year') { rangeOptions._range = { month: 30, year: 365 }[type] * 24 * 36e5 * count; } }, /** * Set the internal and displayed value of a HTML input for the dates * @param {String} name * @param {Number} time */ setInputValue: function (name, time) { var options = this.chart.options.rangeSelector; if (defined(time)) { this[name + 'Input'].HCTime = time; } this[name + 'Input'].value = dateFormat( options.inputEditDateFormat || '%Y-%m-%d', this[name + 'Input'].HCTime ); this[name + 'DateBox'].attr({ text: dateFormat(options.inputDateFormat || '%b %e, %Y', this[name + 'Input'].HCTime) }); }, showInput: function (name) { var inputGroup = this.inputGroup, dateBox = this[name + 'DateBox']; css(this[name + 'Input'], { left: (inputGroup.translateX + dateBox.x) + PX, top: inputGroup.translateY + PX, width: (dateBox.width - 2) + PX, height: (dateBox.height - 2) + PX, border: '2px solid silver' }); }, hideInput: function (name) { css(this[name + 'Input'], { border: 0, width: '1px', height: '1px' }); this.setInputValue(name); }, /** * Draw either the 'from' or the 'to' HTML input box of the range selector * @param {Object} name */ drawInput: function (name) { var rangeSelector = this, chart = rangeSelector.chart, chartStyle = chart.renderer.style, renderer = chart.renderer, options = chart.options.rangeSelector, lang = defaultOptions.lang, div = rangeSelector.div, isMin = name === 'min', input, label, dateBox, inputGroup = this.inputGroup; function updateExtremes() { var inputValue = input.value, value = (options.inputDateParser || Date.parse)(inputValue), xAxis = chart.scroller && chart.scroller.xAxis ? chart.scroller.xAxis : chart.xAxis[0], dataMin = xAxis.dataMin, dataMax = xAxis.dataMax; if (value !== input.previousValue) { input.previousValue = value; // If the value isn't parsed directly to a value by the browser's Date.parse method, // like YYYY-MM-DD in IE, try parsing it a different way if (!isNumber(value)) { value = inputValue.split('-'); value = Date.UTC(pInt(value[0]), pInt(value[1]) - 1, pInt(value[2])); } if (isNumber(value)) { // Correct for timezone offset (#433) if (!defaultOptions.global.useUTC) { value = value + new Date().getTimezoneOffset() * 60 * 1000; } // Validate the extremes. If it goes beyound the data min or max, use the // actual data extreme (#2438). if (isMin) { if (value > rangeSelector.maxInput.HCTime) { value = UNDEFINED; } else if (value < dataMin) { value = dataMin; } } else { if (value < rangeSelector.minInput.HCTime) { value = UNDEFINED; } else if (value > dataMax) { value = dataMax; } } // Set the extremes if (value !== UNDEFINED) { chart.xAxis[0].setExtremes( isMin ? value : xAxis.min, isMin ? xAxis.max : value, UNDEFINED, UNDEFINED, { trigger: 'rangeSelectorInput' } ); } } } } // Create the text label this[name + 'Label'] = label = renderer.label(lang[isMin ? 'rangeSelectorFrom' : 'rangeSelectorTo'], this.inputGroup.offset) .attr({ padding: 2 }) .css(merge(chartStyle, options.labelStyle)) .add(inputGroup); inputGroup.offset += label.width + 5; // Create an SVG label that shows updated date ranges and and records click events that // bring in the HTML input. this[name + 'DateBox'] = dateBox = renderer.label('', inputGroup.offset) .attr({ padding: 2, width: options.inputBoxWidth || 90, height: options.inputBoxHeight || 17, stroke: options.inputBoxBorderColor || 'silver', 'stroke-width': 1 }) .css(merge({ textAlign: 'center', color: '#444' }, chartStyle, options.inputStyle)) .on('click', function () { rangeSelector.showInput(name); // If it is already focused, the onfocus event doesn't fire (#3713) rangeSelector[name + 'Input'].focus(); }) .add(inputGroup); inputGroup.offset += dateBox.width + (isMin ? 10 : 0); // Create the HTML input element. This is rendered as 1x1 pixel then set to the right size // when focused. this[name + 'Input'] = input = createElement('input', { name: name, className: PREFIX + 'range-selector', type: 'text' }, extend({ position: ABSOLUTE, border: 0, width: '1px', // Chrome needs a pixel to see it height: '1px', padding: 0, textAlign: 'center', fontSize: chartStyle.fontSize, fontFamily: chartStyle.fontFamily, left: '-9em', // #4798 top: chart.plotTop + PX // prevent jump on focus in Firefox }, options.inputStyle), div); // Blow up the input box input.onfocus = function () { rangeSelector.showInput(name); }; // Hide away the input box input.onblur = function () { rangeSelector.hideInput(name); }; // handle changes in the input boxes input.onchange = updateExtremes; input.onkeypress = function (event) { // IE does not fire onchange on enter if (event.keyCode === 13) { updateExtremes(); } }; }, /** * Get the position of the range selector buttons and inputs. This can be overridden from outside for custom positioning. */ getPosition: function () { var chart = this.chart, options = chart.options.rangeSelector, buttonTop = pick((options.buttonPosition || {}).y, chart.plotTop - chart.axisOffset[0] - options.height); return { buttonTop: buttonTop, inputTop: buttonTop - 10 }; }, /** * Render the range selector including the buttons and the inputs. The first time render * is called, the elements are created and positioned. On subsequent calls, they are * moved and updated. * @param {Number} min X axis minimum * @param {Number} max X axis maximum */ render: function (min, max) { var rangeSelector = this, chart = rangeSelector.chart, renderer = chart.renderer, container = chart.container, chartOptions = chart.options, navButtonOptions = chartOptions.exporting && chartOptions.exporting.enabled !== false && chartOptions.navigation && chartOptions.navigation.buttonOptions, options = chartOptions.rangeSelector, buttons = rangeSelector.buttons, lang = defaultOptions.lang, div = rangeSelector.div, inputGroup = rangeSelector.inputGroup, buttonTheme = options.buttonTheme, buttonPosition = options.buttonPosition || {}, inputEnabled = options.inputEnabled, states = buttonTheme && buttonTheme.states, plotLeft = chart.plotLeft, buttonLeft, pos = this.getPosition(), buttonGroup = rangeSelector.group, buttonBBox, rendered = rangeSelector.rendered; // create the elements if (!rendered) { rangeSelector.group = buttonGroup = renderer.g('range-selector-buttons').add(); rangeSelector.zoomText = renderer.text(lang.rangeSelectorZoom, pick(buttonPosition.x, plotLeft), 15) .css(options.labelStyle) .add(buttonGroup); // button starting position buttonLeft = pick(buttonPosition.x, plotLeft) + rangeSelector.zoomText.getBBox().width + 5; each(rangeSelector.buttonOptions, function (rangeOptions, i) { buttons[i] = renderer.button( rangeOptions.text, buttonLeft, 0, function () { rangeSelector.clickButton(i); rangeSelector.isActive = true; }, buttonTheme, states && states.hover, states && states.select, states && states.disabled ) .css({ textAlign: 'center' }) .add(buttonGroup); // increase button position for the next button buttonLeft += buttons[i].width + pick(options.buttonSpacing, 5); if (rangeSelector.selected === i) { buttons[i].setState(2); } }); rangeSelector.updateButtonStates(); // first create a wrapper outside the container in order to make // the inputs work and make export correct if (inputEnabled !== false) { rangeSelector.div = div = createElement('div', null, { position: 'relative', height: 0, zIndex: 1 // above container }); container.parentNode.insertBefore(div, container); // Create the group to keep the inputs rangeSelector.inputGroup = inputGroup = renderer.g('input-group') .add(); inputGroup.offset = 0; rangeSelector.drawInput('min'); rangeSelector.drawInput('max'); } } // Set or update the group position buttonGroup[rendered ? 'animate' : 'attr']({ translateY: pos.buttonTop }); if (inputEnabled !== false) { // Update the alignment to the updated spacing box inputGroup.align(extend({ y: pos.inputTop, width: inputGroup.offset, // Detect collision with the exporting buttons x: navButtonOptions && (pos.inputTop < (navButtonOptions.y || 0) + navButtonOptions.height - chart.spacing[0]) ? -40 : 0 }, options.inputPosition), true, chart.spacingBox); // Hide if overlapping - inputEnabled is null or undefined if (!defined(inputEnabled)) { buttonBBox = buttonGroup.getBBox(); inputGroup[inputGroup.translateX < buttonBBox.x + buttonBBox.width + 10 ? 'hide' : 'show'](); } // Set or reset the input values rangeSelector.setInputValue('min', min); rangeSelector.setInputValue('max', max); } rangeSelector.rendered = true; }, /** * Destroys allocated elements. */ destroy: function () { var minInput = this.minInput, maxInput = this.maxInput, chart = this.chart, blurInputs = this.blurInputs, key; removeEvent(chart.container, 'mousedown', blurInputs); removeEvent(chart, 'resize', blurInputs); // Destroy elements in collections destroyObjectProperties(this.buttons); // Clear input element events if (minInput) { minInput.onfocus = minInput.onblur = minInput.onchange = null; } if (maxInput) { maxInput.onfocus = maxInput.onblur = maxInput.onchange = null; } // Destroy HTML and SVG elements for (key in this) { if (this[key] && key !== 'chart') { if (this[key].destroy) { // SVGElement this[key].destroy(); } else if (this[key].nodeType) { // HTML element discardElement(this[key]); } } this[key] = null; } } }; /** * Add logic to normalize the zoomed range in order to preserve the pressed state of range selector buttons */ Axis.prototype.toFixedRange = function (pxMin, pxMax, fixedMin, fixedMax) { var fixedRange = this.chart && this.chart.fixedRange, newMin = pick(fixedMin, this.translate(pxMin, true)), newMax = pick(fixedMax, this.translate(pxMax, true)), changeRatio = fixedRange && (newMax - newMin) / fixedRange; // If the difference between the fixed range and the actual requested range is // too great, the user is dragging across an ordinal gap, and we need to release // the range selector button. if (changeRatio > 0.7 && changeRatio < 1.3) { if (fixedMax) { newMin = newMax - fixedRange; } else { newMax = newMin + fixedRange; } } if (!isNumber(newMin)) { // #1195 newMin = newMax = undefined; } return { min: newMin, max: newMax }; }; Axis.prototype.minFromRange = function () { var rangeOptions = this.range, type = rangeOptions.type, timeName = { month: 'Month', year: 'FullYear' }[type], min, max = this.max, dataMin, range, // Get the true range from a start date getTrueRange = function (base, count) { var date = new Date(base); date['set' + timeName](date['get' + timeName]() + count); return date.getTime() - base; }; if (isNumber(rangeOptions)) { min = this.max - rangeOptions; range = rangeOptions; } else { min = max + getTrueRange(max, -rangeOptions.count); } dataMin = pick(this.dataMin, Number.MIN_VALUE); if (!isNumber(min)) { min = dataMin; } if (min <= dataMin) { min = dataMin; if (range === undefined) { // #4501 range = getTrueRange(min, rangeOptions.count); } this.newMax = mathMin(min + range, this.dataMax); } if (!isNumber(max)) { min = undefined; } return min; }; // Initialize scroller for stock charts wrap(Chart.prototype, 'init', function (proceed, options, callback) { addEvent(this, 'init', function () { if (this.options.rangeSelector.enabled) { this.rangeSelector = new RangeSelector(this); } }); proceed.call(this, options, callback); }); Highcharts.RangeSelector = RangeSelector; /* **************************************************************************** * End Range Selector code * *****************************************************************************/ Chart.prototype.callbacks.push(function (chart) { var extremes, scroller = chart.scroller, rangeSelector = chart.rangeSelector; function renderRangeSelector() { extremes = chart.xAxis[0].getExtremes(); if (isNumber(extremes.min)) { rangeSelector.render(extremes.min, extremes.max); } } function afterSetExtremesHandlerRangeSelector(e) { rangeSelector.render(e.min, e.max); } function destroyEvents() { if (rangeSelector) { removeEvent(chart, 'resize', renderRangeSelector); removeEvent(chart.xAxis[0], 'afterSetExtremes', afterSetExtremesHandlerRangeSelector); } } // initiate the scroller if (scroller) { extremes = chart.xAxis[0].getExtremes(); scroller.render(extremes.min, extremes.max); } if (rangeSelector) { // redraw the scroller on setExtremes addEvent(chart.xAxis[0], 'afterSetExtremes', afterSetExtremesHandlerRangeSelector); // redraw the scroller chart resize addEvent(chart, 'resize', renderRangeSelector); // do it now renderRangeSelector(); } // Remove resize/afterSetExtremes at chart destroy addEvent(chart, 'destroy', destroyEvents); }); /** * A wrapper for Chart with all the default values for a Stock chart */ Highcharts.StockChart = Highcharts.stockChart = function (a, b, c) { var hasRenderToArg = isString(a) || a.nodeName, options = arguments[hasRenderToArg ? 1 : 0], seriesOptions = options.series, // to increase performance, don't merge the data opposite, // Always disable startOnTick:true on the main axis when the navigator is enabled (#1090) navigatorEnabled = pick(options.navigator && options.navigator.enabled, true), disableStartOnTick = navigatorEnabled ? { startOnTick: false, endOnTick: false } : null, lineOptions = { marker: { enabled: false, radius: 2 } // gapSize: 0 }, columnOptions = { shadow: false, borderWidth: 0 }; // apply X axis options to both single and multi y axes options.xAxis = map(splat(options.xAxis || {}), function (xAxisOptions) { return merge( { // defaults minPadding: 0, maxPadding: 0, ordinal: true, title: { text: null }, labels: { overflow: 'justify' }, showLastLabel: true }, xAxisOptions, // user options { // forced options type: 'datetime', categories: null }, disableStartOnTick ); }); // apply Y axis options to both single and multi y axes options.yAxis = map(splat(options.yAxis || {}), function (yAxisOptions) { opposite = pick(yAxisOptions.opposite, true); return merge({ // defaults labels: { y: -2 }, opposite: opposite, showLastLabel: false, title: { text: null } }, yAxisOptions // user options ); }); options.series = null; options = merge( { chart: { panning: true, pinchType: 'x' }, navigator: { enabled: true }, scrollbar: { enabled: true }, rangeSelector: { enabled: true }, title: { text: null, style: { fontSize: '16px' } }, tooltip: { shared: true, crosshairs: true }, legend: { enabled: false }, plotOptions: { line: lineOptions, spline: lineOptions, area: lineOptions, areaspline: lineOptions, arearange: lineOptions, areasplinerange: lineOptions, column: columnOptions, columnrange: columnOptions, candlestick: columnOptions, ohlc: columnOptions } }, options, // user's options { // forced options _stock: true, // internal flag chart: { inverted: false } } ); options.series = seriesOptions; return hasRenderToArg ? new Chart(a, options, c) : new Chart(options, b); }; // Implement the pinchType option wrap(Pointer.prototype, 'init', function (proceed, chart, options) { var pinchType = options.chart.pinchType || ''; proceed.call(this, chart, options); // Pinch status this.pinchX = this.pinchHor = pinchType.indexOf('x') !== -1; this.pinchY = this.pinchVert = pinchType.indexOf('y') !== -1; this.hasZoom = this.hasZoom || this.pinchHor || this.pinchVert; }); // Override the automatic label alignment so that the first Y axis' labels // are drawn on top of the grid line, and subsequent axes are drawn outside wrap(Axis.prototype, 'autoLabelAlign', function (proceed) { var chart = this.chart, options = this.options, panes = chart._labelPanes = chart._labelPanes || {}, key, labelOptions = this.options.labels; if (this.chart.options._stock && this.coll === 'yAxis') { key = options.top + ',' + options.height; if (!panes[key] && labelOptions.enabled) { // do it only for the first Y axis of each pane if (labelOptions.x === 15) { // default labelOptions.x = 0; } if (labelOptions.align === undefined) { labelOptions.align = 'right'; } panes[key] = 1; return 'right'; } } return proceed.call(this, [].slice.call(arguments, 1)); }); // Override getPlotLinePath to allow for multipane charts wrap(Axis.prototype, 'getPlotLinePath', function (proceed, value, lineWidth, old, force, translatedValue) { var axis = this, series = (this.isLinked && !this.series ? this.linkedParent.series : this.series), chart = axis.chart, renderer = chart.renderer, axisLeft = axis.left, axisTop = axis.top, x1, y1, x2, y2, result = [], axes = [], //#3416 need a default array axes2, uniqueAxes, transVal; // Ignore in case of color Axis. #3360, #3524 if (axis.coll === 'colorAxis') { return proceed.apply(this, [].slice.call(arguments, 1)); } // Get the related axes based on series axes = (axis.isXAxis ? (defined(axis.options.yAxis) ? [chart.yAxis[axis.options.yAxis]] : map(series, function (s) { return s.yAxis; }) ) : (defined(axis.options.xAxis) ? [chart.xAxis[axis.options.xAxis]] : map(series, function (s) { return s.xAxis; }) ) ); // Get the related axes based options.*Axis setting #2810 axes2 = (axis.isXAxis ? chart.yAxis : chart.xAxis); each(axes2, function (A) { if (defined(A.options.id) ? A.options.id.indexOf('navigator') === -1 : true) { var a = (A.isXAxis ? 'yAxis' : 'xAxis'), rax = (defined(A.options[a]) ? chart[a][A.options[a]] : chart[a][0]); if (axis === rax) { axes.push(A); } } }); // Remove duplicates in the axes array. If there are no axes in the axes array, // we are adding an axis without data, so we need to populate this with grid // lines (#2796). uniqueAxes = axes.length ? [] : [axis.isXAxis ? chart.yAxis[0] : chart.xAxis[0]]; //#3742 each(axes, function (axis2) { if (inArray(axis2, uniqueAxes) === -1) { uniqueAxes.push(axis2); } }); transVal = pick(translatedValue, axis.translate(value, null, null, old)); if (isNumber(transVal)) { if (axis.horiz) { each(uniqueAxes, function (axis2) { var skip; y1 = axis2.pos; y2 = y1 + axis2.len; x1 = x2 = mathRound(transVal + axis.transB); if (x1 < axisLeft || x1 > axisLeft + axis.width) { // outside plot area if (force) { x1 = x2 = mathMin(mathMax(axisLeft, x1), axisLeft + axis.width); } else { skip = true; } } if (!skip) { result.push('M', x1, y1, 'L', x2, y2); } }); } else { each(uniqueAxes, function (axis2) { var skip; x1 = axis2.pos; x2 = x1 + axis2.len; y1 = y2 = mathRound(axisTop + axis.height - transVal); if (y1 < axisTop || y1 > axisTop + axis.height) { // outside plot area if (force) { y1 = y2 = mathMin(mathMax(axisTop, y1), axis.top + axis.height); } else { skip = true; } } if (!skip) { result.push('M', x1, y1, 'L', x2, y2); } }); } } return result.length > 0 ? renderer.crispPolyLine(result, lineWidth || 1) : null; //#3557 getPlotLinePath in regular Highcharts also returns null }); // Override getPlotBandPath to allow for multipane charts Axis.prototype.getPlotBandPath = function (from, to) { var toPath = this.getPlotLinePath(to, null, null, true), path = this.getPlotLinePath(from, null, null, true), result = [], i; if (path && toPath && path.toString() !== toPath.toString()) { // Go over each subpath for (i = 0; i < path.length; i += 6) { result.push('M', path[i + 1], path[i + 2], 'L', path[i + 4], path[i + 5], toPath[i + 4], toPath[i + 5], toPath[i + 1], toPath[i + 2]); } } else { // outside the axis area result = null; } return result; }; // Function to crisp a line with multiple segments SVGRenderer.prototype.crispPolyLine = function (points, width) { // points format: [M, 0, 0, L, 100, 0] // normalize to a crisp line var i; for (i = 0; i < points.length; i = i + 6) { if (points[i + 1] === points[i + 4]) { // Substract due to #1129. Now bottom and left axis gridlines behave the same. points[i + 1] = points[i + 4] = mathRound(points[i + 1]) - (width % 2 / 2); } if (points[i + 2] === points[i + 5]) { points[i + 2] = points[i + 5] = mathRound(points[i + 2]) + (width % 2 / 2); } } return points; }; if (Renderer === Highcharts.VMLRenderer) { VMLRenderer.prototype.crispPolyLine = SVGRenderer.prototype.crispPolyLine; } // Wrapper to hide the label wrap(Axis.prototype, 'hideCrosshair', function (proceed, i) { proceed.call(this, i); if (this.crossLabel) { this.crossLabel = this.crossLabel.hide(); } }); // Wrapper to draw the label wrap(Axis.prototype, 'drawCrosshair', function (proceed, e, point) { // Draw the crosshair proceed.call(this, e, point); // Check if the label has to be drawn if (!defined(this.crosshair.label) || !this.crosshair.label.enabled || !this.cross) { return; } var chart = this.chart, options = this.options.crosshair.label, // the label's options horiz = this.horiz, // axis orientation opposite = this.opposite, // axis position left = this.left, // left position top = this.top, // top position crossLabel = this.crossLabel, // reference to the svgElement posx, posy, crossBox, formatOption = options.format, formatFormat = '', limit, align, tickInside = this.options.tickPosition === 'inside', snap = this.crosshair.snap !== false, value, offset = 0; // Use last available event (#5287) if (!e) { e = this.cross && this.cross.e; } align = (horiz ? 'center' : opposite ? (this.labelAlign === 'right' ? 'right' : 'left') : (this.labelAlign === 'left' ? 'left' : 'center')); // If the label does not exist yet, create it. if (!crossLabel) { crossLabel = this.crossLabel = chart.renderer.label(null, null, null, options.shape || 'callout') .attr({ align: options.align || align, zIndex: 12, fill: options.backgroundColor || (this.series[0] && this.series[0].color) || 'gray', padding: pick(options.padding, 8), stroke: options.borderColor || '', 'stroke-width': options.borderWidth || 0, r: pick(options.borderRadius, 3) }) .css(extend({ color: 'white', fontWeight: 'normal', fontSize: '11px', textAlign: 'center' }, options.style)) .add(); } if (horiz) { posx = snap ? point.plotX + left : e.chartX; posy = top + (opposite ? 0 : this.height); } else { posx = opposite ? this.width + left : 0; posy = snap ? point.plotY + top : e.chartY; } if (!formatOption && !options.formatter) { if (this.isDatetimeAxis) { formatFormat = '%b %d, %Y'; } formatOption = '{value' + (formatFormat ? ':' + formatFormat : '') + '}'; } // Show the label value = snap ? point[this.isXAxis ? 'x' : 'y'] : this.toValue(horiz ? e.chartX : e.chartY); crossLabel.attr({ text: formatOption ? format(formatOption, { value: value }) : options.formatter.call(this, value), x: posx, y: posy, visibility: 'visible' }); crossBox = crossLabel.getBBox(); // now it is placed we can correct its position if (horiz) { if ((tickInside && !opposite) || (!tickInside && opposite)) { posy = crossLabel.y - crossBox.height; } } else { posy = crossLabel.y - (crossBox.height / 2); } // check the edges if (horiz) { limit = { left: left - crossBox.x, right: left + this.width - crossBox.x }; } else { limit = { left: this.labelAlign === 'left' ? left : 0, right: this.labelAlign === 'right' ? left + this.width : chart.chartWidth }; } // left edge if (crossLabel.translateX < limit.left) { offset = limit.left - crossLabel.translateX; } // right edge if (crossLabel.translateX + crossBox.width >= limit.right) { offset = -(crossLabel.translateX + crossBox.width - limit.right); } // show the crosslabel crossLabel.attr({ x: posx + offset, y: posy, // First set x and y, then anchorX and anchorY, when box is actually calculated, #5702 anchorX: horiz ? posx : (this.opposite ? 0 : chart.chartWidth), anchorY: horiz ? (this.opposite ? chart.chartHeight : 0) : posy + crossBox.height / 2 }); }); /* **************************************************************************** * Start value compare logic * *****************************************************************************/ var seriesInit = seriesProto.init, seriesProcessData = seriesProto.processData, pointTooltipFormatter = Point.prototype.tooltipFormatter; /** * Extend series.init by adding a method to modify the y value used for plotting * on the y axis. This method is called both from the axis when finding dataMin * and dataMax, and from the series.translate method. */ seriesProto.init = function () { // Call base method seriesInit.apply(this, arguments); // Set comparison mode this.setCompare(this.options.compare); }; /** * The setCompare method can be called also from the outside after render time */ seriesProto.setCompare = function (compare) { // Set or unset the modifyValue method this.modifyValue = (compare === 'value' || compare === 'percent') ? function (value, point) { var compareValue = this.compareValue; if (value !== UNDEFINED) { // #2601 // get the modified value value = compare === 'value' ? value - compareValue : // compare value value = 100 * (value / compareValue) - 100; // compare percent // record for tooltip etc. if (point) { point.change = value; } } return value; } : null; // Survive to export, #5485 this.userOptions.compare = compare; // Mark dirty if (this.chart.hasRendered) { this.isDirty = true; } }; /** * Extend series.processData by finding the first y value in the plot area, * used for comparing the following values */ seriesProto.processData = function () { var series = this, i, keyIndex = -1, processedXData, processedYData, length, compareValue; // call base method seriesProcessData.apply(this, arguments); if (series.xAxis && series.processedYData) { // not pies // local variables processedXData = series.processedXData; processedYData = series.processedYData; length = processedYData.length; // For series with more than one value (range, OHLC etc), compare against // close or the pointValKey (#4922, #3112) if (series.pointArrayMap) { // Use close if present (#3112) keyIndex = inArray('close', series.pointArrayMap); if (keyIndex === -1) { keyIndex = inArray(series.pointValKey || 'y', series.pointArrayMap); } } // find the first value for comparison for (i = 0; i < length - 1; i++) { compareValue = keyIndex > -1 ? processedYData[i][keyIndex] : processedYData[i]; if (isNumber(compareValue) && processedXData[i + 1] >= series.xAxis.min && compareValue !== 0) { series.compareValue = compareValue; break; } } } }; /** * Modify series extremes */ wrap(seriesProto, 'getExtremes', function (proceed) { var extremes; proceed.apply(this, [].slice.call(arguments, 1)); if (this.modifyValue) { extremes = [this.modifyValue(this.dataMin), this.modifyValue(this.dataMax)]; this.dataMin = arrayMin(extremes); this.dataMax = arrayMax(extremes); } }); /** * Add a utility method, setCompare, to the Y axis */ Axis.prototype.setCompare = function (compare, redraw) { if (!this.isXAxis) { each(this.series, function (series) { series.setCompare(compare); }); if (pick(redraw, true)) { this.chart.redraw(); } } }; /** * Extend the tooltip formatter by adding support for the point.change variable * as well as the changeDecimals option */ Point.prototype.tooltipFormatter = function (pointFormat) { var point = this; pointFormat = pointFormat.replace( '{point.change}', (point.change > 0 ? '+' : '') + Highcharts.numberFormat(point.change, pick(point.series.tooltipOptions.changeDecimals, 2)) ); return pointTooltipFormatter.apply(this, [pointFormat]); }; /* **************************************************************************** * End value compare logic * *****************************************************************************/ /** * Extend the Series prototype to create a separate series clip box. This is related * to using multiple panes, and a future pane logic should incorporate this feature (#2754). */ wrap(Series.prototype, 'render', function (proceed) { // Only do this on stock charts (#2939), and only if the series type handles clipping // in the animate method (#2975). if (this.chart.options._stock && this.xAxis) { // First render, initial clip box if (!this.clipBox && this.animate) { this.clipBox = merge(this.chart.clipBox); this.clipBox.width = this.xAxis.len; this.clipBox.height = this.yAxis.len; // On redrawing, resizing etc, update the clip rectangle } else if (this.chart[this.sharedClipKey]) { stop(this.chart[this.sharedClipKey]); // #2998 this.chart[this.sharedClipKey].attr({ width: this.xAxis.len, height: this.yAxis.len }); // #3111 } else if (this.clipBox) { this.clipBox.width = this.xAxis.len; this.clipBox.height = this.yAxis.len; } } proceed.call(this); }); // global variables extend(Highcharts, { // Constructors Color: Color, Point: Point, Tick: Tick, Renderer: Renderer, SVGElement: SVGElement, SVGRenderer: SVGRenderer, // Various arrayMin: arrayMin, arrayMax: arrayMax, charts: charts, correctFloat: correctFloat, dateFormat: dateFormat, error: error, format: format, pathAnim: pathAnim, getOptions: getOptions, hasBidiBug: hasBidiBug, isTouchDevice: isTouchDevice, setOptions: setOptions, addEvent: addEvent, removeEvent: removeEvent, createElement: createElement, discardElement: discardElement, css: css, each: each, map: map, merge: merge, splat: splat, stableSort: stableSort, extendClass: extendClass, pInt: pInt, svg: hasSVG, canvas: useCanVG, vml: !hasSVG && !useCanVG, product: PRODUCT, version: VERSION }); return Highcharts; }));
packages/material-ui-icons/src/TripOriginOutlined.js
Kagami/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z" /></React.Fragment> , 'TripOriginOutlined');
app/components/Faction/index.js
kamil-mrzyglod/AosArmyBuilder
/** * * Faction * */ import React from 'react'; import { FormattedMessage } from 'react-intl'; import messages from './messages'; class Faction extends React.Component { // eslint-disable-line react/prefer-stateless-function constructor(props) { super(props); this.state = { faction: "" } this.factionSelected = this.factionSelected.bind(this); this.isSelectedFaction = this.isSelectedFaction.bind(this); } factionSelected(faction) { var state = this.state; state.faction = faction; this.setState(state); this.props.factionChanged(faction); } renderFactions() { if (this.props.allegiance === 'order') { return ( <div className="ui six link stackable cards"> <div className={this.isSelectedFaction('blue', 'aelves')} onClick={() => this.factionSelected('aelves')}> <div className="content"> <div className="header">Aelves</div> <div className="meta"> <span className="category">Eldritch Council, Phoenix Temple, Lion Rangers, Order Draconis, Swifthawk Agents, Order Serpentis, Shadowblades, Darkling Covens, Daughters of Khaine, Scourge Privateers, Wanderers, Aelf</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('blue', 'aelves_legacy')} onClick={() => this.factionSelected('aelves_legacy')}> <div className="content"> <div className="header">Aelves Legacy</div> <div className="meta"> <span className="category">Dark Elves Legacy Units, High Elves Legacy Units, Wood Elf Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('blue', 'brettonia')} onClick={() => this.factionSelected('brettonia')}> <div className="content"> <div className="header">Brettonia</div> <div className="meta"> <span className="category">Bretonnia</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('blue', 'duardin')} onClick={() => this.factionSelected('duardin')}> <div className="content"> <div className="header">Duardin</div> <div className="meta"> <span className="category">Dispossessed, Ironweld Arsenal, Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('blue', 'fyreslayers')} onClick={() => this.factionSelected('fyreslayers')}> <div className="content"> <div className="header">Fyreslayers</div> <div className="meta"> <span className="category">Fyreslayers</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('blue', 'humans')} onClick={() => this.factionSelected('humans')}> <div className="content"> <div className="header">Humans</div> <div className="meta"> <span className="category">Devoted of Sigmar, Free Peoples, Collegiate Arcane, Ironweld Arsenal, Empire Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('blue', 'seraphon')} onClick={() => this.factionSelected('seraphon')}> <div className="content"> <div className="header">Seraphon</div> <div className="meta"> <span className="category">Seraphon, Lizardmen Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('blue', 'stormcast')} onClick={() => this.factionSelected('stormcast')}> <div className="content"> <div className="header">Stormcast</div> <div className="meta"> <span className="category">Stormcast Eternals, Stormcast Extremis</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('blue', 'sylvaneth')} onClick={() => this.factionSelected('sylvaneth')}> <div className="content"> <div className="header">Sylvaneth</div> <div className="meta"> <span className="category">Sylvaneth, Sylvaneth Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> </div> ); } else if (this.props.allegiance === 'chaos') { return ( <div className="ui six link stackable cards"> <div className={this.isSelectedFaction('red', 'herds_and_monsters')} onClick={() => this.factionSelected('herds_and_monsters')}> <div className="content"> <div className="header">Herds & Monsters</div> <div className="meta"> <span className="category">Brayherds, Warherds & Monsters, Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('red', 'khorne')} onClick={() => this.factionSelected('khorne')}> <div className="content"> <div className="header">Khorne</div> <div className="meta"> <span className="category">Khorne Bloodbound, Daemons of Khorne</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('red', 'legion_of_azgorth')} onClick={() => this.factionSelected('legion_of_azgorth')}> <div className="content"> <div className="header">Legion of Azgorth</div> <div className="meta"> <span className="category">Legion of Azgorh</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('red', 'nurgle')} onClick={() => this.factionSelected('nurgle')}> <div className="content"> <div className="header">Nurgle</div> <div className="meta"> <span className="category">Nurgle Rotbringers, Daemons of Nurgle</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('red', 'skaven')} onClick={() => this.factionSelected('skaven')}> <div className="content"> <div className="header">Skaven</div> <div className="meta"> <span className="category">The Clans Eshin, Masterclan, The Clans Moulder, The Clans Pestilens, The Clans Skryre, The Clans Verminus, Skaven Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('red', 'slaneesh')} onClick={() => this.factionSelected('slaneesh')}> <div className="content"> <div className="header">Slaneesh</div> <div className="meta"> <span className="category">Host of Slaanesh, Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('red', 'tamurkhans_horde')} onClick={() => this.factionSelected('tamurkhans_horde')}> <div className="content"> <div className="header">Tamurkhan's Horde</div> <div className="meta"> <span className="category">Tamurkhan’s Horde</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('red', 'tzeentch')} onClick={() => this.factionSelected('tzeentch')}> <div className="content"> <div className="header">Tzeentch</div> <div className="meta"> <span className="category">Tzeentch Arcanites, Daemons of Tzeentch, Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('red', 'undivided')} onClick={() => this.factionSelected('undivided')}> <div className="content"> <div className="header">Undivided</div> <div className="meta"> <span className="category">Everchosen, Slaves to Darkness, Daemons of Chaos, Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> </div> ); } else if (this.props.allegiance === 'death') { return ( <div className="ui six link stackable cards"> <div className={this.isSelectedFaction('black', 'death')} onClick={() => this.factionSelected('death')}> <div className="content"> <div className="header">Death</div> <div className="meta"> <span className="category">Deathlords, Deathmages, Deathrattle, Deadwalkers, Flesh-Eater Courts, Nighthaunt, Soulblight, Vampire Counts Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('black', 'tomb_kings')} onClick={() => this.factionSelected('tomb_kings')}> <div className="content"> <div className="header">Tomb Kings</div> <div className="meta"> <span className="category">Tomb Kings</span> </div> <div className="description"> <p></p> </div> </div> </div> </div> ); } else if (this.props.allegiance === 'destruction') { return ( <div className="ui six link stackable cards"> <div className={this.isSelectedFaction('green', 'grots')} onClick={() => this.factionSelected('grots')}> <div className="content"> <div className="header">Grots</div> <div className="meta"> <span className="category">Gitmob Grots, Moonclan Grots, Spiderfang Grots, Grots, Grots Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('green', 'monsters_and_troggoths')} onClick={() => this.factionSelected('monsters_and_troggoths')}> <div className="content"> <div className="header">Monsters & Troggoths</div> <div className="meta"> <span className="category">Grand Alliance: Destruction Monstrous Arcanum, Troggoths & Gargants</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('green', 'ogors')} onClick={() => this.factionSelected('ogors')}> <div className="content"> <div className="header">Ogors</div> <div className="meta"> <span className="category">Gutbusters, Firebellies, Maneaters, Beastclaw Riders, Ogre Kingdoms Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> <div className={this.isSelectedFaction('green', 'orruks')} onClick={() => this.factionSelected('orruks')}> <div className="content"> <div className="header">Orruks</div> <div className="meta"> <span className="category">Greenskinz, Bonesplitterz, Ironjawz, Orcs Legacy Units</span> </div> <div className="description"> <p></p> </div> </div> </div> </div>); } else { return (<div></div>); } } isSelectedFaction(color, faction) { var defaultClasses = color + " card" if(this.state.faction === faction) { return defaultClasses + " active"; } return defaultClasses; } render() { return this.renderFactions(); } } export default Faction;
src/app/routes/dashboard/containers/SocialWall.js
backpackcoder/world-in-flames
import React from 'react' import HtmlRender from '../../../components/utils/HtmlRender' const html = require('html-loader?-attrs!./SocialWall.html') export default ()=>(<HtmlRender html={html} />)
src/svg-icons/places/child-care.js
matthewoates/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let PlacesChildCare = (props) => ( <SvgIcon {...props}> <circle cx="14.5" cy="10.5" r="1.25"/><circle cx="9.5" cy="10.5" r="1.25"/><path d="M22.94 12.66c.04-.21.06-.43.06-.66s-.02-.45-.06-.66c-.25-1.51-1.36-2.74-2.81-3.17-.53-1.12-1.28-2.1-2.19-2.91C16.36 3.85 14.28 3 12 3s-4.36.85-5.94 2.26c-.92.81-1.67 1.8-2.19 2.91-1.45.43-2.56 1.65-2.81 3.17-.04.21-.06.43-.06.66s.02.45.06.66c.25 1.51 1.36 2.74 2.81 3.17.52 1.11 1.27 2.09 2.17 2.89C7.62 20.14 9.71 21 12 21s4.38-.86 5.97-2.28c.9-.8 1.65-1.79 2.17-2.89 1.44-.43 2.55-1.65 2.8-3.17zM19 14c-.1 0-.19-.02-.29-.03-.2.67-.49 1.29-.86 1.86C16.6 17.74 14.45 19 12 19s-4.6-1.26-5.85-3.17c-.37-.57-.66-1.19-.86-1.86-.1.01-.19.03-.29.03-1.1 0-2-.9-2-2s.9-2 2-2c.1 0 .19.02.29.03.2-.67.49-1.29.86-1.86C7.4 6.26 9.55 5 12 5s4.6 1.26 5.85 3.17c.37.57.66 1.19.86 1.86.1-.01.19-.03.29-.03 1.1 0 2 .9 2 2s-.9 2-2 2zM7.5 14c.76 1.77 2.49 3 4.5 3s3.74-1.23 4.5-3h-9z"/> </SvgIcon> ); PlacesChildCare = pure(PlacesChildCare); PlacesChildCare.displayName = 'PlacesChildCare'; PlacesChildCare.muiName = 'SvgIcon'; export default PlacesChildCare;
src/svg-icons/maps/local-car-wash.js
ngbrown/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let MapsLocalCarWash = (props) => ( <SvgIcon {...props}> <path d="M17 5c.83 0 1.5-.67 1.5-1.5 0-1-1.5-2.7-1.5-2.7s-1.5 1.7-1.5 2.7c0 .83.67 1.5 1.5 1.5zm-5 0c.83 0 1.5-.67 1.5-1.5 0-1-1.5-2.7-1.5-2.7s-1.5 1.7-1.5 2.7c0 .83.67 1.5 1.5 1.5zM7 5c.83 0 1.5-.67 1.5-1.5C8.5 2.5 7 .8 7 .8S5.5 2.5 5.5 3.5C5.5 4.33 6.17 5 7 5zm11.92 3.01C18.72 7.42 18.16 7 17.5 7h-11c-.66 0-1.21.42-1.42 1.01L3 14v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 18c-.83 0-1.5-.67-1.5-1.5S5.67 15 6.5 15s1.5.67 1.5 1.5S7.33 18 6.5 18zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 13l1.5-4.5h11L19 13H5z"/> </SvgIcon> ); MapsLocalCarWash = pure(MapsLocalCarWash); MapsLocalCarWash.displayName = 'MapsLocalCarWash'; MapsLocalCarWash.muiName = 'SvgIcon'; export default MapsLocalCarWash;
src/11-Repository Unit of Work/2-Unit of Work/Before/PocoDemo.Web/Scripts/knockout-3.2.0.debug.js
tonysneed/AdvDotNet.Samples
/*! * Knockout JavaScript library v3.2.0 * (c) Steven Sanderson - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ (function(){ var DEBUG=true; (function(undefined){ // (0, eval)('this') is a robust way of getting a reference to the global object // For details, see http://stackoverflow.com/questions/14119988/return-this-0-evalthis/14120023#14120023 var window = this || (0, eval)('this'), document = window['document'], navigator = window['navigator'], jQueryInstance = window["jQuery"], JSON = window["JSON"]; (function(factory) { // Support three module loading scenarios if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') { // [1] CommonJS/Node.js var target = module['exports'] || exports; // module.exports is for Node.js factory(target, require); } else if (typeof define === 'function' && define['amd']) { // [2] AMD anonymous module define(['exports', 'require'], factory); } else { // [3] No module loader (plain <script> tag) - put directly in global namespace factory(window['ko'] = {}); } }(function(koExports, require){ // Internally, all KO objects are attached to koExports (even the non-exported ones whose names will be minified by the closure compiler). // In the future, the following "ko" variable may be made distinct from "koExports" so that private objects are not externally reachable. var ko = typeof koExports !== 'undefined' ? koExports : {}; // Google Closure Compiler helpers (used only to make the minified file smaller) ko.exportSymbol = function(koPath, object) { var tokens = koPath.split("."); // In the future, "ko" may become distinct from "koExports" (so that non-exported objects are not reachable) // At that point, "target" would be set to: (typeof koExports !== "undefined" ? koExports : ko) var target = ko; for (var i = 0; i < tokens.length - 1; i++) target = target[tokens[i]]; target[tokens[tokens.length - 1]] = object; }; ko.exportProperty = function(owner, publicName, object) { owner[publicName] = object; }; ko.version = "3.2.0"; ko.exportSymbol('version', ko.version); ko.utils = (function () { function objectForEach(obj, action) { for (var prop in obj) { if (obj.hasOwnProperty(prop)) { action(prop, obj[prop]); } } } function extend(target, source) { if (source) { for(var prop in source) { if(source.hasOwnProperty(prop)) { target[prop] = source[prop]; } } } return target; } function setPrototypeOf(obj, proto) { obj.__proto__ = proto; return obj; } var canSetPrototype = ({ __proto__: [] } instanceof Array); // Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup) var knownEvents = {}, knownEventTypesByEventName = {}; var keyEventTypeName = (navigator && /Firefox\/2/i.test(navigator.userAgent)) ? 'KeyboardEvent' : 'UIEvents'; knownEvents[keyEventTypeName] = ['keyup', 'keydown', 'keypress']; knownEvents['MouseEvents'] = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave']; objectForEach(knownEvents, function(eventType, knownEventsForType) { if (knownEventsForType.length) { for (var i = 0, j = knownEventsForType.length; i < j; i++) knownEventTypesByEventName[knownEventsForType[i]] = eventType; } }); var eventsThatMustBeRegisteredUsingAttachEvent = { 'propertychange': true }; // Workaround for an IE9 issue - https://github.com/SteveSanderson/knockout/issues/406 // Detect IE versions for bug workarounds (uses IE conditionals, not UA string, for robustness) // Note that, since IE 10 does not support conditional comments, the following logic only detects IE < 10. // Currently this is by design, since IE 10+ behaves correctly when treated as a standard browser. // If there is a future need to detect specific versions of IE10+, we will amend this. var ieVersion = document && (function() { var version = 3, div = document.createElement('div'), iElems = div.getElementsByTagName('i'); // Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment while ( div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->', iElems[0] ) {} return version > 4 ? version : undefined; }()); var isIe6 = ieVersion === 6, isIe7 = ieVersion === 7; function isClickOnCheckableElement(element, eventType) { if ((ko.utils.tagNameLower(element) !== "input") || !element.type) return false; if (eventType.toLowerCase() != "click") return false; var inputType = element.type; return (inputType == "checkbox") || (inputType == "radio"); } return { fieldsIncludedWithJsonPost: ['authenticity_token', /^__RequestVerificationToken(_.*)?$/], arrayForEach: function (array, action) { for (var i = 0, j = array.length; i < j; i++) action(array[i], i); }, arrayIndexOf: function (array, item) { if (typeof Array.prototype.indexOf == "function") return Array.prototype.indexOf.call(array, item); for (var i = 0, j = array.length; i < j; i++) if (array[i] === item) return i; return -1; }, arrayFirst: function (array, predicate, predicateOwner) { for (var i = 0, j = array.length; i < j; i++) if (predicate.call(predicateOwner, array[i], i)) return array[i]; return null; }, arrayRemoveItem: function (array, itemToRemove) { var index = ko.utils.arrayIndexOf(array, itemToRemove); if (index > 0) { array.splice(index, 1); } else if (index === 0) { array.shift(); } }, arrayGetDistinctValues: function (array) { array = array || []; var result = []; for (var i = 0, j = array.length; i < j; i++) { if (ko.utils.arrayIndexOf(result, array[i]) < 0) result.push(array[i]); } return result; }, arrayMap: function (array, mapping) { array = array || []; var result = []; for (var i = 0, j = array.length; i < j; i++) result.push(mapping(array[i], i)); return result; }, arrayFilter: function (array, predicate) { array = array || []; var result = []; for (var i = 0, j = array.length; i < j; i++) if (predicate(array[i], i)) result.push(array[i]); return result; }, arrayPushAll: function (array, valuesToPush) { if (valuesToPush instanceof Array) array.push.apply(array, valuesToPush); else for (var i = 0, j = valuesToPush.length; i < j; i++) array.push(valuesToPush[i]); return array; }, addOrRemoveItem: function(array, value, included) { var existingEntryIndex = ko.utils.arrayIndexOf(ko.utils.peekObservable(array), value); if (existingEntryIndex < 0) { if (included) array.push(value); } else { if (!included) array.splice(existingEntryIndex, 1); } }, canSetPrototype: canSetPrototype, extend: extend, setPrototypeOf: setPrototypeOf, setPrototypeOfOrExtend: canSetPrototype ? setPrototypeOf : extend, objectForEach: objectForEach, objectMap: function(source, mapping) { if (!source) return source; var target = {}; for (var prop in source) { if (source.hasOwnProperty(prop)) { target[prop] = mapping(source[prop], prop, source); } } return target; }, emptyDomNode: function (domNode) { while (domNode.firstChild) { ko.removeNode(domNode.firstChild); } }, moveCleanedNodesToContainerElement: function(nodes) { // Ensure it's a real array, as we're about to reparent the nodes and // we don't want the underlying collection to change while we're doing that. var nodesArray = ko.utils.makeArray(nodes); var container = document.createElement('div'); for (var i = 0, j = nodesArray.length; i < j; i++) { container.appendChild(ko.cleanNode(nodesArray[i])); } return container; }, cloneNodes: function (nodesArray, shouldCleanNodes) { for (var i = 0, j = nodesArray.length, newNodesArray = []; i < j; i++) { var clonedNode = nodesArray[i].cloneNode(true); newNodesArray.push(shouldCleanNodes ? ko.cleanNode(clonedNode) : clonedNode); } return newNodesArray; }, setDomNodeChildren: function (domNode, childNodes) { ko.utils.emptyDomNode(domNode); if (childNodes) { for (var i = 0, j = childNodes.length; i < j; i++) domNode.appendChild(childNodes[i]); } }, replaceDomNodes: function (nodeToReplaceOrNodeArray, newNodesArray) { var nodesToReplaceArray = nodeToReplaceOrNodeArray.nodeType ? [nodeToReplaceOrNodeArray] : nodeToReplaceOrNodeArray; if (nodesToReplaceArray.length > 0) { var insertionPoint = nodesToReplaceArray[0]; var parent = insertionPoint.parentNode; for (var i = 0, j = newNodesArray.length; i < j; i++) parent.insertBefore(newNodesArray[i], insertionPoint); for (var i = 0, j = nodesToReplaceArray.length; i < j; i++) { ko.removeNode(nodesToReplaceArray[i]); } } }, fixUpContinuousNodeArray: function(continuousNodeArray, parentNode) { // Before acting on a set of nodes that were previously outputted by a template function, we have to reconcile // them against what is in the DOM right now. It may be that some of the nodes have already been removed, or that // new nodes might have been inserted in the middle, for example by a binding. Also, there may previously have been // leading comment nodes (created by rewritten string-based templates) that have since been removed during binding. // So, this function translates the old "map" output array into its best guess of the set of current DOM nodes. // // Rules: // [A] Any leading nodes that have been removed should be ignored // These most likely correspond to memoization nodes that were already removed during binding // See https://github.com/SteveSanderson/knockout/pull/440 // [B] We want to output a continuous series of nodes. So, ignore any nodes that have already been removed, // and include any nodes that have been inserted among the previous collection if (continuousNodeArray.length) { // The parent node can be a virtual element; so get the real parent node parentNode = (parentNode.nodeType === 8 && parentNode.parentNode) || parentNode; // Rule [A] while (continuousNodeArray.length && continuousNodeArray[0].parentNode !== parentNode) continuousNodeArray.shift(); // Rule [B] if (continuousNodeArray.length > 1) { var current = continuousNodeArray[0], last = continuousNodeArray[continuousNodeArray.length - 1]; // Replace with the actual new continuous node set continuousNodeArray.length = 0; while (current !== last) { continuousNodeArray.push(current); current = current.nextSibling; if (!current) // Won't happen, except if the developer has manually removed some DOM elements (then we're in an undefined scenario) return; } continuousNodeArray.push(last); } } return continuousNodeArray; }, setOptionNodeSelectionState: function (optionNode, isSelected) { // IE6 sometimes throws "unknown error" if you try to write to .selected directly, whereas Firefox struggles with setAttribute. Pick one based on browser. if (ieVersion < 7) optionNode.setAttribute("selected", isSelected); else optionNode.selected = isSelected; }, stringTrim: function (string) { return string === null || string === undefined ? '' : string.trim ? string.trim() : string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, ''); }, stringStartsWith: function (string, startsWith) { string = string || ""; if (startsWith.length > string.length) return false; return string.substring(0, startsWith.length) === startsWith; }, domNodeIsContainedBy: function (node, containedByNode) { if (node === containedByNode) return true; if (node.nodeType === 11) return false; // Fixes issue #1162 - can't use node.contains for document fragments on IE8 if (containedByNode.contains) return containedByNode.contains(node.nodeType === 3 ? node.parentNode : node); if (containedByNode.compareDocumentPosition) return (containedByNode.compareDocumentPosition(node) & 16) == 16; while (node && node != containedByNode) { node = node.parentNode; } return !!node; }, domNodeIsAttachedToDocument: function (node) { return ko.utils.domNodeIsContainedBy(node, node.ownerDocument.documentElement); }, anyDomNodeIsAttachedToDocument: function(nodes) { return !!ko.utils.arrayFirst(nodes, ko.utils.domNodeIsAttachedToDocument); }, tagNameLower: function(element) { // For HTML elements, tagName will always be upper case; for XHTML elements, it'll be lower case. // Possible future optimization: If we know it's an element from an XHTML document (not HTML), // we don't need to do the .toLowerCase() as it will always be lower case anyway. return element && element.tagName && element.tagName.toLowerCase(); }, registerEventHandler: function (element, eventType, handler) { var mustUseAttachEvent = ieVersion && eventsThatMustBeRegisteredUsingAttachEvent[eventType]; if (!mustUseAttachEvent && jQueryInstance) { jQueryInstance(element)['bind'](eventType, handler); } else if (!mustUseAttachEvent && typeof element.addEventListener == "function") element.addEventListener(eventType, handler, false); else if (typeof element.attachEvent != "undefined") { var attachEventHandler = function (event) { handler.call(element, event); }, attachEventName = "on" + eventType; element.attachEvent(attachEventName, attachEventHandler); // IE does not dispose attachEvent handlers automatically (unlike with addEventListener) // so to avoid leaks, we have to remove them manually. See bug #856 ko.utils.domNodeDisposal.addDisposeCallback(element, function() { element.detachEvent(attachEventName, attachEventHandler); }); } else throw new Error("Browser doesn't support addEventListener or attachEvent"); }, triggerEvent: function (element, eventType) { if (!(element && element.nodeType)) throw new Error("element must be a DOM node when calling triggerEvent"); // For click events on checkboxes and radio buttons, jQuery toggles the element checked state *after* the // event handler runs instead of *before*. (This was fixed in 1.9 for checkboxes but not for radio buttons.) // IE doesn't change the checked state when you trigger the click event using "fireEvent". // In both cases, we'll use the click method instead. var useClickWorkaround = isClickOnCheckableElement(element, eventType); if (jQueryInstance && !useClickWorkaround) { jQueryInstance(element)['trigger'](eventType); } else if (typeof document.createEvent == "function") { if (typeof element.dispatchEvent == "function") { var eventCategory = knownEventTypesByEventName[eventType] || "HTMLEvents"; var event = document.createEvent(eventCategory); event.initEvent(eventType, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, element); element.dispatchEvent(event); } else throw new Error("The supplied element doesn't support dispatchEvent"); } else if (useClickWorkaround && element.click) { element.click(); } else if (typeof element.fireEvent != "undefined") { element.fireEvent("on" + eventType); } else { throw new Error("Browser doesn't support triggering events"); } }, unwrapObservable: function (value) { return ko.isObservable(value) ? value() : value; }, peekObservable: function (value) { return ko.isObservable(value) ? value.peek() : value; }, toggleDomNodeCssClass: function (node, classNames, shouldHaveClass) { if (classNames) { var cssClassNameRegex = /\S+/g, currentClassNames = node.className.match(cssClassNameRegex) || []; ko.utils.arrayForEach(classNames.match(cssClassNameRegex), function(className) { ko.utils.addOrRemoveItem(currentClassNames, className, shouldHaveClass); }); node.className = currentClassNames.join(" "); } }, setTextContent: function(element, textContent) { var value = ko.utils.unwrapObservable(textContent); if ((value === null) || (value === undefined)) value = ""; // We need there to be exactly one child: a text node. // If there are no children, more than one, or if it's not a text node, // we'll clear everything and create a single text node. var innerTextNode = ko.virtualElements.firstChild(element); if (!innerTextNode || innerTextNode.nodeType != 3 || ko.virtualElements.nextSibling(innerTextNode)) { ko.virtualElements.setDomNodeChildren(element, [element.ownerDocument.createTextNode(value)]); } else { innerTextNode.data = value; } ko.utils.forceRefresh(element); }, setElementName: function(element, name) { element.name = name; // Workaround IE 6/7 issue // - https://github.com/SteveSanderson/knockout/issues/197 // - http://www.matts411.com/post/setting_the_name_attribute_in_ie_dom/ if (ieVersion <= 7) { try { element.mergeAttributes(document.createElement("<input name='" + element.name + "'/>"), false); } catch(e) {} // For IE9 with doc mode "IE9 Standards" and browser mode "IE9 Compatibility View" } }, forceRefresh: function(node) { // Workaround for an IE9 rendering bug - https://github.com/SteveSanderson/knockout/issues/209 if (ieVersion >= 9) { // For text nodes and comment nodes (most likely virtual elements), we will have to refresh the container var elem = node.nodeType == 1 ? node : node.parentNode; if (elem.style) elem.style.zoom = elem.style.zoom; } }, ensureSelectElementIsRenderedCorrectly: function(selectElement) { // Workaround for IE9 rendering bug - it doesn't reliably display all the text in dynamically-added select boxes unless you force it to re-render by updating the width. // (See https://github.com/SteveSanderson/knockout/issues/312, http://stackoverflow.com/questions/5908494/select-only-shows-first-char-of-selected-option) // Also fixes IE7 and IE8 bug that causes selects to be zero width if enclosed by 'if' or 'with'. (See issue #839) if (ieVersion) { var originalWidth = selectElement.style.width; selectElement.style.width = 0; selectElement.style.width = originalWidth; } }, range: function (min, max) { min = ko.utils.unwrapObservable(min); max = ko.utils.unwrapObservable(max); var result = []; for (var i = min; i <= max; i++) result.push(i); return result; }, makeArray: function(arrayLikeObject) { var result = []; for (var i = 0, j = arrayLikeObject.length; i < j; i++) { result.push(arrayLikeObject[i]); }; return result; }, isIe6 : isIe6, isIe7 : isIe7, ieVersion : ieVersion, getFormFields: function(form, fieldName) { var fields = ko.utils.makeArray(form.getElementsByTagName("input")).concat(ko.utils.makeArray(form.getElementsByTagName("textarea"))); var isMatchingField = (typeof fieldName == 'string') ? function(field) { return field.name === fieldName } : function(field) { return fieldName.test(field.name) }; // Treat fieldName as regex or object containing predicate var matches = []; for (var i = fields.length - 1; i >= 0; i--) { if (isMatchingField(fields[i])) matches.push(fields[i]); }; return matches; }, parseJson: function (jsonString) { if (typeof jsonString == "string") { jsonString = ko.utils.stringTrim(jsonString); if (jsonString) { if (JSON && JSON.parse) // Use native parsing where available return JSON.parse(jsonString); return (new Function("return " + jsonString))(); // Fallback on less safe parsing for older browsers } } return null; }, stringifyJson: function (data, replacer, space) { // replacer and space are optional if (!JSON || !JSON.stringify) throw new Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"); return JSON.stringify(ko.utils.unwrapObservable(data), replacer, space); }, postJson: function (urlOrForm, data, options) { options = options || {}; var params = options['params'] || {}; var includeFields = options['includeFields'] || this.fieldsIncludedWithJsonPost; var url = urlOrForm; // If we were given a form, use its 'action' URL and pick out any requested field values if((typeof urlOrForm == 'object') && (ko.utils.tagNameLower(urlOrForm) === "form")) { var originalForm = urlOrForm; url = originalForm.action; for (var i = includeFields.length - 1; i >= 0; i--) { var fields = ko.utils.getFormFields(originalForm, includeFields[i]); for (var j = fields.length - 1; j >= 0; j--) params[fields[j].name] = fields[j].value; } } data = ko.utils.unwrapObservable(data); var form = document.createElement("form"); form.style.display = "none"; form.action = url; form.method = "post"; for (var key in data) { // Since 'data' this is a model object, we include all properties including those inherited from its prototype var input = document.createElement("input"); input.type = "hidden"; input.name = key; input.value = ko.utils.stringifyJson(ko.utils.unwrapObservable(data[key])); form.appendChild(input); } objectForEach(params, function(key, value) { var input = document.createElement("input"); input.type = "hidden"; input.name = key; input.value = value; form.appendChild(input); }); document.body.appendChild(form); options['submitter'] ? options['submitter'](form) : form.submit(); setTimeout(function () { form.parentNode.removeChild(form); }, 0); } } }()); ko.exportSymbol('utils', ko.utils); ko.exportSymbol('utils.arrayForEach', ko.utils.arrayForEach); ko.exportSymbol('utils.arrayFirst', ko.utils.arrayFirst); ko.exportSymbol('utils.arrayFilter', ko.utils.arrayFilter); ko.exportSymbol('utils.arrayGetDistinctValues', ko.utils.arrayGetDistinctValues); ko.exportSymbol('utils.arrayIndexOf', ko.utils.arrayIndexOf); ko.exportSymbol('utils.arrayMap', ko.utils.arrayMap); ko.exportSymbol('utils.arrayPushAll', ko.utils.arrayPushAll); ko.exportSymbol('utils.arrayRemoveItem', ko.utils.arrayRemoveItem); ko.exportSymbol('utils.extend', ko.utils.extend); ko.exportSymbol('utils.fieldsIncludedWithJsonPost', ko.utils.fieldsIncludedWithJsonPost); ko.exportSymbol('utils.getFormFields', ko.utils.getFormFields); ko.exportSymbol('utils.peekObservable', ko.utils.peekObservable); ko.exportSymbol('utils.postJson', ko.utils.postJson); ko.exportSymbol('utils.parseJson', ko.utils.parseJson); ko.exportSymbol('utils.registerEventHandler', ko.utils.registerEventHandler); ko.exportSymbol('utils.stringifyJson', ko.utils.stringifyJson); ko.exportSymbol('utils.range', ko.utils.range); ko.exportSymbol('utils.toggleDomNodeCssClass', ko.utils.toggleDomNodeCssClass); ko.exportSymbol('utils.triggerEvent', ko.utils.triggerEvent); ko.exportSymbol('utils.unwrapObservable', ko.utils.unwrapObservable); ko.exportSymbol('utils.objectForEach', ko.utils.objectForEach); ko.exportSymbol('utils.addOrRemoveItem', ko.utils.addOrRemoveItem); ko.exportSymbol('unwrap', ko.utils.unwrapObservable); // Convenient shorthand, because this is used so commonly if (!Function.prototype['bind']) { // Function.prototype.bind is a standard part of ECMAScript 5th Edition (December 2009, http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf) // In case the browser doesn't implement it natively, provide a JavaScript implementation. This implementation is based on the one in prototype.js Function.prototype['bind'] = function (object) { var originalFunction = this, args = Array.prototype.slice.call(arguments), object = args.shift(); return function () { return originalFunction.apply(object, args.concat(Array.prototype.slice.call(arguments))); }; }; } ko.utils.domData = new (function () { var uniqueId = 0; var dataStoreKeyExpandoPropertyName = "__ko__" + (new Date).getTime(); var dataStore = {}; function getAll(node, createIfNotFound) { var dataStoreKey = node[dataStoreKeyExpandoPropertyName]; var hasExistingDataStore = dataStoreKey && (dataStoreKey !== "null") && dataStore[dataStoreKey]; if (!hasExistingDataStore) { if (!createIfNotFound) return undefined; dataStoreKey = node[dataStoreKeyExpandoPropertyName] = "ko" + uniqueId++; dataStore[dataStoreKey] = {}; } return dataStore[dataStoreKey]; } return { get: function (node, key) { var allDataForNode = getAll(node, false); return allDataForNode === undefined ? undefined : allDataForNode[key]; }, set: function (node, key, value) { if (value === undefined) { // Make sure we don't actually create a new domData key if we are actually deleting a value if (getAll(node, false) === undefined) return; } var allDataForNode = getAll(node, true); allDataForNode[key] = value; }, clear: function (node) { var dataStoreKey = node[dataStoreKeyExpandoPropertyName]; if (dataStoreKey) { delete dataStore[dataStoreKey]; node[dataStoreKeyExpandoPropertyName] = null; return true; // Exposing "did clean" flag purely so specs can infer whether things have been cleaned up as intended } return false; }, nextKey: function () { return (uniqueId++) + dataStoreKeyExpandoPropertyName; } }; })(); ko.exportSymbol('utils.domData', ko.utils.domData); ko.exportSymbol('utils.domData.clear', ko.utils.domData.clear); // Exporting only so specs can clear up after themselves fully ko.utils.domNodeDisposal = new (function () { var domDataKey = ko.utils.domData.nextKey(); var cleanableNodeTypes = { 1: true, 8: true, 9: true }; // Element, Comment, Document var cleanableNodeTypesWithDescendants = { 1: true, 9: true }; // Element, Document function getDisposeCallbacksCollection(node, createIfNotFound) { var allDisposeCallbacks = ko.utils.domData.get(node, domDataKey); if ((allDisposeCallbacks === undefined) && createIfNotFound) { allDisposeCallbacks = []; ko.utils.domData.set(node, domDataKey, allDisposeCallbacks); } return allDisposeCallbacks; } function destroyCallbacksCollection(node) { ko.utils.domData.set(node, domDataKey, undefined); } function cleanSingleNode(node) { // Run all the dispose callbacks var callbacks = getDisposeCallbacksCollection(node, false); if (callbacks) { callbacks = callbacks.slice(0); // Clone, as the array may be modified during iteration (typically, callbacks will remove themselves) for (var i = 0; i < callbacks.length; i++) callbacks[i](node); } // Erase the DOM data ko.utils.domData.clear(node); // Perform cleanup needed by external libraries (currently only jQuery, but can be extended) ko.utils.domNodeDisposal["cleanExternalData"](node); // Clear any immediate-child comment nodes, as these wouldn't have been found by // node.getElementsByTagName("*") in cleanNode() (comment nodes aren't elements) if (cleanableNodeTypesWithDescendants[node.nodeType]) cleanImmediateCommentTypeChildren(node); } function cleanImmediateCommentTypeChildren(nodeWithChildren) { var child, nextChild = nodeWithChildren.firstChild; while (child = nextChild) { nextChild = child.nextSibling; if (child.nodeType === 8) cleanSingleNode(child); } } return { addDisposeCallback : function(node, callback) { if (typeof callback != "function") throw new Error("Callback must be a function"); getDisposeCallbacksCollection(node, true).push(callback); }, removeDisposeCallback : function(node, callback) { var callbacksCollection = getDisposeCallbacksCollection(node, false); if (callbacksCollection) { ko.utils.arrayRemoveItem(callbacksCollection, callback); if (callbacksCollection.length == 0) destroyCallbacksCollection(node); } }, cleanNode : function(node) { // First clean this node, where applicable if (cleanableNodeTypes[node.nodeType]) { cleanSingleNode(node); // ... then its descendants, where applicable if (cleanableNodeTypesWithDescendants[node.nodeType]) { // Clone the descendants list in case it changes during iteration var descendants = []; ko.utils.arrayPushAll(descendants, node.getElementsByTagName("*")); for (var i = 0, j = descendants.length; i < j; i++) cleanSingleNode(descendants[i]); } } return node; }, removeNode : function(node) { ko.cleanNode(node); if (node.parentNode) node.parentNode.removeChild(node); }, "cleanExternalData" : function (node) { // Special support for jQuery here because it's so commonly used. // Many jQuery plugins (including jquery.tmpl) store data using jQuery's equivalent of domData // so notify it to tear down any resources associated with the node & descendants here. if (jQueryInstance && (typeof jQueryInstance['cleanData'] == "function")) jQueryInstance['cleanData']([node]); } } })(); ko.cleanNode = ko.utils.domNodeDisposal.cleanNode; // Shorthand name for convenience ko.removeNode = ko.utils.domNodeDisposal.removeNode; // Shorthand name for convenience ko.exportSymbol('cleanNode', ko.cleanNode); ko.exportSymbol('removeNode', ko.removeNode); ko.exportSymbol('utils.domNodeDisposal', ko.utils.domNodeDisposal); ko.exportSymbol('utils.domNodeDisposal.addDisposeCallback', ko.utils.domNodeDisposal.addDisposeCallback); ko.exportSymbol('utils.domNodeDisposal.removeDisposeCallback', ko.utils.domNodeDisposal.removeDisposeCallback); (function () { var leadingCommentRegex = /^(\s*)<!--(.*?)-->/; function simpleHtmlParse(html) { // Based on jQuery's "clean" function, but only accounting for table-related elements. // If you have referenced jQuery, this won't be used anyway - KO will use jQuery's "clean" function directly // Note that there's still an issue in IE < 9 whereby it will discard comment nodes that are the first child of // a descendant node. For example: "<div><!-- mycomment -->abc</div>" will get parsed as "<div>abc</div>" // This won't affect anyone who has referenced jQuery, and there's always the workaround of inserting a dummy node // (possibly a text node) in front of the comment. So, KO does not attempt to workaround this IE issue automatically at present. // Trim whitespace, otherwise indexOf won't work as expected var tags = ko.utils.stringTrim(html).toLowerCase(), div = document.createElement("div"); // Finds the first match from the left column, and returns the corresponding "wrap" data from the right column var wrap = tags.match(/^<(thead|tbody|tfoot)/) && [1, "<table>", "</table>"] || !tags.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!tags.indexOf("<td") || !tags.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || /* anything else */ [0, "", ""]; // Go to html and back, then peel off extra wrappers // Note that we always prefix with some dummy text, because otherwise, IE<9 will strip out leading comment nodes in descendants. Total madness. var markup = "ignored<div>" + wrap[1] + html + wrap[2] + "</div>"; if (typeof window['innerShiv'] == "function") { div.appendChild(window['innerShiv'](markup)); } else { div.innerHTML = markup; } // Move to the right depth while (wrap[0]--) div = div.lastChild; return ko.utils.makeArray(div.lastChild.childNodes); } function jQueryHtmlParse(html) { // jQuery's "parseHTML" function was introduced in jQuery 1.8.0 and is a documented public API. if (jQueryInstance['parseHTML']) { return jQueryInstance['parseHTML'](html) || []; // Ensure we always return an array and never null } else { // For jQuery < 1.8.0, we fall back on the undocumented internal "clean" function. var elems = jQueryInstance['clean']([html]); // As of jQuery 1.7.1, jQuery parses the HTML by appending it to some dummy parent nodes held in an in-memory document fragment. // Unfortunately, it never clears the dummy parent nodes from the document fragment, so it leaks memory over time. // Fix this by finding the top-most dummy parent element, and detaching it from its owner fragment. if (elems && elems[0]) { // Find the top-most parent element that's a direct child of a document fragment var elem = elems[0]; while (elem.parentNode && elem.parentNode.nodeType !== 11 /* i.e., DocumentFragment */) elem = elem.parentNode; // ... then detach it if (elem.parentNode) elem.parentNode.removeChild(elem); } return elems; } } ko.utils.parseHtmlFragment = function(html) { return jQueryInstance ? jQueryHtmlParse(html) // As below, benefit from jQuery's optimisations where possible : simpleHtmlParse(html); // ... otherwise, this simple logic will do in most common cases. }; ko.utils.setHtml = function(node, html) { ko.utils.emptyDomNode(node); // There's no legitimate reason to display a stringified observable without unwrapping it, so we'll unwrap it html = ko.utils.unwrapObservable(html); if ((html !== null) && (html !== undefined)) { if (typeof html != 'string') html = html.toString(); // jQuery contains a lot of sophisticated code to parse arbitrary HTML fragments, // for example <tr> elements which are not normally allowed to exist on their own. // If you've referenced jQuery we'll use that rather than duplicating its code. if (jQueryInstance) { jQueryInstance(node)['html'](html); } else { // ... otherwise, use KO's own parsing logic. var parsedNodes = ko.utils.parseHtmlFragment(html); for (var i = 0; i < parsedNodes.length; i++) node.appendChild(parsedNodes[i]); } } }; })(); ko.exportSymbol('utils.parseHtmlFragment', ko.utils.parseHtmlFragment); ko.exportSymbol('utils.setHtml', ko.utils.setHtml); ko.memoization = (function () { var memos = {}; function randomMax8HexChars() { return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1); } function generateRandomId() { return randomMax8HexChars() + randomMax8HexChars(); } function findMemoNodes(rootNode, appendToArray) { if (!rootNode) return; if (rootNode.nodeType == 8) { var memoId = ko.memoization.parseMemoText(rootNode.nodeValue); if (memoId != null) appendToArray.push({ domNode: rootNode, memoId: memoId }); } else if (rootNode.nodeType == 1) { for (var i = 0, childNodes = rootNode.childNodes, j = childNodes.length; i < j; i++) findMemoNodes(childNodes[i], appendToArray); } } return { memoize: function (callback) { if (typeof callback != "function") throw new Error("You can only pass a function to ko.memoization.memoize()"); var memoId = generateRandomId(); memos[memoId] = callback; return "<!--[ko_memo:" + memoId + "]-->"; }, unmemoize: function (memoId, callbackParams) { var callback = memos[memoId]; if (callback === undefined) throw new Error("Couldn't find any memo with ID " + memoId + ". Perhaps it's already been unmemoized."); try { callback.apply(null, callbackParams || []); return true; } finally { delete memos[memoId]; } }, unmemoizeDomNodeAndDescendants: function (domNode, extraCallbackParamsArray) { var memos = []; findMemoNodes(domNode, memos); for (var i = 0, j = memos.length; i < j; i++) { var node = memos[i].domNode; var combinedParams = [node]; if (extraCallbackParamsArray) ko.utils.arrayPushAll(combinedParams, extraCallbackParamsArray); ko.memoization.unmemoize(memos[i].memoId, combinedParams); node.nodeValue = ""; // Neuter this node so we don't try to unmemoize it again if (node.parentNode) node.parentNode.removeChild(node); // If possible, erase it totally (not always possible - someone else might just hold a reference to it then call unmemoizeDomNodeAndDescendants again) } }, parseMemoText: function (memoText) { var match = memoText.match(/^\[ko_memo\:(.*?)\]$/); return match ? match[1] : null; } }; })(); ko.exportSymbol('memoization', ko.memoization); ko.exportSymbol('memoization.memoize', ko.memoization.memoize); ko.exportSymbol('memoization.unmemoize', ko.memoization.unmemoize); ko.exportSymbol('memoization.parseMemoText', ko.memoization.parseMemoText); ko.exportSymbol('memoization.unmemoizeDomNodeAndDescendants', ko.memoization.unmemoizeDomNodeAndDescendants); ko.extenders = { 'throttle': function(target, timeout) { // Throttling means two things: // (1) For dependent observables, we throttle *evaluations* so that, no matter how fast its dependencies // notify updates, the target doesn't re-evaluate (and hence doesn't notify) faster than a certain rate target['throttleEvaluation'] = timeout; // (2) For writable targets (observables, or writable dependent observables), we throttle *writes* // so the target cannot change value synchronously or faster than a certain rate var writeTimeoutInstance = null; return ko.dependentObservable({ 'read': target, 'write': function(value) { clearTimeout(writeTimeoutInstance); writeTimeoutInstance = setTimeout(function() { target(value); }, timeout); } }); }, 'rateLimit': function(target, options) { var timeout, method, limitFunction; if (typeof options == 'number') { timeout = options; } else { timeout = options['timeout']; method = options['method']; } limitFunction = method == 'notifyWhenChangesStop' ? debounce : throttle; target.limit(function(callback) { return limitFunction(callback, timeout); }); }, 'notify': function(target, notifyWhen) { target["equalityComparer"] = notifyWhen == "always" ? null : // null equalityComparer means to always notify valuesArePrimitiveAndEqual; } }; var primitiveTypes = { 'undefined':1, 'boolean':1, 'number':1, 'string':1 }; function valuesArePrimitiveAndEqual(a, b) { var oldValueIsPrimitive = (a === null) || (typeof(a) in primitiveTypes); return oldValueIsPrimitive ? (a === b) : false; } function throttle(callback, timeout) { var timeoutInstance; return function () { if (!timeoutInstance) { timeoutInstance = setTimeout(function() { timeoutInstance = undefined; callback(); }, timeout); } }; } function debounce(callback, timeout) { var timeoutInstance; return function () { clearTimeout(timeoutInstance); timeoutInstance = setTimeout(callback, timeout); }; } function applyExtenders(requestedExtenders) { var target = this; if (requestedExtenders) { ko.utils.objectForEach(requestedExtenders, function(key, value) { var extenderHandler = ko.extenders[key]; if (typeof extenderHandler == 'function') { target = extenderHandler(target, value) || target; } }); } return target; } ko.exportSymbol('extenders', ko.extenders); ko.subscription = function (target, callback, disposeCallback) { this.target = target; this.callback = callback; this.disposeCallback = disposeCallback; this.isDisposed = false; ko.exportProperty(this, 'dispose', this.dispose); }; ko.subscription.prototype.dispose = function () { this.isDisposed = true; this.disposeCallback(); }; ko.subscribable = function () { ko.utils.setPrototypeOfOrExtend(this, ko.subscribable['fn']); this._subscriptions = {}; } var defaultEvent = "change"; var ko_subscribable_fn = { subscribe: function (callback, callbackTarget, event) { var self = this; event = event || defaultEvent; var boundCallback = callbackTarget ? callback.bind(callbackTarget) : callback; var subscription = new ko.subscription(self, boundCallback, function () { ko.utils.arrayRemoveItem(self._subscriptions[event], subscription); if (self.afterSubscriptionRemove) self.afterSubscriptionRemove(event); }); if (self.beforeSubscriptionAdd) self.beforeSubscriptionAdd(event); if (!self._subscriptions[event]) self._subscriptions[event] = []; self._subscriptions[event].push(subscription); return subscription; }, "notifySubscribers": function (valueToNotify, event) { event = event || defaultEvent; if (this.hasSubscriptionsForEvent(event)) { try { ko.dependencyDetection.begin(); // Begin suppressing dependency detection (by setting the top frame to undefined) for (var a = this._subscriptions[event].slice(0), i = 0, subscription; subscription = a[i]; ++i) { // In case a subscription was disposed during the arrayForEach cycle, check // for isDisposed on each subscription before invoking its callback if (!subscription.isDisposed) subscription.callback(valueToNotify); } } finally { ko.dependencyDetection.end(); // End suppressing dependency detection } } }, limit: function(limitFunction) { var self = this, selfIsObservable = ko.isObservable(self), isPending, previousValue, pendingValue, beforeChange = 'beforeChange'; if (!self._origNotifySubscribers) { self._origNotifySubscribers = self["notifySubscribers"]; self["notifySubscribers"] = function(value, event) { if (!event || event === defaultEvent) { self._rateLimitedChange(value); } else if (event === beforeChange) { self._rateLimitedBeforeChange(value); } else { self._origNotifySubscribers(value, event); } }; } var finish = limitFunction(function() { // If an observable provided a reference to itself, access it to get the latest value. // This allows computed observables to delay calculating their value until needed. if (selfIsObservable && pendingValue === self) { pendingValue = self(); } isPending = false; if (self.isDifferent(previousValue, pendingValue)) { self._origNotifySubscribers(previousValue = pendingValue); } }); self._rateLimitedChange = function(value) { isPending = true; pendingValue = value; finish(); }; self._rateLimitedBeforeChange = function(value) { if (!isPending) { previousValue = value; self._origNotifySubscribers(value, beforeChange); } }; }, hasSubscriptionsForEvent: function(event) { return this._subscriptions[event] && this._subscriptions[event].length; }, getSubscriptionsCount: function () { var total = 0; ko.utils.objectForEach(this._subscriptions, function(eventName, subscriptions) { total += subscriptions.length; }); return total; }, isDifferent: function(oldValue, newValue) { return !this['equalityComparer'] || !this['equalityComparer'](oldValue, newValue); }, extend: applyExtenders }; ko.exportProperty(ko_subscribable_fn, 'subscribe', ko_subscribable_fn.subscribe); ko.exportProperty(ko_subscribable_fn, 'extend', ko_subscribable_fn.extend); ko.exportProperty(ko_subscribable_fn, 'getSubscriptionsCount', ko_subscribable_fn.getSubscriptionsCount); // For browsers that support proto assignment, we overwrite the prototype of each // observable instance. Since observables are functions, we need Function.prototype // to still be in the prototype chain. if (ko.utils.canSetPrototype) { ko.utils.setPrototypeOf(ko_subscribable_fn, Function.prototype); } ko.subscribable['fn'] = ko_subscribable_fn; ko.isSubscribable = function (instance) { return instance != null && typeof instance.subscribe == "function" && typeof instance["notifySubscribers"] == "function"; }; ko.exportSymbol('subscribable', ko.subscribable); ko.exportSymbol('isSubscribable', ko.isSubscribable); ko.computedContext = ko.dependencyDetection = (function () { var outerFrames = [], currentFrame, lastId = 0; // Return a unique ID that can be assigned to an observable for dependency tracking. // Theoretically, you could eventually overflow the number storage size, resulting // in duplicate IDs. But in JavaScript, the largest exact integral value is 2^53 // or 9,007,199,254,740,992. If you created 1,000,000 IDs per second, it would // take over 285 years to reach that number. // Reference http://blog.vjeux.com/2010/javascript/javascript-max_int-number-limits.html function getId() { return ++lastId; } function begin(options) { outerFrames.push(currentFrame); currentFrame = options; } function end() { currentFrame = outerFrames.pop(); } return { begin: begin, end: end, registerDependency: function (subscribable) { if (currentFrame) { if (!ko.isSubscribable(subscribable)) throw new Error("Only subscribable things can act as dependencies"); currentFrame.callback(subscribable, subscribable._id || (subscribable._id = getId())); } }, ignore: function (callback, callbackTarget, callbackArgs) { try { begin(); return callback.apply(callbackTarget, callbackArgs || []); } finally { end(); } }, getDependenciesCount: function () { if (currentFrame) return currentFrame.computed.getDependenciesCount(); }, isInitial: function() { if (currentFrame) return currentFrame.isInitial; } }; })(); ko.exportSymbol('computedContext', ko.computedContext); ko.exportSymbol('computedContext.getDependenciesCount', ko.computedContext.getDependenciesCount); ko.exportSymbol('computedContext.isInitial', ko.computedContext.isInitial); ko.exportSymbol('computedContext.isSleeping', ko.computedContext.isSleeping); ko.observable = function (initialValue) { var _latestValue = initialValue; function observable() { if (arguments.length > 0) { // Write // Ignore writes if the value hasn't changed if (observable.isDifferent(_latestValue, arguments[0])) { observable.valueWillMutate(); _latestValue = arguments[0]; if (DEBUG) observable._latestValue = _latestValue; observable.valueHasMutated(); } return this; // Permits chained assignments } else { // Read ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation return _latestValue; } } ko.subscribable.call(observable); ko.utils.setPrototypeOfOrExtend(observable, ko.observable['fn']); if (DEBUG) observable._latestValue = _latestValue; observable.peek = function() { return _latestValue }; observable.valueHasMutated = function () { observable["notifySubscribers"](_latestValue); } observable.valueWillMutate = function () { observable["notifySubscribers"](_latestValue, "beforeChange"); } ko.exportProperty(observable, 'peek', observable.peek); ko.exportProperty(observable, "valueHasMutated", observable.valueHasMutated); ko.exportProperty(observable, "valueWillMutate", observable.valueWillMutate); return observable; } ko.observable['fn'] = { "equalityComparer": valuesArePrimitiveAndEqual }; var protoProperty = ko.observable.protoProperty = "__ko_proto__"; ko.observable['fn'][protoProperty] = ko.observable; // Note that for browsers that don't support proto assignment, the // inheritance chain is created manually in the ko.observable constructor if (ko.utils.canSetPrototype) { ko.utils.setPrototypeOf(ko.observable['fn'], ko.subscribable['fn']); } ko.hasPrototype = function(instance, prototype) { if ((instance === null) || (instance === undefined) || (instance[protoProperty] === undefined)) return false; if (instance[protoProperty] === prototype) return true; return ko.hasPrototype(instance[protoProperty], prototype); // Walk the prototype chain }; ko.isObservable = function (instance) { return ko.hasPrototype(instance, ko.observable); } ko.isWriteableObservable = function (instance) { // Observable if ((typeof instance == "function") && instance[protoProperty] === ko.observable) return true; // Writeable dependent observable if ((typeof instance == "function") && (instance[protoProperty] === ko.dependentObservable) && (instance.hasWriteFunction)) return true; // Anything else return false; } ko.exportSymbol('observable', ko.observable); ko.exportSymbol('isObservable', ko.isObservable); ko.exportSymbol('isWriteableObservable', ko.isWriteableObservable); ko.exportSymbol('isWritableObservable', ko.isWriteableObservable); ko.observableArray = function (initialValues) { initialValues = initialValues || []; if (typeof initialValues != 'object' || !('length' in initialValues)) throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined."); var result = ko.observable(initialValues); ko.utils.setPrototypeOfOrExtend(result, ko.observableArray['fn']); return result.extend({'trackArrayChanges':true}); }; ko.observableArray['fn'] = { 'remove': function (valueOrPredicate) { var underlyingArray = this.peek(); var removedValues = []; var predicate = typeof valueOrPredicate == "function" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; }; for (var i = 0; i < underlyingArray.length; i++) { var value = underlyingArray[i]; if (predicate(value)) { if (removedValues.length === 0) { this.valueWillMutate(); } removedValues.push(value); underlyingArray.splice(i, 1); i--; } } if (removedValues.length) { this.valueHasMutated(); } return removedValues; }, 'removeAll': function (arrayOfValues) { // If you passed zero args, we remove everything if (arrayOfValues === undefined) { var underlyingArray = this.peek(); var allValues = underlyingArray.slice(0); this.valueWillMutate(); underlyingArray.splice(0, underlyingArray.length); this.valueHasMutated(); return allValues; } // If you passed an arg, we interpret it as an array of entries to remove if (!arrayOfValues) return []; return this['remove'](function (value) { return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0; }); }, 'destroy': function (valueOrPredicate) { var underlyingArray = this.peek(); var predicate = typeof valueOrPredicate == "function" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; }; this.valueWillMutate(); for (var i = underlyingArray.length - 1; i >= 0; i--) { var value = underlyingArray[i]; if (predicate(value)) underlyingArray[i]["_destroy"] = true; } this.valueHasMutated(); }, 'destroyAll': function (arrayOfValues) { // If you passed zero args, we destroy everything if (arrayOfValues === undefined) return this['destroy'](function() { return true }); // If you passed an arg, we interpret it as an array of entries to destroy if (!arrayOfValues) return []; return this['destroy'](function (value) { return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0; }); }, 'indexOf': function (item) { var underlyingArray = this(); return ko.utils.arrayIndexOf(underlyingArray, item); }, 'replace': function(oldItem, newItem) { var index = this['indexOf'](oldItem); if (index >= 0) { this.valueWillMutate(); this.peek()[index] = newItem; this.valueHasMutated(); } } }; // Populate ko.observableArray.fn with read/write functions from native arrays // Important: Do not add any additional functions here that may reasonably be used to *read* data from the array // because we'll eval them without causing subscriptions, so ko.computed output could end up getting stale ko.utils.arrayForEach(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (methodName) { ko.observableArray['fn'][methodName] = function () { // Use "peek" to avoid creating a subscription in any computed that we're executing in the context of // (for consistency with mutating regular observables) var underlyingArray = this.peek(); this.valueWillMutate(); this.cacheDiffForKnownOperation(underlyingArray, methodName, arguments); var methodCallResult = underlyingArray[methodName].apply(underlyingArray, arguments); this.valueHasMutated(); return methodCallResult; }; }); // Populate ko.observableArray.fn with read-only functions from native arrays ko.utils.arrayForEach(["slice"], function (methodName) { ko.observableArray['fn'][methodName] = function () { var underlyingArray = this(); return underlyingArray[methodName].apply(underlyingArray, arguments); }; }); // Note that for browsers that don't support proto assignment, the // inheritance chain is created manually in the ko.observableArray constructor if (ko.utils.canSetPrototype) { ko.utils.setPrototypeOf(ko.observableArray['fn'], ko.observable['fn']); } ko.exportSymbol('observableArray', ko.observableArray); var arrayChangeEventName = 'arrayChange'; ko.extenders['trackArrayChanges'] = function(target) { // Only modify the target observable once if (target.cacheDiffForKnownOperation) { return; } var trackingChanges = false, cachedDiff = null, pendingNotifications = 0, underlyingSubscribeFunction = target.subscribe; // Intercept "subscribe" calls, and for array change events, ensure change tracking is enabled target.subscribe = target['subscribe'] = function(callback, callbackTarget, event) { if (event === arrayChangeEventName) { trackChanges(); } return underlyingSubscribeFunction.apply(this, arguments); }; function trackChanges() { // Calling 'trackChanges' multiple times is the same as calling it once if (trackingChanges) { return; } trackingChanges = true; // Intercept "notifySubscribers" to track how many times it was called. var underlyingNotifySubscribersFunction = target['notifySubscribers']; target['notifySubscribers'] = function(valueToNotify, event) { if (!event || event === defaultEvent) { ++pendingNotifications; } return underlyingNotifySubscribersFunction.apply(this, arguments); }; // Each time the array changes value, capture a clone so that on the next // change it's possible to produce a diff var previousContents = [].concat(target.peek() || []); cachedDiff = null; target.subscribe(function(currentContents) { // Make a copy of the current contents and ensure it's an array currentContents = [].concat(currentContents || []); // Compute the diff and issue notifications, but only if someone is listening if (target.hasSubscriptionsForEvent(arrayChangeEventName)) { var changes = getChanges(previousContents, currentContents); if (changes.length) { target['notifySubscribers'](changes, arrayChangeEventName); } } // Eliminate references to the old, removed items, so they can be GCed previousContents = currentContents; cachedDiff = null; pendingNotifications = 0; }); } function getChanges(previousContents, currentContents) { // We try to re-use cached diffs. // The scenarios where pendingNotifications > 1 are when using rate-limiting or the Deferred Updates // plugin, which without this check would not be compatible with arrayChange notifications. Normally, // notifications are issued immediately so we wouldn't be queueing up more than one. if (!cachedDiff || pendingNotifications > 1) { cachedDiff = ko.utils.compareArrays(previousContents, currentContents, { 'sparse': true }); } return cachedDiff; } target.cacheDiffForKnownOperation = function(rawArray, operationName, args) { // Only run if we're currently tracking changes for this observable array // and there aren't any pending deferred notifications. if (!trackingChanges || pendingNotifications) { return; } var diff = [], arrayLength = rawArray.length, argsLength = args.length, offset = 0; function pushDiff(status, value, index) { return diff[diff.length] = { 'status': status, 'value': value, 'index': index }; } switch (operationName) { case 'push': offset = arrayLength; case 'unshift': for (var index = 0; index < argsLength; index++) { pushDiff('added', args[index], offset + index); } break; case 'pop': offset = arrayLength - 1; case 'shift': if (arrayLength) { pushDiff('deleted', rawArray[offset], offset); } break; case 'splice': // Negative start index means 'from end of array'. After that we clamp to [0...arrayLength]. // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice var startIndex = Math.min(Math.max(0, args[0] < 0 ? arrayLength + args[0] : args[0]), arrayLength), endDeleteIndex = argsLength === 1 ? arrayLength : Math.min(startIndex + (args[1] || 0), arrayLength), endAddIndex = startIndex + argsLength - 2, endIndex = Math.max(endDeleteIndex, endAddIndex), additions = [], deletions = []; for (var index = startIndex, argsIndex = 2; index < endIndex; ++index, ++argsIndex) { if (index < endDeleteIndex) deletions.push(pushDiff('deleted', rawArray[index], index)); if (index < endAddIndex) additions.push(pushDiff('added', args[argsIndex], index)); } ko.utils.findMovesInArrayComparison(deletions, additions); break; default: return; } cachedDiff = diff; }; }; ko.computed = ko.dependentObservable = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, options) { var _latestValue, _needsEvaluation = true, _isBeingEvaluated = false, _suppressDisposalUntilDisposeWhenReturnsFalse = false, _isDisposed = false, readFunction = evaluatorFunctionOrOptions, pure = false, isSleeping = false; if (readFunction && typeof readFunction == "object") { // Single-parameter syntax - everything is on this "options" param options = readFunction; readFunction = options["read"]; } else { // Multi-parameter syntax - construct the options according to the params passed options = options || {}; if (!readFunction) readFunction = options["read"]; } if (typeof readFunction != "function") throw new Error("Pass a function that returns the value of the ko.computed"); function addSubscriptionToDependency(subscribable, id) { if (!_subscriptionsToDependencies[id]) { _subscriptionsToDependencies[id] = subscribable.subscribe(evaluatePossiblyAsync); ++_dependenciesCount; } } function disposeAllSubscriptionsToDependencies() { ko.utils.objectForEach(_subscriptionsToDependencies, function (id, subscription) { subscription.dispose(); }); _subscriptionsToDependencies = {}; } function disposeComputed() { disposeAllSubscriptionsToDependencies(); _dependenciesCount = 0; _isDisposed = true; _needsEvaluation = false; } function evaluatePossiblyAsync() { var throttleEvaluationTimeout = dependentObservable['throttleEvaluation']; if (throttleEvaluationTimeout && throttleEvaluationTimeout >= 0) { clearTimeout(evaluationTimeoutInstance); evaluationTimeoutInstance = setTimeout(evaluateImmediate, throttleEvaluationTimeout); } else if (dependentObservable._evalRateLimited) { dependentObservable._evalRateLimited(); } else { evaluateImmediate(); } } function evaluateImmediate(suppressChangeNotification) { if (_isBeingEvaluated) { if (pure) { throw Error("A 'pure' computed must not be called recursively"); } // If the evaluation of a ko.computed causes side effects, it's possible that it will trigger its own re-evaluation. // This is not desirable (it's hard for a developer to realise a chain of dependencies might cause this, and they almost // certainly didn't intend infinite re-evaluations). So, for predictability, we simply prevent ko.computeds from causing // their own re-evaluation. Further discussion at https://github.com/SteveSanderson/knockout/pull/387 return; } // Do not evaluate (and possibly capture new dependencies) if disposed if (_isDisposed) { return; } if (disposeWhen && disposeWhen()) { // See comment below about _suppressDisposalUntilDisposeWhenReturnsFalse if (!_suppressDisposalUntilDisposeWhenReturnsFalse) { dispose(); return; } } else { // It just did return false, so we can stop suppressing now _suppressDisposalUntilDisposeWhenReturnsFalse = false; } _isBeingEvaluated = true; // When sleeping, recalculate the value and return. if (isSleeping) { try { var dependencyTracking = {}; ko.dependencyDetection.begin({ callback: function (subscribable, id) { if (!dependencyTracking[id]) { dependencyTracking[id] = 1; ++_dependenciesCount; } }, computed: dependentObservable, isInitial: undefined }); _dependenciesCount = 0; _latestValue = readFunction.call(evaluatorFunctionTarget); } finally { ko.dependencyDetection.end(); _isBeingEvaluated = false; } } else { try { // Initially, we assume that none of the subscriptions are still being used (i.e., all are candidates for disposal). // Then, during evaluation, we cross off any that are in fact still being used. var disposalCandidates = _subscriptionsToDependencies, disposalCount = _dependenciesCount; ko.dependencyDetection.begin({ callback: function(subscribable, id) { if (!_isDisposed) { if (disposalCount && disposalCandidates[id]) { // Don't want to dispose this subscription, as it's still being used _subscriptionsToDependencies[id] = disposalCandidates[id]; ++_dependenciesCount; delete disposalCandidates[id]; --disposalCount; } else { // Brand new subscription - add it addSubscriptionToDependency(subscribable, id); } } }, computed: dependentObservable, isInitial: pure ? undefined : !_dependenciesCount // If we're evaluating when there are no previous dependencies, it must be the first time }); _subscriptionsToDependencies = {}; _dependenciesCount = 0; try { var newValue = evaluatorFunctionTarget ? readFunction.call(evaluatorFunctionTarget) : readFunction(); } finally { ko.dependencyDetection.end(); // For each subscription no longer being used, remove it from the active subscriptions list and dispose it if (disposalCount) { ko.utils.objectForEach(disposalCandidates, function(id, toDispose) { toDispose.dispose(); }); } _needsEvaluation = false; } if (dependentObservable.isDifferent(_latestValue, newValue)) { dependentObservable["notifySubscribers"](_latestValue, "beforeChange"); _latestValue = newValue; if (DEBUG) dependentObservable._latestValue = _latestValue; if (suppressChangeNotification !== true) { // Check for strict true value since setTimeout in Firefox passes a numeric value to the function dependentObservable["notifySubscribers"](_latestValue); } } } finally { _isBeingEvaluated = false; } } if (!_dependenciesCount) dispose(); } function dependentObservable() { if (arguments.length > 0) { if (typeof writeFunction === "function") { // Writing a value writeFunction.apply(evaluatorFunctionTarget, arguments); } else { throw new Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters."); } return this; // Permits chained assignments } else { // Reading the value ko.dependencyDetection.registerDependency(dependentObservable); if (_needsEvaluation) evaluateImmediate(true /* suppressChangeNotification */); return _latestValue; } } function peek() { // Peek won't re-evaluate, except to get the initial value when "deferEvaluation" is set, or while the computed is sleeping. // Those are the only times that both of these conditions will be satisfied. if (_needsEvaluation && !_dependenciesCount) evaluateImmediate(true /* suppressChangeNotification */); return _latestValue; } function isActive() { return _needsEvaluation || _dependenciesCount > 0; } // By here, "options" is always non-null var writeFunction = options["write"], disposeWhenNodeIsRemoved = options["disposeWhenNodeIsRemoved"] || options.disposeWhenNodeIsRemoved || null, disposeWhenOption = options["disposeWhen"] || options.disposeWhen, disposeWhen = disposeWhenOption, dispose = disposeComputed, _subscriptionsToDependencies = {}, _dependenciesCount = 0, evaluationTimeoutInstance = null; if (!evaluatorFunctionTarget) evaluatorFunctionTarget = options["owner"]; ko.subscribable.call(dependentObservable); ko.utils.setPrototypeOfOrExtend(dependentObservable, ko.dependentObservable['fn']); dependentObservable.peek = peek; dependentObservable.getDependenciesCount = function () { return _dependenciesCount; }; dependentObservable.hasWriteFunction = typeof options["write"] === "function"; dependentObservable.dispose = function () { dispose(); }; dependentObservable.isActive = isActive; // Replace the limit function with one that delays evaluation as well. var originalLimit = dependentObservable.limit; dependentObservable.limit = function(limitFunction) { originalLimit.call(dependentObservable, limitFunction); dependentObservable._evalRateLimited = function() { dependentObservable._rateLimitedBeforeChange(_latestValue); _needsEvaluation = true; // Mark as dirty // Pass the observable to the rate-limit code, which will access it when // it's time to do the notification. dependentObservable._rateLimitedChange(dependentObservable); } }; if (options['pure']) { pure = true; isSleeping = true; // Starts off sleeping; will awake on the first subscription dependentObservable.beforeSubscriptionAdd = function () { // If asleep, wake up the computed and evaluate to register any dependencies. if (isSleeping) { isSleeping = false; evaluateImmediate(true /* suppressChangeNotification */); } } dependentObservable.afterSubscriptionRemove = function () { if (!dependentObservable.getSubscriptionsCount()) { disposeAllSubscriptionsToDependencies(); isSleeping = _needsEvaluation = true; } } } else if (options['deferEvaluation']) { // This will force a computed with deferEvaluation to evaluate when the first subscriptions is registered. dependentObservable.beforeSubscriptionAdd = function () { peek(); delete dependentObservable.beforeSubscriptionAdd; } } ko.exportProperty(dependentObservable, 'peek', dependentObservable.peek); ko.exportProperty(dependentObservable, 'dispose', dependentObservable.dispose); ko.exportProperty(dependentObservable, 'isActive', dependentObservable.isActive); ko.exportProperty(dependentObservable, 'getDependenciesCount', dependentObservable.getDependenciesCount); // Add a "disposeWhen" callback that, on each evaluation, disposes if the node was removed without using ko.removeNode. if (disposeWhenNodeIsRemoved) { // Since this computed is associated with a DOM node, and we don't want to dispose the computed // until the DOM node is *removed* from the document (as opposed to never having been in the document), // we'll prevent disposal until "disposeWhen" first returns false. _suppressDisposalUntilDisposeWhenReturnsFalse = true; // Only watch for the node's disposal if the value really is a node. It might not be, // e.g., { disposeWhenNodeIsRemoved: true } can be used to opt into the "only dispose // after first false result" behaviour even if there's no specific node to watch. This // technique is intended for KO's internal use only and shouldn't be documented or used // by application code, as it's likely to change in a future version of KO. if (disposeWhenNodeIsRemoved.nodeType) { disposeWhen = function () { return !ko.utils.domNodeIsAttachedToDocument(disposeWhenNodeIsRemoved) || (disposeWhenOption && disposeWhenOption()); }; } } // Evaluate, unless sleeping or deferEvaluation is true if (!isSleeping && !options['deferEvaluation']) evaluateImmediate(); // Attach a DOM node disposal callback so that the computed will be proactively disposed as soon as the node is // removed using ko.removeNode. But skip if isActive is false (there will never be any dependencies to dispose). if (disposeWhenNodeIsRemoved && isActive() && disposeWhenNodeIsRemoved.nodeType) { dispose = function() { ko.utils.domNodeDisposal.removeDisposeCallback(disposeWhenNodeIsRemoved, dispose); disposeComputed(); }; ko.utils.domNodeDisposal.addDisposeCallback(disposeWhenNodeIsRemoved, dispose); } return dependentObservable; }; ko.isComputed = function(instance) { return ko.hasPrototype(instance, ko.dependentObservable); }; var protoProp = ko.observable.protoProperty; // == "__ko_proto__" ko.dependentObservable[protoProp] = ko.observable; ko.dependentObservable['fn'] = { "equalityComparer": valuesArePrimitiveAndEqual }; ko.dependentObservable['fn'][protoProp] = ko.dependentObservable; // Note that for browsers that don't support proto assignment, the // inheritance chain is created manually in the ko.dependentObservable constructor if (ko.utils.canSetPrototype) { ko.utils.setPrototypeOf(ko.dependentObservable['fn'], ko.subscribable['fn']); } ko.exportSymbol('dependentObservable', ko.dependentObservable); ko.exportSymbol('computed', ko.dependentObservable); // Make "ko.computed" an alias for "ko.dependentObservable" ko.exportSymbol('isComputed', ko.isComputed); ko.pureComputed = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget) { if (typeof evaluatorFunctionOrOptions === 'function') { return ko.computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget, {'pure':true}); } else { evaluatorFunctionOrOptions = ko.utils.extend({}, evaluatorFunctionOrOptions); // make a copy of the parameter object evaluatorFunctionOrOptions['pure'] = true; return ko.computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget); } } ko.exportSymbol('pureComputed', ko.pureComputed); (function() { var maxNestedObservableDepth = 10; // Escape the (unlikely) pathalogical case where an observable's current value is itself (or similar reference cycle) ko.toJS = function(rootObject) { if (arguments.length == 0) throw new Error("When calling ko.toJS, pass the object you want to convert."); // We just unwrap everything at every level in the object graph return mapJsObjectGraph(rootObject, function(valueToMap) { // Loop because an observable's value might in turn be another observable wrapper for (var i = 0; ko.isObservable(valueToMap) && (i < maxNestedObservableDepth); i++) valueToMap = valueToMap(); return valueToMap; }); }; ko.toJSON = function(rootObject, replacer, space) { // replacer and space are optional var plainJavaScriptObject = ko.toJS(rootObject); return ko.utils.stringifyJson(plainJavaScriptObject, replacer, space); }; function mapJsObjectGraph(rootObject, mapInputCallback, visitedObjects) { visitedObjects = visitedObjects || new objectLookup(); rootObject = mapInputCallback(rootObject); var canHaveProperties = (typeof rootObject == "object") && (rootObject !== null) && (rootObject !== undefined) && (!(rootObject instanceof Date)) && (!(rootObject instanceof String)) && (!(rootObject instanceof Number)) && (!(rootObject instanceof Boolean)); if (!canHaveProperties) return rootObject; var outputProperties = rootObject instanceof Array ? [] : {}; visitedObjects.save(rootObject, outputProperties); visitPropertiesOrArrayEntries(rootObject, function(indexer) { var propertyValue = mapInputCallback(rootObject[indexer]); switch (typeof propertyValue) { case "boolean": case "number": case "string": case "function": outputProperties[indexer] = propertyValue; break; case "object": case "undefined": var previouslyMappedValue = visitedObjects.get(propertyValue); outputProperties[indexer] = (previouslyMappedValue !== undefined) ? previouslyMappedValue : mapJsObjectGraph(propertyValue, mapInputCallback, visitedObjects); break; } }); return outputProperties; } function visitPropertiesOrArrayEntries(rootObject, visitorCallback) { if (rootObject instanceof Array) { for (var i = 0; i < rootObject.length; i++) visitorCallback(i); // For arrays, also respect toJSON property for custom mappings (fixes #278) if (typeof rootObject['toJSON'] == 'function') visitorCallback('toJSON'); } else { for (var propertyName in rootObject) { visitorCallback(propertyName); } } }; function objectLookup() { this.keys = []; this.values = []; }; objectLookup.prototype = { constructor: objectLookup, save: function(key, value) { var existingIndex = ko.utils.arrayIndexOf(this.keys, key); if (existingIndex >= 0) this.values[existingIndex] = value; else { this.keys.push(key); this.values.push(value); } }, get: function(key) { var existingIndex = ko.utils.arrayIndexOf(this.keys, key); return (existingIndex >= 0) ? this.values[existingIndex] : undefined; } }; })(); ko.exportSymbol('toJS', ko.toJS); ko.exportSymbol('toJSON', ko.toJSON); (function () { var hasDomDataExpandoProperty = '__ko__hasDomDataOptionValue__'; // Normally, SELECT elements and their OPTIONs can only take value of type 'string' (because the values // are stored on DOM attributes). ko.selectExtensions provides a way for SELECTs/OPTIONs to have values // that are arbitrary objects. This is very convenient when implementing things like cascading dropdowns. ko.selectExtensions = { readValue : function(element) { switch (ko.utils.tagNameLower(element)) { case 'option': if (element[hasDomDataExpandoProperty] === true) return ko.utils.domData.get(element, ko.bindingHandlers.options.optionValueDomDataKey); return ko.utils.ieVersion <= 7 ? (element.getAttributeNode('value') && element.getAttributeNode('value').specified ? element.value : element.text) : element.value; case 'select': return element.selectedIndex >= 0 ? ko.selectExtensions.readValue(element.options[element.selectedIndex]) : undefined; default: return element.value; } }, writeValue: function(element, value, allowUnset) { switch (ko.utils.tagNameLower(element)) { case 'option': switch(typeof value) { case "string": ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, undefined); if (hasDomDataExpandoProperty in element) { // IE <= 8 throws errors if you delete non-existent properties from a DOM node delete element[hasDomDataExpandoProperty]; } element.value = value; break; default: // Store arbitrary object using DomData ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, value); element[hasDomDataExpandoProperty] = true; // Special treatment of numbers is just for backward compatibility. KO 1.2.1 wrote numerical values to element.value. element.value = typeof value === "number" ? value : ""; break; } break; case 'select': if (value === "" || value === null) // A blank string or null value will select the caption value = undefined; var selection = -1; for (var i = 0, n = element.options.length, optionValue; i < n; ++i) { optionValue = ko.selectExtensions.readValue(element.options[i]); // Include special check to handle selecting a caption with a blank string value if (optionValue == value || (optionValue == "" && value === undefined)) { selection = i; break; } } if (allowUnset || selection >= 0 || (value === undefined && element.size > 1)) { element.selectedIndex = selection; } break; default: if ((value === null) || (value === undefined)) value = ""; element.value = value; break; } } }; })(); ko.exportSymbol('selectExtensions', ko.selectExtensions); ko.exportSymbol('selectExtensions.readValue', ko.selectExtensions.readValue); ko.exportSymbol('selectExtensions.writeValue', ko.selectExtensions.writeValue); ko.expressionRewriting = (function () { var javaScriptReservedWords = ["true", "false", "null", "undefined"]; // Matches something that can be assigned to--either an isolated identifier or something ending with a property accessor // This is designed to be simple and avoid false negatives, but could produce false positives (e.g., a+b.c). // This also will not properly handle nested brackets (e.g., obj1[obj2['prop']]; see #911). var javaScriptAssignmentTarget = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i; function getWriteableValue(expression) { if (ko.utils.arrayIndexOf(javaScriptReservedWords, expression) >= 0) return false; var match = expression.match(javaScriptAssignmentTarget); return match === null ? false : match[1] ? ('Object(' + match[1] + ')' + match[2]) : expression; } // The following regular expressions will be used to split an object-literal string into tokens // These two match strings, either with double quotes or single quotes var stringDouble = '"(?:[^"\\\\]|\\\\.)*"', stringSingle = "'(?:[^'\\\\]|\\\\.)*'", // Matches a regular expression (text enclosed by slashes), but will also match sets of divisions // as a regular expression (this is handled by the parsing loop below). stringRegexp = '/(?:[^/\\\\]|\\\\.)*/\w*', // These characters have special meaning to the parser and must not appear in the middle of a // token, except as part of a string. specials = ',"\'{}()/:[\\]', // Match text (at least two characters) that does not contain any of the above special characters, // although some of the special characters are allowed to start it (all but the colon and comma). // The text can contain spaces, but leading or trailing spaces are skipped. everyThingElse = '[^\\s:,/][^' + specials + ']*[^\\s' + specials + ']', // Match any non-space character not matched already. This will match colons and commas, since they're // not matched by "everyThingElse", but will also match any other single character that wasn't already // matched (for example: in "a: 1, b: 2", each of the non-space characters will be matched by oneNotSpace). oneNotSpace = '[^\\s]', // Create the actual regular expression by or-ing the above strings. The order is important. bindingToken = RegExp(stringDouble + '|' + stringSingle + '|' + stringRegexp + '|' + everyThingElse + '|' + oneNotSpace, 'g'), // Match end of previous token to determine whether a slash is a division or regex. divisionLookBehind = /[\])"'A-Za-z0-9_$]+$/, keywordRegexLookBehind = {'in':1,'return':1,'typeof':1}; function parseObjectLiteral(objectLiteralString) { // Trim leading and trailing spaces from the string var str = ko.utils.stringTrim(objectLiteralString); // Trim braces '{' surrounding the whole object literal if (str.charCodeAt(0) === 123) str = str.slice(1, -1); // Split into tokens var result = [], toks = str.match(bindingToken), key, values, depth = 0; if (toks) { // Append a comma so that we don't need a separate code block to deal with the last item toks.push(','); for (var i = 0, tok; tok = toks[i]; ++i) { var c = tok.charCodeAt(0); // A comma signals the end of a key/value pair if depth is zero if (c === 44) { // "," if (depth <= 0) { if (key) result.push(values ? {key: key, value: values.join('')} : {'unknown': key}); key = values = depth = 0; continue; } // Simply skip the colon that separates the name and value } else if (c === 58) { // ":" if (!values) continue; // A set of slashes is initially matched as a regular expression, but could be division } else if (c === 47 && i && tok.length > 1) { // "/" // Look at the end of the previous token to determine if the slash is actually division var match = toks[i-1].match(divisionLookBehind); if (match && !keywordRegexLookBehind[match[0]]) { // The slash is actually a division punctuator; re-parse the remainder of the string (not including the slash) str = str.substr(str.indexOf(tok) + 1); toks = str.match(bindingToken); toks.push(','); i = -1; // Continue with just the slash tok = '/'; } // Increment depth for parentheses, braces, and brackets so that interior commas are ignored } else if (c === 40 || c === 123 || c === 91) { // '(', '{', '[' ++depth; } else if (c === 41 || c === 125 || c === 93) { // ')', '}', ']' --depth; // The key must be a single token; if it's a string, trim the quotes } else if (!key && !values) { key = (c === 34 || c === 39) /* '"', "'" */ ? tok.slice(1, -1) : tok; continue; } if (values) values.push(tok); else values = [tok]; } } return result; } // Two-way bindings include a write function that allow the handler to update the value even if it's not an observable. var twoWayBindings = {}; function preProcessBindings(bindingsStringOrKeyValueArray, bindingOptions) { bindingOptions = bindingOptions || {}; function processKeyValue(key, val) { var writableVal; function callPreprocessHook(obj) { return (obj && obj['preprocess']) ? (val = obj['preprocess'](val, key, processKeyValue)) : true; } if (!bindingParams) { if (!callPreprocessHook(ko['getBindingHandler'](key))) return; if (twoWayBindings[key] && (writableVal = getWriteableValue(val))) { // For two-way bindings, provide a write method in case the value // isn't a writable observable. propertyAccessorResultStrings.push("'" + key + "':function(_z){" + writableVal + "=_z}"); } } // Values are wrapped in a function so that each value can be accessed independently if (makeValueAccessors) { val = 'function(){return ' + val + ' }'; } resultStrings.push("'" + key + "':" + val); } var resultStrings = [], propertyAccessorResultStrings = [], makeValueAccessors = bindingOptions['valueAccessors'], bindingParams = bindingOptions['bindingParams'], keyValueArray = typeof bindingsStringOrKeyValueArray === "string" ? parseObjectLiteral(bindingsStringOrKeyValueArray) : bindingsStringOrKeyValueArray; ko.utils.arrayForEach(keyValueArray, function(keyValue) { processKeyValue(keyValue.key || keyValue['unknown'], keyValue.value); }); if (propertyAccessorResultStrings.length) processKeyValue('_ko_property_writers', "{" + propertyAccessorResultStrings.join(",") + " }"); return resultStrings.join(","); } return { bindingRewriteValidators: [], twoWayBindings: twoWayBindings, parseObjectLiteral: parseObjectLiteral, preProcessBindings: preProcessBindings, keyValueArrayContainsKey: function(keyValueArray, key) { for (var i = 0; i < keyValueArray.length; i++) if (keyValueArray[i]['key'] == key) return true; return false; }, // Internal, private KO utility for updating model properties from within bindings // property: If the property being updated is (or might be) an observable, pass it here // If it turns out to be a writable observable, it will be written to directly // allBindings: An object with a get method to retrieve bindings in the current execution context. // This will be searched for a '_ko_property_writers' property in case you're writing to a non-observable // key: The key identifying the property to be written. Example: for { hasFocus: myValue }, write to 'myValue' by specifying the key 'hasFocus' // value: The value to be written // checkIfDifferent: If true, and if the property being written is a writable observable, the value will only be written if // it is !== existing value on that writable observable writeValueToProperty: function(property, allBindings, key, value, checkIfDifferent) { if (!property || !ko.isObservable(property)) { var propWriters = allBindings.get('_ko_property_writers'); if (propWriters && propWriters[key]) propWriters[key](value); } else if (ko.isWriteableObservable(property) && (!checkIfDifferent || property.peek() !== value)) { property(value); } } }; })(); ko.exportSymbol('expressionRewriting', ko.expressionRewriting); ko.exportSymbol('expressionRewriting.bindingRewriteValidators', ko.expressionRewriting.bindingRewriteValidators); ko.exportSymbol('expressionRewriting.parseObjectLiteral', ko.expressionRewriting.parseObjectLiteral); ko.exportSymbol('expressionRewriting.preProcessBindings', ko.expressionRewriting.preProcessBindings); // Making bindings explicitly declare themselves as "two way" isn't ideal in the long term (it would be better if // all bindings could use an official 'property writer' API without needing to declare that they might). However, // since this is not, and has never been, a public API (_ko_property_writers was never documented), it's acceptable // as an internal implementation detail in the short term. // For those developers who rely on _ko_property_writers in their custom bindings, we expose _twoWayBindings as an // undocumented feature that makes it relatively easy to upgrade to KO 3.0. However, this is still not an official // public API, and we reserve the right to remove it at any time if we create a real public property writers API. ko.exportSymbol('expressionRewriting._twoWayBindings', ko.expressionRewriting.twoWayBindings); // For backward compatibility, define the following aliases. (Previously, these function names were misleading because // they referred to JSON specifically, even though they actually work with arbitrary JavaScript object literal expressions.) ko.exportSymbol('jsonExpressionRewriting', ko.expressionRewriting); ko.exportSymbol('jsonExpressionRewriting.insertPropertyAccessorsIntoJson', ko.expressionRewriting.preProcessBindings); (function() { // "Virtual elements" is an abstraction on top of the usual DOM API which understands the notion that comment nodes // may be used to represent hierarchy (in addition to the DOM's natural hierarchy). // If you call the DOM-manipulating functions on ko.virtualElements, you will be able to read and write the state // of that virtual hierarchy // // The point of all this is to support containerless templates (e.g., <!-- ko foreach:someCollection -->blah<!-- /ko -->) // without having to scatter special cases all over the binding and templating code. // IE 9 cannot reliably read the "nodeValue" property of a comment node (see https://github.com/SteveSanderson/knockout/issues/186) // but it does give them a nonstandard alternative property called "text" that it can read reliably. Other browsers don't have that property. // So, use node.text where available, and node.nodeValue elsewhere var commentNodesHaveTextProperty = document && document.createComment("test").text === "<!--test-->"; var startCommentRegex = commentNodesHaveTextProperty ? /^<!--\s*ko(?:\s+([\s\S]+))?\s*-->$/ : /^\s*ko(?:\s+([\s\S]+))?\s*$/; var endCommentRegex = commentNodesHaveTextProperty ? /^<!--\s*\/ko\s*-->$/ : /^\s*\/ko\s*$/; var htmlTagsWithOptionallyClosingChildren = { 'ul': true, 'ol': true }; function isStartComment(node) { return (node.nodeType == 8) && startCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue); } function isEndComment(node) { return (node.nodeType == 8) && endCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue); } function getVirtualChildren(startComment, allowUnbalanced) { var currentNode = startComment; var depth = 1; var children = []; while (currentNode = currentNode.nextSibling) { if (isEndComment(currentNode)) { depth--; if (depth === 0) return children; } children.push(currentNode); if (isStartComment(currentNode)) depth++; } if (!allowUnbalanced) throw new Error("Cannot find closing comment tag to match: " + startComment.nodeValue); return null; } function getMatchingEndComment(startComment, allowUnbalanced) { var allVirtualChildren = getVirtualChildren(startComment, allowUnbalanced); if (allVirtualChildren) { if (allVirtualChildren.length > 0) return allVirtualChildren[allVirtualChildren.length - 1].nextSibling; return startComment.nextSibling; } else return null; // Must have no matching end comment, and allowUnbalanced is true } function getUnbalancedChildTags(node) { // e.g., from <div>OK</div><!-- ko blah --><span>Another</span>, returns: <!-- ko blah --><span>Another</span> // from <div>OK</div><!-- /ko --><!-- /ko -->, returns: <!-- /ko --><!-- /ko --> var childNode = node.firstChild, captureRemaining = null; if (childNode) { do { if (captureRemaining) // We already hit an unbalanced node and are now just scooping up all subsequent nodes captureRemaining.push(childNode); else if (isStartComment(childNode)) { var matchingEndComment = getMatchingEndComment(childNode, /* allowUnbalanced: */ true); if (matchingEndComment) // It's a balanced tag, so skip immediately to the end of this virtual set childNode = matchingEndComment; else captureRemaining = [childNode]; // It's unbalanced, so start capturing from this point } else if (isEndComment(childNode)) { captureRemaining = [childNode]; // It's unbalanced (if it wasn't, we'd have skipped over it already), so start capturing } } while (childNode = childNode.nextSibling); } return captureRemaining; } ko.virtualElements = { allowedBindings: {}, childNodes: function(node) { return isStartComment(node) ? getVirtualChildren(node) : node.childNodes; }, emptyNode: function(node) { if (!isStartComment(node)) ko.utils.emptyDomNode(node); else { var virtualChildren = ko.virtualElements.childNodes(node); for (var i = 0, j = virtualChildren.length; i < j; i++) ko.removeNode(virtualChildren[i]); } }, setDomNodeChildren: function(node, childNodes) { if (!isStartComment(node)) ko.utils.setDomNodeChildren(node, childNodes); else { ko.virtualElements.emptyNode(node); var endCommentNode = node.nextSibling; // Must be the next sibling, as we just emptied the children for (var i = 0, j = childNodes.length; i < j; i++) endCommentNode.parentNode.insertBefore(childNodes[i], endCommentNode); } }, prepend: function(containerNode, nodeToPrepend) { if (!isStartComment(containerNode)) { if (containerNode.firstChild) containerNode.insertBefore(nodeToPrepend, containerNode.firstChild); else containerNode.appendChild(nodeToPrepend); } else { // Start comments must always have a parent and at least one following sibling (the end comment) containerNode.parentNode.insertBefore(nodeToPrepend, containerNode.nextSibling); } }, insertAfter: function(containerNode, nodeToInsert, insertAfterNode) { if (!insertAfterNode) { ko.virtualElements.prepend(containerNode, nodeToInsert); } else if (!isStartComment(containerNode)) { // Insert after insertion point if (insertAfterNode.nextSibling) containerNode.insertBefore(nodeToInsert, insertAfterNode.nextSibling); else containerNode.appendChild(nodeToInsert); } else { // Children of start comments must always have a parent and at least one following sibling (the end comment) containerNode.parentNode.insertBefore(nodeToInsert, insertAfterNode.nextSibling); } }, firstChild: function(node) { if (!isStartComment(node)) return node.firstChild; if (!node.nextSibling || isEndComment(node.nextSibling)) return null; return node.nextSibling; }, nextSibling: function(node) { if (isStartComment(node)) node = getMatchingEndComment(node); if (node.nextSibling && isEndComment(node.nextSibling)) return null; return node.nextSibling; }, hasBindingValue: isStartComment, virtualNodeBindingValue: function(node) { var regexMatch = (commentNodesHaveTextProperty ? node.text : node.nodeValue).match(startCommentRegex); return regexMatch ? regexMatch[1] : null; }, normaliseVirtualElementDomStructure: function(elementVerified) { // Workaround for https://github.com/SteveSanderson/knockout/issues/155 // (IE <= 8 or IE 9 quirks mode parses your HTML weirdly, treating closing </li> tags as if they don't exist, thereby moving comment nodes // that are direct descendants of <ul> into the preceding <li>) if (!htmlTagsWithOptionallyClosingChildren[ko.utils.tagNameLower(elementVerified)]) return; // Scan immediate children to see if they contain unbalanced comment tags. If they do, those comment tags // must be intended to appear *after* that child, so move them there. var childNode = elementVerified.firstChild; if (childNode) { do { if (childNode.nodeType === 1) { var unbalancedTags = getUnbalancedChildTags(childNode); if (unbalancedTags) { // Fix up the DOM by moving the unbalanced tags to where they most likely were intended to be placed - *after* the child var nodeToInsertBefore = childNode.nextSibling; for (var i = 0; i < unbalancedTags.length; i++) { if (nodeToInsertBefore) elementVerified.insertBefore(unbalancedTags[i], nodeToInsertBefore); else elementVerified.appendChild(unbalancedTags[i]); } } } } while (childNode = childNode.nextSibling); } } }; })(); ko.exportSymbol('virtualElements', ko.virtualElements); ko.exportSymbol('virtualElements.allowedBindings', ko.virtualElements.allowedBindings); ko.exportSymbol('virtualElements.emptyNode', ko.virtualElements.emptyNode); //ko.exportSymbol('virtualElements.firstChild', ko.virtualElements.firstChild); // firstChild is not minified ko.exportSymbol('virtualElements.insertAfter', ko.virtualElements.insertAfter); //ko.exportSymbol('virtualElements.nextSibling', ko.virtualElements.nextSibling); // nextSibling is not minified ko.exportSymbol('virtualElements.prepend', ko.virtualElements.prepend); ko.exportSymbol('virtualElements.setDomNodeChildren', ko.virtualElements.setDomNodeChildren); (function() { var defaultBindingAttributeName = "data-bind"; ko.bindingProvider = function() { this.bindingCache = {}; }; ko.utils.extend(ko.bindingProvider.prototype, { 'nodeHasBindings': function(node) { switch (node.nodeType) { case 1: // Element return node.getAttribute(defaultBindingAttributeName) != null || ko.components['getComponentNameForNode'](node); case 8: // Comment node return ko.virtualElements.hasBindingValue(node); default: return false; } }, 'getBindings': function(node, bindingContext) { var bindingsString = this['getBindingsString'](node, bindingContext), parsedBindings = bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node) : null; return ko.components.addBindingsForCustomElement(parsedBindings, node, bindingContext, /* valueAccessors */ false); }, 'getBindingAccessors': function(node, bindingContext) { var bindingsString = this['getBindingsString'](node, bindingContext), parsedBindings = bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node, { 'valueAccessors': true }) : null; return ko.components.addBindingsForCustomElement(parsedBindings, node, bindingContext, /* valueAccessors */ true); }, // The following function is only used internally by this default provider. // It's not part of the interface definition for a general binding provider. 'getBindingsString': function(node, bindingContext) { switch (node.nodeType) { case 1: return node.getAttribute(defaultBindingAttributeName); // Element case 8: return ko.virtualElements.virtualNodeBindingValue(node); // Comment node default: return null; } }, // The following function is only used internally by this default provider. // It's not part of the interface definition for a general binding provider. 'parseBindingsString': function(bindingsString, bindingContext, node, options) { try { var bindingFunction = createBindingsStringEvaluatorViaCache(bindingsString, this.bindingCache, options); return bindingFunction(bindingContext, node); } catch (ex) { ex.message = "Unable to parse bindings.\nBindings value: " + bindingsString + "\nMessage: " + ex.message; throw ex; } } }); ko.bindingProvider['instance'] = new ko.bindingProvider(); function createBindingsStringEvaluatorViaCache(bindingsString, cache, options) { var cacheKey = bindingsString + (options && options['valueAccessors'] || ''); return cache[cacheKey] || (cache[cacheKey] = createBindingsStringEvaluator(bindingsString, options)); } function createBindingsStringEvaluator(bindingsString, options) { // Build the source for a function that evaluates "expression" // For each scope variable, add an extra level of "with" nesting // Example result: with(sc1) { with(sc0) { return (expression) } } var rewrittenBindings = ko.expressionRewriting.preProcessBindings(bindingsString, options), functionBody = "with($context){with($data||{}){return{" + rewrittenBindings + "}}}"; return new Function("$context", "$element", functionBody); } })(); ko.exportSymbol('bindingProvider', ko.bindingProvider); (function () { ko.bindingHandlers = {}; // The following element types will not be recursed into during binding. In the future, we // may consider adding <template> to this list, because such elements' contents are always // intended to be bound in a different context from where they appear in the document. var bindingDoesNotRecurseIntoElementTypes = { // Don't want bindings that operate on text nodes to mutate <script> contents, // because it's unexpected and a potential XSS issue 'script': true }; // Use an overridable method for retrieving binding handlers so that a plugins may support dynamically created handlers ko['getBindingHandler'] = function(bindingKey) { return ko.bindingHandlers[bindingKey]; }; // The ko.bindingContext constructor is only called directly to create the root context. For child // contexts, use bindingContext.createChildContext or bindingContext.extend. ko.bindingContext = function(dataItemOrAccessor, parentContext, dataItemAlias, extendCallback) { // The binding context object includes static properties for the current, parent, and root view models. // If a view model is actually stored in an observable, the corresponding binding context object, and // any child contexts, must be updated when the view model is changed. function updateContext() { // Most of the time, the context will directly get a view model object, but if a function is given, // we call the function to retrieve the view model. If the function accesses any obsevables or returns // an observable, the dependency is tracked, and those observables can later cause the binding // context to be updated. var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor, dataItem = ko.utils.unwrapObservable(dataItemOrObservable); if (parentContext) { // When a "parent" context is given, register a dependency on the parent context. Thus whenever the // parent context is updated, this context will also be updated. if (parentContext._subscribable) parentContext._subscribable(); // Copy $root and any custom properties from the parent context ko.utils.extend(self, parentContext); // Because the above copy overwrites our own properties, we need to reset them. // During the first execution, "subscribable" isn't set, so don't bother doing the update then. if (subscribable) { self._subscribable = subscribable; } } else { self['$parents'] = []; self['$root'] = dataItem; // Export 'ko' in the binding context so it will be available in bindings and templates // even if 'ko' isn't exported as a global, such as when using an AMD loader. // See https://github.com/SteveSanderson/knockout/issues/490 self['ko'] = ko; } self['$rawData'] = dataItemOrObservable; self['$data'] = dataItem; if (dataItemAlias) self[dataItemAlias] = dataItem; // The extendCallback function is provided when creating a child context or extending a context. // It handles the specific actions needed to finish setting up the binding context. Actions in this // function could also add dependencies to this binding context. if (extendCallback) extendCallback(self, parentContext, dataItem); return self['$data']; } function disposeWhen() { return nodes && !ko.utils.anyDomNodeIsAttachedToDocument(nodes); } var self = this, isFunc = typeof(dataItemOrAccessor) == "function" && !ko.isObservable(dataItemOrAccessor), nodes, subscribable = ko.dependentObservable(updateContext, null, { disposeWhen: disposeWhen, disposeWhenNodeIsRemoved: true }); // At this point, the binding context has been initialized, and the "subscribable" computed observable is // subscribed to any observables that were accessed in the process. If there is nothing to track, the // computed will be inactive, and we can safely throw it away. If it's active, the computed is stored in // the context object. if (subscribable.isActive()) { self._subscribable = subscribable; // Always notify because even if the model ($data) hasn't changed, other context properties might have changed subscribable['equalityComparer'] = null; // We need to be able to dispose of this computed observable when it's no longer needed. This would be // easy if we had a single node to watch, but binding contexts can be used by many different nodes, and // we cannot assume that those nodes have any relation to each other. So instead we track any node that // the context is attached to, and dispose the computed when all of those nodes have been cleaned. // Add properties to *subscribable* instead of *self* because any properties added to *self* may be overwritten on updates nodes = []; subscribable._addNode = function(node) { nodes.push(node); ko.utils.domNodeDisposal.addDisposeCallback(node, function(node) { ko.utils.arrayRemoveItem(nodes, node); if (!nodes.length) { subscribable.dispose(); self._subscribable = subscribable = undefined; } }); }; } } // Extend the binding context hierarchy with a new view model object. If the parent context is watching // any obsevables, the new child context will automatically get a dependency on the parent context. // But this does not mean that the $data value of the child context will also get updated. If the child // view model also depends on the parent view model, you must provide a function that returns the correct // view model on each update. ko.bindingContext.prototype['createChildContext'] = function (dataItemOrAccessor, dataItemAlias, extendCallback) { return new ko.bindingContext(dataItemOrAccessor, this, dataItemAlias, function(self, parentContext) { // Extend the context hierarchy by setting the appropriate pointers self['$parentContext'] = parentContext; self['$parent'] = parentContext['$data']; self['$parents'] = (parentContext['$parents'] || []).slice(0); self['$parents'].unshift(self['$parent']); if (extendCallback) extendCallback(self); }); }; // Extend the binding context with new custom properties. This doesn't change the context hierarchy. // Similarly to "child" contexts, provide a function here to make sure that the correct values are set // when an observable view model is updated. ko.bindingContext.prototype['extend'] = function(properties) { // If the parent context references an observable view model, "_subscribable" will always be the // latest view model object. If not, "_subscribable" isn't set, and we can use the static "$data" value. return new ko.bindingContext(this._subscribable || this['$data'], this, null, function(self, parentContext) { // This "child" context doesn't directly track a parent observable view model, // so we need to manually set the $rawData value to match the parent. self['$rawData'] = parentContext['$rawData']; ko.utils.extend(self, typeof(properties) == "function" ? properties() : properties); }); }; // Returns the valueAccesor function for a binding value function makeValueAccessor(value) { return function() { return value; }; } // Returns the value of a valueAccessor function function evaluateValueAccessor(valueAccessor) { return valueAccessor(); } // Given a function that returns bindings, create and return a new object that contains // binding value-accessors functions. Each accessor function calls the original function // so that it always gets the latest value and all dependencies are captured. This is used // by ko.applyBindingsToNode and getBindingsAndMakeAccessors. function makeAccessorsFromFunction(callback) { return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) { return function() { return callback()[key]; }; }); } // Given a bindings function or object, create and return a new object that contains // binding value-accessors functions. This is used by ko.applyBindingsToNode. function makeBindingAccessors(bindings, context, node) { if (typeof bindings === 'function') { return makeAccessorsFromFunction(bindings.bind(null, context, node)); } else { return ko.utils.objectMap(bindings, makeValueAccessor); } } // This function is used if the binding provider doesn't include a getBindingAccessors function. // It must be called with 'this' set to the provider instance. function getBindingsAndMakeAccessors(node, context) { return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context)); } function validateThatBindingIsAllowedForVirtualElements(bindingName) { var validator = ko.virtualElements.allowedBindings[bindingName]; if (!validator) throw new Error("The binding '" + bindingName + "' cannot be used with virtual elements") } function applyBindingsToDescendantsInternal (bindingContext, elementOrVirtualElement, bindingContextsMayDifferFromDomParentElement) { var currentChild, nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement), provider = ko.bindingProvider['instance'], preprocessNode = provider['preprocessNode']; // Preprocessing allows a binding provider to mutate a node before bindings are applied to it. For example it's // possible to insert new siblings after it, and/or replace the node with a different one. This can be used to // implement custom binding syntaxes, such as {{ value }} for string interpolation, or custom element types that // trigger insertion of <template> contents at that point in the document. if (preprocessNode) { while (currentChild = nextInQueue) { nextInQueue = ko.virtualElements.nextSibling(currentChild); preprocessNode.call(provider, currentChild); } // Reset nextInQueue for the next loop nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement); } while (currentChild = nextInQueue) { // Keep a record of the next child *before* applying bindings, in case the binding removes the current child from its position nextInQueue = ko.virtualElements.nextSibling(currentChild); applyBindingsToNodeAndDescendantsInternal(bindingContext, currentChild, bindingContextsMayDifferFromDomParentElement); } } function applyBindingsToNodeAndDescendantsInternal (bindingContext, nodeVerified, bindingContextMayDifferFromDomParentElement) { var shouldBindDescendants = true; // Perf optimisation: Apply bindings only if... // (1) We need to store the binding context on this node (because it may differ from the DOM parent node's binding context) // Note that we can't store binding contexts on non-elements (e.g., text nodes), as IE doesn't allow expando properties for those // (2) It might have bindings (e.g., it has a data-bind attribute, or it's a marker for a containerless template) var isElement = (nodeVerified.nodeType === 1); if (isElement) // Workaround IE <= 8 HTML parsing weirdness ko.virtualElements.normaliseVirtualElementDomStructure(nodeVerified); var shouldApplyBindings = (isElement && bindingContextMayDifferFromDomParentElement) // Case (1) || ko.bindingProvider['instance']['nodeHasBindings'](nodeVerified); // Case (2) if (shouldApplyBindings) shouldBindDescendants = applyBindingsToNodeInternal(nodeVerified, null, bindingContext, bindingContextMayDifferFromDomParentElement)['shouldBindDescendants']; if (shouldBindDescendants && !bindingDoesNotRecurseIntoElementTypes[ko.utils.tagNameLower(nodeVerified)]) { // We're recursing automatically into (real or virtual) child nodes without changing binding contexts. So, // * For children of a *real* element, the binding context is certainly the same as on their DOM .parentNode, // hence bindingContextsMayDifferFromDomParentElement is false // * For children of a *virtual* element, we can't be sure. Evaluating .parentNode on those children may // skip over any number of intermediate virtual elements, any of which might define a custom binding context, // hence bindingContextsMayDifferFromDomParentElement is true applyBindingsToDescendantsInternal(bindingContext, nodeVerified, /* bindingContextsMayDifferFromDomParentElement: */ !isElement); } } var boundElementDomDataKey = ko.utils.domData.nextKey(); function topologicalSortBindings(bindings) { // Depth-first sort var result = [], // The list of key/handler pairs that we will return bindingsConsidered = {}, // A temporary record of which bindings are already in 'result' cyclicDependencyStack = []; // Keeps track of a depth-search so that, if there's a cycle, we know which bindings caused it ko.utils.objectForEach(bindings, function pushBinding(bindingKey) { if (!bindingsConsidered[bindingKey]) { var binding = ko['getBindingHandler'](bindingKey); if (binding) { // First add dependencies (if any) of the current binding if (binding['after']) { cyclicDependencyStack.push(bindingKey); ko.utils.arrayForEach(binding['after'], function(bindingDependencyKey) { if (bindings[bindingDependencyKey]) { if (ko.utils.arrayIndexOf(cyclicDependencyStack, bindingDependencyKey) !== -1) { throw Error("Cannot combine the following bindings, because they have a cyclic dependency: " + cyclicDependencyStack.join(", ")); } else { pushBinding(bindingDependencyKey); } } }); cyclicDependencyStack.length--; } // Next add the current binding result.push({ key: bindingKey, handler: binding }); } bindingsConsidered[bindingKey] = true; } }); return result; } function applyBindingsToNodeInternal(node, sourceBindings, bindingContext, bindingContextMayDifferFromDomParentElement) { // Prevent multiple applyBindings calls for the same node, except when a binding value is specified var alreadyBound = ko.utils.domData.get(node, boundElementDomDataKey); if (!sourceBindings) { if (alreadyBound) { throw Error("You cannot apply bindings multiple times to the same element."); } ko.utils.domData.set(node, boundElementDomDataKey, true); } // Optimization: Don't store the binding context on this node if it's definitely the same as on node.parentNode, because // we can easily recover it just by scanning up the node's ancestors in the DOM // (note: here, parent node means "real DOM parent" not "virtual parent", as there's no O(1) way to find the virtual parent) if (!alreadyBound && bindingContextMayDifferFromDomParentElement) ko.storedBindingContextForNode(node, bindingContext); // Use bindings if given, otherwise fall back on asking the bindings provider to give us some bindings var bindings; if (sourceBindings && typeof sourceBindings !== 'function') { bindings = sourceBindings; } else { var provider = ko.bindingProvider['instance'], getBindings = provider['getBindingAccessors'] || getBindingsAndMakeAccessors; // Get the binding from the provider within a computed observable so that we can update the bindings whenever // the binding context is updated or if the binding provider accesses observables. var bindingsUpdater = ko.dependentObservable( function() { bindings = sourceBindings ? sourceBindings(bindingContext, node) : getBindings.call(provider, node, bindingContext); // Register a dependency on the binding context to support obsevable view models. if (bindings && bindingContext._subscribable) bindingContext._subscribable(); return bindings; }, null, { disposeWhenNodeIsRemoved: node } ); if (!bindings || !bindingsUpdater.isActive()) bindingsUpdater = null; } var bindingHandlerThatControlsDescendantBindings; if (bindings) { // Return the value accessor for a given binding. When bindings are static (won't be updated because of a binding // context update), just return the value accessor from the binding. Otherwise, return a function that always gets // the latest binding value and registers a dependency on the binding updater. var getValueAccessor = bindingsUpdater ? function(bindingKey) { return function() { return evaluateValueAccessor(bindingsUpdater()[bindingKey]); }; } : function(bindingKey) { return bindings[bindingKey]; }; // Use of allBindings as a function is maintained for backwards compatibility, but its use is deprecated function allBindings() { return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor); } // The following is the 3.x allBindings API allBindings['get'] = function(key) { return bindings[key] && evaluateValueAccessor(getValueAccessor(key)); }; allBindings['has'] = function(key) { return key in bindings; }; // First put the bindings into the right order var orderedBindings = topologicalSortBindings(bindings); // Go through the sorted bindings, calling init and update for each ko.utils.arrayForEach(orderedBindings, function(bindingKeyAndHandler) { // Note that topologicalSortBindings has already filtered out any nonexistent binding handlers, // so bindingKeyAndHandler.handler will always be nonnull. var handlerInitFn = bindingKeyAndHandler.handler["init"], handlerUpdateFn = bindingKeyAndHandler.handler["update"], bindingKey = bindingKeyAndHandler.key; if (node.nodeType === 8) { validateThatBindingIsAllowedForVirtualElements(bindingKey); } try { // Run init, ignoring any dependencies if (typeof handlerInitFn == "function") { ko.dependencyDetection.ignore(function() { var initResult = handlerInitFn(node, getValueAccessor(bindingKey), allBindings, bindingContext['$data'], bindingContext); // If this binding handler claims to control descendant bindings, make a note of this if (initResult && initResult['controlsDescendantBindings']) { if (bindingHandlerThatControlsDescendantBindings !== undefined) throw new Error("Multiple bindings (" + bindingHandlerThatControlsDescendantBindings + " and " + bindingKey + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element."); bindingHandlerThatControlsDescendantBindings = bindingKey; } }); } // Run update in its own computed wrapper if (typeof handlerUpdateFn == "function") { ko.dependentObservable( function() { handlerUpdateFn(node, getValueAccessor(bindingKey), allBindings, bindingContext['$data'], bindingContext); }, null, { disposeWhenNodeIsRemoved: node } ); } } catch (ex) { ex.message = "Unable to process binding \"" + bindingKey + ": " + bindings[bindingKey] + "\"\nMessage: " + ex.message; throw ex; } }); } return { 'shouldBindDescendants': bindingHandlerThatControlsDescendantBindings === undefined }; }; var storedBindingContextDomDataKey = ko.utils.domData.nextKey(); ko.storedBindingContextForNode = function (node, bindingContext) { if (arguments.length == 2) { ko.utils.domData.set(node, storedBindingContextDomDataKey, bindingContext); if (bindingContext._subscribable) bindingContext._subscribable._addNode(node); } else { return ko.utils.domData.get(node, storedBindingContextDomDataKey); } } function getBindingContext(viewModelOrBindingContext) { return viewModelOrBindingContext && (viewModelOrBindingContext instanceof ko.bindingContext) ? viewModelOrBindingContext : new ko.bindingContext(viewModelOrBindingContext); } ko.applyBindingAccessorsToNode = function (node, bindings, viewModelOrBindingContext) { if (node.nodeType === 1) // If it's an element, workaround IE <= 8 HTML parsing weirdness ko.virtualElements.normaliseVirtualElementDomStructure(node); return applyBindingsToNodeInternal(node, bindings, getBindingContext(viewModelOrBindingContext), true); }; ko.applyBindingsToNode = function (node, bindings, viewModelOrBindingContext) { var context = getBindingContext(viewModelOrBindingContext); return ko.applyBindingAccessorsToNode(node, makeBindingAccessors(bindings, context, node), context); }; ko.applyBindingsToDescendants = function(viewModelOrBindingContext, rootNode) { if (rootNode.nodeType === 1 || rootNode.nodeType === 8) applyBindingsToDescendantsInternal(getBindingContext(viewModelOrBindingContext), rootNode, true); }; ko.applyBindings = function (viewModelOrBindingContext, rootNode) { // If jQuery is loaded after Knockout, we won't initially have access to it. So save it here. if (!jQueryInstance && window['jQuery']) { jQueryInstance = window['jQuery']; } if (rootNode && (rootNode.nodeType !== 1) && (rootNode.nodeType !== 8)) throw new Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"); rootNode = rootNode || window.document.body; // Make "rootNode" parameter optional applyBindingsToNodeAndDescendantsInternal(getBindingContext(viewModelOrBindingContext), rootNode, true); }; // Retrieving binding context from arbitrary nodes ko.contextFor = function(node) { // We can only do something meaningful for elements and comment nodes (in particular, not text nodes, as IE can't store domdata for them) switch (node.nodeType) { case 1: case 8: var context = ko.storedBindingContextForNode(node); if (context) return context; if (node.parentNode) return ko.contextFor(node.parentNode); break; } return undefined; }; ko.dataFor = function(node) { var context = ko.contextFor(node); return context ? context['$data'] : undefined; }; ko.exportSymbol('bindingHandlers', ko.bindingHandlers); ko.exportSymbol('applyBindings', ko.applyBindings); ko.exportSymbol('applyBindingsToDescendants', ko.applyBindingsToDescendants); ko.exportSymbol('applyBindingAccessorsToNode', ko.applyBindingAccessorsToNode); ko.exportSymbol('applyBindingsToNode', ko.applyBindingsToNode); ko.exportSymbol('contextFor', ko.contextFor); ko.exportSymbol('dataFor', ko.dataFor); })(); (function(undefined) { var loadingSubscribablesCache = {}, // Tracks component loads that are currently in flight loadedDefinitionsCache = {}; // Tracks component loads that have already completed ko.components = { get: function(componentName, callback) { var cachedDefinition = getObjectOwnProperty(loadedDefinitionsCache, componentName); if (cachedDefinition) { // It's already loaded and cached. Reuse the same definition object. // Note that for API consistency, even cache hits complete asynchronously. setTimeout(function() { callback(cachedDefinition) }, 0); } else { // Join the loading process that is already underway, or start a new one. loadComponentAndNotify(componentName, callback); } }, clearCachedDefinition: function(componentName) { delete loadedDefinitionsCache[componentName]; }, _getFirstResultFromLoaders: getFirstResultFromLoaders }; function getObjectOwnProperty(obj, propName) { return obj.hasOwnProperty(propName) ? obj[propName] : undefined; } function loadComponentAndNotify(componentName, callback) { var subscribable = getObjectOwnProperty(loadingSubscribablesCache, componentName), completedAsync; if (!subscribable) { // It's not started loading yet. Start loading, and when it's done, move it to loadedDefinitionsCache. subscribable = loadingSubscribablesCache[componentName] = new ko.subscribable(); beginLoadingComponent(componentName, function(definition) { loadedDefinitionsCache[componentName] = definition; delete loadingSubscribablesCache[componentName]; // For API consistency, all loads complete asynchronously. However we want to avoid // adding an extra setTimeout if it's unnecessary (i.e., the completion is already // async) since setTimeout(..., 0) still takes about 16ms or more on most browsers. if (completedAsync) { subscribable['notifySubscribers'](definition); } else { setTimeout(function() { subscribable['notifySubscribers'](definition); }, 0); } }); completedAsync = true; } subscribable.subscribe(callback); } function beginLoadingComponent(componentName, callback) { getFirstResultFromLoaders('getConfig', [componentName], function(config) { if (config) { // We have a config, so now load its definition getFirstResultFromLoaders('loadComponent', [componentName, config], function(definition) { callback(definition); }); } else { // The component has no config - it's unknown to all the loaders. // Note that this is not an error (e.g., a module loading error) - that would abort the // process and this callback would not run. For this callback to run, all loaders must // have confirmed they don't know about this component. callback(null); } }); } function getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders) { // On the first call in the stack, start with the full set of loaders if (!candidateLoaders) { candidateLoaders = ko.components['loaders'].slice(0); // Use a copy, because we'll be mutating this array } // Try the next candidate var currentCandidateLoader = candidateLoaders.shift(); if (currentCandidateLoader) { var methodInstance = currentCandidateLoader[methodName]; if (methodInstance) { var wasAborted = false, synchronousReturnValue = methodInstance.apply(currentCandidateLoader, argsExceptCallback.concat(function(result) { if (wasAborted) { callback(null); } else if (result !== null) { // This candidate returned a value. Use it. callback(result); } else { // Try the next candidate getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders); } })); // Currently, loaders may not return anything synchronously. This leaves open the possibility // that we'll extend the API to support synchronous return values in the future. It won't be // a breaking change, because currently no loader is allowed to return anything except undefined. if (synchronousReturnValue !== undefined) { wasAborted = true; // Method to suppress exceptions will remain undocumented. This is only to keep // KO's specs running tidily, since we can observe the loading got aborted without // having exceptions cluttering up the console too. if (!currentCandidateLoader['suppressLoaderExceptions']) { throw new Error('Component loaders must supply values by invoking the callback, not by returning values synchronously.'); } } } else { // This candidate doesn't have the relevant handler. Synchronously move on to the next one. getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders); } } else { // No candidates returned a value callback(null); } } // Reference the loaders via string name so it's possible for developers // to replace the whole array by assigning to ko.components.loaders ko.components['loaders'] = []; ko.exportSymbol('components', ko.components); ko.exportSymbol('components.get', ko.components.get); ko.exportSymbol('components.clearCachedDefinition', ko.components.clearCachedDefinition); })(); (function(undefined) { // The default loader is responsible for two things: // 1. Maintaining the default in-memory registry of component configuration objects // (i.e., the thing you're writing to when you call ko.components.register(someName, ...)) // 2. Answering requests for components by fetching configuration objects // from that default in-memory registry and resolving them into standard // component definition objects (of the form { createViewModel: ..., template: ... }) // Custom loaders may override either of these facilities, i.e., // 1. To supply configuration objects from some other source (e.g., conventions) // 2. Or, to resolve configuration objects by loading viewmodels/templates via arbitrary logic. var defaultConfigRegistry = {}; ko.components.register = function(componentName, config) { if (!config) { throw new Error('Invalid configuration for ' + componentName); } if (ko.components.isRegistered(componentName)) { throw new Error('Component ' + componentName + ' is already registered'); } defaultConfigRegistry[componentName] = config; } ko.components.isRegistered = function(componentName) { return componentName in defaultConfigRegistry; } ko.components.unregister = function(componentName) { delete defaultConfigRegistry[componentName]; ko.components.clearCachedDefinition(componentName); } ko.components.defaultLoader = { 'getConfig': function(componentName, callback) { var result = defaultConfigRegistry.hasOwnProperty(componentName) ? defaultConfigRegistry[componentName] : null; callback(result); }, 'loadComponent': function(componentName, config, callback) { var errorCallback = makeErrorCallback(componentName); possiblyGetConfigFromAmd(errorCallback, config, function(loadedConfig) { resolveConfig(componentName, errorCallback, loadedConfig, callback); }); }, 'loadTemplate': function(componentName, templateConfig, callback) { resolveTemplate(makeErrorCallback(componentName), templateConfig, callback); }, 'loadViewModel': function(componentName, viewModelConfig, callback) { resolveViewModel(makeErrorCallback(componentName), viewModelConfig, callback); } }; var createViewModelKey = 'createViewModel'; // Takes a config object of the form { template: ..., viewModel: ... }, and asynchronously convert it // into the standard component definition format: // { template: <ArrayOfDomNodes>, createViewModel: function(params, componentInfo) { ... } }. // Since both template and viewModel may need to be resolved asynchronously, both tasks are performed // in parallel, and the results joined when both are ready. We don't depend on any promises infrastructure, // so this is implemented manually below. function resolveConfig(componentName, errorCallback, config, callback) { var result = {}, makeCallBackWhenZero = 2, tryIssueCallback = function() { if (--makeCallBackWhenZero === 0) { callback(result); } }, templateConfig = config['template'], viewModelConfig = config['viewModel']; if (templateConfig) { possiblyGetConfigFromAmd(errorCallback, templateConfig, function(loadedConfig) { ko.components._getFirstResultFromLoaders('loadTemplate', [componentName, loadedConfig], function(resolvedTemplate) { result['template'] = resolvedTemplate; tryIssueCallback(); }); }); } else { tryIssueCallback(); } if (viewModelConfig) { possiblyGetConfigFromAmd(errorCallback, viewModelConfig, function(loadedConfig) { ko.components._getFirstResultFromLoaders('loadViewModel', [componentName, loadedConfig], function(resolvedViewModel) { result[createViewModelKey] = resolvedViewModel; tryIssueCallback(); }); }); } else { tryIssueCallback(); } } function resolveTemplate(errorCallback, templateConfig, callback) { if (typeof templateConfig === 'string') { // Markup - parse it callback(ko.utils.parseHtmlFragment(templateConfig)); } else if (templateConfig instanceof Array) { // Assume already an array of DOM nodes - pass through unchanged callback(templateConfig); } else if (isDocumentFragment(templateConfig)) { // Document fragment - use its child nodes callback(ko.utils.makeArray(templateConfig.childNodes)); } else if (templateConfig['element']) { var element = templateConfig['element']; if (isDomElement(element)) { // Element instance - copy its child nodes callback(cloneNodesFromTemplateSourceElement(element)); } else if (typeof element === 'string') { // Element ID - find it, then copy its child nodes var elemInstance = document.getElementById(element); if (elemInstance) { callback(cloneNodesFromTemplateSourceElement(elemInstance)); } else { errorCallback('Cannot find element with ID ' + element); } } else { errorCallback('Unknown element type: ' + element); } } else { errorCallback('Unknown template value: ' + templateConfig); } } function resolveViewModel(errorCallback, viewModelConfig, callback) { if (typeof viewModelConfig === 'function') { // Constructor - convert to standard factory function format // By design, this does *not* supply componentInfo to the constructor, as the intent is that // componentInfo contains non-viewmodel data (e.g., the component's element) that should only // be used in factory functions, not viewmodel constructors. callback(function (params /*, componentInfo */) { return new viewModelConfig(params); }); } else if (typeof viewModelConfig[createViewModelKey] === 'function') { // Already a factory function - use it as-is callback(viewModelConfig[createViewModelKey]); } else if ('instance' in viewModelConfig) { // Fixed object instance - promote to createViewModel format for API consistency var fixedInstance = viewModelConfig['instance']; callback(function (params, componentInfo) { return fixedInstance; }); } else if ('viewModel' in viewModelConfig) { // Resolved AMD module whose value is of the form { viewModel: ... } resolveViewModel(errorCallback, viewModelConfig['viewModel'], callback); } else { errorCallback('Unknown viewModel value: ' + viewModelConfig); } } function cloneNodesFromTemplateSourceElement(elemInstance) { switch (ko.utils.tagNameLower(elemInstance)) { case 'script': return ko.utils.parseHtmlFragment(elemInstance.text); case 'textarea': return ko.utils.parseHtmlFragment(elemInstance.value); case 'template': // For browsers with proper <template> element support (i.e., where the .content property // gives a document fragment), use that document fragment. if (isDocumentFragment(elemInstance.content)) { return ko.utils.cloneNodes(elemInstance.content.childNodes); } } // Regular elements such as <div>, and <template> elements on old browsers that don't really // understand <template> and just treat it as a regular container return ko.utils.cloneNodes(elemInstance.childNodes); } function isDomElement(obj) { if (window['HTMLElement']) { return obj instanceof HTMLElement; } else { return obj && obj.tagName && obj.nodeType === 1; } } function isDocumentFragment(obj) { if (window['DocumentFragment']) { return obj instanceof DocumentFragment; } else { return obj && obj.nodeType === 11; } } function possiblyGetConfigFromAmd(errorCallback, config, callback) { if (typeof config['require'] === 'string') { // The config is the value of an AMD module if (require || window['require']) { (require || window['require'])([config['require']], callback); } else { errorCallback('Uses require, but no AMD loader is present'); } } else { callback(config); } } function makeErrorCallback(componentName) { return function (message) { throw new Error('Component \'' + componentName + '\': ' + message); }; } ko.exportSymbol('components.register', ko.components.register); ko.exportSymbol('components.isRegistered', ko.components.isRegistered); ko.exportSymbol('components.unregister', ko.components.unregister); // Expose the default loader so that developers can directly ask it for configuration // or to resolve configuration ko.exportSymbol('components.defaultLoader', ko.components.defaultLoader); // By default, the default loader is the only registered component loader ko.components['loaders'].push(ko.components.defaultLoader); // Privately expose the underlying config registry for use in old-IE shim ko.components._allRegisteredComponents = defaultConfigRegistry; })(); (function (undefined) { // Overridable API for determining which component name applies to a given node. By overriding this, // you can for example map specific tagNames to components that are not preregistered. ko.components['getComponentNameForNode'] = function(node) { var tagNameLower = ko.utils.tagNameLower(node); return ko.components.isRegistered(tagNameLower) && tagNameLower; }; ko.components.addBindingsForCustomElement = function(allBindings, node, bindingContext, valueAccessors) { // Determine if it's really a custom element matching a component if (node.nodeType === 1) { var componentName = ko.components['getComponentNameForNode'](node); if (componentName) { // It does represent a component, so add a component binding for it allBindings = allBindings || {}; if (allBindings['component']) { // Avoid silently overwriting some other 'component' binding that may already be on the element throw new Error('Cannot use the "component" binding on a custom element matching a component'); } var componentBindingValue = { 'name': componentName, 'params': getComponentParamsFromCustomElement(node, bindingContext) }; allBindings['component'] = valueAccessors ? function() { return componentBindingValue; } : componentBindingValue; } } return allBindings; } var nativeBindingProviderInstance = new ko.bindingProvider(); function getComponentParamsFromCustomElement(elem, bindingContext) { var paramsAttribute = elem.getAttribute('params'); if (paramsAttribute) { var params = nativeBindingProviderInstance['parseBindingsString'](paramsAttribute, bindingContext, elem, { 'valueAccessors': true, 'bindingParams': true }), rawParamComputedValues = ko.utils.objectMap(params, function(paramValue, paramName) { return ko.computed(paramValue, null, { disposeWhenNodeIsRemoved: elem }); }), result = ko.utils.objectMap(rawParamComputedValues, function(paramValueComputed, paramName) { // Does the evaluation of the parameter value unwrap any observables? if (!paramValueComputed.isActive()) { // No it doesn't, so there's no need for any computed wrapper. Just pass through the supplied value directly. // Example: "someVal: firstName, age: 123" (whether or not firstName is an observable/computed) return paramValueComputed.peek(); } else { // Yes it does. Supply a computed property that unwraps both the outer (binding expression) // level of observability, and any inner (resulting model value) level of observability. // This means the component doesn't have to worry about multiple unwrapping. return ko.computed(function() { return ko.utils.unwrapObservable(paramValueComputed()); }, null, { disposeWhenNodeIsRemoved: elem }); } }); // Give access to the raw computeds, as long as that wouldn't overwrite any custom param also called '$raw' // This is in case the developer wants to react to outer (binding) observability separately from inner // (model value) observability, or in case the model value observable has subobservables. if (!result.hasOwnProperty('$raw')) { result['$raw'] = rawParamComputedValues; } return result; } else { // For consistency, absence of a "params" attribute is treated the same as the presence of // any empty one. Otherwise component viewmodels need special code to check whether or not // 'params' or 'params.$raw' is null/undefined before reading subproperties, which is annoying. return { '$raw': {} }; } } // -------------------------------------------------------------------------------- // Compatibility code for older (pre-HTML5) IE browsers if (ko.utils.ieVersion < 9) { // Whenever you preregister a component, enable it as a custom element in the current document ko.components['register'] = (function(originalFunction) { return function(componentName) { document.createElement(componentName); // Allows IE<9 to parse markup containing the custom element return originalFunction.apply(this, arguments); } })(ko.components['register']); // Whenever you create a document fragment, enable all preregistered component names as custom elements // This is needed to make innerShiv/jQuery HTML parsing correctly handle the custom elements document.createDocumentFragment = (function(originalFunction) { return function() { var newDocFrag = originalFunction(), allComponents = ko.components._allRegisteredComponents; for (var componentName in allComponents) { if (allComponents.hasOwnProperty(componentName)) { newDocFrag.createElement(componentName); } } return newDocFrag; }; })(document.createDocumentFragment); } })();(function(undefined) { var componentLoadingOperationUniqueId = 0; ko.bindingHandlers['component'] = { 'init': function(element, valueAccessor, ignored1, ignored2, bindingContext) { var currentViewModel, currentLoadingOperationId, disposeAssociatedComponentViewModel = function () { var currentViewModelDispose = currentViewModel && currentViewModel['dispose']; if (typeof currentViewModelDispose === 'function') { currentViewModelDispose.call(currentViewModel); } // Any in-flight loading operation is no longer relevant, so make sure we ignore its completion currentLoadingOperationId = null; }; ko.utils.domNodeDisposal.addDisposeCallback(element, disposeAssociatedComponentViewModel); ko.computed(function () { var value = ko.utils.unwrapObservable(valueAccessor()), componentName, componentParams; if (typeof value === 'string') { componentName = value; } else { componentName = ko.utils.unwrapObservable(value['name']); componentParams = ko.utils.unwrapObservable(value['params']); } if (!componentName) { throw new Error('No component name specified'); } var loadingOperationId = currentLoadingOperationId = ++componentLoadingOperationUniqueId; ko.components.get(componentName, function(componentDefinition) { // If this is not the current load operation for this element, ignore it. if (currentLoadingOperationId !== loadingOperationId) { return; } // Clean up previous state disposeAssociatedComponentViewModel(); // Instantiate and bind new component. Implicitly this cleans any old DOM nodes. if (!componentDefinition) { throw new Error('Unknown component \'' + componentName + '\''); } cloneTemplateIntoElement(componentName, componentDefinition, element); var componentViewModel = createViewModel(componentDefinition, element, componentParams), childBindingContext = bindingContext['createChildContext'](componentViewModel); currentViewModel = componentViewModel; ko.applyBindingsToDescendants(childBindingContext, element); }); }, null, { disposeWhenNodeIsRemoved: element }); return { 'controlsDescendantBindings': true }; } }; ko.virtualElements.allowedBindings['component'] = true; function cloneTemplateIntoElement(componentName, componentDefinition, element) { var template = componentDefinition['template']; if (!template) { throw new Error('Component \'' + componentName + '\' has no template'); } var clonedNodesArray = ko.utils.cloneNodes(template); ko.virtualElements.setDomNodeChildren(element, clonedNodesArray); } function createViewModel(componentDefinition, element, componentParams) { var componentViewModelFactory = componentDefinition['createViewModel']; return componentViewModelFactory ? componentViewModelFactory.call(componentDefinition, componentParams, { element: element }) : componentParams; // Template-only component } })(); var attrHtmlToJavascriptMap = { 'class': 'className', 'for': 'htmlFor' }; ko.bindingHandlers['attr'] = { 'update': function(element, valueAccessor, allBindings) { var value = ko.utils.unwrapObservable(valueAccessor()) || {}; ko.utils.objectForEach(value, function(attrName, attrValue) { attrValue = ko.utils.unwrapObservable(attrValue); // To cover cases like "attr: { checked:someProp }", we want to remove the attribute entirely // when someProp is a "no value"-like value (strictly null, false, or undefined) // (because the absence of the "checked" attr is how to mark an element as not checked, etc.) var toRemove = (attrValue === false) || (attrValue === null) || (attrValue === undefined); if (toRemove) element.removeAttribute(attrName); // In IE <= 7 and IE8 Quirks Mode, you have to use the Javascript property name instead of the // HTML attribute name for certain attributes. IE8 Standards Mode supports the correct behavior, // but instead of figuring out the mode, we'll just set the attribute through the Javascript // property for IE <= 8. if (ko.utils.ieVersion <= 8 && attrName in attrHtmlToJavascriptMap) { attrName = attrHtmlToJavascriptMap[attrName]; if (toRemove) element.removeAttribute(attrName); else element[attrName] = attrValue; } else if (!toRemove) { element.setAttribute(attrName, attrValue.toString()); } // Treat "name" specially - although you can think of it as an attribute, it also needs // special handling on older versions of IE (https://github.com/SteveSanderson/knockout/pull/333) // Deliberately being case-sensitive here because XHTML would regard "Name" as a different thing // entirely, and there's no strong reason to allow for such casing in HTML. if (attrName === "name") { ko.utils.setElementName(element, toRemove ? "" : attrValue.toString()); } }); } }; (function() { ko.bindingHandlers['checked'] = { 'after': ['value', 'attr'], 'init': function (element, valueAccessor, allBindings) { var checkedValue = ko.pureComputed(function() { // Treat "value" like "checkedValue" when it is included with "checked" binding if (allBindings['has']('checkedValue')) { return ko.utils.unwrapObservable(allBindings.get('checkedValue')); } else if (allBindings['has']('value')) { return ko.utils.unwrapObservable(allBindings.get('value')); } return element.value; }); function updateModel() { // This updates the model value from the view value. // It runs in response to DOM events (click) and changes in checkedValue. var isChecked = element.checked, elemValue = useCheckedValue ? checkedValue() : isChecked; // When we're first setting up this computed, don't change any model state. if (ko.computedContext.isInitial()) { return; } // We can ignore unchecked radio buttons, because some other radio // button will be getting checked, and that one can take care of updating state. if (isRadio && !isChecked) { return; } var modelValue = ko.dependencyDetection.ignore(valueAccessor); if (isValueArray) { if (oldElemValue !== elemValue) { // When we're responding to the checkedValue changing, and the element is // currently checked, replace the old elem value with the new elem value // in the model array. if (isChecked) { ko.utils.addOrRemoveItem(modelValue, elemValue, true); ko.utils.addOrRemoveItem(modelValue, oldElemValue, false); } oldElemValue = elemValue; } else { // When we're responding to the user having checked/unchecked a checkbox, // add/remove the element value to the model array. ko.utils.addOrRemoveItem(modelValue, elemValue, isChecked); } } else { ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'checked', elemValue, true); } }; function updateView() { // This updates the view value from the model value. // It runs in response to changes in the bound (checked) value. var modelValue = ko.utils.unwrapObservable(valueAccessor()); if (isValueArray) { // When a checkbox is bound to an array, being checked represents its value being present in that array element.checked = ko.utils.arrayIndexOf(modelValue, checkedValue()) >= 0; } else if (isCheckbox) { // When a checkbox is bound to any other value (not an array), being checked represents the value being trueish element.checked = modelValue; } else { // For radio buttons, being checked means that the radio button's value corresponds to the model value element.checked = (checkedValue() === modelValue); } }; var isCheckbox = element.type == "checkbox", isRadio = element.type == "radio"; // Only bind to check boxes and radio buttons if (!isCheckbox && !isRadio) { return; } var isValueArray = isCheckbox && (ko.utils.unwrapObservable(valueAccessor()) instanceof Array), oldElemValue = isValueArray ? checkedValue() : undefined, useCheckedValue = isRadio || isValueArray; // IE 6 won't allow radio buttons to be selected unless they have a name if (isRadio && !element.name) ko.bindingHandlers['uniqueName']['init'](element, function() { return true }); // Set up two computeds to update the binding: // The first responds to changes in the checkedValue value and to element clicks ko.computed(updateModel, null, { disposeWhenNodeIsRemoved: element }); ko.utils.registerEventHandler(element, "click", updateModel); // The second responds to changes in the model value (the one associated with the checked binding) ko.computed(updateView, null, { disposeWhenNodeIsRemoved: element }); } }; ko.expressionRewriting.twoWayBindings['checked'] = true; ko.bindingHandlers['checkedValue'] = { 'update': function (element, valueAccessor) { element.value = ko.utils.unwrapObservable(valueAccessor()); } }; })();var classesWrittenByBindingKey = '__ko__cssValue'; ko.bindingHandlers['css'] = { 'update': function (element, valueAccessor) { var value = ko.utils.unwrapObservable(valueAccessor()); if (typeof value == "object") { ko.utils.objectForEach(value, function(className, shouldHaveClass) { shouldHaveClass = ko.utils.unwrapObservable(shouldHaveClass); ko.utils.toggleDomNodeCssClass(element, className, shouldHaveClass); }); } else { value = String(value || ''); // Make sure we don't try to store or set a non-string value ko.utils.toggleDomNodeCssClass(element, element[classesWrittenByBindingKey], false); element[classesWrittenByBindingKey] = value; ko.utils.toggleDomNodeCssClass(element, value, true); } } }; ko.bindingHandlers['enable'] = { 'update': function (element, valueAccessor) { var value = ko.utils.unwrapObservable(valueAccessor()); if (value && element.disabled) element.removeAttribute("disabled"); else if ((!value) && (!element.disabled)) element.disabled = true; } }; ko.bindingHandlers['disable'] = { 'update': function (element, valueAccessor) { ko.bindingHandlers['enable']['update'](element, function() { return !ko.utils.unwrapObservable(valueAccessor()) }); } }; // For certain common events (currently just 'click'), allow a simplified data-binding syntax // e.g. click:handler instead of the usual full-length event:{click:handler} function makeEventHandlerShortcut(eventName) { ko.bindingHandlers[eventName] = { 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { var newValueAccessor = function () { var result = {}; result[eventName] = valueAccessor(); return result; }; return ko.bindingHandlers['event']['init'].call(this, element, newValueAccessor, allBindings, viewModel, bindingContext); } } } ko.bindingHandlers['event'] = { 'init' : function (element, valueAccessor, allBindings, viewModel, bindingContext) { var eventsToHandle = valueAccessor() || {}; ko.utils.objectForEach(eventsToHandle, function(eventName) { if (typeof eventName == "string") { ko.utils.registerEventHandler(element, eventName, function (event) { var handlerReturnValue; var handlerFunction = valueAccessor()[eventName]; if (!handlerFunction) return; try { // Take all the event args, and prefix with the viewmodel var argsForHandler = ko.utils.makeArray(arguments); viewModel = bindingContext['$data']; argsForHandler.unshift(viewModel); handlerReturnValue = handlerFunction.apply(viewModel, argsForHandler); } finally { if (handlerReturnValue !== true) { // Normally we want to prevent default action. Developer can override this be explicitly returning true. if (event.preventDefault) event.preventDefault(); else event.returnValue = false; } } var bubble = allBindings.get(eventName + 'Bubble') !== false; if (!bubble) { event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); } }); } }); } }; // "foreach: someExpression" is equivalent to "template: { foreach: someExpression }" // "foreach: { data: someExpression, afterAdd: myfn }" is equivalent to "template: { foreach: someExpression, afterAdd: myfn }" ko.bindingHandlers['foreach'] = { makeTemplateValueAccessor: function(valueAccessor) { return function() { var modelValue = valueAccessor(), unwrappedValue = ko.utils.peekObservable(modelValue); // Unwrap without setting a dependency here // If unwrappedValue is the array, pass in the wrapped value on its own // The value will be unwrapped and tracked within the template binding // (See https://github.com/SteveSanderson/knockout/issues/523) if ((!unwrappedValue) || typeof unwrappedValue.length == "number") return { 'foreach': modelValue, 'templateEngine': ko.nativeTemplateEngine.instance }; // If unwrappedValue.data is the array, preserve all relevant options and unwrap again value so we get updates ko.utils.unwrapObservable(modelValue); return { 'foreach': unwrappedValue['data'], 'as': unwrappedValue['as'], 'includeDestroyed': unwrappedValue['includeDestroyed'], 'afterAdd': unwrappedValue['afterAdd'], 'beforeRemove': unwrappedValue['beforeRemove'], 'afterRender': unwrappedValue['afterRender'], 'beforeMove': unwrappedValue['beforeMove'], 'afterMove': unwrappedValue['afterMove'], 'templateEngine': ko.nativeTemplateEngine.instance }; }; }, 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { return ko.bindingHandlers['template']['init'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor)); }, 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) { return ko.bindingHandlers['template']['update'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor), allBindings, viewModel, bindingContext); } }; ko.expressionRewriting.bindingRewriteValidators['foreach'] = false; // Can't rewrite control flow bindings ko.virtualElements.allowedBindings['foreach'] = true; var hasfocusUpdatingProperty = '__ko_hasfocusUpdating'; var hasfocusLastValue = '__ko_hasfocusLastValue'; ko.bindingHandlers['hasfocus'] = { 'init': function(element, valueAccessor, allBindings) { var handleElementFocusChange = function(isFocused) { // Where possible, ignore which event was raised and determine focus state using activeElement, // as this avoids phantom focus/blur events raised when changing tabs in modern browsers. // However, not all KO-targeted browsers (Firefox 2) support activeElement. For those browsers, // prevent a loss of focus when changing tabs/windows by setting a flag that prevents hasfocus // from calling 'blur()' on the element when it loses focus. // Discussion at https://github.com/SteveSanderson/knockout/pull/352 element[hasfocusUpdatingProperty] = true; var ownerDoc = element.ownerDocument; if ("activeElement" in ownerDoc) { var active; try { active = ownerDoc.activeElement; } catch(e) { // IE9 throws if you access activeElement during page load (see issue #703) active = ownerDoc.body; } isFocused = (active === element); } var modelValue = valueAccessor(); ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'hasfocus', isFocused, true); //cache the latest value, so we can avoid unnecessarily calling focus/blur in the update function element[hasfocusLastValue] = isFocused; element[hasfocusUpdatingProperty] = false; }; var handleElementFocusIn = handleElementFocusChange.bind(null, true); var handleElementFocusOut = handleElementFocusChange.bind(null, false); ko.utils.registerEventHandler(element, "focus", handleElementFocusIn); ko.utils.registerEventHandler(element, "focusin", handleElementFocusIn); // For IE ko.utils.registerEventHandler(element, "blur", handleElementFocusOut); ko.utils.registerEventHandler(element, "focusout", handleElementFocusOut); // For IE }, 'update': function(element, valueAccessor) { var value = !!ko.utils.unwrapObservable(valueAccessor()); //force boolean to compare with last value if (!element[hasfocusUpdatingProperty] && element[hasfocusLastValue] !== value) { value ? element.focus() : element.blur(); ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, value ? "focusin" : "focusout"]); // For IE, which doesn't reliably fire "focus" or "blur" events synchronously } } }; ko.expressionRewriting.twoWayBindings['hasfocus'] = true; ko.bindingHandlers['hasFocus'] = ko.bindingHandlers['hasfocus']; // Make "hasFocus" an alias ko.expressionRewriting.twoWayBindings['hasFocus'] = true; ko.bindingHandlers['html'] = { 'init': function() { // Prevent binding on the dynamically-injected HTML (as developers are unlikely to expect that, and it has security implications) return { 'controlsDescendantBindings': true }; }, 'update': function (element, valueAccessor) { // setHtml will unwrap the value if needed ko.utils.setHtml(element, valueAccessor()); } }; // Makes a binding like with or if function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) { ko.bindingHandlers[bindingKey] = { 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { var didDisplayOnLastUpdate, savedNodes; ko.computed(function() { var dataValue = ko.utils.unwrapObservable(valueAccessor()), shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue isFirstRender = !savedNodes, needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate); if (needsRefresh) { // Save a copy of the inner nodes on the initial update, but only if we have dependencies. if (isFirstRender && ko.computedContext.getDependenciesCount()) { savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */); } if (shouldDisplay) { if (!isFirstRender) { ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes)); } ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element); } else { ko.virtualElements.emptyNode(element); } didDisplayOnLastUpdate = shouldDisplay; } }, null, { disposeWhenNodeIsRemoved: element }); return { 'controlsDescendantBindings': true }; } }; ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings ko.virtualElements.allowedBindings[bindingKey] = true; } // Construct the actual binding handlers makeWithIfBinding('if'); makeWithIfBinding('ifnot', false /* isWith */, true /* isNot */); makeWithIfBinding('with', true /* isWith */, false /* isNot */, function(bindingContext, dataValue) { return bindingContext['createChildContext'](dataValue); } ); var captionPlaceholder = {}; ko.bindingHandlers['options'] = { 'init': function(element) { if (ko.utils.tagNameLower(element) !== "select") throw new Error("options binding applies only to SELECT elements"); // Remove all existing <option>s. while (element.length > 0) { element.remove(0); } // Ensures that the binding processor doesn't try to bind the options return { 'controlsDescendantBindings': true }; }, 'update': function (element, valueAccessor, allBindings) { function selectedOptions() { return ko.utils.arrayFilter(element.options, function (node) { return node.selected; }); } var selectWasPreviouslyEmpty = element.length == 0; var previousScrollTop = (!selectWasPreviouslyEmpty && element.multiple) ? element.scrollTop : null; var unwrappedArray = ko.utils.unwrapObservable(valueAccessor()); var includeDestroyed = allBindings.get('optionsIncludeDestroyed'); var arrayToDomNodeChildrenOptions = {}; var captionValue; var filteredArray; var previousSelectedValues; if (element.multiple) { previousSelectedValues = ko.utils.arrayMap(selectedOptions(), ko.selectExtensions.readValue); } else { previousSelectedValues = element.selectedIndex >= 0 ? [ ko.selectExtensions.readValue(element.options[element.selectedIndex]) ] : []; } if (unwrappedArray) { if (typeof unwrappedArray.length == "undefined") // Coerce single value into array unwrappedArray = [unwrappedArray]; // Filter out any entries marked as destroyed filteredArray = ko.utils.arrayFilter(unwrappedArray, function(item) { return includeDestroyed || item === undefined || item === null || !ko.utils.unwrapObservable(item['_destroy']); }); // If caption is included, add it to the array if (allBindings['has']('optionsCaption')) { captionValue = ko.utils.unwrapObservable(allBindings.get('optionsCaption')); // If caption value is null or undefined, don't show a caption if (captionValue !== null && captionValue !== undefined) { filteredArray.unshift(captionPlaceholder); } } } else { // If a falsy value is provided (e.g. null), we'll simply empty the select element } function applyToObject(object, predicate, defaultValue) { var predicateType = typeof predicate; if (predicateType == "function") // Given a function; run it against the data value return predicate(object); else if (predicateType == "string") // Given a string; treat it as a property name on the data value return object[predicate]; else // Given no optionsText arg; use the data value itself return defaultValue; } // The following functions can run at two different times: // The first is when the whole array is being updated directly from this binding handler. // The second is when an observable value for a specific array entry is updated. // oldOptions will be empty in the first case, but will be filled with the previously generated option in the second. var itemUpdate = false; function optionForArrayItem(arrayEntry, index, oldOptions) { if (oldOptions.length) { previousSelectedValues = oldOptions[0].selected ? [ ko.selectExtensions.readValue(oldOptions[0]) ] : []; itemUpdate = true; } var option = element.ownerDocument.createElement("option"); if (arrayEntry === captionPlaceholder) { ko.utils.setTextContent(option, allBindings.get('optionsCaption')); ko.selectExtensions.writeValue(option, undefined); } else { // Apply a value to the option element var optionValue = applyToObject(arrayEntry, allBindings.get('optionsValue'), arrayEntry); ko.selectExtensions.writeValue(option, ko.utils.unwrapObservable(optionValue)); // Apply some text to the option element var optionText = applyToObject(arrayEntry, allBindings.get('optionsText'), optionValue); ko.utils.setTextContent(option, optionText); } return [option]; } // By using a beforeRemove callback, we delay the removal until after new items are added. This fixes a selection // problem in IE<=8 and Firefox. See https://github.com/knockout/knockout/issues/1208 arrayToDomNodeChildrenOptions['beforeRemove'] = function (option) { element.removeChild(option); }; function setSelectionCallback(arrayEntry, newOptions) { // IE6 doesn't like us to assign selection to OPTION nodes before they're added to the document. // That's why we first added them without selection. Now it's time to set the selection. if (previousSelectedValues.length) { var isSelected = ko.utils.arrayIndexOf(previousSelectedValues, ko.selectExtensions.readValue(newOptions[0])) >= 0; ko.utils.setOptionNodeSelectionState(newOptions[0], isSelected); // If this option was changed from being selected during a single-item update, notify the change if (itemUpdate && !isSelected) ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, "change"]); } } var callback = setSelectionCallback; if (allBindings['has']('optionsAfterRender')) { callback = function(arrayEntry, newOptions) { setSelectionCallback(arrayEntry, newOptions); ko.dependencyDetection.ignore(allBindings.get('optionsAfterRender'), null, [newOptions[0], arrayEntry !== captionPlaceholder ? arrayEntry : undefined]); } } ko.utils.setDomNodeChildrenFromArrayMapping(element, filteredArray, optionForArrayItem, arrayToDomNodeChildrenOptions, callback); ko.dependencyDetection.ignore(function () { if (allBindings.get('valueAllowUnset') && allBindings['has']('value')) { // The model value is authoritative, so make sure its value is the one selected ko.selectExtensions.writeValue(element, ko.utils.unwrapObservable(allBindings.get('value')), true /* allowUnset */); } else { // Determine if the selection has changed as a result of updating the options list var selectionChanged; if (element.multiple) { // For a multiple-select box, compare the new selection count to the previous one // But if nothing was selected before, the selection can't have changed selectionChanged = previousSelectedValues.length && selectedOptions().length < previousSelectedValues.length; } else { // For a single-select box, compare the current value to the previous value // But if nothing was selected before or nothing is selected now, just look for a change in selection selectionChanged = (previousSelectedValues.length && element.selectedIndex >= 0) ? (ko.selectExtensions.readValue(element.options[element.selectedIndex]) !== previousSelectedValues[0]) : (previousSelectedValues.length || element.selectedIndex >= 0); } // Ensure consistency between model value and selected option. // If the dropdown was changed so that selection is no longer the same, // notify the value or selectedOptions binding. if (selectionChanged) { ko.utils.triggerEvent(element, "change"); } } }); // Workaround for IE bug ko.utils.ensureSelectElementIsRenderedCorrectly(element); if (previousScrollTop && Math.abs(previousScrollTop - element.scrollTop) > 20) element.scrollTop = previousScrollTop; } }; ko.bindingHandlers['options'].optionValueDomDataKey = ko.utils.domData.nextKey(); ko.bindingHandlers['selectedOptions'] = { 'after': ['options', 'foreach'], 'init': function (element, valueAccessor, allBindings) { ko.utils.registerEventHandler(element, "change", function () { var value = valueAccessor(), valueToWrite = []; ko.utils.arrayForEach(element.getElementsByTagName("option"), function(node) { if (node.selected) valueToWrite.push(ko.selectExtensions.readValue(node)); }); ko.expressionRewriting.writeValueToProperty(value, allBindings, 'selectedOptions', valueToWrite); }); }, 'update': function (element, valueAccessor) { if (ko.utils.tagNameLower(element) != "select") throw new Error("values binding applies only to SELECT elements"); var newValue = ko.utils.unwrapObservable(valueAccessor()); if (newValue && typeof newValue.length == "number") { ko.utils.arrayForEach(element.getElementsByTagName("option"), function(node) { var isSelected = ko.utils.arrayIndexOf(newValue, ko.selectExtensions.readValue(node)) >= 0; ko.utils.setOptionNodeSelectionState(node, isSelected); }); } } }; ko.expressionRewriting.twoWayBindings['selectedOptions'] = true; ko.bindingHandlers['style'] = { 'update': function (element, valueAccessor) { var value = ko.utils.unwrapObservable(valueAccessor() || {}); ko.utils.objectForEach(value, function(styleName, styleValue) { styleValue = ko.utils.unwrapObservable(styleValue); if (styleValue === null || styleValue === undefined || styleValue === false) { // Empty string removes the value, whereas null/undefined have no effect styleValue = ""; } element.style[styleName] = styleValue; }); } }; ko.bindingHandlers['submit'] = { 'init': function (element, valueAccessor, allBindings, viewModel, bindingContext) { if (typeof valueAccessor() != "function") throw new Error("The value for a submit binding must be a function"); ko.utils.registerEventHandler(element, "submit", function (event) { var handlerReturnValue; var value = valueAccessor(); try { handlerReturnValue = value.call(bindingContext['$data'], element); } finally { if (handlerReturnValue !== true) { // Normally we want to prevent default action. Developer can override this be explicitly returning true. if (event.preventDefault) event.preventDefault(); else event.returnValue = false; } } }); } }; ko.bindingHandlers['text'] = { 'init': function() { // Prevent binding on the dynamically-injected text node (as developers are unlikely to expect that, and it has security implications). // It should also make things faster, as we no longer have to consider whether the text node might be bindable. return { 'controlsDescendantBindings': true }; }, 'update': function (element, valueAccessor) { ko.utils.setTextContent(element, valueAccessor()); } }; ko.virtualElements.allowedBindings['text'] = true; (function () { if (window && window.navigator) { var parseVersion = function (matches) { if (matches) { return parseFloat(matches[1]); } }; // Detect various browser versions because some old versions don't fully support the 'input' event var operaVersion = window.opera && window.opera.version && parseInt(window.opera.version()), userAgent = window.navigator.userAgent, safariVersion = parseVersion(userAgent.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)), firefoxVersion = parseVersion(userAgent.match(/Firefox\/([^ ]*)/)); } // IE 8 and 9 have bugs that prevent the normal events from firing when the value changes. // But it does fire the 'selectionchange' event on many of those, presumably because the // cursor is moving and that counts as the selection changing. The 'selectionchange' event is // fired at the document level only and doesn't directly indicate which element changed. We // set up just one event handler for the document and use 'activeElement' to determine which // element was changed. if (ko.utils.ieVersion < 10) { var selectionChangeRegisteredName = ko.utils.domData.nextKey(), selectionChangeHandlerName = ko.utils.domData.nextKey(); var selectionChangeHandler = function(event) { var target = this.activeElement, handler = target && ko.utils.domData.get(target, selectionChangeHandlerName); if (handler) { handler(event); } }; var registerForSelectionChangeEvent = function (element, handler) { var ownerDoc = element.ownerDocument; if (!ko.utils.domData.get(ownerDoc, selectionChangeRegisteredName)) { ko.utils.domData.set(ownerDoc, selectionChangeRegisteredName, true); ko.utils.registerEventHandler(ownerDoc, 'selectionchange', selectionChangeHandler); } ko.utils.domData.set(element, selectionChangeHandlerName, handler); }; } ko.bindingHandlers['textInput'] = { 'init': function (element, valueAccessor, allBindings) { var previousElementValue = element.value, timeoutHandle, elementValueBeforeEvent; var updateModel = function (event) { clearTimeout(timeoutHandle); elementValueBeforeEvent = timeoutHandle = undefined; var elementValue = element.value; if (previousElementValue !== elementValue) { // Provide a way for tests to know exactly which event was processed if (DEBUG && event) element['_ko_textInputProcessedEvent'] = event.type; previousElementValue = elementValue; ko.expressionRewriting.writeValueToProperty(valueAccessor(), allBindings, 'textInput', elementValue); } }; var deferUpdateModel = function (event) { if (!timeoutHandle) { // The elementValueBeforeEvent variable is set *only* during the brief gap between an // event firing and the updateModel function running. This allows us to ignore model // updates that are from the previous state of the element, usually due to techniques // such as rateLimit. Such updates, if not ignored, can cause keystrokes to be lost. elementValueBeforeEvent = element.value; var handler = DEBUG ? updateModel.bind(element, {type: event.type}) : updateModel; timeoutHandle = setTimeout(handler, 4); } }; var updateView = function () { var modelValue = ko.utils.unwrapObservable(valueAccessor()); if (modelValue === null || modelValue === undefined) { modelValue = ''; } if (elementValueBeforeEvent !== undefined && modelValue === elementValueBeforeEvent) { setTimeout(updateView, 4); return; } // Update the element only if the element and model are different. On some browsers, updating the value // will move the cursor to the end of the input, which would be bad while the user is typing. if (element.value !== modelValue) { previousElementValue = modelValue; // Make sure we ignore events (propertychange) that result from updating the value element.value = modelValue; } }; var onEvent = function (event, handler) { ko.utils.registerEventHandler(element, event, handler); }; if (DEBUG && ko.bindingHandlers['textInput']['_forceUpdateOn']) { // Provide a way for tests to specify exactly which events are bound ko.utils.arrayForEach(ko.bindingHandlers['textInput']['_forceUpdateOn'], function(eventName) { if (eventName.slice(0,5) == 'after') { onEvent(eventName.slice(5), deferUpdateModel); } else { onEvent(eventName, updateModel); } }); } else { if (ko.utils.ieVersion < 10) { // Internet Explorer <= 8 doesn't support the 'input' event, but does include 'propertychange' that fires whenever // any property of an element changes. Unlike 'input', it also fires if a property is changed from JavaScript code, // but that's an acceptable compromise for this binding. IE 9 does support 'input', but since it doesn't fire it // when using autocomplete, we'll use 'propertychange' for it also. onEvent('propertychange', function(event) { if (event.propertyName === 'value') { updateModel(event); } }); if (ko.utils.ieVersion == 8) { // IE 8 has a bug where it fails to fire 'propertychange' on the first update following a value change from // JavaScript code. It also doesn't fire if you clear the entire value. To fix this, we bind to the following // events too. onEvent('keyup', updateModel); // A single keystoke onEvent('keydown', updateModel); // The first character when a key is held down } if (ko.utils.ieVersion >= 8) { // Internet Explorer 9 doesn't fire the 'input' event when deleting text, including using // the backspace, delete, or ctrl-x keys, clicking the 'x' to clear the input, dragging text // out of the field, and cutting or deleting text using the context menu. 'selectionchange' // can detect all of those except dragging text out of the field, for which we use 'dragend'. // These are also needed in IE8 because of the bug described above. registerForSelectionChangeEvent(element, updateModel); // 'selectionchange' covers cut, paste, drop, delete, etc. onEvent('dragend', deferUpdateModel); } } else { // All other supported browsers support the 'input' event, which fires whenever the content of the element is changed // through the user interface. onEvent('input', updateModel); if (safariVersion < 5 && ko.utils.tagNameLower(element) === "textarea") { // Safari <5 doesn't fire the 'input' event for <textarea> elements (it does fire 'textInput' // but only when typing). So we'll just catch as much as we can with keydown, cut, and paste. onEvent('keydown', deferUpdateModel); onEvent('paste', deferUpdateModel); onEvent('cut', deferUpdateModel); } else if (operaVersion < 11) { // Opera 10 doesn't always fire the 'input' event for cut, paste, undo & drop operations. // We can try to catch some of those using 'keydown'. onEvent('keydown', deferUpdateModel); } else if (firefoxVersion < 4.0) { // Firefox <= 3.6 doesn't fire the 'input' event when text is filled in through autocomplete onEvent('DOMAutoComplete', updateModel); // Firefox <=3.5 doesn't fire the 'input' event when text is dropped into the input. onEvent('dragdrop', updateModel); // <3.5 onEvent('drop', updateModel); // 3.5 } } } // Bind to the change event so that we can catch programmatic updates of the value that fire this event. onEvent('change', updateModel); ko.computed(updateView, null, { disposeWhenNodeIsRemoved: element }); } }; ko.expressionRewriting.twoWayBindings['textInput'] = true; // textinput is an alias for textInput ko.bindingHandlers['textinput'] = { // preprocess is the only way to set up a full alias 'preprocess': function (value, name, addBinding) { addBinding('textInput', value); } }; })();ko.bindingHandlers['uniqueName'] = { 'init': function (element, valueAccessor) { if (valueAccessor()) { var name = "ko_unique_" + (++ko.bindingHandlers['uniqueName'].currentIndex); ko.utils.setElementName(element, name); } } }; ko.bindingHandlers['uniqueName'].currentIndex = 0; ko.bindingHandlers['value'] = { 'after': ['options', 'foreach'], 'init': function (element, valueAccessor, allBindings) { // If the value binding is placed on a radio/checkbox, then just pass through to checkedValue and quit if (element.tagName.toLowerCase() == "input" && (element.type == "checkbox" || element.type == "radio")) { ko.applyBindingAccessorsToNode(element, { 'checkedValue': valueAccessor }); return; } // Always catch "change" event; possibly other events too if asked var eventsToCatch = ["change"]; var requestedEventsToCatch = allBindings.get("valueUpdate"); var propertyChangedFired = false; var elementValueBeforeEvent = null; if (requestedEventsToCatch) { if (typeof requestedEventsToCatch == "string") // Allow both individual event names, and arrays of event names requestedEventsToCatch = [requestedEventsToCatch]; ko.utils.arrayPushAll(eventsToCatch, requestedEventsToCatch); eventsToCatch = ko.utils.arrayGetDistinctValues(eventsToCatch); } var valueUpdateHandler = function() { elementValueBeforeEvent = null; propertyChangedFired = false; var modelValue = valueAccessor(); var elementValue = ko.selectExtensions.readValue(element); ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'value', elementValue); } // Workaround for https://github.com/SteveSanderson/knockout/issues/122 // IE doesn't fire "change" events on textboxes if the user selects a value from its autocomplete list var ieAutoCompleteHackNeeded = ko.utils.ieVersion && element.tagName.toLowerCase() == "input" && element.type == "text" && element.autocomplete != "off" && (!element.form || element.form.autocomplete != "off"); if (ieAutoCompleteHackNeeded && ko.utils.arrayIndexOf(eventsToCatch, "propertychange") == -1) { ko.utils.registerEventHandler(element, "propertychange", function () { propertyChangedFired = true }); ko.utils.registerEventHandler(element, "focus", function () { propertyChangedFired = false }); ko.utils.registerEventHandler(element, "blur", function() { if (propertyChangedFired) { valueUpdateHandler(); } }); } ko.utils.arrayForEach(eventsToCatch, function(eventName) { // The syntax "after<eventname>" means "run the handler asynchronously after the event" // This is useful, for example, to catch "keydown" events after the browser has updated the control // (otherwise, ko.selectExtensions.readValue(this) will receive the control's value *before* the key event) var handler = valueUpdateHandler; if (ko.utils.stringStartsWith(eventName, "after")) { handler = function() { // The elementValueBeforeEvent variable is non-null *only* during the brief gap between // a keyX event firing and the valueUpdateHandler running, which is scheduled to happen // at the earliest asynchronous opportunity. We store this temporary information so that // if, between keyX and valueUpdateHandler, the underlying model value changes separately, // we can overwrite that model value change with the value the user just typed. Otherwise, // techniques like rateLimit can trigger model changes at critical moments that will // override the user's inputs, causing keystrokes to be lost. elementValueBeforeEvent = ko.selectExtensions.readValue(element); setTimeout(valueUpdateHandler, 0); }; eventName = eventName.substring("after".length); } ko.utils.registerEventHandler(element, eventName, handler); }); var updateFromModel = function () { var newValue = ko.utils.unwrapObservable(valueAccessor()); var elementValue = ko.selectExtensions.readValue(element); if (elementValueBeforeEvent !== null && newValue === elementValueBeforeEvent) { setTimeout(updateFromModel, 0); return; } var valueHasChanged = (newValue !== elementValue); if (valueHasChanged) { if (ko.utils.tagNameLower(element) === "select") { var allowUnset = allBindings.get('valueAllowUnset'); var applyValueAction = function () { ko.selectExtensions.writeValue(element, newValue, allowUnset); }; applyValueAction(); if (!allowUnset && newValue !== ko.selectExtensions.readValue(element)) { // If you try to set a model value that can't be represented in an already-populated dropdown, reject that change, // because you're not allowed to have a model value that disagrees with a visible UI selection. ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, "change"]); } else { // Workaround for IE6 bug: It won't reliably apply values to SELECT nodes during the same execution thread // right after you've changed the set of OPTION nodes on it. So for that node type, we'll schedule a second thread // to apply the value as well. setTimeout(applyValueAction, 0); } } else { ko.selectExtensions.writeValue(element, newValue); } } }; ko.computed(updateFromModel, null, { disposeWhenNodeIsRemoved: element }); }, 'update': function() {} // Keep for backwards compatibility with code that may have wrapped value binding }; ko.expressionRewriting.twoWayBindings['value'] = true; ko.bindingHandlers['visible'] = { 'update': function (element, valueAccessor) { var value = ko.utils.unwrapObservable(valueAccessor()); var isCurrentlyVisible = !(element.style.display == "none"); if (value && !isCurrentlyVisible) element.style.display = ""; else if ((!value) && isCurrentlyVisible) element.style.display = "none"; } }; // 'click' is just a shorthand for the usual full-length event:{click:handler} makeEventHandlerShortcut('click'); // If you want to make a custom template engine, // // [1] Inherit from this class (like ko.nativeTemplateEngine does) // [2] Override 'renderTemplateSource', supplying a function with this signature: // // function (templateSource, bindingContext, options) { // // - templateSource.text() is the text of the template you should render // // - bindingContext.$data is the data you should pass into the template // // - you might also want to make bindingContext.$parent, bindingContext.$parents, // // and bindingContext.$root available in the template too // // - options gives you access to any other properties set on "data-bind: { template: options }" // // // // Return value: an array of DOM nodes // } // // [3] Override 'createJavaScriptEvaluatorBlock', supplying a function with this signature: // // function (script) { // // Return value: Whatever syntax means "Evaluate the JavaScript statement 'script' and output the result" // // For example, the jquery.tmpl template engine converts 'someScript' to '${ someScript }' // } // // This is only necessary if you want to allow data-bind attributes to reference arbitrary template variables. // If you don't want to allow that, you can set the property 'allowTemplateRewriting' to false (like ko.nativeTemplateEngine does) // and then you don't need to override 'createJavaScriptEvaluatorBlock'. ko.templateEngine = function () { }; ko.templateEngine.prototype['renderTemplateSource'] = function (templateSource, bindingContext, options) { throw new Error("Override renderTemplateSource"); }; ko.templateEngine.prototype['createJavaScriptEvaluatorBlock'] = function (script) { throw new Error("Override createJavaScriptEvaluatorBlock"); }; ko.templateEngine.prototype['makeTemplateSource'] = function(template, templateDocument) { // Named template if (typeof template == "string") { templateDocument = templateDocument || document; var elem = templateDocument.getElementById(template); if (!elem) throw new Error("Cannot find template with ID " + template); return new ko.templateSources.domElement(elem); } else if ((template.nodeType == 1) || (template.nodeType == 8)) { // Anonymous template return new ko.templateSources.anonymousTemplate(template); } else throw new Error("Unknown template type: " + template); }; ko.templateEngine.prototype['renderTemplate'] = function (template, bindingContext, options, templateDocument) { var templateSource = this['makeTemplateSource'](template, templateDocument); return this['renderTemplateSource'](templateSource, bindingContext, options); }; ko.templateEngine.prototype['isTemplateRewritten'] = function (template, templateDocument) { // Skip rewriting if requested if (this['allowTemplateRewriting'] === false) return true; return this['makeTemplateSource'](template, templateDocument)['data']("isRewritten"); }; ko.templateEngine.prototype['rewriteTemplate'] = function (template, rewriterCallback, templateDocument) { var templateSource = this['makeTemplateSource'](template, templateDocument); var rewritten = rewriterCallback(templateSource['text']()); templateSource['text'](rewritten); templateSource['data']("isRewritten", true); }; ko.exportSymbol('templateEngine', ko.templateEngine); ko.templateRewriting = (function () { var memoizeDataBindingAttributeSyntaxRegex = /(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi; var memoizeVirtualContainerBindingSyntaxRegex = /<!--\s*ko\b\s*([\s\S]*?)\s*-->/g; function validateDataBindValuesForRewriting(keyValueArray) { var allValidators = ko.expressionRewriting.bindingRewriteValidators; for (var i = 0; i < keyValueArray.length; i++) { var key = keyValueArray[i]['key']; if (allValidators.hasOwnProperty(key)) { var validator = allValidators[key]; if (typeof validator === "function") { var possibleErrorMessage = validator(keyValueArray[i]['value']); if (possibleErrorMessage) throw new Error(possibleErrorMessage); } else if (!validator) { throw new Error("This template engine does not support the '" + key + "' binding within its templates"); } } } } function constructMemoizedTagReplacement(dataBindAttributeValue, tagToRetain, nodeName, templateEngine) { var dataBindKeyValueArray = ko.expressionRewriting.parseObjectLiteral(dataBindAttributeValue); validateDataBindValuesForRewriting(dataBindKeyValueArray); var rewrittenDataBindAttributeValue = ko.expressionRewriting.preProcessBindings(dataBindKeyValueArray, {'valueAccessors':true}); // For no obvious reason, Opera fails to evaluate rewrittenDataBindAttributeValue unless it's wrapped in an additional // anonymous function, even though Opera's built-in debugger can evaluate it anyway. No other browser requires this // extra indirection. var applyBindingsToNextSiblingScript = "ko.__tr_ambtns(function($context,$element){return(function(){return{ " + rewrittenDataBindAttributeValue + " } })()},'" + nodeName.toLowerCase() + "')"; return templateEngine['createJavaScriptEvaluatorBlock'](applyBindingsToNextSiblingScript) + tagToRetain; } return { ensureTemplateIsRewritten: function (template, templateEngine, templateDocument) { if (!templateEngine['isTemplateRewritten'](template, templateDocument)) templateEngine['rewriteTemplate'](template, function (htmlString) { return ko.templateRewriting.memoizeBindingAttributeSyntax(htmlString, templateEngine); }, templateDocument); }, memoizeBindingAttributeSyntax: function (htmlString, templateEngine) { return htmlString.replace(memoizeDataBindingAttributeSyntaxRegex, function () { return constructMemoizedTagReplacement(/* dataBindAttributeValue: */ arguments[4], /* tagToRetain: */ arguments[1], /* nodeName: */ arguments[2], templateEngine); }).replace(memoizeVirtualContainerBindingSyntaxRegex, function() { return constructMemoizedTagReplacement(/* dataBindAttributeValue: */ arguments[1], /* tagToRetain: */ "<!-- ko -->", /* nodeName: */ "#comment", templateEngine); }); }, applyMemoizedBindingsToNextSibling: function (bindings, nodeName) { return ko.memoization.memoize(function (domNode, bindingContext) { var nodeToBind = domNode.nextSibling; if (nodeToBind && nodeToBind.nodeName.toLowerCase() === nodeName) { ko.applyBindingAccessorsToNode(nodeToBind, bindings, bindingContext); } }); } } })(); // Exported only because it has to be referenced by string lookup from within rewritten template ko.exportSymbol('__tr_ambtns', ko.templateRewriting.applyMemoizedBindingsToNextSibling); (function() { // A template source represents a read/write way of accessing a template. This is to eliminate the need for template loading/saving // logic to be duplicated in every template engine (and means they can all work with anonymous templates, etc.) // // Two are provided by default: // 1. ko.templateSources.domElement - reads/writes the text content of an arbitrary DOM element // 2. ko.templateSources.anonymousElement - uses ko.utils.domData to read/write text *associated* with the DOM element, but // without reading/writing the actual element text content, since it will be overwritten // with the rendered template output. // You can implement your own template source if you want to fetch/store templates somewhere other than in DOM elements. // Template sources need to have the following functions: // text() - returns the template text from your storage location // text(value) - writes the supplied template text to your storage location // data(key) - reads values stored using data(key, value) - see below // data(key, value) - associates "value" with this template and the key "key". Is used to store information like "isRewritten". // // Optionally, template sources can also have the following functions: // nodes() - returns a DOM element containing the nodes of this template, where available // nodes(value) - writes the given DOM element to your storage location // If a DOM element is available for a given template source, template engines are encouraged to use it in preference over text() // for improved speed. However, all templateSources must supply text() even if they don't supply nodes(). // // Once you've implemented a templateSource, make your template engine use it by subclassing whatever template engine you were // using and overriding "makeTemplateSource" to return an instance of your custom template source. ko.templateSources = {}; // ---- ko.templateSources.domElement ----- ko.templateSources.domElement = function(element) { this.domElement = element; } ko.templateSources.domElement.prototype['text'] = function(/* valueToWrite */) { var tagNameLower = ko.utils.tagNameLower(this.domElement), elemContentsProperty = tagNameLower === "script" ? "text" : tagNameLower === "textarea" ? "value" : "innerHTML"; if (arguments.length == 0) { return this.domElement[elemContentsProperty]; } else { var valueToWrite = arguments[0]; if (elemContentsProperty === "innerHTML") ko.utils.setHtml(this.domElement, valueToWrite); else this.domElement[elemContentsProperty] = valueToWrite; } }; var dataDomDataPrefix = ko.utils.domData.nextKey() + "_"; ko.templateSources.domElement.prototype['data'] = function(key /*, valueToWrite */) { if (arguments.length === 1) { return ko.utils.domData.get(this.domElement, dataDomDataPrefix + key); } else { ko.utils.domData.set(this.domElement, dataDomDataPrefix + key, arguments[1]); } }; // ---- ko.templateSources.anonymousTemplate ----- // Anonymous templates are normally saved/retrieved as DOM nodes through "nodes". // For compatibility, you can also read "text"; it will be serialized from the nodes on demand. // Writing to "text" is still supported, but then the template data will not be available as DOM nodes. var anonymousTemplatesDomDataKey = ko.utils.domData.nextKey(); ko.templateSources.anonymousTemplate = function(element) { this.domElement = element; } ko.templateSources.anonymousTemplate.prototype = new ko.templateSources.domElement(); ko.templateSources.anonymousTemplate.prototype.constructor = ko.templateSources.anonymousTemplate; ko.templateSources.anonymousTemplate.prototype['text'] = function(/* valueToWrite */) { if (arguments.length == 0) { var templateData = ko.utils.domData.get(this.domElement, anonymousTemplatesDomDataKey) || {}; if (templateData.textData === undefined && templateData.containerData) templateData.textData = templateData.containerData.innerHTML; return templateData.textData; } else { var valueToWrite = arguments[0]; ko.utils.domData.set(this.domElement, anonymousTemplatesDomDataKey, {textData: valueToWrite}); } }; ko.templateSources.domElement.prototype['nodes'] = function(/* valueToWrite */) { if (arguments.length == 0) { var templateData = ko.utils.domData.get(this.domElement, anonymousTemplatesDomDataKey) || {}; return templateData.containerData; } else { var valueToWrite = arguments[0]; ko.utils.domData.set(this.domElement, anonymousTemplatesDomDataKey, {containerData: valueToWrite}); } }; ko.exportSymbol('templateSources', ko.templateSources); ko.exportSymbol('templateSources.domElement', ko.templateSources.domElement); ko.exportSymbol('templateSources.anonymousTemplate', ko.templateSources.anonymousTemplate); })(); (function () { var _templateEngine; ko.setTemplateEngine = function (templateEngine) { if ((templateEngine != undefined) && !(templateEngine instanceof ko.templateEngine)) throw new Error("templateEngine must inherit from ko.templateEngine"); _templateEngine = templateEngine; } function invokeForEachNodeInContinuousRange(firstNode, lastNode, action) { var node, nextInQueue = firstNode, firstOutOfRangeNode = ko.virtualElements.nextSibling(lastNode); while (nextInQueue && ((node = nextInQueue) !== firstOutOfRangeNode)) { nextInQueue = ko.virtualElements.nextSibling(node); action(node, nextInQueue); } } function activateBindingsOnContinuousNodeArray(continuousNodeArray, bindingContext) { // To be used on any nodes that have been rendered by a template and have been inserted into some parent element // Walks through continuousNodeArray (which *must* be continuous, i.e., an uninterrupted sequence of sibling nodes, because // the algorithm for walking them relies on this), and for each top-level item in the virtual-element sense, // (1) Does a regular "applyBindings" to associate bindingContext with this node and to activate any non-memoized bindings // (2) Unmemoizes any memos in the DOM subtree (e.g., to activate bindings that had been memoized during template rewriting) if (continuousNodeArray.length) { var firstNode = continuousNodeArray[0], lastNode = continuousNodeArray[continuousNodeArray.length - 1], parentNode = firstNode.parentNode, provider = ko.bindingProvider['instance'], preprocessNode = provider['preprocessNode']; if (preprocessNode) { invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node, nextNodeInRange) { var nodePreviousSibling = node.previousSibling; var newNodes = preprocessNode.call(provider, node); if (newNodes) { if (node === firstNode) firstNode = newNodes[0] || nextNodeInRange; if (node === lastNode) lastNode = newNodes[newNodes.length - 1] || nodePreviousSibling; } }); // Because preprocessNode can change the nodes, including the first and last nodes, update continuousNodeArray to match. // We need the full set, including inner nodes, because the unmemoize step might remove the first node (and so the real // first node needs to be in the array). continuousNodeArray.length = 0; if (!firstNode) { // preprocessNode might have removed all the nodes, in which case there's nothing left to do return; } if (firstNode === lastNode) { continuousNodeArray.push(firstNode); } else { continuousNodeArray.push(firstNode, lastNode); ko.utils.fixUpContinuousNodeArray(continuousNodeArray, parentNode); } } // Need to applyBindings *before* unmemoziation, because unmemoization might introduce extra nodes (that we don't want to re-bind) // whereas a regular applyBindings won't introduce new memoized nodes invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node) { if (node.nodeType === 1 || node.nodeType === 8) ko.applyBindings(bindingContext, node); }); invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node) { if (node.nodeType === 1 || node.nodeType === 8) ko.memoization.unmemoizeDomNodeAndDescendants(node, [bindingContext]); }); // Make sure any changes done by applyBindings or unmemoize are reflected in the array ko.utils.fixUpContinuousNodeArray(continuousNodeArray, parentNode); } } function getFirstNodeFromPossibleArray(nodeOrNodeArray) { return nodeOrNodeArray.nodeType ? nodeOrNodeArray : nodeOrNodeArray.length > 0 ? nodeOrNodeArray[0] : null; } function executeTemplate(targetNodeOrNodeArray, renderMode, template, bindingContext, options) { options = options || {}; var firstTargetNode = targetNodeOrNodeArray && getFirstNodeFromPossibleArray(targetNodeOrNodeArray); var templateDocument = firstTargetNode && firstTargetNode.ownerDocument; var templateEngineToUse = (options['templateEngine'] || _templateEngine); ko.templateRewriting.ensureTemplateIsRewritten(template, templateEngineToUse, templateDocument); var renderedNodesArray = templateEngineToUse['renderTemplate'](template, bindingContext, options, templateDocument); // Loosely check result is an array of DOM nodes if ((typeof renderedNodesArray.length != "number") || (renderedNodesArray.length > 0 && typeof renderedNodesArray[0].nodeType != "number")) throw new Error("Template engine must return an array of DOM nodes"); var haveAddedNodesToParent = false; switch (renderMode) { case "replaceChildren": ko.virtualElements.setDomNodeChildren(targetNodeOrNodeArray, renderedNodesArray); haveAddedNodesToParent = true; break; case "replaceNode": ko.utils.replaceDomNodes(targetNodeOrNodeArray, renderedNodesArray); haveAddedNodesToParent = true; break; case "ignoreTargetNode": break; default: throw new Error("Unknown renderMode: " + renderMode); } if (haveAddedNodesToParent) { activateBindingsOnContinuousNodeArray(renderedNodesArray, bindingContext); if (options['afterRender']) ko.dependencyDetection.ignore(options['afterRender'], null, [renderedNodesArray, bindingContext['$data']]); } return renderedNodesArray; } function resolveTemplateName(template, data, context) { // The template can be specified as: if (ko.isObservable(template)) { // 1. An observable, with string value return template(); } else if (typeof template === 'function') { // 2. A function of (data, context) returning a string return template(data, context); } else { // 3. A string return template; } } ko.renderTemplate = function (template, dataOrBindingContext, options, targetNodeOrNodeArray, renderMode) { options = options || {}; if ((options['templateEngine'] || _templateEngine) == undefined) throw new Error("Set a template engine before calling renderTemplate"); renderMode = renderMode || "replaceChildren"; if (targetNodeOrNodeArray) { var firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray); var whenToDispose = function () { return (!firstTargetNode) || !ko.utils.domNodeIsAttachedToDocument(firstTargetNode); }; // Passive disposal (on next evaluation) var activelyDisposeWhenNodeIsRemoved = (firstTargetNode && renderMode == "replaceNode") ? firstTargetNode.parentNode : firstTargetNode; return ko.dependentObservable( // So the DOM is automatically updated when any dependency changes function () { // Ensure we've got a proper binding context to work with var bindingContext = (dataOrBindingContext && (dataOrBindingContext instanceof ko.bindingContext)) ? dataOrBindingContext : new ko.bindingContext(ko.utils.unwrapObservable(dataOrBindingContext)); var templateName = resolveTemplateName(template, bindingContext['$data'], bindingContext), renderedNodesArray = executeTemplate(targetNodeOrNodeArray, renderMode, templateName, bindingContext, options); if (renderMode == "replaceNode") { targetNodeOrNodeArray = renderedNodesArray; firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray); } }, null, { disposeWhen: whenToDispose, disposeWhenNodeIsRemoved: activelyDisposeWhenNodeIsRemoved } ); } else { // We don't yet have a DOM node to evaluate, so use a memo and render the template later when there is a DOM node return ko.memoization.memoize(function (domNode) { ko.renderTemplate(template, dataOrBindingContext, options, domNode, "replaceNode"); }); } }; ko.renderTemplateForEach = function (template, arrayOrObservableArray, options, targetNode, parentBindingContext) { // Since setDomNodeChildrenFromArrayMapping always calls executeTemplateForArrayItem and then // activateBindingsCallback for added items, we can store the binding context in the former to use in the latter. var arrayItemContext; // This will be called by setDomNodeChildrenFromArrayMapping to get the nodes to add to targetNode var executeTemplateForArrayItem = function (arrayValue, index) { // Support selecting template as a function of the data being rendered arrayItemContext = parentBindingContext['createChildContext'](arrayValue, options['as'], function(context) { context['$index'] = index; }); var templateName = resolveTemplateName(template, arrayValue, arrayItemContext); return executeTemplate(null, "ignoreTargetNode", templateName, arrayItemContext, options); } // This will be called whenever setDomNodeChildrenFromArrayMapping has added nodes to targetNode var activateBindingsCallback = function(arrayValue, addedNodesArray, index) { activateBindingsOnContinuousNodeArray(addedNodesArray, arrayItemContext); if (options['afterRender']) options['afterRender'](addedNodesArray, arrayValue); }; return ko.dependentObservable(function () { var unwrappedArray = ko.utils.unwrapObservable(arrayOrObservableArray) || []; if (typeof unwrappedArray.length == "undefined") // Coerce single value into array unwrappedArray = [unwrappedArray]; // Filter out any entries marked as destroyed var filteredArray = ko.utils.arrayFilter(unwrappedArray, function(item) { return options['includeDestroyed'] || item === undefined || item === null || !ko.utils.unwrapObservable(item['_destroy']); }); // Call setDomNodeChildrenFromArrayMapping, ignoring any observables unwrapped within (most likely from a callback function). // If the array items are observables, though, they will be unwrapped in executeTemplateForArrayItem and managed within setDomNodeChildrenFromArrayMapping. ko.dependencyDetection.ignore(ko.utils.setDomNodeChildrenFromArrayMapping, null, [targetNode, filteredArray, executeTemplateForArrayItem, options, activateBindingsCallback]); }, null, { disposeWhenNodeIsRemoved: targetNode }); }; var templateComputedDomDataKey = ko.utils.domData.nextKey(); function disposeOldComputedAndStoreNewOne(element, newComputed) { var oldComputed = ko.utils.domData.get(element, templateComputedDomDataKey); if (oldComputed && (typeof(oldComputed.dispose) == 'function')) oldComputed.dispose(); ko.utils.domData.set(element, templateComputedDomDataKey, (newComputed && newComputed.isActive()) ? newComputed : undefined); } ko.bindingHandlers['template'] = { 'init': function(element, valueAccessor) { // Support anonymous templates var bindingValue = ko.utils.unwrapObservable(valueAccessor()); if (typeof bindingValue == "string" || bindingValue['name']) { // It's a named template - clear the element ko.virtualElements.emptyNode(element); } else { // It's an anonymous template - store the element contents, then clear the element var templateNodes = ko.virtualElements.childNodes(element), container = ko.utils.moveCleanedNodesToContainerElement(templateNodes); // This also removes the nodes from their current parent new ko.templateSources.anonymousTemplate(element)['nodes'](container); } return { 'controlsDescendantBindings': true }; }, 'update': function (element, valueAccessor, allBindings, viewModel, bindingContext) { var value = valueAccessor(), dataValue, options = ko.utils.unwrapObservable(value), shouldDisplay = true, templateComputed = null, templateName; if (typeof options == "string") { templateName = value; options = {}; } else { templateName = options['name']; // Support "if"/"ifnot" conditions if ('if' in options) shouldDisplay = ko.utils.unwrapObservable(options['if']); if (shouldDisplay && 'ifnot' in options) shouldDisplay = !ko.utils.unwrapObservable(options['ifnot']); dataValue = ko.utils.unwrapObservable(options['data']); } if ('foreach' in options) { // Render once for each data point (treating data set as empty if shouldDisplay==false) var dataArray = (shouldDisplay && options['foreach']) || []; templateComputed = ko.renderTemplateForEach(templateName || element, dataArray, options, element, bindingContext); } else if (!shouldDisplay) { ko.virtualElements.emptyNode(element); } else { // Render once for this single data point (or use the viewModel if no data was provided) var innerBindingContext = ('data' in options) ? bindingContext['createChildContext'](dataValue, options['as']) : // Given an explitit 'data' value, we create a child binding context for it bindingContext; // Given no explicit 'data' value, we retain the same binding context templateComputed = ko.renderTemplate(templateName || element, innerBindingContext, options, element); } // It only makes sense to have a single template computed per element (otherwise which one should have its output displayed?) disposeOldComputedAndStoreNewOne(element, templateComputed); } }; // Anonymous templates can't be rewritten. Give a nice error message if you try to do it. ko.expressionRewriting.bindingRewriteValidators['template'] = function(bindingValue) { var parsedBindingValue = ko.expressionRewriting.parseObjectLiteral(bindingValue); if ((parsedBindingValue.length == 1) && parsedBindingValue[0]['unknown']) return null; // It looks like a string literal, not an object literal, so treat it as a named template (which is allowed for rewriting) if (ko.expressionRewriting.keyValueArrayContainsKey(parsedBindingValue, "name")) return null; // Named templates can be rewritten, so return "no error" return "This template engine does not support anonymous templates nested within its templates"; }; ko.virtualElements.allowedBindings['template'] = true; })(); ko.exportSymbol('setTemplateEngine', ko.setTemplateEngine); ko.exportSymbol('renderTemplate', ko.renderTemplate); // Go through the items that have been added and deleted and try to find matches between them. ko.utils.findMovesInArrayComparison = function (left, right, limitFailedCompares) { if (left.length && right.length) { var failedCompares, l, r, leftItem, rightItem; for (failedCompares = l = 0; (!limitFailedCompares || failedCompares < limitFailedCompares) && (leftItem = left[l]); ++l) { for (r = 0; rightItem = right[r]; ++r) { if (leftItem['value'] === rightItem['value']) { leftItem['moved'] = rightItem['index']; rightItem['moved'] = leftItem['index']; right.splice(r, 1); // This item is marked as moved; so remove it from right list failedCompares = r = 0; // Reset failed compares count because we're checking for consecutive failures break; } } failedCompares += r; } } }; ko.utils.compareArrays = (function () { var statusNotInOld = 'added', statusNotInNew = 'deleted'; // Simple calculation based on Levenshtein distance. function compareArrays(oldArray, newArray, options) { // For backward compatibility, if the third arg is actually a bool, interpret // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }. options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {}); oldArray = oldArray || []; newArray = newArray || []; if (oldArray.length <= newArray.length) return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options); else return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options); } function compareSmallArrayToBigArray(smlArray, bigArray, statusNotInSml, statusNotInBig, options) { var myMin = Math.min, myMax = Math.max, editDistanceMatrix = [], smlIndex, smlIndexMax = smlArray.length, bigIndex, bigIndexMax = bigArray.length, compareRange = (bigIndexMax - smlIndexMax) || 1, maxDistance = smlIndexMax + bigIndexMax + 1, thisRow, lastRow, bigIndexMaxForRow, bigIndexMinForRow; for (smlIndex = 0; smlIndex <= smlIndexMax; smlIndex++) { lastRow = thisRow; editDistanceMatrix.push(thisRow = []); bigIndexMaxForRow = myMin(bigIndexMax, smlIndex + compareRange); bigIndexMinForRow = myMax(0, smlIndex - 1); for (bigIndex = bigIndexMinForRow; bigIndex <= bigIndexMaxForRow; bigIndex++) { if (!bigIndex) thisRow[bigIndex] = smlIndex + 1; else if (!smlIndex) // Top row - transform empty array into new array via additions thisRow[bigIndex] = bigIndex + 1; else if (smlArray[smlIndex - 1] === bigArray[bigIndex - 1]) thisRow[bigIndex] = lastRow[bigIndex - 1]; // copy value (no edit) else { var northDistance = lastRow[bigIndex] || maxDistance; // not in big (deletion) var westDistance = thisRow[bigIndex - 1] || maxDistance; // not in small (addition) thisRow[bigIndex] = myMin(northDistance, westDistance) + 1; } } } var editScript = [], meMinusOne, notInSml = [], notInBig = []; for (smlIndex = smlIndexMax, bigIndex = bigIndexMax; smlIndex || bigIndex;) { meMinusOne = editDistanceMatrix[smlIndex][bigIndex] - 1; if (bigIndex && meMinusOne === editDistanceMatrix[smlIndex][bigIndex-1]) { notInSml.push(editScript[editScript.length] = { // added 'status': statusNotInSml, 'value': bigArray[--bigIndex], 'index': bigIndex }); } else if (smlIndex && meMinusOne === editDistanceMatrix[smlIndex - 1][bigIndex]) { notInBig.push(editScript[editScript.length] = { // deleted 'status': statusNotInBig, 'value': smlArray[--smlIndex], 'index': smlIndex }); } else { --bigIndex; --smlIndex; if (!options['sparse']) { editScript.push({ 'status': "retained", 'value': bigArray[bigIndex] }); } } } // Set a limit on the number of consecutive non-matching comparisons; having it a multiple of // smlIndexMax keeps the time complexity of this algorithm linear. ko.utils.findMovesInArrayComparison(notInSml, notInBig, smlIndexMax * 10); return editScript.reverse(); } return compareArrays; })(); ko.exportSymbol('utils.compareArrays', ko.utils.compareArrays); (function () { // Objective: // * Given an input array, a container DOM node, and a function from array elements to arrays of DOM nodes, // map the array elements to arrays of DOM nodes, concatenate together all these arrays, and use them to populate the container DOM node // * Next time we're given the same combination of things (with the array possibly having mutated), update the container DOM node // so that its children is again the concatenation of the mappings of the array elements, but don't re-map any array elements that we // previously mapped - retain those nodes, and just insert/delete other ones // "callbackAfterAddingNodes" will be invoked after any "mapping"-generated nodes are inserted into the container node // You can use this, for example, to activate bindings on those nodes. function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) { // Map this array value inside a dependentObservable so we re-map when any dependency changes var mappedNodes = []; var dependentObservable = ko.dependentObservable(function() { var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || []; // On subsequent evaluations, just replace the previously-inserted DOM nodes if (mappedNodes.length > 0) { ko.utils.replaceDomNodes(mappedNodes, newMappedNodes); if (callbackAfterAddingNodes) ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]); } // Replace the contents of the mappedNodes array, thereby updating the record // of which nodes would be deleted if valueToMap was itself later removed mappedNodes.length = 0; ko.utils.arrayPushAll(mappedNodes, newMappedNodes); }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } }); return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) }; } var lastMappingResultDomDataKey = ko.utils.domData.nextKey(); ko.utils.setDomNodeChildrenFromArrayMapping = function (domNode, array, mapping, options, callbackAfterAddingNodes) { // Compare the provided array against the previous one array = array || []; options = options || {}; var isFirstExecution = ko.utils.domData.get(domNode, lastMappingResultDomDataKey) === undefined; var lastMappingResult = ko.utils.domData.get(domNode, lastMappingResultDomDataKey) || []; var lastArray = ko.utils.arrayMap(lastMappingResult, function (x) { return x.arrayEntry; }); var editScript = ko.utils.compareArrays(lastArray, array, options['dontLimitMoves']); // Build the new mapping result var newMappingResult = []; var lastMappingResultIndex = 0; var newMappingResultIndex = 0; var nodesToDelete = []; var itemsToProcess = []; var itemsForBeforeRemoveCallbacks = []; var itemsForMoveCallbacks = []; var itemsForAfterAddCallbacks = []; var mapData; function itemMovedOrRetained(editScriptIndex, oldPosition) { mapData = lastMappingResult[oldPosition]; if (newMappingResultIndex !== oldPosition) itemsForMoveCallbacks[editScriptIndex] = mapData; // Since updating the index might change the nodes, do so before calling fixUpContinuousNodeArray mapData.indexObservable(newMappingResultIndex++); ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode); newMappingResult.push(mapData); itemsToProcess.push(mapData); } function callCallback(callback, items) { if (callback) { for (var i = 0, n = items.length; i < n; i++) { if (items[i]) { ko.utils.arrayForEach(items[i].mappedNodes, function(node) { callback(node, i, items[i].arrayEntry); }); } } } } for (var i = 0, editScriptItem, movedIndex; editScriptItem = editScript[i]; i++) { movedIndex = editScriptItem['moved']; switch (editScriptItem['status']) { case "deleted": if (movedIndex === undefined) { mapData = lastMappingResult[lastMappingResultIndex]; // Stop tracking changes to the mapping for these nodes if (mapData.dependentObservable) mapData.dependentObservable.dispose(); // Queue these nodes for later removal nodesToDelete.push.apply(nodesToDelete, ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode)); if (options['beforeRemove']) { itemsForBeforeRemoveCallbacks[i] = mapData; itemsToProcess.push(mapData); } } lastMappingResultIndex++; break; case "retained": itemMovedOrRetained(i, lastMappingResultIndex++); break; case "added": if (movedIndex !== undefined) { itemMovedOrRetained(i, movedIndex); } else { mapData = { arrayEntry: editScriptItem['value'], indexObservable: ko.observable(newMappingResultIndex++) }; newMappingResult.push(mapData); itemsToProcess.push(mapData); if (!isFirstExecution) itemsForAfterAddCallbacks[i] = mapData; } break; } } // Call beforeMove first before any changes have been made to the DOM callCallback(options['beforeMove'], itemsForMoveCallbacks); // Next remove nodes for deleted items (or just clean if there's a beforeRemove callback) ko.utils.arrayForEach(nodesToDelete, options['beforeRemove'] ? ko.cleanNode : ko.removeNode); // Next add/reorder the remaining items (will include deleted items if there's a beforeRemove callback) for (var i = 0, nextNode = ko.virtualElements.firstChild(domNode), lastNode, node; mapData = itemsToProcess[i]; i++) { // Get nodes for newly added items if (!mapData.mappedNodes) ko.utils.extend(mapData, mapNodeAndRefreshWhenChanged(domNode, mapping, mapData.arrayEntry, callbackAfterAddingNodes, mapData.indexObservable)); // Put nodes in the right place if they aren't there already for (var j = 0; node = mapData.mappedNodes[j]; nextNode = node.nextSibling, lastNode = node, j++) { if (node !== nextNode) ko.virtualElements.insertAfter(domNode, node, lastNode); } // Run the callbacks for newly added nodes (for example, to apply bindings, etc.) if (!mapData.initialized && callbackAfterAddingNodes) { callbackAfterAddingNodes(mapData.arrayEntry, mapData.mappedNodes, mapData.indexObservable); mapData.initialized = true; } } // If there's a beforeRemove callback, call it after reordering. // Note that we assume that the beforeRemove callback will usually be used to remove the nodes using // some sort of animation, which is why we first reorder the nodes that will be removed. If the // callback instead removes the nodes right away, it would be more efficient to skip reordering them. // Perhaps we'll make that change in the future if this scenario becomes more common. callCallback(options['beforeRemove'], itemsForBeforeRemoveCallbacks); // Finally call afterMove and afterAdd callbacks callCallback(options['afterMove'], itemsForMoveCallbacks); callCallback(options['afterAdd'], itemsForAfterAddCallbacks); // Store a copy of the array items we just considered so we can difference it next time ko.utils.domData.set(domNode, lastMappingResultDomDataKey, newMappingResult); } })(); ko.exportSymbol('utils.setDomNodeChildrenFromArrayMapping', ko.utils.setDomNodeChildrenFromArrayMapping); ko.nativeTemplateEngine = function () { this['allowTemplateRewriting'] = false; } ko.nativeTemplateEngine.prototype = new ko.templateEngine(); ko.nativeTemplateEngine.prototype.constructor = ko.nativeTemplateEngine; ko.nativeTemplateEngine.prototype['renderTemplateSource'] = function (templateSource, bindingContext, options) { var useNodesIfAvailable = !(ko.utils.ieVersion < 9), // IE<9 cloneNode doesn't work properly templateNodesFunc = useNodesIfAvailable ? templateSource['nodes'] : null, templateNodes = templateNodesFunc ? templateSource['nodes']() : null; if (templateNodes) { return ko.utils.makeArray(templateNodes.cloneNode(true).childNodes); } else { var templateText = templateSource['text'](); return ko.utils.parseHtmlFragment(templateText); } }; ko.nativeTemplateEngine.instance = new ko.nativeTemplateEngine(); ko.setTemplateEngine(ko.nativeTemplateEngine.instance); ko.exportSymbol('nativeTemplateEngine', ko.nativeTemplateEngine); (function() { ko.jqueryTmplTemplateEngine = function () { // Detect which version of jquery-tmpl you're using. Unfortunately jquery-tmpl // doesn't expose a version number, so we have to infer it. // Note that as of Knockout 1.3, we only support jQuery.tmpl 1.0.0pre and later, // which KO internally refers to as version "2", so older versions are no longer detected. var jQueryTmplVersion = this.jQueryTmplVersion = (function() { if (!jQueryInstance || !(jQueryInstance['tmpl'])) return 0; // Since it exposes no official version number, we use our own numbering system. To be updated as jquery-tmpl evolves. try { if (jQueryInstance['tmpl']['tag']['tmpl']['open'].toString().indexOf('__') >= 0) { // Since 1.0.0pre, custom tags should append markup to an array called "__" return 2; // Final version of jquery.tmpl } } catch(ex) { /* Apparently not the version we were looking for */ } return 1; // Any older version that we don't support })(); function ensureHasReferencedJQueryTemplates() { if (jQueryTmplVersion < 2) throw new Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."); } function executeTemplate(compiledTemplate, data, jQueryTemplateOptions) { return jQueryInstance['tmpl'](compiledTemplate, data, jQueryTemplateOptions); } this['renderTemplateSource'] = function(templateSource, bindingContext, options) { options = options || {}; ensureHasReferencedJQueryTemplates(); // Ensure we have stored a precompiled version of this template (don't want to reparse on every render) var precompiled = templateSource['data']('precompiled'); if (!precompiled) { var templateText = templateSource['text']() || ""; // Wrap in "with($whatever.koBindingContext) { ... }" templateText = "{{ko_with $item.koBindingContext}}" + templateText + "{{/ko_with}}"; precompiled = jQueryInstance['template'](null, templateText); templateSource['data']('precompiled', precompiled); } var data = [bindingContext['$data']]; // Prewrap the data in an array to stop jquery.tmpl from trying to unwrap any arrays var jQueryTemplateOptions = jQueryInstance['extend']({ 'koBindingContext': bindingContext }, options['templateOptions']); var resultNodes = executeTemplate(precompiled, data, jQueryTemplateOptions); resultNodes['appendTo'](document.createElement("div")); // Using "appendTo" forces jQuery/jQuery.tmpl to perform necessary cleanup work jQueryInstance['fragments'] = {}; // Clear jQuery's fragment cache to avoid a memory leak after a large number of template renders return resultNodes; }; this['createJavaScriptEvaluatorBlock'] = function(script) { return "{{ko_code ((function() { return " + script + " })()) }}"; }; this['addTemplate'] = function(templateName, templateMarkup) { document.write("<script type='text/html' id='" + templateName + "'>" + templateMarkup + "<" + "/script>"); }; if (jQueryTmplVersion > 0) { jQueryInstance['tmpl']['tag']['ko_code'] = { open: "__.push($1 || '');" }; jQueryInstance['tmpl']['tag']['ko_with'] = { open: "with($1) {", close: "} " }; } }; ko.jqueryTmplTemplateEngine.prototype = new ko.templateEngine(); ko.jqueryTmplTemplateEngine.prototype.constructor = ko.jqueryTmplTemplateEngine; // Use this one by default *only if jquery.tmpl is referenced* var jqueryTmplTemplateEngineInstance = new ko.jqueryTmplTemplateEngine(); if (jqueryTmplTemplateEngineInstance.jQueryTmplVersion > 0) ko.setTemplateEngine(jqueryTmplTemplateEngineInstance); ko.exportSymbol('jqueryTmplTemplateEngine', ko.jqueryTmplTemplateEngine); })(); })); }()); })();
src/svg-icons/communication/call-merge.js
pomerantsev/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let CommunicationCallMerge = (props) => ( <SvgIcon {...props}> <path d="M17 20.41L18.41 19 15 15.59 13.59 17 17 20.41zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5 7.5 8z"/> </SvgIcon> ); CommunicationCallMerge = pure(CommunicationCallMerge); CommunicationCallMerge.displayName = 'CommunicationCallMerge'; CommunicationCallMerge.muiName = 'SvgIcon'; export default CommunicationCallMerge;
lib/Table.js
Imballinst/react-bs-datatable
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.useDatatableLifecycle = void 0; var react_1 = __importStar(require("react")); var data_1 = require("./helpers/data"); var Pagination_1 = __importDefault(require("./Pagination")); var PaginationOpts_1 = __importDefault(require("./PaginationOpts")); var TableHeader_1 = __importDefault(require("./TableHeader")); var TableBody_1 = __importDefault(require("./TableBody")); var Filter_1 = __importDefault(require("./Filter")); var object_1 = require("./helpers/object"); var Row_1 = __importDefault(require("react-bootstrap/Row")); var Button_1 = __importDefault(require("react-bootstrap/Button")); var Table_1 = __importDefault(require("react-bootstrap/Table")); var Col_1 = __importDefault(require("react-bootstrap/Col")); var ButtonGroup_1 = __importDefault(require("react-bootstrap/ButtonGroup")); var FontAwesome_1 = __importDefault(require("./modules/FontAwesome")); var TableContext_1 = require("./modules/TableContext"); /** * Datatable lifecycle convenient function. * It will be used when we are extending the table. **/ function useDatatableLifecycle(_a) { var initialSort = _a.initialSort, onSort = _a.onSort, onFilter = _a.onFilter, rowsPerPage = _a.rowsPerPage, rowsPerPageOption = _a.rowsPerPageOption, async = _a.async, tableHeaders = _a.tableHeaders, _b = _a.classes, classes = _b === void 0 ? {} : _b, tableBody = _a.tableBody, _c = _a.labels, labels = _c === void 0 ? {} : _c, Components = _a.Components, onRowClick = _a.onRowClick; react_1.useEffect(function () { // If in development, warn if async and onSort/onFilter are both passed. if (process.env.NODE_ENV === 'development') { if (async !== undefined) { // Warn if onSort and/or onFilter is/are also passed down. var str = []; if (onSort !== undefined) { str.push('[onSort]'); } if (onFilter !== undefined) { str.push('[onFilter]'); } if (str.length > 0) { console.warn("You are passing [async] props along with " + object_1.customJoin(str, ' and ') + ". When [async] is enabled, you should not pass onFilter or onSort."); } // Warn if all async options are not passed. str = []; if (async.onFilter === undefined) { str.push('[async.onFilter]'); } if (async.onSort === undefined) { str.push('[async.onSort]'); } if (async.onPaginate === undefined) { str.push('[async.onPaginate]'); } if (str.length > 0) { console.warn("These async props are missing: " + object_1.customJoin(str, ', ', 'and ')); } } } }, []); var _d = react_1.useState(function () { var sortObj = initialSort || {}; var filterable = async !== undefined && async.onFilter !== undefined; var defaultSort = {}; tableHeaders.forEach(function (header) { if (header.prop === sortObj.prop) { if (header.sortable) { defaultSort = { isAscending: true, prop: header.prop }; } } if (header.filterable && async === undefined && !filterable) { filterable = true; } }); // Define initial state. return { sortedProp: defaultSort, filterable: filterable, rowsPerPage: rowsPerPage, currentPage: 1, filterText: '' }; }), state = _d[0], setState = _d[1]; react_1.useEffect(function () { // Resets the table if the data passed down is different. if (tableBody !== undefined) { setState(function (oldState) { return (__assign(__assign({}, oldState), { filterText: '', currentPage: 1, rowsPerPage: rowsPerPage })); }); } }, [tableBody, rowsPerPage]); function onChangeFilter(text) { if (async && async.onFilter) { async.onFilter(text); } else { setState(function (oldState) { return (__assign(__assign({}, oldState), { filterText: text, currentPage: 1 })); }); } } function onPageNavigate(nextPage) { if (async && async.onPaginate) { async.onPaginate(nextPage); } else { setState(function (oldState) { return (__assign(__assign({}, oldState), { currentPage: nextPage })); }); } } function onRowsPerPageChange(numOfPage) { if (async && async.onRowsPerPageChange) { async.onRowsPerPageChange(numOfPage); } else { setState(function (oldState) { return (__assign(__assign({}, oldState), { rowsPerPage: numOfPage, currentPage: 1 })); }); } } function onSortChange(nextProp) { if (async && async.onSort) { async.onSort(nextProp); } else { var nextSort_1 = state.sortedProp; if (nextProp !== state.sortedProp.prop) { nextSort_1.prop = nextProp; nextSort_1.isAscending = true; } else { nextSort_1.isAscending = !state.sortedProp.isAscending; } setState(function (oldState) { return (__assign(__assign({}, oldState), { sortedProp: nextSort_1 })); }); } } var data = tableBody; var maxPage; if (async === undefined) { data = data_1.filterData(tableBody, tableHeaders, state.filterText, onFilter); data = data_1.sortData(data, state.sortedProp, onSort); if (state.rowsPerPage) { // Pagination needs. data = data_1.paginateData(data, state.currentPage, state.rowsPerPage); maxPage = Math.ceil(tableBody.length / state.rowsPerPage); } } else { maxPage = async.maxPage; } var tableClass = object_1.makeClasses("table-datatable__root", classes.table); // Default components. // If context has keys, then use context. Instead, use Components props. var context = TableContext_1.useComponentProvider(); var passedComponents = Object.keys(context).length > 0 ? context : Components; var usedComponents = { // Global. Row: Row_1.default, Col: Col_1.default, Button: Button_1.default, // Table. Table: Table_1.default, TableHead: 'thead', TableBody: 'tbody', TableRow: 'tr', TableCell: 'td', // Filter. FilterGroup: undefined, // Pagination. ButtonGroup: ButtonGroup_1.default, // Pagination options. PaginationOptsGroup: undefined, // ICons. SortIcon: FontAwesome_1.default }; if (passedComponents !== undefined) { if (typeof passedComponents === 'object') { for (var key in passedComponents) { // Replace usedComponent fields with the passedComponents fields. usedComponents[key] = passedComponents[key]; } } } return { data: data, tableHeaders: tableHeaders, onChangeFilter: onChangeFilter, onPageNavigate: onPageNavigate, classes: classes, onRowsPerPageChange: onRowsPerPageChange, onSortChange: onSortChange, tableClass: tableClass, labels: labels, rowsPerPageOption: rowsPerPageOption, Components: usedComponents, onRowClick: onRowClick, // States. filterable: state.filterable, filterText: async ? async.filterText : state.filterText, rowsPerPage: async ? async.rowsPerPage : state.rowsPerPage, currentPage: async ? async.currentPage : state.currentPage, sortedProp: async ? async.sortedProp : state.sortedProp, maxPage: maxPage }; } exports.useDatatableLifecycle = useDatatableLifecycle; /** Datatable Component. */ function Datatable(props) { var _a = useDatatableLifecycle(props), data = _a.data, rowsPerPageOption = _a.rowsPerPageOption, tableHeaders = _a.tableHeaders, onChangeFilter = _a.onChangeFilter, onPageNavigate = _a.onPageNavigate, classes = _a.classes, onRowsPerPageChange = _a.onRowsPerPageChange, onSortChange = _a.onSortChange, tableClass = _a.tableClass, labels = _a.labels, filterable = _a.filterable, filterText = _a.filterText, rowsPerPage = _a.rowsPerPage, currentPage = _a.currentPage, sortedProp = _a.sortedProp, maxPage = _a.maxPage, Components = _a.Components, onRowClick = _a.onRowClick; return (react_1.default.createElement(react_1.default.Fragment, null, react_1.default.createElement(Components.Row, { className: object_1.makeClasses('controlRow__root', classes.controlRow) }, react_1.default.createElement(Components.Col, { xs: 12, sm: 4, className: classes.filterCol }, react_1.default.createElement(Filter_1.default, { filterable: filterable, classes: classes, placeholder: labels.filterPlaceholder, onChangeFilter: onChangeFilter, filterText: filterText, CustomFilterGroup: Components.FilterGroup })), react_1.default.createElement(Components.Col, { xs: 12, sm: 2, className: classes.paginationOptsCol }, react_1.default.createElement(PaginationOpts_1.default, { classes: classes, labels: labels, onRowsPerPageChange: onRowsPerPageChange, rowsPerPage: rowsPerPage, rowsPerPageOption: rowsPerPageOption, CustomPaginationOptsGroup: Components.PaginationOptsGroup })), react_1.default.createElement(Components.Col, { xs: 12, sm: 6, className: object_1.makeClasses('text-right', classes.paginationCol) }, react_1.default.createElement(Pagination_1.default, { maxPage: maxPage, classes: classes, rowsPerPage: rowsPerPage, currentPage: currentPage, onPageNavigate: onPageNavigate, labels: labels, components: { Button: Components.Button, ButtonGroup: Components.ButtonGroup } }))), react_1.default.createElement(Components.Row, null, react_1.default.createElement(Components.Col, { xs: 12 }, react_1.default.createElement(Table_1.default, { className: tableClass }, react_1.default.createElement(TableHeader_1.default, { classes: classes, tableHeaders: tableHeaders, sortedProp: sortedProp, onSortChange: onSortChange, components: { TableHead: Components.TableHead, TableCell: Components.TableCell, TableRow: Components.TableRow } }), react_1.default.createElement(TableBody_1.default, { classes: classes, tableHeaders: tableHeaders, labels: labels, data: data, components: { TableBody: Components.TableBody, TableCell: Components.TableCell, TableRow: Components.TableRow }, onRowClick: onRowClick })))))); } // Only update if rowsPerPage, rowsPerPageOption, and tableBody changes. exports.default = react_1.default.memo(Datatable, object_1.shouldTableUpdate); //# sourceMappingURL=Table.js.map
ajax/libs/clappr/0.0.6/clappr.light.js
hpneo/cdnjs
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } module.exports = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } else { throw TypeError('Uncaught, unspecified "error" event.'); } return false; } } handler = this._events[type]; if (isUndefined(handler)) return false; if (isFunction(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: len = arguments.length; args = new Array(len - 1); for (i = 1; i < len; i++) args[i - 1] = arguments[i]; handler.apply(this, args); } } else if (isObject(handler)) { len = arguments.length; args = new Array(len - 1); for (i = 1; i < len; i++) args[i - 1] = arguments[i]; listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject(this._events[type]) && !this._events[type].warned) { var m; if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction(listeners)) { this.removeListener(type, listeners); } else { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.listenerCount = function(emitter, type) { var ret; if (!emitter._events || !emitter._events[type]) ret = 0; else if (isFunction(emitter._events[type])) ret = 1; else ret = emitter._events[type].length; return ret; }; function isFunction(arg) { return typeof arg === 'function'; } function isNumber(arg) { return typeof arg === 'number'; } function isObject(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined(arg) { return arg === void 0; } },{}],2:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; process.nextTick = (function () { var canSetImmediate = typeof window !== 'undefined' && window.setImmediate; var canPost = typeof window !== 'undefined' && window.postMessage && window.addEventListener ; if (canSetImmediate) { return function (f) { return window.setImmediate(f) }; } if (canPost) { var queue = []; window.addEventListener('message', function (ev) { var source = ev.source; if ((source === window || source === null) && ev.data === 'process-tick') { ev.stopPropagation(); if (queue.length > 0) { var fn = queue.shift(); fn(); } } }, true); return function nextTick(fn) { queue.push(fn); window.postMessage('process-tick', '*'); }; } return function nextTick(fn) { setTimeout(fn, 0); }; })(); process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); } // TODO(shtylman) process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; },{}],3:[function(require,module,exports){ (function (process,global){ (function(global) { 'use strict'; if (global.$traceurRuntime) { return; } var $Object = Object; var $TypeError = TypeError; var $create = $Object.create; var $defineProperties = $Object.defineProperties; var $defineProperty = $Object.defineProperty; var $freeze = $Object.freeze; var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor; var $getOwnPropertyNames = $Object.getOwnPropertyNames; var $keys = $Object.keys; var $hasOwnProperty = $Object.prototype.hasOwnProperty; var $toString = $Object.prototype.toString; var $preventExtensions = Object.preventExtensions; var $seal = Object.seal; var $isExtensible = Object.isExtensible; function nonEnum(value) { return { configurable: true, enumerable: false, value: value, writable: true }; } var types = { void: function voidType() {}, any: function any() {}, string: function string() {}, number: function number() {}, boolean: function boolean() {} }; var method = nonEnum; var counter = 0; function newUniqueString() { return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__'; } var symbolInternalProperty = newUniqueString(); var symbolDescriptionProperty = newUniqueString(); var symbolDataProperty = newUniqueString(); var symbolValues = $create(null); var privateNames = $create(null); function createPrivateName() { var s = newUniqueString(); privateNames[s] = true; return s; } function isSymbol(symbol) { return typeof symbol === 'object' && symbol instanceof SymbolValue; } function typeOf(v) { if (isSymbol(v)) return 'symbol'; return typeof v; } function Symbol(description) { var value = new SymbolValue(description); if (!(this instanceof Symbol)) return value; throw new TypeError('Symbol cannot be new\'ed'); } $defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol)); $defineProperty(Symbol.prototype, 'toString', method(function() { var symbolValue = this[symbolDataProperty]; if (!getOption('symbols')) return symbolValue[symbolInternalProperty]; if (!symbolValue) throw TypeError('Conversion from symbol to string'); var desc = symbolValue[symbolDescriptionProperty]; if (desc === undefined) desc = ''; return 'Symbol(' + desc + ')'; })); $defineProperty(Symbol.prototype, 'valueOf', method(function() { var symbolValue = this[symbolDataProperty]; if (!symbolValue) throw TypeError('Conversion from symbol to string'); if (!getOption('symbols')) return symbolValue[symbolInternalProperty]; return symbolValue; })); function SymbolValue(description) { var key = newUniqueString(); $defineProperty(this, symbolDataProperty, {value: this}); $defineProperty(this, symbolInternalProperty, {value: key}); $defineProperty(this, symbolDescriptionProperty, {value: description}); freeze(this); symbolValues[key] = this; } $defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol)); $defineProperty(SymbolValue.prototype, 'toString', { value: Symbol.prototype.toString, enumerable: false }); $defineProperty(SymbolValue.prototype, 'valueOf', { value: Symbol.prototype.valueOf, enumerable: false }); var hashProperty = createPrivateName(); var hashPropertyDescriptor = {value: undefined}; var hashObjectProperties = { hash: {value: undefined}, self: {value: undefined} }; var hashCounter = 0; function getOwnHashObject(object) { var hashObject = object[hashProperty]; if (hashObject && hashObject.self === object) return hashObject; if ($isExtensible(object)) { hashObjectProperties.hash.value = hashCounter++; hashObjectProperties.self.value = object; hashPropertyDescriptor.value = $create(null, hashObjectProperties); $defineProperty(object, hashProperty, hashPropertyDescriptor); return hashPropertyDescriptor.value; } return undefined; } function freeze(object) { getOwnHashObject(object); return $freeze.apply(this, arguments); } function preventExtensions(object) { getOwnHashObject(object); return $preventExtensions.apply(this, arguments); } function seal(object) { getOwnHashObject(object); return $seal.apply(this, arguments); } Symbol.iterator = Symbol(); freeze(SymbolValue.prototype); function toProperty(name) { if (isSymbol(name)) return name[symbolInternalProperty]; return name; } function getOwnPropertyNames(object) { var rv = []; var names = $getOwnPropertyNames(object); for (var i = 0; i < names.length; i++) { var name = names[i]; if (!symbolValues[name] && !privateNames[name]) rv.push(name); } return rv; } function getOwnPropertyDescriptor(object, name) { return $getOwnPropertyDescriptor(object, toProperty(name)); } function getOwnPropertySymbols(object) { var rv = []; var names = $getOwnPropertyNames(object); for (var i = 0; i < names.length; i++) { var symbol = symbolValues[names[i]]; if (symbol) rv.push(symbol); } return rv; } function hasOwnProperty(name) { return $hasOwnProperty.call(this, toProperty(name)); } function getOption(name) { return global.traceur && global.traceur.options[name]; } function setProperty(object, name, value) { var sym, desc; if (isSymbol(name)) { sym = name; name = name[symbolInternalProperty]; } object[name] = value; if (sym && (desc = $getOwnPropertyDescriptor(object, name))) $defineProperty(object, name, {enumerable: false}); return value; } function defineProperty(object, name, descriptor) { if (isSymbol(name)) { if (descriptor.enumerable) { descriptor = $create(descriptor, {enumerable: {value: false}}); } name = name[symbolInternalProperty]; } $defineProperty(object, name, descriptor); return object; } function polyfillObject(Object) { $defineProperty(Object, 'defineProperty', {value: defineProperty}); $defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames}); $defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor}); $defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty}); $defineProperty(Object, 'freeze', {value: freeze}); $defineProperty(Object, 'preventExtensions', {value: preventExtensions}); $defineProperty(Object, 'seal', {value: seal}); Object.getOwnPropertySymbols = getOwnPropertySymbols; } function exportStar(object) { for (var i = 1; i < arguments.length; i++) { var names = $getOwnPropertyNames(arguments[i]); for (var j = 0; j < names.length; j++) { var name = names[j]; if (privateNames[name]) continue; (function(mod, name) { $defineProperty(object, name, { get: function() { return mod[name]; }, enumerable: true }); })(arguments[i], names[j]); } } return object; } function isObject(x) { return x != null && (typeof x === 'object' || typeof x === 'function'); } function toObject(x) { if (x == null) throw $TypeError(); return $Object(x); } function assertObject(x) { if (!isObject(x)) throw $TypeError(x + ' is not an Object'); return x; } function setupGlobals(global) { global.Symbol = Symbol; polyfillObject(global.Object); } setupGlobals(global); global.$traceurRuntime = { assertObject: assertObject, createPrivateName: createPrivateName, exportStar: exportStar, getOwnHashObject: getOwnHashObject, privateNames: privateNames, setProperty: setProperty, setupGlobals: setupGlobals, toObject: toObject, toProperty: toProperty, type: types, typeof: typeOf, defineProperties: $defineProperties, defineProperty: $defineProperty, getOwnPropertyDescriptor: $getOwnPropertyDescriptor, getOwnPropertyNames: $getOwnPropertyNames, keys: $keys }; })(typeof global !== 'undefined' ? global : this); (function() { 'use strict'; var toObject = $traceurRuntime.toObject; function spread() { var rv = [], k = 0; for (var i = 0; i < arguments.length; i++) { var valueToSpread = toObject(arguments[i]); for (var j = 0; j < valueToSpread.length; j++) { rv[k++] = valueToSpread[j]; } } return rv; } $traceurRuntime.spread = spread; })(); (function() { 'use strict'; var $Object = Object; var $TypeError = TypeError; var $create = $Object.create; var $defineProperties = $traceurRuntime.defineProperties; var $defineProperty = $traceurRuntime.defineProperty; var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor; var $getOwnPropertyNames = $traceurRuntime.getOwnPropertyNames; var $getPrototypeOf = Object.getPrototypeOf; function superDescriptor(homeObject, name) { var proto = $getPrototypeOf(homeObject); do { var result = $getOwnPropertyDescriptor(proto, name); if (result) return result; proto = $getPrototypeOf(proto); } while (proto); return undefined; } function superCall(self, homeObject, name, args) { return superGet(self, homeObject, name).apply(self, args); } function superGet(self, homeObject, name) { var descriptor = superDescriptor(homeObject, name); if (descriptor) { if (!descriptor.get) return descriptor.value; return descriptor.get.call(self); } return undefined; } function superSet(self, homeObject, name, value) { var descriptor = superDescriptor(homeObject, name); if (descriptor && descriptor.set) { descriptor.set.call(self, value); return value; } throw $TypeError("super has no setter '" + name + "'."); } function getDescriptors(object) { var descriptors = {}, name, names = $getOwnPropertyNames(object); for (var i = 0; i < names.length; i++) { var name = names[i]; descriptors[name] = $getOwnPropertyDescriptor(object, name); } return descriptors; } function createClass(ctor, object, staticObject, superClass) { $defineProperty(object, 'constructor', { value: ctor, configurable: true, enumerable: false, writable: true }); if (arguments.length > 3) { if (typeof superClass === 'function') ctor.__proto__ = superClass; ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object)); } else { ctor.prototype = object; } $defineProperty(ctor, 'prototype', { configurable: false, writable: false }); return $defineProperties(ctor, getDescriptors(staticObject)); } function getProtoParent(superClass) { if (typeof superClass === 'function') { var prototype = superClass.prototype; if ($Object(prototype) === prototype || prototype === null) return superClass.prototype; } if (superClass === null) return null; throw new $TypeError(); } function defaultSuperCall(self, homeObject, args) { if ($getPrototypeOf(homeObject) !== null) superCall(self, homeObject, 'constructor', args); } $traceurRuntime.createClass = createClass; $traceurRuntime.defaultSuperCall = defaultSuperCall; $traceurRuntime.superCall = superCall; $traceurRuntime.superGet = superGet; $traceurRuntime.superSet = superSet; })(); (function() { 'use strict'; var createPrivateName = $traceurRuntime.createPrivateName; var $defineProperties = $traceurRuntime.defineProperties; var $defineProperty = $traceurRuntime.defineProperty; var $create = Object.create; var $TypeError = TypeError; function nonEnum(value) { return { configurable: true, enumerable: false, value: value, writable: true }; } var ST_NEWBORN = 0; var ST_EXECUTING = 1; var ST_SUSPENDED = 2; var ST_CLOSED = 3; var END_STATE = -2; var RETHROW_STATE = -3; function getInternalError(state) { return new Error('Traceur compiler bug: invalid state in state machine: ' + state); } function GeneratorContext() { this.state = 0; this.GState = ST_NEWBORN; this.storedException = undefined; this.finallyFallThrough = undefined; this.sent_ = undefined; this.returnValue = undefined; this.tryStack_ = []; } GeneratorContext.prototype = { pushTry: function(catchState, finallyState) { if (finallyState !== null) { var finallyFallThrough = null; for (var i = this.tryStack_.length - 1; i >= 0; i--) { if (this.tryStack_[i].catch !== undefined) { finallyFallThrough = this.tryStack_[i].catch; break; } } if (finallyFallThrough === null) finallyFallThrough = RETHROW_STATE; this.tryStack_.push({ finally: finallyState, finallyFallThrough: finallyFallThrough }); } if (catchState !== null) { this.tryStack_.push({catch: catchState}); } }, popTry: function() { this.tryStack_.pop(); }, get sent() { this.maybeThrow(); return this.sent_; }, set sent(v) { this.sent_ = v; }, get sentIgnoreThrow() { return this.sent_; }, maybeThrow: function() { if (this.action === 'throw') { this.action = 'next'; throw this.sent_; } }, end: function() { switch (this.state) { case END_STATE: return this; case RETHROW_STATE: throw this.storedException; default: throw getInternalError(this.state); } }, handleException: function(ex) { this.GState = ST_CLOSED; this.state = END_STATE; throw ex; } }; function nextOrThrow(ctx, moveNext, action, x) { switch (ctx.GState) { case ST_EXECUTING: throw new Error(("\"" + action + "\" on executing generator")); case ST_CLOSED: if (action == 'next') { return { value: undefined, done: true }; } throw new Error(("\"" + action + "\" on closed generator")); case ST_NEWBORN: if (action === 'throw') { ctx.GState = ST_CLOSED; throw x; } if (x !== undefined) throw $TypeError('Sent value to newborn generator'); case ST_SUSPENDED: ctx.GState = ST_EXECUTING; ctx.action = action; ctx.sent = x; var value = moveNext(ctx); var done = value === ctx; if (done) value = ctx.returnValue; ctx.GState = done ? ST_CLOSED : ST_SUSPENDED; return { value: value, done: done }; } } var ctxName = createPrivateName(); var moveNextName = createPrivateName(); function GeneratorFunction() {} function GeneratorFunctionPrototype() {} GeneratorFunction.prototype = GeneratorFunctionPrototype; $defineProperty(GeneratorFunctionPrototype, 'constructor', nonEnum(GeneratorFunction)); GeneratorFunctionPrototype.prototype = { constructor: GeneratorFunctionPrototype, next: function(v) { return nextOrThrow(this[ctxName], this[moveNextName], 'next', v); }, throw: function(v) { return nextOrThrow(this[ctxName], this[moveNextName], 'throw', v); } }; $defineProperties(GeneratorFunctionPrototype.prototype, { constructor: {enumerable: false}, next: {enumerable: false}, throw: {enumerable: false} }); Object.defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() { return this; })); function createGeneratorInstance(innerFunction, functionObject, self) { var moveNext = getMoveNext(innerFunction, self); var ctx = new GeneratorContext(); var object = $create(functionObject.prototype); object[ctxName] = ctx; object[moveNextName] = moveNext; return object; } function initGeneratorFunction(functionObject) { functionObject.prototype = $create(GeneratorFunctionPrototype.prototype); functionObject.__proto__ = GeneratorFunctionPrototype; return functionObject; } function AsyncFunctionContext() { GeneratorContext.call(this); this.err = undefined; var ctx = this; ctx.result = new Promise(function(resolve, reject) { ctx.resolve = resolve; ctx.reject = reject; }); } AsyncFunctionContext.prototype = $create(GeneratorContext.prototype); AsyncFunctionContext.prototype.end = function() { switch (this.state) { case END_STATE: this.resolve(this.returnValue); break; case RETHROW_STATE: this.reject(this.storedException); break; default: this.reject(getInternalError(this.state)); } }; AsyncFunctionContext.prototype.handleException = function() { this.state = RETHROW_STATE; }; function asyncWrap(innerFunction, self) { var moveNext = getMoveNext(innerFunction, self); var ctx = new AsyncFunctionContext(); ctx.createCallback = function(newState) { return function(value) { ctx.state = newState; ctx.value = value; moveNext(ctx); }; }; ctx.errback = function(err) { handleCatch(ctx, err); moveNext(ctx); }; moveNext(ctx); return ctx.result; } function getMoveNext(innerFunction, self) { return function(ctx) { while (true) { try { return innerFunction.call(self, ctx); } catch (ex) { handleCatch(ctx, ex); } } }; } function handleCatch(ctx, ex) { ctx.storedException = ex; var last = ctx.tryStack_[ctx.tryStack_.length - 1]; if (!last) { ctx.handleException(ex); return; } ctx.state = last.catch !== undefined ? last.catch : last.finally; if (last.finallyFallThrough !== undefined) ctx.finallyFallThrough = last.finallyFallThrough; } $traceurRuntime.asyncWrap = asyncWrap; $traceurRuntime.initGeneratorFunction = initGeneratorFunction; $traceurRuntime.createGeneratorInstance = createGeneratorInstance; })(); (function() { function buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { var out = []; if (opt_scheme) { out.push(opt_scheme, ':'); } if (opt_domain) { out.push('//'); if (opt_userInfo) { out.push(opt_userInfo, '@'); } out.push(opt_domain); if (opt_port) { out.push(':', opt_port); } } if (opt_path) { out.push(opt_path); } if (opt_queryData) { out.push('?', opt_queryData); } if (opt_fragment) { out.push('#', opt_fragment); } return out.join(''); } ; var splitRe = new RegExp('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); var ComponentIndex = { SCHEME: 1, USER_INFO: 2, DOMAIN: 3, PORT: 4, PATH: 5, QUERY_DATA: 6, FRAGMENT: 7 }; function split(uri) { return (uri.match(splitRe)); } function removeDotSegments(path) { if (path === '/') return '/'; var leadingSlash = path[0] === '/' ? '/' : ''; var trailingSlash = path.slice(-1) === '/' ? '/' : ''; var segments = path.split('/'); var out = []; var up = 0; for (var pos = 0; pos < segments.length; pos++) { var segment = segments[pos]; switch (segment) { case '': case '.': break; case '..': if (out.length) out.pop(); else up++; break; default: out.push(segment); } } if (!leadingSlash) { while (up-- > 0) { out.unshift('..'); } if (out.length === 0) out.push('.'); } return leadingSlash + out.join('/') + trailingSlash; } function joinAndCanonicalizePath(parts) { var path = parts[ComponentIndex.PATH] || ''; path = removeDotSegments(path); parts[ComponentIndex.PATH] = path; return buildFromEncodedParts(parts[ComponentIndex.SCHEME], parts[ComponentIndex.USER_INFO], parts[ComponentIndex.DOMAIN], parts[ComponentIndex.PORT], parts[ComponentIndex.PATH], parts[ComponentIndex.QUERY_DATA], parts[ComponentIndex.FRAGMENT]); } function canonicalizeUrl(url) { var parts = split(url); return joinAndCanonicalizePath(parts); } function resolveUrl(base, url) { var parts = split(url); var baseParts = split(base); if (parts[ComponentIndex.SCHEME]) { return joinAndCanonicalizePath(parts); } else { parts[ComponentIndex.SCHEME] = baseParts[ComponentIndex.SCHEME]; } for (var i = ComponentIndex.SCHEME; i <= ComponentIndex.PORT; i++) { if (!parts[i]) { parts[i] = baseParts[i]; } } if (parts[ComponentIndex.PATH][0] == '/') { return joinAndCanonicalizePath(parts); } var path = baseParts[ComponentIndex.PATH]; var index = path.lastIndexOf('/'); path = path.slice(0, index + 1) + parts[ComponentIndex.PATH]; parts[ComponentIndex.PATH] = path; return joinAndCanonicalizePath(parts); } function isAbsolute(name) { if (!name) return false; if (name[0] === '/') return true; var parts = split(name); if (parts[ComponentIndex.SCHEME]) return true; return false; } $traceurRuntime.canonicalizeUrl = canonicalizeUrl; $traceurRuntime.isAbsolute = isAbsolute; $traceurRuntime.removeDotSegments = removeDotSegments; $traceurRuntime.resolveUrl = resolveUrl; })(); (function(global) { 'use strict'; var $__2 = $traceurRuntime.assertObject($traceurRuntime), canonicalizeUrl = $__2.canonicalizeUrl, resolveUrl = $__2.resolveUrl, isAbsolute = $__2.isAbsolute; var moduleInstantiators = Object.create(null); var baseURL; if (global.location && global.location.href) baseURL = resolveUrl(global.location.href, './'); else baseURL = ''; var UncoatedModuleEntry = function UncoatedModuleEntry(url, uncoatedModule) { this.url = url; this.value_ = uncoatedModule; }; ($traceurRuntime.createClass)(UncoatedModuleEntry, {}, {}); var UncoatedModuleInstantiator = function UncoatedModuleInstantiator(url, func) { $traceurRuntime.superCall(this, $UncoatedModuleInstantiator.prototype, "constructor", [url, null]); this.func = func; }; var $UncoatedModuleInstantiator = UncoatedModuleInstantiator; ($traceurRuntime.createClass)(UncoatedModuleInstantiator, {getUncoatedModule: function() { if (this.value_) return this.value_; return this.value_ = this.func.call(global); }}, {}, UncoatedModuleEntry); function getUncoatedModuleInstantiator(name) { if (!name) return; var url = ModuleStore.normalize(name); return moduleInstantiators[url]; } ; var moduleInstances = Object.create(null); var liveModuleSentinel = {}; function Module(uncoatedModule) { var isLive = arguments[1]; var coatedModule = Object.create(null); Object.getOwnPropertyNames(uncoatedModule).forEach((function(name) { var getter, value; if (isLive === liveModuleSentinel) { var descr = Object.getOwnPropertyDescriptor(uncoatedModule, name); if (descr.get) getter = descr.get; } if (!getter) { value = uncoatedModule[name]; getter = function() { return value; }; } Object.defineProperty(coatedModule, name, { get: getter, enumerable: true }); })); Object.preventExtensions(coatedModule); return coatedModule; } var ModuleStore = { normalize: function(name, refererName, refererAddress) { if (typeof name !== "string") throw new TypeError("module name must be a string, not " + typeof name); if (isAbsolute(name)) return canonicalizeUrl(name); if (/[^\.]\/\.\.\//.test(name)) { throw new Error('module name embeds /../: ' + name); } if (name[0] === '.' && refererName) return resolveUrl(refererName, name); return canonicalizeUrl(name); }, get: function(normalizedName) { var m = getUncoatedModuleInstantiator(normalizedName); if (!m) return undefined; var moduleInstance = moduleInstances[m.url]; if (moduleInstance) return moduleInstance; moduleInstance = Module(m.getUncoatedModule(), liveModuleSentinel); return moduleInstances[m.url] = moduleInstance; }, set: function(normalizedName, module) { normalizedName = String(normalizedName); moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, (function() { return module; })); moduleInstances[normalizedName] = module; }, get baseURL() { return baseURL; }, set baseURL(v) { baseURL = String(v); }, registerModule: function(name, func) { var normalizedName = ModuleStore.normalize(name); if (moduleInstantiators[normalizedName]) throw new Error('duplicate module named ' + normalizedName); moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, func); }, bundleStore: Object.create(null), register: function(name, deps, func) { if (!deps || !deps.length && !func.length) { this.registerModule(name, func); } else { this.bundleStore[name] = { deps: deps, execute: function() { var $__0 = arguments; var depMap = {}; deps.forEach((function(dep, index) { return depMap[dep] = $__0[index]; })); var registryEntry = func.call(this, depMap); registryEntry.execute.call(this); return registryEntry.exports; } }; } }, getAnonymousModule: function(func) { return new Module(func.call(global), liveModuleSentinel); }, getForTesting: function(name) { var $__0 = this; if (!this.testingPrefix_) { Object.keys(moduleInstances).some((function(key) { var m = /(traceur@[^\/]*\/)/.exec(key); if (m) { $__0.testingPrefix_ = m[1]; return true; } })); } return this.get(this.testingPrefix_ + name); } }; ModuleStore.set('@traceur/src/runtime/ModuleStore', new Module({ModuleStore: ModuleStore})); var setupGlobals = $traceurRuntime.setupGlobals; $traceurRuntime.setupGlobals = function(global) { setupGlobals(global); }; $traceurRuntime.ModuleStore = ModuleStore; global.System = { register: ModuleStore.register.bind(ModuleStore), get: ModuleStore.get, set: ModuleStore.set, normalize: ModuleStore.normalize }; $traceurRuntime.getModuleImpl = function(name) { var instantiator = getUncoatedModuleInstantiator(name); return instantiator && instantiator.getUncoatedModule(); }; })(typeof global !== 'undefined' ? global : this); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/utils", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/utils"; var toObject = $traceurRuntime.toObject; function toUint32(x) { return x | 0; } function isObject(x) { return x && (typeof x === 'object' || typeof x === 'function'); } function isCallable(x) { return typeof x === 'function'; } function toInteger(x) { x = +x; if (isNaN(x)) return 0; if (!isFinite(x) || x === 0) return x; return x > 0 ? Math.floor(x) : Math.ceil(x); } var MAX_SAFE_LENGTH = Math.pow(2, 53) - 1; function toLength(x) { var len = toInteger(x); return len < 0 ? 0 : Math.min(len, MAX_SAFE_LENGTH); } return { get toObject() { return toObject; }, get toUint32() { return toUint32; }, get isObject() { return isObject; }, get isCallable() { return isCallable; }, get toInteger() { return toInteger; }, get toLength() { return toLength; } }; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/Array", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/Array"; var $__3 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/utils")), toInteger = $__3.toInteger, toLength = $__3.toLength, toObject = $__3.toObject, isCallable = $__3.isCallable; function fill(value) { var start = arguments[1] !== (void 0) ? arguments[1] : 0; var end = arguments[2]; var object = toObject(this); var len = toLength(object.length); var fillStart = toInteger(start); var fillEnd = end !== undefined ? toInteger(end) : len; fillStart = fillStart < 0 ? Math.max(len + fillStart, 0) : Math.min(fillStart, len); fillEnd = fillEnd < 0 ? Math.max(len + fillEnd, 0) : Math.min(fillEnd, len); while (fillStart < fillEnd) { object[fillStart] = value; fillStart++; } return object; } function find(predicate) { var thisArg = arguments[1]; return findHelper(this, predicate, thisArg); } function findIndex(predicate) { var thisArg = arguments[1]; return findHelper(this, predicate, thisArg, true); } function findHelper(self, predicate) { var thisArg = arguments[2]; var returnIndex = arguments[3] !== (void 0) ? arguments[3] : false; var object = toObject(self); var len = toLength(object.length); if (!isCallable(predicate)) { throw TypeError(); } for (var i = 0; i < len; i++) { if (i in object) { var value = object[i]; if (predicate.call(thisArg, value, i, object)) { return returnIndex ? i : value; } } } return returnIndex ? -1 : undefined; } return { get fill() { return fill; }, get find() { return find; }, get findIndex() { return findIndex; } }; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/ArrayIterator", [], function() { "use strict"; var $__5; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/ArrayIterator"; var $__6 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/utils")), toObject = $__6.toObject, toUint32 = $__6.toUint32; var ARRAY_ITERATOR_KIND_KEYS = 1; var ARRAY_ITERATOR_KIND_VALUES = 2; var ARRAY_ITERATOR_KIND_ENTRIES = 3; var ArrayIterator = function ArrayIterator() {}; ($traceurRuntime.createClass)(ArrayIterator, ($__5 = {}, Object.defineProperty($__5, "next", { value: function() { var iterator = toObject(this); var array = iterator.iteratorObject_; if (!array) { throw new TypeError('Object is not an ArrayIterator'); } var index = iterator.arrayIteratorNextIndex_; var itemKind = iterator.arrayIterationKind_; var length = toUint32(array.length); if (index >= length) { iterator.arrayIteratorNextIndex_ = Infinity; return createIteratorResultObject(undefined, true); } iterator.arrayIteratorNextIndex_ = index + 1; if (itemKind == ARRAY_ITERATOR_KIND_VALUES) return createIteratorResultObject(array[index], false); if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES) return createIteratorResultObject([index, array[index]], false); return createIteratorResultObject(index, false); }, configurable: true, enumerable: true, writable: true }), Object.defineProperty($__5, Symbol.iterator, { value: function() { return this; }, configurable: true, enumerable: true, writable: true }), $__5), {}); function createArrayIterator(array, kind) { var object = toObject(array); var iterator = new ArrayIterator; iterator.iteratorObject_ = object; iterator.arrayIteratorNextIndex_ = 0; iterator.arrayIterationKind_ = kind; return iterator; } function createIteratorResultObject(value, done) { return { value: value, done: done }; } function entries() { return createArrayIterator(this, ARRAY_ITERATOR_KIND_ENTRIES); } function keys() { return createArrayIterator(this, ARRAY_ITERATOR_KIND_KEYS); } function values() { return createArrayIterator(this, ARRAY_ITERATOR_KIND_VALUES); } return { get entries() { return entries; }, get keys() { return keys; }, get values() { return values; } }; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/Map", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/Map"; var isObject = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/utils")).isObject; var getOwnHashObject = $traceurRuntime.getOwnHashObject; var $hasOwnProperty = Object.prototype.hasOwnProperty; var deletedSentinel = {}; function lookupIndex(map, key) { if (isObject(key)) { var hashObject = getOwnHashObject(key); return hashObject && map.objectIndex_[hashObject.hash]; } if (typeof key === 'string') return map.stringIndex_[key]; return map.primitiveIndex_[key]; } function initMap(map) { map.entries_ = []; map.objectIndex_ = Object.create(null); map.stringIndex_ = Object.create(null); map.primitiveIndex_ = Object.create(null); map.deletedCount_ = 0; } var Map = function Map() { var iterable = arguments[0]; if (!isObject(this)) throw new TypeError("Constructor Map requires 'new'"); if ($hasOwnProperty.call(this, 'entries_')) { throw new TypeError("Map can not be reentrantly initialised"); } initMap(this); if (iterable !== null && iterable !== undefined) { var iter = iterable[Symbol.iterator]; if (iter !== undefined) { for (var $__8 = iterable[Symbol.iterator](), $__9; !($__9 = $__8.next()).done; ) { var $__10 = $traceurRuntime.assertObject($__9.value), key = $__10[0], value = $__10[1]; { this.set(key, value); } } } } }; ($traceurRuntime.createClass)(Map, { get size() { return this.entries_.length / 2 - this.deletedCount_; }, get: function(key) { var index = lookupIndex(this, key); if (index !== undefined) return this.entries_[index + 1]; }, set: function(key, value) { var objectMode = isObject(key); var stringMode = typeof key === 'string'; var index = lookupIndex(this, key); if (index !== undefined) { this.entries_[index + 1] = value; } else { index = this.entries_.length; this.entries_[index] = key; this.entries_[index + 1] = value; if (objectMode) { var hashObject = getOwnHashObject(key); var hash = hashObject.hash; this.objectIndex_[hash] = index; } else if (stringMode) { this.stringIndex_[key] = index; } else { this.primitiveIndex_[key] = index; } } return this; }, has: function(key) { return lookupIndex(this, key) !== undefined; }, delete: function(key) { var objectMode = isObject(key); var stringMode = typeof key === 'string'; var index; var hash; if (objectMode) { var hashObject = getOwnHashObject(key); if (hashObject) { index = this.objectIndex_[hash = hashObject.hash]; delete this.objectIndex_[hash]; } } else if (stringMode) { index = this.stringIndex_[key]; delete this.stringIndex_[key]; } else { index = this.primitiveIndex_[key]; delete this.primitiveIndex_[key]; } if (index !== undefined) { this.entries_[index] = deletedSentinel; this.entries_[index + 1] = undefined; this.deletedCount_++; } }, clear: function() { initMap(this); }, forEach: function(callbackFn) { var thisArg = arguments[1]; for (var i = 0, len = this.entries_.length; i < len; i += 2) { var key = this.entries_[i]; var value = this.entries_[i + 1]; if (key === deletedSentinel) continue; callbackFn.call(thisArg, value, key, this); } } }, {}); return {get Map() { return Map; }}; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/Object", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/Object"; var $__11 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/utils")), toInteger = $__11.toInteger, toLength = $__11.toLength, toObject = $__11.toObject, isCallable = $__11.isCallable; var $__11 = $traceurRuntime.assertObject($traceurRuntime), defineProperty = $__11.defineProperty, getOwnPropertyDescriptor = $__11.getOwnPropertyDescriptor, getOwnPropertyNames = $__11.getOwnPropertyNames, keys = $__11.keys, privateNames = $__11.privateNames; function is(left, right) { if (left === right) return left !== 0 || 1 / left === 1 / right; return left !== left && right !== right; } function assign(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; var props = keys(source); var p, length = props.length; for (p = 0; p < length; p++) { var name = props[p]; if (privateNames[name]) continue; target[name] = source[name]; } } return target; } function mixin(target, source) { var props = getOwnPropertyNames(source); var p, descriptor, length = props.length; for (p = 0; p < length; p++) { var name = props[p]; if (privateNames[name]) continue; descriptor = getOwnPropertyDescriptor(source, props[p]); defineProperty(target, props[p], descriptor); } return target; } return { get is() { return is; }, get assign() { return assign; }, get mixin() { return mixin; } }; }); System.register("traceur-runtime@0.0.42/node_modules/rsvp/lib/rsvp/asap", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/node_modules/rsvp/lib/rsvp/asap"; var $__default = function asap(callback, arg) { var length = queue.push([callback, arg]); if (length === 1) { scheduleFlush(); } }; var browserGlobal = (typeof window !== 'undefined') ? window : {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; function useNextTick() { return function() { process.nextTick(flush); }; } function useMutationObserver() { var iterations = 0; var observer = new BrowserMutationObserver(flush); var node = document.createTextNode(''); observer.observe(node, {characterData: true}); return function() { node.data = (iterations = ++iterations % 2); }; } function useSetTimeout() { return function() { setTimeout(flush, 1); }; } var queue = []; function flush() { for (var i = 0; i < queue.length; i++) { var tuple = queue[i]; var callback = tuple[0], arg = tuple[1]; callback(arg); } queue = []; } var scheduleFlush; if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleFlush = useNextTick(); } else if (BrowserMutationObserver) { scheduleFlush = useMutationObserver(); } else { scheduleFlush = useSetTimeout(); } return {get default() { return $__default; }}; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/Promise", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/Promise"; var async = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/node_modules/rsvp/lib/rsvp/asap")).default; var promiseRaw = {}; function isPromise(x) { return x && typeof x === 'object' && x.status_ !== undefined; } function idResolveHandler(x) { return x; } function idRejectHandler(x) { throw x; } function chain(promise) { var onResolve = arguments[1] !== (void 0) ? arguments[1] : idResolveHandler; var onReject = arguments[2] !== (void 0) ? arguments[2] : idRejectHandler; var deferred = getDeferred(promise.constructor); switch (promise.status_) { case undefined: throw TypeError; case 0: promise.onResolve_.push(onResolve, deferred); promise.onReject_.push(onReject, deferred); break; case +1: promiseEnqueue(promise.value_, [onResolve, deferred]); break; case -1: promiseEnqueue(promise.value_, [onReject, deferred]); break; } return deferred.promise; } function getDeferred(C) { if (this === $Promise) { var promise = promiseInit(new $Promise(promiseRaw)); return { promise: promise, resolve: (function(x) { promiseResolve(promise, x); }), reject: (function(r) { promiseReject(promise, r); }) }; } else { var result = {}; result.promise = new C((function(resolve, reject) { result.resolve = resolve; result.reject = reject; })); return result; } } function promiseSet(promise, status, value, onResolve, onReject) { promise.status_ = status; promise.value_ = value; promise.onResolve_ = onResolve; promise.onReject_ = onReject; return promise; } function promiseInit(promise) { return promiseSet(promise, 0, undefined, [], []); } var Promise = function Promise(resolver) { if (resolver === promiseRaw) return; if (typeof resolver !== 'function') throw new TypeError; var promise = promiseInit(this); try { resolver((function(x) { promiseResolve(promise, x); }), (function(r) { promiseReject(promise, r); })); } catch (e) { promiseReject(promise, e); } }; ($traceurRuntime.createClass)(Promise, { catch: function(onReject) { return this.then(undefined, onReject); }, then: function(onResolve, onReject) { if (typeof onResolve !== 'function') onResolve = idResolveHandler; if (typeof onReject !== 'function') onReject = idRejectHandler; var that = this; var constructor = this.constructor; return chain(this, function(x) { x = promiseCoerce(constructor, x); return x === that ? onReject(new TypeError) : isPromise(x) ? x.then(onResolve, onReject) : onResolve(x); }, onReject); } }, { resolve: function(x) { if (this === $Promise) { return promiseSet(new $Promise(promiseRaw), +1, x); } else { return new this(function(resolve, reject) { resolve(x); }); } }, reject: function(r) { if (this === $Promise) { return promiseSet(new $Promise(promiseRaw), -1, r); } else { return new this((function(resolve, reject) { reject(r); })); } }, cast: function(x) { if (x instanceof this) return x; if (isPromise(x)) { var result = getDeferred(this); chain(x, result.resolve, result.reject); return result.promise; } return this.resolve(x); }, all: function(values) { var deferred = getDeferred(this); var resolutions = []; try { var count = values.length; if (count === 0) { deferred.resolve(resolutions); } else { for (var i = 0; i < values.length; i++) { this.resolve(values[i]).then(function(i, x) { resolutions[i] = x; if (--count === 0) deferred.resolve(resolutions); }.bind(undefined, i), (function(r) { deferred.reject(r); })); } } } catch (e) { deferred.reject(e); } return deferred.promise; }, race: function(values) { var deferred = getDeferred(this); try { for (var i = 0; i < values.length; i++) { this.resolve(values[i]).then((function(x) { deferred.resolve(x); }), (function(r) { deferred.reject(r); })); } } catch (e) { deferred.reject(e); } return deferred.promise; } }); var $Promise = Promise; var $PromiseReject = $Promise.reject; function promiseResolve(promise, x) { promiseDone(promise, +1, x, promise.onResolve_); } function promiseReject(promise, r) { promiseDone(promise, -1, r, promise.onReject_); } function promiseDone(promise, status, value, reactions) { if (promise.status_ !== 0) return; promiseEnqueue(value, reactions); promiseSet(promise, status, value); } function promiseEnqueue(value, tasks) { async((function() { for (var i = 0; i < tasks.length; i += 2) { promiseHandle(value, tasks[i], tasks[i + 1]); } })); } function promiseHandle(value, handler, deferred) { try { var result = handler(value); if (result === deferred.promise) throw new TypeError; else if (isPromise(result)) chain(result, deferred.resolve, deferred.reject); else deferred.resolve(result); } catch (e) { try { deferred.reject(e); } catch (e) {} } } var thenableSymbol = '@@thenable'; function isObject(x) { return x && (typeof x === 'object' || typeof x === 'function'); } function promiseCoerce(constructor, x) { if (!isPromise(x) && isObject(x)) { var then; try { then = x.then; } catch (r) { var promise = $PromiseReject.call(constructor, r); x[thenableSymbol] = promise; return promise; } if (typeof then === 'function') { var p = x[thenableSymbol]; if (p) { return p; } else { var deferred = getDeferred(constructor); x[thenableSymbol] = deferred.promise; try { then.call(x, deferred.resolve, deferred.reject); } catch (r) { deferred.reject(r); } return deferred.promise; } } } return x; } return {get Promise() { return Promise; }}; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/String", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/String"; var $toString = Object.prototype.toString; var $indexOf = String.prototype.indexOf; var $lastIndexOf = String.prototype.lastIndexOf; function startsWith(search) { var string = String(this); if (this == null || $toString.call(search) == '[object RegExp]') { throw TypeError(); } var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var position = arguments.length > 1 ? arguments[1] : undefined; var pos = position ? Number(position) : 0; if (isNaN(pos)) { pos = 0; } var start = Math.min(Math.max(pos, 0), stringLength); return $indexOf.call(string, searchString, pos) == start; } function endsWith(search) { var string = String(this); if (this == null || $toString.call(search) == '[object RegExp]') { throw TypeError(); } var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var pos = stringLength; if (arguments.length > 1) { var position = arguments[1]; if (position !== undefined) { pos = position ? Number(position) : 0; if (isNaN(pos)) { pos = 0; } } } var end = Math.min(Math.max(pos, 0), stringLength); var start = end - searchLength; if (start < 0) { return false; } return $lastIndexOf.call(string, searchString, start) == start; } function contains(search) { if (this == null) { throw TypeError(); } var string = String(this); var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var position = arguments.length > 1 ? arguments[1] : undefined; var pos = position ? Number(position) : 0; if (isNaN(pos)) { pos = 0; } var start = Math.min(Math.max(pos, 0), stringLength); return $indexOf.call(string, searchString, pos) != -1; } function repeat(count) { if (this == null) { throw TypeError(); } var string = String(this); var n = count ? Number(count) : 0; if (isNaN(n)) { n = 0; } if (n < 0 || n == Infinity) { throw RangeError(); } if (n == 0) { return ''; } var result = ''; while (n--) { result += string; } return result; } function codePointAt(position) { if (this == null) { throw TypeError(); } var string = String(this); var size = string.length; var index = position ? Number(position) : 0; if (isNaN(index)) { index = 0; } if (index < 0 || index >= size) { return undefined; } var first = string.charCodeAt(index); var second; if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) { second = string.charCodeAt(index + 1); if (second >= 0xDC00 && second <= 0xDFFF) { return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; } } return first; } function raw(callsite) { var raw = callsite.raw; var len = raw.length >>> 0; if (len === 0) return ''; var s = ''; var i = 0; while (true) { s += raw[i]; if (i + 1 === len) return s; s += arguments[++i]; } } function fromCodePoint() { var codeUnits = []; var floor = Math.floor; var highSurrogate; var lowSurrogate; var index = -1; var length = arguments.length; if (!length) { return ''; } while (++index < length) { var codePoint = Number(arguments[index]); if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) { throw RangeError('Invalid code point: ' + codePoint); } if (codePoint <= 0xFFFF) { codeUnits.push(codePoint); } else { codePoint -= 0x10000; highSurrogate = (codePoint >> 10) + 0xD800; lowSurrogate = (codePoint % 0x400) + 0xDC00; codeUnits.push(highSurrogate, lowSurrogate); } } return String.fromCharCode.apply(null, codeUnits); } return { get startsWith() { return startsWith; }, get endsWith() { return endsWith; }, get contains() { return contains; }, get repeat() { return repeat; }, get codePointAt() { return codePointAt; }, get raw() { return raw; }, get fromCodePoint() { return fromCodePoint; } }; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/polyfills", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/polyfills"; var Map = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/Map")).Map; var Promise = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/Promise")).Promise; var $__14 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/String")), codePointAt = $__14.codePointAt, contains = $__14.contains, endsWith = $__14.endsWith, fromCodePoint = $__14.fromCodePoint, repeat = $__14.repeat, raw = $__14.raw, startsWith = $__14.startsWith; var $__14 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/Array")), fill = $__14.fill, find = $__14.find, findIndex = $__14.findIndex; var $__14 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/ArrayIterator")), entries = $__14.entries, keys = $__14.keys, values = $__14.values; var $__14 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/Object")), assign = $__14.assign, is = $__14.is, mixin = $__14.mixin; function maybeDefineMethod(object, name, value) { if (!(name in object)) { Object.defineProperty(object, name, { value: value, configurable: true, enumerable: false, writable: true }); } } function maybeAddFunctions(object, functions) { for (var i = 0; i < functions.length; i += 2) { var name = functions[i]; var value = functions[i + 1]; maybeDefineMethod(object, name, value); } } function polyfillPromise(global) { if (!global.Promise) global.Promise = Promise; } function polyfillCollections(global) { if (!global.Map) global.Map = Map; } function polyfillString(String) { maybeAddFunctions(String.prototype, ['codePointAt', codePointAt, 'contains', contains, 'endsWith', endsWith, 'startsWith', startsWith, 'repeat', repeat]); maybeAddFunctions(String, ['fromCodePoint', fromCodePoint, 'raw', raw]); } function polyfillArray(Array, Symbol) { maybeAddFunctions(Array.prototype, ['entries', entries, 'keys', keys, 'values', values, 'fill', fill, 'find', find, 'findIndex', findIndex]); if (Symbol && Symbol.iterator) { Object.defineProperty(Array.prototype, Symbol.iterator, { value: values, configurable: true, enumerable: false, writable: true }); } } function polyfillObject(Object) { maybeAddFunctions(Object, ['assign', assign, 'is', is, 'mixin', mixin]); } function polyfill(global) { polyfillPromise(global); polyfillCollections(global); polyfillString(global.String); polyfillArray(global.Array, global.Symbol); polyfillObject(global.Object); } polyfill(this); var setupGlobals = $traceurRuntime.setupGlobals; $traceurRuntime.setupGlobals = function(global) { setupGlobals(global); polyfill(global); }; return {}; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfill-import", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfill-import"; var $__16 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/polyfills")); return {}; }); System.get("traceur-runtime@0.0.42/src/runtime/polyfill-import" + ''); }).call(this,require("FWaASH"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"FWaASH":2}],4:[function(require,module,exports){ (function (global){ //! moment.js //! version : 2.8.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com (function (undefined) { /************************************ Constants ************************************/ var moment, VERSION = '2.8.1', // the global-scope this is NOT the global object in Node.js globalScope = typeof global !== 'undefined' ? global : this, oldGlobalMoment, round = Math.round, i, YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, // internal storage for locale config files locales = {}, // extra moment internal properties (plugins register props here) momentProperties = [], // check for nodeJS hasModule = (typeof module !== 'undefined' && module.exports), // ASP.NET json date format regex aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, // format tokens formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g, // parsing token regexes parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 parseTokenOneToFourDigits = /\d{1,4}/, // 0 - 9999 parseTokenOneToSixDigits = /[+\-]?\d{1,6}/, // -999,999 - 999,999 parseTokenDigits = /\d+/, // nonzero number of digits parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic. parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z parseTokenT = /T/i, // T (ISO separator) parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 parseTokenOrdinal = /\d{1,2}/, //strict parsing regexes parseTokenOneDigit = /\d/, // 0 - 9 parseTokenTwoDigits = /\d\d/, // 00 - 99 parseTokenThreeDigits = /\d{3}/, // 000 - 999 parseTokenFourDigits = /\d{4}/, // 0000 - 9999 parseTokenSixDigits = /[+-]?\d{6}/, // -999,999 - 999,999 parseTokenSignedNumber = /[+-]?\d+/, // -inf - inf // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', isoDates = [ ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], ['GGGG-[W]WW', /\d{4}-W\d{2}/], ['YYYY-DDD', /\d{4}-\d{3}/] ], // iso time formats and regexes isoTimes = [ ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], ['HH:mm', /(T| )\d\d:\d\d/], ['HH', /(T| )\d\d/] ], // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"] parseTimezoneChunker = /([\+\-]|\d\d)/gi, // getter and setter names proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), unitMillisecondFactors = { 'Milliseconds' : 1, 'Seconds' : 1e3, 'Minutes' : 6e4, 'Hours' : 36e5, 'Days' : 864e5, 'Months' : 2592e6, 'Years' : 31536e6 }, unitAliases = { ms : 'millisecond', s : 'second', m : 'minute', h : 'hour', d : 'day', D : 'date', w : 'week', W : 'isoWeek', M : 'month', Q : 'quarter', y : 'year', DDD : 'dayOfYear', e : 'weekday', E : 'isoWeekday', gg: 'weekYear', GG: 'isoWeekYear' }, camelFunctions = { dayofyear : 'dayOfYear', isoweekday : 'isoWeekday', isoweek : 'isoWeek', weekyear : 'weekYear', isoweekyear : 'isoWeekYear' }, // format function strings formatFunctions = {}, // default relative time thresholds relativeTimeThresholds = { s: 45, // seconds to minute m: 45, // minutes to hour h: 22, // hours to day d: 26, // days to month M: 11 // months to year }, // tokens to ordinalize and pad ordinalizeTokens = 'DDD w W M D d'.split(' '), paddedTokens = 'M D H h m s w W'.split(' '), formatTokenFunctions = { M : function () { return this.month() + 1; }, MMM : function (format) { return this.localeData().monthsShort(this, format); }, MMMM : function (format) { return this.localeData().months(this, format); }, D : function () { return this.date(); }, DDD : function () { return this.dayOfYear(); }, d : function () { return this.day(); }, dd : function (format) { return this.localeData().weekdaysMin(this, format); }, ddd : function (format) { return this.localeData().weekdaysShort(this, format); }, dddd : function (format) { return this.localeData().weekdays(this, format); }, w : function () { return this.week(); }, W : function () { return this.isoWeek(); }, YY : function () { return leftZeroFill(this.year() % 100, 2); }, YYYY : function () { return leftZeroFill(this.year(), 4); }, YYYYY : function () { return leftZeroFill(this.year(), 5); }, YYYYYY : function () { var y = this.year(), sign = y >= 0 ? '+' : '-'; return sign + leftZeroFill(Math.abs(y), 6); }, gg : function () { return leftZeroFill(this.weekYear() % 100, 2); }, gggg : function () { return leftZeroFill(this.weekYear(), 4); }, ggggg : function () { return leftZeroFill(this.weekYear(), 5); }, GG : function () { return leftZeroFill(this.isoWeekYear() % 100, 2); }, GGGG : function () { return leftZeroFill(this.isoWeekYear(), 4); }, GGGGG : function () { return leftZeroFill(this.isoWeekYear(), 5); }, e : function () { return this.weekday(); }, E : function () { return this.isoWeekday(); }, a : function () { return this.localeData().meridiem(this.hours(), this.minutes(), true); }, A : function () { return this.localeData().meridiem(this.hours(), this.minutes(), false); }, H : function () { return this.hours(); }, h : function () { return this.hours() % 12 || 12; }, m : function () { return this.minutes(); }, s : function () { return this.seconds(); }, S : function () { return toInt(this.milliseconds() / 100); }, SS : function () { return leftZeroFill(toInt(this.milliseconds() / 10), 2); }, SSS : function () { return leftZeroFill(this.milliseconds(), 3); }, SSSS : function () { return leftZeroFill(this.milliseconds(), 3); }, Z : function () { var a = -this.zone(), b = '+'; if (a < 0) { a = -a; b = '-'; } return b + leftZeroFill(toInt(a / 60), 2) + ':' + leftZeroFill(toInt(a) % 60, 2); }, ZZ : function () { var a = -this.zone(), b = '+'; if (a < 0) { a = -a; b = '-'; } return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2); }, z : function () { return this.zoneAbbr(); }, zz : function () { return this.zoneName(); }, X : function () { return this.unix(); }, Q : function () { return this.quarter(); } }, deprecations = {}, lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin']; // Pick the first defined of two or three arguments. dfl comes from // default. function dfl(a, b, c) { switch (arguments.length) { case 2: return a != null ? a : b; case 3: return a != null ? a : b != null ? b : c; default: throw new Error('Implement me'); } } function defaultParsingFlags() { // We need to deep clone this object, and es5 standard is not very // helpful. return { empty : false, unusedTokens : [], unusedInput : [], overflow : -2, charsLeftOver : 0, nullInput : false, invalidMonth : null, invalidFormat : false, userInvalidated : false, iso: false }; } function printMsg(msg) { if (moment.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { console.warn("Deprecation warning: " + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function () { if (firstTime) { printMsg(msg); firstTime = false; } return fn.apply(this, arguments); }, fn); } function deprecateSimple(name, msg) { if (!deprecations[name]) { printMsg(msg); deprecations[name] = true; } } function padToken(func, count) { return function (a) { return leftZeroFill(func.call(this, a), count); }; } function ordinalizeToken(func, period) { return function (a) { return this.localeData().ordinal(func.call(this, a), period); }; } while (ordinalizeTokens.length) { i = ordinalizeTokens.pop(); formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i); } while (paddedTokens.length) { i = paddedTokens.pop(); formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2); } formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3); /************************************ Constructors ************************************/ function Locale() { } // Moment prototype object function Moment(config, skipOverflow) { if (skipOverflow !== false) { checkOverflow(config); } copyConfig(this, config); this._d = new Date(+config._d); } // Duration Constructor function Duration(duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; // representation for dateAddRemove this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 hours * 36e5; // 1000 * 60 * 60 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + weeks * 7; // It is impossible translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months = +months + quarters * 3 + years * 12; this._data = {}; this._locale = moment.localeData(); this._bubble(); } /************************************ Helpers ************************************/ function extend(a, b) { for (var i in b) { if (b.hasOwnProperty(i)) { a[i] = b[i]; } } if (b.hasOwnProperty('toString')) { a.toString = b.toString; } if (b.hasOwnProperty('valueOf')) { a.valueOf = b.valueOf; } return a; } function copyConfig(to, from) { var i, prop, val; if (typeof from._isAMomentObject !== 'undefined') { to._isAMomentObject = from._isAMomentObject; } if (typeof from._i !== 'undefined') { to._i = from._i; } if (typeof from._f !== 'undefined') { to._f = from._f; } if (typeof from._l !== 'undefined') { to._l = from._l; } if (typeof from._strict !== 'undefined') { to._strict = from._strict; } if (typeof from._tzm !== 'undefined') { to._tzm = from._tzm; } if (typeof from._isUTC !== 'undefined') { to._isUTC = from._isUTC; } if (typeof from._offset !== 'undefined') { to._offset = from._offset; } if (typeof from._pf !== 'undefined') { to._pf = from._pf; } if (typeof from._locale !== 'undefined') { to._locale = from._locale; } if (momentProperties.length > 0) { for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; if (typeof val !== 'undefined') { to[prop] = val; } } } return to; } function absRound(number) { if (number < 0) { return Math.ceil(number); } else { return Math.floor(number); } } // left zero fill a number // see http://jsperf.com/left-zero-filling for performance comparison function leftZeroFill(number, targetLength, forceSign) { var output = '' + Math.abs(number), sign = number >= 0; while (output.length < targetLength) { output = '0' + output; } return (sign ? (forceSign ? '+' : '') : '-') + output; } function positiveMomentsDifference(base, other) { var res = {milliseconds: 0, months: 0}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +(base.clone().add(res.months, 'M')); return res; } function momentsDifference(base, other) { var res; other = makeAs(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple(name, "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period)."); tmp = val; val = period; period = tmp; } val = typeof val === 'string' ? +val : val; dur = moment.duration(val, period); addOrSubtractDurationFromMoment(this, dur, direction); return this; }; } function addOrSubtractDurationFromMoment(mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = duration._days, months = duration._months; updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { mom._d.setTime(+mom._d + milliseconds * isAdding); } if (days) { rawSetter(mom, 'Date', rawGetter(mom, 'Date') + days * isAdding); } if (months) { rawMonthSetter(mom, rawGetter(mom, 'Month') + months * isAdding); } if (updateOffset) { moment.updateOffset(mom, days || months); } } // check if is an array function isArray(input) { return Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date; } // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ((dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { diffs++; } } return diffs + lengthDiff; } function normalizeUnits(units) { if (units) { var lowered = units.toLowerCase().replace(/(.)s$/, '$1'); units = unitAliases[units] || camelFunctions[lowered] || lowered; } return units; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (inputObject.hasOwnProperty(prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } function makeList(field) { var count, setter; if (field.indexOf('week') === 0) { count = 7; setter = 'day'; } else if (field.indexOf('month') === 0) { count = 12; setter = 'month'; } else { return; } moment[field] = function (format, index) { var i, getter, method = moment._locale[field], results = []; if (typeof format === 'number') { index = format; format = undefined; } getter = function (i) { var m = moment().utc().set(setter, i); return method.call(moment._locale, m, format || ''); }; if (index != null) { return getter(index); } else { for (i = 0; i < count; i++) { results.push(getter(i)); } return results; } }; } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { if (coercedNumber >= 0) { value = Math.floor(coercedNumber); } else { value = Math.ceil(coercedNumber); } } return value; } function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); } function weeksInYear(year, dow, doy) { return weekOfYear(moment([year, 11, 31 + dow - doy]), dow, doy).week; } function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } function isLeapYear(year) { return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; } function checkOverflow(m) { var overflow; if (m._a && m._pf.overflow === -2) { overflow = m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR : m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : -1; if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } m._pf.overflow = overflow; } } function isValid(m) { if (m._isValid == null) { m._isValid = !isNaN(m._d.getTime()) && m._pf.overflow < 0 && !m._pf.empty && !m._pf.invalidMonth && !m._pf.nullInput && !m._pf.invalidFormat && !m._pf.userInvalidated; if (m._strict) { m._isValid = m._isValid && m._pf.charsLeftOver === 0 && m._pf.unusedTokens.length === 0; } } return m._isValid; } function normalizeLocale(key) { return key ? key.toLowerCase().replace('_', '-') : key; } // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return null; } function loadLocale(name) { var oldLocale = null; if (!locales[name] && hasModule) { try { oldLocale = moment.locale(); require('./locale/' + name); // because defineLocale currently also sets the global locale, we want to undo that for lazy loaded locales moment.locale(oldLocale); } catch (e) { } } return locales[name]; } // Return a moment from input, that is local/utc/zone equivalent to model. function makeAs(input, model) { return model._isUTC ? moment(input).zone(model._offset || 0) : moment(input).local(); } /************************************ Locale ************************************/ extend(Locale.prototype, { set : function (config) { var prop, i; for (i in config) { prop = config[i]; if (typeof prop === 'function') { this[i] = prop; } else { this['_' + i] = prop; } } }, _months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), months : function (m) { return this._months[m.month()]; }, _monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), monthsShort : function (m) { return this._monthsShort[m.month()]; }, monthsParse : function (monthName) { var i, mom, regex; if (!this._monthsParse) { this._monthsParse = []; } for (i = 0; i < 12; i++) { // make the regex if we don't have it already if (!this._monthsParse[i]) { mom = moment.utc([2000, i]); regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if (this._monthsParse[i].test(monthName)) { return i; } } }, _weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), weekdays : function (m) { return this._weekdays[m.day()]; }, _weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysShort : function (m) { return this._weekdaysShort[m.day()]; }, _weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), weekdaysMin : function (m) { return this._weekdaysMin[m.day()]; }, weekdaysParse : function (weekdayName) { var i, mom, regex; if (!this._weekdaysParse) { this._weekdaysParse = []; } for (i = 0; i < 7; i++) { // make the regex if we don't have it already if (!this._weekdaysParse[i]) { mom = moment([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if (this._weekdaysParse[i].test(weekdayName)) { return i; } } }, _longDateFormat : { LT : 'h:mm A', L : 'MM/DD/YYYY', LL : 'MMMM D, YYYY', LLL : 'MMMM D, YYYY LT', LLLL : 'dddd, MMMM D, YYYY LT' }, longDateFormat : function (key) { var output = this._longDateFormat[key]; if (!output && this._longDateFormat[key.toUpperCase()]) { output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) { return val.slice(1); }); this._longDateFormat[key] = output; } return output; }, isPM : function (input) { // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return ((input + '').toLowerCase().charAt(0) === 'p'); }, _meridiemParse : /[ap]\.?m?\.?/i, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'pm' : 'PM'; } else { return isLower ? 'am' : 'AM'; } }, _calendar : { sameDay : '[Today at] LT', nextDay : '[Tomorrow at] LT', nextWeek : 'dddd [at] LT', lastDay : '[Yesterday at] LT', lastWeek : '[Last] dddd [at] LT', sameElse : 'L' }, calendar : function (key, mom) { var output = this._calendar[key]; return typeof output === 'function' ? output.apply(mom) : output; }, _relativeTime : { future : 'in %s', past : '%s ago', s : 'a few seconds', m : 'a minute', mm : '%d minutes', h : 'an hour', hh : '%d hours', d : 'a day', dd : '%d days', M : 'a month', MM : '%d months', y : 'a year', yy : '%d years' }, relativeTime : function (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return (typeof output === 'function') ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); }, pastFuture : function (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); }, ordinal : function (number) { return this._ordinal.replace('%d', number); }, _ordinal : '%d', preparse : function (string) { return string; }, postformat : function (string) { return string; }, week : function (mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; }, _week : { dow : 0, // Sunday is the first day of the week. doy : 6 // The week that contains Jan 1st is the first week of the year. }, _invalidDate: 'Invalid date', invalidDate: function () { return this._invalidDate; } }); /************************************ Formatting ************************************/ function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ''); } return input.replace(/\\/g, ''); } function makeFormatFunction(format) { var array = format.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function (mom) { var output = ''; for (i = 0; i < length; i++) { output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; } return output; }; } // format date using native date object function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); if (!formatFunctions[format]) { formatFunctions[format] = makeFormatFunction(format); } return formatFunctions[format](m); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format)) { format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); localFormattingTokens.lastIndex = 0; i -= 1; } return format; } /************************************ Parsing ************************************/ // get the regex to find the next token function getParseRegexForToken(token, config) { var a, strict = config._strict; switch (token) { case 'Q': return parseTokenOneDigit; case 'DDDD': return parseTokenThreeDigits; case 'YYYY': case 'GGGG': case 'gggg': return strict ? parseTokenFourDigits : parseTokenOneToFourDigits; case 'Y': case 'G': case 'g': return parseTokenSignedNumber; case 'YYYYYY': case 'YYYYY': case 'GGGGG': case 'ggggg': return strict ? parseTokenSixDigits : parseTokenOneToSixDigits; case 'S': if (strict) { return parseTokenOneDigit; } /* falls through */ case 'SS': if (strict) { return parseTokenTwoDigits; } /* falls through */ case 'SSS': if (strict) { return parseTokenThreeDigits; } /* falls through */ case 'DDD': return parseTokenOneToThreeDigits; case 'MMM': case 'MMMM': case 'dd': case 'ddd': case 'dddd': return parseTokenWord; case 'a': case 'A': return config._locale._meridiemParse; case 'X': return parseTokenTimestampMs; case 'Z': case 'ZZ': return parseTokenTimezone; case 'T': return parseTokenT; case 'SSSS': return parseTokenDigits; case 'MM': case 'DD': case 'YY': case 'GG': case 'gg': case 'HH': case 'hh': case 'mm': case 'ss': case 'ww': case 'WW': return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits; case 'M': case 'D': case 'd': case 'H': case 'h': case 'm': case 's': case 'w': case 'W': case 'e': case 'E': return parseTokenOneOrTwoDigits; case 'Do': return parseTokenOrdinal; default : a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), 'i')); return a; } } function timezoneMinutesFromString(string) { string = string || ''; var possibleTzMatches = (string.match(parseTokenTimezone) || []), tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [], parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0], minutes = +(parts[1] * 60) + toInt(parts[2]); return parts[0] === '+' ? -minutes : minutes; } // function to convert string input to date function addTimeToArrayFromToken(token, input, config) { var a, datePartArray = config._a; switch (token) { // QUARTER case 'Q': if (input != null) { datePartArray[MONTH] = (toInt(input) - 1) * 3; } break; // MONTH case 'M' : // fall through to MM case 'MM' : if (input != null) { datePartArray[MONTH] = toInt(input) - 1; } break; case 'MMM' : // fall through to MMMM case 'MMMM' : a = config._locale.monthsParse(input); // if we didn't find a month name, mark the date as invalid. if (a != null) { datePartArray[MONTH] = a; } else { config._pf.invalidMonth = input; } break; // DAY OF MONTH case 'D' : // fall through to DD case 'DD' : if (input != null) { datePartArray[DATE] = toInt(input); } break; case 'Do' : if (input != null) { datePartArray[DATE] = toInt(parseInt(input, 10)); } break; // DAY OF YEAR case 'DDD' : // fall through to DDDD case 'DDDD' : if (input != null) { config._dayOfYear = toInt(input); } break; // YEAR case 'YY' : datePartArray[YEAR] = moment.parseTwoDigitYear(input); break; case 'YYYY' : case 'YYYYY' : case 'YYYYYY' : datePartArray[YEAR] = toInt(input); break; // AM / PM case 'a' : // fall through to A case 'A' : config._isPm = config._locale.isPM(input); break; // 24 HOUR case 'H' : // fall through to hh case 'HH' : // fall through to hh case 'h' : // fall through to hh case 'hh' : datePartArray[HOUR] = toInt(input); break; // MINUTE case 'm' : // fall through to mm case 'mm' : datePartArray[MINUTE] = toInt(input); break; // SECOND case 's' : // fall through to ss case 'ss' : datePartArray[SECOND] = toInt(input); break; // MILLISECOND case 'S' : case 'SS' : case 'SSS' : case 'SSSS' : datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000); break; // UNIX TIMESTAMP WITH MS case 'X': config._d = new Date(parseFloat(input) * 1000); break; // TIMEZONE case 'Z' : // fall through to ZZ case 'ZZ' : config._useUTC = true; config._tzm = timezoneMinutesFromString(input); break; // WEEKDAY - human case 'dd': case 'ddd': case 'dddd': a = config._locale.weekdaysParse(input); // if we didn't get a weekday name, mark the date as invalid if (a != null) { config._w = config._w || {}; config._w['d'] = a; } else { config._pf.invalidWeekday = input; } break; // WEEK, WEEK DAY - numeric case 'w': case 'ww': case 'W': case 'WW': case 'd': case 'e': case 'E': token = token.substr(0, 1); /* falls through */ case 'gggg': case 'GGGG': case 'GGGGG': token = token.substr(0, 2); if (input) { config._w = config._w || {}; config._w[token] = toInt(input); } break; case 'gg': case 'GG': config._w = config._w || {}; config._w[token] = moment.parseTwoDigitYear(input); } } function dayOfYearFromWeekInfo(config) { var w, weekYear, week, weekday, dow, doy, temp; w = config._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). weekYear = dfl(w.GG, config._a[YEAR], weekOfYear(moment(), 1, 4).year); week = dfl(w.W, 1); weekday = dfl(w.E, 1); } else { dow = config._locale._week.dow; doy = config._locale._week.doy; weekYear = dfl(w.gg, config._a[YEAR], weekOfYear(moment(), dow, doy).year); week = dfl(w.w, 1); if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; if (weekday < dow) { ++week; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; } else { // default to begining of week weekday = dow; } } temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); config._a[YEAR] = temp.year; config._dayOfYear = temp.dayOfYear; } // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function dateFromConfig(config) { var i, date, input = [], currentDate, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear) { yearToUse = dfl(config._a[YEAR], currentDate[YEAR]); if (config._dayOfYear > daysInYear(yearToUse)) { config._pf._overflowDayOfYear = true; } date = makeUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; } config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input); // Apply timezone offset from input. The actual zone can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm); } } function dateFromObject(config) { var normalizedInput; if (config._d) { return; } normalizedInput = normalizeObjectUnits(config._i); config._a = [ normalizedInput.year, normalizedInput.month, normalizedInput.day, normalizedInput.hour, normalizedInput.minute, normalizedInput.second, normalizedInput.millisecond ]; dateFromConfig(config); } function currentDateArray(config) { var now = new Date(); if (config._useUTC) { return [ now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() ]; } else { return [now.getFullYear(), now.getMonth(), now.getDate()]; } } // date from string and format string function makeDateFromStringAndFormat(config) { if (config._f === moment.ISO_8601) { parseISO(config); return; } config._a = []; config._pf.empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { config._pf.unusedInput.push(skipped); } string = string.slice(string.indexOf(parsedInput) + parsedInput.length); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { config._pf.empty = false; } else { config._pf.unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { config._pf.unusedTokens.push(token); } } // add remaining unparsed input length to the string config._pf.charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { config._pf.unusedInput.push(string); } // handle am pm if (config._isPm && config._a[HOUR] < 12) { config._a[HOUR] += 12; } // if is 12 am, change hours to 0 if (config._isPm === false && config._a[HOUR] === 12) { config._a[HOUR] = 0; } dateFromConfig(config); checkOverflow(config); } function unescapeFormat(s) { return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; }); } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function regexpEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } // date from string and array of format strings function makeDateFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore; if (config._f.length === 0) { config._pf.invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < config._f.length; i++) { currentScore = 0; tempConfig = copyConfig({}, config); tempConfig._pf = defaultParsingFlags(); tempConfig._f = config._f[i]; makeDateFromStringAndFormat(tempConfig); if (!isValid(tempConfig)) { continue; } // if there is any input that was not parsed add a penalty for that format currentScore += tempConfig._pf.charsLeftOver; //or tokens currentScore += tempConfig._pf.unusedTokens.length * 10; tempConfig._pf.score = currentScore; if (scoreToBeat == null || currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } extend(config, bestMoment || tempConfig); } // date from iso format function parseISO(config) { var i, l, string = config._i, match = isoRegex.exec(string); if (match) { config._pf.iso = true; for (i = 0, l = isoDates.length; i < l; i++) { if (isoDates[i][1].exec(string)) { // match[5] should be "T" or undefined config._f = isoDates[i][0] + (match[6] || ' '); break; } } for (i = 0, l = isoTimes.length; i < l; i++) { if (isoTimes[i][1].exec(string)) { config._f += isoTimes[i][0]; break; } } if (string.match(parseTokenTimezone)) { config._f += 'Z'; } makeDateFromStringAndFormat(config); } else { config._isValid = false; } } // date from iso format or fallback function makeDateFromString(config) { parseISO(config); if (config._isValid === false) { delete config._isValid; moment.createFromInputFallback(config); } } function makeDateFromInput(config) { var input = config._i, matched; if (input === undefined) { config._d = new Date(); } else if (isDate(input)) { config._d = new Date(+input); } else if ((matched = aspNetJsonRegex.exec(input)) !== null) { config._d = new Date(+matched[1]); } else if (typeof input === 'string') { makeDateFromString(config); } else if (isArray(input)) { config._a = input.slice(0); dateFromConfig(config); } else if (typeof(input) === 'object') { dateFromObject(config); } else if (typeof(input) === 'number') { // from milliseconds config._d = new Date(input); } else { moment.createFromInputFallback(config); } } function makeDate(y, m, d, h, M, s, ms) { //can't just apply() to create a date: //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); //the date constructor doesn't accept years < 1970 if (y < 1970) { date.setFullYear(y); } return date; } function makeUTCDate(y) { var date = new Date(Date.UTC.apply(null, arguments)); if (y < 1970) { date.setUTCFullYear(y); } return date; } function parseWeekday(input, locale) { if (typeof input === 'string') { if (!isNaN(input)) { input = parseInt(input, 10); } else { input = locale.weekdaysParse(input); if (typeof input !== 'number') { return null; } } } return input; } /************************************ Relative Time ************************************/ // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } function relativeTime(posNegDuration, withoutSuffix, locale) { var duration = moment.duration(posNegDuration).abs(), seconds = round(duration.as('s')), minutes = round(duration.as('m')), hours = round(duration.as('h')), days = round(duration.as('d')), months = round(duration.as('M')), years = round(duration.as('y')), args = seconds < relativeTimeThresholds.s && ['s', seconds] || minutes === 1 && ['m'] || minutes < relativeTimeThresholds.m && ['mm', minutes] || hours === 1 && ['h'] || hours < relativeTimeThresholds.h && ['hh', hours] || days === 1 && ['d'] || days < relativeTimeThresholds.d && ['dd', days] || months === 1 && ['M'] || months < relativeTimeThresholds.M && ['MM', months] || years === 1 && ['y'] || ['yy', years]; args[2] = withoutSuffix; args[3] = +posNegDuration > 0; args[4] = locale; return substituteTimeAgo.apply({}, args); } /************************************ Week of Year ************************************/ // firstDayOfWeek 0 = sun, 6 = sat // the day of the week that starts the week // (usually sunday or monday) // firstDayOfWeekOfYear 0 = sun, 6 = sat // the first week is the week that contains the first // of this day of the week // (eg. ISO weeks use thursday (4)) function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { var end = firstDayOfWeekOfYear - firstDayOfWeek, daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), adjustedMoment; if (daysToDayOfWeek > end) { daysToDayOfWeek -= 7; } if (daysToDayOfWeek < end - 7) { daysToDayOfWeek += 7; } adjustedMoment = moment(mom).add(daysToDayOfWeek, 'd'); return { week: Math.ceil(adjustedMoment.dayOfYear() / 7), year: adjustedMoment.year() }; } //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { var d = makeUTCDate(year, 0, 1).getUTCDay(), daysToAdd, dayOfYear; d = d === 0 ? 7 : d; weekday = weekday != null ? weekday : firstDayOfWeek; daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0); dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1; return { year: dayOfYear > 0 ? year : year - 1, dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear }; } /************************************ Top Level Functions ************************************/ function makeMoment(config) { var input = config._i, format = config._f; config._locale = config._locale || moment.localeData(config._l); if (input === null || (format === undefined && input === '')) { return moment.invalid({nullInput: true}); } if (typeof input === 'string') { config._i = input = config._locale.preparse(input); } if (moment.isMoment(input)) { return new Moment(input, true); } else if (format) { if (isArray(format)) { makeDateFromStringAndArray(config); } else { makeDateFromStringAndFormat(config); } } else { makeDateFromInput(config); } return new Moment(config); } moment = function (input, format, locale, strict) { var c; if (typeof(locale) === "boolean") { strict = locale; locale = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c = {}; c._isAMomentObject = true; c._i = input; c._f = format; c._l = locale; c._strict = strict; c._isUTC = false; c._pf = defaultParsingFlags(); return makeMoment(c); }; moment.suppressDeprecationWarnings = false; moment.createFromInputFallback = deprecate( 'moment construction falls back to js Date. This is ' + 'discouraged and will be removed in upcoming major ' + 'release. Please refer to ' + 'https://github.com/moment/moment/issues/1407 for more info.', function (config) { config._d = new Date(config._i); } ); // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return moment(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (moments[i][fn](res)) { res = moments[i]; } } return res; } moment.min = function () { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); }; moment.max = function () { var args = [].slice.call(arguments, 0); return pickBy('isAfter', args); }; // creating with utc moment.utc = function (input, format, locale, strict) { var c; if (typeof(locale) === "boolean") { strict = locale; locale = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c = {}; c._isAMomentObject = true; c._useUTC = true; c._isUTC = true; c._l = locale; c._i = input; c._f = format; c._strict = strict; c._pf = defaultParsingFlags(); return makeMoment(c).utc(); }; // creating with unix timestamp (in seconds) moment.unix = function (input) { return moment(input * 1000); }; // duration moment.duration = function (input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, parseIso, diffRes; if (moment.isDuration(input)) { duration = { ms: input._milliseconds, d: input._days, M: input._months }; } else if (typeof input === 'number') { duration = {}; if (key) { duration[key] = input; } else { duration.milliseconds = input; } } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y: 0, d: toInt(match[DATE]) * sign, h: toInt(match[HOUR]) * sign, m: toInt(match[MINUTE]) * sign, s: toInt(match[SECOND]) * sign, ms: toInt(match[MILLISECOND]) * sign }; } else if (!!(match = isoDurationRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; parseIso = function (inp) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; }; duration = { y: parseIso(match[2]), M: parseIso(match[3]), d: parseIso(match[4]), h: parseIso(match[5]), m: parseIso(match[6]), s: parseIso(match[7]), w: parseIso(match[8]) }; } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { diffRes = momentsDifference(moment(duration.from), moment(duration.to)); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (moment.isDuration(input) && input.hasOwnProperty('_locale')) { ret._locale = input._locale; } return ret; }; // version number moment.version = VERSION; // default format moment.defaultFormat = isoFormat; // constant that refers to the ISO standard moment.ISO_8601 = function () {}; // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. moment.momentProperties = momentProperties; // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. moment.updateOffset = function () {}; // This function allows you to set a threshold for relative time strings moment.relativeTimeThreshold = function (threshold, limit) { if (relativeTimeThresholds[threshold] === undefined) { return false; } if (limit === undefined) { return relativeTimeThresholds[threshold]; } relativeTimeThresholds[threshold] = limit; return true; }; moment.lang = deprecate( "moment.lang is deprecated. Use moment.locale instead.", function (key, value) { return moment.locale(key, value); } ); // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. moment.locale = function (key, values) { var data; if (key) { if (typeof(values) !== "undefined") { data = moment.defineLocale(key, values); } else { data = moment.localeData(key); } if (data) { moment.duration._locale = moment._locale = data; } } return moment._locale._abbr; }; moment.defineLocale = function (name, values) { if (values !== null) { values.abbr = name; if (!locales[name]) { locales[name] = new Locale(); } locales[name].set(values); // backwards compat for now: also set the locale moment.locale(name); return locales[name]; } else { // useful for testing delete locales[name]; return null; } }; moment.langData = deprecate( "moment.langData is deprecated. Use moment.localeData instead.", function (key) { return moment.localeData(key); } ); // returns locale data moment.localeData = function (key) { var locale; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return moment._locale; } if (!isArray(key)) { //short-circuit everything else locale = loadLocale(key); if (locale) { return locale; } key = [key]; } return chooseLocale(key); }; // compare moment object moment.isMoment = function (obj) { return obj instanceof Moment || (obj != null && obj.hasOwnProperty('_isAMomentObject')); }; // for typechecking Duration objects moment.isDuration = function (obj) { return obj instanceof Duration; }; for (i = lists.length - 1; i >= 0; --i) { makeList(lists[i]); } moment.normalizeUnits = function (units) { return normalizeUnits(units); }; moment.invalid = function (flags) { var m = moment.utc(NaN); if (flags != null) { extend(m._pf, flags); } else { m._pf.userInvalidated = true; } return m; }; moment.parseZone = function () { return moment.apply(null, arguments).parseZone(); }; moment.parseTwoDigitYear = function (input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); }; /************************************ Moment Prototype ************************************/ extend(moment.fn = Moment.prototype, { clone : function () { return moment(this); }, valueOf : function () { return +this._d + ((this._offset || 0) * 60000); }, unix : function () { return Math.floor(+this / 1000); }, toString : function () { return this.clone().locale('en').format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); }, toDate : function () { return this._offset ? new Date(+this) : this._d; }, toISOString : function () { var m = moment(this).utc(); if (0 < m.year() && m.year() <= 9999) { return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } else { return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } }, toArray : function () { var m = this; return [ m.year(), m.month(), m.date(), m.hours(), m.minutes(), m.seconds(), m.milliseconds() ]; }, isValid : function () { return isValid(this); }, isDSTShifted : function () { if (this._a) { return this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0; } return false; }, parsingFlags : function () { return extend({}, this._pf); }, invalidAt: function () { return this._pf.overflow; }, utc : function (keepLocalTime) { return this.zone(0, keepLocalTime); }, local : function (keepLocalTime) { if (this._isUTC) { this.zone(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.add(this._d.getTimezoneOffset(), 'm'); } } return this; }, format : function (inputString) { var output = formatMoment(this, inputString || moment.defaultFormat); return this.localeData().postformat(output); }, add : createAdder(1, 'add'), subtract : createAdder(-1, 'subtract'), diff : function (input, units, asFloat) { var that = makeAs(input, this), zoneDiff = (this.zone() - that.zone()) * 6e4, diff, output; units = normalizeUnits(units); if (units === 'year' || units === 'month') { // average number of days in the months in the given dates diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2 // difference in months output = ((this.year() - that.year()) * 12) + (this.month() - that.month()); // adjust by taking difference in days, average number of days // and dst in the given months. output += ((this - moment(this).startOf('month')) - (that - moment(that).startOf('month'))) / diff; // same as above but with zones, to negate all dst output -= ((this.zone() - moment(this).startOf('month').zone()) - (that.zone() - moment(that).startOf('month').zone())) * 6e4 / diff; if (units === 'year') { output = output / 12; } } else { diff = (this - that); output = units === 'second' ? diff / 1e3 : // 1000 units === 'minute' ? diff / 6e4 : // 1000 * 60 units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60 units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst diff; } return asFloat ? output : absRound(output); }, from : function (time, withoutSuffix) { return moment.duration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); }, fromNow : function (withoutSuffix) { return this.from(moment(), withoutSuffix); }, calendar : function (time) { // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're zone'd or not. var now = time || moment(), sod = makeAs(now, this).startOf('day'), diff = this.diff(sod, 'days', true), format = diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; return this.format(this.localeData().calendar(format, this)); }, isLeapYear : function () { return isLeapYear(this.year()); }, isDST : function () { return (this.zone() < this.clone().month(0).zone() || this.zone() < this.clone().month(5).zone()); }, day : function (input) { var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, 'd'); } else { return day; } }, month : makeAccessor('Month', true), startOf : function (units) { units = normalizeUnits(units); // the following switch intentionally omits break keywords // to utilize falling through the cases. switch (units) { case 'year': this.month(0); /* falls through */ case 'quarter': case 'month': this.date(1); /* falls through */ case 'week': case 'isoWeek': case 'day': this.hours(0); /* falls through */ case 'hour': this.minutes(0); /* falls through */ case 'minute': this.seconds(0); /* falls through */ case 'second': this.milliseconds(0); /* falls through */ } // weeks are a special case if (units === 'week') { this.weekday(0); } else if (units === 'isoWeek') { this.isoWeekday(1); } // quarters are also special if (units === 'quarter') { this.month(Math.floor(this.month() / 3) * 3); } return this; }, endOf: function (units) { units = normalizeUnits(units); return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); }, isAfter: function (input, units) { units = typeof units !== 'undefined' ? units : 'millisecond'; return +this.clone().startOf(units) > +moment(input).startOf(units); }, isBefore: function (input, units) { units = typeof units !== 'undefined' ? units : 'millisecond'; return +this.clone().startOf(units) < +moment(input).startOf(units); }, isSame: function (input, units) { units = units || 'ms'; return +this.clone().startOf(units) === +makeAs(input, this).startOf(units); }, min: deprecate( 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function (other) { other = moment.apply(null, arguments); return other < this ? this : other; } ), max: deprecate( 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function (other) { other = moment.apply(null, arguments); return other > this ? this : other; } ), // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[zone(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist int zone // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. zone : function (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; if (input != null) { if (typeof input === 'string') { input = timezoneMinutesFromString(input); } if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = this._d.getTimezoneOffset(); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.subtract(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addOrSubtractDurationFromMoment(this, moment.duration(offset - input, 'm'), 1, false); } else if (!this._changeInProgress) { this._changeInProgress = true; moment.updateOffset(this, true); this._changeInProgress = null; } } } else { return this._isUTC ? offset : this._d.getTimezoneOffset(); } return this; }, zoneAbbr : function () { return this._isUTC ? 'UTC' : ''; }, zoneName : function () { return this._isUTC ? 'Coordinated Universal Time' : ''; }, parseZone : function () { if (this._tzm) { this.zone(this._tzm); } else if (typeof this._i === 'string') { this.zone(this._i); } return this; }, hasAlignedHourOffset : function (input) { if (!input) { input = 0; } else { input = moment(input).zone(); } return (this.zone() - input) % 60 === 0; }, daysInMonth : function () { return daysInMonth(this.year(), this.month()); }, dayOfYear : function (input) { var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1; return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); }, quarter : function (input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); }, weekYear : function (input) { var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; return input == null ? year : this.add((input - year), 'y'); }, isoWeekYear : function (input) { var year = weekOfYear(this, 1, 4).year; return input == null ? year : this.add((input - year), 'y'); }, week : function (input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, 'd'); }, isoWeek : function (input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, 'd'); }, weekday : function (input) { var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); }, isoWeekday : function (input) { // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); }, isoWeeksInYear : function () { return weeksInYear(this.year(), 1, 4); }, weeksInYear : function () { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); }, get : function (units) { units = normalizeUnits(units); return this[units](); }, set : function (units, value) { units = normalizeUnits(units); if (typeof this[units] === 'function') { this[units](value); } return this; }, // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration // variables for this instance. locale : function (key) { if (key === undefined) { return this._locale._abbr; } else { this._locale = moment.localeData(key); return this; } }, lang : deprecate( "moment().lang() is deprecated. Use moment().localeData() instead.", function (key) { if (key === undefined) { return this.localeData(); } else { this._locale = moment.localeData(key); return this; } } ), localeData : function () { return this._locale; } }); function rawMonthSetter(mom, value) { var dayOfMonth; // TODO: Move this out of here! if (typeof value === 'string') { value = mom.localeData().monthsParse(value); // TODO: Another silent failure? if (typeof value !== 'number') { return mom; } } dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); return mom; } function rawGetter(mom, unit) { return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); } function rawSetter(mom, unit, value) { if (unit === 'Month') { return rawMonthSetter(mom, value); } else { return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); } } function makeAccessor(unit, keepTime) { return function (value) { if (value != null) { rawSetter(this, unit, value); moment.updateOffset(this, keepTime); return this; } else { return rawGetter(this, unit); } }; } moment.fn.millisecond = moment.fn.milliseconds = makeAccessor('Milliseconds', false); moment.fn.second = moment.fn.seconds = makeAccessor('Seconds', false); moment.fn.minute = moment.fn.minutes = makeAccessor('Minutes', false); // Setting the hour should keep the time, because the user explicitly // specified which hour he wants. So trying to maintain the same hour (in // a new timezone) makes sense. Adding/subtracting hours does not follow // this rule. moment.fn.hour = moment.fn.hours = makeAccessor('Hours', true); // moment.fn.month is defined separately moment.fn.date = makeAccessor('Date', true); moment.fn.dates = deprecate('dates accessor is deprecated. Use date instead.', makeAccessor('Date', true)); moment.fn.year = makeAccessor('FullYear', true); moment.fn.years = deprecate('years accessor is deprecated. Use year instead.', makeAccessor('FullYear', true)); // add plural methods moment.fn.days = moment.fn.day; moment.fn.months = moment.fn.month; moment.fn.weeks = moment.fn.week; moment.fn.isoWeeks = moment.fn.isoWeek; moment.fn.quarters = moment.fn.quarter; // add aliased format methods moment.fn.toJSON = moment.fn.toISOString; /************************************ Duration Prototype ************************************/ function daysToYears (days) { // 400 years have 146097 days (taking into account leap year rules) return days * 400 / 146097; } function yearsToDays (years) { // years * 365 + absRound(years / 4) - // absRound(years / 100) + absRound(years / 400); return years * 146097 / 400; } extend(moment.duration.fn = Duration.prototype, { _bubble : function () { var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years = 0; // The following code bubbles up values, see the tests for // examples of what that means. data.milliseconds = milliseconds % 1000; seconds = absRound(milliseconds / 1000); data.seconds = seconds % 60; minutes = absRound(seconds / 60); data.minutes = minutes % 60; hours = absRound(minutes / 60); data.hours = hours % 24; days += absRound(hours / 24); // Accurately convert days to years, assume start from year 0. years = absRound(daysToYears(days)); days -= absRound(yearsToDays(years)); // 30 days to a month // TODO (iskren): Use anchor date (like 1st Jan) to compute this. months += absRound(days / 30); days %= 30; // 12 months -> 1 year years += absRound(months / 12); months %= 12; data.days = days; data.months = months; data.years = years; }, abs : function () { this._milliseconds = Math.abs(this._milliseconds); this._days = Math.abs(this._days); this._months = Math.abs(this._months); this._data.milliseconds = Math.abs(this._data.milliseconds); this._data.seconds = Math.abs(this._data.seconds); this._data.minutes = Math.abs(this._data.minutes); this._data.hours = Math.abs(this._data.hours); this._data.months = Math.abs(this._data.months); this._data.years = Math.abs(this._data.years); return this; }, weeks : function () { return absRound(this.days() / 7); }, valueOf : function () { return this._milliseconds + this._days * 864e5 + (this._months % 12) * 2592e6 + toInt(this._months / 12) * 31536e6; }, humanize : function (withSuffix) { var output = relativeTime(this, !withSuffix, this.localeData()); if (withSuffix) { output = this.localeData().pastFuture(+this, output); } return this.localeData().postformat(output); }, add : function (input, val) { // supports only 2.0-style add(1, 's') or add(moment) var dur = moment.duration(input, val); this._milliseconds += dur._milliseconds; this._days += dur._days; this._months += dur._months; this._bubble(); return this; }, subtract : function (input, val) { var dur = moment.duration(input, val); this._milliseconds -= dur._milliseconds; this._days -= dur._days; this._months -= dur._months; this._bubble(); return this; }, get : function (units) { units = normalizeUnits(units); return this[units.toLowerCase() + 's'](); }, as : function (units) { var days, months; units = normalizeUnits(units); days = this._days + this._milliseconds / 864e5; if (units === 'month' || units === 'year') { months = this._months + daysToYears(days) * 12; return units === 'month' ? months : months / 12; } else { days += yearsToDays(this._months / 12); switch (units) { case 'week': return days / 7; case 'day': return days; case 'hour': return days * 24; case 'minute': return days * 24 * 60; case 'second': return days * 24 * 60 * 60; case 'millisecond': return days * 24 * 60 * 60 * 1000; default: throw new Error('Unknown unit ' + units); } } }, lang : moment.fn.lang, locale : moment.fn.locale, toIsoString : deprecate( "toIsoString() is deprecated. Please use toISOString() instead " + "(notice the capitals)", function () { return this.toISOString(); } ), toISOString : function () { // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js var years = Math.abs(this.years()), months = Math.abs(this.months()), days = Math.abs(this.days()), hours = Math.abs(this.hours()), minutes = Math.abs(this.minutes()), seconds = Math.abs(this.seconds() + this.milliseconds() / 1000); if (!this.asSeconds()) { // this is the same as C#'s (Noda) and python (isodate)... // but not other JS (goog.date) return 'P0D'; } return (this.asSeconds() < 0 ? '-' : '') + 'P' + (years ? years + 'Y' : '') + (months ? months + 'M' : '') + (days ? days + 'D' : '') + ((hours || minutes || seconds) ? 'T' : '') + (hours ? hours + 'H' : '') + (minutes ? minutes + 'M' : '') + (seconds ? seconds + 'S' : ''); }, localeData : function () { return this._locale; } }); function makeDurationGetter(name) { moment.duration.fn[name] = function () { return this._data[name]; }; } for (i in unitMillisecondFactors) { if (unitMillisecondFactors.hasOwnProperty(i)) { makeDurationGetter(i.toLowerCase()); } } moment.duration.fn.asMilliseconds = function () { return this.as('ms'); }; moment.duration.fn.asSeconds = function () { return this.as('s'); }; moment.duration.fn.asMinutes = function () { return this.as('m'); }; moment.duration.fn.asHours = function () { return this.as('h'); }; moment.duration.fn.asDays = function () { return this.as('d'); }; moment.duration.fn.asWeeks = function () { return this.as('weeks'); }; moment.duration.fn.asMonths = function () { return this.as('M'); }; moment.duration.fn.asYears = function () { return this.as('y'); }; /************************************ Default Locale ************************************/ // Set default locale, other locale will inherit from English. moment.locale('en', { ordinal : function (number) { var b = number % 10, output = (toInt(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; return number + output; } }); /* EMBED_LOCALES */ /************************************ Exposing Moment ************************************/ function makeGlobal(shouldDeprecate) { /*global ender:false */ if (typeof ender !== 'undefined') { return; } oldGlobalMoment = globalScope.moment; if (shouldDeprecate) { globalScope.moment = deprecate( 'Accessing Moment through the global scope is ' + 'deprecated, and will be removed in an upcoming ' + 'release.', moment); } else { globalScope.moment = moment; } } // CommonJS module is defined if (hasModule) { module.exports = moment; } else if (typeof define === 'function' && define.amd) { define('moment', function (require, exports, module) { if (module.config && module.config() && module.config().noGlobal === true) { // release the global variable globalScope.moment = oldGlobalMoment; } return moment; }); makeGlobal(true); } else { makeGlobal(); } }).call(this); }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],5:[function(require,module,exports){ var EventEmitter = require('events').EventEmitter var inherits = require('inherits') var shimvis = true var change = null var hidden = null module.exports = Visibility if (typeof document.hidden !== 'undefined') { hidden = 'hidden' change = 'visibilitychange' } else if (typeof document.mozHidden !== 'undefined') { hidden = 'mozHidden' change = 'mozvisibilitychange' } else if (typeof document.webkitHidden !== 'undefined') { hidden = 'webkitHidden' change = 'webkitvisibilitychange' } else if (typeof document.webkitHidden !== 'undefined') { hidden = 'webkitHidden' change = 'webkitvisibilitychange' } inherits(Visibility, EventEmitter) function Visibility() { if (!(this instanceof Visibility)) return new Visibility var self = this EventEmitter.call(this) this.supported = !!hidden if (this.supported) { document.addEventListener(change, function() { var visible = !document[hidden] self.emit('change', visible) self.emit(visible ? 'show' : 'hide') }, false) } else { document.addEventListener('focusout', function() { self.emit('change', false) self.emit('hide') shimvis = false }, false) document.addEventListener('focusin', function() { self.emit('change', true) self.emit('show') shimvis = true }, false) } window.addEventListener('unload', function() { self.emit('exit') }, false) } Visibility.prototype.hidden = function() { return this.supported ? !!document[hidden] : !shimvis } Visibility.prototype.visible = function() { return this.supported ? !document[hidden] : shimvis } },{"events":1,"inherits":6}],6:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } },{}],"base_object":[function(require,module,exports){ module.exports=require('2HNVgz'); },{}],"2HNVgz":[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var extend = require('./utils').extend; var Events = require('./events'); var pluginOptions = ['container']; var BaseObject = function BaseObject(options) { this.uniqueId = _.uniqueId('o'); options || (options = {}); _.extend(this, _.pick(options, pluginOptions)); if (this.initialize) { this.initialize.apply(this, arguments); } }; ($traceurRuntime.createClass)(BaseObject, {}, {}, Events); BaseObject.extend = extend; module.exports = BaseObject; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./events":9,"./utils":18}],9:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Log = require('../plugins/log'); var slice = Array.prototype.slice; var Events = function Events() {}; ($traceurRuntime.createClass)(Events, { on: function(name, callback, context) { if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; this._events || (this._events = {}); var events = this._events[name] || (this._events[name] = []); events.push({ callback: callback, context: context, ctx: context || this }); return this; }, once: function(name, callback, context) { if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; var self = this; var once = _.once(function() { self.off(name, once); callback.apply(this, arguments); }); once._callback = callback; return this.on(name, once, context); }, off: function(name, callback, context) { var retain, ev, events, names, i, l, j, k; if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; if (!name && !callback && !context) { this._events = void 0; return this; } names = name ? [name] : _.keys(this._events); for (i = 0, l = names.length; i < l; i++) { name = names[i]; events = this._events[name]; if (events) { this._events[name] = retain = []; if (callback || context) { for (j = 0, k = events.length; j < k; j++) { ev = events[j]; if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || (context && context !== ev.context)) { retain.push(ev); } } } if (!retain.length) delete this._events[name]; } } return this; }, trigger: function(name) { var klass = arguments[arguments.length - 1]; if (global.DEBUG) { if (Log.BLACKLIST.indexOf(name) < 0) Log.info(klass, 'event ' + name + ' triggered'); } if (!this._events) return this; var args = slice.call(arguments, 1); if (!eventsApi(this, 'trigger', name, args)) return this; var events = this._events[name]; var allEvents = this._events.all; if (events) triggerEvents(events, args); if (allEvents) triggerEvents(allEvents, arguments); return this; }, stopListening: function(obj, name, callback) { var listeningTo = this._listeningTo; if (!listeningTo) return this; var remove = !name && !callback; if (!callback && typeof name === 'object') callback = this; if (obj) (listeningTo = {})[obj._listenId] = obj; for (var id in listeningTo) { obj = listeningTo[id]; obj.off(name, callback, this); if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id]; } return this; } }, {}); var eventSplitter = /\s+/; var eventsApi = function(obj, action, name, rest) { if (!name) return true; if (typeof name === 'object') { for (var key in name) { obj[action].apply(obj, [key, name[key]].concat(rest)); } return false; } if (eventSplitter.test(name)) { var names = name.split(eventSplitter); for (var i = 0, l = names.length; i < l; i++) { obj[action].apply(obj, [names[i]].concat(rest)); } return false; } return true; }; var triggerEvents = function(events, args) { var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; switch (args.length) { case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; } }; var listenMethods = { listenTo: 'on', listenToOnce: 'once' }; _.each(listenMethods, function(implementation, method) { Events.prototype[method] = function(obj, name, callback) { var listeningTo = this._listeningTo || (this._listeningTo = {}); var id = obj._listenId || (obj._listenId = _.uniqueId('l')); listeningTo[id] = obj; if (!callback && typeof name === 'object') callback = this; obj[implementation](name, callback, this); return this; }; }); module.exports = Events; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../plugins/log":43}],10:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); module.exports = { 'media_control': _.template('<div class="media-control-layer" data-controls> <% var renderBar = function(name) { %> <div class="bar-container" data-<%= name %>> <div class="bar-background" data-<%= name %>> <div class="bar-fill-1" data-<%= name %>></div> <div class="bar-fill-2" data-<%= name %>></div> </div> <div class="bar-scrubber" data-<%= name %>> <div class="bar-scrubber-icon" data-<%= name %>></div> </div> </div> <% }; %> <% var renderDrawer = function(name, renderContent) { %> <div class="drawer-container" data-<%= name %>> <div class="drawer-icon-container" data-<%= name %>> <div class="drawer-icon media-control-icon" data-<%= name %>></div> <span class="drawer-text" data-<%= name %>></span> </div> <% renderContent(name); %> </div> <% }; %> <% var renderIndicator = function(name) { %> <div class="media-control-indicator" data-<%= name %>></div> <% }; %> <% var renderButton = function(name) { %> <button class="media-control-button media-control-icon" data-<%= name %>></button> <% }; %> <% var render = function(settings) { _.each(settings, function(setting) { if(setting === "seekbar") { renderBar(setting); } else if (setting === "volume") { renderDrawer(setting, renderBar); } else if (setting === "duration" || setting === "position") { renderIndicator(setting); } else { renderButton(setting); } }); }; %> <% if (settings.left && settings.left.length) { %> <div class="media-control-left-panel" data-media-control> <% render(settings.left); %> </div> <% } %> <% if (settings.right && settings.right.length) { %> <div class="media-control-right-panel" data-media-control> <% render(settings.right); %> </div> <% } %> <% if (settings.default && settings.default.length) { %> <div class="media-control-center-panel" data-media-control> <% render(settings.default); %> </div> <% } %></div>'), 'flash_vod': _.template(' <param name="movie" value="<%= swfPath %>"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="gpu"> <param name="tabindex" value="1"> <param name=FlashVars value="playbackId=<%= playbackId %>" /> <embed type="application/x-shockwave-flash" disabled="disabled" tabindex="-1" enablecontextmenu="false" allowScriptAccess="always" quality="autohight" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="gpu" swliveconnect="true" type="application/x-shockwave-flash" allowfullscreen="false" bgcolor="#000000" FlashVars="playbackId=<%= playbackId %>" src="<%= swfPath %>"> </embed>'), 'hls': _.template(' <param name="movie" value="<%= swfPath %>?inline=1"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="transparent"> <param name="tabindex" value="1"> <param name=FlashVars value="playbackId=<%= playbackId %>" /> <embed type="application/x-shockwave-flash" tabindex="1" enablecontextmenu="false" allowScriptAccess="always" quality="autohigh" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" swliveconnect="true" type="application/x-shockwave-flash" allowfullscreen="false" bgcolor="#000000" FlashVars="playbackId=<%= playbackId %>" src="<%= swfPath %>"> </embed>'), 'poster': _.template('<img class="poster-background" data-poster src="" /><div class="play-wrapper" data-poster> <span class="poster-icon play" data-poster /></div>'), 'spinner_loading': _.template('<div data-spinner-container class="spin-container1"> <div data-circle1></div> <div data-circle2></div> <div data-circle3></div> <div data-circle4></div></div><div data-spinner-container class="spin-container2"> <div data-circle1></div> <div data-circle2></div> <div data-circle3></div> <div data-circle4></div></div><div data-spinner-container class="spin-container3"> <div data-circle1></div> <div data-circle2></div> <div data-circle3></div> <div data-circle4></div></div>'), 'spinner_three_bounce': _.template('<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>'), 'watermark': _.template('<div data-watermark data-watermark-<%=position %>><img src="<%= imageUrl %>"></div>'), CSS: { 'container': '[data-container]{position:absolute;background-color:#000;height:100%;width:100%}', 'core': '[data-player] *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;margin:0;padding:0;border:0;font-style:normal;font-weight:400;text-align:center;font-size:100%;color:#000;font-family:"lucida grande",tahoma,verdana,arial,sans-serif;text-shadow:0 0 0;box-sizing:border-box}[data-player] * a,[data-player] * abbr,[data-player] * acronym,[data-player] * address,[data-player] * applet,[data-player] * article,[data-player] * aside,[data-player] * audio,[data-player] * b,[data-player] * big,[data-player] * blockquote,[data-player] * canvas,[data-player] * caption,[data-player] * center,[data-player] * cite,[data-player] * code,[data-player] * dd,[data-player] * del,[data-player] * details,[data-player] * dfn,[data-player] * div,[data-player] * dl,[data-player] * dt,[data-player] * em,[data-player] * embed,[data-player] * fieldset,[data-player] * figcaption,[data-player] * figure,[data-player] * footer,[data-player] * form,[data-player] * h1,[data-player] * h2,[data-player] * h3,[data-player] * h4,[data-player] * h5,[data-player] * h6,[data-player] * header,[data-player] * hgroup,[data-player] * i,[data-player] * iframe,[data-player] * img,[data-player] * ins,[data-player] * kbd,[data-player] * label,[data-player] * legend,[data-player] * li,[data-player] * mark,[data-player] * menu,[data-player] * nav,[data-player] * object,[data-player] * ol,[data-player] * output,[data-player] * p,[data-player] * pre,[data-player] * q,[data-player] * ruby,[data-player] * s,[data-player] * samp,[data-player] * section,[data-player] * small,[data-player] * span,[data-player] * strike,[data-player] * strong,[data-player] * sub,[data-player] * summary,[data-player] * sup,[data-player] * table,[data-player] * tbody,[data-player] * td,[data-player] * tfoot,[data-player] * th,[data-player] * thead,[data-player] * time,[data-player] * tr,[data-player] * tt,[data-player] * u,[data-player] * ul,[data-player] * var,[data-player] * video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}[data-player] * table{border-collapse:collapse;border-spacing:0}[data-player] * caption,[data-player] * td,[data-player] * th{text-align:left;font-weight:400;vertical-align:middle}[data-player] * blockquote,[data-player] * q{quotes:none}[data-player] * blockquote:after,[data-player] * blockquote:before,[data-player] * q:after,[data-player] * q:before{content:"";content:none}[data-player] * a img{border:none}[data-player]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);position:relative;margin:0;height:594px;width:1055px;text-align:center;overflow:hidden}[data-player].fullscreen{width:100%;height:100%}[data-player].nocursor{cursor:none}', 'media_control': '@font-face{font-family:Player;src:url(assets/Player-Regular.eot);src:url(assets/Player-Regular.eot?#iefix) format("embedded-opentype"),url(assets/Player-Regular.ttf) format("truetype"),url(assets/Player-Regular.svg#player) format("svg")}.media-control[data-media-control]{position:absolute;background-color:rgba(2,2,2,.5);border-radius:0;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto;max-width:100%;min-width:60%;height:40px;z-index:9999;-webkit-transition:all .4s ease-out;-moz-transition:all .4s ease-out;-ms-transition:all .4s ease-out;-o-transition:all .4s ease-out;transition:all .4s ease-out}.media-control[data-media-control] .media-control-icon{font-family:Player;font-weight:400;font-style:normal;font-size:26px;line-height:32px;letter-spacing:0;speak:none;color:#fff;vertical-align:middle;text-align:left;padding:0 6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.media-control[data-media-control].media-control-hide{bottom:-40px}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls]{position:relative;top:10%;height:80%;vertical-align:middle}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control]{position:absolute;top:0;left:5px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control]{height:100%;text-align:center;line-height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control]{position:absolute;top:0;right:5px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button{background-color:transparent;border:0;margin:0 8px;cursor:pointer;display:inline-block}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus{outline:0}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play]:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause]:before{content:"\\e002"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]:before{content:"\\e003"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]{float:right;background-color:transparent;border:0;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]:before{content:"\\e006"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]{cursor:default;float:right;background-color:transparent;border:0;width:32px;height:100%;opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]:before{content:"\\e007"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause]:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause].playing:before{content:"\\e002"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause].paused:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop].playing:before{content:"\\e003"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop].stopped:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration],.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{display:inline-block;font-size:13px;color:#fff;cursor:default;line-height:32px;position:relative}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before{content:"/";margin-right:3px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]{position:absolute;top:-20px;left:0;display:inline-block;vertical-align:middle;width:100%;height:32px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar]{width:100%;height:8px;position:relative;top:12px;background-color:#6f6f6f;overflow:hidden}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#bebebe;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-ms-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#fff;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-ms-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{position:absolute;top:6px;left:0;width:20px;height:20px;opacity:1;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-ms-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar]{position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:6px;border:1px solid #6f6f6f;background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume]{float:right;display:inline-block;width:32px;height:32px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume]{position:absolute;bottom:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]{background-color:transparent;border:0;width:32px;height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:before{content:"\\e004"}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted:before{content:"\\e005"}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume]{width:32px;height:88px;position:absolute;bottom:40px;background:rgba(2,2,2,.5);border-radius:4px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-ms-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume]{margin-left:12px;background:#6f6f6f;border-radius:4px;width:8px;height:72px;position:relative;top:8px;overflow:hidden}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume]{position:absolute;bottom:0;background:#fff;width:100%;height:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume]{position:absolute;bottom:40%;left:6px;width:20px;height:20px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume]{position:absolute;left:4px;top:4px;width:12px;height:12px;border-radius:6px;border:1px solid #6f6f6f;background-color:#fff}', 'flash_vod': '[data-flash-vod]{position:absolute;height:100%;width:100%;background-color:#000;display:block;pointer-events:none}', 'hls': '[data-hls]{position:absolute;height:100%;width:100%;background-color:#000;display:block;pointer-events:none}', 'html5_video': '[data-html5-video]{position:absolute;height:100%;width:100%;display:block}', 'pip': '.pip-loading[data-pip]{left:25px;top:15px;position:relative;float:left;z-index:3001;color:#fff}.pip-transition[data-pip]{-webkit-transition:all .4s ease-out;-moz-transition:all .4s ease-out;-ms-transition:all .4s ease-out;-o-transition:all .4s ease-out;transition:all .4s ease-out}.master-container[data-pip]{cursor:default;width:100%;height:100%;font-size:100%;position:absolute;bottom:0;right:0;border:none}.pip-container[data-pip]{cursor:pointer;width:24%;height:24%;font-size:24%;z-index:2000;position:absolute;right:23px;bottom:23px;border-width:2px;border-radius:3px;border-style:solid;border-color:rgba(255,255,255,.25);background-clip:padding-box;-webkit-background-clip:padding-box}.pip-container[data-pip].over-media-control{bottom:63px}', 'poster': '@font-face{font-family:Player;src:url(assets/Player-Regular.eot);src:url(assets/Player-Regular.eot?#iefix) format("embedded-opentype"),url(assets/Player-Regular.ttf) format("truetype"),url(assets/Player-Regular.svg#player) format("svg")}.player-poster[data-poster]{cursor:pointer;position:absolute;height:100%;width:100%;z-index:998;top:0}.player-poster[data-poster] .poster-background[data-poster]{width:100%;height:100%}.player-poster[data-poster] .play-wrapper[data-poster]{position:absolute;overflow:hidden;width:100%;height:20%;line-height:100%;font-size:20%;top:50%;margin-top:-5%;text-align:center}.player-poster[data-poster] .play-wrapper[data-poster] .poster-icon[data-poster]{font-family:Player;font-weight:400;font-style:normal;line-height:1;letter-spacing:0;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#fff;opacity:.75}.player-poster[data-poster] .play-wrapper[data-poster] .poster-icon[data-poster].play[data-poster]:before{content:"\\e001"}.player-poster[data-poster] .play-wrapper[data-poster] .poster-icon[data-poster]:hover{opacity:1}', 'spinner_loading': 'div[data-spinner]{width:50px;height:50px;position:relative;margin-left:auto;margin-right:auto;right:0;left:0;z-index:999;top:45%}.spin-container1>div,.spin-container2>div,.spin-container3>div{width:13px;height:13px;background-color:#fff;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}[data-spinner] [data-spinner-container]{position:absolute;width:100%;height:100%}.spin-container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.spin-container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}[data-circle1]{top:0;left:0}[data-circle2]{top:0;right:0}[data-circle3]{right:0;bottom:0}[data-circle4]{left:0;bottom:0}.spin-container2 [data-circle1]{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spin-container3 [data-circle1]{-webkit-animation-delay:-1s;animation-delay:-1s}.spin-container1 [data-circle2]{-webkit-animation-delay:-.9s;animation-delay:-.9s}.spin-container2 [data-circle2]{-webkit-animation-delay:-.8s;animation-delay:-.8s}.spin-container3 [data-circle2]{-webkit-animation-delay:-.7s;animation-delay:-.7s}.spin-container1 [data-circle3]{-webkit-animation-delay:-.6s;animation-delay:-.6s}.spin-container2 [data-circle3]{-webkit-animation-delay:-.5s;animation-delay:-.5s}.spin-container3 [data-circle3]{-webkit-animation-delay:-.4s;animation-delay:-.4s}.spin-container1 [data-circle4]{-webkit-animation-delay:-.3s;animation-delay:-.3s}.spin-container2 [data-circle4]{-webkit-animation-delay:-.2s;animation-delay:-.2s}.spin-container3 [data-circle4]{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes bouncedelay{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}', 'spinner_three_bounce': '.spinner-three-bounce[data-spinner]{position:absolute;margin:0 auto;width:70px;text-align:center;z-index:10;top:47%;left:0;right:0}.spinner-three-bounce[data-spinner]>div{width:18px;height:18px;background-color:#FFF;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;-moz-animation:bouncedelay 1.4s infinite ease-in-out;-o-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both}.spinner-three-bounce[data-spinner] [data-bounce1]{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce[data-spinner] [data-bounce2]{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}@-moz-keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}@-ms-keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}@keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}', 'watermark': '[data-watermark]{position:absolute;margin:100px auto 0;width:70px;text-align:center;z-index:10}[data-watermark-bottom-left]{bottom:10px;left:10px}[data-watermark-bottom-right]{bottom:10px;right:42px}[data-watermark-top-left]{top:-95px;left:10px}[data-watermark-top-right]{top:-95px;right:37px}' } }; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],11:[function(require,module,exports){ "use strict"; var PluginMixin = require('./plugin_mixin'); var BaseObject = require('./base_object'); var Plugin = BaseObject.extend(PluginMixin).extend({}); module.exports = Plugin; },{"./base_object":"2HNVgz","./plugin_mixin":12}],12:[function(require,module,exports){ "use strict"; var PluginMixin = { initialize: function() { this.bindEvents(); }, enable: function() { this.bindEvents(); }, disable: function() { this.stopListening(); } }; module.exports = PluginMixin; },{}],13:[function(require,module,exports){ (function (global){ "use strict"; var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var JST = require('./jst'); var Styler = {getStyleFor: function(name, options) { options = options || {}; return $('<style></style>').html(_.template(JST.CSS[name])(options)); }}; module.exports = Styler; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./jst":10}],"8lqCAT":[function(require,module,exports){ (function (global){ "use strict"; var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var extend = require('./utils').extend; var BaseObject = require('./base_object'); var delegateEventSplitter = /^(\S+)\s*(.*)$/; var viewOptions = ['container', 'el', 'id', 'attributes', 'className', 'tagName', 'events']; var UIObject = function UIObject(options) { this.cid = _.uniqueId('c'); this._ensureElement(); $traceurRuntime.superCall(this, $UIObject.prototype, "constructor", [options]); this.delegateEvents(); }; var $UIObject = UIObject; ($traceurRuntime.createClass)(UIObject, { get tagName() { return 'div'; }, $: function(selector) { return this.$el.find(selector); }, initialize: function() {}, render: function() { return this; }, remove: function() { this.$el.remove(); this.stopListening(); return this; }, setElement: function(element, delegate) { if (this.$el) this.undelegateEvents(); this.$el = element instanceof $ ? element : $(element); this.el = this.$el[0]; if (delegate !== false) this.delegateEvents(); return this; }, delegateEvents: function(events) { if (!(events || (events = _.result(this, 'events')))) return this; this.undelegateEvents(); for (var key in events) { var method = events[key]; if (!_.isFunction(method)) method = this[events[key]]; if (!method) continue; var match = key.match(delegateEventSplitter); var eventName = match[1], selector = match[2]; method = _.bind(method, this); eventName += '.delegateEvents' + this.cid; if (selector === '') { this.$el.on(eventName, method); } else { this.$el.on(eventName, selector, method); } } return this; }, undelegateEvents: function() { this.$el.off('.delegateEvents' + this.cid); return this; }, _ensureElement: function() { if (!this.el) { var attrs = _.extend({}, _.result(this, 'attributes')); if (this.id) attrs.id = _.result(this, 'id'); if (this.className) attrs['class'] = _.result(this, 'className'); var $el = $('<' + _.result(this, 'tagName') + '>').attr(attrs); this.setElement($el, false); } else { this.setElement(_.result(this, 'el'), false); } } }, {}, BaseObject); UIObject.extend = extend; module.exports = UIObject; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./base_object":"2HNVgz","./utils":18}],"ui_object":[function(require,module,exports){ module.exports=require('8lqCAT'); },{}],"Z7u8cr":[function(require,module,exports){ (function (global){ "use strict"; var PluginMixin = require('./plugin_mixin'); var UIObject = require('./ui_object'); var extend = require('./utils').extend; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var UIPlugin = function UIPlugin() { $traceurRuntime.defaultSuperCall(this, $UIPlugin.prototype, arguments); }; var $UIPlugin = UIPlugin; ($traceurRuntime.createClass)(UIPlugin, { get type() { return 'ui'; }, enable: function() { $UIPlugin.super('enable').call(this); this.$el.show(); }, disable: function() { $UIPlugin.super('disable').call(this); this.$el.hide(); }, bindEvents: function() {} }, {}, UIObject); _.extend(UIPlugin.prototype, PluginMixin); UIPlugin.extend = extend; module.exports = UIPlugin; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./plugin_mixin":12,"./ui_object":"8lqCAT","./utils":18}],"ui_plugin":[function(require,module,exports){ module.exports=require('Z7u8cr'); },{}],18:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Moment = require('moment'); var extend = function(protoProps, staticProps) { var parent = this; var child; if (protoProps && _.has(protoProps, 'constructor')) { child = protoProps.constructor; } else { child = function() { return parent.apply(this, arguments); }; } _.extend(child, parent, staticProps); var Surrogate = function() { this.constructor = child; }; Surrogate.prototype = parent.prototype; child.prototype = new Surrogate(); if (protoProps) _.extend(child.prototype, protoProps); child.__super__ = parent.prototype; child.super = function(name) { return parent.prototype[name]; }; child.prototype.getClass = function() { return child; }; return child; }; var zeroPad = function(number, size) { return (new Array(size + 1 - number.toString().length)).join('0') + number; }; var formatTime = function(time, showMillis) { var duration = Moment.duration(time * 1000); var str = zeroPad(duration.seconds(), 2); if (duration.hours()) { str = zeroPad(duration.minutes(), 2) + ':' + str; str = duration.hours() + ':' + str; } else { str = duration.minutes() + ':' + str; } if (showMillis) str += '.' + duration.milliseconds(); return str; }; var Fullscreen = { isFullscreen: function() { return document.webkitIsFullScreen || document.mozFullScreen; }, requestFullscreen: function(el) { if (el.requestFullscreen) { el.requestFullscreen(); } else if (el.webkitRequestFullscreen) { el.webkitRequestFullscreen(); } else if (el.mozRequestFullScreen) { el.mozRequestFullScreen(); } else if (el.msRequestFullscreen) { el.msRequestFullscreen(); } }, cancelFullscreen: function() { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } } }; module.exports = { extend: extend, zeroPad: zeroPad, formatTime: formatTime, Fullscreen: Fullscreen }; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"moment":4}],19:[function(require,module,exports){ (function (global){ "use strict"; var UIObject = require('../../base/ui_object'); var Styler = require('../../base/styler'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Container = function Container() { $traceurRuntime.defaultSuperCall(this, $Container.prototype, arguments); }; var $Container = Container; ($traceurRuntime.createClass)(Container, { get name() { return 'Container'; }, get attributes() { return {'data-container': ''}; }, get events() { return {'click': 'clicked'}; }, initialize: function(options) { this.playback = options.playback; this.settings = this.playback.settings; this.listenTo(this.playback, 'playback:progress', this.progress); this.listenTo(this.playback, 'playback:timeupdate', this.timeUpdated); this.listenTo(this.playback, 'playback:ready', this.ready); this.listenTo(this.playback, 'playback:buffering', this.buffering); this.listenTo(this.playback, 'playback:bufferfull', this.bufferfull); this.listenTo(this.playback, 'playback:settingsupdate', this.settingsUpdate); this.listenTo(this.playback, 'playback:loadedmetadata', this.loadedMetadata); this.listenTo(this.playback, 'playback:highdefinitionupdate', this.highDefinitionUpdate); this.listenTo(this.playback, 'playback:mediacontrol:disable', this.disableMediaControl); this.listenTo(this.playback, 'playback:mediacontrol:enable', this.enableMediaControl); this.listenTo(this.playback, 'playback:ended', this.ended); this.listenTo(this.playback, 'playback:play', this.playing); this.isReady = false; this.mediaControlDisabled = false; this.plugins = [this.playback]; }, with: function(klass) { _.extend(this, klass); return this; }, destroy: function() { this.trigger('container:destroyed', this, this.name); this.playback.destroy(); this.$el.remove(); }, setStyle: function(style) { this.$el.css(style); }, animate: function(style, duration) { return this.$el.animate(style, duration).promise(); }, ready: function() { this.isReady = true; this.trigger('container:ready', this.name); }, isPlaying: function() { return this.playback.isPlaying(); }, error: function(errorObj) { this.trigger('container:error', errorObj, this.name); }, loadedMetadata: function(duration) { this.trigger('container:loadedmetadata', duration); }, timeUpdated: function(position, duration) { this.trigger('container:timeupdate', position, duration, this.name); }, progress: function(startPosition, endPosition, duration) { this.trigger('container:progress', startPosition, endPosition, duration, this.name); }, playing: function() { this.trigger('container:play', this.name); }, play: function() { this.playback.play(); }, stop: function() { this.trigger('container:stop', this.name); this.playback.stop(); }, pause: function() { this.trigger('container:pause', this.name); this.playback.pause(); }, ended: function() { this.trigger('container:ended', this, this.name); }, clicked: function() { this.trigger('container:click', this, this.name); }, setCurrentTime: function(time) { this.trigger('container:seek', time, this.name); this.playback.seek(time); }, setVolume: function(value) { this.trigger('container:volume', value, this.name); this.playback.volume(value); }, requestFullscreen: function() { this.trigger('container:fullscreen', this.name); }, buffering: function() { this.trigger('container:state:buffering', this.name); }, bufferfull: function() { this.trigger('container:state:bufferfull', this.name); }, addPlugin: function(plugin) { this.plugins.push(plugin); }, hasPlugin: function(name) { return !!this.getPlugin(name); }, getPlugin: function(name) { return _(this.plugins).find(function(plugin) { return plugin.name === name; }); }, settingsUpdate: function() { this.settings = this.playback.settings; this.trigger('container:settingsupdate'); }, highDefinitionUpdate: function() { this.trigger('container:highdefinitionupdate'); }, isHighDefinitionInUse: function() { return this.playback.isHighDefinition(); }, disableMediaControl: function() { this.mediaControlDisabled = true; this.trigger('container:mediacontrol:disable'); }, enableMediaControl: function() { this.mediaControlDisabled = false; this.trigger('container:mediacontrol:enable'); }, render: function() { var style = Styler.getStyleFor('container'); this.$el.append(style); this.$el.append(this.playback.render().el); return this; } }, {}, UIObject); ; module.exports = Container; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/styler":13,"../../base/ui_object":"8lqCAT"}],20:[function(require,module,exports){ "use strict"; module.exports = require('./container'); },{"./container":19}],21:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var BaseObject = require('../../base/base_object'); var Container = require('../container'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var ContainerFactory = function ContainerFactory() { $traceurRuntime.defaultSuperCall(this, $ContainerFactory.prototype, arguments); }; var $ContainerFactory = ContainerFactory; ($traceurRuntime.createClass)(ContainerFactory, { initialize: function(params, loader) { this.params = params; this.loader = loader; }, createContainers: function() { return $.Deferred(function(promise) { promise.resolve(_.map(this.params.sources, function(source) { return this.createContainer(source); }, this)); }.bind(this)); }, findPlaybackPlugin: function(source) { return _.find(this.loader.playbackPlugins, (function(p) { return p.canPlay("" + source); }), this); }, createContainer: function(source) { var playbackPlugin = this.findPlaybackPlugin(source); var params = _.extend({}, this.params, { src: source, autoPlay: !!this.params.autoPlay }); var playback = new playbackPlugin(params); var container = new Container({playback: playback}); var defer = $.Deferred(); defer.promise(container); this.addContainerPlugins(container, source); this.listenToOnce(container, 'container:ready', (function() { return defer.resolve(container); })); return container; }, addContainerPlugins: function(container, source) { _.each(this.loader.containerPlugins, function(plugin) { var params = _.extend(this.params, { container: container, src: source }); container.addPlugin(new plugin(params)); }, this); } }, {}, BaseObject); ; module.exports = ContainerFactory; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../container":20}],22:[function(require,module,exports){ "use strict"; module.exports = require('./container_factory'); },{"./container_factory":21}],23:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var UIObject = require('../../base/ui_object'); var ContainerFactory = require('../container_factory'); var Fullscreen = require('../../base/utils').Fullscreen; var Loader = require('../loader'); var Styler = require('../../base/styler'); var MediaControl = require('../media_control'); var Core = function Core() { $traceurRuntime.defaultSuperCall(this, $Core.prototype, arguments); }; var $Core = Core; ($traceurRuntime.createClass)(Core, { get events() { return { 'webkitfullscreenchange': 'exit', 'mousemove': 'showMediaControl', 'mouseleave': 'hideMediaControl' }; }, get attributes() { return {'data-player': ''}; }, initialize: function(params) { var $__0 = this; this.defer = $.Deferred(); this.defer.promise(this); this.plugins = []; this.containers = []; this.params = params; this.params.displayType || (this.params.displayType = 'pip'); this.parentElement = params.parentElement; this.loader = new Loader(params); this.containerFactory = new ContainerFactory(params, this.loader); this.containerFactory.createContainers().then((function(containers) { return $__0.setupContainers(containers); })).then((function(containers) { return $__0.resolveOnContainersReady(containers); })); this.updateSize(); document.addEventListener('mozfullscreenchange', (function() { return $__0.exit(); })); $(window).resize((function() { return $__0.updateSize(); })); }, updateSize: function() { if (Fullscreen.isFullscreen()) { this.$el.addClass('fullscreen'); this.$el.removeAttr('style'); } else { var width = 0; var height = 0; if (this.params.stretchWidth && this.params.stretchHeight && this.params.stretchWidth <= window.innerWidth && this.params.stretchHeight <= (window.innerHeight * 0.73)) { width = this.params.stretchWidth; height = this.params.stretchHeight; } else { width = this.params.width || width; height = this.params.height || height; } if (width > 0) { this.$el.css({width: width}); } if (height > 0) { this.$el.css({height: height}); } this.$el.removeClass('fullscreen'); } }, resolveOnContainersReady: function(containers) { var $__0 = this; $.when.apply($, containers).done((function() { return $__0.defer.resolve($__0); })); }, addPlugin: function(plugin) { this.plugins.push(plugin); }, hasPlugin: function(name) { return !!this.getPlugin(name); }, getPlugin: function(name) { return _(this.plugins).find((function(plugin) { return plugin.name === name; })); }, load: function(sources) { var $__0 = this; sources = _.isString(sources) ? [sources] : sources; _(this.containers).each((function(container) { return container.destroy(); })); this.containerFactory.params = _(this.params).extend({sources: sources}); this.containerFactory.createContainers().then((function(containers) { return $__0.setupContainers(containers); })); }, destroy: function() { _(this.containers).each((function(container) { return container.destroy(); })); this.$el.remove(); }, exit: function() { this.updateSize(); this.mediaControl.show(); }, setMediaControlContainer: function(container) { this.mediaControl.setContainer(container); this.mediaControl.render(); }, disableMediaControl: function() { this.mediaControl.disable(); this.$el.removeClass('nocursor'); }, enableMediaControl: function() { this.mediaControl.enable(); }, removeContainer: function(container) { console.log('container being removed'); this.stopListening(container); this.containers = _.without(this.containers, container); }, appendContainer: function(container) { this.listenTo(container, 'container:destroyed', this.removeContainer); this.el.appendChild(container.render().el); this.containers.push(container); }, prependContainer: function(container) { this.listenTo(container, 'container:destroyed', this.removeContainer); this.$el.append(container.render().el); this.containers.unshift(container); }, setupContainers: function(containers) { _.map(containers, this.appendContainer, this); this.setupMediaControl(this.getCurrentContainer()); this.render(); this.$el.appendTo(this.parentElement); return containers; }, createContainer: function(source) { var container = this.containerFactory.createContainer(source); this.appendContainer(container); return container; }, setupMediaControl: function(container) { var params = _.extend({container: container}, this.params); if (this.mediaControl) { this.mediaControl.setContainer(container); } else { this.mediaControl = new MediaControl(_.extend({container: container}, this.params)); this.listenTo(this.mediaControl, 'mediacontrol:fullscreen', this.toggleFullscreen); this.listenTo(this.mediaControl, 'mediacontrol:show', this.onMediaControlShow.bind(this, true)); this.listenTo(this.mediaControl, 'mediacontrol:hide', this.onMediaControlShow.bind(this, false)); } }, getCurrentContainer: function() { return this.containers[0]; }, toggleFullscreen: function() { if (!Fullscreen.isFullscreen()) { Fullscreen.requestFullscreen(this.el); this.$el.addClass('fullscreen'); } else { Fullscreen.cancelFullscreen(); this.$el.removeClass('fullscreen nocursor'); } this.mediaControl.show(); }, showMediaControl: function(event) { this.mediaControl.show(event); }, hideMediaControl: function(event) { this.mediaControl.hide(event); }, onMediaControlShow: function(showing) { if (showing) this.$el.removeClass('nocursor'); else if (Fullscreen.isFullscreen()) this.$el.addClass('nocursor'); }, render: function() { var $__0 = this; var style = Styler.getStyleFor('core'); this.$el.append(style); this.$el.append(this.mediaControl.render().el); this.$el.ready((function() { $__0.params.width = $__0.params.width || $__0.$el.width(); $__0.params.height = $__0.params.height || $__0.$el.height(); $__0.updateSize(); })); return this; } }, {}, UIObject); module.exports = Core; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/styler":13,"../../base/ui_object":"8lqCAT","../../base/utils":18,"../container_factory":22,"../loader":27,"../media_control":29}],24:[function(require,module,exports){ "use strict"; module.exports = require('./core'); },{"./core":23}],25:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var BaseObject = require('../../base/base_object'); var Core = require('../core'); var CoreFactory = BaseObject.extend({ initialize: function(player, loader) { this.player = player; this.params = player.params; this.loader = loader; }, create: function() { this.core = new Core(this.params); this.core.then(this.addCorePlugins.bind(this)); return this.core; }, addCorePlugins: function() { _.each(this.loader.globalPlugins, function(Plugin) { var plugin = new Plugin(this.core); this.core.addPlugin(plugin); this.setupExternalInterface(plugin); }, this); return this.core; }, setupExternalInterface: function(plugin) { _.each(plugin.getExternalInterface(), function(value, key) { this.player[key] = value.bind(plugin); }, this); } }); module.exports = CoreFactory; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../core":24}],26:[function(require,module,exports){ "use strict"; module.exports = require('./core_factory'); },{"./core_factory":25}],27:[function(require,module,exports){ "use strict"; module.exports = require('./loader'); },{"./loader":28}],28:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var HTML5VideoPlaybackPlugin = require('../../playbacks/html5_video'); var FlashVideoPlaybackPlugin = require('../../playbacks/flash_vod'); var HTML5AudioPlaybackPlugin = require('../../playbacks/html5_audio'); var HLSVideoPlaybackPlugin = require('../../playbacks/hls'); var SpinnerThreeBouncePlugin = require('../../plugins/spinner_three_bounce'); var StatsPlugin = require('../../plugins/stats'); var WaterMarkPlugin = require('../../plugins/watermark'); var PosterPlugin = require('../../plugins/poster'); var PipPlugin = require('../../plugins/pip'); var Sequence = require('../../plugins/sequence'); var Loader = BaseObject.extend({ displayPlugins: { 'sequence': Sequence, 'pip': PipPlugin }, initialize: function(params) { this.params = params; this.playbackPlugins = [FlashVideoPlaybackPlugin, HTML5VideoPlaybackPlugin, HTML5AudioPlaybackPlugin, HLSVideoPlaybackPlugin]; this.containerPlugins = [SpinnerThreeBouncePlugin, WaterMarkPlugin, PosterPlugin, StatsPlugin]; this.globalPlugins = [this.displayPlugins[this.params.displayType]]; this.addExternalPlugins(params.plugins || []); }, addExternalPlugins: function(plugins) { if (plugins.playback) { this.playbackPlugins = plugins.playback.concat(this.playbackPlugins); } if (plugins.container) { this.containerPlugins = plugins.container.concat(this.containerPlugins); } if (plugins.core) { this.globalPlugins = plugins.core.concat(this.globalPlugins); } }, getPlugin: function(name) { return _.find(_.union(this.containerPlugins, this.playbackPlugins, this.globalPlugins), function(plugin) { return plugin.prototype.name === name; }); } }); module.exports = Loader; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../../playbacks/flash_vod":34,"../../playbacks/hls":36,"../../playbacks/html5_audio":38,"../../playbacks/html5_video":40,"../../plugins/pip":45,"../../plugins/poster":47,"../../plugins/sequence":49,"../../plugins/spinner_three_bounce":52,"../../plugins/stats":54,"../../plugins/watermark":57}],29:[function(require,module,exports){ "use strict"; module.exports = require('./media_control'); },{"./media_control":30}],30:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var JST = require('../../base/jst'); var Styler = require('../../base/styler'); var UIObject = require('../../base/ui_object'); var Utils = require('../../base/utils'); var MediaControl = function MediaControl() { $traceurRuntime.defaultSuperCall(this, $MediaControl.prototype, arguments); }; var $MediaControl = MediaControl; ($traceurRuntime.createClass)(MediaControl, { get name() { return 'MediaControl'; }, get attributes() { return { class: 'media-control', 'data-media-control': '' }; }, get events() { return { 'click [data-play]': 'play', 'click [data-pause]': 'pause', 'click [data-playpause]': 'togglePlayPause', 'click [data-stop]': 'stop', 'click [data-playstop]': 'togglePlayStop', 'click [data-fullscreen]': 'toggleFullscreen', 'click [data-seekbar]': 'seek', 'click .bar-background[data-volume]': 'volume', 'click .drawer-icon[data-volume]': 'toggleMute', 'mouseover .drawer-container[data-volume]': 'showVolumeBar', 'mouseleave .drawer-container[data-volume]': 'hideVolumeBar', 'mousedown .bar-scrubber[data-seekbar]': 'startSeekDrag', 'mousedown .bar-scrubber[data-volume]': 'startVolumeDrag', 'mouseenter .media-control-layer[data-controls]': 'setKeepVisible', 'mouseleave .media-control-layer[data-controls]': 'resetKeepVisible' }; }, get template() { return JST.media_control; }, initialize: function(params) { var $__0 = this; this.params = params; this.container = params.container; this.keepVisible = false; this.addEventListeners(); this.defaultSettings = { left: ['play', 'stop', 'pause'], right: ['volume'], default: ['position', 'seekbar', 'duration'] }; this.disabled = false; if (this.container.mediaControlDisabled || this.params.chromeless) this.disable(); this.currentVolume = 100; $(document).bind('mouseup', (function(event) { return $__0.stopDrag(event); })); $(document).bind('mousemove', (function(event) { return $__0.updateDrag(event); })); }, addEventListeners: function() { this.listenTo(this.container, 'container:play', this.changeTogglePlay); this.listenTo(this.container, 'container:playing', this.changeTogglePlay); this.listenTo(this.container, 'container:timeupdate', this.updateSeekBar); this.listenTo(this.container, 'container:progress', this.updateProgressBar); this.listenTo(this.container, 'container:settingsupdate', this.settingsUpdate); this.listenTo(this.container, 'container:highdefinitionupdate', this.highDefinitionUpdate); this.listenTo(this.container, 'container:mediacontrol:disable', this.disable); this.listenTo(this.container, 'container:mediacontrol:enable', this.enable); this.listenTo(this.container, 'container:ended', this.ended); }, disable: function() { this.disabled = true; this.hide(); this.$el.hide(); }, enable: function() { if (this.params.chromeless) return; this.disabled = false; this.show(); }, play: function() { this.container.play(); }, pause: function() { this.container.pause(); }, stop: function() { this.container.stop(); }, changeTogglePlay: function() { if (this.container.isPlaying()) { this.$playPauseToggle.removeClass('paused').addClass('playing'); this.$playStopToggle.removeClass('stopped').addClass('playing'); } else { this.$playPauseToggle.removeClass('playing').addClass('paused'); this.$playStopToggle.removeClass('playing').addClass('stopped'); } }, onKeyDown: function(event) { if (event.keyCode === 32) this.togglePlayPause(); }, togglePlayPause: function() { if (this.container.isPlaying()) { this.container.pause(); } else { this.container.play(); } this.changeTogglePlay(); }, togglePlayStop: function() { if (this.container.isPlaying()) { this.container.stop(); } else { this.container.play(); } this.changeTogglePlay(); }, startSeekDrag: function(event) { this.draggingSeekBar = true; if (event) { event.preventDefault(); } }, startVolumeDrag: function(event) { this.draggingVolumeBar = true; if (event) { event.preventDefault(); } }, stopDrag: function(event) { if (this.draggingSeekBar) { this.seek(event); } this.draggingSeekBar = false; this.draggingVolumeBar = false; }, updateDrag: function(event) { if (event) { event.preventDefault(); } if (this.draggingSeekBar) { var offsetX = event.pageX - this.$seekBarContainer.offset().left; var pos = offsetX / this.$seekBarContainer.width() * 100; pos = Math.min(100, Math.max(pos, 0)); this.setSeekPercentage(pos); } else if (this.draggingVolumeBar) { this.volume(event); } }, volume: function(event) { var offsetY = event.pageY - this.$volumeBarContainer.offset().top; this.currentVolume = (1 - (offsetY / this.$volumeBarContainer.height())) * 100; this.currentVolume = Math.min(100, Math.max(this.currentVolume, 0)); this.container.setVolume(this.currentVolume); this.setVolumeLevel(this.currentVolume); }, toggleMute: function() { if (!!this.mute) { this.container.setVolume(this.currentVolume); this.setVolumeLevel(this.currentVolume); this.mute = false; } else { this.container.setVolume(0); this.setVolumeLevel(0); this.mute = true; } }, toggleFullscreen: function() { this.trigger('mediacontrol:fullscreen', this.name); }, setContainer: function(container) { this.stopListening(this.container); this.container = container; this.changeTogglePlay(); this.addEventListeners(); this.settingsUpdate(); this.container.setVolume(this.currentVolume); if (this.container.mediaControlDisabled) this.disable(); }, showVolumeBar: function() { if (this.hideVolumeId) { clearTimeout(this.hideVolumeId); } this.$volumeBarContainer.show(); this.$volumeBarContainer.removeClass('volume-bar-hide'); }, hideVolumeBar: function() { var $__0 = this; if (!this.$volumeBarContainer) return; if (this.hideVolumeId) { clearTimeout(this.hideVolumeId); } this.hideVolumeId = setTimeout((function() { $__0.$volumeBarContainer.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', (function() { $__0.$volumeBarContainer.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend'); $__0.$volumeBarContainer.hide(); })); $__0.$volumeBarContainer.addClass('volume-bar-hide'); }), 750); }, ended: function() { this.changeTogglePlay(); }, updateProgressBar: function(startPosition, endPosition, duration) { var loadedStart = startPosition / duration * 100; var loadedEnd = endPosition / duration * 100; this.$seekBarLoaded.css({ left: loadedStart + '%', width: (loadedEnd - loadedStart) + '%' }); }, updateSeekBar: function(position, duration) { if (this.draggingSeekBar) return; var seekbarValue = (100 / duration) * position; this.setSeekPercentage(seekbarValue); this.$('[data-position]').html(Utils.formatTime(position)); this.$('[data-duration]').html(Utils.formatTime(duration)); }, seek: function(event) { var offsetX = event.pageX - this.$seekBarContainer.offset().left; var pos = offsetX / this.$seekBarContainer.width() * 100; pos = Math.min(100, Math.max(pos, 0)); this.container.setCurrentTime(pos); }, setKeepVisible: function() { this.keepVisible = true; }, resetKeepVisible: function() { this.keepVisible = false; }, show: function(event) { var $__0 = this; if (this.disabled) return; var timeout = 2000; if (!event || (event.clientX !== this.lastMouseX && event.clientY !== this.lastMouseY) || navigator.userAgent.match(/firefox/i)) { if (this.hideId) { clearTimeout(this.hideId); } this.$el.show(); this.trigger('mediacontrol:show', this.name); this.$el.removeClass('media-control-hide'); this.hideId = setTimeout((function() { return $__0.hide(); }), timeout); if (event) { this.lastMouseX = event.clientX; this.lastMouseY = event.clientY; } } }, hide: function() { var $__0 = this; var timeout = 2000; if (this.hideId) { clearTimeout(this.hideId); } if (this.keepVisible || this.draggingVolumeBar || this.draggingSeekBar) { this.hideId = setTimeout((function() { return $__0.hide(); }), timeout); } else { if (this.$volumeBarContainer) { this.$volumeBarContainer.hide(); } this.trigger('mediacontrol:hide', this.name); this.$el.addClass('media-control-hide'); } }, settingsUpdate: function() { this.render(); }, highDefinitionUpdate: function() { var $element = this.$el.find('button[data-hd]'); $element.removeClass('enabled'); if (this.container.isHighDefinitionInUse()) { $element.addClass('enabled'); } }, createCachedElements: function() { this.$playPauseToggle = this.$el.find('button.media-control-button[data-playpause]'); this.$playStopToggle = this.$el.find('button.media-control-button[data-playstop]'); this.$seekBarContainer = this.$el.find('.bar-container[data-seekbar]'); this.$seekBarLoaded = this.$el.find('.bar-fill-1[data-seekbar]'); this.$seekBarPosition = this.$el.find('.bar-fill-2[data-seekbar]'); this.$seekBarScrubber = this.$el.find('.bar-scrubber[data-seekbar]'); this.$volumeBarContainer = this.$el.find('.bar-container[data-volume]'); this.$volumeBarBackground = this.$el.find('.bar-background[data-volume]'); this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]'); this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]'); this.$volumeIcon = this.$el.find('.drawer-icon[data-volume]'); }, setVolumeLevel: function(value) { var containerHeight = this.$volumeBarContainer.height(); var barHeight = this.$volumeBarBackground.height(); var offset = (containerHeight - barHeight) / 2.0; var pos = barHeight * value / 100.0 - this.$volumeBarScrubber.height() / 2.0 + offset; this.$volumeBarFill.css({height: value + '%'}); this.$volumeBarScrubber.css({bottom: pos}); if (value > 0) { this.$volumeIcon.removeClass('muted'); } else { this.$volumeIcon.addClass('muted'); } }, setSeekPercentage: function(value) { var pos = this.$seekBarContainer.width() * value / 100.0 - this.$seekBarScrubber.width() / 2.0; this.$seekBarPosition.css({width: value + '%'}); this.$seekBarScrubber.css({left: pos}); }, bindKeyEvents: function() { var $__0 = this; if (this.keydownHandlerFn) { $(document).unbind('keydown', this.keydownHandlerFn); } else { this.keydownHandlerFn = (function(event) { return $__0.onKeyDown(event); }); } if (this.$playPauseToggle.length > 0) { $(document).bind('keydown', this.keydownHandlerFn); } }, render: function() { var $__0 = this; var timeout = 1000; var style = Styler.getStyleFor('media_control'); var settings = _.isEmpty(this.container.settings) ? this.defaultSettings : this.container.settings; this.$el.html(this.template({settings: settings})); this.$el.append(style); this.createCachedElements(); this.$playPauseToggle.addClass('paused'); this.$playStopToggle.addClass('stopped'); this.currentVolume = this.currentVolume || 100; this.$volumeBarContainer.hide(); if (this.params.autoPlay) { this.togglePlayPause(); this.togglePlayStop(); } this.changeTogglePlay(); this.hideId = setTimeout((function() { return $__0.hide(); }), timeout); if (this.disabled) this.hide(); this.$el.ready((function() { $__0.setVolumeLevel($__0.currentVolume); $__0.setSeekPercentage(0); $__0.bindKeyEvents(); })); return this; } }, {}, UIObject); module.exports = MediaControl; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_object":"8lqCAT","../../base/utils":18}],31:[function(require,module,exports){ "use strict"; var Events = require('../base/events'); var events = new Events(); var Mediator = function Mediator() {}; ($traceurRuntime.createClass)(Mediator, {}, {}); Mediator.on = function(name, callback, context) { events.on(name, callback, context); return; }; Mediator.once = function(name, callback, context) { events.once(name, callback, context); return; }; Mediator.off = function(name, callback, context) { events.off(name, callback, context); return; }; Mediator.trigger = function(name, opts) { events.trigger(name, opts); return; }; Mediator.stopListening = function(obj, name, callback) { events.stopListening(obj, name, callback); return; }; module.exports = Mediator; },{"../base/events":9}],32:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('./base/base_object'); var CoreFactory = require('./components/core_factory'); var Loader = require('./components/loader'); var Mediator = require('./components/mediator'); var Player = function Player() { $traceurRuntime.defaultSuperCall(this, $Player.prototype, arguments); }; var $Player = Player; ($traceurRuntime.createClass)(Player, { initialize: function(params) { window.p = this; params.displayType || (params.displayType = 'pip'); this.params = params; this.loader = new Loader(this.params); this.coreFactory = new CoreFactory(this, this.loader); }, attachTo: function(element) { this.params.parentElement = element; this.core = this.coreFactory.create(); }, load: function(sources) { this.core.load(sources); }, destroy: function() { this.core.destroy(); } }, {}, BaseObject); global.DEBUG = false; window.WP3 = { Player: Player, Mediator: Mediator }; module.exports = window.WP3; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./base/base_object":"2HNVgz","./components/core_factory":26,"./components/loader":27,"./components/mediator":31}],33:[function(require,module,exports){ (function (global){ "use strict"; var UIObject = require('../../base/ui_object'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var Mediator = require('../../components/mediator'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var objectIE = '<object type="application/x-shockwave-flash" id="<%= cid %>" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" data-flash-vod=""><param name="movie" value="<%= swfPath %>"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="gpu"> <param name="tabindex" value="1"> </object>'; var FlashVOD = function FlashVOD() { $traceurRuntime.defaultSuperCall(this, $FlashVOD.prototype, arguments); }; var $FlashVOD = FlashVOD; ($traceurRuntime.createClass)(FlashVOD, { get name() { return 'flash_vod'; }, get tagName() { return 'object'; }, get template() { return JST.flash_vod; }, initialize: function(options) { $traceurRuntime.superCall(this, $FlashVOD.prototype, "initialize", [options]); this.src = options.src; this.swfPath = options.swfPath || "assets/Player.swf"; this.autoPlay = options.autoPlay; this.settings = { left: ["playpause", "position", "duration"], default: ["seekbar"], right: ["fullscreen", "volume"] }; this.isReady = false; this.addListeners(); }, safe: function(fn) { if (this.el.getState && this.el.getDuration && this.el.getPosition && this.el.getBytesLoaded && this.el.getBytesTotal) { return fn.apply(this); } }, bootstrap: function() { this.el.width = "100%"; this.el.height = "100%"; this.isReady = true; this.trigger('playback:ready', this.name); this.currentState = "IDLE"; this.autoPlay && this.play(); $('<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%" />').insertAfter(this.$el); }, setupFirefox: function() { var $el = this.$('embed'); $el.attr('data-flash-vod', ''); this.setElement($el[0]); }, getPlaybackType: function() { return "vod"; }, updateTime: function() { var $__0 = this; this.safe((function() { $__0.trigger('playback:timeupdate', $__0.el.getPosition(), $__0.el.getDuration(), $__0.name); })); }, addListeners: function() { var $__0 = this; Mediator.on(this.uniqueId + ':progress', (function() { return $__0.progress(); })); Mediator.on(this.uniqueId + ':timeupdate', (function() { return $__0.updateTime(); })); Mediator.on(this.uniqueId + ':statechanged', (function() { return $__0.checkState(); })); Mediator.on(this.uniqueId + ':flashready', (function() { return $__0.bootstrap(); })); }, stopListening: function() { $traceurRuntime.superCall(this, $FlashVOD.prototype, "stopListening", []); Mediator.off(this.uniqueId + ':progress'); Mediator.off(this.uniqueId + ':timeupdate'); Mediator.off(this.uniqueId + ':statechanged'); }, checkState: function() { var $__0 = this; this.safe((function() { if ($__0.currentState !== "PLAYING_BUFFERING" && $__0.el.getState() === "PLAYING_BUFFERING") { $__0.trigger('playback:buffering', $__0.name); $__0.currentState = "PLAYING_BUFFERING"; } else if ($__0.currentState === "PLAYING_BUFFERING" && $__0.el.getState() === "PLAYING") { $__0.trigger('playback:bufferfull', $__0.name); $__0.currentState = "PLAYING"; } else if ($__0.el.getState() === "IDLE") { $__0.currentState = "IDLE"; } else if ($__0.el.getState() === "ENDED") { $__0.trigger('playback:ended', $__0.name); $__0.trigger('playback:timeupdate', 0, $__0.el.getDuration(), $__0.name); $__0.currentState = "ENDED"; } })); }, progress: function() { var $__0 = this; this.safe((function() { if ($__0.currentState !== "IDLE" && $__0.currentState !== "ENDED") { $__0.trigger('playback:progress', 0, $__0.el.getBytesLoaded(), $__0.el.getBytesTotal(), $__0.name); } })); }, firstPlay: function() { var $__0 = this; this.safe((function() { $__0.currentState = "PLAYING"; $__0.el.playerPlay($__0.src); })); }, play: function() { var $__0 = this; this.safe((function() { if ($__0.el.getState() === 'PAUSED') { $__0.currentState = "PLAYING"; $__0.el.playerResume(); } else if ($__0.el.getState() !== 'PLAYING') { $__0.firstPlay(); } $__0.trigger('playback:play', $__0.name); })); }, volume: function(value) { var $__0 = this; this.safe((function() { $__0.el.playerVolume(value); })); }, pause: function() { var $__0 = this; this.safe((function() { $__0.currentState = "PAUSED"; $__0.el.playerPause(); })); }, stop: function() { var $__0 = this; this.safe((function() { $__0.el.playerStop(); $__0.trigger('playback:timeupdate', 0, $__0.name); })); }, isPlaying: function() { return !!(this.isReady && this.currentState == "PLAYING"); }, getDuration: function() { var $__0 = this; return this.safe((function() { return $__0.el.getDuration(); })); }, seek: function(time) { var $__0 = this; this.safe((function() { var seekTo = $__0.el.getDuration() * (time / 100); $__0.el.playerSeek(seekTo); $__0.trigger('playback:timeupdate', seekTo, $__0.el.getDuration(), $__0.name); if ($__0.currentState == "PAUSED") { $__0.pause(); } })); }, destroy: function() { clearInterval(this.bootstrapId); this.stopListening(); this.$el.remove(); }, setupIE: function() { this.setElement($(_.template(objectIE)({ cid: this.cid, swfPath: this.swfPath }))); }, render: function() { var style = Styler.getStyleFor(this.name); this.$el.html(this.template({ cid: this.cid, swfPath: this.swfPath, playbackId: this.uniqueId })); if (navigator.userAgent.match(/firefox/i)) { this.setupFirefox(); } else if (window.ActiveXObject) { this.setupIE(); } this.$el.append(style); return this; } }, {}, UIObject); FlashVOD.canPlay = function(resource) { if (navigator.userAgent.match(/firefox/i) || window.ActiveXObject) { return _.isString(resource) && !!resource.match(/(.*).(mp4|mov|f4v|3gpp|3gp)/); } else { return _.isString(resource) && !!resource.match(/(.*).(mov|f4v|3gpp|3gp)/); } }; module.exports = FlashVOD; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_object":"8lqCAT","../../components/mediator":31}],34:[function(require,module,exports){ "use strict"; module.exports = require('./flash_vod'); },{"./flash_vod":33}],35:[function(require,module,exports){ (function (global){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Mediator = require('../../components/mediator'); var Visibility = require('visibility'); var objectIE = '<object type="application/x-shockwave-flash" id="<%= cid %>" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" data-hls=""><param name="movie" value="<%= swfPath %>"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="transparent"> <param name="tabindex" value="1"> </object>'; var HLS = function HLS() { $traceurRuntime.defaultSuperCall(this, $HLS.prototype, arguments); }; var $HLS = HLS; ($traceurRuntime.createClass)(HLS, { get name() { return 'hls'; }, get tagName() { return 'object'; }, get template() { return JST.hls; }, get attributes() { return { 'data-hls': '', 'type': 'application/x-shockwave-flash' }; }, initialize: function(options) { $traceurRuntime.superCall(this, $HLS.prototype, "initialize", [options]); this.src = options.src; this.swfPath = options.swfPath || "assets/HLSPlayer.swf"; this.setupBrowser(); this.setupVisibility(); this.highDefinition = false; this.autoPlay = options.autoPlay; this.defaultSettings = { left: ["playstop"], default: [], right: ["fullscreen", "volume", "hd"] }; this.settings = _.extend({}, this.defaultSettings); this.addListeners(); }, setupBrowser: function() { this.isLegacyIE = window.ActiveXObject; this.isChrome = navigator.userAgent.match(/chrome/i); this.isFirefox = navigator.userAgent.match(/firefox/i); this.isSafari = navigator.userAgent.match(/safari/i); }, setupVisibility: function() { var $__0 = this; this.visibility = new Visibility(); this.visibility.on('show', (function() { return $__0.visibleCallback(); })); this.visibility.on('hide', (function() { return $__0.hiddenCallback(); })); }, addListeners: function() { var $__0 = this; Mediator.on(this.uniqueId + ':flashready', (function() { return $__0.bootstrap(); })); Mediator.on(this.uniqueId + ':timeupdate', (function(params) { return $__0.updateTime(params); })); Mediator.on(this.uniqueId + ':playbackstate', (function(params) { return $__0.setPlaybackState(params); })); Mediator.on(this.uniqueId + ':highdefinition', (function(params) { return $__0.updateHighDefinition(params); })); }, stopListening: function() { $traceurRuntime.superCall(this, $HLS.prototype, "stopListening", []); Mediator.off(this.uniqueId + ':flashready'); Mediator.off(this.uniqueId + ':timeupdate'); Mediator.off(this.uniqueId + ':playbackstate'); Mediator.off(this.uniqueId + ':highdefinition'); }, safe: function(fn) { if (this.el.globoGetState && this.el.globoGetDuration && this.el.globoGetPosition && this.el.globoPlayerSmoothSetLevel && this.el.globoPlayerSetflushLiveURLCache) { return fn.apply(this); } }, hiddenCallback: function() { var $__0 = this; this.hiddenId = this.safe((function() { return setTimeout((function() { return $__0.el.globoPlayerSmoothSetLevel(0); }), 10000); })); }, visibleCallback: function() { var $__0 = this; this.safe((function() { if ($__0.hiddenId) { clearTimeout($__0.hiddenId); } if (!$__0.el.globoGetAutoLevel()) { $__0.el.globoPlayerSmoothSetLevel(-1); } })); }, bootstrap: function() { this.el.width = "100%"; this.el.height = "100%"; this.trigger('playback:ready', this.name); this.currentState = "IDLE"; this.el.globoPlayerSetflushLiveURLCache(true); this.autoPlay && this.play(); }, updateHighDefinition: function(params) { this.highDefinition = params.isHD; this.trigger('playback:highdefinitionupdate'); }, updateTime: function(params) { var $__0 = this; return this.safe((function() { var previousDvrEnabled = $__0.dvrEnabled; $__0.dvrEnabled = ($__0.playbackType === 'live' && params.duration > 240); var duration = $__0.getDuration(); if ($__0.playbackType === 'live') { var position = $__0.el.globoGetPosition(); if (position >= duration) { position = duration; } $__0.trigger('playback:timeupdate', position, duration, $__0.name); } else { $__0.trigger('playback:timeupdate', $__0.el.globoGetPosition(), duration, $__0.name); } if ($__0.dvrEnabled != previousDvrEnabled) { $__0.updateSettings(); } })); }, play: function() { var $__0 = this; this.safe((function() { if ($__0.el.currentState === 'PAUSED') { $__0.el.globoPlayerResume(); } else { $__0.firstPlay(); } $__0.trigger('playback:play', $__0.name); })); }, getPlaybackType: function() { if (this.playbackType) return this.playbackType; return null; }, getCurrentBitrate: function() { return this.safe(function() { var currentLevel = this.getLevels()[this.el.globoGetLevel()]; return currentLevel.bitrate; }); }, getLastProgramDate: function() { var programDate = this.el.globoGetLastProgramDate(); return programDate - 1.08e+7; }, isHighDefinition: function() { return this.highDefinition; }, getLevels: function() { var $__0 = this; return this.safe((function() { if (!$__0.levels || $__0.levels.length === 0) { $__0.levels = $__0.el.globoGetLevels(); } return $__0.levels; })); }, setPlaybackState: function(params) { if (params.state === "PLAYING_BUFFERING" && this.el.globoGetbufferLength() < 1 && this.currentState !== "PLAYING_BUFFERING") { this.trigger('playback:buffering', this.name); } else if (params.state === "PLAYING" && this.currentState === "PLAYING_BUFFERING") { this.trigger('playback:bufferfull', this.name); } else if (params.state === "IDLE") { this.trigger('playback:ended', this.name); this.trigger('playback:timeupdate', 0, this.el.globoGetDuration(), this.name); } this.currentState = params.state; this.updatePlaybackType(); }, updatePlaybackType: function() { var $__0 = this; this.safe((function() { if (!$__0.playbackType) { $__0.playbackType = $__0.el.globoGetType(); if ($__0.playbackType) { $__0.playbackType = $__0.playbackType.toLowerCase(); $__0.updateSettings(); } } })); }, firstPlay: function() { var $__0 = this; this.safe((function() { $__0.el.globoPlayerLoad($__0.src); $__0.el.globoPlayerPlay(); })); }, volume: function(value) { var $__0 = this; this.safe((function() { $__0.el.globoPlayerVolume(value); })); }, pause: function() { var $__0 = this; this.safe((function() { $__0.el.globoPlayerPause(); })); }, stop: function() { var $__0 = this; this.safe((function() { $__0.el.globoPlayerStop(); $__0.trigger('playback:timeupdate', 0, $__0.name); })); }, isPlaying: function() { var $__0 = this; return this.safe((function() { if ($__0.currentState) return !!($__0.currentState.match(/playing/i)); return false; })); }, getDuration: function() { var $__0 = this; return this.safe((function() { var duration = $__0.el.globoGetDuration(); if ($__0.playbackType === 'live') { duration = duration - 10; } return duration; })); }, seek: function(time) { var $__0 = this; this.safe((function() { if (time < 0) { $__0.el.globoPlayerSeek(time); } else { var duration = $__0.getDuration(); time = duration * time / 100; if ($__0.playbackType === 'live' && duration - time < 2) time = -1; $__0.el.globoPlayerSeek(time); } })); }, isPip: function(pipStatus) { if (pipStatus == true && this.getCurrentBitrate() > 750000) { this.el.globoPlayerSetStageScaleMode("exactFit"); this.el.globoPlayerSmoothSetLevel(2); } else if (!this.el.globoGetAutoLevel()) { this.el.globoPlayerSetStageScaleMode("noScale"); this.el.globoPlayerSetLevel(-1); } }, timeUpdate: function(time, duration) { this.trigger('playback:timeupdate', time, duration, this.name); }, destroy: function() { this.stopListening(); this.$el.remove(); }, setupFirefox: function() { var $el = this.$('embed'); $el.attr('data-hls', ''); this.setElement($el[0]); }, setupIE: function() { this.setElement($(_.template(objectIE)({ cid: this.cid, swfPath: this.swfPath }))); }, updateSettings: function() { this.settings = _.extend({}, this.defaultSettings); if (this.playbackType === "vod" || this.dvrEnabled) { this.settings.left = ["playpause", "position", "duration"]; this.settings.default = ["seekbar"]; } this.trigger('playback:settingsupdate', this.name); }, render: function() { var style = Styler.getStyleFor(this.name); this.$el.html(this.template({ cid: this.cid, swfPath: this.swfPath, playbackId: this.uniqueId })); this.$el.append(style); this.el.id = this.cid; if (this.isFirefox) { this.setupFirefox(); } else if (this.isLegacyIE) { this.setupIE(); } return this; } }, {}, UIPlugin); HLS.canPlay = function(resource) { return !!resource.match(/^http(.*).m3u8/); }; module.exports = HLS; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr","../../components/mediator":31,"visibility":5}],36:[function(require,module,exports){ "use strict"; module.exports = require('./hls'); },{"./hls":35}],37:[function(require,module,exports){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var HTML5Audio = function HTML5Audio() { $traceurRuntime.defaultSuperCall(this, $HTML5Audio.prototype, arguments); }; var $HTML5Audio = HTML5Audio; ($traceurRuntime.createClass)(HTML5Audio, { get name() { return 'html5_audio'; }, get type() { return 'playback'; }, get tagName() { return 'audio'; }, get events() { return { 'timeupdate': 'timeUpdated', 'ended': 'ended' }; }, initialize: function(options) { this.el.src = options.src; this.render(); }, setContainer: function() { this.container.settings = { left: ['playpause'], right: ['volume'], default: ['position', 'seekbar', 'duration'] }; this.render(); this.params.autoPlay && this.play(); }, bindEvents: function() { this.listenTo(this.container, 'container:play', this.play); this.listenTo(this.container, 'container:pause', this.pause); this.listenTo(this.container, 'container:seek', this.seek); this.listenTo(this.container, 'container:volume', this.volume); this.listenTo(this.container, 'container:stop', this.stop); }, play: function() { this.el.play(); }, pause: function() { this.el.pause(); }, stop: function() { this.pause(); this.el.currentTime = 0; }, volume: function(value) { this.el.volume = value / 100; }, mute: function() { this.el.volume = 0; }, unmute: function() { this.el.volume = 1; }, isMuted: function() { return !!this.el.volume; }, ended: function() { this.trigger('container:timeupdate', 0); }, seek: function(seekBarValue) { var time = this.el.duration * (seekBarValue / 100); this.el.currentTime = time; }, getCurrentTime: function() { return this.el.currentTime; }, getDuration: function() { return this.el.duration; }, timeUpdated: function() { this.container.timeUpdated(this.el.currentTime, this.el.duration); }, render: function() { this.container.$el.append(this.el); return this; } }, {}, UIPlugin); HTML5Audio.canPlay = function(resource) { return !!resource.match(/(.*).mp3/); }; module.exports = HTML5Audio; },{"../../base/ui_plugin":"Z7u8cr"}],38:[function(require,module,exports){ "use strict"; module.exports = require('./html5_audio'); },{"./html5_audio":37}],39:[function(require,module,exports){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var HTML5Video = function HTML5Video() { $traceurRuntime.defaultSuperCall(this, $HTML5Video.prototype, arguments); }; var $HTML5Video = HTML5Video; ($traceurRuntime.createClass)(HTML5Video, { get name() { return 'html5_video'; }, get type() { return 'playback'; }, get tagName() { return 'video'; }, get attributes() { return {'data-html5-video': ''}; }, get events() { return { 'timeupdate': 'timeUpdated', 'progress': 'progress', 'ended': 'ended', 'playing': 'playing', 'stalled': 'buffering', 'waiting': 'buffering', 'canplaythrough': 'bufferFull', 'loadedmetadata': 'loadedMetadata' }; }, initialize: function(options) { this.options = options; this.src = options.src; this.el.src = options.src; this.el.loop = options.loop; this.settings = { left: ['playpause', 'position', 'duration'], right: ['fullscreen', 'volume'], default: ['seekbar'] }; }, loadedMetadata: function(e) { this.trigger('playback:loadedmetadata', e.target.duration); }, play: function() { this.el.play(); }, pause: function() { this.el.pause(); }, stop: function() { this.pause(); if (this.el.readyState !== 0) { this.el.currentTime = 0; } }, volume: function(value) { this.el.volume = value / 100; }, mute: function() { this.el.volume = 0; }, unmute: function() { this.el.volume = 1; }, isMuted: function() { return !!this.el.volume; }, isPlaying: function() { return !this.el.paused && !this.el.ended; }, ended: function() { this.trigger('playback:ended', this.name); this.trigger('playback:timeupdate', 0, this.el.duration, this.name); }, buffering: function() { this.trigger('playback:buffering', this.name); }, bufferFull: function() { this.trigger('playback:bufferfull', this.name); }, destroy: function() { this.stop(); this.el.src = ''; this.$el.remove(); }, seek: function(seekBarValue) { var time = this.el.duration * (seekBarValue / 100); this.el.currentTime = time; }, getCurrentTime: function() { return this.el.currentTime; }, getDuration: function() { return this.el.duration; }, timeUpdated: function() { this.trigger('playback:timeupdate', this.el.currentTime, this.el.duration, this.name); }, progress: function() { if (!this.el.buffered.length) return; var bufferedPos = 0; for (var i = 0; i < this.el.buffered.length; i++) { if (this.el.currentTime >= this.el.buffered.start(i) && this.el.currentTime <= this.el.buffered.end(i)) { bufferedPos = i; break; } } this.trigger('playback:progress', this.el.buffered.start(bufferedPos), this.el.buffered.end(bufferedPos), this.el.duration, this.name); }, playing: function() { this.trigger('playback:play', this.name); }, render: function() { var style = Styler.getStyleFor(this.name); this.$el.append(style); this.trigger('playback:ready', this.name); this.options.autoPlay && this.play(); return this; } }, {}, UIPlugin); HTML5Video.canPlay = function(resource) { return !!resource.match(/(.*).mp4/); }; module.exports = HTML5Video; },{"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr"}],40:[function(require,module,exports){ "use strict"; module.exports = require('./html5_video'); },{"./html5_video":39}],41:[function(require,module,exports){ "use strict"; module.exports = require('./loading'); },{"./loading":42}],42:[function(require,module,exports){ (function (global){ "use strict"; var UIObject = require('../../base/ui_object'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var defaultImage = "data:image/gif;base64,R0lGODlhGQAZAPMAAP////f39+/v7+bm5t7e3tbW1szMzMXFxb29vbW1ta2traWlpZmZmYyMjISEhHNzcyH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCAAQACwAAAAAGQAZAAAFjCAkjiTkPE6pqssyPvBIECu5MIwLwY881yMcQ8QTzX5AiNBVPNJWiUQQt4sdSU9IQsEV3XA8p/Gq5XKlOB3k6kSKzN1aOzvaxldiYBToHhX+gAVJa3OBgINzBIZ/iHMqfSWQkWR4lFh5lZiOlGxtY0iJeZpZnTSWdJc/paiZn5+sqU+ckpM+pLBJlishACH5BAUIABAALAAAAAAUAA4AAAVRICSOJLQwS6lCSTIy8Og4aqIoLgQz4/PQpZtCtBP5fiqhq+g4jgqEkVAXc4oK2ILIhts1fc8sFnLLQb4qsXbFFrPfkDEcQqjbo3P6vZ7X7/shACH5BAUIABAALAEAAAAXAAsAAAVQICSOZKIkZKoSxai847KoY2G30KuMDDPTkJtIJ+r5gEEhcWFckZSw5sgBIVgJoltBx+yJHI+H43pN4iBdCDgsFpGxQHaYOiIj2fQVnAZOhQAAIfkEBQgAEAAsBQAAABQADgAABUogJI5FOZ4oRJCmmCQpIa9QWYyKAqOzaIs5Xaz3SwRTIqLpOFqcZgSbUQhhWJ2jnisHWVivyNQXHEaNy0gvuvxoux1rkXseh8zdIQAh+QQFCAAQACwLAAAADgAUAAAFSyAhQmRpQiJRFsWJjiTbmmksn7U80+NdJqSUjpRQKIArFqRoPLogTSPS1Zw+i08XY8tdPLngL3jrcjyypofagYao3+ysGd6mtyHxEAAh+QQFCAAQACwOAAEACwAXAAAFTiAkEoRonmR5jukKperamgVLikVetnlf074fMOeCEIsihXKZOC2fzqeiKVowkBCGdlHUerkQx+MBsX7DY4foDBmTTWD0GOlWF9NIh/0UAgAh+QQFCAAQACwLAAUADgAUAAAFTiAkjiRElCihoqPqnukLxysr1vZY7HzB9rwf0FdKJHIjhfKYUzqZowWDAUk4FceHVspYiJ4Q7QMypY6YYgjXTEqTp962dgQvudVx+RgZAgAh+QQFCAAQACwFAAsAFAAOAAAFUSAkjuRInChRrmKKsqt7wmRR0LRt46uul4+HY5RQKCC+ncgRfDCeRUVC5Bs1IU8GxHgc3ZbBYRYSna6u2KeIax4xhaLxWrpyDONqUaJNW+RpIQAh+QQFCAAQACwBAA4AFwALAAAFUiAkio4zniJBoKPzvOyoquhrx+lMu/YDMYzFqECE6FQ8H2QBZCiexKJxBimNmpCnAhI9rVBNRvbJ7eJ+QJFWFP2ymEE1mS2NLYTyLf3MSigSfCEAIfkEBQgAEAAsAAALABQADgAABU6g84wkZJ7oSa5pa66lK5/LMrsLo9+p7vOmnI8BUSgSJ4ISJSRCEkZFYapc0mymKGRagFRl0ON26v22tONumTBIhZHppBWVgMdN8xm3FQIAIfkEBQgAEAAsAAAFAA4AFAAABUsgBDmOaJ6i86woqq5P2ZowO6fwfZLtwvzAGXAoHP50p0QCmVA4dc7orBldFq5JKeR6JXhFShMX4iW0uAXyFzVWm09oUfmclq915RAAIfkECQgAEAAsAAAAABkAGQAABVwgJI5kaZ6j46Bs6TzP2s7wM9OwfI/LMtY7HmMoesGCkMVw6MshRUvik6SUTqm+Z0LB7V674OsWrLiaCgWzCI1Ws9vTd5tAR75F9Lo9jdeb8wRqEHmCgIKDgYdmIQA7"; var Loading = function Loading() { $traceurRuntime.defaultSuperCall(this, $Loading.prototype, arguments); }; var $Loading = Loading; ($traceurRuntime.createClass)(Loading, { get template() { return _.template('<img src=<%= base64Image %> <h3> <%= message %> </h3>'); }, get defaultImage() { return defaultImage; }, initialize: function(options) { this.message = options.message || ''; this.base64Image = options.base64Image || this.defaultImage; this.customStyle = options.style || {}; }, show: function() { return this.$el.show().promise(); }, hide: function() { return this.$el.hide().promise(); }, render: function() { this.$el.css(this.customStyle); this.$el.html(this.template({ base64Image: this.base64Image, message: this.message })); this.$el.hide(); return this; } }, {}, UIObject); module.exports = Loading; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/ui_object":"8lqCAT"}],43:[function(require,module,exports){ "use strict"; module.exports = require('./log'); },{"./log":44}],44:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var BOLD = 'font-weight: bold; font-size: 13px;'; var INFO = 'color: green;' + BOLD; var DEBUG = 'color: #222;' + BOLD; var ERROR = 'color: red;' + BOLD; var DEFAULT = ''; $(document).keydown(function(e) { if (e.ctrlKey && e.shiftKey && e.keyCode === 68) { window.DEBUG = !window.DEBUG; } }); var Log = function(klass) { this.klass = klass || 'Logger'; }; Log.info = function(klass, msg) { console.log('%s %cINFO%c [%s] %s', (new Date()).toLocaleTimeString(), INFO, DEFAULT, klass, msg); }; Log.error = function(klass, msg) { console.log('%s %cINFO%c [%s] %s', (new Date()).toLocaleTimeString(), INFO, DEFAULT, klass, msg); }; Log.BLACKLIST = ['mediacontrol:show', 'mediacontrol:hide', 'playback:timeupdate', 'playback:progress', 'container:hover', 'container:timeupdate', 'container:progress']; Log.prototype = { log: function(msg) { this.info(msg); }, info: function(msg) { console.log('%s %cINFO%c [%s] %s', (new Date()).toLocaleTimeString(), INFO, DEFAULT, this.klass, msg); }, error: function(msg) { console.log('%s %cERROR%c [%s] %s', (new Date()).toLocaleTimeString(), ERROR, DEFAULT, this.klass, msg); } }; module.exports = Log; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz"}],45:[function(require,module,exports){ "use strict"; module.exports = require('./pip'); },{"./pip":46}],46:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var Styler = require('../../base/styler'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Loading = require('../loading'); var PipPlugin = function PipPlugin() { $traceurRuntime.defaultSuperCall(this, $PipPlugin.prototype, arguments); }; var $PipPlugin = PipPlugin; ($traceurRuntime.createClass)(PipPlugin, { get name() { return 'pip'; }, initialize: function(core) { this.core = core; this.addListeners(); this.loading = new Loading({message: 'Carregando...'}); this.core.$el.append(this.loading.render().el); var style = Styler.getStyleFor('pip'); this.core.$el.append(style); this.loading.$el.attr('data-pip', ''); this.loading.$el.addClass('pip-loading'); this.setupContainers(); }, getExternalInterface: function() { return { addPip: this.addPip, discardPip: this.discardPip, addMaster: this.addMaster, addMasterContainer: this.addMasterContainer, changeMaster: this.changeMaster, pipToMaster: this.pipToMaster, hasPip: this.hasPip }; }, addListeners: function() { this.listenTo(this.core.mediaControl, 'mediacontrol:show', this.onMediaControlShow); this.listenTo(this.core.mediaControl, 'mediacontrol:hide', this.onMediaControlHide); }, setupContainers: function() { this.masterContainer = this.core.containers[0]; this.setMasterStyle(this.masterContainer, false); this.core.mediaControl.setContainer(this.masterContainer); this.core.mediaControl.render(); if (this.core.containers.length === 2) { this.pipContainer = this.core.containers[1]; this.setPipStyle(this.pipContainer, false); this.masterContainer.play(); this.pipContainer.play(); this.pipContainer.setVolume(0); this.pipContainer.trigger("container:pip", true); this.listenToPipClick(); } }, hasPip: function() { return !!this.pipContainer; }, addPip: function(source) { this.stopListening(this.pipContainer); this.discardPip(); this.core.createContainer(source).then(this.addPipCallback.bind(this)); }, addPipCallback: function(container) { this.pipContainer = _(container).isArray() ? container[0] : container; this.onContainerReady(); if (this.core.params.onPipLoaded) this.core.params.onPipLoaded(this.pipContainer.playback.src); }, onContainerReady: function() { this.pipContainer.setVolume(0); this.setPipStyle(this.pipContainer); this.pipContainer.play(); this.stopListening(this.pipContainer); this.listenToPipClick(); this.listenTo(this.pipContainer, "container:ended", this.discardPip); this.pipContainer.trigger("container:pip", true); }, discardPip: function() { if (this.pipContainer) { this.stopListening(this.pipContainer); this.discardContainer(this.pipContainer); this.pipContainer = undefined; } }, discardMaster: function() { if (this.masterContainer) { this.stopListening(this.masterContainer); this.discardContainer(this.masterContainer); this.masterContainer = undefined; } }, setMasterContainer: function(container) { this.discardContainer(this.masterContainer); this.masterContainer = container; this.setMasterStyle(this.masterContainer); this.listenTo(this.masterContainer, "container:ended", this.pipToMaster); this.masterContainer.play(); }, addMaster: function(source) { if (this.masterContainer) { this.loading.show(); this.stopListening(this.masterContainer); this.tmpContainer = this.masterContainer; this.tmpContainer.setStyle({'z-index': 2000}); this.core.createContainer(source).then(this.addMasterCallback.bind(this)); } }, addMasterContainer: function(container) { if (this.masterContainer) { this.tmpContainer = this.masterContainer; this.tmpContainer.setStyle({'z-index': 2000}); this.addMasterCallback(container); } }, addMasterCallback: function(container) { this.masterContainer = container; if (this.pipContainer) { this.discardPip(); } this.pipContainer = this.tmpContainer; this.setPipStyle(this.pipContainer); this.setMasterStyle(this.masterContainer); this.masterContainer.play(); this.animateMasterToPip(); this.tmpContainer = undefined; this.pipContainer.setVolume(0); }, animateMasterToPip: function() { var $__0 = this; this.loading.hide(); this.listenTo(this.masterContainer, "container:ended", this.pipToMaster); this.pipContainer.$el.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', (function() { $__0.pipContainer.trigger("container:pip", true); if ($__0.core.params.onMasterLoaded) { $__0.core.params.onMasterLoaded($__0.masterContainer.getSource()); } })); this.setPipStyle(this.pipContainer); this.core.mediaControl.setContainer(this.masterContainer); this.listenToPipClick(); }, changeMaster: function(source) { if (this.masterContainer) { this.stopListening(this.masterContainer); this.tmpContainer = this.masterContainer; this.tmpContainer.setStyle({'z-index': 2000}); this.core.createContainer(source).then(this.changeMasterCallback.bind(this)); } }, changeMasterCallback: function(container) { this.masterContainer.destroy(); this.masterContainer = container; this.masterContainer.play(); this.tmpContainer = undefined; this.setMasterStyle(this.masterContainer); this.listenTo(this.masterContainer, "container:ended", this.pipToMaster); this.core.mediaControl.setContainer(this.masterContainer); if (this.core.params.onMasterLoaded) this.core.params.onMasterLoaded(this.masterContainer.playback.params.src); }, listenToPipClick: function() { if (this.pipContainer) { this.stopListening(this.pipContainer); this.listenTo(this.pipContainer, "container:click", this.pipToMaster.bind(this)); } }, discardContainer: function(container) { container.destroy(); }, pipToMaster: function() { var $__0 = this; this.stopListening(this.masterContainer); this.stopListening(this.pipContainer, "container:click"); if (this.pipContainer) { this.pipContainer.setStyle({'z-index': 998}); this.setMasterStyle(this.pipContainer); this.pipContainer.$el.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', (function() { $__0.pipContainer.$el.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend'); $__0.pipToMasterCallback(); })); } return this; }, pipToMasterCallback: function() { this.discardMaster(); this.pipContainer.setVolume(100); this.pipContainer.trigger("container:pip", false); this.pipContainer.play(); this.masterContainer = this.pipContainer; this.masterContainer.setStyle({"z-index": 20}); this.pipContainer = undefined; this.core.mediaControl.setContainer(this.masterContainer); this.core.enableMediaControl(); if (this.core.params.onPipToMaster) this.core.params.onPipToMaster(this.masterContainer.playback.params.src); }, onMediaControlShow: function() { if (this.pipContainer) { this.pipContainer.$el.addClass('pip-transition over-media-control'); } }, onMediaControlHide: function() { this.masterContainer.$el.removeClass('over-media-control'); if (this.pipContainer) { this.pipContainer.$el.addClass('pip-transition'); this.pipContainer.$el.removeClass('over-media-control'); } }, setAnimatedTransition: function(container, animated) { if (animated) { container.$el.addClass('pip-transition'); } else { container.$el.removeClass('pip-transition'); } }, setPipStyle: function(container) { var animated = arguments[1] !== (void 0) ? arguments[1] : true; this.setAnimatedTransition(container, animated); container.$el.attr('data-pip', ''); container.$el.addClass('pip-container'); container.$el.removeClass('over-media-control master-container'); }, setMasterStyle: function(container) { var animated = arguments[1] !== (void 0) ? arguments[1] : true; this.setAnimatedTransition(container, animated); container.$el.attr('data-pip', ''); container.$el.addClass('master-container'); container.$el.removeClass('over-media-control pip-container'); } }, {}, BaseObject); module.exports = PipPlugin; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../../base/styler":13,"../loading":41}],47:[function(require,module,exports){ "use strict"; module.exports = require('./poster'); },{"./poster":48}],48:[function(require,module,exports){ (function (global){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var PosterPlugin = function PosterPlugin() { $traceurRuntime.defaultSuperCall(this, $PosterPlugin.prototype, arguments); }; var $PosterPlugin = PosterPlugin; ($traceurRuntime.createClass)(PosterPlugin, { get name() { return 'poster'; }, get template() { return JST.poster; }, get attributes() { return { 'class': 'player-poster', 'data-poster': '' }; }, get events() { return {'click': 'clicked'}; }, initialize: function(options) { $traceurRuntime.superCall(this, $PosterPlugin.prototype, "initialize", [options]); if (options.disableControlsOnPoster === undefined) options.disableControlsOnPoster = true; this.options = options; if (this.options.disableControlsOnPoster) this.container.disableMediaControl(); this.render(); }, bindEvents: function() { this.listenTo(this.container, 'container:state:buffering', this.onBuffering); this.listenTo(this.container, 'container:play', this.onPlay); this.listenTo(this.container, 'container:stop', this.onStop); this.listenTo(this.container, 'container:ended', this.onStop); this.listenTo(this.container, 'container:pip', this.onPipStateChanged); }, onBuffering: function() { this.hidePlayButton(); }, onPlay: function() { this.$el.hide(); if (this.options.disableControlsOnPoster) { this.container.enableMediaControl(); } }, onStop: function() { this.$el.show(); if (this.options.disableControlsOnPoster) { this.container.disableMediaControl(); } if (!this.options.hidePlayButton) { this.showPlayButton(); } }, onPipStateChanged: function(isPip) { this.$el.css({fontSize: this.$el.height()}); if (!this.options.hidePlayButton) { this.showPlayButton(); } }, hidePlayButton: function() { this.$playButton.hide(); }, showPlayButton: function() { this.$el.css({fontSize: this.$el.height()}); this.$playButton.show(); }, clicked: function() { this.container.play(); }, render: function() { var $__0 = this; var style = Styler.getStyleFor(this.name); this.$el.html(this.template()); this.$el.append(style); this.container.$el.append(this.el); this.$el.ready((function() { $__0.$el.css({fontSize: $__0.options.height || $__0.$el.height()}); })); var imgEl = this.$el.find('img')[0]; imgEl.src = this.options.poster || 'assets/default.png'; this.$playButton = $(this.$el.find('.play-wrapper')); if (this.options.hidePlayButton) this.$playButton.hide(); return this; } }, {}, UIPlugin); module.exports = PosterPlugin; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr"}],49:[function(require,module,exports){ "use strict"; module.exports = require('./sequence'); },{"./sequence":50}],50:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var SequenceContainer = require('./sequence_container'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Utils = require('../../base/utils'); var Sequence = BaseObject.extend({ initialize: function(core) { this.core = core; this.sequenceContainer = new SequenceContainer(this.core.containers); this.core.mediaControl.setContainer(this.sequenceContainer); }, getExternalInterface: function() { return {}; } }); module.exports = Sequence; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../../base/utils":18,"./sequence_container":51}],51:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var SequenceContainer = BaseObject.extend({ name: 'SequenceContainer', initialize: function(containers) { this.containers = containers; this.plugins = []; this.containersRange = []; this.currentContainer = 0; this.checkpoint = 0; this.duration = 0; _.each(this.containers, this._setupContainers, this); this.containersToSetup = this.containers.length; this._bindChildEvents(this.getCurrentContainer()); this.getCurrentContainer().$el.show(); this.settings = this.getCurrentContainer().settings; }, _bindChildEvents: function(container) { this.listenTo(container, 'container:ended', this.playNextContainer); this.listenTo(container, 'container:timeupdate', this.timeUpdateProxy); this.listenTo(container, 'container:progress', this.progressProxy); }, _setupContainers: function(container) { container.$el.hide(); this._injectInChildPlugins(container.plugins); this.listenTo(container, 'container:loadedmetadata', this._setupDuration); }, _injectInChildPlugins: function(plugins) { _.each(plugins, function(plugin) { plugin.stopListening(); plugin.container = this; plugin.bindEvents(); }, this); }, _setupDuration: function(duration) { this.duration += duration; this.trigger('container:timeupdate', 0, this.duration); if (--this.containersToSetup === 0) { this._setupSeek(); } }, _setupSeek: function() { _.each(this.containers, function(container) { var containerDuration = container.playback.getDuration(); var totalPercent = (containerDuration * 100) / this.duration; this.containersRange.push(totalPercent); }, this); }, getPlaybackType: function() { return this.getCurrentContainer().getPlaybackType(); }, length: function() { return this.containers.length; }, playNextContainer: function() { this.getCurrentContainer().$el.hide(); this.stopListening(this.getCurrentContainer()); var nextContainer = this.getNextContainer(); this.trigger('container:next', this.currentContainer); this._bindChildEvents(nextContainer); if (this.currentContainer === 0) { this.checkpoint = 0; nextContainer.$el.show(); this.trigger('container:ended'); nextContainer.stop(); } else { nextContainer.play(); this.trigger('container:play'); this.trigger('container:settingsupdate'); this.trigger('container:timeupdate', this.checkpoint, this.duration); nextContainer.$el.show(); } }, timeUpdateProxy: function(position, duration) { this.trigger('container:timeupdate', position + this.checkpoint, this.duration, this.name); }, progressProxy: function(startPosition, endPosition, duration) { this.trigger('container:progress', startPosition, endPosition, this.duration, this.name); }, getCurrentContainer: function() { return this.containers[this.currentContainer]; }, getNextContainer: function() { this.checkpoint += this.getCurrentContainer().playback.getDuration(); this.currentContainer = ++this.currentContainer % this.containers.length; var nextContainer = this.containers[this.currentContainer]; this.settings = nextContainer.settings; return nextContainer; }, play: function() { this.getCurrentContainer().playback.play(); this.trigger('container:play', this.name); }, setVolume: function(value) { this.trigger('container:volume', value, this.name); this.getCurrentContainer().setVolume(value); }, pause: function() { this.getCurrentContainer().pause(); this.trigger('container:pause', this.name); }, stop: function() { this.getCurrentContainer().stop(); this.trigger('container:stop', this.name); }, playing: function() { this.trigger('container:playing', this.name); }, progress: function(startPosition, endPosition, duration) { this.trigger('container:progress', startPosition, endPosition, duration); }, _matchContainerIndex: function(percent) { var total = 0; for (var i = 0, l = this.containers.length; i < l; i++) { total += this.containersRange[i]; if (total >= percent) { return i; } } return this.containers.length - 1; }, jumpToContainer: function(index) { if (index === 0) { this.seekToContainer(index, 0); } else { var value = _.reduce(this.containersRange.slice(0, index), function(total, percent) { return total + percent; }); this.seekToContainer(index, value); } }, setCurrentTime: function(time) { var containerIndex = this._matchContainerIndex(time); this.seekToContainer(containerIndex, time); }, seekToContainer: function(containerIndex, time) { if (containerIndex === 0) { this.checkpoint = 0; } else { var slice = this.containers.slice(0, containerIndex); this.checkpoint = _.reduce(slice, function(duration, container) { return duration + container.playback.getDuration(); }, 0); var pastRange = _.reduce(this.containersRange.slice(0, containerIndex), function(total, percent) { return percent + total; }, 0); time = time - pastRange; } var containerSeek = time * 100 / this.containersRange[containerIndex]; var currentContainer = this.getCurrentContainer(); currentContainer.$el.hide(); this.stopListening(currentContainer); currentContainer.stop(); this.currentContainer = containerIndex; var newContainer = this.containers[containerIndex]; this.listenTo(newContainer, 'container:ended', this.playNextContainer); this.listenTo(newContainer, 'container:timeupdate', this.timeUpdateProxy); this.listenTo(newContainer, 'container:progress', this.progressProxy); newContainer.play(); this.trigger('container:settingsupdate'); this.trigger('container:play'); newContainer.setCurrentTime(containerSeek); newContainer.$el.show(); }, settingsUpdate: function() { this.settings = this.getCurrentContainer().settings; this.trigger('container:settingsupdate'); }, isPlaying: function() { return this.getCurrentContainer().isPlaying(); }, render: function() { this.el = _.map(this.containers, function(container) { return container.render().el; }); return this; } }); module.exports = SequenceContainer; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz"}],52:[function(require,module,exports){ "use strict"; module.exports = require('./spinner_three_bounce'); },{"./spinner_three_bounce":53}],53:[function(require,module,exports){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var SpinnerThreeBouncePlugin = UIPlugin.extend({ name: 'spinner_three_bounce', attributes: { 'data-spinner': '', 'class': 'spinner-three-bounce' }, initialize: function(options) { SpinnerThreeBouncePlugin.super('initialize').call(this, options); this.template = JST[this.name]; this.listenTo(this.container, 'container:state:buffering', this.onBuffering); this.listenTo(this.container, 'container:state:bufferfull', this.onBufferFull); this.listenTo(this.container, 'container:stop', this.onStop); this.render(); }, onBuffering: function() { this.$el.show(); }, onBufferFull: function() { this.$el.hide(); }, onStop: function() { this.$el.hide(); }, render: function() { this.$el.hide(); this.$el.html(this.template()); var style = Styler.getStyleFor(this.name); this.container.$el.append(style); this.container.$el.append(this.$el); return this; } }); module.exports = SpinnerThreeBouncePlugin; },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr"}],54:[function(require,module,exports){ "use strict"; module.exports = require('./stats'); },{"./stats":55}],55:[function(require,module,exports){ (function (global){ "use strict"; var Plugin = require('../../base/plugin'); var StatsEvents = require('./stats_events'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var StatsPlugin = Plugin.extend({ name: 'stats', type: 'stats', initialize: function(options) { StatsPlugin.super('initialize').call(this, options); this.container.with(StatsEvents); this.setInitialAttrs(); this.reportInterval = options.reportInterval || 5000; this.state = "IDLE"; }, bindEvents: function() { this.listenTo(this.container, 'container:play', this.onPlay); this.listenTo(this.container, 'container:stop', this.onStop); this.listenTo(this.container, 'container:destroyed', this.onStop); this.listenTo(this.container, 'container:setreportinterval', this.setReportInterval); this.listenTo(this.container, 'container:state:buffering', this.onBuffering); this.listenTo(this.container, 'container:state:bufferfull', this.onBufferFull); this.listenTo(this.container, 'container:stats:add', this.onStatsAdd); this.listenTo(this.container.playback, 'playback:stats:add', this.onStatsAdd); }, setReportInterval: function(reportInterval) { this.reportInterval = reportInterval; }, setInitialAttrs: function() { this.firstPlay = true; this.startupTime = 0; this.rebufferingTime = 0; this.watchingTime = 0; this.rebuffers = 0; this.externalMetrics = {}; }, onPlay: function() { this.state = "PLAYING"; this.watchingTimeInit = Date.now(); this.intervalId = setInterval(this.report.bind(this), this.reportInterval); }, onStop: function() { clearInterval(this.intervalId); this.state = "STOPPED"; }, onBuffering: function() { if (this.firstPlay) { this.startupTimeInit = Date.now(); } else { this.rebufferingTimeInit = Date.now(); } this.state = "BUFFERING"; this.rebuffers++; }, onBufferFull: function() { if (this.state !== "BUFFERING") return; if (this.firstPlay) { this.firstPlay = false; this.startupTime = Date.now() - this.startupTimeInit; this.watchingTimeInit = Date.now(); } else { this.rebufferingTime += this.getRebufferingTime(); } this.rebufferingTimeInit = undefined; this.state = "PLAYING"; }, getRebufferingTime: function() { return Date.now() - this.rebufferingTimeInit; }, getWatchingTime: function() { var totalTime = (Date.now() - this.watchingTimeInit); return totalTime - this.rebufferingTime - this.startupTime; }, isRebuffering: function() { return !!this.rebufferingTimeInit; }, onStatsAdd: function(metric) { $.extend(this.externalMetrics, metric); }, getStats: function() { var metrics = { startupTime: this.startupTime, rebuffers: this.rebuffers, rebufferingTime: this.isRebuffering() ? this.rebufferingTime + this.getRebufferingTime() : this.rebufferingTime, watchingTime: this.isRebuffering() ? this.getWatchingTime() - this.getRebufferingTime() : this.getWatchingTime() }; $.extend(metrics, this.externalMetrics); return metrics; }, report: function() { this.container.statsReport(this.getStats()); } }); module.exports = StatsPlugin; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/plugin":11,"./stats_events":56}],56:[function(require,module,exports){ "use strict"; var StatsEvents = { statsAdd: function(metric) { this.trigger('container:stats:add', metric); }, statsReport: function(metrics) { this.trigger('container:stats:report', metrics); } }; module.exports = StatsEvents; },{}],57:[function(require,module,exports){ "use strict"; module.exports = require('./watermark'); },{"./watermark":58}],58:[function(require,module,exports){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var WaterMarkPlugin = function WaterMarkPlugin() { $traceurRuntime.defaultSuperCall(this, $WaterMarkPlugin.prototype, arguments); }; var $WaterMarkPlugin = WaterMarkPlugin; ($traceurRuntime.createClass)(WaterMarkPlugin, { get name() { return 'watermark'; }, get type() { return 'ui'; }, initialize: function(options) { $traceurRuntime.superCall(this, $WaterMarkPlugin.prototype, "initialize", [options]); this.template = JST[this.name]; this.position = options.position || "bottom-right"; this.imageUrl = options.watermark || 'assets/watermark.png'; this.render(); }, bindEvents: function() { this.listenTo(this.container, 'container:play', this.onPlay); this.listenTo(this.container, 'container:stop', this.onStop); this.listenTo(this.container, 'container:pip', this.onPip); }, onPlay: function() { if (!this.hidden) this.$el.show(); }, onStop: function() { this.$el.hide(); }, onPip: function(isPip) { this.hidden = !!isPip; if (isPip) { this.$el.hide(); } else { this.$el.show(); } }, render: function() { this.$el.hide(); var templateOptions = { position: this.position, imageUrl: this.imageUrl }; this.$el.html(this.template(templateOptions)); var style = Styler.getStyleFor(this.name); this.container.$el.append(style); this.container.$el.append(this.$el); return this; } }, {}, UIPlugin); module.exports = WaterMarkPlugin; },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr"}]},{},[3,32])
services/ui/src/components/Breadcrumbs/Problem.js
amazeeio/lagoon
import React from 'react'; import { getLinkData } from 'components/link/Problem'; import Breadcrumb from 'components/Breadcrumbs/Breadcrumb'; const EnvironmentBreadcrumb = ({ header, problemSlug, environmentSlug, projectSlug }) => { const linkData = { urlObject: { pathname: '/problems', query: { openshiftProjectName: environmentSlug } }, asPath: `/projects/${projectSlug}/${environmentSlug}/problems` }; return ( <Breadcrumb header={header} title={problemSlug} {...linkData} /> ); }; export default EnvironmentBreadcrumb;
app/javascript/mastodon/features/keyboard_shortcuts/index.js
5thfloor/ichiji-social
import React from 'react'; import Column from '../ui/components/column'; import ColumnBackButtonSlim from '../../components/column_back_button_slim'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import ImmutablePureComponent from 'react-immutable-pure-component'; const messages = defineMessages({ heading: { id: 'keyboard_shortcuts.heading', defaultMessage: 'Keyboard Shortcuts' }, }); export default @injectIntl class KeyboardShortcuts extends ImmutablePureComponent { static propTypes = { intl: PropTypes.object.isRequired, multiColumn: PropTypes.bool, }; render () { const { intl, multiColumn } = this.props; return ( <Column bindToDocument={!multiColumn} icon='question' heading={intl.formatMessage(messages.heading)}> <ColumnBackButtonSlim /> <div className='keyboard-shortcuts scrollable optionally-scrollable'> <table> <thead> <tr> <th><FormattedMessage id='keyboard_shortcuts.hotkey' defaultMessage='Hotkey' /></th> <th><FormattedMessage id='keyboard_shortcuts.description' defaultMessage='Description' /></th> </tr> </thead> <tbody> <tr> <td><kbd>r</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.reply' defaultMessage='to reply' /></td> </tr> <tr> <td><kbd>m</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.mention' defaultMessage='to mention author' /></td> </tr> <tr> <td><kbd>p</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.profile' defaultMessage="to open author's profile" /></td> </tr> <tr> <td><kbd>f</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.favourite' defaultMessage='to favourite' /></td> </tr> <tr> <td><kbd>b</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.boost' defaultMessage='to boost' /></td> </tr> <tr> <td><kbd>enter</kbd>, <kbd>o</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.enter' defaultMessage='to open status' /></td> </tr> <tr> <td><kbd>x</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.toggle_hidden' defaultMessage='to show/hide text behind CW' /></td> </tr> <tr> <td><kbd>h</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.toggle_sensitivity' defaultMessage='to show/hide media' /></td> </tr> <tr> <td><kbd>up</kbd>, <kbd>k</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.up' defaultMessage='to move up in the list' /></td> </tr> <tr> <td><kbd>down</kbd>, <kbd>j</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.down' defaultMessage='to move down in the list' /></td> </tr> <tr> <td><kbd>1</kbd>-<kbd>9</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.column' defaultMessage='to focus a status in one of the columns' /></td> </tr> <tr> <td><kbd>n</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.compose' defaultMessage='to focus the compose textarea' /></td> </tr> <tr> <td><kbd>alt</kbd>+<kbd>n</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.toot' defaultMessage='to start a brand new toot' /></td> </tr> <tr> <td><kbd>backspace</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.back' defaultMessage='to navigate back' /></td> </tr> <tr> <td><kbd>s</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.search' defaultMessage='to focus search' /></td> </tr> <tr> <td><kbd>esc</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.unfocus' defaultMessage='to un-focus compose textarea/search' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>h</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.home' defaultMessage='to open home timeline' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>n</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.notifications' defaultMessage='to open notifications column' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>l</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.local' defaultMessage='to open local timeline' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>t</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.federated' defaultMessage='to open federated timeline' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>d</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.direct' defaultMessage='to open direct messages column' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>s</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.start' defaultMessage='to open "get started" column' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>f</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.favourites' defaultMessage='to open favourites list' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>p</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.pinned' defaultMessage='to open pinned toots list' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>u</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.my_profile' defaultMessage='to open your profile' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>b</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.blocked' defaultMessage='to open blocked users list' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>m</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.muted' defaultMessage='to open muted users list' /></td> </tr> <tr> <td><kbd>g</kbd>+<kbd>r</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.requests' defaultMessage='to open follow requests list' /></td> </tr> <tr> <td><kbd>?</kbd></td> <td><FormattedMessage id='keyboard_shortcuts.legend' defaultMessage='to display this legend' /></td> </tr> </tbody> </table> </div> </Column> ); } }
core/static/admin/blueprints/form/files/__root__/forms/__name__Form/__name__Form.js
tjcunliffe/hoverfly
import React from 'react' import { reduxForm } from 'redux-form' export const fields = [] const validate = (values) => { const errors = {} return errors } type Props = { handleSubmit: Function, fields: Object, } export class <%= pascalEntityName %> extends React.Component { props: Props; defaultProps = { fields: {}, } render() { const { fields, handleSubmit } = this.props return ( <form onSubmit={handleSubmit}> </form> ) } } <%= pascalEntityName %> = reduxForm({ form: '<%= pascalEntityName %>', fields, validate })(<%= pascalEntityName %>) export default <%= pascalEntityName %>
ajax/libs/yui/3.3.0pr4/event/event-min.js
jonobr1/cdnjs
var GLOBAL_ENV=YUI.Env;if(!GLOBAL_ENV._ready){GLOBAL_ENV._ready=function(){GLOBAL_ENV.DOMReady=true;GLOBAL_ENV.remove(YUI.config.doc,"DOMContentLoaded",GLOBAL_ENV._ready);};GLOBAL_ENV.add(YUI.config.doc,"DOMContentLoaded",GLOBAL_ENV._ready);}YUI.add("event-base",function(e){e.publish("domready",{fireOnce:true,async:true});if(GLOBAL_ENV.DOMReady){e.fire("domready");}else{e.Do.before(function(){e.fire("domready");},YUI.Env,"_ready");}var b=e.UA,d={},a={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},c=function(h){if(!h){return h;}try{if(h&&3==h.nodeType){h=h.parentNode;}}catch(g){return null;}return e.one(h);},f=function(g,h,i){this._event=g;this._currentTarget=h;this._wrapper=i||d;this.init();};e.extend(f,Object,{init:function(){var i=this._event,j=this._wrapper.overrides,g=i.pageX,l=i.pageY,k,h=this._currentTarget;this.altKey=i.altKey;this.ctrlKey=i.ctrlKey;this.metaKey=i.metaKey;this.shiftKey=i.shiftKey;this.type=(j&&j.type)||i.type;this.clientX=i.clientX;this.clientY=i.clientY;this.pageX=g;this.pageY=l;k=i.keyCode||i.charCode;if(b.webkit&&(k in a)){k=a[k];}this.keyCode=k;this.charCode=k;this.which=i.which||i.charCode||k;this.button=this.which;this.target=c(i.target);this.currentTarget=c(h);this.relatedTarget=c(i.relatedTarget);if(i.type=="mousewheel"||i.type=="DOMMouseScroll"){this.wheelDelta=(i.detail)?(i.detail*-1):Math.round(i.wheelDelta/80)||((i.wheelDelta<0)?-1:1);}if(this._touch){this._touch(i,h,this._wrapper);}},stopPropagation:function(){this._event.stopPropagation();this._wrapper.stopped=1;this.stopped=1;},stopImmediatePropagation:function(){var g=this._event;if(g.stopImmediatePropagation){g.stopImmediatePropagation();}else{this.stopPropagation();}this._wrapper.stopped=2;this.stopped=2;},preventDefault:function(g){var h=this._event;h.preventDefault();h.returnValue=g||false;this._wrapper.prevented=1;this.prevented=1;},halt:function(g){if(g){this.stopImmediatePropagation();}else{this.stopPropagation();}this.preventDefault();}});f.resolve=c;e.DOM2EventFacade=f;e.DOMEventFacade=f;(function(){e.Env.evt.dom_wrappers={};e.Env.evt.dom_map={};var o=e.Env.evt,h=e.config,l=h.win,q=YUI.Env.add,j=YUI.Env.remove,n=function(){YUI.Env.windowLoaded=true;e.Event._load();j(l,"load",n);},g=function(){e.Event._unload();},i="domready",k="~yui|2|compat~",m=function(s){try{return(s&&typeof s!=="string"&&e.Lang.isNumber(s.length)&&!s.tagName&&!s.alert);}catch(r){return false;}},p=function(){var t=false,u=0,s=[],v=o.dom_wrappers,r=null,w=o.dom_map;return{POLL_RETRYS:1000,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!p._interval){p._interval=setInterval(p._poll,p.POLL_INTERVAL);}},onAvailable:function(x,B,F,y,C,E){var D=e.Array(x),z,A;for(z=0;z<D.length;z=z+1){s.push({id:D[z],fn:B,obj:F,override:y,checkReady:C,compat:E});}u=this.POLL_RETRYS;setTimeout(p._poll,0);A=new e.EventHandle({_delete:function(){if(A.handle){A.handle.detach();return;}var H,G;for(H=0;H<D.length;H++){for(G=0;G<s.length;G++){if(D[H]===s[G].id){s.splice(G,1);}}}}});return A;},onContentReady:function(B,z,A,y,x){return p.onAvailable(B,z,A,y,true,x);},attach:function(A,z,y,x){return p._attach(e.Array(arguments,0,true));},_createWrapper:function(D,C,x,y,B){var A,E=e.stamp(D),z="event:"+E+C;if(false===B){z+="native";}if(x){z+="capture";}A=v[z];if(!A){A=e.publish(z,{silent:true,bubbles:false,contextFn:function(){if(y){return A.el;}else{A.nodeRef=A.nodeRef||e.one(A.el);return A.nodeRef;}}});A.overrides={};A.el=D;A.key=z;A.domkey=E;A.type=C;A.fn=function(F){A.fire(p.getEvent(F,D,(y||(false===B))));};A.capture=x;if(D==l&&C=="load"){A.fireOnce=true;r=z;}v[z]=A;w[E]=w[E]||{};w[E][z]=A;q(D,C,A.fn,x);}return A;},_attach:function(D,C){var I,K,A,H,x,z=false,B,E=D[0],F=D[1],y=D[2]||l,L=C&&C.facade,J=C&&C.capture,G=C&&C.overrides;if(D[D.length-1]===k){I=true;}if(!F||!F.call){return false;}if(m(y)){K=[];e.each(y,function(N,M){D[2]=N;K.push(p._attach(D,C));});return new e.EventHandle(K);}else{if(e.Lang.isString(y)){if(I){A=e.DOM.byId(y);}else{A=e.Selector.query(y);switch(A.length){case 0:A=null;break;case 1:A=A[0];break;default:D[2]=A;return p._attach(D,C);}}if(A){y=A;}else{B=p.onAvailable(y,function(){B.handle=p._attach(D,C);},p,true,false,I);return B;}}}if(!y){return false;}if(e.Node&&e.instanceOf(y,e.Node)){y=e.Node.getDOMNode(y);}H=p._createWrapper(y,E,J,I,L);if(G){e.mix(H.overrides,G);}if(y==l&&E=="load"){if(YUI.Env.windowLoaded){z=true;}}if(I){D.pop();}x=D[3];B=H._on(F,x,(D.length>4)?D.slice(4):null);if(z){H.fire();}return B;},detach:function(E,F,z,C){var D=e.Array(arguments,0,true),H,A,G,B,x,y;if(D[D.length-1]===k){H=true;}if(E&&E.detach){return E.detach();}if(typeof z=="string"){if(H){z=e.DOM.byId(z);}else{z=e.Selector.query(z);A=z.length;if(A<1){z=null;}else{if(A==1){z=z[0];}}}}if(!z){return false;}if(z.detach){D.splice(2,1);return z.detach.apply(z,D);}else{if(m(z)){G=true;for(B=0,A=z.length;B<A;++B){D[2]=z[B];G=(e.Event.detach.apply(e.Event,D)&&G);}return G;}}if(!E||!F||!F.call){return p.purgeElement(z,false,E);}x="event:"+e.stamp(z)+E;y=v[x];if(y){return y.detach(F);}else{return false;}},getEvent:function(A,y,x){var z=A||l.event;return(x)?z:new e.DOMEventFacade(z,y,v["event:"+e.stamp(y)+A.type]);},generateId:function(x){return e.DOM.generateID(x);},_isValidCollection:m,_load:function(x){if(!t){t=true;if(e.fire){e.fire(i);}p._poll();}},_poll:function(){if(p.locked){return;}if(e.UA.ie&&!YUI.Env.DOMReady){p.startInterval();return;}p.locked=true;var y,x,C,z,B,D,A=!t;if(!A){A=(u>0);}B=[];D=function(G,H){var F,E=H.override;if(H.compat){if(H.override){if(E===true){F=H.obj;}else{F=E;}}else{F=G;}H.fn.call(F,H.obj);}else{F=H.obj||e.one(G);H.fn.apply(F,(e.Lang.isArray(E))?E:[]);}};for(y=0,x=s.length;y<x;++y){C=s[y];if(C&&!C.checkReady){z=(C.compat)?e.DOM.byId(C.id):e.Selector.query(C.id,null,true);if(z){D(z,C);s[y]=null;}else{B.push(C);}}}for(y=0,x=s.length;y<x;++y){C=s[y];if(C&&C.checkReady){z=(C.compat)?e.DOM.byId(C.id):e.Selector.query(C.id,null,true);if(z){if(t||(z.get&&z.get("nextSibling"))||z.nextSibling){D(z,C); s[y]=null;}}else{B.push(C);}}}u=(B.length===0)?0:u-1;if(A){p.startInterval();}else{clearInterval(p._interval);p._interval=null;}p.locked=false;return;},purgeElement:function(A,x,E){var C=(e.Lang.isString(A))?e.Selector.query(A,null,true):A,G=p.getListeners(C,E),B,D,F,z,y;if(x&&C){G=G||[];z=e.Selector.query("*",C);B=0;D=z.length;for(;B<D;++B){y=p.getListeners(z[B],E);if(y){G=G.concat(y);}}}if(G){B=0;D=G.length;for(;B<D;++B){F=G[B];F.detachAll();j(F.el,F.type,F.fn,F.capture);delete v[F.key];delete w[F.domkey][F.key];}}},getListeners:function(B,A){var C=e.stamp(B,true),x=w[C],z=[],y=(A)?"event:"+C+A:null,D=o.plugins;if(!x){return null;}if(y){if(D[A]&&D[A].eventDef){y+="_synth";}if(x[y]){z.push(x[y]);}y+="native";if(x[y]){z.push(x[y]);}}else{e.each(x,function(F,E){z.push(F);});}return(z.length)?z:null;},_unload:function(x){e.each(v,function(z,y){z.detachAll();j(z.el,z.type,z.fn,z.capture);delete v[y];delete w[z.domkey][y];});j(l,"unload",g);},nativeAdd:q,nativeRemove:j};}();e.Event=p;if(h.injected||YUI.Env.windowLoaded){n();}else{q(l,"load",n);}if(e.UA.ie){e.on(i,p._poll);}q(l,"unload",g);p.Custom=e.CustomEvent;p.Subscriber=e.Subscriber;p.Target=e.EventTarget;p.Handle=e.EventHandle;p.Facade=e.EventFacade;p._poll();})();e.Env.evt.plugins.available={on:function(i,h,k,j){var g=arguments.length>4?e.Array(arguments,4,true):null;return e.Event.onAvailable.call(e.Event,k,h,j,g);}};e.Env.evt.plugins.contentready={on:function(i,h,k,j){var g=arguments.length>4?e.Array(arguments,4,true):null;return e.Event.onContentReady.call(e.Event,k,h,j,g);}};},"@VERSION@",{requires:["event-custom-base"]});YUI.add("event-delegate",function(a){var c=a.Array,h=a.Lang,b=h.isString,i=h.isObject,e=h.isArray,g=a.Selector.test,d=a.Env.evt.handles;function f(u,w,l,k){var s=c(arguments,0,true),t=b(l)?l:null,r,o,j,n,v,m,q,x,p;if(i(u)){x=[];if(e(u)){for(m=0,q=u.length;m<q;++m){s[0]=u[m];x.push(a.delegate.apply(a,s));}}else{s.unshift(null);for(m in u){if(u.hasOwnProperty(m)){s[0]=m;s[1]=u[m];x.push(a.delegate.apply(a,s));}}}return new a.EventHandle(x);}r=u.split(/\|/);if(r.length>1){v=r.shift();u=r.shift();}o=a.Node.DOM_EVENTS[u];if(i(o)&&o.delegate){p=o.delegate.apply(o,arguments);}if(!p){if(!u||!w||!l||!k){return;}j=(t)?a.Selector.query(t,null,true):l;if(!j&&b(l)){p=a.on("available",function(){a.mix(p,a.delegate.apply(a,s),true);},l);}if(!p&&j){s.splice(2,2,j);p=a.Event._attach(s,{facade:false});p.sub.filter=k;p.sub._notify=f.notifySub;}}if(p&&v){n=d[v]||(d[v]={});n=n[u]||(n[u]=[]);n.push(p);}return p;}f.notifySub=function(q,l,p){l=l.slice();if(this.args){l.push.apply(l,this.args);}var o=f._applyFilter(this.filter,l,p),n,m,j,k;if(o){o=c(o);n=l[0]=new a.DOMEventFacade(l[0],p.el,p);n.container=a.one(p.el);for(m=0,j=o.length;m<j&&!n.stopped;++m){n.currentTarget=a.one(o[m]);k=this.fn.apply(this.context||n.currentTarget,l);if(k===false){break;}}return k;}};f.compileFilter=a.cached(function(j){return function(l,k){return g(l._node,j,k.currentTarget._node);};});f._applyFilter=function(n,l,q){var p=l[0],j=q.el,o=p.target||p.srcElement,k=[],m=false;if(o.nodeType===3){o=o.parentNode;}l.unshift(o);if(b(n)){while(o){m=(o===j);if(g(o,n,(m?null:j))){k.push(o);}if(m){break;}o=o.parentNode;}}else{l[0]=a.one(o);l[1]=new a.DOMEventFacade(p,j,q);while(o){if(n.apply(l[0],l)){k.push(o);}if(o===j){break;}o=o.parentNode;l[0]=a.one(o);}l[1]=p;}if(k.length<=1){k=k[0];}l.shift();return k;};a.delegate=a.Event.delegate=f;},"@VERSION@",{requires:["node-base"]});YUI.add("event-synthetic",function(b){var h=b.Env.evt.dom_map,d=b.Array,g=b.Lang,j=g.isObject,c=g.isString,e=b.Selector.query,i=function(){};function f(l,k){this.handle=l;this.emitFacade=k;}f.prototype.fire=function(q){var k=d(arguments,0,true),o=this.handle,p=o.evt,m=o.sub,r=m.context,l=m.filter,n=q||{};if(this.emitFacade){if(!q||!q.preventDefault){n=p._getFacade();if(j(q)&&!q.preventDefault){b.mix(n,q,true);k[0]=n;}else{k.unshift(n);}}n.type=p.type;n.details=k.slice();if(l){n.container=p.host;}}else{if(l&&j(q)&&q.currentTarget){k.shift();}}m.context=r||n.currentTarget||p.host;p.fire.apply(p,k);m.context=r;};function a(){this._init.apply(this,arguments);}b.mix(a,{Notifier:f,getRegistry:function(q,p,n){var o=q._node,m=b.stamp(o),l="event:"+m+p+"_synth",k=h[m]||(h[m]={});if(!k[l]&&n){k[l]={type:"_synth",fn:i,capture:false,el:o,key:l,domkey:m,notifiers:[],detachAll:function(){var r=this.notifiers,s=r.length;while(--s>=0){r[s].detach();}}};}return(k[l])?k[l].notifiers:null;},_deleteSub:function(l){if(l&&l.fn){var k=this.eventDef,m=(l.filter)?"detachDelegate":"detach";this.subscribers={};this.subCount=0;k[m](l.node,l,this.notifier,l.filter);k._unregisterSub(l);delete l.fn;delete l.node;delete l.context;}},prototype:{constructor:a,_init:function(){var k=this.publishConfig||(this.publishConfig={});this.emitFacade=("emitFacade" in k)?k.emitFacade:true;k.emitFacade=false;},processArgs:i,on:i,detach:i,delegate:i,detachDelegate:i,_on:function(n,p){var o=[],l=this.processArgs(n,p),k=n[2],r=p?"delegate":"on",m,q;m=(c(k))?e(k):d(k);if(!m.length&&c(k)){q=b.on("available",function(){b.mix(q,b[r].apply(b,n),true);},k);return q;}b.Array.each(m,function(t){var u=n.slice(),s;t=b.one(t);if(t){if(p){s=u.splice(3,1)[0];}u.splice(0,4,u[1],u[3]);if(!this.preventDups||!this.getSubs(t,n,null,true)){q=this._getNotifier(t,u,l,s);this[r](t,q.sub,q.notifier,s);o.push(q);}}},this);return(o.length===1)?o[0]:new b.EventHandle(o);},_getNotifier:function(n,q,o,m){var s=new b.CustomEvent(this.type,this.publishConfig),p=s.on.apply(s,q),r=new f(p,this.emitFacade),l=a.getRegistry(n,this.type,true),k=p.sub;p.notifier=r;k.node=n;k.filter=m;if(o){this.applyArgExtras(o,k);}b.mix(s,{eventDef:this,notifier:r,host:n,currentTarget:n,target:n,el:n._node,_delete:a._deleteSub},true);l.push(p);return p;},applyArgExtras:function(k,l){l._extra=k;},_unregisterSub:function(m){var k=a.getRegistry(m.node,this.type),l;if(k){for(l=k.length-1;l>=0;--l){if(k[l].sub===m){k.splice(l,1);break;}}}},_detach:function(m){var r=m[2],p=(c(r))?e(r):d(r),q,o,k,n,l;m.splice(2,1); for(o=0,k=p.length;o<k;++o){q=b.one(p[o]);if(q){n=this.getSubs(q,m);if(n){for(l=n.length-1;l>=0;--l){n[l].detach();}}}}},getSubs:function(l,q,k,n){var r=a.getRegistry(l,this.type),s=[],m,p,o;if(r){if(!k){k=this.subMatch;}for(m=0,p=r.length;m<p;++m){o=r[m];if(k.call(this,o.sub,q)){if(n){return o;}else{s.push(r[m]);}}}}return s.length&&s;},subMatch:function(l,k){return !k[1]||l.fn===k[1];}}},true);b.SyntheticEvent=a;b.Event.define=function(m,l,o){if(!l){l={};}var n=(j(m))?m:b.merge({type:m},l),p,k;if(o||!b.Node.DOM_EVENTS[n.type]){p=function(){a.apply(this,arguments);};b.extend(p,a,n);k=new p();m=k.type;b.Node.DOM_EVENTS[m]=b.Env.evt.plugins[m]={eventDef:k,on:function(){return k._on(d(arguments));},delegate:function(){return k._on(d(arguments),true);},detach:function(){return k._detach(d(arguments));}};}return k;};},"@VERSION@",{requires:["node-base","event-custom"]});YUI.add("event-mousewheel",function(c){var b="DOMMouseScroll",a=function(e){var d=c.Array(e,0,true),f;if(c.UA.gecko){d[0]=b;f=c.config.win;}else{f=c.config.doc;}if(d.length<3){d[2]=f;}else{d.splice(2,0,f);}return d;};c.Env.evt.plugins.mousewheel={on:function(){return c.Event._attach(a(arguments));},detach:function(){return c.Event.detach.apply(c.Event,a(arguments));}};},"@VERSION@",{requires:["node-base"]});YUI.add("event-mouseenter",function(c){function b(h,d){var g=h.currentTarget,f=h.relatedTarget;if(g!==f&&!g.contains(f)){d.fire(h);}}var a={proxyType:"mouseover",on:function(f,d,e){d.onHandle=f.on(this.proxyType,b,null,e);},detach:function(e,d){d.onHandle.detach();},delegate:function(g,e,f,d){e.delegateHandle=c.delegate(this.proxyType,b,g,d,null,f);},detachDelegate:function(e,d){d.delegateHandle.detach();}};c.Event.define("mouseenter",a,true);c.Event.define("mouseleave",c.merge(a,{proxyType:"mouseout"}),true);},"@VERSION@",{requires:["event-synthetic"]});YUI.add("event-key",function(a){a.Env.evt.plugins.key={on:function(e,g,b,k,c){var i=a.Array(arguments,0,true),f,j,h,d;f=k&&k.split(":");if(!k||k.indexOf(":")==-1||!f[1]){i[0]="key"+((f&&f[0])||"press");return a.on.apply(a,i);}j=f[0];h=(f[1])?f[1].split(/,|\+/):null;d=(a.Lang.isString(b)?b:a.stamp(b))+k;d=d.replace(/,/g,"_");if(!a.getEvent(d)){a.on(e+j,function(p){var q=false,m=false,n,l,o;for(n=0;n<h.length;n=n+1){l=h[n];o=parseInt(l,10);if(a.Lang.isNumber(o)){if(p.charCode===o){q=true;}else{m=true;}}else{if(q||!m){q=(p[l+"Key"]);m=!q;}}}if(q){a.fire(d,p);}},b);}i.splice(2,2);i[0]=d;return a.on.apply(a,i);}};},"@VERSION@",{requires:["node-base"]});YUI.add("event-focus",function(e){var d=e.Event,c=e.Lang,a=c.isString,b=c.isFunction(e.DOM.create('<p onbeforeactivate=";"/>').onbeforeactivate);function f(h,g,j){var i="_"+h+"Notifiers";e.Event.define(h,{_attach:function(l,m,k){if(e.DOM.isWindow(l)){return d._attach([h,function(n){m.fire(n);},l]);}else{return d._attach([g,this._proxy,l,this,m,k],{capture:true});}},_proxy:function(o,s,p){var m=o.target,q=m.getData(i),t=e.stamp(o.currentTarget._node),k=(b||o.target!==o.currentTarget),l=s.handle.sub,r=[m,o].concat(l.args||[]),n;s.currentTarget=(p)?m:o.currentTarget;s.container=(p)?o.currentTarget:null;if(!l.filter||l.filter.apply(m,r)){if(!q){q={};m.setData(i,q);if(k){n=d._attach([j,this._notify,m._node]).sub;n.once=true;}}if(!q[t]){q[t]=[];}q[t].push(s);if(!k){this._notify(o);}}},_notify:function(p,l){var m=p.currentTarget,r=m.getData(i),s=m.get("ownerDocument")||m,q=m,k=[],t,n,o;if(r){while(q&&q!==s){k.push.apply(k,r[e.stamp(q)]||[]);q=q.get("parentNode");}k.push.apply(k,r[e.stamp(s)]||[]);for(n=0,o=k.length;n<o;++n){t=k[n];p.currentTarget=k[n].currentTarget;if(t.container){p.container=t.container;}else{delete p.container;}t.fire(p);}m.clearData(i);}},on:function(m,k,l){k.onHandle=this._attach(m._node,l);},detach:function(l,k){k.onHandle.detach();},delegate:function(n,l,m,k){if(a(k)){l.filter=e.delegate.compileFilter(k);}l.delegateHandle=this._attach(n._node,m,true);},detachDelegate:function(l,k){k.delegateHandle.detach();}},true);}if(b){f("focus","beforeactivate","focusin");f("blur","beforedeactivate","focusout");}else{f("focus","focus","focus");f("blur","blur","blur");}},"@VERSION@",{requires:["event-synthetic"]});YUI.add("event-resize",function(a){(function(){var c,b,e="window:resize",d=function(f){if(a.UA.gecko){a.fire(e,f);}else{if(b){b.cancel();}b=a.later(a.config.windowResizeDelay||40,a,function(){a.fire(e,f);});}};a.Env.evt.plugins.windowresize={on:function(h,g){if(!c){c=a.Event._attach(["resize",d]);}var f=a.Array(arguments,0,true);f[0]=e;return a.on.apply(a,f);}};})();},"@VERSION@",{requires:["node-base"]});YUI.add("event-hover",function(d){var c=d.Lang.isFunction,b=function(){},a={processArgs:function(e){var f=c(e[2])?2:3;return(c(e[f]))?e.splice(f,1)[0]:b;},on:function(h,f,g,e){f._detach=h[(e)?"delegate":"on"]({mouseenter:d.bind(g.fire,g),mouseleave:f._extra},e);},detach:function(g,e,f){e._detacher.detach();}};a.delegate=a.on;a.detachDelegate=a.detach;d.Event.define("hover",a);},"@VERSION@",{requires:["event-mouseenter"]});YUI.add("event",function(a){},"@VERSION@",{use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover"]});
ajax/libs/yui/3.7.1/datatable-core/datatable-core.js
AlicanC/cdnjs
YUI.add('datatable-core', function (Y, NAME) { /** The core implementation of the `DataTable` and `DataTable.Base` Widgets. @module datatable @submodule datatable-core @since 3.5.0 **/ var INVALID = Y.Attribute.INVALID_VALUE, Lang = Y.Lang, isFunction = Lang.isFunction, isObject = Lang.isObject, isArray = Lang.isArray, isString = Lang.isString, isNumber = Lang.isNumber, toArray = Y.Array, keys = Y.Object.keys, Table; /** _API docs for this extension are included in the DataTable class._ Class extension providing the core API and structure for the DataTable Widget. Use this class extension with Widget or another Base-based superclass to create the basic DataTable model API and composing class structure. @class DataTable.Core @for DataTable @since 3.5.0 **/ Table = Y.namespace('DataTable').Core = function () {}; Table.ATTRS = { /** Columns to include in the rendered table. If omitted, the attributes on the configured `recordType` or the first item in the `data` collection will be used as a source. This attribute takes an array of strings or objects (mixing the two is fine). Each string or object is considered a column to be rendered. Strings are converted to objects, so `columns: ['first', 'last']` becomes `columns: [{ key: 'first' }, { key: 'last' }]`. DataTable.Core only concerns itself with a few properties of columns. These properties are: * `key` - Used to identify the record field/attribute containing content for this column. Also used to create a default Model if no `recordType` or `data` are provided during construction. If `name` is not specified, this is assigned to the `_id` property (with added incrementer if the key is used by multiple columns). * `children` - Traversed to initialize nested column objects * `name` - Used in place of, or in addition to, the `key`. Useful for columns that aren't bound to a field/attribute in the record data. This is assigned to the `_id` property. * `id` - For backward compatibility. Implementers can specify the id of the header cell. This should be avoided, if possible, to avoid the potential for creating DOM elements with duplicate IDs. * `field` - For backward compatibility. Implementers should use `name`. * `_id` - Assigned unique-within-this-instance id for a column. By order of preference, assumes the value of `name`, `key`, `id`, or `_yuid`. This is used by the rendering views as well as feature module as a means to identify a specific column without ambiguity (such as multiple columns using the same `key`. * `_yuid` - Guid stamp assigned to the column object. * `_parent` - Assigned to all child columns, referencing their parent column. @attribute columns @type {Object[]|String[]} @default (from `recordType` ATTRS or first item in the `data`) @since 3.5.0 **/ columns: { // TODO: change to setter to clone input array/objects validator: isArray, setter: '_setColumns', getter: '_getColumns' }, /** Model subclass to use as the `model` for the ModelList stored in the `data` attribute. If not provided, it will try really hard to figure out what to use. The following attempts will be made to set a default value: 1. If the `data` attribute is set with a ModelList instance and its `model` property is set, that will be used. 2. If the `data` attribute is set with a ModelList instance, and its `model` property is unset, but it is populated, the `ATTRS` of the `constructor of the first item will be used. 3. If the `data` attribute is set with a non-empty array, a Model subclass will be generated using the keys of the first item as its `ATTRS` (see the `_createRecordClass` method). 4. If the `columns` attribute is set, a Model subclass will be generated using the columns defined with a `key`. This is least desirable because columns can be duplicated or nested in a way that's not parsable. 5. If neither `data` nor `columns` is set or populated, a change event subscriber will listen for the first to be changed and try all over again. @attribute recordType @type {Function} @default (see description) @since 3.5.0 **/ recordType: { getter: '_getRecordType', setter: '_setRecordType' }, /** The collection of data records to display. This attribute is a pass through to a `data` property, which is a ModelList instance. If this attribute is passed a ModelList or subclass, it will be assigned to the property directly. If an array of objects is passed, a new ModelList will be created using the configured `recordType` as its `model` property and seeded with the array. Retrieving this attribute will return the ModelList stored in the `data` property. @attribute data @type {ModelList|Object[]} @default `new ModelList()` @since 3.5.0 **/ data: { valueFn: '_initData', setter : '_setData', lazyAdd: false }, /** Content for the `<table summary="ATTRIBUTE VALUE HERE">`. Values assigned to this attribute will be HTML escaped for security. @attribute summary @type {String} @default '' (empty string) @since 3.5.0 **/ //summary: {}, /** HTML content of an optional `<caption>` element to appear above the table. Leave this config unset or set to a falsy value to remove the caption. @attribute caption @type HTML @default '' (empty string) @since 3.5.0 **/ //caption: {}, /** Deprecated as of 3.5.0. Passes through to the `data` attribute. WARNING: `get('recordset')` will NOT return a Recordset instance as of 3.5.0. This is a break in backward compatibility. @attribute recordset @type {Object[]|Recordset} @deprecated Use the `data` attribute @since 3.5.0 **/ recordset: { setter: '_setRecordset', getter: '_getRecordset', lazyAdd: false }, /** Deprecated as of 3.5.0. Passes through to the `columns` attribute. WARNING: `get('columnset')` will NOT return a Columnset instance as of 3.5.0. This is a break in backward compatibility. @attribute columnset @type {Object[]} @deprecated Use the `columns` attribute @since 3.5.0 **/ columnset: { setter: '_setColumnset', getter: '_getColumnset', lazyAdd: false } }; Y.mix(Table.prototype, { // -- Instance properties ------------------------------------------------- /** The ModelList that manages the table's data. @property data @type {ModelList} @default undefined (initially unset) @since 3.5.0 **/ //data: null, // -- Public methods ------------------------------------------------------ /** Gets the column configuration object for the given key, name, or index. For nested columns, `name` can be an array of indexes, each identifying the index of that column in the respective parent's "children" array. If you pass a column object, it will be returned. For columns with keys, you can also fetch the column with `instance.get('columns.foo')`. @method getColumn @param {String|Number|Number[]} name Key, "name", index, or index array to identify the column @return {Object} the column configuration object @since 3.5.0 **/ getColumn: function (name) { var col, columns, i, len, cols; if (isObject(name) && !isArray(name)) { // TODO: support getting a column from a DOM node - this will cross // the line into the View logic, so it should be relayed // Assume an object passed in is already a column def col = name; } else { col = this.get('columns.' + name); } if (col) { return col; } columns = this.get('columns'); if (isNumber(name) || isArray(name)) { name = toArray(name); cols = columns; for (i = 0, len = name.length - 1; cols && i < len; ++i) { cols = cols[name[i]] && cols[name[i]].children; } return (cols && cols[name[i]]) || null; } return null; }, /** Returns the Model associated to the record `id`, `clientId`, or index (not row index). If none of those yield a Model from the `data` ModelList, the arguments will be passed to the `view` instance's `getRecord` method if it has one. If no Model can be found, `null` is returned. @method getRecord @param {Number|String|Node} seed Record `id`, `clientId`, index, Node, or identifier for a row or child element @return {Model} @since 3.5.0 **/ getRecord: function (seed) { var record = this.data.getById(seed) || this.data.getByClientId(seed); if (!record) { if (isNumber(seed)) { record = this.data.item(seed); } // TODO: this should be split out to base somehow if (!record && this.view && this.view.getRecord) { record = this.view.getRecord.apply(this.view, arguments); } } return record || null; }, // -- Protected and private properties and methods ------------------------ /** This tells `Y.Base` that it should create ad-hoc attributes for config properties passed to DataTable's constructor. This is useful for setting configurations on the DataTable that are intended for the rendering View(s). @property _allowAdHocAttrs @type Boolean @default true @protected @since 3.6.0 **/ _allowAdHocAttrs: true, /** A map of column key to column configuration objects parsed from the `columns` attribute. @property _columnMap @type {Object} @default undefined (initially unset) @protected @since 3.5.0 **/ //_columnMap: null, /** The Node instance of the table containing the data rows. This is set when the table is rendered. It may also be set by progressive enhancement, though this extension does not provide the logic to parse from source. @property _tableNode @type {Node} @default undefined (initially unset) @protected @since 3.5.0 **/ //_tableNode: null, /** Updates the `_columnMap` property in response to changes in the `columns` attribute. @method _afterColumnsChange @param {EventFacade} e The `columnsChange` event object @protected @since 3.5.0 **/ _afterColumnsChange: function (e) { this._setColumnMap(e.newVal); }, /** Updates the `modelList` attributes of the rendered views in response to the `data` attribute being assigned a new ModelList. @method _afterDataChange @param {EventFacade} e the `dataChange` event @protected @since 3.5.0 **/ _afterDataChange: function (e) { var modelList = e.newVal; this.data = e.newVal; if (!this.get('columns') && modelList.size()) { // TODO: this will cause a re-render twice because the Views are // subscribed to columnsChange this._initColumns(); } }, /** Assigns to the new recordType as the model for the data ModelList @method _afterRecordTypeChange @param {EventFacade} e recordTypeChange event @protected @since 3.6.0 **/ _afterRecordTypeChange: function (e) { var data = this.data.toJSON(); this.data.model = e.newVal; this.data.reset(data); if (!this.get('columns') && data) { if (data.length) { this._initColumns(); } else { this.set('columns', keys(e.newVal.ATTRS)); } } }, /** Creates a Model subclass from an array of attribute names or an object of attribute definitions. This is used to generate a class suitable to represent the data passed to the `data` attribute if no `recordType` is set. @method _createRecordClass @param {String[]|Object} attrs Names assigned to the Model subclass's `ATTRS` or its entire `ATTRS` definition object @return {Model} @protected @since 3.5.0 **/ _createRecordClass: function (attrs) { var ATTRS, i, len; if (isArray(attrs)) { ATTRS = {}; for (i = 0, len = attrs.length; i < len; ++i) { ATTRS[attrs[i]] = {}; } } else if (isObject(attrs)) { ATTRS = attrs; } return Y.Base.create('record', Y.Model, [], null, { ATTRS: ATTRS }); }, /** Tears down the instance. @method destructor @protected @since 3.6.0 **/ destructor: function () { new Y.EventHandle(Y.Object.values(this._eventHandles)).detach(); }, /** The getter for the `columns` attribute. Returns the array of column configuration objects if `instance.get('columns')` is called, or the specific column object if `instance.get('columns.columnKey')` is called. @method _getColumns @param {Object[]} columns The full array of column objects @param {String} name The attribute name requested (e.g. 'columns' or 'columns.foo'); @protected @since 3.5.0 **/ _getColumns: function (columns, name) { // Workaround for an attribute oddity (ticket #2529254) // getter is expected to return an object if get('columns.foo') is called. // Note 'columns.' is 8 characters return name.length > 8 ? this._columnMap : columns; }, /** Relays the `get()` request for the deprecated `columnset` attribute to the `columns` attribute. THIS BREAKS BACKWARD COMPATIBILITY. 3.4.1 and prior implementations will expect a Columnset instance returned from `get('columnset')`. @method _getColumnset @param {Object} ignored The current value stored in the `columnset` state @param {String} name The attribute name requested (e.g. 'columnset' or 'columnset.foo'); @deprecated This will be removed with the `columnset` attribute in a future version. @protected @since 3.5.0 **/ _getColumnset: function (_, name) { return this.get(name.replace(/^columnset/, 'columns')); }, /** Returns the Model class of the instance's `data` attribute ModelList. If not set, returns the explicitly configured value. @method _getRecordType @param {Model} val The currently configured value @return {Model} **/ _getRecordType: function (val) { // Prefer the value stored in the attribute because the attribute // change event defaultFn sets e.newVal = this.get('recordType') // before notifying the after() subs. But if this getter returns // this.data.model, then after() subs would get e.newVal === previous // model before _afterRecordTypeChange can set // this.data.model = e.newVal return val || (this.data && this.data.model); }, /** Initializes the `_columnMap` property from the configured `columns` attribute. If `columns` is not set, but there are records in the `data` ModelList, use `ATTRS` of that class. @method _initColumns @protected @since 3.5.0 **/ _initColumns: function () { var columns = this.get('columns') || [], item; // Default column definition from the configured recordType if (!columns.length && this.data.size()) { // TODO: merge superclass attributes up to Model? item = this.data.item(0); if (item.toJSON) { item = item.toJSON(); } this.set('columns', keys(item)); } this._setColumnMap(columns); }, /** Sets up the change event subscriptions to maintain internal state. @method _initCoreEvents @protected @since 3.6.0 **/ _initCoreEvents: function () { this._eventHandles.coreAttrChanges = this.after({ columnsChange : Y.bind('_afterColumnsChange', this), recordTypeChange: Y.bind('_afterRecordTypeChange', this), dataChange : Y.bind('_afterDataChange', this) }); }, /** Defaults the `data` attribute to an empty ModelList if not set during construction. Uses the configured `recordType` for the ModelList's `model` proeprty if set. @method _initData @protected @return {ModelList} @since 3.6.0 **/ _initData: function () { var recordType = this.get('recordType'), // TODO: LazyModelList if recordType doesn't have complex ATTRS modelList = new Y.ModelList(); if (recordType) { modelList.model = recordType; } return modelList; }, /** Initializes the instance's `data` property from the value of the `data` attribute. If the attribute value is a ModelList, it is assigned directly to `this.data`. If it is an array, a ModelList is created, its `model` property is set to the configured `recordType` class, and it is seeded with the array data. This ModelList is then assigned to `this.data`. @method _initDataProperty @param {Array|ModelList|ArrayList} data Collection of data to populate the DataTable @protected @since 3.6.0 **/ _initDataProperty: function (data) { var recordType; if (!this.data) { recordType = this.get('recordType'); if (data && data.each && data.toJSON) { this.data = data; if (recordType) { this.data.model = recordType; } } else { // TODO: customize the ModelList or read the ModelList class // from a configuration option? this.data = new Y.ModelList(); if (recordType) { this.data.model = recordType; } } // TODO: Replace this with an event relay for specific events. // Using bubbling causes subscription conflicts with the models' // aggregated change event and 'change' events from DOM elements // inside the table (via Widget UI event). this.data.addTarget(this); } }, /** Initializes the columns, `recordType` and data ModelList. @method initializer @param {Object} config Configuration object passed to constructor @protected @since 3.5.0 **/ initializer: function (config) { var data = config.data, columns = config.columns, recordType; // Referencing config.data to allow _setData to be more stringent // about its behavior this._initDataProperty(data); // Default columns from recordType ATTRS if recordType is supplied at // construction. If no recordType is supplied, but the data is // supplied as a non-empty array, use the keys of the first item // as the columns. if (!columns) { recordType = (config.recordType || config.data === this.data) && this.get('recordType'); if (recordType) { columns = keys(recordType.ATTRS); } else if (isArray(data) && data.length) { columns = keys(data[0]); } if (columns) { this.set('columns', columns); } } this._initColumns(); this._eventHandles = {}; this._initCoreEvents(); }, /** Iterates the array of column configurations to capture all columns with a `key` property. An map is built with column keys as the property name and the corresponding column object as the associated value. This map is then assigned to the instance's `_columnMap` property. @method _setColumnMap @param {Object[]|String[]} columns The array of column config objects @protected @since 3.6.0 **/ _setColumnMap: function (columns) { var map = {}; function process(cols) { var i, len, col, key; for (i = 0, len = cols.length; i < len; ++i) { col = cols[i]; key = col.key; // First in wins for multiple columns with the same key // because the first call to genId (in _setColumns) will // return the same key, which will then be overwritten by the // subsequent same-keyed column. So table.getColumn(key) would // return the last same-keyed column. if (key && !map[key]) { map[key] = col; } //TODO: named columns can conflict with keyed columns map[col._id] = col; if (col.children) { process(col.children); } } } process(columns); this._columnMap = map; }, /** Translates string columns into objects with that string as the value of its `key` property. All columns are assigned a `_yuid` stamp and `_id` property corresponding to the column's configured `name` or `key` property with any spaces replaced with dashes. If the same `name` or `key` appears in multiple columns, subsequent appearances will have their `_id` appended with an incrementing number (e.g. if column "foo" is included in the `columns` attribute twice, the first will get `_id` of "foo", and the second an `_id` of "foo1"). Columns that are children of other columns will have the `_parent` property added, assigned the column object to which they belong. @method _setColumns @param {null|Object[]|String[]} val Array of config objects or strings @return {null|Object[]} @protected **/ _setColumns: function (val) { var keys = {}, known = [], knownCopies = [], arrayIndex = Y.Array.indexOf; function copyObj(o) { var copy = {}, key, val, i; known.push(o); knownCopies.push(copy); for (key in o) { if (o.hasOwnProperty(key)) { val = o[key]; if (isArray(val)) { copy[key] = val.slice(); } else if (isObject(val, true)) { i = arrayIndex(val, known); copy[key] = i === -1 ? copyObj(val) : knownCopies[i]; } else { copy[key] = o[key]; } } } return copy; } function genId(name) { // Sanitize the name for use in generated CSS classes. // TODO: is there more to do for other uses of _id? name = name.replace(/\s+/, '-'); if (keys[name]) { name += (keys[name]++); } else { keys[name] = 1; } return name; } function process(cols, parent) { var columns = [], i, len, col, yuid; for (i = 0, len = cols.length; i < len; ++i) { columns[i] = // chained assignment col = isString(cols[i]) ? { key: cols[i] } : copyObj(cols[i]); yuid = Y.stamp(col); // For backward compatibility if (!col.id) { // Implementers can shoot themselves in the foot by setting // this config property to a non-unique value col.id = yuid; } if (col.field) { // Field is now known as "name" to avoid confusion with data // fields or schema.resultFields col.name = col.field; } if (parent) { col._parent = parent; } else { delete col._parent; } // Unique id based on the column's configured name or key, // falling back to the yuid. Duplicates will have a counter // added to the end. col._id = genId(col.name || col.key || col.id); if (isArray(col.children)) { col.children = process(col.children, col); } } return columns; } return val && process(val); }, /** Relays attribute assignments of the deprecated `columnset` attribute to the `columns` attribute. If a Columnset is object is passed, its basic object structure is mined. @method _setColumnset @param {Array|Columnset} val The columnset value to relay @deprecated This will be removed with the deprecated `columnset` attribute in a later version. @protected @since 3.5.0 **/ _setColumnset: function (val) { this.set('columns', val); return isArray(val) ? val : INVALID; }, /** Accepts an object with `each` and `getAttrs` (preferably a ModelList or subclass) or an array of data objects. If an array is passes, it will create a ModelList to wrap the data. In doing so, it will set the created ModelList's `model` property to the class in the `recordType` attribute, which will be defaulted if not yet set. If the `data` property is already set with a ModelList, passing an array as the value will call the ModelList's `reset()` method with that array rather than replacing the stored ModelList wholesale. Any non-ModelList-ish and non-array value is invalid. @method _setData @protected @since 3.5.0 **/ _setData: function (val) { if (val === null) { val = []; } if (isArray(val)) { this._initDataProperty(); // silent to prevent subscribers to both reset and dataChange // from reacting to the change twice. // TODO: would it be better to return INVALID to silence the // dataChange event, or even allow both events? this.data.reset(val, { silent: true }); // Return the instance ModelList to avoid storing unprocessed // data in the state and their vivified Model representations in // the instance's data property. Decreases memory consumption. val = this.data; } else if (!val || !val.each || !val.toJSON) { // ModelList/ArrayList duck typing val = INVALID; } return val; }, /** Relays the value assigned to the deprecated `recordset` attribute to the `data` attribute. If a Recordset instance is passed, the raw object data will be culled from it. @method _setRecordset @param {Object[]|Recordset} val The recordset value to relay @deprecated This will be removed with the deprecated `recordset` attribute in a later version. @protected @since 3.5.0 **/ _setRecordset: function (val) { var data; if (val && Y.Recordset && val instanceof Y.Recordset) { data = []; val.each(function (record) { data.push(record.get('data')); }); val = data; } this.set('data', val); return val; }, /** Accepts a Base subclass (preferably a Model subclass). Alternately, it will generate a custom Model subclass from an array of attribute names or an object defining attributes and their respective configurations (it is assigned as the `ATTRS` of the new class). Any other value is invalid. @method _setRecordType @param {Function|String[]|Object} val The Model subclass, array of attribute names, or the `ATTRS` definition for a custom model subclass @return {Function} A Base/Model subclass @protected @since 3.5.0 **/ _setRecordType: function (val) { var modelClass; // Duck type based on known/likely consumed APIs if (isFunction(val) && val.prototype.toJSON && val.prototype.setAttrs) { modelClass = val; } else if (isObject(val)) { modelClass = this._createRecordClass(val); } return modelClass || INVALID; } }); }, '@VERSION@', {"requires": ["escape", "model-list", "node-event-delegate"]});
packages/material-ui-icons/src/LocalFloristRounded.js
allanalexandre/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><path d="M12 22c4.56 0 8.33-3.4 8.92-7.8.09-.64-.48-1.21-1.12-1.12-4.4.59-7.8 4.36-7.8 8.92zM5.6 10.25c0 1.38 1.12 2.5 2.5 2.5.53 0 1.01-.16 1.42-.44l-.02.19c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5l-.02-.19c.4.28.89.44 1.42.44 1.38 0 2.5-1.12 2.5-2.5 0-1-.59-1.85-1.43-2.25.84-.4 1.43-1.25 1.43-2.25 0-1.38-1.12-2.5-2.5-2.5-.53 0-1.01.16-1.42.44l.02-.19C14.5 2.12 13.38 1 12 1S9.5 2.12 9.5 3.5l.02.19c-.4-.28-.89-.44-1.42-.44-1.38 0-2.5 1.12-2.5 2.5 0 1 .59 1.85 1.43 2.25-.84.4-1.43 1.25-1.43 2.25zM12 5.5c1.38 0 2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5S9.5 9.38 9.5 8s1.12-2.5 2.5-2.5zm-8.92 8.7C3.67 18.6 7.44 22 12 22c0-4.56-3.4-8.33-7.8-8.92-.64-.09-1.21.48-1.12 1.12z" /></React.Fragment> , 'LocalFloristRounded');
public/js/components/Spinner/index.js
nowordforfree/react-cv
import React from 'react'; import './Spinner.less'; export default () => ( <div className="spin-backdrop"> <img className="spinner" alt="" src="/img/logo.svg" /> </div> );
docs/app/Examples/views/Statistic/Variations/index.js
Rohanhacker/Semantic-UI-React
import React from 'react' import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample' import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection' const Variations = () => ( <ExampleSection title='Variations'> <ComponentExample title='Horizontal Statistic' description='A statistic can present its measurement horizontally.' examplePath='views/Statistic/Variations/StatisticExampleHorizontal' /> <ComponentExample examplePath='views/Statistic/Variations/StatisticExampleHorizontalGroup' /> <ComponentExample title='Colored' description='A statistic can be formatted to be different colors.' examplePath='views/Statistic/Variations/StatisticExampleColored' /> <ComponentExample title='Inverted' description='A statistic can be formatted to fit on a dark background.' examplePath='views/Statistic/Variations/StatisticExampleInverted' /> <ComponentExample title='Evenly Divided' description='A statistic group can have its items divided evenly.' examplePath='views/Statistic/Variations/StatisticExampleEvenlyDivided' /> <ComponentExample title='Floated' description='An statistic can sit to the left or right of other content.' examplePath='views/Statistic/Variations/StatisticExampleFloated' /> <ComponentExample title='Size' description='A statistic can vary in size.' examplePath='views/Statistic/Variations/StatisticExampleSize' /> <ComponentExample examplePath='views/Statistic/Variations/StatisticExampleSizeDivided' /> </ExampleSection> ) export default Variations
webansible-school/webansible-react/static/build/react-dom-server.min.js
mikolajs/javascript-teaching
/** * ReactDOMServer v15.3.1 * * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var f;f="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,f.ReactDOMServer=e(f.React)}}(function(e){return e.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED});
sites/default/files/js/simplemenu-d9256fda96c0b8eaa8e20bcfad057096.js
condesan/camino
var simplemenu="\x3cdiv class=\"simplemenu-block\"\x3e\x3cul class=\"menu clear-block\" id=\"simplemenu\"\x3e\x3cli class=\"expanded first\" id=\"simplemenu-li-0\"\x3e\x3ca name=\"menu-id-1\"\x3eDevel module\x3c/a\x3e\x3cul class=\"menu\"0\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-146\"\x3e\x3ca href=\"/camino/admin/settings/devel\"\x3eDevel settings\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-145\"\x3e\x3ca href=\"/camino/admin/reports/status/run-cron\"\x3eEjecutar cron\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-172\"\x3e\x3ca href=\"/camino/devel/cache/clear?destination=calendar%2F2010-10-24\" title=\"Clear the CSS cache and all database cache tables which store page, node, theme and variable caches.\"\x3eEmpty cache\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-153\"\x3e\x3ca href=\"/camino/devel/php\" title=\"Execute some PHP code\"\x3eExecute PHP Code\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-154\"\x3e\x3ca href=\"/camino/devel/reference\" title=\"View a list of currently defined user functions with documentation links.\"\x3eFunction reference\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-156\"\x3e\x3ca href=\"/camino/devel/elements\" title=\"View the active form/render elements for this site.\"\x3eHook_elements()\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-180\"\x3e\x3ca href=\"/camino/devel/node_access/summary\"\x3eNode_access summary\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-158\"\x3e\x3ca href=\"/camino/devel/phpinfo\" title=\"View your server\x26#039;s PHP configuration\"\x3ePHPinfo()\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-184\"\x3e\x3ca href=\"/camino/devel/menu/reset?destination=calendar%2F2010-10-24\" title=\"Rebuild menu based on hook_menu() and revert any custom changes. All menu items return to their default settings.\"\x3eRebuild menus\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-160\"\x3e\x3ca href=\"/camino/devel/reinstall?destination=calendar%2F2010-10-24\" title=\"Run hook_uninstall() and then hook_install() for a given module.\"\x3eReinstall modules\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-161\"\x3e\x3ca href=\"/camino/devel/session\" title=\"List the contents of $_SESSION.\"\x3eSession viewer\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-187\"\x3e\x3ca href=\"/camino/devel/theme/registry\" title=\"View a list of available theme functions across the whole site.\"\x3eTheme registry\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-164\"\x3e\x3ca href=\"/camino/devel/variable?destination=calendar%2F2010-10-24\" title=\"Edit and delete site variables.\"\x3eVariable editor\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-372\"\x3e\x3ca href=\"/camino/geonames/docs\"\x3eGeonames Docs\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-21\"\x3e\x3ca href=\"/camino/user/me\"\x3eMi cuenta\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-11\"\x3e\x3ca name=\"menu-id-2\"\x3eCrear contenido\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-11\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-112\"\x3e\x3ca href=\"/camino/node/add/story\" title=\"Un artículo, con estructura similar a una página, es ideal para crear y mostrar contenido que informa a los visitantes del sitio. Notas de prensa, anuncios del sitio, y entradas informales de un blog pueden ser creadas con un artículo. Por defecto, un artículo aparece automáticamente en la página inicial del sitio, y permite recibir comentarios.\"\x3eArtículo\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-235\"\x3e\x3ca href=\"/camino/node/add/caminos\"\x3eCaminos\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-254\"\x3e\x3ca href=\"/camino/node/add/etapas\"\x3eEtapas\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-355\"\x3e\x3ca href=\"/camino/node/add/experiencias\"\x3eExperiencias\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-271\"\x3e\x3ca href=\"/camino/node/add/galeria\"\x3eGalería de Fotos\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-610\"\x3e\x3ca href=\"/camino/node/add/logos\" title=\"Agregar logo\"\x3eLogos\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-430\"\x3e\x3ca href=\"/camino/node/add/panel\" title=\"A panel layout broken up into rows and columns.\"\x3ePanel\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-261\"\x3e\x3ca href=\"/camino/node/add/usuarios\"\x3ePerfil\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-276\"\x3e\x3ca href=\"/camino/node/add/pizarra\"\x3ePizarra\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-114\"\x3e\x3ca href=\"/camino/node/add/page\" title=\"Una página, similar en forma y contenido a un artículo, es un método sencillo de crear y mostrar información que no suele cambiar, como una sección \x26quot;Acerca de\x26quot; en un sitio web. Por defecto, una página no permite comentarios de visitantes y no es promovida a la portada del sitio.\"\x3ePágina\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-266\"\x3e\x3ca href=\"/camino/node/add/recursos\"\x3eRecursos\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-2\"\x3e\x3ca name=\"menu-id-3\"\x3eAdministrar\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-2\"\x3e\x3cli class=\"expanded first\" id=\"simplemenu-li-10\"\x3e\x3ca name=\"menu-id-4\"\x3eAdministración de contenido\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-10\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-480\"\x3e\x3ca href=\"/camino/admin/content/backup_migrate\" title=\"Backup/restore your database or migrate data to or from another Drupal site.\"\x3eBackup and Migrate\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-27\"\x3e\x3ca href=\"/camino/admin/content/comment\" title=\"Lista y edita los comentarios del sitio y la cola de moderación de comentarios.\"\x3eComentarios\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-28\"\x3e\x3ca href=\"/camino/admin/content/node\" title=\"Ver, editar y borrar el contenido de su sitio.\"\x3eContenido\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-245\"\x3e\x3ca href=\"/camino/admin/content/date/tools\" title=\"Herramientas para importar y autocrear fechas y calendarios.\"\x3eDate Tools\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-324\"\x3e\x3ca href=\"/camino/admin/content/emfield\" title=\"Configure Embedded Media Field: Allow content types to use various 3rd party providers, enter API keys, etc.\"\x3eEmbedded Media Field configuration\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-42\"\x3e\x3ca href=\"/camino/admin/content/node-settings\" title=\"Controla el comportamiento del envío, como la longitud del avance, la necesidad de una vista preliminar antes de enviar y el número de envíos en la página principal.\"\x3eOpciones de envío\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-43\"\x3e\x3ca href=\"/camino/admin/content/rss-publishing\" title=\"Configura el número de ítems por origen y si los orígenes deben contener los títulos, los avances o el texto completo.\"\x3ePublicación RSS\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-514\"\x3e\x3ca href=\"/camino/admin/content/taxonomy_manager\" title=\"Administer vocabularies with the Taxonomy Manager\"\x3eTaxonomy Manager\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-95\"\x3e\x3ca href=\"/camino/admin/content/taxonomy\" title=\"Gestionar el etiquetado, categorización y clasificación de su contenido\"\x3eTaxonomía\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-29\"\x3e\x3ca href=\"/camino/admin/content/types\" title=\"Gestiona los envíos por tipo de contenido, incluyendo el estado predefinido, la promoción a la página principal, etc.\"\x3eTipos de contenido\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-17\"\x3e\x3ca name=\"menu-id-5\"\x3eConstrucción del sitio\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-17\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-127\"\x3e\x3ca href=\"/camino/admin/build/path\" title=\"Cambia las rutas de URLs del sitio mediante alias.\"\x3eAlias de URL\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-25\"\x3e\x3ca href=\"/camino/admin/build/block\" title=\"Configura qué bloques de contenido aparecen en las zonas laterales del sitio y de otras regiones.\"\x3eBloques\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-426\"\x3e\x3ca href=\"/camino/admin/build/ctools-rulesets\" title=\"Add, edit or delete custom access rulesets for use with Panels and other systems that utilize CTools content plugins.\"\x3eCustom access rulesets\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-693\"\x3e\x3ca href=\"/camino/admin/build/custom_breadcrumbs\" title=\"Add custom breadcrumb trails for content types.\"\x3eCustom breadcrumbs\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-427\"\x3e\x3ca href=\"/camino/admin/build/ctools-content\" title=\"Add, edit or delete custom content panes.\"\x3eCustom content panes\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-491\"\x3e\x3ca href=\"/camino/admin/build/features\" title=\"Manage features.\"\x3eFeatures\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-170\"\x3e\x3ca href=\"/camino/admin/build/contact\" title=\"Crea un formulario de contacto del sistema y configura categorías para que las utilice el formulario.\"\x3eFormulario de contacto\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-179\"\x3e\x3ca href=\"/camino/admin/build/imagecache\" title=\"Administer imagecache presets and actions.\"\x3eImageCache\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-38\"\x3e\x3ca name=\"menu-id-6\"\x3eMenús\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-38\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-90\"\x3e\x3ca href=\"/camino/admin/build/menu-customize/primary-links\"\x3eEnlaces primarios\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-91\"\x3e\x3ca href=\"/camino/admin/build/menu-customize/secondary-links\"\x3eEnlaces secundarios\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-629\"\x3e\x3ca href=\"/camino/admin/build/menu-customize/menu-mi-menu\"\x3eMi menu\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-89\"\x3e\x3ca href=\"/camino/admin/build/menu-customize/navigation\"\x3eNavegación\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-428\"\x3e\x3ca href=\"/camino/admin/build/mini-panels\" title=\"Add, edit or delete mini panels, which can be used as blocks or content panes in other panels.\"\x3eMini panels\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-39\"\x3e\x3ca href=\"/camino/admin/build/modules\" title=\"Habilitar o deshabilitar módulos adicionales para su sitio.\"\x3eMódulos\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-431\"\x3e\x3ca href=\"/camino/admin/build/panels\" title=\"Get a bird\x26#039;s eye view of items related to Panels.\"\x3ePanels\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-429\"\x3e\x3ca href=\"/camino/admin/build/pages\" title=\"Add, edit and remove overridden system pages and user defined pages from the system.\"\x3ePáginas\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-432\"\x3e\x3ca href=\"/camino/admin/build/stylizer\" title=\"Add, edit or delete stylizer styles.\"\x3eStylizer\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-49\"\x3e\x3ca href=\"/camino/admin/build/themes\" title=\"Cambia el tema que usa el sitio o permite que los usuarios lo elijan.\"\x3eTemas\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-99\"\x3e\x3ca href=\"/camino/admin/build/translate\" title=\"Traduce la interfaz interna y opcionalmente otro texto.\"\x3eTraducir interfaz\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-197\"\x3e\x3ca href=\"/camino/admin/build/views\" title=\"Views are customized lists of content on your system; they are highly configurable and give you control over how lists of content are presented.\"\x3eViews\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-373\"\x3e\x3ca name=\"menu-id-7\"\x3eGoogle Maps Tools\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-373\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-378\"\x3e\x3ca href=\"/camino/admin/gmaps/icons\" title=\"Manage the icons defined for your site.\"\x3eIcons\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-380\"\x3e\x3ca href=\"/camino/admin/gmaps/maps\" title=\"Manage the map presets defined for your site.\"\x3eMap presets\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-381\"\x3e\x3ca href=\"/camino/admin/gmaps/static-maps\" title=\"Manage the static map presets defined for your site.\"\x3eStatic map presets\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-18\"\x3e\x3ca name=\"menu-id-8\"\x3eConfiguración del sitio\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-18\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-634\"\x3e\x3ca href=\"/camino/admin/settings/me\" title=\"Configure the \x26#039;me\x26#039; aliases, and how they\x26#039;re matched.\"\x3e\x26#039;Me\x26#039; Aliases\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-23\"\x3e\x3ca href=\"/camino/admin/settings/actions\" title=\"Gestionar las acciones definidas para su sitio.\"\x3eAcciones\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-327\"\x3e\x3ca href=\"/camino/admin/settings/audiofield\" title=\"Configure Audiofield.\"\x3eAudio Field\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-241\"\x3e\x3ca href=\"/camino/admin/settings/date_popup\" title=\"Allows the user to configure the Date Popup settings.\"\x3eDate Popup Configuration\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-171\"\x3e\x3ca href=\"/camino/admin/settings/devel\" title=\"Helper functions, pages, and blocks to assist Drupal developers. The devel blocks can be managed via the block administration page.\"\x3eDevel settings\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-30\"\x3e\x3ca href=\"/camino/admin/settings/date-time\" title=\"Opciones para la visualización de la fecha y de la hora, así como la zona horaria predefinida del sistema.\"\x3eFecha y hora\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-36\"\x3e\x3ca href=\"/camino/admin/settings/filters\" title=\"Configurar cómo se procesa el contenido introducido por los usuarios, incluidas las etiquetas HTML permitidas. También permite activar formatos de entrada proporcionados por módulos.\"\x3eFormatos de entrada\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-376\"\x3e\x3ca href=\"/camino/admin/settings/geonames\" title=\"GeoNames Configuration.\"\x3eGeoNames\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-377\"\x3e\x3ca href=\"/camino/admin/settings/gmaps\" title=\"Configure GMaps Core settings.\"\x3eGoogle Maps Tools\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-93\"\x3e\x3ca href=\"/camino/admin/settings/language\" title=\"Configurar los idiomas para el contenido y la interfaz de usuario.\"\x3eIdiomas\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-178\"\x3e\x3ca href=\"/camino/admin/settings/imageapi\" title=\"Configure ImageAPI.\"\x3eImageAPI\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-46\"\x3e\x3ca href=\"/camino/admin/settings/site-information\" title=\"Cambiar la información básica del sitio, tal como el nombre del sitio, eslogan, dirección de correo electrónico, misión, portada y más.\"\x3eInformación del sitio\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-33\"\x3e\x3ca href=\"/camino/admin/settings/error-reporting\" title=\"Controla cómo gestiona Drupal los errores como los 403/404, así como los informes de error de PHP.\"\x3eInformar de errores\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-35\"\x3e\x3ca href=\"/camino/admin/settings/image-toolkit\" title=\"Elija qué juego de herramientas de imágenes quiere usar, si ha instalado otros juegos de herramientas de imágenes.\"\x3eJuego de herramientas de imágenes\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-47\"\x3e\x3ca href=\"/camino/admin/settings/site-maintenance\" title=\"Desactivar el sitio por cuestiones de mantenimiento o reactivarlo.\"\x3eMantenimiento del sitio\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-542\"\x3e\x3ca href=\"/camino/admin/settings/media_youtube\" title=\"Administer the Media: YouTube module.\"\x3eMedia: YouTube\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-368\"\x3e\x3ca href=\"/camino/admin/settings/module_filter\" title=\"Configure settings for Module Filter.\"\x3eModule filter\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-304\"\x3e\x3ca href=\"/camino/admin/settings/search\" title=\"Configura las opciones de relevancia para la búsqueda y otras opciones de indexación\"\x3eOpciones de búsqueda\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-183\"\x3e\x3ca name=\"menu-id-9\"\x3ePerformance logging\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-183\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-200\"\x3e\x3ca href=\"/camino/admin/settings/performance_logging/apc_clear\" title=\"Clears performance statistics collected in APC.\"\x3eClear APC\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-202\"\x3e\x3ca href=\"/camino/admin/settings/performance_logging/memcache_clear\" title=\"Clears performance statistics collected in Memcache.\"\x3eClear Memcache\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-37\"\x3e\x3ca name=\"menu-id-10\"\x3eRegistro y alertas\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-37\"\x3e\x3cli class=\"leaf first last\" id=\"simplemenu-li-103\"\x3e\x3ca href=\"/camino/admin/settings/logging/dblog\" title=\"Configuración para registrar los mensajes de Drupal en la base de datos. Este es el método más común para los pequeños y medianos sitios de alojamiento compartido. Los registros se pueden ver desde las páginas de administrar.\"\x3eRegistro en base de datos\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-40\"\x3e\x3ca href=\"/camino/admin/settings/performance\" title=\"Activar o desactivar la caché de páginas para los usuarios anónimos y establecer las opciones de optimización del ancho de banda para CSS y JS.\"\x3eRendimiento\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-186\"\x3e\x3ca href=\"/camino/admin/settings/simplemenu\" title=\"Select the menu to display.\"\x3eSimpleMenu\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-34\"\x3e\x3ca href=\"/camino/admin/settings/file-system\" title=\"Le dice a Drupal dónde se deben almacenar los archivos y cómo debe accederse a ellos.\"\x3eSistema de archivos\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-488\"\x3e\x3ca href=\"/camino/admin/settings/tabs\" title=\"Configuration for tabs\"\x3eTabs\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-515\"\x3e\x3ca href=\"/camino/admin/settings/taxonomy_manager\" title=\"Advanced settings for the Taxonomy Manager\"\x3eTaxonomy Manager\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-24\"\x3e\x3ca href=\"/camino/admin/settings/admin\" title=\"Opciones de apariencia de las páginas de administración.\"\x3eTema de administración\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-26\"\x3e\x3ca href=\"/camino/admin/settings/clean-urls\" title=\"Activa o desactiva URLs limpias en su sitio.\"\x3eURLs limpios\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-379\"\x3e\x3ca href=\"/camino/admin/settings/location\" title=\"Settings for Location module\"\x3eUbicación\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-691\"\x3e\x3ca href=\"/camino/admin/settings/wysiwyg\" title=\"Configure client-side editors.\"\x3eWysiwyg\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-685\"\x3e\x3ca href=\"/camino/admin/settings/jquery_update\" title=\"Configure settings for jQuery Update module.\"\x3ejQuery Update\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-20\"\x3e\x3ca name=\"menu-id-11\"\x3eAdministración de usuario\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-20\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-50\"\x3e\x3ca href=\"/camino/admin/user/settings\" title=\"Configura el comportamiento predefinido de los usuarios, incluyendo los requisitos del registro, los correos y las imágenes.\"\x3eOpciones de usuario\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-126\"\x3e\x3ca href=\"/camino/admin/user/profile\" title=\"Crea campos personalizables para sus usuarios.\"\x3ePerfiles\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-41\"\x3e\x3ca href=\"/camino/admin/user/permissions\" title=\"Determina el acceso a las características mediante selección de permisos para roles.\"\x3ePermisos\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-22\"\x3e\x3ca href=\"/camino/admin/user/rules\" title=\"Enliste y cree reglas para prohibir nombres de usuario, direcciones de correo y direcciones de IP.\"\x3eReglas de acceso\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-45\"\x3e\x3ca href=\"/camino/admin/user/roles\" title=\"Lista, edita o añade roles de usuarios.\"\x3eRoles\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-51\"\x3e\x3ca href=\"/camino/admin/user/user\" title=\"Lista, añade y edita usuarios.\"\x3eUsuarios\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-155\"\x3e\x3ca name=\"menu-id-12\"\x3eGenerate items\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-155\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-175\"\x3e\x3ca href=\"/camino/admin/generate/taxonomy\" title=\"Generate a given number of vocabularies and terms. Optionally delete current categories.\"\x3eGenerate categories\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-176\"\x3e\x3ca href=\"/camino/admin/generate/content\" title=\"Generate a given number of nodes and comments. Optionally delete current items.\"\x3eGenerate content\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-177\"\x3e\x3ca href=\"/camino/admin/generate/user\" title=\"Generate a given number of users. Optionally delete current users.\"\x3eGenerate users\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-16\"\x3e\x3ca name=\"menu-id-13\"\x3eInformes\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-16\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-94\"\x3e\x3ca href=\"/camino/admin/reports/dblog\" title=\"Ver los eventos registrados recientemente.\"\x3eEntradas recientes del registro\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-305\"\x3e\x3ca href=\"/camino/admin/reports/search\" title=\"Ver las frases más populares en las búsquedas.\"\x3eFrases principales en las búsquedas\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-181\"\x3e\x3ca href=\"/camino/admin/reports/performance_logging_details\" title=\"View detailed, per page, performance logs: page generation times and memory usage.\"\x3ePerformance Logs: Details\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-182\"\x3e\x3ca href=\"/camino/admin/reports/performance_logging_summary\" title=\"View summary performance logs: page generation times and memory usage.\"\x3ePerformance Logs: Summary\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-97\"\x3e\x3ca href=\"/camino/admin/reports/access-denied\" title=\"Ver los errores de \x26quot;acceso denegado\x26quot; (403).\"\x3ePrincipales errores de \x26quot;acceso denegado\x26quot;\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-98\"\x3e\x3ca href=\"/camino/admin/reports/page-not-found\" title=\"Ver los errores de \x26quot;página no encontrada\x26quot; (404).\"\x3ePrincipales errores de \x26quot;página no encontrada\x26quot;\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-189\"\x3e\x3ca href=\"/camino/admin/reports/referrers\" title=\"Ve los referentes principales.\"\x3eReferentes principales\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-185\"\x3e\x3ca href=\"/camino/admin/reports/hits\" title=\"Ve las páginas que se han visitado recientemente.\"\x3eVisitas recientes\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-188\"\x3e\x3ca href=\"/camino/admin/reports/pages\" title=\"Ve las páginas que se visitan con frecuencia.\"\x3ePáginas principales\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-190\"\x3e\x3ca href=\"/camino/admin/reports/visitors\" title=\"Ver los visitantes que visitan muchas páginas.\"\x3eVisitantes principales\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-169\"\x3e\x3ca href=\"/camino/admin/reports/settings\" title=\"Controla los detalles de qué se registra y cómo se hace en el sitio.\"\x3eOpciones del registro de acceso\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-113\"\x3e\x3ca href=\"/camino/admin/reports/updates\" title=\"Obtenga un informe de estado acerca de las actualizaciones disponibles de los módulos y temas visuales instalados.\"\x3eActualizaciones disponibles\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-48\"\x3e\x3ca href=\"/camino/admin/reports/status\" title=\"Obtiene un informe del estado de operación de su sitio y de cualquier problema detectado.\"\x3eInforme de estado\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"expanded\" id=\"simplemenu-li-588\"\x3e\x3ca name=\"menu-id-14\"\x3eRules\x3c/a\x3e\x3cul class=\"menu\" id=\"simplemenu-ul-588\"\x3e\x3cli class=\"leaf first\" id=\"simplemenu-li-594\"\x3e\x3ca href=\"/camino/admin/rules/trigger\" title=\"Customize your site by configuring rules that are evaluated on events.\"\x3eTriggered rules\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-592\"\x3e\x3ca href=\"/camino/admin/rules/rule_sets\" title=\"Create and manage rule sets.\"\x3eRule sets\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-591\"\x3e\x3ca href=\"/camino/admin/rules/ie\" title=\"Export your rules as text or import rules.\"\x3eImport / Export\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-590\"\x3e\x3ca href=\"/camino/admin/rules/forms\" title=\"Configure Rules forms events.\"\x3eForm events\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-593\"\x3e\x3ca href=\"/camino/admin/rules/settings\" title=\"Set display options, show/hide Rules messages.\"\x3eOpciones\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"leaf\" id=\"simplemenu-li-297\"\x3e\x3ca href=\"/camino/admin/advanced_help\"\x3eAdvanced help\x3c/a\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-15\"\x3e\x3ca href=\"/camino/admin/help\"\x3eAyuda\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/li\x3e\n\x3cli class=\"leaf last\" id=\"simplemenu-li-4\"\x3e\x3ca href=\"/camino/logout\"\x3eTerminar sesión\x3c/a\x3e\x3c/li\x3e\n\x3c/ul\x3e\x3c/div\x3e";
test/integration/image-component/default/pages/invalid-src.js
JeromeFitz/next.js
import React from 'react' import Image from 'next/image' const Page = () => { return ( <div> <p>Invalid Source</p> <Image src="https://google.com/test.png" width="10" height="10" /> </div> ) } export default Page
app/components/TopBar.js
cdiezmoran/AlphaStage-2.0
import React from 'react'; import { object } from 'prop-types'; import styles from './TopBar.scss'; const TopBar = ({ history }) => { const handlePrevious = () => { history.goBack(); }; return ( <div className={styles.TopBar}> <button className={styles.PrevButton} onClick={handlePrevious}> <i className="fa fa-angle-left fa-2x" /> </button> </div> ); }; TopBar.propTypes = { history: object.isRequired }; export default TopBar;
tests/layouts/CoreLayout.spec.js
realalexhomer/redux-react-todo
import React from 'react' import TestUtils from 'react-addons-test-utils' import CoreLayout from 'layouts/CoreLayout' function shallowRender (component) { const renderer = TestUtils.createRenderer() renderer.render(component) return renderer.getRenderOutput() } function renderWithProps (props = {}) { return TestUtils.renderIntoDocument(<CoreLayout {...props} />) } function shallowRenderWithProps (props = {}) { return shallowRender(<CoreLayout {...props} />) } describe('(Layout) Core', function () { let _component, _rendered, _props, _child beforeEach(function () { _child = <h1 className='child'>Child</h1> _props = { children: _child } _component = shallowRenderWithProps(_props) _rendered = renderWithProps(_props) }) it('Should render as a <div>.', function () { expect(_component.type).to.equal('div') }) it('Should render a child component.', function () { const child = TestUtils.findRenderedDOMComponentWithClass( _rendered, 'child' ) expect(child).to.exist }) })
server/dashboard/js/components/BenchLog.react.js
MrAlone/mzbench
import React from 'react'; import ReactDOM from 'react-dom'; import LogsStore from '../stores/LogsStore'; import MZBenchActions from '../actions/MZBenchActions'; import MZBenchRouter from '../utils/MZBenchRouter'; import BenchLogEntry from './BenchLogEntry.react'; import LoadingSpinner from './LoadingSpinner.react'; const LOGS_PER_PAGE = 100; class BenchLog extends React.Component { constructor(props) { super(props); this.streamId = 0; this.autoSearchHandler = null; this.filtered = 0; this.state = this._resolveState(); this.state.tempQ = this.state.form.query; this.state.tempK = this.state.form.kind; this.state.tempE = this.state.form.errors; this.state.logShown = LOGS_PER_PAGE; this.followFlag = false; this._onChange = this._onChange.bind(this); this._onChangeSearch = this._onChangeSearch.bind(this); this._onUser = this._onUser.bind(this); this._onSystem = this._onSystem.bind(this); this._onErrors = this._onErrors.bind(this); this._onScroll = this._onScroll.bind(this); this._onResize = this._onResize.bind(this); this._onFollow = this._onFollow.bind(this); this._onTop = this._onTop.bind(this); this.lastLogShown = 0; } componentDidMount() { LogsStore.onChange(this._onChange); this.streamId = LogsStore.subscribeToLogs(this.props.bench.id); window.addEventListener("scroll", this._onScroll); window.addEventListener("resize", this._onResize); ReactDOM.findDOMNode(this.refs.loglookup).focus(); this._updateFollowPos(); this._updateTopPos(); } componentWillUnmount() { LogsStore.off(this._onChange); LogsStore.unsubscribeFromLogs(this.streamId); window.removeEventListener("resize", this._onResize); window.removeEventListener("scroll", this._onScroll); } componentDidUpdate() { if (this.state.isFollow) { this.goBottom(); } this._updateFollowPos(); this._updateTopPos(); } render() { const url = '/' + (this.state.form.kind == 0 ? 'userlog' : 'log') + '?id=' + this.props.bench.id; let classUser = "btn btn-" + (this.state.form.kind == 0 ? "primary":"default"); let classSystem = "btn btn-" + (this.state.form.kind == 1 ? "primary":"default"); let classError = "btn btn-" + (this.state.form.errors == 1 ? "danger":"default"); let currentLog = this.state.form.kind == 1 ? this.state.logs.system : this.state.logs.user; let overflow = this.state.form.kind == 1 ? this.state.logs.systemOverflow : this.state.logs.userOverflow; let loaded = this.state.form.kind == 1 ? this.state.logs.isSystemLoaded : this.state.logs.isUserLoaded; let logAfterQuery = this.state.logAfterQuery; let logsToShow = (logAfterQuery.length < this.state.logShown) ? logAfterQuery.length : this.state.logShown; this.lastLogShown = logsToShow; return ( <div> <form className="form-inline log-lookup-form"> <div className="input-group col-xs-4"> <div className="input-group-addon"><span className="glyphicon glyphicon-search" aria-hidden="true"></span></div> <input ref="loglookup" type="text" className="form-control" onKeyDown={this._onKeyDown.bind(this)} onChange={this._onChangeSearch} value={this.state.tempQ} placeholder="Lookup Logs" /> </div> <div className="btn-group" role="group"> <button type="button" className={classUser} onClick={this._onUser}>User</button> <button type="button" className={classSystem} onClick={this._onSystem}>System</button> </div> <button type="button" className={classError} onClick={this._onErrors}>Errors only</button> </form> { !loaded ? (<LoadingSpinner>Loading...</LoadingSpinner>) : <div> <div className="top-raw-fixed" ref="followdiv"> <span className="btn-raw"> <a href={url} target="_blank">Raw log</a> </span> <span className="btn-raw btn-bottom" style={{fontWeight: this.state.isFollow && this.props.isBenchActive ? 'bold' : 'normal'}} ref="followbtn"> <a href="#" onClick={this._onFollow}>{this.props.isBenchActive ? "Follow log" : "Scroll to end"}</a> </span> </div> <div className="bottom-raw-fixed" ref="topbtn"> <span className="btn-raw btn-top"> <a href="#" onClick={this._onTop}>Top</a> </span> </div> <div className="log-window" ref="logwindow"> <table className="table table-striped table-logs"> <tbody> {overflow ? <tr className="warning"><td>Warning: due to big size, this log is trimmed</td></tr> : null} {!currentLog.length ? <tr className="warning"><td>Warning: this log is empty</td></tr> : (!logAfterQuery.length ? <tr className="warning"><td>Query not found</td></tr> : null)} </tbody> </table> {this.formatLogs(logsToShow, logAfterQuery)} </div> </div> } </div> ); } formatLogs(logsToShow, log) { let nPages = Math.round(logsToShow / LOGS_PER_PAGE) + 1; let form = this.state.form; let prefix = form.kind + "-" + form.errors + "-" + form.query + "-"; let res = []; for (var page = 0; page < nPages; page++) { res.push(<BenchLogEntry key={prefix + page} log={log} from={page*LOGS_PER_PAGE} to={(page + 1)*LOGS_PER_PAGE} query={this.state.form.query}/>); } return res; } filterLogs(form, logs, needRefilter) { let filtered = (needRefilter || !this.state) ? 0 : this.filtered; var logAfterQuery = (needRefilter || !this.state) ? [] : this.state.logAfterQuery; let currentLog = form.kind == 1 ? logs.system : logs.user; let query = form.query; let errors = form.errors; if (needRefilter) this.lastLogShown = 0; if (!query && !errors) { this.filtered = currentLog.length; return currentLog; } for (; filtered < currentLog.length; filtered++) { let line = currentLog[filtered]; if (!line) break; if (query) { let fullText = line.time + " " + line.severity + " " + line.text; if (fullText.indexOf(query) == -1) continue; } if (errors && line.severity!="[error]") continue; logAfterQuery.push(line); }; this.filtered = filtered; return logAfterQuery; } _onScroll(scrollEvent) { this._updateFollowPos(); this._updateTopPos(); if (this.updatePage()) return; if (this.followFlag) { this.followFlag = false; } else if(this.state.isFollow) { this.setState({isFollow: false}); } } _onResize(resizeEvent) { this._updateFollowPos(); this._updateTopPos(); } _updateFollowPos() { let logElement = ReactDOM.findDOMNode(this.refs.logwindow); if (!logElement) return; var rect = logElement.getBoundingClientRect(); let top = (rect.top > 0) ? rect.top : 0; let right = (window.innerWidth - rect.right); let followDiv = ReactDOM.findDOMNode(this.refs.followdiv); followDiv.style.top = top + 'px'; followDiv.style.right = right + 'px'; let followBtn = ReactDOM.findDOMNode(this.refs.followbtn); let visible = document.body.scrollHeight > window.innerHeight; followBtn.style.visibility = visible ? "visible" : "hidden"; } _updateTopPos() { let logElement = ReactDOM.findDOMNode(this.refs.logwindow); if (!logElement) return; var rect = logElement.getBoundingClientRect(); let right = (window.innerWidth - rect.right); let topBtn = ReactDOM.findDOMNode(this.refs.topbtn); topBtn.style.visibility = (document.body.scrollTop > 0 ? 'visible' : 'hidden'); topBtn.style.right = right + 'px'; } _resolveState() { let currentState = this.state ? this.state : {form: {query: "", kind: 0, errors: 0}, logAfterQuery: [], isFollow: false}; let newForm = LogsStore.getQueryData(this.props.bench.id); let needRefilter = (!currentState.form || currentState.form.query != newForm.query || currentState.form.kind != newForm.kind || currentState.form.errors != newForm.errors); currentState.form.kind = newForm.kind; currentState.form.query = newForm.query; currentState.form.errors = newForm.errors; currentState.logs = LogsStore.getLogData(this.streamId); currentState.logAfterQuery = this.filterLogs(newForm, currentState.logs, needRefilter); return currentState; } _onChange() { this.setState(this._resolveState()); if (this.state.isFollow) this.updatePage(); } _runSearch() { this.state.logShown = LOGS_PER_PAGE; if (this.autoSearchHandler) { clearTimeout(this.autoSearchHandler); } MZBenchRouter.navigate("/bench/" + this.props.bench.id + "/logs/" + (this.state.tempK ? "system": "user") + "/" + (this.state.tempE ? "errors": "all") + (this.state.tempQ ? "/" + encodeURIComponent(this.state.tempQ).replace(/'/g, "%27") : ""), {}); } _onKeyDown(event) { if (event.key === 'Enter') { event.preventDefault(); this._runSearch(); } } _onChangeSearch(event) { let state = this.state; if (this.autoSearchHandler) { clearTimeout(this.autoSearchHandler); } state.tempQ = event.target.value; this.setState(state); this.autoSearchHandler = setTimeout(() => this._runSearch(), this.props.autoSearchInterval); } _onUser() { this.state.tempK = 0; ReactDOM.findDOMNode(this.refs.loglookup).focus(); this._runSearch(); } _onSystem() { this.state.tempK = 1; ReactDOM.findDOMNode(this.refs.loglookup).focus(); this._runSearch(); } _onFollow(event) { event.preventDefault(); this.setState({isFollow: !this.state.isFollow}); let logLen = this.state.logAfterQuery.length; if (this.state.logShown < logLen) { this.setState({logShown: logLen}); } if (this.state.isFollow) this.goBottom(); } _onTop(event) { event.preventDefault(); this.setState({isFollow: false}); ReactDOM.findDOMNode(this.refs.loglookup).focus(); this.goTop(); } _onErrors() { this.state.tempE = !this.state.tempE; ReactDOM.findDOMNode(this.refs.loglookup).focus(); this._runSearch(); } goBottom() { var newValue = document.body.scrollHeight - window.innerHeight; if (document.body.scrollTop < newValue) { document.body.scrollTop = newValue; this.followFlag = true; } } goTop() { document.body.scrollTop = 0; } updatePage () { let node = document.body; var shouldIncrementPage = (node.scrollTop + window.innerHeight + 2000 > node.scrollHeight); let endReached = (this.state.logAfterQuery.length <= this.state.logShown); if (shouldIncrementPage && !endReached) { this.setState({logShown: this.state.logShown + LOGS_PER_PAGE}); return true; } return false; } }; BenchLog.propTypes = { bench: React.PropTypes.object.isRequired, autoSearchInterval: React.PropTypes.number }; BenchLog.defaultProps = { autoSearchInterval: 500 }; export default BenchLog;
src/renderer/index.js
BeatPlus/Protonmail
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { hot } from 'react-hot-loader'; import store from './store'; import App from './containers/App'; import './styles/base.scss'; let AppComponent; if (module.hot) { AppComponent = hot(module)(App); } else { AppComponent = App; } ReactDOM.render( <Provider store={store}> <AppComponent /> </Provider>, document.getElementById('root') );
source/client/js/views/filter.js
singggum3b/meteor-gulp-seed
//==================FLUX========================= var Reactor = require("client/js/reactor.js"); var Store = require("client/js/store"); //=========================================== var Button = require("client/js/components/button"); var Field = require("client/js/components/field"); var Filter = React.createClass({ displayName: "Filter", propTypes: { target: React.PropTypes.oneOf(["news", "drivers", "calendar", "suggestionDrivers"]).isRequired, title: React.PropTypes.string, type: React.PropTypes.string, placeholder: React.PropTypes.string, controlType: React.PropTypes.oneOf(["select", "text", "customSelect", "alphabet"]), disable: React.PropTypes.bool, lazy: React.PropTypes.bool, require: React.PropTypes.array, onKeyUp: React.PropTypes.func, extra: React.PropTypes.object }, getDefaultProps() { return { controlType: "select", action: "filter" } }, getInitialState() { return { isExpanded: false } }, mixins: [Reactor.ReactMixin], getDataBindings() { return { [this.props.target]: Store.getters[this.props.target] } }, onKeyUp(e) { this.props.onKeyUp && this.props.onKeyUp(e); }, filter(id, activeValue, formattedVal, isValidated) { this.setState({ isExpanded: false }); (activeValue != this.state[this.props.target].getIn(["meta", this.props.type + "Filter"])) && Store.actions[this.props.action](this.props.target, this.props.type, activeValue, this.state[this.props.target].get("meta").toJS(), this.props.lazy, this.props.require, this.props.extra); }, toggleFilter(isOpen) { this.setState({ isExpanded: !this.state.isExpanded }); }, buildComponent(props, state) { //console.log(state[props.target].get("meta").toJS()); return mdx(props.controlType, { "alphabet": ()=> { let alphabet = Immutable.fromJS("abcdefghijklmnopqrstuvwxyz".split("")) .map((char)=>Immutable.fromJS({title: char, value: char})) .unshift(Immutable.fromJS({title: "All", value: ""})); return ( <div className="v-filter v-filter--alphabet"> { alphabet.map((filter, index)=> { let _className = cx({ "item": true, "active": state[props.target].getIn(["meta", props.type + "Filter"]) == filter.get("value") }); return <span key={filter.get("title")} className={_className} onClick={()=>this.filter(null,filter.get("value"))}>{filter.get("title")}</span> }) } </div> ) }, "select": ()=> { return ( <Field className="v-filter" id={`${props.target}_${props.type}`} onChange={this.filter} type="select" value={state[props.target].getIn(["meta","filter",props.type])} defaultValue={state[props.target].getIn(["meta",props.type + "Filter"])}></Field> ) }, "text": ()=> { return ( <Field className="v-filter" id={`${props.target}_${props.type}`} placeholder={props.placeholder} onChange={this.filter} onKeyUp={props.onKeyUp} type="text" value={state[props.target].getIn(["meta",props.type + "Filter"])} defaultValue={state[props.target].getIn(["meta",props.type + "Filter"])}></Field> ) }, "customSelect": ()=> { let _list, _activeValue, _activeTitle; try { _list = state[props.target].getIn(["meta", "filter", props.type]).map((item, index)=> { return Immutable.fromJS({ title: item.get("title"), onClick: ()=> { this.filter(null, item.get("value")); this.setState({ isExpanded: false }); } }); }); _activeValue = state[props.target].getIn(["meta", props.type + "Filter"]); _activeTitle = state[props.target].getIn(["meta", "filter", props.type]).find((filter)=>filter.get("value") == _activeValue); _activeTitle = _activeTitle ? _activeTitle.get("title") : "No value selected"; //console.log(state[props.target].getIn(["meta"]).toJS()); } catch (e) { console.warn(`Failed to generate [${props.target + props.type}] filter data`); } return _list ? ( <Button className="v-filter b-dropdown" mode="text" disable={props.disable} preventDefault={false} title={_activeTitle} active={state.isExpanded} showList={true} onClick={this.toggleFilter} list={_list}/> ) : null; } }); }, render() { return this.buildComponent(this.props, this.state) } }); module.exports = Filter;
src/Link.js
lzcmaro/react-ratchet
import React from 'react'; // import ReactDOM from 'react-dom'; import classNames from 'classnames'; import ratchetUtils from './utils/ratchetUtils'; // import Ajax from './utils/ajax'; // import getContainer from './utils/getContainer'; // import ownerDocument from './utils/ownerDocument'; // import {transform} from 'babel-core'; // import presetEs2015 from 'babel-preset-es2015'; // import presetReact from 'babel-preset-react'; let Link = React.createClass ({ propTypes: { href: React.PropTypes.string, icon: React.PropTypes.string, left: React.PropTypes.bool, right: React.PropTypes.bool }, getDefaultProps() { return{ ratClass: 'link', left: false, right: false }; }, render() { let classes = ratchetUtils.getClassSet( this.props ), iconProps = {ratClass: 'icon', ratStyle: this.props.icon}, iconClasses = this.props.icon ? ratchetUtils.getClassSet( iconProps ) : {}, leftClass = 'pull-left', rightClass = 'pull-right', href = this.props.href || 'javascript:;'; Object.assign( classes, iconClasses ); classes = { ...classes, [leftClass]: this.props.left, [rightClass]: this.props.right }; return ( <a { ...this.props } href = { href } className = { classNames(classes, this.props.className) } onTouchEnd={this.handleTouch}> { this.props.children } </a> ) }, handleTouch(event) { let push = this.props.push; if( !push || !push.href ){ this.props.onTouchEnd && this.props.onTouchEnd() return; } event.preventDefault(); event.stopPropagation(); this.onPush( push ) }, onPush(options) { // Ajax.ajax({ // url: options.href, // dataType: 'html', // success: (...args) => this.renderPage(options, ...args) // }); }, renderPage(options, html) { // const React = require('react'); // const ReactDOM = require('react-dom'); // const ReactDOMServer = require('react-dom/server'); // //components // const NavBar = require('./NavBar').default; // const NavButton = require('./NavButton').default; // const TabBar = require('./TabBar').default; // const StandardBar = require('./StandardBar').default; // const SegmentedControl = require('./SegmentedControl').default; // // const Link = require('./Link').default; // const Form = require('./Form').default; // const FormButton = require('./FormButton').default; // const Input = require('./Input').default; // const List = require('./List').default; // const ListItem = require('./ListItem').default; // const Card = require('./Card').default; // const Media = require('./Media').default; // const Button = require('./Button').default; // const Toggle = require('./Toggle').default; // const Badge = require('./Badge').default; // const Icon = require('./Icon').default; // const NavPopover = require('./NavPopover').default; // const Modal = require('./Modal').default; // const Slider = require('./Slider').default; // const SliderItem = require('./SliderItem').default; // let doc = ownerDocument(this); // let container = getContainer(options.container, doc.body); // //普通html页面,直接append // if (/<html/i.test(html)) { // this.appendTo( html, container ); // return; // } // // For the initial render, we can hijack React.render to intercept the // // example element and render it normally. This is safe because it's code // // that we supply, so we can ensure ahead of time that it won't throw an // // exception while rendering. // const originalRender = ReactDOM.render; // try { // const compiledCode = transform( html,{ // presets: [presetReact] // }).code; // //获取要render的element // ReactDOM.render = (element) => this._element = element; // eval(compiledCode); // //不直接渲染到container,这样会使原来的节点被删除 // // let div = doc.createElement('div'); // // div = doc.body.appendChild( div ); // //ReactDOM.render( this._element, div ); // // div.innerHTML = ReactDOMServer.renderToString( this._element ); // // this.appendTo( div.childNodes[0], container ); // } catch(e){ // throw e; // } finally { // ReactDOM.render = originalRender; // } // let div = doc.createElement('div'); // // // // ReactDOM.unstable_renderSubtreeIntoContainer( this, this._element, div ); // //无法删除该节点 // //React.unmountComponentAtNode( container ); // ReactDOM.render( this._element, div ); // //container在外面传过来的时候,可能直接使用了this,这样会导致它指向了前面创建的div,在render时,层级会越来越多 // container.insertBefore( div, container.childNodes[0] ); // this.removeChildNodes( container ); }, appendTo(dom, container){ let doc = ownerDocument(this); container.insertBefore( dom, container.childNodes[0] ); this.removeChildNodes( container ); }, removeChildNodes(container) { let first = container.childNodes[0]; while (first.nextSibling !== null) { container.removeChild( first.nextSibling ); } } }); export default Link;
extensions/amp-timeago/1.0/amp-timeago.js
alanorozco/amphtml
import {isExperimentOn} from '#experiments'; import {AmpPreactBaseElement, setSuperClass} from '#preact/amp-base-element'; import {userAssert} from '#utils/log'; import {BaseElement} from './base-element'; /** @const {string} */ const TAG = 'amp-timeago'; class AmpTimeago extends setSuperClass(BaseElement, AmpPreactBaseElement) { /** @override */ isLayoutSupported(layout) { userAssert( isExperimentOn(this.win, 'bento') || isExperimentOn(this.win, 'bento-timeago'), 'expected global "bento" or specific "bento-timeago" experiment to be enabled' ); return super.isLayoutSupported(layout); } } AMP.extension(TAG, '1.0', (AMP) => { AMP.registerElement(TAG, AmpTimeago); });
wp-content/plugins/post-thumbnail-editor/apps/jcrop/js/jquery.min.js
roycocup/enclothed
/*! jQuery v1.9.0 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */(function(e,t){"use strict";function n(e){var t=e.length,n=st.type(e);return st.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(cn[0].contentWindow||cn[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=A(e,t),cn.detach()),bn[e]=n),n}function A(e,t){var n=st(t.createElement(e)).appendTo(t.body),r=st.css(n[0],"display");return n.remove(),r}function j(e,t,n,r){var i;if(st.isArray(t))st.each(t,function(t,i){n||kn.test(e)?r(e,i):j(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==st.type(t))r(e,t);else for(i in t)j(e+"["+i+"]",t[i],n,r)}function D(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(lt)||[];if(st.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function L(e,n,r,i){function o(u){var l;return a[u]=!0,st.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||s||a[c]?s?!(l=c):t:(n.dataTypes.unshift(c),o(c),!1)}),l}var a={},s=e===$n;return o(n.dataTypes[0])||!a["*"]&&o("*")}function H(e,n){var r,i,o=st.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);return i&&st.extend(!0,e,i),e}function M(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(o in c)o in r&&(n[c[o]]=r[o]);for(;"*"===l[0];)l.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){l.unshift(o);break}if(l[0]in r)a=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function q(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=u[++s];)if("*"!==i){if("*"!==l&&l!==i){if(n=a[l+" "+i]||a["* "+i],!n)for(r in a)if(o=r.split(" "),o[1]===i&&(n=a[l+" "+o[0]]||a["* "+o[0]])){n===!0?n=a[r]:a[r]!==!0&&(i=o[0],u.splice(s--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(c){return{state:"parsererror",error:n?c:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function _(){try{return new e.XMLHttpRequest}catch(t){}}function F(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function O(){return setTimeout(function(){Qn=t}),Qn=st.now()}function B(e,t){st.each(t,function(t,n){for(var r=(rr[t]||[]).concat(rr["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function P(e,t,n){var r,i,o=0,a=nr.length,s=st.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Qn||O(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:st.extend({},t),opts:st.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Qn||O(),duration:n.duration,tweens:[],createTween:function(t,n){var r=st.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(R(c,l.opts.specialEasing);a>o;o++)if(r=nr[o].call(l,e,c,l.opts))return r;return B(l,c),st.isFunction(l.opts.start)&&l.opts.start.call(e,l),st.fx.timer(st.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function R(e,t){var n,r,i,o,a;for(n in e)if(r=st.camelCase(n),i=t[r],o=e[n],st.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=st.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function W(e,t,n){var r,i,o,a,s,u,l,c,f,p=this,d=e.style,h={},g=[],m=e.nodeType&&w(e);n.queue||(c=st._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,st.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===st.css(e,"display")&&"none"===st.css(e,"float")&&(st.support.inlineBlockNeedsLayout&&"inline"!==S(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",st.support.shrinkWrapBlocks||p.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Zn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=st._data(e,"fxshow")||st._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?st(e).show():p.done(function(){st(e).hide()}),p.done(function(){var t;st._removeData(e,"fxshow");for(t in h)st.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],l=p.createTween(i,m?s[i]:0),h[i]=s[i]||st.style(e,i),i in s||(s[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function $(e,t,n,r,i){return new $.prototype.init(e,t,n,r,i)}function I(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=wn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function z(e){return st.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var X,U,V=e.document,Y=e.location,J=e.jQuery,G=e.$,Q={},K=[],Z="1.9.0",et=K.concat,tt=K.push,nt=K.slice,rt=K.indexOf,it=Q.toString,ot=Q.hasOwnProperty,at=Z.trim,st=function(e,t){return new st.fn.init(e,t,X)},ut=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=/\S+/g,ct=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ft=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,pt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,dt=/^[\],:{}\s]*$/,ht=/(?:^|:|,)(?:\s*\[)+/g,gt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,mt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,yt=/^-ms-/,vt=/-([\da-z])/gi,bt=function(e,t){return t.toUpperCase()},xt=function(){V.addEventListener?(V.removeEventListener("DOMContentLoaded",xt,!1),st.ready()):"complete"===V.readyState&&(V.detachEvent("onreadystatechange",xt),st.ready())};st.fn=st.prototype={jquery:Z,constructor:st,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ft.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof st?n[0]:n,st.merge(this,st.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:V,!0)),pt.test(i[1])&&st.isPlainObject(n))for(i in n)st.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=V.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=V,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):st.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),st.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return nt.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=st.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return st.each(this,e,t)},ready:function(e){return st.ready.promise().done(e),this},slice:function(){return this.pushStack(nt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(st.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:tt,sort:[].sort,splice:[].splice},st.fn.init.prototype=st.fn,st.extend=st.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||st.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(e=arguments[u]))for(n in e)r=s[n],i=e[n],s!==i&&(c&&i&&(st.isPlainObject(i)||(o=st.isArray(i)))?(o?(o=!1,a=r&&st.isArray(r)?r:[]):a=r&&st.isPlainObject(r)?r:{},s[n]=st.extend(c,a,i)):i!==t&&(s[n]=i));return s},st.extend({noConflict:function(t){return e.$===st&&(e.$=G),t&&e.jQuery===st&&(e.jQuery=J),st},isReady:!1,readyWait:1,holdReady:function(e){e?st.readyWait++:st.ready(!0)},ready:function(e){if(e===!0?!--st.readyWait:!st.isReady){if(!V.body)return setTimeout(st.ready);st.isReady=!0,e!==!0&&--st.readyWait>0||(U.resolveWith(V,[st]),st.fn.trigger&&st(V).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===st.type(e)},isArray:Array.isArray||function(e){return"array"===st.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Q[it.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==st.type(e)||e.nodeType||st.isWindow(e))return!1;try{if(e.constructor&&!ot.call(e,"constructor")&&!ot.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||ot.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||V;var r=pt.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=st.buildFragment([e],t,i),i&&st(i).remove(),st.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=st.trim(n),n&&dt.test(n.replace(gt,"@").replace(mt,"]").replace(ht,"")))?Function("return "+n)():(st.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||st.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&st.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(yt,"ms-").replace(vt,bt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var i,o=0,a=e.length,s=n(e);if(r){if(s)for(;a>o&&(i=t.apply(e[o],r),i!==!1);o++);else for(o in e)if(i=t.apply(e[o],r),i===!1)break}else if(s)for(;a>o&&(i=t.call(e[o],o,e[o]),i!==!1);o++);else for(o in e)if(i=t.call(e[o],o,e[o]),i===!1)break;return e},trim:at&&!at.call("\ufeff\u00a0")?function(e){return null==e?"":at.call(e)}:function(e){return null==e?"":(e+"").replace(ct,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?st.merge(r,"string"==typeof e?[e]:e):tt.call(r,e)),r},inArray:function(e,t,n){var r;if(t){if(rt)return rt.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,r){var i,o=0,a=e.length,s=n(e),u=[];if(s)for(;a>o;o++)i=t(e[o],o,r),null!=i&&(u[u.length]=i);else for(o in e)i=t(e[o],o,r),null!=i&&(u[u.length]=i);return et.apply([],u)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),st.isFunction(e)?(i=nt.call(arguments,2),o=function(){return e.apply(n||this,i.concat(nt.call(arguments)))},o.guid=e.guid=e.guid||st.guid++,o):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===st.type(r)){o=!0;for(u in r)st.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,st.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(st(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),st.ready.promise=function(t){if(!U)if(U=st.Deferred(),"complete"===V.readyState)setTimeout(st.ready);else if(V.addEventListener)V.addEventListener("DOMContentLoaded",xt,!1),e.addEventListener("load",st.ready,!1);else{V.attachEvent("onreadystatechange",xt),e.attachEvent("onload",st.ready);var n=!1;try{n=null==e.frameElement&&V.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!st.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}st.ready()}}()}return U.promise(t)},st.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Q["[object "+t+"]"]=t.toLowerCase()}),X=st(V);var Tt={};st.Callbacks=function(e){e="string"==typeof e?Tt[e]||r(e):st.extend({},e);var n,i,o,a,s,u,l=[],c=!e.once&&[],f=function(t){for(n=e.memory&&t,i=!0,u=a||0,a=0,s=l.length,o=!0;l&&s>u;u++)if(l[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,l&&(c?c.length&&f(c.shift()):n?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function r(t){st.each(t,function(t,n){var i=st.type(n);"function"===i?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==i&&r(n)})})(arguments),o?s=l.length:n&&(a=t,f(n))}return this},remove:function(){return l&&st.each(arguments,function(e,t){for(var n;(n=st.inArray(t,l,n))>-1;)l.splice(n,1),o&&(s>=n&&s--,u>=n&&u--)}),this},has:function(e){return st.inArray(e,l)>-1},empty:function(){return l=[],this},disable:function(){return l=c=n=t,this},disabled:function(){return!l},lock:function(){return c=t,n||p.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!c||(o?c.push(t):f(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},st.extend({Deferred:function(e){var t=[["resolve","done",st.Callbacks("once memory"),"resolved"],["reject","fail",st.Callbacks("once memory"),"rejected"],["notify","progress",st.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return st.Deferred(function(n){st.each(t,function(t,o){var a=o[0],s=st.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&st.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?st.extend(e,r):r}},i={};return r.pipe=r.then,st.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=nt.call(arguments),a=o.length,s=1!==a||e&&st.isFunction(e.promise)?a:0,u=1===s?e:st.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?nt.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&st.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(u.reject).progress(l(i,n,t)):--s;return s||u.resolveWith(r,o),u.promise()}}),st.support=function(){var n,r,i,o,a,s,u,l,c,f,p=V.createElement("div");if(p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=p.getElementsByTagName("*"),i=p.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=V.createElement("select"),a=o.appendChild(V.createElement("option")),s=p.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={getSetAttribute:"t"!==p.className,leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:!!s.value,optSelected:a.selected,enctype:!!V.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==V.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===V.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete p.test}catch(d){n.deleteExpando=!1}s=V.createElement("input"),s.setAttribute("value",""),n.input=""===s.getAttribute("value"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","t"),s.setAttribute("name","t"),u=V.createDocumentFragment(),u.appendChild(s),n.appendChecked=s.checked,n.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){n.noCloneEvent=!1}),p.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+f,"t"),n[f+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",n.clearCloneStyle="content-box"===p.style.backgroundClip,st(function(){var r,i,o,a="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",s=V.getElementsByTagName("body")[0];s&&(r=V.createElement("div"),r.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",s.appendChild(r).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=c&&0===o[0].offsetHeight,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===p.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==s.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(p,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(p,null)||{width:"4px"}).width,i=p.appendChild(V.createElement("div")),i.style.cssText=p.style.cssText=a,i.style.marginRight=i.style.width="0",p.style.width="1px",n.reliableMarginRight=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight)),p.style.zoom!==t&&(p.innerHTML="",p.style.cssText=a+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===p.offsetWidth,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==p.offsetWidth,s.style.zoom=1),s.removeChild(r),r=p=o=i=null)}),r=o=u=a=i=s=null,n}();var wt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Nt=/([A-Z])/g;st.extend({cache:{},expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?st.cache[e[st.expando]]:e[st.expando],!!e&&!s(e)},data:function(e,t,n){return i(e,t,n,!1)},removeData:function(e,t){return o(e,t,!1)},_data:function(e,t,n){return i(e,t,n,!0)},_removeData:function(e,t){return o(e,t,!0)},acceptData:function(e){var t=e.nodeName&&st.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),st.fn.extend({data:function(e,n){var r,i,o=this[0],s=0,u=null;if(e===t){if(this.length&&(u=st.data(o),1===o.nodeType&&!st._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>s;s++)i=r[s].name,i.indexOf("data-")||(i=st.camelCase(i.substring(5)),a(o,i,u[i]));st._data(o,"parsedAttrs",!0)}return u}return"object"==typeof e?this.each(function(){st.data(this,e)}):st.access(this,function(n){return n===t?o?a(o,e,st.data(o,e)):null:(this.each(function(){st.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){st.removeData(this,e)})}}),st.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=st._data(e,n),r&&(!i||st.isArray(r)?i=st._data(e,n,st.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=st.queue(e,t),r=n.length,i=n.shift(),o=st._queueHooks(e,t),a=function(){st.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return st._data(e,n)||st._data(e,n,{empty:st.Callbacks("once memory").add(function(){st._removeData(e,t+"queue"),st._removeData(e,n)})})}}),st.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?st.queue(this[0],e):n===t?this:this.each(function(){var t=st.queue(this,e,n);st._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&st.dequeue(this,e)})},dequeue:function(e){return this.each(function(){st.dequeue(this,e)})},delay:function(e,t){return e=st.fx?st.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=st.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=st._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var Ct,kt,Et=/[\t\r\n]/g,St=/\r/g,At=/^(?:input|select|textarea|button|object)$/i,jt=/^(?:a|area)$/i,Dt=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Lt=/^(?:checked|selected)$/i,Ht=st.support.getSetAttribute,Mt=st.support.input;st.fn.extend({attr:function(e,t){return st.access(this,st.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){st.removeAttr(this,e)})},prop:function(e,t){return st.access(this,st.prop,e,t,arguments.length>1)},removeProp:function(e){return e=st.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=st.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?st.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return st.isFunction(e)?this.each(function(n){st(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=st(this),s=t,u=e.match(lt)||[];i=u[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&st._data(this,"__className__",this.className),this.className=this.className||e===!1?"":st._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Et," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=st.isFunction(e),this.each(function(r){var o,a=st(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":st.isArray(o)&&(o=st.map(o,function(e){return null==e?"":e+""})),n=st.valHooks[this.type]||st.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=st.valHooks[o.type]||st.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(St,""):null==r?"":r)}}}),st.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(st.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&st.nodeName(n.parentNode,"optgroup"))){if(t=st(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=st.makeArray(t);return st(e).find("option").each(function(){this.selected=st.inArray(st(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return e.getAttribute===t?st.prop(e,n,r):(a=1!==s||!st.isXMLDoc(e),a&&(n=n.toLowerCase(),o=st.attrHooks[n]||(Dt.test(n)?kt:Ct)),r===t?o&&a&&"get"in o&&null!==(i=o.get(e,n))?i:(e.getAttribute!==t&&(i=e.getAttribute(n)),null==i?t:i):null!==r?o&&a&&"set"in o&&(i=o.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):(st.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(lt);if(o&&1===e.nodeType)for(;n=o[i++];)r=st.propFix[n]||n,Dt.test(n)?!Ht&&Lt.test(n)?e[st.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:st.attr(e,n,""),e.removeAttribute(Ht?n:r)},attrHooks:{type:{set:function(e,t){if(!st.support.radioValue&&"radio"===t&&st.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!st.isXMLDoc(e),a&&(n=st.propFix[n]||n,o=st.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):At.test(e.nodeName)||jt.test(e.nodeName)&&e.href?0:t}}}}),kt={get:function(e,n){var r=st.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?Mt&&Ht?null!=i:Lt.test(n)?e[st.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?st.removeAttr(e,n):Mt&&Ht||!Lt.test(n)?e.setAttribute(!Ht&&st.propFix[n]||n,n):e[st.camelCase("default-"+n)]=e[n]=!0,n}},Mt&&Ht||(st.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return st.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t },set:function(e,n,r){return st.nodeName(e,"input")?(e.defaultValue=n,t):Ct&&Ct.set(e,n,r)}}),Ht||(Ct=st.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},st.attrHooks.contenteditable={get:Ct.get,set:function(e,t,n){Ct.set(e,""===t?!1:t,n)}},st.each(["width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),st.support.hrefNormalized||(st.each(["href","src","width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),st.each(["href","src"],function(e,t){st.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),st.support.style||(st.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),st.support.optSelected||(st.propHooks.selected=st.extend(st.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),st.support.enctype||(st.propFix.enctype="encoding"),st.support.checkOn||st.each(["radio","checkbox"],function(){st.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),st.each(["radio","checkbox"],function(){st.valHooks[this]=st.extend(st.valHooks[this],{set:function(e,n){return st.isArray(n)?e.checked=st.inArray(st(e).val(),n)>=0:t}})});var qt=/^(?:input|select|textarea)$/i,_t=/^key/,Ft=/^(?:mouse|contextmenu)|click/,Ot=/^(?:focusinfocus|focusoutblur)$/,Bt=/^([^.]*)(?:\.(.+)|)$/;st.event={global:{},add:function(e,n,r,i,o){var a,s,u,l,c,f,p,d,h,g,m,y=3!==e.nodeType&&8!==e.nodeType&&st._data(e);if(y){for(r.handler&&(a=r,r=a.handler,o=a.selector),r.guid||(r.guid=st.guid++),(l=y.events)||(l=y.events={}),(s=y.handle)||(s=y.handle=function(e){return st===t||e&&st.event.triggered===e.type?t:st.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=(n||"").match(lt)||[""],c=n.length;c--;)u=Bt.exec(n[c])||[],h=m=u[1],g=(u[2]||"").split(".").sort(),p=st.event.special[h]||{},h=(o?p.delegateType:p.bindType)||h,p=st.event.special[h]||{},f=st.extend({type:h,origType:m,data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&st.expr.match.needsContext.test(o),namespace:g.join(".")},a),(d=l[h])||(d=l[h]=[],d.delegateCount=0,p.setup&&p.setup.call(e,i,g,s)!==!1||(e.addEventListener?e.addEventListener(h,s,!1):e.attachEvent&&e.attachEvent("on"+h,s))),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,f):d.push(f),st.event.global[h]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,m=st.hasData(e)&&st._data(e);if(m&&(u=m.events)){for(t=(t||"").match(lt)||[""],l=t.length;l--;)if(s=Bt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(f=st.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&f.teardown.call(e,h,m.handle)!==!1||st.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)st.event.remove(e,d+t[l],n,r,!0);st.isEmptyObject(u)&&(delete m.handle,st._removeData(e,"events"))}},trigger:function(n,r,i,o){var a,s,u,l,c,f,p,d=[i||V],h=n.type||n,g=n.namespace?n.namespace.split("."):[];if(s=u=i=i||V,3!==i.nodeType&&8!==i.nodeType&&!Ot.test(h+st.event.triggered)&&(h.indexOf(".")>=0&&(g=h.split("."),h=g.shift(),g.sort()),c=0>h.indexOf(":")&&"on"+h,n=n[st.expando]?n:new st.Event(h,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=g.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:st.makeArray(r,[n]),p=st.event.special[h]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!st.isWindow(i)){for(l=p.delegateType||h,Ot.test(l+h)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(i.ownerDocument||V)&&d.push(u.defaultView||u.parentWindow||e)}for(a=0;(s=d[a++])&&!n.isPropagationStopped();)n.type=a>1?l:p.bindType||h,f=(st._data(s,"events")||{})[n.type]&&st._data(s,"handle"),f&&f.apply(s,r),f=c&&s[c],f&&st.acceptData(s)&&f.apply&&f.apply(s,r)===!1&&n.preventDefault();if(n.type=h,!(o||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===h&&st.nodeName(i,"a")||!st.acceptData(i)||!c||!i[h]||st.isWindow(i))){u=i[c],u&&(i[c]=null),st.event.triggered=h;try{i[h]()}catch(m){}st.event.triggered=t,u&&(i[c]=u)}return n.result}},dispatch:function(e){e=st.event.fix(e);var n,r,i,o,a,s=[],u=nt.call(arguments),l=(st._data(this,"events")||{})[e.type]||[],c=st.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=st.event.handlers.call(this,e,l),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,r=0;(a=o.handlers[r++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,i=((st.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u),i!==t&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(i=[],r=0;u>r;r++)a=n[r],o=a.selector+" ",i[o]===t&&(i[o]=a.needsContext?st(o,this).index(l)>=0:st.find(o,this,null,[l]).length),i[o]&&i.push(a);i.length&&s.push({elem:l,handlers:i})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[st.expando])return e;var t,n,r=e,i=st.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=new st.Event(r),t=o.length;t--;)n=o[t],e[n]=r[n];return e.target||(e.target=r.srcElement||V),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},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(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||V,i=r.documentElement,o=r.body,e.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return st.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==V.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===V.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=st.extend(new st.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?st.event.trigger(i,null,t):st.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},st.removeEvent=V.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var i="on"+n;e.detachEvent&&(e[i]===t&&(e[i]=null),e.detachEvent(i,r))},st.Event=function(e,n){return this instanceof st.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?u:l):this.type=e,n&&st.extend(this,n),this.timeStamp=e&&e.timeStamp||st.now(),this[st.expando]=!0,t):new st.Event(e,n)},st.Event.prototype={isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=u,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=u,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u,this.stopPropagation()}},st.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){st.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!st.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),st.support.submitBubbles||(st.event.special.submit={setup:function(){return st.nodeName(this,"form")?!1:(st.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=st.nodeName(n,"input")||st.nodeName(n,"button")?n.form:t;r&&!st._data(r,"submitBubbles")&&(st.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),st._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&st.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return st.nodeName(this,"form")?!1:(st.event.remove(this,"._submit"),t)}}),st.support.changeBubbles||(st.event.special.change={setup:function(){return qt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(st.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),st.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),st.event.simulate("change",this,e,!0)})),!1):(st.event.add(this,"beforeactivate._change",function(e){var t=e.target;qt.test(t.nodeName)&&!st._data(t,"changeBubbles")&&(st.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||st.event.simulate("change",this.parentNode,e,!0)}),st._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return st.event.remove(this,"._change"),!qt.test(this.nodeName)}}),st.support.focusinBubbles||st.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){st.event.simulate(t,e.target,st.event.fix(e),!0)};st.event.special[t]={setup:function(){0===n++&&V.addEventListener(e,r,!0)},teardown:function(){0===--n&&V.removeEventListener(e,r,!0)}}}),st.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(s in e)this.on(s,n,r,e[s],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=l;else if(!i)return this;return 1===o&&(a=i,i=function(e){return st().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=st.guid++)),this.each(function(){st.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,st(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=l),this.each(function(){st.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){st.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?st.event.trigger(e,n,r,!0):t},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),st.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(e,t){st.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)},_t.test(t)&&(st.event.fixHooks[t]=st.event.keyHooks),Ft.test(t)&&(st.event.fixHooks[t]=st.event.mouseHooks)}),function(e,t){function n(e){return ht.test(e+"")}function r(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>C.cacheLength&&delete e[t.shift()],e[n]=r}}function i(e){return e[P]=!0,e}function o(e){var t=L.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function a(e,t,n,r){var i,o,a,s,u,l,c,d,h,g;if((t?t.ownerDocument||t:R)!==L&&D(t),t=t||L,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!M&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Q.apply(n,K.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&W.getByClassName&&t.getElementsByClassName)return Q.apply(n,K.call(t.getElementsByClassName(a),0)),n}if(W.qsa&&!q.test(e)){if(c=!0,d=P,h=t,g=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=f(e),(c=t.getAttribute("id"))?d=c.replace(vt,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",u=l.length;u--;)l[u]=d+p(l[u]);h=dt.test(e)&&t.parentNode||t,g=l.join(",")}if(g)try{return Q.apply(n,K.call(h.querySelectorAll(g),0)),n}catch(m){}finally{c||t.removeAttribute("id")}}}return x(e.replace(at,"$1"),t,n,r)}function s(e,t){for(var n=e&&t&&e.nextSibling;n;n=n.nextSibling)if(n===t)return-1;return e?1:-1}function u(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function f(e,t){var n,r,i,o,s,u,l,c=X[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=C.preFilter;s;){(!n||(r=ut.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(i=[])),n=!1,(r=lt.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(at," ")}),s=s.slice(n.length));for(o in C.filter)!(r=pt[o].exec(s))||l[o]&&!(r=l[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?a.error(e):X(e,u).slice(0)}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=I++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,u,l,c=$+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(l=t[P]||(t[P]={}),(u=l[r])&&u[0]===c){if((s=u[1])===!0||s===N)return s===!0}else if(u=l[r]=[c],u[1]=e(t,n,a)||N,u[1]===!0)return!0}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function m(e,t,n,r,o,a){return r&&!r[P]&&(r=m(r)),o&&!o[P]&&(o=m(o,a)),i(function(i,a,s,u){var l,c,f,p=[],d=[],h=a.length,m=i||b(t||"*",s.nodeType?[s]:s,[]),y=!e||!i&&t?m:g(m,p,e,s,u),v=n?o||(i?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r)for(l=g(v,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f));if(i){if(o||e){if(o){for(l=[],c=v.length;c--;)(f=v[c])&&l.push(y[c]=f);o(null,v=[],l,u)}for(c=v.length;c--;)(f=v[c])&&(l=o?Z.call(i,f):p[c])>-1&&(i[l]=!(a[l]=f))}}else v=g(v===a?v.splice(h,v.length):v),o?o(null,a,v,u):Q.apply(a,v)})}function y(e){for(var t,n,r,i=e.length,o=C.relative[e[0].type],a=o||C.relative[" "],s=o?1:0,u=d(function(e){return e===t},a,!0),l=d(function(e){return Z.call(t,e)>-1},a,!0),c=[function(e,n,r){return!o&&(r||n!==j)||((t=n).nodeType?u(e,n,r):l(e,n,r))}];i>s;s++)if(n=C.relative[e[s].type])c=[d(h(c),n)];else{if(n=C.filter[e[s].type].apply(null,e[s].matches),n[P]){for(r=++s;i>r&&!C.relative[e[r].type];r++);return m(s>1&&h(c),s>1&&p(e.slice(0,s-1)).replace(at,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}c.push(n)}return h(c)}function v(e,t){var n=0,r=t.length>0,o=e.length>0,s=function(i,s,u,l,c){var f,p,d,h=[],m=0,y="0",v=i&&[],b=null!=c,x=j,T=i||o&&C.find.TAG("*",c&&s.parentNode||s),w=$+=null==x?1:Math.E;for(b&&(j=s!==L&&s,N=n);null!=(f=T[y]);y++){if(o&&f){for(p=0;d=e[p];p++)if(d(f,s,u)){l.push(f);break}b&&($=w,N=++n)}r&&((f=!d&&f)&&m--,i&&v.push(f))}if(m+=y,r&&y!==m){for(p=0;d=t[p];p++)d(v,h,s,u);if(i){if(m>0)for(;y--;)v[y]||h[y]||(h[y]=G.call(l));h=g(h)}Q.apply(l,h),b&&!i&&h.length>0&&m+t.length>1&&a.uniqueSort(l)}return b&&($=w,j=x),v};return r?i(s):s}function b(e,t,n){for(var r=0,i=t.length;i>r;r++)a(e,t[r],n);return n}function x(e,t,n,r){var i,o,a,s,u,l=f(e);if(!r&&1===l.length){if(o=l[0]=l[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&!M&&C.relative[o[1].type]){if(t=C.find.ID(a.matches[0].replace(xt,Tt),t)[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?-1:o.length-1;i>=0&&(a=o[i],!C.relative[s=a.type]);i--)if((u=C.find[s])&&(r=u(a.matches[0].replace(xt,Tt),dt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return Q.apply(n,K.call(r,0)),n;break}}return S(e,l)(r,t,M,n,dt.test(e)),n}function T(){}var w,N,C,k,E,S,A,j,D,L,H,M,q,_,F,O,B,P="sizzle"+-new Date,R=e.document,W={},$=0,I=0,z=r(),X=r(),U=r(),V=typeof t,Y=1<<31,J=[],G=J.pop,Q=J.push,K=J.slice,Z=J.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},et="[\\x20\\t\\r\\n\\f]",tt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",nt=tt.replace("w","w#"),rt="([*^$|!~]?=)",it="\\["+et+"*("+tt+")"+et+"*(?:"+rt+et+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+nt+")|)|)"+et+"*\\]",ot=":("+tt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+it.replace(3,8)+")*)|.*)\\)|)",at=RegExp("^"+et+"+|((?:^|[^\\\\])(?:\\\\.)*)"+et+"+$","g"),ut=RegExp("^"+et+"*,"+et+"*"),lt=RegExp("^"+et+"*([\\x20\\t\\r\\n\\f>+~])"+et+"*"),ct=RegExp(ot),ft=RegExp("^"+nt+"$"),pt={ID:RegExp("^#("+tt+")"),CLASS:RegExp("^\\.("+tt+")"),NAME:RegExp("^\\[name=['\"]?("+tt+")['\"]?\\]"),TAG:RegExp("^("+tt.replace("w","w*")+")"),ATTR:RegExp("^"+it),PSEUDO:RegExp("^"+ot),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),needsContext:RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},dt=/[\x20\t\r\n\f]*[+~]/,ht=/\{\s*\[native code\]\s*\}/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,vt=/'|\\/g,bt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{K.call(H.childNodes,0)[0].nodeType}catch(wt){K=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}E=a.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},D=a.setDocument=function(e){var r=e?e.ownerDocument||e:R;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,H=r.documentElement,M=E(r),W.tagNameNoComments=o(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),W.attributes=o(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),W.getByClassName=o(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),W.getByName=o(function(e){e.id=P+0,e.innerHTML="<a name='"+P+"'></a><div name='"+P+"'></div>",H.insertBefore(e,H.firstChild);var t=r.getElementsByName&&r.getElementsByName(P).length===2+r.getElementsByName(P+0).length;return W.getIdNotName=!r.getElementById(P),H.removeChild(e),t}),C.attrHandle=o(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==V&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},W.getIdNotName?(C.find.ID=function(e,t){if(typeof t.getElementById!==V&&!M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){return e.getAttribute("id")===t}}):(C.find.ID=function(e,n){if(typeof n.getElementById!==V&&!M){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==V&&r.getAttributeNode("id").value===e?[r]:t:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){var n=typeof e.getAttributeNode!==V&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=W.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==V?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i];i++)1===n.nodeType&&r.push(n);return r}return o},C.find.NAME=W.getByName&&function(e,n){return typeof n.getElementsByName!==V?n.getElementsByName(name):t},C.find.CLASS=W.getByClassName&&function(e,n){return typeof n.getElementsByClassName===V||M?t:n.getElementsByClassName(e)},_=[],q=[":focus"],(W.qsa=n(r.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||q.push("\\["+et+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||q.push(":checked")}),o(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&q.push("[*^$]="+et+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),q.push(",.*:")})),(W.matchesSelector=n(F=H.matchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){W.disconnectedMatch=F.call(e,"div"),F.call(e,"[s!='']:x"),_.push("!=",ot)}),q=RegExp(q.join("|")),_=RegExp(_.join("|")),O=n(H.contains)||H.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},B=H.compareDocumentPosition?function(e,t){var n;return e===t?(A=!0,0):(n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===r||O(R,e)?-1:t===r||O(R,t)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,a=t.parentNode,u=[e],l=[t];if(e===t)return A=!0,0;if(e.sourceIndex&&t.sourceIndex)return(~t.sourceIndex||Y)-(O(R,e)&&~e.sourceIndex||Y);if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:0;if(o===a)return s(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;u[i]===l[i];)i++;return i?s(u[i],l[i]):u[i]===R?-1:l[i]===R?1:0},A=!1,[0,0].sort(B),W.detectDuplicates=A,L):L},a.matches=function(e,t){return a(e,null,null,t)},a.matchesSelector=function(e,t){if((e.ownerDocument||e)!==L&&D(e),t=t.replace(bt,"='$1']"),!(!W.matchesSelector||M||_&&_.test(t)||q.test(t)))try{var n=F.call(e,t);if(n||W.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return a(t,L,null,[e]).length>0},a.contains=function(e,t){return(e.ownerDocument||e)!==L&&D(e),O(e,t)},a.attr=function(e,t){var n;return(e.ownerDocument||e)!==L&&D(e),M||(t=t.toLowerCase()),(n=C.attrHandle[t])?n(e):M||W.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},a.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},a.uniqueSort=function(e){var t,n=[],r=1,i=0;if(A=!W.detectDuplicates,e.sort(B),A){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},k=a.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=k(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=k(t);return n},C=a.selectors={cacheLength:50,createPseudo:i,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,Tt),e[3]=(e[4]||e[5]||"").replace(xt,Tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||a.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&a.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&ct.test(n)&&(t=f(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,Tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=z[e+" "];return t||(t=RegExp("(^|"+et+")"+e+"("+et+"|$)"))&&z(e,function(e){return t.test(e.className||typeof e.getAttribute!==V&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=a.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.substr(i.length-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[P]||(m[P]={}),l=c[e]||[],d=l[0]===$&&l[1],p=l[0]===$&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[$,d,p];break}}else if(v&&(l=(t[P]||(t[P]={}))[e])&&l[0]===$)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++p||(v&&((f[P]||(f[P]={}))[e]=[$,p]),f!==t)););return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,r=C.pseudos[e]||C.setFilters[e.toLowerCase()]||a.error("unsupported pseudo: "+e);return r[P]?r(t):r.length>1?(n=[e,e,"",t],C.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=Z.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:i(function(e){var t=[],n=[],r=S(e.replace(at,"$1"));return r[P]?i(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:i(function(e){return function(t){return a(e,t).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:i(function(e){return ft.test(e||"")||a.error("unsupported lang: "+e),e=e.replace(xt,Tt).toLowerCase(),function(t){var n;do if(n=M?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===H},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return mt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[w]=u(w);for(w in{submit:!0,reset:!0})C.pseudos[w]=l(w);S=a.compile=function(e,t){var n,r=[],i=[],o=U[e+" "];if(!o){for(t||(t=f(e)),n=t.length;n--;)o=y(t[n]),o[P]?r.push(o):i.push(o);o=U(e,v(i,r))}return o},C.pseudos.nth=C.pseudos.eq,C.filters=T.prototype=C.pseudos,C.setFilters=new T,D(),a.attr=st.attr,st.find=a,st.expr=a.selectors,st.expr[":"]=st.expr.pseudos,st.unique=a.uniqueSort,st.text=a.getText,st.isXMLDoc=a.isXML,st.contains=a.contains}(e);var Pt=/Until$/,Rt=/^(?:parents|prev(?:Until|All))/,Wt=/^.[^:#\[\.,]*$/,$t=st.expr.match.needsContext,It={children:!0,contents:!0,next:!0,prev:!0};st.fn.extend({find:function(e){var t,n,r;if("string"!=typeof e)return r=this,this.pushStack(st(e).filter(function(){for(t=0;r.length>t;t++)if(st.contains(r[t],this))return!0}));for(n=[],t=0;this.length>t;t++)st.find(e,this[t],n);return n=this.pushStack(st.unique(n)),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=st(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(st.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(f(this,e,!1))},filter:function(e){return this.pushStack(f(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?$t.test(e)?st(e,this.context).index(this[0])>=0:st.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=$t.test(e)||"string"!=typeof e?st(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:st.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?st.unique(o):o)},index:function(e){return e?"string"==typeof e?st.inArray(this[0],st(e)):st.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?st(e,t):st.makeArray(e&&e.nodeType?[e]:e),r=st.merge(this.get(),n);return this.pushStack(st.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),st.fn.andSelf=st.fn.addBack,st.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return st.dir(e,"parentNode")},parentsUntil:function(e,t,n){return st.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling") },nextAll:function(e){return st.dir(e,"nextSibling")},prevAll:function(e){return st.dir(e,"previousSibling")},nextUntil:function(e,t,n){return st.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return st.dir(e,"previousSibling",n)},siblings:function(e){return st.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return st.sibling(e.firstChild)},contents:function(e){return st.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:st.merge([],e.childNodes)}},function(e,t){st.fn[e]=function(n,r){var i=st.map(this,t,n);return Pt.test(e)||(r=n),r&&"string"==typeof r&&(i=st.filter(r,i)),i=this.length>1&&!It[e]?st.unique(i):i,this.length>1&&Rt.test(e)&&(i=i.reverse()),this.pushStack(i)}}),st.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?st.find.matchesSelector(t[0],e)?[t[0]]:[]:st.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!st(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var zt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Xt=/ jQuery\d+="(?:null|\d+)"/g,Ut=RegExp("<(?:"+zt+")[\\s/>]","i"),Vt=/^\s+/,Yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Jt=/<([\w:]+)/,Gt=/<tbody/i,Qt=/<|&#?\w+;/,Kt=/<(?:script|style|link)/i,Zt=/^(?:checkbox|radio)$/i,en=/checked\s*(?:[^=]|=\s*.checked.)/i,tn=/^$|\/(?:java|ecma)script/i,nn=/^true\/(.*)/,rn=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,on={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:st.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},an=p(V),sn=an.appendChild(V.createElement("div"));on.optgroup=on.option,on.tbody=on.tfoot=on.colgroup=on.caption=on.thead,on.th=on.td,st.fn.extend({text:function(e){return st.access(this,function(e){return e===t?st.text(this):this.empty().append((this[0]&&this[0].ownerDocument||V).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(st.isFunction(e))return this.each(function(t){st(this).wrapAll(e.call(this,t))});if(this[0]){var t=st(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return st.isFunction(e)?this.each(function(t){st(this).wrapInner(e.call(this,t))}):this.each(function(){var t=st(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=st.isFunction(e);return this.each(function(n){st(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){st.nodeName(this,"body")||st(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||st.filter(e,[n]).length>0)&&(t||1!==n.nodeType||st.cleanData(b(n)),n.parentNode&&(t&&st.contains(n.ownerDocument,n)&&m(b(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&st.cleanData(b(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&st.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return st.clone(this,e,t)})},html:function(e){return st.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Xt,""):t;if(!("string"!=typeof e||Kt.test(e)||!st.support.htmlSerialize&&Ut.test(e)||!st.support.leadingWhitespace&&Vt.test(e)||on[(Jt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Yt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(st.cleanData(b(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=st.isFunction(e);return t||"string"==typeof e||(e=st(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;(n&&1===this.nodeType||11===this.nodeType)&&(st(this).remove(),t?t.parentNode.insertBefore(e,t):n.appendChild(e))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=et.apply([],e);var i,o,a,s,u,l,c=0,f=this.length,p=this,m=f-1,y=e[0],v=st.isFunction(y);if(v||!(1>=f||"string"!=typeof y||st.support.checkClone)&&en.test(y))return this.each(function(i){var o=p.eq(i);v&&(e[0]=y.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(f&&(i=st.buildFragment(e,this[0].ownerDocument,!1,this),o=i.firstChild,1===i.childNodes.length&&(i=o),o)){for(n=n&&st.nodeName(o,"tr"),a=st.map(b(i,"script"),h),s=a.length;f>c;c++)u=i,c!==m&&(u=st.clone(u,!0,!0),s&&st.merge(a,b(u,"script"))),r.call(n&&st.nodeName(this[c],"table")?d(this[c],"tbody"):this[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,st.map(a,g),c=0;s>c;c++)u=a[c],tn.test(u.type||"")&&!st._data(u,"globalEval")&&st.contains(l,u)&&(u.src?st.ajax({url:u.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):st.globalEval((u.text||u.textContent||u.innerHTML||"").replace(rn,"")));i=o=null}return this}}),st.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){st.fn[e]=function(e){for(var n,r=0,i=[],o=st(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),st(o[r])[t](n),tt.apply(i,n.get());return this.pushStack(i)}}),st.extend({clone:function(e,t,n){var r,i,o,a,s,u=st.contains(e.ownerDocument,e);if(st.support.html5Clone||st.isXMLDoc(e)||!Ut.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(sn.innerHTML=e.outerHTML,sn.removeChild(s=sn.firstChild)),!(st.support.noCloneEvent&&st.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||st.isXMLDoc(e)))for(r=b(s),i=b(e),a=0;null!=(o=i[a]);++a)r[a]&&v(o,r[a]);if(t)if(n)for(i=i||b(e),r=r||b(s),a=0;null!=(o=i[a]);a++)y(o,r[a]);else y(e,s);return r=b(s,"script"),r.length>0&&m(r,!u&&b(e,"script")),r=i=o=null,s},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,f=e.length,d=p(t),h=[],g=0;f>g;g++)if(o=e[g],o||0===o)if("object"===st.type(o))st.merge(h,o.nodeType?[o]:o);else if(Qt.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(Jt.exec(o)||["",""])[1].toLowerCase(),u=on[a]||on._default,s.innerHTML=u[1]+o.replace(Yt,"<$1></$2>")+u[2],c=u[0];c--;)s=s.lastChild;if(!st.support.leadingWhitespace&&Vt.test(o)&&h.push(t.createTextNode(Vt.exec(o)[0])),!st.support.tbody)for(o="table"!==a||Gt.test(o)?"<table>"!==u[1]||Gt.test(o)?0:s:s.firstChild,c=o&&o.childNodes.length;c--;)st.nodeName(l=o.childNodes[c],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(st.merge(h,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=d.lastChild}else h.push(t.createTextNode(o));for(s&&d.removeChild(s),st.support.appendChecked||st.grep(b(h,"input"),x),g=0;o=h[g++];)if((!r||-1===st.inArray(o,r))&&(i=st.contains(o.ownerDocument,o),s=b(d.appendChild(o),"script"),i&&m(s),n))for(c=0;o=s[c++];)tn.test(o.type||"")&&n.push(o);return s=null,d},cleanData:function(e,n){for(var r,i,o,a,s=0,u=st.expando,l=st.cache,c=st.support.deleteExpando,f=st.event.special;null!=(o=e[s]);s++)if((n||st.acceptData(o))&&(i=o[u],r=i&&l[i])){if(r.events)for(a in r.events)f[a]?st.event.remove(o,a):st.removeEvent(o,a,r.handle);l[i]&&(delete l[i],c?delete o[u]:o.removeAttribute!==t?o.removeAttribute(u):o[u]=null,K.push(i))}}});var un,ln,cn,fn=/alpha\([^)]*\)/i,pn=/opacity\s*=\s*([^)]*)/,dn=/^(top|right|bottom|left)$/,hn=/^(none|table(?!-c[ea]).+)/,gn=/^margin/,mn=RegExp("^("+ut+")(.*)$","i"),yn=RegExp("^("+ut+")(?!px)[a-z%]+$","i"),vn=RegExp("^([+-])=("+ut+")","i"),bn={BODY:"block"},xn={position:"absolute",visibility:"hidden",display:"block"},Tn={letterSpacing:0,fontWeight:400},wn=["Top","Right","Bottom","Left"],Nn=["Webkit","O","Moz","ms"];st.fn.extend({css:function(e,n){return st.access(this,function(e,n,r){var i,o,a={},s=0;if(st.isArray(n)){for(i=ln(e),o=n.length;o>s;s++)a[n[s]]=st.css(e,n[s],!1,i);return a}return r!==t?st.style(e,n,r):st.css(e,n)},e,n,arguments.length>1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:w(this))?st(this).show():st(this).hide()})}}),st.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=un(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":st.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=st.camelCase(n),l=e.style;if(n=st.cssProps[u]||(st.cssProps[u]=T(l,u)),s=st.cssHooks[n]||st.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=vn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(st.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||st.cssNumber[u]||(r+="px"),st.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=st.camelCase(n);return n=st.cssProps[u]||(st.cssProps[u]=T(e.style,u)),s=st.cssHooks[n]||st.cssHooks[u],s&&"get"in s&&(o=s.get(e,!0,r)),o===t&&(o=un(e,n,i)),"normal"===o&&n in Tn&&(o=Tn[n]),r?(a=parseFloat(o),r===!0||st.isNumeric(a)?a||0:o):o},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(ln=function(t){return e.getComputedStyle(t,null)},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||st.contains(e.ownerDocument,e)||(u=st.style(e,n)),yn.test(u)&&gn.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):V.documentElement.currentStyle&&(ln=function(e){return e.currentStyle},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),yn.test(u)&&!dn.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),st.each(["height","width"],function(e,n){st.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&hn.test(st.css(e,"display"))?st.swap(e,xn,function(){return E(e,n,i)}):E(e,n,i):t},set:function(e,t,r){var i=r&&ln(e);return C(e,t,r?k(e,n,r,st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,i),i):0)}}}),st.support.opacity||(st.cssHooks.opacity={get:function(e,t){return pn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=st.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===st.trim(o.replace(fn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=fn.test(o)?o.replace(fn,i):o+" "+i)}}),st(function(){st.support.reliableMarginRight||(st.cssHooks.marginRight={get:function(e,n){return n?st.swap(e,{display:"inline-block"},un,[e,"marginRight"]):t}}),!st.support.pixelPosition&&st.fn.position&&st.each(["top","left"],function(e,n){st.cssHooks[n]={get:function(e,r){return r?(r=un(e,n),yn.test(r)?st(e).position()[n]+"px":r):t}}})}),st.expr&&st.expr.filters&&(st.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!st.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||st.css(e,"display"))},st.expr.filters.visible=function(e){return!st.expr.filters.hidden(e)}),st.each({margin:"",padding:"",border:"Width"},function(e,t){st.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+wn[r]+t]=o[r]||o[r-2]||o[0];return i}},gn.test(e)||(st.cssHooks[e+t].set=C)});var Cn=/%20/g,kn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:submit|button|image|reset)$/i,An=/^(?:input|select|textarea|keygen)/i;st.fn.extend({serialize:function(){return st.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=st.prop(this,"elements");return e?st.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!st(this).is(":disabled")&&An.test(this.nodeName)&&!Sn.test(e)&&(this.checked||!Zt.test(e))}).map(function(e,t){var n=st(this).val();return null==n?null:st.isArray(n)?st.map(n,function(e){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}}),st.param=function(e,n){var r,i=[],o=function(e,t){t=st.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=st.ajaxSettings&&st.ajaxSettings.traditional),st.isArray(e)||e.jquery&&!st.isPlainObject(e))st.each(e,function(){o(this.name,this.value)});else for(r in e)j(r,e[r],n,o);return i.join("&").replace(Cn,"+")};var jn,Dn,Ln=st.now(),Hn=/\?/,Mn=/#.*$/,qn=/([?&])_=[^&]*/,_n=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Fn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Bn=/^\/\//,Pn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Rn=st.fn.load,Wn={},$n={},In="*/".concat("*");try{Dn=Y.href}catch(zn){Dn=V.createElement("a"),Dn.href="",Dn=Dn.href}jn=Pn.exec(Dn.toLowerCase())||[],st.fn.load=function(e,n,r){if("string"!=typeof e&&Rn)return Rn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),st.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),s.length>0&&st.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){a=arguments,s.html(i?st("<div>").append(st.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,a||[e.responseText,t,e])}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){st.fn[t]=function(e){return this.on(t,e)}}),st.each(["get","post"],function(e,n){st[n]=function(e,r,i,o){return st.isFunction(r)&&(o=o||i,i=r,r=t),st.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),st.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dn,type:"GET",isLocal:Fn.test(jn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":In,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"},converters:{"* text":e.String,"text html":!0,"text json":st.parseJSON,"text xml":st.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?H(H(e,st.ajaxSettings),t):H(st.ajaxSettings,e)},ajaxPrefilter:D(Wn),ajaxTransport:D($n),ajax:function(e,n){function r(e,n,r,s){var l,f,v,b,T,N=n;2!==x&&(x=2,u&&clearTimeout(u),i=t,a=s||"",w.readyState=e>0?4:0,r&&(b=M(p,w,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=w.getResponseHeader("Last-Modified"),T&&(st.lastModified[o]=T),T=w.getResponseHeader("etag"),T&&(st.etag[o]=T)),304===e?(l=!0,N="notmodified"):(l=q(p,b),N=l.state,f=l.data,v=l.error,l=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),w.status=e,w.statusText=(n||N)+"",l?g.resolveWith(d,[f,N,w]):g.rejectWith(d,[w,N,v]),w.statusCode(y),y=t,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[w,p,l?f:v]),m.fireWith(d,[w,N]),c&&(h.trigger("ajaxComplete",[w,p]),--st.active||st.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,u,l,c,f,p=st.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?st(d):st.event,g=st.Deferred(),m=st.Callbacks("once memory"),y=p.statusCode||{},v={},b={},x=0,T="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!s)for(s={};t=_n.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)y[t]=[y[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,p.url=((e||p.url||Dn)+"").replace(Mn,"").replace(Bn,jn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=st.trim(p.dataType||"*").toLowerCase().match(lt)||[""],null==p.crossDomain&&(l=Pn.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===jn[1]&&l[2]===jn[2]&&(l[3]||("http:"===l[1]?80:443))==(jn[3]||("http:"===jn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=st.param(p.data,p.traditional)),L(Wn,p,n,w),2===x)return w;c=p.global,c&&0===st.active++&&st.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!On.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(Hn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=qn.test(o)?o.replace(qn,"$1_="+Ln++):o+(Hn.test(o)?"&":"?")+"_="+Ln++)),p.ifModified&&(st.lastModified[o]&&w.setRequestHeader("If-Modified-Since",st.lastModified[o]),st.etag[o]&&w.setRequestHeader("If-None-Match",st.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+In+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)w.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(d,w,p)===!1||2===x))return w.abort();T="abort";for(f in{success:1,error:1,complete:1})w[f](p[f]);if(i=L($n,p,n,w)){w.readyState=1,c&&h.trigger("ajaxSend",[w,p]),p.async&&p.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},p.timeout));try{x=1,i.send(v,r)}catch(N){if(!(2>x))throw N;r(-1,N)}}else r(-1,"No Transport");return w},getScript:function(e,n){return st.get(e,t,n,"script")},getJSON:function(e,t,n){return st.get(e,t,n,"json")}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return st.globalEval(e),e}}}),st.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),st.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=V.head||st("head")[0]||V.documentElement;return{send:function(t,i){n=V.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Xn=[],Un=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xn.pop()||st.expando+"_"+Ln++;return this[e]=!0,e}}),st.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Un.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Un.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=st.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Un,"$1"+o):n.jsonp!==!1&&(n.url+=(Hn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Xn.push(o)),s&&st.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Vn,Yn,Jn=0,Gn=e.ActiveXObject&&function(){var e;for(e in Vn)Vn[e](t,!0)};st.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&_()||F()}:_,Yn=st.ajaxSettings.xhr(),st.support.cors=!!Yn&&"withCredentials"in Yn,Yn=st.support.ajax=!!Yn,Yn&&st.ajaxTransport(function(n){if(!n.crossDomain||st.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,f,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=st.noop,Gn&&delete Vn[a]),i)4!==u.readyState&&u.abort();else{f={},s=u.status,p=u.responseXML,c=u.getAllResponseHeaders(),p&&p.documentElement&&(f.xml=p),"string"==typeof u.responseText&&(f.text=u.responseText);try{l=u.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=f.text?200:404}}catch(h){i||o(-1,h)}f&&o(s,l,f,c)},n.async?4===u.readyState?setTimeout(r):(a=++Jn,Gn&&(Vn||(Vn={},st(e).unload(Gn)),Vn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Qn,Kn,Zn=/^(?:toggle|show|hide)$/,er=RegExp("^(?:([+-])=|)("+ut+")([a-z%]*)$","i"),tr=/queueHooks$/,nr=[W],rr={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=er.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(st.cssNumber[e]?"":"px"),"px"!==r&&s){s=st.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,st.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};st.Animation=st.extend(P,{tweener:function(e,t){st.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],rr[n]=rr[n]||[],rr[n].unshift(t)},prefilter:function(e,t){t?nr.unshift(e):nr.push(e)}}),st.Tween=$,$.prototype={constructor:$,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(st.cssNumber[n]?"":"px")},cur:function(){var e=$.propHooks[this.prop];return e&&e.get?e.get(this):$.propHooks._default.get(this)},run:function(e){var t,n=$.propHooks[this.prop];return this.pos=t=this.options.duration?st.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=st.css(e.elem,e.prop,"auto"),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){st.fx.step[e.prop]?st.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[st.cssProps[e.prop]]||st.cssHooks[e.prop])?st.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},st.each(["toggle","show","hide"],function(e,t){var n=st.fn[t];st.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,r,i)}}),st.fn.extend({fadeTo:function(e,t,n,r){return this.filter(w).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=st.isEmptyObject(e),o=st.speed(t,n,r),a=function(){var t=P(this,st.extend({},e),o);a.finish=function(){t.stop(!0)},(i||st._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=st.timers,a=st._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&tr.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&st.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=st._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=st.timers,a=r?r.length:0;for(n.finish=!0,st.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),st.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){st.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),st.speed=function(e,t,n){var r=e&&"object"==typeof e?st.extend({},e):{complete:n||!n&&t||st.isFunction(e)&&e,duration:e,easing:n&&t||t&&!st.isFunction(t)&&t};return r.duration=st.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in st.fx.speeds?st.fx.speeds[r.duration]:st.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){st.isFunction(r.old)&&r.old.call(this),r.queue&&st.dequeue(this,r.queue)},r},st.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},st.timers=[],st.fx=$.prototype.init,st.fx.tick=function(){var e,n=st.timers,r=0;for(Qn=st.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||st.fx.stop(),Qn=t},st.fx.timer=function(e){e()&&st.timers.push(e)&&st.fx.start()},st.fx.interval=13,st.fx.start=function(){Kn||(Kn=setInterval(st.fx.tick,st.fx.interval))},st.fx.stop=function(){clearInterval(Kn),Kn=null},st.fx.speeds={slow:600,fast:200,_default:400},st.fx.step={},st.expr&&st.expr.filters&&(st.expr.filters.animated=function(e){return st.grep(st.timers,function(t){return e===t.elem}).length}),st.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){st.offset.setOffset(this,e,t)});var n,r,i={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return n=a.documentElement,st.contains(n,o)?(o.getBoundingClientRect!==t&&(i=o.getBoundingClientRect()),r=z(a),{top:i.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:i.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):i},st.offset={setOffset:function(e,t,n){var r=st.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=st(e),s=a.offset(),u=st.css(e,"top"),l=st.css(e,"left"),c=("absolute"===r||"fixed"===r)&&st.inArray("auto",[u,l])>-1,f={},p={};c?(p=a.position(),i=p.top,o=p.left):(i=parseFloat(u)||0,o=parseFloat(l)||0),st.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+i),null!=t.left&&(f.left=t.left-s.left+o),"using"in t?t.using.call(e,f):a.css(f)}},st.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===st.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),st.nodeName(e[0],"html")||(n=e.offset()),n.top+=st.css(e[0],"borderTopWidth",!0),n.left+=st.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-st.css(r,"marginTop",!0),left:t.left-n.left-st.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||V.documentElement;e&&!st.nodeName(e,"html")&&"static"===st.css(e,"position");)e=e.offsetParent;return e||V.documentElement})}}),st.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);st.fn[e]=function(i){return st.access(this,function(e,i,o){var a=z(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?st(a).scrollLeft():o,r?o:st(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),st.each({Height:"height",Width:"width"},function(e,n){st.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){st.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return st.access(this,function(n,r,i){var o;return st.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?st.css(n,r,s):st.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=st,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return st})})(window); //@ sourceMappingURL=jquery.min.map
ajax/libs/react-cookie/0.1.7/react-cookie.min.js
dominicrico/cdnjs
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var cookie=require("cookie");var _cookies=cookie.parse(typeof document!=="undefined"?document.cookie:"");for(var key in _cookies){try{_cookies[key]=JSON.parse(_cookies[key])}catch(e){}}function load(name){return _cookies[name]}function save(name,val,opt){_cookies[name]=val;if(typeof document==="undefined")return;document.cookie=cookie.serialize(name,val,opt)}var reactCookie={load:load,save:save};if(typeof module!=="undefined"){module.exports=reactCookie}if(typeof window!=="undefined"){window["reactCookie"]=reactCookie}},{cookie:2}],2:[function(require,module,exports){var serialize=function(name,val,opt){opt=opt||{};var enc=opt.encode||encode;var pairs=[name+"="+enc(val)];if(null!=opt.maxAge){var maxAge=opt.maxAge-0;if(isNaN(maxAge))throw new Error("maxAge should be a Number");pairs.push("Max-Age="+maxAge)}if(opt.domain)pairs.push("Domain="+opt.domain);if(opt.path)pairs.push("Path="+opt.path);if(opt.expires)pairs.push("Expires="+opt.expires.toUTCString());if(opt.httpOnly)pairs.push("HttpOnly");if(opt.secure)pairs.push("Secure");return pairs.join("; ")};var parse=function(str,opt){opt=opt||{};var obj={};var pairs=str.split(/; */);var dec=opt.decode||decode;pairs.forEach(function(pair){var eq_idx=pair.indexOf("=");if(eq_idx<0){return}var key=pair.substr(0,eq_idx).trim();var val=pair.substr(++eq_idx,pair.length).trim();if('"'==val[0]){val=val.slice(1,-1)}if(undefined==obj[key]){try{obj[key]=dec(val)}catch(e){obj[key]=val}}});return obj};var encode=encodeURIComponent;var decode=decodeURIComponent;module.exports.serialize=serialize;module.exports.parse=parse},{}]},{},[1]);
__tests__/index.ios.js
RichHomies/Poof
import 'react-native'; import React from 'react'; import Index from '../index.ios.js'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; it('renders correctly', () => { const tree = renderer.create( <Index /> ); });
studio/plugins/dashboard-widget-structure-menu/src/components/StructureMenuWidget.js
ajmalafif/ajmalafif.com
import {Link} from 'part:@sanity/base/router' import FolderIcon from 'part:@sanity/base/folder-icon' import FileIcon from 'part:@sanity/base/file-icon' import React from 'react' import styles from './StructureMenuWidget.css' function getIconComponent (item) { if (item.icon) return item.icon if (!item.schemaType) return FileIcon return item.schemaType.icon || FolderIcon } function StructureMenuWidget (props) { return ( <div className={styles.root}> <div className={styles.header}> <h3 className={styles.title}>Edit your content</h3> </div> <div className={styles.content}> {props.structure.items .filter(item => item.type !== 'divider') .map(item => { const Icon = getIconComponent(item) return ( <div key={item.id}> <Link className={styles.link} href={`/desk/${item.id}`}> <div className={styles.iconWrapper}> <Icon /> </div> <div>{item.title}</div> </Link> </div> ) })} </div> </div> ) } export default StructureMenuWidget
tests/routes/Home/components/HomeView.spec.js
leviluo/oneToone
import React from 'react' import { HomeView } from 'routes/Home/components/HomeView' import { render } from 'enzyme' describe('(View) Home', () => { let _component beforeEach(() => { _component = render(<HomeView />) }) it('Renders a welcome message', () => { const welcome = _component.find('h4') expect(welcome).to.exist expect(welcome.text()).to.match(/Welcome!/) }) it('Renders an awesome duck image', () => { const duck = _component.find('img') expect(duck).to.exist expect(duck.attr('alt')).to.match(/This is a duck, because Redux!/) }) })
src/containers/Articles/List.js
mcnamee/react-native-starter-app
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Layout from '../../components/Articles/List'; class ArticlesListContainer extends Component { constructor(props) { super(); // Prioritize (web) page route over last meta value const page = props.page || props.meta.page; this.state = { error: null, loading: false, page: parseInt(page, 10) || 1, }; } componentDidMount = () => this.fetchData(); /** * If the page prop changes, update state */ componentDidUpdate = (prevProps) => { const { page } = this.props; const { page: prevPage } = prevProps; if (page !== prevPage) { // eslint-disable-next-line this.setState({ error: null, loading: false, page: parseInt(page, 10) || 1, }, this.fetchData); } } /** * Fetch Data */ fetchData = async ({ forceSync = false, incrementPage = false } = {}) => { const { fetchData } = this.props; let { page } = this.state; page = incrementPage ? page + 1 : page; // Force fetch the next page worth of data when requested page = forceSync ? 1 : page; // Start from scratch this.setState({ loading: true, error: null, page }); try { await fetchData({ forceSync, page }); this.setState({ loading: false, error: null }); } catch (err) { this.setState({ loading: false, error: err.message }); } }; /** * Render */ render = () => { const { listFlat, listPaginated, pagination, meta, } = this.props; const { loading, error, page } = this.state; return ( <Layout page={page} meta={meta} error={error} loading={loading} listFlat={listFlat} listPaginated={listPaginated} pagination={pagination} reFetch={this.fetchData} /> ); }; } ArticlesListContainer.propTypes = { listFlat: PropTypes.arrayOf(PropTypes.shape({})).isRequired, listPaginated: PropTypes.shape({}).isRequired, meta: PropTypes.shape({ page: PropTypes.number, }).isRequired, fetchData: PropTypes.func.isRequired, pagination: PropTypes.arrayOf(PropTypes.shape()).isRequired, page: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), }; ArticlesListContainer.defaultProps = { page: 1, }; const mapStateToProps = (state) => ({ listFlat: state.articles.listFlat || [], listPaginated: state.articles.listPaginated || {}, meta: state.articles.meta || [], pagination: state.articles.pagination || {}, }); const mapDispatchToProps = (dispatch) => ({ fetchData: dispatch.articles.fetchList, }); export default connect(mapStateToProps, mapDispatchToProps)(ArticlesListContainer);
app/javascript/mastodon/components/avatar_overlay.js
masarakki/mastodon
import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { autoPlayGif } from '../initial_state'; export default class AvatarOverlay extends React.PureComponent { static propTypes = { account: ImmutablePropTypes.map.isRequired, friend: ImmutablePropTypes.map.isRequired, animate: PropTypes.bool, }; static defaultProps = { animate: autoPlayGif, }; render() { const { account, friend, animate } = this.props; const baseStyle = { backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`, }; const overlayStyle = { backgroundImage: `url(${friend.get(animate ? 'avatar' : 'avatar_static')})`, }; return ( <div className='account__avatar-overlay'> <div className='account__avatar-overlay-base' style={baseStyle} /> <div className='account__avatar-overlay-overlay' style={overlayStyle} /> </div> ); } }
examples/huge-apps/routes/Course/routes/Announcements/components/Sidebar.js
moudy/react-router
import React from 'react'; import { Link } from 'react-router'; export default class AnnouncementsSidebar extends React.Component { render () { var announcements = COURSES[this.props.params.courseId].announcements; return ( <div> <h3>Sidebar Assignments</h3> <ul> {announcements.map(announcement => ( <li key={announcement.id}> <Link to={`/course/${this.props.params.courseId}/announcements/${announcement.id}`}> {announcement.title} </Link> </li> ))} </ul> </div> ); } }
fixtures/ssr/server/render.js
jdlehman/react
import React from 'react'; import {renderToString} from 'react-dom/server'; import App from '../src/components/App'; let assets; if (process.env.NODE_ENV === 'development') { // Use the bundle from create-react-app's server in development mode. assets = { 'main.js': '/static/js/bundle.js', 'main.css': '', }; } else { assets = require('../build/asset-manifest.json'); } export default function render() { var html = renderToString(<App assets={assets} />); // There's no way to render a doctype in React so prepend manually. // Also append a bootstrap script tag. return '<!DOCTYPE html>' + html; }
ajax/libs/angular-data/0.10.5/angular-data.js
sullivanmatt/cdnjs
/** * @author Jason Dobry <jason.dobry@gmail.com> * @file angular-data.js * @version 0.10.5 - Homepage <http://angular-data.pseudobry.com/> * @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/> * @license MIT <https://github.com/jmdobry/angular-data/blob/master/LICENSE> * * @overview Data store for Angular.js. */ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ // Copyright 2012 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Modifications // Copyright 2014 Jason Dobry // // Summary of modifications: // Removed all code related to: // - ArrayObserver // - ArraySplice // - PathObserver // - CompoundObserver // - Path // - ObserverTransform (function(global) { 'use strict'; // Detect and do basic sanity checking on Object/Array.observe. function detectObjectObserve() { if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') { return false; } var records = []; function callback(recs) { records = recs; } var test = {}; var arr = []; Object.observe(test, callback); Array.observe(arr, callback); test.id = 1; test.id = 2; delete test.id; arr.push(1, 2); arr.length = 0; Object.deliverChangeRecords(callback); if (records.length !== 5) return false; if (records[0].type != 'add' || records[1].type != 'update' || records[2].type != 'delete' || records[3].type != 'splice' || records[4].type != 'splice') { return false; } Object.unobserve(test, callback); Array.unobserve(arr, callback); return true; } var hasObserve = detectObjectObserve(); function detectEval() { // Don't test for eval if we're running in a Chrome App environment. // We check for APIs set that only exist in a Chrome App context. if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) { return false; } try { var f = new Function('', 'return true;'); return f(); } catch (ex) { return false; } } var hasEval = detectEval(); var createObject = ('__proto__' in {}) ? function(obj) { return obj; } : function(obj) { var proto = obj.__proto__; if (!proto) return obj; var newObject = Object.create(proto); Object.getOwnPropertyNames(obj).forEach(function(name) { Object.defineProperty(newObject, name, Object.getOwnPropertyDescriptor(obj, name)); }); return newObject; }; var MAX_DIRTY_CHECK_CYCLES = 1000; function dirtyCheck(observer) { var cycles = 0; while (cycles < MAX_DIRTY_CHECK_CYCLES && observer.check_()) { cycles++; } if (global.testingExposeCycleCount) global.dirtyCheckCycleCount = cycles; return cycles > 0; } function objectIsEmpty(object) { for (var prop in object) return false; return true; } function diffIsEmpty(diff) { return objectIsEmpty(diff.added) && objectIsEmpty(diff.removed) && objectIsEmpty(diff.changed); } function diffObjectFromOldObject(object, oldObject) { var added = {}; var removed = {}; var changed = {}; for (var prop in oldObject) { var newValue = object[prop]; if (newValue !== undefined && newValue === oldObject[prop]) continue; if (!(prop in object)) { removed[prop] = undefined; continue; } if (newValue !== oldObject[prop]) changed[prop] = newValue; } for (var prop in object) { if (prop in oldObject) continue; added[prop] = object[prop]; } if (Array.isArray(object) && object.length !== oldObject.length) changed.length = object.length; return { added: added, removed: removed, changed: changed }; } var eomTasks = []; function runEOMTasks() { if (!eomTasks.length) return false; for (var i = 0; i < eomTasks.length; i++) { eomTasks[i](); } eomTasks.length = 0; return true; } var runEOM = hasObserve ? (function(){ var eomObj = { pingPong: true }; var eomRunScheduled = false; Object.observe(eomObj, function() { runEOMTasks(); eomRunScheduled = false; }); return function(fn) { eomTasks.push(fn); if (!eomRunScheduled) { eomRunScheduled = true; eomObj.pingPong = !eomObj.pingPong; } }; })() : (function() { return function(fn) { eomTasks.push(fn); }; })(); var observedObjectCache = []; function newObservedObject() { var observer; var object; var discardRecords = false; var first = true; function callback(records) { if (observer && observer.state_ === OPENED && !discardRecords) observer.check_(records); } return { open: function(obs) { if (observer) throw Error('ObservedObject in use'); if (!first) Object.deliverChangeRecords(callback); observer = obs; first = false; }, observe: function(obj, arrayObserve) { object = obj; if (arrayObserve) Array.observe(object, callback); else Object.observe(object, callback); }, deliver: function(discard) { discardRecords = discard; Object.deliverChangeRecords(callback); discardRecords = false; }, close: function() { observer = undefined; Object.unobserve(object, callback); observedObjectCache.push(this); } }; } /* * The observedSet abstraction is a perf optimization which reduces the total * number of Object.observe observations of a set of objects. The idea is that * groups of Observers will have some object dependencies in common and this * observed set ensures that each object in the transitive closure of * dependencies is only observed once. The observedSet acts as a write barrier * such that whenever any change comes through, all Observers are checked for * changed values. * * Note that this optimization is explicitly moving work from setup-time to * change-time. * * TODO(rafaelw): Implement "garbage collection". In order to move work off * the critical path, when Observers are closed, their observed objects are * not Object.unobserve(d). As a result, it's possible that if the observedSet * is kept open, but some Observers have been closed, it could cause "leaks" * (prevent otherwise collectable objects from being collected). At some * point, we should implement incremental "gc" which keeps a list of * observedSets which may need clean-up and does small amounts of cleanup on a * timeout until all is clean. */ function getObservedObject(observer, object, arrayObserve) { var dir = observedObjectCache.pop() || newObservedObject(); dir.open(observer); dir.observe(object, arrayObserve); return dir; } var UNOPENED = 0; var OPENED = 1; var CLOSED = 2; var nextObserverId = 1; function Observer() { this.state_ = UNOPENED; this.callback_ = undefined; this.target_ = undefined; // TODO(rafaelw): Should be WeakRef this.directObserver_ = undefined; this.value_ = undefined; this.id_ = nextObserverId++; } Observer.prototype = { open: function(callback, target) { if (this.state_ != UNOPENED) throw Error('Observer has already been opened.'); addToAll(this); this.callback_ = callback; this.target_ = target; this.connect_(); this.state_ = OPENED; return this.value_; }, close: function() { if (this.state_ != OPENED) return; removeFromAll(this); this.disconnect_(); this.value_ = undefined; this.callback_ = undefined; this.target_ = undefined; this.state_ = CLOSED; }, deliver: function() { if (this.state_ != OPENED) return; dirtyCheck(this); }, report_: function(changes) { try { this.callback_.apply(this.target_, changes); } catch (ex) { Observer._errorThrownDuringCallback = true; console.error('Exception caught during observer callback: ' + (ex.stack || ex)); } }, discardChanges: function() { this.check_(undefined, true); return this.value_; } } var collectObservers = !hasObserve; var allObservers; Observer._allObserversCount = 0; if (collectObservers) { allObservers = []; } function addToAll(observer) { Observer._allObserversCount++; if (!collectObservers) return; allObservers.push(observer); } function removeFromAll(observer) { Observer._allObserversCount--; } var runningMicrotaskCheckpoint = false; var hasDebugForceFullDelivery = hasObserve && hasEval && (function() { try { eval('%RunMicrotasks()'); return true; } catch (ex) { return false; } })(); global.Platform = global.Platform || {}; global.Platform.performMicrotaskCheckpoint = function() { if (runningMicrotaskCheckpoint) return; if (hasDebugForceFullDelivery) { eval('%RunMicrotasks()'); return; } if (!collectObservers) return; runningMicrotaskCheckpoint = true; var cycles = 0; var anyChanged, toCheck; do { cycles++; toCheck = allObservers; allObservers = []; anyChanged = false; for (var i = 0; i < toCheck.length; i++) { var observer = toCheck[i]; if (observer.state_ != OPENED) continue; if (observer.check_()) anyChanged = true; allObservers.push(observer); } if (runEOMTasks()) anyChanged = true; } while (cycles < MAX_DIRTY_CHECK_CYCLES && anyChanged); if (global.testingExposeCycleCount) global.dirtyCheckCycleCount = cycles; runningMicrotaskCheckpoint = false; }; if (collectObservers) { global.Platform.clearObservers = function() { allObservers = []; }; } function ObjectObserver(object) { Observer.call(this); this.value_ = object; this.oldObject_ = undefined; } ObjectObserver.prototype = createObject({ __proto__: Observer.prototype, arrayObserve: false, connect_: function(callback, target) { if (hasObserve) { this.directObserver_ = getObservedObject(this, this.value_, this.arrayObserve); } else { this.oldObject_ = this.copyObject(this.value_); } }, copyObject: function(object) { var copy = Array.isArray(object) ? [] : {}; for (var prop in object) { copy[prop] = object[prop]; }; if (Array.isArray(object)) copy.length = object.length; return copy; }, check_: function(changeRecords, skipChanges) { var diff; var oldValues; if (hasObserve) { if (!changeRecords) return false; oldValues = {}; diff = diffObjectFromChangeRecords(this.value_, changeRecords, oldValues); } else { oldValues = this.oldObject_; diff = diffObjectFromOldObject(this.value_, this.oldObject_); } if (diffIsEmpty(diff)) return false; if (!hasObserve) this.oldObject_ = this.copyObject(this.value_); this.report_([ diff.added || {}, diff.removed || {}, diff.changed || {}, function(property) { return oldValues[property]; } ]); return true; }, disconnect_: function() { if (hasObserve) { this.directObserver_.close(); this.directObserver_ = undefined; } else { this.oldObject_ = undefined; } }, deliver: function() { if (this.state_ != OPENED) return; if (hasObserve) this.directObserver_.deliver(false); else dirtyCheck(this); }, discardChanges: function() { if (this.directObserver_) this.directObserver_.deliver(true); else this.oldObject_ = this.copyObject(this.value_); return this.value_; } }); var observerSentinel = {}; var expectedRecordTypes = { add: true, update: true, delete: true }; function diffObjectFromChangeRecords(object, changeRecords, oldValues) { var added = {}; var removed = {}; for (var i = 0; i < changeRecords.length; i++) { var record = changeRecords[i]; if (!expectedRecordTypes[record.type]) { console.error('Unknown changeRecord type: ' + record.type); console.error(record); continue; } if (!(record.name in oldValues)) oldValues[record.name] = record.oldValue; if (record.type == 'update') continue; if (record.type == 'add') { if (record.name in removed) delete removed[record.name]; else added[record.name] = true; continue; } // type = 'delete' if (record.name in added) { delete added[record.name]; delete oldValues[record.name]; } else { removed[record.name] = true; } } for (var prop in added) added[prop] = object[prop]; for (var prop in removed) removed[prop] = undefined; var changed = {}; for (var prop in oldValues) { if (prop in added || prop in removed) continue; var newValue = object[prop]; if (oldValues[prop] !== newValue) changed[prop] = newValue; } return { added: added, removed: removed, changed: changed }; } global.Observer = Observer; global.Observer.runEOM_ = runEOM; global.Observer.observerSentinel_ = observerSentinel; // for testing. global.Observer.hasObjectObserve = hasObserve; global.ObjectObserver = ObjectObserver; })((exports.Number = { isNaN: window.isNaN }) ? exports : exports); },{}],2:[function(require,module,exports){ var indexOf = require('./indexOf'); /** * If array contains values. */ function contains(arr, val) { return indexOf(arr, val) !== -1; } module.exports = contains; },{"./indexOf":5}],3:[function(require,module,exports){ var makeIterator = require('../function/makeIterator_'); /** * Array filter */ function filter(arr, callback, thisObj) { callback = makeIterator(callback, thisObj); var results = []; if (arr == null) { return results; } var i = -1, len = arr.length, value; while (++i < len) { value = arr[i]; if (callback(value, i, arr)) { results.push(value); } } return results; } module.exports = filter; },{"../function/makeIterator_":11}],4:[function(require,module,exports){ /** * Array forEach */ function forEach(arr, callback, thisObj) { if (arr == null) { return; } var i = -1, len = arr.length; while (++i < len) { // we iterate over sparse items since there is no way to make it // work properly on IE 7-8. see #64 if ( callback.call(thisObj, arr[i], i, arr) === false ) { break; } } } module.exports = forEach; },{}],5:[function(require,module,exports){ /** * Array.indexOf */ function indexOf(arr, item, fromIndex) { fromIndex = fromIndex || 0; if (arr == null) { return -1; } var len = arr.length, i = fromIndex < 0 ? len + fromIndex : fromIndex; while (i < len) { // we iterate over sparse items since there is no way to make it // work properly on IE 7-8. see #64 if (arr[i] === item) { return i; } i++; } return -1; } module.exports = indexOf; },{}],6:[function(require,module,exports){ var filter = require('./filter'); function isValidString(val) { return (val != null && val !== ''); } /** * Joins strings with the specified separator inserted between each value. * Null values and empty strings will be excluded. */ function join(items, separator) { separator = separator || ''; return filter(items, isValidString).join(separator); } module.exports = join; },{"./filter":3}],7:[function(require,module,exports){ /** * Create slice of source array or array-like object */ function slice(arr, start, end){ var len = arr.length; if (start == null) { start = 0; } else if (start < 0) { start = Math.max(len + start, 0); } else { start = Math.min(start, len); } if (end == null) { end = len; } else if (end < 0) { end = Math.max(len + end, 0); } else { end = Math.min(end, len); } var result = []; while (start < end) { result.push(arr[start++]); } return result; } module.exports = slice; },{}],8:[function(require,module,exports){ /** * Merge sort (http://en.wikipedia.org/wiki/Merge_sort) */ function mergeSort(arr, compareFn) { if (arr == null) { return []; } else if (arr.length < 2) { return arr; } if (compareFn == null) { compareFn = defaultCompare; } var mid, left, right; mid = ~~(arr.length / 2); left = mergeSort( arr.slice(0, mid), compareFn ); right = mergeSort( arr.slice(mid, arr.length), compareFn ); return merge(left, right, compareFn); } function defaultCompare(a, b) { return a < b ? -1 : (a > b? 1 : 0); } function merge(left, right, compareFn) { var result = []; while (left.length && right.length) { if (compareFn(left[0], right[0]) <= 0) { // if 0 it should preserve same order (stable) result.push(left.shift()); } else { result.push(right.shift()); } } if (left.length) { result.push.apply(result, left); } if (right.length) { result.push.apply(result, right); } return result; } module.exports = mergeSort; },{}],9:[function(require,module,exports){ var isFunction = require('../lang/isFunction'); /** * Creates an object that holds a lookup for the objects in the array. */ function toLookup(arr, key) { var result = {}; if (arr == null) { return result; } var i = -1, len = arr.length, value; if (isFunction(key)) { while (++i < len) { value = arr[i]; result[key(value)] = value; } } else { while (++i < len) { value = arr[i]; result[value[key]] = value; } } return result; } module.exports = toLookup; },{"../lang/isFunction":16}],10:[function(require,module,exports){ /** * Returns the first argument provided to it. */ function identity(val){ return val; } module.exports = identity; },{}],11:[function(require,module,exports){ var identity = require('./identity'); var prop = require('./prop'); var deepMatches = require('../object/deepMatches'); /** * Converts argument into a valid iterator. * Used internally on most array/object/collection methods that receives a * callback/iterator providing a shortcut syntax. */ function makeIterator(src, thisObj){ if (src == null) { return identity; } switch(typeof src) { case 'function': // function is the first to improve perf (most common case) // also avoid using `Function#call` if not needed, which boosts // perf a lot in some cases return (typeof thisObj !== 'undefined')? function(val, i, arr){ return src.call(thisObj, val, i, arr); } : src; case 'object': return function(val){ return deepMatches(val, src); }; case 'string': case 'number': return prop(src); } } module.exports = makeIterator; },{"../object/deepMatches":21,"./identity":10,"./prop":12}],12:[function(require,module,exports){ /** * Returns a function that gets a property of the passed object */ function prop(name){ return function(obj){ return obj[name]; }; } module.exports = prop; },{}],13:[function(require,module,exports){ var isKind = require('./isKind'); /** */ var isArray = Array.isArray || function (val) { return isKind(val, 'Array'); }; module.exports = isArray; },{"./isKind":17}],14:[function(require,module,exports){ var isKind = require('./isKind'); /** */ function isBoolean(val) { return isKind(val, 'Boolean'); } module.exports = isBoolean; },{"./isKind":17}],15:[function(require,module,exports){ var forOwn = require('../object/forOwn'); var isArray = require('./isArray'); function isEmpty(val){ if (val == null) { // typeof null == 'object' so we check it first return false; } else if ( typeof val === 'string' || isArray(val) ) { return !val.length; } else if ( typeof val === 'object' || typeof val === 'function' ) { var result = true; forOwn(val, function(){ result = false; return false; // break loop }); return result; } else { return false; } } module.exports = isEmpty; },{"../object/forOwn":24,"./isArray":13}],16:[function(require,module,exports){ var isKind = require('./isKind'); /** */ function isFunction(val) { return isKind(val, 'Function'); } module.exports = isFunction; },{"./isKind":17}],17:[function(require,module,exports){ var kindOf = require('./kindOf'); /** * Check if value is from a specific "kind". */ function isKind(val, kind){ return kindOf(val) === kind; } module.exports = isKind; },{"./kindOf":19}],18:[function(require,module,exports){ /** * Checks if the value is created by the `Object` constructor. */ function isPlainObject(value) { return (!!value && typeof value === 'object' && value.constructor === Object); } module.exports = isPlainObject; },{}],19:[function(require,module,exports){ var _rKind = /^\[object (.*)\]$/, _toString = Object.prototype.toString, UNDEF; /** * Gets the "kind" of value. (e.g. "String", "Number", etc) */ function kindOf(val) { if (val === null) { return 'Null'; } else if (val === UNDEF) { return 'Undefined'; } else { return _rKind.exec( _toString.call(val) )[1]; } } module.exports = kindOf; },{}],20:[function(require,module,exports){ /** * Typecast a value to a String, using an empty string value for null or * undefined. */ function toString(val){ return val == null ? '' : val.toString(); } module.exports = toString; },{}],21:[function(require,module,exports){ var forOwn = require('./forOwn'); var isArray = require('../lang/isArray'); function containsMatch(array, pattern) { var i = -1, length = array.length; while (++i < length) { if (deepMatches(array[i], pattern)) { return true; } } return false; } function matchArray(target, pattern) { var i = -1, patternLength = pattern.length; while (++i < patternLength) { if (!containsMatch(target, pattern[i])) { return false; } } return true; } function matchObject(target, pattern) { var result = true; forOwn(pattern, function(val, key) { if (!deepMatches(target[key], val)) { // Return false to break out of forOwn early return (result = false); } }); return result; } /** * Recursively check if the objects match. */ function deepMatches(target, pattern){ if (target && typeof target === 'object') { if (isArray(target) && isArray(pattern)) { return matchArray(target, pattern); } else { return matchObject(target, pattern); } } else { return target === pattern; } } module.exports = deepMatches; },{"../lang/isArray":13,"./forOwn":24}],22:[function(require,module,exports){ var forOwn = require('./forOwn'); var isPlainObject = require('../lang/isPlainObject'); /** * Mixes objects into the target object, recursively mixing existing child * objects. */ function deepMixIn(target, objects) { var i = 0, n = arguments.length, obj; while(++i < n){ obj = arguments[i]; if (obj) { forOwn(obj, copyProp, target); } } return target; } function copyProp(val, key) { var existing = this[key]; if (isPlainObject(val) && isPlainObject(existing)) { deepMixIn(existing, val); } else { this[key] = val; } } module.exports = deepMixIn; },{"../lang/isPlainObject":18,"./forOwn":24}],23:[function(require,module,exports){ var hasOwn = require('./hasOwn'); var _hasDontEnumBug, _dontEnums; function checkDontEnum(){ _dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ]; _hasDontEnumBug = true; for (var key in {'toString': null}) { _hasDontEnumBug = false; } } /** * Similar to Array/forEach but works over object properties and fixes Don't * Enum bug on IE. * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation */ function forIn(obj, fn, thisObj){ var key, i = 0; // no need to check if argument is a real object that way we can use // it for arrays, functions, date, etc. //post-pone check till needed if (_hasDontEnumBug == null) checkDontEnum(); for (key in obj) { if (exec(fn, obj, key, thisObj) === false) { break; } } if (_hasDontEnumBug) { var ctor = obj.constructor, isProto = !!ctor && obj === ctor.prototype; while (key = _dontEnums[i++]) { // For constructor, if it is a prototype object the constructor // is always non-enumerable unless defined otherwise (and // enumerated above). For non-prototype objects, it will have // to be defined on this object, since it cannot be defined on // any prototype objects. // // For other [[DontEnum]] properties, check if the value is // different than Object prototype value. if ( (key !== 'constructor' || (!isProto && hasOwn(obj, key))) && obj[key] !== Object.prototype[key] ) { if (exec(fn, obj, key, thisObj) === false) { break; } } } } } function exec(fn, obj, key, thisObj){ return fn.call(thisObj, obj[key], key, obj); } module.exports = forIn; },{"./hasOwn":25}],24:[function(require,module,exports){ var hasOwn = require('./hasOwn'); var forIn = require('./forIn'); /** * Similar to Array/forEach but works over object properties and fixes Don't * Enum bug on IE. * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation */ function forOwn(obj, fn, thisObj){ forIn(obj, function(val, key){ if (hasOwn(obj, key)) { return fn.call(thisObj, obj[key], key, obj); } }); } module.exports = forOwn; },{"./forIn":23,"./hasOwn":25}],25:[function(require,module,exports){ /** * Safer Object.hasOwnProperty */ function hasOwn(obj, prop){ return Object.prototype.hasOwnProperty.call(obj, prop); } module.exports = hasOwn; },{}],26:[function(require,module,exports){ var forEach = require('../array/forEach'); /** * Create nested object if non-existent */ function namespace(obj, path){ if (!path) return obj; forEach(path.split('.'), function(key){ if (!obj[key]) { obj[key] = {}; } obj = obj[key]; }); return obj; } module.exports = namespace; },{"../array/forEach":4}],27:[function(require,module,exports){ var slice = require('../array/slice'); /** * Return a copy of the object, filtered to only have values for the whitelisted keys. */ function pick(obj, var_keys){ var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1), out = {}, i = 0, key; while (key = keys[i++]) { out[key] = obj[key]; } return out; } module.exports = pick; },{"../array/slice":7}],28:[function(require,module,exports){ var namespace = require('./namespace'); /** * set "nested" object property */ function set(obj, prop, val){ var parts = (/^(.+)\.(.+)$/).exec(prop); if (parts){ namespace(obj, parts[1])[parts[2]] = val; } else { obj[prop] = val; } } module.exports = set; },{"./namespace":26}],29:[function(require,module,exports){ var toString = require('../lang/toString'); var replaceAccents = require('./replaceAccents'); var removeNonWord = require('./removeNonWord'); var upperCase = require('./upperCase'); var lowerCase = require('./lowerCase'); /** * Convert string to camelCase text. */ function camelCase(str){ str = toString(str); str = replaceAccents(str); str = removeNonWord(str) .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE .replace(/\s+/g, '') //remove spaces .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase return str; } module.exports = camelCase; },{"../lang/toString":20,"./lowerCase":30,"./removeNonWord":33,"./replaceAccents":34,"./upperCase":35}],30:[function(require,module,exports){ var toString = require('../lang/toString'); /** * "Safer" String.toLowerCase() */ function lowerCase(str){ str = toString(str); return str.toLowerCase(); } module.exports = lowerCase; },{"../lang/toString":20}],31:[function(require,module,exports){ var join = require('../array/join'); var slice = require('../array/slice'); /** * Group arguments as path segments, if any of the args is `null` or an * empty string it will be ignored from resulting path. */ function makePath(var_args){ var result = join(slice(arguments), '/'); // need to disconsider duplicate '/' after protocol (eg: 'http://') return result.replace(/([^:\/]|^)\/{2,}/g, '$1/'); } module.exports = makePath; },{"../array/join":6,"../array/slice":7}],32:[function(require,module,exports){ var toString = require('../lang/toString'); var camelCase = require('./camelCase'); var upperCase = require('./upperCase'); /** * camelCase + UPPERCASE first char */ function pascalCase(str){ str = toString(str); return camelCase(str).replace(/^[a-z]/, upperCase); } module.exports = pascalCase; },{"../lang/toString":20,"./camelCase":29,"./upperCase":35}],33:[function(require,module,exports){ var toString = require('../lang/toString'); // This pattern is generated by the _build/pattern-removeNonWord.js script var PATTERN = /[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g; /** * Remove non-word chars. */ function removeNonWord(str){ str = toString(str); return str.replace(PATTERN, ''); } module.exports = removeNonWord; },{"../lang/toString":20}],34:[function(require,module,exports){ var toString = require('../lang/toString'); /** * Replaces all accented chars with regular ones */ function replaceAccents(str){ str = toString(str); // verifies if the String has accents and replace them if (str.search(/[\xC0-\xFF]/g) > -1) { str = str .replace(/[\xC0-\xC5]/g, "A") .replace(/[\xC6]/g, "AE") .replace(/[\xC7]/g, "C") .replace(/[\xC8-\xCB]/g, "E") .replace(/[\xCC-\xCF]/g, "I") .replace(/[\xD0]/g, "D") .replace(/[\xD1]/g, "N") .replace(/[\xD2-\xD6\xD8]/g, "O") .replace(/[\xD9-\xDC]/g, "U") .replace(/[\xDD]/g, "Y") .replace(/[\xDE]/g, "P") .replace(/[\xE0-\xE5]/g, "a") .replace(/[\xE6]/g, "ae") .replace(/[\xE7]/g, "c") .replace(/[\xE8-\xEB]/g, "e") .replace(/[\xEC-\xEF]/g, "i") .replace(/[\xF1]/g, "n") .replace(/[\xF2-\xF6\xF8]/g, "o") .replace(/[\xF9-\xFC]/g, "u") .replace(/[\xFE]/g, "p") .replace(/[\xFD\xFF]/g, "y"); } return str; } module.exports = replaceAccents; },{"../lang/toString":20}],35:[function(require,module,exports){ var toString = require('../lang/toString'); /** * "Safer" String.toUpperCase() */ function upperCase(str){ str = toString(str); return str.toUpperCase(); } module.exports = upperCase; },{"../lang/toString":20}],36:[function(require,module,exports){ /** * @doc function * @id DSHttpAdapterProvider * @name DSHttpAdapterProvider */ function DSHttpAdapterProvider() { /** * @doc property * @id DSHttpAdapterProvider.properties:defaults * @name defaults * @description * Default configuration for this adapter. * * Properties: * * - `{function}` - `queryTransform` - See [the guide](/documentation/guide/adapters/index). Default: No-op. */ var defaults = this.defaults = { /** * @doc property * @id DSHttpAdapterProvider.properties:defaults.queryTransform * @name defaults.queryTransform * @description * Transform the angular-data query to something your server understands. You might just do this on the server instead. * * @param {string} resourceName The name of the resource. * @param {object} params Params sent through from `$http()`. * @returns {*} Returns `params` as-is. */ queryTransform: function (resourceName, params) { return params; }, /** * @doc property * @id DSHttpAdapterProvider.properties:defaults.$httpConfig * @name defaults.$httpConfig * @description * Default `$http` configuration options used whenever `DSHttpAdapter` uses `$http`. * * ## Example: * ```js * angular.module('myApp', function (DSHttpAdapterProvider) { * angular.extend(DSHttpAdapterProvider.defaults.httpConfig, { * interceptor: [...], * headers: { * common: { * Authorization: 'Basic YmVlcDpib29w' * } * }, * timeout: 20000 * }); * }); * ``` */ $httpConfig: {} }; this.$get = ['$http', '$log', 'DSUtils', function ($http, $log, DSUtils) { /** * @doc interface * @id DSHttpAdapter * @name DSHttpAdapter * @description * Default adapter used by angular-data. This adapter uses AJAX and JSON to send/retrieve data to/from a server. * Developers may provide custom adapters that implement the adapter interface. */ return { /** * @doc property * @id DSHttpAdapter.properties:defaults * @name defaults * @description * Reference to [DSHttpAdapterProvider.defaults](/documentation/api/api/DSHttpAdapterProvider.properties:defaults). */ defaults: defaults, /** * @doc method * @id DSHttpAdapter.methods:HTTP * @name HTTP * @description * Wrapper for `$http()`. * * ## Signature: * ```js * DS.HTTP(config) * ``` * * ## Example: * * ```js * works the same as $http() * ``` * * @param {object} config Configuration for the request. * @returns {Promise} Promise produced by the `$q` service. */ HTTP: HTTP, /** * @doc method * @id DSHttpAdapter.methods:GET * @name GET * @description * Wrapper for `$http.get()`. * * ## Signature: * ```js * DS.GET(url[, config]) * ``` * * ## Example: * * ```js * Works the same as $http.get() * ``` * * @param {string} url The url of the request. * @param {object=} config Configuration for the request. * @returns {Promise} Promise produced by the `$q` service. */ GET: GET, /** * @doc method * @id DSHttpAdapter.methods:POST * @name POST * @description * Wrapper for `$http.post()`. * * ## Signature: * ```js * DS.POST(url[, attrs][, config]) * ``` * * ## Example: * * ```js * Works the same as $http.post() * ``` * * @param {string} url The url of the request. * @param {object=} attrs Request payload. * @param {object=} config Configuration for the request. * @returns {Promise} Promise produced by the `$q` service. */ POST: POST, /** * @doc method * @id DSHttpAdapter.methods:PUT * @name PUT * @description * Wrapper for `$http.put()`. * * ## Signature: * ```js * DS.PUT(url[, attrs][, config]) * ``` * * ## Example: * * ```js * Works the same as $http.put() * ``` * * @param {string} url The url of the request. * @param {object=} attrs Request payload. * @param {object=} config Configuration for the request. * @returns {Promise} Promise produced by the `$q` service. */ PUT: PUT, /** * @doc method * @id DSHttpAdapter.methods:DEL * @name DEL * @description * Wrapper for `$http.delete()`. * * ## Signature: * ```js * DS.DEL(url[, config]) * ``` * * ## Example: * * ```js * Works the same as $http.delete * ``` * * @param {string} url The url of the request. * @param {object} config Configuration for the request. * @returns {Promise} Promise produced by the `$q` service. */ DEL: DEL, /** * @doc method * @id DSHttpAdapter.methods:find * @name find * @description * Retrieve a single entity from the server. * * Sends a `GET` request to `:baseUrl/:endpoint/:id`. * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `endpoint` - Endpoint path for the resource. * @param {string|number} id The primary key of the entity to retrieve. * @param {object=} options Optional configuration. Refer to the documentation for `$http.get`. * @returns {Promise} Promise. */ find: find, /** * @doc method * @id DSHttpAdapter.methods:findAll * @name findAll * @description * Retrieve a collection of entities from the server. * * Sends a `GET` request to `:baseUrl/:endpoint`. * * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `endpoint` - Endpoint path for the resource. * @param {object=} params Search query parameters. See the [query guide](/documentation/guide/queries/index). * @param {object=} options Optional configuration. Refer to the documentation for `$http.get`. * @returns {Promise} Promise. */ findAll: findAll, /** * @doc method * @id DSHttpAdapter.methods:findAll * @name find * @description * Create a new entity on the server. * * Sends a `POST` request to `:baseUrl/:endpoint`. * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `endpoint` - Endpoint path for the resource. * @param {object=} params Search query parameters. See the [query guide](/documentation/guide/queries/index). * @param {object=} options Optional configuration. Refer to the documentation for `$http.post`. * @returns {Promise} Promise. */ create: create, /** * @doc method * @id DSHttpAdapter.methods:update * @name update * @description * Update an entity on the server. * * Sends a `PUT` request to `:baseUrl/:endpoint/:id`. * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `endpoint` - Endpoint path for the resource. * @param {string|number} id The primary key of the entity to update. * @param {object} attrs The attributes with which to update the entity. See the [query guide](/documentation/guide/queries/index). * @param {object=} options Optional configuration. Refer to the documentation for `$http.put`. * @returns {Promise} Promise. */ update: update, /** * @doc method * @id DSHttpAdapter.methods:updateAll * @name updateAll * @description * Update a collection of entities on the server. * * Sends a `PUT` request to `:baseUrl/:endpoint`. * * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `endpoint` - Endpoint path for the resource. * @param {object=} params Search query parameters. See the [query guide](/documentation/guide/queries/index). * @param {object=} options Optional configuration. Refer to the documentation for `$http.put`. * @returns {Promise} Promise. */ updateAll: updateAll, /** * @doc method * @id DSHttpAdapter.methods:destroy * @name destroy * @description * destroy an entity on the server. * * Sends a `PUT` request to `:baseUrl/:endpoint/:id`. * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `endpoint` - Endpoint path for the resource. * @param {string|number} id The primary key of the entity to destroy. * @param {object=} options Optional configuration. Refer to the documentation for `$http.delete`. * @returns {Promise} Promise. */ destroy: destroy, /** * @doc method * @id DSHttpAdapter.methods:destroyAll * @name destroyAll * @description * Retrieve a collection of entities from the server. * * Sends a `DELETE` request to `:baseUrl/:endpoint`. * * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `endpoint` - Endpoint path for the resource. * @param {object=} params Search query parameters. See the [query guide](/documentation/guide/queries/index). * @param {object=} options Optional configuration. Refer to the documentation for `$http.delete`. * @returns {Promise} Promise. */ destroyAll: destroyAll }; function HTTP(config) { var start = new Date().getTime(); config = DSUtils.deepMixIn(config, defaults.$httpConfig); return $http(config).then(function (data) { $log.debug(data.config.method + ' request:' + data.config.url + ' Time taken: ' + (new Date().getTime() - start) + 'ms', arguments); return data; }); } function GET(url, config) { config = config || {}; return HTTP(DSUtils.deepMixIn(config, { url: url, method: 'GET' })); } function POST(url, attrs, config) { config = config || {}; return HTTP(DSUtils.deepMixIn(config, { url: url, data: attrs, method: 'POST' })); } function PUT(url, attrs, config) { config = config || {}; return HTTP(DSUtils.deepMixIn(config, { url: url, data: attrs, method: 'PUT' })); } function DEL(url, config) { config = config || {}; return this.HTTP(DSUtils.deepMixIn(config, { url: url, method: 'DELETE' })); } function create(resourceConfig, attrs, options) { options = options || {}; return this.POST( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint), attrs, options ); } function destroy(resourceConfig, id, options) { options = options || {}; return this.DEL( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint, id), options ); } function destroyAll(resourceConfig, params, options) { options = options || {}; options.params = options.params || {}; if (params) { params = defaults.queryTransform(resourceConfig.name, params); DSUtils.deepMixIn(options.params, params); } return this.DEL( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint), options ); } function find(resourceConfig, id, options) { options = options || {}; return this.GET( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint, id), options ); } function findAll(resourceConfig, params, options) { options = options || {}; options.params = options.params || {}; if (params) { params = defaults.queryTransform(resourceConfig.name, params); DSUtils.deepMixIn(options.params, params); } return this.GET( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint), options ); } function update(resourceConfig, id, attrs, options) { options = options || {}; return this.PUT( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint, id), attrs, options ); } function updateAll(resourceConfig, attrs, params, options) { options = options || {}; options.params = options.params || {}; if (params) { params = defaults.queryTransform(resourceConfig.name, params); DSUtils.deepMixIn(options.params, params); } return this.PUT( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint), attrs, options ); } }]; } module.exports = DSHttpAdapterProvider; },{}],37:[function(require,module,exports){ /** * @doc function * @id DSLocalStorageProvider * @name DSLocalStorageProvider */ function DSLocalStorageProvider() { this.$get = ['$q', 'DSUtils', function ($q, DSUtils) { /** * @doc interface * @id DSLocalStorage * @name DSLocalStorage * @description * Default adapter used by angular-data. This adapter uses AJAX and JSON to send/retrieve data to/from a server. * Developers may provide custom adapters that implement the adapter interface. */ return { /** * @doc method * @id DSLocalStorage.methods:find * @name find * @description * Retrieve a single entity from localStorage. * * Calls `localStorage.getItem(key)`. * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `namespace` - Namespace path for the resource. * @param {string|number} id The primary key of the entity to retrieve. * @returns {Promise} Promise. */ find: find, /** * @doc method * @id DSLocalStorage.methods:findAll * @name findAll * @description * Not supported. */ findAll: function () { throw new Error('Not supported!'); }, /** * @doc method * @id DSLocalStorage.methods:findAll * @name find * @description * Not supported. */ create: function () { throw new Error('Not supported!'); }, /** * @doc method * @id DSLocalStorage.methods:update * @name update * @description * Update an entity in localStorage. * * Calls `localStorage.setItem(key, value)`. * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `namespace` - Namespace path for the resource. * @param {string|number} id The primary key of the entity to update. * @param {object} attrs The attributes with which to update the entity. * @returns {Promise} Promise. */ update: update, /** * @doc method * @id DSLocalStorage.methods:updateAll * @name updateAll * @description * Not supported. */ updateAll: function () { throw new Error('Not supported!'); }, /** * @doc method * @id DSLocalStorage.methods:destroy * @name destroy * @description * Destroy an entity from localStorage. * * Calls `localStorage.removeItem(key)`. * * @param {object} resourceConfig Properties: * - `{string}` - `baseUrl` - Base url. * - `{string=}` - `endpoint` - Endpoint path for the resource. * @param {string|number} id The primary key of the entity to destroy. * @returns {Promise} Promise. */ destroy: destroy, /** * @doc method * @id DSLocalStorage.methods:destroyAll * @name destroyAll * @description * Not supported. */ destroyAll: function () { throw new Error('Not supported!'); } }; function GET(key) { var deferred = $q.defer(); try { var item = localStorage.getItem(key); deferred.resolve(item ? angular.fromJson(item) : undefined); } catch (err) { deferred.reject(err); } return deferred.promise; } function PUT(key, value) { var deferred = $q.defer(); try { var item = localStorage.getItem(key); if (item) { item = angular.fromJson(item); DSUtils.deepMixIn(item, value); deferred.resolve(localStorage.setItem(key, angular.toJson(item))); } else { deferred.resolve(localStorage.setItem(key, angular.toJson(value))); } } catch (err) { deferred.reject(err); } return deferred.promise; } function DEL(key) { var deferred = $q.defer(); try { deferred.resolve(localStorage.removeItem(key)); } catch (err) { deferred.reject(err); } return deferred.promise; } function destroy(resourceConfig, id, options) { options = options || {}; return DEL( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint, id), options ); } function find(resourceConfig, id, options) { options = options || {}; return GET( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint, id), options ); } function update(resourceConfig, id, attrs, options) { options = options || {}; return PUT( DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint, id), attrs, options ).then(function () { return GET(DSUtils.makePath(options.baseUrl || resourceConfig.baseUrl, resourceConfig.endpoint, id)); }); } }]; } module.exports = DSLocalStorageProvider; },{}],38:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.create(' + resourceName + ', attrs[, options]): '; } /** * @doc method * @id DS.async_methods:create * @name create * @description * Create a new resource and save it to the server. * * ## Signature: * ```js * DS.create(resourceName, attrs[, options]) * ``` * * ## Example: * * ```js * DS.create('document', { author: 'John Anderson' }) * .then(function (document) { * document; // { id: 'aab7ff66-e21e-46e2-8be8-264d82aee535', author: 'John Anderson' } * * // The new document is already in the data store * DS.get('document', document.id); // { id: 'aab7ff66-e21e-46e2-8be8-264d82aee535', author: 'John Anderson' } * }, function (err) { * // handle error * }); * ``` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {object} attrs The attributes with which to create the item of the type specified by `resourceName`. * @param {object=} options Configuration options. Properties: * * - `{boolean=}` - `cacheResponse` - Inject the data returned by the server into the data store. Default: `true`. * - `{boolean=}` - `upsert` - If `attrs` already contains a primary key, then attempt to call `DS.update` instead. Default: `true`. * * @returns {Promise} Promise produced by the `$q` service. * * ## Resolves with: * * - `{object}` - `item` - A reference to the newly created item. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` */ function create(resourceName, attrs, options) { var DS = this; var deferred = DS.$q.defer(); var promise = deferred.promise; try { options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isObject(attrs)) { throw new DS.errors.IA(errorPrefix(resourceName) + 'attrs: Must be an object!'); } var definition = DS.definitions[resourceName]; var resource = DS.store[resourceName]; if (!('cacheResponse' in options)) { options.cacheResponse = true; } if (!('upsert' in options)) { options.upsert = true; } if (options.upsert && attrs[definition.idAttribute]) { promise = DS.update(resourceName, attrs[definition.idAttribute], attrs, options); } else { promise = promise .then(function (attrs) { return DS.$q.promisify(definition.beforeValidate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.validate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.afterValidate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.beforeCreate)(resourceName, attrs); }) .then(function (attrs) { return DS.adapters[options.adapter || definition.defaultAdapter].create(definition, definition.serialize(resourceName, attrs), options); }) .then(function (res) { return DS.$q.promisify(definition.afterCreate)(resourceName, definition.deserialize(resourceName, res)); }) .then(function (data) { if (options.cacheResponse) { var created = DS.inject(definition.name, data); var id = created[definition.idAttribute]; resource.completedQueries[id] = new Date().getTime(); resource.previousAttributes[id] = DS.utils.deepMixIn({}, created); resource.saved[id] = DS.utils.updateTimestamp(resource.saved[id]); return DS.get(definition.name, id); } else { return data; } }); } deferred.resolve(attrs); } catch (err) { deferred.reject(err); } return promise; } module.exports = create; },{}],39:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.destroy(' + resourceName + ', ' + id + '): '; } /** * @doc method * @id DS.async_methods:destroy * @name destroy * @description * Delete the item of the type specified by `resourceName` with the primary key specified by `id` from the data store * and the server. * * ## Signature: * ```js * DS.destroy(resourceName, id); * ``` * * ## Example: * * ```js * DS.destroy('document', 'aab7ff66-e21e-46e2-8be8-264d82aee535') * .then(function (id) { * id; // 'aab7ff66-e21e-46e2-8be8-264d82aee535' * * // The document is gone * DS.get('document', 'aab7ff66-e21e-46e2-8be8-264d82aee535'); // undefined * }, function (err) { * // Handle error * }); * ``` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item to remove. * @param {object=} options Configuration options. * @returns {Promise} Promise produced by the `$q` service. * * ## Resolves with: * * - `{string|number}` - `id` - The primary key of the destroyed item. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{RuntimeError}` * - `{NonexistentResourceError}` */ function destroy(resourceName, id, options) { var DS = this; var deferred = DS.$q.defer(); var promise = deferred.promise; try { options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new DS.errors.IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } var item = DS.get(resourceName, id); if (!item) { throw new DS.errors.R(errorPrefix(resourceName, id) + 'id: "' + id + '" not found!'); } var definition = DS.definitions[resourceName]; promise = promise .then(function (attrs) { return DS.$q.promisify(definition.beforeDestroy)(resourceName, attrs); }) .then(function () { return DS.adapters[options.adapter || definition.defaultAdapter].destroy(definition, id, options); }) .then(function () { return DS.$q.promisify(definition.afterDestroy)(resourceName, item); }) .then(function () { DS.eject(resourceName, id); return id; }); deferred.resolve(item); } catch (err) { deferred.reject(err); } return promise; } module.exports = destroy; },{}],40:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.destroyAll(' + resourceName + ', params[, options]): '; } /** * @doc method * @id DS.async_methods:destroyAll * @name destroyAll * @description * Asynchronously return the resource from the server filtered by the query. The results will be added to the data * store when it returns from the server. * * ## Signature: * ```js * DS.destroyAll(resourceName, params[, options]) * ``` * * ## Example: * * ```js * var params = { * where: { * author: { * '==': 'John Anderson' * } * } * }; * * DS.destroyAll('document', params).then(function (documents) { * // The documents are gone from the data store * DS.filter('document', params); // [] * * }, function (err) { * // handle error * }); * ``` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {object} params Parameter object that is serialized into the query string. Properties: * * - `{object=}` - `where` - Where clause. * - `{number=}` - `limit` - Limit clause. * - `{number=}` - `skip` - Skip clause. * - `{number=}` - `offset` - Same as skip. * - `{string|array=}` - `orderBy` - OrderBy clause. * * @param {object=} options Optional configuration. Properties: * * - `{boolean=}` - `bypassCache` - Bypass the cache. Default: `false`. * * @returns {Promise} Promise produced by the `$q` service. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` */ function destroyAll(resourceName, params, options) { var DS = this; var deferred = DS.$q.defer(); var promise = deferred.promise; try { var IA = DS.errors.IA; options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isObject(params)) { throw new IA(errorPrefix(resourceName) + 'params: Must be an object!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName) + 'options: Must be an object!'); } var definition = DS.definitions[resourceName]; promise = promise .then(function () { return DS.adapters[options.adapter || definition.defaultAdapter].destroyAll(definition, params, options); }) .then(function () { return DS.ejectAll(resourceName, params); }); deferred.resolve(); } catch (err) { deferred.reject(err); } return promise; } module.exports = destroyAll; },{}],41:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.find(' + resourceName + ', ' + id + '[, options]): '; } /** * @doc method * @id DS.async_methods:find * @name find * @description * Asynchronously return the resource with the given id from the server. The result will be added to the data * store when it returns from the server. * * ## Signature: * ```js * DS.find(resourceName, id[, options]) * ``` * * ## Example: * * ```js * DS.get('document', 5); // undefined * DS.find('document', 5).then(function (document) { * document; // { id: 5, author: 'John Anderson' } * * DS.get('document', 5); // { id: 5, author: 'John Anderson' } * }, function (err) { * // Handled errors * }); * ``` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item to retrieve. * @param {object=} options Optional configuration. Properties: * * - `{boolean=}` - `bypassCache` - Bypass the cache. Default: `false`. * - `{boolean=}` - `cacheResponse` - Inject the data returned by the server into the data store. Default: `true`. * * @returns {Promise} Promise produced by the `$q` service. * * ## Resolves with: * * - `{object}` - `item` - The item with the primary key specified by `id`. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` */ function find(resourceName, id, options) { var DS = this; var deferred = DS.$q.defer(); var promise = deferred.promise; try { var IA = DS.errors.IA; options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName, id) + 'options: Must be an object!'); } if (!('cacheResponse' in options)) { options.cacheResponse = true; } var definition = DS.definitions[resourceName]; var resource = DS.store[resourceName]; if (options.bypassCache || !options.cacheResponse) { delete resource.completedQueries[id]; } if (!(id in resource.completedQueries)) { if (!(id in resource.pendingQueries)) { promise = resource.pendingQueries[id] = DS.adapters[options.adapter || definition.defaultAdapter].find(definition, id, options) .then(function (res) { var data = definition.deserialize(resourceName, res); if (options.cacheResponse) { // Query is no longer pending delete resource.pendingQueries[id]; resource.completedQueries[id] = new Date().getTime(); return DS.inject(resourceName, data); } else { return data; } }, function (err) { delete resource.pendingQueries[id]; return DS.$q.reject(err); }); } return resource.pendingQueries[id]; } else { deferred.resolve(DS.get(resourceName, id)); } } catch (err) { deferred.reject(err); } return promise; } module.exports = find; },{}],42:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.findAll(' + resourceName + ', params[, options]): '; } function processResults(data, resourceName, queryHash) { var DS = this; var resource = DS.store[resourceName]; var idAttribute = DS.definitions[resourceName].idAttribute; var date = new Date().getTime(); data = data || []; // Query is no longer pending delete resource.pendingQueries[queryHash]; resource.completedQueries[queryHash] = date; // Update modified timestamp of collection resource.collectionModified = DS.utils.updateTimestamp(resource.collectionModified); // Merge the new values into the cache var injected = DS.inject(resourceName, data); // Make sure each object is added to completedQueries if (DS.utils.isArray(injected)) { angular.forEach(injected, function (item) { if (item && item[idAttribute]) { resource.completedQueries[item[idAttribute]] = date; } }); } else { DS.$log.warn(errorPrefix(resourceName) + 'response is expected to be an array!'); resource.completedQueries[injected[idAttribute]] = date; } return injected; } function _findAll(resourceName, params, options) { var DS = this; var definition = DS.definitions[resourceName]; var resource = DS.store[resourceName]; var queryHash = DS.utils.toJson(params); if (options.bypassCache || !options.cacheResponse) { delete resource.completedQueries[queryHash]; } if (!(queryHash in resource.completedQueries)) { // This particular query has never been completed if (!(queryHash in resource.pendingQueries)) { // This particular query has never even been made resource.pendingQueries[queryHash] = DS.adapters[options.adapter || definition.defaultAdapter].findAll(definition, params, options) .then(function (res) { var data = definition.deserialize(resourceName, res); if (options.cacheResponse) { try { return processResults.apply(DS, [data, resourceName, queryHash]); } catch (err) { return DS.$q.reject(err); } } else { return data; } }, function (err) { delete resource.pendingQueries[queryHash]; return DS.$q.reject(err); }); } return resource.pendingQueries[queryHash]; } else { return DS.filter(resourceName, params, options); } } /** * @doc method * @id DS.async_methods:findAll * @name findAll * @description * Asynchronously return the resource from the server filtered by the query. The results will be added to the data * store when it returns from the server. * * ## Signature: * ```js * DS.findAll(resourceName, params[, options]) * ``` * * ## Example: * * ```js * var params = { * where: { * author: { * '==': 'John Anderson' * } * } * }; * * DS.findAll('document', params).then(function (documents) { * documents; // [{ id: '1', author: 'John Anderson', title: 'How to cook' }, * // { id: '2', author: 'John Anderson', title: 'How NOT to cook' }] * * // The documents are now in the data store * DS.filter('document', params); // [{ id: '1', author: 'John Anderson', title: 'How to cook' }, * // { id: '2', author: 'John Anderson', title: 'How NOT to cook' }] * * }, function (err) { * // handle error * }); * ``` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {object=} params Parameter object that is serialized into the query string. Properties: * * - `{object=}` - `where` - Where clause. * - `{number=}` - `limit` - Limit clause. * - `{number=}` - `skip` - Skip clause. * - `{number=}` - `offset` - Same as skip. * - `{string|array=}` - `orderBy` - OrderBy clause. * * @param {object=} options Optional configuration. Properties: * * - `{boolean=}` - `bypassCache` - Bypass the cache. Default: `false`. * - `{boolean=}` - `cacheResponse` - Inject the data returned by the server into the data store. Default: `true`. * * @returns {Promise} Promise produced by the `$q` service. * * ## Resolves with: * * - `{array}` - `items` - The collection of items returned by the server. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` */ function findAll(resourceName, params, options) { var DS = this; var deferred = DS.$q.defer(); var promise = deferred.promise; try { var IA = DS.errors.IA; options = options || {}; params = params || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isObject(params)) { throw new IA(errorPrefix(resourceName) + 'params: Must be an object!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName) + 'options: Must be an object!'); } if (!('cacheResponse' in options)) { options.cacheResponse = true; } promise = promise.then(function () { return _findAll.apply(DS, [resourceName, params, options]); }); deferred.resolve(); } catch (err) { deferred.reject(err); } return promise; } module.exports = findAll; },{}],43:[function(require,module,exports){ module.exports = { /** * @doc method * @id DS.async_methods:create * @name create * @methodOf DS * @description * See [DS.create](/documentation/api/api/DS.async_methods:create). */ create: require('./create'), /** * @doc method * @id DS.async_methods:destroy * @name destroy * @methodOf DS * @description * See [DS.destroy](/documentation/api/api/DS.async_methods:destroy). */ destroy: require('./destroy'), /** * @doc method * @id DS.async_methods:destroyAll * @name destroyAll * @methodOf DS * @description * See [DS.destroyAll](/documentation/api/api/DS.async_methods:destroyAll). */ destroyAll: require('./destroyAll'), /** * @doc method * @id DS.async_methods:find * @name find * @methodOf DS * @description * See [DS.find](/documentation/api/api/DS.async_methods:find). */ find: require('./find'), /** * @doc method * @id DS.async_methods:findAll * @name findAll * @methodOf DS * @description * See [DS.findAll](/documentation/api/api/DS.async_methods:findAll). */ findAll: require('./findAll'), /** * @doc method * @id DS.async_methods:loadRelations * @name loadRelations * @methodOf DS * @description * See [DS.loadRelations](/documentation/api/api/DS.async_methods:loadRelations). */ loadRelations: require('./loadRelations'), /** * @doc method * @id DS.async_methods:refresh * @name refresh * @methodOf DS * @description * See [DS.refresh](/documentation/api/api/DS.async_methods:refresh). */ refresh: require('./refresh'), /** * @doc method * @id DS.async_methods:save * @name save * @methodOf DS * @description * See [DS.save](/documentation/api/api/DS.async_methods:save). */ save: require('./save'), /** * @doc method * @id DS.async_methods:update * @name update * @methodOf DS * @description * See [DS.update](/documentation/api/api/DS.async_methods:update). */ update: require('./update'), /** * @doc method * @id DS.async_methods:updateAll * @name updateAll * @methodOf DS * @description * See [DS.updateAll](/documentation/api/api/DS.async_methods:updateAll). */ updateAll: require('./updateAll') }; },{"./create":38,"./destroy":39,"./destroyAll":40,"./find":41,"./findAll":42,"./loadRelations":44,"./refresh":45,"./save":46,"./update":47,"./updateAll":48}],44:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.loadRelations(' + resourceName + ', instance(Id), relations[, options]): '; } /** * @doc method * @id DS.async_methods:loadRelations * @name loadRelations * @description * Asynchronously load the indicated relations of the given instance. * * ## Signature: * ```js * DS.loadRelations(resourceName, instance(Id), relations[, options]) * ``` * * ## Examples: * * ```js * DS.loadRelations('user', 10, ['profile']).then(function (user) { * user.profile; // object * assert.deepEqual(user.profile, DS.filter('profile', { userId: 10 })[0]); * }); * ``` * * ```js * var user = DS.get('user', 10); * * DS.loadRelations('user', user, ['profile']).then(function (user) { * user.profile; // object * assert.deepEqual(user.profile, DS.filter('profile', { userId: 10 })[0]); * }); * ``` * * ```js * DS.loadRelations('user', 10, ['profile'], { cacheResponse: false }).then(function (user) { * user.profile; // object * assert.equal(DS.filter('profile', { userId: 10 }).length, 0); * }); * ``` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number|object} instance The instance or the id of the instance for which relations are to be loaded. * @param {string|array=} relations The relation(s) to load. * @param {object=} options Optional configuration that is passed to the `find` and `findAll` methods that may be called. * * @returns {Promise} Promise produced by the `$q` service. * * ## Resolves with: * * - `{object}` - `item` - The instance with its loaded relations. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` */ function loadRelations(resourceName, instance, relations, options) { var DS = this; var deferred = DS.$q.defer(); var promise = deferred.promise; try { var IA = DS.errors.IA; options = options || {}; if (angular.isString(instance) || angular.isNumber(instance)) { instance = DS.get(resourceName, instance); } if (angular.isString(relations)) { relations = [relations]; } if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isObject(instance)) { throw new IA(errorPrefix(resourceName) + 'instance(Id): Must be a string, number or object!'); } else if (!DS.utils.isArray(relations)) { throw new IA(errorPrefix(resourceName) + 'relations: Must be a string or an array!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName) + 'options: Must be an object!'); } var definition = DS.definitions[resourceName]; var tasks = []; var fields = []; DS.utils.forOwn(definition.relations, function (relation, type) { DS.utils.forOwn(relation, function (def, relationName) { if (DS.utils.contains(relations, relationName)) { var task; var params = {}; params[def.foreignKey] = instance[definition.idAttribute]; if (type === 'hasMany') { task = DS.findAll(relationName, params, options); } else if (type === 'hasOne') { if (def.localKey && instance[def.localKey]) { task = DS.find(relationName, instance[def.localKey], options); } else if (def.foreignKey) { task = DS.findAll(relationName, params, options); } } else { task = DS.find(relationName, instance[def.localKey], options); } if (task) { tasks.push(task); fields.push(def.localField); } } }); }); promise = promise .then(function () { return DS.$q.all(tasks); }) .then(function (loadedRelations) { angular.forEach(fields, function (field, index) { instance[field] = loadedRelations[index]; }); return instance; }); deferred.resolve(); } catch (err) { deferred.reject(err); } return promise; } module.exports = loadRelations; },{}],45:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.refresh(' + resourceName + ', ' + id + '[, options]): '; } /** * @doc method * @id DS.async_methods:refresh * @name refresh * @description * Like find(), except the resource is only refreshed from the server if it already exists in the data store. * * ## Signature: * ```js * DS.refresh(resourceName, id) * ``` * ## Example: * * ```js * // Exists in the data store, but we want a fresh copy * DS.get('document', 5); * * DS.refresh('document', 5) * .then(function (document) { * document; // The fresh copy * }); * * // Does not exist in the data store * DS.get('document', 6); // undefined * * DS.refresh('document', 6).then(function (document) { * document; // undeinfed * }); // false * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item to refresh from the server. * @param {object=} options Optional configuration passed through to `DS.find` if it is called. * @returns {Promise} A Promise created by the $q server. * * ## Resolves with: * * - `{object}` - `item` - A reference to the refreshed item. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` */ function refresh(resourceName, id, options) { var DS = this; var IA = DS.errors.IA; options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName, id) + 'options: Must be an object!'); } else { options.bypassCache = true; if (DS.get(resourceName, id)) { return DS.find(resourceName, id, options); } else { var deferred = DS.$q.defer(); deferred.resolve(); return deferred.promise; } } } module.exports = refresh; },{}],46:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.save(' + resourceName + ', ' + id + '[, options]): '; } /** * @doc method * @id DS.async_methods:save * @name save * @description * Save the item of the type specified by `resourceName` that has the primary key specified by `id`. * * ## Signature: * ```js * DS.save(resourceName, id[, options]) * ``` * * ## Example: * * ```js * var document = DS.get('document', 'ee7f3f4d-98d5-4934-9e5a-6a559b08479f'); * * document.title = 'How to cook in style'; * * DS.save('document', 'ee7f3f4d-98d5-4934-9e5a-6a559b08479f') * .then(function (document) { * document; // A reference to the document that's been saved to the server * }); * ``` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item to save. * @param {object=} options Optional configuration. Properties:: * * - `{boolean=}` - `cacheResponse` - Inject the data returned by the server into the data store. Default: `true`. * - `{boolean=}` - `changesOnly` - Only send changed and added values back to the server. * * @returns {Promise} Promise produced by the `$q` service. * * ## Resolves with: * * - `{object}` - `item` - A reference to the newly saved item. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{RuntimeError}` * - `{NonexistentResourceError}` */ function save(resourceName, id, options) { var DS = this; var deferred = DS.$q.defer(); var promise = deferred.promise; try { var IA = DS.errors.IA; options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName, id) + 'options: Must be an object!'); } var item = DS.get(resourceName, id); if (!item) { throw new DS.errors.R(errorPrefix(resourceName, id) + 'id: "' + id + '" not found!'); } var definition = DS.definitions[resourceName]; var resource = DS.store[resourceName]; if (!('cacheResponse' in options)) { options.cacheResponse = true; } promise = promise .then(function (attrs) { return DS.$q.promisify(definition.beforeValidate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.validate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.afterValidate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.beforeUpdate)(resourceName, attrs); }) .then(function (attrs) { if (options.changesOnly) { resource.observers[id].deliver(); var toKeep = [], changes = DS.changes(resourceName, id); for (var key in changes.added) { toKeep.push(key); } for (key in changes.changed) { toKeep.push(key); } changes = DS.utils.pick(attrs, toKeep); if (DS.utils.isEmpty(changes)) { // no changes, return return attrs; } else { attrs = changes; } } return DS.adapters[options.adapter || definition.defaultAdapter].update(definition, id, definition.serialize(resourceName, attrs), options); }) .then(function (res) { return DS.$q.promisify(definition.afterUpdate)(resourceName, definition.deserialize(resourceName, res)); }) .then(function (data) { if (options.cacheResponse) { var saved = DS.inject(definition.name, data, options); resource.previousAttributes[id] = DS.utils.deepMixIn({}, saved); resource.saved[id] = DS.utils.updateTimestamp(resource.saved[id]); return DS.get(resourceName, id); } else { return data; } }); deferred.resolve(item); } catch (err) { deferred.reject(err); } return promise; } module.exports = save; },{}],47:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.update(' + resourceName + ', ' + id + ', attrs[, options]): '; } /** * @doc method * @id DS.async_methods:update * @name update * @description * Update the item of type `resourceName` and primary key `id` with `attrs`. This is useful when you want to update an * item that isn't already in the data store, or you don't want to update the item that's in the data store until the * server-side operation succeeds. This differs from `DS.save` which simply saves items in their current form that * already reside in the data store. * * ## Signature: * ```js * DS.update(resourceName, id, attrs[, options]) * ``` * * ## Example: * * ```js * DS.get('document', 5); // undefined * * DS.update('document', 5, { title: 'How to cook in style' }) * .then(function (document) { * document; // A reference to the document that's been saved to the server * // and now resides in the data store * }); * ``` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item to update. * @param {object} attrs The attributes with which to update the item. * @param {object=} options Optional configuration. Properties: * * - `{boolean=}` - `cacheResponse` - Inject the data returned by the server into the data store. Default: `true`. * * @returns {Promise} Promise produced by the `$q` service. * * ## Resolves with: * * - `{object}` - `item` - A reference to the newly saved item. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` */ function update(resourceName, id, attrs, options) { var DS = this; var deferred = DS.$q.defer(); var promise = deferred.promise; try { var IA = DS.errors.IA; options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } else if (!DS.utils.isObject(attrs)) { throw new IA(errorPrefix(resourceName, id) + 'attrs: Must be an object!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName, id) + 'options: Must be an object!'); } var definition = DS.definitions[resourceName]; var resource = DS.store[resourceName]; if (!('cacheResponse' in options)) { options.cacheResponse = true; } promise = promise .then(function (attrs) { return DS.$q.promisify(definition.beforeValidate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.validate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.afterValidate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.beforeUpdate)(resourceName, attrs); }) .then(function (attrs) { return DS.adapters[options.adapter || definition.defaultAdapter].update(definition, id, definition.serialize(resourceName, attrs), options); }) .then(function (res) { return DS.$q.promisify(definition.afterUpdate)(resourceName, definition.deserialize(resourceName, res)); }) .then(function (data) { if (options.cacheResponse) { var updated = DS.inject(definition.name, data, options); var id = updated[definition.idAttribute]; resource.previousAttributes[id] = DS.utils.deepMixIn({}, updated); resource.saved[id] = DS.utils.updateTimestamp(resource.saved[id]); return DS.get(definition.name, id); } else { return data; } }); deferred.resolve(attrs); } catch (err) { deferred.reject(err); } return promise; } module.exports = update; },{}],48:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.updateAll(' + resourceName + ', attrs, params[, options]): '; } /** * @doc method * @id DS.async_methods:updateAll * @name updateAll * @description * Update items of type `resourceName` with `attrs` according to the criteria specified by `params`. This is useful when * you want to update multiple items with the same attributes that aren't already in the data store, or you don't want * to update the items that are in the data store until the server-side operation succeeds. * * ## Signature: * ```js * DS.updateAll(resourceName, attrs, params[, options]) * ``` * * ## Example: * * ```js * DS.filter('document'); // [] * * DS.updateAll('document', 5, { author: 'Sally' }, { * where: { * author: { * '==': 'John Anderson' * } * } * }) * .then(function (documents) { * documents; // The documents that were updated on the server * // and now reside in the data store * * documents[0].author; // "Sally" * }); * ``` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {object} attrs The attributes with which to update the items. * @param {object} params Parameter object that is serialized into the query string. Properties: * * - `{object=}` - `where` - Where clause. * - `{number=}` - `limit` - Limit clause. * - `{number=}` - `skip` - Skip clause. * - `{number=}` - `offset` - Same as skip. * - `{string|array=}` - `orderBy` - OrderBy clause. * * @param {object=} options Optional configuration. Properties: * * - `{boolean=}` - `cacheResponse` - Inject the data returned by the server into the data store. Default: `true`. * * @returns {Promise} Promise produced by the `$q` service. * * ## Resolves with: * * - `{object}` - `item` - A reference to the newly saved item. * * ## Rejects with: * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` */ function updateAll(resourceName, attrs, params, options) { var DS = this; var deferred = DS.$q.defer(); var promise = deferred.promise; try { var IA = DS.errors.IA; options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isObject(attrs)) { throw new IA(errorPrefix(resourceName) + 'attrs: Must be an object!'); } else if (!DS.utils.isObject(params)) { throw new IA(errorPrefix(resourceName) + 'params: Must be an object!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName) + 'options: Must be an object!'); } var definition = DS.definitions[resourceName]; if (!('cacheResponse' in options)) { options.cacheResponse = true; } promise = promise .then(function (attrs) { return DS.$q.promisify(definition.beforeValidate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.validate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.afterValidate)(resourceName, attrs); }) .then(function (attrs) { return DS.$q.promisify(definition.beforeUpdate)(resourceName, attrs); }) .then(function (attrs) { return DS.adapters[options.adapter || definition.defaultAdapter].updateAll(definition, definition.serialize(resourceName, attrs), params, options); }) .then(function (res) { return DS.$q.promisify(definition.afterUpdate)(resourceName, definition.deserialize(resourceName, res)); }) .then(function (data) { if (options.cacheResponse) { return DS.inject(definition.name, data, options); } else { return data; } }); deferred.resolve(attrs); } catch (err) { deferred.reject(err); } return promise; } module.exports = updateAll; },{}],49:[function(require,module,exports){ var utils = require('../utils')[0](); function lifecycleNoop(resourceName, attrs, cb) { cb(null, attrs); } function Defaults() { } Defaults.prototype.idAttribute = 'id'; Defaults.prototype.defaultAdapter = 'DSHttpAdapter'; Defaults.prototype.defaultFilter = function (collection, resourceName, params, options) { var _this = this; var filtered = collection; var where = null; var reserved = { skip: '', offset: '', where: '', limit: '', orderBy: '', sort: '' }; if (this.utils.isObject(params.where)) { where = params.where; } else { where = {}; } if (options.allowSimpleWhere) { this.utils.forOwn(params, function (value, key) { if (!(key in reserved) && !(key in where)) { where[key] = { '==': value }; } }); } if (this.utils.isEmpty(where)) { where = null; } if (where) { filtered = this.utils.filter(filtered, function (attrs) { var first = true; var keep = true; _this.utils.forOwn(where, function (clause, field) { if (_this.utils.isString(clause)) { clause = { '===': clause }; } else if (_this.utils.isNumber(clause) || _this.utils.isBoolean(clause)) { clause = { '==': clause }; } if (_this.utils.isObject(clause)) { _this.utils.forOwn(clause, function (val, op) { if (op === '==') { keep = first ? (attrs[field] == val) : keep && (attrs[field] == val); } else if (op === '===') { keep = first ? (attrs[field] === val) : keep && (attrs[field] === val); } else if (op === '!=') { keep = first ? (attrs[field] != val) : keep && (attrs[field] != val); } else if (op === '!==') { keep = first ? (attrs[field] !== val) : keep && (attrs[field] !== val); } else if (op === '>') { keep = first ? (attrs[field] > val) : keep && (attrs[field] > val); } else if (op === '>=') { keep = first ? (attrs[field] >= val) : keep && (attrs[field] >= val); } else if (op === '<') { keep = first ? (attrs[field] < val) : keep && (attrs[field] < val); } else if (op === '<=') { keep = first ? (attrs[field] <= val) : keep && (attrs[field] <= val); } else if (op === 'in') { keep = first ? _this.utils.contains(val, attrs[field]) : keep && _this.utils.contains(val, attrs[field]); } else if (op === '|==') { keep = first ? (attrs[field] == val) : keep || (attrs[field] == val); } else if (op === '|===') { keep = first ? (attrs[field] === val) : keep || (attrs[field] === val); } else if (op === '|!=') { keep = first ? (attrs[field] != val) : keep || (attrs[field] != val); } else if (op === '|!==') { keep = first ? (attrs[field] !== val) : keep || (attrs[field] !== val); } else if (op === '|>') { keep = first ? (attrs[field] > val) : keep || (attrs[field] > val); } else if (op === '|>=') { keep = first ? (attrs[field] >= val) : keep || (attrs[field] >= val); } else if (op === '|<') { keep = first ? (attrs[field] < val) : keep || (attrs[field] < val); } else if (op === '|<=') { keep = first ? (attrs[field] <= val) : keep || (attrs[field] <= val); } else if (op === '|in') { keep = first ? _this.utils.contains(val, attrs[field]) : keep || _this.utils.contains(val, attrs[field]); } first = false; }); } }); return keep; }); } var orderBy = null; if (this.utils.isString(params.orderBy)) { orderBy = [ [params.orderBy, 'ASC'] ]; } else if (this.utils.isArray(params.orderBy)) { orderBy = params.orderBy; } if (!orderBy && this.utils.isString(params.sort)) { orderBy = [ [params.sort, 'ASC'] ]; } else if (!orderBy && this.utils.isArray(params.sort)) { orderBy = params.sort; } // Apply 'orderBy' if (orderBy) { angular.forEach(orderBy, function (def) { if (_this.utils.isString(def)) { def = [def, 'ASC']; } else if (!_this.utils.isArray(def)) { throw new _this.errors.IllegalArgumentError('DS.filter(resourceName[, params][, options]): ' + angular.toJson(def) + ': Must be a string or an array!', { params: { 'orderBy[i]': { actual: typeof def, expected: 'string|array' } } }); } filtered = _this.utils.sort(filtered, function (a, b) { var cA = a[def[0]], cB = b[def[0]]; if (_this.utils.isString(cA)) { cA = _this.utils.upperCase(cA); } if (_this.utils.isString(cB)) { cB = _this.utils.upperCase(cB); } if (def[1] === 'DESC') { if (cB < cA) { return -1; } else if (cB > cA) { return 1; } else { return 0; } } else { if (cA < cB) { return -1; } else if (cA > cB) { return 1; } else { return 0; } } }); }); } var limit = angular.isNumber(params.limit) ? params.limit : null; var skip = null; if (angular.isNumber(params.skip)) { skip = params.skip; } else if (angular.isNumber(params.offset)) { skip = params.offset; } // Apply 'limit' and 'skip' if (limit && skip) { filtered = this.utils.slice(filtered, skip, Math.min(filtered.length, skip + limit)); } else if (this.utils.isNumber(limit)) { filtered = this.utils.slice(filtered, 0, Math.min(filtered.length, limit)); } else if (this.utils.isNumber(skip)) { if (skip < filtered.length) { filtered = this.utils.slice(filtered, skip); } else { filtered = []; } } return filtered; }; Defaults.prototype.baseUrl = ''; Defaults.prototype.endpoint = ''; Defaults.prototype.useClass = false; /** * @doc property * @id DSProvider.properties:defaults.beforeValidate * @name defaults.beforeValidate * @description * Called before the `validate` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * beforeValidate(resourceName, attrs, cb) * ``` * * ## Callback signature: * ```js * cb(err, attrs) * ``` * Remember to pass the attributes along to the next step. Passing a first argument to the callback will abort the * lifecycle and reject the promise. * * ## Example: * ```js * DSProvider.defaults.beforeValidate = function (resourceName, attrs, cb) { * // do somthing/inspect attrs * cb(null, attrs); * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.beforeValidate = lifecycleNoop; /** * @doc property * @id DSProvider.properties:defaults.validate * @name defaults.validate * @description * Called before the `afterValidate` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * validate(resourceName, attrs, cb) * ``` * * ## Callback signature: * ```js * cb(err, attrs) * ``` * Remember to pass the attributes along to the next step. Passing a first argument to the callback will abort the * lifecycle and reject the promise. * * ## Example: * ```js * DSProvider.defaults.validate = function (resourceName, attrs, cb) { * // do somthing/inspect attrs * cb(null, attrs); * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.validate = lifecycleNoop; /** * @doc property * @id DSProvider.properties:defaults.afterValidate * @name defaults.afterValidate * @description * Called before the `beforeCreate` or `beforeUpdate` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * afterValidate(resourceName, attrs, cb) * ``` * * ## Callback signature: * ```js * cb(err, attrs) * ``` * Remember to pass the attributes along to the next step. Passing a first argument to the callback will abort the * lifecycle and reject the promise. * * ## Example: * ```js * DSProvider.defaults.afterValidate = function (resourceName, attrs, cb) { * // do somthing/inspect attrs * cb(null, attrs); * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.afterValidate = lifecycleNoop; /** * @doc property * @id DSProvider.properties:defaults.beforeCreate * @name defaults.beforeCreate * @description * Called before the `create` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * beforeCreate(resourceName, attrs, cb) * ``` * * ## Callback signature: * ```js * cb(err, attrs) * ``` * Remember to pass the attributes along to the next step. Passing a first argument to the callback will abort the * lifecycle and reject the promise. * * ## Example: * ```js * DSProvider.defaults.beforeCreate = function (resourceName, attrs, cb) { * // do somthing/inspect attrs * cb(null, attrs); * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.beforeCreate = lifecycleNoop; /** * @doc property * @id DSProvider.properties:defaults.afterCreate * @name defaults.afterCreate * @description * Called after the `create` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * afterCreate(resourceName, attrs, cb) * ``` * * ## Callback signature: * ```js * cb(err, attrs) * ``` * Remember to pass the attributes along to the next step. Passing a first argument to the callback will abort the * lifecycle and reject the promise. * * ## Example: * ```js * DSProvider.defaults.afterCreate = function (resourceName, attrs, cb) { * // do somthing/inspect attrs * cb(null, attrs); * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.afterCreate = lifecycleNoop; /** * @doc property * @id DSProvider.properties:defaults.beforeUpdate * @name defaults.beforeUpdate * @description * Called before the `update` or `save` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * beforeUpdate(resourceName, attrs, cb) * ``` * * ## Callback signature: * ```js * cb(err, attrs) * ``` * Remember to pass the attributes along to the next step. Passing a first argument to the callback will abort the * lifecycle and reject the promise. * * ## Example: * ```js * DSProvider.defaults.beforeUpdate = function (resourceName, attrs, cb) { * // do somthing/inspect attrs * cb(null, attrs); * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.beforeUpdate = lifecycleNoop; /** * @doc property * @id DSProvider.properties:defaults.afterUpdate * @name defaults.afterUpdate * @description * Called after the `update` or `save` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * afterUpdate(resourceName, attrs, cb) * ``` * * ## Callback signature: * ```js * cb(err, attrs) * ``` * Remember to pass the attributes along to the next step. Passing a first argument to the callback will abort the * lifecycle and reject the promise. * * ## Example: * ```js * DSProvider.defaults.afterUpdate = function (resourceName, attrs, cb) { * // do somthing/inspect attrs * cb(null, attrs); * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.afterUpdate = lifecycleNoop; /** * @doc property * @id DSProvider.properties:defaults.beforeDestroy * @name defaults.beforeDestroy * @description * Called before the `destroy` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * beforeDestroy(resourceName, attrs, cb) * ``` * * ## Callback signature: * ```js * cb(err, attrs) * ``` * Remember to pass the attributes along to the next step. Passing a first argument to the callback will abort the * lifecycle and reject the promise. * * ## Example: * ```js * DSProvider.defaults.beforeDestroy = function (resourceName, attrs, cb) { * // do somthing/inspect attrs * cb(null, attrs); * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.beforeDestroy = lifecycleNoop; /** * @doc property * @id DSProvider.properties:defaults.afterDestroy * @name defaults.afterDestroy * @description * Called after the `destroy` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * afterDestroy(resourceName, attrs, cb) * ``` * * ## Callback signature: * ```js * cb(err, attrs) * ``` * Remember to pass the attributes along to the next step. Passing a first argument to the callback will abort the * lifecycle and reject the promise. * * ## Example: * ```js * DSProvider.defaults.afterDestroy = function (resourceName, attrs, cb) { * // do somthing/inspect attrs * cb(null, attrs); * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.afterDestroy = lifecycleNoop; /** * @doc property * @id DSProvider.properties:defaults.beforeInject * @name defaults.beforeInject * @description * Called before the `inject` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * beforeInject(resourceName, attrs) * ``` * * Throwing an error inside this step will cancel the injection. * * ## Example: * ```js * DSProvider.defaults.beforeInject = function (resourceName, attrs) { * // do somthing/inspect/modify attrs * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.beforeInject = function (resourceName, attrs) { return attrs; }; /** * @doc property * @id DSProvider.properties:defaults.afterInject * @name defaults.afterInject * @description * Called after the `inject` lifecycle step. Can be overridden per resource as well. * * ## Signature: * ```js * afterInject(resourceName, attrs) * ``` * * Throwing an error inside this step will cancel the injection. * * ## Example: * ```js * DSProvider.defaults.afterInject = function (resourceName, attrs) { * // do somthing/inspect/modify attrs * }; * ``` * * @param {string} resourceName The name of the resource moving through the lifecycle. * @param {object} attrs Attributes of the item moving through the lifecycle. */ Defaults.prototype.afterInject = function (resourceName, attrs) { return attrs; }; /** * @doc property * @id DSProvider.properties:defaults.serialize * @name defaults.serialize * @description * Your server might expect a custom request object rather than the plain POJO payload. Use `serialize` to * create your custom request object. * * ## Example: * ```js * DSProvider.defaults.serialize = function (resourceName, data) { * return { * payload: data * }; * }; * ``` * * @param {string} resourceName The name of the resource to serialize. * @param {object} data Data to be sent to the server. * @returns {*} By default returns `data` as-is. */ Defaults.prototype.serialize = function (resourceName, data) { return data; }; /** * @doc property * @id DSProvider.properties:defaults.deserialize * @name DSProvider.properties:defaults.deserialize * @description * Your server might return a custom response object instead of the plain POJO payload. Use `deserialize` to * pull the payload out of your response object so angular-data can use it. * * ## Example: * ```js * DSProvider.defaults.deserialize = function (resourceName, data) { * return data ? data.payload : data; * }; * ``` * * @param {string} resourceName The name of the resource to deserialize. * @param {object} data Response object from `$http()`. * @returns {*} By default returns `data.data`. */ Defaults.prototype.deserialize = function (resourceName, data) { return data.data; }; /** * @doc property * @id DSProvider.properties:defaults.events * @name DSProvider.properties:defaults.events * @description * Whether to broadcast, emit, or disable DS events on the `$rootScope`. * * Possible values are: `"broadcast"`, `"emit"`, `"none"`. * * `"broadcast"` events will be [broadcasted](https://code.angularjs.org/1.2.22/docs/api/ng/type/$rootScope.Scope#$broadcast) on the `$rootScope`. * * `"emit"` events will be [emitted](https://code.angularjs.org/1.2.22/docs/api/ng/type/$rootScope.Scope#$emit) on the `$rootScope`. * * `"none"` events will be will neither be broadcasted nor emitted. * * Current events are `"DS.inject"` and `"DS.eject"`. * * Overridable per resource. */ Defaults.prototype.events = 'broadcast'; /** * @doc function * @id DSProvider * @name DSProvider */ function DSProvider() { /** * @doc property * @id DSProvider.properties:defaults * @name defaults * @description * See the [configuration guide](/documentation/guide/configure/global). * * Properties: * * - `{string}` - `baseUrl` - The url relative to which all AJAX requests will be made. * - `{string}` - `idAttribute` - Default: `"id"` - The attribute that specifies the primary key for resources. * - `{string}` - `defaultAdapter` - Default: `"DSHttpAdapter"` * - `{string}` - `events` - Default: `"broadcast"` [DSProvider.defaults.events](/documentation/api/angular-data/DSProvider.properties:defaults.events) * - `{function}` - `filter` - Default: See [angular-data query language](/documentation/guide/queries/custom). * - `{function}` - `beforeValidate` - See [DSProvider.defaults.beforeValidate](/documentation/api/angular-data/DSProvider.properties:defaults.beforeValidate). Default: No-op * - `{function}` - `validate` - See [DSProvider.defaults.validate](/documentation/api/angular-data/DSProvider.properties:defaults.validate). Default: No-op * - `{function}` - `afterValidate` - See [DSProvider.defaults.afterValidate](/documentation/api/angular-data/DSProvider.properties:defaults.afterValidate). Default: No-op * - `{function}` - `beforeCreate` - See [DSProvider.defaults.beforeCreate](/documentation/api/angular-data/DSProvider.properties:defaults.beforeCreate). Default: No-op * - `{function}` - `afterCreate` - See [DSProvider.defaults.afterCreate](/documentation/api/angular-data/DSProvider.properties:defaults.afterCreate). Default: No-op * - `{function}` - `beforeUpdate` - See [DSProvider.defaults.beforeUpdate](/documentation/api/angular-data/DSProvider.properties:defaults.beforeUpdate). Default: No-op * - `{function}` - `afterUpdate` - See [DSProvider.defaults.afterUpdate](/documentation/api/angular-data/DSProvider.properties:defaults.afterUpdate). Default: No-op * - `{function}` - `beforeDestroy` - See [DSProvider.defaults.beforeDestroy](/documentation/api/angular-data/DSProvider.properties:defaults.beforeDestroy). Default: No-op * - `{function}` - `afterDestroy` - See [DSProvider.defaults.afterDestroy](/documentation/api/angular-data/DSProvider.properties:defaults.afterDestroy). Default: No-op * - `{function}` - `afterInject` - See [DSProvider.defaults.afterInject](/documentation/api/angular-data/DSProvider.properties:defaults.afterInject). Default: No-op * - `{function}` - `beforeInject` - See [DSProvider.defaults.beforeInject](/documentation/api/angular-data/DSProvider.properties:defaults.beforeInject). Default: No-op * - `{function}` - `serialize` - See [DSProvider.defaults.serialize](/documentation/api/angular-data/DSProvider.properties:defaults.serialize). Default: No-op * - `{function}` - `deserialize` - See [DSProvider.defaults.deserialize](/documentation/api/angular-data/DSProvider.properties:defaults.deserialize). Default: No-op */ var defaults = this.defaults = new Defaults(); this.$get = [ '$rootScope', '$log', '$q', 'DSHttpAdapter', 'DSLocalStorageAdapter', 'DSUtils', 'DSErrors', function ($rootScope, $log, $q, DSHttpAdapter, DSLocalStorageAdapter, DSUtils, DSErrors) { var syncMethods = require('./sync_methods'), asyncMethods = require('./async_methods'), cache; try { cache = angular.injector(['angular-data.DSCacheFactory']).get('DSCacheFactory'); } catch (err) { $log.warn(err); $log.warn('DSCacheFactory is unavailable. Resorting to the lesser capabilities of $cacheFactory.'); cache = angular.injector(['ng']).get('$cacheFactory'); } /** * @doc interface * @id DS * @name DS * @description * Public data store interface. Consists of several properties and a number of methods. Injectable as `DS`. * * See the [guide](/documentation/guide/overview/index). */ var DS = { notify: function (definition, event) { var args = Array.prototype.slice.call(arguments, 2); args.unshift(definition.name); args.unshift('DS.' + event); if (definition.events === 'broadcast') { $rootScope.$broadcast.apply($rootScope, args); } else if (definition.events === 'emit') { $rootScope.$emit.apply($rootScope, args); } }, $rootScope: $rootScope, $log: $log, $q: $q, cacheFactory: cache, /** * @doc property * @id DS.properties:defaults * @name defaults * @description * Reference to [DSProvider.defaults](/documentation/api/api/DSProvider.properties:defaults). */ defaults: defaults, /*! * @doc property * @id DS.properties:store * @name store * @description * Meta data for each registered resource. */ store: {}, /*! * @doc property * @id DS.properties:definitions * @name definitions * @description * Registered resource definitions available to the data store. */ definitions: {}, /** * @doc property * @id DS.properties:adapters * @name adapters * @description * Registered adapters available to the data store. Object consists of key-values pairs where the key is * the name of the adapter and the value is the adapter itself. */ adapters: { DSHttpAdapter: DSHttpAdapter, DSLocalStorageAdapter: DSLocalStorageAdapter }, /** * @doc property * @id DS.properties:errors * @name errors * @description * References to the various [error types](/documentation/api/api/errors) used by angular-data. */ errors: DSErrors, /*! * @doc property * @id DS.properties:utils * @name utils * @description * Utility functions used internally by angular-data. */ utils: DSUtils }; DSUtils.deepFreeze(syncMethods); DSUtils.deepFreeze(asyncMethods); DSUtils.deepMixIn(DS, syncMethods); DSUtils.deepMixIn(DS, asyncMethods); DSUtils.deepFreeze(DS.errors); DSUtils.deepFreeze(DS.utils); if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') { $rootScope.$watch(function () { // Throttle angular-data's digest loop to tenths of a second return new Date().getTime() / 100 | 0; }, function () { DS.digest(); }); } return DS; } ]; } module.exports = DSProvider; },{"../utils":68,"./async_methods":43,"./sync_methods":61}],50:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.bindAll(scope, expr, ' + resourceName + ', params[, cb]): '; } /** * @doc method * @id DS.sync_methods:bindAll * @name bindAll * @description * Bind a collection of items in the data store to `scope` under the property specified by `expr` filtered by `params`. * * ## Signature: * ```js * DS.bindAll(scope, expr, resourceName, params[, cb]) * ``` * * ## Example: * * ```js * // bind the documents with ownerId of 5 to the 'docs' property of the $scope * var deregisterFunc = DS.bindAll($scope, 'docs', 'document', { * where: { * ownerId: 5 * } * }); * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {object} scope The scope to bind to. * @param {string} expr An expression used to bind to the scope. Can be used to set nested keys, i.e. `"user.comments"`. * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {object} params Parameter object that is used in filtering the collection. Properties: * * - `{object=}` - `where` - Where clause. * - `{number=}` - `limit` - Limit clause. * - `{number=}` - `skip` - Skip clause. * - `{number=}` - `offset` - Same as skip. * - `{string|array=}` - `orderBy` - OrderBy clause. * * @param {function=} cb Optional callback executed on change. Signature: `cb(err, items)`. * * @returns {function} Scope $watch deregistration function. */ function bindAll(scope, expr, resourceName, params, cb) { var DS = this; var IA = DS.errors.IA; if (!DS.utils.isObject(scope)) { throw new IA(errorPrefix(resourceName) + 'scope: Must be an object!'); } else if (!DS.utils.isString(expr)) { throw new IA(errorPrefix(resourceName) + 'expr: Must be a string!'); } else if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isObject(params)) { throw new IA(errorPrefix(resourceName) + 'params: Must be an object!'); } try { return scope.$watch(function () { return DS.lastModified(resourceName); }, function () { var items = DS.filter(resourceName, params); DS.utils.set(scope, expr, items); if (cb) { cb(null, items); } }); } catch (err) { if (cb) { cb(err); } else { throw err; } } } module.exports = bindAll; },{}],51:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.bindOne(scope, expr, ' + resourceName + ', id[, cb]): '; } /** * @doc method * @id DS.sync_methods:bindOne * @name bindOne * @description * Bind an item in the data store to `scope` under the property specified by `expr`. * * ## Signature: * ```js * DS.bindOne(scope, expr, resourceName, id[, cb]) * ``` * * ## Example: * * ```js * // bind the document with id 5 to the 'doc' property of the $scope * var deregisterFunc = DS.bindOne($scope, 'doc', 'document', 5); * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {object} scope The scope to bind to. * @param {string} expr An expression used to bind to the scope. Can be used to set nested keys, i.e. `"user.profile"`. * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item to bind. * @param {function=} cb Optional callback executed on change. Signature: `cb(err, item)`. * @returns {function} Scope $watch deregistration function. */ function bindOne(scope, expr, resourceName, id, cb) { var DS = this; var IA = DS.errors.IA; if (!DS.utils.isObject(scope)) { throw new IA(errorPrefix(resourceName) + 'scope: Must be an object!'); } else if (!DS.utils.isString(expr)) { throw new IA(errorPrefix(resourceName) + 'expr: Must be a string!'); } else if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new IA(errorPrefix(resourceName) + 'id: Must be a string or a number!'); } try { return scope.$watch(function () { return DS.lastModified(resourceName, id); }, function () { var item = DS.get(resourceName, id); DS.utils.set(scope, expr, item); if (cb) { cb(null, item); } }); } catch (err) { if (cb) { cb(err); } else { throw err; } } } module.exports = bindOne; },{}],52:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.changes(' + resourceName + ', id): '; } /** * @doc method * @id DS.sync_methods:changes * @name changes * @description * Synchronously return the changes object of the item of the type specified by `resourceName` that has the primary key * specified by `id`. This object represents the diff between the item in its current state and the state of the item * the last time it was saved via an async adapter. * * ## Signature: * ```js * DS.changes(resourceName, id) * ``` * * ## Example: * * ```js * var d = DS.get('document', 5); // { author: 'John Anderson', id: 5 } * * d.author = 'Sally'; * * DS.changes('document', 5); // {...} Object describing changes * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item of the changes to retrieve. * @returns {object} The changes of the item of the type specified by `resourceName` with the primary key specified by `id`. */ function changes(resourceName, id) { var DS = this; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new DS.errors.IA(errorPrefix(resourceName) + 'id: Must be a string or a number!'); } var item = DS.get(resourceName, id); if (item) { DS.store[resourceName].observers[id].deliver(); var diff = DS.utils.diffObjectFromOldObject(item, DS.store[resourceName].previousAttributes[id]); DS.utils.forOwn(diff, function (changeset, name) { var toKeep = []; DS.utils.forOwn(changeset, function (value, field) { if (!angular.isFunction(value)) { toKeep.push(field); } }); diff[name] = DS.utils.pick(diff[name], toKeep); }); return diff; } } module.exports = changes; },{}],53:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.createInstance(' + resourceName + '[, attrs][, options]): '; } /** * @doc method * @id DS.sync_methods:createInstance * @name createInstance * @description * Return a new instance of the specified resource. * * ## Signature: * ```js * DS.createInstance(resourceName[, attrs][, options]) * ``` * * ## Example: * * ```js * // Thanks to createInstance, you don't have to do this anymore * var User = DS.definitions.user[DS.definitions.user.class]; * * var user = DS.createInstance('user'); * * user instanceof User; // true * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {object=} attrs Optional attributes to mix in to the new instance. * @param {object=} options Optional configuration. Properties: * * - `{boolean=}` - `useClass` - Whether to use the resource's wrapper class. Default: `true`. * * @returns {object} The new instance */ function createInstance(resourceName, attrs, options) { var DS = this; var IA = DS.errors.IA; attrs = attrs || {}; options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (attrs && !DS.utils.isObject(attrs)) { throw new IA(errorPrefix(resourceName) + 'attrs: Must be an object!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName) + 'options: Must be an object!'); } if (!('useClass' in options)) { options.useClass = true; } var item; if (options.useClass) { var Func = DS.definitions[resourceName][DS.definitions[resourceName].class]; item = new Func(); } else { item = {}; } return DS.utils.deepMixIn(item, attrs); } module.exports = createInstance; },{}],54:[function(require,module,exports){ /*jshint evil:true*/ var errorPrefix = 'DS.defineResource(definition): '; function Resource(utils, options) { utils.deepMixIn(this, options); if ('endpoint' in options) { this.endpoint = options.endpoint; } else { this.endpoint = this.name; } } var methodsToProxy = [ 'bindAll', 'bindOne', 'changes', 'create', 'createInstance', 'destroy', 'destroyAll', 'eject', 'ejectAll', 'filter', 'find', 'findAll', 'get', 'hasChanges', 'inject', 'lastModified', 'lastSaved', 'loadRelations', 'previous', 'refresh', 'save', 'update', 'updateAll' ]; /** * @doc method * @id DS.sync_methods:defineResource * @name defineResource * @description * Define a resource and register it with the data store. * * ## Signature: * ```js * DS.defineResource(definition) * ``` * * ## Example: * * ```js * DS.defineResource({ * name: 'document', * idAttribute: '_id', * endpoint: '/documents * baseUrl: 'http://myapp.com/api', * beforeDestroy: function (resourceName attrs, cb) { * console.log('looks good to me'); * cb(null, attrs); * } * }); * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{RuntimeError}` * * @param {string|object} definition Name of resource or resource definition object: Properties: * * - `{string}` - `name` - The name by which this resource will be identified. * - `{string="id"}` - `idAttribute` - The attribute that specifies the primary key for this resource. * - `{string=}` - `endpoint` - The attribute that specifies the primary key for this resource. Default is the value of `name`. * - `{string=}` - `baseUrl` - The url relative to which all AJAX requests will be made. * - `{boolean=}` - `useClass` - Whether to use a wrapper class created from the ProperCase name of the resource. The wrapper will always be used for resources that have `methods` defined. * - `{function=}` - `defaultFilter` - Override the filtering used internally by `DS.filter` with you own function here. * - `{*=}` - `meta` - A property reserved for developer use. This will never be used by the API. * - `{object=}` - `methods` - If provided, items of this resource will be wrapped in a constructor function that is * empty save for the attributes in this option which will be mixed in to the constructor function prototype. Enabling * this feature for this resource will incur a slight performance penalty, but allows you to give custom behavior to what * are now "instances" of this resource. * - `{function=}` - `beforeValidate` - Lifecycle hook. Overrides global. Signature: `beforeValidate(resourceName, attrs, cb)`. Callback signature: `cb(err, attrs)`. * - `{function=}` - `validate` - Lifecycle hook. Overrides global. Signature: `validate(resourceName, attrs, cb)`. Callback signature: `cb(err, attrs)`. * - `{function=}` - `afterValidate` - Lifecycle hook. Overrides global. Signature: `afterValidate(resourceName, attrs, cb)`. Callback signature: `cb(err, attrs)`. * - `{function=}` - `beforeCreate` - Lifecycle hook. Overrides global. Signature: `beforeCreate(resourceName, attrs, cb)`. Callback signature: `cb(err, attrs)`. * - `{function=}` - `afterCreate` - Lifecycle hook. Overrides global. Signature: `afterCreate(resourceName, attrs, cb)`. Callback signature: `cb(err, attrs)`. * - `{function=}` - `beforeUpdate` - Lifecycle hook. Overrides global. Signature: `beforeUpdate(resourceName, attrs, cb)`. Callback signature: `cb(err, attrs)`. * - `{function=}` - `afterUpdate` - Lifecycle hook. Overrides global. Signature: `afterUpdate(resourceName, attrs, cb)`. Callback signature: `cb(err, attrs)`. * - `{function=}` - `beforeDestroy` - Lifecycle hook. Overrides global. Signature: `beforeDestroy(resourceName, attrs, cb)`. Callback signature: `cb(err, attrs)`. * - `{function=}` - `afterDestroy` - Lifecycle hook. Overrides global. Signature: `afterDestroy(resourceName, attrs, cb)`. Callback signature: `cb(err, attrs)`. * - `{function=}` - `beforeInject` - Lifecycle hook. Overrides global. Signature: `beforeInject(resourceName, attrs)`. * - `{function=}` - `afterInject` - Lifecycle hook. Overrides global. Signature: `afterInject(resourceName, attrs)`. * - `{function=}` - `serialize` - Serialization hook. Overrides global. Signature: `serialize(resourceName, attrs)`. * - `{function=}` - `deserialize` - Deserialization hook. Overrides global. Signature: `deserialize(resourceName, attrs)`. * * See [DSProvider.defaults](/documentation/api/angular-data/DSProvider.properties:defaults). */ function defineResource(definition) { var DS = this; var IA = DS.errors.IA; if (DS.utils.isString(definition)) { definition = definition.replace(/\s/gi, ''); definition = { name: definition }; } if (!DS.utils.isObject(definition)) { throw new IA(errorPrefix + 'definition: Must be an object!'); } else if (!DS.utils.isString(definition.name)) { throw new IA(errorPrefix + 'definition.name: Must be a string!'); } else if (definition.idAttribute && !DS.utils.isString(definition.idAttribute)) { throw new IA(errorPrefix + 'definition.idAttribute: Must be a string!'); } else if (definition.endpoint && !DS.utils.isString(definition.endpoint)) { throw new IA(errorPrefix + 'definition.endpoint: Must be a string!'); } else if (DS.store[definition.name]) { throw new DS.errors.R(errorPrefix + definition.name + ' is already registered!'); } try { // Inherit from global defaults Resource.prototype = DS.defaults; DS.definitions[definition.name] = new Resource(DS.utils, definition); var def = DS.definitions[definition.name]; // Remove this in v0.11.0 and make a breaking change notice // the the `filter` option has been renamed to `defaultFilter` if (def.filter) { def.defaultFilter = def.filter; delete def.filter; } // Setup the cache var cache = DS.cacheFactory('DS.' + def.name, { maxAge: def.maxAge || null, recycleFreq: def.recycleFreq || 1000, cacheFlushInterval: def.cacheFlushInterval || null, deleteOnExpire: def.deleteOnExpire || 'none', onExpire: function (id) { DS.eject(def.name, id); }, capacity: Number.MAX_VALUE, storageMode: 'memory', storageImpl: null, disabled: false, storagePrefix: 'DS.' + def.name }); // Create the wrapper class for the new resource def.class = DS.utils.pascalCase(definition.name); eval('function ' + def.class + '() {}'); def[def.class] = eval(def.class); // Apply developer-defined methods if (def.methods) { DS.utils.deepMixIn(def[def.class].prototype, def.methods); } // Prepare for computed properties if (def.computed) { DS.utils.forOwn(def.computed, function (fn, field) { if (angular.isFunction(fn)) { def.computed[field] = [fn]; fn = def.computed[field]; } if (def.methods && field in def.methods) { DS.$log.warn(errorPrefix + 'Computed property "' + field + '" conflicts with previously defined prototype method!'); } var deps; if (fn.length === 1) { var match = fn[0].toString().match(/function.*?\(([\s\S]*?)\)/); deps = match[1].split(','); def.computed[field] = deps.concat(fn); fn = def.computed[field]; if (deps.length) { DS.$log.warn(errorPrefix + 'Use the computed property array syntax for compatibility with minified code!'); } } deps = fn.slice(0, fn.length - 1); angular.forEach(deps, function (val, index) { deps[index] = val.trim(); }); fn.deps = DS.utils.filter(deps, function (dep) { return !!dep; }); }); } // Initialize store data for the new resource DS.store[def.name] = { collection: [], completedQueries: {}, pendingQueries: {}, index: cache, modified: {}, saved: {}, previousAttributes: {}, observers: {}, collectionModified: 0 }; // Proxy DS methods with shorthand ones angular.forEach(methodsToProxy, function (name) { if (name === 'bindOne' || name === 'bindAll') { def[name] = function () { var args = Array.prototype.slice.call(arguments); args.splice(2, 0, def.name); return DS[name].apply(DS, args); }; } else { def[name] = function () { var args = Array.prototype.slice.call(arguments); args.unshift(def.name); return DS[name].apply(DS, args); }; } }); return def; } catch (err) { DS.$log.error(err); delete DS.definitions[definition.name]; delete DS.store[definition.name]; throw err; } } module.exports = defineResource; },{}],55:[function(require,module,exports){ var observe = require('../../../lib/observe-js/observe-js'); /** * @doc method * @id DS.sync_methods:digest * @name digest * @description * Trigger a digest loop that checks for changes and updates the `lastModified` timestamp if an object has changed. * Anything $watching `DS.lastModified(...)` will detect the updated timestamp and execute the callback function. * * ## Signature: * ```js * DS.digest() * ``` * * ## Example: * * ```js * Works like $scope.$apply() * ``` * */ function digest() { if (!this.$rootScope.$$phase) { this.$rootScope.$apply(function () { observe.Platform.performMicrotaskCheckpoint(); }); } else { observe.Platform.performMicrotaskCheckpoint(); } } module.exports = digest; },{"../../../lib/observe-js/observe-js":1}],56:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.eject(' + resourceName + ', ' + id + '): '; } function _eject(definition, resource, id) { var item; var found = false; for (var i = 0; i < resource.collection.length; i++) { if (resource.collection[i][definition.idAttribute] == id) { item = resource.collection[i]; found = true; break; } } if (found) { resource.collection.splice(i, 1); resource.observers[id].close(); delete resource.observers[id]; resource.index.remove(id); delete resource.previousAttributes[id]; delete resource.completedQueries[id]; delete resource.modified[id]; delete resource.saved[id]; resource.collectionModified = this.utils.updateTimestamp(resource.collectionModified); this.notify(definition, 'eject', item); return item; } } /** * @doc method * @id DS.sync_methods:eject * @name eject * @description * Eject the item of the specified type that has the given primary key from the data store. Ejection only removes items * from the data store and does not attempt to delete items on the server. * * ## Signature: * ```js * DS.eject(resourceName[, id]) * ``` * * ## Example: * * ```js * DS.get('document', 45); // { title: 'How to Cook', id: 45 } * * DS.eject('document', 45); * * DS.get('document', 45); // undefined * ``` * * ```js * $rootScope.$on('DS.eject', function ($event, resourceName, ejected) {...}); * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item to eject. * @returns {object} A reference to the item that was ejected from the data store. */ function eject(resourceName, id) { var DS = this; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new DS.errors.IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } var definition = DS.definitions[resourceName]; var resource = DS.store[resourceName]; var ejected; if (!DS.$rootScope.$$phase) { DS.$rootScope.$apply(function () { ejected = _eject.call(DS, definition, resource, id); }); } else { ejected = _eject.call(DS, definition, resource, id); } return ejected; } module.exports = eject; },{}],57:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.ejectAll(' + resourceName + '[, params]): '; } function _ejectAll(definition, resource, params) { var DS = this; var queryHash = DS.utils.toJson(params); var items = DS.filter(definition.name, params); var ids = DS.utils.toLookup(items, definition.idAttribute); angular.forEach(ids, function (item, id) { DS.eject(definition.name, id); }); delete resource.completedQueries[queryHash]; resource.collectionModified = DS.utils.updateTimestamp(resource.collectionModified); DS.notify(definition, 'eject', items); return items; } /** * @doc method * @id DS.sync_methods:ejectAll * @name ejectAll * @description * Eject all matching items of the specified type from the data store. If query is specified then all items of the * specified type will be removed. Ejection only removes items from the data store and does not attempt to delete items * on the server. * * ## Signature: * ```js * DS.ejectAll(resourceName[, params]) * ``` * * ## Example: * * ```js * DS.get('document', 45); // { title: 'How to Cook', id: 45 } * * DS.eject('document', 45); * * DS.get('document', 45); // undefined * ``` * * Eject all items of the specified type that match the criteria from the data store. * * ```js * DS.filter('document'); // [ { title: 'How to Cook', id: 45, author: 'John Anderson' }, * // { title: 'How to Eat', id: 46, author: 'Sally Jane' } ] * * DS.ejectAll('document', { where: { author: 'Sally Jane' } }); * * DS.filter('document'); // [ { title: 'How to Cook', id: 45, author: 'John Anderson' } ] * ``` * * Eject all items of the specified type from the data store. * * ```js * DS.filter('document'); // [ { title: 'How to Cook', id: 45, author: 'John Anderson' }, * // { title: 'How to Eat', id: 46, author: 'Sally Jane' } ] * * DS.ejectAll('document'); * * DS.filter('document'); // [ ] * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {object} params Parameter object that is serialized into the query string. Properties: * * - `{object=}` - `where` - Where clause. * - `{number=}` - `limit` - Limit clause. * - `{number=}` - `skip` - Skip clause. * - `{number=}` - `offset` - Same as skip. * - `{string|array=}` - `orderBy` - OrderBy clause. * * @returns {array} The items that were ejected from the data store. */ function ejectAll(resourceName, params) { var DS = this; params = params || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isObject(params)) { throw new DS.errors.IA(errorPrefix(resourceName) + 'params: Must be an object!'); } var definition = DS.definitions[resourceName]; var resource = DS.store[resourceName]; var ejected; if (DS.utils.isEmpty(params)) { resource.completedQueries = {}; } if (!DS.$rootScope.$$phase) { DS.$rootScope.$apply(function () { ejected = _ejectAll.apply(DS, [definition, resource, params]); }); } else { ejected = _ejectAll.apply(DS, [definition, resource, params]); } return ejected; } module.exports = ejectAll; },{}],58:[function(require,module,exports){ function errorPrefix(resourceName) { return 'DS.filter(' + resourceName + '[, params][, options]): '; } /** * @doc method * @id DS.sync_methods:filter * @name filter * @description * Synchronously filter items in the data store of the type specified by `resourceName`. * * ## Signature: * ```js * DS.filter(resourceName[, params][, options]) * ``` * * ## Example: * * ```js * TODO: filter(resourceName, params[, options]) example * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {object=} params Parameter object that is serialized into the query string. Properties: * * - `{object=}` - `where` - Where clause. * - `{number=}` - `limit` - Limit clause. * - `{number=}` - `skip` - Skip clause. * - `{number=}` - `offset` - Same as skip. * - `{string|array=}` - `orderBy` - OrderBy clause. * * @param {object=} options Optional configuration. Properties: * * - `{boolean=}` - `loadFromServer` - Send the query to server if it has not been sent yet. Default: `false`. * - `{boolean=}` - `allowSimpleWhere` - Treat top-level fields on the `params` argument as simple "where" equality clauses. Default: `true`. * * @returns {array} The filtered collection of items of the type specified by `resourceName`. */ function filter(resourceName, params, options) { var DS = this; var IA = DS.errors.IA; options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (params && !DS.utils.isObject(params)) { throw new IA(errorPrefix(resourceName) + 'params: Must be an object!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName) + 'options: Must be an object!'); } var definition = DS.definitions[resourceName]; var resource = DS.store[resourceName]; // Protect against null params = params || {}; if ('allowSimpleWhere' in options) { options.allowSimpleWhere = !!options.allowSimpleWhere; } else { options.allowSimpleWhere = true; } var queryHash = DS.utils.toJson(params); if (!(queryHash in resource.completedQueries) && options.loadFromServer) { // This particular query has never been completed if (!resource.pendingQueries[queryHash]) { // This particular query has never even been started DS.findAll(resourceName, params, options); } } return definition.defaultFilter.call(DS, resource.collection, resourceName, params, options); } module.exports = filter; },{}],59:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.get(' + resourceName + ', ' + id + '): '; } /** * @doc method * @id DS.sync_methods:get * @name get * @description * Synchronously return the resource with the given id. The data store will forward the request to the server if the * item is not in the cache and `loadFromServer` is set to `true` in the options hash. * * ## Signature: * ```js * DS.get(resourceName, id[, options]) * ``` * * ## Example: * * ```js * DS.get('document', 5'); // { author: 'John Anderson', id: 5 } * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item to retrieve. * @param {object=} options Optional configuration. Properties: * * - `{boolean=}` - `loadFromServer` - Send the query to server if it has not been sent yet. Default: `false`. * * @returns {object} The item of the type specified by `resourceName` with the primary key specified by `id`. */ function get(resourceName, id, options) { var DS = this; var IA = DS.errors.IA; options = options || {}; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } else if (!DS.utils.isObject(options)) { throw new IA(errorPrefix(resourceName, id) + 'options: Must be an object!'); } // cache miss, request resource from server var item = DS.store[resourceName].index.get(id); if (!item && options.loadFromServer) { DS.find(resourceName, id).then(null, function (err) { return DS.$q.reject(err); }); } // return resource from cache return item; } module.exports = get; },{}],60:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.hasChanges(' + resourceName + ', ' + id + '): '; } function diffIsEmpty(utils, diff) { return !(utils.isEmpty(diff.added) && utils.isEmpty(diff.removed) && utils.isEmpty(diff.changed)); } /** * @doc method * @id DS.sync_methods:hasChanges * @name hasChanges * @description * Synchronously return whether object of the item of the type specified by `resourceName` that has the primary key * specified by `id` has changes. * * ## Signature: * ```js * DS.hasChanges(resourceName, id) * ``` * * ## Example: * * ```js * var d = DS.get('document', 5); // { author: 'John Anderson', id: 5 } * * d.author = 'Sally'; * * DS.hasChanges('document', 5); // true * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item. * @returns {boolean} Whether the item of the type specified by `resourceName` with the primary key specified by `id` has changes. */ function hasChanges(resourceName, id) { var DS = this; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new DS.errors.IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } // return resource from cache if (DS.get(resourceName, id)) { return diffIsEmpty(DS.utils, DS.changes(resourceName, id)); } else { return false; } } module.exports = hasChanges; },{}],61:[function(require,module,exports){ module.exports = { /** * @doc method * @id DS.sync_methods:bindOne * @name bindOne * @methodOf DS * @description * See [DS.bindOne](/documentation/api/api/DS.sync_methods:bindOne). */ bindOne: require('./bindOne'), /** * @doc method * @id DS.sync_methods:bindAll * @name bindAll * @methodOf DS * @description * See [DS.bindAll](/documentation/api/api/DS.sync_methods:bindAll). */ bindAll: require('./bindAll'), /** * @doc method * @id DS.sync_methods:createInstance * @name createInstance * @methodOf DS * @description * See [DS.createInstance](/documentation/api/api/DS.sync_methods:createInstance). */ createInstance: require('./createInstance'), /** * @doc method * @id DS.sync_methods:defineResource * @name defineResource * @methodOf DS * @description * See [DS.defineResource](/documentation/api/api/DS.sync_methods:defineResource). */ defineResource: require('./defineResource'), /** * @doc method * @id DS.sync_methods:eject * @name eject * @methodOf DS * @description * See [DS.eject](/documentation/api/api/DS.sync_methods:eject). */ eject: require('./eject'), /** * @doc method * @id DS.sync_methods:ejectAll * @name ejectAll * @methodOf DS * @description * See [DS.ejectAll](/documentation/api/api/DS.sync_methods:ejectAll). */ ejectAll: require('./ejectAll'), /** * @doc method * @id DS.sync_methods:filter * @name filter * @methodOf DS * @description * See [DS.filter](/documentation/api/api/DS.sync_methods:filter). */ filter: require('./filter'), /** * @doc method * @id DS.sync_methods:get * @name get * @methodOf DS * @description * See [DS.get](/documentation/api/api/DS.sync_methods:get). */ get: require('./get'), /** * @doc method * @id DS.sync_methods:inject * @name inject * @methodOf DS * @description * See [DS.inject](/documentation/api/api/DS.sync_methods:inject). */ inject: require('./inject'), /** * @doc method * @id DS.sync_methods:lastModified * @name lastModified * @methodOf DS * @description * See [DS.lastModified](/documentation/api/api/DS.sync_methods:lastModified). */ lastModified: require('./lastModified'), /** * @doc method * @id DS.sync_methods:lastSaved * @name lastSaved * @methodOf DS * @description * See [DS.lastSaved](/documentation/api/api/DS.sync_methods:lastSaved). */ lastSaved: require('./lastSaved'), /** * @doc method * @id DS.sync_methods:digest * @name digest * @methodOf DS * @description * See [DS.digest](/documentation/api/api/DS.sync_methods:digest). */ digest: require('./digest'), /** * @doc method * @id DS.sync_methods:changes * @name changes * @methodOf DS * @description * See [DS.changes](/documentation/api/api/DS.sync_methods:changes). */ changes: require('./changes'), /** * @doc method * @id DS.sync_methods:previous * @name previous * @methodOf DS * @description * See [DS.previous](/documentation/api/api/DS.sync_methods:previous). */ previous: require('./previous'), /** * @doc method * @id DS.sync_methods:hasChanges * @name hasChanges * @methodOf DS * @description * See [DS.hasChanges](/documentation/api/api/DS.sync_methods:hasChanges). */ hasChanges: require('./hasChanges') }; },{"./bindAll":50,"./bindOne":51,"./changes":52,"./createInstance":53,"./defineResource":54,"./digest":55,"./eject":56,"./ejectAll":57,"./filter":58,"./get":59,"./hasChanges":60,"./inject":62,"./lastModified":63,"./lastSaved":64,"./previous":65}],62:[function(require,module,exports){ var observe = require('../../../lib/observe-js/observe-js'); function errorPrefix(resourceName) { return 'DS.inject(' + resourceName + ', attrs): '; } function _inject(definition, resource, attrs) { var DS = this; var $log = DS.$log; function _react(added, removed, changed, oldValueFn) { var target = this; var innerId = (oldValueFn && oldValueFn(definition.idAttribute)) ? oldValueFn(definition.idAttribute) : target[definition.idAttribute]; resource.modified[innerId] = DS.utils.updateTimestamp(resource.modified[innerId]); resource.collectionModified = DS.utils.updateTimestamp(resource.collectionModified); if (definition.computed) { var item = DS.get(definition.name, innerId); DS.utils.forOwn(definition.computed, function (fn, field) { var compute = false; // check if required fields changed angular.forEach(fn.deps, function (dep) { if (dep in added || dep in removed || dep in changed || !(field in item)) { compute = true; } }); compute = compute || !fn.deps.length; if (compute) { var args = []; angular.forEach(fn.deps, function (dep) { args.push(item[dep]); }); // recompute property item[field] = fn[fn.length - 1].apply(item, args); } }); } if (definition.idAttribute in changed) { $log.error('Doh! You just changed the primary key of an object! ' + 'I don\'t know how to handle this yet, so your data for the "' + definition.name + '" resource is now in an undefined (probably broken) state.'); } } var injected; if (DS.utils.isArray(attrs)) { injected = []; for (var i = 0; i < attrs.length; i++) { injected.push(_inject.call(DS, definition, resource, attrs[i])); } } else { // check if "idAttribute" is a computed property var c = definition.computed; var idA = definition.idAttribute; if (c && c[idA]) { var args = []; angular.forEach(c[idA].deps, function (dep) { args.push(attrs[dep]); }); attrs[idA] = c[idA][c[idA].length - 1].apply(attrs, args); } if (!(idA in attrs)) { var error = new DS.errors.R(errorPrefix(definition.name) + 'attrs: Must contain the property specified by `idAttribute`!'); $log.error(error); throw error; } else { try { definition.beforeInject(definition.name, attrs); var id = attrs[idA]; var item = DS.get(definition.name, id); if (!item) { if (definition.methods || definition.useClass) { if (attrs instanceof definition[definition.class]) { item = attrs; } else { item = new definition[definition.class](); } } else { item = {}; } resource.previousAttributes[id] = {}; DS.utils.deepMixIn(item, attrs); DS.utils.deepMixIn(resource.previousAttributes[id], attrs); resource.collection.push(item); resource.observers[id] = new observe.ObjectObserver(item); resource.observers[id].open(_react, item); resource.index.put(id, item); _react.call(item, {}, {}, {}); } else { DS.utils.deepMixIn(item, attrs); if (typeof resource.index.touch === 'function') { resource.index.touch(id); } else { resource.index.put(id, resource.index.get(id)); } resource.observers[id].deliver(); } resource.saved[id] = DS.utils.updateTimestamp(resource.saved[id]); definition.afterInject(definition.name, item); injected = item; } catch (err) { $log.error(err); $log.error('inject failed!', definition.name, attrs); } } } return injected; } function _injectRelations(definition, injected) { var DS = this; DS.utils.forOwn(definition.relations, function (relation, type) { DS.utils.forOwn(relation, function (def, relationName) { if (DS.definitions[relationName] && injected[def.localField]) { try { injected[def.localField] = DS.inject(relationName, injected[def.localField]); } catch (err) { DS.$log.error(errorPrefix(definition.name) + 'Failed to inject ' + type + ' relation: "' + relationName + '"!', err); } } }); }); } /** * @doc method * @id DS.sync_methods:inject * @name inject * @description * Inject the given item into the data store as the specified type. If `attrs` is an array, inject each item into the * data store. Injecting an item into the data store does not save it to the server. Emits a `"DS.inject"` event. * * ## Signature: * ```js * DS.inject(resourceName, attrs[, options]) * ``` * * ## Examples: * * ```js * DS.get('document', 45); // undefined * * DS.inject('document', { title: 'How to Cook', id: 45 }); * * DS.get('document', 45); // { title: 'How to Cook', id: 45 } * ``` * * Inject a collection into the data store: * * ```js * DS.filter('document'); // [ ] * * DS.inject('document', [ { title: 'How to Cook', id: 45 }, { title: 'How to Eat', id: 46 } ]); * * DS.filter('document'); // [ { title: 'How to Cook', id: 45 }, { title: 'How to Eat', id: 46 } ] * ``` * * ```js * $rootScope.$on('DS.inject', function ($event, resourceName, injected) {...}); * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{RuntimeError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {object|array} attrs The item or collection of items to inject into the data store. * @returns {object|array} A reference to the item that was injected into the data store or an array of references to * the items that were injected into the data store. */ function inject(resourceName, attrs) { var DS = this; var IA = DS.errors.IA; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName) + resourceName); } else if (!DS.utils.isObject(attrs) && !DS.utils.isArray(attrs)) { throw new IA(errorPrefix(resourceName) + 'attrs: Must be an object or an array!'); } var definition = DS.definitions[resourceName]; var resource = DS.store[resourceName]; var injected; if (!DS.$rootScope.$$phase) { DS.$rootScope.$apply(function () { injected = _inject.call(DS, definition, resource, attrs); }); } else { injected = _inject.call(DS, definition, resource, attrs); } if (definition.relations) { _injectRelations.call(DS, definition, injected); } DS.notify(definition, 'inject', injected); return injected; } module.exports = inject; },{"../../../lib/observe-js/observe-js":1}],63:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.lastModified(' + resourceName + '[, ' + id + ']): '; } /** * @doc method * @id DS.sync_methods:lastModified * @name lastModified * @description * Return the timestamp of the last time either the collection for `resourceName` or the item of type `resourceName` * with the given primary key was modified. * * ## Signature: * ```js * DS.lastModified(resourceName[, id]) * ``` * * ## Example: * * ```js * DS.lastModified('document', 5); // undefined * * DS.find('document', 5).then(function (document) { * DS.lastModified('document', 5); // 1234235825494 * }); * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number=} id The primary key of the item to remove. * @returns {number} The timestamp of the last time either the collection for `resourceName` or the item of type * `resourceName` with the given primary key was modified. */ function lastModified(resourceName, id) { var DS = this; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (id && !DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new DS.errors.IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } if (id) { if (!(id in DS.store[resourceName].modified)) { DS.store[resourceName].modified[id] = 0; } return DS.store[resourceName].modified[id]; } return DS.store[resourceName].collectionModified; } module.exports = lastModified; },{}],64:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.lastSaved(' + resourceName + '[, ' + id + ']): '; } /** * @doc method * @id DS.sync_methods:lastSaved * @name lastSaved * @description * Return the timestamp of the last time either the collection for `resourceName` or the item of type `resourceName` * with the given primary key was saved via an async adapter. * * ## Signature: * ```js * DS.lastSaved(resourceName[, id]) * ``` * * ## Example: * * ```js * DS.lastModified('document', 5); // undefined * DS.lastSaved('document', 5); // undefined * * DS.find('document', 5).then(function (document) { * DS.lastModified('document', 5); // 1234235825494 * DS.lastSaved('document', 5); // 1234235825494 * * document.author = 'Sally'; * * DS.lastModified('document', 5); // 1234304985344 - something different * DS.lastSaved('document', 5); // 1234235825494 - still the same * }); * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item for which to retrieve the lastSaved timestamp. * @returns {number} The timestamp of the last time the item of type `resourceName` with the given primary key was saved. */ function lastSaved(resourceName, id) { var DS = this; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new DS.errors.IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } if (!(id in DS.store[resourceName].saved)) { DS.store[resourceName].saved[id] = 0; } return DS.store[resourceName].saved[id]; } module.exports = lastSaved; },{}],65:[function(require,module,exports){ function errorPrefix(resourceName, id) { return 'DS.previous(' + resourceName + '[, ' + id + ']): '; } /** * @doc method * @id DS.sync_methods:previous * @name previous * @description * Synchronously return the previous attributes of the item of the type specified by `resourceName` that has the primary key * specified by `id`. This object represents the state of the item the last time it was saved via an async adapter. * * ## Signature: * ```js * DS.previous(resourceName, id) * ``` * * ## Example: * * ```js * var d = DS.get('document', 5); // { author: 'John Anderson', id: 5 } * * d.author = 'Sally'; * * d; // { author: 'Sally', id: 5 } * * DS.previous('document', 5); // { author: 'John Anderson', id: 5 } * ``` * * ## Throws * * - `{IllegalArgumentError}` * - `{NonexistentResourceError}` * * @param {string} resourceName The resource type, e.g. 'user', 'comment', etc. * @param {string|number} id The primary key of the item whose previous attributes are to be retrieved. * @returns {object} The previous attributes of the item of the type specified by `resourceName` with the primary key specified by `id`. */ function previous(resourceName, id) { var DS = this; if (!DS.definitions[resourceName]) { throw new DS.errors.NER(errorPrefix(resourceName, id) + resourceName); } else if (!DS.utils.isString(id) && !DS.utils.isNumber(id)) { throw new DS.errors.IA(errorPrefix(resourceName, id) + 'id: Must be a string or a number!'); } // return resource from cache return angular.copy(DS.store[resourceName].previousAttributes[id]); } module.exports = previous; },{}],66:[function(require,module,exports){ /** * @doc function * @id errors.types:IllegalArgumentError * @name IllegalArgumentError * @description Error that is thrown/returned when a caller does not honor the pre-conditions of a method/function. * @param {string=} message Error message. Default: `"Illegal Argument!"`. * @returns {IllegalArgumentError} A new instance of `IllegalArgumentError`. */ function IllegalArgumentError(message) { Error.call(this); if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor); } /** * @doc property * @id errors.types:IllegalArgumentError.type * @name type * @propertyOf errors.types:IllegalArgumentError * @description Name of error type. Default: `"IllegalArgumentError"`. */ this.type = this.constructor.name; /** * @doc property * @id errors.types:IllegalArgumentError.message * @name message * @propertyOf errors.types:IllegalArgumentError * @description Error message. Default: `"Illegal Argument!"`. */ this.message = message || 'Illegal Argument!'; } IllegalArgumentError.prototype = Object.create(Error.prototype); IllegalArgumentError.prototype.constructor = IllegalArgumentError; /** * @doc function * @id errors.types:RuntimeError * @name RuntimeError * @description Error that is thrown/returned for invalid state during runtime. * @param {string=} message Error message. Default: `"Runtime Error!"`. * @returns {RuntimeError} A new instance of `RuntimeError`. */ function RuntimeError(message) { Error.call(this); if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor); } /** * @doc property * @id errors.types:RuntimeError.type * @name type * @propertyOf errors.types:RuntimeError * @description Name of error type. Default: `"RuntimeError"`. */ this.type = this.constructor.name; /** * @doc property * @id errors.types:RuntimeError.message * @name message * @propertyOf errors.types:RuntimeError * @description Error message. Default: `"Runtime Error!"`. */ this.message = message || 'RuntimeError Error!'; } RuntimeError.prototype = Object.create(Error.prototype); RuntimeError.prototype.constructor = RuntimeError; /** * @doc function * @id errors.types:NonexistentResourceError * @name NonexistentResourceError * @description Error that is thrown/returned when trying to access a resource that does not exist. * @param {string=} resourceName Name of non-existent resource. * @returns {NonexistentResourceError} A new instance of `NonexistentResourceError`. */ function NonexistentResourceError(resourceName) { Error.call(this); if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor); } /** * @doc property * @id errors.types:NonexistentResourceError.type * @name type * @propertyOf errors.types:NonexistentResourceError * @description Name of error type. Default: `"NonexistentResourceError"`. */ this.type = this.constructor.name; /** * @doc property * @id errors.types:NonexistentResourceError.message * @name message * @propertyOf errors.types:NonexistentResourceError * @description Error message. Default: `"Runtime Error!"`. */ this.message = (resourceName || '') + ' is not a registered resource!'; } NonexistentResourceError.prototype = Object.create(Error.prototype); NonexistentResourceError.prototype.constructor = NonexistentResourceError; /** * @doc interface * @id errors * @name angular-data error types * @description * Various error types that may be thrown by angular-data. * * - [IllegalArgumentError](/documentation/api/api/errors.types:IllegalArgumentError) * - [RuntimeError](/documentation/api/api/errors.types:RuntimeError) * - [NonexistentResourceError](/documentation/api/api/errors.types:NonexistentResourceError) * * References to the constructor functions of these errors can be found in `DS.errors`. */ module.exports = [function () { return { IllegalArgumentError: IllegalArgumentError, IA: IllegalArgumentError, RuntimeError: RuntimeError, R: RuntimeError, NonexistentResourceError: NonexistentResourceError, NER: NonexistentResourceError }; }]; },{}],67:[function(require,module,exports){ (function (window, angular, undefined) { 'use strict'; /** * @doc overview * @id angular-data * @name angular-data * @description * __Version:__ 0.10.0 * * ## Install * * #### Bower * ```text * bower install angular-data * ``` * * Load `dist/angular-data.js` or `dist/angular-data.min.js` onto your web page after Angular.js. * * #### Npm * ```text * npm install angular-data * ``` * * Load `dist/angular-data.js` or `dist/angular-data.min.js` onto your web page after Angular.js. * * #### Manual download * Download angular-data-<%= pkg.version %>.js from the [Releases](https://github.com/jmdobry/angular-data/releases) * section of the angular-data GitHub project. * * ## Load into Angular * Your Angular app must depend on the module `"angular-data.DS"` in order to use angular-data. Loading * angular-data into your app allows you to inject the following: * * - `DS` * - `DSHttpAdapter` * - `DSUtils` * - `DSErrors` * * [DS](/documentation/api/api/DS) is the Data Store itself, which you will inject often. * [DSHttpAdapter](/documentation/api/api/DSHttpAdapter) is useful as a wrapper for `$http` and is configurable. * [DSUtils](/documentation/api/api/DSUtils) has some useful utility methods. * [DSErrors](/documentation/api/api/DSErrors) provides references to the various errors thrown by the data store. */ angular.module('angular-data.DS', ['ng']) .factory('DSUtils', require('./utils')) .factory('DSErrors', require('./errors')) .provider('DSHttpAdapter', require('./adapters/http')) .provider('DSLocalStorageAdapter', require('./adapters/localStorage')) .provider('DS', require('./datastore')) .config(['$provide', function ($provide) { $provide.decorator('$q', ['$delegate', function ($delegate) { // do whatever you you want $delegate.promisify = function (fn, target) { var _this = this; return function () { var deferred = _this.defer(), args = Array.prototype.slice.apply(arguments); args.push(function (err, result) { if (err) { deferred.reject(err); } else { deferred.resolve(result); } }); try { fn.apply(target || this, args); } catch (err) { deferred.reject(err); } return deferred.promise; }; }; return $delegate; }]); }]); })(window, window.angular); },{"./adapters/http":36,"./adapters/localStorage":37,"./datastore":49,"./errors":66,"./utils":68}],68:[function(require,module,exports){ module.exports = [function () { return { isBoolean: require('mout/lang/isBoolean'), isString: angular.isString, isArray: angular.isArray, isObject: angular.isObject, isNumber: angular.isNumber, isFunction: angular.isFunction, isEmpty: require('mout/lang/isEmpty'), toJson: angular.toJson, makePath: require('mout/string/makePath'), upperCase: require('mout/string/upperCase'), pascalCase: require('mout/string/pascalCase'), deepMixIn: require('mout/object/deepMixIn'), forOwn: require('mout/object/forOwn'), pick: require('mout/object/pick'), set: require('mout/object/set'), contains: require('mout/array/contains'), filter: require('mout/array/filter'), toLookup: require('mout/array/toLookup'), slice: require('mout/array/slice'), sort: require('mout/array/sort'), updateTimestamp: function (timestamp) { var newTimestamp = typeof Date.now === 'function' ? Date.now() : new Date().getTime(); if (timestamp && newTimestamp <= timestamp) { return timestamp + 1; } else { return newTimestamp; } }, deepFreeze: function deepFreeze(o) { if (typeof Object.freeze === 'function') { var prop, propKey; Object.freeze(o); // First freeze the object. for (propKey in o) { prop = o[propKey]; if (!o.hasOwnProperty(propKey) || typeof prop !== 'object' || Object.isFrozen(prop)) { // If the object is on the prototype, not an object, or is already frozen, // skip it. Note that this might leave an unfrozen reference somewhere in the // object if there is an already frozen object containing an unfrozen object. continue; } deepFreeze(prop); // Recursively call deepFreeze. } } }, diffObjectFromOldObject: function (object, oldObject) { var added = {}; var removed = {}; var changed = {}; for (var prop in oldObject) { var newValue = object[prop]; if (newValue !== undefined && newValue === oldObject[prop]) continue; if (!(prop in object)) { removed[prop] = undefined; continue; } if (newValue !== oldObject[prop]) changed[prop] = newValue; } for (var prop2 in object) { if (prop2 in oldObject) continue; added[prop2] = object[prop2]; } return { added: added, removed: removed, changed: changed }; } }; }]; },{"mout/array/contains":2,"mout/array/filter":3,"mout/array/slice":7,"mout/array/sort":8,"mout/array/toLookup":9,"mout/lang/isBoolean":14,"mout/lang/isEmpty":15,"mout/object/deepMixIn":22,"mout/object/forOwn":24,"mout/object/pick":27,"mout/object/set":28,"mout/string/makePath":31,"mout/string/pascalCase":32,"mout/string/upperCase":35}]},{},[67]);
node_modules/socket.io/node_modules/engine.io-client/engine.io.js
PatrickFis/E-Portfolio
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["eio"] = factory(); else root["eio"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; module.exports = __webpack_require__(1); /** * Exports parser * * @api public * */ module.exports.parser = __webpack_require__(8); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** * Module dependencies. */ var transports = __webpack_require__(2); var Emitter = __webpack_require__(18); var debug = __webpack_require__(22)('engine.io-client:socket'); var index = __webpack_require__(29); var parser = __webpack_require__(8); var parseuri = __webpack_require__(30); var parseqs = __webpack_require__(19); /** * Module exports. */ module.exports = Socket; /** * Socket constructor. * * @param {String|Object} uri or options * @param {Object} options * @api public */ function Socket(uri, opts) { if (!(this instanceof Socket)) return new Socket(uri, opts); opts = opts || {}; if (uri && 'object' === (typeof uri === 'undefined' ? 'undefined' : _typeof(uri))) { opts = uri; uri = null; } if (uri) { uri = parseuri(uri); opts.hostname = uri.host; opts.secure = uri.protocol === 'https' || uri.protocol === 'wss'; opts.port = uri.port; if (uri.query) opts.query = uri.query; } else if (opts.host) { opts.hostname = parseuri(opts.host).host; } this.secure = null != opts.secure ? opts.secure : global.location && 'https:' === location.protocol; if (opts.hostname && !opts.port) { // if no port is specified manually, use the protocol default opts.port = this.secure ? '443' : '80'; } this.agent = opts.agent || false; this.hostname = opts.hostname || (global.location ? location.hostname : 'localhost'); this.port = opts.port || (global.location && location.port ? location.port : this.secure ? 443 : 80); this.query = opts.query || {}; if ('string' === typeof this.query) this.query = parseqs.decode(this.query); this.upgrade = false !== opts.upgrade; this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/'; this.forceJSONP = !!opts.forceJSONP; this.jsonp = false !== opts.jsonp; this.forceBase64 = !!opts.forceBase64; this.enablesXDR = !!opts.enablesXDR; this.timestampParam = opts.timestampParam || 't'; this.timestampRequests = opts.timestampRequests; this.transports = opts.transports || ['polling', 'websocket']; this.transportOptions = opts.transportOptions || {}; this.readyState = ''; this.writeBuffer = []; this.prevBufferLen = 0; this.policyPort = opts.policyPort || 843; this.rememberUpgrade = opts.rememberUpgrade || false; this.binaryType = null; this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades; this.perMessageDeflate = false !== opts.perMessageDeflate ? opts.perMessageDeflate || {} : false; if (true === this.perMessageDeflate) this.perMessageDeflate = {}; if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) { this.perMessageDeflate.threshold = 1024; } // SSL options for Node.js client this.pfx = opts.pfx || null; this.key = opts.key || null; this.passphrase = opts.passphrase || null; this.cert = opts.cert || null; this.ca = opts.ca || null; this.ciphers = opts.ciphers || null; this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized; this.forceNode = !!opts.forceNode; // other options for Node.js client var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) === 'object' && global; if (freeGlobal.global === freeGlobal) { if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) { this.extraHeaders = opts.extraHeaders; } if (opts.localAddress) { this.localAddress = opts.localAddress; } } // set on handshake this.id = null; this.upgrades = null; this.pingInterval = null; this.pingTimeout = null; // set on heartbeat this.pingIntervalTimer = null; this.pingTimeoutTimer = null; this.open(); } Socket.priorWebsocketSuccess = false; /** * Mix in `Emitter`. */ Emitter(Socket.prototype); /** * Protocol version. * * @api public */ Socket.protocol = parser.protocol; // this is an int /** * Expose deps for legacy compatibility * and standalone browser access. */ Socket.Socket = Socket; Socket.Transport = __webpack_require__(7); Socket.transports = __webpack_require__(2); Socket.parser = __webpack_require__(8); /** * Creates transport of the given type. * * @param {String} transport name * @return {Transport} * @api private */ Socket.prototype.createTransport = function (name) { debug('creating transport "%s"', name); var query = clone(this.query); // append engine.io protocol identifier query.EIO = parser.protocol; // transport name query.transport = name; // per-transport options var options = this.transportOptions[name] || {}; // session id if we already have one if (this.id) query.sid = this.id; var transport = new transports[name]({ query: query, socket: this, agent: options.agent || this.agent, hostname: options.hostname || this.hostname, port: options.port || this.port, secure: options.secure || this.secure, path: options.path || this.path, forceJSONP: options.forceJSONP || this.forceJSONP, jsonp: options.jsonp || this.jsonp, forceBase64: options.forceBase64 || this.forceBase64, enablesXDR: options.enablesXDR || this.enablesXDR, timestampRequests: options.timestampRequests || this.timestampRequests, timestampParam: options.timestampParam || this.timestampParam, policyPort: options.policyPort || this.policyPort, pfx: options.pfx || this.pfx, key: options.key || this.key, passphrase: options.passphrase || this.passphrase, cert: options.cert || this.cert, ca: options.ca || this.ca, ciphers: options.ciphers || this.ciphers, rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized, perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate, extraHeaders: options.extraHeaders || this.extraHeaders, forceNode: options.forceNode || this.forceNode, localAddress: options.localAddress || this.localAddress, requestTimeout: options.requestTimeout || this.requestTimeout, protocols: options.protocols || void 0 }); return transport; }; function clone(obj) { var o = {}; for (var i in obj) { if (obj.hasOwnProperty(i)) { o[i] = obj[i]; } } return o; } /** * Initializes transport to use and starts probe. * * @api private */ Socket.prototype.open = function () { var transport; if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) { transport = 'websocket'; } else if (0 === this.transports.length) { // Emit error on next tick so it can be listened to var self = this; setTimeout(function () { self.emit('error', 'No transports available'); }, 0); return; } else { transport = this.transports[0]; } this.readyState = 'opening'; // Retry with the next transport if the transport is disabled (jsonp: false) try { transport = this.createTransport(transport); } catch (e) { this.transports.shift(); this.open(); return; } transport.open(); this.setTransport(transport); }; /** * Sets the current transport. Disables the existing one (if any). * * @api private */ Socket.prototype.setTransport = function (transport) { debug('setting transport %s', transport.name); var self = this; if (this.transport) { debug('clearing existing transport %s', this.transport.name); this.transport.removeAllListeners(); } // set up transport this.transport = transport; // set up transport listeners transport.on('drain', function () { self.onDrain(); }).on('packet', function (packet) { self.onPacket(packet); }).on('error', function (e) { self.onError(e); }).on('close', function () { self.onClose('transport close'); }); }; /** * Probes a transport. * * @param {String} transport name * @api private */ Socket.prototype.probe = function (name) { debug('probing transport "%s"', name); var transport = this.createTransport(name, { probe: 1 }); var failed = false; var self = this; Socket.priorWebsocketSuccess = false; function onTransportOpen() { if (self.onlyBinaryUpgrades) { var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary; failed = failed || upgradeLosesBinary; } if (failed) return; debug('probe transport "%s" opened', name); transport.send([{ type: 'ping', data: 'probe' }]); transport.once('packet', function (msg) { if (failed) return; if ('pong' === msg.type && 'probe' === msg.data) { debug('probe transport "%s" pong', name); self.upgrading = true; self.emit('upgrading', transport); if (!transport) return; Socket.priorWebsocketSuccess = 'websocket' === transport.name; debug('pausing current transport "%s"', self.transport.name); self.transport.pause(function () { if (failed) return; if ('closed' === self.readyState) return; debug('changing transport and sending upgrade packet'); cleanup(); self.setTransport(transport); transport.send([{ type: 'upgrade' }]); self.emit('upgrade', transport); transport = null; self.upgrading = false; self.flush(); }); } else { debug('probe transport "%s" failed', name); var err = new Error('probe error'); err.transport = transport.name; self.emit('upgradeError', err); } }); } function freezeTransport() { if (failed) return; // Any callback called by transport should be ignored since now failed = true; cleanup(); transport.close(); transport = null; } // Handle any error that happens while probing function onerror(err) { var error = new Error('probe error: ' + err); error.transport = transport.name; freezeTransport(); debug('probe transport "%s" failed because of error: %s', name, err); self.emit('upgradeError', error); } function onTransportClose() { onerror('transport closed'); } // When the socket is closed while we're probing function onclose() { onerror('socket closed'); } // When the socket is upgraded while we're probing function onupgrade(to) { if (transport && to.name !== transport.name) { debug('"%s" works - aborting "%s"', to.name, transport.name); freezeTransport(); } } // Remove all listeners on the transport and on self function cleanup() { transport.removeListener('open', onTransportOpen); transport.removeListener('error', onerror); transport.removeListener('close', onTransportClose); self.removeListener('close', onclose); self.removeListener('upgrading', onupgrade); } transport.once('open', onTransportOpen); transport.once('error', onerror); transport.once('close', onTransportClose); this.once('close', onclose); this.once('upgrading', onupgrade); transport.open(); }; /** * Called when connection is deemed open. * * @api public */ Socket.prototype.onOpen = function () { debug('socket open'); this.readyState = 'open'; Socket.priorWebsocketSuccess = 'websocket' === this.transport.name; this.emit('open'); this.flush(); // we check for `readyState` in case an `open` // listener already closed the socket if ('open' === this.readyState && this.upgrade && this.transport.pause) { debug('starting upgrade probes'); for (var i = 0, l = this.upgrades.length; i < l; i++) { this.probe(this.upgrades[i]); } } }; /** * Handles a packet. * * @api private */ Socket.prototype.onPacket = function (packet) { if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) { debug('socket receive: type "%s", data "%s"', packet.type, packet.data); this.emit('packet', packet); // Socket is live - any packet counts this.emit('heartbeat'); switch (packet.type) { case 'open': this.onHandshake(JSON.parse(packet.data)); break; case 'pong': this.setPing(); this.emit('pong'); break; case 'error': var err = new Error('server error'); err.code = packet.data; this.onError(err); break; case 'message': this.emit('data', packet.data); this.emit('message', packet.data); break; } } else { debug('packet received with socket readyState "%s"', this.readyState); } }; /** * Called upon handshake completion. * * @param {Object} handshake obj * @api private */ Socket.prototype.onHandshake = function (data) { this.emit('handshake', data); this.id = data.sid; this.transport.query.sid = data.sid; this.upgrades = this.filterUpgrades(data.upgrades); this.pingInterval = data.pingInterval; this.pingTimeout = data.pingTimeout; this.onOpen(); // In case open handler closes socket if ('closed' === this.readyState) return; this.setPing(); // Prolong liveness of socket on heartbeat this.removeListener('heartbeat', this.onHeartbeat); this.on('heartbeat', this.onHeartbeat); }; /** * Resets ping timeout. * * @api private */ Socket.prototype.onHeartbeat = function (timeout) { clearTimeout(this.pingTimeoutTimer); var self = this; self.pingTimeoutTimer = setTimeout(function () { if ('closed' === self.readyState) return; self.onClose('ping timeout'); }, timeout || self.pingInterval + self.pingTimeout); }; /** * Pings server every `this.pingInterval` and expects response * within `this.pingTimeout` or closes connection. * * @api private */ Socket.prototype.setPing = function () { var self = this; clearTimeout(self.pingIntervalTimer); self.pingIntervalTimer = setTimeout(function () { debug('writing ping packet - expecting pong within %sms', self.pingTimeout); self.ping(); self.onHeartbeat(self.pingTimeout); }, self.pingInterval); }; /** * Sends a ping packet. * * @api private */ Socket.prototype.ping = function () { var self = this; this.sendPacket('ping', function () { self.emit('ping'); }); }; /** * Called on `drain` event * * @api private */ Socket.prototype.onDrain = function () { this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important // for example, when upgrading, upgrade packet is sent over, // and a nonzero prevBufferLen could cause problems on `drain` this.prevBufferLen = 0; if (0 === this.writeBuffer.length) { this.emit('drain'); } else { this.flush(); } }; /** * Flush write buffers. * * @api private */ Socket.prototype.flush = function () { if ('closed' !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) { debug('flushing %d packets in socket', this.writeBuffer.length); this.transport.send(this.writeBuffer); // keep track of current length of writeBuffer // splice writeBuffer and callbackBuffer on `drain` this.prevBufferLen = this.writeBuffer.length; this.emit('flush'); } }; /** * Sends a message. * * @param {String} message. * @param {Function} callback function. * @param {Object} options. * @return {Socket} for chaining. * @api public */ Socket.prototype.write = Socket.prototype.send = function (msg, options, fn) { this.sendPacket('message', msg, options, fn); return this; }; /** * Sends a packet. * * @param {String} packet type. * @param {String} data. * @param {Object} options. * @param {Function} callback function. * @api private */ Socket.prototype.sendPacket = function (type, data, options, fn) { if ('function' === typeof data) { fn = data; data = undefined; } if ('function' === typeof options) { fn = options; options = null; } if ('closing' === this.readyState || 'closed' === this.readyState) { return; } options = options || {}; options.compress = false !== options.compress; var packet = { type: type, data: data, options: options }; this.emit('packetCreate', packet); this.writeBuffer.push(packet); if (fn) this.once('flush', fn); this.flush(); }; /** * Closes the connection. * * @api private */ Socket.prototype.close = function () { if ('opening' === this.readyState || 'open' === this.readyState) { this.readyState = 'closing'; var self = this; if (this.writeBuffer.length) { this.once('drain', function () { if (this.upgrading) { waitForUpgrade(); } else { close(); } }); } else if (this.upgrading) { waitForUpgrade(); } else { close(); } } function close() { self.onClose('forced close'); debug('socket closing - telling transport to close'); self.transport.close(); } function cleanupAndClose() { self.removeListener('upgrade', cleanupAndClose); self.removeListener('upgradeError', cleanupAndClose); close(); } function waitForUpgrade() { // wait for upgrade to finish since we can't send packets while pausing a transport self.once('upgrade', cleanupAndClose); self.once('upgradeError', cleanupAndClose); } return this; }; /** * Called upon transport error * * @api private */ Socket.prototype.onError = function (err) { debug('socket error %j', err); Socket.priorWebsocketSuccess = false; this.emit('error', err); this.onClose('transport error', err); }; /** * Called upon transport close. * * @api private */ Socket.prototype.onClose = function (reason, desc) { if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) { debug('socket close with reason: "%s"', reason); var self = this; // clear timers clearTimeout(this.pingIntervalTimer); clearTimeout(this.pingTimeoutTimer); // stop event from firing again for transport this.transport.removeAllListeners('close'); // ensure transport won't stay open this.transport.close(); // ignore further transport communication this.transport.removeAllListeners(); // set ready state this.readyState = 'closed'; // clear session id this.id = null; // emit close event this.emit('close', reason, desc); // clean buffers after, so users can still // grab the buffers on `close` event self.writeBuffer = []; self.prevBufferLen = 0; } }; /** * Filters upgrades, returning only those matching client transports. * * @param {Array} server upgrades * @api private * */ Socket.prototype.filterUpgrades = function (upgrades) { var filteredUpgrades = []; for (var i = 0, j = upgrades.length; i < j; i++) { if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]); } return filteredUpgrades; }; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {'use strict'; /** * Module dependencies */ var XMLHttpRequest = __webpack_require__(3); var XHR = __webpack_require__(5); var JSONP = __webpack_require__(26); var websocket = __webpack_require__(27); /** * Export transports. */ exports.polling = polling; exports.websocket = websocket; /** * Polling transport polymorphic constructor. * Decides on xhr vs jsonp based on feature detection. * * @api private */ function polling(opts) { var xhr; var xd = false; var xs = false; var jsonp = false !== opts.jsonp; if (global.location) { var isSSL = 'https:' === location.protocol; var port = location.port; // some user agents have empty `location.port` if (!port) { port = isSSL ? 443 : 80; } xd = opts.hostname !== location.hostname || port !== opts.port; xs = opts.secure !== isSSL; } opts.xdomain = xd; opts.xscheme = xs; xhr = new XMLHttpRequest(opts); if ('open' in xhr && !opts.forceJSONP) { return new XHR(opts); } else { if (!jsonp) throw new Error('JSONP disabled'); return new JSONP(opts); } } /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {'use strict'; // browser shim for xmlhttprequest module var hasCORS = __webpack_require__(4); module.exports = function (opts) { var xdomain = opts.xdomain; // scheme must be same when usign XDomainRequest // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx var xscheme = opts.xscheme; // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default. // https://github.com/Automattic/engine.io-client/pull/217 var enablesXDR = opts.enablesXDR; // XMLHttpRequest can be disabled on IE try { if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) { return new XMLHttpRequest(); } } catch (e) {} // Use XDomainRequest for IE8 if enablesXDR is true // because loading bar keeps flashing when using jsonp-polling // https://github.com/yujiosaka/socke.io-ie8-loading-example try { if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) { return new XDomainRequest(); } } catch (e) {} if (!xdomain) { try { return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP'); } catch (e) {} } }; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 4 */ /***/ function(module, exports) { /** * Module exports. * * Logic borrowed from Modernizr: * * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js */ try { module.exports = typeof XMLHttpRequest !== 'undefined' && 'withCredentials' in new XMLHttpRequest(); } catch (err) { // if XMLHttp support is disabled in IE then it will throw // when trying to create module.exports = false; } /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {'use strict'; /** * Module requirements. */ var XMLHttpRequest = __webpack_require__(3); var Polling = __webpack_require__(6); var Emitter = __webpack_require__(18); var inherit = __webpack_require__(20); var debug = __webpack_require__(22)('engine.io-client:polling-xhr'); /** * Module exports. */ module.exports = XHR; module.exports.Request = Request; /** * Empty function */ function empty() {} /** * XHR Polling constructor. * * @param {Object} opts * @api public */ function XHR(opts) { Polling.call(this, opts); this.requestTimeout = opts.requestTimeout; this.extraHeaders = opts.extraHeaders; if (global.location) { var isSSL = 'https:' === location.protocol; var port = location.port; // some user agents have empty `location.port` if (!port) { port = isSSL ? 443 : 80; } this.xd = opts.hostname !== global.location.hostname || port !== opts.port; this.xs = opts.secure !== isSSL; } } /** * Inherits from Polling. */ inherit(XHR, Polling); /** * XHR supports binary */ XHR.prototype.supportsBinary = true; /** * Creates a request. * * @param {String} method * @api private */ XHR.prototype.request = function (opts) { opts = opts || {}; opts.uri = this.uri(); opts.xd = this.xd; opts.xs = this.xs; opts.agent = this.agent || false; opts.supportsBinary = this.supportsBinary; opts.enablesXDR = this.enablesXDR; // SSL options for Node.js client opts.pfx = this.pfx; opts.key = this.key; opts.passphrase = this.passphrase; opts.cert = this.cert; opts.ca = this.ca; opts.ciphers = this.ciphers; opts.rejectUnauthorized = this.rejectUnauthorized; opts.requestTimeout = this.requestTimeout; // other options for Node.js client opts.extraHeaders = this.extraHeaders; return new Request(opts); }; /** * Sends data. * * @param {String} data to send. * @param {Function} called upon flush. * @api private */ XHR.prototype.doWrite = function (data, fn) { var isBinary = typeof data !== 'string' && data !== undefined; var req = this.request({ method: 'POST', data: data, isBinary: isBinary }); var self = this; req.on('success', fn); req.on('error', function (err) { self.onError('xhr post error', err); }); this.sendXhr = req; }; /** * Starts a poll cycle. * * @api private */ XHR.prototype.doPoll = function () { debug('xhr poll'); var req = this.request(); var self = this; req.on('data', function (data) { self.onData(data); }); req.on('error', function (err) { self.onError('xhr poll error', err); }); this.pollXhr = req; }; /** * Request constructor * * @param {Object} options * @api public */ function Request(opts) { this.method = opts.method || 'GET'; this.uri = opts.uri; this.xd = !!opts.xd; this.xs = !!opts.xs; this.async = false !== opts.async; this.data = undefined !== opts.data ? opts.data : null; this.agent = opts.agent; this.isBinary = opts.isBinary; this.supportsBinary = opts.supportsBinary; this.enablesXDR = opts.enablesXDR; this.requestTimeout = opts.requestTimeout; // SSL options for Node.js client this.pfx = opts.pfx; this.key = opts.key; this.passphrase = opts.passphrase; this.cert = opts.cert; this.ca = opts.ca; this.ciphers = opts.ciphers; this.rejectUnauthorized = opts.rejectUnauthorized; // other options for Node.js client this.extraHeaders = opts.extraHeaders; this.create(); } /** * Mix in `Emitter`. */ Emitter(Request.prototype); /** * Creates the XHR object and sends the request. * * @api private */ Request.prototype.create = function () { var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR }; // SSL options for Node.js client opts.pfx = this.pfx; opts.key = this.key; opts.passphrase = this.passphrase; opts.cert = this.cert; opts.ca = this.ca; opts.ciphers = this.ciphers; opts.rejectUnauthorized = this.rejectUnauthorized; var xhr = this.xhr = new XMLHttpRequest(opts); var self = this; try { debug('xhr open %s: %s', this.method, this.uri); xhr.open(this.method, this.uri, this.async); try { if (this.extraHeaders) { xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true); for (var i in this.extraHeaders) { if (this.extraHeaders.hasOwnProperty(i)) { xhr.setRequestHeader(i, this.extraHeaders[i]); } } } } catch (e) {} if ('POST' === this.method) { try { if (this.isBinary) { xhr.setRequestHeader('Content-type', 'application/octet-stream'); } else { xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8'); } } catch (e) {} } try { xhr.setRequestHeader('Accept', '*/*'); } catch (e) {} // ie6 check if ('withCredentials' in xhr) { xhr.withCredentials = true; } if (this.requestTimeout) { xhr.timeout = this.requestTimeout; } if (this.hasXDR()) { xhr.onload = function () { self.onLoad(); }; xhr.onerror = function () { self.onError(xhr.responseText); }; } else { xhr.onreadystatechange = function () { if (xhr.readyState === 2) { try { var contentType = xhr.getResponseHeader('Content-Type'); if (self.supportsBinary && contentType === 'application/octet-stream') { xhr.responseType = 'arraybuffer'; } } catch (e) {} } if (4 !== xhr.readyState) return; if (200 === xhr.status || 1223 === xhr.status) { self.onLoad(); } else { // make sure the `error` event handler that's user-set // does not throw in the same tick and gets caught here setTimeout(function () { self.onError(xhr.status); }, 0); } }; } debug('xhr data %s', this.data); xhr.send(this.data); } catch (e) { // Need to defer since .create() is called directly fhrom the constructor // and thus the 'error' event can only be only bound *after* this exception // occurs. Therefore, also, we cannot throw here at all. setTimeout(function () { self.onError(e); }, 0); return; } if (global.document) { this.index = Request.requestsCount++; Request.requests[this.index] = this; } }; /** * Called upon successful response. * * @api private */ Request.prototype.onSuccess = function () { this.emit('success'); this.cleanup(); }; /** * Called if we have data. * * @api private */ Request.prototype.onData = function (data) { this.emit('data', data); this.onSuccess(); }; /** * Called upon error. * * @api private */ Request.prototype.onError = function (err) { this.emit('error', err); this.cleanup(true); }; /** * Cleans up house. * * @api private */ Request.prototype.cleanup = function (fromError) { if ('undefined' === typeof this.xhr || null === this.xhr) { return; } // xmlhttprequest if (this.hasXDR()) { this.xhr.onload = this.xhr.onerror = empty; } else { this.xhr.onreadystatechange = empty; } if (fromError) { try { this.xhr.abort(); } catch (e) {} } if (global.document) { delete Request.requests[this.index]; } this.xhr = null; }; /** * Called upon load. * * @api private */ Request.prototype.onLoad = function () { var data; try { var contentType; try { contentType = this.xhr.getResponseHeader('Content-Type'); } catch (e) {} if (contentType === 'application/octet-stream') { data = this.xhr.response || this.xhr.responseText; } else { data = this.xhr.responseText; } } catch (e) { this.onError(e); } if (null != data) { this.onData(data); } }; /** * Check if it has XDomainRequest. * * @api private */ Request.prototype.hasXDR = function () { return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR; }; /** * Aborts the request. * * @api public */ Request.prototype.abort = function () { this.cleanup(); }; /** * Aborts pending requests when unloading the window. This is needed to prevent * memory leaks (e.g. when using IE) and to ensure that no spurious error is * emitted. */ Request.requestsCount = 0; Request.requests = {}; if (global.document) { if (global.attachEvent) { global.attachEvent('onunload', unloadHandler); } else if (global.addEventListener) { global.addEventListener('beforeunload', unloadHandler, false); } } function unloadHandler() { for (var i in Request.requests) { if (Request.requests.hasOwnProperty(i)) { Request.requests[i].abort(); } } } /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; /** * Module dependencies. */ var Transport = __webpack_require__(7); var parseqs = __webpack_require__(19); var parser = __webpack_require__(8); var inherit = __webpack_require__(20); var yeast = __webpack_require__(21); var debug = __webpack_require__(22)('engine.io-client:polling'); /** * Module exports. */ module.exports = Polling; /** * Is XHR2 supported? */ var hasXHR2 = function () { var XMLHttpRequest = __webpack_require__(3); var xhr = new XMLHttpRequest({ xdomain: false }); return null != xhr.responseType; }(); /** * Polling interface. * * @param {Object} opts * @api private */ function Polling(opts) { var forceBase64 = opts && opts.forceBase64; if (!hasXHR2 || forceBase64) { this.supportsBinary = false; } Transport.call(this, opts); } /** * Inherits from Transport. */ inherit(Polling, Transport); /** * Transport name. */ Polling.prototype.name = 'polling'; /** * Opens the socket (triggers polling). We write a PING message to determine * when the transport is open. * * @api private */ Polling.prototype.doOpen = function () { this.poll(); }; /** * Pauses polling. * * @param {Function} callback upon buffers are flushed and transport is paused * @api private */ Polling.prototype.pause = function (onPause) { var self = this; this.readyState = 'pausing'; function pause() { debug('paused'); self.readyState = 'paused'; onPause(); } if (this.polling || !this.writable) { var total = 0; if (this.polling) { debug('we are currently polling - waiting to pause'); total++; this.once('pollComplete', function () { debug('pre-pause polling complete'); --total || pause(); }); } if (!this.writable) { debug('we are currently writing - waiting to pause'); total++; this.once('drain', function () { debug('pre-pause writing complete'); --total || pause(); }); } } else { pause(); } }; /** * Starts polling cycle. * * @api public */ Polling.prototype.poll = function () { debug('polling'); this.polling = true; this.doPoll(); this.emit('poll'); }; /** * Overloads onData to detect payloads. * * @api private */ Polling.prototype.onData = function (data) { var self = this; debug('polling got data %s', data); var callback = function callback(packet, index, total) { // if its the first message we consider the transport open if ('opening' === self.readyState) { self.onOpen(); } // if its a close packet, we close the ongoing requests if ('close' === packet.type) { self.onClose(); return false; } // otherwise bypass onData and handle the message self.onPacket(packet); }; // decode payload parser.decodePayload(data, this.socket.binaryType, callback); // if an event did not trigger closing if ('closed' !== this.readyState) { // if we got data we're not polling this.polling = false; this.emit('pollComplete'); if ('open' === this.readyState) { this.poll(); } else { debug('ignoring poll - transport state "%s"', this.readyState); } } }; /** * For polling, send a close packet. * * @api private */ Polling.prototype.doClose = function () { var self = this; function close() { debug('writing close packet'); self.write([{ type: 'close' }]); } if ('open' === this.readyState) { debug('transport open - closing'); close(); } else { // in case we're trying to close while // handshaking is in progress (GH-164) debug('transport not open - deferring close'); this.once('open', close); } }; /** * Writes a packets payload. * * @param {Array} data packets * @param {Function} drain callback * @api private */ Polling.prototype.write = function (packets) { var self = this; this.writable = false; var callbackfn = function callbackfn() { self.writable = true; self.emit('drain'); }; parser.encodePayload(packets, this.supportsBinary, function (data) { self.doWrite(data, callbackfn); }); }; /** * Generates uri for connection. * * @api private */ Polling.prototype.uri = function () { var query = this.query || {}; var schema = this.secure ? 'https' : 'http'; var port = ''; // cache busting is forced if (false !== this.timestampRequests) { query[this.timestampParam] = yeast(); } if (!this.supportsBinary && !query.sid) { query.b64 = 1; } query = parseqs.encode(query); // avoid port if default for schema if (this.port && ('https' === schema && Number(this.port) !== 443 || 'http' === schema && Number(this.port) !== 80)) { port = ':' + this.port; } // prepend ? to query if (query.length) { query = '?' + query; } var ipv6 = this.hostname.indexOf(':') !== -1; return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query; }; /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; /** * Module dependencies. */ var parser = __webpack_require__(8); var Emitter = __webpack_require__(18); /** * Module exports. */ module.exports = Transport; /** * Transport abstract constructor. * * @param {Object} options. * @api private */ function Transport(opts) { this.path = opts.path; this.hostname = opts.hostname; this.port = opts.port; this.secure = opts.secure; this.query = opts.query; this.timestampParam = opts.timestampParam; this.timestampRequests = opts.timestampRequests; this.readyState = ''; this.agent = opts.agent || false; this.socket = opts.socket; this.enablesXDR = opts.enablesXDR; // SSL options for Node.js client this.pfx = opts.pfx; this.key = opts.key; this.passphrase = opts.passphrase; this.cert = opts.cert; this.ca = opts.ca; this.ciphers = opts.ciphers; this.rejectUnauthorized = opts.rejectUnauthorized; this.forceNode = opts.forceNode; // other options for Node.js client this.extraHeaders = opts.extraHeaders; this.localAddress = opts.localAddress; } /** * Mix in `Emitter`. */ Emitter(Transport.prototype); /** * Emits an error. * * @param {String} str * @return {Transport} for chaining * @api public */ Transport.prototype.onError = function (msg, desc) { var err = new Error(msg); err.type = 'TransportError'; err.description = desc; this.emit('error', err); return this; }; /** * Opens the transport. * * @api public */ Transport.prototype.open = function () { if ('closed' === this.readyState || '' === this.readyState) { this.readyState = 'opening'; this.doOpen(); } return this; }; /** * Closes the transport. * * @api private */ Transport.prototype.close = function () { if ('opening' === this.readyState || 'open' === this.readyState) { this.doClose(); this.onClose(); } return this; }; /** * Sends multiple packets. * * @param {Array} packets * @api private */ Transport.prototype.send = function (packets) { if ('open' === this.readyState) { this.write(packets); } else { throw new Error('Transport not open'); } }; /** * Called upon open * * @api private */ Transport.prototype.onOpen = function () { this.readyState = 'open'; this.writable = true; this.emit('open'); }; /** * Called with data. * * @param {String} data * @api private */ Transport.prototype.onData = function (data) { var packet = parser.decodePacket(data, this.socket.binaryType); this.onPacket(packet); }; /** * Called with a decoded packet. */ Transport.prototype.onPacket = function (packet) { this.emit('packet', packet); }; /** * Called upon close. * * @api private */ Transport.prototype.onClose = function () { this.readyState = 'closed'; this.emit('close'); }; /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** * Module dependencies. */ var keys = __webpack_require__(9); var hasBinary = __webpack_require__(10); var sliceBuffer = __webpack_require__(12); var after = __webpack_require__(13); var utf8 = __webpack_require__(14); var base64encoder; if (global && global.ArrayBuffer) { base64encoder = __webpack_require__(16); } /** * Check if we are running an android browser. That requires us to use * ArrayBuffer with polling transports... * * http://ghinda.net/jpeg-blob-ajax-android/ */ var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent); /** * Check if we are running in PhantomJS. * Uploading a Blob with PhantomJS does not work correctly, as reported here: * https://github.com/ariya/phantomjs/issues/11395 * @type boolean */ var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent); /** * When true, avoids using Blobs to encode payloads. * @type boolean */ var dontSendBlobs = isAndroid || isPhantomJS; /** * Current protocol version. */ exports.protocol = 3; /** * Packet types. */ var packets = exports.packets = { open: 0 // non-ws , close: 1 // non-ws , ping: 2 , pong: 3 , message: 4 , upgrade: 5 , noop: 6 }; var packetslist = keys(packets); /** * Premade error packet. */ var err = { type: 'error', data: 'parser error' }; /** * Create a blob api even for blob builder when vendor prefixes exist */ var Blob = __webpack_require__(17); /** * Encodes a packet. * * <packet type id> [ <data> ] * * Example: * * 5hello world * 3 * 4 * * Binary is encoded in an identical principle * * @api private */ exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) { if (typeof supportsBinary === 'function') { callback = supportsBinary; supportsBinary = false; } if (typeof utf8encode === 'function') { callback = utf8encode; utf8encode = null; } var data = (packet.data === undefined) ? undefined : packet.data.buffer || packet.data; if (global.ArrayBuffer && data instanceof ArrayBuffer) { return encodeArrayBuffer(packet, supportsBinary, callback); } else if (Blob && data instanceof global.Blob) { return encodeBlob(packet, supportsBinary, callback); } // might be an object with { base64: true, data: dataAsBase64String } if (data && data.base64) { return encodeBase64Object(packet, callback); } // Sending data as a utf-8 string var encoded = packets[packet.type]; // data fragment is optional if (undefined !== packet.data) { encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data); } return callback('' + encoded); }; function encodeBase64Object(packet, callback) { // packet data is an object { base64: true, data: dataAsBase64String } var message = 'b' + exports.packets[packet.type] + packet.data.data; return callback(message); } /** * Encode packet helpers for binary types */ function encodeArrayBuffer(packet, supportsBinary, callback) { if (!supportsBinary) { return exports.encodeBase64Packet(packet, callback); } var data = packet.data; var contentArray = new Uint8Array(data); var resultBuffer = new Uint8Array(1 + data.byteLength); resultBuffer[0] = packets[packet.type]; for (var i = 0; i < contentArray.length; i++) { resultBuffer[i+1] = contentArray[i]; } return callback(resultBuffer.buffer); } function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) { if (!supportsBinary) { return exports.encodeBase64Packet(packet, callback); } var fr = new FileReader(); fr.onload = function() { packet.data = fr.result; exports.encodePacket(packet, supportsBinary, true, callback); }; return fr.readAsArrayBuffer(packet.data); } function encodeBlob(packet, supportsBinary, callback) { if (!supportsBinary) { return exports.encodeBase64Packet(packet, callback); } if (dontSendBlobs) { return encodeBlobAsArrayBuffer(packet, supportsBinary, callback); } var length = new Uint8Array(1); length[0] = packets[packet.type]; var blob = new Blob([length.buffer, packet.data]); return callback(blob); } /** * Encodes a packet with binary data in a base64 string * * @param {Object} packet, has `type` and `data` * @return {String} base64 encoded message */ exports.encodeBase64Packet = function(packet, callback) { var message = 'b' + exports.packets[packet.type]; if (Blob && packet.data instanceof global.Blob) { var fr = new FileReader(); fr.onload = function() { var b64 = fr.result.split(',')[1]; callback(message + b64); }; return fr.readAsDataURL(packet.data); } var b64data; try { b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data)); } catch (e) { // iPhone Safari doesn't let you apply with typed arrays var typed = new Uint8Array(packet.data); var basic = new Array(typed.length); for (var i = 0; i < typed.length; i++) { basic[i] = typed[i]; } b64data = String.fromCharCode.apply(null, basic); } message += global.btoa(b64data); return callback(message); }; /** * Decodes a packet. Changes format to Blob if requested. * * @return {Object} with `type` and `data` (if any) * @api private */ exports.decodePacket = function (data, binaryType, utf8decode) { if (data === undefined) { return err; } // String data if (typeof data === 'string') { if (data.charAt(0) === 'b') { return exports.decodeBase64Packet(data.substr(1), binaryType); } if (utf8decode) { data = tryDecode(data); if (data === false) { return err; } } var type = data.charAt(0); if (Number(type) != type || !packetslist[type]) { return err; } if (data.length > 1) { return { type: packetslist[type], data: data.substring(1) }; } else { return { type: packetslist[type] }; } } var asArray = new Uint8Array(data); var type = asArray[0]; var rest = sliceBuffer(data, 1); if (Blob && binaryType === 'blob') { rest = new Blob([rest]); } return { type: packetslist[type], data: rest }; }; function tryDecode(data) { try { data = utf8.decode(data, { strict: false }); } catch (e) { return false; } return data; } /** * Decodes a packet encoded in a base64 string * * @param {String} base64 encoded message * @return {Object} with `type` and `data` (if any) */ exports.decodeBase64Packet = function(msg, binaryType) { var type = packetslist[msg.charAt(0)]; if (!base64encoder) { return { type: type, data: { base64: true, data: msg.substr(1) } }; } var data = base64encoder.decode(msg.substr(1)); if (binaryType === 'blob' && Blob) { data = new Blob([data]); } return { type: type, data: data }; }; /** * Encodes multiple messages (payload). * * <length>:data * * Example: * * 11:hello world2:hi * * If any contents are binary, they will be encoded as base64 strings. Base64 * encoded strings are marked with a b before the length specifier * * @param {Array} packets * @api private */ exports.encodePayload = function (packets, supportsBinary, callback) { if (typeof supportsBinary === 'function') { callback = supportsBinary; supportsBinary = null; } var isBinary = hasBinary(packets); if (supportsBinary && isBinary) { if (Blob && !dontSendBlobs) { return exports.encodePayloadAsBlob(packets, callback); } return exports.encodePayloadAsArrayBuffer(packets, callback); } if (!packets.length) { return callback('0:'); } function setLengthHeader(message) { return message.length + ':' + message; } function encodeOne(packet, doneCallback) { exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) { doneCallback(null, setLengthHeader(message)); }); } map(packets, encodeOne, function(err, results) { return callback(results.join('')); }); }; /** * Async array map using after */ function map(ary, each, done) { var result = new Array(ary.length); var next = after(ary.length, done); var eachWithIndex = function(i, el, cb) { each(el, function(error, msg) { result[i] = msg; cb(error, result); }); }; for (var i = 0; i < ary.length; i++) { eachWithIndex(i, ary[i], next); } } /* * Decodes data when a payload is maybe expected. Possible binary contents are * decoded from their base64 representation * * @param {String} data, callback method * @api public */ exports.decodePayload = function (data, binaryType, callback) { if (typeof data !== 'string') { return exports.decodePayloadAsBinary(data, binaryType, callback); } if (typeof binaryType === 'function') { callback = binaryType; binaryType = null; } var packet; if (data === '') { // parser error - ignoring payload return callback(err, 0, 1); } var length = '', n, msg; for (var i = 0, l = data.length; i < l; i++) { var chr = data.charAt(i); if (chr !== ':') { length += chr; continue; } if (length === '' || (length != (n = Number(length)))) { // parser error - ignoring payload return callback(err, 0, 1); } msg = data.substr(i + 1, n); if (length != msg.length) { // parser error - ignoring payload return callback(err, 0, 1); } if (msg.length) { packet = exports.decodePacket(msg, binaryType, false); if (err.type === packet.type && err.data === packet.data) { // parser error in individual packet - ignoring payload return callback(err, 0, 1); } var ret = callback(packet, i + n, l); if (false === ret) return; } // advance cursor i += n; length = ''; } if (length !== '') { // parser error - ignoring payload return callback(err, 0, 1); } }; /** * Encodes multiple messages (payload) as binary. * * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number * 255><data> * * Example: * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers * * @param {Array} packets * @return {ArrayBuffer} encoded payload * @api private */ exports.encodePayloadAsArrayBuffer = function(packets, callback) { if (!packets.length) { return callback(new ArrayBuffer(0)); } function encodeOne(packet, doneCallback) { exports.encodePacket(packet, true, true, function(data) { return doneCallback(null, data); }); } map(packets, encodeOne, function(err, encodedPackets) { var totalLength = encodedPackets.reduce(function(acc, p) { var len; if (typeof p === 'string'){ len = p.length; } else { len = p.byteLength; } return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2 }, 0); var resultArray = new Uint8Array(totalLength); var bufferIndex = 0; encodedPackets.forEach(function(p) { var isString = typeof p === 'string'; var ab = p; if (isString) { var view = new Uint8Array(p.length); for (var i = 0; i < p.length; i++) { view[i] = p.charCodeAt(i); } ab = view.buffer; } if (isString) { // not true binary resultArray[bufferIndex++] = 0; } else { // true binary resultArray[bufferIndex++] = 1; } var lenStr = ab.byteLength.toString(); for (var i = 0; i < lenStr.length; i++) { resultArray[bufferIndex++] = parseInt(lenStr[i]); } resultArray[bufferIndex++] = 255; var view = new Uint8Array(ab); for (var i = 0; i < view.length; i++) { resultArray[bufferIndex++] = view[i]; } }); return callback(resultArray.buffer); }); }; /** * Encode as Blob */ exports.encodePayloadAsBlob = function(packets, callback) { function encodeOne(packet, doneCallback) { exports.encodePacket(packet, true, true, function(encoded) { var binaryIdentifier = new Uint8Array(1); binaryIdentifier[0] = 1; if (typeof encoded === 'string') { var view = new Uint8Array(encoded.length); for (var i = 0; i < encoded.length; i++) { view[i] = encoded.charCodeAt(i); } encoded = view.buffer; binaryIdentifier[0] = 0; } var len = (encoded instanceof ArrayBuffer) ? encoded.byteLength : encoded.size; var lenStr = len.toString(); var lengthAry = new Uint8Array(lenStr.length + 1); for (var i = 0; i < lenStr.length; i++) { lengthAry[i] = parseInt(lenStr[i]); } lengthAry[lenStr.length] = 255; if (Blob) { var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]); doneCallback(null, blob); } }); } map(packets, encodeOne, function(err, results) { return callback(new Blob(results)); }); }; /* * Decodes data when a payload is maybe expected. Strings are decoded by * interpreting each byte as a key code for entries marked to start with 0. See * description of encodePayloadAsBinary * * @param {ArrayBuffer} data, callback method * @api public */ exports.decodePayloadAsBinary = function (data, binaryType, callback) { if (typeof binaryType === 'function') { callback = binaryType; binaryType = null; } var bufferTail = data; var buffers = []; while (bufferTail.byteLength > 0) { var tailArray = new Uint8Array(bufferTail); var isString = tailArray[0] === 0; var msgLength = ''; for (var i = 1; ; i++) { if (tailArray[i] === 255) break; // 310 = char length of Number.MAX_VALUE if (msgLength.length > 310) { return callback(err, 0, 1); } msgLength += tailArray[i]; } bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length); msgLength = parseInt(msgLength); var msg = sliceBuffer(bufferTail, 0, msgLength); if (isString) { try { msg = String.fromCharCode.apply(null, new Uint8Array(msg)); } catch (e) { // iPhone Safari doesn't let you apply to typed arrays var typed = new Uint8Array(msg); msg = ''; for (var i = 0; i < typed.length; i++) { msg += String.fromCharCode(typed[i]); } } } buffers.push(msg); bufferTail = sliceBuffer(bufferTail, msgLength); } var total = buffers.length; buffers.forEach(function(buffer, i) { callback(exports.decodePacket(buffer, binaryType, true), i, total); }); }; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 9 */ /***/ function(module, exports) { /** * Gets the keys for an object. * * @return {Array} keys * @api private */ module.exports = Object.keys || function keys (obj){ var arr = []; var has = Object.prototype.hasOwnProperty; for (var i in obj) { if (has.call(obj, i)) { arr.push(i); } } return arr; }; /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/* global Blob File */ /* * Module requirements. */ var isArray = __webpack_require__(11); var toString = Object.prototype.toString; var withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]'; var withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]'; /** * Module exports. */ module.exports = hasBinary; /** * Checks for binary data. * * Supports Buffer, ArrayBuffer, Blob and File. * * @param {Object} anything * @api public */ function hasBinary (obj) { if (!obj || typeof obj !== 'object') { return false; } if (isArray(obj)) { for (var i = 0, l = obj.length; i < l; i++) { if (hasBinary(obj[i])) { return true; } } return false; } if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) || (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) || (withNativeBlob && obj instanceof Blob) || (withNativeFile && obj instanceof File) ) { return true; } // see: https://github.com/Automattic/has-binary/pull/4 if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) { return hasBinary(obj.toJSON(), true); } for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) { return true; } } return false; } /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 11 */ /***/ function(module, exports) { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; /***/ }, /* 12 */ /***/ function(module, exports) { /** * An abstraction for slicing an arraybuffer even when * ArrayBuffer.prototype.slice is not supported * * @api public */ module.exports = function(arraybuffer, start, end) { var bytes = arraybuffer.byteLength; start = start || 0; end = end || bytes; if (arraybuffer.slice) { return arraybuffer.slice(start, end); } if (start < 0) { start += bytes; } if (end < 0) { end += bytes; } if (end > bytes) { end = bytes; } if (start >= bytes || start >= end || bytes === 0) { return new ArrayBuffer(0); } var abv = new Uint8Array(arraybuffer); var result = new Uint8Array(end - start); for (var i = start, ii = 0; i < end; i++, ii++) { result[ii] = abv[i]; } return result.buffer; }; /***/ }, /* 13 */ /***/ function(module, exports) { module.exports = after function after(count, callback, err_cb) { var bail = false err_cb = err_cb || noop proxy.count = count return (count === 0) ? callback() : proxy function proxy(err, result) { if (proxy.count <= 0) { throw new Error('after called too many times') } --proxy.count // after first error, rest are passed to err_cb if (err) { bail = true callback(err) // future error callbacks will go to error handler callback = err_cb } else if (proxy.count === 0 && !bail) { callback(null, result) } } } function noop() {} /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/utf8js v2.1.2 by @mathias */ ;(function(root) { // Detect free variables `exports` var freeExports = typeof exports == 'object' && exports; // Detect free variable `module` var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; // Detect free variable `global`, from Node.js or Browserified code, // and use it as `root` var freeGlobal = typeof global == 'object' && global; if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { root = freeGlobal; } /*--------------------------------------------------------------------------*/ var stringFromCharCode = String.fromCharCode; // Taken from https://mths.be/punycode function ucs2decode(string) { var output = []; var counter = 0; var length = string.length; var value; var extra; while (counter < length) { value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // high surrogate, and there is a next character extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // low surrogate output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // unmatched surrogate; only append this code unit, in case the next // code unit is the high surrogate of a surrogate pair output.push(value); counter--; } } else { output.push(value); } } return output; } // Taken from https://mths.be/punycode function ucs2encode(array) { var length = array.length; var index = -1; var value; var output = ''; while (++index < length) { value = array[index]; if (value > 0xFFFF) { value -= 0x10000; output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); value = 0xDC00 | value & 0x3FF; } output += stringFromCharCode(value); } return output; } function checkScalarValue(codePoint, strict) { if (codePoint >= 0xD800 && codePoint <= 0xDFFF) { if (strict) { throw Error( 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() + ' is not a scalar value' ); } return false; } return true; } /*--------------------------------------------------------------------------*/ function createByte(codePoint, shift) { return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80); } function encodeCodePoint(codePoint, strict) { if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence return stringFromCharCode(codePoint); } var symbol = ''; if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0); } else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence if (!checkScalarValue(codePoint, strict)) { codePoint = 0xFFFD; } symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0); symbol += createByte(codePoint, 6); } else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0); symbol += createByte(codePoint, 12); symbol += createByte(codePoint, 6); } symbol += stringFromCharCode((codePoint & 0x3F) | 0x80); return symbol; } function utf8encode(string, opts) { opts = opts || {}; var strict = false !== opts.strict; var codePoints = ucs2decode(string); var length = codePoints.length; var index = -1; var codePoint; var byteString = ''; while (++index < length) { codePoint = codePoints[index]; byteString += encodeCodePoint(codePoint, strict); } return byteString; } /*--------------------------------------------------------------------------*/ function readContinuationByte() { if (byteIndex >= byteCount) { throw Error('Invalid byte index'); } var continuationByte = byteArray[byteIndex] & 0xFF; byteIndex++; if ((continuationByte & 0xC0) == 0x80) { return continuationByte & 0x3F; } // If we end up here, it’s not a continuation byte throw Error('Invalid continuation byte'); } function decodeSymbol(strict) { var byte1; var byte2; var byte3; var byte4; var codePoint; if (byteIndex > byteCount) { throw Error('Invalid byte index'); } if (byteIndex == byteCount) { return false; } // Read first byte byte1 = byteArray[byteIndex] & 0xFF; byteIndex++; // 1-byte sequence (no continuation bytes) if ((byte1 & 0x80) == 0) { return byte1; } // 2-byte sequence if ((byte1 & 0xE0) == 0xC0) { byte2 = readContinuationByte(); codePoint = ((byte1 & 0x1F) << 6) | byte2; if (codePoint >= 0x80) { return codePoint; } else { throw Error('Invalid continuation byte'); } } // 3-byte sequence (may include unpaired surrogates) if ((byte1 & 0xF0) == 0xE0) { byte2 = readContinuationByte(); byte3 = readContinuationByte(); codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3; if (codePoint >= 0x0800) { return checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD; } else { throw Error('Invalid continuation byte'); } } // 4-byte sequence if ((byte1 & 0xF8) == 0xF0) { byte2 = readContinuationByte(); byte3 = readContinuationByte(); byte4 = readContinuationByte(); codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) | (byte3 << 0x06) | byte4; if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { return codePoint; } } throw Error('Invalid UTF-8 detected'); } var byteArray; var byteCount; var byteIndex; function utf8decode(byteString, opts) { opts = opts || {}; var strict = false !== opts.strict; byteArray = ucs2decode(byteString); byteCount = byteArray.length; byteIndex = 0; var codePoints = []; var tmp; while ((tmp = decodeSymbol(strict)) !== false) { codePoints.push(tmp); } return ucs2encode(codePoints); } /*--------------------------------------------------------------------------*/ var utf8 = { 'version': '2.1.2', 'encode': utf8encode, 'decode': utf8decode }; // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( true ) { !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { return utf8; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (freeExports && !freeExports.nodeType) { if (freeModule) { // in Node.js or RingoJS v0.8.0+ freeModule.exports = utf8; } else { // in Narwhal or RingoJS v0.7.0- var object = {}; var hasOwnProperty = object.hasOwnProperty; for (var key in utf8) { hasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]); } } } else { // in Rhino or a web browser root.utf8 = utf8; } }(this)); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15)(module), (function() { return this; }()))) /***/ }, /* 15 */ /***/ function(module, exports) { module.exports = function(module) { if(!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default module.children = []; module.webpackPolyfill = 1; } return module; } /***/ }, /* 16 */ /***/ function(module, exports) { /* * base64-arraybuffer * https://github.com/niklasvh/base64-arraybuffer * * Copyright (c) 2012 Niklas von Hertzen * Licensed under the MIT license. */ (function(){ "use strict"; var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // Use a lookup table to find the index. var lookup = new Uint8Array(256); for (var i = 0; i < chars.length; i++) { lookup[chars.charCodeAt(i)] = i; } exports.encode = function(arraybuffer) { var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = ""; for (i = 0; i < len; i+=3) { base64 += chars[bytes[i] >> 2]; base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; base64 += chars[bytes[i + 2] & 63]; } if ((len % 3) === 2) { base64 = base64.substring(0, base64.length - 1) + "="; } else if (len % 3 === 1) { base64 = base64.substring(0, base64.length - 2) + "=="; } return base64; }; exports.decode = function(base64) { var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4; if (base64[base64.length - 1] === "=") { bufferLength--; if (base64[base64.length - 2] === "=") { bufferLength--; } } var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer); for (i = 0; i < len; i+=4) { encoded1 = lookup[base64.charCodeAt(i)]; encoded2 = lookup[base64.charCodeAt(i+1)]; encoded3 = lookup[base64.charCodeAt(i+2)]; encoded4 = lookup[base64.charCodeAt(i+3)]; bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); } return arraybuffer; }; })(); /***/ }, /* 17 */ /***/ function(module, exports) { /* WEBPACK VAR INJECTION */(function(global) {/** * Create a blob builder even when vendor prefixes exist */ var BlobBuilder = global.BlobBuilder || global.WebKitBlobBuilder || global.MSBlobBuilder || global.MozBlobBuilder; /** * Check if Blob constructor is supported */ var blobSupported = (function() { try { var a = new Blob(['hi']); return a.size === 2; } catch(e) { return false; } })(); /** * Check if Blob constructor supports ArrayBufferViews * Fails in Safari 6, so we need to map to ArrayBuffers there. */ var blobSupportsArrayBufferView = blobSupported && (function() { try { var b = new Blob([new Uint8Array([1,2])]); return b.size === 2; } catch(e) { return false; } })(); /** * Check if BlobBuilder is supported */ var blobBuilderSupported = BlobBuilder && BlobBuilder.prototype.append && BlobBuilder.prototype.getBlob; /** * Helper function that maps ArrayBufferViews to ArrayBuffers * Used by BlobBuilder constructor and old browsers that didn't * support it in the Blob constructor. */ function mapArrayBufferViews(ary) { for (var i = 0; i < ary.length; i++) { var chunk = ary[i]; if (chunk.buffer instanceof ArrayBuffer) { var buf = chunk.buffer; // if this is a subarray, make a copy so we only // include the subarray region from the underlying buffer if (chunk.byteLength !== buf.byteLength) { var copy = new Uint8Array(chunk.byteLength); copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength)); buf = copy.buffer; } ary[i] = buf; } } } function BlobBuilderConstructor(ary, options) { options = options || {}; var bb = new BlobBuilder(); mapArrayBufferViews(ary); for (var i = 0; i < ary.length; i++) { bb.append(ary[i]); } return (options.type) ? bb.getBlob(options.type) : bb.getBlob(); }; function BlobConstructor(ary, options) { mapArrayBufferViews(ary); return new Blob(ary, options || {}); }; module.exports = (function() { if (blobSupported) { return blobSupportsArrayBufferView ? global.Blob : BlobConstructor; } else if (blobBuilderSupported) { return BlobBuilderConstructor; } else { return undefined; } })(); /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { /** * Expose `Emitter`. */ if (true) { module.exports = Emitter; } /** * Initialize a new `Emitter`. * * @api public */ function Emitter(obj) { if (obj) return mixin(obj); }; /** * Mixin the emitter properties. * * @param {Object} obj * @return {Object} * @api private */ function mixin(obj) { for (var key in Emitter.prototype) { obj[key] = Emitter.prototype[key]; } return obj; } /** * Listen on the given `event` with `fn`. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.on = Emitter.prototype.addEventListener = function(event, fn){ this._callbacks = this._callbacks || {}; (this._callbacks['$' + event] = this._callbacks['$' + event] || []) .push(fn); return this; }; /** * Adds an `event` listener that will be invoked a single * time then automatically removed. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.once = function(event, fn){ function on() { this.off(event, on); fn.apply(this, arguments); } on.fn = fn; this.on(event, on); return this; }; /** * Remove the given callback for `event` or all * registered callbacks. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function(event, fn){ this._callbacks = this._callbacks || {}; // all if (0 == arguments.length) { this._callbacks = {}; return this; } // specific event var callbacks = this._callbacks['$' + event]; if (!callbacks) return this; // remove all handlers if (1 == arguments.length) { delete this._callbacks['$' + event]; return this; } // remove specific handler var cb; for (var i = 0; i < callbacks.length; i++) { cb = callbacks[i]; if (cb === fn || cb.fn === fn) { callbacks.splice(i, 1); break; } } return this; }; /** * Emit `event` with the given args. * * @param {String} event * @param {Mixed} ... * @return {Emitter} */ Emitter.prototype.emit = function(event){ this._callbacks = this._callbacks || {}; var args = [].slice.call(arguments, 1) , callbacks = this._callbacks['$' + event]; if (callbacks) { callbacks = callbacks.slice(0); for (var i = 0, len = callbacks.length; i < len; ++i) { callbacks[i].apply(this, args); } } return this; }; /** * Return array of callbacks for `event`. * * @param {String} event * @return {Array} * @api public */ Emitter.prototype.listeners = function(event){ this._callbacks = this._callbacks || {}; return this._callbacks['$' + event] || []; }; /** * Check if this emitter has `event` handlers. * * @param {String} event * @return {Boolean} * @api public */ Emitter.prototype.hasListeners = function(event){ return !! this.listeners(event).length; }; /***/ }, /* 19 */ /***/ function(module, exports) { /** * Compiles a querystring * Returns string representation of the object * * @param {Object} * @api private */ exports.encode = function (obj) { var str = ''; for (var i in obj) { if (obj.hasOwnProperty(i)) { if (str.length) str += '&'; str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]); } } return str; }; /** * Parses a simple querystring into an object * * @param {String} qs * @api private */ exports.decode = function(qs){ var qry = {}; var pairs = qs.split('&'); for (var i = 0, l = pairs.length; i < l; i++) { var pair = pairs[i].split('='); qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); } return qry; }; /***/ }, /* 20 */ /***/ function(module, exports) { module.exports = function(a, b){ var fn = function(){}; fn.prototype = b.prototype; a.prototype = new fn; a.prototype.constructor = a; }; /***/ }, /* 21 */ /***/ function(module, exports) { 'use strict'; var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('') , length = 64 , map = {} , seed = 0 , i = 0 , prev; /** * Return a string representing the specified number. * * @param {Number} num The number to convert. * @returns {String} The string representation of the number. * @api public */ function encode(num) { var encoded = ''; do { encoded = alphabet[num % length] + encoded; num = Math.floor(num / length); } while (num > 0); return encoded; } /** * Return the integer value specified by the given string. * * @param {String} str The string to convert. * @returns {Number} The integer value represented by the string. * @api public */ function decode(str) { var decoded = 0; for (i = 0; i < str.length; i++) { decoded = decoded * length + map[str.charAt(i)]; } return decoded; } /** * Yeast: A tiny growing id generator. * * @returns {String} A unique id. * @api public */ function yeast() { var now = encode(+new Date()); if (now !== prev) return seed = 0, prev = now; return now +'.'+ encode(seed++); } // // Map each character to its index. // for (; i < length; i++) map[alphabet[i]] = i; // // Expose the `yeast`, `encode` and `decode` functions. // yeast.encode = encode; yeast.decode = decode; module.exports = yeast; /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * This is the web browser implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = __webpack_require__(24); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ exports.formatters.j = function(v) { try { return JSON.stringify(v); } catch (err) { return '[UnexpectedJSONParseError]: ' + err.message; } }; /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { var useColors = this.useColors; args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); if (!useColors) return; var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit') // the final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function(match) { if ('%%' === match) return; index++; if ('%c' === match) { // we only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (null == namespaces) { exports.storage.removeItem('debug'); } else { exports.storage.debug = namespaces; } } catch(e) {} } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.debug; } catch(e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Enable namespaces listed in `localStorage.debug` initially. */ exports.enable(load()); /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { return window.localStorage; } catch (e) {} } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(23))) /***/ }, /* 23 */ /***/ function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; exports.humanize = __webpack_require__(25); /** * Active `debug` instances. */ exports.instances = []; /** * The currently active debug mode names, and names to skip. */ exports.names = []; exports.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ exports.formatters = {}; /** * Select a color. * @param {String} namespace * @return {Number} * @api private */ function selectColor(namespace) { var hash = 0, i; for (i in namespace) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return exports.colors[Math.abs(hash) % exports.colors.length]; } /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { // disabled? if (!debug.enabled) return; var self = debug; // set `diff` timestamp var curr = +new Date(); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; // turn the `arguments` into a proper Array var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } args[0] = exports.coerce(args[0]); if ('string' !== typeof args[0]) { // anything else let's inspect with %O args.unshift('%O'); } // apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { // if we encounter an escaped % then don't increase the array index if (match === '%%') return match; index++; var formatter = exports.formatters[format]; if ('function' === typeof formatter) { var val = args[index]; match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // apply env-specific formatting (colors, etc.) exports.formatArgs.call(self, args); var logFn = debug.log || exports.log || console.log.bind(console); logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = exports.enabled(namespace); debug.useColors = exports.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; // env-specific initialization logic for debug instances if ('function' === typeof exports.init) { exports.init(debug); } exports.instances.push(debug); return debug; } function destroy () { var index = exports.instances.indexOf(this); if (index !== -1) { exports.instances.splice(index, 1); return true; } else { return false; } } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { exports.save(namespaces); exports.names = []; exports.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { exports.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < exports.instances.length; i++) { var instance = exports.instances[i]; instance.enabled = exports.enabled(instance.namespace); } } /** * Disable debug output. * * @api public */ function disable() { exports.enable(''); } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i, len; for (i = 0, len = exports.skips.length; i < len; i++) { if (exports.skips[i].test(name)) { return false; } } for (i = 0, len = exports.names.length; i < len; i++) { if (exports.names[i].test(name)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) return val.stack || val.message; return val; } /***/ }, /* 25 */ /***/ function(module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { if (ms >= d) { return Math.round(ms / d) + 'd'; } if (ms >= h) { return Math.round(ms / h) + 'h'; } if (ms >= m) { return Math.round(ms / m) + 'm'; } if (ms >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, n, name) { if (ms < n) { return; } if (ms < n * 1.5) { return Math.floor(ms / n) + ' ' + name; } return Math.ceil(ms / n) + ' ' + name + 's'; } /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {'use strict'; /** * Module requirements. */ var Polling = __webpack_require__(6); var inherit = __webpack_require__(20); /** * Module exports. */ module.exports = JSONPPolling; /** * Cached regular expressions. */ var rNewline = /\n/g; var rEscapedNewline = /\\n/g; /** * Global JSONP callbacks. */ var callbacks; /** * Noop. */ function empty() {} /** * JSONP Polling constructor. * * @param {Object} opts. * @api public */ function JSONPPolling(opts) { Polling.call(this, opts); this.query = this.query || {}; // define global callbacks array if not present // we do this here (lazily) to avoid unneeded global pollution if (!callbacks) { // we need to consider multiple engines in the same page if (!global.___eio) global.___eio = []; callbacks = global.___eio; } // callback identifier this.index = callbacks.length; // add callback to jsonp global var self = this; callbacks.push(function (msg) { self.onData(msg); }); // append to query string this.query.j = this.index; // prevent spurious errors from being emitted when the window is unloaded if (global.document && global.addEventListener) { global.addEventListener('beforeunload', function () { if (self.script) self.script.onerror = empty; }, false); } } /** * Inherits from Polling. */ inherit(JSONPPolling, Polling); /* * JSONP only supports binary as base64 encoded strings */ JSONPPolling.prototype.supportsBinary = false; /** * Closes the socket. * * @api private */ JSONPPolling.prototype.doClose = function () { if (this.script) { this.script.parentNode.removeChild(this.script); this.script = null; } if (this.form) { this.form.parentNode.removeChild(this.form); this.form = null; this.iframe = null; } Polling.prototype.doClose.call(this); }; /** * Starts a poll cycle. * * @api private */ JSONPPolling.prototype.doPoll = function () { var self = this; var script = document.createElement('script'); if (this.script) { this.script.parentNode.removeChild(this.script); this.script = null; } script.async = true; script.src = this.uri(); script.onerror = function (e) { self.onError('jsonp poll error', e); }; var insertAt = document.getElementsByTagName('script')[0]; if (insertAt) { insertAt.parentNode.insertBefore(script, insertAt); } else { (document.head || document.body).appendChild(script); } this.script = script; var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent); if (isUAgecko) { setTimeout(function () { var iframe = document.createElement('iframe'); document.body.appendChild(iframe); document.body.removeChild(iframe); }, 100); } }; /** * Writes with a hidden iframe. * * @param {String} data to send * @param {Function} called upon flush. * @api private */ JSONPPolling.prototype.doWrite = function (data, fn) { var self = this; if (!this.form) { var form = document.createElement('form'); var area = document.createElement('textarea'); var id = this.iframeId = 'eio_iframe_' + this.index; var iframe; form.className = 'socketio'; form.style.position = 'absolute'; form.style.top = '-1000px'; form.style.left = '-1000px'; form.target = id; form.method = 'POST'; form.setAttribute('accept-charset', 'utf-8'); area.name = 'd'; form.appendChild(area); document.body.appendChild(form); this.form = form; this.area = area; } this.form.action = this.uri(); function complete() { initIframe(); fn(); } function initIframe() { if (self.iframe) { try { self.form.removeChild(self.iframe); } catch (e) { self.onError('jsonp polling iframe removal error', e); } } try { // ie6 dynamic iframes with target="" support (thanks Chris Lambacher) var html = '<iframe src="javascript:0" name="' + self.iframeId + '">'; iframe = document.createElement(html); } catch (e) { iframe = document.createElement('iframe'); iframe.name = self.iframeId; iframe.src = 'javascript:0'; } iframe.id = self.iframeId; self.form.appendChild(iframe); self.iframe = iframe; } initIframe(); // escape \n to prevent it from being converted into \r\n by some UAs // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side data = data.replace(rEscapedNewline, '\\\n'); this.area.value = data.replace(rNewline, '\\n'); try { this.form.submit(); } catch (e) {} if (this.iframe.attachEvent) { this.iframe.onreadystatechange = function () { if (self.iframe.readyState === 'complete') { complete(); } }; } else { this.iframe.onload = complete; } }; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {'use strict'; /** * Module dependencies. */ var Transport = __webpack_require__(7); var parser = __webpack_require__(8); var parseqs = __webpack_require__(19); var inherit = __webpack_require__(20); var yeast = __webpack_require__(21); var debug = __webpack_require__(22)('engine.io-client:websocket'); var BrowserWebSocket = global.WebSocket || global.MozWebSocket; var NodeWebSocket; if (typeof window === 'undefined') { try { NodeWebSocket = __webpack_require__(28); } catch (e) {} } /** * Get either the `WebSocket` or `MozWebSocket` globals * in the browser or try to resolve WebSocket-compatible * interface exposed by `ws` for Node-like environment. */ var WebSocket = BrowserWebSocket; if (!WebSocket && typeof window === 'undefined') { WebSocket = NodeWebSocket; } /** * Module exports. */ module.exports = WS; /** * WebSocket transport constructor. * * @api {Object} connection options * @api public */ function WS(opts) { var forceBase64 = opts && opts.forceBase64; if (forceBase64) { this.supportsBinary = false; } this.perMessageDeflate = opts.perMessageDeflate; this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode; this.protocols = opts.protocols; if (!this.usingBrowserWebSocket) { WebSocket = NodeWebSocket; } Transport.call(this, opts); } /** * Inherits from Transport. */ inherit(WS, Transport); /** * Transport name. * * @api public */ WS.prototype.name = 'websocket'; /* * WebSockets support binary */ WS.prototype.supportsBinary = true; /** * Opens socket. * * @api private */ WS.prototype.doOpen = function () { if (!this.check()) { // let probe timeout return; } var uri = this.uri(); var protocols = this.protocols; var opts = { agent: this.agent, perMessageDeflate: this.perMessageDeflate }; // SSL options for Node.js client opts.pfx = this.pfx; opts.key = this.key; opts.passphrase = this.passphrase; opts.cert = this.cert; opts.ca = this.ca; opts.ciphers = this.ciphers; opts.rejectUnauthorized = this.rejectUnauthorized; if (this.extraHeaders) { opts.headers = this.extraHeaders; } if (this.localAddress) { opts.localAddress = this.localAddress; } try { this.ws = this.usingBrowserWebSocket ? protocols ? new WebSocket(uri, protocols) : new WebSocket(uri) : new WebSocket(uri, protocols, opts); } catch (err) { return this.emit('error', err); } if (this.ws.binaryType === undefined) { this.supportsBinary = false; } if (this.ws.supports && this.ws.supports.binary) { this.supportsBinary = true; this.ws.binaryType = 'nodebuffer'; } else { this.ws.binaryType = 'arraybuffer'; } this.addEventListeners(); }; /** * Adds event listeners to the socket * * @api private */ WS.prototype.addEventListeners = function () { var self = this; this.ws.onopen = function () { self.onOpen(); }; this.ws.onclose = function () { self.onClose(); }; this.ws.onmessage = function (ev) { self.onData(ev.data); }; this.ws.onerror = function (e) { self.onError('websocket error', e); }; }; /** * Writes data to socket. * * @param {Array} array of packets. * @api private */ WS.prototype.write = function (packets) { var self = this; this.writable = false; // encodePacket efficient as it uses WS framing // no need for encodePayload var total = packets.length; for (var i = 0, l = total; i < l; i++) { (function (packet) { parser.encodePacket(packet, self.supportsBinary, function (data) { if (!self.usingBrowserWebSocket) { // always create a new object (GH-437) var opts = {}; if (packet.options) { opts.compress = packet.options.compress; } if (self.perMessageDeflate) { var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length; if (len < self.perMessageDeflate.threshold) { opts.compress = false; } } } // Sometimes the websocket has already been closed but the browser didn't // have a chance of informing us about it yet, in that case send will // throw an error try { if (self.usingBrowserWebSocket) { // TypeError is thrown when passing the second argument on Safari self.ws.send(data); } else { self.ws.send(data, opts); } } catch (e) { debug('websocket closed before onclose event'); } --total || done(); }); })(packets[i]); } function done() { self.emit('flush'); // fake drain // defer to next tick to allow Socket to clear writeBuffer setTimeout(function () { self.writable = true; self.emit('drain'); }, 0); } }; /** * Called upon close * * @api private */ WS.prototype.onClose = function () { Transport.prototype.onClose.call(this); }; /** * Closes socket. * * @api private */ WS.prototype.doClose = function () { if (typeof this.ws !== 'undefined') { this.ws.close(); } }; /** * Generates uri for connection. * * @api private */ WS.prototype.uri = function () { var query = this.query || {}; var schema = this.secure ? 'wss' : 'ws'; var port = ''; // avoid port if default for schema if (this.port && ('wss' === schema && Number(this.port) !== 443 || 'ws' === schema && Number(this.port) !== 80)) { port = ':' + this.port; } // append timestamp to URI if (this.timestampRequests) { query[this.timestampParam] = yeast(); } // communicate binary support capabilities if (!this.supportsBinary) { query.b64 = 1; } query = parseqs.encode(query); // prepend ? to query if (query.length) { query = '?' + query; } var ipv6 = this.hostname.indexOf(':') !== -1; return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query; }; /** * Feature detection for WebSocket. * * @return {Boolean} whether this transport is available. * @api public */ WS.prototype.check = function () { return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name); }; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 28 */ /***/ function(module, exports) { /* (ignored) */ /***/ }, /* 29 */ /***/ function(module, exports) { var indexOf = [].indexOf; module.exports = function(arr, obj){ if (indexOf) return arr.indexOf(obj); for (var i = 0; i < arr.length; ++i) { if (arr[i] === obj) return i; } return -1; }; /***/ }, /* 30 */ /***/ function(module, exports) { /** * Parses an URI * * @author Steven Levithan <stevenlevithan.com> (MIT license) * @api private */ var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; var parts = [ 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor' ]; module.exports = function parseuri(str) { var src = str, b = str.indexOf('['), e = str.indexOf(']'); if (b != -1 && e != -1) { str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length); } var m = re.exec(str || ''), uri = {}, i = 14; while (i--) { uri[parts[i]] = m[i] || ''; } if (b != -1 && e != -1) { uri.source = src; uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':'); uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':'); uri.ipv6uri = true; } return uri; }; /***/ } /******/ ]) }); ;
src/routes.js
Malinin88/SaratovJS
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */ import React from 'react'; import Router from 'react-routing/src/Router'; import http from './core/HttpClient'; import App from './components/App'; import ContentPage from './components/ContentPage'; import ContactPage from './components/ContactPage'; import LoginPage from './components/LoginPage'; import RegisterPage from './components/RegisterPage'; import NotFoundPage from './components/NotFoundPage'; import ErrorPage from './components/ErrorPage'; const router = new Router(on => { on('*', async (state, next) => { const component = await next(); return component && <App context={state.context}>{component}</App>; }); on('/contact', async () => <ContactPage />); on('/login', async () => <LoginPage />); on('/register', async () => <RegisterPage />); on('*', async (state) => { const content = await http.get(`/api/content?path=${state.path}`); return content && <ContentPage {...content} />; }); on('error', (state, error) => state.statusCode === 404 ? <App context={state.context} error={error}><NotFoundPage /></App> : <App context={state.context} error={error}><ErrorPage /></App> ); }); export default router;
src/SocketProvider.js
danielfarrell/redux-channels
import React from 'react'; import { Provider } from 'react-redux'; const { Component, PropTypes } = React; const storeShape = PropTypes.shape({ subscribe: PropTypes.func.isRequired, dispatch: PropTypes.func.isRequired, getState: PropTypes.func.isRequired }); export default class SocketProvider extends Component { constructor(props, context) { super(props, context); this.store = props.store; this.socket = props.socket; } getChildContext() { return { store: this.store, socket: this.socket }; } render() { const { children } = this.props; return ( <Provider store={this.store}> {children} </Provider> ); } } SocketProvider.propTypes = { store: storeShape, socket: PropTypes.object, children: PropTypes.element }; SocketProvider.childContextTypes = { store: storeShape, socket: PropTypes.object };
ajax/libs/zxcvbn/3.2.0/zxcvbn.js
cdnjs/cdnjs
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.zxcvbn = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ var adjacency_graphs;adjacency_graphs={qwerty:{"!":["`~",null,null,"2@","qQ",null],'"':[";:","[{","]}",null,null,"/?"],"#":["2@",null,null,"4$","eE","wW"],$:["3#",null,null,"5%","rR","eE"],"%":["4$",null,null,"6^","tT","rR"],"&":["6^",null,null,"8*","uU","yY"],"'":[";:","[{","]}",null,null,"/?"],"(":["8*",null,null,"0)","oO","iI"],")":["9(",null,null,"-_","pP","oO"],"*":["7&",null,null,"9(","iI","uU"],"+":["-_",null,null,null,"]}","[{"],",":["mM","kK","lL",".>",null,null],"-":["0)",null,null,"=+","[{","pP"],".":[",<","lL",";:","/?",null,null],"/":[".>",";:","'\"",null,null,null],0:["9(",null,null,"-_","pP","oO"],1:["`~",null,null,"2@","qQ",null],2:["1!",null,null,"3#","wW","qQ"],3:["2@",null,null,"4$","eE","wW"],4:["3#",null,null,"5%","rR","eE"],5:["4$",null,null,"6^","tT","rR"],6:["5%",null,null,"7&","yY","tT"],7:["6^",null,null,"8*","uU","yY"],8:["7&",null,null,"9(","iI","uU"],9:["8*",null,null,"0)","oO","iI"],":":["lL","pP","[{","'\"","/?",".>"],";":["lL","pP","[{","'\"","/?",".>"],"<":["mM","kK","lL",".>",null,null],"=":["-_",null,null,null,"]}","[{"],">":[",<","lL",";:","/?",null,null],"?":[".>",";:","'\"",null,null,null],"@":["1!",null,null,"3#","wW","qQ"],A:[null,"qQ","wW","sS","zZ",null],B:["vV","gG","hH","nN",null,null],C:["xX","dD","fF","vV",null,null],D:["sS","eE","rR","fF","cC","xX"],E:["wW","3#","4$","rR","dD","sS"],F:["dD","rR","tT","gG","vV","cC"],G:["fF","tT","yY","hH","bB","vV"],H:["gG","yY","uU","jJ","nN","bB"],I:["uU","8*","9(","oO","kK","jJ"],J:["hH","uU","iI","kK","mM","nN"],K:["jJ","iI","oO","lL",",<","mM"],L:["kK","oO","pP",";:",".>",",<"],M:["nN","jJ","kK",",<",null,null],N:["bB","hH","jJ","mM",null,null],O:["iI","9(","0)","pP","lL","kK"],P:["oO","0)","-_","[{",";:","lL"],Q:[null,"1!","2@","wW","aA",null],R:["eE","4$","5%","tT","fF","dD"],S:["aA","wW","eE","dD","xX","zZ"],T:["rR","5%","6^","yY","gG","fF"],U:["yY","7&","8*","iI","jJ","hH"],V:["cC","fF","gG","bB",null,null],W:["qQ","2@","3#","eE","sS","aA"],X:["zZ","sS","dD","cC",null,null],Y:["tT","6^","7&","uU","hH","gG"],Z:[null,"aA","sS","xX",null,null],"[":["pP","-_","=+","]}","'\"",";:"],"\\":["]}",null,null,null,null,null],"]":["[{","=+",null,"\\|",null,"'\""],"^":["5%",null,null,"7&","yY","tT"],_:["0)",null,null,"=+","[{","pP"],"`":[null,null,null,"1!",null,null],a:[null,"qQ","wW","sS","zZ",null],b:["vV","gG","hH","nN",null,null],c:["xX","dD","fF","vV",null,null],d:["sS","eE","rR","fF","cC","xX"],e:["wW","3#","4$","rR","dD","sS"],f:["dD","rR","tT","gG","vV","cC"],g:["fF","tT","yY","hH","bB","vV"],h:["gG","yY","uU","jJ","nN","bB"],i:["uU","8*","9(","oO","kK","jJ"],j:["hH","uU","iI","kK","mM","nN"],k:["jJ","iI","oO","lL",",<","mM"],l:["kK","oO","pP",";:",".>",",<"],m:["nN","jJ","kK",",<",null,null],n:["bB","hH","jJ","mM",null,null],o:["iI","9(","0)","pP","lL","kK"],p:["oO","0)","-_","[{",";:","lL"],q:[null,"1!","2@","wW","aA",null],r:["eE","4$","5%","tT","fF","dD"],s:["aA","wW","eE","dD","xX","zZ"],t:["rR","5%","6^","yY","gG","fF"],u:["yY","7&","8*","iI","jJ","hH"],v:["cC","fF","gG","bB",null,null],w:["qQ","2@","3#","eE","sS","aA"],x:["zZ","sS","dD","cC",null,null],y:["tT","6^","7&","uU","hH","gG"],z:[null,"aA","sS","xX",null,null],"{":["pP","-_","=+","]}","'\"",";:"],"|":["]}",null,null,null,null,null],"}":["[{","=+",null,"\\|",null,"'\""],"~":[null,null,null,"1!",null,null]},dvorak:{"!":["`~",null,null,"2@","'\"",null],'"':[null,"1!","2@",",<","aA",null],"#":["2@",null,null,"4$",".>",",<"],$:["3#",null,null,"5%","pP",".>"],"%":["4$",null,null,"6^","yY","pP"],"&":["6^",null,null,"8*","gG","fF"],"'":[null,"1!","2@",",<","aA",null],"(":["8*",null,null,"0)","rR","cC"],")":["9(",null,null,"[{","lL","rR"],"*":["7&",null,null,"9(","cC","gG"],"+":["/?","]}",null,"\\|",null,"-_"],",":["'\"","2@","3#",".>","oO","aA"],"-":["sS","/?","=+",null,null,"zZ"],".":[",<","3#","4$","pP","eE","oO"],"/":["lL","[{","]}","=+","-_","sS"],0:["9(",null,null,"[{","lL","rR"],1:["`~",null,null,"2@","'\"",null],2:["1!",null,null,"3#",",<","'\""],3:["2@",null,null,"4$",".>",",<"],4:["3#",null,null,"5%","pP",".>"],5:["4$",null,null,"6^","yY","pP"],6:["5%",null,null,"7&","fF","yY"],7:["6^",null,null,"8*","gG","fF"],8:["7&",null,null,"9(","cC","gG"],9:["8*",null,null,"0)","rR","cC"],":":[null,"aA","oO","qQ",null,null],";":[null,"aA","oO","qQ",null,null],"<":["'\"","2@","3#",".>","oO","aA"],"=":["/?","]}",null,"\\|",null,"-_"],">":[",<","3#","4$","pP","eE","oO"],"?":["lL","[{","]}","=+","-_","sS"],"@":["1!",null,null,"3#",",<","'\""],A:[null,"'\"",",<","oO",";:",null],B:["xX","dD","hH","mM",null,null],C:["gG","8*","9(","rR","tT","hH"],D:["iI","fF","gG","hH","bB","xX"],E:["oO",".>","pP","uU","jJ","qQ"],F:["yY","6^","7&","gG","dD","iI"],G:["fF","7&","8*","cC","hH","dD"],H:["dD","gG","cC","tT","mM","bB"],I:["uU","yY","fF","dD","xX","kK"],J:["qQ","eE","uU","kK",null,null],K:["jJ","uU","iI","xX",null,null],L:["rR","0)","[{","/?","sS","nN"],M:["bB","hH","tT","wW",null,null],N:["tT","rR","lL","sS","vV","wW"],O:["aA",",<",".>","eE","qQ",";:"],P:[".>","4$","5%","yY","uU","eE"],Q:[";:","oO","eE","jJ",null,null],R:["cC","9(","0)","lL","nN","tT"],S:["nN","lL","/?","-_","zZ","vV"],T:["hH","cC","rR","nN","wW","mM"],U:["eE","pP","yY","iI","kK","jJ"],V:["wW","nN","sS","zZ",null,null],W:["mM","tT","nN","vV",null,null],X:["kK","iI","dD","bB",null,null],Y:["pP","5%","6^","fF","iI","uU"],Z:["vV","sS","-_",null,null,null],"[":["0)",null,null,"]}","/?","lL"],"\\":["=+",null,null,null,null,null],"]":["[{",null,null,null,"=+","/?"],"^":["5%",null,null,"7&","fF","yY"],_:["sS","/?","=+",null,null,"zZ"],"`":[null,null,null,"1!",null,null],a:[null,"'\"",",<","oO",";:",null],b:["xX","dD","hH","mM",null,null],c:["gG","8*","9(","rR","tT","hH"],d:["iI","fF","gG","hH","bB","xX"],e:["oO",".>","pP","uU","jJ","qQ"],f:["yY","6^","7&","gG","dD","iI"],g:["fF","7&","8*","cC","hH","dD"],h:["dD","gG","cC","tT","mM","bB"],i:["uU","yY","fF","dD","xX","kK"],j:["qQ","eE","uU","kK",null,null],k:["jJ","uU","iI","xX",null,null],l:["rR","0)","[{","/?","sS","nN"],m:["bB","hH","tT","wW",null,null],n:["tT","rR","lL","sS","vV","wW"],o:["aA",",<",".>","eE","qQ",";:"],p:[".>","4$","5%","yY","uU","eE"],q:[";:","oO","eE","jJ",null,null],r:["cC","9(","0)","lL","nN","tT"],s:["nN","lL","/?","-_","zZ","vV"],t:["hH","cC","rR","nN","wW","mM"],u:["eE","pP","yY","iI","kK","jJ"],v:["wW","nN","sS","zZ",null,null],w:["mM","tT","nN","vV",null,null],x:["kK","iI","dD","bB",null,null],y:["pP","5%","6^","fF","iI","uU"],z:["vV","sS","-_",null,null,null],"{":["0)",null,null,"]}","/?","lL"],"|":["=+",null,null,null,null,null],"}":["[{",null,null,null,"=+","/?"],"~":[null,null,null,"1!",null,null]},keypad:{"*":["/",null,null,null,"-","+","9","8"],"+":["9","*","-",null,null,null,null,"6"],"-":["*",null,null,null,null,null,"+","9"],".":["0","2","3",null,null,null,null,null],"/":[null,null,null,null,"*","9","8","7"],0:[null,"1","2","3",".",null,null,null],1:[null,null,"4","5","2","0",null,null],2:["1","4","5","6","3",".","0",null],3:["2","5","6",null,null,null,".","0"],4:[null,null,"7","8","5","2","1",null],5:["4","7","8","9","6","3","2","1"],6:["5","8","9","+",null,null,"3","2"],7:[null,null,null,"/","8","5","4",null],8:["7",null,"/","*","9","6","5","4"],9:["8","/","*","-","+",null,"6","5"]},mac_keypad:{"*":["/",null,null,null,null,null,"-","9"],"+":["6","9","-",null,null,null,null,"3"],"-":["9","/","*",null,null,null,"+","6"],".":["0","2","3",null,null,null,null,null],"/":["=",null,null,null,"*","-","9","8"],0:[null,"1","2","3",".",null,null,null],1:[null,null,"4","5","2","0",null,null],2:["1","4","5","6","3",".","0",null],3:["2","5","6","+",null,null,".","0"],4:[null,null,"7","8","5","2","1",null],5:["4","7","8","9","6","3","2","1"],6:["5","8","9","-","+",null,"3","2"],7:[null,null,null,"=","8","5","4",null],8:["7",null,"=","/","9","6","5","4"],9:["8","=","/","*","-","+","6","5"],"=":[null,null,null,null,"/","9","8","7"]}},module.exports=adjacency_graphs; },{}],2:[function(require,module,exports){ var frequency_lists;frequency_lists={passwords:["password","123456","12345678","1234","qwerty","12345","dragon","pussy","baseball","football","letmein","monkey","696969","abc123","mustang","shadow","master","111111","2000","jordan","superman","harley","1234567","fuckme","hunter","fuckyou","trustno1","ranger","buster","tigger","soccer","fuck","batman","test","pass","killer","hockey","charlie","love","sunshine","asshole","6969","pepper","access","123456789","654321","maggie","starwars","silver","dallas","yankees","123123","666666","hello","orange","biteme","freedom","computer","sexy","thunder","ginger","hammer","summer","corvette","fucker","austin","1111","merlin","121212","golfer","cheese","princess","chelsea","diamond","yellow","bigdog","secret","asdfgh","sparky","cowboy","camaro","matrix","falcon","iloveyou","guitar","purple","scooter","phoenix","aaaaaa","tigers","porsche","mickey","maverick","cookie","nascar","peanut","131313","money","horny","samantha","panties","steelers","snoopy","boomer","whatever","iceman","smokey","gateway","dakota","cowboys","eagles","chicken","dick","black","zxcvbn","ferrari","knight","hardcore","compaq","coffee","booboo","bitch","bulldog","xxxxxx","welcome","player","ncc1701","wizard","scooby","junior","internet","bigdick","brandy","tennis","blowjob","banana","monster","spider","lakers","rabbit","enter","mercedes","fender","yamaha","diablo","boston","tiger","marine","chicago","rangers","gandalf","winter","bigtits","barney","raiders","porn","badboy","blowme","spanky","bigdaddy","chester","london","midnight","blue","fishing","000000","hannah","slayer","11111111","sexsex","redsox","thx1138","asdf","marlboro","panther","zxcvbnm","arsenal","qazwsx","mother","7777777","jasper","winner","golden","butthead","viking","iwantu","angels","prince","cameron","girls","madison","hooters","startrek","captain","maddog","jasmine","butter","booger","golf","rocket","theman","liverpoo","flower","forever","muffin","turtle","sophie","redskins","toyota","sierra","winston","giants","packers","newyork","casper","bubba","112233","lovers","mountain","united","driver","helpme","fucking","pookie","lucky","maxwell","8675309","bear","suckit","gators","5150","222222","shithead","fuckoff","jaguar","hotdog","tits","gemini","lover","xxxxxxxx","777777","canada","florida","88888888","rosebud","metallic","doctor","trouble","success","stupid","tomcat","warrior","peaches","apples","fish","qwertyui","magic","buddy","dolphins","rainbow","gunner","987654","freddy","alexis","braves","cock","2112","1212","cocacola","xavier","dolphin","testing","bond007","member","voodoo","7777","samson","apollo","fire","tester","beavis","voyager","porno","rush2112","beer","apple","scorpio","skippy","sydney","red123","power","beaver","star","jackass","flyers","boobs","232323","zzzzzz","scorpion","doggie","legend","ou812","yankee","blazer","runner","birdie","bitches","555555","topgun","asdfasdf","heaven","viper","animal","2222","bigboy","4444","private","godzilla","lifehack","phantom","rock","august","sammy","cool","platinum","jake","bronco","heka6w2","copper","cumshot","garfield","willow","cunt","slut","69696969","kitten","super","jordan23","eagle1","shelby","america","11111","free","123321","chevy","bullshit","broncos","horney","surfer","nissan","999999","saturn","airborne","elephant","shit","action","adidas","qwert","1313","explorer","police","christin","december","wolf","sweet","therock","online","dickhead","brooklyn","cricket","racing","penis","0000","teens","redwings","dreams","michigan","hentai","magnum","87654321","donkey","trinity","digital","333333","cartman","guinness","123abc","speedy","buffalo","kitty","pimpin","eagle","einstein","nirvana","vampire","xxxx","playboy","pumpkin","snowball","test123","sucker","mexico","beatles","fantasy","celtic","cherry","cassie","888888","sniper","genesis","hotrod","reddog","alexande","college","jester","passw0rd","bigcock","lasvegas","slipknot","3333","death","1q2w3e","eclipse","1q2w3e4r","drummer","montana","music","aaaa","carolina","colorado","creative","hello1","goober","friday","bollocks","scotty","abcdef","bubbles","hawaii","fluffy","horses","thumper","5555","pussies","darkness","asdfghjk","boobies","buddha","sandman","naughty","honda","azerty","6666","shorty","money1","beach","loveme","4321","simple","poohbear","444444","badass","destiny","vikings","lizard","assman","nintendo","123qwe","november","xxxxx","october","leather","bastard","101010","extreme","password1","pussy1","lacrosse","hotmail","spooky","amateur","alaska","badger","paradise","maryjane","poop","mozart","video","vagina","spitfire","cherokee","cougar","420420","horse","enigma","raider","brazil","blonde","55555","dude","drowssap","lovely","1qaz2wsx","booty","snickers","nipples","diesel","rocks","eminem","westside","suzuki","passion","hummer","ladies","alpha","suckme","147147","pirate","semperfi","jupiter","redrum","freeuser","wanker","stinky","ducati","paris","babygirl","windows","spirit","pantera","monday","patches","brutus","smooth","penguin","marley","forest","cream","212121","flash","maximus","nipple","vision","pokemon","champion","fireman","indian","softball","picard","system","cobra","enjoy","lucky1","boogie","marines","security","dirty","admin","wildcats","pimp","dancer","hardon","fucked","abcd1234","abcdefg","ironman","wolverin","freepass","bigred","squirt","justice","hobbes","pearljam","mercury","domino","9999","rascal","hitman","mistress","bbbbbb","peekaboo","naked","budlight","electric","sluts","stargate","saints","bondage","bigman","zombie","swimming","duke","qwerty1","babes","scotland","disney","rooster","mookie","swordfis","hunting","blink182","8888","samsung","bubba1","whore","general","passport","aaaaaaaa","erotic","liberty","arizona","abcd","newport","skipper","rolltide","balls","happy1","galore","christ","weasel","242424","wombat","digger","classic","bulldogs","poopoo","accord","popcorn","turkey","bunny","mouse","007007","titanic","liverpool","dreamer","everton","chevelle","psycho","nemesis","pontiac","connor","eatme","lickme","cumming","ireland","spiderma","patriots","goblue","devils","empire","asdfg","cardinal","shaggy","froggy","qwer","kawasaki","kodiak","phpbb","54321","chopper","hooker","whynot","lesbian","snake","teen","ncc1701d","qqqqqq","airplane","britney","avalon","sugar","sublime","wildcat","raven","scarface","elizabet","123654","trucks","wolfpack","pervert","redhead","american","bambam","woody","shaved","snowman","tiger1","chicks","raptor","1969","stingray","shooter","france","stars","madmax","sports","789456","simpsons","lights","chronic","hahaha","packard","hendrix","service","spring","srinivas","spike","252525","bigmac","suck","single","popeye","tattoo","texas","bullet","taurus","sailor","wolves","panthers","japan","strike","pussycat","chris1","loverboy","berlin","sticky","tarheels","russia","wolfgang","testtest","mature","catch22","juice","michael1","nigger","159753","alpha1","trooper","hawkeye","freaky","dodgers","pakistan","machine","pyramid","vegeta","katana","moose","tinker","coyote","infinity","pepsi","letmein1","bang","hercules","james1","tickle","outlaw","browns","billybob","pickle","test1","sucks","pavilion","changeme","caesar","prelude","darkside","bowling","wutang","sunset","alabama","danger","zeppelin","pppppp","2001","ping","darkstar","madonna","qwe123","bigone","casino","charlie1","mmmmmm","integra","wrangler","apache","tweety","qwerty12","bobafett","transam","2323","seattle","ssssss","openup","pandora","pussys","trucker","indigo","storm","malibu","weed","review","babydoll","doggy","dilbert","pegasus","joker","catfish","flipper","fuckit","detroit","cheyenne","bruins","smoke","marino","fetish","xfiles","stinger","pizza","babe","stealth","manutd","gundam","cessna","longhorn","presario","mnbvcxz","wicked","mustang1","victory","21122112","awesome","athena","q1w2e3r4","holiday","knicks","redneck","12341234","gizmo","scully","dragon1","devildog","triumph","bluebird","shotgun","peewee","angel1","metallica","madman","impala","lennon","omega","access14","enterpri","search","smitty","blizzard","unicorn","tight","asdf1234","trigger","truck","beauty","thailand","1234567890","cadillac","castle","bobcat","buddy1","sunny","stones","asian","butt","loveyou","hellfire","hotsex","indiana","panzer","lonewolf","trumpet","colors","blaster","12121212","fireball","precious","jungle","atlanta","gold","corona","polaris","timber","theone","baller","chipper","skyline","dragons","dogs","licker","engineer","kong","pencil","basketba","hornet","barbie","wetpussy","indians","redman","foobar","travel","morpheus","target","141414","hotstuff","photos","rocky1","fuck_inside","dollar","turbo","design","hottie","202020","blondes","4128","lestat","avatar","goforit","random","abgrtyu","jjjjjj","cancer","q1w2e3","smiley","express","virgin","zipper","wrinkle1","babylon","consumer","monkey1","serenity","samurai","99999999","bigboobs","skeeter","joejoe","master1","aaaaa","chocolat","christia","stephani","tang","1234qwer","98765432","sexual","maxima","77777777","buckeye","highland","seminole","reaper","bassman","nugget","lucifer","airforce","nasty","warlock","2121","dodge","chrissy","burger","snatch","pink","gang","maddie","huskers","piglet","photo","dodger","paladin","chubby","buckeyes","hamlet","abcdefgh","bigfoot","sunday","manson","goldfish","garden","deftones","icecream","blondie","spartan","charger","stormy","juventus","galaxy","escort","zxcvb","planet","blues","david1","ncc1701e","1966","51505150","cavalier","gambit","ripper","oicu812","nylons","aardvark","whiskey","bing","plastic","anal","babylon5","loser","racecar","insane","yankees1","mememe","hansolo","chiefs","fredfred","freak","frog","salmon","concrete","zxcv","shamrock","atlantis","wordpass","rommel","1010","predator","massive","cats","sammy1","mister","stud","marathon","rubber","ding","trunks","desire","montreal","justme","faster","irish","1999","jessica1","alpine","diamonds","00000","swinger","shan","stallion","pitbull","letmein2","ming","shadow1","clitoris","fuckers","jackoff","bluesky","sundance","renegade","hollywoo","151515","wolfman","soldier","ling","goddess","manager","sweety","titans","fang","ficken","niners","bubble","hello123","ibanez","sweetpea","stocking","323232","tornado","content","aragorn","trojan","christop","rockstar","geronimo","pascal","crimson","google","fatcat","lovelove","cunts","stimpy","finger","wheels","viper1","latin","greenday","987654321","creampie","hiphop","snapper","funtime","duck","trombone","adult","cookies","mulder","westham","latino","jeep","ravens","drizzt","madness","energy","kinky","314159","slick","rocker","55555555","mongoose","speed","dddddd","catdog","cheng","ghost","gogogo","tottenha","curious","butterfl","mission","january","shark","techno","lancer","lalala","chichi","orion","trixie","delta","bobbob","bomber","kang","1968","spunky","liquid","beagle","granny","network","kkkkkk","1973","biggie","beetle","teacher","toronto","anakin","genius","cocks","dang","karate","snakes","bangkok","fuckyou2","pacific","daytona","infantry","skywalke","sailing","raistlin","vanhalen","huang","blackie","tarzan","strider","sherlock","gong","dietcoke","ultimate","shai","sprite","ting","artist","chai","chao","devil","python","ninja","ytrewq","superfly","456789","tian","jing","jesus1","freedom1","drpepper","chou","hobbit","shen","nolimit","mylove","biscuit","yahoo","shasta","sex4me","smoker","pebbles","pics","philly","tong","tintin","lesbians","cactus","frank1","tttttt","chun","danni","emerald","showme","pirates","lian","dogg","xiao","xian","tazman","tanker","toshiba","gotcha","rang","keng","jazz","bigguy","yuan","tomtom","chaos","fossil","racerx","creamy","bobo","musicman","warcraft","blade","shuang","shun","lick","jian","microsoft","rong","feng","getsome","quality","1977","beng","wwwwww","yoyoyo","zhang","seng","harder","qazxsw","qian","cong","chuan","deng","nang","boeing","keeper","western","1963","subaru","sheng","thuglife","teng","jiong","miao","mang","maniac","pussie","a1b2c3","zhou","zhuang","xing","stonecol","spyder","liang","jiang","memphis","ceng","magic1","logitech","chuang","sesame","shao","poison","titty","kuan","kuai","mian","guan","hamster","guai","ferret","geng","duan","pang","maiden","quan","velvet","nong","neng","nookie","buttons","bian","bingo","biao","zhong","zeng","zhun","ying","zong","xuan","zang","0.0.000","suan","shei","shui","sharks","shang","shua","peng","pian","piao","liao","meng","miami","reng","guang","cang","ruan","diao","luan","qing","chui","chuo","cuan","nuan","ning","heng","huan","kansas","muscle","weng","1passwor","bluemoon","zhui","zhua","xiang","zheng","zhen","zhei","zhao","zhan","yomama","zhai","zhuo","zuan","tarheel","shou","shuo","tiao","leng","kuang","jiao","13579","basket","qiao","qiong","qiang","chuai","nian","niao","niang","huai","22222222","zhuan","zhuai","shuan","shuai","stardust","jumper","66666666","charlott","qwertz","bones","waterloo","2002","11223344","oldman","trains","vertigo","246810","black1","swallow","smiles","standard","alexandr","parrot","user","1976","surfing","pioneer","apple1","asdasd","auburn","hannibal","frontier","panama","welcome1","vette","blue22","shemale","111222","baggins","groovy","global","181818","1979","blades","spanking","byteme","lobster","dawg","japanese","1970","1964","2424","polo","coco","deedee","mikey","1972","171717","1701","strip","jersey","green1","capital","putter","vader","seven7","banshee","grendel","dicks","hidden","iloveu","1980","ledzep","147258","female","bugger","buffett","molson","2020","wookie","sprint","jericho","102030","ranger1","trebor","deepthroat","bonehead","molly1","mirage","models","1984","2468","showtime","squirrel","pentium","anime","gator","powder","twister","connect","neptune","engine","eatshit","mustangs","woody1","shogun","septembe","pooh","jimbo","russian","sabine","voyeur","2525","363636","camel","germany","giant","qqqq","nudist","bone","sleepy","tequila","fighter","obiwan","makaveli","vacation","walnut","1974","ladybug","cantona","ccbill","satan","rusty1","passwor1","columbia","kissme","motorola","william1","1967","zzzz","skater","smut","matthew1","valley","coolio","dagger","boner","bull","horndog","jason1","penguins","rescue","griffey","8j4ye3uz","californ","champs","qwertyuiop","portland","colt45","xxxxxxx","xanadu","tacoma","carpet","gggggg","safety","palace","italia","picturs","picasso","thongs","tempest","asd123","hairy","foxtrot","nimrod","hotboy","343434","1111111","asdfghjkl","goose","overlord","stranger","454545","shaolin","sooners","socrates","spiderman","peanuts","13131313","andrew1","filthy","ohyeah","africa","intrepid","pickles","assass","fright","potato","hhhhhh","kingdom","weezer","424242","pepsi1","throat","looker","puppy","butch","sweets","megadeth","analsex","nymets","ddddddd","bigballs","oakland","oooooo","qweasd","chucky","carrot","chargers","discover","dookie","condor","horny1","sunrise","sinner","jojo","megapass","martini","assfuck","ffffff","mushroom","jamaica","7654321","77777","cccccc","gizmodo","tractor","mypass","hongkong","1975","blue123","pissing","thomas1","redred","basketball","satan666","dublin","bollox","kingkong","1971","22222","272727","sexx","bbbb","grizzly","passat","defiant","bowler","knickers","monitor","wisdom","slappy","thor","letsgo","robert1","brownie","098765","playtime","lightnin","atomic","goku","llllll","qwaszx","cosmos","bosco","knights","beast","slapshot","assword","frosty","dumbass","mallard","dddd","159357","titleist","aussie","golfing","doobie","loveit","werewolf","vipers","1965","blabla","surf","sucking","tardis","thegame","legion","rebels","sarah1","onelove","loulou","toto","blackcat","0007","tacobell","soccer1","jedi","method","poopie","boob","breast","kittycat","belly","pikachu","thunder1","thankyou","celtics","frogger","scoobydo","sabbath","coltrane","budman","jackal","zzzzz","licking","gopher","geheim","lonestar","primus","pooper","newpass","brasil","heather1","husker","element","moomoo","beefcake","zzzzzzzz","shitty","smokin","jjjj","anthony1","anubis","backup","gorilla","fuckface","lowrider","punkrock","traffic","delta1","amazon","fatass","dodgeram","dingdong","qqqqqqqq","breasts","boots","honda1","spidey","poker","temp","johnjohn","147852","asshole1","dogdog","tricky","crusader","syracuse","spankme","speaker","meridian","amadeus","harley1","falcons","turkey50","kenwood","keyboard","ilovesex","1978","shazam","shalom","lickit","jimbob","roller","fatman","sandiego","magnus","cooldude","clover","mobile","plumber","texas1","tool","topper","mariners","rebel","caliente","celica","oxford","osiris","orgasm","punkin","porsche9","tuesday","breeze","bossman","kangaroo","latinas","astros","scruffy","qwertyu","hearts","jammer","java","1122","goodtime","chelsea1","freckles","flyboy","doodle","nebraska","bootie","kicker","webmaster","vulcan","191919","blueeyes","321321","farside","rugby","director","pussy69","power1","hershey","hermes","monopoly","birdman","blessed","blackjac","southern","peterpan","thumbs","fuckyou1","rrrrrr","a1b2c3d4","coke","bohica","elvis1","blacky","sentinel","snake1","richard1","1234abcd","guardian","candyman","fisting","scarlet","dildo","pancho","mandingo","lucky7","condom","munchkin","billyboy","summer1","sword","skiing","site","sony","thong","rootbeer","assassin","fffff","fitness","durango","postal","achilles","kisses","warriors","plymouth","topdog","asterix","hallo","cameltoe","fuckfuck","eeeeee","sithlord","theking","avenger","backdoor","chevrole","trance","cosworth","houses","homers","eternity","kingpin","verbatim","incubus","1961","blond","zaphod","shiloh","spurs","mighty","aliens","charly","dogman","omega1","printer","aggies","deadhead","bitch1","stone55","pineappl","thekid","rockets","camels","formula","oracle","pussey","porkchop","abcde","clancy","mystic","inferno","blackdog","steve1","alfa","grumpy","flames","puffy","proxy","valhalla","unreal","herbie","engage","yyyyyy","010101","pistol","celeb","gggg","portugal","a12345","newbie","mmmm","1qazxsw2","zorro","writer","stripper","sebastia","spread","links","metal","1221","565656","funfun","trojans","cyber","hurrican","moneys","1x2zkg8w","zeus","tomato","lion","atlantic","usa123","trans","aaaaaaa","homerun","hyperion","kevin1","blacks","44444444","skittles","fart","gangbang","fubar","sailboat","oilers","buster1","hithere","immortal","sticks","pilot","lexmark","jerkoff","maryland","cheers","possum","cutter","muppet","swordfish","sport","sonic","peter1","jethro","rockon","asdfghj","pass123","pornos","ncc1701a","bootys","buttman","bonjour","1960","bears","362436","spartans","tinman","threesom","maxmax","1414","bbbbb","camelot","chewie","gogo","fusion","saint","dilligaf","nopass","hustler","hunter1","whitey","beast1","yesyes","spank","smudge","pinkfloy","patriot","lespaul","hammers","formula1","sausage","scooter1","orioles","oscar1","colombia","cramps","exotic","iguana","suckers","slave","topcat","lancelot","magelan","racer","crunch","british","steph","456123","skinny","seeking","rockhard","filter","freaks","sakura","pacman","poontang","newlife","homer1","klingon","watcher","walleye","tasty","sinatra","starship","steel","starbuck","poncho","amber1","gonzo","catherin","candle","firefly","goblin","scotch","diver","usmc","huskies","kentucky","kitkat","beckham","bicycle","yourmom","studio","33333333","splash","jimmy1","12344321","sapphire","mailman","raiders1","ddddd","excalibu","illini","imperial","lansing","maxx","gothic","golfball","facial","front242","macdaddy","qwer1234","vectra","cowboys1","crazy1","dannyboy","aquarius","franky","ffff","sassy","pppp","pppppppp","prodigy","noodle","eatpussy","vortex","wanking","billy1","siemens","phillies","groups","chevy1","cccc","gggggggg","doughboy","dracula","nurses","loco","lollipop","utopia","chrono","cooler","nevada","wibble","summit","1225","capone","fugazi","panda","qazwsxed","puppies","triton","9876","nnnnnn","momoney","iforgot","wolfie","studly","hamburg","81fukkc","741852","catman","china","gagging","scott1","oregon","qweqwe","crazybab","daniel1","cutlass","holes","mothers","music1","walrus","1957","bigtime","xtreme","simba","ssss","rookie","bathing","rotten","maestro","turbo1","99999","butthole","hhhh","yoda","shania","phish","thecat","rightnow","baddog","greatone","gateway1","abstr","napster","brian1","bogart","hitler","wildfire","jackson1","1981","beaner","yoyo","0.0.0.000","super1","select","snuggles","slutty","phoenix1","technics","toon","raven1","rayray","123789","1066","albion","greens","gesperrt","brucelee","hehehe","kelly1","mojo","1998","bikini","woofwoof","yyyy","strap","sites","central","f**k","nyjets","punisher","username","vanilla","twisted","bunghole","viagra","veritas","pony","titts","labtec","jenny1","masterbate","mayhem","redbull","govols","gremlin","505050","gmoney","rovers","diamond1","trident","abnormal","deskjet","cuddles","bristol","milano","vh5150","jarhead","1982","bigbird","bizkit","sixers","slider","star69","starfish","penetration","tommy1","john316","caligula","flicks","films","railroad","cosmo","cthulhu","br0d3r","bearbear","swedish","spawn","patrick1","reds","anarchy","groove","fuckher","oooo","airbus","cobra1","clips","delete","duster","kitty1","mouse1","monkeys","jazzman","1919","262626","swinging","stroke","stocks","sting","pippen","labrador","jordan1","justdoit","meatball","females","vector","cooter","defender","nike","bubbas","bonkers","kahuna","wildman","4121","sirius","static","piercing","terror","teenage","leelee","microsof","mechanic","robotech","rated","chaser","salsero","macross","quantum","tsunami","daddy1","cruise","newpass6","nudes","hellyeah","1959","zaq12wsx","striker","spice","spectrum","smegma","thumb","jjjjjjjj","mellow","cancun","cartoon","sabres","samiam","oranges","oklahoma","lust","denali","nude","noodles","brest","hooter","mmmmmmmm","warthog","blueblue","zappa","wolverine","sniffing","jjjjj","calico","freee","rover","pooter","closeup","bonsai","emily1","keystone","iiii","1955","yzerman","theboss","tolkien","megaman","rasta","bbbbbbbb","hal9000","goofy","gringo","gofish","gizmo1","samsam","scuba","onlyme","tttttttt","corrado","clown","clapton","bulls","jayhawk","wwww","sharky","seeker","ssssssss","pillow","thesims","lighter","lkjhgf","melissa1","marcius2","guiness","gymnast","casey1","goalie","godsmack","lolo","rangers1","poppy","clemson","clipper","deeznuts","holly1","eeee","kingston","yosemite","sucked","sex123","sexy69","pic\\'s","tommyboy","masterbating","gretzky","happyday","frisco","orchid","orange1","manchest","aberdeen","ne1469","boxing","korn","intercourse","161616","1985","ziggy","supersta","stoney","amature","babyboy","bcfields","goliath","hack","hardrock","frodo","scout","scrappy","qazqaz","tracker","active","craving","commando","cohiba","cyclone","bubba69","katie1","mpegs","vsegda","irish1","sexy1","smelly","squerting","lions","jokers","jojojo","meathead","ashley1","groucho","cheetah","champ","firefox","gandalf1","packer","love69","tyler1","typhoon","tundra","bobby1","kenworth","village","volley","wolf359","0420","000007","swimmer","skydive","smokes","peugeot","pompey","legolas","redhot","rodman","redalert","grapes","4runner","carrera","floppy","ou8122","quattro","cloud9","davids","nofear","busty","homemade","mmmmm","whisper","vermont","webmaste","wives","insertion","jayjay","philips","topher","temptress","midget","ripken","havefun","canon","celebrity","ghetto","ragnarok","usnavy","conover","cruiser","dalshe","nicole1","buzzard","hottest","kingfish","misfit","milfnew","warlord","wassup","bigsexy","blackhaw","zippy","tights","kungfu","labia","meatloaf","area51","batman1","bananas","636363","ggggg","paradox","queens","adults","aikido","cigars","hoosier","eeyore","moose1","warez","interacial","streaming","313131","pertinant","pool6123","mayday","animated","banker","baddest","gordon24","ccccc","fantasies","aisan","deadman","homepage","ejaculation","whocares","iscool","jamesbon","1956","1pussy","womam","sweden","skidoo","spock","sssss","pepper1","pinhead","micron","allsop","amsterda","gunnar","666999","february","fletch","george1","sapper","sasha1","luckydog","lover1","magick","popopo","ultima","cypress","businessbabe","brandon1","vulva","vvvv","jabroni","bigbear","yummy","010203","searay","secret1","sinbad","sexxxx","soleil","software","piccolo","thirteen","leopard","legacy","memorex","redwing","rasputin","134679","anfield","greenbay","catcat","feather","scanner","pa55word","contortionist","danzig","daisy1","hores","exodus","iiiiii","1001","subway","snapple","sneakers","sonyfuck","picks","poodle","test1234","llll","junebug","marker","mellon","ronaldo","roadkill","amanda1","asdfjkl","beaches","great1","cheerleaers","doitnow","ozzy","boxster","brighton","housewifes","kkkk","mnbvcx","moocow","vides","1717","bigmoney","blonds","1000","storys","stereo","4545","420247","seductive","sexygirl","lesbean","justin1","124578","cabbage","canadian","gangbanged","dodge1","dimas","malaka","puss","probes","coolman","nacked","hotpussy","erotica","kool","implants","intruder","bigass","zenith","woohoo","womans","tango","pisces","laguna","maxell","andyod22","barcelon","chainsaw","chickens","flash1","orgasms","magicman","profit","pusyy","pothead","coconut","chuckie","clevelan","builder","budweise","hotshot","horizon","experienced","mondeo","wifes","1962","stumpy","smiths","slacker","pitchers","passwords","laptop","allmine","alliance","bbbbbbb","asscock","halflife","88888","chacha","saratoga","sandy1","doogie","qwert40","transexual","close-up","ib6ub9","volvo","jacob1","iiiii","beastie","sunnyday","stoned","sonics","starfire","snapon","pictuers","pepe","testing1","tiberius","lisalisa","lesbain","litle","retard","ripple","austin1","badgirl","golfgolf","flounder","royals","dragoon","dickie","passwor","majestic","poppop","trailers","nokia","bobobo","br549","minime","mikemike","whitesox","1954","3232","353535","seamus","solo","sluttey","pictere","titten","lback","1024","goodluck","fingerig","gallaries","goat","passme","oasis","lockerroom","logan1","rainman","treasure","custom","cyclops","nipper","bucket","homepage-","hhhhh","momsuck","indain","2345","beerbeer","bimmer","stunner","456456","tootsie","testerer","reefer","1012","harcore","gollum","545454","chico","caveman","fordf150","fishes","gaymen","saleen","doodoo","pa55w0rd","presto","qqqqq","cigar","bogey","helloo","dutch","kamikaze","wasser","vietnam","visa","japanees","0123","swords","slapper","peach","masterbaiting","redwood","1005","ametuer","chiks","fucing","sadie1","panasoni","mamas","rambo","unknown","absolut","dallas1","housewife","keywest","kipper","18436572","1515","zxczxc","303030","shaman","terrapin","masturbation","mick","redfish","1492","angus","goirish","hardcock","forfun","galary","freeporn","duchess","olivier","lotus","pornographic","ramses","purdue","traveler","crave","brando","enter1","killme","moneyman","welder","windsor","wifey","indon","yyyyy","taylor1","4417","picher","pickup","thumbnils","johnboy","jets","ameteur","amateurs","apollo13","hambone","goldwing","5050","sally1","doghouse","padres","pounding","quest","truelove","underdog","trader","climber","bolitas","hohoho","beanie","beretta","wrestlin","stroker","sexyman","jewels","johannes","mets","rhino","bdsm","balloons","grils","happy123","flamingo","route66","devo","outkast","paintbal","magpie","llllllll","twilight","critter","cupcake","nickel","bullseye","knickerless","videoes","binladen","xerxes","slim","slinky","pinky","thanatos","meister","menace","retired","albatros","balloon","goten","5551212","getsdown","donuts","nwo4life","tttt","comet","deer","dddddddd","deeznutz","nasty1","nonono","enterprise","eeeee","misfit99","milkman","vvvvvv","1818","blueboy","bigbutt","tech","toolman","juggalo","jetski","barefoot","50spanks","gobears","scandinavian","cubbies","nitram","kings","bilbo","yumyum","zzzzzzz","stylus","321654","shannon1","server","squash","starman","steeler","phrases","techniques","laser","135790","athens","cbr600","chemical","fester","gangsta","fucku2","droopy","objects","passwd","lllll","manchester","vedder","clit","chunky","darkman","buckshot","buddah","boobed","henti","winter1","bigmike","beta","zidane","talon","slave1","pissoff","thegreat","lexus","matador","readers","armani","goldstar","5656","fmale","fuking","fucku","ggggggg","sauron","diggler","pacers","looser","pounded","premier","triangle","cosmic","depeche","norway","helmet","mustard","misty1","jagger","3x7pxr","silver1","snowboar","penetrating","photoes","lesbens","lindros","roadking","rockford","1357","143143","asasas","goodboy","898989","chicago1","ferrari1","galeries","godfathe","gawker","gargoyle","gangster","rubble","rrrr","onetime","pussyman","pooppoop","trapper","cinder","newcastl","boricua","bunny1","boxer","hotred","hockey1","edward1","moscow","mortgage","bigtit","snoopdog","joshua1","july","1230","assholes","frisky","sanity","divine","dharma","lucky13","akira","butterfly","hotbox","hootie","howdy","earthlink","kiteboy","westwood","1988","blackbir","biggles","wrench","wrestle","slippery","pheonix","penny1","pianoman","thedude","jenn","jonjon","jones1","roadrunn","arrow","azzer","seahawks","diehard","dotcom","tunafish","chivas","cinnamon","clouds","deluxe","northern","boobie","momomo","modles","volume","23232323","bluedog","wwwwwww","zerocool","yousuck","pluto","limewire","joung","awnyce","gonavy","haha","films+pic+galeries","girsl","fuckthis","girfriend","uncencored","a123456","chrisbln","combat","cygnus","cupoi","netscape","hhhhhhhh","eagles1","elite","knockers","1958","tazmania","shonuf","pharmacy","thedog","midway","arsenal1","anaconda","australi","gromit","gotohell","787878","66666","carmex2","camber","gator1","ginger1","fuzzy","seadoo","lovesex","rancid","uuuuuu","911911","bulldog1","heater","monalisa","mmmmmmm","whiteout","virtual","jamie1","japanes","james007","2727","2469","blam","bitchass","zephyr","stiffy","sweet1","southpar","spectre","tigger1","tekken","lakota","lionking","jjjjjjj","megatron","1369","hawaiian","gymnastic","golfer1","gunners","7779311","515151","sanfran","optimus","panther1","love1","maggie1","pudding","aaron1","delphi","niceass","bounce","house1","killer1","momo","musashi","jammin","2003","234567","wp2003wp","submit","sssssss","spikes","sleeper","passwort","kume","meme","medusa","mantis","reebok","1017","artemis","harry1","cafc91","fettish","oceans","oooooooo","mango","ppppp","trainer","uuuu","909090","death1","bullfrog","hokies","holyshit","eeeeeee","jasmine1","&amp","&amp;","spinner","jockey","babyblue","gooner","474747","cheeks","pass1234","parola","okokok","poseidon","989898","crusher","cubswin","nnnn","kotaku","mittens","whatsup","vvvvv","iomega","insertions","bengals","biit","yellow1","012345","spike1","sowhat","pitures","pecker","theend","hayabusa","hawkeyes","florian","qaz123","usarmy","twinkle","chuckles","hounddog","hover","hothot","europa","kenshin","kojak","mikey1","water1","196969","wraith","zebra","wwwww","33333","simon1","spider1","snuffy","philippe","thunderb","teddy1","marino13","maria1","redline","renault","aloha","handyman","cerberus","gamecock","gobucks","freesex","duffman","ooooo","nuggets","magician","longbow","preacher","porno1","chrysler","contains","dalejr","navy","buffy1","hedgehog","hoosiers","honey1","hott","heyhey","dutchess","everest","wareagle","ihateyou","sunflowe","3434","senators","shag","spoon","sonoma","stalker","poochie","terminal","terefon","maradona","1007","142536","alibaba","america1","bartman","astro","goth","chicken1","cheater","ghost1","passpass","oral","r2d2c3po","civic","cicero","myxworld","kkkkk","missouri","wishbone","infiniti","1a2b3c","1qwerty","wonderboy","shojou","sparky1","smeghead","poiuy","titanium","lantern","jelly","1213","bayern","basset","gsxr750","cattle","fishing1","fullmoon","gilles","dima","obelix","popo","prissy","ramrod","bummer","hotone","dynasty","entry","konyor","missy1","282828","xyz123","426hemi","404040","seinfeld","pingpong","lazarus","marine1","12345a","beamer","babyface","greece","gustav","7007","ccccccc","faggot","foxy","gladiato","duckie","dogfood","packers1","longjohn","radical","tuna","clarinet","danny1","novell","bonbon","kashmir","kiki","mortimer","modelsne","moondog","vladimir","insert","1953","zxc123","supreme","3131","sexxx","softail","poipoi","pong","mars","martin1","rogue","avalanch","audia4","55bgates","cccccccc","came11","figaro","dogboy","dnsadm","dipshit","paradigm","othello","operator","tripod","chopin","coucou","cocksuck","borussia","heritage","hiziad","homerj","mullet","whisky","4242","speedo","starcraf","skylar","spaceman","piggy","tiger2","legos","jezebel","joker1","mazda","727272","chester1","rrrrrrrr","dundee","lumber","ppppppp","tranny","aaliyah","admiral","comics","delight","buttfuck","homeboy","eternal","kilroy","violin","wingman","walmart","bigblue","blaze","beemer","beowulf","bigfish","yyyyyyy","woodie","yeahbaby","0123456","tbone","syzygy","starter","linda1","merlot","mexican","11235813","banner","bangbang","badman","barfly","grease","charles1","ffffffff","doberman","dogshit","overkill","coolguy","claymore","demo","nomore","hhhhhhh","hondas","iamgod","enterme","electron","eastside","minimoni","mybaby","wildbill","wildcard","ipswich","200000","bearcat","zigzag","yyyyyyyy","sweetnes","369369","skyler","skywalker","pigeon","tipper","asdf123","alphabet","asdzxc","babybaby","banane","guyver","graphics","chinook","florida1","flexible","fuckinside","ursitesux","tototo","adam12","christma","chrome","buddie","bombers","hippie","misfits","292929","woofer","wwwwwwww","stubby","sheep","sparta","stang","spud","sporty","pinball","just4fun","maxxxx","rebecca1","fffffff","freeway","garion","rrrrr","sancho","outback","maggot","puddin","987456","hoops","mydick","19691969","bigcat","shiner","silverad","templar","lamer","juicy","mike1","maximum","1223","10101010","arrows","alucard","haggis","cheech","safari","dog123","orion1","paloma","qwerasdf","presiden","vegitto","969696","adonis","cookie1","newyork1","buddyboy","hellos","heineken","eraser","moritz","millwall","visual","jaybird","1983","beautifu","zodiac","steven1","sinister","slammer","smashing","slick1","sponge","teddybea","ticklish","jonny","1211","aptiva","applepie","bailey1","guitar1","canyon","gagged","fuckme1","digital1","dinosaur","98765","90210","clowns","cubs","deejay","nigga","naruto","boxcar","icehouse","hotties","electra","widget","1986","2004","bluefish","bingo1","*****","stratus","sultan","storm1","44444","4200","sentnece","sexyboy","sigma","smokie","spam","pippo","temppass","manman","1022","bacchus","aztnm","axio","bamboo","hakr","gregor","hahahaha","5678","camero1","dolphin1","paddle","magnet","qwert1","pyon","porsche1","tripper","noway","burrito","bozo","highheel","hookem","eddie1","entropy","kkkkkkkk","kkkkkkk","illinois","1945","1951","24680","21212121","100000","stonecold","taco","subzero","sexxxy","skolko","skyhawk","spurs1","sputnik","testpass","jiggaman","1224","hannah1","525252","4ever","carbon","scorpio1","rt6ytere","madison1","loki","coolness","coldbeer","citadel","monarch","morgan1","washingt","1997","bella1","yaya","superb","taxman","studman","3636","pizzas","tiffany1","lassie","larry1","joseph1","mephisto","reptile","razor","1013","hammer1","gypsy","grande","camper","chippy","cat123","chimera","fiesta","glock","domain","dieter","dragonba","onetwo","nygiants","password2","quartz","prowler","prophet","towers","ultra","cocker","corleone","dakota1","cumm","nnnnnnn","boxers","heynow","iceberg","kittykat","wasabi","vikings1","beerman","splinter","snoopy1","pipeline","mickey1","mermaid","micro","meowmeow","redbird","baura","chevys","caravan","frogman","diving","dogger","draven","drifter","oatmeal","paris1","longdong","quant4307s","rachel1","vegitta","cobras","corsair","dadada","mylife","bowwow","hotrats","eastwood","moonligh","modena","illusion","iiiiiii","jayhawks","swingers","shocker","shrimp","sexgod","squall","poiu","tigers1","toejam","tickler","julie1","jimbo1","jefferso","michael2","rodeo","robot","1023","annie1","bball","happy2","charter","flasher","falcon1","fiction","fastball","gadget","scrabble","diaper","dirtbike","oliver1","paco","macman","poopy","popper","postman","ttttttt","acura","cowboy1","conan","daewoo","nemrac58","nnnnn","nextel","bobdylan","eureka","kimmie","kcj9wx5n","killbill","musica","volkswag","wage","windmill","wert","vintage","iloveyou1","itsme","zippo","311311","starligh","smokey1","snappy","soulmate","plasma","krusty","just4me","marius","rebel1","1123","audi","fick","goaway","rusty2","dogbone","doofus","ooooooo","oblivion","mankind","mahler","lllllll","pumper","puck","pulsar","valkyrie","tupac","compass","concorde","cougars","delaware","niceguy","nocturne","bob123","boating","bronze","herewego","hewlett","houhou","earnhard","eeeeeeee","mingus","mobydick","venture","verizon","imation","1950","1948","1949","223344","bigbig","wowwow","sissy","spiker","snooker","sluggo","player1","jsbach","jumbo","medic","reddevil","reckless","123456a","1125","1031","astra","gumby","757575","585858","chillin","fuck1","radiohea","upyours","trek","coolcool","classics","choochoo","nikki1","nitro","boytoy","excite","kirsty","wingnut","wireless","icu812","1master","beatle","bigblock","wolfen","summer99","sugar1","tartar","sexysexy","senna","sexman","soprano","platypus","pixies","telephon","laura1","laurent","rimmer","1020","12qwaszx","hamish","halifax","fishhead","forum","dododo","doit","paramedi","lonesome","mandy1","uuuuu","uranus","ttttt","bruce1","helper","hopeful","eduard","dusty1","kathy1","moonbeam","muscles","monster1","monkeybo","windsurf","vvvvvvv","vivid","install","1947","187187","1941","1952","susan1","31415926","sinned","sexxy","smoothie","snowflak","playstat","playa","playboy1","toaster","jerry1","marie1","mason1","merlin1","roger1","roadster","112358","1121","andrea1","bacardi","hardware","789789","5555555","captain1","fergus","sascha","rrrrrrr","dome","onion","lololo","qqqqqqq","undertak","uuuuuuuu","uuuuuuu","cobain","cindy1","coors","descent","nimbus","nomad","nanook","norwich","bombay","broker","hookup","kiwi","winners","jackpot","1a2b3c4d","1776","beardog","bighead","bird33","0987","spooge","pelican","peepee","titan","thedoors","jeremy1","altima","baba","hardone","5454","catwoman","finance","farmboy","farscape","genesis1","salomon","loser1","r2d2","pumpkins","chriss","cumcum","ninjas","ninja1","killers","miller1","islander","jamesbond","intel","19841984","2626","bizzare","blue12","biker","yoyoma","sushi","shitface","spanker","steffi","sphinx","please1","paulie","pistons","tiburon","maxwell1","mdogg","rockies","armstron","alejandr","arctic","banger","audio","asimov","753951","4you","chilly","care1839","flyfish","fantasia","freefall","sandrine","oreo","ohshit","macbeth","madcat","loveya","qwerqwer","colnago","chocha","cobalt","crystal1","dabears","nevets","nineinch","broncos1","epsilon","kestrel","winston1","warrior1","iiiiiiii","iloveyou2","1616","woowoo","sloppy","specialk","tinkerbe","jellybea","reader","redsox1","1215","1112","arcadia","baggio","555666","cayman","cbr900rr","gabriell","glennwei","sausages","disco","pass1","lovebug","macmac","puffin","vanguard","trinitro","airwolf","aaa111","cocaine","cisco","datsun","bricks","bumper","eldorado","kidrock","wizard1","whiskers","wildwood","istheman","25802580","bigones","woodland","wolfpac","strawber","3030","sheba1","sixpack","peace1","physics","tigger2","toad","megan1","meow","ringo","amsterdam","717171","686868","5424","canuck","football1","footjob","fulham","seagull","orgy","lobo","mancity","vancouve","vauxhall","acidburn","derf","myspace1","boozer","buttercu","hola","minemine","munch","1dragon","biology","bestbuy","bigpoppa","blackout","blowfish","bmw325","bigbob","stream","talisman","tazz","sundevil","3333333","skate","shutup","shanghai","spencer1","slowhand","pinky1","tootie","thecrow","jubilee","jingle","matrix1","manowar","messiah","resident","redbaron","romans","andromed","athlon","beach1","badgers","guitars","harald","harddick","gotribe","6996","7grout","5wr2i7h8","635241","chase1","fallout","fiddle","fenris","francesc","fortuna","fairlane","felix1","gasman","fucks","sahara","sassy1","dogpound","dogbert","divx1","manila","pornporn","quasar","venom","987987","access1","clippers","daman","crusty","nathan1","nnnnnnnn","bruno1","budapest","kittens","kerouac","mother1","waldo1","whistler","whatwhat","wanderer","idontkno","1942","1946","bigdawg","bigpimp","zaqwsx","414141","3000gt","434343","serpent","smurf","pasword","thisisit","john1","robotics","redeye","rebelz","1011","alatam","asians","bama","banzai","harvest","575757","5329","fatty","fender1","flower2","funky","sambo","drummer1","dogcat","oedipus","osama","prozac","private1","rampage","concord","cinema","cornwall","cleaner","ciccio","clutch","corvet07","daemon","bruiser","boiler","hjkl","egghead","mordor","jamess","iverson3","bluesman","zouzou","090909","1002","stone1","4040","sexo","smith1","sperma","sneaky","polska","thewho","terminat","krypton","lekker","johnson1","johann","rockie","aspire","goodie","cheese1","fenway","fishon","fishin","fuckoff1","girls1","doomsday","pornking","ramones","rabbits","transit","aaaaa1","boyz","bookworm","bongo","bunnies","buceta","highbury","henry1","eastern","mischief","mopar","ministry","vienna","wildone","bigbooty","beavis1","xxxxxx1","yogibear","000001","0815","zulu","420000","sigmar","sprout","stalin","lkjhgfds","lagnaf","rolex","redfox","referee","123123123","1231","angus1","ballin","attila","greedy","grunt","747474","carpedie","caramel","foxylady","gatorade","futbol","frosch","saiyan","drums","donner","doggy1","drum","doudou","nutmeg","quebec","valdepen","tosser","tuscl","comein","cola","deadpool","bremen","hotass","hotmail1","eskimo","eggman","koko","kieran","katrin","kordell1","komodo","mone","munich","vvvvvvvv","jackson5","2222222","bergkamp","bigben","zanzibar","xxx123","sunny1","373737","slayer1","snoop","peachy","thecure","little1","jennaj","rasta69","1114","aries","havana","gratis","calgary","checkers","flanker","salope","dirty1","draco","dogface","luv2epus","rainbow6","qwerty123","umpire","turnip","vbnm","tucson","troll","codered","commande","neon","nico","nightwin","boomer1","bushido","hotmail0","enternow","keepout","karen1","mnbv","viewsoni","volcom","wizards","1995","berkeley","woodstoc","tarpon","shinobi","starstar","phat","toolbox","julien","johnny1","joebob","riders","reflex","120676","1235","angelus","anthrax","atlas","grandam","harlem","hawaii50","655321","cabron","challeng","callisto","firewall","firefire","flyer","flower1","gambler","frodo1","sam123","scania","dingo","papito","passmast","ou8123","randy1","twiggy","travis1","treetop","addict","admin1","963852","aceace","cirrus","bobdole","bonjovi","bootsy","boater","elway7","kenny1","moonshin","montag","wayne1","white1","jazzy","jakejake","1994","1991","2828","bluejays","belmont","sensei","southpark","peeper","pharao","pigpen","tomahawk","teensex","leedsutd","jeepster","jimjim","josephin","melons","matthias","robocop","1003","1027","antelope","azsxdc","gordo","hazard","granada","8989","7894","ceasar","cabernet","cheshire","chelle","candy1","fergie","fidelio","giorgio","fuckhead","dominion","qawsed","trucking","chloe1","daddyo","nostromo","boyboy","booster","bucky","honolulu","esquire","dynamite","mollydog","windows1","waffle","wealth","vincent1","jabber","jaguars","javelin","irishman","idefix","bigdog1","blue42","blanked","blue32","biteme1","bearcats","yessir","sylveste","sunfire","tbird","stryker","3ip76k2","sevens","pilgrim","tenchi","titman","leeds","lithium","linkin","marijuan","mariner","markie","midnite","reddwarf","1129","123asd","12312312","allstar","albany","asdf12","aspen","hardball","goldfing","7734","49ers","carnage","callum","carlos1","fitter","fandango","gofast","gamma","fucmy69","scrapper","dogwood","django","magneto","premium","9999999","abc1234","newyear","bookie","bounty","brown1","bologna","elway","killjoy","klondike","mouser","wayer","impreza","insomnia","24682468","2580","24242424","billbill","bellaco","blues1","blunts","teaser","sf49ers","shovel","solitude","spikey","pimpdadd","timeout","toffee","lefty","johndoe","johndeer","mega","manolo","ratman","robin1","1124","1210","1028","1226","babylove","barbados","gramma","646464","carpente","chaos1","fishbone","fireblad","frogs","screamer","scuba1","ducks","doggies","dicky","obsidian","rams","tottenham","aikman","comanche","corolla","cumslut","cyborg","boston1","houdini","helmut","elvisp","keksa12","monty1","wetter","watford","wiseguy","1989","1987","20202020","biatch","beezer","bigguns","blueball","bitchy","wyoming","yankees2","wrestler","stupid1","sealteam","sidekick","simple1","smackdow","sporting","spiral","smeller","plato","tophat","test2","toomuch","jello","junkie","maxim","maxime","meadow","remingto","roofer","124038","1018","1269","1227","123457","arkansas","aramis","beaker","barcelona","baltimor","googoo","goochi","852456","4711","catcher","champ1","fortress","fishfish","firefigh","geezer","rsalinas","samuel1","saigon","scooby1","dick1","doom","dontknow","magpies","manfred","vader1","universa","tulips","mygirl","bowtie","holycow","honeys","enforcer","waterboy","1992","23skidoo","bimbo","blue11","birddog","zildjian","030303","stinker","stoppedby","sexybabe","speakers","slugger","spotty","smoke1","polopolo","perfect1","torpedo","lakeside","jimmys","junior1","masamune","1214","april1","grinch","767676","5252","cherries","chipmunk","cezer121","carnival","capecod","finder","fearless","goats","funstuff","gideon","savior","seabee","sandro","schalke","salasana","disney1","duckman","pancake","pantera1","malice","love123","qwert123","tracer","creation","cwoui","nascar24","hookers","erection","ericsson","edthom","kokoko","kokomo","mooses","inter","1michael","1993","19781978","25252525","shibby","shamus","skibum","sheepdog","sex69","spliff","slipper","spoons","spanner","snowbird","toriamos","temp123","tennesse","lakers1","jomama","mazdarx7","recon","revolver","1025","1101","barney1","babycake","gotham","gravity","hallowee","616161","515000","caca","cannabis","chilli","fdsa","getout","fuck69","gators1","sable","rumble","dolemite","dork","duffer","dodgers1","onions","logger","lookout","magic32","poon","twat","coventry","citroen","civicsi","cocksucker","coochie","compaq1","nancy1","buzzer","boulder","butkus","bungle","hogtied","hotgirls","heidi1","eggplant","mustang6","monkey12","wapapapa","wendy1","volleyba","vibrate","blink","birthday4","xxxxx1","stephen1","suburban","sheeba","start1","soccer10","starcraft","soccer12","peanut1","plastics","penthous","peterbil","tetsuo","torino","tennis1","termite","lemmein","lakewood","jughead","melrose","megane","redone","angela1","goodgirl","gonzo1","golden1","gotyoass","656565","626262","capricor","chains","calvin1","getmoney","gabber","runaway","salami","dungeon","dudedude","opus","paragon","panhead","pasadena","opendoor","odyssey","magellan","printing","prince1","trustme","nono","buffet","hound","kajak","killkill","moto","winner1","vixen","whiteboy","versace","voyager1","indy","jackjack","bigal","beech","biggun","blake1","blue99","big1","synergy","success1","336699","sixty9","shark1","simba1","sebring","spongebo","spunk","springs","sliver","phialpha","password9","pizza1","pookey","tickling","lexingky","lawman","joe123","mike123","romeo1","redheads","apple123","backbone","aviation","green123","carlitos","byebye","cartman1","camden","chewy","camaross","favorite6","forumwp","ginscoot","fruity","sabrina1","devil666","doughnut","pantie","oldone","paintball","lumina","rainbow1","prosper","umbrella","ajax","951753","achtung","abc12345","compact","corndog","deerhunt","darklord","dank","nimitz","brandy1","hetfield","holein1","hillbill","hugetits","evolutio","kenobi","whiplash","wg8e3wjf","istanbul","invis","1996","bigjohn","bluebell","beater","benji","bluejay","xyzzy","suckdick","taichi","stellar","shaker","semper","splurge","squeak","pearls","playball","pooky","titfuck","joemama","johnny5","marcello","maxi","rhubarb","ratboy","reload","1029","1030","1220","bbking","baritone","gryphon","57chevy","494949","celeron","fishy","gladiator","fucker1","roswell","dougie","dicker","diva","donjuan","nympho","racers","truck1","trample","acer","cricket1","climax","denmark","cuervo","notnow","nittany","neutron","bosco1","buffa","breaker","hello2","hydro","kisskiss","kittys","montecar","modem","mississi","20012001","bigdick1","benfica","yahoo1","striper","tabasco","supra","383838","456654","seneca","shuttle","penguin1","pathfind","testibil","thethe","jeter2","marma","mark1","metoo","republic","rollin","redleg","redbone","redskin","1245","anthony7","altoids","barley","asswipe","bauhaus","bbbbbb1","gohome","harrier","golfpro","goldeney","818181","6666666","5000","5rxypn","cameron1","checker","calibra","freefree","faith1","fdm7ed","giraffe","giggles","fringe","scamper","rrpass1","screwyou","dimples","pacino","ontario","passthie","oberon","quest1","postov1000","puppydog","puffer","qwerty7","tribal","adam25","a1234567","collie","cleopatr","davide","namaste","buffalo1","bonovox","bukkake","burner","bordeaux","burly","hun999","enters","mohawk","vgirl","jayden","1812","1943","222333","bigjim","bigd","zoom","wordup","ziggy1","yahooo","workout","young1","xmas","zzzzzz1","surfer1","strife","sunlight","tasha1","skunk","sprinter","peaches1","pinetree","plum","pimping","theforce","thedon","toocool","laddie","lkjh","jupiter1","matty","redrose","1200","102938","antares","austin31","goose1","737373","78945612","789987","6464","calimero","caster","casper1","cement","chevrolet","chessie","caddy","canucks","fellatio","f00tball","gateway2","gamecube","rugby1","scheisse","dshade","dixie1","offshore","lucas1","macaroni","manga","pringles","puff","trouble1","ussy","coolhand","colonial","colt","darthvad","cygnusx1","natalie1","newark","hiking","errors","elcamino","koolaid","knight1","murphy1","volcano","idunno","2005","2233","blueberr","biguns","yamahar1","zapper","zorro1","0911","3006","sixsix","shopper","sextoy","snowboard","speedway","pokey","playboy2","titi","toonarmy","lambda","joecool","juniper","max123","mariposa","met2002","reggae","ricky1","1236","1228","1016","all4one","baberuth","asgard","484848","5683","6669","catnip","charisma","capslock","cashmone","galant","frenchy","gizmodo1","girlies","screwy","doubled","divers","dte4uw","dragonfl","treble","twinkie","tropical","crescent","cococo","dabomb","daffy","dandfa","cyrano","nathanie","boners","helium","hellas","espresso","killa","kikimora","w4g8at","ilikeit","iforget","1944","20002000","birthday1","beatles1","blue1","bigdicks","beethove","blacklab","blazers","benny1","woodwork","0069","0101","taffy","4567","shodan","pavlov","pinnacle","petunia","tito","teenie","lemonade","lalakers","lebowski","lalalala","ladyboy","jeeper","joyjoy","mercury1","mantle","mannn","rocknrol","riversid","123aaa","11112222","121314","1021","1004","1120","allen1","ambers","amstel","alice1","alleycat","allegro","ambrosia","gspot","goodsex","hattrick","harpoon","878787","8inches","4wwvte","cassandr","charlie123","gatsby","generic","gareth","fuckme2","samm","seadog","satchmo","scxakv","santafe","dipper","outoutout","madmad","london1","qbg26i","pussy123","tzpvaw","vamp","comp","cowgirl","coldplay","dawgs","nt5d27","novifarm","notredam","newness","mykids","bryan1","bouncer","hihihi","honeybee","iceman1","hotlips","dynamo","kappa","kahlua","muffy","mizzou","wannabe","wednesda","whatup","waterfal","willy1","bear1","billabon","youknow","yyyyyy1","zachary1","01234567","070462","zurich","superstar","stiletto","strat","427900","sigmachi","shells","sexy123","smile1","sophie1","stayout","somerset","playmate","pinkfloyd","phish1","payday","thebear","telefon","laetitia","kswbdu","jerky","metro","revoluti","1216","1201","1204","1222","1115","archange","barry1","handball","676767","chewbacc","furball","gocubs","fullback","gman","dewalt","dominiqu","diver1","dhip6a","olemiss","mandrake","mangos","pretzel","pusssy","tripleh","vagabond","clovis","dandan","csfbr5yy","deadspin","ninguna","ncc74656","bootsie","bp2002","bourbon","bumble","heyyou","houston1","hemlock","hippo","hornets","horseman","excess","extensa","muffin1","virginie","werdna","idontknow","jack1","1bitch","151nxjmt","bendover","bmwbmw","zaq123","wxcvbn","supernov","tahoe","shakur","sexyone","seviyi","smart1","speed1","pepito","phantom1","playoffs","terry1","terrier","laser1","lite","lancia","johngalt","jenjen","midori","maserati","matteo","miami1","riffraff","ronald1","1218","1026","123987","1015","1103","armada","architec","austria","gotmilk","cambridg","camero","flex","foreplay","getoff","glacier","glotest","froggie","gerbil","rugger","sanity72","donna1","orchard","oyster","palmtree","pajero","m5wkqf","magenta","luckyone","treefrog","vantage","usmarine","tyvugq","uptown","abacab","aaaaaa1","chuck1","darkange","cyclones","navajo","bubba123","iawgk2","hrfzlz","dylan1","enrico","encore","eclipse1","mutant","mizuno","mustang2","video1","viewer","weed420","whales","jaguar1","1990","159159","1love","bears1","bigtruck","bigboss","blitz","xqgann","yeahyeah","zeke","zardoz","stickman","3825","sentra","shiva","skipper1","singapor","southpaw","sonora","squid","slamdunk","slimjim","placid","photon","placebo","pearl1","test12","therock1","tiger123","leinad","legman","jeepers","joeblow","mike23","redcar","rhinos","rjw7x4","1102","13576479","112211","gwju3g","greywolf","7bgiqk","7878","535353","4snz9g","candyass","cccccc1","catfight","cali","fister","fosters","finland","frankie1","gizzmo","royalty","rugrat","dodo","oemdlg","out3xf","paddy","opennow","puppy1","qazwsxedc","ramjet","abraxas","cn42qj","dancer1","death666","nudity","nimda2k","buick","bobb","braves1","henrik","hooligan","everlast","karachi","mortis","monies","motocros","wally1","willie1","inspiron","1test","2929","bigblack","xytfu7","yackwin","zaq1xsw2","yy5rbfsc","100100","0660","tahiti","takehana","332211","3535","sedona","seawolf","skydiver","spleen","slash","spjfet","special1","slimshad","sopranos","spock1","penis1","patches1","thierry","thething","toohot","limpone","mash4077","matchbox","masterp","maxdog","ribbit","rockin","redhat","1113","14789632","1331","allday","aladin","andrey","amethyst","baseball1","athome","goofy1","greenman","goofball","ha8fyp","goodday","778899","charon","chappy","caracas","cardiff","capitals","canada1","cajun","catter","freddy1","favorite2","forme","forsaken","feelgood","gfxqx686","saskia","sanjose","salsa","dilbert1","dukeduke","downhill","longhair","locutus","lockdown","malachi","mamacita","lolipop","rainyday","pumpkin1","punker","prospect","rambo1","rainbows","quake","trinity1","trooper1","citation","coolcat","default","deniro","d9ungl","daddys","nautica","nermal","bukowski","bubbles1","bogota","buds","hulk","hitachi","ender","export","kikiki","kcchiefs","kram","morticia","montrose","mongo","waqw3p","wizzard","whdbtp","whkzyc","154ugeiu","1fuck","binky","bigred1","blubber","becky1","year2005","wonderfu","xrated","0001","tampabay","survey","tammy1","stuffer","3mpz4r","3000","3some","sierra1","shampoo","shyshy","slapnuts","standby","spartan1","sprocket","stanley1","poker1","theshit","lavalamp","light1","laserjet","jediknig","jjjjj1","mazda626","menthol","margaux","medic1","rhino1","1209","1234321","amigos","apricot","asdfgh1","hairball","hatter","grimace","7xm5rq","6789","cartoons","capcom","cashflow","carrots","fanatic","format","girlie","safeway","dogfart","dondon","outsider","odin","opiate","lollol","love12","mallrats","prague","primetime21","pugsley","r29hqq","valleywa","airman","abcdefg1","darkone","cummer","natedogg","nineball","ndeyl5","natchez","newone","normandy","nicetits","buddy123","buddys","homely","husky","iceland","hr3ytm","highlife","holla","earthlin","exeter","eatmenow","kimkim","k2trix","kernel","money123","moonman","miles1","mufasa","mousey","whites","warhamme","jackass1","2277","20spanks","blobby","blinky","bikers","blackjack","becca","blue23","xman","wyvern","085tzzqi","zxzxzx","zsmj2v","suede","t26gn4","sugars","tantra","swoosh","4226","4271","321123","383pdjvl","shane1","shelby1","spades","smother","sparhawk","pisser","photo1","pebble","peavey","pavement","thistle","kronos","lilbit","linux","melanie1","marbles","redlight","1208","1138","1008","alchemy","aolsucks","alexalex","atticus","auditt","b929ezzh","goodyear","gubber","863abgsg","7474","797979","464646","543210","4zqauf","4949","ch5nmk","carlito","chewey","carebear","checkmat","cheddar","chachi","forgetit","forlife","giants1","getit","gerhard","galileo","g3ujwg","ganja","rufus1","rushmore","discus","dudeman","olympus","oscars","osprey","madcow","locust","loyola","mammoth","proton","rabbit1","ptfe3xxp","pwxd5x","purple1","punkass","prophecy","uyxnyd","tyson1","aircraft","access99","abcabc","colts","civilwar","claudia1","contour","dddddd1","cypher","dapzu455","daisydog","noles","hoochie","hoser","eldiablo","kingrich","mudvayne","motown","mp8o6d","vipergts","italiano","2055","2211","bloke","blade1","yamato","zooropa","yqlgr667","050505","zxcvbnm1","zw6syj","suckcock","tango1","swampy","445566","333666","380zliki","sexpot","sexylady","sixtynin","sickboy","spiffy","skylark","sparkles","pintail","phreak","teller","timtim","thighs","latex","letsdoit","lkjhg","landmark","lizzard","marlins","marauder","metal1","manu","righton","1127","alain","alcat","amigo","basebal1","azertyui","azrael","hamper","gotenks","golfgti","hawkwind","h2slca","grace1","6chid8","789654","canine","casio","cazzo","cbr900","cabrio","calypso","capetown","feline","flathead","fisherma","flipmode","fungus","g9zns4","giggle","gabriel1","fuck123","saffron","dogmeat","dreamcas","dirtydog","douche","dresden","dickdick","destiny1","pappy","oaktree","luft4","puta","ramada","trumpet1","vcradq","tulip","tracy71","tycoon","aaaaaaa1","conquest","chitown","creepers","cornhole","danman","dada","density","d9ebk7","darth","nirvana1","nestle","brenda1","bonanza","hotspur","hufmqw","electro","erasure","elisabet","etvww4","ewyuza","eric1","kenken","kismet","klaatu","milamber","willi","isacs155","igor","1million","1letmein","x35v8l","yogi","ywvxpz","xngwoj","zippy1","020202","****","stonewal","sentry","sexsexsex","sonysony","smirnoff","star12","solace","star1","pkxe62","pilot1","pommes","paulpaul","tical","tictac","lighthou","lemans","kubrick","letmein22","letmesee","jys6wz","jonesy","jjjjjj1","jigga","redstorm","riley1","14141414","1126","allison1","badboy1","asthma","auggie","hardwood","gumbo","616913","57np39","56qhxs","4mnveh","fatluvr69","fqkw5m","fidelity","feathers","fresno","godiva","gecko","gibson1","gogators","general1","saxman","rowing","sammys","scotts","scout1","sasasa","samoht","dragon69","ducky","dragonball","driller","p3wqaw","papillon","oneone","openit","optimist","longshot","rapier","pussy2","ralphie","tuxedo","undertow","copenhag","delldell","culinary","deltas","mytime","noname","noles1","bucker","bopper","burnout","ibilltes","hihje863","hitter","ekim","espana","eatme69","elpaso","express1","eeeeee1","eatme1","karaoke","mustang5","wellingt","willem","waterski","webcam","jasons","infinite","iloveyou!","jakarta","belair","bigdad","beerme","yoshi","yinyang","x24ik3","063dyjuy","0000007","ztmfcq","stopit","stooges","symow8","strato","2hot4u","skins","shakes","sex1","snacks","softtail","slimed123","pizzaman","tigercat","tonton","lager","lizzy","juju","john123","jesse1","jingles","martian","mario1","rootedit","rochard","redwine","requiem","riverrat","1117","1014","1205","amor","amiga","alpina","atreides","banana1","bahamut","golfman","happines","7uftyx","5432","5353","5151","4747","foxfire","ffvdj474","foreskin","gayboy","gggggg1","gameover","glitter","funny1","scoobydoo","saxophon","dingbat","digimon","omicron","panda1","loloxx","macintos","lululu","lollypop","racer1","queen1","qwertzui","upnfmc","tyrant","trout1","9skw5g","aceman","acls2h","aaabbb","acapulco","aggie","comcast","cloudy","cq2kph","d6o8pm","cybersex","davecole","darian","crumbs","davedave","dasani","mzepab","myporn","narnia","booger1","bravo1","budgie","btnjey","highlander","hotel6","humbug","ewtosi","kristin1","kobe","knuckles","keith1","katarina","muff","muschi","montana1","wingchun","wiggle","whatthe","vette1","vols","virago","intj3a","ishmael","jachin","illmatic","199999","2010","blender","bigpenis","bengal","blue1234","zaqxsw","xray","xxxxxxx1","zebras","yanks","tadpole","stripes","3737","4343","3728","4444444","368ejhih","solar","sonne","sniffer","sonata","squirts","playstation","pktmxr","pescator","texaco","lesbos","l8v53x","jo9k2jw2","jimbeam","jimi","jupiter2","jurassic","marines1","rocket1","14725836","12345679","1219","123098","1233","alessand","althor","arch","alpha123","basher","barefeet","balboa","bbbbb1","badabing","gopack","golfnut","gsxr1000","gregory1","766rglqy","8520","753159","8dihc6","69camaro","666777","cheeba","chino","cheeky","camel1","fishcake","flubber","gianni","gnasher23","frisbee","fuzzy1","fuzzball","save13tx","russell1","sandra1","scrotum","scumbag","sabre","samdog","dripping","dragon12","dragster","orwell","mainland","maine","qn632o","poophead","rapper","porn4life","rapunzel","velocity","vanessa1","trueblue","vampire1","abacus","902100","crispy","chooch","d6wnro","dabulls","dehpye","navyseal","njqcw4","nownow","nigger1","nightowl","nonenone","nightmar","bustle","buddy2","boingo","bugman","bosshog","hybrid","hillside","hilltop","hotlegs","hzze929b","hhhhh1","hellohel","evilone","edgewise","e5pftu","eded","embalmer","excalibur","elefant","kenzie","killah","kleenex","mouses","mounta1n","motors","mutley","muffdive","vivitron","w00t88","iloveit","jarjar","incest","indycar","17171717","1664","17011701","222777","2663","beelch","benben","yitbos","yyyyy1","zzzzz1","stooge","tangerin","taztaz","stewart1","summer69","system1","surveyor","stirling","3qvqod","3way","456321","sizzle","simhrq","sparty","ssptx452","sphere","persian","ploppy","pn5jvw","poobear","pianos","plaster","testme","tiff","thriller","master12","rockey","1229","1217","1478","1009","anastasi","amonra","argentin","albino","azazel","grinder","6uldv8","83y6pv","8888888","4tlved","515051","carsten","flyers88","ffffff1","firehawk","firedog","flashman","ggggg1","godspeed","galway","giveitup","funtimes","gohan","giveme","geryfe","frenchie","sayang","rudeboy","sandals","dougal","drag0n","dga9la","desktop","onlyone","otter","pandas","mafia","luckys","lovelife","manders","qqh92r","qcmfd454","radar1","punani","ptbdhw","turtles","undertaker","trs8f7","ugejvp","abba","911turbo","acdc","abcd123","crash1","colony","delboy","davinci","notebook","nitrox","borabora","bonzai","brisbane","heeled","hooyah","hotgirl","i62gbq","horse1","hpk2qc","epvjb6","mnbvc","mommy1","munster","wiccan","2369","bettyboo","blondy","bismark","beanbag","bjhgfi","blackice","yvtte545","ynot","yess","zlzfrh","wolvie","007bond","******","tailgate","tanya1","sxhq65","stinky1","3234412","3ki42x","seville","shimmer","sienna","shitshit","skillet","sooners1","solaris","smartass","pedros","pennywis","pfloyd","tobydog","thetruth","letme1n","mario66","micky","rocky2","rewq","reindeer","1128","1207","1104","1432","aprilia","allstate","bagels","baggies","barrage","guru","72d5tn","606060","4wcqjn","chance1","flange","fartman","geil","gbhcf2","fussball","fuaqz4","gameboy","geneviev","rotary","seahawk","saab","samadams","devlt4","ditto","drevil","drinker","deuce","dipstick","octopus","ottawa","losangel","loverman","porky","q9umoz","rapture","pussy4me","triplex","ue8fpw","turbos","aaa340","churchil","crazyman","cutiepie","ddddd1","dejavu","cuxldv","nbvibt","nikon","niko","nascar1","bubba2","boobear","boogers","bullwink","bulldawg","horsemen","escalade","eagle2","dynamic","efyreg","minnesot","mogwai","msnxbi","mwq6qlzo","werder","verygood","voodoo1","iiiiii1","159951","1624","1911a1","2244","bellagio","bedlam","belkin","bill1","xirt2k","??????","susieq","sundown","sukebe","swifty","2fast4u","sexe","shroom","seaweed","skeeter1","snicker","spanky1","spook","phaedrus","pilots","peddler","thumper1","tiger7","tmjxn151","thematri","l2g7k3","letmeinn","jeffjeff","johnmish","mantra","mike69","mazda6","riptide","robots","1107","1130","142857","11001001","1134","armored","allnight","amatuers","bartok","astral","baboon","balls1","bassoon","hcleeb","happyman","granite","graywolf","golf1","gomets","8vjzus","7890","789123","8uiazp","5757","474jdvff","551scasi","50cent","camaro1","cherry1","chemist","firenze","fishtank","freewill","glendale","frogfrog","ganesh","scirocco","devilman","doodles","okinawa","olympic","orpheus","ohmygod","paisley","pallmall","lunchbox","manhatta","mahalo","mandarin","qwqwqw","qguvyt","pxx3eftp","rambler","poppy1","turk182","vdlxuc","tugboat","valiant","uwrl7c","chris123","cmfnpu","decimal","debbie1","dandy","daedalus","natasha1","nissan1","nancy123","nevermin","napalm","newcastle","bonghit","ibxnsm","hhhhhh1","holger","edmonton","equinox","dvader","kimmy","knulla","mustafa","monsoon","mistral","morgana","monica1","mojave","monterey","mrbill","vkaxcs","victor1","violator","vfdhif","wilson1","wavpzt","wildstar","winter99","iqzzt580","imback","1914","19741974","1monkey","1q2w3e4r5t","2500","2255","bigshow","bigbucks","blackcoc","zoomer","wtcacq","wobble","xmen","xjznq5","yesterda","yhwnqc","zzzxxx","393939","2fchbg","skinhead","skilled","shadow12","seaside","sinful","silicon","smk7366","snapshot","sniper1","soccer11","smutty","peepers","plokij","pdiddy","pimpdaddy","thrust","terran","topaz","today1","lionhear","littlema","lauren1","lincoln1","lgnu9d","juneau","methos","rogue1","romulus","redshift","1202","1469","12locked","arizona1","alfarome","al9agd","aol123","altec","apollo1","arse","baker1","bbb747","axeman","astro1","hawthorn","goodfell","hawks1","gstring","hannes","8543852","868686","4ng62t","554uzpad","5401","567890","5232","catfood","fire1","flipflop","fffff1","fozzie","fluff","fzappa","rustydog","scarab","satin","ruger","samsung1","destin","diablo2","dreamer1","detectiv","doqvq3","drywall","paladin1","papabear","offroad","panasonic","nyyankee","luetdi","qcfmtz","pyf8ah","puddles","pussyeat","ralph1","princeto","trivia","trewq","tri5a3","advent","9898","agyvorc","clarkie","coach1","courier","christo","chowder","cyzkhw","davidb","dad2ownu","daredevi","de7mdf","nazgul","booboo1","bonzo","butch1","huskers1","hgfdsa","hornyman","elektra","england1","elodie","kermit1","kaboom","morten","mocha","monday1","morgoth","weewee","weenie","vorlon","wahoo","ilovegod","insider","jayman","1911","1dallas","1900","1ranger","201jedlz","2501","1qaz","bignuts","bigbad","beebee","billows","belize","wvj5np","wu4etd","yamaha1","wrinkle5","zebra1","yankee1","zoomzoom","09876543","0311","?????","stjabn","tainted","3tmnej","skooter","skelter","starlite","spice1","stacey1","smithy","pollux","peternorth","pixie","piston","poets","toons","topspin","kugm7b","legends","jeepjeep","joystick","junkmail","jojojojo","jonboy","midland","mayfair","riches","reznor","rockrock","reboot","renee1","roadway","rasta220","1411","1478963","1019","archery","andyandy","barks","bagpuss","auckland","gooseman","hazmat","gucci","grammy","happydog","7kbe9d","7676","6bjvpe","5lyedn","5858","5291","charlie2","c7lrwu","candys","chateau","ccccc1","cardinals","fihdfv","fortune12","gocats","gaelic","fwsadn","godboy","gldmeo","fx3tuo","fubar1","generals","gforce","rxmtkp","rulz","sairam","dunhill","dogggg","ozlq6qwm","ov3ajy","lockout","makayla","macgyver","mallorca","prima","pvjegu","qhxbij","prelude1","totoro","tusymo","trousers","tulane","turtle1","tracy1","aerosmit","abbey1","clticic","cooper1","comets","delpiero","cyprus","dante1","dave1","nounours","nexus6","nogard","norfolk","brent1","booyah","bootleg","bulls23","bulls1","booper","heretic","icecube","hellno","hounds","honeydew","hooters1","hoes","hevnm4","hugohugo","epson","evangeli","eeeee1","eyphed"], male_names:["james","john","robert","michael","william","david","richard","charles","joseph","thomas","christopher","daniel","paul","mark","donald","george","kenneth","steven","edward","brian","ronald","anthony","kevin","jason","matthew","gary","timothy","jose","larry","jeffrey","frank","scott","eric","stephen","andrew","raymond","gregory","joshua","jerry","dennis","walter","patrick","peter","harold","douglas","henry","carl","arthur","ryan","roger","joe","juan","jack","albert","jonathan","justin","terry","gerald","keith","samuel","willie","ralph","lawrence","nicholas","roy","benjamin","bruce","brandon","adam","harry","fred","wayne","billy","steve","louis","jeremy","aaron","randy","eugene","carlos","russell","bobby","victor","ernest","phillip","todd","jesse","craig","alan","shawn","clarence","sean","philip","chris","johnny","earl","jimmy","antonio","danny","bryan","tony","luis","mike","stanley","leonard","nathan","dale","manuel","rodney","curtis","norman","marvin","vincent","glenn","jeffery","travis","jeff","chad","jacob","melvin","alfred","kyle","francis","bradley","jesus","herbert","frederick","ray","joel","edwin","don","eddie","ricky","troy","randall","barry","bernard","mario","leroy","francisco","marcus","micheal","theodore","clifford","miguel","oscar","jay","jim","tom","calvin","alex","jon","ronnie","bill","lloyd","tommy","leon","derek","darrell","jerome","floyd","leo","alvin","tim","wesley","dean","greg","jorge","dustin","pedro","derrick","dan","zachary","corey","herman","maurice","vernon","roberto","clyde","glen","hector","shane","ricardo","sam","rick","lester","brent","ramon","tyler","gilbert","gene","marc","reginald","ruben","brett","angel","nathaniel","rafael","edgar","milton","raul","ben","cecil","duane","andre","elmer","brad","gabriel","ron","roland","jared","adrian","karl","cory","claude","erik","darryl","neil","christian","javier","fernando","clinton","ted","mathew","tyrone","darren","lonnie","lance","cody","julio","kurt","allan","clayton","hugh","max","dwayne","dwight","armando","felix","jimmie","everett","ian","ken","bob","jaime","casey","alfredo","alberto","dave","ivan","johnnie","sidney","byron","julian","isaac","clifton","willard","daryl","virgil","andy","salvador","kirk","sergio","seth","kent","terrance","rene","eduardo","terrence","enrique","freddie","stuart","fredrick","arturo","alejandro","joey","nick","luther","wendell","jeremiah","evan","julius","donnie","otis","trevor","luke","homer","gerard","doug","kenny","hubert","angelo","shaun","lyle","matt","alfonso","orlando","rex","carlton","ernesto","pablo","lorenzo","omar","wilbur","blake","horace","roderick","kerry","abraham","rickey","ira","andres","cesar","johnathan","malcolm","rudolph","damon","kelvin","rudy","preston","alton","archie","marco","wm","pete","randolph","garry","geoffrey","jonathon","felipe","bennie","gerardo","ed","dominic","loren","delbert","colin","guillermo","earnest","benny","noel","rodolfo","myron","edmund","salvatore","cedric","lowell","gregg","sherman","devin","sylvester","roosevelt","israel","jermaine","forrest","wilbert","leland","simon","irving","owen","rufus","woodrow","kristopher","levi","marcos","gustavo","lionel","marty","gilberto","clint","nicolas","laurence","ismael","orville","drew","ervin","dewey","al","wilfred","josh","hugo","ignacio","caleb","tomas","sheldon","erick","frankie","darrel","rogelio","terence","alonzo","elias","bert","elbert","ramiro","conrad","noah","grady","phil","cornelius","lamar","rolando","clay","percy","dexter","bradford","merle","darin","amos","terrell","moses","irvin","saul","roman","darnell","randal","tommie","timmy","darrin","brendan","toby","van","abel","dominick","emilio","elijah","cary","domingo","aubrey","emmett","marlon","emanuel","jerald","edmond","emil","dewayne","otto","teddy","reynaldo","bret","jess","trent","humberto","emmanuel","stephan","louie","vicente","lamont","garland","micah","efrain","heath","rodger","demetrius","ethan","eldon","rocky","pierre","eli","bryce","antoine","robbie","kendall","royce","sterling","grover","elton","cleveland","dylan","chuck","damian","reuben","stan","leonardo","russel","erwin","benito","hans","monte","blaine","ernie","curt","quentin","agustin","jamal","devon","adolfo","tyson","wilfredo","bart","jarrod","vance","denis","damien","joaquin","harlan","desmond","elliot","darwin","gregorio","kermit","roscoe","esteban","anton","solomon","norbert","elvin","nolan","carey","rod","quinton","hal","brain","rob","elwood","kendrick","darius","moises","marlin","fidel","thaddeus","cliff","marcel","ali","raphael","bryon","armand","alvaro","jeffry","dane","joesph","thurman","ned","sammie","rusty","michel","monty","rory","fabian","reggie","kris","isaiah","gus","avery","loyd","diego","adolph","millard","rocco","gonzalo","derick","rodrigo","gerry","rigoberto","alphonso","ty","rickie","noe","vern","elvis","bernardo","mauricio","hiram","donovan","basil","nickolas","scot","vince","quincy","eddy","sebastian","federico","ulysses","heriberto","donnell","denny","gavin","emery","romeo","jayson","dion","dante","clement","coy","odell","jarvis","bruno","issac","dudley","sanford","colby","carmelo","nestor","hollis","stefan","donny","art","linwood","beau","weldon","galen","isidro","truman","delmar","johnathon","silas","frederic","irwin","merrill","charley","marcelino","carlo","trenton","kurtis","aurelio","winfred","vito","collin","denver","leonel","emory","pasquale","mohammad","mariano","danial","landon","dirk","branden","adan","numbers","clair","buford","german","bernie","wilmer","emerson","zachery","jacques","errol","josue","edwardo","wilford","theron","raymundo","daren","tristan","robby","lincoln","jame","genaro","octavio","cornell","hung","arron","antony","herschel","alva","giovanni","garth","cyrus","cyril","ronny","stevie","lon","kennith","carmine","augustine","erich","chadwick","wilburn","russ","myles","jonas","mitchel","mervin","zane","jamel","lazaro","alphonse","randell","major","johnie","jarrett","ariel","abdul","dusty","luciano","seymour","scottie","eugenio","mohammed","valentin","arnulfo","lucien","ferdinand","thad","ezra","aldo","rubin","royal","mitch","earle","abe","marquis","lanny","kareem","jamar","boris","isiah","emile","elmo","aron","leopoldo","everette","josef","eloy","dorian","rodrick","reinaldo","lucio","jerrod","weston","hershel","lemuel","lavern","burt","jules","gil","eliseo","ahmad","nigel","efren","antwan","alden","margarito","refugio","dino","osvaldo","les","deandre","normand","kieth","ivory","trey","norberto","napoleon","jerold","fritz","rosendo","milford","sang","deon","christoper","alfonzo","lyman","josiah","brant","wilton","rico","jamaal","dewitt","brenton","yong","olin","faustino","claudio","judson","gino","edgardo","alec","jarred","donn","trinidad","tad","porfirio","odis","lenard","chauncey","tod","mel","marcelo","kory","augustus","keven","hilario","bud","sal","orval","mauro","dannie","zachariah","olen","anibal","milo","jed","thanh","amado","lenny","tory","richie","horacio","brice","mohamed","delmer","dario","mac","jonah","jerrold","robt","hank","sung","rupert","rolland","kenton","damion","chi","antone","waldo","fredric","bradly","kip","burl","tyree","jefferey","ahmed","willy","stanford","oren","moshe","mikel","enoch","brendon","quintin","jamison","florencio","darrick","tobias","minh","hassan","giuseppe","demarcus","cletus","tyrell","lyndon","keenan","werner","theo","geraldo","columbus","chet","bertram","markus","huey","hilton","dwain","donte","tyron","omer","isaias","hipolito","fermin","chung","adalberto","jamey","teodoro","mckinley","maximo","sol","raleigh","lawerence","abram","rashad","emmitt","daron","chong","samual","otha","miquel","eusebio","dong","domenic","darron","wilber","renato","hoyt","haywood","ezekiel","chas","florentino","elroy","clemente","arden","neville","edison","deshawn","carrol","shayne","nathanial","jordon","danilo","claud","val","sherwood","raymon","rayford","cristobal","ambrose","titus","hyman","felton","ezequiel","erasmo","lonny","len","ike","milan","lino","jarod","herb","andreas","rhett","jude","douglass","cordell","oswaldo","ellsworth","virgilio","toney","nathanael","del","benedict","mose","hong","isreal","garret","fausto","asa","arlen","zack","modesto","francesco","manual","jae","gaylord","gaston","filiberto","deangelo","michale","granville","wes","malik","zackary","tuan","nicky","cristopher","antione","malcom","korey","jospeh","colton","waylon","von","hosea","shad","santo","rudolf","rolf","rey","renaldo","marcellus","lucius","kristofer","harland","arnoldo","rueben","leandro","kraig","jerrell","jeromy","hobert","cedrick","arlie","winford","wally","luigi","keneth","jacinto","graig","franklyn","edmundo","sid","leif","jeramy","willian","vincenzo","shon","michal","lynwood","jere","hai","elden","darell","broderick","alonso"],female_names:["mary","patricia","linda","barbara","elizabeth","jennifer","maria","susan","margaret","dorothy","lisa","nancy","karen","betty","helen","sandra","donna","carol","ruth","sharon","michelle","laura","sarah","kimberly","deborah","jessica","shirley","cynthia","angela","melissa","brenda","amy","anna","rebecca","virginia","kathleen","pamela","martha","debra","amanda","stephanie","carolyn","christine","marie","janet","catherine","frances","ann","joyce","diane","alice","julie","heather","teresa","doris","gloria","evelyn","jean","cheryl","mildred","katherine","joan","ashley","judith","rose","janice","kelly","nicole","judy","christina","kathy","theresa","beverly","denise","tammy","irene","jane","lori","rachel","marilyn","andrea","kathryn","louise","sara","anne","jacqueline","wanda","bonnie","julia","ruby","lois","tina","phyllis","norma","paula","diana","annie","lillian","emily","robin","peggy","crystal","gladys","rita","dawn","connie","florence","tracy","edna","tiffany","carmen","rosa","cindy","grace","wendy","victoria","edith","kim","sherry","sylvia","josephine","thelma","shannon","sheila","ethel","ellen","elaine","marjorie","carrie","charlotte","monica","esther","pauline","emma","juanita","anita","rhonda","hazel","amber","eva","debbie","april","leslie","clara","lucille","jamie","joanne","eleanor","valerie","danielle","megan","alicia","suzanne","michele","gail","bertha","darlene","veronica","jill","erin","geraldine","lauren","cathy","joann","lorraine","lynn","sally","regina","erica","beatrice","dolores","bernice","audrey","yvonne","annette","june","marion","dana","stacy","ana","renee","ida","vivian","roberta","holly","brittany","melanie","loretta","yolanda","jeanette","laurie","katie","kristen","vanessa","alma","sue","elsie","beth","jeanne","vicki","carla","tara","rosemary","eileen","terri","gertrude","lucy","tonya","ella","stacey","wilma","gina","kristin","jessie","natalie","agnes","vera","charlene","bessie","delores","melinda","pearl","arlene","maureen","colleen","allison","tamara","joy","georgia","constance","lillie","claudia","jackie","marcia","tanya","nellie","minnie","marlene","heidi","glenda","lydia","viola","courtney","marian","stella","caroline","dora","jo","vickie","mattie","maxine","irma","mabel","marsha","myrtle","lena","christy","deanna","patsy","hilda","gwendolyn","jennie","nora","margie","nina","cassandra","leah","penny","kay","priscilla","naomi","carole","olga","billie","dianne","tracey","leona","jenny","felicia","sonia","miriam","velma","becky","bobbie","violet","kristina","toni","misty","mae","shelly","daisy","ramona","sherri","erika","katrina","claire","lindsey","lindsay","geneva","guadalupe","belinda","margarita","sheryl","cora","faye","ada","natasha","sabrina","isabel","marguerite","hattie","harriet","molly","cecilia","kristi","brandi","blanche","sandy","rosie","joanna","iris","eunice","angie","inez","lynda","madeline","amelia","alberta","genevieve","monique","jodi","janie","kayla","sonya","jan","kristine","candace","fannie","maryann","opal","alison","yvette","melody","luz","susie","olivia","flora","shelley","kristy","mamie","lula","lola","verna","beulah","antoinette","candice","juana","jeannette","pam","kelli","whitney","bridget","karla","celia","latoya","patty","shelia","gayle","della","vicky","lynne","sheri","marianne","kara","jacquelyn","erma","blanca","myra","leticia","pat","krista","roxanne","angelica","robyn","adrienne","rosalie","alexandra","brooke","bethany","sadie","bernadette","traci","jody","kendra","nichole","rachael","mable","ernestine","muriel","marcella","elena","krystal","angelina","nadine","kari","estelle","dianna","paulette","lora","mona","doreen","rosemarie","desiree","antonia","janis","betsy","christie","freda","meredith","lynette","teri","cristina","eula","leigh","meghan","sophia","eloise","rochelle","gretchen","cecelia","raquel","henrietta","alyssa","jana","gwen","jenna","tricia","laverne","olive","tasha","silvia","elvira","delia","kate","patti","lorena","kellie","sonja","lila","lana","darla","mindy","essie","mandy","lorene","elsa","josefina","jeannie","miranda","dixie","lucia","marta","faith","lela","johanna","shari","camille","tami","shawna","elisa","ebony","melba","ora","nettie","tabitha","ollie","winifred","kristie","marina","alisha","aimee","rena","myrna","marla","tammie","latasha","bonita","patrice","ronda","sherrie","addie","francine","deloris","stacie","adriana","cheri","abigail","celeste","jewel","cara","adele","rebekah","lucinda","dorthy","effie","trina","reba","sallie","aurora","lenora","etta","lottie","kerri","trisha","nikki","estella","francisca","josie","tracie","marissa","karin","brittney","janelle","lourdes","laurel","helene","fern","elva","corinne","kelsey","ina","bettie","elisabeth","aida","caitlin","ingrid","iva","eugenia","christa","goldie","maude","jenifer","therese","dena","lorna","janette","latonya","candy","consuelo","tamika","rosetta","debora","cherie","polly","dina","jewell","fay","jillian","dorothea","nell","trudy","esperanza","patrica","kimberley","shanna","helena","cleo","stefanie","rosario","ola","janine","mollie","lupe","alisa","lou","maribel","susanne","bette","susana","elise","cecile","isabelle","lesley","jocelyn","paige","joni","rachelle","leola","daphne","alta","ester","petra","graciela","imogene","jolene","keisha","lacey","glenna","gabriela","keri","ursula","lizzie","kirsten","shana","adeline","mayra","jayne","jaclyn","gracie","sondra","carmela","marisa","rosalind","charity","tonia","beatriz","marisol","clarice","jeanine","sheena","angeline","frieda","lily","shauna","millie","claudette","cathleen","angelia","gabrielle","autumn","katharine","jodie","staci","lea","christi","justine","elma","luella","margret","dominique","socorro","martina","margo","mavis","callie","bobbi","maritza","lucile","leanne","jeannine","deana","aileen","lorie","ladonna","willa","manuela","gale","selma","dolly","sybil","abby","ivy","dee","winnie","marcy","luisa","jeri","magdalena","ofelia","meagan","audra","matilda","leila","cornelia","bianca","simone","bettye","randi","virgie","latisha","barbra","georgina","eliza","leann","bridgette","rhoda","haley","adela","nola","bernadine","flossie","ila","greta","ruthie","nelda","minerva","lilly","terrie","letha","hilary","estela","valarie","brianna","rosalyn","earline","catalina","ava","mia","clarissa","lidia","corrine","alexandria","concepcion","tia","sharron","rae","dona","ericka","jami","elnora","chandra","lenore","neva","marylou","melisa","tabatha","serena","avis","allie","sofia","jeanie","odessa","nannie","harriett","loraine","penelope","milagros","emilia","benita","allyson","ashlee","tania","esmeralda","karina","eve","pearlie","zelma","malinda","noreen","tameka","saundra","hillary","amie","althea","rosalinda","lilia","alana","clare","alejandra","elinor","lorrie","jerri","darcy","earnestine","carmella","noemi","marcie","liza","annabelle","louisa","earlene","mallory","carlene","nita","selena","tanisha","katy","julianne","lakisha","edwina","maricela","margery","kenya","dollie","roxie","roslyn","kathrine","nanette","charmaine","lavonne","ilene","tammi","suzette","corine","kaye","chrystal","lina","deanne","lilian","juliana","aline","luann","kasey","maryanne","evangeline","colette","melva","lawanda","yesenia","nadia","madge","kathie","ophelia","valeria","nona","mitzi","mari","georgette","claudine","fran","alissa","roseann","lakeisha","susanna","reva","deidre","chasity","sheree","elvia","alyce","deirdre","gena","briana","araceli","katelyn","rosanne","wendi","tessa","berta","marva","imelda","marietta","marci","leonor","arline","sasha","madelyn","janna","juliette","deena","aurelia","josefa","augusta","liliana","lessie","amalia","savannah","anastasia","vilma","natalia","rosella","lynnette","corina","alfreda","leanna","amparo","coleen","tamra","aisha","wilda","karyn","queen","maura","mai","evangelina","rosanna","hallie","erna","enid","mariana","lacy","juliet","jacklyn","freida","madeleine","mara","cathryn","lelia","casandra","bridgett","angelita","jannie","dionne","annmarie","katina","beryl","millicent","katheryn","diann","carissa","maryellen","liz","lauri","helga","gilda","rhea","marquita","hollie","tisha","tamera","angelique","francesca","kaitlin","lolita","florine","rowena","reyna","twila","fanny","janell","ines","concetta","bertie","alba","brigitte","alyson","vonda","pansy","elba","noelle","letitia","deann","brandie","louella","leta","felecia","sharlene","lesa","beverley","isabella","herminia","terra","celina","tori","octavia","jade","denice","germaine","michell","cortney","nelly","doretha","deidra","monika","lashonda","judi","chelsey","antionette","margot","adelaide","nan","leeann","elisha","dessie","libby","kathi","gayla","latanya","mina","mellisa","kimberlee","jasmin","renae","zelda","elda","justina","gussie","emilie","camilla","abbie","rocio","kaitlyn","edythe","ashleigh","selina","lakesha","geri","allene","pamala","michaela","dayna","caryn","rosalia","sun","jacquline","rebeca","marybeth","krystle","iola","dottie","belle","griselda","ernestina","elida","adrianne","demetria","delma","jaqueline","arleen","virgina","retha","fatima","tillie","eleanore","cari","treva","wilhelmina","rosalee","maurine","latrice","jena","taryn","elia","debby","maudie","jeanna","delilah","catrina","shonda","hortencia","theodora","teresita","robbin","danette","delphine","brianne","nilda","danna","cindi","bess","iona","winona","vida","rosita","marianna","racheal","guillermina","eloisa","celestine","caren","malissa","lona","chantel","shellie","marisela","leora","agatha","soledad","migdalia","ivette","christen","janel","veda","pattie","tessie","tera","marilynn","lucretia","karrie","dinah","daniela","alecia","adelina","vernice","shiela","portia","merry","lashawn","dara","tawana","oma","verda","alene","zella","sandi","rafaela","maya","kira","candida","alvina","suzan","shayla","lyn","lettie","samatha","oralia","matilde","larissa","vesta","renita","india","delois","shanda","phillis","lorri","erlinda","cathrine","barb","zoe","isabell","ione","gisela","roxanna","mayme","kisha","ellie","mellissa","dorris","dalia","bella","annetta","zoila","reta","reina","lauretta","kylie","christal","pilar","charla","elissa","tiffani","tana","paulina","leota","breanna","jayme","carmel","vernell","tomasa","mandi","dominga","santa","melodie","lura","alexa","tamela","mirna","kerrie","venus","felicita","cristy","carmelita","berniece","annemarie","tiara","roseanne","missy","cori","roxana","pricilla","kristal","jung","elyse","haydee","aletha","bettina","marge","gillian","filomena","zenaida","harriette","caridad","vada","una","aretha","pearline","marjory","marcela","flor","evette","elouise","alina","damaris","catharine","belva","nakia","marlena","luanne","lorine","karon","dorene","danita","brenna","tatiana","louann","julianna","andria","philomena","lucila","leonora","dovie","romona","mimi","jacquelin","gaye","tonja","misti","chastity","stacia","roxann","micaela","nikita","mei","velda","marlys","johnna","aura","ivonne","hayley","nicki","majorie","herlinda","yadira","perla","gregoria","antonette","shelli","mozelle","mariah","joelle","cordelia","josette","chiquita","trista","laquita","georgiana","candi","shanon","hildegard","valentina","stephany","magda","karol","gabriella","tiana","roma","richelle","oleta","jacque","idella","alaina","suzanna","jovita","tosha","nereida","marlyn","kyla","delfina","tena","stephenie","sabina","nathalie","marcelle","gertie","darleen","thea","sharonda","shantel","belen","venessa","rosalina","ona","genoveva","clementine","rosalba","renate","renata","georgianna","floy","dorcas","ariana","tyra","theda","mariam","juli","jesica","vikki","verla","roselyn","melvina","jannette","ginny","debrah","corrie","asia","violeta","myrtis","latricia","collette","charleen","anissa","viviana","twyla","nedra","latonia","lan","hellen","fabiola","annamarie","adell","sharyn","chantal","niki","maud","lizette","lindy","kia","kesha","jeana","danelle","charline","chanel","valorie","lia","dortha","cristal","leone","leilani","gerri","debi","andra","keshia","ima","eulalia","easter","dulce","natividad","linnie","kami","georgie","catina","brook","alda","winnifred","sharla","ruthann","meaghan","magdalene","lissette","adelaida","venita","trena","shirlene","shameka","elizebeth","dian","shanta","latosha","carlotta","windy","rosina","mariann","leisa","jonnie","dawna","cathie","astrid","laureen","janeen","holli","fawn","vickey","teressa","shante","rubye","marcelina","chanda","terese","scarlett","marnie","lulu","lisette","jeniffer","elenor","dorinda","donita","carman","bernita","altagracia","aleta","adrianna","zoraida","nicola","lyndsey","janina","ami","starla","phylis","phuong","kyra","charisse","blanch","sanjuanita","rona","nanci","marilee","maranda","brigette","sanjuana","marita","kassandra","joycelyn","felipa","chelsie","bonny","mireya","lorenza","kyong","ileana","candelaria","sherie","lucie","leatrice","lakeshia","gerda","edie","bambi","marylin","lavon","hortense","garnet","evie","tressa","shayna","lavina","kyung","jeanetta","sherrill","shara","phyliss","mittie","anabel","alesia","thuy","tawanda","joanie","tiffanie","lashanda","karissa","enriqueta","daria","daniella","corinna","alanna","abbey","roxane","roseanna","magnolia","lida","joellen","era","coral","carleen","tresa","peggie","novella","nila","maybelle","jenelle","carina","nova","melina","marquerite","margarette","josephina","evonne","cinthia","albina","toya","tawnya","sherita","myriam","lizabeth","lise","keely","jenni","giselle","cheryle","ardith","ardis","alesha","adriane","shaina","linnea","karolyn","felisha","dori","darci","artie","armida","zola","xiomara","vergie","shamika","nena","nannette","maxie","lovie","jeane","jaimie","inge","farrah","elaina","caitlyn","felicitas","cherly","caryl","yolonda","yasmin","teena","prudence","pennie","nydia","mackenzie","orpha","marvel","lizbeth","laurette","jerrie","hermelinda","carolee","tierra","mirian","meta","melony","kori","jennette","jamila","ena","anh","yoshiko","susannah","salina","rhiannon","joleen","cristine","ashton","aracely","tomeka","shalonda","marti","lacie","kala","jada","ilse","hailey","brittani","zona","syble","sherryl","nidia","marlo","kandice","kandi","deb","alycia","ronna","norene","mercy","ingeborg","giovanna","gemma","christel","audry","zora","vita","trish","stephaine","shirlee","shanika","melonie","mazie","jazmin","inga","hoa","hettie","geralyn","fonda","estrella","adella","sarita","rina","milissa","maribeth","golda","evon","ethelyn","enedina","cherise","chana","velva","tawanna","sade","mirta","karie","jacinta","elna","davina","cierra","ashlie","albertha","tanesha","nelle","mindi","lorinda","larue","florene","demetra","dedra","ciara","chantelle","ashly","suzy","rosalva","noelia","lyda","leatha","krystyna","kristan","karri","darline","darcie","cinda","cherrie","awilda","almeda","rolanda","lanette","jerilyn","gisele","evalyn","cyndi","cleta","carin","zina","zena","velia","tanika","charissa","talia","margarete","lavonda","kaylee","kathlene","jonna","irena","ilona","idalia","candis","candance","brandee","anitra","alida","sigrid","nicolette","maryjo","linette","hedwig","christiana","alexia","tressie","modesta","lupita","lita","gladis","evelia","davida","cherri","cecily","ashely","annabel","agustina","wanita","shirly","rosaura","hulda","eun","yetta","verona","thomasina","sibyl","shannan","mechelle","lue","leandra","lani","kylee","kandy","jolynn","ferne","eboni","corene","alysia","zula","nada","moira","lyndsay","lorretta","jammie","hortensia","gaynell","adria","vina","vicenta","tangela","stephine","norine","nella","liana","leslee","kimberely","iliana","glory","felica","emogene","elfriede","eden","eartha","carma","bea","ocie","lennie","kiara","jacalyn","carlota","arielle","otilia","kirstin","kacey","johnetta","joetta","jeraldine","jaunita","elana","dorthea","cami","amada","adelia","vernita","tamar","siobhan","renea","rashida","ouida","nilsa","meryl","kristyn","julieta","danica","breanne","aurea","anglea","sherron","odette","malia","lorelei","leesa","kenna","kathlyn","fiona","charlette","suzie","shantell","sabra","racquel","myong","mira","martine","lucienne","lavada","juliann","elvera","delphia","christiane","charolette","carri","asha","angella","paola","ninfa","leda","lai","eda","stefani","shanell","palma","machelle","lissa","kecia","kathryne","karlene","julissa","jettie","jenniffer","hui","corrina","carolann","alena","rosaria","myrtice","marylee","liane","kenyatta","judie","janey","elmira","eldora","denna","cristi","cathi","zaida","vonnie","viva","vernie","rosaline","mariela","luciana","lesli","karan","felice","deneen","adina","wynona","tarsha","sheron","shanita","shani","shandra","randa","pinkie","nelida","marilou","lyla","laurene","laci","joi","janene","dorotha","daniele","dani","carolynn","carlyn","berenice","ayesha","anneliese","alethea","thersa","tamiko","rufina","oliva","mozell","marylyn","kristian","kathyrn","kasandra","kandace","janae","domenica","debbra","dannielle","arcelia","aja","zenobia","sharen","sharee","lavinia","kum","kacie","jackeline","huong","felisa","emelia","eleanora","cythia","cristin","claribel","anastacia","zulma","zandra","yoko","tenisha","susann","sherilyn","shay","shawanda","romana","mathilda","linsey","keiko","joana","isela","gretta","georgetta","eugenie","desirae","delora","corazon","antonina","anika","willene","tracee","tamatha","nichelle","mickie","maegan","luana","lanita","kelsie","edelmira","bree","afton","teodora","tamie","shena","meg","linh","keli","kaci","danyelle","arlette","albertine","adelle","tiffiny","simona","nicolasa","nichol","nia","nakisha","mee","maira","loreen","kizzy","fallon","christene","bobbye","vincenza","tanja","rubie","roni","queenie","margarett","kimberli","irmgard","idell","hilma","evelina","esta","emilee","dennise","dania","carie","wai","risa","rikki","particia","mui","masako","luvenia","loree","loni","lien","gigi","florencia","denita","billye","tomika","sharita","rana","nikole","neoma","margarite","madalyn","lucina","laila","kali","jenette","gabriele","evelyne","elenora","clementina","alejandrina","zulema","violette","vannessa","thresa","retta","pia","patience","noella","nickie","jonell","chaya","camelia","bethel","anya","suzann","shu","mila","lilla","laverna","keesha","kattie","georgene","eveline","estell","elizbeth","vivienne","vallie","trudie","stephane","magaly","madie","kenyetta","karren","janetta","hermine","drucilla","debbi","celestina","candie","britni","beckie","amina","zita","yun","yolande","vivien","vernetta","trudi","sommer","pearle","patrina","ossie","nicolle","loyce","letty","larisa","katharina","joselyn","jonelle","jenell","iesha","heide","florinda","florentina","flo","elodia","dorine","brunilda","brigid","ashli","ardella","twana","thu","tarah","shavon","serina","rayna","ramonita","nga","margurite","lucrecia","kourtney","kati","jesenia","crista","ayana","alica","alia","vinnie","suellen","romelia","rachell","olympia","michiko","kathaleen","jolie","jessi","janessa","hana","elease","carletta","britany","shona","salome","rosamond","regena","raina","ngoc","nelia","louvenia","lesia","latrina","laticia","larhonda","jina","jacki","emmy","deeann","coretta","arnetta","thalia","shanice","neta","mikki","micki","lonna","leana","lashunda","kiley","joye","jacqulyn","ignacia","hyun","hiroko","henriette","elayne","delinda","dahlia","coreen","consuela","conchita","celine","babette","ayanna","anette","albertina","shawnee","shaneka","quiana","pamelia","min","merri","merlene","margit","kiesha","kiera","kaylene","jodee","jenise","erlene","emmie","dalila","daisey","casie","belia","babara","versie","vanesa","shelba","shawnda","nikia","naoma","marna","margeret","madaline","lawana","kindra","jutta","jazmine","janett","hannelore","glendora","gertrud","garnett","freeda","frederica","florance","flavia","carline","beverlee","anjanette","valda","tamala","shonna","sha","sarina","oneida","merilyn","marleen","lurline","lenna","katherin","jin","jeni","hae","gracia","glady","farah","enola","ema","dominque","devona","delana","cecila","caprice","alysha","alethia","vena","theresia","tawny","shakira","samara","sachiko","rachele","pamella","marni","mariel","maren","malisa","ligia","lera","latoria","larae","kimber","kathern","karey","jennefer","janeth","halina","fredia","delisa","debroah","ciera","angelika","andree","altha","yen","vivan","terresa","tanna","suk","sudie","soo","signe","salena","ronni","rebbecca","myrtie","malika","maida","loan","leonarda","kayleigh","ethyl","ellyn","dayle","cammie","brittni","birgit","avelina","asuncion","arianna","akiko","venice","tyesha","tonie","tiesha","takisha","steffanie","sindy","meghann","manda","macie","kellye","kellee","joslyn","inger","indira","glinda","glennis","fernanda","faustina","eneida","elicia","dot","digna","dell","arletta","willia","tammara","tabetha","sherrell","sari","rebbeca","pauletta","natosha","nakita","mammie","kenisha","kazuko","kassie","earlean","daphine","corliss","clotilde","carolyne","bernetta","augustina","audrea","annis","annabell","yan","tennille","tamica","selene","rosana","regenia","qiana","markita","macy","leeanne","laurine","kym","jessenia","janita","georgine","genie","emiko","elvie","deandra","dagmar","corie","collen","cherish","romaine","porsha","pearlene","micheline","merna","margorie","margaretta","lore","jenine","hermina","fredericka","elke","drusilla","dorathy","dione","celena","brigida","angeles","allegra","tamekia","synthia","sook","slyvia","rosann","reatha","raye","marquetta","margart","layla","kymberly","kiana","kayleen","katlyn","karmen","joella","irina","emelda","eleni","detra","clemmie","cheryll","chantell","cathey","arnita","arla","angle","angelic","alyse","zofia","thomasine","tennie","sherly","sherley","sharyl","remedios","petrina","nickole","myung","myrle","mozella","louanne","lisha","latia","krysta","julienne","jeanene","jacqualine","isaura","gwenda","earleen","cleopatra","carlie","audie","antonietta","alise","verdell","tomoko","thao","talisha","shemika","savanna","santina","rosia","raeann","odilia","nana","minna","magan","lynelle","karma","joeann","ivana","inell","ilana","hye","hee","gudrun","dreama","crissy","chante","carmelina","arvilla","annamae","alvera","aleida","yanira","vanda","tianna","tam","stefania","shira","nicol","nancie","monserrate","melynda","melany","lovella","laure","kacy","jacquelynn","hyon","gertha","eliana","christena","christeen","charise","caterina","carley","candyce","arlena","ammie","willette","vanita","tuyet","syreeta","penney","nyla","maryam","marya","magen","ludie","loma","livia","lanell","kimberlie","julee","donetta","diedra","denisha","deane","dawne","clarine","cherryl","bronwyn","alla","valery","tonda","sueann","soraya","shoshana","shela","sharleen","shanelle","nerissa","meridith","mellie","maye","maple","magaret","lili","leonila","leonie","leeanna","lavonia","lavera","kristel","kathey","kathe","jann","ilda","hildred","hildegarde","genia","fumiko","evelin","ermelinda","elly","dung","doloris","dionna","danae","berneice","annice","alix","verena","verdie","shawnna","shawana","shaunna","rozella","randee","ranae","milagro","lynell","luise","loida","lisbeth","karleen","junita","jona","isis","hyacinth","hedy","gwenn","ethelene","erline","donya","domonique","delicia","dannette","cicely","branda","blythe","bethann","ashlyn","annalee","alline","yuko","vella","trang","towanda","tesha","sherlyn","narcisa","miguelina","meri","maybell","marlana","marguerita","madlyn","lory","loriann","leonore","leighann","laurice","latesha","laronda","katrice","kasie","kaley","jadwiga","glennie","gearldine","francina","epifania","dyan","dorie","diedre","denese","demetrice","delena","cristie","cleora","catarina","carisa","barbera","almeta","trula","tereasa","solange","sheilah","shavonne","sanora","rochell","mathilde","margareta","maia","lynsey","lawanna","launa","kena","keena","katia","glynda","gaylene","elvina","elanor","danuta","danika","cristen","cordie","coletta","clarita","carmon","brynn","azucena","aundrea","angele","verlie","verlene","tamesha","silvana","sebrina","samira","reda","raylene","penni","norah","noma","mireille","melissia","maryalice","laraine","kimbery","karyl","karine","kam","jolanda","johana","jesusa","jaleesa","jacquelyne","iluminada","hilaria","hanh","gennie","francie","floretta","exie","edda","drema","delpha","bev","barbar","assunta","ardell","annalisa","alisia","yukiko","yolando","wonda","wei","waltraud","veta","temeka","tameika","shirleen","shenita","piedad","ozella","mirtha","marilu","kimiko","juliane","jenice","janay","jacquiline","hilde","fae","elois","echo","devorah","chau","brinda","betsey","arminda","aracelis","apryl","annett","alishia","veola","usha","toshiko","theola","tashia","talitha","shery","renetta","reiko","rasheeda","obdulia","mika","melaine","meggan","marlen","marget","marceline","mana","magdalen","librada","lezlie","latashia","lasandra","kelle","isidra","isa","inocencia","gwyn","francoise","erminia","erinn","dimple","devora","criselda","armanda","arie","ariane","angelena","aliza","adriene","adaline","xochitl","twanna","tomiko","tamisha","taisha","susy","siu","rutha","rhona","noriko","natashia","merrie","marinda","mariko","margert","loris","lizzette","leisha","kaila","joannie","jerrica","jene","jannet","janee","jacinda","herta","elenore","doretta","delaine","daniell","claudie","britta","apolonia","amberly","alease","yuri","yuk","wen","waneta","ute","tomi","sharri","sandie","roselle","reynalda","raguel","phylicia","patria","olimpia","odelia","mitzie","minda","mignon","mica","mendy","marivel","maile","lynetta","lavette","lauryn","latrisha","lakiesha","kiersten","kary","josphine","jolyn","jetta","janise","jacquie","ivelisse","glynis","gianna","gaynelle","danyell","danille","dacia","coralee","cher","ceola","arianne","aleshia","yung","williemae","trinh","thora","tai","svetlana","sherika","shemeka","shaunda","roseline","ricki","melda","mallie","lavonna","latina","laquanda","lala","lachelle","klara","kandis","johna","jeanmarie","jaye","grayce","gertude","emerita","ebonie","clorinda","ching","chery","carola","breann","blossom","bernardine","becki","arletha","argelia","ara","alita","yulanda","yon","yessenia","tobi","tasia","sylvie","shirl","shirely","shella","shantelle","sacha","rebecka","providencia","paulene","misha","miki","marline","marica","lorita","latoyia","lasonya","kerstin","kenda","keitha","kathrin","jaymie","gricelda","ginette","eryn","elina","elfrieda","danyel","cheree","chanelle","barrie","aurore","annamaria","alleen","ailene","aide","yasmine","vashti","treasa","tiffaney","sheryll","sharie","shanae","sau","raisa","neda","mitsuko","mirella","milda","maryanna","maragret","mabelle","luetta","lorina","letisha","latarsha","lanelle","lajuana","krissy","karly","karena","jessika","jerica","jeanelle","jalisa","jacelyn","izola","euna","etha","domitila","dominica","daina","creola","carli","camie","brittny","ashanti","anisha","aleen","adah","yasuko","valrie","tona","tinisha","thi","terisa","taneka","simonne","shalanda","serita","ressie","refugia","olene","margherita","mandie","maire","lyndia","luci","lorriane","loreta","leonia","lavona","lashawnda","lakia","kyoko","krystina","krysten","kenia","kelsi","jeanice","isobel","georgiann","genny","felicidad","eilene","deloise","conception","clora","cherilyn","calandra","armandina","anisa","ula","tiera","theressa","stephania","sima","shyla","shonta","shera","shaquita","shala","rossana","nohemi","nery","moriah","melita","melida","melani","marylynn","marisha","mariette","malorie","madelene","ludivina","loria","lorette","loralee","lianne","lavenia","laurinda","lashon","kit","kimi","keila","katelynn","kai","jone","joane","jayna","janella","hue","hertha","francene","elinore","despina","delsie","deedra","clemencia","carolin","bulah","brittanie","bok","blondell","bibi","beaulah","beata","annita","agripina","virgen","valene","twanda","tommye","toi","tarra","tari","tammera","shakia","sadye","ruthanne","rochel","rivka","pura","nenita","natisha","merrilee","melodee","marvis","lucilla","leena","laveta","larita","lanie","keren","ileen","georgeann","genna","frida","ewa","eufemia","emely","ela","edyth","deonna","deadra","darlena","chanell","cathern","cassondra","cassaundra","bernarda","berna","arlinda","anamaria","vertie","valeri","torri","tatyana","stasia","sherise","sherill","sanda","ruthe","rosy","robbi","ranee","quyen","pearly","palmira","onita","nisha","niesha","nida","nam","merlyn","mayola","marylouise","marth","margene","madelaine","londa","leontine","leoma","leia","lauralee","lanora","lakita","kiyoko","keturah","katelin","kareen","jonie","johnette","jenee","jeanett","izetta","hiedi","heike","hassie","giuseppina","georgann","fidela","fernande","elwanda","ellamae","eliz","dusti","dotty","cyndy","coralie","celesta","argentina","alverta","xenia","wava","vanetta","torrie","tashina","tandy","tambra","tama","stepanie","shila","shaunta","sharan","shaniqua","shae","setsuko","serafina","sandee","rosamaria","priscila","olinda","nadene","muoi","michelina","mercedez","maryrose","marcene","mao","magali","mafalda","lannie","kayce","karoline","kamilah","kamala","justa","joline","jennine","jacquetta","iraida","georgeanna","franchesca","emeline","elane","ehtel","earlie","dulcie","dalene","classie","chere","charis","caroyln","carmina","carita","bethanie","ayako","arica","alysa","alessandra","akilah","adrien","zetta","youlanda","yelena","yahaira","wendolyn","tijuana","terina","teresia","suzi","sherell","shavonda","shaunte","sharda","shakita","sena","ryann","rubi","riva","reginia","rachal","parthenia","pamula","monnie","monet","michaele","melia","malka","maisha","lisandra","lekisha","lean","lakendra","krystin","kortney","kizzie","kittie","kera","kendal","kemberly","kanisha","julene","jule","johanne","jamee","halley","gidget","galina","fredricka","fleta","fatimah","eusebia","elza","eleonore","dorthey","doria","donella","dinorah","delorse","claretha","christinia","charlyn","bong","belkis","azzie","andera","aiko","adena","yer","yajaira","wan","vania","ulrike","toshia","tifany","stefany","shizue","shenika","shawanna","sharolyn","sharilyn","shaquana","shantay","rozanne","roselee","remona","reanna","raelene","phung","petronila","natacha","nancey","myrl","miyoko","miesha","merideth","marvella","marquitta","marhta","marchelle","lizeth","libbie","lahoma","ladawn","kina","katheleen","katharyn","karisa","kaleigh","junie","julieann","johnsie","janean","jaimee","jackqueline","hisako","herma","helaine","gwyneth","gita","eustolia","emelina","elin","edris","donnette","donnetta","dierdre","denae","darcel","clarisa","cinderella","chia","charlesetta","charita","celsa","cassy","cassi","carlee","bruna","brittaney","brande","billi","bao","antonetta","angla","angelyn","analisa","alane","wenona","wendie","veronique","vannesa","tobie","tempie","sumiko","sulema","sparkle","somer","sheba","sharice","shanel","shalon","rosio","roselia","renay","rema","reena","ozie","oretha","oralee","oda","ngan","nakesha","milly","marybelle","margrett","maragaret","manie","lurlene","lillia","lieselotte","lavelle","lashaunda","lakeesha","kaycee","kalyn","joya","joette","jenae","janiece","illa","grisel","glayds","genevie","gala","fredda","eleonor","debera","deandrea","corrinne","cordia","contessa","colene","cleotilde","chantay","cecille","beatris","azalee","arlean","ardath","anjelica","anja","alfredia","aleisha","zada","yuonne","willodean","vennie","vanna","tyisha","tova","torie","tonisha","tilda","tien","sirena","sherril","shanti","senaida","samella","robbyn","renda","reita","phebe","paulita","nobuko","nguyet","neomi","mikaela","melania","maximina","marg","maisie","lynna","lilli","lashaun","lakenya","lael","kirstie","kathline","kasha","karlyn","karima","jovan","josefine","jennell","jacqui","jackelyn","hyo","hien","grazyna","florrie","floria","eleonora","dwana","dorla","delmy","deja","dede","dann","crysta","clelia","claris","chieko","cherlyn","cherelle","charmain","chara","cammy","bee","arnette","ardelle","annika","amiee","amee","allena","yvone","yuki","yoshie","yevette","yael","willetta","voncile","venetta","tula","tonette","timika","temika","telma","teisha","taren","stacee","shawnta","saturnina","ricarda","pok","pasty","onie","nubia","marielle","mariella","marianela","mardell","luanna","loise","lisabeth","lindsy","lilliana","lilliam","lelah","leigha","leanora","kristeen","khalilah","keeley","kandra","junko","joaquina","jerlene","jani","jamika","hsiu","hermila","genevive","evia","eugena","emmaline","elfreda","elene","donette","delcie","deeanna","darcey","cuc","clarinda","cira","chae","celinda","catheryn","casimira","carmelia","camellia","breana","bobette","bernardina","bebe","basilia","arlyne","amal","alayna","zonia","zenia","yuriko","yaeko","wynell","willena","vernia","tora","terrilyn","terica","tenesha","tawna","tajuana","taina","stephnie","sona","sina","shondra","shizuko","sherlene","sherice","sharika","rossie","rosena","rima","ria","rheba","renna","natalya","nancee","melodi","meda","matha","marketta","maricruz","marcelene","malvina","luba","louetta","leida","lecia","lauran","lashawna","laine","khadijah","katerine","kasi","kallie","julietta","jesusita","jestine","jessia","jeffie","janyce","isadora","georgianne","fidelia","evita","eura","eulah","estefana","elsy","eladia","dodie","dia","denisse","deloras","delila","daysi","crystle","concha","claretta","charlsie","charlena","carylon","bettyann","asley","ashlea","amira","agueda","agnus","yuette","vinita","victorina","tynisha","treena","toccara","tish","thomasena","tegan","soila","shenna","sharmaine","shantae","shandi","september","saran","sarai","sana","rosette","rolande","regine","otelia","olevia","nicholle","necole","naida","myrta","myesha","mitsue","minta","mertie","margy","mahalia","madalene","loura","lorean","lesha","leonida","lenita","lavone","lashell","lashandra","lamonica","kimbra","katherina","karry","kanesha","jong","jeneva","jaquelyn","hwa","gilma","ghislaine","gertrudis","fransisca","fermina","ettie","etsuko","ellan","elidia","edra","dorethea","doreatha","denyse","deetta","daine","cyrstal","corrin","cayla","carlita","camila","burma","bula","buena","barabara","avril","alaine","zana","wilhemina","wanetta","veronika","verline","vasiliki","tonita","tisa","teofila","tayna","taunya","tandra","takako","sunni","suanne","sixta","sharell","seema","rosenda","robena","raymonde","pei","pamila","ozell","neida","mistie","micha","merissa","maurita","maryln","maryetta","marcell","malena","makeda","lovetta","lourie","lorrine","lorilee","laurena","lashay","larraine","laree","lacresha","kristle","krishna","keva","keira","karole","joie","jinny","jeannetta","jama","heidy","gilberte","gema","faviola","evelynn","enda","elli","ellena","divina","dagny","collene","codi","cindie","chassidy","chasidy","catrice","catherina","cassey","caroll","carlena","candra","calista","bryanna","britteny","beula","bari","audrie","audria","ardelia","annelle","angila","alona","allyn"], surnames:["smith","johnson","williams","jones","brown","davis","miller","wilson","moore","taylor","anderson","jackson","white","harris","martin","thompson","garcia","martinez","robinson","clark","rodriguez","lewis","lee","walker","hall","allen","young","hernandez","king","wright","lopez","hill","green","adams","baker","gonzalez","nelson","carter","mitchell","perez","roberts","turner","phillips","campbell","parker","evans","edwards","collins","stewart","sanchez","morris","rogers","reed","cook","morgan","bell","murphy","bailey","rivera","cooper","richardson","cox","howard","ward","torres","peterson","gray","ramirez","watson","brooks","sanders","price","bennett","wood","barnes","ross","henderson","coleman","jenkins","perry","powell","long","patterson","hughes","flores","washington","butler","simmons","foster","gonzales","bryant","alexander","griffin","diaz","hayes","myers","ford","hamilton","graham","sullivan","wallace","woods","cole","west","owens","reynolds","fisher","ellis","harrison","gibson","mcdonald","cruz","marshall","ortiz","gomez","murray","freeman","wells","webb","simpson","stevens","tucker","porter","hicks","crawford","boyd","mason","morales","kennedy","warren","dixon","ramos","reyes","burns","gordon","shaw","holmes","rice","robertson","hunt","daniels","palmer","mills","nichols","grant","ferguson","stone","hawkins","dunn","perkins","hudson","spencer","gardner","stephens","payne","pierce","berry","matthews","arnold","wagner","willis","watkins","olson","carroll","duncan","snyder","hart","cunningham","lane","andrews","ruiz","harper","fox","riley","armstrong","carpenter","weaver","greene","elliott","chavez","sims","peters","kelley","franklin","lawson","fields","gutierrez","schmidt","carr","vasquez","castillo","wheeler","chapman","oliver","montgomery","richards","williamson","johnston","banks","meyer","bishop","mccoy","howell","alvarez","morrison","hansen","fernandez","garza","burton","nguyen","jacobs","reid","fuller","lynch","garrett","romero","welch","larson","frazier","burke","hanson","mendoza","moreno","bowman","medina","fowler","brewer","hoffman","carlson","silva","pearson","holland","fleming","jensen","vargas","byrd","davidson","hopkins","may","herrera","wade","soto","walters","neal","caldwell","lowe","jennings","barnett","graves","jimenez","horton","shelton","barrett","obrien","castro","sutton","mckinney","lucas","miles","rodriquez","chambers","holt","lambert","fletcher","watts","bates","hale","rhodes","pena","beck","newman","haynes","mcdaniel","mendez","bush","vaughn","parks","dawson","santiago","norris","hardy","steele","curry","powers","schultz","barker","guzman","page","munoz","ball","keller","chandler","weber","walsh","lyons","ramsey","wolfe","schneider","mullins","benson","sharp","bowen","barber","cummings","hines","baldwin","griffith","valdez","hubbard","salazar","reeves","warner","stevenson","burgess","santos","tate","cross","garner","mann","mack","moss","thornton","mcgee","farmer","delgado","aguilar","vega","glover","manning","cohen","harmon","rodgers","robbins","newton","blair","higgins","ingram","reese","cannon","strickland","townsend","potter","goodwin","walton","rowe","hampton","ortega","patton","swanson","goodman","maldonado","yates","becker","erickson","hodges","rios","conner","adkins","webster","malone","hammond","flowers","cobb","moody","quinn","pope","osborne","mccarthy","guerrero","estrada","sandoval","gibbs","gross","fitzgerald","stokes","doyle","saunders","wise","colon","gill","alvarado","greer","padilla","waters","nunez","ballard","schwartz","mcbride","houston","christensen","klein","pratt","briggs","parsons","mclaughlin","zimmerman","french","buchanan","moran","copeland","pittman","brady","mccormick","holloway","brock","poole","logan","bass","marsh","drake","wong","jefferson","park","morton","abbott","sparks","norton","huff","massey","figueroa","carson","bowers","roberson","barton","tran","lamb","harrington","boone","cortez","clarke","mathis","singleton","wilkins","cain","underwood","hogan","mckenzie","collier","luna","phelps","mcguire","bridges","wilkerson","nash","summers","atkins","wilcox","pitts","conley","marquez","burnett","cochran","chase","davenport","hood","gates","ayala","sawyer","vazquez","dickerson","hodge","acosta","flynn","espinoza","nicholson","monroe","morrow","whitaker","oconnor","skinner","ware","molina","kirby","huffman","gilmore","dominguez","oneal","lang","combs","kramer","hancock","gallagher","gaines","shaffer","short","wiggins","mathews","mcclain","fischer","wall","small","melton","hensley","bond","dyer","grimes","contreras","wyatt","baxter","snow","mosley","shepherd","larsen","hoover","beasley","petersen","whitehead","meyers","garrison","shields","horn","savage","olsen","schroeder","hartman","woodard","mueller","kemp","deleon","booth","patel","calhoun","wiley","eaton","cline","navarro","harrell","humphrey","parrish","duran","hutchinson","hess","dorsey","bullock","robles","beard","dalton","avila","rich","blackwell","york","johns","blankenship","trevino","salinas","campos","pruitt","callahan","montoya","hardin","guerra","mcdowell","stafford","gallegos","henson","wilkinson","booker","merritt","atkinson","orr","decker","hobbs","tanner","knox","pacheco","stephenson","glass","rojas","serrano","marks","hickman","english","sweeney","strong","mcclure","conway","roth","maynard","farrell","lowery","hurst","nixon","weiss","trujillo","ellison","sloan","juarez","winters","mclean","boyer","villarreal","mccall","gentry","carrillo","ayers","lara","sexton","pace","hull","leblanc","browning","velasquez","leach","chang","sellers","herring","noble","foley","bartlett","mercado","landry","durham","walls","barr","mckee","bauer","rivers","bradshaw","pugh","velez","rush","estes","dodson","morse","sheppard","weeks","camacho","bean","barron","livingston","middleton","spears","branch","blevins","chen","kerr","mcconnell","hatfield","harding","solis","frost","giles","blackburn","pennington","woodward","finley","mcintosh","koch","mccullough","blanchard","rivas","brennan","mejia","kane","benton","buckley","valentine","maddox","russo","mcknight","buck","moon","mcmillan","crosby","berg","dotson","mays","roach","church","chan","richmond","meadows","faulkner","oneill","knapp","kline","ochoa","jacobson","gay","hendricks","horne","shepard","hebert","cardenas","mcintyre","waller","holman","donaldson","cantu","morin","gillespie","fuentes","tillman","bentley","peck","key","salas","rollins","gamble","dickson","battle","santana","cabrera","cervantes","howe","hinton","hurley","spence","zamora","yang","mcneil","suarez","petty","gould","mcfarland","sampson","carver","bray","macdonald","stout","hester","melendez","dillon","farley","hopper","galloway","potts","joyner","stein","aguirre","osborn","mercer","bender","franco","rowland","sykes","pickett","sears","mayo","dunlap","hayden","wilder","mckay","coffey","mccarty","ewing","cooley","vaughan","bonner","cotton","holder","stark","ferrell","cantrell","fulton","lott","calderon","pollard","hooper","burch","mullen","fry","riddle","levy","odonnell","britt","daugherty","berger","dillard","alston","frye","riggs","chaney","odom","duffy","fitzpatrick","valenzuela","mayer","alford","mcpherson","acevedo","barrera","cote","reilly","compton","mooney","mcgowan","craft","clemons","wynn","nielsen","baird","stanton","snider","rosales","bright","witt","hays","holden","rutledge","kinney","clements","castaneda","slater","hahn","burks","delaney","pate","lancaster","sharpe","whitfield","talley","macias","burris","ratliff","mccray","madden","kaufman","goff","cash","bolton","mcfadden","levine","byers","kirkland","kidd","workman","carney","mcleod","holcomb","england","finch","sosa","haney","franks","sargent","nieves","downs","rasmussen","bird","hewitt","foreman","valencia","oneil","delacruz","vinson","dejesus","hyde","forbes","gilliam","guthrie","wooten","huber","barlow","boyle","mcmahon","buckner","rocha","puckett","langley","knowles","cooke","velazquez","whitley","vang","shea","rouse","hartley","mayfield","elder","rankin","hanna","cowan","lucero","arroyo","slaughter","haas","oconnell","minor","boucher","archer","boggs","dougherty","andersen","newell","crowe","wang","friedman","bland","swain","holley","pearce","childs","yarbrough","galvan","proctor","meeks","lozano","mora","rangel","bacon","villanueva","schaefer","rosado","helms","boyce","goss","stinson","lake","ibarra","hutchins","covington","crowley","hatcher","mackey","bunch","womack","polk","dodd","childress","childers","camp","villa","dye","springer","mahoney","dailey","belcher","lockhart","griggs","costa","brandt","walden","moser","tatum","mccann","akers","lutz","pryor","orozco","mcallister","lugo","davies","shoemaker","rutherford","newsome","magee","chamberlain","blanton","simms","godfrey","flanagan","crum","cordova","escobar","downing","sinclair","donahue","krueger","mcginnis","gore","farris","webber","corbett","andrade","starr","lyon","yoder","hastings","mcgrath","spivey","krause","harden","crabtree","kirkpatrick","arrington","ritter","mcghee","bolden","maloney","gagnon","dunbar","ponce","pike","mayes","beatty","mobley","kimball","butts","montes","eldridge","braun","hamm","gibbons","moyer","manley","herron","plummer","elmore","cramer","rucker","pierson","fontenot","field","rubio","goldstein","elkins","wills","novak","hickey","worley","gorman","katz","dickinson","broussard","woodruff","crow","britton","nance","lehman","bingham","zuniga","whaley","shafer","coffman","steward","delarosa","nix","neely","mata","davila","mccabe","kessler","hinkle","welsh","pagan","goldberg","goins","crouch","cuevas","quinones","mcdermott","hendrickson","samuels","denton","bergeron","lam","ivey","locke","haines","snell","hoskins","byrne","arias","roe","corbin","beltran","chappell","downey","dooley","tuttle","couch","payton","mcelroy","crockett","groves","cartwright","dickey","mcgill","dubois","muniz","tolbert","dempsey","cisneros","sewell","latham","vigil","tapia","rainey","norwood","stroud","meade","tipton","kuhn","hilliard","bonilla","teague","gunn","greenwood","correa","reece","poe","pineda","phipps","frey","kaiser","ames","gunter","schmitt","milligan","espinosa","bowden","vickers","lowry","pritchard","costello","piper","mcclellan","lovell","sheehan","hatch","dobson","singh","jeffries","hollingsworth","sorensen","meza","fink","donnelly","burrell","tomlinson","colbert","billings","ritchie","helton","sutherland","peoples","mcqueen","thomason","givens","crocker","vogel","robison","dunham","coker","swartz","keys","ladner","richter","hargrove","edmonds","brantley","albright","murdock","boswell","muller","quintero","padgett","kenney","daly","connolly","inman","quintana","lund","barnard","villegas","simons","land","huggins","tidwell","sanderson","bullard","mcclendon","duarte","draper","marrero","dwyer","abrams","stover","goode","fraser","crews","bernal","godwin","conklin","mcneal","baca","esparza","crowder","bower","brewster","mcneill","rodrigues","leal","coates","raines","mccain","mccord","miner","holbrook","swift","dukes","carlisle","aldridge","ackerman","starks","ricks","holliday","ferris","hairston","sheffield","lange","fountain","doss","betts","kaplan","carmichael","bloom","ruffin","penn","kern","bowles","sizemore","larkin","dupree","seals","metcalf","hutchison","henley","farr","mccauley","hankins","gustafson","curran","ash","waddell","ramey","cates","pollock","cummins","messer","heller","lin","funk","cornett","palacios","galindo","cano","hathaway","singer","pham","enriquez","salgado","pelletier","painter","wiseman","blount","feliciano","temple","houser","doherty","mead","mcgraw","swan","capps","blanco","blackmon","thomson","mcmanus","burkett","post","gleason","ott","dickens","cormier","voss","rushing","rosenberg","hurd","dumas","benitez","arellano","marin","caudill","bragg","jaramillo","huerta","gipson","colvin","biggs","vela","platt","cassidy","tompkins","mccollum","dolan","daley","crump","sneed","kilgore","grove","grimm","davison","brunson","prater","marcum","devine","stratton","rosas","choi","tripp","ledbetter","hightower","feldman","epps","yeager","posey","scruggs","cope","stubbs","richey","overton","trotter","sprague","cordero","butcher","stiles","burgos","woodson","horner","bassett","purcell","haskins","akins","ziegler","spaulding","hadley","grubbs","sumner","murillo","zavala","shook","lockwood","driscoll","dahl","thorpe","redmond","putnam","mcwilliams","mcrae","romano","joiner","sadler","hedrick","hager","hagen","fitch","coulter","thacker","mansfield","langston","guidry","ferreira","corley","conn","rossi","lackey","baez","saenz","mcnamara","mcmullen","mckenna","mcdonough","link","engel","browne","roper","peacock","eubanks","drummond","stringer","pritchett","parham","mims","landers","ham","grayson","schafer","egan","timmons","ohara","keen","hamlin","finn","cortes","mcnair","nadeau","moseley","michaud","rosen","oakes","kurtz","jeffers","calloway","beal","bautista","winn","suggs","stern","stapleton","lyles","laird","montano","dawkins","hagan","goldman","bryson","barajas","lovett","segura","metz","lockett","langford","hinson","eastman","hooks","smallwood","shapiro","crowell","whalen","triplett","chatman","aldrich","cahill","youngblood","ybarra","stallings","sheets","reeder","connelly","bateman","abernathy","winkler","wilkes","masters","hackett","granger","gillis","schmitz","sapp","napier","souza","lanier","gomes","weir","otero","ledford","burroughs","babcock","ventura","siegel","dugan","bledsoe","atwood","wray","varner","spangler","anaya","staley","kraft","fournier","belanger","wolff","thorne","bynum","burnette","boykin","swenson","purvis","pina","khan","duvall","darby","xiong","kauffman","healy","engle","benoit","valle","steiner","spicer","shaver","randle","lundy","dow","chin","calvert","staton","neff","kearney","darden","oakley","medeiros","mccracken","crenshaw","block","perdue","dill","whittaker","tobin","washburn","hogue","goodrich","easley","bravo","dennison","shipley","kerns","jorgensen","crain","villalobos","maurer","longoria","keene","coon","witherspoon","staples","pettit","kincaid","eason","madrid","echols","lusk","stahl","currie","thayer","shultz","mcnally","seay","north","maher","gagne","barrow","nava","moreland","honeycutt","hearn","diggs","caron","whitten","westbrook","stovall","ragland","munson","meier","looney","kimble","jolly","hobson","goddard","culver","burr","presley","negron","connell","tovar","huddleston","ashby","salter","root","pendleton","oleary","nickerson","myrick","judd","jacobsen","bain","adair","starnes","matos","busby","herndon","hanley","bellamy","doty","bartley","yazzie","rowell","parson","gifford","cullen","christiansen","benavides","barnhart","talbot","mock","crandall","connors","bonds","whitt","gage","bergman","arredondo","addison","lujan","dowdy","jernigan","huynh","bouchard","dutton","rhoades","ouellette","kiser","herrington","hare","blackman","babb","allred","rudd","paulson","ogden","koenig","geiger","begay","parra","lassiter","hawk","esposito","cho","waldron","ransom","prather","chacon","vick","sands","roark","parr","mayberry","greenberg","coley","bruner","whitman","skaggs","shipman","leary","hutton","romo","medrano","ladd","kruse","askew","schulz","alfaro","tabor","mohr","gallo","bermudez","pereira","bliss","reaves","flint","comer","woodall","naquin","guevara","delong","carrier","pickens","brand","tilley","schaffer","lim","knutson","fenton","doran","chu","vogt","vann","prescott","mclain","landis","corcoran","zapata","hyatt","hemphill","faulk","dove","boudreaux","aragon","whitlock","trejo","tackett","shearer","saldana","hanks","mckinnon","koehler","bourgeois","keyes","goodson","foote","lunsford","goldsmith","flood","winslow","sams","reagan","mccloud","hough","esquivel","naylor","loomis","coronado","ludwig","braswell","bearden","fagan","ezell","edmondson","cyr","cronin","nunn","lemon","guillory","grier","dubose","traylor","ryder","dobbins","coyle","aponte","whitmore","smalls","rowan","malloy","cardona","braxton","borden","humphries","carrasco","ruff","metzger","huntley","hinojosa","finney","madsen","hills","ernst","dozier","burkhart","bowser","peralta","daigle","whittington","sorenson","saucedo","roche","redding","fugate","avalos","waite","lind","huston","hay","hawthorne","hamby","boyles","boles","regan","faust","crook","beam","barger","hinds","gallardo","willoughby","willingham","eckert","busch","zepeda","worthington","tinsley","hoff","hawley","carmona","varela","rector","newcomb","kinsey","dube","whatley","ragsdale","bernstein","becerra","yost","mattson","felder","cheek","handy","grossman","gauthier","escobedo","braden","beckman","mott","hillman","flaherty","dykes","doe","stockton","stearns","lofton","coats","cavazos","beavers","barrios","parish","mosher","cardwell","coles","burnham","weller","lemons","beebe","aguilera","parnell","harman","couture","alley","schumacher","redd","dobbs","blum","blalock","merchant","ennis","denson","cottrell","brannon","bagley","aviles","watt","sousa","rosenthal","rooney","dietz","blank","paquette","mcclelland","duff","velasco","lentz","grubb","burrows","barbour","ulrich","shockley","rader","beyer","mixon","layton","altman","weathers","stoner","squires","shipp","priest","lipscomb","cutler","caballero","zimmer","willett","thurston","storey","medley","epperson","shah","mcmillian","baggett","torrez","laws","hirsch","dent","poirier","peachey","farrar","creech","barth","trimble","dupre","albrecht","sample","lawler","crisp","conroy","wetzel","nesbitt","murry","jameson","wilhelm","patten","minton","matson","kimbrough","iverson","guinn","croft","toth","pulliam","nugent","newby","littlejohn","dias","canales","bernier","baron","singletary","renteria","pruett","mchugh","mabry","landrum","brower","stoddard","cagle","stjohn","scales","kohler","kellogg","hopson","gant","tharp","gann","zeigler","pringle","hammons","fairchild","deaton","chavis","carnes","rowley","matlock","kearns","irizarry","carrington","starkey","lopes","jarrell","craven","baum","spain","littlefield","linn","humphreys","etheridge","cuellar","chastain","bundy","speer","skelton","quiroz","pyle","portillo","ponder","moulton","machado","liu","killian","hutson","hitchcock","dowling","cloud","burdick","spann","pedersen","levin","leggett","hayward","hacker","dietrich","beaulieu","barksdale","wakefield","snowden","briscoe","bowie","berman","ogle","mcgregor","laughlin","helm","burden","wheatley","schreiber","pressley","parris","alaniz","agee","urban","swann","snodgrass","schuster","radford","monk","mattingly","harp","girard","cheney","yancey","wagoner","ridley","lombardo","lau","hudgins","gaskins","duckworth","coe","coburn","willey","prado","newberry","magana","hammonds","elam","whipple","slade","serna","ojeda","liles","dorman","diehl","upton","reardon","michaels","goetz","eller","bauman","baer","layne","hummel","brenner","amaya","adamson","ornelas","dowell","cloutier","castellanos","wing","wellman","saylor","orourke","moya","montalvo","kilpatrick","durbin","shell","oldham","garvin","foss","branham","bartholomew","templeton","maguire","holton","rider","monahan","mccormack","beaty","anders","streeter","nieto","nielson","moffett","lankford","keating","heck","gatlin","delatorre","callaway","adcock","worrell","unger","robinette","nowak","jeter","brunner","steen","parrott","overstreet","nobles","montanez","clevenger","brinkley","trahan","quarles","pickering","pederson","jansen","grantham","gilchrist","crespo","aiken","schell","schaeffer","lorenz","leyva","harms","dyson","wallis","pease","leavitt","cavanaugh","batts","warden","seaman","rockwell","quezada","paxton","linder","houck","fontaine","durant","caruso","adler","pimentel","mize","lytle","cleary","cason","acker","switzer","isaacs","higginbotham","han","waterman","vandyke","stamper","sisk","shuler","riddick","mcmahan","levesque","hatton","bronson","bollinger","arnett","okeefe","gerber","gannon","farnsworth","baughman","silverman","satterfield","mccrary","kowalski","grigsby","greco","cabral","trout","rinehart","mahon","linton","gooden","curley","baugh","wyman","weiner","schwab","schuler","morrissey","mahan","bunn","thrasher","spear","waggoner","qualls","purdy","mcwhorter","mauldin","gilman","perryman","newsom","menard","martino","graf","billingsley","artis","simpkins","salisbury","quintanilla","gilliland","fraley","foust","crouse","scarborough","ngo","grissom","fultz","marlow","markham","madrigal","lawton","barfield","whiting","varney","schwarz","gooch","arce","wheat","truong","poulin","hurtado","selby","gaither","fortner","culpepper","coughlin","brinson","boudreau","barkley","bales","stepp","holm","tan","schilling","morrell","kahn","heaton","gamez","causey","turpin","shanks","schrader","meek","isom","hardison","carranza","yanez","scroggins","schofield","runyon","ratcliff","murrell","moeller","irby","currier","butterfield","yee","ralston","pullen","pinson","estep","carbone","hawks","ellington","casillas","spurlock","sikes","motley","mccartney","kruger","isbell","houle","burk","tomlin","quigley","neumann","lovelace","fennell","cheatham","bustamante","skidmore","hidalgo","forman","culp","bowens","betancourt","aquino","robb","rea","milner","martel","gresham","wiles","ricketts","dowd","collazo","bostic","blakely","sherrod","kenyon","gandy","ebert","deloach","allard","sauer","robins","olivares","gillette","chestnut","bourque","paine","hite","hauser","devore","crawley","chapa","talbert","poindexter","meador","mcduffie","mattox","kraus","harkins","choate","wren","sledge","sanborn","kinder","geary","cornwell","barclay","abney","seward","rhoads","howland","fortier","benner","vines","tubbs","troutman","rapp","mccurdy","deluca","westmoreland","havens","guajardo","ely","clary","seal","meehan","herzog","guillen","ashcraft","waugh","renner","milam","elrod","churchill","breaux","bolin","asher","windham","tirado","pemberton","nolen","noland","knott","emmons","cornish","christenson","brownlee","barbee","waldrop","pitt","olvera","lombardi","gruber","gaffney","eggleston","banda","archuleta","slone","prewitt","pfeiffer","nettles","mena","mcadams","henning","gardiner","cromwell","chisholm","burleson","vest","oglesby","mccarter","lumpkin","grey","wofford","vanhorn","thorn","teel","swafford","stclair","stanfield","ocampo","herrmann","hannon","arsenault","roush","mcalister","hiatt","gunderson","forsythe","duggan","delvalle","cintron","wilks","weinstein","uribe","rizzo","noyes","mclendon","gurley","bethea","winstead","maples","guyton","giordano","alderman","valdes","polanco","pappas","lively","grogan","griffiths","arevalo","whitson","sowell","rendon","fernandes","farrow","benavidez","ayres","alicea","stump","smalley","seitz","schulte","gilley","gallant","canfield","wolford","omalley","mcnutt","mcnulty","mcgovern","hardman","harbin","cowart","chavarria","brink","beckett","bagwell","armstead","anglin","abreu","reynoso","krebs","jett","hoffmann","greenfield","forte","burney","broome","sisson","trammell","partridge","mace","lomax","lemieux","gossett","frantz","fogle","cooney","broughton","pence","paulsen","muncy","mcarthur","hollins","beauchamp","withers","osorio","mulligan","hoyle","foy","dockery","cockrell","begley","amador","roby","rains","lindquist","gentile","everhart","bohannon","wylie","sommers","purnell","fortin","dunning","breeden","vail","phelan","phan","marx","cosby","colburn","boling","biddle","ledesma","gaddis","denney","chow","bueno","berrios","wicker","tolliver","thibodeaux","nagle","lavoie","fisk","crist","barbosa","reedy","march","locklear","kolb","himes","behrens","beckwith","weems","wahl","shorter","shackelford","rees","muse","cerda","valadez","thibodeau","saavedra","ridgeway","reiter","mchenry","majors","lachance","keaton","ferrara","clemens","blocker","applegate","paz","needham","mojica","kuykendall","hamel","escamilla","doughty","burchett","ainsworth","vidal","upchurch","thigpen","strauss","spruill","sowers","riggins","ricker","mccombs","harlow","buffington","sotelo","olivas","negrete","morey","macon","logsdon","lapointe","bigelow","bello","westfall","stubblefield","peak","lindley","hein","hawes","farrington","breen","birch","wilde","steed","sepulveda","reinhardt","proffitt","minter","messina","mcnabb","maier","keeler","gamboa","donohue","basham","shinn","crooks","cota","borders","bills","bachman","tisdale","tavares","schmid","pickard","gulley","fonseca","delossantos","condon","batista","wicks","wadsworth","martell","littleton","ison","haag","folsom","brumfield","broyles","brito","mireles","mcdonnell","leclair","hamblin","gough","fanning","binder","winfield","whitworth","soriano","palumbo","newkirk","mangum","hutcherson","comstock","carlin","beall","bair","wendt","watters","walling","putman","otoole","morley","mares","lemus","keener","hundley","dial","damico","billups","strother","mcfarlane","lamm","eaves","crutcher","caraballo","canty","atwell","taft","siler","rust","rawls","rawlings","prieto","mcneely","mcafee","hulsey","hackney","galvez","escalante","delagarza","crider","charlton","bandy","wilbanks","stowe","steinberg","renfro","masterson","massie","lanham","haskell","hamrick","fort","dehart","burdette","branson","bourne","babin","aleman","worthy","tibbs","smoot","slack","paradis","mull","luce","houghton","gantt","furman","danner","christianson","burge","ashford","arndt","almeida","stallworth","shade","searcy","sager","noonan","mclemore","mcintire","maxey","lavigne","jobe","ferrer","falk","coffin","byrnes","aranda","apodaca","stamps","rounds","peek","olmstead","lewandowski","kaminski","dunaway","bruns","brackett","amato","reich","mcclung","lacroix","koontz","herrick","hardesty","flanders","cousins","cato","cade","vickery","shank","nagel","dupuis","croteau","cotter","cable","stuckey","stine","porterfield","pauley","nye","moffitt","knudsen","hardwick","goforth","dupont","blunt","barrows","barnhill","shull","rash","loftis","lemay","kitchens","horvath","grenier","fuchs","fairbanks","culbertson","calkins","burnside","beattie","ashworth","albertson","wertz","vaught","vallejo","turk","tuck","tijerina","sage","peterman","marroquin","marr","lantz","hoang","demarco","daily","cone","berube","barnette","wharton","stinnett","slocum","scanlon","sander","pinto","mancuso","lima","headley","epstein","counts","clarkson","carnahan","boren","arteaga","adame","zook","whittle","whitehurst","wenzel","saxton","reddick","puente","handley","haggerty","earley","devlin","chaffin","cady","acuna","solano","sigler","pollack","pendergrass","ostrander","janes","francois","crutchfield","chamberlin","brubaker","baptiste","willson","reis","neeley","mullin","mercier","lira","layman","keeling","higdon","espinal","chapin","warfield","toledo","pulido","peebles","nagy","montague","mello","lear","jaeger","hogg","graff","furr","soliz","poore","mendenhall","mclaurin","maestas","gable","barraza","tillery","snead","pond","neill","mcculloch","mccorkle","lightfoot","hutchings","holloman","harness","dorn","council","bock","zielinski","turley","treadwell","stpierre","starling","somers","oswald","merrick","easterling","bivens","truitt","poston","parry","ontiveros","olivarez","moreau","medlin","lenz","knowlton","fairley","cobbs","chisolm","bannister","woodworth","toler","ocasio","noriega","neuman","moye","milburn","mcclanahan","lilley","hanes","flannery","dellinger","danielson","conti","blodgett","beers","weatherford","strain","karr","hitt","denham","custer","coble","clough","casteel","bolduc","batchelor","ammons","whitlow","tierney","staten","sibley","seifert","schubert","salcedo","mattison","laney","haggard","grooms","dix","dees","cromer","cooks","colson","caswell","zarate","swisher","shin","ragan","pridgen","mcvey","matheny","lafleur","franz","ferraro","dugger","whiteside","rigsby","mcmurray","lehmann","jacoby","hildebrand","hendrick","headrick","goad","fincher","drury","borges","archibald","albers","woodcock","trapp","soares","seaton","monson","luckett","lindberg","kopp","keeton","hsu","healey","garvey","gaddy","fain","burchfield","wentworth","strand","stack","spooner","saucier","sales","ricci","plunkett","pannell","ness","leger","hoy","freitas","fong","elizondo","duval","beaudoin","urbina","rickard","partin","moe","mcgrew","mcclintock","ledoux","forsyth","faison","devries","bertrand","wasson","tilton","scarbrough","leung","irvine","garber","denning","corral","colley","castleberry","bowlin","bogan","beale","baines","trice","rayburn","parkinson","pak","nunes","mcmillen","leahy","kimmel","higgs","fulmer","carden","bedford","taggart","spearman","register","prichard","morrill","koonce","heinz","hedges","guenther","grice","findley","dover","creighton","boothe","bayer","arreola","vitale","valles","raney","osgood","hanlon","burley","bounds","worden","weatherly","vetter","tanaka","stiltner","nevarez","mosby","montero","melancon","harter","hamer","goble","gladden","gist","ginn","akin","zaragoza","towns","tarver","sammons","royster","oreilly","muir","morehead","luster","kingsley","kelso","grisham","glynn","baumann","alves","yount","tamayo","paterson","oates","menendez","longo","hargis","gillen","desantis","breedlove","sumpter","scherer","rupp","reichert","heredia","creel","cohn","clemmons","casas","bickford","belton","bach","williford","whitcomb","tennant","sutter","stull","sessions","mccallum","langlois","keel","keegan","dangelo","dancy","damron","clapp","clanton","bankston","oliveira","mintz","mcinnis","martens","mabe","laster","jolley","hildreth","hefner","glaser","duckett","demers","brockman","blais","alcorn","agnew","toliver","tice","seeley","najera","musser","mcfall","laplante","galvin","fajardo","doan","coyne","copley","clawson","cheung","barone","wynne","woodley","tremblay","stoll","sparrow","sparkman","schweitzer","sasser","samples","roney","legg","heim","farias","colwell","christman","bratcher","winchester","upshaw","southerland","sorrell","sells","mount","mccloskey","martindale","luttrell","loveless","lovejoy","linares","latimer","embry","coombs","bratton","bostick","venable","tuggle","toro","staggs","sandlin","jefferies","heckman","griffis","crayton","clem","browder","thorton","sturgill","sprouse","royer","rousseau","ridenour","pogue","perales","peeples","metzler","mesa","mccutcheon","mcbee","hornsby","heffner","corrigan","armijo","vue","plante","peyton","paredes","macklin","hussey","hodgson","granados","frias","becnel","batten","almanza","turney","teal","sturgeon","meeker","mcdaniels","limon","keeney","kee","hutto","holguin","gorham","fishman","fierro","blanchette","rodrigue","reddy","osburn","oden","lerma","kirkwood","keefer","haugen","hammett","chalmers","brinkman","baumgartner","valerio","tellez","steffen","shumate","sauls","ripley","kemper","jacks","guffey","evers","craddock","carvalho","blaylock","banuelos","balderas","wooden","wheaton","turnbull","shuman","pointer","mosier","mccue","ligon","kozlowski","johansen","ingle","herr","briones","snipes","rickman","pipkin","pantoja","orosco","moniz","lawless","kunkel","hibbard","galarza","enos","bussey","schott","salcido","perreault","mcdougal","mccool","haight","garris","ferry","easton","conyers","atherton","wimberly","utley","spellman","smithson","slagle","ritchey","rand","petit","osullivan","oaks","nutt","mcvay","mccreary","mayhew","knoll","jewett","harwood","cardoza","ashe","arriaga","zeller","wirth","whitmire","stauffer","rountree","redden","mccaffrey","martz","larose","langdon","humes","gaskin","faber","devito","cass","almond","wingfield","wingate","villareal","tyner","smothers","severson","reno","pennell","maupin","leighton","janssen","hassell","hallman","halcomb","folse","fitzsimmons","fahey","cranford","bolen","battles","battaglia","wooldridge","trask","rosser","regalado","mcewen","keefe","fuqua","echevarria","caro","boynton","andrus","viera","vanmeter","taber","spradlin","seibert","provost","prentice","oliphant","laporte","hwang","hatchett","hass","greiner","freedman","covert","chilton","byars","wiese","venegas","swank","shrader","roberge","mullis","mortensen","mccune","marlowe","kirchner","keck","isaacson","hostetler","halverson","gunther","griswold","fenner","durden","blackwood","ahrens","sawyers","savoy","nabors","mcswain","mackay","loy","lavender","lash","labbe","jessup","fullerton","cruse","crittenden","correia","centeno","caudle","canady","callender","alarcon","ahern","winfrey","tribble","styles","salley","roden","musgrove","minnick","fortenberry","carrion","bunting","batiste","whited","underhill","stillwell","rauch","pippin","perrin","messenger","mancini","lister","kinard","hartmann","fleck","broadway","wilt","treadway","thornhill","spalding","rafferty","pitre","patino","ordonez","linkous","kelleher","homan","galbraith","feeney","curtin","coward","camarillo","buss","bunnell","bolt","beeler","autry","alcala","witte","wentz","stidham","shively","nunley","meacham","martins","lemke","lefebvre","hynes","horowitz","hoppe","holcombe","dunne","derr","cochrane","brittain","bedard","beauregard","torrence","strunk","soria","simonson","shumaker","scoggins","oconner","moriarty","kuntz","ives","hutcheson","horan","hales","garmon","fitts","bohn","atchison","wisniewski","vanwinkle","sturm","sallee","prosser","moen","lundberg","kunz","kohl","keane","jorgenson","jaynes","funderburk","freed","durr","creamer","cosgrove","batson","vanhoose","thomsen","teeter","smyth","redmon","orellana","maness","heflin","goulet","frick","forney","bunker","asbury","aguiar","talbott","southard","mowery","mears","lemmon","krieger","hickson","elston","duong","delgadillo","dayton","dasilva","conaway","catron","bruton","bradbury","bordelon","bivins","bittner","bergstrom","beals","abell","whelan","tejada","pulley","pino","norfleet","nealy","maes","loper","gatewood","frierson","freund","finnegan","cupp","covey","catalano","boehm","bader","yoon","walston","tenney","sipes","rawlins","medlock","mccaskill","mccallister","marcotte","maclean","hughey","henke","harwell","gladney","gilson","dew","chism","caskey","brandenburg","baylor","villasenor","veal","thatcher","stegall","shore","petrie","nowlin","navarrete","muhammad","lombard","loftin","lemaster","kroll","kovach","kimbrell","kidwell","hershberger","fulcher","eng","cantwell","bustos","boland","bobbitt","binkley","wester","weis","verdin","tiller","sisco","sharkey","seymore","rosenbaum","rohr","quinonez","pinkston","nation","malley","logue","lessard","lerner","lebron","krauss","klinger","halstead","haller","getz","burrow","alger","shores","pfeifer","perron","nelms","munn","mcmaster","mckenney","manns","knudson","hutchens","huskey","goebel","flagg","cushman","click","castellano","carder","bumgarner","wampler","spinks","robson","neel","mcreynolds","mathias","maas","loera","kasper","jenson","florez","coons","buckingham","brogan","berryman","wilmoth","wilhite","thrash","shephard","seidel","schulze","roldan","pettis","obryan","maki","mackie","hatley","frazer","fiore","chesser","bui","bottoms","bisson","benefield","allman","wilke","trudeau","timm","shifflett","rau","mundy","milliken","mayers","leake","kohn","huntington","horsley","hermann","guerin","fryer","frizzell","foret","flemming","fife","criswell","carbajal","bozeman","boisvert","angulo","wallen","tapp","silvers","ramsay","oshea","orta","moll","mckeever","mcgehee","linville","kiefer","ketchum","howerton","groce","gass","fusco","corbitt","betz","bartels","amaral","aiello","yoo","weddle","sperry","seiler","runyan","raley","overby","osteen","olds","mckeown","matney","lauer","lattimore","hindman","hartwell","fredrickson","fredericks","espino","clegg","carswell","cambell","burkholder","woodbury","welker","totten","thornburg","theriault","stitt","stamm","stackhouse","scholl","saxon","rife","razo","quinlan","pinkerton","olivo","nesmith","nall","mattos","lafferty","justus","giron","geer","fielder","drayton","dortch","conners","conger","boatwright","billiot","barden","armenta","tibbetts","steadman","slattery","rinaldi","raynor","pinckney","pettigrew","milne","matteson","halsey","gonsalves","fellows","durand","desimone","cowley","cowles","brill","barham","barela","barba","ashmore","withrow","valenti","tejeda","spriggs","sayre","salerno","peltier","peel","merriman","matheson","lowman","lindstrom","hyland","giroux","earls","dugas","dabney","collado","briseno","baxley","whyte","wenger","vanover","vanburen","thiel","schindler","schiller","rigby","pomeroy","passmore","marble","manzo","mahaffey","lindgren","laflamme","greathouse","fite","calabrese","bayne","yamamoto","wick","townes","thames","reinhart","peeler","naranjo","montez","mcdade","mast","markley","marchand","leeper","kellum","hudgens","hennessey","hadden","gainey","coppola","borrego","bolling","beane","ault","slaton","poland","pape","null","mulkey","lightner","langer","hillard","glasgow","ethridge","enright","derosa","baskin","weinberg","turman","somerville","pardo","noll","lashley","ingraham","hiller","hendon","glaze","cothran","cooksey","conte","carrico","abner","wooley","swope","summerlin","sturgis","sturdivant","stott","spurgeon","spillman","speight","roussel","popp","nutter","mckeon","mazza","magnuson","lanning","kozak","jankowski","heyward","forster","corwin","callaghan","bays","wortham","usher","theriot","sayers","sabo","poling","loya","lieberman","laroche","labelle","howes","harr","garay","fogarty","everson","durkin","dominquez","chaves","chambliss","witcher","vieira","vandiver","terrill","stoker","schreiner","moorman","liddell","lew","lawhorn","krug","irons","hylton","hollenbeck","herrin","hembree","goolsby","goodin","gilmer","foltz","dinkins","daughtry","caban","brim","briley","bilodeau","wyant","vergara","tallent","swearingen","stroup","scribner","quillen","pitman","monaco","mccants","maxfield","martinson","holtz","flournoy","brookins","brody","baumgardner","straub","sills","roybal","roundtree","oswalt","mcgriff","mcdougall","mccleary","maggard","gragg","gooding","godinez","doolittle","donato","cowell","cassell","bracken","appel","zambrano","reuter","perea","nakamura","monaghan","mickens","mcclinton","mcclary","marler","kish","judkins","gilbreath","freese","flanigan","felts","erdmann","dodds","chew","brownell","boatright","barreto","slayton","sandberg","saldivar","pettway","odum","narvaez","moultrie","montemayor","merrell","lees","keyser","hoke","hardaway","hannan","gilbertson","fogg","dumont","deberry","coggins","buxton","bucher","broadnax","beeson","araujo","appleton","amundson","aguayo","ackley","yocum","worsham","shivers","sanches","sacco","robey","rhoden","pender","ochs","mccurry","madera","luong","knotts","jackman","heinrich","hargrave","gault","comeaux","chitwood","caraway","boettcher","bernhardt","barrientos","zink","wickham","whiteman","thorp","stillman","settles","schoonover","roque","riddell","pilcher","phifer","novotny","macleod","hardee","haase","grider","doucette","clausen","bevins","beamon","badillo","tolley","tindall","soule","snook","seale","pitcher","pinkney","pellegrino","nowell","nemeth","mondragon","mclane","lundgren","ingalls","hudspeth","hixson","gearhart","furlong","downes","dibble","deyoung","cornejo","camara","brookshire","boyette","wolcott","surratt","sellars","segal","salyer","reeve","rausch","labonte","haro","gower","freeland","fawcett","eads","driggers","donley","collett","bromley","boatman","ballinger","baldridge","volz","trombley","stonge","shanahan","rivard","rhyne","pedroza","matias","jamieson","hedgepeth","hartnett","estevez","eskridge","denman","chiu","chinn","catlett","carmack","buie","bechtel","beardsley","bard","ballou","ulmer","skeen","robledo","rincon","reitz","piazza","munger","moten","mcmichael","loftus","ledet","kersey","groff","fowlkes","folk","crumpton","clouse","bettis","villagomez","timmerman","strom","santoro","roddy","penrod","musselman","macpherson","leboeuf","harless","haddad","guido","golding","fulkerson","fannin","dulaney","dowdell","cottle","ceja","cate","bosley","benge","albritton","voigt","trowbridge","soileau","seely","rohde","pearsall","paulk","orth","nason","mota","mcmullin","marquardt","madigan","hoag","gillum","gabbard","fenwick","eck","danforth","cushing","cress","creed","cazares","casanova","bey","bettencourt","barringer","baber","stansberry","schramm","rutter","rivero","oquendo","necaise","mouton","montenegro","miley","mcgough","marra","macmillan","lamontagne","jasso","horst","hetrick","heilman","gaytan","gall","fortney","dingle","desjardins","dabbs","burbank","brigham","breland","beaman","arriola","yarborough","wallin","toscano","stowers","reiss","pichardo","orton","michels","mcnamee","mccrory","leatherman","kell","keister","horning","hargett","guay","ferro","deboer","dagostino","carper","blanks","beaudry","towle","tafoya","stricklin","strader","soper","sonnier","sigmon","schenk","saddler","pedigo","mendes","lunn","lohr","lahr","kingsbury","jarman","hume","holliman","hofmann","haworth","harrelson","hambrick","flick","edmunds","dacosta","crossman","colston","chaplin","carrell","budd","weiler","waits","valentino","trantham","tarr","solorio","roebuck","powe","plank","pettus","palm","pagano","mink","luker","leathers","joslin","hartzell","gambrell","deutsch","cepeda","carty","caputo","brewington","bedell","ballew","applewhite","warnock","walz","urena","tudor","reel","pigg","parton","mickelson","meagher","mclellan","mcculley","mandel","leech","lavallee","kraemer","kling","kipp","kehoe","hochstetler","harriman","gregoire","grabowski","gosselin","gammon","fancher","edens","desai","brannan","armendariz","woolsey","whitehouse","whetstone","ussery","towne","testa","tallman","studer","strait","steinmetz","sorrells","sauceda","rolfe","paddock","mitchem","mcginn","mccrea","lovato","hazen","gilpin","gaynor","fike","devoe","delrio","curiel","burkhardt","bode","backus","zinn","watanabe","wachter","vanpelt","turnage","shaner","schroder","sato","riordan","quimby","portis","natale","mckoy","mccown","kilmer","hotchkiss","hesse","halbert","gwinn","godsey","delisle","chrisman","canter","arbogast","angell","acree","yancy","woolley","wesson","weatherspoon","trainor","stockman","spiller","sipe","rooks","reavis","propst","porras","neilson","mullens","loucks","llewellyn","kumar","koester","klingensmith","kirsch","kester","honaker","hodson","hennessy","helmick","garrity","garibay","fee","drain","casarez","callis","botello","aycock","avant","wingard","wayman","tully","theisen","szymanski","stansbury","segovia","rainwater","preece","pirtle","padron","mincey","mckelvey","mathes","larrabee","kornegay","klug","ingersoll","hecht","germain","eggers","dykstra","deering","decoteau","deason","dearing","cofield","carrigan","bonham","bahr","aucoin","appleby","almonte","yager","womble","wimmer","weimer","vanderpool","stancil","sprinkle","romine","remington","pfaff","peckham","olivera","meraz","maze","lathrop","koehn","hazelton","halvorson","hallock","haddock","ducharme","dehaven","caruthers","brehm","bosworth","bost","bias","beeman","basile","bane","aikens","wold","walther","tabb","suber","strawn","stocker","shirey","schlosser","riedel","rembert","reimer","pyles","peele","merriweather","letourneau","latta","kidder","hixon","hillis","hight","herbst","henriquez","haygood","hamill","gabel","fritts","eubank","dawes","correll","cha","bushey","buchholz","brotherton","botts","barnwell","auger","atchley","westphal","veilleux","ulloa","stutzman","shriver","ryals","prior","pilkington","moyers","marrs","mangrum","maddux","lockard","laing","kuhl","harney","hammock","hamlett","felker","doerr","depriest","carrasquillo","carothers","bogle","bischoff","bergen","albanese","wyckoff","vermillion","vansickle","thibault","tetreault","stickney","shoemake","ruggiero","rawson","racine","philpot","paschal","mcelhaney","mathison","legrand","lapierre","kwan","kremer","jiles","hilbert","geyer","faircloth","ehlers","egbert","desrosiers","dalrymple","cotten","cashman","cadena","breeding","boardman","alcaraz","ahn","wyrick","therrien","tankersley","strickler","puryear","plourde","pattison","pardue","mcginty","mcevoy","landreth","kuhns","koon","hewett","giddens","emerick","eades","deangelis","cosme","ceballos","birdsong","benham","bemis","armour","anguiano","welborn","tsosie","storms","shoup","sessoms","samaniego","rood","rojo","rhinehart","raby","northcutt","myer","munguia","morehouse","mcdevitt","mallett","lozada","lemoine","kuehn","hallett","grim","gillard","gaylor","garman","gallaher","feaster","faris","darrow","dardar","coney","carreon","braithwaite","boylan","boyett","bixler","bigham","benford","barragan","barnum","zuber","wyche","westcott","vining","stoltzfus","simonds","shupe","sabin","ruble","rittenhouse","richman","perrone","mulholland","millan","lomeli","kite","jemison","hulett","holler","hickerson","herold","hazelwood","griffen","gause","forde","eisenberg","dilworth","charron","chaisson","brodie","bristow","breunig","brace","boutwell","bentz","belk","bayless","batchelder","baran","baeza","zimmermann","weathersby","volk","toole","theis","tedesco","searle","schenck","satterwhite","ruelas","rankins","partida","nesbit","morel","menchaca","levasseur","kaylor","johnstone","hulse","hollar","hersey","harrigan","harbison","guyer","gish","giese","gerlach","geller","geisler","falcone","elwell","doucet","deese","darr","corder","chafin","byler","bussell","burdett","brasher","bowe","bellinger","bastian","barner","alleyne","wilborn","weil","wegner","wales","tatro","spitzer","smithers","schoen","resendez","parisi","overman","obrian","mudd","moy","mclaren","maggio","lindner","lalonde","lacasse","laboy","killion","kahl","jessen","jamerson","houk","henshaw","gustin","graber","durst","duenas","davey","cundiff","conlon","colunga","coakley","chiles","capers","buell","bricker","bissonnette","birmingham","bartz","bagby","zayas","volpe","treece","toombs","thom","terrazas","swinney","skiles","silveira","shouse","senn","ramage","nez","moua","langham","kyles","holston","hoagland","herd","feller","denison","carraway","burford","bickel","ambriz","abercrombie","yamada","weidner","waddle","verduzco","thurmond","swindle","schrock","sanabria","rosenberger","probst","peabody","olinger","nazario","mccafferty","mcbroom","mcabee","mazur","matherne","mapes","leverett","killingsworth","heisler","griego","gosnell","frankel","franke","ferrante","fenn","ehrlich","christopherso","chasse","chancellor","caton","brunelle","bly","bloomfield","babbitt","azevedo","abramson","ables","abeyta","youmans","wozniak","wainwright","stowell","smitherman","samuelson","runge","rothman","rosenfeld","peake","owings","olmos","munro","moreira","leatherwood","larkins","krantz","kovacs","kizer","kindred","karnes","jaffe","hubbell","hosey","hauck","goodell","erdman","dvorak","doane","cureton","cofer","buehler","bierman","berndt","banta","abdullah","warwick","waltz","turcotte","torrey","stith","seger","sachs","quesada","pinder","peppers","pascual","paschall","parkhurst","ozuna","oster","nicholls","lheureux","lavalley","kimura","jablonski","haun","gourley","gilligan","derby","croy","cotto","cargill","burwell","burgett","buckman","booher","adorno","wrenn","whittemore","urias","szabo","sayles","saiz","rutland","rael","pharr","pelkey","ogrady","nickell","musick","moats","mather","massa","kirschner","kieffer","kellar","hendershot","gott","godoy","gadson","furtado","fiedler","erskine","dutcher","dever","daggett","chevalier","brake","ballesteros","amerson","wingo","waldon","trott","silvey","showers","schlegel","rue","ritz","pepin","pelayo","parsley","palermo","moorehead","mchale","lett","kocher","kilburn","iglesias","humble","hulbert","huckaby","hix","haven","hartford","hardiman","gurney","grigg","grasso","goings","fillmore","farber","depew","dandrea","dame","cowen","covarrubias","burrus","bracy","ardoin","thompkins","standley","radcliffe","pohl","persaud","parenteau","pabon","newson","newhouse","napolitano","mulcahy","malave","keim","hooten","hernandes","heffernan","hearne","greenleaf","glick","fuhrman","fetter","faria","dishman","dickenson","crites","criss","clapper","chenault","castor","casto","bugg","bove","bonney","ard","anderton","allgood","alderson","woodman","warrick","toomey","tooley","tarrant","summerville","stebbins","sokol","searles","schutz","schumann","scheer","remillard","raper","proulx","palmore","monroy","messier","melo","melanson","mashburn","manzano","lussier","jenks","huneycutt","hartwig","grimsley","fulk","fielding","fidler","engstrom","eldred","dantzler","crandell","calder","brumley","breton","brann","bramlett","boykins","bianco","bancroft","almaraz","alcantar","whitmer","whitener","welton","vineyard","rahn","paquin","mizell","mcmillin","mckean","marston","maciel","lundquist","liggins","lampkin","kranz","koski","kirkham","jiminez","hazzard","harrod","graziano","grammer","gendron","garrido","fordham","englert","dryden","demoss","deluna","crabb","comeau","brummett","blume","benally","wessel","vanbuskirk","thorson","stumpf","stockwell","reams","radtke","rackley","pelton","niemi","newland","nelsen","morrissette","miramontes","mcginley","mccluskey","marchant","luevano","lampe","lail","jeffcoat","infante","hinman","gaona","erb","eady","desmarais","decosta","dansby","choe","breckenridge","bostwick","borg","bianchi","alberts","wilkie","whorton","vargo","tait","soucy","schuman","ousley","mumford","lum","lippert","leath","lavergne","laliberte","kirksey","kenner","johnsen","izzo","hiles","gullett","greenwell","gaspar","galbreath","gaitan","ericson","delapaz","croom","cottingham","clift","bushnell","bice","beason","arrowood","waring","voorhees","truax","shreve","shockey","schatz","sandifer","rubino","rozier","roseberry","pieper","peden","nester","nave","murphey","malinowski","macgregor","lafrance","kunkle","kirkman","hipp","hasty","haddix","gervais","gerdes","gamache","fouts","fitzwater","dillingham","deming","deanda","cedeno","cannady","burson","bouldin","arceneaux","woodhouse","whitford","wescott","welty","weigel","torgerson","toms","surber","sunderland","sterner","setzer","riojas","pumphrey","puga","metts","mcgarry","mccandless","magill","lupo","loveland","llamas","leclerc","koons","kahler","huss","holbert","heintz","haupt","grimmett","gaskill","ellingson","dorr","dingess","deweese","desilva","crossley","cordeiro","converse","conde","caldera","cairns","burmeister","burkhalter","brawner","bott","youngs","vierra","valladares","shrum","shropshire","sevilla","rusk","rodarte","pedraza","nino","merino","mcminn","markle","mapp","lajoie","koerner","kittrell","kato","hyder","hollifield","heiser","hazlett","greenwald","fant","eldredge","dreher","delafuente","cravens","claypool","beecher","aronson","alanis","worthen","wojcik","winger","whitacre","wellington","valverde","valdivia","troupe","thrower","swindell","suttles","suh","stroman","spires","slate","shealy","sarver","sartin","sadowski","rondeau","rolon","rascon","priddy","paulino","nolte","munroe","molloy","mciver","lykins","loggins","lenoir","klotz","kempf","hupp","hollowell","hollander","haynie","harkness","harker","gottlieb","frith","eddins","driskell","doggett","densmore","charette","cassady","byrum","burcham","buggs","benn","whitted","warrington","vandusen","vaillancourt","steger","siebert","scofield","quirk","purser","plumb","orcutt","nordstrom","mosely","michalski","mcphail","mcdavid","mccraw","marchese","mannino","lefevre","largent","lanza","kress","isham","hunsaker","hoch","hildebrandt","guarino","grijalva","graybill","ewell","ewald","cusick","crumley","coston","cathcart","carruthers","bullington","bowes","blain","blackford","barboza","yingling","weiland","varga","silverstein","sievers","shuster","shumway","runnels","rumsey","renfroe","provencher","polley","mohler","middlebrooks","kutz","koster","groth","glidden","fazio","deen","chipman","chenoweth","champlin","cedillo","carrero","carmody","buckles","brien","boutin","bosch","berkowitz","altamirano","wilfong","wiegand","waites","truesdale","toussaint","tobey","tedder","steelman","sirois","schnell","robichaud","richburg","plumley","pizarro","piercy","ortego","oberg","neace","mertz","mcnew","matta","lapp","lair","kibler","howlett","hollister","hofer","hatten","hagler","falgoust","engelhardt","eberle","dombrowski","dinsmore","daye","casares","braud","balch","autrey","wendel","tyndall","strobel","stoltz","spinelli","serrato","rochester","reber","rathbone","palomino","nickels","mayle","mathers","mach","loeffler","littrell","levinson","leong","lemire","lejeune","lazo","lasley","koller","kennard","hoelscher","hintz","hagerman","greaves","fore","eudy","engler","corrales","cordes","brunet","bidwell","bennet","tyrrell","tharpe","swinton","stribling","southworth","sisneros","savoie","samons","ruvalcaba","ries","ramer","omara","mosqueda","millar","mcpeak","macomber","luckey","litton","lehr","lavin","hubbs","hoard","hibbs","hagans","futrell","exum","evenson","culler","carbaugh","callen","brashear","bloomer","blakeney","bigler","addington","woodford","unruh","tolentino","sumrall","stgermain","smock","sherer","rayner","pooler","oquinn","nero","mcglothlin","linden","kowal","kerrigan","ibrahim","harvell","hanrahan","goodall","geist","fussell","fung","ferebee","eley","eggert","dorsett","dingman","destefano","colucci","clemmer","burnell","brumbaugh","boddie","berryhill","avelar","alcantara","winder","winchell","vandenberg","trotman","thurber","thibeault","stlouis","stilwell","sperling","shattuck","sarmiento","ruppert","rumph","renaud","randazzo","rademacher","quiles","pearman","palomo","mercurio","lowrey","lindeman","lawlor","larosa","lander","labrecque","hovis","holifield","henninger","hawkes","hartfield","hann","hague","genovese","garrick","fudge","frink","eddings","dinh","cribbs","calvillo","bunton","brodeur","bolding","blanding","agosto","zahn","wiener","trussell","tew","tello","teixeira","speck","sharma","shanklin","sealy","scanlan","santamaria","roundy","robichaux","ringer","rigney","prevost","polson","nord","moxley","medford","mccaslin","mcardle","macarthur","lewin","lasher","ketcham","keiser","heine","hackworth","grose","grizzle","gillman","gartner","frazee","fleury","edson","edmonson","derry","cronk","conant","burress","burgin","broom","brockington","bolick","boger","birchfield","billington","baily","bahena","armbruster","anson","yoho","wilcher","tinney","timberlake","thoma","thielen","sutphin","stultz","sikora","serra","schulman","scheffler","santillan","rego","preciado","pinkham","mickle","luu","lomas","lizotte","lent","kellerman","keil","johanson","hernadez","hartsfield","haber","gorski","farkas","eberhardt","duquette","delano","cropper","cozart","cockerham","chamblee","cartagena","cahoon","buzzell","brister","brewton","blackshear","benfield","aston","ashburn","arruda","wetmore","weise","vaccaro","tucci","sudduth","stromberg","stoops","showalter","shears","runion","rowden","rosenblum","riffle","renfrow","peres","obryant","leftwich","lark","landeros","kistler","killough","kerley","kastner","hoggard","hartung","guertin","govan","gatling","gailey","fullmer","fulford","flatt","esquibel","endicott","edmiston","edelstein","dufresne","dressler","dickman","chee","busse","bonnett","berard","arena","yoshida","velarde","veach","vanhouten","vachon","tolson","tolman","tennyson","stites","soler","shutt","ruggles","rhone","pegues","ong","neese","muro","moncrief","mefford","mcphee","mcmorris","mceachern","mcclurg","mansour","mader","leija","lecompte","lafountain","labrie","jaquez","heald","hash","hartle","gainer","frisby","farina","eidson","edgerton","dyke","durrett","duhon","cuomo","cobos","cervantez","bybee","brockway","borowski","binion","beery","arguello","amaro","acton","yuen","winton","wigfall","weekley","vidrine","vannoy","tardiff","shoop","shilling","schick","safford","prendergast","pellerin","osuna","nissen","nalley","moller","messner","messick","merrifield","mcguinness","matherly","marcano","mahone","lemos","lebrun","jara","hoffer","herren","hecker","haws","haug","gwin","gober","gilliard","fredette","favela","echeverria","downer","donofrio","desrochers","crozier","corson","bechtold","argueta","aparicio","zamudio","westover","westerman","utter","troyer","thies","tapley","slavin","shirk","sandler","roop","raymer","radcliff","otten","moorer","millet","mckibben","mccutchen","mcavoy","mcadoo","mayorga","mastin","martineau","marek","madore","leflore","kroeger","kennon","jimerson","hostetter","hornback","hendley","hance","guardado","granado","gowen","goodale","flinn","fleetwood","fitz","durkee","duprey","dipietro","dilley","clyburn","brawley","beckley","arana","weatherby","vollmer","vestal","tunnell","trigg","tingle","takahashi","sweatt","storer","snapp","shiver","rooker","rathbun","poisson","perrine","perri","pastor","parmer","parke","pare","palmieri","nottingham","midkiff","mecham","mccomas","mcalpine","lovelady","lillard","lally","knopp","kile","kiger","haile","gupta","goldsberry","gilreath","fulks","friesen","franzen","flack","findlay","ferland","dreyer","dore","dennard","deckard","debose","crim","coulombe","cork","chancey","cantor","branton","bissell","barns","woolard","witham","wasserman","spiegel","shoffner","scholz","ruch","rossman","petry","palacio","paez","neary","mortenson","millsap","miele","menke","mckim","mcanally","martines","manor","lemley","larochelle","klaus","klatt","kaufmann","kapp","helmer","hedge","halloran","glisson","frechette","fontana","eagan","distefano","danley","creekmore","chartier","chaffee","carillo","burg","bolinger","berkley","benz","basso","bash","barrier","zelaya","woodring","witkowski","wilmot","wilkens","wieland","verdugo","urquhart","tsai","timms","swiger","swaim","sussman","pires","molnar","mcatee","lowder","loos","linker","landes","kingery","hufford","higa","hendren","hammack","hamann","gillam","gerhardt","edelman","eby","delk","deans","curl","constantine","cleaver","claar","casiano","carruth","carlyle","brophy","bolanos","bibbs","bessette","beggs","baugher","bartel","averill","andresen","amin","adames","via","valente","turnbow","tse","swink","sublett","stroh","stringfellow","ridgway","pugliese","poteat","ohare","neubauer","murchison","mingo","lemmons","kwon","kellam","kean","jarmon","hyden","hudak","hollinger","henkel","hemingway","hasson","hansel","halter","haire","ginsberg","gillispie","fogel","flory","etter","elledge","eckman","deas","currin","crafton","coomer","colter","claxton","bulter","braddock","bowyer","binns","bellows","baskerville","barros","ansley","woolf","wight","waldman","wadley","tull","trull","tesch","stouffer","stadler","slay","shubert","sedillo","santacruz","reinke","poynter","neri","neale","mowry","moralez","monger","mitchum","merryman","manion","macdougall","lux","litchfield","ley","levitt","lepage","lasalle","khoury","kavanagh","karns","ivie","huebner","hodgkins","halpin","garica","eversole","dutra","dunagan","duffey","dillman","dillion","deville","dearborn","damato","courson","coulson","burdine","bousquet","bonin","bish","atencio","westbrooks","wages","vaca","tye","toner","tillis","swett","struble","stanfill","solorzano","slusher","sipple","sim","silvas","shults","schexnayder","saez","rodas","rager","pulver","plaza","penton","paniagua","meneses","mcfarlin","mcauley","matz","maloy","magruder","lohman","landa","lacombe","jaimes","hom","holzer","holst","heil","hackler","grundy","gilkey","farnham","durfee","dunton","dunston","duda","dews","craver","corriveau","conwell","colella","chambless","bremer","boutte","bourassa","blaisdell","backman","babineaux","audette","alleman","towner","taveras","tarango","sullins","suiter","stallard","solberg","schlueter","poulos","pimental","owsley","okelley","nations","moffatt","metcalfe","meekins","medellin","mcglynn","mccowan","marriott","marable","lennox","lamoureux","koss","kerby","karp","isenberg","howze","hockenberry","highsmith","harbour","hallmark","gusman","greeley","giddings","gaudet","gallup","fleenor","eicher","edington","dimaggio","dement","demello","decastro","bushman","brundage","brooker","bourg","blackstock","bergmann","beaton","banister","argo","appling","wortman","watterson","villalpando","tillotson","tighe","sundberg","sternberg","stamey","shipe","seeger","scarberry","sattler","sain","rothstein","poteet","plowman","pettiford","penland","partain","pankey","oyler","ogletree","ogburn","moton","merkel","lucier","lakey","kratz","kinser","kershaw","josephson","imhoff","hendry","hammon","frisbie","friedrich","frawley","fraga","forester","eskew","emmert","drennan","doyon","dandridge","cawley","carvajal","bracey","belisle","batey","ahner","wysocki","weiser","veliz","tincher","sansone","sankey","sandstrom","rohrer","risner","pridemore","pfeffer","persinger","peery","oubre","nowicki","musgrave","murdoch","mullinax","mccary","mathieu","livengood","kyser","klink","kimes","kellner","kavanaugh","kasten","imes","hoey","hinshaw","hake","gurule","grube","grillo","geter","gatto","garver","garretson","farwell","eiland","dunford","decarlo","corso","colman","collard","cleghorn","chasteen","cavender","carlile","calvo","byerly","brogdon","broadwater","breault","bono","bergin","behr","ballenger","amick","tamez","stiffler","steinke","simmon","shankle","schaller","salmons","sackett","saad","rideout","ratcliffe","rao","ranson","plascencia","petterson","olszewski","olney","olguin","nilsson","nevels","morelli","montiel","monge","michaelson","mertens","mcchesney","mcalpin","mathewson","loudermilk","lineberry","liggett","kinlaw","kight","jost","hereford","hardeman","halpern","halliday","hafer","gaul","friel","freitag","forsberg","evangelista","doering","dicarlo","dendy","delp","deguzman","dameron","curtiss","cosper","cauthen","cao","bradberry","bouton","bonnell","bixby","bieber","beveridge","bedwell","barhorst","bannon","baltazar","baier","ayotte","attaway","arenas","abrego","turgeon","tunstall","thaxton","thai","tenorio","stotts","sthilaire","shedd","seabolt","scalf","salyers","ruhl","rowlett","robinett","pfister","perlman","parkman","nunnally","norvell","napper","modlin","mckellar","mcclean","mascarenas","leibowitz","ledezma","kuhlman","kobayashi","hunley","holmquist","hinkley","hartsell","gribble","gravely","fifield","eliason","doak","crossland","carleton","bridgeman","bojorquez","boggess","auten","woosley","whiteley","wexler","twomey","tullis","townley","standridge","santoyo","rueda","riendeau","revell","pless","ottinger","nigro","nickles","mulvey","menefee","mcshane","mcloughlin","mckinzie","markey","lockridge","lipsey","knisley","knepper","kitts","kiel","jinks","hathcock","godin","gallego","fikes","fecteau","estabrook","ellinger","dunlop","dudek","countryman","chauvin","chatham","bullins","brownfield","boughton","bloodworth","bibb","baucom","barbieri","aubin","armitage","alessi","absher","abbate","zito","woolery","wiggs","wacker","tynes","tolle","telles","tarter","swarey","strode","stockdale","stalnaker","spina","schiff","saari","risley","rameriz","rakes","pettaway","penner","paulus","palladino","omeara","montelongo","melnick","mehta","mcgary","mccourt","mccollough","marchetti","manzanares","lowther","leiva","lauderdale","lafontaine","kowalczyk","knighton","joubert","jaworski","ide","huth","hurdle","housley","hackman","gulick","gordy","gilstrap","gehrke","gebhart","gaudette","foxworth","essex","endres","dunkle","cimino","caddell","brauer","braley","bodine","blackmore","belden","backer","ayer","andress","wisner","vuong","valliere","twigg","tso","tavarez","strahan","steib","staub","sowder","seiber","schutt","scharf","schade","rodriques","risinger","renshaw","rahman","presnell","piatt","nieman","nevins","mcilwain","mcgaha","mccully","mccomb","massengale","macedo","lesher","kearse","jauregui","husted","hudnall","holmberg","hertel","hardie","glidewell","frausto","fassett","dalessandro","dahlgren","corum","constantino","conlin","colquitt","colombo","claycomb","cardin","buller","boney","bocanegra","biggers","benedetto","araiza","andino","albin","zorn","werth","weisman","walley","vanegas","ulibarri","towe","tedford","teasley","suttle","steffens","stcyr","squire","singley","sifuentes","shuck","schram","sass","rieger","ridenhour","rickert","richerson","rayborn","rabe","raab","pendley","pastore","ordway","moynihan","mellott","mckissick","mcgann","mccready","mauney","marrufo","lenhart","lazar","lafave","keele","kautz","jardine","jahnke","jacobo","hord","hardcastle","hageman","giglio","gehring","fortson","duque","duplessis","dicken","derosier","deitz","dalessio","cram","castleman","candelario","callison","caceres","bozarth","biles","bejarano","bashaw","avina","armentrout","alverez","acord","waterhouse","vereen","vanlandingham","uhl","strawser","shotwell","severance","seltzer","schoonmaker","schock","schaub","schaffner","roeder","rodrigez","riffe","rhine","rasberry","rancourt","railey","quade","pursley","prouty","perdomo","oxley","osterman","nickens","murphree","mounts","merida","maus","mattern","masse","martinelli","mangan","lutes","ludwick","loney","laureano","lasater","knighten","kissinger","kimsey","kessinger","honea","hollingshead","hockett","heyer","heron","gurrola","gove","glasscock","gillett","galan","featherstone","eckhardt","duron","dunson","dasher","culbreth","cowden","cowans","claypoole","churchwell","chabot","caviness","cater","caston","callan","byington","burkey","boden","beckford","atwater","archambault","alvey","alsup","whisenant","weese","voyles","verret","tsang","tessier","sweitzer","sherwin","shaughnessy","revis","remy","prine","philpott","peavy","paynter","parmenter","ovalle","offutt","nightingale","newlin","nakano","myatt","muth","mohan","mcmillon","mccarley","mccaleb","maxson","marinelli","maley","liston","letendre","kain","huntsman","hirst","hagerty","gulledge","greenway","grajeda","gorton","goines","gittens","frederickson","fanelli","embree","eichelberger","dunkin","dixson","dillow","defelice","chumley","burleigh","borkowski","binette","biggerstaff","berglund","beller","audet","arbuckle","allain","alfano","youngman","wittman","weintraub","vanzant","vaden","twitty","stollings","standifer","sines","shope","scalise","saville","posada","pisano","otte","nolasco","napoli","mier","merkle","mendiola","melcher","mejias","mcmurry","mccalla","markowitz","manis","mallette","macfarlane","lough","looper","landin","kittle","kinsella","kinnard","hobart","herald","helman","hellman","hartsock","halford","hage","gordan","glasser","gayton","gattis","gastelum","gaspard","frisch","fitzhugh","eckstein","eberly","dowden","despain","crumpler","crotty","cornelison","chouinard","chamness","catlin","cann","bumgardner","budde","branum","bradfield","braddy","borst","birdwell","bazan","banas","bade","arango","ahearn","addis","zumwalt","wurth","wilk","widener","wagstaff","urrutia","terwilliger","tart","steinman","staats","sloat","rives","riggle","revels","reichard","prickett","poff","pitzer","petro","pell","northrup","nicks","moline","mielke","maynor","mallon","magness","lingle","lindell","lieb","lesko","lebeau","lammers","lafond","kiernan","ketron","jurado","holmgren","hilburn","hayashi","hashimoto","harbaugh","guillot","gard","froehlich","feinberg","falco","dufour","drees","doney","diep","delao","daves","dail","crowson","coss","congdon","carner","camarena","butterworth","burlingame","bouffard","bloch","bilyeu","barta","bakke","baillargeon","avent","aquilar","ake","aho","zeringue","yarber","wolfson","vogler","voelker","truss","troxell","thrift","strouse","spielman","sistrunk","sevigny","schuller","schaaf","ruffner","routh","roseman","ricciardi","peraza","pegram","overturf","olander","odaniel","neu","millner","melchor","maroney","machuca","macaluso","livesay","layfield","laskowski","kwiatkowski","kilby","hovey","heywood","hayman","havard","harville","haigh","hagood","grieco","glassman","gebhardt","fleischer","fann","elson","eccles","cunha","crumb","blakley","bardwell","abshire","woodham","wines","welter","wargo","varnado","tutt","traynor","swaney","svoboda","stricker","stoffel","stambaugh","sickler","shackleford","selman","seaver","sansom","sanmiguel","royston","rourke","rockett","rioux","puleo","pitchford","nardi","mulvaney","middaugh","malek","leos","lathan","kujawa","kimbro","killebrew","houlihan","hinckley","herod","hepler","hamner","hammel","hallowell","gonsalez","gingerich","gambill","funkhouser","fricke","fewell","falkner","endsley","dulin","drennen","deaver","dambrosio","chadwell","castanon","burkes","brune","brisco","brinker","bowker","boldt","berner","beaumont","beaird","bazemore","barrick","albano","younts","wunderlich","weidman","vanness","toland","theobald","stickler","steiger","stanger","spies","spector","sollars","smedley","seibel","scoville","saito","rye","rummel","rowles","rouleau","roos","rogan","roemer","ream","raya","purkey","priester","perreira","penick","paulin","parkins","overcash","oleson","neves","muldrow","minard","midgett","michalak","melgar","mcentire","mcauliffe","marte","lydon","lindholm","leyba","langevin","lagasse","lafayette","kesler","kelton","kao","kaminsky","jaggers","humbert","huck","howarth","hinrichs","higley","gupton","guimond","gravois","giguere","fretwell","fontes","feeley","faucher","eichhorn","ecker","earp","dole","dinger","derryberry","demars","deel","copenhaver","collinsworth","colangelo","cloyd","claiborne","caulfield","carlsen","calzada","caffey","broadus","brenneman","bouie","bodnar","blaney","blanc","beltz","behling","barahona","yockey","winkle","windom","wimer","villatoro","trexler","teran","taliaferro","sydnor","swinson","snelling","smtih","simonton","simoneaux","simoneau","sherrer","seavey","scheel","rushton","rupe","ruano","rippy","reiner","reiff","rabinowitz","quach","penley","odle","nock","minnich","mckown","mccarver","mcandrew","longley","laux","lamothe","lafreniere","kropp","krick","kates","jepson","huie","howse","howie","henriques","haydon","haught","hartzog","harkey","grimaldo","goshorn","gormley","gluck","gilroy","gillenwater","giffin","fluker","feder","eyre","eshelman","eakins","detwiler","delrosario","davisson","catalan","canning","calton","brammer","botelho","blakney","bartell","averett","askins","aker","zak","worcester","witmer","wiser","winkelman","widmer","whittier","weitzel","wardell","wagers","ullman","tupper","tingley","tilghman","talton","simard","seda","scheller","sala","rundell","rost","roa","ribeiro","rabideau","primm","pinon","peart","ostrom","ober","nystrom","nussbaum","naughton","murr","moorhead","monti","monteiro","melson","meissner","mclin","mcgruder","marotta","makowski","majewski","madewell","lunt","lukens","leininger","lebel","lakin","kepler","jaques","hunnicutt","hungerford","hoopes","hertz","heins","halliburton","grosso","gravitt","glasper","gallman","gallaway","funke","fulbright","falgout","eakin","dostie","dorado","dewberry","derose","cutshall","crampton","costanzo","colletti","cloninger","claytor","chiang","canterbury","campagna","burd","brokaw","broaddus","bretz","brainard","binford","bilbrey","alpert","aitken","ahlers","zajac","woolfolk","witten","windle","wayland","tramel","tittle","talavera","suter","straley","specht","sommerville","soloman","skeens","sigman","sibert","shavers","schuck","schmit","sartain","sabol","rosenblatt","rollo","rashid","rabb","province","polston","nyberg","northrop","navarra","muldoon","mikesell","mcdougald","mcburney","mariscal","lui","lozier","lingerfelt","legere","latour","lagunas","lacour","kurth","killen","kiely","kayser","kahle","isley","huertas","hower","hinz","haugh","gumm","galicia","fortunato","flake","dunleavy","duggins","doby","digiovanni","devaney","deltoro","cribb","corpuz","coronel","coen","charbonneau","caine","burchette","blakey","blakemore","bergquist","beene","beaudette","bayles","ballance","bakker","bailes","asberry","arwood","zucker","willman","whitesell","wald","walcott","vancleave","trump","strasser","simas","shick","schleicher","schaal","saleh","rotz","resnick","rainer","partee","ollis","oller","oday","munday","mong","millican","merwin","mazzola","mansell","magallanes","llanes","lewellen","lepore","kisner","keesee","jeanlouis","ingham","hornbeck","hawn","hartz","harber","haffner","gutshall","guth","grays","gowan","finlay","finkelstein","eyler","enloe","dungan","diez","dearman","cull","crosson","chronister","cassity","campion","callihan","butz","breazeale","blumenthal","berkey","batty","batton","arvizu","alderete","aldana","albaugh","abernethy","wolter","wille","tweed","tollefson","thomasson","teter","testerman","sproul","spates","southwick","soukup","skelly","senter","sealey","sawicki","sargeant","rossiter","rosemond","repp","pifer","ormsby","nickelson","naumann","morabito","monzon","millsaps","millen","mcelrath","marcoux","mantooth","madson","macneil","mackinnon","louque","leister","lampley","kushner","krouse","kirwan","jessee","janson","jahn","jacquez","islas","hutt","holladay","hillyer","hepburn","hensel","harrold","gingrich","geis","gales","fults","finnell","ferri","featherston","epley","ebersole","eames","dunigan","drye","dismuke","devaughn","delorenzo","damiano","confer","collum","clower","clow","claussen","clack","caylor","cawthon","casias","carreno","bluhm","bingaman","bewley","belew","beckner","auld","amey","wolfenbarger","wilkey","wicklund","waltman","villalba","valero","valdovinos","ung","ullrich","tyus","twyman","trost","tardif","tanguay","stripling","steinbach","shumpert","sasaki","sappington","sandusky","reinhold","reinert","quijano","pye","placencia","pinkard","phinney","perrotta","pernell","parrett","oxendine","owensby","orman","nuno","mori","mcroberts","mcneese","mckamey","mccullum","markel","mardis","maines","lueck","lubin","lefler","leffler","larios","labarbera","kershner","josey","jeanbaptiste","izaguirre","hermosillo","haviland","hartshorn","hafner","ginter","getty","franck","fiske","dufrene","doody","davie","dangerfield","dahlberg","cuthbertson","crone","coffelt","chidester","chesson","cauley","caudell","cantara","campo","caines","bullis","bucci","brochu","bogard","bickerstaff","benning","arzola","antonelli","adkinson","zellers","wulf","worsley","woolridge","whitton","westerfield","walczak","vassar","truett","trueblood","trawick","townsley","topping","tobar","telford","steverson","stagg","sitton","sill","sergent","schoenfeld","sarabia","rutkowski","rubenstein","rigdon","prentiss","pomerleau","plumlee","philbrick","peer","patnode","oloughlin","obregon","nuss","morell","mikell","mele","mcinerney","mcguigan","mcbrayer","lor","lollar","lakes","kuehl","kinzer","kamp","joplin","jacobi","howells","holstein","hedden","hassler","harty","halle","greig","gouge","goodrum","gerhart","geier","geddes","gast","forehand","ferree","fendley","feltner","esqueda","encarnacion","eichler","egger","edmundson","eatmon","doud","donohoe","donelson","dilorenzo","digiacomo","diggins","delozier","dejong","danford","crippen","coppage","cogswell","clardy","cioffi","cabe","brunette","bresnahan","bramble","blomquist","blackstone","biller","bevis","bevan","bethune","benbow","baty","basinger","balcom","andes","aman","aguero","adkisson","yandell","wilds","whisenhunt","weigand","weeden","voight","villar","trottier","tillett","suazo","setser","scurry","schuh","schreck","schauer","samora","roane","rinker","reimers","ratchford","popovich","parkin","natal","melville","mcbryde","magdaleno","loehr","lockman","lingo","leduc","larocca","lao","lamere","laclair","krall","korte","koger","jalbert","hughs","higbee","henton","heaney","haith","gump","greeson","goodloe","gholston","gasper","gagliardi","fregoso","farthing","fabrizio","ensor","elswick","elgin","eklund","eaddy","drouin","dorton","dizon","derouen","deherrera","davy","dampier","cullum","culley","cowgill","cardoso","cardinale","brodsky","broadbent","brimmer","briceno","branscum","bolyard","boley","bennington","beadle","baur","ballentine","azure","aultman","arciniega","aguila","aceves","yepez","yap","woodrum","wethington","weissman","veloz","trusty","troup","trammel","tarpley","stivers","steck","sprayberry","spraggins","spitler","spiers","sohn","seagraves","schiffman","rudnick","rizo","riccio","rennie","quackenbush","puma","plott","pearcy","parada","paiz","munford","moskowitz","mease","mcnary","mccusker","lozoya","longmire","loesch","lasky","kuhlmann","krieg","koziol","kowalewski","konrad","kindle","jowers","jolin","jaco","hua","horgan","hine","hileman","hepner","heise","heady","hawkinson","hannigan","haberman","guilford","grimaldi","garton","gagliano","fruge","follett","fiscus","ferretti","ebner","easterday","eanes","dirks","dimarco","depalma","deforest","cruce","craighead","christner","candler","cadwell","burchell","buettner","brinton","brazier","brannen","brame","bova","bomar","blakeslee","belknap","bangs","balzer","athey","armes","alvis","alverson","alvardo","yeung","wheelock","westlund","wessels","volkman","threadgill","thelen","tague","symons","swinford","sturtevant","straka","stier","stagner","segarra","seawright","rutan","roux","ringler","riker","ramsdell","quattlebaum","purifoy","poulson","permenter","peloquin","pasley","pagel","osman","obannon","nygaard","newcomer","munos","motta","meadors","mcquiston","mcniel","mcmann","mccrae","mayne","matte","legault","lechner","kucera","krohn","kratzer","koopman","jeske","horrocks","hock","hibbler","hesson","hersh","harvin","halvorsen","griner","grindle","gladstone","garofalo","frampton","forbis","eddington","diorio","dingus","dewar","desalvo","curcio","creasy","cortese","cordoba","connally","cluff","cascio","capuano","canaday","calabro","bussard","brayton","borja","bigley","arnone","arguelles","acuff","zamarripa","wooton","widner","wideman","threatt","thiele","templin","teeters","synder","swint","swick","sturges","stogner","stedman","spratt","siegfried","shetler","scull","savino","sather","rothwell","rook","rone","rhee","quevedo","privett","pouliot","poche","pickel","petrillo","pellegrini","peaslee","partlow","otey","nunnery","morelock","morello","meunier","messinger","mckie","mccubbin","mccarron","lerch","lavine","laverty","lariviere","lamkin","kugler","krol","kissel","keeter","hubble","hickox","hetzel","hayner","hagy","hadlock","groh","gottschalk","goodsell","gassaway","garrard","galligan","fye","firth","fenderson","feinstein","etienne","engleman","emrick","ellender","drews","doiron","degraw","deegan","dart","crissman","corr","cookson","coil","cleaves","charest","chapple","chaparro","castano","carpio","byer","bufford","bridgewater","bridgers","brandes","borrero","bonanno","aube","ancheta","abarca","abad","yim","wooster","wimbush","willhite","willams","wigley","weisberg","wardlaw","vigue","vanhook","unknow","torre","tasker","tarbox","strachan","slover","shamblin","semple","schuyler","schrimsher","sayer","salzman","rubalcava","riles","reneau","reichel","rayfield","rabon","pyatt","prindle","poss","polito","plemmons","pesce","perrault","pereyra","ostrowski","nilsen","niemeyer","munsey","mundell","moncada","miceli","meader","mcmasters","mckeehan","matsumoto","marron","marden","lizarraga","lingenfelter","lewallen","langan","lamanna","kovac","kinsler","kephart","keown","kass","kammerer","jeffreys","hysell","householder","hosmer","hardnett","hanner","guyette","greening","glazer","ginder","fromm","fluellen","finkle","fey","fessler","essary","eisele","duren","dittmer","crochet","cosentino","cogan","coelho","cavin","carrizales","campuzano","brough","bopp","bookman","blouin","beesley","battista","bascom","bakken","badgett","arneson","anselmo","ahumada","woodyard","wolters","wireman","willison","warman","waldrup","vowell","vantassel","vale","twombly","toomer","tennison","teets","tedeschi","swanner","stutz","stelly","sheehy","schermerhorn","scala","sandidge","salters","salo","saechao","roseboro","rolle","ressler","renz","renn","redford","raposa","rainbolt","pelfrey","orndorff","oney","nolin","nimmons","ney","nardone","myhre","morman","menjivar","mcglone","mccammon","maxon","marciano","manus","lowrance","lorenzen","lonergan","lollis","littles","lindahl","lamas","lach","kuster","krawczyk","knuth","knecht","kirkendall","keitt","keever","kantor","jarboe","hoye","houchens","holter","holsinger","hickok","helwig","helgeson","hassett","harner","hamman","hames","hadfield","goree","goldfarb","gaughan","gaudreau","gantz","gallion","frady","foti","flesher","ferrin","faught","engram","donegan","desouza","degroot","cutright","crowl","criner","coan","clinkscales","chewning","chavira","catchings","carlock","bulger","buenrostro","bramblett","brack","boulware","bookout","bitner","birt","baranowski","baisden","augustin","allmon","acklin","yoakum","wilbourn","whisler","weinberger","washer","vasques","vanzandt","vanatta","troxler","tomes","tindle","tims","throckmorton","thach","stpeter","stlaurent","stenson","spry","spitz","songer","snavely","sly","shroyer","shortridge","shenk","sevier","seabrook","scrivner","saltzman","rosenberry","rockwood","robeson","roan","reiser","ramires","raber","posner","popham","piotrowski","pinard","peterkin","pelham","peiffer","peay","nadler","musso","millett","mestas","mcgowen","marques","marasco","manriquez","manos","mair","lipps","leiker","krumm","knorr","kinslow","kessel","kendricks","kelm","ito","irick","ickes","hurlburt","horta","hoekstra","heuer","helmuth","heatherly","hampson","hagar","haga","greenlaw","grau","godbey","gingras","gillies","gibb","gayden","gauvin","garrow","fontanez","florio","finke","fasano","ezzell","ewers","eveland","eckenrode","duclos","drumm","dimmick","delancey","defazio","dashiell","cusack","crowther","crigger","cray","coolidge","coldiron","cleland","chalfant","cassel","camire","cabrales","broomfield","brittingham","brisson","brickey","braziel","brazell","bragdon","boulanger","bos","boman","bohannan","beem","barre","baptist","azar","ashbaugh","armistead","almazan","adamski","zendejas","winburn","willaims","wilhoit","westberry","wentzel","wendling","visser","vanscoy","vankirk","vallee","tweedy","thornberry","sweeny","spradling","spano","smelser","shim","sechrist","schall","scaife","rugg","rothrock","roesler","riehl","ridings","render","ransdell","radke","pinero","petree","pendergast","peluso","pecoraro","pascoe","panek","oshiro","navarrette","murguia","moores","moberg","michaelis","mcwhirter","mcsweeney","mcquade","mccay","mauk","mariani","marceau","mandeville","maeda","lunde","ludlow","loeb","lindo","linderman","leveille","leith","larock","lambrecht","kulp","kinsley","kimberlin","kesterson","hoyos","helfrich","hanke","grisby","goyette","gouveia","glazier","gile","gerena","gelinas","gasaway","funches","fujimoto","flynt","fenske","fellers","fehr","eslinger","escalera","enciso","duley","dittman","dineen","diller","devault","dao","collings","clymer","clowers","chavers","charland","castorena","castello","camargo","bunce","bullen","boyes","borchers","borchardt","birnbaum","birdsall","billman","benites","bankhead","ange","ammerman","adkison","winegar","wickman","warr","warnke","villeneuve","veasey","vassallo","vannatta","vadnais","twilley","towery","tomblin","tippett","theiss","talkington","talamantes","swart","swanger","streit","stines","stabler","spurling","sobel","sine","simmers","shippy","shiflett","shearin","sauter","sanderlin","rusch","runkle","ruckman","rorie","roesch","richert","rehm","randel","ragin","quesenberry","puentes","plyler","plotkin","paugh","oshaughnessy","ohalloran","norsworthy","niemann","nader","moorefield","mooneyham","modica","miyamoto","mickel","mebane","mckinnie","mazurek","mancilla","lukas","lovins","loughlin","lotz","lindsley","liddle","levan","lederman","leclaire","lasseter","lapoint","lamoreaux","lafollette","kubiak","kirtley","keffer","kaczmarek","housman","hiers","hibbert","herrod","hegarty","hathorn","greenhaw","grafton","govea","futch","furst","franko","forcier","foran","flickinger","fairfield","eure","emrich","embrey","edgington","ecklund","eckard","durante","deyo","delvecchio","dade","currey","creswell","cottrill","casavant","cartier","cargile","capel","cammack","calfee","burse","burruss","brust","brousseau","bridwell","braaten","borkholder","bloomquist","bjork","bartelt","arp","amburgey","yeary","yao","whitefield","vinyard","vanvalkenburg","twitchell","timmins","tapper","stringham","starcher","spotts","slaugh","simonsen","sheffer","sequeira","rosati","rhymes","reza","quint","pollak","peirce","patillo","parkerson","paiva","nilson","nevin","narcisse","nair","mitton","merriam","merced","meiners","mckain","mcelveen","mcbeth","marsden","marez","manke","mahurin","mabrey","luper","krull","kees","iles","hunsicker","hornbuckle","holtzclaw","hirt","hinnant","heston","hering","hemenway","hegwood","hearns","halterman","guiterrez","grote","granillo","grainger","glasco","gilder","garren","garlock","garey","fryar","fredricks","fraizer","foxx","foshee","ferrel","felty","everitt","evens","esser","elkin","eberhart","durso","duguay","driskill","doster","dewall","deveau","demps","demaio","delreal","deleo","deem","darrah","cumberbatch","culberson","cranmer","cordle","colgan","chesley","cavallo","castellon","castelli","carreras","carnell","carlucci","bontrager","blumberg","blasingame","becton","ayon","artrip","andujar","alkire","alder","agan","zukowski","zuckerman","zehr","wroblewski","wrigley","woodside","wigginton","westman","westgate","werts","washam","wardlow","walser","waiters","tadlock","stringfield","stimpson","stickley","standish","spurlin","spindler","speller","spaeth","sotomayor","sok","sluder","shryock","shepardson","shatley","scannell","santistevan","rosner","rhode","resto","reinhard","rathburn","prisco","poulsen","pinney","phares","pennock","pastrana","oviedo","ostler","noto","nauman","mulford","moise","moberly","mirabal","metoyer","metheny","mentzer","meldrum","mcinturff","mcelyea","mcdougle","massaro","lumpkins","loveday","lofgren","loe","lirette","lesperance","lefkowitz","ledger","lauzon","lain","lachapelle","kurz","klassen","keough","kempton","kaelin","jeffords","huot","hsieh","hoyer","horwitz","hopp","hoeft","hennig","haskin","gourdine","golightly","girouard","fulgham","fritsch","freer","frasher","foulk","firestone","fiorentino","fedor","ensley","englehart","eells","ebel","dunphy","donahoe","dileo","dibenedetto","dabrowski","crick","coonrod","conder","coddington","chunn","choy","chaput","cerna","carreiro","calahan","braggs","bourdon","bollman","bittle","behm","bauder","batt","barreras","aubuchon","anzalone","adamo","zerbe","wirt","willcox","westberg","weikel","waymire","vroman","vinci","vallejos","truesdell","troutt","trotta","tollison","toles","tichenor","symonds","surles","strayer","stgeorge","sroka","sorrentino","solares","snelson","silvestri","sikorski","shawver","schumaker","schorr","schooley","scates","satterlee","satchell","sacks","rymer","roselli","robitaille","riegel","regis","reames","provenzano","priestley","plaisance","pettey","palomares","oman","nowakowski","nace","monette","minyard","mclamb","mchone","mccarroll","masson","magoon","maddy","lundin","loza","licata","leonhardt","lema","landwehr","kircher","kinch","karpinski","johannsen","hussain","houghtaling","hoskinson","hollaway","holeman","hobgood","hilt","hiebert","gros","goggin","geissler","gadbois","gabaldon","fleshman","flannigan","fairman","epp","eilers","dycus","dunmire","duffield","dowler","deloatch","dehaan","deemer","clayborn","christofferso","chilson","chesney","chatfield","carron","canale","brigman","branstetter","bosse","borton","bonar","blau","biron","barroso","arispe","zacharias","zabel","yaeger","woolford","whetzel","weakley","veatch","vandeusen","tufts","troxel","troche","traver","townsel","tosh","talarico","swilley","sterrett","stenger","speakman","sowards","sours","souders","souder","soles","sobers","snoddy","smither","sias","shute","shoaf","shahan","schuetz","scaggs","santini","rosson","rolen","robidoux","rentas","recio","pixley","pawlowski","pawlak","paull","overbey","orear","oliveri","oldenburg","nutting","naugle","mote","mossman","moor","misner","milazzo","michelson","mcentee","mccullar","mccree","mcaleer","mazzone","mandell","manahan","malott","maisonet","mailloux","lumley","lowrie","louviere","lipinski","lindemann","leppert","leopold","leasure","labarge","kubik","knisely","knepp","kenworthy","kennelly","kelch","karg","kanter","hyer","houchin","hosley","hosler","hollon","holleman","heitman","hebb","haggins","gwaltney","guin","goulding","gorden","geraci","georges","gathers","frison","feagin","falconer","espada","erving","erikson","eisenhauer","eder","ebeling","durgin","dowdle","dinwiddie","delcastillo","dedrick","crimmins","covell","cournoyer","coria","cohan","cataldo","carpentier","canas","campa","brode","brashears","blaser","bicknell","berk","bednar","barwick","ascencio","althoff","almodovar","alamo","zirkle","zabala","wolverton","winebrenner","wetherell","westlake","wegener","weddington","vong","tuten","trosclair","tressler","theroux","teske","swinehart","swensen","sundquist","southall","socha","sizer","silverberg","shortt","shimizu","sherrard","shaeffer","scheid","scheetz","saravia","sanner","rubinstein","rozell","romer","rheaume","reisinger","randles","pullum","petrella","payan","papp","nordin","norcross","nicoletti","nicholes","newbold","nakagawa","mraz","monteith","milstead","milliner","mellen","mccardle","luft","liptak","lipp","leitch","latimore","larrison","landau","laborde","koval","izquierdo","hymel","hoskin","holte","hoefer","hayworth","hausman","harrill","harrel","hardt","gully","groover","grinnell","greenspan","graver","grandberry","gorrell","goldenberg","goguen","gilleland","garr","fuson","foye","feldmann","everly","dyess","dyal","dunnigan","downie","dolby","deatherage","cosey","cheever","celaya","caver","cashion","caplinger","cansler","byrge","bruder","breuer","breslin","brazelton","botkin","bonneau","bondurant","bohanan","bogue","boes","bodner","boatner","blatt","bickley","belliveau","beiler","beier","beckstead","bachmann","atkin","altizer","alloway","allaire","albro","abron","zellmer","yetter","yelverton","wiltshire","wiens","whidden","viramontes","vanwormer","tarantino","tanksley","sumlin","strauch","strang","stice","spahn","sosebee","sigala","shrout","seamon","schrum","schneck","schantz","ruddy","romig","roehl","renninger","reding","pyne","polak","pohlman","pasillas","oldfield","oldaker","ohanlon","ogilvie","norberg","nolette","nies","neufeld","nellis","mummert","mulvihill","mullaney","monteleone","mendonca","meisner","mcmullan","mccluney","mattis","massengill","manfredi","luedtke","lounsbury","liberatore","leek","lamphere","laforge","kuo","koo","jourdan","ismail","iorio","iniguez","ikeda","hubler","hodgdon","hocking","heacock","haslam","haralson","hanshaw","hannum","hallam","haden","garnes","garces","gammage","gambino","finkel","faucett","fahy","ehrhardt","eggen","dusek","durrant","dubay","dones","dey","depasquale","delucia","degraff","decamp","davalos","cullins","conard","clouser","clontz","cifuentes","chappel","chaffins","celis","carwile","byram","bruggeman","bressler","brathwaite","brasfield","bradburn","boose","boon","bodie","blosser","blas","bise","bertsch","bernardi","bernabe","bengtson","barrette","astorga","alday","albee","abrahamson","yarnell","wiltse","wile","wiebe","waguespack","vasser","upham","tyre","turek","traxler","torain","tomaszewski","tinnin","tiner","tindell","teed","styron","stahlman","staab","skiba","shih","sheperd","seidl","secor","schutte","sanfilippo","ruder","rondon","rearick","procter","prochaska","pettengill","pauly","neilsen","nally","mutter","mullenax","morano","meads","mcnaughton","mcmurtry","mcmath","mckinsey","matthes","massenburg","marlar","margolis","malin","magallon","mackin","lovette","loughran","loring","longstreet","loiselle","lenihan","laub","kunze","kull","koepke","kerwin","kalinowski","kagan","innis","innes","holtzman","heinemann","harshman","haider","haack","guss","grondin","grissett","greenawalt","gravel","goudy","goodlett","goldston","gokey","gardea","galaviz","gafford","gabrielson","furlow","fritch","fordyce","folger","elizalde","ehlert","eckhoff","eccleston","ealey","dubin","diemer","deschamps","delapena","decicco","debolt","daum","cullinan","crittendon","crase","cossey","coppock","coots","colyer","cluck","chamberland","burkhead","bumpus","buchan","borman","bork","boe","birkholz","berardi","benda","behnke","barter","auer","amezquita","wotring","wirtz","wingert","wiesner","whitesides","weyant","wainscott","venezia","varnell","tussey","thurlow","tabares","stiver","stell","starke","stanhope","stanek","sisler","sinnott","siciliano","shehan","selph","seager","scurlock","scranton","santucci","santangelo","saltsman","ruel","ropp","rogge","rettig","renwick","reidy","reider","redfield","quam","premo","peet","parente","paolucci","palmquist","orme","ohler","ogg","netherton","mutchler","morita","mistretta","minnis","middendorf","menzel","mendosa","mendelson","meaux","mcspadden","mcquaid","mcnatt","manigault","maney","mager","lukes","lopresti","liriano","lipton","letson","lechuga","lazenby","lauria","larimore","kwok","kwak","krupp","krupa","krum","kopec","kinchen","kifer","kerney","kerner","kennison","kegley","kays","karcher","justis","johson","jellison","janke","huskins","holzman","hinojos","hefley","hatmaker","harte","halloway","hallenbeck","goodwyn","glaspie","geise","fullwood","fryman","frew","frakes","fraire","farrer","enlow","engen","ellzey","eckles","earles","ealy","dunkley","drinkard","dreiling","draeger","dinardo","dills","desroches","desantiago","curlee","crumbley","critchlow","coury","courtright","coffield","cleek","charpentier","cardone","caples","cantin","buntin","bugbee","brinkerhoff","brackin","bourland","bohl","bogdan","blassingame","beacham","banning","auguste","andreasen","amann","almon","alejo","adelman","abston","zeno","yerger","wymer","woodberry","windley","whiteaker","westfield","weibel","wanner","waldrep","villani","vanarsdale","utterback","updike","triggs","topete","tolar","tigner","thoms","tauber","tarvin","tally","swiney","sweatman","studebaker","stennett","starrett","stannard","stalvey","sonnenberg","smithey","sieber","sickles","shinault","segars","sanger","salmeron","rothe","rizzi","rine","ricard","restrepo","ralls","ragusa","quiroga","pero","pegg","pavlik","papenfuss","oropeza","okane","neer","nee","mudge","mozingo","molinaro","mcvicker","mcgarvey","mcfalls","mccraney","matus","magers","llanos","livermore","liss","linehan","leto","leitner","laymon","lawing","lacourse","kwong","kollar","kneeland","keo","kennett","kellett","kangas","janzen","hutter","huse","huling","hoss","hohn","hofmeister","hewes","hern","harjo","habib","gust","guice","grullon","greggs","grayer","granier","grable","gowdy","giannini","getchell","gartman","garnica","ganey","gallimore","fray","fetters","fergerson","farlow","fagundes","exley","esteves","enders","edenfield","easterwood","drakeford","dipasquale","desousa","deshields","deeter","dedmon","debord","daughtery","cutts","courtemanche","coursey","copple","coomes","collis","coll","cogburn","clopton","choquette","chaidez","castrejon","calhoon","burbach","bulloch","buchman","bruhn","bohon","blough","bien","baynes","barstow","zeman","zackery","yardley","yamashita","wulff","wilken","wiliams","wickersham","wible","whipkey","wedgeworth","walmsley","walkup","vreeland","verrill","valera","umana","traub","swingle","summey","stroupe","stockstill","steffey","stefanski","statler","stapp","speights","solari","soderberg","shunk","shorey","shewmaker","sheilds","schiffer","schank","schaff","sagers","rochon","riser","rickett","reale","raglin","polen","plata","pitcock","percival","palen","pahl","orona","oberle","nocera","navas","nault","mullings","moos","montejano","monreal","minick","middlebrook","meece","mcmillion","mccullen","mauck","marshburn","maillet","mahaney","magner","maclin","lucey","litteral","lippincott","leite","leis","leaks","lamarre","kost","jurgens","jerkins","jager","hurwitz","hughley","hotaling","horstman","hohman","hocker","hively","hipps","hile","hessler","hermanson","hepworth","henn","helland","hedlund","harkless","haigler","gutierez","grindstaff","glantz","giardina","gerken","gadsden","finnerty","feld","farnum","encinas","drakes","dennie","cutlip","curtsinger","couto","cortinas","corby","chiasson","carle","carballo","brindle","borum","bober","blagg","birk","berthiaume","beahm","batres","basnight","backes","axtell","aust","atterberry","alvares","alt","alegria","yow","yip","woodell","wojciechowski","winfree","winbush","wiest","wesner","wamsley","wakeman","verner","truex","trafton","toman","thorsen","theus","tellier","tallant","szeto","strope","stills","sorg","simkins","shuey","shaul","servin","serio","serafin","salguero","saba","ryerson","rudder","ruark","rother","rohrbaugh","rohrbach","rohan","rogerson","risher","rigg","reeser","pryce","prokop","prins","priebe","prejean","pinheiro","petrone","petri","penson","pearlman","parikh","natoli","murakami","mullikin","mullane","motes","morningstar","monks","mcveigh","mcgrady","mcgaughey","mccurley","masi","marchan","manske","maez","lusby","linde","lile","likens","licon","leroux","lemaire","legette","lax","laskey","laprade","laplant","kolar","kittredge","kinley","kerber","kanagy","jetton","janik","ippolito","inouye","hunsinger","howley","howery","horrell","holthaus","hiner","hilson","hilderbrand","hasan","hartzler","harnish","harada","hansford","halligan","hagedorn","gwynn","gudino","greenstein","greear","gracey","goudeau","gose","goodner","ginsburg","gerth","gerner","fyfe","fujii","frier","frenette","folmar","fleisher","fleischmann","fetzer","eisenman","earhart","dupuy","dunkelberger","drexler","dillinger","dilbeck","dewald","demby","deford","dake","craine","como","chesnut","casady","carstens","carrick","carino","carignan","canchola","cale","bushong","burman","buono","brownlow","broach","britten","brickhouse","boyden","boulton","borne","borland","bohrer","blubaugh","bever","berggren","benevides","arocho","arends","amezcua","almendarez","zalewski","witzel","winkfield","wilhoite","vara","vangundy","vanfleet","vanetten","vandergriff","urbanski","troiano","thibodaux","straus","stoneking","stjean","stillings","stange","speicher","speegle","sowa","smeltzer","slawson","simmonds","shuttleworth","serpa","senger","seidman","schweiger","schloss","schimmel","schechter","sayler","sabb","sabatini","ronan","rodiguez","riggleman","richins","reep","reamer","prunty","porath","plunk","piland","philbrook","pettitt","perna","peralez","pascale","padula","oboyle","nivens","nickols","murph","mundt","munden","montijo","mcmanis","mcgrane","mccrimmon","manzi","mangold","malick","mahar","maddock","losey","litten","liner","leff","leedy","leavell","ladue","krahn","kluge","junker","iversen","imler","hurtt","huizar","hubbert","howington","hollomon","holdren","hoisington","hise","heiden","hauge","hartigan","gutirrez","griffie","greenhill","gratton","granata","gottfried","gertz","gautreaux","furry","furey","funderburg","flippen","fitzgibbon","dyar","drucker","donoghue","dildy","devers","detweiler","despres","denby","degeorge","cueto","cranston","courville","clukey","cirillo","chon","chivers","caudillo","catt","butera","bulluck","buckmaster","braunstein","bracamonte","bourdeau","bonnette","bobadilla","boaz","blackledge","beshears","bernhard","bergeson","baver","barthel","balsamo","bak","aziz","awad","authement","altom","altieri","abels","zigler","zhu","younker","yeomans","yearwood","wurster","winget","whitsett","wechsler","weatherwax","wathen","warriner","wanamaker","walraven","viens","vandemark","vancamp","uchida","triana","tinoco","terpstra","tellis","tarin","taranto","takacs","studdard","struthers","strout","stiller","spataro","soderquist","sliger","silberman","shurtleff","sheetz","ritch","reif","raybon","ratzlaff","radley","putt","putney","pinette","piner","petrin","parise","osbourne","nyman","northington","noblitt","nishimura","neher","nalls","naccarato","mucha","mounce","miron","millis","meaney","mcnichols","mckinnis","mcjunkin","mcduffy","manrique","mannion","mangual","malveaux","mains","lumsden","lohmann","lipe","lightsey","lemasters","leist","laxton","laverriere","latorre","lamons","kral","kopf","knauer","kitt","kaul","karas","kamps","jusino","islam","hullinger","huges","hornung","hiser","hempel","helsel","hassinger","hargraves","hammes","hallberg","gutman","gumbs","gruver","graddy","gonsales","goncalves","glennon","gilford","geno","freshour","flippo","fifer","fason","farrish","fallin","ewert","estepp","escudero","ensminger","emberton","elms","ellerbe","eide","dysart","dougan","dierking","dicus","detrick","deroche","depue","demartino","delosreyes","dalke","culbreath","crownover","crisler","crass","corsi","chagnon","centers","cavanagh","casson","carollo","cadwallader","burnley","burciaga","burchard","broadhead","bolte","berens","bellman","bellard","baril","antonucci","wolfgram","winsor","wimbish","wier","wallach","viveros","vento","varley","vanslyke","vangorder","touchstone","tomko","tiemann","throop","tamura","talmadge","swayze","sturdevant","strauser","stolz","stenberg","stayton","spohn","spillers","spillane","sluss","slavens","simonetti","shofner","shead","senecal","seales","schueler","schley","schacht","sauve","sarno","salsbury","rothschild","rosier","rines","reveles","rein","redus","redfern","reck","ranney","raggs","prout","prill","preble","prager","plemons","pilon","piccirillo","pewitt","pesina","pecora","otani","orsini","oestreich","odea","ocallaghan","northup","niehaus","newberg","nasser","narron","monarrez","mishler","mcsherry","mcelfresh","mayon","mauer","mattice","marrone","marmolejo","marini","malm","machen","lunceford","loewen","liverman","litwin","linscott","levins","lenox","legaspi","leeman","leavy","lannon","lamson","lambdin","labarre","knouse","klemm","kleinschmidt","kirklin","keels","juliano","howser","hosier","hopwood","holyfield","hodnett","hirsh","heimann","heckel","harger","hamil","hajek","gurganus","gunning","grange","gonzalas","goggins","gerow","gaydos","garduno","ganley","galey","farner","engles","emond","emert","ellenburg","edick","duell","dorazio","dimond","diederich","depuy","dempster","demaria","dehoyos","dearth","dealba","czech","crose","crespin","cogdill","clinard","cipriano","chretien","cerny","ceniceros","celestin","caple","cacho","burrill","buhr","buckland","branam","boysen","bovee","boos","boler","blom","blasko","beyers","belz","belmonte","bednarz","beckmann","beaudin","bazile","barbeau","balentine","abrahams","zielke","yunker","yeates","wrobel","wike","whisnant","wherry","wagnon","vogan","vansant","vannest","vallo","ullery","towles","towell","thill","taormina","tannehill","taing","storrs","stickles","stetler","sparling","solt","silcox","sheard","shadle","seman","selleck","schlemmer","scher","sapien","sainz","roye","romain","rizzuto","resch","rentz","rasch","ranieri","purtell","primmer","portwood","pontius","pons","pletcher","pledger","pirkle","pillsbury","pentecost","paxson","ortez","oles","mullett","muirhead","mouzon","mork","mollett","mohn","mitcham","melillo","medders","mcmiller","mccleery","mccaughey","mak","maciejewski","macaulay","lute","lipman","lewter","larocque","langton","kriner","knipp","killeen","karn","kalish","kaczor","jonson","jerez","jarrard","janda","hymes","hollman","hollandsworth","holl","hobdy","hennen","hemmer","hagins","haddox","guitierrez","guernsey","gorsuch","gholson","genova","gazaway","gauna","gammons","freels","fonville","fetterman","fava","farquhar","farish","fabela","escoto","eisen","dossett","dority","dorfman","demmer","dehn","dawley","darbonne","damore","damm","crosley","cron","crompton","crichton","cotner","cordon","conerly","colvard","clauson","cheeseman","cavallaro","castille","cabello","burgan","buffum","bruss","brassfield","bowerman","bothwell","borgen","bonaparte","bombard","boivin","boissonneault","bogner","bodden","boan","bittinger","bickham","bedolla","bale","bainbridge","aybar","avendano","ashlock","amidon","almanzar","akridge","ackermann","zager","worrall","winans","wilsey","wightman","westrick","wenner","warne","warford","verville","utecht","upson","tuma","tseng","troncoso","trollinger","torbert","taulbee","sutterfield","stough","storch","stonebraker","stolle","stilson","stiefel","steptoe","stepney","stender","stemple","staggers","spurrier","spinney","spengler","smartt","skoog","silvis","sieg","shuford","selfridge","seguin","sedgwick","sease","scotti","schroer","schlenker","schill","savarese","sapienza","sanson","sandefur","salamone","rusnak","rudisill","rothermel","roca","resendiz","reliford","rasco","raiford","quisenberry","quijada","pullins","puccio","postell","poppe","pinter","piche","petrucci","pellegrin","pelaez","paton","pasco","parkes","paden","pabst","olmsted","newlon","mynatt","mower","morrone","moree","moffat","mixson","minner","millette","mederos","mcgahan","mcconville","maughan","massingill","marano","macri","lovern","lichtenstein","leonetti","lehner","lawley","laramie","lappin","lahti","lago","lacayo","kuester","kincade","juhl","jiron","jessop","jarosz","jain","hults","hoge","hodgins","hoban","hinkson","hillyard","herzig","hervey","henriksen","hawker","hause","hankerson","gregson","golliday","gilcrease","gessner","gerace","garwood","garst","gaillard","flinchum","fishel","fishback","filkins","fentress","fabre","ethier","eisner","ehrhart","efird","drennon","dominy","domingue","dipaolo","dinan","dimartino","deskins","dengler","defreitas","defranco","dahlin","cutshaw","cuthbert","croyle","crothers","critchfield","cowie","costner","coppedge","copes","ciccone","caufield","capo","cambron","cambridge","buser","burnes","buhl","buendia","brindley","brecht","bourgoin","blackshire","birge","benninger","bembry","beil","begaye","barrentine","banton","balmer","baity","auerbach","ambler","alexandre","ackerson","zurcher","zell","wynkoop","wallick","waid","vos","vizcaino","vester","veale","vandermark","vanderford","tuthill","trivette","thiessen","tewksbury","tao","tabron","swasey","swanigan","stoughton","stoudt","stimson","stecker","stead","spady","souther","smoak","sklar","simcox","sidwell","seybert","sesco","seeman","schwenk","schmeling","rossignol","robillard","robicheaux","riveria","rippeon","ridgley","remaley","rehkop","reddish","rauscher","quirion","pusey","pruden","pressler","potvin","pospisil","paradiso","pangburn","palmateer","ownby","otwell","osterberg","osmond","olsson","oberlander","nusbaum","novack","nokes","nicastro","nehls","naber","mulhern","motter","moretz","milian","mckeel","mcclay","mccart","matsuda","martucci","marple","marko","marciniak","manes","mancia","macrae","lybarger","lint","lineberger","levingston","lecroy","lattimer","laseter","kulick","krier","knutsen","klem","kinne","kinkade","ketterman","kerstetter","kersten","karam","joshi","jent","jefcoat","hillier","hillhouse","hettinger","henthorn","henline","helzer","heitzman","heineman","heenan","haughton","haris","harbert","haman","grinstead","gremillion","gorby","giraldo","gioia","gerardi","geraghty","gaunt","gatson","gardin","gans","gammill","friedlander","frahm","fossett","fosdick","forbush","fondren","fleckenstein","fitchett","filer","feliz","feist","ewart","esters","elsner","edgin","easterly","dussault","durazo","devereaux","deshotel","deckert","dargan","cornman","conkle","condit","claunch","clabaugh","cheesman","chea","charney","casella","carone","carbonell","canipe","campana","calles","cabezas","cabell","buttram","bustillos","buskirk","boyland","bourke","blakeley","berumen","berrier","belli","behrendt","baumbach","bartsch","baney","arambula","alldredge","allbritton","ziemba","zanders","youngquist","yoshioka","yohe","wunder","woodfin","wojtowicz","winkel","wilmore","willbanks","wesolowski","wendland","walko","votaw","vanek","uriarte","urbano","turnipseed","triche","trautman","towler","tokarz","temples","tefft","teegarden","syed","swigart","stoller","stapler","stansfield","smit","smelley","sicard","shulman","shew","shear","sheahan","sharpton","selvidge","schlesinger","savell","sandford","sabatino","rosenbloom","roepke","rish","rhames","renken","reger","quarterman","puig","prasad","poplar","pizano","pigott","phair","petrick","patt","pascua","paramore","papineau","olivieri","ogren","norden","noga","nisbet","munk","morvant","moro","moloney","merz","meltzer","mellinger","mehl","mcnealy","mckernan","mchaney","mccleskey","mcandrews","mayton","markert","maresca","maner","mandujano","malpass","macintyre","lytton","lyall","lummus","longshore","longfellow","lokey","locher","leverette","lepe","lefever","leeson","lederer","lampert","lagrone","kreider","korth","knopf","kleist","keltner","kelling","kaspar","kappler","josephs","huckins","holub","hofstetter","hoehn","higginson","hennings","heid","havel","hauer","harnden","hargreaves","hanger","guild","guidi","grate","grandy","grandstaff","goza","goodridge","goodfellow","goggans","godley","giusti","gilyard","geoghegan","galyon","gaeta","funes","font","flanary","fales","erlandson","ellett","edinger","dziedzic","duerr","draughn","donoho","dimatteo","devos","dematteo","degnan","darlington","danis","dahlstrom","dahlke","czajkowski","cumbie","culbert","crosier","croley","corry","clinger","chalker","cephas","caywood","capehart","cales","cadiz","bussiere","burriss","burkart","brundidge","bronstein","bradt","boydston","bostrom","borel","bolles","blay","blackwelder","bissett","bevers","bester","bernardino","benefiel","belote","beedle","beckles","baysinger","bassler","bartee","barlett","bargas","barefield","baptista","arterburn","armas","apperson","amoroso","amedee","zullo","zellner","yelton","willems","wilkin","wiggin","widman","welk","weingarten","walla","viers","vess","verdi","veazey","vannote","tullos","trudell","trower","trosper","trimm","trew","tousignant","topp","tocco","thoreson","terhune","tatom","suniga","sumter","steeves","stansell","soltis","sloss","slaven","shisler","shanley","servantes","selders","segrest","seese","seeber","schaible","savala","sartor","rutt","rumbaugh","ruis","roten","roessler","ritenour","riney","restivo","renard","rakestraw","rake","quiros","pullin","prudhomme","primeaux","prestridge","presswood","ponte","polzin","poarch","pittenger","piggott","pickell","phaneuf","parvin","parmley","palmeri","ozment","ormond","ordaz","ono","olea","obanion","oakman","novick","nicklas","nemec","nappi","mund","morfin","mera","melgoza","melby","mcgoldrick","mcelwain","mcchristian","mccaw","marquart","marlatt","markovich","mahr","lupton","lucus","lorusso","lerman","leddy","leaman","leachman","lavalle","laduke","kummer","koury","konopka","koh","koepp","kloss","klock","khalil","kernan","kappel","jakes","inoue","hutsell","howle","honore","hockman","hockaday","hiltz","hetherington","hesser","hershman","heffron","headen","haskett","hartline","harned","guillemette","guglielmo","guercio","greenbaum","goris","glines","gilmour","gardella","gadd","gabler","gabbert","fuselier","freudenburg","fragoso","follis","flemings","feltman","febus","farren","fallis","evert","ekstrom","eastridge","dyck","dufault","dubreuil","drapeau","domingues","dolezal","dinkel","didonato","devitt","demott","daughtrey","daubert","das","creason","crary","costilla","chipps","cheatwood","carmean","canton","caffrey","burgher","buker","brunk","brodbeck","brantner","bolivar","boerner","bodkin","biel","bencomo","bellino","beliveau","beauvais","beaupre","baylis","baskett","barcus","baltz","asay","arney","arcuri","ankney","agostini","addy","zwilling","zubia","zollinger","zeitz","yanes","winship","winningham","wickline","webre","waddington","vosburgh","verrett","varnum","vandeventer","vacca","usry","towry","touchet","tookes","tonkin","timko","tibbitts","thedford","tarleton","talty","talamantez","tafolla","sugg","strecker","steffan","spiva","slape","shatzer","seyler","seamans","schmaltz","schipper","sasso","ruppe","roudebush","riemer","richarson","revilla","reichenbach","ratley","railsback","quayle","poplin","poorman","ponton","pollitt","poitras","piscitelli","piedra","pew","perera","penwell","pelt","parkhill","paladino","ore","oram","olmo","oliveras","olivarria","ogorman","naron","muncie","mowbray","morones","moretti","monn","mitts","minks","minarik","mimms","milliron","millington","millhouse","messersmith","mcnett","mckinstry","mcgeorge","mcdill","mcateer","mazzeo","matchett","mahood","mabery","lundell","louden","losoya","lisk","lezama","leib","lebo","lanoue","lanford","lafortune","kump","krone","kreps","kott","kopecky","kolodziej","kinman","kimmons","kelty","kaster","karlson","kania","joyal","jenner","jasinski","jandreau","isenhour","hunziker","huhn","houde","houchins","holtman","hodo","heyman","hentges","hedberg","hayne","haycraft","harshbarger","harshaw","harriss","haring","hansell","hanford","handler","hamblen","gunnell","groat","gorecki","gochenour","gleeson","genest","geiser","fulghum","friese","fridley","freeborn","frailey","flaugher","fiala","ettinger","etheredge","espitia","eriksen","engelbrecht","engebretson","elie","eickhoff","edney","edelen","eberhard","eastin","eakes","driggs","doner","donaghy","disalvo","deshong","dahms","dahlquist","curren","cripe","cree","creager","corle","conatser","commons","coggin","coder","coaxum","closson","clodfelter","classen","chittenden","castilleja","casale","cartee","carriere","canup","canizales","burgoon","bunger","bugarin","buchanon","bruning","bruck","brookes","broadwell","brier","brekke","breese","bracero","bowley","bowersox","bose","bogar","blauser","blacker","bjorklund","baumer","basler","baize","baden","auman","amundsen","amore","alvarenga","adamczyk","yerkes","yerby","yamaguchi","worthey","wolk","wixom","wiersma","wieczorek","whiddon","weyer","wetherington","wein","watchman","warf","wansley","vesely","velazco","vannorman","valasquez","utz","urso","turco","turbeville","trivett","toothaker","toohey","tondreau","thaler","sylvain","swindler","swigert","swider","stiner","stever","steffes","stampley","stair","smidt","skeete","silvestre","shutts","shealey","seigler","schweizer","schuldt","schlichting","scherr","saulsberry","saner","rosin","rosato","roling","rohn","rix","rister","remley","remick","recinos","ramm","raabe","pursell","poythress","poli","pokorny","pettry","petrey","petitt","penman","payson","paquet","pappalardo","outland","orenstein","nuttall","nuckols","nott","nimmo","murtagh","mousseau","moulder","mooneyhan","moak","minch","miera","mercuri","meighan","mcnelly","mcguffin","mccreery","mcclaskey","mainor","luongo","lundstrom","loughman","lobb","linhart","lever","leu","leiter","lehoux","lehn","lares","lapan","langhorne","lamon","ladwig","ladson","kuzma","kreitzer","knop","keech","kea","kadlec","jhonson","jantz","inglis","husk","hulme","housel","hofman","hillery","heidenreich","heaps","haslett","harting","hartig","hamler","halton","hallum","gutierres","guida","guerrier","grossi","gress","greenhalgh","gravelle","gow","goslin","gonyea","gipe","gerstner","gasser","garceau","gannaway","gama","gallop","gaiser","fullilove","foutz","fossum","flannagan","farrior","faller","ericksen","entrekin","enochs","englund","ellenberger","eastland","earwood","dudash","drozd","desoto","delph","dekker","dejohn","degarmo","defeo","defalco","deblois","dacus","cudd","crossen","crooms","cronan","costin","cordray","comerford","colegrove","coldwell","claassen","chartrand","castiglione","carte","cardella","carberry","capp","capobianco","cangelosi","buch","brunell","brucker","brockett","brizendine","brinegar","brimer","brase","bosque","bonk","bolger","bohanon","bohan","blazek","berning","bergan","bennette","beauchemin","battiste","barra","balogh","avallone","aubry","ashcroft","asencio","arledge","anchondo","alvord","acheson","zaleski","yonker","wyss","wycoff","woodburn","wininger","winders","willmon","wiechmann","westley","weatherholt","warnick","wardle","warburton","volkert","villanveva","veit","vass","vanallen","tung","toribio","toothman","tiggs","thornsberry","thome","tepper","teeple","tebo","tassone","tann","stucker","stotler","stoneman","stehle","stanback","stallcup","spurr","speers","spada","solum","smolen","sinn","silvernail","sholes","shives","shain","secrest","seagle","schuette","schoch","schnieders","schild","schiavone","schiavo","scharff","santee","sandell","salvo","rollings","rivenburg","ritzman","rist","reynosa","retana","regnier","rarick","ransome","rall","propes","prall","poyner","ponds","poitra","pippins","pinion","phu","perillo","penrose","pendergraft","pelchat","patenaude","palko","odoms","oddo","novoa","noone","newburn","negri","nantz","mosser","moshier","molter","molinari","moler","millman","meurer","mendel","mcray","mcnicholas","mcnerney","mckillip","mcilvain","mcadory","marmol","marinez","manzer","mankin","makris","majeski","maffei","luoma","luman","luebke","luby","lomonaco","loar","litchford","lintz","licht","levenson","legge","lanigan","krom","kreger","koop","kober","klima","kitterman","kinkead","kimbell","kilian","kibbe","kendig","kemmer","kash","jenkin","inniss","hurlbut","hunsucker","huckabee","hoxie","hoglund","hockensmith","hoadley","hinkel","higuera","herrman","heiner","hausmann","haubrich","hassen","hanlin","hallinan","haglund","hagberg","gullo","gullion","groner","greenwalt","gobert","glowacki","glessner","gines","gildersleeve","gildea","gerke","gebhard","gatton","gately","galasso","fralick","fouse","fluharty","faucette","fairfax","evanoff","elser","ellard","egerton","ector","ebling","dunkel","duhart","drysdale","dostal","dorey","dolph","doles","dismukes","digregorio","digby","dewees","deramus","denniston","dennett","deloney","delaughter","cuneo","cumberland","crotts","crosswhite","cremeans","creasey","cottman","cothern","costales","cosner","corpus","colligan","cobble","clutter","chupp","chevez","chatmon","chaires","caplan","caffee","cabana","burrough","burditt","buckler","brunswick","brouillard","broady","bowlby","bouley","borgman","boltz","boddy","blackston","birdsell","bedgood","bate","bartos","barriga","barna","barcenas","banach","baccus","auclair","ashman","arter","arendt","ansell","allums","allender","alber","albarran","adelson","zoll","wysong","wimbley","wildes","whitis","whitehill","whicker","weymouth","weldy","wark","wareham","waddy","viveiros","vath","vandoren","vanderhoof","unrein","uecker","tsan","trepanier","tregre","torkelson","tobler","tineo","timmer","swopes","swofford","sweeten","swarts","summerfield","sumler","stucky","strozier","stigall","stickel","stennis","stelzer","steely","slayden","skillern","shurtz","shelor","shellenbarger","shand","shabazz","seo","scroggs","schwandt","schrecengost","schoenrock","schirmer","sandridge","ruzicka","rozek","rowlands","roser","rosendahl","romanowski","rolston","riggio","reichman","redondo","reay","rawlinson","raskin","raine","quandt","purpura","pruneda","prevatte","prettyman","pinedo","pierro","pidgeon","phillippi","pfeil","penix","peasley","paro","ospina","ortegon","ogata","ogara","normandin","nordman","nims","nassar","motz","morlan","mooring","moles","moir","mizrahi","mire","minaya","millwood","mikula","messmer","meikle","mctaggart","mcgonagle","mcewan","mccasland","mccane","mccaffery","mcalexander","mattocks","matranga","martone","markland","maravilla","manno","mancha","mallery","magno","lorentz","locklin","livingstone","lipford","lininger","lepley","leming","lemelin","leadbetter","lawhon","lattin","langworthy","lampman","lambeth","lamarr","lahey","krajewski","klopp","kinnison","kestner","kennell","karim","jozwiak","jakubowski","ivery","iliff","iddings","hudkins","houseman","holz","holderman","hoehne","highfill","hiett","heskett","heldt","hedman","hayslett","hatchell","hasse","hamon","hamada","hakala","haislip","haffey","hackbarth","guo","gullickson","guerrette","greenblatt","goudreau","gongora","godbout","glaude","gills","gillison","gigliotti","gargano","gallucci","galli","galante","frasure","fodor","fizer","fishburn","finkbeiner","finck","fager","estey","espiritu","eppinger","epperly","emig","eckley","dray","dorsch","dille","devita","deslauriers","demery","delorme","delbosque","dauphin","dantonio","curd","crume","cozad","cossette","comacho","climer","chadbourne","cespedes","cayton","castaldo","carpino","carls","capozzi","canela","buzard","busick","burlison","brinkmann","bridgeforth","bourbeau","bornstein","bonfiglio","boice","boese","biondi","bilski","betton","berwick","berlanga","behan","becraft","barrientez","banh","balke","balderrama","bahe","bachand","armer","arceo","aliff","alatorre","zermeno","younce","yeoman","yamasaki","wroten","woodby","winer","willits","wilcoxon","wehmeyer","waterbury","wass","wann","wachtel","vizcarra","veitch","vanderbilt","vallone","vallery","ureno","tyer","tipps","tiedeman","theberge","texeira","taub","tapscott","stutts","stults","stukes","spink","sottile","smithwick","slane","simeone","silvester","siegrist","shiffer","sheedy","sheaffer","severin","sellman","scotto","schupp","schueller","schreier","schoolcraft","schoenberger","schnabel","sangster","samford","saliba","ryles","ryans","rossetti","rodriguz","risch","riel","rezendes","rester","rencher","recker","rathjen","profitt","poteete","polizzi","perrigo","patridge","osby","orvis","opperman","oppenheim","onorato","olaughlin","ohagan","ogles","oehler","obyrne","nuzzo","nickle","nease","neagle","navarette","nagata","musto","morison","montz","mogensen","mizer","miraglia","migliore","menges","mellor","mcnear","mcnab","mcloud","mcelligott","mccollom","maynes","marquette","markowski","marcantonio","maldanado","macey","lundeen","longino","lisle","linthicum","limones","lesure","lesage","lauver","laubach","latshaw","lary","lapham","lacoste","lacher","kutcher","knickerbocker","klos","klingler","kleiman","kittleson","kimbrel","kemmerer","kelson","keese","kallas","jurgensen","junkins","juergens","jolliff","jelks","janicki","jang","ingles","huguley","huggard","howton","hone","holford","hogle","hipple","heimbach","heider","heidel","havener","hattaway","harrah","hanscom","hankinson","hamdan","gridley","goulette","goulart","goodrow","girardi","gent","gautreau","gandara","gamblin","galipeau","fyffe","furrow","fulp","fricks","frase","frandsen","fout","foulks","fouche","foskey","forgey","foor","fobbs","finklea","fincham","figueiredo","festa","ferrier","fellman","eslick","eilerman","eckart","eaglin","dunfee","dumond","drewry","douse","dimick","diener","dickert","deines","declue","daw","dattilo","danko","custodio","cuccia","crunk","crispin","corp","corea","coppin","considine","coniglio","conboy","cockrum","clute","clewis","christiano","channell","cerrato","cecere","catoe","castillon","castile","carstarphen","carmouche","caperton","buteau","bumpers","brey","brazeal","brassard","braga","bradham","bourget","borrelli","borba","boothby","bohr","bohm","boehme","bodin","bloss","blocher","bizzell","bieker","berthelot","bernardini","berends","benard","belser","baze","bartling","barrientes","barras","barcia","banfield","aurand","artman","arnott","arend","amon","almaguer","allee","albarado","alameda","abdo","zuehlke","zoeller","yokoyama","yocom","wyllie","woolum","wint","winland","wilner","wilmes","whitlatch","westervelt","walthall","walkowiak","walburn","viviano","vanderhoff","valez","ugalde","trumbull","todaro","tilford","tidd","tibbits","terranova","templeman","tannenbaum","talmage","tabarez","swearengin","swartwood","svendsen","strum","strack","storie","stockard","steinbeck","starns","stanko","stankiewicz","stacks","stach","sproles","spenser","smotherman","slusser","sinha","silber","siefert","siddiqui","shuff","sherburne","seldon","seddon","schweigert","schroeter","schmucker","saffold","rutz","rundle","rosinski","rosenow","rogalski","ridout","rhymer","replogle","raygoza","ratner","rascoe","rahm","quast","pressnell","predmore","pou","porto","pleasants","pigford","pavone","patnaude","parramore","papadopoulos","palmatier","ouzts","oshields","ortis","olmeda","olden","okamoto","norby","nitz","niebuhr","nevius","neiman","neidig","neece","murawski","mroz","moylan","moultry","mosteller","moring","morganti","mook","moffet","mettler","merlo","mengel","mendelsohn","meli","melchior","mcmeans","mcfaddin","mccullers","mccollister","mccloy","mcclaine","maury","maser","martelli","manthey","malkin","maio","magwood","maginnis","mabon","luton","lusher","lucht","lobato","levis","letellier","legendre","latson","larmon","largo","landreneau","landgraf","lamberson","kurland","kresge","korman","korando","klapper","kitson","kinyon","kincheloe","kawamoto","kawakami","jenney","jeanpierre","ivers","issa","ince","hollier","hollars","hoerner","hodgkinson","hiott","hibbitts","herlihy","henricks","heavner","hayhurst","harvill","harewood","hanselman","hanning","gustavson","grizzard","graybeal","gravley","gorney","goll","goehring","godines","gobeil","glickman","giuliano","gimbel","geib","gayhart","gatti","gains","gadberry","frei","fraise","fouch","forst","forsman","folden","fogleman","fetty","feely","fabry","eury","estill","epling","elamin","echavarria","dutil","duryea","dumais","drago","downard","douthit","doolin","dobos","dison","dinges","diebold","desilets","deshazo","depaz","degennaro","dall","cyphers","cryer","croce","crisman","credle","coriell","copp","compos","colmenero","cogar","carnevale","campanella","caley","calderone","burtch","brouwer","brehmer","brassell","brafford","bourquin","bourn","bohnert","blewett","blass","blakes","bhakta","besser","berge","bellis","balfour","avera","applin","ammon","alsop","aleshire","akbar","zoller","zapien","wymore","wyble","wolken","wix","wickstrom","whobrey","whigham","westerlund","welsch","weisser","weisner","weinstock","wehner","watlington","wakeland","wafer","victorino","veltri","veith","urich","uresti","umberger","twedt","tuohy","tschida","trumble","troia","trimmer","topps","tonn","tiernan","threet","thrall","thetford","teneyck","tartaglia","strohl","streater","strausbaugh","stradley","stonecipher","steadham","stansel","stalcup","stabile","sprenger","spradley","speier","southwood","sorrels","slezak","skow","sirmans","simental","sifford","sievert","shover","sheley","selzer","scriven","schwindt","schwan","schroth","saylors","saragosa","sant","salaam","saephan","routt","rousey","ros","rolfes","rieke","rieder","richeson","redinger","rasnick","rapoza","rambert","quist","pyron","pullman","przybylski","pridmore","pooley","pines","perkinson","perine","perham","pecor","peavler","partington","panton","oliverio","olague","ohman","ohearn","noyola","nicolai","nebel","murtha","mowrey","moroney","morgenstern","morant","monsour","moffit","mijares","meriwether","mendieta","melendrez","mejorado","mckittrick","mckey","mckenny","mckelvy","mcelvain","mccoin","mazzarella","mazon","maurin","matthies","maston","maske","marzano","marmon","marburger","mangus","mangino","mallet","luo","losada","londono","lobdell","lipson","lesniak","leighty","lei","lavallie","lareau","laperle","lape","laforce","laffey","kuehner","kravitz","kowalsky","kohr","kinsman","keppler","kennemer","keiper","kaler","jun","jelinek","jarnagin","isakson","hypes","hutzler","huls","horak","hitz","hice","herrell","henslee","heitz","heiss","heiman","hasting","hartwick","harmer","hammontree","hakes","guse","guillotte","groleau","greve","greenough","golub","golson","goldschmidt","golder","godbolt","gilmartin","gies","gibby","geren","genthner","gendreau","gemmill","gaymon","galyean","galeano","friar","folkerts","fleeman","fitzgibbons","ferranti","felan","farrand","eoff","enger","engels","ducksworth","duby","drumheller","douthitt","donis","dixion","dittrich","dials","descoteaux","depaul","denker","demuth","demelo","delacerda","deforge","danos","dalley","daigneault","cybulski","cothren","corns","corkery","copas","clubb","clore","chitty","chichester","chace","catanzaro","castonguay","cassella","carlberg","cammarata","calle","cajigas","byas","buzbee","busey","burling","bufkin","brzezinski","brun","brickner","brabham","boller","bockman","bleich","blakeman","bisbee","bier","bezanson","bevilacqua","besaw","berrian","bequette","beauford","baumgarten","baudoin","batie","basaldua","bardin","bangert","banes","backlund","avitia","artz","archey","apel","amico","alam","aden","zebrowski","yokota","wormley","wootton","womac","wiltz","wigington","whitehorn","whisman","weisgerber","weigle","weedman","watkin","wasilewski","wadlington","wadkins","viverette","vidaurri","vidales","vezina","vanleer","vanhoy","vanguilder","vanbrunt","updegraff","tylor","trinkle","touchette","tilson","tilman","tengan","tarkington","surrett","summy","streetman","straughter","steere","spruell","spadaro","solley","smathers","silvera","siems","shreffler","sholar","selden","schaper","samayoa","ruggeri","rowen","rosso","rosenbalm","roose","ronquillo","rogowski","rexford","repass","renzi","renick","rehberg","ranck","raffa","rackers","raap","puglisi","prinz","pounders","pon","pompa","plasencia","pipkins","petrosky","pelley","pauls","pauli","parkison","parisien","pangle","pancoast","palazzolo","owenby","overbay","orris","orlowski","nipp","newbern","nedd","nealon","najar","mysliwiec","myres","musson","murrieta","munsell","mumma","muldowney","moyle","mowen","morejon","moodie","monier","mikkelsen","miers","metzinger","melin","mcquay","mcpeek","mcneeley","mcglothin","mcghie","mcdonell","mccumber","mccranie","mcbean","mayhugh","marts","marenco","manges","lynam","lupien","luff","luebbert","loh","loflin","lococo","loch","lis","linke","lightle","lewellyn","leishman","lebow","lebouef","leanos","lanz","landy","landaverde","lacefield","kyler","kuebler","kropf","kroeker","kluesner","klass","kimberling","kilkenny","kiker","ketter","kelemen","keasler","kawamura","karst","kardos","igo","huseman","huseby","hurlbert","huard","hottinger","hornberger","hopps","holdsworth","hensen","heilig","heeter","harpole","haak","gutowski","gunnels","grimmer","gravatt","granderson","gotcher","gleaves","genao","garfinkel","frerichs","foushee","flanery","finnie","feldt","fagin","ewalt","ellefson","eiler","eckhart","eastep","digirolamo","didomenico","devera","delavega","defilippo","debusk","daub","damiani","cupples","crofoot","courter","coto","costigan","corning","corman","corlett","cooperman","collison","coghlan","cobbins","coady","coachman","clothier","cipolla","chmielewski","chiodo","chatterton","chappelle","chairez","ceron","casperson","casler","casados","carrow","carlino","carico","cardillo","caouette","canto","canavan","cambra","byard","buterbaugh","buse","bucy","buckwalter","bubb","bryd","brissette","brault","bradwell","boshears","borchert","blansett","biondo","biehl","bessey","belles","beeks","beekman","beaufort","bayliss","bardsley","avilla","astudillo","ardito","antunez","aderholt","abate","yowell","yin","yearby","wurst","woolverton","woolbright","wildermuth","whittenburg","whitely","wetherbee","wenz","welliver","welling","wason","warlick","voorhies","vivier","villines","verde","veiga","varghese","vanwyk","vanwingerden","vanhorne","umstead","twiggs","tusing","trego","tompson","tinkle","thoman","thole","tatman","tartt","suda","studley","strock","strawbridge","stokely","stec","stalter","speidel","spafford","sontag","sokolowski","skillman","skelley","skalski","sison","sippel","sinquefield","siegle","sher","sharrow","setliff","sellner","selig","seibold","seery","scriber","schull","schrupp","schippers","saulsbury","sao","santillo","sanor","rubalcaba","roosa","ronk","robbs","roache","riebe","reinoso","quin","preuss","pottorff","pontiff","plouffe","picou","picklesimer","pettyjohn","petti","penaloza","parmelee","pardee","palazzo","overholt","ogawa","ofarrell","nolting","noda","nickson","nevitt","neveu","navarre","murrow","munz","mulloy","monzo","milliman","metivier","merlino","mcpeters","mckissack","mckeen","mcgurk","mcfee","mcfarren","mcelwee","mceachin","mcdonagh","mccarville","mayhall","mattoon","martello","marconi","marbury","manzella","maly","malec","maitland","maheu","maclennan","lyke","luera","lowenstein","losh","lopiccolo","longacre","loman","loden","loaiza","lieber","libbey","lenhardt","lefebre","lauterbach","lauritsen","lass","larocco","larimer","lansford","lanclos","lamay","lal","kulikowski","kriebel","kosinski","kleinman","kleiner","kleckner","kistner","kissner","kissell","keisler","keeble","keaney","kale","joly","jimison","ikner","hursey","hruska","hove","hou","hosking","hoose","holle","hoeppner","hittle","hitchens","hirth","hinerman","higby","hertzog","hentz","hensler","heier","hegg","hassel","harpe","hara","hain","hagopian","grimshaw","grado","gowin","gowans","googe","goodlow","goering","gleaton","gidley","giannone","gascon","garneau","gambrel","galaz","fuentez","frisina","fresquez","fraher","feuerstein","felten","everman","ertel","erazo","ensign","endo","ellerman","eichorn","edgell","ebron","eaker","dundas","duncanson","duchene","ducan","dombroski","doman","dickison","dewoody","deloera","delahoussaye","dejean","degroat","decaro","dearmond","dashner","dales","crossett","cressey","cowger","cornette","corbo","coplin","coover","condie","cokley","ceaser","cannaday","callanan","cadle","buscher","bullion","bucklin","bruening","bruckner","brose","branan","bradway","botsford","bortz","borelli","bonetti","bolan","boerger","bloomberg","bingman","bilger","berns","beringer","beres","beets","beede","beaudet","beachum","baughn","bator","bastien","basquez","barreiro","barga","baratta","balser","baillie","axford","attebery","arakaki","annunziata","andrzejewski","ament","amendola","adcox","abril","zenon","zeitler","zambrana","ybanez","yagi","wolak","wilcoxson","whitesel","whitehair","weyand","westendorf","welke","weinmann","weesner","weekes","wedel","weatherall","warthen","vose","villalta","viator","vaz","valtierra","urbanek","tulley","trojanowski","trapani","toups","torpey","tomita","tindal","tieman","tevis","tedrow","taul","tash","tammaro","sylva","swiderski","sweeting","sund","stutler","stich","sterns","stegner","stalder","splawn","speirs","southwell","soltys","smead","slye","skipworth","sipos","simmerman","sidhu","shuffler","shingleton","shadwick","sermons","seefeldt","scipio","schwanke","schreffler","schiro","scheiber","sandoz","samsel","ruddell","royse","rouillard","rotella","rosalez","romriell","rizer","riner","rickards","rhoton","rhem","reppert","rayl","raulston","raposo","rainville","radel","quinney","purdie","pizzo","pincus","petrus","pendelton","pendarvis","peltz","peguero","peete","patricio","patchett","parrino","papke","palafox","ottley","ostby","oritz","ogan","odegaard","oatman","noell","nicoll","newhall","newbill","netzer","nettleton","neblett","murley","mungo","mulhall","mosca","morissette","morford","monsen","mitzel","miskell","minder","mehaffey","mcquillen","mclennan","mcgrail","mccreight","mayville","maysonet","maust","mathieson","mastrangelo","maskell","manz","malmberg","makela","madruga","lotts","longnecker","logston","littell","liska","lindauer","lillibridge","levron","letchworth","lesh","leffel","leday","leamon","kulas","kula","kucharski","kromer","kraatz","konieczny","konen","komar","kivett","kirts","kinnear","kersh","keithley","keifer","judah","jimenes","jeppesen","jansson","huntsberry","hund","huitt","huffine","hosford","holmstrom","hollen","hodgin","hirschman","hiltner","hilliker","hibner","hennis","helt","heidelberg","heger","heer","hartness","hardrick","halladay","gula","guillaume","guerriero","grunewald","grosse","griffeth","grenz","grassi","grandison","ginther","gimenez","gillingham","gillham","gess","gelman","gearheart","gaskell","gariepy","gamino","gallien","galentine","fuquay","froman","froelich","friedel","foos","fomby","focht","flythe","fiqueroa","filson","filip","fierros","fett","fedele","fasching","farney","fargo","everts","etzel","elzey","eichner","eger","eatman","ducker","duchesne","donati","domenech","dollard","dodrill","dinapoli","denn","delfino","delcid","delaune","delatte","deems","daluz","cusson","cullison","cuadrado","crumrine","cruickshank","crosland","croll","criddle","crepeau","coutu","couey","cort","coppinger","collman","cockburn","coca","clayborne","claflin","cissell","chowdhury","chicoine","chenier","causby","caulder","cassano","casner","cardiel","brunton","bruch","broxton","brosius","brooking","branco","bracco","bourgault","bosserman","bonet","bolds","bolander","bohman","boelter","blohm","blea","blaise","bischof","beus","bellew","bastarache","bast","bartolome","barcomb","barco","balk","balas","bakos","avey","atnip","ashbrook","arno","arbour","aquirre","appell","aldaco","alban","ahlstrom","abadie","zylstra","zick","yother","wyse","wunsch","whitty","weist","vrooman","villalon","vidrio","vavra","vasbinder","vanmatre","vandorn","ugarte","turberville","tuel","trogdon","toupin","toone","tolleson","tinkham","tinch","tiano","teston","teer","tawney","taplin","tant","tansey","swayne","sutcliffe","sunderman","strothers","stromain","stork","stoneburner","stolte","stolp","stoehr","stingley","stegman","stangl","spinella","spier","soules","sommerfield","sipp","simek","siders","shufelt","shue","shor","shires","shellenberger","sheely","sepe","seaberg","schwing","scherrer","scalzo","sasse","sarvis","santora","sansbury","salls","saleem","ryland","rybicki","ruggieri","rothenberg","rosenstein","roquemore","rollison","rodden","rivet","ridlon","riche","riccardi","reiley","regner","rech","rayo","raff","radabaugh","quon","quill","privette","prange","pickrell","perino","penning","pankratz","orlandi","nyquist","norrell","noren","naples","nale","nakashima","musselwhite","murrin","murch","mullinix","mullican","mullan","morneau","mondor","molinar","minjares","minix","minchew","milewski","mikkelson","mifflin","merkley","meis","meas","mcroy","mcphearson","mcneel","mcmunn","mcmorrow","mcdorman","mccroskey","mccoll","mcclusky","mcclaran","mccampbell","mazzariello","mauzy","mauch","mastro","martinek","marsala","marcantel","mahle","luciani","lubbers","lobel","linch","liller","legros","layden","lapine","lansberry","lage","laforest","labriola","koga","knupp","klimek","kittinger","kirchoff","kinzel","killinger","kilbourne","ketner","kepley","kemble","kells","kear","kaya","karsten","kaneshiro","kamm","joines","joachim","jacobus","iler","holgate","hoar","hisey","hird","hilyard","heslin","herzberg","hennigan","hegland","hartl","haner","handel","gualtieri","greenly","grasser","goetsch","godbold","gilland","gidney","gibney","giancola","gettinger","garzon","galle","galgano","gaier","gaertner","fuston","freel","fortes","fiorillo","figgs","fenstermacher","fedler","facer","fabiano","evins","euler","esquer","enyeart","elem","eich","edgerly","durocher","durgan","duffin","drolet","drewes","dotts","dossantos","dockins","dirksen","difiore","dierks","dickerman","dery","denault","demaree","delmonte","delcambre","daulton","darst","dahle","curnutt","cully","culligan","cueva","crosslin","croskey","cromartie","crofts","covin","coutee","coppa","coogan","condrey","concannon","coger","cloer","clatterbuck","cieslak","chumbley","choudhury","chiaramonte","charboneau","carneal","cappello","campisi","callicoat","burgoyne","bucholz","brumback","brosnan","brogden","broder","brendle","breece","bown","bou","boser","bondy","bolster","boll","bluford","blandon","biscoe","bevill","bence","battin","basel","bartram","barnaby","barmore","balbuena","badgley","backstrom","auyeung","ater","arrellano","arant","ansari","alling","alejandre","alcock","alaimo","aguinaldo","aarons","zurita","zeiger","zawacki","yutzy","yarger","wygant","wurm","wuest","witherell","wisneski","whitby","whelchel","weisz","weisinger","weishaar","wehr","waxman","waldschmidt","walck","waggener","vosburg","villela","vercher","venters","vanscyoc","vandyne","valenza","utt","urick","ungar","ulm","tumlin","tsao","tryon","trudel","treiber","tober","tipler","tillson","tiedemann","thornley","tetrault","temme","tarrance","tackitt","sykora","sweetman","swatzell","sutliff","suhr","sturtz","strub","strayhorn","stormer","steveson","stengel","steinfeldt","spiro","spieker","speth","spero","soza","souliere","soucie","snedeker","slifer","skillings","situ","siniard","simeon","signorelli","siggers","shultis","shrewsbury","shippee","shimp","shepler","sharpless","shadrick","severt","severs","semon","semmes","seiter","segers","sclafani","sciortino","schroyer","schrack","schoenberg","schober","scheidt","scheele","satter","sartori","sarratt","salvaggio","saladino","sakamoto","saine","ryman","rumley","ruggerio","rucks","roughton","robards","ricca","rexroad","resler","reny","rentschler","redrick","redick","reagle","raymo","raker","racette","pyburn","pritt","presson","pressman","pough","pisani","perz","perras","pelzer","pedrosa","palos","palmisano","paille","orem","orbison","oliveros","nourse","nordquist","newbury","nelligan","nawrocki","myler","mumaw","morphis","moldenhauer","miyashiro","mignone","mickelsen","michalec","mesta","mcree","mcqueary","mcninch","mcneilly","mclelland","mclawhorn","mcgreevy","mcconkey","mattes","maselli","marten","marcucci","manseau","manjarrez","malbrough","machin","mabie","lynde","lykes","lueras","lokken","loken","linzy","lillis","lilienthal","levey","legler","leedom","lebowitz","lazzaro","larabee","lapinski","langner","langenfeld","lampkins","lamotte","lambright","lagarde","ladouceur","labounty","lablanc","laberge","kyte","kroon","kron","kraker","kouba","kirwin","kincer","kimbler","kegler","keach","katzman","katzer","kalman","jimmerson","jenning","janus","iacovelli","hust","huson","husby","humphery","hufnagel","honig","holsey","holoman","hohl","hogge","hinderliter","hildebrant","hemby","helle","heintzelman","heidrick","hearon","hazelip","hauk","hasbrouck","harton","hartin","harpster","hansley","hanchett","haar","guthridge","gulbranson","guill","guerrera","grund","grosvenor","grist","grell","grear","granberry","gonser","giunta","giuliani","gillon","gillmore","gillan","gibbon","gettys","gelb","gano","galliher","fullen","frese","frates","foxwell","fleishman","fleener","fielden","ferrera","fells","feemster","fauntleroy","evatt","espy","eno","emmerich","edler","eastham","dunavant","duca","drinnon","dowe","dorgan","dollinger","dipalma","difranco","dietrick","denzer","demarest","delee","delariva","delany","decesare","debellis","deavers","deardorff","dawe","darosa","darley","dalzell","dahlen","curto","cupps","cunniff","cude","crivello","cripps","cresswell","cousar","cotta","compo","clyne","clayson","cearley","catania","carini","cantero","buttrey","buttler","burpee","bulkley","buitron","buda","bublitz","bryer","bryden","brouillette","brott","brookman","bronk","breshears","brennen","brannum","brandl","braman","bracewell","boyter","bomberger","bogen","boeding","blauvelt","blandford","biermann","bielecki","bibby","berthold","berkman","belvin","bellomy","beland","behne","beecham","becher","bax","bassham","barret","baley","auxier","atkison","ary","arocha","arechiga","anspach","algarin","alcott","alberty","ager","ackman","abdallah","zwick","ziemer","zastrow","zajicek","yokum","yokley","wittrock","winebarger","wilker","wilham","whitham","wetzler","westling","westbury","wendler","wellborn","weitzman","weitz","wallner","waldroup","vrabel","vowels","volker","vitiello","visconti","villicana","vibbert","vesey","vannatter","vangilder","vandervort","vandegrift","vanalstyne","vallecillo","usrey","tynan","turpen","tuller","trisler","townson","tillmon","threlkeld","thornell","terrio","taunton","tarry","tardy","swoboda","swihart","sustaita","suitt","stuber","strine","stookey","stmartin","stiger","stainbrook","solem","smail","sligh","siple","sieben","shumake","shriner","showman","sheen","sheckler","seim","secrist","scoggin","schultheis","schmalz","schendel","schacher","savard","saulter","santillanes","sandiford","sande","salzer","salvato","saltz","sakai","ryckman","ryant","ruck","rittenberry","ristau","richart","rhynes","reyer","reulet","reser","redington","reddington","rebello","reasor","raftery","rabago","raasch","quintanar","pylant","purington","provencal","prioleau","prestwood","pothier","popa","polster","politte","poffenberger","pinner","pietrzak","pettie","penaflor","pellot","pellham","paylor","payeur","papas","paik","oyola","osbourn","orzechowski","oppenheimer","olesen","oja","ohl","nuckolls","nordberg","noonkester","nold","nitta","niblett","neuhaus","nesler","nanney","myrie","mutch","mosquera","morena","montalto","montagna","mizelle","mincy","millikan","millay","miler","milbourn","mikels","migues","miesner","mershon","merrow","meigs","mealey","mcraney","mcmartin","mclachlan","mcgeehan","mcferren","mcdole","mccaulley","mcanulty","maziarz","maul","mateer","martinsen","marson","mariotti","manna","mance","malbon","magnusson","maclachlan","macek","lurie","luc","lown","loranger","lonon","lisenby","linsley","lenk","leavens","lauritzen","lathem","lashbrook","landman","lamarche","lamantia","laguerre","lagrange","kogan","klingbeil","kist","kimpel","kime","kier","kerfoot","kennamer","kellems","kammer","kamen","jepsen","jarnigan","isler","ishee","hux","hungate","hummell","hultgren","huffaker","hruby","hornick","hooser","hooley","hoggan","hirano","hilley","higham","heuser","henrickson","henegar","hellwig","hedley","hasegawa","hartt","hambright","halfacre","hafley","guion","guinan","grunwald","grothe","gries","greaney","granda","grabill","gothard","gossman","gosser","gossard","gosha","goldner","gobin","ginyard","gilkes","gilden","gerson","gephart","gengler","gautier","gassett","garon","galusha","gallager","galdamez","fulmore","fritsche","fowles","foutch","footman","fludd","ferriera","ferrero","ferreri","fenimore","fegley","fegan","fearn","farrier","fansler","fane","falzone","fairweather","etherton","elsberry","dykema","duppstadt","dunnam","dunklin","duet","dudgeon","dubuc","doxey","donmoyer","dodgen","disanto","dingler","dimattia","dilday","digennaro","diedrich","derossett","depp","demasi","degraffenreid","deakins","deady","davin","daigre","daddario","czerwinski","cullens","cubbage","cracraft","combest","coletti","coghill","claybrooks","christofferse","chiesa","chason","chamorro","celentano","cayer","carolan","carnegie","capetillo","callier","cadogan","caba","byrom","byrns","burrowes","burket","burdge","burbage","buchholtz","brunt","brungardt","brunetti","brumbelow","brugger","broadhurst","brigance","brandow","bouknight","bottorff","bottomley","bosarge","borger","bombardier","boggan","blumer","blecha","birney","birkland","betances","beran","belin","belgrave","bealer","bauch","bashir","bartow","baro","barnhouse","barile","ballweg","baisley","bains","baehr","badilla","bachus","bacher","bachelder","auzenne","aten","astle","allis","agarwal","adger","adamek","ziolkowski","zinke","zazueta","zamorano","younkin","wittig","witman","winsett","winkles","wiedman","whitner","whitcher","wetherby","westra","westhoff","wehrle","wagaman","voris","vicknair","veasley","vaugh","vanderburg","valletta","tunney","trumbo","truluck","trueman","truby","trombly","tourville","tostado","titcomb","timpson","tignor","thrush","thresher","thiede","tews","tamplin","taff","tacker","syverson","sylvestre","summerall","stumbaugh","strouth","straker","stradford","stokley","steinhoff","steinberger","spigner","soltero","snively","sletten","sinkler","sinegal","simoes","siller","sigel","shire","shinkle","shellman","sheller","sheats","sharer","selvage","sedlak","schriver","schimke","scheuerman","schanz","savory","saulters","sauers","sais","rusin","rumfelt","ruhland","rozar","rosborough","ronning","rolph","roloff","robie","rimer","riehle","ricco","rhein","retzlaff","reisman","reimann","rayes","raub","raminez","quesinberry","pua","procopio","priolo","printz","prewett","preas","prahl","poovey","ploof","platz","plaisted","pinzon","pineiro","pickney","petrovich","perl","pehrson","peets","pavon","pautz","pascarella","paras","paolini","pafford","oyer","ovellette","outten","outen","orduna","odriscoll","oberlin","nosal","niven","nisbett","nevers","nathanson","mukai","mozee","mowers","motyka","morency","montford","mollica","molden","mitten","miser","millender","midgette","messerly","melendy","meisel","meidinger","meany","mcnitt","mcnemar","mcmakin","mcgaugh","mccaa","mauriello","maudlin","matzke","mattia","matsumura","masuda","mangels","maloof","malizia","mahmoud","maglione","maddix","lucchesi","lochner","linquist","lietz","leventhal","lemanski","leiser","laury","lauber","lamberth","kuss","kulik","kuiper","krout","kotter","kort","kohlmeier","koffler","koeller","knipe","knauss","kleiber","kissee","kirst","kirch","kilgo","kerlin","kellison","kehl","kalb","jorden","jantzen","inabinet","ikard","husman","hunsberger","hundt","hucks","houtz","houseknecht","hoots","hogsett","hogans","hintze","hession","henault","hemming","helsley","heinen","heffington","heberling","heasley","hazley","hazeltine","hayton","hayse","hawke","haston","harward","harrow","hanneman","hafford","hadnot","guerro","grahm","gowins","gordillo","goosby","glatt","gibbens","ghent","gerrard","germann","gebo","gean","garling","gardenhire","garbutt","gagner","furguson","funchess","fujiwara","fujita","friley","frigo","forshee","folkes","filler","fernald","ferber","feingold","faul","farrelly","fairbank","failla","espey","eshleman","ertl","erhart","erhardt","erbe","elsea","ells","ellman","eisenhart","ehmann","earnhardt","duplantis","dulac","ducote","draves","dosch","dolce","divito","dimauro","derringer","demeo","demartini","delima","dehner","degen","defrancisco","defoor","dedeaux","debnam","cypert","cutrer","cusumano","custis","croker","courtois","costantino","cormack","corbeil","copher","conlan","conkling","cogdell","cilley","chapdelaine","cendejas","castiglia","cashin","carstensen","caprio","calcote","calaway","byfield","butner","bushway","burritt","browner","brobst","briner","bridger","brickley","brendel","bratten","bratt","brainerd","brackman","bowne","bouck","borunda","bordner","bonenfant","boer","boehmer","bodiford","bleau","blankinship","blane","blaha","bitting","bissonette","bigby","bibeau","bermudes","berke","bergevin","bergerson","bendel","belville","bechard","bearce","beadles","batz","bartlow","ayoub","avans","aumiller","arviso","arpin","arnwine","armwood","arent","arehart","arcand","antle","ambrosino","alongi","alm","allshouse","ahart","aguon","ziebarth","zeledon","zakrzewski","yuhas","yingst","yedinak","wommack","winnett","wingler","wilcoxen","whitmarsh","wayt","watley","warkentin","voll","vogelsang","voegele","vivanco","vinton","villafane","viles","ver","venne","vanwagoner","vanwagenen","vanleuven","vanauken","uselton","uren","trumbauer","tritt","treadaway","tozier","tope","tomczak","tomberlin","tomasini","tollett","toller","titsworth","tirrell","tilly","tavera","tarnowski","tanouye","swarthout","sutera","surette","styers","styer","stipe","stickland","stembridge","stearn","starkes","stanberry","stahr","spino","spicher","sperber","speece","sonntag","sneller","smalling","slowik","slocumb","sliva","slemp","slama","sitz","sisto","sisemore","sindelar","shipton","shillings","sheeley","sharber","shaddix","severns","severino","sensabaugh","seder","seawell","seamons","schrantz","schooler","scheffer","scheerer","scalia","saum","santibanez","sano","sanjuan","sampley","sailer","sabella","sabbagh","royall","rottman","rivenbark","rikard","ricketson","rickel","rethman","reily","reddin","reasoner","rast","ranallo","quintal","pung","pucci","proto","prosperie","prim","preusser","preslar","powley","postma","pinnix","pilla","pietsch","pickerel","pica","pharris","petway","petillo","perin","pereda","pennypacker","pennebaker","pedrick","patin","patchell","parodi","parman","pantano","padua","padro","osterhout","orner","olivar","ohlson","odonoghue","oceguera","oberry","novello","noguera","newquist","newcombe","neihoff","nehring","nees","nebeker","mundo","mullenix","morrisey","moronta","morillo","morefield","mongillo","molino","minto","midgley","michie","menzies","medved","mechling","mealy","mcshan","mcquaig","mcnees","mcglade","mcgarity","mcgahey","mcduff","mayweather","mastropietro","masten","maranto","maniscalco","maize","mahmood","maddocks","maday","macha","maag","luken","lopp","lolley","llanas","litz","litherland","lindenberg","lieu","letcher","lentini","lemelle","leet","lecuyer","leber","laursen","larrick","lantigua","langlinais","lalli","lafever","labat","labadie","krogman","kohut","knarr","klimas","klar","kittelson","kirschbaum","kintzel","kincannon","kimmell","killgore","kettner","kelsch","karle","kapoor","johansson","jenkinson","janney","iraheta","insley","hyslop","huckstep","holleran","hoerr","hinze","hinnenkamp","hilger","higgin","hicklin","heroux","henkle","helfer","heikkinen","heckstall","heckler","heavener","haydel","haveman","haubert","harrop","harnois","hansard","hanover","hammitt","haliburton","haefner","hadsell","haakenson","guynn","guizar","grout","grosz","gomer","golla","godby","glanz","glancy","givan","giesen","gerst","gayman","garraway","gabor","furness","frisk","fremont","frary","forand","fessenden","ferrigno","fearon","favreau","faulks","falbo","ewen","eurich","etchison","esterly","entwistle","ellingsworth","eisenbarth","edelson","eckel","earnshaw","dunneback","doyal","donnellan","dolin","dibiase","deschenes","dermody","degregorio","darnall","dant","dansereau","danaher","dammann","dames","czarnecki","cuyler","custard","cummingham","cuffie","cuffee","cudney","cuadra","crigler","creger","coughlan","corvin","cortright","corchado","connery","conforti","condron","colosimo","colclough","cohee","ciotti","chien","chacko","cevallos","cavitt","cavins","castagna","cashwell","carrozza","carrara","capra","campas","callas","caison","caggiano","bynoe","buswell","burpo","burnam","burges","buerger","buelow","bueche","bruni","brummitt","brodersen","briese","breit","brakebill","braatz","boyers","boughner","borror","borquez","bonelli","bohner","blaker","blackmer","bissette","bibbins","bhatt","bhatia","bessler","bergh","beresford","bensen","benningfield","bellantoni","behler","beehler","beazley","beauchesne","bargo","bannerman","baltes","balog","ballantyne","axelson","apgar","aoki","anstett","alejos","alcocer","albury","aichele","ackles","zerangue","zehner","zank","zacarias","youngberg","yorke","yarbro","wydra","worthley","wolbert","wittmer","witherington","wishart","winkleman","willilams","willer","wiedeman","whittingham","whitbeck","whetsel","wheless","westerberg","welcher","wegman","waterfield","wasinger","warfel","wannamaker","walborn","wada","vogl","vizcarrondo","vitela","villeda","veras","venuti","veney","ulrey","uhlig","turcios","tremper","torian","torbett","thrailkill","terrones","teitelbaum","teems","swoope","sunseri","stutes","stthomas","strohm","stroble","striegel","streicher","stodola","stinchcomb","steves","steppe","steller","staudt","starner","stamant","stam","stackpole","sprankle","speciale","spahr","sowders","sova","soluri","soderlund","slinkard","sjogren","sirianni","siewert","sickels","sica","shugart","shoults","shive","shimer","shier","shepley","sheeran","sevin","seto","segundo","sedlacek","scuderi","schurman","schuelke","scholten","schlater","schisler","schiefelbein","schalk","sanon","sabala","ruyle","ruybal","rueb","rowsey","rosol","rocheleau","rishel","rippey","ringgold","rieves","ridinger","retherford","rempe","reith","rafter","raffaele","quinto","putz","purdom","puls","pulaski","propp","principato","preiss","prada","polansky","poch","plath","pittard","pinnock","pfarr","pfannenstiel","penniman","pauling","patchen","paschke","parkey","pando","ouimet","ottman","ostlund","ormiston","occhipinti","nowacki","norred","noack","nishida","nilles","nicodemus","neth","nealey","myricks","murff","mungia","motsinger","moscato","morado","monnier","molyneux","modzelewski","miura","minich","militello","milbrandt","michalik","meserve","mendivil","melara","mcnish","mcelhannon","mccroy","mccrady","mazzella","maule","mattera","mathena","matas","mascorro","marinello","marguez","manwaring","manhart","mangano","maggi","lymon","luter","luse","lukasik","luiz","ludlum","luczak","lowenthal","lossett","lorentzen","loredo","longworth","lomanto","lisi","lish","lipsky","linck","liedtke","levering","lessman","lemond","lembo","ledonne","leatham","laufer","lanphear","langlais","lamphear","lamberton","lafon","lade","lacross","kyzer","krok","kring","krell","krehbiel","kratochvil","krach","kovar","kostka","knudtson","knaack","kliebert","klahn","kirkley","kimzey","kerrick","kennerson","keesler","karlin","janousek","imel","icenhour","hyler","hudock","houpt","holquin","holiman","holahan","hodapp","hillen","hickmon","hersom","henrich","helvey","heidt","heideman","hedstrom","hedin","hebron","hayter","harn","hardage","halsted","hahne","hagemann","guzik","guel","groesbeck","gritton","grego","graziani","grasty","graney","gouin","gossage","golston","goheen","godina","glade","giorgi","giambrone","gerrity","gerrish","gero","gerling","gaulke","garlick","galiano","gaiter","gahagan","gagnier","friddle","fredericksen","franqui","follansbee","foerster","flury","fitzmaurice","fiorini","finlayson","fiecke","fickes","fichter","ferron","farrel","fackler","eyman","escarcega","errico","erler","erby","engman","engelmann","elsass","elliston","eddleman","eadie","dummer","drost","dorrough","dorrance","doolan","donalson","domenico","ditullio","dittmar","dishon","dionisio","dike","devinney","desir","deschamp","derrickson","delamora","deitch","dechant","danek","dahmen","curci","cudjoe","croxton","creasman","craney","crader","cowling","coulston","cortina","corlew","corl","copland","convery","cohrs","clune","clausing","cipriani","cianciolo","chubb","chittum","chenard","charlesworth","charlebois","champine","chamlee","chagoya","casselman","cardello","capasso","cannella","calderwood","byford","buttars","bushee","burrage","buentello","brzozowski","bryner","brumit","brookover","bronner","bromberg","brixey","brinn","briganti","bremner","brawn","branscome","brannigan","bradsher","bozek","boulay","bormann","bongiorno","bollin","bohler","bogert","bodenhamer","blose","bivona","billips","bibler","benfer","benedetti","belue","bellanger","belford","behn","barnhardt","baltzell","balling","balducci","bainter","babineau","babich","baade","attwood","asmus","asaro","artiaga","applebaum","anding","amar","amaker","allsup","alligood","alers","agin","agar","achenbach","abramowitz","abbas","aasen","zehnder","yopp","yelle","yeldell","wynter","woodmansee","wooding","woll","winborne","willsey","willeford","widger","whiten","whitchurch","whang","weissinger","weinman","weingartner","weidler","waltrip","wagar","wafford","vitagliano","villalvazo","villacorta","vigna","vickrey","vicini","ventimiglia","vandenbosch","valvo","valazquez","utsey","urbaniak","unzueta","trombetta","trevizo","trembley","tremaine","traverso","tores","tolan","tillison","tietjen","teachout","taube","tatham","tarwater","tarbell","sydow","swims","swader","striplin","stoltenberg","steinhauer","steil","steigerwald","starkweather","stallman","squier","sparacino","spadafora","shiflet","shibata","shevlin","sherrick","sessums","servais","senters","seevers","seelye","searfoss","seabrooks","scoles","schwager","schrom","schmeltzer","scheffel","sawin","saterfiel","sardina","sanroman","sandin","salamanca","saladin","sabia","rustin","rushin","ruley","rueter","rotter","rosenzweig","rohe","roder","riter","rieth","ried","ridder","rennick","remmers","remer","relyea","reilley","reder","rasheed","rakowski","rabin","queener","pursel","prowell","pritts","presler","pouncy","porche","porcaro","pollman","pleas","planas","pinkley","pinegar","pilger","philson","petties","perrodin","pendergrast","patao","pasternak","passarelli","pasko","parshall","panos","panella","palombo","padillo","oyama","overlock","overbeck","otterson","orrell","ornellas","opitz","okelly","obando","noggle","nicosia","netto","negrin","natali","nakayama","nagao","nadel","musial","murrill","murrah","munsch","mucci","mrozek","moyes","mowrer","moris","morais","moorhouse","monico","mondy","moncayo","miltenberger","milsap","milone","millikin","milardo","micheals","micco","meyerson","mericle","mendell","meinhardt","meachum","mcleroy","mcgray","mcgonigal","maultsby","matis","matheney","matamoros","marro","marcil","marcial","mantz","mannings","maltby","malchow","maiorano","mahn","mahlum","maglio","maberry","lustig","luellen","longwell","longenecker","lofland","locascio","linney","linneman","lighty","levell","levay","lenahan","lemen","lehto","lebaron","lanctot","lamy","lainez","laffoon","labombard","kujawski","kroger","kreutzer","korhonen","kondo","kollman","kohan","kogut","knaus","kivi","kittel","kinner","kindig","kindel","kiesel","kibby","khang","kettler","ketterer","kepner","kelliher","keenum","kanode","kail","juhasz","jowett","jolicoeur","jeon","iser","ingrassia","imai","hutchcraft","humiston","hulings","hukill","huizenga","hugley","hornyak","hodder","hisle","hillenbrand","hille","higuchi","hertzler","herdon","heppner","hepp","heitmann","heckart","hazlewood","hayles","hayek","hawkin","haugland","hasler","harbuck","happel","hambly","hambleton","hagaman","guzzi","gullette","guinyard","grogg","grise","griffing","goto","gosney","goley","goldblatt","gledhill","girton","giltner","gillock","gilham","gilfillan","giblin","gentner","gehlert","gehl","garten","garney","garlow","garett","galles","galeana","futral","fuhr","friedland","franson","fransen","foulds","follmer","foland","flax","flavin","firkins","fillion","figueredo","ferrill","fenster","fenley","fauver","farfan","eustice","eppler","engelman","engelke","emmer","elzy","ellwood","ellerbee","elks","ehret","ebbert","durrah","dupras","dubuque","dragoo","donlon","dolloff","dibella","derrico","demko","demar","darrington","czapla","crooker","creagh","cranor","craner","crabill","coyer","cowman","cowherd","cottone","costillo","coster","costas","cosenza","corker","collinson","coello","clingman","clingerman","claborn","chmura","chausse","chaudhry","chapell","chancy","cerrone","caverly","caulkins","carn","campfield","campanelli","callaham","cadorette","butkovich","buske","burrier","burkley","bunyard","buckelew","buchheit","broman","brescia","brasel","boyster","booe","bonomo","bondi","bohnsack","blomberg","blanford","bilderback","biggins","bently","behrends","beegle","bedoya","bechtol","beaubien","bayerl","baumgart","baumeister","barratt","barlowe","barkman","barbagallo","baldree","baine","baggs","bacote","aylward","ashurst","arvidson","arthurs","arrieta","arrey","arreguin","arrant","arner","arizmendi","anker","amis","amend","alphin","allbright","aikin","zupan","zuchowski","zeolla","zanchez","zahradnik","zahler","younan","yeater","yearta","yarrington","yantis","woomer","wollard","wolfinger","woerner","witek","wishon","wisener","wingerter","willet","wilding","wiedemann","weisel","wedeking","waybright","wardwell","walkins","waldorf","voth","voit","virden","viloria","villagran","vasta","vashon","vaquera","vantassell","vanderlinden","vandergrift","vancuren","valenta","underdahl","tygart","twining","twiford","turlington","tullius","tubman","trowell","trieu","transue","tousant","torgersen","tooker","tome","toma","tocci","tippins","tinner","timlin","tillinghast","tidmore","teti","tedrick","tacey","swanberg","sunde","summitt","summerford","summa","stratman","strandberg","storck","stober","steitz","stayer","stauber","staiger","sponaugle","spofford","sparano","spagnola","sokoloski","snay","slough","skowronski","sieck","shimkus","sheth","sherk","shankles","shahid","sevy","senegal","seiden","seidell","searls","searight","schwalm","schug","schilke","schier","scheck","sawtelle","santore","sanks","sandquist","sanden","saling","saathoff","ryberg","rustad","ruffing","rudnicki","ruane","rozzi","rowse","rosenau","rodes","risser","riggin","riess","riese","rhoten","reinecke","reigle","reichling","redner","rebelo","raynes","raimondi","rahe","rada","querry","quellette","pulsifer","prochnow","prato","poulton","poudrier","policastro","polhemus","polasek","poissant","pohlmann","plotner","pitkin","pita","pinkett","piekarski","pichon","pfau","petroff","petermann","peplinski","peller","pecinovsky","pearse","pattillo","patague","parlier","parenti","parchman","pane","paff","ortner","oros","nolley","noakes","nigh","nicolosi","nicolay","newnam","netter","nass","napoles","nakata","nakamoto","morlock","moraga","montilla","mongeau","molitor","mohney","mitchener","meyerhoff","medel","mcniff","mcmonagle","mcglown","mcglinchey","mcgarrity","mccright","mccorvey","mcconnel","mccargo","mazzei","matula","mastroianni","massingale","maring","maricle","mans","mannon","mannix","manney","manalo","malo","malan","mahony","madril","mackowiak","macko","macintosh","lurry","luczynski","lucke","lucarelli","losee","lorence","loiacono","lohse","loder","lipari","linebarger","lindamood","limbaugh","letts","leleux","leep","leeder","leard","laxson","lawry","laverdiere","laughton","lastra","kurek","kriss","krishnan","kretschmer","krebsbach","kontos","knobel","knauf","klick","kleven","klawitter","kitchin","kirkendoll","kinkel","kingrey","kilbourn","kensinger","kennerly","kamin","justiniano","jurek","junkin","judon","jordahl","jeanes","jarrells","iwamoto","ishida","immel","iman","ihle","hyre","hurn","hunn","hultman","huffstetler","huffer","hubner","howey","hooton","holts","holscher","holen","hoggatt","hilaire","herz","henne","helstrom","hellickson","heinlein","heckathorn","heckard","headlee","hauptman","haughey","hatt","harring","harford","hammill","hamed","halperin","haig","hagwood","hagstrom","gunnells","gundlach","guardiola","greeno","greenland","gonce","goldsby","gobel","gisi","gillins","gillie","germano","geibel","gauger","garriott","garbarino","gajewski","funari","fullbright","fuell","fritzler","freshwater","freas","fortino","forbus","flohr","flemister","fisch","finks","fenstermaker","feldstein","farhat","fankhauser","fagg","fader","exline","emigh","eguia","edman","eckler","eastburn","dunmore","dubuisson","dubinsky","drayer","doverspike","doubleday","doten","dorner","dolson","dohrmann","disla","direnzo","dipaola","dines","diblasi","dewolf","desanti","dennehy","demming","delker","decola","davilla","daughtridge","darville","darland","danzy","dagenais","culotta","cruzado","crudup","croswell","coverdale","covelli","couts","corbell","coplan","coolbaugh","conyer","conlee","conigliaro","comiskey","coberly","clendening","clairmont","cienfuegos","chojnacki","chilcote","champney","cassara","casazza","casado","carew","carbin","carabajal","calcagni","cail","busbee","burts","burbridge","bunge","bundick","buhler","bucholtz","bruen","broce","brite","brignac","brierly","bridgman","braham","bradish","boyington","borjas","bonn","bonhomme","bohlen","bogardus","bockelman","blick","blackerby","bizier","biro","binney","bertolini","bertin","berti","bento","beno","belgarde","belding","beckel","becerril","bazaldua","bayes","bayard","barrus","barris","baros","bara","ballow","bakewell","baginski","badalamenti","backhaus","avilez","auvil","atteberry","ardon","anzaldua","anello","amsler","ambrosio","althouse","alles","alberti","alberson","aitchison","aguinaga","ziemann","zickefoose","zerr","zeck","zartman","zahm","zabriskie","yohn","yellowhair","yeaton","yarnall","yaple","wolski","wixon","willner","willms","whitsitt","wheelwright","weyandt","wess","wengerd","weatherholtz","wattenbarger","walrath","walpole","waldrip","voges","vinzant","viars","veres","veneziano","veillon","vawter","vaughns","vanwart","vanostrand","valiente","valderas","uhrig","tunison","tulloch","trostle","treaster","traywick","toye","tomson","tomasello","tomasek","tippit","tinajero","tift","tienda","thorington","thieme","thibeau","thakkar","tewell","telfer","sweetser","stratford","stracener","stoke","stiverson","stelling","spatz","spagnoli","sorge","slevin","slabaugh","simson","shupp","shoultz","shotts","shiroma","shetley","sherrow","sheffey","shawgo","shamburger","sester","segraves","seelig","scioneaux","schwartzkopf","schwabe","scholes","schluter","schlecht","schillaci","schildgen","schieber","schewe","schecter","scarpelli","scaglione","sautter","santelli","salmi","sabado","ryer","rydberg","ryba","rushford","runk","ruddick","rotondo","rote","rosenfield","roesner","rocchio","ritzer","rippel","rimes","riffel","richison","ribble","reynold","resh","rehn","ratti","rasor","rasnake","rappold","rando","radosevich","pulice","prichett","pribble","poynor","plowden","pitzen","pittsley","pitter","philyaw","philipps","pestana","perro","perone","pera","peil","pedone","pawlowicz","pattee","parten","parlin","pariseau","paredez","paek","pacifico","otts","ostrow","osornio","oslund","orso","ooten","onken","oniel","onan","ollison","ohlsen","ohlinger","odowd","niemiec","neubert","nembhard","neaves","neathery","nakasone","myerson","muto","muntz","munez","mumme","mumm","mujica","muise","muench","morriss","molock","mishoe","minier","metzgar","mero","meiser","meese","mcsween","mcquire","mcquinn","mcpheeters","mckeller","mcilrath","mcgown","mcdavis","mccuen","mcclenton","maxham","matsui","marriner","marlette","mansur","mancino","maland","majka","maisch","maheux","madry","madriz","mackley","macke","lydick","lutterman","luppino","lundahl","lovingood","loudon","longmore","liefer","leveque","lescarbeau","lemmer","ledgerwood","lawver","lawrie","lattea","lasko","lahman","kulpa","kukowski","kukla","kubota","kubala","krizan","kriz","krikorian","kravetz","kramp","kowaleski","knobloch","klosterman","kloster","klepper","kirven","kinnaman","kinnaird","killam","kiesling","kesner","keebler","keagle","karls","kapinos","kantner","kaba","junious","jefferys","jacquet","izzi","ishii","irion","ifill","hotard","horman","hoppes","hopkin","hokanson","hoda","hocutt","hoaglin","hites","hirai","hindle","hinch","hilty","hild","hier","hickle","hibler","henrichs","hempstead","helmers","hellard","heims","heidler","hawbaker","harkleroad","harari","hanney","hannaford","hamid","haltom","hallford","guilliams","guerette","gryder","groseclose","groen","grimley","greenidge","graffam","goucher","goodenough","goldsborough","gloster","glanton","gladson","gladding","ghee","gethers","gerstein","geesey","geddie","gayer","gaver","gauntt","gartland","garriga","garoutte","fronk","fritze","frenzel","forgione","fluitt","flinchbaugh","flach","fiorito","finan","finamore","fimbres","fillman","figeroa","ficklin","feher","feddersen","fambro","fairbairn","eves","escalona","elsey","eisenstein","ehrenberg","eargle","drane","dogan","dively","dewolfe","dettman","desiderio","desch","dennen","denk","demaris","delsignore","dejarnette","deere","dedman","daws","dauphinais","danz","dantin","dannenberg","dalby","currence","culwell","cuesta","croston","crossno","cromley","crisci","craw","coryell","condra","colpitts","colas","clink","clevinger","clermont","cistrunk","cirilo","chirico","chiarello","cephus","cecena","cavaliere","caughey","casimir","carwell","carlon","carbonaro","caraveo","cantley","callejas","cagney","cadieux","cabaniss","bushard","burlew","buras","budzinski","bucklew","bruneau","brummer","brueggemann","brotzman","bross","brittian","brimage","briles","brickman","breneman","breitenstein","brandel","brackins","boydstun","botta","bosket","boros","borgmann","bordeau","bonifacio","bolten","boehman","blundell","bloodsaw","bjerke","biffle","bickett","bickers","beville","bergren","bergey","benzing","belfiore","beirne","beckert","bebout","baumert","battey","barrs","barriere","barcelo","barbe","balliet","baham","babst","auton","asper","asbell","arzate","argento","arel","araki","arai","antley","amodeo","ammann","allensworth","aldape","akey","abeita","zweifel","zeiler","zamor","zalenski","yzaguirre","yousef","yetman","wyer","woolwine","wohlgemuth","wohlers","wittenberg","wingrove","wimsatt","willimas","wilkenson","wildey","wilderman","wilczynski","wigton","whorley","wellons","welle","weirich","weideman","weide","weast","wasmund","warshaw","walson","waldner","walch","walberg","wagener","wageman","vrieze","vossen","vorce","voorhis","vonderheide","viruet","vicari","verne","velasques","vautour","vartanian","varona","vankeuren","vandine","vandermeer","ursery","underdown","uhrich","uhlman","tworek","twine","twellman","tweedie","tutino","turmelle","tubb","trivedi","triano","trevathan","treese","treanor","treacy","traina","topham","toenjes","tippetts","tieu","thomure","thatch","tetzlaff","tetterton","teamer","tappan","talcott","tagg","szczepanski","syring","surace","sulzer","sugrue","sugarman","suess","styons","stwart","stupka","strey","straube","strate","stoddart","stockbridge","stjames","steimle","steenberg","stamand","staller","stahly","stager","spurgin","sprow","sponsler","speas","spainhour","sones","smits","smelcer","slovak","slaten","singleterry","simien","sidebottom","sibrian","shellhammer","shelburne","shambo","sepeda","seigel","scogin","scianna","schmoll","schmelzer","scheu","schachter","savant","sauseda","satcher","sandor","sampsell","rugh","rufener","rotenberry","rossow","rossbach","rollman","rodrique","rodreguez","rodkey","roda","rini","riggan","rients","riedl","rhines","ress","reinbold","raschke","rardin","racicot","quillin","pushard","primrose","pries","pressey","precourt","pratts","postel","poppell","plumer","pingree","pieroni","pflug","petre","petrarca","peterka","perkin","pergande","peranio","penna","paulhus","pasquariello","parras","parmentier","pamplin","oviatt","osterhoudt","ostendorf","osmun","ortman","orloff","orban","onofrio","olveda","oltman","okeeffe","ocana","nunemaker","novy","noffsinger","nish","niday","nethery","nemitz","neidert","nadal","nack","muszynski","munsterman","mulherin","mortimore","morter","montesino","montalvan","montalbano","momon","moman","mogan","minns","millward","milling","michelsen","mewborn","metayer","mensch","meloy","meggs","meaders","mcsorley","mcmenamin","mclead","mclauchlin","mcguffey","mcguckin","mcglaughlin","mcferron","mcentyre","mccrum","mccawley","mcbain","mayhue","matzen","matton","marsee","marrin","marland","markum","mantilla","manfre","makuch","madlock","macauley","luzier","luthy","lufkin","lucena","loudin","lothrop","lorch","loll","loadholt","lippold","lichtman","liberto","liakos","lewicki","levett","lentine","leja","legree","lawhead","lauro","lauder","lanman","lank","laning","lalor","krob","kriger","kriegel","krejci","kreisel","kozel","konkel","kolstad","koenen","kocsis","knoblock","knebel","klopfer","klee","kilday","kesten","kerbs","kempker","keathley","kazee","kaur","kamer","kamaka","kallenbach","jehle","jaycox","jardin","jahns","ivester","hyppolite","hyche","huppert","hulin","hubley","horsey","hornak","holzwarth","holmon","hollabaugh","holaway","hodes","hoak","hinesley","hillwig","hillebrand","highfield","heslop","herrada","hendryx","hellums","heit","heishman","heindel","hayslip","hayford","hastie","hartgrove","hanus","hakim","hains","hadnott","gundersen","gulino","guidroz","guebert","gressett","graydon","gramling","grahn","goupil","gorelick","goodreau","goodnough","golay","goers","glatz","gillikin","gieseke","giammarino","getman","gensler","gazda","garibaldi","gahan","funderburke","fukuda","fugitt","fuerst","fortman","forsgren","formica","flink","fitton","feltz","fekete","feit","fehrenbach","farone","farinas","faries","fagen","ewin","esquilin","esch","enderle","ellery","ellers","ekberg","egli","effinger","dymond","dulle","dula","duhe","dudney","dowless","dower","dorminey","dopp","dooling","domer","disher","dillenbeck","difilippo","dibernardo","deyoe","devillier","denley","deland","defibaugh","deeb","debow","dauer","datta","darcangelo","daoust","damelio","dahm","dahlman","curlin","cupit","culton","cuenca","cropp","croke","cremer","crace","cosio","corzine","coombe","coman","colone","coloma","collingwood","coderre","cocke","cobler","claybrook","cincotta","cimmino","christoff","chisum","chillemi","chevere","chachere","cervone","cermak","cefalu","cauble","cather","caso","carns","carcamo","carbo","capoccia","capello","capell","canino","cambareri","calvi","cabiness","bushell","burtt","burstein","burkle","bunner","bundren","buechler","bryand","bruso","brownstein","brouse","brodt","brisbin","brightman","brenes","breitenbach","brazzell","brazee","bramwell","bramhall","bradstreet","boyton","bowland","boulter","bossert","bonura","bonebrake","bonacci","boeck","blystone","birchard","bilal","biddy","bibee","bevans","bethke","bertelsen","berney","bergfeld","benware","bellon","bellah","batterton","barberio","bamber","bagdon","badeaux","averitt","augsburger","ates","arvie","aronowitz","arens","araya","angelos","andrada","amell","amante","almy","almquist","alls","aispuro","aguillon","agudelo","aceto","abalos","zdenek","zaremba","zaccaria","youssef","wrona","wrede","wotton","woolston","wolpert","wollman","wince","wimberley","willmore","willetts","wikoff","wieder","wickert","whitenack","wernick","welte","welden","weisenberger","weich","wallington","walder","vossler","vore","vigo","vierling","victorine","verdun","vencill","vazguez","vassel","vanzile","vanvliet","vantrease","vannostrand","vanderveer","vanderveen","vancil","uyeda","umphrey","uhler","uber","tutson","turrentine","tullier","tugwell","trundy","tripodi","tomer","tomasi","tomaselli","tokarski","tisher","tibbets","thweatt","tharrington","tesar","telesco","teasdale","tatem","taniguchi","suriel","sudler","stutsman","sturman","strite","strelow","streight","strawder","stransky","strahl","stours","stong","stinebaugh","stillson","steyer","stelle","steffensmeier","statham","squillante","spiess","spargo","southward","soller","soden","snuggs","snellgrove","smyers","smiddy","slonaker","skyles","skowron","sivils","siqueiros","siers","siddall","shontz","shingler","shiley","shibley","sherard","shelnutt","shedrick","shasteen","sereno","selke","scovil","scola","schuett","schuessler","schreckengost","schranz","schoepp","schneiderman","schlanger","schiele","scheuermann","schertz","scheidler","scheff","schaner","schamber","scardina","savedra","saulnier","sater","sarro","sambrano","salomone","sabourin","ruud","rutten","ruffino","ruddock","rowser","roussell","rosengarten","rominger","rollinson","rohman","roeser","rodenberg","roberds","ridgell","rhodus","reynaga","rexrode","revelle","rempel","remigio","reising","reiling","reetz","rayos","ravenscroft","ravenell","raulerson","rasmusson","rask","rase","ragon","quesnel","quashie","puzo","puterbaugh","ptak","prost","prisbrey","principe","pricer","pratte","pouncey","portman","pontious","pomerantz","planck","pilkenton","pilarski","phegley","pertuit","penta","pelc","peffer","pech","peagler","pavelka","pavao","patman","paskett","parrilla","pardini","papazian","panter","palin","paley","paetzold","packett","pacheo","ostrem","orsborn","olmedo","okamura","oiler","oglesbee","oatis","nuckles","notter","nordyke","nogueira","niswander","nibert","nesby","neloms","nading","naab","munns","mullarkey","moudy","moret","monnin","molder","modisette","moczygemba","moctezuma","mischke","miro","mings","milot","milledge","milhorn","milera","mieles","mickley","micek","metellus","mersch","merola","mercure","mencer","mellin","mell","meinke","mcquillan","mcmurtrie","mckillop","mckiernan","mckendrick","mckamie","mcilvaine","mcguffie","mcgonigle","mcgarrah","mcfetridge","mcenaney","mcdow","mccutchan","mccallie","mcadam","maycock","maybee","mattei","massi","masser","masiello","marshell","marmo","marksberry","markell","marchal","manross","manganaro","mally","mallow","mailhot","magyar","madero","madding","maddalena","macfarland","lynes","lugar","luckie","lucca","lovitt","loveridge","loux","loth","loso","lorenzana","lorance","lockley","lockamy","littler","litman","litke","liebel","lichtenberger","licea","leverich","letarte","lesesne","leno","legleiter","leffew","laurin","launius","laswell","lassen","lasala","laraway","laramore","landrith","lancon","lanahan","laiche","laford","lachermeier","kunst","kugel","kuck","kuchta","kube","korus","koppes","kolbe","koerber","kochan","knittel","kluck","kleve","kleine","kitch","kirton","kirker","kintz","kinghorn","kindell","kimrey","kilduff","kilcrease","kicklighter","kibble","kervin","keplinger","keogh","kellog","keeth","kealey","kazmierczak","karner","kamel","kalina","kaczynski","juel","jerman","jeppson","jawad","jasik","jaqua","janusz","janco","inskeep","inks","ingold","hyndman","hymer","hunte","hunkins","humber","huffstutler","huffines","hudon","hudec","hovland","houze","hout","hougland","hopf","holsapple","holness","hollenbach","hoffmeister","hitchings","hirata","hieber","hickel","hewey","herriman","hermansen","herandez","henze","heffelfinger","hedgecock","hazlitt","hazelrigg","haycock","harren","harnage","harling","harcrow","hannold","hanline","hanel","hanberry","hammersley","hamernik","hajduk","haithcock","haff","hadaway","haan","gullatt","guilbault","guidotti","gruner","grisson","grieves","granato","grabert","gover","gorka","glueck","girardin","giesler","gersten","gering","geers","gaut","gaulin","gaskamp","garbett","gallivan","galland","gaeth","fullenkamp","fullam","friedrichs","freire","freeney","fredenburg","frappier","fowkes","foree","fleurant","fleig","fleagle","fitzsimons","fischetti","fiorenza","finneran","filippi","figueras","fesler","fertig","fennel","feltmann","felps","felmlee","fannon","familia","fairall","fadden","esslinger","enfinger","elsasser","elmendorf","ellisor","einhorn","ehrman","egner","edmisten","edlund","ebinger","dyment","dykeman","durling","dunstan","dunsmore","dugal","duer","drescher","doyel","dossey","donelan","dockstader","dobyns","divis","dilks","didier","desrosier","desanto","deppe","delosh","delange","defrank","debo","dauber","dartez","daquila","dankert","dahn","cygan","cusic","curfman","croghan","croff","criger","creviston","crays","cravey","crandle","crail","crago","craghead","cousineau","couchman","cothron","corella","conine","coller","colberg","cogley","coatney","coale","clendenin","claywell","clagon","cifaldi","choiniere","chickering","chica","chennault","chavarin","chattin","chaloux","challis","cesario","cazarez","caughman","catledge","casebolt","carrel","carra","carlow","capote","canez","camillo","caliendo","calbert","bylsma","buskey","buschman","burkhard","burghardt","burgard","buonocore","bunkley","bungard","bundrick","bumbrey","buice","buffkin","brundige","brockwell","brion","briant","bredeson","bransford","brannock","brakefield","brackens","brabant","bowdoin","bouyer","bothe","boor","bonavita","bollig","blurton","blunk","blanke","blanck","birden","bierbaum","bevington","beutler","betters","bettcher","bera","benway","bengston","benesh","behar","bedsole","becenti","beachy","battersby","basta","bartmess","bartle","bartkowiak","barsky","barrio","barletta","barfoot","banegas","baldonado","azcona","avants","austell","aungst","aune","aumann","audia","atterbury","asselin","asmussen","ashline","asbill","arvizo","arnot","ariola","ardrey","angstadt","anastasio","amsden","amerman","alred","allington","alewine","alcina","alberico","ahlgren","aguas","agrawal","agosta","adolphsen","acey","aburto","abler","zwiebel","zepp","zentz","ybarbo","yarberry","yamauchi","yamashiro","wurtz","wronski","worster","wootten","wongus","woltz","wolanski","witzke","withey","wisecarver","wingham","wineinger","winegarden","windholz","wilgus","wiesen","wieck","widrick","wickliffe","whittenberg","westby","werley","wengert","wendorf","weimar","weick","weckerly","watrous","wasden","walford","wainright","wahlstrom","wadlow","vrba","voisin","vives","vivas","vitello","villescas","villavicencio","villanova","vialpando","vetrano","vensel","vassell","varano","vanriper","vankleeck","vanduyne","vanderpol","vanantwerp","valenzula","udell","turnquist","tuff","trickett","tramble","tingey","timbers","tietz","thiem","tercero","tenner","tenaglia","teaster","tarlton","taitt","tabon","sward","swaby","suydam","surita","suman","suddeth","stumbo","studivant","strobl","streich","stoodley","stoecker","stillwagon","stickle","stellmacher","stefanik","steedley","starbird","stainback","stacker","speir","spath","sommerfeld","soltani","solie","sojka","sobota","sobieski","sobczak","smullen","sleeth","slaymaker","skolnick","skoglund","sires","singler","silliman","shrock","shott","shirah","shimek","shepperd","sheffler","sheeler","sharrock","sharman","shalash","seyfried","seybold","selander","seip","seifried","sedor","sedlock","sebesta","seago","scutt","scrivens","sciacca","schultze","schoemaker","schleifer","schlagel","schlachter","schempp","scheider","scarboro","santi","sandhu","salim","saia","rylander","ryburn","rutigliano","ruocco","ruland","rudloff","rott","rosenburg","rosenbeck","romberger","romanelli","rohloff","rohlfing","rodda","rodd","ritacco","rielly","rieck","rickles","rickenbacker","respass","reisner","reineck","reighard","rehbein","rega","reddix","rawles","raver","rattler","ratledge","rathman","ramsburg","raisor","radovich","radigan","quail","puskar","purtee","priestly","prestidge","presti","pressly","pozo","pottinger","portier","porta","porcelli","poplawski","polin","poeppelman","pocock","plump","plantz","placek","piro","pinnell","pinkowski","pietz","picone","philbeck","pflum","peveto","perret","pentz","payer","patlan","paterno","papageorge","overmyer","overland","osier","orwig","orum","orosz","oquin","opie","ochsner","oathout","nygard","norville","northway","niver","nicolson","newhart","neitzel","nath","nanez","murnane","mortellaro","morreale","morino","moriarity","morgado","moorehouse","mongiello","molton","mirza","minnix","millspaugh","milby","miland","miguez","mickles","michaux","mento","melugin","melito","meinecke","mehr","meares","mcneece","mckane","mcglasson","mcgirt","mcgilvery","mcculler","mccowen","mccook","mcclintic","mccallon","mazzotta","maza","mayse","mayeda","matousek","matley","martyn","marney","marnell","marling","manuelito","maltos","malson","mahi","maffucci","macken","maass","lyttle","lynd","lyden","lukasiewicz","luebbers","lovering","loveall","longtin","lobue","loberg","lipka","lightbody","lichty","levert","lettieri","letsinger","lepak","lemmond","lembke","leitz","lasso","lasiter","lango","landsman","lamirande","lamey","laber","kuta","kulesza","krenz","kreiner","krein","kreiger","kraushaar","kottke","koser","kornreich","kopczynski","konecny","koff","koehl","kocian","knaub","kmetz","kluender","klenke","kleeman","kitzmiller","kirsh","kilman","kildow","kielbasa","ketelsen","kesinger","kehr","keef","kauzlarich","karter","kahre","jobin","jinkins","jines","jeffress","jaquith","jaillet","jablonowski","ishikawa","irey","ingerson","indelicato","huntzinger","huisman","huett","howson","houge","hosack","hora","hoobler","holtzen","holtsclaw","hollingworth","hollin","hoberg","hobaugh","hilker","hilgefort","higgenbotham","heyen","hetzler","hessel","hennessee","hendrie","hellmann","heft","heesch","haymond","haymon","haye","havlik","havis","haverland","haus","harstad","harriston","harju","hardegree","hammell","hamaker","halbrook","halberg","guptill","guntrum","gunderman","gunder","gularte","guarnieri","groll","grippo","greely","gramlich","goewey","goetzinger","goding","giraud","giefer","giberson","gennaro","gemmell","gearing","gayles","gaudin","gatz","gatts","gasca","garn","gandee","gammel","galindez","galati","gagliardo","fulop","fukushima","friedt","fretz","frenz","freeberg","fravel","fountaine","forry","forck","fonner","flippin","flewelling","flansburg","filippone","fettig","fenlon","felter","felkins","fein","favero","faulcon","farver","farless","fahnestock","facemire","faas","eyer","evett","esses","escareno","ensey","ennals","engelking","empey","ellithorpe","effler","edling","edgley","durrell","dunkerson","draheim","domina","dombrosky","doescher","dobbin","divens","dinatale","dieguez","diede","devivo","devilbiss","devaul","determan","desjardin","deshaies","delpozo","delorey","delman","delapp","delamater","deibert","degroff","debelak","dapolito","dano","dacruz","dacanay","cushenberry","cruze","crosbie","cregan","cousino","corrao","corney","cookingham","conry","collingsworth","coldren","cobian","coate","clauss","christenberry","chmiel","chauez","charters","chait","cesare","cella","caya","castenada","cashen","cantrelle","canova","campione","calixte","caicedo","byerley","buttery","burda","burchill","bulmer","bulman","buesing","buczek","buckholz","buchner","buchler","buban","bryne","brunkhorst","brumsey","brumer","brownson","brodnax","brezinski","brazile","braverman","branning","boye","boulden","bough","bossard","bosak","borth","borgmeyer","borge","blowers","blaschke","blann","blankenbaker","bisceglia","billingslea","bialek","beverlin","besecker","berquist","benigno","benavente","belizaire","beisner","behrman","beausoleil","baylon","bayley","bassi","basnett","basilio","basden","basco","banerjee","balli","bagnell","bady","averette","arzu","archambeault","arboleda","arbaugh","arata","antrim","amrhein","amerine","alpers","alfrey","alcon","albus","albertini","aguiniga","aday","acquaviva","accardi","zygmont","zych","zollner","zobel","zinck","zertuche","zaragosa","zale","zaldivar","yeadon","wykoff","woullard","wolfrum","wohlford","wison","wiseley","wisecup","winchenbach","wiltsie","whittlesey","whitelow","whiteford","wever","westrich","wertman","wensel","wenrich","weisbrod","weglarz","wedderburn","weatherhead","wease","warring","wadleigh","voltz","vise","villano","vicario","vermeulen","vazques","vasko","varughese","vangieson","vanfossen","vanepps","vanderploeg","vancleve","valerius","uyehara","unsworth","twersky","turrell","tuner","tsui","trunzo","trousdale","trentham","traughber","torgrimson","toppin","tokar","tobia","tippens","tigue","thiry","thackston","terhaar","tenny","tassin","tadeo","sweigart","sutherlin","sumrell","suen","stuhr","strzelecki","strosnider","streiff","stottlemyer","storment","storlie","stonesifer","stogsdill","stenzel","stemen","stellhorn","steidl","stecklein","statton","stangle","spratling","spoor","spight","spelman","spece","spanos","spadoni","southers","sola","sobol","smyre","slaybaugh","sizelove","sirmons","simington","silversmith","siguenza","sieren","shelman","sharples","sharif","sessler","serrata","serino","serafini","semien","selvey","seedorf","seckman","seawood","scoby","scicchitano","schorn","schommer","schnitzer","schleusner","schlabach","schiel","schepers","schaber","scally","sautner","sartwell","santerre","sandage","salvia","salvetti","salsman","sallis","salais","saeger","sabat","saar","ruther","russom","ruoff","rumery","rubottom","rozelle","rowton","routon","rotolo","rostad","roseborough","rorick","ronco","roher","roberie","robare","ritts","rison","rippe","rinke","ringwood","righter","rieser","rideaux","rickerson","renfrew","releford","reinsch","reiman","reifsteck","reidhead","redfearn","reddout","reaux","rado","radebaugh","quinby","quigg","provo","provenza","provence","pridgeon","praylow","powel","poulter","portner","pontbriand","poirrier","poirer","platero","pixler","pintor","pigman","piersall","piel","pichette","phou","pharis","phalen","petsche","perrier","penfield","pelosi","pebley","peat","pawloski","pawlik","pavlick","pavel","patz","patout","pascucci","pasch","parrinello","parekh","pantaleo","pannone","pankow","pangborn","pagani","pacelli","orsi","oriley","orduno","oommen","olivero","okada","ocon","ocheltree","oberman","nyland","noss","norling","nolton","nobile","nitti","nishimoto","nghiem","neuner","neuberger","neifert","negus","nagler","mullally","moulden","morra","morquecho","moots","mizzell","mirsky","mirabito","minardi","milholland","mikus","mijangos","michener","michalek","methvin","merrit","menter","meneely","meiers","mehring","mees","mcwhirt","mcwain","mcphatter","mcnichol","mcnaught","mclarty","mcivor","mcginness","mcgaughy","mcferrin","mcfate","mcclenny","mcclard","mccaskey","mccallion","mcamis","mathisen","marton","marsico","marchi","mani","mangione","macaraeg","lupi","lunday","lukowski","lucious","locicero","loach","littlewood","litt","lipham","linley","lindon","lightford","lieser","leyendecker","lewey","lesane","lenzi","lenart","leisinger","lehrman","lefebure","lazard","laycock","laver","launer","lastrapes","lastinger","lasker","larkey","lanser","lanphere","landey","lampton","lamark","kumm","kullman","krzeminski","krasner","koran","koning","kohls","kohen","kobel","kniffen","knick","kneip","knappenberger","klumpp","klausner","kitamura","kisling","kirshner","kinloch","kingman","kimery","kestler","kellen","keleher","keehn","kearley","kasprzak","kampf","kamerer","kalis","kahan","kaestner","kadel","kabel","junge","juckett","joynt","jorstad","jetter","jelley","jefferis","jeansonne","janecek","jaffee","izzard","istre","isherwood","ipock","iannuzzi","hypolite","humfeld","hotz","hosein","honahni","holzworth","holdridge","holdaway","holaday","hodak","hitchman","hippler","hinchey","hillin","hiler","hibdon","hevey","heth","hepfer","henneman","hemsley","hemmings","hemminger","helbert","helberg","heinze","heeren","heber","haver","hauff","haswell","harvison","hartson","harshberger","harryman","harries","hane","hamsher","haggett","hagemeier","haecker","haddon","haberkorn","guttman","guttierrez","guthmiller","guillet","guilbert","gugino","grumbles","griffy","gregerson","grana","goya","goranson","gonsoulin","goettl","goertz","godlewski","glandon","gilsdorf","gillogly","gilkison","giard","giampaolo","gheen","gettings","gesell","gershon","gaumer","gartrell","garside","garrigan","garmany","garlitz","garlington","gamet","furlough","funston","funaro","frix","frasca","francoeur","forshey","foose","flatley","flagler","fils","fillers","fickett","feth","fennelly","fencl","felch","fedrick","febres","fazekas","farnan","fairless","ewan","etsitty","enterline","elsworth","elliff","eleby","eldreth","eidem","edgecomb","edds","ebarb","dworkin","dusenberry","durrance","duropan","durfey","dungy","dundon","dumbleton","dubon","dubberly","droz","drinkwater","dressel","doughtie","doshier","dorrell","dople","doonan","donadio","dollison","doig","ditzler","dishner","discher","dimaio","digman","difalco","devino","devens","derosia","deppen","depaola","deniz","denardo","demos","demay","delgiudice","davi","danielsen","dally","dais","dahmer","cutsforth","cusimano","curington","cumbee","cryan","crusoe","crowden","crete","cressman","crapo","cowens","coupe","councill","coty","cotnoir","correira","copen","consiglio","combes","coffer","cockrill","coad","clogston","clasen","chesnutt","charrier","chadburn","cerniglia","cebula","castruita","castilla","castaldi","casebeer","casagrande","carta","carrales","carnley","cardon","capshaw","capron","cappiello","capito","canney","candela","caminiti","califano","calabria","caiazzo","cahall","buscemi","burtner","burgdorf","burdo","buffaloe","buchwald","brwon","brunke","brummond","brumm","broe","brocious","brocato","briski","brisker","brightwell","bresett","breiner","brazeau","braz","brayman","brandis","bramer","bradeen","boyko","bossi","boshart","bortle","boniello","bomgardner","bolz","bolenbaugh","bohling","bohland","bochenek","blust","bloxham","blowe","blish","blackwater","bjelland","biros","biederman","bickle","bialaszewski","bevil","beumer","bettinger","besse","bernett","bermejo","bement","belfield","beckler","baxendale","batdorf","bastin","bashore","bascombe","bartlebaugh","barsh","ballantine","bahl","badon","autin","astin","askey","ascher","arrigo","arbeiter","antes","angers","amburn","amarante","alvidrez","althaus","allmond","alfieri","aldinger","akerley","akana","aikins","ader","acebedo","accardo","abila","aberle","abele","abboud","zollars","zimmerer","zieman","zerby","zelman","zellars","yoshimura","yonts","yeats","yant","yamanaka","wyland","wuensche","worman","wordlaw","wohl","winslett","winberg","wilmeth","willcutt","wiers","wiemer","wickwire","wichman","whitting","whidbee","westergard","wemmer","wellner","weishaupt","weinert","weedon","waynick","wasielewski","waren","walworth","wallingford","walke","waechter","viviani","vitti","villagrana","vien","vicks","venema","varnes","varnadoe","varden","vanpatten","vanorden","vanderzee","vandenburg","vandehey","valls","vallarta","valderrama","valade","urman","ulery","tusa","tuft","tripoli","trimpe","trickey","tortora","torrens","torchia","toft","tjaden","tison","tindel","thurmon","thode","tardugno","tancredi","taketa","taillon","tagle","sytsma","symes","swindall","swicegood","swartout","sundstrom","sumners","sulton","studstill","stroop","stonerock","stmarie","stlawrence","stemm","steinhauser","steinert","steffensen","stefaniak","starck","stalzer","spidle","spake","sowinski","sosnowski","sorber","somma","soliday","soldner","soja","soderstrom","soder","sockwell","sobus","sloop","sinkfield","simerly","silguero","sigg","siemers","siegmund","shum","sholtis","shkreli","sheikh","shattles","sharlow","shambaugh","shaikh","serrao","serafino","selley","selle","seel","sedberry","secord","schunk","schuch","schor","scholze","schnee","schmieder","schleich","schimpf","scherf","satterthwaite","sasson","sarkisian","sarinana","sanzone","salvas","salone","salido","saiki","sahr","rusher","rusek","ruppel","rubel","rothfuss","rothenberger","rossell","rosenquist","rosebrook","romito","romines","rolan","roker","roehrig","rockhold","rocca","robuck","riss","rinaldo","riggenbach","rezentes","reuther","renolds","rench","remus","remsen","reller","relf","reitzel","reiher","rehder","redeker","ramero","rahaim","radice","quijas","qualey","purgason","prum","proudfoot","prock","probert","printup","primer","primavera","prenatt","pratico","polich","podkowka","podesta","plattner","plasse","plamondon","pittmon","pippenger","pineo","pierpont","petzold","petz","pettiway","petters","petroski","petrik","pesola","pershall","perlmutter","penepent","peevy","pechacek","peaden","pazos","pavia","pascarelli","parm","parillo","parfait","paoletti","palomba","palencia","pagaduan","oxner","overfield","overcast","oullette","ostroff","osei","omarah","olenick","olah","odem","nygren","notaro","northcott","nodine","nilges","neyman","neve","neuendorf","neisler","neault","narciso","naff","muscarella","morrisette","morphew","morein","montville","montufar","montesinos","monterroso","mongold","mojarro","moitoso","mirarchi","mirando","minogue","milici","miga","midyett","michna","meuser","messana","menzie","menz","mendicino","melone","mellish","meller","melle","meints","mechem","mealer","mcwilliam","mcwhite","mcquiggan","mcphillips","mcpartland","mcnellis","mcmackin","mclaughin","mckinny","mckeithan","mcguirk","mcgillivray","mcgarr","mcgahee","mcfaul","mcfadin","mceuen","mccullah","mcconico","mcclaren","mccaul","mccalley","mccalister","mazer","mayson","mayhan","maugeri","mauger","mattix","mattews","maslowski","masek","martir","marsch","marquess","maron","markwell","markow","marinaro","marcinek","mannella","mallen","majeed","mahnke","mahabir","magby","magallan","madere","machnik","lybrand","luque","lundholm","lueders","lucian","lubinski","lowy","loew","lippard","linson","lindblad","lightcap","levitsky","levens","leonardi","lenton","lengyel","leitzel","leicht","leaver","laubscher","lashua","larusso","larrimore","lanterman","lanni","lanasa","lamoureaux","lambros","lamborn","lamberti","lall","lafuente","laferriere","laconte","kyger","kupiec","kunzman","kuehne","kuder","kubat","krogh","kreidler","krawiec","krauth","kratky","kottwitz","korb","kono","kolman","kolesar","koeppel","knapper","klingenberg","kjos","keppel","kennan","keltz","kealoha","kasel","karney","kanne","kamrowski","kagawa","johnosn","jilek","jarvie","jarret","jansky","jacquemin","jacox","jacome","iriarte","ingwersen","imboden","iglesia","huyser","hurston","hursh","huntoon","hudman","hoying","horsman","horrigan","hornbaker","horiuchi","hopewell","hommel","homeyer","holzinger","holmer","hipsher","hinchman","hilts","higginbottom","hieb","heyne","hessling","hesler","hertlein","herford","heras","henricksen","hennemann","henery","hendershott","hemstreet","heiney","heckert","heatley","hazell","hazan","hayashida","hausler","hartsoe","harth","harriott","harriger","harpin","hardisty","hardge","hannaman","hannahs","hamp","hammersmith","hamiton","halsell","halderman","hagge","habel","gusler","gushiken","gurr","gummer","gullick","grunden","grosch","greenburg","greb","greaver","gratz","grajales","gourlay","gotto","gorley","goodpasture","godard","glorioso","gloor","glascock","gizzi","giroir","gibeault","gauldin","gauer","gartin","garrels","gamber","gallogly","gade","fusaro","fripp","freyer","freiberg","franzoni","fragale","foston","forti","forness","folts","followell","foard","flom","flett","fleitas","flamm","fino","finnen","finchum","filippelli","fickel","feucht","feiler","feenstra","feagins","faver","faulkenberry","farabaugh","fandel","faler","faivre","fairey","facey","exner","evensen","erion","erben","epting","epping","ephraim","engberg","elsen","ellingwood","eisenmann","eichman","ehle","edsall","durall","dupler","dunker","dumlao","duford","duffie","dudding","dries","doung","dorantes","donahoo","domenick","dollins","dobles","dipiazza","dimeo","diehm","dicicco","devenport","desormeaux","derrow","depaolo","demas","delpriore","delosantos","degreenia","degenhardt","defrancesco","defenbaugh","deets","debonis","deary","dazey","dargie","dambrosia","dalal","dagen","cuen","crupi","crossan","crichlow","creque","coutts","counce","coram","constante","connon","collelo","coit","cocklin","coblentz","cobey","coard","clutts","clingan","clampitt","claeys","ciulla","cimini","ciampa","christon","choat","chiou","chenail","chavous","catto","catalfamo","casterline","cassinelli","caspers","carroway","carlen","carithers","cappel","calo","callow","cagley","cafferty","byun","byam","buttner","buth","burtenshaw","burget","burfield","buresh","bunt","bultman","bulow","buchta","buchmann","brunett","bruemmer","brueggeman","britto","briney","brimhall","bribiesca","bresler","brazan","brashier","brar","brandstetter","boze","boonstra","bluitt","blomgren","blattner","blasi","bladen","bitterman","bilby","bierce","biello","bettes","bertone","berrey","bernat","berberich","benshoof","bendickson","bellefeuille","bednarski","beddingfield","beckerman","beaston","bavaro","batalla","basye","baskins","bartolotta","bartkowski","barranco","barkett","banaszak","bame","bamberger","balsley","ballas","balicki","badura","aymond","aylor","aylesworth","axley","axelrod","aubert","armond","ariza","apicella","anstine","ankrom","angevine","andreotti","alto","alspaugh","alpaugh","almada","allinder","alequin","aguillard","agron","agena","afanador","ackerley","abrev","abdalla","aaronson","zynda","zucco","zipp","zetina","zenz","zelinski","youngren","yochum","yearsley","yankey","woodfork","wohlwend","woelfel","wiste","wismer","winzer","winker","wilkison","wigger","wierenga","whipps","westray","wesch","weld","weible","wedell","weddell","wawrzyniak","wasko","washinton","wantz","walts","wallander","wain","wahlen","wachowiak","voshell","viteri","vire","villafuerte","vieyra","viau","vescio","verrier","verhey","vause","vandermolen","vanderhorst","valois","valla","valcourt","vacek","uzzle","umland","ulman","ulland","turvey","tuley","trembath","trabert","towsend","totman","toews","tisch","tisby","tierce","thivierge","tenenbaum","teagle","tacy","tabler","szewczyk","swearngin","suire","sturrock","stubbe","stronach","stoute","stoudemire","stoneberg","sterba","stejskal","steier","stehr","steckel","stearman","steakley","stanforth","stancill","srour","sprowl","spevak","sokoloff","soderman","snover","sleeman","slaubaugh","sitzman","simes","siegal","sidoti","sidler","sider","sidener","siddiqi","shireman","shima","sheroan","shadduck","seyal","sentell","sennett","senko","seligman","seipel","seekins","seabaugh","scouten","schweinsberg","schwartzberg","schurr","schult","schrick","schoening","schmitmeyer","schlicher","schlager","schack","schaar","scavuzzo","scarpa","sassano","santigo","sandavol","sampsel","samms","samet","salzano","salyards","salva","saidi","sabir","saam","runions","rundquist","rousselle","rotunno","rosch","romney","rohner","roff","rockhill","rocamora","ringle","riggie","ricklefs","rexroat","reves","reuss","repka","rentfro","reineke","recore","recalde","rease","rawling","ravencraft","ravelo","rappa","randol","ramsier","ramerez","rahimi","rahim","radney","racey","raborn","rabalais","quebedeaux","pujol","puchalski","prothro","proffit","prigge","prideaux","prevo","portales","porco","popovic","popek","popejoy","pompei","plude","platner","pizzuto","pizer","pistone","piller","pierri","piehl","pickert","piasecki","phong","philipp","peugh","pesqueira","perrett","perfetti","percell","penhollow","pelto","pellett","pavlak","paulo","pastorius","parsell","parrales","pareja","parcell","pappan","pajak","owusu","ovitt","orrick","oniell","olliff","olberding","oesterling","odwyer","ocegueda","obermiller","nylander","nulph","nottage","northam","norgard","nodal","niel","nicols","newhard","nellum","neira","nazzaro","nassif","narducci","nalbandian","musil","murga","muraoka","mumper","mulroy","mountjoy","mossey","moreton","morea","montoro","montesdeoca","montealegre","montanye","montandon","moisan","mohl","modeste","mitra","minson","minjarez","milbourne","michaelsen","metheney","mestre","mescher","mervis","mennenga","melgarejo","meisinger","meininger","mcwaters","mckern","mckendree","mchargue","mcglothlen","mcgibbon","mcgavock","mcduffee","mcclurkin","mccausland","mccardell","mccambridge","mazzoni","mayen","maxton","mawson","mauffray","mattinson","mattila","matsunaga","mascia","marse","marotz","marois","markin","markee","marcinko","marcin","manville","mantyla","manser","manry","manderscheid","mallari","malecha","malcomb","majerus","macinnis","mabey","lyford","luth","lupercio","luhman","luedke","lovick","lossing","lookabaugh","longway","loisel","logiudice","loffredo","lobaugh","lizaola","livers","littlepage","linnen","limmer","liebsch","liebman","leyden","levitan","levison","levier","leven","levalley","lettinga","lessley","lessig","lepine","leight","leick","leggio","leffingwell","leffert","lefevers","ledlow","leaton","leander","leaming","lazos","laviolette","lauffer","latz","lasorsa","lasch","larin","laporta","lanter","langstaff","landi","lamica","lambson","lambe","lamarca","laman","lamagna","lajeunesse","lafontant","lafler","labrum","laakso","kush","kuether","kuchar","kruk","kroner","kroh","kridler","kreuzer","kovats","koprowski","kohout","knicely","knell","klutts","kindrick","kiddy","khanna","ketcher","kerschner","kerfien","kensey","kenley","kenan","kemplin","kellerhouse","keesling","keas","kaplin","kanady","kampen","jutras","jungers","jeschke","janowski","janas","iskra","imperato","ikerd","igoe","hyneman","hynek","husain","hurrell","hultquist","hullett","hulen","huberty","hoyte","hossain","hornstein","hori","hopton","holms","hollmann","holdman","holdeman","holben","hoffert","himel","hillsman","herdt","hellyer","heister","heimer","heidecker","hedgpeth","hedgepath","hebel","heatwole","hayer","hausner","haskew","haselden","hartranft","harsch","harres","harps","hardimon","halm","hallee","hallahan","hackley","hackenberg","hachey","haapala","guynes","gunnerson","gunby","gulotta","gudger","groman","grignon","griebel","gregori","greenan","grauer","gourd","gorin","gorgone","gooslin","goold","goltz","goldberger","glotfelty","glassford","gladwin","giuffre","gilpatrick","gerdts","geisel","gayler","gaunce","gaulding","gateley","gassman","garson","garron","garand","gangestad","gallow","galbo","gabrielli","fullington","fucci","frum","frieden","friberg","frasco","francese","fowle","foucher","fothergill","foraker","fonder","foisy","fogal","flurry","flenniken","fitzhenry","fishbein","finton","filmore","filice","feola","felberbaum","fausnaught","fasciano","farquharson","faires","estridge","essman","enriques","emmick","ekker","ekdahl","eisman","eggleton","eddinger","eakle","eagar","durio","dunwoody","duhaime","duenes","duden","dudas","dresher","dresel","doutt","donlan","donathan","domke","dobrowolski","dingee","dimmitt","dimery","dilullo","deveaux","devalle","desper","desnoyers","desautels","derouin","derbyshire","denmon","demski","delucca","delpino","delmont","deller","dejulio","deibler","dehne","deharo","degner","defore","deerman","decuir","deckman","deasy","dease","deaner","dawdy","daughdrill","darrigo","darity","dalbey","dagenhart","daffron","curro","curnutte","curatolo","cruikshank","crosswell","croslin","croney","crofton","criado","crecelius","coscia","conniff","commodore","coltharp","colonna","collyer","collington","cobbley","coache","clonts","cloe","cliett","clemans","chrisp","chiarini","cheatam","cheadle","chand","chadd","cervera","cerulli","cerezo","cedano","cayetano","cawthorne","cavalieri","cattaneo","cartlidge","carrithers","carreira","carranco","cargle","candanoza","camburn","calender","calderin","calcagno","cahn","cadden","byham","buttry","burry","burruel","burkitt","burgio","burgener","buescher","buckalew","brymer","brumett","brugnoli","brugman","brosnahan","bronder","broeckel","broderson","brisbon","brinsfield","brinks","bresee","bregman","branner","brambila","brailsford","bouska","boster","borucki","bortner","boroughs","borgeson","bonier","bomba","bolender","boesch","boeke","bloyd","bley","binger","bilbro","biery","bichrest","bezio","bevel","berrett","bermeo","bergdoll","bercier","benzel","bentler","belnap","bellini","beitz","behrend","bednarczyk","bearse","bartolini","bartol","barretta","barbero","barbaro","banvelos","bankes","ballengee","baldon","ausmus","atilano","atienza","aschenbrenner","arora","armstong","aquilino","appleberry","applebee","apolinar","antos","andrepont","ancona","amesquita","alvino","altschuler","allin","alire","ainslie","agular","aeschliman","accetta","abdulla","abbe","zwart","zufelt","zirbel","zingaro","zilnicki","zenteno","zent","zemke","zayac","zarrella","yoshimoto","yearout","womer","woltman","wolin","wolery","woldt","witts","wittner","witherow","winward","winrow","wiemann","wichmann","whitwell","whitelaw","wheeless","whalley","wessner","wenzl","wene","weatherbee","waye","wattles","wanke","walkes","waldeck","vonruden","voisine","vogus","vittetoe","villalva","villacis","venturini","venturi","venson","vanloan","vanhooser","vanduzer","vandever","vanderwal","vanderheyden","vanbeek","vanbebber","vallance","vales","vahle","urbain","upshur","umfleet","tsuji","trybus","triolo","trimarchi","trezza","trenholm","tovey","tourigny","torry","torrain","torgeson","tomey","tischler","tinkler","tinder","ticknor","tibbles","tibbals","throneberry","thormahlen","thibert","thibeaux","theurer","templet","tegeler","tavernier","taubman","tamashiro","tallon","tallarico","taboada","sypher","sybert","swyers","switalski","swedberg","suther","surprenant","sullen","sulik","sugden","suder","suchan","strube","stroope","strittmatter","streett","straughn","strasburg","stjacques","stimage","stimac","stifter","stgelais","steinhart","stehlik","steffenson","steenbergen","stanbery","stallone","spraggs","spoto","spilman","speno","spanbauer","spalla","spagnolo","soliman","solan","sobolik","snelgrove","snedden","smale","sliter","slankard","sircy","shutter","shurtliff","shur","shirkey","shewmake","shams","shadley","shaddox","sgro","serfass","seppala","segawa","segalla","seaberry","scruton","scism","schwein","schwartzman","schwantes","schomer","schoenborn","schlottmann","schissler","scheurer","schepis","scheidegger","saunier","sauders","sassman","sannicolas","sanderfur","salser","sagar","saffer","saeed","sadberry","saban","ryce","rybak","rumore","rummell","rudasill","rozman","rota","rossin","rosell","rosel","romberg","rojero","rochin","robideau","robarge","roath","risko","ringel","ringdahl","riera","riemann","ribas","revard","renegar","reinwald","rehman","redel","raysor","rathke","rapozo","rampton","ramaker","rakow","raia","radin","raco","rackham","racca","racanelli","rabun","quaranta","purves","pundt","protsman","prezioso","presutti","presgraves","poydras","portnoy","portalatin","pontes","poehler","poblete","poat","plumadore","pleiman","pizana","piscopo","piraino","pinelli","pillai","picken","picha","piccoli","philen","petteway","petros","peskin","perugini","perrella","pernice","peper","pensinger","pembleton","passman","parrent","panetta","pallas","palka","pais","paglia","padmore","ottesen","oser","ortmann","ormand","oriol","orick","oler","okafor","ohair","obert","oberholtzer","nowland","nosek","nordeen","nolf","nogle","nobriga","nicley","niccum","newingham","neumeister","neugebauer","netherland","nerney","neiss","neis","neider","neeld","nailor","mustain","mussman","musante","murton","murden","munyon","muldrew","motton","moscoso","moschella","moroz","morelos","morace","moone","montesano","montemurro","montas","montalbo","molander","mleczko","miyake","mitschke","minger","minelli","minear","millener","mihelich","miedema","miah","metzer","mery","merrigan","merck","mennella","membreno","melecio","melder","mehling","mehler","medcalf","meche","mealing","mcqueeney","mcphaul","mcmickle","mcmeen","mcmains","mclees","mcgowin","mcfarlain","mcdivitt","mccotter","mcconn","mccaster","mcbay","mcbath","mayoral","mayeux","matsuo","masur","massman","marzette","martensen","marlett","markgraf","marcinkowski","marchbanks","mansir","mandez","mancil","malagon","magnani","madonia","madill","madia","mackiewicz","macgillivray","macdowell","mabee","lundblad","lovvorn","lovings","loreto","linz","linnell","linebaugh","lindstedt","lindbloom","limberg","liebig","lickteig","lichtenberg","licari","lewison","levario","levar","lepper","lenzen","lenderman","lemarr","leinen","leider","legrande","lefort","lebleu","leask","leacock","lazano","lawalin","laven","laplaca","lant","langsam","langone","landress","landen","lande","lamorte","lairsey","laidlaw","laffin","lackner","lacaze","labuda","labree","labella","labar","kyer","kuyper","kulinski","kulig","kuhnert","kuchera","kubicek","kruckeberg","kruchten","krider","kotch","kornfeld","koren","koogler","koll","kole","kohnke","kohli","kofoed","koelling","kluth","klump","klopfenstein","klippel","klinge","klett","klemp","kleis","klann","kitzman","kinnan","kingsberry","kilmon","killpack","kilbane","kijowski","kies","kierstead","kettering","kesselman","kennington","keniston","kehrer","kearl","keala","kassa","kasahara","kantz","kalin","kaina","jupin","juntunen","juares","joynes","jovel","joos","jiggetts","jervis","jerabek","jennison","jaso","janz","izatt","ishibashi","iannotti","hymas","huneke","hulet","hougen","horvat","horstmann","hopple","holtkamp","holsten","hohenstein","hoefle","hoback","hiney","hiemstra","herwig","herter","herriott","hermsen","herdman","herder","herbig","helling","helbig","heitkamp","heinrichs","heinecke","heileman","heffley","heavrin","heaston","haymaker","hauenstein","hartlage","harig","hardenbrook","hankin","hamiter","hagens","hagel","grizzell","griest","griese","grennan","graden","gosse","gorder","goldin","goatley","gillespi","gilbride","giel","ghoston","gershman","geisinger","gehringer","gedeon","gebert","gaxiola","gawronski","gathright","gatchell","gargiulo","garg","galang","gadison","fyock","furniss","furby","funnell","frizell","frenkel","freeburg","frankhouser","franchi","foulger","formby","forkey","fonte","folson","follette","flavell","finegan","filippini","ferencz","ference","fennessey","feggins","feehan","fazzino","fazenbaker","faunce","farraj","farnell","farler","farabee","falkowski","facio","etzler","ethington","esterline","esper","esker","erxleben","engh","emling","elridge","ellenwood","elfrink","ekhoff","eisert","eifert","eichenlaub","egnor","eggebrecht","edlin","edberg","eble","eber","easler","duwe","dutta","dutremble","dusseault","durney","dunworth","dumire","dukeman","dufner","duey","duble","dreese","dozal","douville","ditmore","distin","dimuzio","dildine","dieterich","dieckman","didonna","dhillon","dezern","devereux","devall","detty","detamore","derksen","deremer","deras","denslow","deno","denicola","denbow","demma","demille","delira","delawder","delara","delahanty","dejonge","deininger","dedios","dederick","decelles","debus","debruyn","deborde","deak","dauenhauer","darsey","dansie","dalman","dakin","dagley","czaja","cybart","cutchin","currington","curbelo","croucher","crinklaw","cremin","cratty","cranfield","crafford","cowher","couvillion","couturier","corter","coombes","contos","consolini","connaughton","conely","collom","cockett","clepper","cleavenger","claro","clarkin","ciriaco","ciesla","cichon","ciancio","cianci","chynoweth","chrzanowski","christion","cholewa","chipley","chilcott","cheyne","cheslock","chenevert","charlot","chagolla","chabolla","cesena","cerutti","cava","caul","cassone","cassin","cassese","casaus","casali","cartledge","cardamone","carcia","carbonneau","carboni","carabello","capozzoli","capella","cannata","campoverde","campeau","cambre","camberos","calvery","calnan","calmes","calley","callery","calise","cacciotti","cacciatore","butterbaugh","burgo","burgamy","burell","bunde","bumbalough","buel","buechner","buchannon","brunn","brost","broadfoot","brittan","brevard","breda","brazel","brayboy","brasier","boyea","boxx","boso","bosio","boruff","borda","bongiovanni","bolerjack","boedeker","blye","blumstein","blumenfeld","blinn","bleakley","blatter","blan","bjornson","bisignano","billick","bieniek","bhatti","bevacqua","berra","berenbaum","bensinger","bennefield","belvins","belson","bellin","beighley","beecroft","beaudreau","baynard","bautch","bausch","basch","bartleson","barthelemy","barak","balzano","balistreri","bailer","bagnall","bagg","auston","augustyn","aslinger","ashalintubbi","arjona","arebalo","appelbaum","angert","angelucci","andry","andersson","amorim","amavisca","alward","alvelo","alvear","alumbaugh","alsobrook","allgeier","allende","aldrete","akiyama","ahlquist","adolphson","addario","acoff","abelson","abasta","zulauf","zirkind","zeoli","zemlicka","zawislak","zappia","zanella","yelvington","yeatman","yanni","wragg","wissing","wischmeier","wirta","wiren","wilmouth","williard","willert","willaert","wildt","whelpley","weingart","weidenbach","weidemann","weatherman","weakland","watwood","wattley","waterson","wambach","walzer","waldow","waag","vorpahl","volkmann","vitolo","visitacion","vincelette","viggiano","vieth","vidana","vert","verges","verdejo","venzon","velardi","varian","vargus","vandermeulen","vandam","vanasse","vanaman","utzinger","uriostegui","uplinger","twiss","tumlinson","tschanz","trunnell","troung","troublefield","trojacek","treloar","tranmer","touchton","torsiello","torina","tootle","toki","toepfer","tippie","thronson","thomes","tezeno","texada","testani","tessmer","terrel","terlizzi","tempel","temblador","tayler","tawil","tasch","tames","talor","talerico","swinderman","sweetland","swager","sulser","sullens","subia","sturgell","stumpff","stufflebeam","stucki","strohmeyer","strebel","straughan","strackbein","stobaugh","stetz","stelter","steinmann","steinfeld","stecher","stanwood","stanislawski","stander","speziale","soppe","soni","sobotka","smuin","slee","skerrett","sjoberg","sittig","simonelli","simo","silverio","silveria","silsby","sillman","sienkiewicz","shomo","shoff","shoener","shiba","sherfey","shehane","sexson","setton","sergi","selvy","seiders","seegmiller","sebree","seabury","scroggin","sconyers","schwalb","schurg","schulenberg","schuld","schrage","schow","schon","schnur","schneller","schmidtke","schlatter","schieffer","schenkel","scheeler","schauwecker","schartz","schacherer","scafe","sayegh","savidge","saur","sarles","sarkissian","sarkis","sarcone","sagucio","saffell","saenger","sacher","rylee","ruvolo","ruston","ruple","rulison","ruge","ruffo","ruehl","rueckert","rudman","rudie","rubert","rozeboom","roysden","roylance","rothchild","rosse","rosecrans","rodi","rockmore","robnett","roberti","rivett","ritzel","rierson","ricotta","ricken","rezac","rendell","reitman","reindl","reeb","reddic","reddell","rebuck","reali","raso","ramthun","ramsden","rameau","ralphs","rago","racz","quinteros","quinter","quinley","quiggle","purvines","purinton","purdum","pummill","puglia","puett","ptacek","przybyla","prowse","prestwich","pracht","poutre","poucher","portera","polinsky","poage","platts","pineau","pinckard","pilson","pilling","pilkins","pili","pikes","pigram","pietila","pickron","philippi","philhower","pflueger","pfalzgraf","pettibone","pett","petrosino","persing","perrino","perotti","periera","peri","peredo","peralto","pennywell","pennel","pellegren","pella","pedroso","paulos","paulding","pates","pasek","paramo","paolino","panganiban","paneto","paluch","ozaki","ownbey","overfelt","outman","opper","onstad","oland","okuda","oertel","oelke","normandeau","nordby","nordahl","noecker","noblin","niswonger","nishioka","nett","negley","nedeau","natera","nachman","naas","musich","mungin","mourer","mounsey","mottola","mothershed","moskal","mosbey","morini","moreles","montaluo","moneypenny","monda","moench","moates","moad","missildine","misiewicz","mirabella","minott","mincks","milum","milani","mikelson","mestayer","mertes","merrihew","merlos","meritt","melnyk","medlen","meder","mcvea","mcquarrie","mcquain","mclucas","mclester","mckitrick","mckennon","mcinnes","mcgrory","mcgranahan","mcglamery","mcgivney","mcgilvray","mccuiston","mccuin","mccrystal","mccolley","mcclerkin","mcclenon","mccamey","mcaninch","mazariegos","maynez","mattioli","mastronardi","masone","marzett","marsland","margulies","margolin","malatesta","mainer","maietta","magrath","maese","madkins","madeiros","madamba","mackson","maben","lytch","lundgreen","lumb","lukach","luick","luetkemeyer","luechtefeld","ludy","ludden","luckow","lubinsky","lowes","lorenson","loran","lopinto","looby","lones","livsey","liskey","lisby","lintner","lindow","lindblom","liming","liechty","leth","lesniewski","lenig","lemonds","leisy","lehrer","lehnen","lehmkuhl","leeth","leeks","lechler","lebsock","lavere","lautenschlage","laughridge","lauderback","laudenslager","lassonde","laroque","laramee","laracuente","lapeyrouse","lampron","lamers","laino","lague","lafromboise","lafata","lacount","lachowicz","kysar","kwiecien","kuffel","kueter","kronenberg","kristensen","kristek","krings","kriesel","krey","krebbs","kreamer","krabbe","kossman","kosakowski","kosak","kopacz","konkol","koepsell","koening","koen","knerr","knapik","kluttz","klocke","klenk","klemme","klapp","kitchell","kita","kissane","kirkbride","kirchhoff","kinter","kinsel","kingsland","kimmer","kimler","killoran","kieser","khalsa","khalaf","kettel","kerekes","keplin","kentner","kennebrew","kenison","kellough","keatts","keasey","kauppi","katon","kanner","kampa","kall","kaczorowski","kaczmarski","juarbe","jordison","jobst","jezierski","jeanbart","jarquin","jagodzinski","ishak","isett","infantino","imburgia","illingworth","hysmith","hynson","hydrick","hurla","hunton","hunnell","humbertson","housand","hottle","hosch","hoos","honn","hohlt","hodel","hochmuth","hixenbaugh","hislop","hisaw","hintzen","hilgendorf","hilchey","higgens","hersman","herrara","hendrixson","hendriks","hemond","hemmingway","heminger","helgren","heisey","heilmann","hehn","hegna","heffern","hawrylak","haverty","hauger","haslem","harnett","harb","happ","hanzlik","hanway","hanby","hanan","hamric","hammaker","halas","hagenbuch","habeck","gwozdz","gunia","guadarrama","grubaugh","grivas","griffieth","grieb","grewell","gregorich","grazier","graeber","graciano","gowens","goodpaster","gondek","gohr","goffney","godbee","gitlin","gisler","gillyard","gillooly","gilchrest","gilbo","gierlach","giebler","giang","geske","gervasio","gertner","gehling","geeter","gaus","gattison","gatica","gathings","gath","gassner","gassert","garabedian","gamon","gameros","galban","gabourel","gaal","fuoco","fullenwider","fudala","friscia","franceschini","foronda","fontanilla","florey","flore","flegle","flecha","fisler","fischbach","fiorita","figura","figgins","fichera","ferra","fawley","fawbush","fausett","farnes","farago","fairclough","fahie","fabiani","evanson","eutsey","eshbaugh","ertle","eppley","englehardt","engelhard","emswiler","elling","elderkin","eland","efaw","edstrom","edgemon","ecton","echeverri","ebright","earheart","dynes","dygert","dyches","dulmage","duhn","duhamel","dubrey","dubray","dubbs","drey","drewery","dreier","dorval","dorough","dorais","donlin","donatelli","dohm","doetsch","dobek","disbrow","dinardi","dillahunty","dillahunt","diers","dier","diekmann","diangelo","deskin","deschaine","depaoli","denner","demyan","demont","demaray","delillo","deleeuw","deibel","decato","deblasio","debartolo","daubenspeck","darner","dardon","danziger","danials","damewood","dalpiaz","dallman","dallaire","cunniffe","cumpston","cumbo","cubero","cruzan","cronkhite","critelli","crimi","creegan","crean","craycraft","cranfill","coyt","courchesne","coufal","corradino","corprew","colville","cocco","coby","clinch","clickner","clavette","claggett","cirigliano","ciesielski","christain","chesbro","chavera","chard","casteneda","castanedo","casseus","caruana","carnero","cappelli","capellan","canedy","cancro","camilleri","calero","cada","burghart","burbidge","bulfer","buis","budniewski","bruney","brugh","brossard","brodmerkel","brockmann","brigmond","briere","bremmer","breck","breau","brautigam","brasch","brandenberger","bragan","bozell","bowsher","bosh","borgia","borey","boomhower","bonneville","bonam","bolland","boise","boeve","boettger","boersma","boateng","bliven","blazier","blahnik","bjornstad","bitton","biss","birkett","billingsly","biagioni","bettle","bertucci","bertolino","bermea","bergner","berber","bensley","bendixen","beltrami","bellone","belland","behringer","begum","bayona","batiz","bassin","baskette","bartolomeo","bartolo","bartholow","barkan","barish","barett","bardo","bamburg","ballerini","balla","balis","bakley","bailon","bachicha","babiarz","ayars","axton","axel","awong","awalt","auslander","ausherman","aumick","atha","atchinson","aslett","askren","arrowsmith","arras","arnhold","armagost","arey","arcos","archibeque","antunes","antilla","andras","amyx","amison","amero","alzate","alper","aller","alioto","aigner","agtarap","agbayani","adami","achorn","aceuedo","acedo","abundis","aber","abee","zuccaro","ziglar","zier","ziebell","zieba","zamzow","zahl","yurko","yurick","yonkers","yerian","yeaman","yarman","yann","yahn","yadon","yadao","woodbridge","wolske","wollenberg","wojtczak","wnuk","witherite","winther","winick","widell","wickens","whichard","wheelis","wesely","wentzell","wenthold","wemple","weisenburger","wehling","weger","weaks","wassink","walquist","wadman","wacaster","waage","voliva","vlcek","villafana","vigliotti","viger","viernes","viands","veselka","versteeg","vero","verhoeven","vendetti","velardo","vatter","vasconcellos","varn","vanwagner","vanvoorhis","vanhecke","vanduyn","vandervoort","vanderslice","valone","vallier","vails","uvalle","ursua","urenda","uphoff","tustin","turton","turnbough","turck","tullio","tuch","truehart","tropea","troester","trippe","tricarico","trevarthen","trembly","trabue","traber","tosi","toal","tinley","tingler","timoteo","tiffin","ticer","thorman","therriault","theel","tessman","tekulve","tejera","tebbs","tavernia","tarpey","tallmadge","takemoto","szot","sylvest","swindoll","swearinger","swantek","swaner","swainston","susi","surrette","sullenger","sudderth","suddarth","suckow","strege","strassburg","stoval","stotz","stoneham","stilley","stille","stierwalt","stfleur","steuck","stermer","stclaire","stano","staker","stahler","stablein","srinivasan","squillace","sprvill","sproull","sprau","sporer","spore","spittler","speelman","sparr","sparkes","spang","spagnuolo","sosinski","sorto","sorkin","sondag","sollers","socia","snarr","smrekar","smolka","slyter","slovinsky","sliwa","slavik","slatter","skiver","skeem","skala","sitzes","sitsler","sitler","sinko","simser","siegler","sideris","shrewsberry","shoopman","shoaff","shindler","shimmin","shill","shenkel","shemwell","shehorn","severa","semones","selsor","sekulski","segui","sechrest","schwer","schwebach","schur","schmiesing","schlick","schlender","schebler","schear","schapiro","sauro","saunder","sauage","satterly","saraiva","saracino","saperstein","sanmartin","sanluis","sandt","sandrock","sammet","sama","salk","sakata","saini","sackrider","russum","russi","russaw","rozzell","roza","rowlette","rothberg","rossano","rosebrock","romanski","romanik","romani","roiger","roig","roehr","rodenberger","rodela","rochford","ristow","rispoli","rigo","riesgo","riebel","ribera","ribaudo","reys","resendes","repine","reisdorf","reisch","rebman","rasmus","raske","ranum","rames","rambin","raman","rajewski","raffield","rady","radich","raatz","quinnie","pyper","puthoff","prow","proehl","pribyl","pretti","prete","presby","poyer","powelson","porteous","poquette","pooser","pollan","ploss","plewa","placide","pion","pinnick","pinales","pillot","pille","pilato","piggee","pietrowski","piermarini","pickford","piccard","phenix","pevey","petrowski","petrillose","pesek","perrotti","peppler","peppard","penfold","pellitier","pelland","pehowic","pedretti","paules","passero","pasha","panza","pallante","palau","pakele","pacetti","paavola","overy","overson","outler","osegueda","oplinger","oldenkamp","ohern","oetting","odums","nowlen","nowack","nordlund","noblett","nobbe","nierman","nichelson","niblock","newbrough","nemetz","needleman","navin","nastasi","naslund","naramore","nakken","nakanishi","najarro","mushrush","muma","mulero","morganfield","moreman","morain","moquin","monterrosa","monsivais","monroig","monje","monfort","moffa","moeckel","mobbs","misiak","mires","mirelez","mineo","mineau","milnes","mikeska","michelin","michalowski","meszaros","messineo","meshell","merten","meola","menton","mends","mende","memmott","melius","mehan","mcnickle","mcmorran","mclennon","mcleish","mclaine","mckendry","mckell","mckeighan","mcisaac","mcie","mcguinn","mcgillis","mcfatridge","mcfarling","mcelravy","mcdonalds","mcculla","mcconnaughy","mcconnaughey","mcchriston","mcbeath","mayr","matyas","matthiesen","matsuura","matinez","mathys","matarazzo","masker","masden","mascio","martis","marrinan","marinucci","margerum","marengo","manthe","mansker","manoogian","mankey","manigo","manier","mangini","maltese","malsam","mallo","maliszewski","mainolfi","maharaj","maggart","magar","maffett","macmaster","macky","macdonnell","lyvers","luzzi","lutman","lovan","lonzo","longerbeam","lofthouse","loethen","lodi","llorens","lizama","litscher","lisowski","lipski","lipsett","lipkin","linzey","lineman","limerick","limas","lige","lierman","liebold","liberti","leverton","levene","lesueur","lenser","lenker","legnon","lefrancois","ledwell","lavecchia","laurich","lauricella","lannigan","landor","lamprecht","lamountain","lamore","lammert","lamboy","lamarque","lamacchia","lalley","lagace","lacorte","lacomb","kyllonen","kyker","kuschel","kupfer","kunde","kucinski","kubacki","kroenke","krech","koziel","kovacich","kothari","koth","kotek","kostelnik","kosloski","knoles","knabe","kmiecik","klingman","kliethermes","kleffman","klees","klaiber","kittell","kissling","kisinger","kintner","kinoshita","kiener","khouri","kerman","kelii","keirn","keezer","kaup","kathan","kaser","karlsen","kapur","kandoll","kammel","kahele","justesen","jonason","johnsrud","joerling","jochim","jespersen","jeong","jenness","jedlicka","jakob","isaman","inghram","ingenito","iadarola","hynd","huxtable","huwe","hurless","humpal","hughston","hughart","huggett","hugar","huether","howdyshell","houtchens","houseworth","hoskie","holshouser","holmen","holloran","hohler","hoefler","hodsdon","hochman","hjort","hippert","hippe","hinzman","hillock","hilden","heyn","heyden","heyd","hergert","henrikson","henningsen","hendel","helget","helf","helbing","heintzman","heggie","hege","hecox","heatherington","heare","haxton","haverstock","haverly","hatler","haselton","hase","hartzfeld","harten","harken","hargrow","haran","hanton","hammar","hamamoto","halper","halko","hackathorn","haberle","haake","gunnoe","gunkel","gulyas","guiney","guilbeau","guider","guerrant","gudgel","guarisco","grossen","grossberg","gropp","groome","grobe","gremminger","greenley","grauberger","grabenstein","gowers","gostomski","gosier","goodenow","gonzoles","goliday","goettle","goens","goates","glymph","glavin","glassco","gladfelter","glackin","githens","girgis","gimpel","gilbreth","gilbeau","giffen","giannotti","gholar","gervasi","gertsch","gernatt","gephardt","genco","gehr","geddis","gase","garrott","garrette","gapinski","ganter","ganser","gangi","gangemi","gallina","galdi","gailes","gaetano","gadomski","gaccione","fuschetto","furtick","furfaro","fullman","frutos","fruchter","frogge","freytag","freudenthal","fregoe","franzone","frankum","francia","franceschi","forys","forero","folkers","flug","flitter","flemons","fitzer","firpo","finizio","filiault","figg","fichtner","fetterolf","ferringer","feil","fayne","farro","faddis","ezzo","ezelle","eynon","evitt","eutsler","euell","escovedo","erne","eriksson","enriguez","empson","elkington","eisenmenger","eidt","eichenberger","ehrmann","ediger","earlywine","eacret","duzan","dunnington","ducasse","dubiel","drovin","drager","drage","donham","donat","dolinger","dokken","doepke","dodwell","docherty","distasio","disandro","diniz","digangi","didion","dezzutti","detmer","deshon","derrigo","dentler","demoura","demeter","demeritt","demayo","demark","demario","delzell","delnero","delgrosso","dejarnett","debernardi","dearmas","dashnaw","daris","danks","danker","dangler","daignault","dafoe","dace","curet","cumberledge","culkin","crowner","crocket","crawshaw","craun","cranshaw","cragle","courser","costella","cornforth","corkill","coopersmith","conzemius","connett","connely","condict","condello","comley","cohoon","coday","clugston","clowney","clippard","clinkenbeard","clines","clelland","clapham","clancey","clabough","cichy","cicalese","chua","chittick","chisom","chisley","chinchilla","cheramie","cerritos","cercone","cena","cawood","cavness","catanzarite","casada","carvell","carmicheal","carll","cardozo","caplin","candia","canby","cammon","callister","calligan","calkin","caillouet","buzzelli","bute","bustillo","bursey","burgeson","bupp","bulson","buist","buffey","buczkowski","buckbee","bucio","brueckner","broz","brookhart","brong","brockmeyer","broberg","brittenham","brisbois","bridgmon","breyer","brede","breakfield","breakey","brauner","branigan","brandewie","branche","brager","brader","bovell","bouthot","bostock","bosma","boseman","boschee","borthwick","borneman","borer","borek","boomershine","boni","bommarito","bolman","boleware","boisse","boehlke","bodle","blash","blasco","blakesley","blacklock","blackley","bittick","birks","birdin","bircher","bilbao","bick","biby","bertoni","bertino","bertini","berson","bern","berkebile","bergstresser","benne","benevento","belzer","beltre","bellomo","bellerose","beilke","begeman","bebee","beazer","beaven","beamish","baymon","baston","bastidas","basom","basey","bartles","baroni","barocio","barnet","barclift","banville","balthazor","balleza","balkcom","baires","bailie","baik","baggott","bagen","bachner","babington","babel","asmar","arvelo","artega","arrendondo","arreaga","arrambide","arquette","aronoff","arico","argentieri","arevalos","archbold","apuzzo","antczak","ankeny","angelle","angelini","anfinson","amer","amarillas","altier","altenburg","alspach","alosa","allsbrook","alexopoulos","aleem","aldred","albertsen","akerson","agler","adley","addams","acoba","achille","abplanalp","abella","abare","zwolinski","zollicoffer","zins","ziff","zenner","zender","zelnick","zelenka","zeches","zaucha","zauala","zangari","zagorski","youtsey","yasso","yarde","yarbough","woolever","woodsmall","woodfolk","wobig","wixson","wittwer","wirtanen","winson","wingerd","wilkening","wilhelms","wierzbicki","wiechman","weyrick","wessell","wenrick","wenning","weltz","weinrich","weiand","wehunt","wareing","walth","waibel","wahlquist","vona","voelkel","vitek","vinsant","vincente","vilar","viel","vicars","vermette","verma","venner","veazie","vayda","vashaw","varon","vardeman","vandevelde","vanbrocklin","vaccarezza","urquidez","urie","urbach","uram","ungaro","umali","ulsh","tutwiler","turnbaugh","tumminello","tuite","tueller","trulove","troha","trivino","trisdale","trippett","tribbett","treptow","tremain","travelstead","trautwein","trautmann","tram","traeger","tonelli","tomsic","tomich","tomasulo","tomasino","tole","todhunter","toborg","tischer","tirpak","tircuit","tinnon","tinnel","tines","timbs","tilden","tiede","thumm","throgmorton","thorndike","thornburgh","thoren","thomann","therrell","thau","thammavong","tetrick","tessitore","tesreau","teicher","teaford","tauscher","tauer","tanabe","talamo","takeuchi","taite","tadych","sweeton","swecker","swartzentrube","swarner","surrell","surbaugh","suppa","sumbry","suchy","stuteville","studt","stromer","strome","streng","stonestreet","stockley","stmichel","stfort","sternisha","stensrud","steinhardt","steinback","steichen","stauble","stasiak","starzyk","stango","standerfer","stachowiak","springston","spratlin","spracklen","sponseller","spilker","spiegelman","spellacy","speiser","spaziani","spader","spackman","sorum","sopha","sollis","sollenberger","solivan","solheim","sokolsky","sogge","smyser","smitley","sloas","slinker","skora","skiff","skare","siverd","sivels","siska","siordia","simmering","simko","sime","silmon","silano","sieger","siebold","shukla","shreves","shoun","shortle","shonkwiler","shoals","shimmel","shiel","shieh","sherbondy","shenkman","shein","shearon","shean","shatz","shanholtz","shafran","shaff","shackett","sgroi","sewall","severy","sethi","sessa","sequra","sepulvado","seper","senteno","sendejo","semmens","seipp","segler","seegers","sedwick","sedore","sechler","sebastiano","scovel","scotton","scopel","schwend","schwarting","schutter","schrier","schons","scholtes","schnetzer","schnelle","schmutz","schlichter","schelling","schams","schamp","scarber","scallan","scalisi","scaffidi","saxby","sawrey","sauvageau","sauder","sarrett","sanzo","santizo","santella","santander","sandez","sandel","sammon","salsedo","salge","sagun","safi","sader","sacchetti","sablan","saade","runnion","runkel","rumbo","ruesch","ruegg","ruckle","ruchti","rubens","rubano","rozycki","roupe","roufs","rossel","rosmarin","rosero","rosenwald","ronca","romos","rolla","rohling","rohleder","roell","roehm","rochefort","roch","robotham","rivenburgh","riopel","riederer","ridlen","rias","rhudy","reynard","retter","respess","reppond","repko","rengifo","reinking","reichelt","reeh","redenius","rebolledo","rauh","ratajczak","rapley","ranalli","ramie","raitt","radloff","radle","rabbitt","quay","quant","pusateri","puffinberger","puerta","provencio","proano","privitera","prenger","prellwitz","pousson","potier","portz","portlock","porth","portela","portee","porchia","pollick","polinski","polfer","polanski","polachek","pluta","plourd","plauche","pitner","piontkowski","pileggi","pierotti","pico","piacente","phinisee","phaup","pfost","pettinger","pettet","petrich","peto","persley","persad","perlstein","perko","pere","penders","peifer","peco","pawley","pash","parrack","parady","papen","pangilinan","pandolfo","palone","palmertree","padin","ottey","ottem","ostroski","ornstein","ormonde","onstott","oncale","oltremari","olcott","olan","oishi","oien","odonell","odonald","obeso","obeirne","oatley","nusser","novo","novicki","nitschke","nistler","nikkel","niese","nierenberg","nield","niedzwiecki","niebla","niebel","nicklin","neyhart","newsum","nevares","nageotte","nagai","mutz","murata","muralles","munnerlyn","mumpower","muegge","muckle","muchmore","moulthrop","motl","moskos","mortland","morring","mormile","morimoto","morikawa","morgon","mordecai","montour","mont","mongan","monell","miyasato","mish","minshew","mimbs","millin","milliard","mihm","middlemiss","miano","mesick","merlan","mendonsa","mench","melonson","melling","meachem","mctighe","mcnelis","mcmurtrey","mckesson","mckenrick","mckelvie","mcjunkins","mcgory","mcgirr","mcgeever","mcfield","mcelhinney","mccrossen","mccommon","mccannon","mazyck","mawyer","maull","matute","mathies","maschino","marzan","martinie","marrotte","marmion","markarian","marinacci","margolies","margeson","marak","maraia","maracle","manygoats","manker","mank","mandich","manderson","maltz","malmquist","malacara","majette","magnan","magliocca","madina","madara","macwilliams","macqueen","maccallum","lyde","lyday","lutrick","lurz","lurvey","lumbreras","luhrs","luhr","lowrimore","lowndes","lourenco","lougee","lorona","longstreth","loht","lofquist","loewenstein","lobos","lizardi","lionberger","limoli","liljenquist","liguori","liebl","liburd","leukhardt","letizia","lesinski","lepisto","lenzini","leisenring","leipold","leier","leggitt","legare","leaphart","lazor","lazaga","lavey","laue","laudermilk","lauck","lassalle","larsson","larison","lanzo","lantzy","lanners","langtry","landford","lancour","lamour","lambertson","lalone","lairson","lainhart","lagreca","lacina","labranche","labate","kurtenbach","kuipers","kuechle","kubo","krinsky","krauser","kraeger","kracht","kozeliski","kozar","kowalik","kotler","kotecki","koslosky","kosel","koob","kolasinski","koizumi","kohlman","koffman","knutt","knore","knaff","kmiec","klamm","kittler","kitner","kirkeby","kiper","kindler","kilmartin","kilbride","kerchner","kendell","keddy","keaveney","kearsley","karlsson","karalis","kappes","kapadia","kallman","kallio","kalil","kader","jurkiewicz","jitchaku","jillson","jeune","jarratt","jarchow","janak","ivins","ivans","isenhart","inocencio","inoa","imhof","iacono","hynds","hutching","hutchin","hulsman","hulsizer","hueston","huddleson","hrbek","howry","housey","hounshell","hosick","hortman","horky","horine","hootman","honeywell","honeyestewa","holste","holien","holbrooks","hoffmeyer","hoese","hoenig","hirschfeld","hildenbrand","higson","higney","hibert","hibbetts","hewlin","hesley","herrold","hermon","hepker","henwood","helbling","heinzman","heidtbrink","hedger","havey","hatheway","hartshorne","harpel","haning","handelman","hamalainen","hamad","halasz","haigwood","haggans","hackshaw","guzzo","gundrum","guilbeault","gugliuzza","guglielmi","guderian","gruwell","grunow","grundman","gruen","grotzke","grossnickle","groomes","grode","grochowski","grob","grein","greif","greenwall","greenup","grassl","grannis","grandfield","grames","grabski","grabe","gouldsberry","gosch","goodling","goodermote","gonzale","golebiowski","goldson","godlove","glanville","gillin","gilkerson","giessler","giambalvo","giacomini","giacobbe","ghio","gergen","gentz","genrich","gelormino","gelber","geitner","geimer","gauthreaux","gaultney","garvie","gareau","garbacz","ganoe","gangwer","gandarilla","galyen","galt","galluzzo","galardo","gager","gaddie","gaber","gabehart","gaarder","fusilier","furnari","furbee","fugua","fruth","frohman","friske","frilot","fridman","frescas","freier","frayer","franzese","frankenberry","frain","fosse","foresman","forbess","flook","fletes","fleer","fleek","fleegle","fishburne","fiscalini","finnigan","fini","filipiak","figueira","fiero","ficek","fiaschetti","ferren","ferrando","ferman","fergusson","fenech","feiner","feig","faulds","fariss","falor","falke","ewings","eversley","everding","etling","essen","erskin","enstrom","engebretsen","eitel","eichberger","ehler","eekhoff","edrington","edmonston","edgmon","edes","eberlein","dwinell","dupee","dunklee","dungey","dunagin","dumoulin","duggar","duenez","dudzic","dudenhoeffer","ducey","drouillard","dreibelbis","dreger","dreesman","draughon","downen","dorminy","dombeck","dolman","doebler","dittberner","dishaw","disanti","dinicola","dinham","dimino","dilling","difrancesco","dicello","dibert","deshazer","deserio","descoteau","deruyter","dering","depinto","dente","demus","demattos","demarsico","delude","dekok","debrito","debois","deakin","dayley","dawsey","dauria","datson","darty","darsow","darragh","darensbourg","dalleva","dalbec","dadd","cutcher","cung","cuello","cuadros","crute","crutchley","crispino","crislip","crisco","crevier","creekmur","crance","cragg","crager","cozby","coyan","coxon","covalt","couillard","costley","costilow","cossairt","corvino","corigliano","cordaro","corbridge","corban","coor","conkel","conary","coltrain","collopy","colgin","colen","colbath","coiro","coffie","cochrum","cobbett","clopper","cliburn","clendenon","clemon","clementi","clausi","cirino","cina","churchman","chilcutt","cherney","cheetham","cheatom","chatelain","chalifour","cesa","cervenka","cerullo","cerreta","cerbone","cecchini","ceccarelli","cawthorn","cavalero","castner","castlen","castine","casimiro","casdorph","cartmill","cartmell","carro","carriger","carias","caravella","cappas","capen","cantey","canedo","camuso","campanaro","cambria","calzado","callejo","caligiuri","cafaro","cadotte","cacace","byrant","busbey","burtle","burres","burnworth","burggraf","burback","bunte","bunke","bulle","bugos","budlong","buckhalter","buccellato","brummet","bruff","brubeck","brouk","broten","brosky","broner","brislin","brimm","brillhart","bridgham","brideau","brennecke","breer","breeland","bredesen","brackney","brackeen","boza","boyum","bowdry","bowdish","bouwens","bouvier","bougie","bouche","bottenfield","bostian","bossie","bosler","boschert","boroff","borello","bonser","bonfield","bole","boldue","bogacz","boemer","bloxom","blickenstaff","blessinger","bleazard","blatz","blanchet","blacksher","birchler","binning","binkowski","biltz","bilotta","bilagody","bigbee","bieri","biehle","bidlack","betker","bethers","bethell","bero","bernacchi","bermingham","berkshire","benvenuto","bensman","benoff","bencivenga","beman","bellow","bellany","belflower","belch","bekker","bejar","beisel","beichner","beedy","beas","beanblossom","bawek","baus","baugus","battie","battershell","bateson","basque","basford","bartone","barritt","barko","bann","bamford","baltrip","balon","balliew","ballam","baldus","ayling","avelino","ashwell","ashland","arseneau","arroyos","armendarez","arita","argust","archuletta","arcement","antonacci","anthis","antal","annan","anderman","amster","amiri","amadon","alveraz","altomari","altmann","altenhofen","allers","allbee","allaway","aleo","alcoser","alcorta","akhtar","ahuna","agramonte","agard","adkerson","achord","abdi","abair","zurn","zoellner","zirk","zion","zarro","zarco","zambo","zaiser","zaino","zachry","youd","yonan","yniguez","yepes","yellock","yellen","yeatts","yearling","yatsko","yannone","wyler","woodridge","wolfrom","wolaver","wolanin","wojnar","wojciak","wittmann","wittich","wiswell","wisser","wintersteen","wineland","willford","wiginton","wigfield","wierman","wice","wiater","whitsel","whitbread","wheller","wettstein","werling","wente","wenig","wempe","welz","weinhold","weigelt","weichman","wedemeyer","weddel","wayment","waycaster","wauneka","watzka","watton","warnell","warnecke","warmack","warder","wands","waldvogel","waldridge","wahs","wagganer","waddill","vyas","vought","votta","voiles","virga","viner","villella","villaverde","villaneda","viele","vickroy","vicencio","vetere","vermilyea","verley","verburg","ventresca","veno","venard","venancio","velaquez","veenstra","vasil","vanzee","vanwie","vantine","vant","vanschoyck","vannice","vankampen","vanicek","vandersloot","vanderpoel","vanderlinde","vallieres","uzzell","uzelac","uranga","uptain","updyke","uong","untiedt","umbrell","umbaugh","umbarger","ulysse","ullmann","ullah","tutko","turturro","turnmire","turnley","turcott","turbyfill","turano","tuminello","tumbleson","tsou","truscott","trulson","troutner","trone","trinklein","tremmel","tredway","trease","traynham","traw","totty","torti","torregrossa","torok","tomkins","tomaino","tkach","tirey","tinsman","timpe","tiefenauer","tiedt","tidball","thwaites","thulin","throneburg","thorell","thorburn","thiemann","thieman","thesing","tham","terrien","telfair","taybron","tasson","tasso","tarro","tanenbaum","taddeo","taborn","tabios","szekely","szatkowski","sylve","swineford","swartzfager","swanton","swagerty","surrency","sunderlin","sumerlin","suero","suddith","sublette","stumpe","stueve","stuckert","strycker","struve","struss","strubbe","strough","strothmann","strahle","stoutner","stooksbury","stonebarger","stokey","stoffer","stimmel","stief","stephans","stemper","steltenpohl","stellato","steinle","stegeman","steffler","steege","steckman","stapel","stansbery","stanaland","stahley","stagnaro","stachowski","squibb","sprunger","sproule","sprehe","spreen","sprecher","sposato","spivery","souter","sopher","sommerfeldt","soffer","snowberger","snape","smylie","smyer","slaydon","slatton","slaght","skovira","skeans","sjolund","sjodin","siragusa","singelton","silis","siebenaler","shuffield","shobe","shiring","shimabukuro","shilts","sherbert","shelden","sheil","shedlock","shearn","shaub","sharbono","shapley","shands","shaheen","shaffner","servantez","sentz","seney","selin","seitzinger","seider","sehr","sego","segall","sebastien","scimeca","schwenck","schweiss","schwark","schwalbe","schucker","schronce","schrag","schouten","schoppe","schomaker","schnarr","schmied","schmader","schlicht","schlag","schield","schiano","scheve","scherbarth","schaumburg","schauman","scarpino","savinon","sassaman","saporito","sanville","santilli","santaana","salzmann","salman","sagraves","safran","saccone","rutty","russett","rupard","rumbley","ruffins","ruacho","rozema","roxas","routson","rourk","rought","rotunda","rotermund","rosman","rork","rooke","rolin","rohm","rohlman","rohl","roeske","roecker","rober","robenson","riso","rinne","riina","rigsbee","riggles","riester","rials","rhinehardt","reynaud","reyburn","rewis","revermann","reutzel","retz","rende","rendall","reistad","reinders","reichardt","rehrig","rehrer","recendez","reamy","rauls","ratz","rattray","rasband","rapone","ragle","ragins","radican","raczka","rachels","raburn","rabren","raboin","quesnell","quaintance","puccinelli","pruner","prouse","prosise","proffer","prochazka","probasco","previte","portell","porcher","popoca","pomroy","poma","polsky","polsgrove","polidore","podraza","plymale","plescia","pleau","platte","pizzi","pinchon","picot","piccione","picazo","philibert","phebus","pfohl","petell","pesso","pesante","pervis","perrins","perley","perkey","pereida","penate","peloso","pellerito","peffley","peddicord","pecina","peale","payette","paxman","pawlikowski","pavy","patry","patmon","patil","pater","patak","pasqua","pasche","partyka","parody","parmeter","pares","pardi","paonessa","panozzo","panameno","paletta","pait","oyervides","ossman","oshima","ortlieb","orsak","onley","oldroyd","okano","ohora","offley","oestreicher","odonovan","odham","odegard","obst","obriant","obrecht","nuccio","nowling","nowden","novelli","nost","norstrom","nordgren","nopper","noller","nisonger","niskanen","nienhuis","nienaber","neuwirth","neumeyer","neice","naugher","naiman","nagamine","mustin","murrietta","murdaugh","munar","muhlbauer","mroczkowski","mowdy","mouw","mousel","mountcastle","moscowitz","mosco","morro","moresi","morago","moomaw","montroy","montpas","montieth","montanaro","mongelli","mollison","mollette","moldovan","mohar","mitchelle","mishra","misenheimer","minshall","minozzi","minniefield","milhous","migliaccio","migdal","mickell","meyering","methot","mester","mesler","meriweather","mensing","mensah","menge","mendibles","meloche","melnik","mellas","meinert","mehrhoff","medas","meckler","mctague","mcspirit","mcshea","mcquown","mcquiller","mclarney","mckiney","mckearney","mcguyer","mcfarlan","mcfadyen","mcdanial","mcdanel","mccurtis","mccrohan","mccorry","mcclune","mccant","mccanna","mccandlish","mcaloon","mayall","maver","maune","matza","matsuzaki","matott","mathey","mateos","masoner","masino","marzullo","marz","marsolek","marquard","marchetta","marberry","manzione","manthei","manka","mangram","mangle","mangel","mandato","mancillas","mammen","malina","maletta","malecki","majkut","mages","maestre","macphail","maco","macneill","macadam","lysiak","lyne","luxton","luptak","lundmark","luginbill","lovallo","louthan","lousteau","loupe","lotti","lopresto","lonsdale","longsworth","lohnes","loghry","logemann","lofaro","loeber","locastro","livings","litzinger","litts","liotta","lingard","lineback","lindhorst","lill","lide","lickliter","liberman","lewinski","levandowski","leimbach","leifer","leidholt","leiby","leibel","leibee","lehrke","lehnherr","lego","leese","leen","ledo","lech","leblond","leahey","lazzari","lawrance","lawlis","lawhorne","lawes","lavigna","lavell","lauzier","lauter","laumann","latsha","latourette","latona","latney","laska","larner","larmore","larke","larence","lapier","lanzarin","lammey","lamke","laminack","lamastus","lamaster","lacewell","labarr","laabs","kutch","kuper","kuna","kubis","krzemien","krupinski","krepps","kreeger","kraner","krammer","kountz","kothe","korpela","komara","kolenda","kolek","kohnen","koelzer","koelsch","kocurek","knoke","knauff","knaggs","knab","kluver","klose","klien","klahr","kitagawa","kissler","kirstein","kinnon","kinnebrew","kinnamon","kimmins","kilgour","kilcoyne","kiester","kiehm","kesselring","kerestes","kenniston","kennamore","kenebrew","kelderman","keitel","kefauver","katzenberger","katt","kast","kassel","kamara","kalmbach","kaizer","kaiwi","kainz","jurczyk","jumonville","juliar","jourdain","johndrow","johanning","johannesen","joffrion","jobes","jerde","jentzsch","jenkens","jendro","jellerson","jefferds","jaure","jaquish","janeway","jago","iwasaki","ishman","isaza","inmon","inlow","inclan","ildefonso","iezzi","ianni","iacovetto","hyldahl","huxhold","huser","humpherys","humburg","hult","hullender","hulburt","huckabay","howeth","hovermale","hoven","houtman","hourigan","hosek","hopgood","homrich","holstine","holsclaw","hokama","hoffpauir","hoffner","hochstein","hochstatter","hochberg","hjelm","hiscox","hinsley","hineman","hineline","hinck","hilbun","hewins","herzing","hertzberg","hertenstein","herrea","herington","henrie","henman","hengst","hemmen","helmke","helgerson","heinsohn","heigl","hegstad","heggen","hegge","hefti","heathcock","haylett","haupert","haufler","hatala","haslip","hartless","hartje","hartis","harpold","harmsen","harbach","hanten","hanington","hammen","hameister","hallstrom","habersham","habegger","gussman","gundy","guitterez","guisinger","guilfoyle","groulx","grismer","griesbach","grawe","grall","graben","goulden","gornick","gori","gookin","gonzalaz","gonyer","gonder","golphin","goller","goergen","glosson","glor","gladin","girdler","gillim","gillians","gillaspie","gilhooly","gildon","gignac","gibler","gibbins","giardino","giampietro","gettman","gerringer","gerrald","gerlich","georgiou","georgi","geiselman","gehman","gangl","gamage","gallian","gallen","gallatin","galea","gainor","gahr","furbush","fulfer","fuhrmann","fritter","friis","friedly","freudenberger","freemon","fratus","frans","foulke","fosler","forquer","fontan","folwell","foeller","fodge","fobes","florek","fliss","flesner","flegel","fitzloff","fiser","firmin","firestine","finfrock","fineberg","fiegel","fickling","fesperman","fernadez","felber","feimster","feazel","favre","faughn","fatula","fasone","farron","faron","farino","falvey","falkenberg","faley","faletti","faeth","fackrell","espe","eskola","escott","esaw","erps","erker","erath","enfield","emfinger","embury","embleton","emanuele","elvers","ellwanger","ellegood","eichinger","egge","egeland","edgett","echard","eblen","eastmond","duteau","durland","dure","dunlavy","dungee","dukette","dugay","duboise","dubey","dsouza","druck","dralle","doubek","dorta","dorch","dorce","dopson","dolney","dockter","distler","dippel","dichiara","dicerbo","dewindt","dewan","deveney","devargas","deutscher","deuel","detter","dess","derrington","deroberts","dern","deponte","denogean","denardi","denard","demary","demarais","delucas","deloe","delmonico","delisi","delio","delduca","deihl","dehmer","decoste","dechick","decatur","debruce","debold","debell","deats","daunt","daquilante","dambrosi","damas","dalin","dahman","dahlem","daffin","dacquel","cutrell","cusano","curtner","currens","curnow","cuppett","cummiskey","cullers","culhane","crull","crossin","cropsey","cromie","crofford","criscuolo","crisafulli","crego","creeden","covello","covel","corse","correra","cordner","cordier","coplen","copeman","contini","conteras","consalvo","conduff","compher","colliver","colan","cohill","cohenour","cogliano","codd","cockayne","clum","clowdus","clarida","clance","clairday","clagg","citron","citino","ciriello","cicciarelli","chrostowski","christley","chrisco","chrest","chisler","chieffo","cherne","cherico","cherian","cheirs","chauhan","chamblin","cerra","cepero","cellini","celedon","cejka","cavagnaro","cauffman","catanese","castrillo","castrellon","casserly","caseres","carthen","carse","carragher","carpentieri","carmony","carmer","carlozzi","caradine","cappola","capece","capaldi","cantres","cantos","canevari","canete","calcaterra","cadigan","cabbell","byrn","bykowski","butchko","busler","bushaw","buschmann","burow","buri","burgman","bunselmeyer","bunning","buhrman","budnick","buckson","buckhannon","brunjes","brumleve","bruckman","brouhard","brougham","brostrom","broerman","brocks","brison","brining","brindisi","brereton","breon","breitling","breedon","brasseaux","branaman","bramon","brackenridge","boyan","boxley","bouman","bouillion","botting","botti","bosshart","borup","borner","bordonaro","bonsignore","bonsall","bolter","bojko","bohne","bohlmann","bogdon","boen","bodenschatz","bockoven","bobrow","blondin","blissett","bligen","blasini","blankenburg","bjorkman","bistline","bisset","birdow","biondolillo","bielski","biele","biddix","biddinger","bianchini","bevens","bevard","betancur","bernskoetter","bernet","bernardez","berliner","berland","berkheimer","berent","bensch","benesch","belleau","bedingfield","beckstrom","beckim","bechler","beachler","bazzell","basa","bartoszek","barsch","barrell","barnas","barnaba","barillas","barbier","baltodano","baltierra","balle","balint","baldi","balderson","balderama","baldauf","balcazar","balay","baiz","bairos","azim","aversa","avellaneda","ausburn","auila","augusto","atwill","artiles","arterberry","arnow","arnaud","arnall","arenz","arduini","archila","arakawa","appleman","aplin","antonini","anstey","anglen","andros","amweg","amstutz","amari","amadeo","alteri","aloi","allebach","aley","alamillo","airhart","ahrendt","aegerter","adragna","admas","adderly","adderley","addair","abelar","abbamonte","abadi","zurek","zundel","zuidema","zuelke","zuck","zogg","zody","zets","zech","zecca","zavaleta","zarr","yousif","yoes","yoast","yeagley","yaney","yanda","yackel","wyles","wyke","woolman","woollard","woodis","woodin","wonderly","wombles","woloszyn","wollam","wnek","wittie","withee","wissman","wisham","wintle","winokur","wilmarth","willhoite","wildner","wikel","wieser","wien","wicke","wiatrek","whitehall","whetstine","wheelus","weyrauch","weyers","westerling","wendelken","welner","weinreb","weinheimer","weilbacher","weihe","weider","wecker","wead","watler","watkinson","wasmer","waskiewicz","wasik","warneke","wares","wangerin","wamble","walken","waker","wakeley","wahlgren","wahlberg","wagler","wachob","vorhies","vonseggern","vittitow","vink","villarruel","villamil","villamar","villalovos","vidmar","victorero","vespa","vertrees","verissimo","veltman","vecchione","veals","varrone","varma","vanveen","vanterpool","vaneck","vandyck","vancise","vanausdal","vanalphen","valdiviezo","urton","urey","updegrove","unrue","ulbrich","tysinger","twiddy","tunson","trueheart","troyan","trier","traweek","trafford","tozzi","toulouse","tosto","toste","torez","tooke","tonini","tonge","tomerlin","tolmie","tobe","tippen","tierno","tichy","thuss","thran","thornbury","thone","theunissen","thelmon","theall","textor","teters","tesh","tench","tekautz","tehrani","teat","teare","tavenner","tartaglione","tanski","tanis","tanguma","tangeman","taney","tammen","tamburri","tamburello","talsma","tallie","takeda","taira","taheri","tademy","taddei","taaffe","szymczak","szczepaniak","szafranski","swygert","swem","swartzlander","sutley","supernaw","sundell","sullivant","suderman","sudbury","suares","stueber","stromme","streeper","streck","strebe","stonehouse","stoia","stohr","stodghill","stirewalt","sterry","stenstrom","stene","steinbrecher","stear","stdenis","stanphill","staniszewski","stanard","stahlhut","stachowicz","srivastava","spong","spomer","spinosa","spindel","spera","soward","sopp","sooter","sonnek","soland","sojourner","soeder","sobolewski","snellings","smola","smetana","smeal","smarr","sloma","sligar","skenandore","skalsky","sissom","sirko","simkin","silverthorn","silman","sikkink","signorile","siddens","shumsky","shrider","shoulta","shonk","shomaker","shippey","shimada","shillingburg","shifflet","shiels","shepheard","sheerin","shedden","sheckles","sharrieff","sharpley","shappell","shaneyfelt","shampine","shaefer","shaddock","shadd","sforza","severtson","setzler","sepich","senne","senatore","sementilli","selway","selover","sellick","seigworth","sefton","seegars","sebourn","seaquist","sealock","seabreeze","scriver","scinto","schumer","schulke","schryver","schriner","schramek","schoon","schoolfield","schonberger","schnieder","schnider","schlitz","schlather","schirtzinger","scherman","schenker","scheiner","scheible","schaus","schakel","schaad","saxe","savely","savary","sardinas","santarelli","sanschagrin","sanpedro","sandine","sandigo","sandgren","sanderford","sandahl","salzwedel","salzar","salvino","salvatierra","salminen","salierno","salberg","sahagun","saelee","sabel","rynearson","ryker","rupprecht","runquist","rumrill","ruhnke","rovira","rottenberg","rosoff","rosete","rosebrough","roppolo","roope","romas","roley","rohrback","rohlfs","rogriguez","roel","rodriguiz","rodewald","roback","rizor","ritt","rippee","riolo","rinkenberger","riggsby","rigel","rieman","riedesel","rideau","ricke","rhinebolt","rheault","revak","relford","reinsmith","reichmann","regula","redlinger","rayno","raycroft","raus","raupp","rathmann","rastorfer","rasey","raponi","rantz","ranno","ranes","ramnauth","rahal","raddatz","quattrocchi","quang","pullis","pulanco","pryde","prohaska","primiano","prez","prevatt","prechtl","pottle","potenza","portes","porowski","poppleton","pontillo","politz","politi","poggi","plonka","plaskett","placzek","pizzuti","pizzaro","pisciotta","pippens","pinkins","pinilla","pini","pingitore","piercey","piccola","piccioni","picciano","philps","philp","philo","philmon","philbin","pflieger","pezzullo","petruso","petrea","petitti","peth","peshlakai","peschel","persico","persichetti","persechino","perris","perlow","perico","pergola","penniston","pembroke","pellman","pekarek","peirson","pearcey","pealer","pavlicek","passino","pasquarello","pasion","parzych","parziale","parga","papalia","papadakis","paino","pacini","oyen","ownes","owczarzak","outley","ouelette","ottosen","otting","ostwinkle","osment","oshita","osario","orlow","oriordan","orefice","orantes","oran","orahood","opel","olpin","oliveria","okon","okerlund","okazaki","ohta","offerman","nyce","nutall","northey","norcia","noor","niehoff","niederhauser","nickolson","nguy","neylon","newstrom","nevill","netz","nesselrodt","nemes","neally","nauyen","nascimento","nardella","nanni","myren","murchinson","munter","mundschenk","mujalli","muckleroy","moussa","mouret","moulds","mottram","motte","morre","montreuil","monton","montellano","monninger","monhollen","mongeon","monestime","monegro","mondesir","monceaux","mola","moga","moening","moccia","misko","miske","mishaw","minturn","mingione","milstein","milla","milks","michl","micheletti","michals","mesia","merson","meras","menifee","meluso","mella","melick","mehlman","meffert","medoza","mecum","meaker","meahl","mczeal","mcwatters","mcomber","mcmonigle","mckiddy","mcgranor","mcgeary","mcgaw","mcenery","mcelderry","mcduffey","mccuistion","mccrudden","mccrossin","mccosh","mccolgan","mcclish","mcclenahan","mcclam","mccartt","mccarrell","mcbane","maybury","mayben","maulden","mauceri","matko","mathie","matheis","mathai","masucci","massiah","martorano","martnez","martindelcamp","marschke","marovich","markiewicz","marinaccio","marhefka","marcrum","manton","mannarino","manlove","mangham","manasco","malpica","mallernee","malinsky","malhotra","maish","maisel","mainville","maharrey","magid","maertz","mada","maclaughlin","macina","macdermott","macallister","macadangdang","maack","lynk","lydic","luyando","lutke","lupinacci","lunz","lundsten","lujano","luhn","luecke","luebbe","ludolph","luckman","lucker","luckenbill","luckenbach","lucido","lowney","lowitz","lovaglio","louro","louk","loudy","louderback","lorick","lorenzini","lorensen","lorenc","lomuscio","loguidice","lockner","lockart","lochridge","litaker","lisowe","liptrap","linnane","linhares","lindfors","lindenmuth","lincourt","liew","liebowitz","levengood","leskovec","lesch","leoni","lennard","legner","leaser","leas","leadingham","lazarski","layland","laurito","laulu","laughner","laughman","laughery","laube","latiolais","lasserre","lasser","larrow","larrea","lapsley","lantrip","lanthier","langwell","langelier","landaker","lampi","lamond","lamblin","lambie","lakins","laipple","lagrimas","lafrancois","laffitte","laday","lacko","lacava","labianca","kutsch","kuske","kunert","kubly","kuamoo","krummel","krise","krenek","kreiser","krausz","kraska","krakowski","kradel","kozik","koza","kotowski","koslow","korber","kojima","kochel","knabjian","klunder","klugh","klinkhammer","kliewer","klever","kleber","klages","klaas","kizziar","kitchel","kishimoto","kirschenman","kirschenbaum","kinnick","kinn","kiner","kindla","kindall","kincaide","kilson","killins","kightlinger","kienzle","kiah","khim","ketcherside","kerl","kelsoe","kelker","keizer","keir","kawano","kawa","kaveney","kasparek","kaplowitz","kantrowitz","kant","kanoff","kano","kamalii","kalt","kaleta","kalbach","kalauli","kalata","kalas","kaigler","kachel","juran","jubb","jonker","jonke","jolivette","joles","joas","jividen","jeffus","jeanty","jarvi","jardon","janvier","janosko","janoski","janiszewski","janish","janek","iwanski","iuliano","irle","ingmire","imber","ijames","iiams","ihrig","ichikawa","hynum","hutzel","hutts","huskin","husak","hurndon","huntsinger","hulette","huitron","huguenin","hugg","hugee","huelskamp","huch","howen","hovanec","hoston","hostettler","horsfall","horodyski","holzhauer","hollimon","hollender","hogarth","hoffelmeyer","histand","hissem","hisel","hirayama","hinegardner","hinde","hinchcliffe","hiltbrand","hilsinger","hillstrom","hiley","hickenbottom","hickam","hibley","heying","hewson","hetland","hersch","herlong","herda","henzel","henshall","helson","helfen","heinbach","heikkila","heggs","hefferon","hebard","heathcote","hearl","heaberlin","hauth","hauschild","haughney","hauch","hattori","hasley","hartpence","harroun","harelson","hardgrove","hardel","hansbrough","handshoe","handly","haluska","hally","halling","halfhill","halferty","hakanson","haist","hairgrove","hahner","hagg","hafele","haaland","guttierez","gutknecht","gunnarson","gunlock","gummersheimer","gullatte","guity","guilmette","guhl","guenette","guardino","groshong","grober","gripp","grillot","grilli","greulich","gretzinger","greenwaldt","graven","grassman","granberg","graeser","graeff","graef","grabow","grabau","gotchy","goswick","gosa","gordineer","gorczyca","goodchild","golz","gollihue","goldwire","goldbach","goffredo","glassburn","glaeser","gillilan","gigante","giere","gieger","gidcumb","giarrusso","giannelli","gettle","gesualdi","geschke","gerwig","gervase","geoffrion","gentilcore","genther","gemes","gemberling","gelles","geitz","geeslin","gedney","gebauer","gawron","gavia","gautney","gaustad","gasmen","gargus","ganske","ganger","galvis","gallinger","gallichio","galletta","gaede","gadlin","gaby","gabrielsen","gaboriault","furlan","furgerson","fujioka","fugett","fuehrer","frint","frigon","frevert","frautschi","fraker","fradette","foulkes","forslund","forni","fontenette","fones","folz","folmer","follman","folkman","flourney","flickner","flemmings","fleischacker","flander","flament","fithian","fiorello","fiorelli","fioravanti","fieck","ficke","fiallos","fiacco","feuer","ferrington","fernholz","feria","fergurson","feick","febles","favila","faulkingham","fath","farnam","falter","fakhouri","fairhurst","fahs","estrello","essick","espree","esmond","eskelson","escue","escatel","erebia","epperley","epler","enyart","engelbert","enderson","emch","elisondo","elford","ekman","eick","eichmann","ehrich","ehlen","edwardson","edley","edghill","edel","eastes","easterbrooks","eagleson","eagen","eade","dyle","dutkiewicz","dunnagan","duncil","duling","drumgoole","droney","dreyfus","dragan","dowty","doscher","dornan","doremus","doogan","donaho","donahey","dombkowski","dolton","dolen","dobratz","diveley","dittemore","ditsch","disque","dishmon","disch","dirickson","dippolito","dimuccio","dilger","diefenderfer","dicola","diblasio","dibello","devan","dettmer","deschner","desbiens","derusha","denkins","demonbreun","demchak","delucchi","delprete","deloy","deliz","deline","delap","deiter","deignan","degiacomo","degaetano","defusco","deboard","debiase","deaville","deadwyler","davanzo","daughton","darter","danser","dandrade","dando","dampeer","dalziel","dalen","dain","dague","czekanski","cutwright","cutliff","curle","cuozzo","cunnington","cunnigham","cumings","crowston","crittle","crispell","crisostomo","crear","creach","craigue","crabbs","cozzi","cozza","coxe","cowsert","coviello","couse","coull","cottier","costagliola","corra","corpening","cormany","corless","corkern","conteh","conkey","conditt","conaty","colomb","collura","colledge","colins","colgate","coleson","colemon","coffland","coccia","clougherty","clewell","cleckley","cleaveland","clarno","civils","cillo","cifelli","ciesluk","christison","chowning","chouteau","choung","childres","cherrington","chenette","cheeves","cheairs","chaddock","cernoch","cerino","cazier","castel","casselberry","caserta","carvey","carris","carmant","cariello","cardarelli","caras","caracciolo","capitano","cantoni","cantave","cancio","campillo","callens","caldero","calamia","cahee","cahan","cahalan","cabanilla","cabal","bywater","bynes","byassee","busker","bushby","busack","burtis","burrola","buroker","burnias","burlock","burham","burak","bulla","buffin","buening","budney","buchannan","buchalter","brule","brugler","broxson","broun","brosh","brissey","brisby","brinlee","brinkmeyer","brimley","brickell","breth","breger","brees","brank","braker","bozak","bowlds","bowersock","bousman","boushie","botz","bordwell","bonkowski","bonine","bonifay","bonesteel","boldin","bohringer","bohlander","boecker","bocook","bocock","boblett","bobbett","boas","boarman","bleser","blazejewski","blaustein","blausey","blancarte","blaize","blackson","blacketer","blackard","bisch","birchett","billa","bilder","bierner","bienvenu","bielinski","bialas","biagini","beynon","beyl","bettini","betcher","bessent","beshara","besch","bernd","bergemann","bergeaux","berdan","bens","benedicto","bendall","beltron","beltram","bellville","beisch","behney","beechler","beckum","batzer","batte","bastida","bassette","basley","bartosh","bartolone","barraclough","barnick","barket","barkdoll","baringer","barella","barbian","barbati","bannan","balles","baldo","balasubramani","baig","bahn","bachmeier","babyak","baas","baars","ayuso","avinger","avella","ausbrooks","aull","augello","atkeson","atkerson","atherley","athan","assad","asebedo","arrison","armon","armfield","arkin","archambeau","antonellis","angotti","amorose","amini","amborn","amano","aluarez","allgaier","allegood","alen","aldama","aird","ahsing","ahmann","aguado","agostino","agostinelli","adwell","adsit","adelstein","actis","acierno","achee","abbs","abbitt","zwagerman","zuercher","zinno","zettler","zeff","zavalza","zaugg","zarzycki","zappulla","zanotti","zachman","zacher","yundt","yslas","younes","yontz","yglesias","yeske","yeargin","yauger","yamane","xang","wylam","wrobleski","wratchford","woodlee","wolsey","wolfinbarger","wohlenhaus","wittler","wittenmyer","witkop","wishman","wintz","winkelmann","windus","winborn","wims","wiltrout","willmott","williston","wilemon","wilbourne","wiedyk","widmann","wickland","wickes","wichert","whitsell","whisenand","whidby","wetz","westmeyer","wertheim","wernert","werle","werkheiser","weldin","weissenborn","weingard","weinfeld","weihl","weightman","weichel","wehrheim","wegrzyn","wegmann","waszak","wankum","walthour","waltermire","walstad","waldren","walbert","walawender","wahlund","wahlert","wahlers","wach","vuncannon","vredenburgh","vonk","vollmar","voisinet","vlahos","viscardi","vires","vipperman","violante","vidro","vessey","vesper","veron","vergari","verbeck","venturino","velastegui","vegter","varas","vanwey","vanvranken","vanvalkenbur","vanorsdale","vanoli","vanochten","vanier","vanevery","vane","vanduser","vandersteen","vandell","vandall","vallot","vallon","vallez","vallely","vadenais","uthe","usery","unga","ultsch","ullom","tyminski","twogood","tursi","turay","tungate","truxillo","trulock","trovato","troise","tripi","trinks","trimboli","trickel","trezise","trefry","treen","trebilcock","travieso","trachtenberg","touhey","tougas","tortorella","tormey","torelli","torborg","toran","tomek","tomassi","tollerson","tolden","toda","tobon","tjelmeland","titmus","tilbury","tietje","thurner","thum","thrope","thornbrough","thibaudeau","thackeray","tesoro","territo","ternes","teich","tecson","teater","teagarden","tatsch","tarallo","tapanes","tanberg","tamm","sylvis","swenor","swedlund","sutfin","sura","sundt","sundin","summerson","sumatzkuku","sultemeier","sulivan","suggitt","suermann","sturkie","sturgess","stumph","stuemke","struckhoff","strose","stroder","stricklen","strick","streib","strei","strawther","stratis","strahm","stortz","storrer","storino","stohler","stohl","stockel","stinnette","stile","stieber","steffenhagen","stefanowicz","steever","steagall","statum","stapley","stanish","standiford","standen","stamos","stahlecker","stadtler","spratley","spraker","sposito","spickard","spehar","spees","spearing","spangle","spallone","soulard","sora","sopko","sood","sonnen","solly","solesbee","soldano","sobey","sobczyk","snedegar","sneddon","smolinski","smolik","slota","slavick","skorupski","skolnik","skirvin","skeels","skains","skahan","skaar","siwiec","siverly","siver","sivak","sirk","sinton","sinor","sincell","silberstein","sieminski","sidelinger","shurman","shunnarah","shirer","shidler","sherlin","shepperson","shemanski","sharum","shartrand","shapard","shanafelt","shamp","shader","shackelton","seyer","seroka","sernas","seright","serano","sengupta","selinger","seith","seidler","seehusen","seefried","scovell","scorzelli","sconiers","schwind","schwichtenber","schwerin","schwenke","schwaderer","schussler","schuneman","schumpert","schultheiss","schroll","schroepfer","schroeden","schrimpf","schook","schoof","schomburg","schoenfeldt","schoener","schnoor","schmick","schlereth","schindele","schildt","schildknecht","schemmel","scharfenberg","schanno","schane","schaer","schad","scearce","scardino","sawka","sawinski","savoca","savery","saults","sarpy","saris","sardinha","sarafin","sankar","sanjurjo","sanderfer","sanagustin","samudio","sammartino","samas","salz","salmen","salkeld","salamon","sakurai","sakoda","safley","sada","sachse","ryden","ryback","russow","russey","ruprecht","rumple","ruffini","rudzinski","rudel","rudden","rovero","routledge","roussin","rousse","rouser","rougeau","rosica","romey","romaniello","rolfs","rogoff","rogne","rodriquz","rodrequez","rodin","rocray","rocke","riviere","rivette","riske","risenhoover","rindfleisch","rinaudo","rimbey","riha","righi","ridner","ridling","riden","rhue","reyome","reynoldson","reusch","rensing","rensch","rennels","renderos","reininger","reiners","reigel","rehmer","regier","reff","redlin","recchia","reaume","reagor","rawe","rattigan","raska","rashed","ranta","ranft","randlett","ramiez","ramella","rallis","rajan","raisbeck","raimondo","raible","ragone","rackliffe","quirino","quiring","quero","quaife","pyke","purugganan","pursifull","purkett","purdon","pulos","puccia","provance","propper","preis","prehn","prata","prasek","pranger","pradier","portor","portley","porte","popiel","popescu","pomales","polowy","pollett","politis","polit","poley","pohler","poggio","podolak","poag","plymel","ploeger","planty","piskura","pirrone","pirro","piroso","pinsky","pilant","pickerill","piccolomini","picart","piascik","phann","petruzzelli","petosa","persson","perretta","perkowski","perilli","percifield","perault","peppel","pember","pelotte","pelcher","peixoto","pehl","peatross","pearlstein","peacher","payden","paya","pawelek","pavey","pauda","pathak","parrillo","parness","parlee","paoli","pannebaker","palomar","palo","palmberg","paganelli","paffrath","padovano","padden","pachucki","ovando","othman","osowski","osler","osika","orsburn","orlowsky","oregel","oppelt","opfer","opdyke","onell","olivos","okumura","okoro","ogas","oelschlaeger","oder","ocanas","obrion","obarr","oare","nyhus","nyenhuis","nunnelley","nunamaker","nuckels","noyd","nowlan","novakovich","noteboom","norviel","nortz","norment","norland","nolt","nolie","nixson","nitka","nissley","nishiyama","niland","niewiadomski","niemeier","nieland","nickey","nicholsen","neugent","neto","nerren","neikirk","neigh","nedrow","neave","nazaire","navaro","navalta","nasworthy","nasif","nalepa","nakao","nakai","nadolny","myklebust","mussel","murthy","muratore","murat","mundie","mulverhill","muilenburg","muetzel","mudra","mudgett","mrozinski","moura","mottinger","morson","moretto","morentin","mordan","mooreland","mooers","monts","montone","montondo","montiero","monie","monat","monares","mollo","mollet","molacek","mokry","mohrmann","mohabir","mogavero","moes","moceri","miyoshi","mitzner","misra","mirr","minish","minge","minckler","milroy","mille","mileski","milanesi","miko","mihok","mihalik","mieczkowski","messerli","meskill","mesenbrink","merton","merryweather","merkl","menser","menner","menk","menden","menapace","melbourne","mekus","meinzer","meers","mctigue","mcquitty","mcpheron","mcmurdie","mcleary","mclafferty","mckinzy","mckibbin","mckethan","mcintee","mcgurl","mceachran","mcdowall","mcdermitt","mccuaig","mccreedy","mccoskey","mcclosky","mcclintick","mccleese","mccanless","mazzucco","mazzocco","mazurkiewicz","mazariego","mayhorn","maxcy","mavity","mauzey","maulding","matuszewski","mattsson","mattke","matsushita","matsuno","matsko","matkin","mathur","masterman","massett","massart","massari","mashni","martella","marren","margotta","marder","marczak","maran","maradiaga","manwarren","manter","mantelli","manso","mangone","manfredonia","malden","malboeuf","malanga","makara","maison","maisano","mairs","mailhiot","magri","madron","madole","mackall","macduff","macartney","lynds","lusane","luffman","louth","loughmiller","lougheed","lotspeich","lorenzi","loosli","longe","longanecker","lonero","lohmeyer","loeza","lobstein","lobner","lober","littman","litalien","lippe","lints","lijewski","ligas","liebert","liebermann","liberati","lezcano","levinthal","lessor","lesieur","lenning","lengel","lempke","lemp","lemar","leitzke","leinweber","legrone","lege","leder","lawnicki","lauth","laun","laughary","lassley","lashway","larrivee","largen","lare","lanouette","lanno","langille","langen","lamonte","lalin","laible","lafratta","laforte","lacuesta","lacer","labore","laboe","labeau","kwasniewski","kunselman","kuhr","kuchler","krugman","kruckenberg","krotzer","kroemer","krist","krigbaum","kreke","kreisman","kreisler","kreft","krasnow","kras","krag","kouyate","kough","kotz","kostura","korner","kornblum","korczynski","koppa","kopczyk","konz","komorowski","kollen","kolander","koepnick","koehne","kochis","knoch","knippers","knaebel","klipp","klinedinst","klimczyk","klier","klement","klaphake","kisler","kinzie","kines","kindley","kimple","kimm","kimbel","kilker","kilborn","kibbey","khong","ketchie","kerbow","kennemore","kennebeck","kenneally","kenndy","kenmore","kemnitz","kemler","kemery","kelnhofer","kellstrom","kellis","kellams","keiter","keirstead","keeny","keelin","keefauver","keams","kautzman","kaus","katayama","kasson","kassim","kasparian","kase","karwoski","kapuscinski","kaneko","kamerling","kamada","kalka","kalar","kakacek","kaczmarczyk","jurica","junes","journell","jolliffe","johnsey","jindra","jimenz","jette","jesperson","jerido","jenrette","jencks","jech","jayroe","jayo","javens","jaskot","jaros","jaquet","janowiak","jaegers","jackel","izumi","irelan","inzunza","imoto","imme","iglehart","iannone","iannacone","huyler","hussaini","hurlock","hurlbutt","huprich","humphry","hulslander","huelsman","hudelson","hudecek","hsia","hreha","hoyland","howk","housholder","housden","houff","horkey","honan","homme","holtzberg","hollyfield","hollings","hollenbaugh","hokenson","hogrefe","hogland","hoel","hodgkin","hochhalter","hjelle","hittson","hinderman","hinchliffe","hime","hilyer","hilby","hibshman","heydt","hewell","heward","hetu","hestand","heslep","herridge","herner","hernande","hermandez","hermance","herbold","heon","henthorne","henion","henao","heming","helmkamp","hellberg","heidgerken","heichel","hehl","hegedus","heckathorne","hearron","haymer","haycook","havlicek","hausladen","haseman","hartsook","hartog","harns","harne","harmann","haren","hanserd","hanners","hanekamp","hamra","hamley","hamelin","hamblet","hakimi","hagle","hagin","haehn","haeck","hackleman","haacke","gulan","guirand","guiles","guggemos","guerrieri","guerreiro","guereca","gudiel","guccione","gubler","gruenwald","gritz","grieser","grewe","grenon","gregersen","grefe","grech","grecco","gravette","grassia","granholm","graner","grandi","grahan","gradowski","gradney","graczyk","gouthier","gottschall","goracke","gootee","goodknight","goodine","gonzalea","gonterman","gonalez","gomm","goleman","goldtooth","goldstone","goldey","golan","goen","goeller","goel","goecke","godek","goan","glunz","gloyd","glodowski","glinski","glawe","girod","girdley","gindi","gillings","gildner","giger","giesbrecht","gierke","gier","giboney","giaquinto","giannakopoulo","giaimo","giaccio","giacalone","gessel","gerould","gerlt","gerhold","geralds","genson","genereux","gellatly","geigel","gehrig","gehle","geerdes","geagan","gawel","gavina","gauss","gatwood","gathman","gaster","garske","garratt","garms","garis","gansburg","gammell","gambale","gamba","galimore","gadway","gadoury","furrer","furino","fullard","fukui","fryou","friesner","friedli","friedl","friedberg","freyermuth","fremin","fredell","fraze","franken","foth","fote","fortini","fornea","formanek","forker","forgette","folan","foister","foglesong","flinck","flewellen","flaten","flaig","fitgerald","fischels","firman","finstad","finkelman","finister","fina","fetterhoff","ferriter","ferch","fennessy","feltus","feltes","feinman","farve","farry","farrall","farag","falzarano","falck","falanga","fakhoury","fairbrother","fagley","faggins","facteau","ewer","ewbank","evola","evener","eustis","estwick","estel","essa","espinola","escutia","eschmann","erpelding","ernsberger","erling","entz","engelhart","enbody","emick","elsinger","ellinwood","ellingsen","ellicott","elkind","eisinger","eisenbeisz","eischen","eimer","eigner","eichhorst","ehmke","egleston","eggett","efurd","edgeworth","eckels","ebey","eberling","eagleton","dwiggins","dweck","dunnings","dunnavant","dumler","duman","dugue","duerksen","dudeck","dreisbach","drawdy","drawbaugh","draine","draggoo","dowse","dovel","doughton","douds","doubrava","dort","dorshorst","dornier","doolen","donavan","dominik","domingez","dolder","dold","dobies","diskin","disano","dirden","diponio","dipirro","dimock","diltz","dillabough","diley","dikes","digges","digerolamo","diel","dicharry","dicecco","dibartolomeo","diamant","dewire","devone","dessecker","dertinger","derousselle","derk","depauw","depalo","denherder","demeyer","demetro","demastus","delvillar","deloye","delosrios","delgreco","delarge","delangel","dejongh","deitsch","degiorgio","degidio","defreese","defoe","decambra","debenedetto","deaderick","daza","dauzat","daughenbaugh","dato","dass","darwish","dantuono","danton","dammeyer","daloia","daleo","dagg","dacey","curts","cuny","cunneen","culverhouse","cucinella","cubit","crumm","crudo","crowford","crout","crotteau","crossfield","crooke","crom","critz","cristaldi","crickmore","cribbin","cremeens","crayne","cradduck","couvertier","cottam","cossio","correy","cordrey","coplon","copass","coone","coody","contois","consla","connelley","connard","congleton","condry","coltey","colindres","colgrove","colfer","colasurdo","cochell","cobbin","clouthier","closs","cloonan","clizbe","clennon","clayburn","claybourn","clausell","clasby","clagett","ciskowski","cirrincione","cinque","cinelli","cimaglia","ciaburri","christiani","christeson","chladek","chizmar","chinnici","chiarella","chevrier","cheves","chernow","cheong","chelton","chanin","cham","chaligoj","celestino","cayce","cavey","cavaretta","caughron","catmull","catapano","cashaw","carullo","carualho","carthon","cartelli","carruba","carrere","carolus","carlstrom","carfora","carello","carbary","caplette","cannell","cancilla","campell","cammarota","camilo","camejo","camarata","caisse","cacioppo","cabbagestalk","cabatu","cabanas","byles","buxbaum","butland","burrington","burnsed","burningham","burlingham","burgy","buitrago","bueti","buehring","buday","bucknell","buchbinder","bucey","bruster","brunston","brouillet","brosious","broomes","brodin","broddy","brochard","britsch","britcher","brierley","brezina","bressi","bressette","breslow","brenden","breier","brei","braymer","brasuell","branscomb","branin","brandley","brahler","bracht","bracamontes","brabson","boyne","boxell","bowery","bovard","boutelle","boulette","bottini","botkins","bosen","boscia","boscarino","borich","boreman","bordoy","bordley","bordenet","boquet","boocks","bolner","boissy","boilard","bohnen","bohall","boening","boccia","boccella","bobe","blyth","biviano","bitto","bisel","binstock","bines","billiter","bigsby","bighorse","bielawski","bickmore","bettin","bettenhausen","besson","beseau","berton","berroa","berntson","bernas","berisford","berhow","bergsma","benyo","benyard","bente","bennion","benko","belsky","bellavance","belasco","belardo","beidler","behring","begnaud","bega","befort","beek","bedore","beddard","becknell","beardslee","beardall","beagan","bayly","bauza","bautz","bausman","baumler","batterson","battenfield","bassford","basse","basemore","baruch","bartholf","barman","baray","barabas","banghart","banez","balsam","ballester","ballagh","baldock","bagnoli","bagheri","bacus","bacho","baccam","axson","averhart","aver","austill","auberry","athans","atcitty","atay","astarita","ascolese","artzer","arrasmith","argenbright","aresco","aranjo","appleyard","appenzeller","apilado","antonetti","antis","annas","angwin","andris","andries","andreozzi","ando","andis","anderegg","amyot","aminov","amelung","amelio","amason","alviar","allendorf","aldredge","alcivar","alaya","alapai","airington","aina","ailor","ahrns","ahmadi","agresta","affolter","aeschlimann","adney","aderhold","adachi","ackiss","aben","abdelhamid","abar","aase","zorilla","zordan","zollman","zoch","zipfel","zimmerle","zike","ziel","zens","zelada","zaman","zahner","zadora","zachar","zaborowski","zabinski","yzquierdo","yoshizawa","yori","yielding","yerton","yehl","yeargain","yeakley","yamaoka","yagle","yablonski","wynia","wyne","wyers","wrzesinski","wrye","wriston","woolums","woolen","woodlock","woodle","wonser","wombacher","wollschlager","wollen","wolfley","wolfer","wisse","wisell","wirsing","winstanley","winsley","winiecki","winiarski","winge","winesett","windell","winberry","willyard","willemsen","wilkosz","wilensky","wikle","wiford","wienke","wieneke","wiederhold","wiebold","widick","wickenhauser","whitrock","whisner","whinery","wherley","whedbee","wheadon","whary","wessling","wessells","wenninger","wendroth","wende","wellard","weirick","weinkauf","wehrman","weech","weathersbee","warncke","wardrip","walstrom","walkowski","walcutt","waight","wagman","waggett","wadford","vowles","vormwald","vondran","vohs","vitt","vitalo","viser","vinas","villena","villaneuva","villafranca","villaflor","vilain","vicory","viana","vian","verucchi","verra","venzke","venske","veley","veile","veeder","vaske","vasconez","vargason","varble","vanwert","vantol","vanscooter","vanmetre","vanmaanen","vanhise","vaneaton","vandyk","vandriel","vandorp","vandewater","vandervelden","vanderstelt","vanderhoef","vanderbeck","vanbibber","vanalstine","vanacore","valdespino","vaill","vailes","vagliardo","ursini","urrea","urive","uriegas","umphress","ucci","uballe","tynon","twiner","tutton","tudela","tuazon","troisi","tripplett","trias","trescott","treichel","tredo","tranter","tozer","toxey","tortorici","tornow","topolski","topia","topel","topalian","tonne","tondre","tola","toepke","tisdell","tiscareno","thornborrow","thomison","thilges","theuret","therien","thagard","thacher","texter","terzo","tenpenny","tempesta","teetz","teaff","tavella","taussig","tatton","tasler","tarrence","tardie","tarazon","tantillo","tanney","tankson","tangen","tamburo","tabone","szilagyi","syphers","swistak","swiatkowski","sweigert","swayzer","swapp","svehla","sutphen","sutch","susa","surma","surls","sundermeyer","sundeen","sulek","sughrue","sudol","sturms","stupar","stum","stuckman","strole","strohman","streed","strebeck","strausser","strassel","stpaul","storts","storr","stommes","stmary","stjulien","stika","stiggers","sthill","stevick","sterman","stepanek","stemler","stelman","stelmack","steinkamp","steinbock","stcroix","stcharles","staudinger","stanly","stallsworth","stalley","srock","spritzer","spracklin","spinuzzi","spidell","speyrer","sperbeck","spendlove","speckman","spargur","spangenberg","spaid","sowle","soulier","sotolongo","sostre","sorey","sonier","somogyi","somera","soldo","soderholm","snoots","snooks","snoke","snodderly","snee","smithhart","smillie","smay","smallman","sliwinski","slentz","sledd","slager","skogen","skog","skarda","skalicky","siwek","sitterson","sisti","sissel","sinopoli","similton","simila","simenson","silvertooth","silos","siggins","sieler","siburt","sianez","shurley","shular","shuecraft","shreeves","shollenberger","shoen","shishido","shipps","shipes","shinall","sherfield","shawe","sharrett","sharrard","shankman","sessum","serviss","servello","serice","serda","semler","semenza","selmon","sellen","seley","seidner","seib","sehgal","seelbach","sedivy","sebren","sebo","seanez","seagroves","seagren","seabron","schwertner","schwegel","schwarzer","schrunk","schriefer","schreder","schrank","schopp","schonfeld","schoenwetter","schnall","schnackenberg","schnack","schmutzler","schmierer","schmidgall","schlup","schloemer","schlitt","schermann","scherff","schellenberg","schain","schaedler","schabel","scaccia","saye","saurez","sasseen","sasnett","sarti","sarra","sarber","santoy","santeramo","sansoucy","sando","sandles","sandau","samra","samaha","salizar","salam","saindon","sagaser","saeteun","sadusky","sackman","sabater","saas","ruthven","ruszkowski","rusche","rumpf","ruhter","ruhenkamp","rufo","rudge","ruddle","rowlee","rowand","routhier","rougeot","rotramel","rotan","rosten","rosillo","rookard","roode","rongstad","rollie","roider","roffe","roettger","rodick","rochez","rochat","rivkin","rivadeneira","riston","risso","rinderknecht","riis","riggsbee","rieker","riegle","riedy","richwine","richmon","ricciuti","riccardo","ricardson","rhew","revier","remsberg","remiszewski","rembold","rella","reinken","reiland","reidel","reichart","rehak","redway","rednour","redifer","redgate","redenbaugh","redburn","readus","raybuck","rauhuff","rauda","ratte","rathje","rappley","rands","ramseyer","ramseur","ramsdale","ramo","ramariz","raitz","raisch","rainone","rahr","ragasa","rafalski","radunz","quenzer","queja","queenan","pyun","putzier","puskas","purrington","puri","punt","pullar","pruse","pring","primeau","prevette","preuett","prestage","pownell","pownall","potthoff","potratz","poth","poter","posthuma","posen","porritt","popkin","poormon","polidoro","polcyn","pokora","poer","pluviose","plock","pleva","placke","pioli","pingleton","pinchback","pieretti","piccone","piatkowski","philley","phibbs","phay","phagan","pfund","peyer","pettersen","petter","petrucelli","petropoulos","petras","petix","pester","pepperman","pennick","penado","pelot","pelis","peeden","pechon","peal","pazmino","patchin","pasierb","parran","parilla","pardy","parcells","paragas","paradee","papin","panko","pangrazio","pangelinan","pandya","pancheri","panas","palmiter","pallares","palinkas","palek","pagliaro","packham","pacitti","ozier","overbaugh","oursler","ouimette","otteson","otsuka","othon","osmundson","oroz","orgill","ordeneaux","orama","oppy","opheim","onkst","oltmanns","olstad","olofson","ollivier","olejniczak","okura","okuna","ohrt","oharra","oguendo","ogier","offermann","oetzel","oechsle","odoherty","oddi","ockerman","occhiogrosso","obryon","obremski","nyreen","nylund","nylen","nyholm","nuon","nuanes","norrick","noris","nordell","norbury","nooner","nomura","nole","nolden","nofsinger","nocito","niedbala","niebergall","nicolini","nevils","neuburger","nemerofsky","nemecek","nazareno","nastri","nast","nagorski","myre","muzzey","mutschler","muther","musumeci","muranaka","muramoto","murad","murach","muns","munno","muncrief","mugrage","muecke","mozer","moyet","mowles","mottern","mosman","mosconi","morine","morge","moravec","morad","mones","moncur","monarez","molzahn","moglia","moesch","mody","modisett","mitnick","mithcell","mitchiner","mistry","misercola","mirabile","minvielle","mino","minkler","minifield","minichiello","mindell","minasian","milteer","millwee","millstein","millien","mikrut","mihaly","miggins","michard","mezo","metzner","mesquita","merriwether","merk","merfeld","mercik","mercadante","menna","mendizabal","mender","melusky","melquist","mellado","meler","melendes","mekeel","meiggs","megginson","meck","mcwherter","mcwayne","mcsparren","mcrea","mcneff","mcnease","mcmurrin","mckeag","mchughes","mcguiness","mcgilton","mcelreath","mcelhone","mcelhenney","mceldowney","mccurtain","mccure","mccosker","mccory","mccormic","mccline","mccleave","mcclatchey","mccarney","mccanse","mcallen","mazzie","mazin","mazanec","mayette","mautz","maun","mattas","mathurin","mathiesen","massmann","masri","masias","mascolo","mascetti","mascagni","marzolf","maruska","martain","marszalek","marolf","marmas","marlor","markwood","marinero","marier","marich","marcom","marciante","marchman","marchio","marbach","manzone","mantey","mannina","manhardt","manaois","malmgren","mallonee","mallin","mallary","malette","makinson","makins","makarewicz","mainwaring","maiava","magro","magouyrk","magett","maeder","madyun","maduena","maden","madeira","mackins","mackel","macinnes","macia","macgowan","lyssy","lyerly","lyalls","lutter","lunney","luksa","ludeman","lucidi","lucci","lowden","lovier","loughridge","losch","lorson","lorenzano","lorden","lorber","lopardo","loosier","loomer","longsdorf","longchamps","loncar","loker","logwood","loeffelholz","lockmiller","livoti","linford","linenberger","lindloff","lindenbaum","limoges","liley","lighthill","lightbourne","lieske","leza","levandoski","leuck","lepere","leonhart","lenon","lemma","lemler","leising","leinonen","lehtinen","lehan","leetch","leeming","ledyard","ledwith","ledingham","leclere","leck","lebert","leandry","lazzell","layo","laye","laxen","lawther","lawerance","lavoy","lavertu","laverde","latouche","latner","lathen","laskin","lashbaugh","lascala","larroque","larick","laraia","laplume","lanzilotta","lannom","landrigan","landolt","landess","lamkins","lalla","lalk","lakeman","lakatos","laib","lahay","lagrave","lagerquist","lafoy","lafleche","lader","labrada","kwiecinski","kutner","kunshier","kulakowski","kujak","kuehnle","kubisiak","krzyminski","krugh","krois","kritikos","krill","kriener","krewson","kretzschmar","kretz","kresse","kreiter","kreischer","krebel","krans","kraling","krahenbuhl","kouns","kotson","kossow","kopriva","konkle","kolter","kolk","kolich","kohner","koeppen","koenigs","kock","kochanski","kobus","knowling","knouff","knoerzer","knippel","kloberdanz","kleinert","klarich","klaassen","kisamore","kirn","kiraly","kipps","kinson","kinneman","kington","kine","kimbriel","kille","kibodeaux","khamvongsa","keylon","kever","keser","kertz","kercheval","kendrix","kendle","kempt","kemple","keesey","keatley","kazmierski","kazda","kazarian","kawashima","katsch","kasun","kassner","kassem","kasperski","kasinger","kaschak","karels","kantola","kana","kamai","kalthoff","kalla","kalani","kahrs","kahanek","kacher","jurasek","jungels","jukes","juelfs","judice","juda","josselyn","jonsson","jonak","joens","jobson","jegede","jeanjacques","jaworowski","jaspers","jannsen","janner","jankowiak","jank","janiak","jackowski","jacklin","jabbour","iyer","iveson","isner","iniquez","ingwerson","ingber","imbrogno","ille","ikehara","iannelli","hyson","huxford","huseth","hurns","hurney","hurles","hunnings","humbarger","hulan","huisinga","hughett","hughen","hudler","hubiak","hricko","hoversten","hottel","hosaka","horsch","hormann","hordge","honzell","homburg","holten","holme","hollopeter","hollinsworth","hollibaugh","holberg","hohmann","hoenstine","hodell","hodde","hiter","hirko","hinzmann","hinrichsen","hinger","hincks","hilz","hilborn","highley","higashi","hieatt","hicken","heverly","hesch","hervert","hershkowitz","herreras","hermanns","herget","henriguez","hennon","hengel","helmlinger","helmig","heldman","heizer","heinitz","heifner","heidorn","heglin","heffler","hebner","heathman","heaslip","hazlip","haymes","hayase","hawver","havermale","havas","hauber","hashim","hasenauer","harvel","hartney","hartel","harsha","harpine","harkrider","harkin","harer","harclerode","hanzely","hanni","hannagan","hampel","hammerschmidt","hamar","hallums","hallin","hainline","haid","haggart","hafen","haer","hadiaris","hadad","hackford","habeeb","guymon","guttery","gunnett","guillette","guiliano","guilbeaux","guiher","guignard","guerry","gude","gucman","guadian","grzybowski","grzelak","grussendorf","grumet","gruenhagen","grudzinski","grossmann","grof","grisso","grisanti","griffitts","griesbaum","grella","gregston","graveline","grandusky","grandinetti","gramm","goynes","gowing","goudie","gosman","gort","gorsline","goralski","goodstein","goodroe","goodlin","goodheart","goodhart","gonzelez","gonthier","goldsworthy","goldade","goettel","goerlitz","goepfert","goehner","goben","gobeille","gliem","gleich","glasson","glascoe","gladwell","giusto","girdner","gipple","giller","giesing","giammona","ghormley","germon","geringer","gergely","gerberich","gepner","gens","genier","gemme","gelsinger","geigle","gebbia","gayner","gavitt","gatrell","gastineau","gasiewski","gascoigne","garro","garin","ganong","ganga","galpin","gallus","galizia","gajda","gahm","gagen","gaffigan","furno","furnia","furgason","fronczak","frishman","friess","frierdich","freestone","franta","frankovich","fors","forres","forrer","florido","flis","flicek","flens","flegal","finkler","finkenbinder","finefrock","filpo","filion","fierman","fieldman","ferreyra","fernendez","fergeson","fera","fencil","feith","feight","federici","federer","fechtner","feagan","fausnaugh","faubert","fata","farman","farinella","fantauzzi","fanara","falso","falardeau","fagnani","fabro","excell","ewton","evey","everetts","evarts","etherington","estremera","estis","estabrooks","essig","esplin","espenschied","ernzen","eppes","eppard","entwisle","emison","elison","elguezabal","eledge","elbaz","eisler","eiden","eichorst","eichert","egle","eggler","eggimann","edey","eckerman","echelberger","ebbs","ebanks","dziak","dyche","dyce","dusch","duross","durley","durate","dunsworth","dumke","dulek","duhl","duggin","dufford","dudziak","ducrepin","dubree","dubre","dubie","dubas","droste","drisko","drewniak","doxtator","dowtin","downum","doubet","dottle","dosier","doshi","dorst","dorset","dornbusch","donze","donica","domanski","domagala","dohse","doerner","doerfler","doble","dobkins","dilts","digiulio","digaetano","dietzel","diddle","dickel","dezarn","devoy","devoss","devilla","devere","deters","desvergnes","deshay","desena","deross","depedro","densley","demorest","demore","demora","demirjian","demerchant","dematteis","demateo","delgardo","delfavero","delaurentis","delamar","delacy","deitrich","deisher","degracia","degraaf","defries","defilippis","decoursey","debruin","debiasi","debar","dearden","dealy","dayhoff","davino","darvin","darrisaw","darbyshire","daquino","daprile","danh","danahy","dalsanto","dallavalle","dagel","dadamo","dacy","dacunha","dabadie","czyz","cutsinger","curney","cuppernell","cunliffe","cumby","cullop","cullinane","cugini","cudmore","cuda","cucuzza","cuch","crumby","crouser","critton","critchley","cremona","cremar","crehan","creary","crasco","crall","crabbe","cozzolino","cozier","coyner","couvillier","counterman","coulthard","coudriet","cottom","corzo","cornutt","corkran","corda","copelin","coonan","consolo","conrow","conran","connerton","conkwright","condren","comly","comisky","colli","collet","colello","colbeck","colarusso","coiner","cohron","codere","cobia","clure","clowser","clingenpeel","clenney","clendaniel","clemenson","cleere","cleckler","claybaugh","clason","cirullo","ciraulo","ciolek","ciampi","christopherse","chovanec","chopra","chol","chiem","chestnutt","chesterman","chernoff","chermak","chelette","checketts","charpia","charo","chargois","champman","challender","chafins","cerruto","celi","cazenave","cavaluzzi","cauthon","caudy","catino","catano","cassaro","cassarino","carrano","carozza","carow","carmickle","carlyon","carlew","cardena","caputi","capley","capalbo","canseco","candella","campton","camposano","calleros","calleja","callegari","calica","calarco","calais","caillier","cahue","cadenhead","cadenas","cabera","buzzo","busto","bussmann","busenbark","burzynski","bursley","bursell","burle","burkleo","burkette","burczyk","bullett","buikema","buenaventura","buege","buechel","budreau","budhram","bucknam","brye","brushwood","brumbalow","brulotte","bruington","bruderer","brougher","bromfield","broege","brodhead","brocklesby","broadie","brizuela","britz","brisendine","brilla","briggeman","brierton","bridgeford","breyfogle","brevig","breuninger","bresse","bresette","brelsford","breitbach","brayley","braund","branscom","brandner","brahm","braboy","brabble","bozman","boyte","boynes","boyken","bowell","bowan","boutet","bouse","boulet","boule","bottcher","bosquez","borrell","boria","bordes","borchard","bonson","bonino","bonas","bonamico","bolstad","bolser","bollis","bolich","bolf","boker","boileau","bohac","bogucki","bogren","boeger","bodziony","bodo","bodley","boback","blyther","blenker","blazina","blase","blamer","blacknall","blackmond","bitz","biser","biscardi","binz","bilton","billotte","billafuerte","bigford","biegler","bibber","bhandari","beyersdorf","bevelle","bettendorf","bessard","bertsche","berne","berlinger","berish","beranek","bentson","bentsen","benskin","benoy","benoist","benitz","belongia","belmore","belka","beitzel","beiter","beitel","behrns","becka","beaudion","beary","beare","beames","beabout","beaber","bazzano","bazinet","baucum","batrez","baswell","bastos","bascomb","bartha","barstad","barrilleaux","barretto","barresi","barona","barkhurst","barke","bardales","barczak","barca","barash","banfill","balonek","balmes","balko","balestrieri","baldino","baldelli","baken","baiza","bahner","baek","badour","badley","badia","backmon","bacich","bacca","ayscue","aynes","ausiello","auringer","auiles","aspinwall","askwith","artiga","arroliga","arns","arman","arellanes","aracena","antwine","antuna","anselmi","annen","angelino","angeli","angarola","andrae","amodio","ameen","alwine","alverio","altro","altobello","altemus","alquicira","allphin","allemand","allam","alessio","akpan","akerman","aiona","agyeman","agredano","adamik","adamczak","acrey","acevado","abreo","abrahamsen","abild","zwicker","zweig","zuvich","zumpano","zuluaga","zubek","zornes","zoglmann","ziminski","zimbelman","zhanel","zenor","zechman","zauner","zamarron","zaffino","yusuf","ytuarte","yett","yerkovich","yelder","yasuda","yapp","yaden","yackley","yaccarino","wytch","wyre","wussow","worthing","wormwood","wormack","wordell","woodroof","woodington","woodhams","wooddell","wollner","wojtkowski","wojcicki","wogan","wlodarczyk","wixted","withington","withem","wisler","wirick","winterhalter","winski","winne","winemiller","wimett","wiltfong","willibrand","willes","wilkos","wilbon","wiktor","wiggers","wigg","wiegmann","wickliff","wiberg","whittler","whittenton","whitling","whitledge","whitherspoon","whiters","whitecotton","whitebird","wheary","wetherill","westmark","westaby","wertenberger","wentland","wenstrom","wenker","wellen","weier","wegleitner","wedekind","wawers","wassel","warehime","wandersee","waltmon","waltersheid","walbridge","wakely","wakeham","wajda","waithe","waidelich","wahler","wahington","wagster","wadel","vuyovich","vuolo","vulich","vukovich","volmer","vollrath","vollbrecht","vogelgesang","voeller","vlach","vivar","vitullo","vitanza","visker","visalli","viray","vinning","viniard","villapando","villaman","vier","viar","viall","verstraete","vermilya","verdon","venn","velten","velis","vanoven","vanorder","vanlue","vanheel","vanderwoude","vanderheide","vandenheuvel","vandenbos","vandeberg","vandal","vanblarcom","vanaken","vanacker","vallian","valine","valent","vaine","vaile","vadner","uttech","urioste","urbanik","unrath","unnasch","underkofler","uehara","tyrer","tyburski","twaddle","turntine","tunis","tullock","tropp","troilo","tritsch","triola","trigo","tribou","tribley","trethewey","tress","trela","treharne","trefethen","trayler","trax","traut","tranel","trager","traczyk","towsley","torrecillas","tornatore","tork","torivio","toriello","tooles","tomme","tolosa","tolen","toca","titterington","tipsword","tinklenberg","tigney","tigert","thygerson","thurn","thur","thorstad","thornberg","thoresen","thomaston","tholen","thicke","theiler","thebeau","theaux","thaker","tewani","teufel","tetley","terrebonne","terrano","terpening","tela","teig","teichert","tegethoff","teele","tatar","tashjian","tarte","tanton","tanimoto","tamimi","tamas","talman","taal","szydlowski","szostak","swoyer","swerdlow","sweeden","sweda","swanke","swander","suyama","suriano","suri","surdam","suprenant","sundet","summerton","sult","suleiman","suffridge","suby","stych","studeny","strupp","struckman","strief","strictland","stremcha","strehl","stramel","stoy","stoutamire","storozuk","stordahl","stopher","stolley","stolfi","stoeger","stockhausen","stjulian","stivanson","stinton","stinchfield","stigler","stieglitz","stgermaine","steuer","steuber","steuart","stepter","stepnowski","stepanian","steimer","stefanelli","stebner","stears","steans","stayner","staubin","statz","stasik","starn","starmer","stargel","stanzione","stankovich","stamour","staib","stadelman","stadel","stachura","squadrito","springstead","spragg","spigelmyer","spieler","spaur","sovocool","soundara","soulia","souffrant","sorce","sonkin","sodhi","soble","sniffen","smouse","smittle","smithee","smedick","slowinski","slovacek","slominski","skowronek","skokan","skanes","sivertson","sinyard","sinka","sinard","simonin","simonian","simmions","silcott","silberg","siefken","siddon","shuttlesworth","shubin","shubeck","shiro","shiraki","shipper","shina","shilt","shikles","shideler","shenton","shelvey","shellito","shelhorse","shawcroft","shatto","shanholtzer","shamonsky","shadden","seymer","seyfarth","setlock","serratos","serr","sepulueda","senay","semmel","semans","selvig","selkirk","selk","seligson","seldin","seiple","seiersen","seidling","seidensticker","secker","searson","scordo","scollard","scoggan","scobee","sciandra","scialdone","schwimmer","schwieger","schweer","schwanz","schutzenhofer","schuetze","schrodt","schriever","schriber","schremp","schrecongost","schraeder","schonberg","scholtz","scholle","schoettle","schoenemann","schoene","schnitker","schmuhl","schmith","schlotterbeck","schleppenbach","schlee","schickel","schibi","schein","scheide","scheibe","scheib","schaumberg","schardein","schaalma","scantlin","scantlebury","sayle","sausedo","saurer","sassone","sarracino","saric","sanz","santarpia","santano","santaniello","sangha","sandvik","sandoral","sandobal","sandercock","sanantonio","salviejo","salsberry","salois","salazer","sagon","saglibene","sagel","sagal","saetern","saefong","sadiq","sabori","saballos","rygiel","rushlow","runco","rulli","ruller","ruffcorn","ruess","ruebush","rudlong","rudin","rudgers","rudesill","ruderman","rucki","rucinski","rubner","rubinson","rubiano","roznowski","rozanski","rowson","rower","rounsaville","roudabush","rotundo","rothell","rotchford","rosiles","roshak","rosetti","rosenkranz","rorer","rollyson","rokosz","rojek","roitman","rohrs","rogel","roewe","rodriges","rodocker","rodgerson","rodan","rodak","rocque","rochholz","robicheau","robbinson","roady","ritchotte","ripplinger","rippetoe","ringstaff","ringenberg","rinard","rigler","rightmire","riesen","riek","ridges","richner","richberg","riback","rial","rhyner","rhees","resse","renno","rendleman","reisz","reisenauer","reinschmidt","reinholt","reinard","reifsnyder","rehfeld","reha","regester","reffitt","redler","rediske","reckner","reckart","rebolloso","rebollar","reasonover","reasner","reaser","reano","reagh","raval","ratterman","ratigan","rater","rasp","raneses","randolf","ramil","ramdas","ramberg","rajaniemi","raggio","ragel","ragain","rade","radaker","racioppi","rabinovich","quickle","quertermous","queal","quartucci","quander","quain","pynes","putzel","purl","pulizzi","pugliares","prusak","prueter","protano","propps","primack","prieur","presta","preister","prawl","pratley","pozzo","powless","povey","pottorf","pote","postley","porzio","portney","ponzi","pontoriero","ponto","pont","poncedeleon","polimeni","polhamus","polan","poetker","poellnitz","podgurski","plotts","pliego","plaugher","plantenberg","plair","plagmann","pizzitola","pittinger","pitcavage","pischke","piontek","pintar","pinnow","pinneo","pinley","pingel","pinello","pimenta","pillard","piker","pietras","piere","phillps","pfleger","pfahl","pezzuti","petruccelli","petrello","peteet","pescatore","peruzzi","perusse","perotta","perona","perini","perelman","perciful","peppin","pennix","pennino","penalosa","pemble","pelz","peltzer","pelphrey","pelote","pellum","pellecchia","pelikan","peitz","pebworth","peary","pawlicki","pavelich","paster","pasquarella","paskey","paseur","paschel","parslow","parrow","parlow","parlett","parler","pargo","parco","paprocki","panepinto","panebianco","pandy","pandey","pamphile","pamintuan","pamer","paluso","paleo","paker","pagett","paczkowski","ozburn","ovington","overmeyer","ouellet","osterlund","oslin","oseguera","osaki","orrock","ormsbee","orlikowski","organista","oregan","orebaugh","orabuena","openshaw","ontiveroz","ondo","omohundro","ollom","ollivierre","olivencia","oley","olazabal","okino","offenberger","oestmann","ocker","obar","oakeson","nuzum","nurre","nowinski","novosel","norquist","nordlie","noorani","nonnemacher","nolder","njoku","niznik","niwa","niss","ninneman","nimtz","niemczyk","nieder","nicolo","nichlos","niblack","newtown","newill","newcom","neverson","neuhart","neuenschwande","nestler","nenno","nejman","neiffer","neidlinger","neglia","nazarian","navor","nary","narayan","nangle","nakama","naish","naik","nadolski","muscato","murphrey","murdick","murchie","muratalla","munnis","mundwiller","muncey","munce","mullenbach","mulhearn","mulcahey","muhammed","muchow","mountford","moudry","mosko","morvay","morrical","morr","moros","mormann","morgen","moredock","morden","mordarski","moravek","morandi","mooradian","montejo","montegut","montan","monsanto","monford","moncus","molinas","molek","mohd","moehrle","moehring","modzeleski","modafferi","moala","moake","miyahira","mitani","mischel","minges","minella","mimes","milles","milbrett","milanes","mikolajczyk","mikami","meucci","metler","methven","metge","messmore","messerschmidt","mesrobian","meservey","merseal","menor","menon","menear","melott","melley","melfi","meinhart","megivern","megeath","meester","meeler","meegan","medoff","medler","meckley","meath","mearns","mcquigg","mcpadden","mclure","mckellips","mckeithen","mcglathery","mcginnes","mcghan","mcdonel","mccullom","mccraken","mccrackin","mcconathy","mccloe","mcclaughry","mcclaflin","mccarren","mccaig","mcaulay","mcaffee","mazzuca","maytubby","mayner","maymi","mattiello","matthis","matthees","matthai","mathiason","mastrogiovann","masteller","mashack","marucci","martorana","martiniz","marter","martellaro","marsteller","marris","marrara","maroni","marolda","marocco","maritn","maresh","maready","marchione","marbut","maranan","maragno","mapps","manrriquez","mannis","manni","mangina","manganelli","mancera","mamon","maloch","mallozzi","maller","majchrzak","majano","mainella","mahanna","maertens","madon","macumber","macioce","machuga","machlin","machala","mabra","lybbert","luvert","lutts","luttrull","lupez","lukehart","ludewig","luchsinger","lovecchio","louissaint","loughney","lostroh","lorton","lopeman","loparo","londo","lombera","lokietek","loiko","lohrenz","lohan","lofties","locklar","lockaby","lobianco","llano","livesey","litster","liske","linsky","linne","lindbeck","licudine","leyua","levie","leonelli","lenzo","lenze","lents","leitao","leidecker","leibold","lehne","legan","lefave","leehy","ledue","lecount","lecea","leadley","lazzara","lazcano","lazalde","lavi","lavancha","lavan","latu","latty","lato","larranaga","lapidus","lapenta","langridge","langeveld","langel","landowski","landgren","landfried","lamattina","lallier","lairmore","lahaie","lagazo","lagan","lafoe","lafluer","laflame","lafevers","lada","lacoss","lachney","labreck","labreche","labay","kwasnik","kuzyk","kutzner","kushnir","kusek","kurtzman","kurian","kulhanek","kuklinski","kueny","kuczynski","kubitz","kruschke","krous","krompel","kritz","krimple","kriese","krenzer","kreis","kratzke","krane","krage","kraebel","kozub","kozma","kouri","koudelka","kotcher","kotas","kostic","kosh","kosar","kopko","kopka","kooy","konigsberg","konarski","kolmer","kohlmeyer","kobbe","knoop","knoedler","knocke","knipple","knippenberg","knickrehm","kneisel","kluss","klossner","klipfel","klawiter","klasen","kittles","kissack","kirtland","kirschenmann","kirckof","kiphart","kinstler","kinion","kilton","killman","kiehl","kief","kett","kesling","keske","kerstein","kepple","keneipp","kempson","kempel","kehm","kehler","keeran","keedy","kebert","keast","kearbey","kawaguchi","kaupu","kauble","katzenbach","katcher","kartes","karpowicz","karpf","karban","kanzler","kanarek","kamper","kaman","kalsow","kalafut","kaeser","kaercher","kaeo","kaeding","jurewicz","julson","jozwick","jollie","johnigan","johll","jochum","jewkes","jestes","jeska","jereb","jaurez","jarecki","jansma","janosik","jandris","jamin","jahr","jacot","ivens","itson","isenhower","iovino","ionescu","ingrum","ingels","imrie","imlay","ihlenfeld","ihde","igou","ibach","huyett","huppe","hultberg","hullihen","hugi","hueso","huesman","hsiao","hronek","hovde","housewright","houlahan","hougham","houchen","hostler","hoster","hosang","hornik","hornes","horio","honyumptewa","honeyman","honer","hommerding","holsworth","hollobaugh","hollinshead","hollands","hollan","holecek","holdorf","hokes","hogston","hoesly","hodkinson","hodgman","hodgens","hochstedler","hochhauser","hobbie","hoare","hnat","hiskey","hirschy","hinostroza","hink","hing","hillmer","hillian","hillerman","hietala","hierro","hickling","hickingbottom","heye","heubusch","hesselschward","herriot","hernon","hermida","hermans","hentschel","henningson","henneke","henk","heninger","heltsley","helmle","helminiak","helmes","hellner","hellmuth","helke","heitmeyer","heird","heinle","heinicke","heinandez","heimsoth","heibel","hegyi","heggan","hefel","heeralall","hedrington","heacox","hazlegrove","hazelett","haymore","havenhill","hautala","hascall","harvie","hartrick","hartling","harrer","harles","hargenrader","hanshew","hanly","hankla","hanisch","hancox","hammann","hambelton","halseth","hallisey","halleck","hallas","haisley","hairr","hainey","hainer","hailstock","haertel","guzek","guyett","guster","gussler","gurwitz","gurka","gunsolus","guinane","guiden","gugliotti","guevin","guevarra","guerard","gudaitis","guadeloupe","gschwind","grupe","grumbach","gruenes","gruenberg","grom","grodski","groden","grizzel","gritten","griswald","grishaber","grinage","grimwood","grims","griffon","griffies","gribben","gressley","gren","greenstreet","grealish","gravett","grantz","granfield","granade","gowell","gossom","gorsky","goring","goodnow","goodfriend","goodemote","golob","gollnick","golladay","goldwyn","goldsboro","golds","goldrick","gohring","gohn","goettsch","goertzen","goelz","godinho","goans","glumac","gleisner","gleen","glassner","glanzer","gladue","gjelaj","givhan","girty","girone","girgenti","giorgianni","gilpatric","gillihan","gillet","gilbar","gierut","gierhart","gibert","gianotti","giannetto","giambanco","gharing","geurts","gettis","gettel","gest","germani","gerdis","gerbitz","geppert","gennings","gemmer","gelvin","gellert","gehler","geddings","gearon","geach","gazaille","gayheart","gauld","gaukel","gaudio","gathing","gasque","garstka","garsee","garringer","garofano","garo","garnsey","garigen","garcias","garbe","ganoung","ganfield","ganaway","gamero","galuska","galster","gallacher","galinski","galimi","galik","galeazzi","galdo","galdames","galas","galanis","gaglio","gaeddert","gadapee","fussner","furukawa","fuhs","fuerte","fuerstenberg","fryrear","froese","fringer","frieson","friesenhahn","frieler","friede","freymuth","freyman","freudenberg","freman","fredricksen","frech","frasch","frantum","frankin","franca","frago","fragnoli","fouquet","fossen","foskett","forner","formosa","formisano","fooks","fons","folino","flott","flesch","flener","flemmons","flanagin","flamino","flamand","fitzerald","findling","filsinger","fillyaw","fillinger","fiechter","ferre","ferdon","feldkamp","fazzio","favia","faulconer","faughnan","faubel","fassler","faso","farrey","farrare","farnworth","farland","fairrow","faille","faherty","fagnant","fabula","fabbri","eylicio","esteve","estala","espericueta","escajeda","equia","enrriquez","enomoto","enmon","engemann","emmerson","emmel","emler","elstad","ellwein","ellerson","eliott","eliassen","elchert","eisenbeis","eisel","eikenberry","eichholz","ehmer","edgerson","echenique","eberley","eans","dziuk","dykhouse","dworak","dutt","dupas","duntz","dunshee","dunovant","dunnaway","dummermuth","duerson","ducotey","duchon","duchesneau","ducci","dubord","duberry","dubach","drummonds","droege","drish","drexel","dresch","dresbach","drenner","drechsler","dowen","dotter","dosreis","doser","dorward","dorin","dorf","domeier","doler","doleman","dolbow","dolbin","dobrunz","dobransky","dobberstein","dlouhy","diosdado","dingmann","dimmer","dimarino","dimaria","dillenburg","dilaura","dieken","dickhaus","dibbles","dibben","diamante","dewilde","dewaard","devich","devenney","devaux","dettinger","desroberts","dershem","dersch","derita","derickson","depina","deorio","deoliveira","denzler","dentremont","denoble","demshar","demond","demint","demichele","demel","delzer","delval","delorbe","delli","delbridge","delanoy","delancy","delahoya","dekle","deitrick","deis","dehnert","degrate","defrance","deetz","deeg","decoster","decena","dearment","daughety","datt","darrough","danzer","danielovich","dandurand","dancause","dalo","dalgleish","daisley","dadlani","daddona","daddio","dacpano","cyprian","cutillo","curz","curvin","cuna","cumber","cullom","cudworth","cubas","crysler","cryderman","crummey","crumbly","crookshanks","croes","criscione","crespi","cresci","creaser","craton","cowin","cowdrey","coutcher","cotterman","cosselman","cosgriff","cortner","corsini","corporan","corniel","cornick","cordts","copening","connick","conlisk","conelli","comito","colten","colletta","coldivar","colclasure","colantuono","colaizzi","coggeshall","cockman","cockfield","cobourn","cobo","cobarrubias","clyatt","cloney","clonch","climes","cleckner","clearo","claybourne","clavin","claridge","claffey","ciufo","cisnero","cipollone","cieslik","ciejka","cichocki","cicchetti","cianflone","chrusciel","christesen","chmielowiec","chirino","chillis","chhoun","chevas","chehab","chaviano","chavaria","chasten","charbonnet","chanley","champoux","champa","chalifoux","cerio","cedotal","cech","cavett","cavendish","catoire","castronovo","castellucci","castellow","castaner","casso","cassels","cassatt","cassar","cashon","cartright","carros","carrisalez","carrig","carrejo","carnicelli","carnett","carlise","carhart","cardova","cardell","carchi","caram","caquias","capper","capizzi","capano","cannedy","campese","calvello","callon","callins","callies","callicutt","calix","calin","califf","calderaro","caldeira","cadriel","cadmus","cadman","caccamise","buttermore","butay","bustamente","busa","burmester","burkard","burhans","burgert","bure","burdin","bullman","bulin","buelna","buehner","budin","buco","buckhanon","bryars","brutger","brus","brumitt","brum","bruer","brucato","broyhill","broy","brownrigg","brossart","brookings","broden","brocklehurst","brockert","bristo","briskey","bringle","bries","bressman","branyan","brands","bramson","brammell","brallier","bozich","boysel","bowthorpe","bowron","bowin","boutilier","boulos","boullion","boughter","bottiglieri","borruso","borreggine","borns","borkoski","borghese","borenstein","boran","booton","bonvillain","bonini","bonello","bolls","boitnott","boike","bohnet","bohnenkamp","bohmer","boeson","boeneke","bodey","bocchino","bobrowski","bobic","bluestein","bloomingdale","blogg","blewitt","blenman","bleck","blaszak","blankenbeckle","blando","blanchfield","blancato","blalack","blakenship","blackett","bisping","birkner","birckhead","bingle","bineau","billiel","bigness","bies","bierer","bhalla","beyerlein","betesh","besler","berzins","bertalan","berntsen","bergo","berganza","bennis","benney","benkert","benjamen","benincasa","bengochia","bendle","bendana","benchoff","benbrook","belsito","belshaw","belinsky","belak","beigert","beidleman","behen","befus","beel","bedonie","beckstrand","beckerle","beato","bauguess","baughan","bauerle","battis","batis","bastone","bassetti","bashor","bary","bartunek","bartoletti","barro","barno","barnicle","barlage","barkus","barkdull","barcellos","barbarino","baranski","baranick","bankert","banchero","bambrick","bamberg","bambenek","balthrop","balmaceda","ballman","balistrieri","balcomb","balboni","balbi","bagner","bagent","badasci","bacot","bache","babione","babic","babers","babbs","avitabile","avers","avena","avance","ausley","auker","audas","aubut","athearn","atcheson","astorino","asplund","aslanian","askari","ashmead","asby","asai","arterbury","artalejo","arqueta","arquero","arostegui","arnell","armeli","arista","arender","arca","arballo","aprea","applen","applegarth","apfel","antonello","antolin","antkowiak","angis","angione","angerman","angelilli","andujo","andrick","anderberg","amigon","amalfitano","alviso","alvez","altice","altes","almarez","allton","allston","allgeyer","allegretti","aliaga","algood","alberg","albarez","albaladejo","akre","aitkin","ahles","ahlberg","agnello","adinolfi","adamis","abramek","abolt","abitong","zurawski","zufall","zubke","zizzo","zipperer","zinner","zinda","ziller","zill","zevallos","zesati","zenzen","zentner","zellmann","zelinsky","zboral","zarcone","zapalac","zaldana","zakes","zaker","zahniser","zacherl","zabawa","zabaneh","youree","younis","yorty","yonce","yero","yerkey","yeck","yeargan","yauch","yashinski","yambo","wrinn","wrightsman","worton","wortley","worland","woolworth","woolfrey","woodhead","woltjer","wolfenden","wolden","wolchesky","wojick","woessner","witters","witchard","wissler","wisnieski","wisinski","winnike","winkowski","winkels","wingenter","wineman","winegardner","wilridge","wilmont","willians","williamsen","wilhide","wilhelmsen","wilhelmi","wildrick","wilden","wiland","wiker","wigglesworth","wiebusch","widdowson","wiant","wiacek","whittet","whitelock","whiteis","whiley","westrope","westpfahl","westin","wessman","wessinger","wesemann","wesby","wertheimer","weppler","wenke","wengler","wender","welp","weitzner","weissberg","weisenborn","weipert","weiman","weidmann","wehrsig","wehrenberg","weemes","weeman","wayner","waston","wasicek","wascom","wasco","warmath","warbritton","waltner","wallenstein","waldoch","waldal","wala","waide","wadlinger","wadhams","vullo","voorheis","vonbargen","volner","vollstedt","vollman","vold","voge","vittorio","violett","viney","vinciguerra","vinal","villata","villarrvel","vilanova","vigneault","vielma","veyna","vessella","versteegh","verderber","venier","venditti","velotta","vejarano","vecchia","vecchi","vastine","vasguez","varella","vanry","vannah","vanhyning","vanhuss","vanhoff","vanhoesen","vandivort","vandevender","vanderlip","vanderkooi","vandebrink","vancott","vallien","vallas","vallandingham","valiquette","valasek","vahey","vagott","uyematsu","urbani","uran","umbach","tyon","tyma","twyford","twombley","twohig","tutterrow","turnes","turkington","turchi","tunks","tumey","tumbaga","tuinstra","tsukamoto","tschetter","trussel","trubey","trovillion","troth","trostel","tron","trinka","trine","triarsi","treto","trautz","tragesser","tooman","toolson","tonozzi","tomkiewicz","tomasso","tolin","tolfree","toelle","tisor","tiry","tinstman","timmermann","tickner","tiburcio","thunberg","thronton","thompsom","theil","thayne","thaggard","teschner","tensley","tenery","tellman","tellado","telep","teigen","teator","teall","tayag","tavis","tattersall","tassoni","tarshis","tappin","tappe","tansley","talone","talford","tainter","taha","taguchi","tacheny","tabak","szymczyk","szwaja","szopinski","syvertsen","swogger","switcher","swist","swierczek","swiech","swickard","swiatek","swezey","swepson","sweezy","swaringen","swanagan","swailes","swade","sveum","svenningsen","svec","suttie","supry","sunga","summerhill","summars","sulit","stys","stutesman","stupak","stumpo","stuller","stuekerjuerge","stuckett","stuckel","stuchlik","stuard","strutton","strop","stromski","stroebel","strehlow","strause","strano","straney","stoyle","stormo","stopyra","stoots","stonis","stoltenburg","stoiber","stoessel","stitzer","stien","stichter","stezzi","stewert","stepler","steinkraus","stegemann","steeples","steenburg","steeley","staszak","stasko","starkson","stanwick","stanke","stanifer","stangel","stai","squiers","spraglin","spragins","spraberry","spoelstra","spisak","spirko","spille","spidel","speyer","speroni","spenst","spartz","sparlin","sparacio","spaman","spainhower","souers","souchet","sosbee","sorn","sorice","sorbo","soqui","solon","soehl","sodergren","sobie","smucker","smsith","smoley","smolensky","smolenski","smolder","smethers","slusar","slowey","slonski","slemmons","slatkin","slates","slaney","slagter","slacum","skutnik","skrzypek","skibbe","sjostrom","sjoquist","sivret","sitko","sisca","sinnett","sineath","simoni","simar","simao","silvestro","silleman","silha","silfies","silberhorn","silacci","sigrist","sieczkowski","sieczka","shure","shulz","shugrue","shrode","shovlin","shortell","shonka","shiyou","shiraishi","shiplett","sheu","shermer","sherick","sheeks","shantz","shakir","shaheed","shadoan","shadid","shackford","shabot","seung","seufert","setty","setters","servis","serres","serrell","serpas","sensenig","senft","semenec","semas","semaan","selvera","sellmeyer","segar","seever","seeney","seeliger","seehafer","seebach","sebben","seaward","seary","searl","searby","scordino","scolieri","scolaro","schwiebert","schwartze","schwaner","schuur","schupbach","schumacker","schum","schudel","schubbe","schroader","schramel","schollmeyer","schoenherr","schoeffler","schoeder","schnurr","schnorr","schneeman","schnake","schnaible","schmaus","schlotter","schinke","schimming","schimek","schikora","scheulen","scherping","schermer","scherb","schember","schellhase","schedler","schanck","schaffhauser","schaffert","schadler","scarola","scarfo","scarff","scantling","scaff","sayward","sayas","saxbury","savel","savastano","sault","satre","sarkar","santellan","sandmeier","sampica","salvesen","saltis","salloum","salling","salce","salatino","salata","salamy","sadowsky","sadlier","sabbatini","sabatelli","sabal","sabados","rydzewski","rybka","rybczyk","rusconi","rupright","rufino","ruffalo","rudiger","rudig","ruda","rubyor","royea","roxberry","rouzer","roumeliotis","rossmann","rosko","rosene","rosenbluth","roseland","rosasco","rosano","rosal","rorabaugh","romie","romaro","rolstad","rollow","rohrich","roghair","rogala","roets","roen","roemmich","roelfs","roeker","roedl","roedel","rodeheaver","roddenberry","rockstad","rocchi","robirds","robben","robasciotti","robaina","rizzotto","rizzio","ritcher","rissman","riseden","ripa","rion","rintharamy","rinehimer","rinck","riling","rietschlin","riesenberg","riemenschneid","rieland","rickenbaugh","rickenbach","rhody","revells","reutter","respress","resnik","remmel","reitmeyer","reitan","reister","reinstein","reino","reinkemeyer","reifschneider","reierson","reichle","rehmeier","rehl","reeds","rede","recar","rebeiro","raybourn","rawl","rautio","raugust","raudenbush","raudales","rattan","rapuano","rapoport","rantanen","ransbottom","raner","ramkissoon","rambousek","raio","rainford","radakovich","rabenhorst","quivers","quispe","quinoes","quilici","quattrone","quates","quance","quale","purswell","purpora","pulera","pulcher","puckhaber","pryer","pruyne","pruit","prudencio","prows","protzman","prothero","prosperi","prospal","privott","pritchet","priem","prest","prell","preer","pree","preddy","preda","pravata","pradhan","potocki","postier","postema","posadas","poremba","popichak","ponti","pomrenke","pomarico","pollok","polkinghorn","polino","pock","plater","plagman","pipher","pinzone","pinkleton","pillette","pillers","pilapil","pignone","pignatelli","piersol","piepho","picton","pickrel","pichard","picchi","piatek","pharo","phanthanouvon","pettingill","pettinato","petrovits","pethtel","petersheim","pershing","perrez","perra","pergram","peretz","perego","perches","pennello","pennella","pendry","penaz","pellish","pecanty","peare","paysour","pavlovich","pavick","pavelko","paustian","patzer","patete","patadia","paszkiewicz","pase","pasculli","pascascio","parrotte","parajon","paparo","papandrea","paone","pantaleon","panning","paniccia","panarello","palmeter","pallan","palardy","pahmeier","padget","padel","oxborrow","oveson","outwater","ottaway","otake","ostermeyer","osmer","osinski","osiecki","oroak","orndoff","orms","orkin","ordiway","opatz","onsurez","onishi","oliger","okubo","okoye","ohlmann","offord","offner","offerdahl","oesterle","oesch","odonnel","odeh","odebralski","obie","obermeier","oberhausen","obenshain","obenchain","nute","nulty","norrington","norlin","nore","nordling","nordhoff","norder","nordan","norals","nogales","noboa","nitsche","niermann","nienhaus","niedringhaus","niedbalski","nicolella","nicolais","nickleberry","nicewander","newfield","neurohr","neumeier","netterville","nersesian","nern","nerio","nerby","nerbonne","neitz","neidecker","neason","nead","navratil","naves","nastase","nasir","nasca","narine","narimatsu","nard","narayanan","nappo","namm","nalbone","nakonechny","nabarro","myott","muthler","muscatello","murriel","murin","muoio","mundel","munafo","mukherjee","muffoletto","muessig","muckey","mucher","mruk","moyd","mowell","mowatt","moutray","motzer","moster","morgenroth","morga","morataya","montross","montezuma","monterroza","montemarano","montello","montbriand","montavon","montaque","monigold","monforte","molgard","moleski","mohsin","mohead","mofield","moerbe","moeder","mochizuki","miyazaki","miyasaki","mital","miskin","mischler","minniear","minero","milosevic","mildenhall","mielsch","midden","michonski","michniak","michitsch","michelotti","micheli","michelfelder","michand","metelus","merkt","merando","meranda","mentz","meneley","menaker","melino","mehaffy","meehl","meech","meczywor","mcweeney","mcumber","mcredmond","mcneer","mcnay","mcmikle","mcmaken","mclaurine","mclauglin","mclaney","mckune","mckinnies","mckague","mchattie","mcgrapth","mcglothen","mcgath","mcfolley","mcdannell","mccurty","mccort","mcclymonds","mcclimon","mcclamy","mccaughan","mccartan","mccan","mccadden","mcburnie","mcburnett","mcbryar","mcannally","mcalevy","mcaleese","maytorena","mayrant","mayland","mayeaux","mauter","matthewson","mathiew","matern","matera","maslow","mashore","masaki","maruco","martorell","martenez","marrujo","marrison","maroun","markway","markos","markoff","markman","marello","marbry","marban","maphis","manuele","mansel","manganello","mandrell","mandoza","manard","manago","maltba","mallick","mallak","maline","malikowski","majure","majcher","maise","mahl","maffit","maffeo","madueno","madlem","madariaga","macvane","mackler","macconnell","macchi","maccarone","lyng","lynchard","lunning","luneau","lunden","lumbra","lumbert","lueth","ludington","luckado","lucchini","lucatero","luallen","lozeau","lowen","lovera","lovelock","louck","lothian","lorio","lorimer","lorge","loretto","longhenry","lonas","loiseau","lohrman","logel","lockie","llerena","livington","liuzzi","liscomb","lippeatt","liou","linhardt","lindelof","lindbo","limehouse","limage","lillo","lilburn","liggons","lidster","liddick","lich","liberato","leysath","lewelling","lesney","leser","lescano","leonette","lentsch","lenius","lemmo","lemming","lemcke","leggette","legerski","legard","leever","leete","ledin","lecomte","lecocq","leakes","leab","lazarz","layous","lawrey","lawery","lauze","lautz","laughinghouse","latulippe","lattus","lattanzio","lascano","larmer","laris","larcher","laprise","lapin","lapage","lano","langseth","langman","langland","landstrom","landsberg","landsaw","landram","lamphier","lamendola","lamberty","lakhani","lajara","lagrow","lagman","ladewig","laderman","ladden","lacrue","laclaire","lachut","lachner","kwit","kvamme","kvam","kutscher","kushi","kurgan","kunsch","kundert","kulju","kukene","kudo","kubin","kubes","kuberski","krystofiak","kruppa","krul","krukowski","kruegel","kronemeyer","krock","kriston","kretzer","krenn","kralik","krafft","krabill","kozisek","koverman","kovatch","kovarik","kotlowski","kosmala","kosky","kosir","kosa","korpi","kornbluth","koppen","kooistra","kohlhepp","kofahl","koeneman","koebel","koczur","kobrin","kobashigawa","koba","knuteson","knoff","knoble","knipper","knierim","kneisley","klusman","kloc","klitzing","klinko","klinefelter","klemetson","kleinpeter","klauser","klatte","klaren","klare","kissam","kirkhart","kirchmeier","kinzinger","kindt","kincy","kincey","kimoto","killingworth","kilcullen","kilbury","kietzman","kienle","kiedrowski","kidane","khamo","khalili","ketterling","ketchem","kessenich","kessell","kepp","kenon","kenning","kennady","kendzior","kemppainen","kellermann","keirns","keilen","keiffer","kehew","keelan","keawe","keator","kealy","keady","kathman","kastler","kastanes","kassab","karpin","karau","karathanasis","kaps","kaplun","kapaun","kannenberg","kanipe","kander","kandel","kanas","kanan","kamke","kaltenbach","kallenberger","kallam","kafton","kafer","kabler","kaaihue","jundt","jovanovich","jojola","johnstad","jodon","joachin","jinright","jessick","jeronimo","jenne","jelsma","jeannotte","jeangilles","jaworsky","jaubert","jarry","jarrette","jarreau","jarett","janos","janecka","janczak","jalomo","jagoda","jagla","jacquier","jaber","iwata","ivanoff","isola","iserman","isais","isaacks","inverso","infinger","ibsen","hyser","hylan","hybarger","hwee","hutchenson","hutchcroft","husar","hurlebaus","hunsley","humberson","hulst","hulon","huhtala","hugill","hugghins","huffmaster","huckeba","hrabovsky","howden","hoverson","houts","houskeeper","housh","hosten","horras","horchler","hopke","hooke","honie","holtsoi","holsomback","holoway","holmstead","hoistion","hohnstein","hoheisel","hoguet","hoggle","hogenson","hoffstetter","hoffler","hofe","hoefling","hoague","hizer","hirschfield","hironaka","hiraldo","hinote","hingston","hinaman","hillie","hillesheim","hilderman","hiestand","heyser","heys","hews","hertler","herrandez","heppe","henle","henkensiefken","henigan","henandez","henagan","hemberger","heman","helser","helmich","hellinger","helfrick","heldenbrand","heinonen","heineck","heikes","heidkamp","heglar","heffren","heelan","hedgebeth","heckmann","heckaman","hechmer","hazelhurst","hawken","haverkamp","havatone","hausauer","hasch","harwick","hartse","harrower","harle","hargroder","hardway","hardinger","hardemon","harbeck","hant","hamre","hamberg","hallback","haisten","hailstone","hahl","hagner","hagman","hagemeyer","haeussler","hackwell","haby","haataja","gverrero","gustovich","gustave","guske","gushee","gurski","gurnett","gura","gunto","gunselman","gugler","gudmundson","gudinas","guarneri","grumbine","gruis","grotz","grosskopf","grosman","grosbier","grinter","grilley","grieger","grewal","gressler","greaser","graus","grasman","graser","grannan","granath","gramer","graboski","goyne","gowler","gottwald","gottesman","goshay","gorr","gorovitz","gores","goossens","goodier","goodhue","gonzeles","gonzalos","gonnella","golomb","golick","golembiewski","goeke","godzik","goar","glosser","glendenning","glendening","glatter","glas","gittings","gitter","gisin","giscombe","gimlin","gillitzer","gillick","gilliand","gilb","gigler","gidden","gibeau","gibble","gianunzio","giannattasio","gertelman","gerosa","gerold","gerland","gerig","gerecke","gerbino","genz","genovesi","genet","gelrud","geitgey","geiszler","gehrlein","gawrys","gavilanes","gaulden","garthwaite","garmoe","gargis","gara","gannett","galligher","galler","galleher","gallahan","galford","gahn","gacek","gabert","fuster","furuya","furse","fujihara","fuhriman","frueh","fromme","froemming","friskney","frietas","freiler","freelove","freber","frear","frankl","frankenfield","franey","francke","foxworthy","formella","foringer","forgue","fonnesbeck","fonceca","folland","fodera","fode","floresca","fleurent","fleshner","flentge","fleischhacker","fleeger","flecher","flam","flaim","fivecoat","firebaugh","fioretti","finucane","filley","figuroa","figuerda","fiddelke","feurtado","fetterly","fessel","femia","feild","fehling","fegett","fedde","fechter","fawver","faulhaber","fatchett","fassnacht","fashaw","fasel","farrugia","farran","farness","farhart","fama","falwell","falvo","falkenstein","falin","failor","faigin","fagundo","fague","fagnan","fagerstrom","faden","eytchison","eyles","everage","evangelist","estrin","estorga","esponda","espindola","escher","esche","escarsega","escandon","erven","erding","eplin","enix","englade","engdahl","enck","emmette","embery","emberson","eltzroth","elsayed","ellerby","ellens","elhard","elfers","elazegui","eisermann","eilertson","eiben","ehrhard","ehresman","egolf","egnew","eggins","efron","effland","edminster","edgeston","eckstrom","eckhard","eckford","echoles","ebsen","eatherly","eastlick","earnheart","dykhuizen","dyas","duttweiler","dutka","dusenbury","dusenbery","durre","durnil","durnell","durie","durhan","durando","dupriest","dunsmoor","dunseith","dunnum","dunman","dunlevy","duma","dulude","dulong","duignan","dugar","dufek","ducos","duchaine","duch","dubow","drowne","dross","drollinger","droke","driggars","drawhorn","drach","drabek","doyne","doukas","dorvil","dorow","doroski","dornak","dormer","donnelson","donivan","dondero","dompe","dolle","doakes","diza","divirgilio","ditore","distel","disimone","disbro","dipiero","dingson","diluzio","dillehay","digiorgio","diflorio","dietzler","dietsch","dieterle","dierolf","dierker","dicostanzo","dicesare","dexheimer","dewitte","dewing","devoti","devincentis","devary","deutschman","dettloff","detienne","destasio","dest","despard","desmet","deslatte","desfosses","derise","derenzo","deppner","depolo","denoyer","denoon","denno","denne","deniston","denike","denes","demoya","demick","demicco","demetriou","demange","delva","delorge","delley","delisio","delhoyo","delgrande","delgatto","delcour","delair","deinert","degruy","degrave","degeyter","defino","deffenbaugh","deener","decook","decant","deboe","deblanc","deatley","dearmitt","deale","deaguiar","dayan","daus","dauberman","datz","dase","dary","dartt","darocha","dari","danowski","dancel","dami","dallmann","dalere","dalba","dakan","daise","dailing","dahan","dagnan","daggs","dagan","czarkowski","czaplinski","cutten","curtice","curenton","curboy","cura","culliton","culberth","cucchiara","cubbison","csaszar","crytser","crotzer","crossgrove","crosser","croshaw","crocco","critzer","creveling","cressy","creps","creese","cratic","craigo","craigen","craib","cracchiolo","crable","coykendall","cowick","coville","couzens","coutch","cousens","cousain","counselman","coult","cotterell","cott","cotham","corsaut","corriere","corredor","cornet","corkum","coreas","cordoza","corbet","corathers","conwill","contreas","consuegra","constanza","conolly","conedy","comins","combee","colosi","colom","colmenares","collymore","colleran","colina","colaw","colatruglio","colantro","colantonio","cohea","cogill","codner","codding","cockram","cocanougher","cobine","cluckey","clucas","cloward","cloke","clisham","clinebell","cliffe","clendenen","cisowski","cirelli","ciraolo","ciocca","cintora","ciesco","cibrian","chupka","chugg","christmann","choma","chiverton","chirinos","chinen","chimenti","chima","cheuvront","chesla","chesher","chesebro","chern","chehebar","cheatum","chastine","chapnick","chapelle","chambley","cercy","celius","celano","cayea","cavicchi","cattell","catanach","catacutan","castelluccio","castellani","cassmeyer","cassetta","cassada","caspi","cashmore","casebier","casanas","carrothers","carrizal","carriveau","carretero","carradine","carosella","carnine","carloni","carkhuff","cardosi","cardo","carchidi","caravello","caranza","carandang","cantrall","canpos","canoy","cannizzaro","canion","canida","canham","cangemi","cange","cancelliere","canard","camarda","calverley","calogero","callendar","calame","cadrette","cachero","caccavale","cabreros","cabrero","cabrara","cabler","butzer","butte","butrick","butala","bustios","busser","busic","bushorn","busher","burmaster","burkland","burkins","burkert","burgueno","burgraff","burel","burck","burby","bumford","bulock","bujnowski","buggie","budine","bucciero","bubier","brzoska","brydges","brumlow","brosseau","brooksher","brokke","broeker","brittin","bristle","briano","briand","brettschneide","bresnan","brentson","brenneis","brender","brazle","brassil","brasington","branstrom","branon","branker","brandwein","brandau","bralley","brailey","brague","brade","bozzi","bownds","bowmer","bournes","bour","bouchey","botto","boteler","borroel","borra","boroski","boothroyd","boord","bonga","bonato","bonadonna","bolejack","boldman","boiser","boggio","bogacki","boerboom","boehnlein","boehle","bodah","bobst","boak","bluemel","blockmon","blitch","blincoe","bleier","blaydes","blasius","bittel","binsfeld","bindel","bilotti","billiott","bilbrew","bihm","biersner","bielat","bidrowski","bickler","biasi","bhola","bhat","bewick","betzen","bettridge","betti","betsch","besley","beshero","besa","bertoli","berstein","berrien","berrie","berrell","bermel","berenguer","benzer","bensing","benedix","bemo","belile","beilman","behunin","behrmann","bedient","becht","beaule","beaudreault","bealle","beagley","bayuk","bayot","bayliff","baugess","battistoni","batrum","basinski","basgall","bartolomei","bartnik","bartl","bartko","bartholomay","barthlow","bartgis","barsness","barski","barlette","barickman","bargen","bardon","barcliff","barbu","barakat","baracani","baraban","banos","banko","bambach","balok","balogun","bally","baldini","balck","balcer","balash","baim","bailor","bahm","bahar","bagshaw","baggerly","badie","badal","backues","babino","aydelott","awbrey","aversano","avansino","auyon","aukamp","aujla","augenstein","astacio","asplin","asato","asano","aruizu","artale","arrick","arneecher","armelin","armbrester","armacost","arkell","argrave","areizaga","apolo","anzures","anzualda","antwi","antillon","antenor","annand","anhalt","angove","anglemyer","anglada","angiano","angeloni","andaya","ancrum","anagnos","ammirati","amescua","ambrosius","amacker","amacher","amabile","alvizo","alvernaz","alvara","altobelli","altobell","althauser","alterman","altavilla","alsip","almeyda","almeter","alman","allscheid","allaman","aliotta","aliberti","alghamdi","albiston","alberding","alarie","alano","ailes","ahsan","ahrenstorff","ahler","aerni","ackland","achor","acero","acebo","abshier","abruzzo","abrom","abood","abnet","abend","abegg","abbruzzese","aaberg","zysk","zutell","zumstein","zummo","zuhlke","zuehlsdorff","zuch","zucconi","zortman","zohn","zingone","zingg","zingale","zima","zientek","zieg","zervas","zerger","zenk","zeldin","zeiss","zeiders","zediker","zavodny","zarazua","zappone","zappala","zapanta","zaniboni","zanchi","zampedri","zaller","zakrajsek","zagar","zadrozny","zablocki","zable","yust","yunk","youngkin","yosten","yockers","yochim","yerke","yerena","yanos","wysinger","wyner","wrisley","woznicki","wortz","worsell","wooters","woon","woolcock","woodke","wonnacott","wolnik","wittstock","witting","witry","witfield","witcraft","wissmann","wissink","wisehart","wiscount","wironen","wipf","winterrowd","wingett","windon","windish","windisch","windes","wiltbank","willmarth","wiler","wieseler","wiedmaier","wiederstein","wiedenheft","wieberg","wickware","wickkiser","wickell","whittmore","whitker","whitegoat","whitcraft","whisonant","whisby","whetsell","whedon","westry","westcoat","wernimont","wentling","wendlandt","wencl","weisgarber","weininger","weikle","weigold","weigl","weichbrodt","wehrli","wehe","weege","weare","watland","wassmann","warzecha","warrix","warrell","warnack","waples","wantland","wanger","wandrei","wanat","wampole","waltjen","walterscheid","waligora","walding","waldie","walczyk","wakins","waitman","wair","wainio","wahpekeche","wahlman","wagley","wagenknecht","wadle","waddoups","wadding","vuono","vuillemot","vugteveen","vosmus","vorkink","vories","vondra","voelz","vlashi","vitelli","vitali","viscarra","vinet","vimont","villega","villard","vignola","viereck","videtto","vicoy","vessell","vescovi","verros","vernier","vernaglia","vergin","verdone","verdier","verastequi","vejar","vasile","vasi","varnadore","vardaro","vanzanten","vansumeren","vanschuyver","vanleeuwen","vanhowe","vanhoozer","vaness","vandewalker","vandevoorde","vandeveer","vanderzwaag","vanderweide","vanderhyde","vandellen","vanamburg","vanalst","vallin","valk","valentini","valcarcel","valasco","valadao","vacher","urquijo","unterreiner","unsicker","unser","unrau","undercoffler","uffelman","uemura","ueda","tyszko","tyska","tymon","tyce","tyacke","twinam","tutas","tussing","turmel","turkowski","turkel","turchetta","tupick","tukes","tufte","tufo","tuey","tuell","tuckerman","tsutsumi","tsuchiya","trossbach","trivitt","trippi","trippensee","trimbach","trillo","triller","trible","tribby","trevisan","tresch","tramonte","traff","trad","tousey","totaro","torregrosa","torralba","tolly","tofil","tofani","tobiassen","tiogangco","tino","tinnes","tingstrom","tingen","tindol","tifft","tiffee","tiet","thuesen","thruston","throndson","thornsbury","thornes","thiery","thielman","thie","theilen","thede","thate","thane","thalacker","thaden","teuscher","terracina","terell","terada","tepfer","tenneson","temores","temkin","telleria","teaque","tealer","teachey","tavakoli","tauras","taucher","tartaglino","tarpy","tannery","tani","tams","tamlin","tambe","tallis","talamante","takayama","takaki","taibl","taffe","tadesse","tade","tabeling","tabag","szoke","szoc","szala","szady","sysak","sylver","syler","swonger","swiggett","swensson","sweis","sweers","sweene","sweany","sweaney","swartwout","swamy","swales","susman","surman","sundblad","summerset","summerhays","sumerall","sule","sugimoto","subramanian","sturch","stupp","stunkard","stumpp","struiksma","stropes","stromyer","stromquist","strede","strazza","strauf","storniolo","storjohann","stonum","stonier","stonecypher","stoneberger","stollar","stokke","stokan","stoetzel","stoeckel","stockner","stockinger","stockert","stockdill","stobbe","stitzel","stitely","stirgus","stigers","stettner","stettler","sterlin","sterbenz","stemp","stelluti","steinmeyer","steininger","steinauer","steigerwalt","steider","stavrou","staufenberger","stassi","stankus","stanaway","stammer","stakem","staino","stahlnecker","stagnitta","staelens","staal","srsen","sprott","sprigg","sprenkle","sprenkel","spreitzer","spraque","sprandel","sporn","spivak","spira","spiewak","spieth","spiering","sperow","speh","specking","spease","spead","sparger","spanier","spall","sower","southcott","sosna","soran","sookram","sonders","solak","sohr","sohl","sofranko","soderling","sochor","sobon","smutz","smudrick","smithj","smid","slosser","sliker","slenker","sleger","slaby","skousen","skilling","skibinski","skees","skane","skafidas","sivic","sivertsen","sivers","sitra","sito","siracusa","sinicki","simpers","simley","simbeck","silberberg","siever","siegwarth","sidman","siddle","sibbett","shumard","shubrooks","shough","shorb","shoptaw","sholty","shoffstall","shiverdecker","shininger","shimasaki","shifrin","shiffler","sheston","sherr","shere","shepeard","shelquist","sheler","shauf","sharrar","sharpnack","shamsiddeen","shambley","shallenberger","shadler","shaban","sferra","seys","sexauer","sevey","severo","setlak","seta","sesko","sersen","serratore","serdula","senechal","seldomridge","seilhamer","seifer","seidlitz","sehnert","sedam","sebron","seber","sebek","seavers","scullark","scroger","scovill","sciascia","sciarra","schweers","schwarze","schummer","schultes","schuchardt","schuchard","schrieber","schrenk","schreifels","schowalter","schoultz","scholer","schofill","schoff","schnuerer","schnettler","schmitke","schmiege","schloop","schlinger","schlessman","schlesser","schlageter","schiess","schiefer","schiavoni","scherzer","scherich","schechtman","schebel","scharpman","schaich","schaap","scappaticci","scadlock","savocchia","savini","savers","savageau","sauvage","sause","sauerwein","sary","sarwary","sarnicola","santone","santoli","santalucia","santacruce","sansoucie","sankoff","sanes","sandri","sanderman","sammartano","salmonson","salmela","salmans","sallaz","salis","sakuma","sakowski","sajdak","sahm","sagredo","safrit","sackey","sabio","sabino","rybolt","ruzzo","ruthstrom","ruta","russin","russak","rusko","ruskin","rusiecki","ruscher","rupar","rumberger","rullan","ruliffson","ruhlman","rufenacht","ruelle","rudisell","rudi","rucci","rublee","ruberto","rubeck","rowett","rottinghaus","roton","rothgeb","rothgaber","rothermich","rostek","rossini","roskelley","rosing","rosi","rosewell","rosberg","roon","ronin","romesburg","romelus","rolley","rollerson","rollefson","rolins","rolens","rois","rohrig","rohrbacher","rohland","rohen","rogness","roes","roering","roehrick","roebke","rodregez","rodabaugh","rockingham","roblee","robel","roadcap","rizzolo","riviezzo","rivest","riveron","risto","rissler","rippentrop","ripka","rinn","ringuette","ringering","rindone","rindels","rieffer","riedman","riede","riecke","riebow","riddlebarger","rhome","rhodd","rhatigan","rhame","reyers","rewitzer","revalee","retzer","rettinger","reschke","requa","reper","reopell","renzelman","renne","renker","renk","renicker","rendina","rendel","remund","remmele","remiasz","remaklus","remak","reitsma","reitmeier","reiswig","reishus","reining","reim","reidinger","reick","reiche","regans","reffett","reesor","reekie","redpath","redditt","rechtzigel","recht","rearden","raynoso","raxter","ratkowski","rasulo","rassmussen","rassel","raser","rappleye","rappe","randrup","randleman","ramson","rampey","radziewicz","quirarte","quintyne","quickel","quattrini","quakenbush","quaile","pytel","pushaw","pusch","purslow","punzo","pullam","pugmire","puello","przekop","pruss","pruiett","provow","prophete","procaccini","pritz","prillaman","priess","pretlow","prestia","presha","prescod","preast","praytor","prashad","praino","pozzi","pottenger","potash","porada","popplewell","ponzo","ponter","pommier","polland","polidori","polasky","pola","poisso","poire","pofahl","podolsky","podell","plueger","plowe","plotz","plotnik","ploch","pliska","plessner","plaut","platzer","plake","pizzino","pirog","piquette","pipho","pioche","pintos","pinkert","pinet","pilkerton","pilch","pilarz","pignataro","piermatteo","picozzi","pickler","pickette","pichler","philogene","phare","phang","pfrogner","pfisterer","pettinelli","petruzzi","petrovic","petretti","petermeier","pestone","pesterfield","pessin","pesch","persky","perruzza","perrott","perritt","perretti","perrera","peroutka","peroni","peron","peret","perdew","perazzo","peppe","peno","penberthy","penagos","peles","pelech","peiper","peight","pefferman","peddie","peckenpaugh","pean","payen","pavloski","pavlica","paullin","patteson","passon","passey","passalacqua","pasquini","paskel","partch","parriott","parrella","parraz","parmely","parizo","papelian","papasergi","pantojz","panto","panich","panchal","palys","pallone","palinski","pali","palevic","pagels","paciorek","pacho","pacella","paar","ozbun","overweg","overholser","ovalles","outcalt","otterbein","otta","ostergren","osher","osbon","orzech","orwick","orrico","oropesa","ormes","orillion","onorati","onnen","omary","olding","okonski","okimoto","ohlrich","ohayon","oguin","ogley","oftedahl","offen","ofallon","oeltjen","odam","ockmond","ockimey","obermeyer","oberdorf","obanner","oballe","oard","oakden","nyhan","nydam","numan","noyer","notte","nothstein","notestine","noser","nork","nolde","nishihara","nishi","nikolic","nihart","nietupski","niesen","niehus","nidiffer","nicoulin","nicolaysen","nicklow","nickl","nickeson","nichter","nicholl","ngyun","newsham","newmann","neveux","neuzil","neumayer","netland","nessen","nesheim","nelli","nelke","necochea","nazari","navorro","navarez","navan","natter","natt","nater","nasta","narvaiz","nardelli","napp","nakahara","nairn","nagg","nager","nagano","nafziger","naffziger","nadelson","muzzillo","murri","murrey","murgia","murcia","muno","munier","mulqueen","mulliniks","mulkins","mulik","muhs","muffley","moynahan","mounger","mottley","motil","moseman","moseby","mosakowski","mortell","morrisroe","morrero","mormino","morland","morger","morgenthaler","moren","morelle","morawski","morasca","morang","morand","moog","montney","montera","montee","montane","montagne","mons","monohan","monnett","monkhouse","moncure","momphard","molyneaux","molles","mollenkopf","molette","mohs","mohmand","mohlke","moessner","moers","mockus","moccio","mlinar","mizzelle","mittler","mitri","mitchusson","mitchen","mistrot","mistler","misch","miriello","minkin","mininger","minerich","minehart","minderman","minden","minahan","milonas","millon","millholland","milleson","millerbernd","millage","militante","milionis","milhoan","mildenberger","milbury","mikolajczak","miklos","mikkola","migneault","mifsud","mietus","mieszala","mielnicki","midy","michon","michioka","micheau","michaeli","micali","methe","metallo","messler","mesch","merow","meroney","mergenthaler","meres","menuey","menousek","menning","menn","menghini","mendia","memmer","melot","mellenthin","melland","meland","meixner","meisenheimer","meineke","meinders","mehrens","mehlig","meglio","medsker","medero","mederios","meabon","mcwright","mcright","mcreath","mcrary","mcquirter","mcquerry","mcquary","mcphie","mcnurlen","mcnelley","mcnee","mcnairy","mcmanamy","mcmahen","mckowen","mckiver","mckinlay","mckearin","mcirvin","mcintrye","mchorse","mchaffie","mcgroarty","mcgoff","mcgivern","mceniry","mcelhiney","mcdiarmid","mccullars","mccubbins","mccrimon","mccovery","mccommons","mcclour","mccarrick","mccarey","mccallen","mcbrien","mcarthy","mayone","maybin","maxam","maurais","maughn","matzek","matts","matin","mathre","mathia","mateen","matava","masso","massar","massanet","masingale","mascaro","marthaler","martes","marso","marshman","marsalis","marrano","marolt","marold","markins","margulis","mardirosian","marchiano","marchak","marandola","marana","manues","mante","mansukhani","mansi","mannan","maniccia","mangine","manery","mandigo","mancell","mamo","malstrom","malouf","malenfant","maldenado","malandruccolo","malak","malabanan","makino","maisonave","mainord","maino","mainard","maillard","mahmud","mahdi","mahapatra","mahaley","mahaffy","magouirk","maglaras","magat","maga","maffia","madrazo","madrano","maditz","mackert","mackellar","mackell","macht","macchia","maccarthy","maahs","lytal","luzar","luzader","lutjen","lunger","lunan","luma","lukins","luhmann","luers","ludvigsen","ludlam","ludemann","luchini","lucente","lubrano","lubow","luber","lubeck","lowing","loven","loup","louge","losco","lorts","lormand","lorenzetti","longford","longden","longbrake","lokhmatov","loge","loeven","loeser","locey","locatelli","litka","lista","lisonbee","lisenbee","liscano","liranzo","liquori","liptrot","lionetti","linscomb","linkovich","linington","lingefelt","lindler","lindig","lindall","lincks","linander","linan","limburg","limbrick","limbach","likos","lighthall","liford","lietzke","liebe","liddicoat","lickley","lichter","liapis","lezo","lewan","levitz","levesgue","leverson","levander","leuthauser","letbetter","lesuer","lesmeister","lesly","lerer","leppanen","lepinski","lenherr","lembrick","lelonek","leisten","leiss","leins","leingang","leinberger","leinbach","leikam","leidig","lehtonen","lehnert","lehew","legier","lefchik","lecy","leconte","lecher","lebrecht","leaper","lawter","lawrenz","lavy","laur","lauderbaugh","lauden","laudato","latting","latsko","latini","lassere","lasseigne","laspina","laso","laslie","laskowitz","laske","lasenby","lascola","lariosa","larcade","lapete","laperouse","lanuza","lanting","lantagne","lansdale","lanphier","langmaid","langella","lanese","landrus","lampros","lamens","laizure","laitinen","laigle","lahm","lagueux","lagorio","lagomarsino","lagasca","lagana","lafont","laflen","lafavor","lafarge","laducer","ladnier","ladesma","lacognata","lackland","lacerte","labuff","laborin","labine","labauve","kuzio","kusterer","kussman","kusel","kusch","kurutz","kurdyla","kupka","kunzler","kunsman","kuni","kuney","kunc","kulish","kuliga","kulaga","kuilan","kuhre","kuhnke","kuemmerle","kueker","kudla","kudelka","kubinski","kubicki","kubal","krzyzanowski","krupicka","krumwiede","krumme","kropidlowski","krokos","kroell","kritzer","kribs","kreitlow","kreisher","kraynak","krass","kranzler","kramb","kozyra","kozicki","kovalik","kovalchik","kovacevic","kotula","kotrba","koteles","kosowski","koskela","kosiba","koscinski","kosch","korab","kopple","kopper","koppelman","koppel","konwinski","kolosky","koloski","kolinsky","kolinski","kolbeck","kolasa","koepf","koda","kochevar","kochert","kobs","knust","knueppel","knoy","knieriem","knier","kneller","knappert","klitz","klintworth","klinkenberg","klinck","kleindienst","kleeb","klecker","kjellberg","kitsmiller","kisor","kisiel","kise","kirbo","kinzle","kingsford","kingry","kimpton","kimel","killmon","killick","kilgallon","kilcher","kihn","kiggins","kiecker","kher","khaleel","keziah","kettell","ketchen","keshishian","kersting","kersch","kerins","kercher","kenefick","kemph","kempa","kelsheimer","kelln","kellenberger","kekahuna","keisling","keirnan","keimig","kehn","keal","kaupp","kaufhold","kauffmann","katzenberg","katona","kaszynski","kaszuba","kassebaum","kasa","kartye","kartchner","karstens","karpinsky","karmely","karel","karasek","kapral","kaper","kanelos","kanahele","kampmann","kampe","kalp","kallus","kallevig","kallen","kaliszewski","kaleohano","kalchthaler","kalama","kalahiki","kaili","kahawai","kagey","justiss","jurkowski","jurgensmeyer","juilfs","jopling","jondahl","jomes","joice","johannessen","joeckel","jezewski","jezek","jeswald","jervey","jeppsen","jenniges","jennett","jemmott","jeffs","jaurequi","janisch","janick","jacek","jacaruso","iwanicki","ishihara","isenberger","isbister","iruegas","inzer","inyart","inscore","innocenti","inglish","infantolino","indovina","inaba","imondi","imdieke","imbert","illes","iarocci","iannucci","huver","hutley","husser","husmann","hupf","huntsberger","hunnewell","hullum","huit","huish","hughson","huft","hufstetler","hueser","hudnell","hovden","housen","houghtling","hossack","hoshaw","horsford","horry","hornbacher","hoppenstedt","hopkinson","honza","homann","holzmeister","holycross","holverson","holtzlander","holroyd","holmlund","holderness","holderfield","holck","hojnacki","hohlfeld","hohenberger","hoganson","hogancamp","hoffses","hoerauf","hoell","hoefert","hodum","hoder","hockenbury","hoage","hisserich","hislip","hirons","hippensteel","hippen","hinkston","hindes","hinchcliff","himmel","hillberry","hildring","hiester","hiefnar","hibberd","hibben","heyliger","heyl","heyes","hevia","hettrick","hert","hersha","hernandz","herkel","herber","henscheid","hennesy","henly","henegan","henebry","hench","hemsath","hemm","hemken","hemann","heltzel","hellriegel","hejny","heinl","heinke","heidinger","hegeman","hefferan","hedglin","hebdon","hearnen","heape","heagy","headings","headd","hazelbaker","havlick","hauschildt","haury","hassenfritz","hasenbeck","haseltine","hartstein","hartry","hartnell","harston","harpool","harmen","hardister","hardey","harders","harbolt","harbinson","haraway","haque","hansmann","hanser","hansch","hansberry","hankel","hanigan","haneline","hampe","hamons","hammerstone","hammerle","hamme","hammargren","hamelton","hamberger","hamasaki","halprin","halman","hallihan","haldane","haifley","hages","hagadorn","hadwin","habicht","habermehl","gyles","gutzman","gutekunst","gustason","gusewelle","gurnsey","gurnee","gunterman","gumina","gulliver","gulbrandson","guiterez","guerino","guedry","gucwa","guardarrama","guagliano","guadagno","grulke","groote","groody","groft","groeneweg","grochow","grippe","grimstead","griepentrog","greenfeld","greenaway","grebe","graziosi","graw","gravina","grassie","granzow","grandjean","granby","gramacy","gozalez","goyer","gotch","gosden","gorny","gormont","goodgion","gonya","gonnerman","gompert","golish","goligoski","goldmann","goike","goetze","godeaux","glaza","glassel","glaspy","glander","giumarro","gitelman","gisondi","gismondi","girvan","girten","gironda","giovinco","ginkel","gilster","giesy","gierman","giddins","giardini","gianino","ghea","geurin","gett","getson","gerrero","germond","gentsy","genta","gennette","genito","genis","gendler","geltz","geiss","gehret","gegenheimer","geffert","geeting","gebel","gavette","gavenda","gaumond","gaudioso","gatzke","gatza","gattshall","gaton","gatchel","gasperi","gaska","gasiorowski","garritson","garrigus","garnier","garnick","gardinier","gardenas","garcy","garate","gandolfi","gamm","gamel","gambel","gallmon","gallemore","gallati","gainous","gainforth","gahring","gaffey","gaebler","gadzinski","gadbury","gabri","gaba","fyke","furtaw","furnas","furcron","funn","funck","fulwood","fulvio","fullmore","fukumoto","fuest","fuery","frymire","frush","frohlich","froedge","frodge","fritzinger","fricker","frericks","frein","freid","freggiaro","fratto","franzi","franciscus","fralix","fowble","fotheringham","foslien","foshie","fortmann","forsey","forkner","foppiano","fontanetta","fonohema","fogler","fockler","fluty","flusche","flud","flori","flenory","fleharty","fleeks","flaxman","fiumara","fitzmorris","finnicum","finkley","fineran","fillhart","filipi","fijal","fieldson","ficarra","festerman","ferryman","ferner","fergason","ferell","fennern","femmer","feldmeier","feeser","feenan","federick","fedak","febbo","feazell","fazzone","fauth","fauset","faurote","faulker","faubion","fatzinger","fasick","fanguy","fambrough","falks","fahl","faaita","exler","ewens","estrado","esten","esteen","esquivez","espejo","esmiol","esguerra","esco","ertz","erspamer","ernstes","erisman","erhard","ereaux","ercanbrack","erbes","epple","entsminger","entriken","enslow","ennett","engquist","englebert","englander","engesser","engert","engeman","enge","enerson","emhoff","emge","elting","ellner","ellenberg","ellenbecker","elio","elfert","elawar","ekstrand","eison","eismont","eisenbrandt","eiseman","eischens","ehrgott","egley","egert","eddlemon","eckerson","eckersley","eckberg","echeverry","eberts","earthman","earnhart","eapen","eachus","dykas","dusi","durning","durdan","dunomes","duncombe","dume","dullen","dullea","dulay","duffett","dubs","dubard","drook","drenth","drahos","dragone","downin","downham","dowis","dowhower","doward","dovalina","dopazo","donson","donnan","dominski","dollarhide","dolinar","dolecki","dolbee","doege","dockus","dobkin","dobias","divoll","diviney","ditter","ditman","dissinger","dismang","dirlam","dinneen","dini","dingwall","diloreto","dilmore","dillaman","dikeman","diiorio","dighton","diffley","dieudonne","dietel","dieringer","diercks","dienhart","diekrager","diefendorf","dicke","dicamillo","dibrito","dibona","dezeeuw","dewhurst","devins","deviney","deupree","detherage","despino","desmith","desjarlais","deshner","desha","desanctis","derring","derousse","derobertis","deridder","derego","derden","deprospero","deprofio","depping","deperro","denty","denoncourt","dencklau","demler","demirchyan","demichiel","demesa","demere","demaggio","delung","deluise","delmoral","delmastro","delmas","delligatti","delle","delasbour","delarme","delargy","delagrange","delafontaine","deist","deiss","deighan","dehoff","degrazia","degman","defosses","deforrest","deeks","decoux","decarolis","debuhr","deberg","debarr","debari","dearmon","deare","deardurff","daywalt","dayer","davoren","davignon","daviau","dauteuil","dauterive","daul","darnley","darakjy","dapice","dannunzio","danison","daniello","damario","dalonzo","dallis","daleske","dalenberg","daiz","dains","daines","dagnese","dady","dadey","czyzewski","czapor","czaplewski","czajka","cyganiewicz","cuttino","cutrona","cussins","cusanelli","cuperus","cundy","cumiskey","cumins","cuizon","cuffia","cuffe","cuffari","cuccaro","cubie","cryder","cruson","crounse","cromedy","cring","creer","credeur","crea","cozort","cozine","cowee","cowdery","couser","courtway","courington","cotman","costlow","costell","corton","corsaro","corrieri","corrick","corradini","coron","coren","corbi","corado","copus","coppenger","cooperwood","coontz","coonce","contrera","connealy","conell","comtois","compere","commins","commings","comegys","colyar","colo","collister","collick","collella","coler","colborn","cohran","cogbill","coffen","cocuzzo","clynes","closter","clipp","clingingsmith","clemence","clayman","classon","clas","clarey","clague","ciubal","citrino","citarella","cirone","cipponeri","cindrich","cimo","ciliberto","cichowski","ciccarello","cicala","chura","chubbuck","chronis","christlieb","chizek","chittester","chiquito","chimento","childree","chianese","chevrette","checo","chastang","chargualaf","chapmon","chantry","chahal","chafetz","cezar","ceruantes","cerrillo","cerrano","cerecedes","cerami","cegielski","cavallero","catinella","cassata","caslin","casano","casacchia","caruth","cartrette","carten","carodine","carnrike","carnall","carmicle","carlan","carlacci","caris","cariaga","cardine","cardimino","cardani","carbonara","capua","capponi","cappellano","caporale","canupp","cantrel","cantone","canterberry","cannizzo","cannan","canelo","caneer","candill","candee","campbel","caminero","camble","caluya","callicott","calk","caito","caffie","caden","cadavid","cacy","cachu","cachola","cabreja","cabiles","cabada","caamano","byran","byon","buyck","bussman","bussie","bushner","burston","burnison","burkman","burkhammer","bures","burdeshaw","bumpass","bullinger","bullers","bulgrin","bugay","budak","buczynski","buckendorf","buccieri","bubrig","brynteson","brunz","brunmeier","brunkow","brunetto","brunelli","brumwell","bruggman","brucki","brucculeri","brozovich","browing","brotman","brocker","broadstreet","brix","britson","brinck","brimmage","brierre","bridenstine","brezenski","brezee","brevik","brentlinger","brentley","breidenbach","breckel","brech","brazzle","braughton","brauch","brattin","brattain","branhan","branford","braner","brander","braly","braegelmann","brabec","boyt","boyack","bowren","bovian","boughan","botton","botner","bosques","borzea","borre","boron","bornhorst","borgstrom","borella","bontempo","bonniwell","bonnes","bonillo","bonano","bolek","bohol","bohaty","boffa","boetcher","boesen","boepple","boehler","boedecker","boeckx","bodi","boal","bloodsworth","bloodgood","blome","blockett","blixt","blanchett","blackhurst","blackaby","bjornberg","bitzer","bittenbender","bitler","birchall","binnicker","binggeli","billett","bilberry","biglow","bierly","bielby","biegel","berzas","berte","bertagnolli","berreth","bernhart","bergum","berentson","berdy","bercegeay","bentle","bentivegna","bentham","benscoter","benns","bennick","benjamine","beneze","benett","beneke","bendure","bendix","bendick","benauides","belman","bellus","bellott","bellefleur","bellas","beljan","belgard","beith","beinlich","beierle","behme","beevers","beermann","beeching","bedward","bedrosian","bedner","bedeker","bechel","becera","beaubrun","beardmore","bealmear","bazin","bazer","baumhoer","baumgarner","bauknecht","battson","battiest","basulto","baster","basques","basista","basiliere","bashi","barzey","barz","bartus","bartucca","bartek","barrero","barreca","barnoski","barndt","barklow","baribeau","barette","bares","barentine","bareilles","barbre","barberi","barbagelata","baraw","baratto","baranoski","baptise","bankson","bankey","bankard","banik","baltzley","ballen","balkey","balius","balderston","bakula","bakalar","baffuto","baerga","badoni","backous","bachtel","bachrach","baccari","babine","babilonia","baar","azbill","azad","aycox","ayalla","avolio","austerberry","aughtry","aufderheide","auch","attanasio","athayde","atcher","asselta","aslin","aslam","ashwood","ashraf","ashbacher","asbridge","asakura","arzaga","arriaza","arrez","arrequin","arrants","armiger","armenteros","armbrister","arko","argumedo","arguijo","ardolino","arcia","arbizo","aravjo","aper","anzaldo","antu","antrikin","antonetty","antinoro","anthon","antenucci","anstead","annese","ankrum","andreason","andrado","andaverde","anastos","anable","amspoker","amrine","amrein","amorin","amel","ambrosini","alsbrook","alnutt","almasi","allessio","allateef","aldous","alderink","aldaz","akmal","akard","aiton","aites","ainscough","aikey","ahrends","ahlm","aguada","agans","adelmann","addesso","adaway","adamaitis","ackison","abud","abendroth","abdur","abdool","aamodt","zywiec","zwiefelhofer","zwahlen","zunino","zuehl","zmuda","zmolek","zizza","ziska","zinser","zinkievich","zinger","zingarelli","ziesmer","ziegenfuss","ziebol","zettlemoyer","zettel","zervos","zenke","zembower","zelechowski","zelasko","zeise","zeek","zeeb","zarlenga","zarek","zaidi","zahnow","zahnke","zaharis","zacate","zabrocki","zaborac","yurchak","yuengling","younie","youngers","youell","yott","yoshino","yorks","yordy","yochem","yerico","yerdon","yeiser","yearous","yearick","yeaney","ybarro","yasutake","yasin","yanke","yanish","yanik","yamazaki","yamat","yaggi","ximenez","wyzard","wynder","wyly","wykle","wutzke","wuori","wuertz","wuebker","wrightsel","worobel","worlie","worford","worek","woolson","woodrome","woodly","woodling","wontor","wondra","woltemath","wollmer","wolinski","wolfert","wojtanik","wojtak","wohlfarth","woeste","wobbleton","witz","wittmeyer","witchey","wisotzkey","wisnewski","wisman","wirch","wippert","wineberg","wimpee","wilusz","wiltsey","willig","williar","willers","willadsen","wildhaber","wilday","wigham","wiewel","wieting","wietbrock","wiesel","wiesehan","wiersema","wiegert","widney","widmark","wickson","wickings","wichern","whtie","whittie","whitlinger","whitfill","whitebread","whispell","whetten","wheeley","wheeles","wheelen","whatcott","weyland","weter","westrup","westphalen","westly","westland","wessler","wesolick","wesler","wesche","werry","wero","wernecke","werkhoven","wellspeak","wellings","welford","welander","weissgerber","weisheit","weins","weill","weigner","wehrmann","wehrley","wehmeier","wege","weers","weavers","watring","wassum","wassman","wassil","washabaugh","wascher","warth","warbington","wanca","wammack","wamboldt","walterman","walkington","walkenhorst","walinski","wakley","wagg","wadell","vuckovich","voogd","voller","vokes","vogle","vogelsberg","vodicka","vissering","vipond","vincik","villalona","vickerman","vettel","veteto","vesperman","vesco","vertucci","versaw","verba","ventris","venecia","vendela","venanzi","veldhuizen","vehrs","vaughen","vasilopoulos","vascocu","varvel","varno","varlas","varland","vario","vareschi","vanwyhe","vanweelden","vansciver","vannaman","vanluven","vanloo","vanlaningham","vankomen","vanhout","vanhampler","vangorp","vangorden","vanella","vandresar","vandis","vandeyacht","vandewerker","vandevsen","vanderwall","vandercook","vanderberg","vanbergen","valko","valesquez","valeriano","valen","vachula","vacha","uzee","uselman","urizar","urion","urben","upthegrove","unzicker","unsell","unick","umscheid","umin","umanzor","ullo","ulicki","uhlir","uddin","tytler","tymeson","tyger","twisdale","twedell","tweddle","turrey","tures","turell","tupa","tuitt","tuberville","tryner","trumpower","trumbore","troglen","troff","troesch","trivisonno","tritto","tritten","tritle","trippany","tringali","tretheway","treon","trejos","tregoning","treffert","traycheff","travali","trauth","trauernicht","transou","trane","trana","toves","tosta","torp","tornquist","tornes","torchio","toor","tooks","tonks","tomblinson","tomala","tollinchi","tolles","tokich","tofte","todman","titze","timpone","tillema","tienken","tiblier","thyberg","thursby","thurrell","thurm","thruman","thorsted","thorley","thomer","thoen","thissen","theimer","thayn","thanpaeng","thammavongsa","thalman","texiera","texidor","teverbaugh","teska","ternullo","teplica","tepe","teno","tenholder","tenbusch","tenbrink","temby","tejedor","teitsworth","teichmann","tehan","tegtmeyer","tees","teem","tays","taubert","tauares","taschler","tartamella","tarquinio","tarbutton","tappendorf","tapija","tansil","tannahill","tamondong","talahytewa","takashima","taecker","tabora","tabin","tabbert","szymkowski","szymanowski","syversen","syrett","synnott","sydnes","swimm","sweney","swearegene","swartzel","swanstrom","svedin","suryan","supplice","supnet","suoboda","sundby","sumaya","sumabat","sulzen","sukovaty","sukhu","sugerman","sugalski","sudweeks","sudbeck","sucharski","stutheit","stumfoll","stuffle","struyk","strutz","strumpf","strowbridge","strothman","strojny","strohschein","stroffolino","stribble","strevel","strenke","stremming","strehle","stranak","stram","stracke","stoudamire","storks","stopp","stonebreaker","stolt","stoica","stofer","stockham","stockfisch","stjuste","stiteler","stiman","stillions","stillabower","stierle","sterlace","sterk","stepps","stenquist","stenner","stellman","steines","steinbaugh","steinbacher","steiling","steidel","steffee","stavinoha","staver","stastny","stasiuk","starrick","starliper","starlin","staniford","staner","standre","standefer","standafer","stanczyk","stallsmith","stagliano","staehle","staebler","stady","stadtmiller","squyres","spurbeck","sprunk","spranger","spoonamore","spoden","spilde","spezio","speros","sperandio","specchio","spearin","spayer","spallina","spadafino","sovie","sotello","sortor","sortino","soros","sorola","sorbello","sonner","sonday","somes","soloway","soens","soellner","soderblom","sobin","sniezek","sneary","smyly","smutnick","smoots","smoldt","smitz","smitreski","smallen","smades","slunaker","sluka","slown","slovick","slocomb","slinger","slife","sleeter","slanker","skufca","skubis","skrocki","skov","skjei","skilton","skarke","skalka","skalak","skaff","sixkiller","sitze","siter","sisko","sirman","sirls","sinotte","sinon","sincock","sincebaugh","simmoms","similien","silvius","silton","silloway","sikkema","sieracki","sienko","siemon","siemer","siefker","sieberg","siebens","siebe","sicurella","sicola","sickle","shumock","shumiloff","shuffstall","shuemaker","shuart","shroff","shreeve","shostak","shortes","shorr","shivley","shintaku","shindo","shimomura","shiigi","sherow","sherburn","shepps","shenefield","shelvin","shelstad","shelp","sheild","sheaman","shaulis","sharrer","sharps","sharpes","shappy","shapero","shanor","shandy","seyller","severn","sessom","sesley","servidio","serrin","sero","septon","septer","sennott","sengstock","senff","senese","semprini","semone","sembrat","selva","sella","selbig","seiner","seif","seidt","sehrt","seemann","seelbinder","sedlay","sebert","seaholm","seacord","seaburg","scungio","scroggie","scritchfield","scrimpsher","scrabeck","scorca","scobey","scivally","schwulst","schwinn","schwieson","schwery","schweppe","schwartzenbur","schurz","schumm","schulenburg","schuff","schuerholz","schryer","schrager","schorsch","schonhardt","schoenfelder","schoeck","schoeb","schnitzler","schnick","schnautz","schmig","schmelter","schmeichel","schluneger","schlosberg","schlobohm","schlenz","schlembach","schleisman","schleining","schleiff","schleider","schink","schilz","schiffler","schiavi","scheuer","schemonia","scheman","schelb","schaul","schaufelberge","scharer","schardt","scharbach","schabacker","scee","scavone","scarth","scarfone","scalese","sayne","sayed","savitz","satterlund","sattazahn","satow","sastre","sarr","sarjeant","sarff","sardella","santoya","santoni","santai","sankowski","sanft","sandow","sandoe","sandhaus","sandefer","sampey","samperi","sammarco","samia","samek","samay","samaan","salvadore","saltness","salsgiver","saller","salaz","salano","sakal","saka","saintlouis","saile","sahota","saggese","sagastume","sadri","sadak","sachez","saalfrank","saal","saadeh","rynn","ryley","ryle","rygg","rybarczyk","ruzich","ruyter","ruvo","rupel","ruopp","rundlett","runde","rundall","runck","rukavina","ruggiano","rufi","ruef","rubright","rubbo","rowbottom","rotner","rotman","rothweiler","rothlisberger","rosseau","rossean","rossa","roso","rosiek","roshia","rosenkrans","rosener","rosencrantz","rosencrans","rosello","roques","rookstool","rondo","romasanta","romack","rokus","rohweder","roethler","roediger","rodwell","rodrigus","rodenbeck","rodefer","rodarmel","rockman","rockholt","rochow","roches","roblin","roblez","roble","robers","roat","rizza","rizvi","rizk","rixie","riveiro","rius","ritschard","ritrovato","risi","rishe","rippon","rinks","ringley","ringgenberg","ringeisen","rimando","rilley","rijos","rieks","rieken","riechman","riddley","ricord","rickabaugh","richmeier","richesin","reyolds","rexach","requena","reppucci","reposa","renzulli","renter","remondini","reither","reisig","reifsnider","reifer","reibsome","reibert","rehor","rehmann","reedus","redshaw","reczek","recupero","recor","reckard","recher","realbuto","razer","rayman","raycraft","rayas","rawle","raviscioni","ravetto","ravenelle","rauth","raup","rattliff","rattley","rathfon","rataj","rasnic","rappleyea","rapaport","ransford","rann","rampersad","ramis","ramcharan","rainha","rainforth","ragans","ragains","rafidi","raffety","raducha","radsky","radler","radatz","raczkowski","rabenold","quraishi","quinerly","quercia","quarnstrom","pusser","puppo","pullan","pulis","pugel","puca","pruna","prowant","provines","pronk","prinkleton","prindall","primas","priesmeyer","pridgett","prevento","preti","presser","presnall","preseren","presas","presa","prchal","prattis","pratillo","praska","prak","powis","powderly","postlewait","postle","posch","porteus","porraz","popwell","popoff","poplaski","poniatoski","pollina","polle","polhill","poletti","polaski","pokorney","pointdexter","poinsette","ploszaj","plitt","pletz","pletsch","plemel","pleitez","playford","plaxco","platek","plambeck","plagens","placido","pisarski","pinuelas","pinnette","pinick","pinell","pinciaro","pinal","pilz","piltz","pillion","pilkinton","pikul","piepenburg","piening","piehler","piedrahita","piechocki","picknell","pickelsimer","pich","picariello","phoeuk","phillipson","philbert","pherigo","phelka","peverini","petrash","petramale","petraglia","pery","personius","perrington","perrill","perpall","perot","perman","peragine","pentland","pennycuff","penninger","pennachio","pendexter","penalver","pelzel","pelter","pelow","pelo","peli","peinado","pedley","pecue","pecore","pechar","peairs","paynes","payano","pawelk","pavlock","pavlich","pavich","pavek","pautler","paulik","patmore","patella","patee","patalano","passini","passeri","paskell","parrigan","parmar","parayno","paparelli","pantuso","pante","panico","panduro","panagos","pama","palmo","pallotta","paling","palamino","pake","pajtas","pailthorpe","pahler","pagon","paglinawan","pagley","paget","paetz","paet","padley","pacleb","pachelo","paccione","pabey","ozley","ozimek","ozawa","owney","outram","ouillette","oudekerk","ostrosky","ostermiller","ostermann","osterloh","osterfeld","ossenfort","osoria","oshell","orsino","orscheln","orrison","ororke","orellano","orejuela","ordoyne","opsahl","opland","onofre","onaga","omahony","olszowka","olshan","ollig","oliff","olien","olexy","oldridge","oldfather","olalde","okun","okumoto","oktavec","okin","ohme","ohlemacher","ohanesian","odneal","odgers","oderkirk","odden","ocain","obradovich","oakey","nussey","nunziato","nunoz","nunnenkamp","nuncio","noviello","novacek","nothstine","northum","norsen","norlander","norkus","norgaard","norena","nored","nobrega","niziolek","ninnemann","nievas","nieratko","nieng","niedermeyer","niedermaier","nicolls","newham","newcome","newberger","nevills","nevens","nevel","neumiller","netti","nessler","neria","nemet","nelon","nellon","neller","neisen","neilly","neifer","neid","neering","neehouse","neef","needler","nebergall","nealis","naumoff","naufzinger","narum","narro","narramore","naraine","napps","nansteel","namisnak","namanny","nallie","nakhle","naito","naccari","nabb","myracle","myhand","mwakitwile","muzzy","muscolino","musco","muscente","muscat","muscara","musacchia","musa","murrish","murfin","muray","munnelly","munley","munivez","mundine","mundahl","munari","mullennex","mullendore","mulkhey","mulinix","mulders","muhl","muenchow","muellner","mudget","mudger","muckenfuss","muchler","mozena","movius","mouldin","motola","mosseri","mossa","moselle","mory","morsell","morrish","morles","morie","morguson","moresco","morck","moppin","moosman","montuori","montono","montogomery","montis","monterio","monter","monsalve","mongomery","mongar","mondello","moncivais","monard","monagan","molt","mollenhauer","moldrem","moldonado","molano","mokler","moisant","moilanen","mohrman","mohamad","moger","mogel","modine","modin","modic","modha","mlynek","miya","mittiga","mittan","mitcheltree","misfeldt","misener","mirchandani","miralles","miotke","miosky","mintey","mins","minassian","minar","mimis","milon","milloy","millison","milito","milfort","milbradt","mikulich","mikos","miklas","mihelcic","migliorisi","migliori","miesch","midura","miclette","michela","micale","mezey","mews","mewes","mettert","mesker","mesich","mesecher","merthie","mersman","mersereau","merrithew","merriott","merring","merenda","merchen","mercardo","merati","mentzel","mentis","mentel","menotti","meno","mengle","mendolia","mellick","mellett","melichar","melhorn","melendres","melchiorre","meitzler","mehtani","mehrtens","meditz","medeiras","meckes","mcteer","mctee","mcparland","mcniell","mcnealey","mcmanaway","mcleon","mclay","mclavrin","mcklveen","mckinzey","mcken","mckeand","mckale","mcilwraith","mcilroy","mcgreal","mcgougan","mcgettigan","mcgarey","mcfeeters","mcelhany","mcdaris","mccomis","mccomber","mccolm","mccollins","mccollin","mccollam","mccoach","mcclory","mcclennon","mccathern","mccarthey","mccarson","mccarrel","mccargar","mccandles","mccamish","mccally","mccage","mcbrearty","mcaneny","mcanallen","mcalarney","mcaferty","mazzo","mazy","mazurowski","mazique","mayoras","mayden","maxberry","mauller","matusiak","mattsen","matthey","matkins","mathiasen","mathe","mateus","matalka","masullo","massay","mashak","mascroft","martinex","martenson","marsiglia","marsella","maroudas","marotte","marner","markes","maret","mareno","marean","marcinkiewicz","marchel","marasigan","manzueta","manzanilla","manternach","manring","manquero","manoni","manne","mankowski","manjarres","mangen","mangat","mandonado","mandia","mancias","manbeck","mamros","maltez","mallia","mallar","malla","malen","malaspina","malahan","malagisi","malachowski","makowsky","makinen","makepeace","majkowski","majid","majercin","maisey","mainguy","mailliard","maignan","mahlman","maha","magsamen","magpusao","magnano","magley","magedanz","magarelli","magaddino","maenner","madnick","maddrey","madaffari","macnaughton","macmullen","macksey","macknight","macki","macisaac","maciejczyk","maciag","machenry","machamer","macguire","macdaniel","maccormack","maccabe","mabbott","mabb","lynott","lycan","lutwin","luscombe","lusco","lusardi","luria","lunetta","lundsford","lumas","luisi","luevanos","lueckenhoff","ludgate","ludd","lucherini","lubbs","lozado","lourens","lounsberry","loughrey","loughary","lotton","losser","loshbaugh","loseke","loscalzo","lortz","loperena","loots","loosle","looman","longstaff","longobardi","longbottom","lomay","lomasney","lohrmann","lohmiller","logalbo","loetz","loeffel","lodwick","lodrigue","lockrem","llera","llarena","littrel","littmann","lisser","lippa","lipner","linnemann","lingg","lindemuth","lindeen","lillig","likins","lieurance","liesmann","liesman","liendo","lickert","lichliter","leyvas","leyrer","lewy","leubner","lesslie","lesnick","lesmerises","lerno","lequire","lepera","lepard","lenske","leneau","lempka","lemmen","lemm","lemere","leinhart","leichner","leicher","leibman","lehmberg","leggins","lebeda","leavengood","leanard","lazaroff","laventure","lavant","lauster","laumea","latigo","lasota","lashure","lasecki","lascurain","lartigue","larouche","lappe","laplaunt","laplace","lanum","lansdell","lanpher","lanoie","lankard","laniado","langowski","langhorn","langfield","langfeldt","landt","landerman","landavazo","lampo","lampke","lamper","lamery","lambey","lamadrid","lallemand","laisure","laigo","laguer","lagerman","lageman","lagares","lacosse","lachappelle","laborn","labonne","kuzia","kutt","kutil","kurylo","kurowski","kuriger","kupcho","kulzer","kulesa","kules","kuhs","kuhne","krutz","krus","krupka","kronberg","kromka","kroese","krizek","krivanek","kringel","kreiss","kratofil","krapp","krakowsky","kracke","kozlow","kowald","kover","kovaleski","kothakota","kosten","koskinen","kositzke","korff","korbar","kopplin","koplin","koos","konyn","konczak","komp","komo","kolber","kolash","kolakowski","kohm","kogen","koestner","koegler","kodama","kocik","kochheiser","kobler","kobara","knezevich","kneifl","knapchuck","knabb","klugman","klosner","klingel","klimesh","klice","kley","kleppe","klemke","kleinmann","kleinhans","kleinberg","kleffner","kleckley","klase","kisto","kissick","kisselburg","kirschman","kirks","kirkner","kirkey","kirchman","kinville","kinnunen","kimmey","kimmerle","kimbley","kilty","kilts","killmeyer","killilea","killay","kiest","kierce","kiepert","kielman","khalid","kewal","keszler","kesson","kesich","kerwood","kerksiek","kerkhoff","kerbo","keranen","keomuangtai","kenter","kennelley","keniry","kendzierski","kempner","kemmis","kemerling","kelsay","kelchner","kela","keithly","keipe","kegg","keer","keahey","kaywood","kayes","kawahara","kasuboski","kastendieck","kassin","kasprzyk","karraker","karnofski","karman","karger","karge","karella","karbowski","kapphahn","kannel","kamrath","kaminer","kamansky","kalua","kaltz","kalpakoff","kalkbrenner","kaku","kaib","kaehler","kackley","kaber","justo","juris","jurich","jurgenson","jurez","junor","juniel","juncker","jugo","jubert","jowell","jovanovic","joosten","joncas","joma","johnso","johanns","jodoin","jockers","joans","jinwright","jinenez","jimeson","jerrett","jergens","jerden","jerdee","jepperson","jendras","jeanfrancois","jazwa","jaussi","jaster","jarzombek","jarencio","janocha","jakab","jadlowiec","jacobsma","jach","izaquirre","iwaoka","ivaska","iturbe","israelson","isles","isachsen","isaak","irland","inzerillo","insogna","ingegneri","ingalsbe","inciong","inagaki","icenogle","hyett","hyers","huyck","hutti","hutten","hutnak","hussar","hurrle","hurford","hurde","hupper","hunkin","hunkele","hunke","humann","huhtasaari","hugel","hufft","huegel","hrobsky","hren","hoyles","hovsepian","hovenga","hovatter","houdek","hotze","hossler","hossfeld","hosseini","horten","hort","horr","horgen","horen","hoopii","hoon","hoogland","hontz","honnold","homewood","holway","holtgrewe","holtan","holstrom","holstege","hollway","hollingshed","hollenback","hollard","holberton","hoines","hogeland","hofstad","hoetger","hoen","hoaglund","hirota","hintermeister","hinnen","hinders","hinderer","hinchee","himelfarb","himber","hilzer","hilling","hillers","hillegas","hildinger","hignight","highman","hierholzer","heyde","hettich","hesketh","herzfeld","herzer","hershenson","hershberg","hernando","hermenegildo","hereth","hererra","hereda","herbin","heraty","herard","hepa","henschel","henrichsen","hennes","henneberger","heningburg","henig","hendron","hendericks","hemple","hempe","hemmingsen","hemler","helvie","helmly","helmbrecht","heling","helin","helfrey","helble","helaire","heizman","heisser","heiny","heinbaugh","heidemann","heidema","heiberger","hegel","heerdt","heeg","heefner","heckerman","heckendorf","heavin","headman","haynesworth","haylock","hayakawa","hawksley","haverstick","haut","hausen","hauke","haubold","hattan","hattabaugh","hasstedt","hashem","haselhorst","harrist","harpst","haroldsen","harmison","harkema","harison","hariri","harcus","harcum","harcharik","hanzel","hanvey","hantz","hansche","hansberger","hannig","hanken","hanhardt","hanf","hanauer","hamberlin","halward","halsall","hals","hallquist","hallmon","halk","halbach","halat","hajdas","hainsworth","haik","hahm","hagger","haggar","hader","hadel","haddick","hackmann","haasch","haaf","guzzetta","guzy","gutterman","gutmann","gutkowski","gustine","gursky","gurner","gunsolley","gumpert","gulla","guilmain","guiliani","guier","guers","guerero","guerena","guebara","guadiana","grunder","grothoff","grosland","grosh","groos","grohs","grohmann","groepper","grodi","grizzaffi","grissinger","grippi","grinde","griffee","grether","greninger","greigo","gregorski","greger","grega","greenberger","graza","grattan","grasse","grano","gramby","gradilla","govin","goutremout","goulas","gotay","gosling","gorey","gordner","goossen","goodwater","gonzaga","gonyo","gonska","gongalves","gomillion","gombos","golonka","gollman","goldtrap","goldammer","golas","golab","gola","gogan","goffman","goeppinger","godkin","godette","glore","glomb","glauner","glassey","glasner","gividen","giuffrida","gishal","giovanelli","ginoza","ginns","gindlesperger","gindhart","gillem","gilger","giggey","giebner","gibbson","giacomo","giacolone","giaccone","giacchino","ghere","gherardini","gherardi","gfeller","getts","gerwitz","gervin","gerstle","gerfin","geremia","gercak","gener","gencarelli","gehron","gehrmann","geffers","geery","geater","gawlik","gaudino","garsia","garrahan","garrabrant","garofolo","garigliano","garfinkle","garelick","gardocki","garafola","gappa","gantner","ganther","gangelhoff","gamarra","galstad","gally","gallik","gallier","galimba","gali","galassi","gaige","gadsby","gabbin","gabak","fyall","furney","funez","fulwider","fulson","fukunaga","fujikawa","fugere","fuertes","fuda","fryson","frump","frothingham","froning","froncillo","frohling","froberg","froats","fritchman","frische","friedrichsen","friedmann","friddell","frid","fresch","frentzel","freno","frelow","freimuth","freidel","freehan","freeby","freeburn","fredieu","frederiksen","fredeen","frazell","frayser","fratzke","frattini","franze","franich","francescon","framer","fragman","frack","foxe","fowlston","fosberg","fortna","fornataro","forden","foots","foody","fogt","foglia","fogerty","fogelson","flygare","flowe","flinner","flem","flath","flater","flahaven","flad","fjeld","fitanides","fistler","fishbaugh","firsching","finzel","finical","fingar","filosa","filicetti","filby","fierst","fierra","ficklen","ficher","fersner","ferrufino","ferrucci","fero","ferlenda","ferko","fergerstrom","ferge","fenty","fent","fennimore","fendt","femat","felux","felman","feldhaus","feisthamel","feijoo","feiertag","fehrman","fehl","feezell","feeback","fedigan","fedder","fechner","feary","fayson","faylor","fauteux","faustini","faure","fauci","fauber","fattig","farruggio","farrens","faraci","fantini","fantin","fanno","fannings","faniel","fallaw","falker","falkenhagen","fajen","fahrner","fabel","fabacher","eytcheson","eyster","exford","exel","evetts","evenstad","evanko","euresti","euber","etcitty","estler","essner","essinger","esplain","espenshade","espaillat","escribano","escorcia","errington","errett","errera","erlanger","erenrich","erekson","erber","entinger","ensworth","ensell","enno","ennen","englin","engblom","engberson","encinias","enama","emel","elzie","elsbree","elman","ellebracht","elkan","elfstrom","elerson","eleazer","eleam","eldrige","elcock","einspahr","eike","eidschun","eickman","eichele","eiche","ehlke","eguchi","eggink","edouard","edgehill","eckes","eblin","ebberts","eavenson","earvin","eardley","eagon","eader","dzubak","dylla","dyckman","dwire","dutrow","dutile","dusza","dustman","dusing","duryee","durupan","durtschi","durtsche","durell","dunny","dunnegan","dunken","dumm","dulak","duker","dukelow","dufort","dufilho","duffee","duett","dueck","dudzinski","dudasik","duckwall","duchemin","dubrow","dubis","dubicki","duba","drust","druckman","drinnen","drewett","drewel","dreitzler","dreckman","drappo","draffen","drabant","doyen","dowding","doub","dorson","dorschner","dorrington","dorney","dormaier","dorff","dorcy","donges","donelly","donel","domangue","dols","dollahite","dolese","doldo","doiley","dohrman","dohn","doheny","doceti","dobry","dobrinski","dobey","divincenzo","dischinger","dirusso","dirocco","dipiano","diop","dinitto","dinehart","dimsdale","diminich","dimalanta","dillavou","dilello","difusco","diffey","diffenderfer","diffee","difelice","difabio","dietzman","dieteman","diepenbrock","dieckmann","dicampli","dibari","diazdeleon","diallo","dewitz","dewiel","devoll","devol","devincent","devier","devendorf","devalk","detten","detraglia","dethomas","detemple","desler","desharnais","desanty","derocco","dermer","derks","derito","derhammer","deraney","dequattro","depass","depadua","denyes","denyer","dentino","denlinger","deneal","demory","demopoulos","demontigny","demonte","demeza","delsol","delrosso","delpit","delpapa","delouise","delone","delo","delmundo","delmore","dellapaolera","delfin","delfierro","deleonardis","delenick","delcarlo","delcampo","delcamp","delawyer","delaroca","delaluz","delahunt","delaguardia","dekeyser","dekay","dejaeger","dejackome","dehay","dehass","degraffenried","degenhart","degan","deever","deedrick","deckelbaum","dechico","dececco","decasas","debrock","debona","debeaumont","debarros","debaca","dearmore","deangelus","dealmeida","dawood","davney","daudt","datri","dasgupta","darring","darracott","darcus","daoud","dansbury","dannels","danielski","danehy","dancey","damour","dambra","dalcour","dahlheimer","dadisman","dacunto","dacamara","dabe","cyrulik","cyphert","cwik","cussen","curles","curit","curby","curbo","cunas","cunard","cunanan","cumpton","culcasi","cucinotta","cucco","csubak","cruthird","crumwell","crummitt","crumedy","crouthamel","cronce","cromack","crisafi","crimin","cresto","crescenzo","cremonese","creedon","crankshaw","cozzens","coval","courtwright","courcelle","coupland","counihan","coullard","cotrell","cosgrave","cornelio","corish","cordoua","corbit","coppersmith","coonfield","conville","contrell","contento","conser","conrod","connole","congrove","conery","condray","colver","coltman","colflesh","colcord","colavito","colar","coile","coggan","coenen","codling","coda","cockroft","cockrel","cockerill","cocca","coberley","clouden","clos","clish","clinkscale","clester","clammer","cittadino","citrano","ciresi","cillis","ciccarelli","ciborowski","ciarlo","ciardullo","chritton","chopp","chirco","chilcoat","chevarie","cheslak","chernak","chay","chatterjee","chatten","chatagnier","chastin","chappuis","channey","champlain","chalupsky","chalfin","chaffer","chadek","chadderton","cestone","cestero","cestari","cerros","cermeno","centola","cedrone","cayouette","cavan","cavaliero","casuse","castricone","castoreno","casten","castanada","castagnola","casstevens","cassanova","caspari","casher","cashatt","casco","casassa","casad","carville","cartland","cartegena","carsey","carsen","carrino","carrilo","carpinteyro","carmley","carlston","carlsson","cariddi","caricofe","carel","cardy","carducci","carby","carangelo","capriotti","capria","caprario","capelo","canul","cantua","cantlow","canny","cangialosi","canepa","candland","campolo","campi","camors","camino","camfield","camelo","camarero","camaeho","calvano","calliste","caldarella","calcutt","calcano","caissie","cager","caccamo","cabotage","cabble","byman","buzby","butkowski","bussler","busico","bushovisky","busbin","busard","busalacchi","burtman","burrous","burridge","burrer","burno","burin","burgette","burdock","burdier","burckhard","bunten","bungay","bundage","bumby","bultema","bulinski","bulan","bukhari","buganski","buerkle","buen","buehl","budzynski","buckham","bryk","brydon","bruyere","brunsvold","brunnett","brunker","brunfield","brumble","brue","brozina","brossman","brosey","brookens","broersma","brodrick","brockmeier","brockhouse","brisky","brinkly","brincefield","brighenti","brigante","brieno","briede","bridenbaugh","brickett","breske","brener","brenchley","breitkreutz","breitbart","breister","breining","breighner","breidel","brehon","breheny","breard","breakell","brazill","braymiller","braum","brau","brashaw","bransom","brandolino","brancato","branagan","braff","brading","bracker","brackenbury","bracher","braasch","boylen","boyda","boyanton","bowlus","bowditch","boutot","bouthillette","boursiquot","bourjolly","bouret","boulerice","bouer","bouchillon","bouchie","bottin","boteilho","bosko","bosack","borys","bors","borla","borjon","borghi","borah","booten","boore","bonuz","bonne","bongers","boneta","bonawitz","bonanni","bomer","bollen","bollard","bolla","bolio","boisseau","boies","boiani","bohorquez","boghossian","boespflug","boeser","boehl","boegel","bodrick","bodkins","bodenstein","bodell","bockover","bocci","bobbs","boals","boahn","boadway","bluma","bluett","bloor","blomker","blevens","blethen","bleecker","blayney","blaske","blasetti","blancas","blackner","bjorkquist","bjerk","bizub","bisono","bisges","bisaillon","birr","birnie","bires","birdtail","birdine","bina","billock","billinger","billig","billet","bigwood","bigalk","bielicki","biddick","biccum","biafore","bhagat","beza","beyah","bevier","bevell","beute","betzer","betthauser","bethay","bethard","beshaw","bertholf","bertels","berridge","bernot","bernath","bernabei","berkson","berkovitz","berkich","bergsten","berget","berezny","berdin","beougher","benthin","benhaim","benenati","benejan","bemiss","beloate","bellucci","bellotti","belling","bellido","bellaire","bellafiore","bekins","bekele","beish","behnken","beerly","beddo","becket","becke","bebeau","beauchaine","beaucage","beadling","beacher","bazar","baysmore"], english:["you","i","to","the","a","and","that","it","of","me","what","is","in","this","know","i'm","for","no","have","my","don't","just","not","do","be","on","your","was","we","it's","with","so","but","all","well","are","he","oh","about","right","you're","get","here","out","going","like","yeah","if","her","she","can","up","want","think","that's","now","go","him","at","how","got","there","one","did","why","see","come","good","they","really","as","would","look","when","time","will","okay","back","can't","mean","tell","i'll","from","hey","were","he's","could","didn't","yes","his","been","or","something","who","because","some","had","then","say","ok","take","an","way","us","little","make","need","gonna","never","we're","too","she's","i've","sure","them","more","over","our","sorry","where","what's","let","thing","am","maybe","down","man","has","uh","very","by","there's","should","anything","said","much","any","life","even","off","doing","thank","give","only","thought","help","two","talk","people","god","still","wait","into","find","nothing","again","things","let's","doesn't","call","told","great","before","better","ever","night","than","away","first","believe","other","feel","everything","work","you've","fine","home","after","last","these","day","keep","does","put","around","stop","they're","i'd","guy","isn't","always","listen","wanted","mr","guys","huh","those","big","lot","happened","thanks","won't","trying","kind","wrong","through","talking","made","new","being","guess","hi","care","bad","mom","remember","getting","we'll","together","dad","leave","place","understand","wouldn't","actually","hear","baby","nice","father","else","stay","done","wasn't","their","course","might","mind","every","enough","try","hell","came","someone","you'll","own","family","whole","another","house","yourself","idea","ask","best","must","coming","old","looking","woman","which","years","room","left","knew","tonight","real","son","hope","name","same","went","um","hmm","happy","pretty","saw","girl","sir","show","friend","already","saying","next","three","job","problem","minute","found","world","thinking","haven't","heard","honey","matter","myself","couldn't","exactly","having","ah","probably","happen","we've","hurt","boy","both","while","dead","gotta","alone","since","excuse","start","kill","hard","you'd","today","car","ready","until","without","wants","hold","wanna","yet","seen","deal","took","once","gone","called","morning","supposed","friends","head","stuff","most","used","worry","second","part","live","truth","school","face","forget","true","business","each","cause","soon","knows","few","telling","wife","who's","use","chance","run","move","anyone","person","bye","somebody","dr","heart","such","miss","married","point","later","making","meet","anyway","many","phone","reason","damn","lost","looks","bring","case","turn","wish","tomorrow","kids","trust","check","change","end","late","anymore","five","least","town","aren't","ha","working","year","makes","taking","means","brother","play","hate","ago","says","beautiful","gave","fact","crazy","party","sit","open","afraid","between","important","rest","fun","kid","word","watch","glad","everyone","days","sister","minutes","everybody","bit","couple","whoa","either","mrs","feeling","daughter","wow","gets","asked","under","break","promise","door","set","close","hand","easy","question","tried","far","walk","needs","mine","though","times","different","killed","hospital","anybody","alright","wedding","shut","able","die","perfect","stand","comes","hit","story","ya","mm","waiting","dinner","against","funny","husband","almost","pay","answer","four","office","eyes","news","child","shouldn't","half","side","yours","moment","sleep","read","where's","started","men","sounds","sonny","pick","sometimes","em","bed","also","date","line","plan","hours","lose","hands","serious","behind","inside","high","ahead","week","wonderful","fight","past","cut","quite","number","he'll","sick","it'll","game","eat","nobody","goes","along","save","seems","finally","lives","worried","upset","carly","met","book","brought","seem","sort","safe","living","children","weren't","leaving","front","shot","loved","asking","running","clear","figure","hot","felt","six","parents","drink","absolutely","how's","daddy","alive","sense","meant","happens","special","bet","blood","ain't","kidding","lie","full","meeting","dear","seeing","sound","fault","water","ten","women","buy","months","hour","speak","lady","jen","thinks","christmas","body","order","outside","hang","possible","worse","company","mistake","ooh","handle","spend","totally","giving","control","here's","marriage","realize","president","unless","sex","send","needed","taken","died","scared","picture","talked","ass","hundred","changed","completely","explain","playing","certainly","sign","boys","relationship","loves","hair","lying","choice","anywhere","future","weird","luck","she'll","turned","known","touch","kiss","crane","questions","obviously","wonder","pain","calling","somewhere","throw","straight","cold","fast","words","food","none","drive","feelings","they'll","worked","marry","light","drop","cannot","sent","city","dream","protect","twenty","class","surprise","its","sweetheart","poor","looked","mad","except","gun","y'know","dance","takes","appreciate","especially","situation","besides","pull","himself","hasn't","act","worth","sheridan","amazing","top","given","expect","rather","involved","swear","piece","busy","law","decided","happening","movie","we'd","catch","country","less","perhaps","step","fall","watching","kept","darling","dog","win","air","honor","personal","moving","till","admit","problems","murder","he'd","evil","definitely","feels","information","honest","eye","broke","missed","longer","dollars","tired","evening","human","starting","red","entire","trip","club","niles","suppose","calm","imagine","fair","caught","blame","street","sitting","favor","apartment","court","terrible","clean","learn","works","frasier","relax","million","accident","wake","prove","smart","message","missing","forgot","interested","table","nbsp","become","mouth","pregnant","middle","ring","careful","shall","team","ride","figured","wear","shoot","stick","follow","angry","instead","write","stopped","early","ran","war","standing","forgive","jail","wearing","kinda","lunch","cristian","eight","greenlee","gotten","hoping","phoebe","thousand","ridge","paper","tough","tape","state","count","boyfriend","proud","agree","birthday","seven","they've","history","share","offer","hurry","feet","wondering","decision","building","ones","finish","voice","herself","would've","list","mess","deserve","evidence","cute","dress","interesting","hotel","quiet","concerned","road","staying","beat","sweetie","mention","clothes","finished","fell","neither","mmm","fix","respect","spent","prison","attention","holding","calls","near","surprised","bar","keeping","gift","hadn't","putting","dark","self","owe","using","ice","helping","normal","aunt","lawyer","apart","certain","plans","jax","girlfriend","floor","whether","everything's","present","earth","box","cover","judge","upstairs","sake","mommy","possibly","worst","station","acting","accept","blow","strange","saved","conversation","plane","mama","yesterday","lied","quick","lately","stuck","report","difference","rid","store","she'd","bag","bought","doubt","listening","walking","cops","deep","dangerous","buffy","sleeping","chloe","rafe","shh","record","lord","moved","join","card","crime","gentlemen","willing","window","return","walked","guilty","likes","fighting","difficult","soul","joke","favorite","uncle","promised","public","bother","island","seriously","cell","lead","knowing","broken","advice","somehow","paid","losing","push","helped","killing","usually","earlier","boss","beginning","liked","innocent","doc","rules","cop","learned","thirty","risk","letting","speaking","officer","ridiculous","support","afternoon","born","apologize","seat","nervous","across","song","charge","patient","boat","how'd","hide","detective","planning","nine","huge","breakfast","horrible","age","awful","pleasure","driving","hanging","picked","sell","quit","apparently","dying","notice","congratulations","chief","one's","month","visit","could've","c'mon","letter","decide","double","sad","press","forward","fool","showed","smell","seemed","spell","memory","pictures","slow","seconds","hungry","board","position","hearing","roz","kitchen","ma'am","force","fly","during","space","should've","realized","experience","kick","others","grab","mother's","discuss","third","cat","fifty","responsible","fat","reading","idiot","yep","suddenly","agent","destroy","bucks","track","shoes","scene","peace","arms","demon","low","livvie","consider","papers","medical","incredible","witch","drunk","attorney","tells","knock","ways","gives","department","nose","skye","turns","keeps","jealous","drug","sooner","cares","plenty","extra","tea","won","attack","ground","whose","outta","weekend","matters","wrote","type","father's","gosh","opportunity","impossible","books","waste","pretend","named","jump","eating","proof","complete","slept","career","arrest","breathe","perfectly","warm","pulled","twice","easier","goin","dating","suit","romantic","drugs","comfortable","finds","checked","fit","divorce","begin","ourselves","closer","ruin","although","smile","laugh","treat","god's","fear","what'd","guy's","otherwise","excited","mail","hiding","cost","stole","pacey","noticed","fired","excellent","lived","bringing","pop","bottom","note","sudden","bathroom","flight","honestly","sing","foot","games","remind","bank","charges","witness","finding","places","tree","dare","hardly","that'll","interest","steal","silly","contact","teach","shop","plus","colonel","fresh","trial","invited","roll","radio","reach","heh","choose","emergency","dropped","credit","obvious","cry","locked","loving","positive","nuts","agreed","prue","goodbye","condition","guard","fuckin","grow","cake","mood","dad's","total","crap","crying","belong","lay","partner","trick","pressure","ohh","arm","dressed","cup","lies","bus","taste","neck","south","something's","nurse","raise","lots","carry","group","whoever","drinking","they'd","breaking","file","lock","wine","closed","writing","spot","paying","study","assume","asleep","man's","turning","legal","viki","bedroom","shower","nikolas","camera","fill","reasons","forty","bigger","nope","breath","doctors","pants","level","movies","gee","area","folks","ugh","continue","focus","wild","truly","desk","convince","client","threw","band","hurts","spending","allow","grand","answers","shirt","chair","allowed","rough","doin","sees","government","ought","empty","round","hat","wind","shows","aware","dealing","pack","meaning","hurting","ship","subject","guest","mom's","pal","match","arrested","salem","confused","surgery","expecting","deacon","unfortunately","goddamn","lab","passed","bottle","beyond","whenever","pool","opinion","held","common","starts","jerk","secrets","falling","played","necessary","barely","dancing","health","tests","copy","cousin","planned","dry","ahem","twelve","simply","tess","skin","often","fifteen","speech","names","issue","orders","nah","final","results","code","believed","complicated","umm","research","nowhere","escape","biggest","restaurant","grateful","usual","burn","address","within","someplace","screw","everywhere","train","film","regret","goodness","mistakes","details","responsibility","suspect","corner","hero","dumb","terrific","further","gas","whoo","hole","memories","o'clock","following","ended","nobody's","teeth","ruined","split","airport","bite","stenbeck","older","liar","showing","project","cards","desperate","themselves","pathetic","damage","spoke","quickly","scare","marah","afford","vote","settle","mentioned","due","stayed","rule","checking","tie","hired","upon","heads","concern","blew","natural","alcazar","champagne","connection","tickets","happiness","form","saving","kissing","hated","personally","suggest","prepared","build","leg","onto","leaves","downstairs","ticket","it'd","taught","loose","holy","staff","sea","duty","convinced","throwing","defense","kissed","legs","according","loud","practice","saturday","babies","army","where'd","warning","miracle","carrying","flying","blind","ugly","shopping","hates","someone's","sight","bride","coat","account","states","clearly","celebrate","brilliant","wanting","add","forrester","lips","custody","center","screwed","buying","size","toast","thoughts","student","stories","however","professional","reality","birth","lexie","attitude","advantage","grandfather","sami","sold","opened","grandma","beg","changes","someday","grade","roof","brothers","signed","ahh","marrying","powerful","grown","grandmother","fake","opening","expected","eventually","must've","ideas","exciting","covered","familiar","bomb","bout","television","harmony","color","heavy","schedule","records","capable","practically","including","correct","clue","forgotten","immediately","appointment","social","nature","deserves","threat","bloody","lonely","ordered","shame","local","jacket","hook","destroyed","scary","investigation","above","invite","shooting","port","lesson","criminal","growing","caused","victim","professor","followed","funeral","nothing's","considering","burning","strength","loss","view","gia","sisters","everybody's","several","pushed","written","somebody's","shock","pushing","heat","chocolate","greatest","miserable","corinthos","nightmare","brings","zander","character","became","famous","enemy","crash","chances","sending","recognize","healthy","boring","feed","engaged","percent","headed","lines","treated","purpose","knife","rights","drag","san","fan","badly","hire","paint","pardon","built","behavior","closet","warn","gorgeous","milk","survive","forced","operation","offered","ends","dump","rent","remembered","lieutenant","trade","thanksgiving","rain","revenge","physical","available","program","prefer","baby's","spare","pray","disappeared","aside","statement","sometime","meat","fantastic","breathing","laughing","itself","tip","stood","market","affair","ours","depends","main","protecting","jury","national","brave","large","jack's","interview","fingers","murdered","explanation","process","picking","based","style","pieces","blah","assistant","stronger","aah","pie","handsome","unbelievable","anytime","nearly","shake","everyone's","oakdale","cars","wherever","serve","pulling","points","medicine","facts","waited","lousy","circumstances","stage","disappointed","weak","trusted","license","nothin","community","trash","understanding","slip","cab","sounded","awake","friendship","stomach","weapon","threatened","mystery","official","regular","river","vegas","understood","contract","race","basically","switch","frankly","issues","cheap","lifetime","deny","painting","ear","clock","weight","garbage","why'd","tear","ears","dig","selling","setting","indeed","changing","singing","tiny","particular","draw","decent","avoid","messed","filled","touched","score","people's","disappear","exact","pills","kicked","harm","recently","fortune","pretending","raised","insurance","fancy","drove","cared","belongs","nights","shape","lorelai","base","lift","stock","sonny's","fashion","timing","guarantee","chest","bridge","woke","source","patients","theory","original","burned","watched","heading","selfish","oil","drinks","failed","period","doll","committed","elevator","freeze","noise","exist","science","pair","edge","wasting","sat","ceremony","pig","uncomfortable","peg","guns","staring","files","bike","weather","name's","mostly","stress","permission","arrived","thrown","possibility","example","borrow","release","ate","notes","hoo","library","property","negative","fabulous","event","doors","screaming","xander","term","what're","meal","fellow","apology","anger","honeymoon","wet","bail","parking","non","protection","fixed","families","chinese","campaign","map","wash","stolen","sensitive","stealing","chose","lets","comfort","worrying","whom","pocket","mateo","bleeding","students","shoulder","ignore","fourth","neighborhood","fbi","talent","tied","garage","dies","demons","dumped","witches","training","rude","crack","model","bothering","radar","grew","remain","soft","meantime","gimme","connected","kinds","cast","sky","likely","fate","buried","hug","brother's","concentrate","prom","messages","east","unit","intend","crew","ashamed","somethin","manage","guilt","weapons","terms","interrupt","guts","tongue","distance","conference","treatment","shoe","basement","sentence","purse","glasses","cabin","universe","towards","repeat","mirror","wound","travers","tall","reaction","odd","engagement","therapy","letters","emotional","runs","magazine","jeez","decisions","soup","daughter's","thrilled","society","managed","stake","chef","moves","extremely","entirely","moments","expensive","counting","shots","kidnapped","square","son's","cleaning","shift","plate","impressed","smells","trapped","male","tour","aidan","knocked","charming","attractive","argue","puts","whip","language","embarrassed","settled","package","laid","animals","hitting","disease","bust","stairs","alarm","pure","nail","nerve","incredibly","walks","dirt","stamp","sister's","becoming","terribly","friendly","easily","damned","jobs","suffering","disgusting","stopping","deliver","riding","helps","federal","disaster","bars","dna","crossed","rate","create","trap","claim","california","talks","eggs","effect","chick","threatening","spoken","introduce","confession","embarrassing","bags","impression","gate","year's","reputation","attacked","among","knowledge","presents","inn","europe","chat","suffer","argument","talkin","crowd","homework","fought","coincidence","cancel","accepted","rip","pride","solve","hopefully","pounds","pine","mate","illegal","generous","streets","con","separate","outfit","maid","bath","punch","mayor","freaked","begging","recall","enjoying","bug","woman's","prepare","parts","wheel","signal","direction","defend","signs","painful","yourselves","rat","maris","amount","that'd","suspicious","flat","cooking","button","warned","sixty","pity","parties","crisis","coach","row","yelling","leads","awhile","pen","confidence","offering","falls","image","farm","pleased","panic","hers","gettin","role","refuse","determined","hell's","grandpa","progress","testify","passing","military","choices","uhh","gym","cruel","wings","bodies","mental","gentleman","coma","cutting","proteus","guests","girl's","expert","benefit","faces","cases","led","jumped","toilet","secretary","sneak","mix","firm","halloween","agreement","privacy","dates","anniversary","smoking","reminds","pot","created","twins","swing","successful","season","scream","considered","solid","options","commitment","senior","ill","else's","crush","ambulance","wallet","discovered","officially","til","rise","reached","eleven","option","laundry","former","assure","stays","skip","fail","accused","wide","challenge","popular","learning","discussion","clinic","plant","exchange","betrayed","bro","sticking","university","members","lower","bored","mansion","soda","sheriff","suite","handled","busted","senator","load","happier","younger","studying","romance","procedure","ocean","section","sec","commit","assignment","suicide","minds","swim","ending","bat","yell","llanview","league","chasing","seats","proper","command","believes","humor","hopes","fifth","winning","solution","leader","theresa's","sale","lawyers","nor","material","latest","highly","escaped","audience","parent","tricks","insist","dropping","cheer","medication","higher","flesh","district","routine","century","shared","sandwich","handed","false","beating","appear","warrant","family's","awfully","odds","article","treating","thin","suggesting","fever","sweat","silent","specific","clever","sweater","request","prize","mall","tries","mile","fully","estate","union","sharing","assuming","judgment","goodnight","divorced","despite","surely","steps","jet","confess","math","listened","comin","answered","vulnerable","bless","dreaming","rooms","chip","zero","potential","pissed","nate","kills","tears","knees","chill","carly's","brains","agency","harvard","degree","unusual","wife's","joint","packed","dreamed","cure","covering","newspaper","lookin","coast","grave","egg","direct","cheating","breaks","quarter","mixed","locker","husband's","gifts","awkward","toy","thursday","rare","policy","kid's","joking","competition","classes","assumed","reasonable","dozen","curse","quartermaine","millions","dessert","rolling","detail","alien","served","delicious","closing","vampires","released","ancient","wore","value","tail","secure","salad","murderer","hits","toward","spit","screen","offense","dust","conscience","bread","answering","admitted","lame","invitation","grief","smiling","path","stands","bowl","pregnancy","hollywood","prisoner","delivery","guards","virus","shrink","influence","freezing","concert","wreck","partners","massimo","chain","birds","life's","wire","technically","presence","blown","anxious","cave","version","holidays","cleared","wishes","survived","caring","candles","bound","related","charm","yup","pulse","jumping","jokes","frame","boom","vice","performance","occasion","silence","opera","nonsense","frightened","downtown","americans","slipped","dimera","blowing","world's","session","relationships","kidnapping","actual","spin","civil","roxy","packing","education","blaming","wrap","obsessed","fruit","torture","personality","location","effort","daddy's","commander","trees","there'll","owner","fairy","per","other's","necessarily","county","contest","seventy","print","motel","fallen","directly","underwear","grams","exhausted","believing","particularly","freaking","carefully","trace","touching","messing","committee","recovery","intention","consequences","belt","sacrifice","courage","officers","enjoyed","lack","attracted","appears","bay","yard","returned","remove","nut","carried","today's","testimony","intense","granted","violence","heal","defending","attempt","unfair","relieved","political","loyal","approach","slowly","plays","normally","buzz","alcohol","actor","surprises","psychiatrist","pre","plain","attic","who'd","uniform","terrified","sons","pet","cleaned","zach","threaten","teaching","mum","motion","fella","enemies","desert","collection","incident","failure","satisfied","imagination","hooked","headache","forgetting","counselor","andie","acted","opposite","highest","equipment","badge","italian","visiting","naturally","frozen","commissioner","sakes","labor","appropriate","trunk","armed","thousands","received","dunno","costume","temporary","sixteen","impressive","zone","kicking","junk","hon","grabbed","unlike","understands","describe","clients","owns","affect","witnesses","starving","instincts","happily","discussing","deserved","strangers","leading","intelligence","host","authority","surveillance","cow","commercial","admire","questioning","fund","dragged","barn","object","deeply","amp","wrapped","wasted","tense","route","reports","hoped","fellas","election","roommate","mortal","fascinating","chosen","stops","shown","arranged","abandoned","sides","delivered","becomes","arrangements","agenda","began","theater","series","literally","propose","honesty","underneath","forces","services","sauce","promises","lecture","eighty","torn","shocked","relief","explained","counter","circle","victims","transfer","response","channel","identity","differently","campus","spy","ninety","interests","guide","deck","biological","pheebs","ease","creep","will's","waitress","skills","telephone","ripped","raising","scratch","rings","prints","wave","thee","arguing","figures","ephram","asks","reception","pin","oops","diner","annoying","agents","taggert","goal","mass","ability","sergeant","julian's","international","gig","blast","basic","tradition","towel","earned","rub","president's","habit","customers","creature","bermuda","actions","snap","react","prime","paranoid","wha","handling","eaten","therapist","comment","charged","tax","sink","reporter","beats","priority","interrupting","gain","fed","warehouse","shy","pattern","loyalty","inspector","events","pleasant","media","excuses","threats","permanent","guessing","financial","demand","assault","tend","praying","motive","los","unconscious","trained","museum","tracks","range","nap","mysterious","unhappy","tone","switched","rappaport","award","sookie","neighbor","loaded","gut","childhood","causing","swore","piss","hundreds","balance","background","toss","mob","misery","valentine's","thief","squeeze","lobby","hah","goa'uld","geez","exercise","ego","drama","al's","forth","facing","booked","boo","songs","sandburg","eighteen","d'you","bury","perform","everyday","digging","creepy","compared","wondered","trail","liver","hmmm","drawn","device","magical","journey","fits","discussed","supply","moral","helpful","attached","timmy's","searching","flew","depressed","aisle","underground","pro","daughters","cris","amen","vows","proposal","pit","neighbors","darn","cents","arrange","annulment","uses","useless","squad","represent","product","joined","afterwards","adventure","resist","protected","net","fourteen","celebrating","piano","inch","flag","debt","violent","tag","sand","gum","dammit","teal'c","hip","celebration","below","reminded","claims","tonight's","replace","phones","paperwork","emotions","typical","stubborn","stable","sheridan's","pound","papa","lap","designed","current","bum","tension","tank","suffered","steady","provide","overnight","meanwhile","chips","beef","wins","suits","boxes","salt","cassadine","collect","boy's","tragedy","therefore","spoil","realm","profile","degrees","wipe","surgeon","stretch","stepped","nephew","neat","limo","confident","anti","perspective","designer","climb","title","suggested","punishment","finest","ethan's","springfield","occurred","hint","furniture","blanket","twist","surrounded","surface","proceed","lip","fries","worries","refused","niece","gloves","soap","signature","disappoint","crawl","convicted","zoo","result","pages","lit","flip","counsel","doubts","crimes","accusing","when's","shaking","remembering","phase","hallway","halfway","bothered","useful","makeup","madam","gather","concerns","cia","cameras","blackmail","symptoms","rope","ordinary","imagined","concept","cigarette","supportive","memorial","explosion","yay","woo","trauma","ouch","leo's","furious","cheat","avoiding","whew","thick","oooh","boarding","approve","urgent","shhh","misunderstanding","minister","drawer","sin","phony","joining","jam","interfere","governor","chapter","catching","bargain","tragic","schools","respond","punish","penthouse","hop","thou","remains","rach","ohhh","insult","doctor's","bugs","beside","begged","absolute","strictly","stefano","socks","senses","ups","sneaking","yah","serving","reward","polite","checks","tale","physically","instructions","fooled","blows","tabby","internal","bitter","adorable","y'all","tested","suggestion","string","jewelry","debate","com","alike","pitch","fax","distracted","shelter","lessons","foreign","average","twin","friend's","damnit","constable","circus","audition","tune","shoulders","mud","mask","helpless","feeding","explains","dated","robbery","objection","behave","valuable","shadows","courtroom","confusing","tub","talented","struck","smarter","mistaken","italy","customer","bizarre","scaring","punk","motherfucker","holds","focused","alert","activity","vecchio","reverend","highway","foolish","compliment","bastards","attend","scheme","aid","worker","wheelchair","protective","poetry","gentle","script","reverse","picnic","knee","intended","construction","cage","wednesday","voices","toes","stink","scares","pour","effects","cheated","tower","time's","slide","ruining","recent","jewish","filling","exit","cottage","corporate","upside","supplies","proves","parked","instance","grounds","diary","complaining","basis","wounded","thing's","politics","confessed","pipe","merely","massage","data","chop","budget","brief","spill","prayer","costs","betray","begins","arrangement","waiter","scam","rats","fraud","flu","brush","anyone's","adopted","tables","sympathy","pill","pee","web","seventeen","landed","expression","entrance","employee","drawing","cap","bracelet","principal","pays","jen's","fairly","facility","dru","deeper","arrive","unique","tracking","spite","shed","recommend","oughta","nanny","naive","menu","grades","diet","corn","authorities","separated","roses","patch","dime","devastated","description","tap","subtle","include","citizen","bullets","beans","ric","pile","las","executive","confirm","toe","strings","parade","harbor","charity's","bow","borrowed","toys","straighten","steak","status","remote","premonition","poem","planted","honored","youth","specifically","meetings","exam","convenient","traveling","matches","laying","insisted","apply","units","technology","dish","aitoro","sis","kindly","grandson","donor","temper","teenager","strategy","richard's","proven","iron","denial","couples","backwards","tent","swell","noon","happiest","episode","drives","thinkin","spirits","potion","fence","affairs","acts","whatsoever","rehearsal","proved","overheard","nuclear","lemme","hostage","faced","constant","bench","tryin","taxi","shove","sets","moron","limits","impress","entitled","needle","limit","lad","intelligent","instant","forms","disagree","stinks","rianna","recover","paul's","losers","groom","gesture","developed","constantly","blocks","bartender","tunnel","suspects","sealed","removed","legally","illness","hears","dresses","aye","vehicle","thy","teachers","sheet","receive","psychic","night's","denied","knocking","judging","bible","behalf","accidentally","waking","ton","superior","seek","rumor","natalie's","manners","homeless","hollow","desperately","critical","theme","tapes","referring","personnel","item","genoa","gear","majesty","fans","exposed","cried","tons","spells","producer","launch","instinct","belief","quote","motorcycle","convincing","appeal","advance","greater","fashioned","aids","accomplished","mommy's","grip","bump","upsetting","soldiers","scheduled","production","needing","invisible","forgiveness","feds","complex","compare","bothers","tooth","territory","sacred","mon","jessica's","inviting","inner","earn","compromise","cocktail","tramp","temperature","signing","landing","jabot","intimate","dignity","dealt","souls","informed","gods","entertainment","dressing","cigarettes","blessing","billion","alistair","upper","manner","lightning","leak","heaven's","fond","corky","alternative","seduce","players","operate","modern","liquor","fingerprints","enchantment","butters","stuffed","stavros","rome","filed","emotionally","division","conditions","uhm","transplant","tips","passes","oxygen","nicely","lunatic","hid","drill","designs","complain","announcement","visitors","unfortunate","slap","prayers","plug","organization","opens","oath","o'neill","mutual","graduate","confirmed","broad","yacht","spa","remembers","fried","extraordinary","bait","appearance","abuse","warton","sworn","stare","safely","reunion","plot","burst","aha","might've","experiment","dive","commission","cells","aboard","returning","independent","expose","environment","buddies","trusting","smaller","mountains","booze","sweep","sore","scudder","properly","parole","manhattan","effective","ditch","decides","canceled","bra","antonio's","speaks","spanish","reaching","glow","foundation","women's","wears","thirsty","skull","ringing","dorm","dining","bend","unexpected","systems","sob","pancakes","michael's","harsh","flattered","existence","ahhh","troubles","proposed","fights","favourite","eats","driven","computers","rage","luke's","causes","border","undercover","spoiled","sloane","shine","rug","identify","destroying","deputy","deliberately","conspiracy","clothing","thoughtful","similar","sandwiches","plates","nails","miracles","investment","fridge","drank","contrary","beloved","allergic","washed","stalking","solved","sack","misses","hope's","forgiven","erica's","cuz","bent","approval","practical","organized","maciver","involve","industry","fuel","dragging","cooked","possession","pointing","foul","editor","dull","beneath","ages","horror","heels","grass","faking","deaf","stunt","portrait","painted","jealousy","hopeless","fears","cuts","conclusion","volunteer","scenario","satellite","necklace","men's","crashed","chapel","accuse","restraining","jason's","humans","homicide","helicopter","formal","firing","shortly","safer","devoted","auction","videotape","tore","stores","reservations","pops","appetite","anybody's","wounds","vanquish","symbol","prevent","patrol","ironic","flow","fathers","excitement","anyhow","tearing","sends","sam's","rape","laughed","function","core","charmed","whatever's","sub","lucy's","dealer","cooperate","bachelor","accomplish","wakes","struggle","spotted","sorts","reservation","ashes","yards","votes","tastes","supposedly","loft","intentions","integrity","wished","towels","suspected","slightly","qualified","log","investigating","inappropriate","immediate","companies","backed","pan","owned","lipstick","lawn","compassion","cafeteria","belonged","affected","scarf","precisely","obsession","management","loses","lighten","jake's","infection","granddaughter","explode","chemistry","balcony","this'll","storage","spying","publicity","exists","employees","depend","cue","cracked","conscious","aww","ally","ace","accounts","absurd","vicious","tools","strongly","rap","invented","forbid","directions","defendant","bare","announce","alcazar's","screwing","salesman","robbed","leap","lakeview","insanity","injury","genetic","document","why's","reveal","religious","possibilities","kidnap","gown","entering","chairs","wishing","statue","setup","serial","punished","dramatic","dismissed","criminals","seventh","regrets","raped","quarters","produce","lamp","dentist","anyways","anonymous","added","semester","risks","regarding","owes","magazines","machines","lungs","explaining","delicate","child's","tricked","oldest","liv","eager","doomed","cafe","bureau","adoption","traditional","surrender","stab","sickness","scum","loop","independence","generation","floating","envelope","entered","combination","chamber","worn","vault","sorel","pretended","potatoes","plea","photograph","payback","misunderstood","kiddo","healing","cascade","capeside","application","stabbed","remarkable","cabinet","brat","wrestling","sixth","scale","privilege","passionate","nerves","lawsuit","kidney","disturbed","crossing","cozy","associate","tire","shirts","required","posted","oven","ordering","mill","journal","gallery","delay","clubs","risky","nest","monsters","honorable","grounded","favour","culture","closest","brenda's","breakdown","attempted","tony's","placed","conflict","bald","actress","abandon","steam","scar","pole","duh","collar","worthless","standards","resources","photographs","introduced","injured","graduation","enormous","disturbing","disturb","distract","deals","conclusions","vodka","situations","require","mid","measure","dishes","crawling","congress","children's","briefcase","wiped","whistle","sits","roast","rented","pigs","greek","flirting","existed","deposit","damaged","bottles","vanessa's","types","topic","riot","overreacting","minimum","logical","impact","hostile","embarrass","casual","beacon","amusing","altar","values","recognized","maintain","goods","covers","claus","battery","survival","skirt","shave","prisoners","porch","med","ghosts","favors","drops","dizzy","chili","begun","beaten","advise","transferred","strikes","rehab","raw","photographer","peaceful","leery","heavens","fortunately","fooling","expectations","draft","citizens","weakness","ski","ships","ranch","practicing","musical","movement","individual","homes","executed","examine","documents","cranes","column","bribe","task","species","sail","rum","resort","prescription","operating","hush","fragile","forensics","expense","drugged","differences","cows","conduct","comic","bells","avenue","attacking","assigned","visitor","suitcase","sources","sorta","scan","payment","motor","mini","manticore","inspired","insecure","imagining","hardest","clerk","yea","wrist","what'll","tube","starters","silk","pump","pale","nicer","haul","flies","demands","boot","arts","african","there'd","limited","how're","elders","connections","quietly","pulls","idiots","factor","erase","denying","attacks","ankle","amnesia","accepting","ooo","heartbeat","gal","devane","confront","backing","phrase","operations","minus","meets","legitimate","hurricane","fixing","communication","boats","auto","arrogant","supper","studies","slightest","sins","sayin","recipe","pier","paternity","humiliating","genuine","catholic","snack","rational","pointed","minded","guessed","grace's","display","dip","brooke's","advanced","weddings","unh","tumor","teams","reported","humiliated","destruction","copies","closely","bid","aspirin","academy","wig","throughout","spray","occur","logic","eyed","equal","drowning","contacts","shakespeare","ritual","perfume","kelly's","hiring","hating","generally","error","elected","docks","creatures","visions","thanking","thankful","sock","replaced","nineteen","nick's","fork","comedy","analysis","yale","throws","teenagers","studied","stressed","slice","rolls","requires","plead","ladder","kicks","detectives","assured","alison's","widow","tomorrow's","tissue","tellin","shallow","responsibilities","repay","rejected","permanently","girlfriends","deadly","comforting","ceiling","bonus","verdict","maintenance","jar","insensitive","factory","aim","triple","spilled","respected","recovered","messy","interrupted","halliwell","car's","bleed","benefits","wardrobe","takin","significant","objective","murders","doo","chart","backs","workers","waves","underestimate","ties","registered","multiple","justify","harmless","frustrated","fold","enzo","convention","communicate","bugging","attraction","arson","whack","salary","rumors","residence","party's","obligation","medium","liking","laura's","development","develop","dearest","david's","danny's","congratulate","vengeance","switzerland","severe","rack","puzzle","puerto","guidance","fires","courtesy","caller","blamed","tops","repair","quiz","prep","now's","involves","headquarters","curiosity","codes","circles","barbecue","troops","sunnydale","spinning","scores","pursue","psychotic","cough","claimed","accusations","shares","resent","money's","laughs","gathered","freshman","envy","drown","cristian's","bartlet","asses","sofa","scientist","poster","islands","highness","dock","apologies","welfare","victor's","theirs","stat","stall","spots","somewhat","ryan's","realizes","psych","fools","finishing","album","wee","understandable","unable","treats","theatre","succeed","stir","relaxed","makin","inches","gratitude","faithful","bin","accent","zip","witter","wandering","regardless","que","locate","inevitable","gretel","deed","crushed","controlling","taxes","smelled","settlement","robe","poet","opposed","marked","greenlee's","gossip","gambling","determine","cuba","cosmetics","cent","accidents","surprising","stiff","sincere","shield","rushed","resume","reporting","refrigerator","reference","preparing","nightmares","mijo","ignoring","hunch","fog","fireworks","drowned","crown","cooperation","brass","accurate","whispering","sophisticated","religion","luggage","investigate","hike","explore","emotion","creek","crashing","contacted","complications","ceo","acid","shining","rolled","righteous","reconsider","inspiration","goody","geek","frightening","festival","ethics","creeps","courthouse","camping","assistance","affection","vow","smythe","protest","lodge","haircut","forcing","essay","chairman","baked","apologized","vibe","respects","receipt","mami","includes","hats","exclusive","destructive","define","defeat","adore","adopt","voted","tracked","signals","shorts","rory's","reminding","relative","ninth","floors","dough","creations","continues","cancelled","cabot","barrel","adam's","snuck","slight","reporters","rear","pressing","novel","newspapers","magnificent","madame","lazy","glorious","fiancee","candidate","brick","bits","australia","activities","visitation","scholarship","sane","previous","kindness","ivy's","shoulda","rescued","mattress","maria's","lounge","lifted","label","importantly","glove","enterprises","driver's","disappointment","condo","cemetery","beings","admitting","yelled","waving","screech","satisfaction","requested","reads","plants","nun","nailed","described","dedicated","certificate","centuries","annual","worm","tick","resting","primary","polish","marvelous","fuss","funds","defensive","cortlandt","compete","chased","provided","pockets","luckily","lilith","filing","depression","conversations","consideration","consciousness","worlds","innocence","indicate","grandmother's","forehead","bam","appeared","aggressive","trailer","slam","retirement","quitting","pry","person's","narrow","levels","kay's","inform","encourage","dug","delighted","daylight","danced","currently","confidential","billy's","ben's","aunts","washing","vic","tossed","spectra","rick's","permit","marrow","lined","implying","hatred","grill","efforts","corpse","clues","sober","relatives","promotion","offended","morgue","larger","infected","humanity","eww","emily's","electricity","electrical","distraction","cart","broadcast","wired","violation","suspended","promising","harassment","glue","gathering","d'angelo","cursed","controlled","calendar","brutal","assets","warlocks","wagon","unpleasant","proving","priorities","observation","mustn't","lease","grows","flame","domestic","disappearance","depressing","thrill","sitter","ribs","offers","naw","flush","exception","earrings","deadline","corporal","collapsed","update","snapped","smack","orleans","offices","melt","figuring","delusional","coulda","burnt","actors","trips","tender","sperm","specialist","scientific","realise","pork","popped","planes","kev","interrogation","institution","included","esteem","communications","choosing","choir","undo","pres","prayed","plague","manipulate","lifestyle","insulting","honour","detention","delightful","coffeehouse","chess","betrayal","apologizing","adjust","wrecked","wont","whipped","rides","reminder","psychological","principle","monsieur","injuries","fame","faint","confusion","christ's","bon","bake","nearest","korea","industries","execution","distress","definition","creating","correctly","complaint","blocked","trophy","tortured","structure","rot","risking","pointless","household","heir","handing","eighth","dumping","cups","chloe's","alibi","absence","vital","tokyo","thus","struggling","shiny","risked","refer","mummy","mint","joey's","involvement","hose","hobby","fortunate","fleischman","fitting","curtain","counseling","addition","wit","transport","technical","rode","puppet","opportunities","modeling","memo","irresponsible","humiliation","hiya","freakin","fez","felony","choke","blackmailing","appreciated","tabloid","suspicion","recovering","rally","psychology","pledge","panicked","nursery","louder","jeans","investigator","identified","homecoming","helena's","height","graduated","frustrating","fabric","distant","buys","busting","buff","wax","sleeve","products","philosophy","irony","hospitals","dope","declare","autopsy","workin","torch","substitute","scandal","prick","limb","leaf","lady's","hysterical","growth","goddamnit","fetch","dimension","day's","crowded","clip","climbing","bonding","approved","yeh","woah","ultimately","trusts","returns","negotiate","millennium","majority","lethal","length","iced","deeds","bore","babysitter","questioned","outrageous","medal","kiriakis","insulted","grudge","established","driveway","deserted","definite","capture","beep","wires","suggestions","searched","owed","originally","nickname","lighting","lend","drunken","demanding","costanza","conviction","characters","bumped","weigh","touches","tempted","shout","resolve","relate","poisoned","pip","phoebe's","pete's","occasionally","molly's","meals","maker","invitations","haunted","fur","footage","depending","bogus","autograph","affects","tolerate","stepping","spontaneous","sleeps","probation","presentation","performed","manny","identical","fist","cycle","associates","aaron's","streak","spectacular","sector","lasted","isaac's","increase","hostages","heroin","havin","habits","encouraging","cult","consult","burgers","boyfriends","bailed","baggage","association","wealthy","watches","versus","troubled","torturing","teasing","sweetest","stations","sip","shawn's","rag","qualities","postpone","pad","overwhelmed","malkovich","impulse","hut","follows","classy","charging","barbara's","angel's","amazed","scenes","rising","revealed","representing","policeman","offensive","mug","hypocrite","humiliate","hideous","finals","experiences","d'ya","courts","costumes","captured","bluffing","betting","bein","bedtime","alcoholic","vegetable","tray","suspicions","spreading","splendid","shouting","roots","pressed","nooo","liza's","jew","intent","grieving","gladly","fling","eliminate","disorder","courtney's","cereal","arrives","aaah","yum","technique","statements","sonofabitch","servant","roads","republican","paralyzed","orb","lotta","locks","guaranteed","european","dummy","discipline","despise","dental","corporation","carries","briefing","bluff","batteries","atmosphere","whatta","tux","sounding","servants","rifle","presume","kevin's","handwriting","goals","gin","fainted","elements","dried","cape","allright","allowing","acknowledge","whacked","toxic","skating","reliable","quicker","penalty","panel","overwhelming","nearby","lining","importance","harassing","fatal","endless","elsewhere","dolls","convict","bold","ballet","whatcha","unlikely","spiritual","shutting","separation","recording","positively","overcome","goddam","failing","essence","dose","diagnosis","cured","claiming","bully","airline","ahold","yearbook","various","tempting","shelf","rig","pursuit","prosecution","pouring","possessed","partnership","miguel's","lindsay's","countries","wonders","tsk","thorough","spine","rath","psychiatric","meaningless","latte","jammed","ignored","fiance","exposure","exhibit","evidently","duties","contempt","compromised","capacity","cans","weekends","urge","theft","suing","shipment","scissors","responding","refuses","proposition","noises","matching","located","ink","hormones","hiv","hail","grandchildren","godfather","gently","establish","crane's","contracts","compound","buffy's","worldwide","smashed","sexually","sentimental","senor","scored","patient's","nicest","marketing","manipulated","jaw","intern","handcuffs","framed","errands","entertaining","discovery","crib","carriage","barge","awards","attending","ambassador","videos","tab","spends","slipping","seated","rubbing","rely","reject","recommendation","reckon","ratings","headaches","float","embrace","corners","whining","sweating","sole","skipped","restore","receiving","population","pep","mountie","motives","mama's","listens","korean","heroes","heart's","cristobel","controls","cheerleader","balsom","unnecessary","stunning","shipping","scent","santa's","quartermaines","praise","pose","montega","luxury","loosen","kyle's","keri's","info","hum","haunt","gracious","git","forgiving","fleet","errand","emperor","cakes","blames","abortion","worship","theories","strict","sketch","shifts","plotting","physician","perimeter","passage","pals","mere","mattered","lonigan","longest","jews","interference","eyewitness","enthusiasm","encounter","diapers","craig's","artists","strongest","shaken","serves","punched","projects","portal","outer","nazi","hal's","colleagues","catches","bearing","backyard","academic","winds","terrorists","sabotage","pea","organs","needy","mentor","measures","listed","lex","cuff","civilization","caribbean","articles","writes","woof","who'll","viki's","valid","rarely","rabbi","prank","performing","obnoxious","mates","improve","hereby","gabby","faked","cellar","whitelighter","void","substance","strangle","sour","skill","senate","purchase","native","muffins","interfering","hoh","gina's","demonic","colored","clearing","civilian","buildings","boutique","barrington","trading","terrace","smoked","seed","righty","relations","quack","published","preliminary","petey","pact","outstanding","opinions","knot","ketchup","items","examined","disappearing","cordy","coin","circuit","assist","administration","walt","uptight","ticking","terrifying","tease","tabitha's","syd","swamp","secretly","rejection","reflection","realizing","rays","pennsylvania","partly","mentally","marone","jurisdiction","frasier's","doubted","deception","crucial","congressman","cheesy","arrival","visited","supporting","stalling","scouts","scoop","ribbon","reserve","raid","notion","income","immune","grandma's","expects","edition","destined","constitution","classroom","bets","appreciation","appointed","accomplice","whitney's","wander","shoved","sewer","scroll","retire","paintings","lasts","fugitive","freezer","discount","cranky","crank","clearance","bodyguard","anxiety","accountant","abby's","whoops","volunteered","terrorist","tales","talents","stinking","resolved","remotely","protocol","livvie's","garlic","decency","cord","beds","asa's","areas","altogether","uniforms","tremendous","restaurants","rank","profession","popping","philadelphia","outa","observe","lung","largest","hangs","feelin","experts","enforcement","encouraged","economy","dudes","donation","disguise","diane's","curb","continued","competitive","businessman","bites","antique","advertising","ads","toothbrush","retreat","represents","realistic","profits","predict","nora's","lid","landlord","hourglass","hesitate","frank's","focusing","equally","consolation","boyfriend's","babbling","aged","troy's","tipped","stranded","smartest","sabrina's","rhythm","replacement","repeating","puke","psst","paycheck","overreacted","macho","leadership","kendall's","juvenile","john's","images","grocery","freshen","disposal","cuffs","consent","caffeine","arguments","agrees","abigail's","vanished","unfinished","tobacco","tin","syndrome","ripping","pinch","missiles","isolated","flattering","expenses","dinners","cos","colleague","ciao","buh","belthazor","belle's","attorneys","amber's","woulda","whereabouts","wars","waitin","visits","truce","tripped","tee","tasted","stu","steer","ruling","poisoning","nursing","manipulative","immature","husbands","heel","granddad","delivering","deaths","condoms","automatically","anchor","trashed","tournament","throne","raining","prices","pasta","needles","leaning","leaders","judges","ideal","detector","coolest","casting","batch","approximately","appointments","almighty","achieve","vegetables","sum","spark","ruled","revolution","principles","perfection","pains","momma","mole","interviews","initiative","hairs","getaway","employment","den","cracking","counted","compliments","behold","verge","tougher","timer","tapped","taped","stakes","specialty","snooping","shoots","semi","rendezvous","pentagon","passenger","leverage","jeopardize","janitor","grandparents","forbidden","examination","communist","clueless","cities","bidding","arriving","adding","ungrateful","unacceptable","tutor","soviet","shaped","serum","scuse","savings","pub","pajamas","mouths","modest","methods","lure","irrational","depth","cries","classified","bombs","beautifully","arresting","approaching","vessel","variety","traitor","sympathetic","smug","smash","rental","prostitute","premonitions","mild","jumps","inventory","ing","improved","grandfather's","developing","darlin","committing","caleb's","banging","asap","amendment","worms","violated","vent","traumatic","traced","tow","swiss","sweaty","shaft","recommended","overboard","literature","insight","healed","grasp","fluid","experiencing","crappy","crab","connecticut","chunk","chandler's","awww","applied","witnessed","traveled","stain","shack","reacted","pronounce","presented","poured","occupied","moms","marriages","jabez","invested","handful","gob","gag","flipped","fireplace","expertise","embarrassment","disappears","concussion","bruises","brakes","anything's","week's","twisting","tide","swept","summon","splitting","settling","scientists","reschedule","regard","purposes","ohio","notch","mike's","improvement","hooray","grabbing","extend","exquisite","disrespect","complaints","colin's","armor","voting","thornhart","sustained","straw","slapped","simon's","shipped","shattered","ruthless","reva's","refill","recorded","payroll","numb","mourning","marijuana","manly","jerry's","involving","hunk","entertain","earthquake","drift","dreadful","doorstep","confirmation","chops","bridget's","appreciates","announced","vague","tires","stressful","stem","stashed","stash","sensed","preoccupied","predictable","noticing","madly","halls","gunshot","embassy","dozens","dinner's","confuse","cleaners","charade","chalk","cappuccino","breed","bouquet","amulet","addiction","who've","warming","unlock","transition","satisfy","sacrificed","relaxing","lone","input","hampshire","girlfriend's","elaborate","concerning","completed","channels","category","cal","blocking","blend","blankets","america's","addicted","yuck","voters","professionals","positions","monica's","mode","initial","hunger","hamburger","greeting","greet","gravy","gram","dreamt","dice","declared","collecting","caution","brady's","backpack","agreeing","writers","whale","tribe","taller","supervisor","sacrifices","radiation","poo","phew","outcome","ounce","missile","meter","likewise","irrelevant","gran","felon","feature","favorites","farther","fade","experiments","erased","easiest","disk","convenience","conceived","compassionate","challenged","cane","blair's","backstage","agony","adores","veins","tweek","thieves","surgical","strangely","stetson","recital","proposing","productive","meaningful","marching","immunity","hassle","goddamned","frighten","directors","dearly","comments","closure","cease","ambition","wisconsin","unstable","sweetness","salvage","richer","refusing","raging","pumping","pressuring","petition","mortals","lowlife","jus","intimidated","intentionally","inspire","forgave","eric's","devotion","despicable","deciding","dash","comfy","breach","bo's","bark","alternate","aaaah","switching","swallowed","stove","slot","screamed","scars","russians","relevant","poof","pipes","persons","pawn","losses","legit","invest","generations","farewell","experimental","difficulty","curtains","civilized","championship","caviar","boost","token","tends","temporarily","superstition","supernatural","sunk","sadness","reduced","recorder","psyched","presidential","owners","motivated","microwave","lands","karen's","hallelujah","gap","fraternity","engines","dryer","cocoa","chewing","additional","acceptable","unbelievably","survivor","smiled","smelling","sized","simpler","sentenced","respectable","remarks","registration","premises","passengers","organ","occasional","khasinau","indication","gutter","grabs","goo","fulfill","flashlight","ellenor","courses","blooded","blessings","beware","beth's","bands","advised","water's","uhhh","turf","swings","slips","shocking","resistance","privately","olivia's","mirrors","lyrics","locking","instrument","historical","heartless","fras","decades","comparison","childish","cassie's","cardiac","admission","utterly","tuscany","ticked","suspension","stunned","statesville","sadly","resolution","reserved","purely","opponent","noted","lowest","kiddin","jerks","hitch","flirt","fare","extension","establishment","equals","dismiss","delayed","decade","christening","casket","c'mere","breakup","brad's","biting","antibiotics","accusation","abducted","witchcraft","whoever's","traded","thread","spelling","so's","school's","runnin","remaining","punching","protein","printed","paramedics","newest","murdering","mine's","masks","lawndale","intact","ins","initials","heights","grampa","democracy","deceased","colleen's","choking","charms","careless","bushes","buns","bummed","accounting","travels","taylor's","shred","saves","saddle","rethink","regards","references","precinct","persuade","patterns","meds","manipulating","llanfair","leash","kenny's","housing","hearted","guarantees","flown","feast","extent","educated","disgrace","determination","deposition","coverage","corridor","burial","bookstore","boil","abilities","vitals","veil","trespassing","teaches","sidewalk","sensible","punishing","overtime","optimistic","occasions","obsessing","oak","notify","mornin","jeopardy","jaffa","injection","hilarious","distinct","directed","desires","curve","confide","challenging","cautious","alter","yada","wilderness","where're","vindictive","vial","tomb","teeny","subjects","stroll","sittin","scrub","rebuild","rachel's","posters","parallel","ordeal","orbit","o'brien","nuns","max's","jennifer's","intimacy","inheritance","fails","exploded","donate","distracting","despair","democratic","defended","crackers","commercials","bryant's","ammunition","wildwind","virtue","thoroughly","tails","spicy","sketches","sights","sheer","shaving","seize","scarecrow","refreshing","prosecute","possess","platter","phillip's","napkin","misplaced","merchandise","membership","loony","jinx","heroic","frankenstein","fag","efficient","devil's","corps","clan","boundaries","attract","ambitious","virtually","syrup","solitary","resignation","resemblance","reacting","pursuing","premature","pod","liz's","lavery","journalist","honors","harvey's","genes","flashes","erm","contribution","company's","client's","cheque","charts","cargo","awright","acquainted","wrapping","untie","salute","ruins","resign","realised","priceless","partying","myth","moonlight","lightly","lifting","kasnoff","insisting","glowing","generator","flowing","explosives","employer","cutie","confronted","clause","buts","breakthrough","blouse","ballistic","antidote","analyze","allowance","adjourned","vet","unto","understatement","tucked","touchy","toll","subconscious","sequence","screws","sarge","roommates","reaches","rambaldi","programs","offend","nerd","knives","kin","irresistible","inherited","incapable","hostility","goddammit","fuse","frat","equation","curfew","centered","blackmailed","allows","alleged","walkin","transmission","text","starve","sleigh","sarcastic","recess","rebound","procedures","pinned","parlor","outfits","livin","issued","institute","industrial","heartache","head's","haired","fundraiser","doorman","documentary","discreet","dilucca","detect","cracks","cracker","considerate","climbed","catering","author","apophis","zoey","vacuum","urine","tunnels","todd's","tanks","strung","stitches","sordid","sark","referred","protector","portion","phoned","pets","paths","mat","lengths","kindergarten","hostess","flaw","flavor","discharge","deveraux","consumed","confidentiality","automatic","amongst","viktor","victim's","tactics","straightened","specials","spaghetti","soil","prettier","powerless","por","poems","playin","playground","parker's","paranoia","nsa","mainly","mac's","joe's","instantly","havoc","exaggerating","evaluation","eavesdropping","doughnuts","diversion","deepest","cutest","companion","comb","bela","behaving","avoided","anyplace","agh","accessory","zap","whereas","translate","stuffing","speeding","slime","polls","personalities","payments","musician","marital","lurking","lottery","journalism","interior","imaginary","hog","guinea","greetings","game's","fairwinds","ethical","equipped","environmental","elegant","elbow","customs","cuban","credibility","credentials","consistent","collapse","cloth","claws","chopped","challenges","bridal","boards","bedside","babysitting","authorized","assumption","ant","youngest","witty","vast","unforgivable","underworld","tempt","tabs","succeeded","sophomore","selfless","secrecy","runway","restless","programming","professionally","okey","movin","metaphor","messes","meltdown","lecter","incoming","hence","gasoline","gained","funding","episodes","diefenbaker","contain","comedian","collected","cam","buckle","assembly","ancestors","admired","adjustment","acceptance","weekly","warmth","throats","seduced","ridge's","reform","rebecca's","queer","poll","parenting","noses","luckiest","graveyard","gifted","footsteps","dimeras","cynical","assassination","wedded","voyage","volunteers","verbal","unpredictable","tuned","stoop","slides","sinking","show's","rio","rigged","regulations","region","promoted","plumbing","lingerie","layer","katie's","hankey","greed","everwood","essential","elope","dresser","departure","dat","dances","coup","chauffeur","bulletin","bugged","bouncing","website","tubes","temptation","supported","strangest","sorel's","slammed","selection","sarcasm","rib","primitive","platform","pending","partial","packages","orderly","obsessive","nevertheless","nbc","murderers","motto","meteor","inconvenience","glimpse","froze","fiber","execute","etc","ensure","drivers","dispute","damages","crop","courageous","consulate","closes","bosses","bees","amends","wuss","wolfram","wacky","unemployed","traces","town's","testifying","tendency","syringe","symphony","stew","startled","sorrow","sleazy","shaky","screams","rsquo","remark","poke","phone's","philip's","nutty","nobel","mentioning","mend","mayor's","iowa","inspiring","impulsive","housekeeper","germans","formed","foam","fingernails","economic","divide","conditioning","baking","whine","thug","starved","sedative","rose's","reversed","publishing","programmed","picket","paged","nowadays","newman's","mines","margo's","invasion","homosexual","homo","hips","forgets","flipping","flea","flatter","dwell","dumpster","consultant","choo","banking","assignments","apartments","ants","affecting","advisor","vile","unreasonable","tossing","thanked","steals","souvenir","screening","scratched","rep","psychopath","proportion","outs","operative","obstruction","obey","neutral","lump","lily's","insists","ian's","harass","gloat","flights","filth","extended","electronic","edgy","diseases","didn","coroner","confessing","cologne","cedar","bruise","betraying","bailing","attempting","appealing","adebisi","wrath","wandered","waist","vain","traps","transportation","stepfather","publicly","presidents","poking","obligated","marshal","lexie's","instructed","heavenly","halt","employed","diplomatic","dilemma","crazed","contagious","coaster","cheering","carved","bundle","approached","appearances","vomit","thingy","stadium","speeches","robbing","reflect","raft","qualify","pumped","pillows","peep","pageant","packs","neo","neglected","m'kay","loneliness","liberal","intrude","indicates","helluva","gardener","freely","forresters","err","drooling","continuing","betcha","alan's","addressed","acquired","vase","supermarket","squat","spitting","spaces","slaves","rhyme","relieve","receipts","racket","purchased","preserve","pictured","pause","overdue","officials","nod","motivation","morgendorffer","lucky's","lacking","kidnapper","introduction","insect","hunters","horns","feminine","eyeballs","dumps","disc","disappointing","difficulties","crock","convertible","context","claw","clamp","canned","cambias","bathtub","avanya","artery","weep","warmer","vendetta","tenth","suspense","summoned","stuff's","spiders","sings","reiber","raving","pushy","produced","poverty","postponed","ohhhh","noooo","mold","mice","laughter","incompetent","hugging","groceries","frequency","fastest","drip","differ","daphne's","communicating","body's","beliefs","bats","bases","auntie","adios","wraps","willingly","weirdest","voila","timmih","thinner","swelling","swat","steroids","sensitivity","scrape","rehearse","quarterback","organic","matched","ledge","justified","insults","increased","heavily","hateful","handles","feared","doorway","decorations","colour","chatting","buyer","buckaroo","bedrooms","batting","askin","ammo","tutoring","subpoena","span","scratching","requests","privileges","pager","mart","kel","intriguing","idiotic","hotels","grape","enlighten","dum","door's","dixie's","demonstrate","dairy","corrupt","combined","brunch","bridesmaid","barking","architect","applause","alongside","ale","acquaintance","yuh","wretched","superficial","sufficient","sued","soak","smoothly","sensing","restraint","quo","pow","posing","pleading","pittsburgh","peru","payoff","participate","organize","oprah","nemo","morals","loans","loaf","lists","laboratory","jumpy","intervention","ignorant","herbal","hangin","germs","generosity","flashing","country's","convent","clumsy","chocolates","captive","bianca's","behaved","apologise","vanity","trials","stumbled","republicans","represented","recognition","preview","poisonous","perjury","parental","onboard","mugged","minding","linen","learns","knots","interviewing","inmates","ingredients","humour","grind","greasy","goons","estimate","elementary","edmund's","drastic","database","coop","comparing","cocky","clearer","bruised","brag","bind","axe","asset","apparent","ann's","worthwhile","whoop","wedding's","vanquishing","tabloids","survivors","stenbeck's","sprung","spotlight","shops","sentencing","sentences","revealing","reduce","ram","racist","provoke","piper's","pining","overly","oui","ops","mop","louisiana","locket","king's","jab","imply","impatient","hovering","hotter","fest","endure","dots","doren","dim","diagnosed","debts","cultures","crawled","contained","condemned","chained","brit","breaths","adds","weirdo","warmed","wand","utah","troubling","tok'ra","stripped","strapped","soaked","skipping","sharon's","scrambled","rattle","profound","musta","mocking","mnh","misunderstand","merit","loading","linked","limousine","kacl","investors","interviewed","hustle","forensic","foods","enthusiastic","duct","drawers","devastating","democrats","conquer","concentration","comeback","clarify","chores","cheerleaders","cheaper","charlie's","callin","blushing","barging","abused","yoga","wrecking","wits","waffles","virginity","vibes","uninvited","unfaithful","underwater","tribute","strangled","state's","scheming","ropes","responded","residents","rescuing","rave","priests","postcard","overseas","orientation","ongoing","o'reily","newly","neil's","morphine","lotion","limitations","lesser","lectures","lads","kidneys","judgement","jog","itch","intellectual","installed","infant","indefinitely","grenade","glamorous","genetically","freud","faculty","engineering","doh","discretion","delusions","declaration","crate","competent","commonwealth","catalog","bakery","attempts","asylum","argh","applying","ahhhh","yesterday's","wedge","wager","unfit","tripping","treatments","torment","superhero","stirring","spinal","sorority","seminar","scenery","repairs","rabble","pneumonia","perks","owl","override","ooooh","moo","mija","manslaughter","mailed","love's","lime","lettuce","intimidate","instructor","guarded","grieve","grad","globe","frustration","extensive","exploring","exercises","eve's","doorbell","devices","deal's","dam","cultural","ctu","credits","commerce","chinatown","chemicals","baltimore","authentic","arraignment","annulled","altered","allergies","wanta","verify","vegetarian","tunes","tourist","tighter","telegram","suitable","stalk","specimen","spared","solving","shoo","satisfying","saddam","requesting","publisher","pens","overprotective","obstacles","notified","negro","nasedo","judged","jill's","identification","grandchild","genuinely","founded","flushed","fluids","floss","escaping","ditched","demon's","decorated","criticism","cramp","corny","contribute","connecting","bunk","bombing","bitten","billions","bankrupt","yikes","wrists","ultrasound","ultimatum","thirst","spelled","sniff","scope","ross's","room's","retrieve","releasing","reassuring","pumps","properties","predicted","neurotic","negotiating","needn't","multi","monitors","millionaire","microphone","mechanical","lydecker","limp","incriminating","hatchet","gracias","gordie","fills","feeds","egypt","doubting","dedication","decaf","dawson's","competing","cellular","biopsy","whiz","voluntarily","visible","ventilator","unpack","unload","universal","tomatoes","targets","suggests","strawberry","spooked","snitch","schillinger","sap","reassure","providing","prey","pressure's","persuasive","mystical","mysteries","mri","moment's","mixing","matrimony","mary's","mails","lighthouse","liability","kgb","jock","headline","frankie's","factors","explosive","explanations","dispatch","detailed","curly","cupid","condolences","comrade","cassadines","bulb","brittany's","bragging","awaits","assaulted","ambush","adolescent","adjusted","abort","yank","whit","verse","vaguely","undermine","tying","trim","swamped","stitch","stan's","stabbing","slippers","skye's","sincerely","sigh","setback","secondly","rotting","rev","retail","proceedings","preparation","precaution","pox","pcpd","nonetheless","melting","materials","mar","liaison","hots","hooking","headlines","hag","ganz","fury","felicity","fangs","expelled","encouragement","earring","dreidel","draws","dory","donut","dog's","dis","dictate","dependent","decorating","coordinates","cocktails","bumps","blueberry","believable","backfired","backfire","apron","anticipated","adjusting","activated","vous","vouch","vitamins","vista","urn","uncertain","ummm","tourists","tattoos","surrounding","sponsor","slimy","singles","sibling","shhhh","restored","representative","renting","reign","publish","planets","peculiar","parasite","paddington","noo","marries","mailbox","magically","lovebirds","listeners","knocks","kane's","informant","grain","exits","elf","drazen","distractions","disconnected","dinosaurs","designing","dashwood","crooked","conveniently","contents","argued","wink","warped","underestimated","testified","tacky","substantial","steve's","steering","staged","stability","shoving","seizure","reset","repeatedly","radius","pushes","pitching","pairs","opener","mornings","mississippi","matthew's","mash","investigations","invent","indulge","horribly","hallucinating","festive","eyebrows","expand","enjoys","dictionary","dialogue","desperation","dealers","darkest","daph","critic","consulting","cartman's","canal","boragora","belts","bagel","authorization","auditions","associated","ape","amy's","agitated","adventures","withdraw","wishful","wimp","vehicles","vanish","unbearable","tonic","tom's","tackle","suffice","suction","slaying","singapore","safest","rosanna's","rocking","relive","rates","puttin","prettiest","oval","noisy","newlyweds","nauseous","moi","misguided","mildly","midst","maps","liable","kristina's","judgmental","introducing","individuals","hunted","hen","givin","frequent","fisherman","fascinated","elephants","dislike","diploma","deluded","decorate","crummy","contractions","carve","careers","bottled","bonded","bahamas","unavailable","twenties","trustworthy","translation","traditions","surviving","surgeons","stupidity","skies","secured","salvation","remorse","rafe's","princeton","preferably","pies","photography","operational","nuh","northwest","nausea","napkins","mule","mourn","melted","mechanism","mashed","julia's","inherit","holdings","hel","greatness","golly","excused","edges","dumbo","drifting","delirious","damaging","cubicle","compelled","comm","colleges","cole's","chooses","checkup","chad's","certified","candidates","boredom","bob's","bandages","baldwin's","bah","automobile","athletic","alarms","absorbed","absent","windshield","who're","whaddya","vitamin","transparent","surprisingly","sunglasses","starring","slit","sided","schemes","roar","relatively","reade","quarry","prosecutor","prognosis","probe","potentially","pitiful","persistent","perception","percentage","peas","oww","nosy","neighbourhood","nagging","morons","molecular","meters","masterpiece","martinis","limbo","liars","jax's","irritating","inclined","hump","hoynes","haw","gauge","functions","fiasco","educational","eatin","donated","destination","dense","cubans","continent","concentrating","commanding","colorful","clam","cider","brochure","behaviour","barto","bargaining","awe","artistic","welcoming","weighing","villain","vein","vanquished","striking","stains","sooo","smear","sire","simone's","secondary","roughly","rituals","resentment","psychologist","preferred","pint","pension","passive","overhear","origin","orchestra","negotiations","mounted","morality","landingham","labs","kisser","jackson's","icy","hoot","holling","handshake","grilled","functioning","formality","elevators","edward's","depths","confirms","civilians","bypass","briefly","boathouse","binding","acres","accidental","westbridge","wacko","ulterior","transferring","tis","thugs","tangled","stirred","stefano's","sought","snag","smallest","sling","sleaze","seeds","rumour","ripe","remarried","reluctant","regularly","puddle","promote","precise","popularity","pins","perceptive","miraculous","memorable","maternal","lucinda's","longing","lockup","locals","librarian","job's","inspection","impressions","immoral","hypothetically","guarding","gourmet","gabe","fighters","fees","features","faxed","extortion","expressed","essentially","downright","digest","der","crosses","cranberry","city's","chorus","casualties","bygones","buzzing","burying","bikes","attended","allah","all's","weary","viewing","viewers","transmitter","taping","takeout","sweeping","stepmother","stating","stale","seating","seaborn","resigned","rating","prue's","pros","pepperoni","ownership","occurs","nicole's","newborn","merger","mandatory","malcolm's","ludicrous","jan's","injected","holden's","henry's","heating","geeks","forged","faults","expressing","eddie's","drue","dire","dief","desi","deceiving","centre","celebrities","caterer","calmed","businesses","budge","ashley's","applications","ankles","vending","typing","tribbiani","there're","squared","speculation","snowing","shades","sexist","scudder's","scattered","sanctuary","rewrite","regretted","regain","raises","processing","picky","orphan","mural","misjudged","miscarriage","memorize","marshall's","mark's","licensed","lens","leaking","launched","larry's","languages","judge's","jitters","invade","interruption","implied","illegally","handicapped","glitch","gittes","finer","fewer","engineered","distraught","dispose","dishonest","digs","dahlia's","dads","cruelty","conducting","clinical","circling","champions","canceling","butterflies","belongings","barbrady","amusement","allegations","alias","aging","zombies","where've","unborn","tri","swearing","stables","squeezed","spaulding's","slavery","sew","sensational","revolutionary","resisting","removing","radioactive","races","questionable","privileged","portofino","par","owning","overlook","overhead","orson","oddly","nazis","musicians","interrogate","instruments","imperative","impeccable","icu","hurtful","hors","heap","harley's","graduating","graders","glance","endangered","disgust","devious","destruct","demonstration","creates","crazier","countdown","coffee's","chump","cheeseburger","cat's","burglar","brotherhood","berries","ballroom","assumptions","ark","annoyed","allies","allergy","advantages","admirer","admirable","addresses","activate","accompany","wed","victoria's","valve","underpants","twit","triggered","teacher's","tack","strokes","stool","starr's","sham","seasons","sculpture","scrap","sailed","retarded","resourceful","remarkably","refresh","ranks","pressured","precautions","pointy","obligations","nightclub","mustache","month's","minority","mind's","maui","lace","isabella's","improving","iii","hunh","hubby","flare","fierce","farmers","dont","dokey","divided","demise","demanded","dangerously","crushing","considerable","complained","clinging","choked","chem","cheerleading","checkbook","cashmere","calmly","blush","believer","aspect","amazingly","alas","acute","a's","yak","whores","what've","tuition","trey's","tolerance","toilets","tactical","tacos","stairwell","spur","spirited","slower","sewing","separately","rubbed","restricted","punches","protects","partially","ole","nuisance","niagara","motherfuckers","mingle","mia's","kynaston","knack","kinkle","impose","hosting","harry's","gullible","grid","godmother","funniest","friggin","folding","financially","filming","fashions","eater","dysfunctional","drool","distinguished","defence","defeated","cruising","crude","criticize","corruption","contractor","conceive","clone","circulation","cedars","caliber","brighter","blinded","birthdays","bio","bill's","banquet","artificial","anticipate","annoy","achievement","whim","whichever","volatile","veto","vested","uncle's","supports","successfully","shroud","severely","rests","representation","quarantine","premiere","pleases","parent's","painless","pads","orphans","orphanage","offence","obliged","nip","niggers","negotiation","narcotics","nag","mistletoe","meddling","manifest","lookit","loo","lilah","investigated","intrigued","injustice","homicidal","hayward's","gigantic","exposing","elves","disturbance","disastrous","depended","demented","correction","cooped","colby's","cheerful","buyers","brownies","beverage","basics","attorney's","atm","arvin","arcade","weighs","upsets","unethical","tidy","swollen","sweaters","swap","stupidest","sensation","scalpel","rail","prototype","props","prescribed","pompous","poetic","ploy","paws","operates","objections","mushrooms","mulwray","monitoring","manipulation","lured","lays","lasting","kung","keg","jell","internship","insignificant","inmate","incentive","gandhi","fulfilled","flooded","expedition","evolution","discharged","disagreement","dine","dean's","crypt","coroner's","cornered","copied","confrontation","cds","catalogue","brightest","beethoven","banned","attendant","athlete","amaze","airlines","yogurt","wyndemere","wool","vocabulary","vcr","tulsa","tags","tactic","stuffy","slug","sexuality","seniors","segment","revelation","respirator","pulp","prop","producing","processed","pretends","polygraph","perp","pennies","ordinarily","opposition","olives","necks","morally","martyr","martial","lisa's","leftovers","joints","jimmy's","irs","invaded","imported","hopping","homey","hints","helicopters","heed","heated","heartbroken","gulf","greatly","forge","florist","firsthand","fiend","expanding","emma's","defenses","crippled","cousin's","corrected","conniving","conditioner","clears","chemo","bubbly","bladder","beeper","baptism","apb","answer's","anna's","angles","ache","womb","wiring","wench","weaknesses","volunteering","violating","unlocked","unemployment","tummy","tibet","threshold","surrogate","submarine","subid","stray","stated","startle","specifics","snob","slowing","sled","scoot","robbers","rightful","richest","quid","qfxmjrie","puffs","probable","pitched","pierced","pencils","paralysis","nuke","managing","makeover","luncheon","lords","linksynergy","jury's","jacuzzi","ish","interstate","hitched","historic","hangover","gasp","fracture","flock","firemen","drawings","disgusted","darned","coal","clams","chez","cables","broadcasting","brew","borrowing","banged","achieved","wildest","weirder","unauthorized","stunts","sleeves","sixties","shush","shalt","senora","rises","retro","quits","pupils","politicians","pegged","painfully","paging","outlet","omelet","observed","ned's","memorized","lawfully","jackets","interpretation","intercept","ingredient","grownup","glued","gaining","fulfilling","flee","enchanted","dvd","delusion","daring","conservative","conducted","compelling","charitable","carton","bronx","bridesmaids","bribed","boiling","bathrooms","bandage","awareness","awaiting","assign","arrogance","antiques","ainsley","turkeys","travelling","trashing","tic","takeover","sync","supervision","stockings","stalked","stabilized","spacecraft","slob","skates","sirs","sedated","robes","reviews","respecting","rat's","psyche","prominent","prizes","presumptuous","prejudice","platoon","permitted","paragraph","mush","mum's","movements","mist","missions","mints","mating","mantan","lorne","lord's","loads","listener","legendary","itinerary","hugs","hepatitis","heave","guesses","gender","flags","fading","exams","examining","elizabeth's","egyptian","dumbest","dishwasher","dimera's","describing","deceive","cunning","cripple","cove","convictions","congressional","confided","compulsive","compromising","burglary","bun","bumpy","brainwashed","benes","arnie","alvy","affirmative","adrenaline","adamant","watchin","waitresses","uncommon","treaty","transgenic","toughest","toby's","surround","stormed","spree","spilling","spectacle","soaking","significance","shreds","sewers","severed","scarce","scamming","scalp","sami's","salem's","rewind","rehearsing","pretentious","potions","possessions","planner","placing","periods","overrated","obstacle","notices","nerds","meems","medieval","mcmurphy","maturity","maternity","masses","maneuver","lyin","loathe","lawyer's","irv","investigators","hep","grin","gospel","gals","formation","fertility","facilities","exterior","epidemic","eloping","ecstatic","ecstasy","duly","divorcing","distribution","dignan","debut","costing","coaching","clubhouse","clot","clocks","classical","candid","bursting","breather","braces","bennett's","bending","australian","attendance","arsonist","applies","adored","accepts","absorb","vacant","uuh","uphold","unarmed","turd","topolsky","thrilling","thigh","terminate","tempo","sustain","spaceship","snore","sneeze","smuggling","shrine","sera","scott's","salty","salon","ramp","quaint","prostitution","prof","policies","patronize","patio","nasa","morbid","marlo's","mamma","locations","licence","kettle","joyous","invincible","interpret","insecurities","insects","inquiry","infamous","impulses","illusions","holed","glen's","fragments","forrester's","exploit","economics","drivin","des","defy","defenseless","dedicate","cradle","cpr","coupon","countless","conjure","confined","celebrated","cardboard","booking","blur","bleach","ban","backseat","austin's","alternatives","afterward","accomplishment","wordsworth","wisely","wildlife","valet","vaccine","urges","unnatural","unlucky","truths","traumatized","tit","tennessee","tasting","swears","strawberries","steaks","stats","skank","seducing","secretive","screwdriver","schedules","rooting","rightfully","rattled","qualifies","puppets","provides","prospects","pronto","prevented","powered","posse","poorly","polling","pedestal","palms","muddy","morty","miniature","microscope","merci","margin","lecturing","inject","incriminate","hygiene","hospital's","grapefruit","gazebo","funnier","freight","flooding","equivalent","eliminated","elaine's","dios","deacon's","cuter","continental","container","cons","compensation","clap","cbs","cavity","caves","capricorn","canvas","calculations","bossy","booby","bacteria","aides","zende","winthrop","wider","warrants","valentines","undressed","underage","truthfully","tampered","suffers","stored","statute","speechless","sparkling","sod","socially","sidelines","shrek","sank","roy's","raul's","railing","puberty","practices","pesky","parachute","outrage","outdoors","operated","openly","nominated","motions","moods","lunches","litter","kidnappers","itching","intuition","index","imitation","icky","humility","hassling","gallons","firmly","excessive","evolved","employ","eligible","elections","elderly","drugstore","dosage","disrupt","directing","dipping","deranged","debating","cuckoo","cremated","craziness","cooperating","compatible","circumstantial","chimney","bonnie's","blinking","biscuits","belgium","arise","analyzed","admiring","acquire","accounted","willow's","weeping","volumes","views","triad","trashy","transaction","tilt","soothing","slumber","slayers","skirts","siren","ship's","shindig","sentiment","sally's","rosco","riddance","rewarded","quaid","purity","proceeding","pretzels","practiced","politician","polar","panicking","overall","occupation","naming","minimal","mckechnie","massacre","marah's","lovin","leaked","layers","isolation","intruding","impersonating","ignorance","hoop","hamburgers","gwen's","fruits","footprints","fluke","fleas","festivities","fences","feisty","evacuate","emergencies","diabetes","detained","democrat","deceived","creeping","craziest","corpses","conned","coincidences","charleston","bums","brussels","bounced","bodyguards","blasted","bitterness","baloney","ashtray","apocalypse","advances","zillion","watergate","wallpaper","viable","tory's","tenants","telesave","sympathize","sweeter","swam","sup","startin","stages","spencer's","sodas","snowed","sleepover","signor","seein","reviewing","reunited","retainer","restroom","rested","replacing","repercussions","reliving","reef","reconciliation","reconcile","recognise","prevail","preaching","planting","overreact","oof","omen","o'neil","numerous","noose","moustache","morning's","manicure","maids","mah","lorelei's","landlady","hypothetical","hopped","homesick","hives","hesitation","herbs","hectic","heartbreak","haunting","gangs","frown","fingerprint","extract","expired","exhausting","exchanged","exceptional","everytime","encountered","disregard","daytime","cooperative","constitutional","cling","chevron","chaperone","buenos","blinding","bitty","beads","battling","badgering","anticipation","advocate","zander's","waterfront","upstanding","unprofessional","unity","unhealthy","undead","turmoil","truthful","toothpaste","tippin","thoughtless","tagataya","stretching","strategic","spun","shortage","shooters","sheriff's","shady","senseless","sailors","rewarding","refuge","rapid","rah","pun","propane","pronounced","preposterous","pottery","portable","pigeons","pastry","overhearing","ogre","obscene","novels","negotiable","mtv","morgan's","monthly","loner","leisure","leagues","jogging","jaws","itchy","insinuating","insides","induced","immigration","hospitality","hormone","hilda's","hearst","grandpa's","frequently","forthcoming","fists","fifties","etiquette","endings","elevated","editing","dunk","distinction","disabled","dibs","destroys","despises","desired","designers","deprived","dancers","dah","cuddy","crust","conductor","communists","cloak","circumstance","chewed","casserole","bora","bidder","bearer","assessment","artoo","applaud","appalling","amounts","admissions","withdrawal","weights","vowed","virgins","vigilante","vatican","undone","trench","touchdown","throttle","thaw","tha","testosterone","tailor","symptom","swoop","suited","suitcases","stomp","sticker","stakeout","spoiling","snatched","smoochy","smitten","shameless","restraints","researching","renew","relay","regional","refund","reclaim","rapids","raoul","rags","puzzles","purposely","punks","prosecuted","plaid","pineapple","picturing","pickin","pbs","parasites","offspring","nyah","mysteriously","multiply","mineral","masculine","mascara","laps","kramer's","jukebox","interruptions","hoax","gunfire","gays","furnace","exceptions","engraved","elbows","duplicate","drapes","designated","deliberate","deli","decoy","cub","cryptic","crowds","critics","coupla","convert","conventional","condemn","complicate","combine","colossal","clerks","clarity","cassadine's","byes","brushed","bride's","banished","arrests","argon","andy's","alarmed","worships","versa","uncanny","troop","treasury","transformation","terminated","telescope","technicality","sydney's","sundae","stumble","stripping","shuts","separating","schmuck","saliva","robber","retain","remained","relentless","reconnect","recipes","rearrange","ray's","rainy","psychiatrists","producers","policemen","plunge","plugged","patched","overload","ofc","obtained","obsolete","o'malley","numbered","number's","nay","moth","module","mkay","mindless","menus","lullaby","lotte","leavin","layout","knob","killin","karinsky","irregular","invalid","hides","grownups","griff","flaws","flashy","flaming","fettes","evicted","epic","encoded","dread","dil","degrassi","dealings","dangers","cushion","console","concluded","casey's","bowel","beginnings","barged","apes","announcing","amanda's","admits","abroad","abide","abandoning","workshop","wonderfully","woak","warfare","wait'll","wad","violate","turkish","tim's","ter","targeted","susan's","suicidal","stayin","sorted","slamming","sketchy","shoplifting","shapes","selected","sarah's","retiring","raiser","quizmaster","pursued","pupkin","profitable","prefers","politically","phenomenon","palmer's","olympics","needless","nature's","mutt","motherhood","momentarily","migraine","lizzie's","lilo","lifts","leukemia","leftover","law's","keepin","idol","hinks","hellhole","h'mm","gowns","goodies","gallon","futures","friction","finale","farms","extraction","entertained","electronics","eighties","earth's","dmv","darker","daniel's","cum","conspiring","consequence","cheery","caps","calf","cadet","builds","benign","barney's","aspects","artillery","apiece","allison's","aggression","adjustments","abusive","abduction","wiping","whipping","welles","unspeakable","unlimited","unidentified","trivial","transcripts","threatens","textbook","tenant","supervise","superstitious","stricken","stretched","story's","stimulating","steep","statistics","spielberg","sodium","slices","shelves","scratches","saudi","sabotaged","roxy's","retrieval","repressed","relation","rejecting","quickie","promoting","ponies","peeking","paw","paolo","outraged","observer","o'connell","moping","moaning","mausoleum","males","licked","kovich","klutz","iraq","interrogating","interfered","intensive","insulin","infested","incompetence","hyper","horrified","handedly","hacked","guiding","glamour","geoff","gekko","fraid","fractured","formerly","flour","firearms","fend","executives","examiner","evaluate","eloped","duke's","disoriented","delivers","dashing","crystals","crossroads","crashdown","court's","conclude","coffees","cockroach","climate","chipped","camps","brushing","boulevard","bombed","bolts","begs","baths","baptized","astronaut","assurance","anemia","allegiance","aiming","abuela","abiding","workplace","withholding","weave","wearin","weaker","warnings","usa","tours","thesis","terrorism","suffocating","straws","straightforward","stench","steamed","starboard","sideways","shrinks","shortcut","sean's","scram","roasted","roaming","riviera","respectfully","repulsive","recognizes","receiver","psychiatry","provoked","penitentiary","peed","pas","painkillers","oink","norm","ninotchka","muslim","montgomery's","mitzvah","milligrams","mil","midge","marshmallows","markets","macy's","looky","lapse","kubelik","knit","jeb","investments","intellect","improvise","implant","hometown","hanged","handicap","halo","governor's","goa'ulds","giddy","gia's","geniuses","fruitcake","footing","flop","findings","fightin","fib","editorial","drinkin","doork","discovering","detour","danish","cuddle","crashes","coordinate","combo","colonnade","collector","cheats","cetera","canadians","bip","bailiff","auditioning","assed","amused","alienate","algebra","alexi","aiding","aching","woe","wah","unwanted","typically","tug","topless","tongues","tiniest","them's","symbols","superiors","soy","soften","sheldrake","sensors","seller","seas","ruler","rival","rips","renowned","recruiting","reasoning","rawley","raisins","racial","presses","preservation","portfolio","oversight","organizing","obtain","observing","nessa","narrowed","minions","midwest","meth","merciful","manages","magistrate","lawsuits","labour","invention","intimidating","infirmary","indicated","inconvenient","imposter","hugged","honoring","holdin","hades","godforsaken","fumes","forgery","foremost","foolproof","folder","folded","flattery","fingertips","financing","fifteenth","exterminator","explodes","eccentric","drained","dodging","documented","disguised","developments","currency","crafts","constructive","concealed","compartment","chute","chinpokomon","captains","capitol","calculated","buses","bodily","astronauts","alimony","accustomed","accessories","abdominal","zen","zach's","wrinkle","wallow","viv","vicinity","venue","valued","valium","valerie's","upgrade","upcoming","untrue","uncover","twig","twelfth","trembling","treasures","torched","toenails","timed","termites","telly","taunting","taransky","tar","talker","succubus","statues","smarts","sliding","sizes","sighting","semen","seizures","scarred","savvy","sauna","saddest","sacrificing","rubbish","riled","ricky's","rican","revive","recruit","ratted","rationally","provenance","professors","prestigious","pms","phonse","perky","pedal","overdose","organism","nasal","nanites","mushy","movers","moot","missus","midterm","merits","melodramatic","manure","magnetic","knockout","knitting","jig","invading","interpol","incapacitated","idle","hotline","horse's","highlight","hauling","hair's","gunpoint","greenwich","grail","ganza","framing","formally","fleeing","flap","flannel","fin","fibers","faded","existing","email","eavesdrop","dwelling","dwarf","donations","detected","desserts","dar","corporations","constellation","collision","chic","calories","businessmen","buchanan's","breathtaking","bleak","blacked","batter","balanced","ante","aggravated","agencies","abu","yanked","wuh","withdrawn","wigand","whoah","wham","vocal","unwind","undoubtedly","unattractive","twitch","trimester","torrance","timetable","taxpayers","strained","stationed","stared","slapping","sincerity","signatures","siding","siblings","shit's","shenanigans","shacking","seer","satellites","sappy","samaritan","rune","regained","rebellion","proceeds","privy","power's","poorer","politely","paste","oysters","overruled","olaf","nightcap","networks","necessity","mosquito","millimeter","michelle's","merrier","massachusetts","manuscript","manufacture","manhood","lunar","lug","lucked","loaned","kilos","ignition","hurl","hauled","harmed","goodwill","freshmen","forming","fenmore","fasten","farce","failures","exploding","erratic","elm","drunks","ditching","d'artagnan","crops","cramped","contacting","coalition","closets","clientele","chimp","cavalry","casa","cabs","bled","bargained","arranging","archives","anesthesia","amuse","altering","afternoons","accountable","abetting","wrinkles","wolek","waved","unite","uneasy","unaware","ufo","toot","toddy","tens","tattooed","tad's","sway","stained","spauldings","solely","sliced","sirens","schibetta","scatter","rumours","roger's","robbie's","rinse","remo","remedy","redemption","queen's","progressive","pleasures","picture's","philosopher","pacey's","optimism","oblige","natives","muy","measuring","measured","masked","mascot","malicious","mailing","luca","lifelong","kosher","koji","kiddies","judas","isolate","intercepted","insecurity","initially","inferior","incidentally","ifs","hun","heals","headlights","guided","growl","grilling","glazed","gem","gel","gaps","fundamental","flunk","floats","fiery","fairness","exercising","excellency","evenings","ere","enrolled","disclosure","det","department's","damp","curling","cupboard","counterfeit","cooling","condescending","conclusive","clicked","cleans","cholesterol","chap","cashed","brow","broccoli","brats","blueprints","blindfold","biz","billing","barracks","attach","aquarium","appalled","altitude","alrighty","aimed","yawn","xander's","wynant","winslow's","welcomed","violations","upright","unsolved","unreliable","toots","tighten","symbolic","sweatshirt","steinbrenner","steamy","spouse","sox","sonogram","slowed","slots","sleepless","skeleton","shines","roles","retaliate","representatives","rephrase","repeated","renaissance","redeem","rapidly","rambling","quilt","quarrel","prying","proverbial","priced","presiding","presidency","prescribe","prepped","pranks","possessive","plaintiff","philosophical","pest","persuaded","perk","pediatrics","paige's","overlooked","outcast","oop","odor","notorious","nightgown","mythology","mumbo","monitored","mediocre","master's","mademoiselle","lunchtime","lifesaver","legislation","leaned","lambs","lag","killings","interns","intensity","increasing","identities","hounding","hem","hellmouth","goon","goner","ghoul","germ","gardening","frenzy","foyer","food's","extras","extinct","exhibition","exaggerate","everlasting","enlightened","drilling","doubles","digits","dialed","devote","defined","deceitful","d'oeuvres","csi","cosmetic","contaminated","conspired","conning","colonies","cerebral","cavern","cathedral","carving","butting","boiled","blurry","beams","barf","babysit","assistants","ascension","architecture","approaches","albums","albanian","aaaaah","wildly","whoopee","whiny","weiskopf","walkie","vultures","veteran","vacations","upfront","unresolved","tile","tampering","struggled","stockholders","specially","snaps","sleepwalking","shrunk","sermon","seeks","seduction","scenarios","scams","ridden","revolve","repaired","regulation","reasonably","reactor","quotes","preserved","phenomenal","patrolling","paranormal","ounces","omigod","offs","nonstop","nightfall","nat","militia","meeting's","logs","lineup","libby's","lava","lashing","labels","kilometers","kate's","invites","investigative","innocents","infierno","incision","import","implications","humming","highlights","haunts","greeks","gloss","gloating","general's","frannie","flute","fled","fitted","finishes","fiji","fetal","feeny","entrapment","edit","dyin","download","discomfort","dimensions","detonator","dependable","deke","decree","dax","cot","confiscated","concludes","concede","complication","commotion","commence","chulak","caucasian","casually","canary","brainer","bolie","ballpark","arm's","anwar","anatomy","analyzing","accommodations","yukon","youse","wring","wharf","wallowing","uranium","unclear","treason","transgenics","thrive","think's","thermal","territories","tedious","survives","stylish","strippers","sterile","squeezing","squeaky","sprained","solemn","snoring","sic","shifting","shattering","shabby","seams","scrawny","rotation","risen","revoked","residue","reeks","recite","reap","ranting","quoting","primal","pressures","predicament","precision","plugs","pits","pinpoint","petrified","petite","persona","pathological","passports","oughtta","nods","nighter","navigate","nashville","namely","museums","morale","milwaukee","meditation","mathematics","martin's","malta","logan's","latter","kippie","jackie's","intrigue","intentional","insufferable","incomplete","inability","imprisoned","hup","hunky","how've","horrifying","hearty","headmaster","hath","har","hank's","handbook","hamptons","grazie","goof","george's","funerals","fuck's","fraction","forks","finances","fetched","excruciating","enjoyable","enhanced","enhance","endanger","efficiency","dumber","drying","diabolical","destroyer","desirable","defendants","debris","darts","cuisine","cucumber","cube","crossword","contestant","considers","comprehend","club's","clipped","classmates","choppers","certificates","carmen's","canoe","candlelight","building's","brutally","brutality","boarded","bathrobe","backward","authorize","audrey's","atom","assemble","appeals","airports","aerobics","ado","abbott's","wholesome","whiff","vessels","vermin","varsity","trophies","trait","tragically","toying","titles","tissues","testy","team's","tasteful","surge","sun's","studios","strips","stocked","stephen's","staircase","squares","spinach","sow","southwest","southeast","sookie's","slayer's","sipping","singers","sidetracked","seldom","scrubbing","scraping","sanctity","russell's","ruse","robberies","rink","ridin","retribution","reinstated","refrain","rec","realities","readings","radiant","protesting","projector","posed","plutonium","plaque","pilar's","payin","parting","pans","o'reilly","nooooo","motorcycles","motherfucking","mein","measly","marv","manic","line's","lice","liam","lenses","lama","lalita","juggling","jerking","jamie's","intro","inevitably","imprisonment","hypnosis","huddle","horrendous","hobbies","heavier","heartfelt","harlin","hairdresser","grub","gramps","gonorrhea","gardens","fussing","fragment","fleeting","flawless","flashed","fetus","exclusively","eulogy","equality","enforce","distinctly","disrespectful","denies","crossbow","crest","cregg","crabs","cowardly","countess","contrast","contraction","contingency","consulted","connects","confirming","condone","coffins","cleansing","cheesecake","certainty","captain's","cages","c'est","briefed","brewing","bravest","bosom","boils","binoculars","bachelorette","aunt's","atta","assess","appetizer","ambushed","alerted","woozy","withhold","weighed","vulgar","viral","utmost","unusually","unleashed","unholy","unhappiness","underway","uncovered","unconditional","typewriter","typed","twists","sweeps","supervised","supermodel","suburbs","subpoenaed","stringing","snyder's","snot","skeptical","skateboard","shifted","secret's","scottish","schoolgirl","romantically","rocked","revoir","reviewed","respiratory","reopen","regiment","reflects","refined","puncture","pta","prone","produces","preach","pools","polished","pods","planetarium","penicillin","peacefully","partner's","nurturing","nation's","more'n","monastery","mmhmm","midgets","marklar","machinery","lodged","lifeline","joanna's","jer","jellyfish","infiltrate","implies","illegitimate","hutch","horseback","henri","heist","gents","frickin","freezes","forfeit","followers","flakes","flair","fathered","fascist","eternally","eta","epiphany","enlisted","eleventh","elect","effectively","dos","disgruntled","discrimination","discouraged","delinquent","decipher","danvers","dab","cubes","credible","coping","concession","cnn","clash","chills","cherished","catastrophe","caretaker","bulk","bras","branches","bombshell","birthright","billionaire","awol","ample","alumni","affections","admiration","abbotts","zelda's","whatnot","watering","vinegar","vietnamese","unthinkable","unseen","unprepared","unorthodox","underhanded","uncool","transmitted","traits","timeless","thump","thermometer","theoretically","theoretical","testament","tapping","tagged","tac","synthetic","syndicate","swung","surplus","supplier","stares","spiked","soviets","solves","smuggle","scheduling","scarier","saucer","reinforcements","recruited","rant","quitter","prudent","projection","previously","powdered","poked","pointers","placement","peril","penetrate","penance","patriotic","passions","opium","nudge","nostrils","nevermind","neurological","muslims","mow","momentum","mockery","mobster","mining","medically","magnitude","maggie's","loudly","listing","killer's","kar","jim's","insights","indicted","implicate","hypocritical","humanly","holiness","healthier","hammered","haldeman","gunman","graphic","gloom","geography","gary's","freshly","francs","formidable","flunked","flawed","feminist","faux","ewww","escorted","escapes","emptiness","emerge","drugging","dozer","doc's","directorate","diana's","derevko","deprive","deodorant","cryin","crusade","crocodile","creativity","controversial","commands","coloring","colder","cognac","clocked","clippings","christine's","chit","charades","chanting","certifiable","caterers","brute","brochures","briefs","bran","botched","blinders","bitchin","bauer's","banter","babu","appearing","adequate","accompanied","abrupt","abdomen","zones","wooo","woken","winding","vip","venezuela","unanimous","ulcer","tread","thirteenth","thankfully","tame","tabby's","swine","swimsuit","swans","suv","stressing","steaming","stamped","stabilize","squirm","spokesman","snooze","shuffle","shredded","seoul","seized","seafood","scratchy","savor","sadistic","roster","rica","rhetorical","revlon","realist","reactions","prosecuting","prophecies","prisons","precedent","polyester","petals","persuasion","paddles","o'leary","nuthin","neighbour","negroes","naval","mute","muster","muck","minnesota","meningitis","matron","mastered","markers","maris's","manufactured","lot's","lockers","letterman","legged","launching","lanes","journals","indictment","indicating","hypnotized","housekeeping","hopelessly","hmph","hallucinations","grader","goldilocks","girly","furthermore","frames","flask","expansion","envelopes","engaging","downside","doves","doorknob","distinctive","dissolve","discourage","disapprove","diabetic","departed","deliveries","decorator","deaq","crossfire","criminally","containment","comrades","complimentary","commitments","chum","chatter","chapters","catchy","cashier","cartel","caribou","cardiologist","bull's","buffer","brawl","bowls","booted","boat's","billboard","biblical","barbershop","awakening","aryan","angst","administer","acquitted","acquisition","aces","accommodate","zellie","yield","wreak","witch's","william's","whistles","wart","vandalism","vamps","uterus","upstate","unstoppable","unrelated","understudy","tristin","transporting","transcript","tranquilizer","trails","trafficking","toxins","tonsils","timing's","therapeutic","tex","subscription","submitted","stephanie's","stempel","spotting","spectator","spatula","soho","softer","snotty","slinging","showered","sexiest","sensual","scoring","sadder","roam","rimbaud","rim","rewards","restrain","resilient","remission","reinstate","rehash","recollection","rabies","quinn's","presenting","preference","prairie","popsicle","plausible","plantation","pharmaceutical","pediatric","patronizing","patent","participation","outdoor","ostrich","ortolani","oooooh","omelette","neighbor's","neglect","nachos","movie's","mixture","mistrial","mio","mcginty's","marseilles","mare","mandate","malt","luv","loophole","literary","liberation","laughin","lacey's","kevvy","jah","irritated","intends","initiation","initiated","initiate","influenced","infidelity","indigenous","inc","idaho","hypothermia","horrific","hive","heroine","groupie","grinding","graceful","government's","goodspeed","gestures","gah","frantic","extradition","evil's","engineers","echelon","earning","disks","discussions","demolition","definitive","dawnie","dave's","date's","dared","dan's","damsel","curled","courtyard","constitutes","combustion","collective","collateral","collage","col","chant","cassette","carol's","carl's","calculating","bumping","britain","bribes","boardwalk","blinds","blindly","bleeds","blake's","bickering","beasts","battlefield","bankruptcy","backside","avenge","apprehended","annie's","anguish","afghanistan","acknowledged","abusing","youthful","yells","yanking","whomever","when'd","waterfall","vomiting","vine","vengeful","utility","unpacking","unfamiliar","undying","tumble","trolls","treacherous","todo","tipping","tantrum","tanked","summons","strategies","straps","stomped","stinkin","stings","stance","staked","squirrels","sprinkles","speculate","specialists","sorting","skinned","sicko","sicker","shootin","shep","shatter","seeya","schnapps","s'posed","rows","rounded","ronee","rite","revolves","respectful","resource","reply","rendered","regroup","regretting","reeling","reckoned","rebuilding","randy's","ramifications","qualifications","pulitzer","puddy","projections","preschool","pots","potassium","plissken","platonic","peter's","permalash","performer","peasant","outdone","outburst","ogh","obscure","mutants","mugging","molecules","misfortune","miserably","miraculously","medications","medals","margaritas","manpower","lovemaking","long's","logo","logically","leeches","latrine","lamps","lacks","kneel","johnny's","jenny's","inflict","impostor","icon","hypocrisy","hype","hosts","hippies","heterosexual","heightened","hecuba's","hecuba","healer","habitat","gunned","grooming","groo","groin","gras","gory","gooey","gloomy","frying","friendships","fredo","foil","fishermen","firepower","fess","fathom","exhaustion","evils","epi","endeavor","ehh","eggnog","dreaded","drafted","dimensional","detached","deficit","d'arcy","crotch","coughing","coronary","cookin","contributed","consummate","congrats","concerts","companionship","caved","caspar","bulletproof","bris","brilliance","breakin","brash","blasting","beak","arabia","analyst","aluminum","aloud","alligator","airtight","advising","advertise","adultery","administered","aches","abstract","aahh","wronged","wal","voluntary","ventilation","upbeat","uncertainty","trot","trillion","tricia's","trades","tots","tol","tightly","thingies","tending","technician","tarts","surreal","summer's","strengths","specs","specialize","spat","spade","slogan","sloane's","shrew","shaping","seth's","selves","seemingly","schoolwork","roomie","requirements","redundant","redo","recuperating","recommendations","ratio","rabid","quart","pseudo","provocative","proudly","principal's","pretenses","prenatal","pillar","photographers","photographed","pharmaceuticals","patron","pacing","overworked","originals","nicotine","newsletter","neighbours","murderous","miller's","mileage","mechanics","mayonnaise","massages","maroon","lucrative","losin","lil","lending","legislative","kat","juno","iran","interrogated","instruction","injunction","impartial","homing","heartbreaker","harm's","hacks","glands","giver","fraizh","flows","flips","flaunt","excellence","estimated","espionage","englishman","electrocuted","eisenhower","dusting","ducking","drifted","donna's","donating","dom","distribute","diem","daydream","cylon","curves","crutches","crates","cowards","covenant","converted","contributions","composed","comfortably","cod","cockpit","chummy","chitchat","childbirth","charities","businesswoman","brood","brewery","bp's","blatant","bethy","barring","bagged","awakened","assumes","assembled","asbestos","arty","artwork","arc","anthony's","aka","airplanes","accelerated","worshipped","winnings","why're","whilst","wesley's","volleyball","visualize","unprotected","unleash","unexpectedly","twentieth","turnpike","trays","translated","tones","three's","thicker","therapists","takeoff","sums","stub","streisand","storm's","storeroom","stethoscope","stacked","sponsors","spiteful","solutions","sneaks","snapping","slaughtered","slashed","simplest","silverware","shits","secluded","scruples","scrubs","scraps","scholar","ruptured","rubs","roaring","relying","reflected","refers","receptionist","recap","reborn","raisin","rainforest","rae's","raditch","radiator","pushover","pout","plastered","pharmacist","petroleum","perverse","perpetrator","passages","ornament","ointment","occupy","nineties","napping","nannies","mousse","mort","morocco","moors","momentary","modified","mitch's","misunderstandings","marina's","marcy's","marched","manipulator","malfunction","loot","limbs","latitude","lapd","laced","kivar","kickin","interface","infuriating","impressionable","imposing","holdup","hires","hick","hesitated","hebrew","hearings","headphones","hammering","groundwork","grotesque","greenhouse","gradually","graces","genetics","gauze","garter","gangsters","g's","frivolous","freelance","freeing","fours","forwarding","feud","ferrars","faulty","fantasizing","extracurricular","exhaust","empathy","educate","divorces","detonate","depraved","demeaning","declaring","deadlines","dea","daria's","dalai","cursing","cufflink","crows","coupons","countryside","coo","consultation","composer","comply","comforted","clive","claustrophobic","chef's","casinos","caroline's","capsule","camped","cairo","busboy","bred","bravery","bluth","biography","berserk","bennetts","baskets","attacker","aplastic","angrier","affectionate","zit","zapped","yorker","yarn","wormhole","weaken","vat","unrealistic","unravel","unimportant","unforgettable","twain","tv's","tush","turnout","trio","towed","tofu","textbooks","territorial","suspend","supplied","superbowl","sundays","stutter","stewardess","stepson","standin","sshh","specializes","spandex","souvenirs","sociopath","snails","slope","skeletons","shivering","sexier","sequel","sensory","selfishness","scrapbook","romania","riverside","rites","ritalin","rift","ribbons","reunite","remarry","relaxation","reduction","realization","rattling","rapist","quad","pup","psychosis","promotions","presumed","prepping","posture","poses","pleasing","pisses","piling","photographic","pfft","persecuted","pear","part's","pantyhose","padded","outline","organizations","operatives","oohh","obituary","northeast","nina's","neural","negotiator","nba","natty","nathan's","minimize","merl","menopause","mennihan","marty's","martimmys","makers","loyalties","literal","lest","laynie","lando","justifies","josh's","intimately","interact","integrated","inning","inexperienced","impotent","immortality","imminent","ich","horrors","hooky","holders","hinges","heartbreaking","handcuffed","gypsies","guacamole","grovel","graziella","goggles","gestapo","fussy","functional","filmmaker","ferragamo","feeble","eyesight","explosions","experimenting","enzo's","endorsement","enchanting","eee","ed's","duration","doubtful","dizziness","dismantle","disciplinary","disability","detectors","deserving","depot","defective","decor","decline","dangling","dancin","crumble","criteria","creamed","cramping","cooled","conceal","component","competitors","clockwork","clark's","circuits","chrissakes","chrissake","chopping","cabinets","buttercup","brooding","bonfire","blurt","bluestar","bloated","blackmailer","beforehand","bathed","bathe","barcode","banjo","banish","badges","babble","await","attentive","artifacts","aroused","antibodies","animosity","administrator","accomplishments","ya'll","wrinkled","wonderland","willed","whisk","waltzing","waitressing","vis","vin","vila","vigilant","upbringing","unselfish","unpopular","unmarried","uncles","trendy","trajectory","targeting","surroundings","stun","striped","starbucks","stamina","stalled","staking","stag","spoils","snuff","snooty","snide","shrinking","senorita","securities","secretaries","scrutiny","scoundrel","saline","salads","sails","rundown","roz's","roommate's","riddles","responses","resistant","requirement","relapse","refugees","recommending","raspberry","raced","prosperity","programme","presumably","preparations","posts","pom","plight","pleaded","pilot's","peers","pecan","particles","pantry","overturned","overslept","ornaments","opposing","niner","nfl","negligent","negligence","nailing","mutually","mucho","mouthed","monstrous","monarchy","minsk","matt's","mateo's","marking","manufacturing","manager's","malpractice","maintaining","lowly","loitering","logged","lingering","light's","lettin","lattes","kim's","kamal","justification","juror","junction","julie's","joys","johnson's","jillefsky","jacked","irritate","intrusion","inscription","insatiable","infect","inadequate","impromptu","icing","hmmmm","hefty","grammar","generate","gdc","gasket","frightens","flapping","firstborn","fire's","fig","faucet","exaggerated","estranged","envious","eighteenth","edible","downward","dopey","doesn","disposition","disposable","disasters","disappointments","dipped","diminished","dignified","diaries","deported","deficiency","deceit","dealership","deadbeat","curses","coven","counselors","convey","consume","concierge","clutches","christians","cdc","casbah","carefree","callous","cahoots","caf","brotherly","britches","brides","bop","bona","bethie","beige","barrels","ballot","ave","autographed","attendants","attachment","attaboy","astonishing","ashore","appreciative","antibiotic","aneurysm","afterlife","affidavit","zuko","zoning","work's","whats","whaddaya","weakened","watermelon","vasectomy","unsuspecting","trial's","trailing","toula","topanga","tonio","toasted","tiring","thereby","terrorized","tenderness","tch","tailing","syllable","sweats","suffocated","sucky","subconsciously","starvin","staging","sprouts","spineless","sorrows","snowstorm","smirk","slicery","sledding","slander","simmer","signora","sigmund","siege","siberia","seventies","sedate","scented","sampling","sal's","rowdy","rollers","rodent","revenue","retraction","resurrection","resigning","relocate","releases","refusal","referendum","recuperate","receptive","ranking","racketeering","queasy","proximity","provoking","promptly","probability","priors","princes","prerogative","premed","pornography","porcelain","poles","podium","pinched","pig's","pendant","packet","owner's","outsiders","outpost","orbing","opportunist","olanov","observations","nurse's","nobility","neurologist","nate's","nanobot","muscular","mommies","molested","misread","melon","mediterranean","mea","mastermind","mannered","maintained","mackenzie's","liberated","lesions","lee's","laundromat","landscape","lagoon","labeled","jolt","intercom","inspect","insanely","infrared","infatuation","indulgent","indiscretion","inconsiderate","incidents","impaired","hurrah","hungarian","howling","honorary","herpes","hasta","harassed","hanukkah","guides","groveling","groosalug","geographic","gaze","gander","galactica","futile","fridays","flier","fixes","fide","fer","feedback","exploiting","exorcism","exile","evasive","ensemble","endorse","emptied","dreary","dreamy","downloaded","dodged","doctored","displayed","disobeyed","disneyland","disable","diego's","dehydrated","defect","customary","csc","criticizing","contracted","contemplating","consists","concepts","compensate","commonly","colours","coins","coconuts","cockroaches","clogged","cincinnati","churches","chronicle","chilling","chaperon","ceremonies","catalina's","cant","cameraman","bulbs","bucklands","bribing","brava","bracelets","bowels","bobby's","bmw","bluepoint","baton","barred","balm","audit","astronomy","aruba","appetizers","appendix","antics","anointed","analogy","almonds","albuquerque","abruptly","yore","yammering","winch","white's","weston's","weirdness","wangler","vibrations","vendor","unmarked","unannounced","twerp","trespass","tres","travesty","transported","transfusion","trainee","towelie","topics","tock","tiresome","thru","theatrical","terrain","suspect's","straightening","staggering","spaced","sonar","socializing","sitcom","sinus","sinners","shambles","serene","scraped","scones","scepter","sarris","saberhagen","rouge","rigid","ridiculously","ridicule","reveals","rents","reflecting","reconciled","rate's","radios","quota","quixote","publicist","pubes","prune","prude","provider","propaganda","prolonged","projecting","prestige","precrime","postponing","pluck","perpetual","permits","perish","peppermint","peeled","particle","parliament","overdo","oriented","optional","nutshell","notre","notions","nostalgic","nomination","mulan","mouthing","monkey's","mistook","mis","milhouse","mel's","meddle","maybourne","martimmy","loon","lobotomy","livelihood","litigation","lippman","likeness","laurie's","kindest","kare","kaffee","jocks","jerked","jeopardizing","jazzed","investing","insured","inquisition","inhale","ingenious","inflation","incorrect","igby","ideals","holier","highways","hereditary","helmets","heirloom","heinous","haste","harmsway","hardship","hanky","gutters","gruesome","groping","governments","goofing","godson","glare","garment","founding","fortunes","foe","finesse","figuratively","ferrie","fda","external","examples","evacuation","ethnic","est","endangerment","enclosed","emphasis","dyed","dud","dreading","dozed","dorky","dmitri","divert","dissertation","discredit","director's","dialing","describes","decks","cufflinks","crutch","creator","craps","corrupted","coronation","contemporary","consumption","considerably","comprehensive","cocoon","cleavage","chile","carriers","carcass","cannery","bystander","brushes","bruising","bribery","brainstorm","bolted","binge","bart's","barracuda","baroness","ballistics","b's","astute","arroway","arabian","ambitions","alexandra's","afar","adventurous","adoptive","addicts","addictive","accessible","yadda","wilson's","wigs","whitelighters","wematanye","weeds","wedlock","wallets","walker's","vulnerability","vroom","vibrant","vertical","vents","uuuh","urgh","upped","unsettling","unofficial","unharmed","underlying","trippin","trifle","tracing","tox","tormenting","timothy's","threads","theaters","thats","tavern","taiwan","syphilis","susceptible","summary","suites","subtext","stickin","spices","sores","smacked","slumming","sixteenth","sinks","signore","shitting","shameful","shacked","sergei","septic","seedy","security's","searches","righteousness","removal","relish","relevance","rectify","recruits","recipient","ravishing","quickest","pupil","productions","precedence","potent","pooch","pledged","phoebs","perverted","peeing","pedicure","pastrami","passionately","ozone","overlooking","outnumbered","outlook","oregano","offender","nukes","novelty","nosed","nighty","nifty","mugs","mounties","motivate","moons","misinterpreted","miners","mercenary","mentality","mas","marsellus","mapped","malls","lupus","lumbar","lovesick","longitude","lobsters","likelihood","leaky","laundering","latch","japs","jafar","instinctively","inspires","inflicted","inflammation","indoors","incarcerated","imagery","hundredth","hula","hemisphere","handkerchief","hand's","gynecologist","guittierez","groundhog","grinning","graduates","goodbyes","georgetown","geese","fullest","ftl","floral","flashback","eyelashes","eyelash","excluded","evening's","evacuated","enquirer","endlessly","encounters","elusive","disarm","detest","deluding","dangle","crabby","cotillion","corsage","copenhagen","conjugal","confessional","cones","commandment","coded","coals","chuckle","christmastime","christina's","cheeseburgers","chardonnay","ceremonial","cept","cello","celery","carter's","campfire","calming","burritos","burp","buggy","brundle","broflovski","brighten","bows","borderline","blinked","bling","beauties","bauers","battered","athletes","assisting","articulate","alot","alienated","aleksandr","ahhhhh","agreements","agamemnon","accountants","zat","y'see","wrongful","writer's","wrapper","workaholic","wok","winnebago","whispered","warts","vikki's","verified","vacate","updated","unworthy","unprecedented","unanswered","trend","transformed","transform","trademark","tote","tonane","tolerated","throwin","throbbing","thriving","thrills","thorns","thereof","there've","terminator","tendencies","tarot","tailed","swab","sunscreen","stretcher","stereotype","spike's","soggy","sobbing","slopes","skis","skim","sizable","sightings","shucks","shrapnel","sever","senile","sections","seaboard","scripts","scorned","saver","roxanne's","resemble","red's","rebellious","rained","putty","proposals","prenup","positioned","portuguese","pores","pinching","pilgrims","pertinent","peeping","pamphlet","paints","ovulating","outbreak","oppression","opposites","occult","nutcracker","nutcase","nominee","newt","newsstand","newfound","nepal","mocked","midterms","marshmallow","manufacturer","managers","majesty's","maclaren","luscious","lowered","loops","leans","laurence's","krudski","knowingly","keycard","katherine's","junkies","juilliard","judicial","jolinar","jase","irritable","invaluable","inuit","intoxicating","instruct","insolent","inexcusable","induce","incubator","illustrious","hydrogen","hunsecker","hub","houseguest","honk","homosexuals","homeroom","holly's","hindu","hernia","harming","handgun","hallways","hallucination","gunshots","gums","guineas","groupies","groggy","goiter","gingerbread","giggling","geometry","genre","funded","frontal","frigging","fledged","fedex","feat","fairies","eyeball","extending","exchanging","exaggeration","esteemed","ergo","enlist","enlightenment","encyclopedia","drags","disrupted","dispense","disloyal","disconnect","dimitri","desks","dentists","delhi","delacroix","degenerate","deemed","decay","daydreaming","cushions","cuddly","corroborate","contender","congregation","conflicts","confessions","complexion","completion","compensated","cobbler","closeness","chilled","checkmate","channing","carousel","calms","bylaws","bud's","benefactor","belonging","ballgame","baiting","backstabbing","assassins","artifact","armies","appoint","anthropology","anthropologist","alzheimer's","allegedly","alex's","airspace","adversary","adolf","actin","acre","aced","accuses","accelerant","abundantly","abstinence","abc","zsa","zissou","zandt","yom","yapping","wop","witchy","winter's","willows","whee","whadaya","want's","walter's","waah","viruses","vilandra","veiled","unwilling","undress","undivided","underestimating","ultimatums","twirl","truckload","tremble","traditionally","touring","touche","toasting","tingling","tiles","tents","tempered","sussex","sulking","stunk","stretches","sponges","spills","softly","snipers","slid","sedan","screens","scourge","rooftop","rog","rivalry","rifles","riana","revolting","revisit","resisted","rejects","refreshments","redecorating","recurring","recapture","raysy","randomly","purchases","prostitutes","proportions","proceeded","prevents","pretense","prejudiced","precogs","pouting","poppie","poofs","pimple","piles","pediatrician","patrick's","pathology","padre","packets","paces","orvelle","oblivious","objectivity","nikki's","nighttime","nervosa","navigation","moist","moan","minors","mic","mexicans","meurice","melts","mau","mats","matchmaker","markings","maeby","lugosi","lipnik","leprechaun","kissy","kafka","italians","introductions","intestines","intervene","inspirational","insightful","inseparable","injections","informal","influential","inadvertently","illustrated","hussy","huckabees","hmo","hittin","hiss","hemorrhaging","headin","hazy","haystack","hallowed","haiti","haa","grudges","grenades","granilith","grandkids","grading","gracefully","godsend","gobbles","fyi","future's","fun's","fret","frau","fragrance","fliers","firms","finchley","fbi's","farts","eyewitnesses","expendable","existential","endured","embraced","elk","ekg","dude's","dragonfly","dorms","domination","directory","depart","demonstrated","delaying","degrading","deduction","darlings","dante's","danes","cylons","counsellor","cortex","cop's","coordinator","contraire","consensus","consciously","conjuring","congratulating","compares","commentary","commandant","cokes","centimeters","cc's","caucus","casablanca","buffay","buddy's","brooch","bony","boggle","blood's","bitching","bistro","bijou","bewitched","benevolent","bends","bearings","barren","arr","aptitude","antenna","amish","amazes","alcatraz","acquisitions","abomination","worldly","woodstock","withstand","whispers","whadda","wayward","wayne's","wailing","vinyl","variables","vanishing","upscale","untouchable","unspoken","uncontrollable","unavoidable","unattended","tuning","trite","transvestite","toupee","timid","timers","themes","terrorizing","teamed","taipei","t's","swana","surrendered","suppressed","suppress","stumped","strolling","stripe","storybook","storming","stomachs","stoked","stationery","springtime","spontaneity","sponsored","spits","spins","soiree","sociology","soaps","smarty","shootout","shar","settings","sentiments","senator's","scramble","scouting","scone","runners","rooftops","retract","restrictions","residency","replay","remainder","regime","reflexes","recycling","rcmp","rawdon","ragged","quirky","quantico","psychologically","prodigal","primo","pounce","potty","portraits","pleasantries","plane's","pints","phd","petting","perceive","patrons","parameters","outright","outgoing","onstage","officer's","o'connor","notwithstanding","noah's","nibble","newmans","neutralize","mutilated","mortality","monumental","ministers","millionaires","mentions","mcdonald's","mayflower","masquerade","mangy","macreedy","lunatics","luau","lover's","lovable","louie's","locating","lizards","limping","lasagna","largely","kwang","keepers","juvie","jaded","ironing","intuitive","intensely","insure","installation","increases","incantation","identifying","hysteria","hypnotize","humping","heavyweight","happenin","gung","griet","grasping","glorified","glib","ganging","g'night","fueled","focker","flunking","flimsy","flaunting","fixated","fitzwallace","fictional","fearing","fainting","eyebrow","exonerated","ether","ers","electrician","egotistical","earthly","dusted","dues","donors","divisions","distinguish","displays","dismissal","dignify","detonation","deploy","departments","debrief","dazzling","dawn's","dan'l","damnedest","daisies","crushes","crucify","cordelia's","controversy","contraband","contestants","confronting","communion","collapsing","cocked","clock's","clicks","cliche","circular","circled","chord","characteristics","chandelier","casualty","carburetor","callers","bup","broads","breathes","boca","bobbie's","bloodshed","blindsided","blabbing","binary","bialystock","bashing","ballerina","ball's","aviva","avalanche","arteries","appliances","anthem","anomaly","anglo","airstrip","agonizing","adjourn","abandonment","zack's","you's","yearning","yams","wrecker","word's","witnessing","winged","whence","wept","warsaw","warp","warhead","wagons","visibility","usc","unsure","unions","unheard","unfreeze","unfold","unbalanced","ugliest","troublemaker","tolerant","toddler","tiptoe","threesome","thirties","thermostat","tampa","sycamore","switches","swipe","surgically","supervising","subtlety","stung","stumbling","stubs","struggles","stride","strangling","stamp's","spruce","sprayed","socket","snuggle","smuggled","skulls","simplicity","showering","shhhhh","sensor","sci","sac","sabotaging","rumson","rounding","risotto","riots","revival","responds","reserves","reps","reproduction","repairman","rematch","rehearsed","reelection","redi","recognizing","ratty","ragging","radiology","racquetball","racking","quieter","quicksand","pyramids","pulmonary","puh","publication","prowl","provisions","prompt","premeditated","prematurely","prancing","porcupine","plated","pinocchio","perceived","peeked","peddle","pasture","panting","overweight","oversee","overrun","outing","outgrown","obsess","o'donnell","nyu","nursed","northwestern","norma's","nodding","negativity","negatives","musketeers","mugger","mounting","motorcade","monument","merrily","matured","massimo's","masquerading","marvellous","marlena's","margins","maniacs","mag","lumpy","lovey","louse","linger","lilies","libido","lawful","kudos","knuckle","kitchen's","kennedy's","juices","judgments","joshua's","jars","jams","jamal's","jag","itches","intolerable","intermission","interaction","institutions","infectious","inept","incentives","incarceration","improper","implication","imaginative","ight","hussein","humanitarian","huckleberry","horatio","holster","heiress","heartburn","hayley's","hap","gunna","guitarist","groomed","greta's","granting","graciously","glee","gentleman's","fulfillment","fugitives","fronts","founder","forsaking","forgives","foreseeable","flavors","flares","fixation","figment","fickle","featuring","featured","fantasize","famished","faith's","fades","expiration","exclamation","evolve","euro","erasing","emphasize","elevator's","eiffel","eerie","earful","duped","dulles","distributor","distorted","dissing","dissect","dispenser","dilated","digit","differential","diagnostic","detergent","desdemona","debriefing","dazzle","damper","cylinder","curing","crowbar","crispina","crafty","crackpot","courting","corrections","cordial","copying","consuming","conjunction","conflicted","comprehension","commie","collects","cleanup","chiropractor","charmer","chariot","charcoal","chaplain","challenger","census","cd's","cauldron","catatonic","capabilities","calculate","bullied","buckets","brilliantly","breathed","boss's","booths","bombings","boardroom","blowout","blower","blip","blindness","blazing","birthday's","biologically","bibles","biased","beseech","barbaric","band's","balraj","auditorium","audacity","assisted","appropriations","applicants","anticipating","alcoholics","airhead","agendas","aft","admittedly","adapt","absolution","abbot","zing","youre","yippee","wittlesey","withheld","willingness","willful","whammy","webber's","weakest","washes","virtuous","violently","videotapes","vials","vee","unplugged","unpacked","unfairly","und","turbulence","tumbling","troopers","tricking","trenches","tremendously","travelled","travelers","traitors","torches","tommy's","tinga","thyroid","texture","temperatures","teased","tawdry","tat","taker","sympathies","swiped","swallows","sundaes","suave","strut","structural","stone's","stewie","stepdad","spewing","spasm","socialize","slither","sky's","simulator","sighted","shutters","shrewd","shocks","sherry's","sgc","semantics","scout's","schizophrenic","scans","savages","satisfactory","rya'c","runny","ruckus","royally","roadblocks","riff","rewriting","revoke","reversal","repent","renovation","relating","rehearsals","regal","redecorate","recovers","recourse","reconnaissance","receives","ratched","ramali","racquet","quince","quiche","puppeteer","puking","puffed","prospective","projected","problemo","preventing","praises","pouch","posting","postcards","pooped","poised","piled","phoney","phobia","performances","patty's","patching","participating","parenthood","pardner","oppose","oozing","oils","ohm","ohhhhh","nypd","numbing","novelist","nostril","nosey","nominate","noir","neatly","nato","naps","nappa","nameless","muzzle","muh","mortuary","moronic","modesty","mitz","missionary","mimi's","midwife","mercenaries","mcclane","maxie's","matuka","mano","mam","maitre","lush","lumps","lucid","loosened","loosely","loins","lawnmower","lane's","lamotta","kroehner","kristen's","juggle","jude's","joins","jinxy","jessep","jaya","jamming","jailhouse","jacking","ironically","intruders","inhuman","infections","infatuated","indoor","indigestion","improvements","implore","implanted","id's","hormonal","hoboken","hillbilly","heartwarming","headway","headless","haute","hatched","hartmans","harping","hari","grapevine","graffiti","gps","gon","gogh","gnome","ged","forties","foreigners","fool's","flyin","flirted","fingernail","fdr","exploration","expectation","exhilarating","entrusted","enjoyment","embark","earliest","dumper","duel","dubious","drell","dormant","docking","disqualified","disillusioned","dishonor","disbarred","directive","dicey","denny's","deleted","del's","declined","custodial","crunchy","crises","counterproductive","correspondent","corned","cords","cor","coot","contributing","contemplate","containers","concur","conceivable","commissioned","cobblepot","cliffs","clad","chief's","chickened","chewbacca","checkout","carpe","cap'n","campers","calcium","buyin","buttocks","bullies","brown's","brigade","brain's","braid","boxed","bouncy","blueberries","blubbering","bloodstream","bigamy","bel","beeped","bearable","bank's","awarded","autographs","attracts","attracting","asteroid","arbor","arab","apprentice","announces","andie's","ammonia","alarming","aidan's","ahoy","ahm","zan","wretch","wimps","widows","widower","whirlwind","whirl","weather's","warms","war's","wack","villagers","vie","vandelay","unveiling","uno","undoing","unbecoming","ucla","turnaround","tribunal","togetherness","tickles","ticker","tended","teensy","taunt","system's","sweethearts","superintendent","subcommittee","strengthen","stomach's","stitched","standpoint","staffers","spotless","splits","soothe","sonnet","smothered","sickening","showdown","shouted","shepherds","shelters","shawl","seriousness","separates","sen","schooled","schoolboy","scat","sats","sacramento","s'mores","roped","ritchie's","resembles","reminders","regulars","refinery","raggedy","profiles","preemptive","plucked","pheromones","particulars","pardoned","overpriced","overbearing","outrun","outlets","onward","oho","ohmigod","nosing","norwegian","nightly","nicked","neanderthal","mosquitoes","mortified","moisture","moat","mime","milky","messin","mecha","markinson","marivellas","mannequin","manderley","maid's","madder","macready","maciver's","lookie","locusts","lisbon","lifetimes","leg's","lanna","lakhi","kholi","joke's","invasive","impersonate","impending","immigrants","ick","i's","hyperdrive","horrid","hopin","hombre","hogging","hens","hearsay","haze","harpy","harboring","hairdo","hafta","hacking","gun's","guardians","grasshopper","graded","gobble","gatehouse","fourteenth","foosball","floozy","fitzgerald's","fished","firewood","finalize","fever's","fencing","felons","falsely","fad","exploited","euphemism","entourage","enlarged","ell","elitist","elegance","eldest","duo","drought","drokken","drier","dredge","dramas","dossier","doses","diseased","dictator","diarrhea","diagnose","despised","defuse","defendant's","d'amour","crowned","cooper's","continually","contesting","consistently","conserve","conscientious","conjured","completing","commune","commissioner's","collars","coaches","clogs","chenille","chatty","chartered","chamomile","casing","calculus","calculator","brittle","breached","boycott","blurted","birthing","bikinis","bankers","balancing","astounding","assaulting","aroma","arbitration","appliance","antsy","amnio","alienating","aliases","aires","adolescence","administrative","addressing","achieving","xerox","wrongs","workload","willona","whistling","werewolves","wallaby","veterans","usin","updates","unwelcome","unsuccessful","unseemly","unplug","undermining","ugliness","tyranny","tuesdays","trumpets","transference","traction","ticks","tete","tangible","tagging","swallowing","superheroes","sufficiently","studs","strep","stowed","stow","stomping","steffy","stature","stairway","sssh","sprain","spouting","sponsoring","snug","sneezing","smeared","slop","slink","slew","skid","simultaneously","simulation","sheltered","shakin","sewed","sewage","seatbelt","scariest","scammed","scab","sanctimonious","samir","rushes","rugged","routes","romanov","roasting","rightly","retinal","rethinking","resulted","resented","reruns","replica","renewed","remover","raiding","raided","racks","quantity","purest","progressing","primarily","presidente","prehistoric","preeclampsia","postponement","portals","poppa","pop's","pollution","polka","pliers","playful","pinning","pharaoh","perv","pennant","pelvic","paved","patented","paso","parted","paramedic","panels","pampered","painters","padding","overjoyed","orthodox","organizer","one'll","octavius","occupational","oakdale's","nous","nite","nicknames","neurosurgeon","narrows","mitt","misled","mislead","mishap","milltown","milking","microscopic","meticulous","mediocrity","meatballs","measurements","mandy's","malaria","machete","lydecker's","lurch","lorelai's","linda's","layin","lavish","lard","knockin","khruschev","kelso's","jurors","jumpin","jugular","journalists","jour","jeweler","jabba","intersection","intellectually","integral","installment","inquiries","indulging","indestructible","indebted","implicated","imitate","ignores","hyperventilating","hyenas","hurrying","huron","horizontal","hermano","hellish","heheh","header","hazardous","hart's","harshly","harper's","handout","handbag","grunemann","gots","glum","gland","glances","giveaway","getup","gerome","furthest","funhouse","frosting","franchise","frail","fowl","forwarded","forceful","flavored","flank","flammable","flaky","fingered","finalists","fatherly","famine","fags","facilitate","exempt","exceptionally","ethic","essays","equity","entrepreneur","enduring","empowered","employers","embezzlement","eels","dusk","duffel","downfall","dotted","doth","doke","distressed","disobey","disappearances","disadvantage","dinky","diminish","diaphragm","deuces","deployed","delia's","davidson's","curriculum","curator","creme","courteous","correspondence","conquered","comforts","coerced","coached","clots","clarification","cite","chunks","chickie","chick's","chases","chaperoning","ceramic","ceased","cartons","capri","caper","cannons","cameron's","calves","caged","bustin","bungee","bulging","bringin","brie","boomhauer","blowin","blindfolded","blab","biscotti","bird's","beneficial","bastard's","ballplayer","bagging","automated","auster","assurances","aschen","arraigned","anonymity","annex","animation","andi","anchorage","alters","alistair's","albatross","agreeable","advancement","adoring","accurately","abduct","wolfi","width","weirded","watchers","washroom","warheads","voltage","vincennes","villains","victorian","urgency","upward","understandably","uncomplicated","uhuh","uhhhh","twitching","trig","treadmill","transactions","topped","tiffany's","they's","thermos","termination","tenorman","tater","tangle","talkative","swarm","surrendering","summoning","substances","strive","stilts","stickers","stationary","squish","squashed","spraying","spew","sparring","sorrel's","soaring","snout","snort","sneezed","slaps","skanky","singin","sidle","shreck","shortness","shorthand","shepherd's","sharper","shamed","sculptures","scanning","saga","sadist","rydell","rusik","roulette","rodi's","rockefeller","revised","resumes","restoring","respiration","reiber's","reek","recycle","recount","reacts","rabbit's","purge","purgatory","purchasing","providence","prostate","princesses","presentable","poultry","ponytail","plotted","playwright","pinot","pigtails","pianist","phillippe","philippines","peddling","paroled","owww","orchestrated","orbed","opted","offends","o'hara","noticeable","nominations","nancy's","myrtle's","music's","mope","moonlit","moines","minefield","metaphors","memoirs","mecca","maureen's","manning's","malignant","mainframe","magicks","maggots","maclaine","lobe","loathing","linking","leper","leaps","leaping","lashed","larch","larceny","lapses","ladyship","juncture","jiffy","jane's","jakov","invoke","interpreted","internally","intake","infantile","increasingly","inadmissible","implement","immense","howl","horoscope","hoof","homage","histories","hinting","hideaway","hesitating","hellbent","heddy","heckles","hat's","harmony's","hairline","gunpowder","guidelines","guatemala","gripe","gratifying","grants","governess","gorge","goebbels","gigolo","generated","gears","fuzz","frigid","freddo","freddie's","foresee","filters","filmed","fertile","fellowship","feeling's","fascination","extinction","exemplary","executioner","evident","etcetera","estimates","escorts","entity","endearing","encourages","electoral","eaters","earplugs","draped","distributors","disrupting","disagrees","dimes","devastate","detain","deposits","depositions","delicacy","delays","darklighter","dana's","cynicism","cyanide","cutters","cronus","convoy","continuous","continuance","conquering","confiding","concentrated","compartments","companions","commodity","combing","cofell","clingy","cleanse","christmases","cheered","cheekbones","charismatic","cabaret","buttle","burdened","buddhist","bruenell","broomstick","brin","brained","bozos","bontecou","bluntman","blazes","blameless","bizarro","benny's","bellboy","beaucoup","barry's","barkeep","bali","bala","bacterial","axis","awaken","astray","assailant","aslan","arlington","aria","appease","aphrodisiac","announcements","alleys","albania","aitoro's","activation","acme","yesss","wrecks","woodpecker","wondrous","window's","wimpy","willpower","widowed","wheeling","weepy","waxing","waive","vulture","videotaped","veritable","vascular","variations","untouched","unlisted","unfounded","unforeseen","two's","twinge","truffles","triggers","traipsing","toxin","tombstone","titties","tidal","thumping","thor's","thirds","therein","testicles","tenure","tenor","telephones","technicians","tarmac","talby","tackled","systematically","swirling","suicides","suckered","subtitles","sturdy","strangler","stockbroker","stitching","steered","staple","standup","squeal","sprinkler","spontaneously","splendor","spiking","spender","sovereign","snipe","snip","snagged","slum","skimming","significantly","siddown","showroom","showcase","shovels","shotguns","shoelaces","shitload","shifty","shellfish","sharpest","shadowy","sewn","seizing","seekers","scrounge","scapegoat","sayonara","satan's","saddled","rung","rummaging","roomful","romp","retained","residual","requiring","reproductive","renounce","reggie's","reformed","reconsidered","recharge","realistically","radioed","quirks","quadrant","punctual","public's","presently","practising","pours","possesses","poolhouse","poltergeist","pocketbook","plural","plots","pleasure's","plainly","plagued","pity's","pillars","picnics","pesto","pawing","passageway","partied","para","owing","openings","oneself","oats","numero","nostalgia","nocturnal","nitwit","nile","nexus","neuro","negotiated","muss","moths","mono","molecule","mixer","medicines","meanest","mcbeal","matinee","margate","marce","manipulations","manhunt","manger","magicians","maddie's","loafers","litvack","lightheaded","lifeguard","lawns","laughingstock","kodak","kink","jewellery","jessie's","jacko","itty","inhibitor","ingested","informing","indignation","incorporate","inconceivable","imposition","impersonal","imbecile","ichabod","huddled","housewarming","horizons","homicides","hobo","historically","hiccups","helsinki","hehe","hearse","harmful","hardened","gushing","gushie","greased","goddamit","gigs","freelancer","forging","fonzie","fondue","flustered","flung","flinch","flicker","flak","fixin","finalized","fibre","festivus","fertilizer","fenmore's","farted","faggots","expanded","exonerate","exceeded","evict","establishing","enormously","enforced","encrypted","emdash","embracing","embedded","elliot's","elimination","dynamics","duress","dupres","dowser","doormat","dominant","districts","dissatisfied","disfigured","disciplined","discarded","dibbs","diagram","detailing","descend","depository","defining","decorative","decoration","deathbed","death's","dazzled","da's","cuttin","cures","crowding","crepe","crater","crammed","costly","cosmopolitan","cortlandt's","copycat","coordinated","conversion","contradict","containing","constructed","confidant","condemning","conceited","computer's","commute","comatose","coleman's","coherent","clinics","clapping","circumference","chuppah","chore","choksondik","chestnuts","catastrophic","capitalist","campaigning","cabins","briault","bottomless","boop","bonnet","board's","bloomingdale's","blokes","blob","bids","berluti","beret","behavioral","beggars","bar's","bankroll","bania","athos","assassinate","arsenic","apperantly","ancestor","akron","ahhhhhh","afloat","adjacent","actresses","accordingly","accents","abe's","zipped","zeros","zeroes","zamir","yuppie","youngsters","yorkers","writ","wisest","wipes","wield","whyn't","weirdos","wednesdays","villages","vicksburg","variable","upchuck","untraceable","unsupervised","unpleasantness","unpaid","unhook","unconscionable","uncalled","turks","tumors","trappings","translating","tragedies","townie","timely","tiki","thurgood","things'll","thine","tetanus","terrorize","temptations","teamwork","tanning","tampons","tact","swarming","surfaced","supporter","stuart's","stranger's","straitjacket","stint","stimulation","steroid","statistically","startling","starry","squander","speculating","source's","sollozzo","sobriety","soar","sneaked","smithsonian","slugs","slaw","skit","skedaddle","sinker","similarities","silky","shortcomings","shipments","sheila's","severity","sellin","selective","seattle's","seasoned","scrubbed","scrooge","screwup","scrapes","schooling","scarves","saturdays","satchel","sandburg's","sandbox","salesmen","rooming","romances","revolving","revere","resulting","reptiles","reproach","reprieve","recreational","rearranging","realtor","ravine","rationalize","raffle","quoted","punchy","psychobabble","provocation","profoundly","problematic","prescriptions","preferable","praised","polishing","poached","plow","pledges","planetary","plan's","pirelli","perverts","peaked","pastures","pant","oversized","overdressed","outdid","outdated","oriental","ordinance","orbs","opponents","occurrence","nuptials","nominees","nineteenth","nefarious","mutiny","mouthpiece","motels","mopping","moon's","mongrel","monetary","mommie","missin","metaphorically","merv","mertin","memos","memento","melodrama","melancholy","measles","meaner","marches","mantel","maneuvers","maneuvering","mailroom","machine's","luring","listenin","lion's","lifeless","liege","licks","libraries","liberties","levon","legwork","lanka","lacked","kneecaps","kippur","kiddie","kaput","justifiable","jigsaw","issuing","islamic","insistent","insidious","innuendo","innit","inhabitants","individually","indicator","indecent","imaginable","illicit","hymn","hurling","humane","hospitalized","horseshit","hops","hondo","hemorrhoid","hella","healthiest","haywire","hamsters","halibut","hairbrush","hackers","guam","grouchy","grisly","griffin's","gratuitous","glutton","glimmer","gibberish","ghastly","geologist","gentler","generously","generators","geeky","gaga","furs","fuhrer","fronting","forklift","foolin","fluorescent","flats","flan","financed","filmmaking","fight's","faxes","faceless","extinguisher","expressions","expel","etched","entertainer","engagements","endangering","empress","egos","educator","ducked","dual","dramatically","dodgeball","dives","diverted","dissolved","dislocated","discrepancy","discovers","dink","devour","destroyers","derail","deputies","dementia","decisive","daycare","daft","cynic","crumbling","cowardice","cow's","covet","cornwallis","corkscrew","cookbook","conditioned","commendation","commandments","columns","coincidental","cobwebs","clouded","clogging","clicking","clasp","citizenship","chopsticks","chefs","chaps","catherine's","castles","cashing","carat","calmer","burgundy","bulldog's","brightly","brazen","brainwashing","bradys","bowing","booties","bookcase","boned","bloodsucking","blending","bleachers","bleached","belgian","bedpan","bearded","barrenger","bachelors","awwww","atop","assures","assigning","asparagus","arabs","apprehend","anecdote","amoral","alterations","alli","aladdin","aggravation","afoot","acquaintances","accommodating","accelerate","yakking","wreckage","worshipping","wladek","willya","willies","wigged","whoosh","whisked","wavelength","watered","warpath","warehouses","volts","vitro","violates","viewed","vicar","valuables","users","urging","uphill","unwise","untimely","unsavory","unresponsive","unpunished","unexplained","unconventional","tubby","trolling","treasurer","transfers","toxicology","totaled","tortoise","tormented","toothache","tingly","tina's","timmiihh","tibetan","thursdays","thoreau","terrifies","temperature's","temperamental","telegrams","ted's","technologies","teaming","teal'c's","talkie","takers","table's","symbiote","swirl","suffocate","subsequently","stupider","strapping","store's","steckler","standardized","stampede","stainless","springing","spreads","spokesperson","speeds","someway","snowflake","sleepyhead","sledgehammer","slant","slams","situation's","showgirl","shoveling","shmoopy","sharkbait","shan't","seminars","scrambling","schizophrenia","schematics","schedule's","scenic","sanitary","sandeman","saloon","sabbatical","rural","runt","rummy","rotate","reykjavik","revert","retrieved","responsive","rescheduled","requisition","renovations","remake","relinquish","rejoice","rehabilitation","recreation","reckoning","recant","rebuilt","rebadow","reassurance","reassigned","rattlesnake","ramble","racism","quor","prowess","prob","primed","pricey","predictions","prance","pothole","pocus","plains","pitches","pistols","persist","perpetrated","penal","pekar","peeling","patter","pastime","parmesan","paper's","papa's","panty","pail","pacemaker","overdrive","optic","operas","ominous","offa","observant","nothings","noooooo","nonexistent","nodded","nieces","neia","neglecting","nauseating","mutton","mutated","musket","munson's","mumbling","mowing","mouthful","mooseport","monologue","momma's","moly","mistrust","meetin","maximize","masseuse","martha's","marigold","mantini","mailer","madre","lowlifes","locksmith","livid","liven","limos","licenses","liberating","lhasa","lenin","leniency","leering","learnt","laughable","lashes","lasagne","laceration","korben","katan","kalen","jordan's","jittery","jesse's","jammies","irreplaceable","intubate","intolerant","inhaler","inhaled","indifferent","indifference","impound","imposed","impolite","humbly","holocaust","heroics","heigh","gunk","guillotine","guesthouse","grounding","groundbreaking","groom's","grips","grant's","gossiping","goatee","gnomes","gellar","fusion's","fumble","frutt","frobisher","freudian","frenchman","foolishness","flagged","fixture","femme","feeder","favored","favorable","fatso","fatigue","fatherhood","farmer's","fantasized","fairest","faintest","factories","eyelids","extravagant","extraterrestrial","extraordinarily","explicit","escalator","eros","endurance","encryption","enchantment's","eliminating","elevate","editors","dysfunction","drivel","dribble","dominican","dissed","dispatched","dismal","disarray","dinnertime","devastation","dermatologist","delicately","defrost","debutante","debacle","damone","dainty","cuvee","culpa","crucified","creeped","crayons","courtship","counsel's","convene","continents","conspicuous","congresswoman","confinement","conferences","confederate","concocted","compromises","comprende","composition","communism","comma","collectors","coleslaw","clothed","clinically","chug","chickenshit","checkin","chaotic","cesspool","caskets","cancellation","calzone","brothel","boomerang","bodega","bloods","blasphemy","black's","bitsy","bink","biff","bicentennial","berlini","beatin","beards","barbas","barbarians","backpacking","audiences","artist's","arrhythmia","array","arousing","arbitrator","aqui","appropriately","antagonize","angling","anesthetic","altercation","alice's","aggressor","adversity","adopting","acne","accordance","acathla","aaahhh","wreaking","workup","workings","wonderin","wolf's","wither","wielding","whopper","what'm","what'cha","waxed","vibrating","veterinarian","versions","venting","vasey","valor","validate","urged","upholstery","upgraded","untied","unscathed","unsafe","unlawful","uninterrupted","unforgiving","undies","uncut","twinkies","tucking","tuba","truffle","truck's","triplets","treatable","treasured","transmit","tranquility","townspeople","torso","tomei","tipsy","tinsel","timeline","tidings","thirtieth","tensions","teapot","tasks","tantrums","tamper","talky","swayed","swapping","sven","sulk","suitor","subjected","stylist","stroller","storing","stirs","statistical","standoff","staffed","squadron","sprinklers","springsteen","specimens","sparkly","song's","snowy","snobby","snatcher","smoother","smith's","sleepin","shrug","shortest","shoebox","shel","sheesh","shee","shackles","setbacks","sedatives","screeching","scorched","scanned","satyr","sammy's","sahib","rosemary's","rooted","rods","roadblock","riverbank","rivals","ridiculed","resentful","repellent","relates","registry","regarded","refugee","recreate","reconvene","recalled","rebuttal","realmedia","quizzes","questionnaire","quartet","pusher","punctured","pucker","propulsion","promo","prolong","professionalism","prized","premise","predators","portions","pleasantly","planet's","pigsty","physicist","phil's","penniless","pedestrian","paychecks","patiently","paternal","parading","pa's","overactive","ovaries","orderlies","oracles","omaha","oiled","offending","nudie","neonatal","neighborly","nectar","nautical","naught","moops","moonlighting","mobilize","mite","misleading","milkshake","mickey's","metropolitan","menial","meats","mayan","maxed","marketplace","mangled","magua","lunacy","luckier","llanview's","livestock","liters","liter","licorice","libyan","legislature","lasers","lansbury","kremlin","koreans","kooky","knowin","kilt","junkyard","jiggle","jest","jeopardized","jags","intending","inkling","inhalation","influences","inflated","inflammatory","infecting","incense","inbound","impractical","impenetrable","iffy","idealistic","i'mma","hypocrites","hurtin","humbled","hosted","homosexuality","hologram","hokey","hocus","hitchhiking","hemorrhoids","headhunter","hassled","harts","hardworking","haircuts","hacksaw","guerrilla","genitals","gazillion","gatherings","ganza's","gammy","gamesphere","fugue","fuels","forests","footwear","folly","folds","flexibility","flattened","flashlights","fives","filet","field's","famously","extenuating","explored","exceed","estrogen","envisioned","entails","emerged","embezzled","eloquent","egomaniac","dummies","duds","ducts","drowsy","drones","dragon's","drafts","doree","donovon","donny's","docked","dixon's","distributed","disorders","disguises","disclose","diggin","dickie's","detachment","deserting","depriving","demographic","delegation","defying","deductible","decorum","decked","daylights","daybreak","dashboard","darien","damnation","d'angelo's","cuddling","crunching","crickets","crazies","crayon","councilman","coughed","coordination","conundrum","contractors","contend","considerations","compose","complimented","compliance","cohaagen","clutching","cluster","clued","climbs","clader","chuck's","chromosome","cheques","checkpoint","chats","channeling","ceases","catholics","cassius","carver's","carasco","capped","capisce","cantaloupe","cancelling","campsite","camouflage","cambodia","burglars","bureaucracy","breakfasts","branding","bra'tac","book's","blueprint","bleedin","blaze's","blabbed","bisexual","bile","big's","beverages","beneficiary","battery's","basing","avert","avail","autobiography","atone","army's","arlyn","ares","architectural","approves","apothecary","anus","antiseptic","analytical","amnesty","alphabetical","alignment","aligned","aleikuum","advisory","advisors","advisement","adulthood","acquiring","accessed","zombie's","zadir","wrestled","wobbly","withnail","wheeled","whattaya","whacking","wedged","wanders","walkman","visionary","virtues","vincent's","vega's","vaginal","usage","unnamed","uniquely","unimaginable","undeniable","unconditionally","uncharted","unbridled","tweezers","tvmegasite","trumped","triumphant","trimming","tribes","treading","translates","tranquilizers","towing","tout","toontown","thunk","taps","taboo","suture","suppressing","succeeding","submission","strays","stonewall","stogie","stepdaughter","stalls","stace","squint","spouses","splashed","speakin","sounder","sorrier","sorrel","sorcerer","sombrero","solemnly","softened","socialist","snobs","snippy","snare","smoothing","slump","slimeball","slaving","sips","singular","silently","sicily","shiller","shayne's","shareholders","shakedown","sensations","seagulls","scrying","scrumptious","screamin","saucy","santoses","santos's","sanctions","roundup","roughed","rosary","robechaux","roadside","riley's","retrospect","resurrected","restoration","reside","researched","rescind","reproduce","reprehensible","repel","rendering","remodeling","religions","reconsidering","reciprocate","ratchet","rambaldi's","railroaded","raccoon","quasi","psychics","psat","promos","proclamation","problem's","prob'ly","pristine","printout","priestess","prenuptial","prediction","precedes","pouty","potter's","phoning","petersburg","peppy","pariah","parched","parcel","panes","overloaded","overdoing","operators","oldies","obesity","nymphs","nother","notebooks","nook","nikolai","nearing","nearer","mutation","municipal","monstrosity","minister's","milady","mieke","mephesto","memory's","melissa's","medicated","marshals","manilow","mammogram","mainstream","madhouse","m'lady","luxurious","luck's","lucas's","lotsa","loopy","logging","liquids","lifeboat","lesion","lenient","learner","lateral","laszlo","larva","kross","kinks","jinxed","involuntary","inventor","interim","insubordination","inherent","ingrate","inflatable","independently","incarnate","inane","imaging","hypoglycemia","huntin","humorous","humongous","hoodlum","honoured","honking","hitler's","hemorrhage","helpin","hearing's","hathor","hatching","hangar","halftime","guise","guggenheim","grrr","grotto","grandson's","grandmama","gorillas","godless","girlish","ghouls","gershwin","frosted","friday's","forwards","flutter","flourish","flagpole","finely","finder's","fetching","fatter","fated","faithfully","faction","fabrics","exposition","expo","exploits","exert","exclude","eviction","everwood's","evasion","espn","escorting","escalate","enticing","enroll","enhancement","endowed","enchantress","emerging","elopement","drills","drat","downtime","downloading","dorks","doorways","doctorate","divulge","dissociative","diss","disgraceful","disconcerting","dirtbag","deteriorating","deteriorate","destinies","depressive","dented","denim","defeating","decruz","decidedly","deactivate","daydreams","czar","curls","culprit","cues","crybaby","cruelest","critique","crippling","cretin","cranberries","cous","coupled","corvis","copped","convicts","converts","contingent","contests","complement","commend","commemorate","combinations","coastguard","cloning","cirque","churning","chock","chivalry","chemotherapy","charlotte's","chancellor's","catalogues","cartwheels","carpets","carols","canister","camera's","buttered","bureaucratic","bundt","buljanoff","bubbling","brokers","broaden","brimstone","brainless","borneo","bores","boing","bodied","billie's","biceps","beijing","bead","badmouthing","bad's","avec","autopilot","attractions","attire","atoms","atheist","ascertain","artificially","archbishop","aorta","amps","ampata","amok","alloy","allied","allenby","align","albeit","aired","aint","adjoining","accosted","abyss","absolve","aborted","aaagh","aaaaaah","your's","yonder","yellin","yearly","wyndham","wrongdoing","woodsboro","wigging","whup","wasteland","warranty","waltzed","walnuts","wallace's","vividly","vibration","verses","veggie","variation","validation","unnecessarily","unloaded","unicorns","understated","undefeated","unclean","umbrellas","tyke","twirling","turpentine","turnover","tupperware","tugger","triangles","triage","treehouse","tract","toil","tidbit","tickled","thud","threes","thousandth","thingie","terminally","temporal","teething","tassel","talkies","syndication","syllables","swoon","switchboard","swerved","suspiciously","superiority","successor","subsequentlyne","subsequent","subscribe","strudel","stroking","strictest","steven's","stensland","stefan's","starsky","starin","stannart","squirming","squealing","sorely","solidarity","softie","snookums","sniveling","snail","smidge","smallpox","sloth","slab","skulking","singled","simian","silo","sightseeing","siamese","shudder","shoppers","shax","sharpen","shannen","semtex","sellout","secondhand","season's","seance","screenplay","scowl","scorn","scandals","santiago's","safekeeping","sacked","russe","rummage","rosie's","roshman","roomies","roaches","rinds","retrace","retires","resuscitate","restrained","residential","reservoir","rerun","reputations","rekall","rejoin","refreshment","reenactment","recluse","ravioli","raves","ranked","rampant","rama","rallies","raking","purses","punishable","punchline","puked","provincial","prosky","prompted","processor","previews","prepares","poughkeepsie","poppins","polluted","placenta","pissy","petulant","peterson's","perseverance","persecution","pent","peasants","pears","pawns","patrols","pastries","partake","paramount","panky","palate","overzealous","overthrow","overs","oswald's","oskar","originated","orchids","optical","onset","offenses","obstructing","objectively","obituaries","obedient","obedience","novice","nothingness","nitrate","newer","nets","mwah","musty","mung","motherly","mooning","monique's","momentous","moby","mistaking","mistakenly","minutemen","milos","microchip","meself","merciless","menelaus","mazel","mauser","masturbate","marsh's","manufacturers","mahogany","lysistrata","lillienfield","likable","lightweight","liberate","leveled","letdown","leer","leeloo","larynx","lardass","lainey","lagged","lab's","klorel","klan","kidnappings","keyed","karmic","jive","jiggy","jeebies","isabel's","irate","iraqi","iota","iodine","invulnerable","investor","intrusive","intricate","intimidation","interestingly","inserted","insemination","inquire","innate","injecting","inhabited","informative","informants","incorporation","inclination","impure","impasse","imbalance","illiterate","i'ma","i'ii","hurled","hunts","hispanic","hematoma","help's","helen's","headstrong","harmonica","hark","handmade","handiwork","gymnasium","growling","governors","govern","gorky","gook","girdle","getcha","gesundheit","gazing","gazette","garde","galley","funnel","fred's","fossils","foolishly","fondness","flushing","floris","firearm","ferocious","feathered","fateful","fancies","fakes","faker","expressway","expire","exec","ever'body","estates","essentials","eskimos","equations","eons","enlightening","energetic","enchilada","emmi","emissary","embolism","elsinore","ecklie","drenched","drazi","doped","dogging","documentation","doable","diverse","disposed","dislikes","dishonesty","disengage","discouraging","diplomat","diplomacy","deviant","descended","derailed","depleted","demi","deformed","deflect","defines","defer","defcon","deactivated","crips","creditors","counters","corridors","cordy's","conversation's","constellations","congressmen","congo","complimenting","colombian","clubbing","clog","clint's","clawing","chromium","chimes","chicken's","chews","cheatin","chaste","ceremony's","cellblock","ceilings","cece","caving","catered","catacombs","calamari","cabbie","bursts","bullying","bucking","brulee","brits","brisk","breezes","brandon's","bounces","boudoir","blockbuster","binks","better'n","beluga","bellied","behrani","behaves","bedding","battalion","barriers","banderas","balmy","bakersfield","badmouth","backers","avenging","atat","aspiring","aromatherapy","armpit","armoire","anythin","another's","anonymously","anniversaries","alonzo's","aftershave","affordable","affliction","adrift","admissible","adieu","activist","acquittal","yucky","yearn","wrongly","wino","whitter","whirlpool","wendigo","watchdog","wannabes","walkers","wakey","vomited","voicemail","verb","vans","valedictorian","vacancy","uttered","up's","unwed","unrequited","unnoticed","unnerving","unkind","unjust","uniformed","unconfirmed","unadulterated","unaccounted","uglier","tyler's","twix","turnoff","trough","trolley","trampled","tramell","traci's","tort","toads","titled","timbuktu","thwarted","throwback","thon","thinker","thimble","tasteless","tarantula","tammy's","tamale","takeovers","symposium","symmetry","swish","supposing","supporters","suns","sully","streaking","strands","statutory","starlight","stargher","starch","stanzi","stabs","squeamish","spokane","splattered","spiritually","spilt","sped","speciality","spacious","soundtrack","smacking","slain","slag","slacking","skywire","skips","skeet","skaara","simpatico","shredding","showin","shortcuts","shite","shielding","sheep's","shamelessly","serafine","sentimentality","sect","secretary's","seasick","scientifically","scholars","schemer","scandalous","saturday's","salts","saks","sainted","rustic","rugs","riedenschneider","ric's","rhyming","rhetoric","revolt","reversing","revel","retractor","retards","retaliation","resurrect","remiss","reminiscing","remanded","reluctance","relocating","relied","reiben","regions","regains","refuel","refresher","redoing","redheaded","redeemed","recycled","reassured","rearranged","rapport","qumar","prowling","promotional","promoter","preserving","prejudices","precarious","powwow","pondering","plunger","plunged","pleasantville","playpen","playback","pioneers","physicians","phlegm","perfected","pancreas","pakistani","oxide","ovary","output","outbursts","oppressed","opal's","ooohhh","omoroca","offed","o'toole","nurture","nursemaid","nosebleed","nixon's","necktie","muttering","munchies","mucking","mogul","mitosis","misdemeanor","miscarried","minx","millionth","migraines","midler","methane","metabolism","merchants","medicinal","margaret's","manifestation","manicurist","mandelbaum","manageable","mambo","malfunctioned","mais","magnesium","magnanimous","loudmouth","longed","lifestyles","liddy","lickety","leprechauns","lengthy","komako","koji's","klute","kennel","kathy's","justifying","jerusalem","israelis","isle","irreversible","inventing","invariably","intervals","intergalactic","instrumental","instability","insinuate","inquiring","ingenuity","inconclusive","incessant","improv","impersonation","impeachment","immigrant","id'd","hyena","humperdinck","humm","hubba","housework","homeland","holistic","hoffa","hither","hissy","hippy","hijacked","hero's","heparin","hellooo","heat's","hearth","hassles","handcuff","hairstyle","hadda","gymnastics","guys'll","gutted","gulp","gulls","guard's","gritty","grievous","gravitational","graft","gossamer","gooder","glory's","gere","gash","gaming","gambled","galaxies","gadgets","fundamentals","frustrations","frolicking","frock","frilly","fraser's","francais","foreseen","footloose","fondly","fluent","flirtation","flinched","flight's","flatten","fiscal","fiercely","felicia's","fashionable","farting","farthest","farming","facade","extends","exposer","exercised","evading","escrow","errr","enzymes","energies","empathize","embryos","embodiment","ellsberg","electromagnetic","ebola","earnings","dulcinea","dreamin","drawbacks","drains","doyle's","doubling","doting","doose's","doose","doofy","dominated","dividing","diversity","disturbs","disorderly","disliked","disgusts","devoid","detox","descriptions","denominator","demonstrating","demeanor","deliriously","decode","debauchery","dartmouth","d'oh","croissant","cravings","cranked","coworkers","councilor","council's","convergence","conventions","consistency","consist","conquests","conglomerate","confuses","confiscate","confines","confesses","conduit","compress","committee's","commanded","combed","colonel's","coated","clouding","clamps","circulating","circa","cinch","chinnery","celebratory","catalogs","carpenters","carnal","carla's","captures","capitan","capability","canin","canes","caitlin's","cadets","cadaver","cable's","bundys","bulldozer","buggers","bueller","bruno's","breakers","brazilian","branded","brainy","booming","bookstores","bloodbath","blister","bittersweet","biologist","billed","betty's","bellhop","beeping","beaut","beanstalk","beady","baudelaire","bartenders","bargains","ballad","backgrounds","averted","avatar's","atmospheric","assert","assassinated","armadillo","archive","appreciating","appraised","antlers","anterior","alps","aloof","allowances","alleyway","agriculture","agent's","affleck","acknowledging","achievements","accordion","accelerator","abracadabra","abject","zinc","zilch","yule","yemen","xanax","wrenching","wreath","wouldn","witted","widely","wicca","whorehouse","whooo","whips","westchester","websites","weaponry","wasn","walsh's","vouchers","vigorous","viet","victimized","vicodin","untested","unsolicited","unofficially","unfocused","unfettered","unfeeling","unexplainable","uneven","understaffed","underbelly","tutorial","tuberculosis","tryst","trois","trix","transmitting","trampoline","towering","topeka","tirade","thieving","thang","tentacles","teflon","teachings","tablets","swimmin","swiftly","swayzak","suspecting","supplying","suppliers","superstitions","superhuman","subs","stubbornness","structures","streamers","strattman","stonewalling","stimulate","stiffs","station's","stacking","squishy","spout","splice","spec","sonrisa","smarmy","slows","slicing","sisterly","sierra's","sicilian","shrill","shined","shift's","seniority","seine","seeming","sedley","seatbelts","scour","scold","schoolyard","scarring","sash","sark's","salieri","rustling","roxbury","richly","rexy","rex's","rewire","revved","retriever","respective","reputable","repulsed","repeats","rendition","remodel","relocated","reins","reincarnation","regression","reconstruction","readiness","rationale","rance","rafters","radiohead","radio's","rackets","quarterly","quadruple","pumbaa","prosperous","propeller","proclaim","probing","privates","pried","prewedding","premeditation","posturing","posterity","posh","pleasurable","pizzeria","pish","piranha","pimps","penmanship","penchant","penalties","pelvis","patriotism","pasa","papaya","packaging","overturn","overture","overstepped","overcoat","ovens","outsmart","outed","orient","ordained","ooohh","oncologist","omission","olly","offhand","odour","occurring","nyazian","notarized","nobody'll","nightie","nightclubs","newsweek","nesting","navel","nationwide","nabbed","naah","mystique","musk","mover","mortician","morose","moratorium","monster's","moderate","mockingbird","mobsters","misconduct","mingling","mikey's","methinks","metaphysical","messengered","merge","merde","medallion","mathematical","mater","mason's","masochist","martouf","martians","marinara","manray","manned","mammal","majorly","magnifying","mackerel","mabel's","lyme","lurid","lugging","lonnegan","loathsome","llantano","liszt","listings","limiting","liberace","leprosy","latinos","lanterns","lamest","laferette","ladybird","kraut","kook","kits","kipling","joyride","inward","intestine","innocencia","inhibitions","ineffectual","indisposed","incurable","incumbent","incorporated","inconvenienced","inanimate","improbable","implode","idea's","hypothesis","hydrant","hustling","hustled","huevos","how'm","horseshoe","hooey","hoods","honcho","hinge","hijack","heroism","hermit","heimlich","harvesting","hamunaptra","haladki","haiku","haggle","haaa","gutsy","grunting","grueling","grit","grifter","grievances","gribbs","greevy","greeted","green's","grandstanding","godparents","glows","glistening","glider","gimmick","genocide","gaping","fraiser","formalities","foreigner","forecast","footprint","folders","foggy","flaps","fitty","fiends","femmes","fearful","fe'nos","favours","fabio","eyeing","extort","experimentation","expedite","escalating","erect","epinephrine","entitles","entice","enriched","enable","emissions","eminence","eights","ehhh","educating","eden's","earthquakes","earthlings","eagerly","dunville","dugout","draining","doublemeat","doling","disperse","dispensing","dispatches","dispatcher","discoloration","disapproval","diners","dieu","diddly","dictates","diazepam","descendants","derogatory","deposited","delights","defies","decoder","debates","dealio","danson","cutthroat","crumbles","crud","croissants","crematorium","craftsmanship","crafted","could'a","correctional","cordless","cools","contradiction","constitute","conked","confine","concealing","composite","complicates","communique","columbian","cockamamie","coasters","clusters","clobbered","clipping","clipboard","clergy","clemenza","cleanser","circumcision","cindy's","chisel","character's","chanukah","certainaly","centerpiece","cellmate","cartoonist","cancels","cadmium","buzzed","busiest","bumstead","bucko","browsing","broth","broader","break's","braver","boundary","boggling","bobbing","blurred","birkhead","bethesda","benet","belvedere","bellies","begrudge","beckworth","bebe's","banky","baldness","bagpipes","baggy","babysitters","aversion","auxiliary","attributes","attain","astonished","asta","assorted","aspirations","arnold's","area's","appetites","apparel","apocalyptic","apartment's","announcer","angina","amiss","ambulances","allo","alleviate","alibis","algeria","alaskan","airway","affiliated","aerial","advocating","adrenalin","admires","adhesive","actively","accompanying","zeta","yoyou","yoke","yachts","wreaked","wracking","woooo","wooing","wised","winnie's","wind's","wilshire","wedgie","watson's","warden's","waging","violets","vincey","victorious","victories","velcro","vastly","valves","valley's","uplifting","untrustworthy","unmitigated","universities","uneventful","undressing","underprivileged","unburden","umbilical","twigs","tweet","tweaking","turquoise","trustees","truckers","trimmed","triggering","treachery","trapping","tourism","tosses","torching","toothpick","toga","toasty","toasts","tiamat","thickens","ther","tereza","tenacious","temperament","televised","teldar","taxis","taint","swill","sweatin","sustaining","surgery's","surgeries","succeeds","subtly","subterranean","subject's","subdural","streep","stopwatch","stockholder","stillwater","steamer","stang's","stalkers","squished","squeegee","splinters","spliced","splat","spied","specialized","spaz","spackle","sophistication","snapshots","smoky","smite","sluggish","slithered","skin's","skeeters","sidewalks","sickly","shrugs","shrubbery","shrieking","shitless","shithole","settin","servers","serge","sentinels","selfishly","segments","scarcely","sawdust","sanitation","sangria","sanctum","samantha's","sahjhan","sacrament","saber","rustle","rupture","rump","roving","rousing","rosomorf","rosario's","rodents","robust","rigs","riddled","rhythms","revelations","restart","responsibly","repression","reporter's","replied","repairing","renoir","remoray","remedial","relocation","relies","reinforcement","refundable","redirect","recheck","ravenwood","rationalizing","ramus","ramsey's","ramelle","rails","radish","quivering","pyjamas","puny","psychos","prussian","provocations","prouder","protestors","protesters","prohibited","prohibit","progression","prodded","proctologist","proclaimed","primordial","pricks","prickly","predatory","precedents","praising","pragmatic","powerhouse","posterior","postage","porthos","populated","poly","pointe","pivotal","pinata","persistence","performers","pentangeli","pele","pecs","pathetically","parka","parakeet","panicky","pandora's","pamphlets","paired","overthruster","outsmarted","ottoman","orthopedic","oncoming","oily","offing","nutritious","nuthouse","nourishment","nietzsche","nibbling","newlywed","newcomers","need's","nautilus","narcissist","myths","mythical","mutilation","mundane","mummy's","mummies","mumble","mowed","morvern","mortem","mortal's","mopes","mongolian","molasses","modification","misplace","miscommunication","miney","militant","midlife","mens","menacing","memorizing","memorabilia","membrane","massaging","masking","maritime","mapping","manually","magnets","ma's","luxuries","lows","lowering","lowdown","lounging","lothario","longtime","liposuction","lieutenant's","lidocaine","libbets","lewd","levitate","leslie's","leeway","lectured","lauren's","launcher","launcelot","latent","larek","lagos","lackeys","kumbaya","kryptonite","knapsack","keyhole","kensington","katarangura","kann","junior's","juiced","jugs","joyful","jihad","janitor's","jakey","ironclad","invoice","intertwined","interlude","interferes","insurrection","injure","initiating","infernal","india's","indeedy","incur","incorrigible","incantations","imprint","impediment","immersion","immensely","illustrate","ike's","igloo","idly","ideally","hysterectomy","hyah","house's","hour's","hounded","hooch","honeymoon's","hollering","hogs","hindsight","highs","high's","hiatus","helix","heirs","heebie","havesham","hassan's","hasenfuss","hankering","hangers","hakuna","gutless","gusto","grubbing","grrrr","greg's","grazed","gratification","grandeur","gorak","godammit","gnawing","glanced","gladiators","generating","galahad","gaius","furnished","funeral's","fundamentally","frostbite","frees","frazzled","fraulein","fraternizing","fortuneteller","formaldehyde","followup","foggiest","flunky","flickering","flashbacks","fixtures","firecrackers","fines","filly","figger","fetuses","fella's","feasible","fates","eyeliner","extremities","extradited","expires","experimented","exiting","exhibits","exhibited","exes","excursion","exceedingly","evaporate","erupt","equilibrium","epileptic","ephram's","entrails","entities","emporium","egregious","eggshells","easing","duwayne","drone","droll","dreyfuss","drastically","dovey","doubly","doozy","donkeys","donde","dominate","distrust","distributing","distressing","disintegrate","discreetly","disagreements","diff","dick's","devised","determines","descending","deprivation","delegate","dela","degradation","decision's","decapitated","dealin","deader","dashed","darkroom","dares","daddies","dabble","cycles","cushy","currents","cupcakes","cuffed","croupier","croak","criticized","crapped","coursing","cornerstone","copyright","coolers","continuum","contaminate","cont","consummated","construed","construct","condos","concoction","compulsion","committees","commish","columnist","collapses","coercion","coed","coastal","clemency","clairvoyant","circulate","chords","chesterton","checkered","charlatan","chaperones","categorically","cataracts","carano","capsules","capitalize","cache","butcher's","burdon","bullshitting","bulge","buck's","brewed","brethren","bren","breathless","breasted","brainstorming","bossing","borealis","bonsoir","bobka","boast","blimp","bleu","bleep","bleeder","blackouts","bisque","binford's","billboards","bernie's","beecher's","beatings","bayberry","bashed","bartlet's","bapu","bamboozled","ballon","balding","baklava","baffled","backfires","babak","awkwardness","attributed","attest","attachments","assembling","assaults","asphalt","arthur's","arthritis","armenian","arbitrary","apologizes","anyhoo","antiquated","alcante","agency's","advisable","advertisement","adventurer","abundance","aahhh","aaahh","zatarc","yous","york's","yeti","yellowstone","yearbooks","yakuza","wuddya","wringing","woogie","womanhood","witless","winging","whatsa","wetting","wessex","wendy's","way's","waterproof","wastin","washington's","wary","voom","volition","volcanic","vogelman","vocation","visually","violinist","vindicated","vigilance","viewpoint","vicariously","venza","vasily","validity","vacuuming","utensils","uplink","unveil","unloved","unloading","uninhibited","unattached","ukraine","typo","tweaked","twas","turnips","tunisia","tsch","trinkets","tribune","transmitters","translator","train's","toured","toughen","toting","topside","topical","toothed","tippy","tides","theology","terrors","terrify","tentative","technologically","tarnish","target's","tallest","tailored","tagliati","szpilman","swimmers","swanky","susie's","surly","supple","sunken","summation","suds","suckin","substantially","structured","stockholm","stepmom","squeaking","springfield's","spooks","splashmore","spanked","souffle","solitaire","solicitation","solarium","smooch","smokers","smog","slugged","slobbering","skylight","skimpy","situated","sinuses","simplify","silenced","sideburns","sid's","shutdown","shrinkage","shoddy","shhhhhh","shelling","shelled","shareef","shangri","shakey's","seuss","servicing","serenade","securing","scuffle","scrolls","scoff","scholarships","scanners","sauerkraut","satisfies","satanic","sars","sardines","sarcophagus","santino","sandi's","salvy","rusted","russells","ruby's","rowboat","routines","routed","rotating","rolfsky","ringside","rigging","revered","retreated","respectability","resonance","resembling","reparations","reopened","renewal","renegotiate","reminisce","reluctantly","reimburse","regimen","regaining","rectum","recommends","recognizable","realism","reactive","rawhide","rappaport's","raincoat","quibble","puzzled","pursuits","purposefully","puns","pubic","psychotherapy","prosecution's","proofs","proofing","professor's","prevention","prescribing","prelim","positioning","pore","poisons","poaching","pizza's","pertaining","personalized","personable","peroxide","performs","pentonville","penetrated","peggy's","payphone","payoffs","participated","park's","parisian","palp","paleontology","overhaul","overflowing","organised","oompa","ojai","offenders","oddest","objecting","o'hare","o'daniel","notches","noggin","nobody'd","nitrogen","nightstand","niece's","nicky's","neutralized","nervousness","nerdy","needlessly","navigational","narrative","narc","naquadah","nappy","nantucket","nambla","myriad","mussolini","mulberry","mountaineer","mound","motherfuckin","morrie","monopolizing","mohel","mistreated","misreading","misbehave","miramax","minstrel","minivan","milligram","milkshakes","milestone","middleweight","michelangelo","metamorphosis","mesh","medics","mckinnon's","mattresses","mathesar","matchbook","matata","marys","marco's","malucci","majored","magilla","magic's","lymphoma","lowers","lordy","logistics","linens","lineage","lindenmeyer","limelight","libel","leery's","leased","leapt","laxative","lather","lapel","lamppost","laguardia","labyrinth","kindling","key's","kegs","kegger","kawalsky","juries","judo","jokin","jesminder","janine's","izzy","israeli","interning","insulation","institutionalized","inspected","innings","innermost","injun","infallible","industrious","indulgence","indonesia","incinerator","impossibility","imports","impart","illuminate","iguanas","hypnotic","hyped","huns","housed","hostilities","hospitable","hoses","horton's","homemaker","history's","historian","hirschmuller","highlighted","hideout","helpers","headset","guardianship","guapo","guantanamo","grubby","greyhound","grazing","granola","granddaddy","gotham's","goren","goblet","gluttony","glucose","globes","giorno","gillian's","getter","geritol","gassed","gang's","gaggle","freighter","freebie","frederick's","fractures","foxhole","foundations","fouled","foretold","forcibly","folklore","floorboards","floods","floated","flippers","flavour","flaked","firstly","fireflies","feedings","fashionably","fascism","farragut","fallback","factions","facials","exterminate","exited","existent","exiled","exhibiting","excites","everything'll","evenin","evaluated","ethically","entree","entirety","ensue","enema","empath","embryo","eluded","eloquently","elle","eliminates","eject","edited","edema","echoes","earns","dumpling","drumming","droppings","drazen's","drab","dolled","doll's","doctrine","distasteful","disputing","disputes","displeasure","disdain","disciples","diamond's","develops","deterrent","detection","dehydration","defied","defiance","decomposing","debated","dawned","darken","daredevil","dailies","cyst","custodian","crusts","crucifix","crowning","crier","crept","credited","craze","crawls","coveted","couple's","couldn","corresponding","correcting","corkmaster","copperfield","cooties","coopers","cooperated","controller","contraption","consumes","constituents","conspire","consenting","consented","conquers","congeniality","computerized","compute","completes","complains","communicator","communal","commits","commendable","colonels","collide","coladas","colada","clout","clooney","classmate","classifieds","clammy","claire's","civility","cirrhosis","chink","chemically","characterize","censor","catskills","cath","caterpillar","catalyst","carvers","carts","carpool","carelessness","career's","cardio","carbs","captivity","capeside's","capades","butabi","busmalis","bushel","burping","buren","burdens","bunks","buncha","bulldozers","browse","brockovich","bria","breezy","breeds","breakthroughs","bravado","brandy's","bracket","boogety","bolshevik","blossoms","bloomington","blooming","bloodsucker","blockade","blight","blacksmith","betterton","betrayer","bestseller","bennigan's","belittle","beeps","bawling","barts","bartending","barbed","bankbooks","back's","babs","babish","authors","authenticity","atropine","astronomical","assertive","arterial","armbrust","armageddon","aristotle","arches","anyanka","annoyance","anemic","anck","anago","ali's","algiers","airways","airwaves","air's","aimlessly","ails","ahab","afflicted","adverse","adhere","accuracy","aaargh","aaand","zest","yoghurt","yeast","wyndham's","writings","writhing","woven","workable","winking","winded","widen","whooping","whiter","whip's","whatya","whacko","we's","wazoo","wasp","waived","vlad","virile","vino","vic's","veterinary","vests","vestibule","versed","venetian","vaughn's","vanishes","vacancies","urkel","upwards","uproot","unwarranted","unscheduled","unparalleled","undertaking","undergrad","tweedle","turtleneck","turban","trickery","travolta","transylvania","transponder","toyed","townhouse","tonto","toed","tion","tier","thyself","thunderstorm","thnk","thinning","thinkers","theatres","thawed","tether","tempus","telegraph","technicalities","tau'ri","tarp","tarnished","tara's","taggert's","taffeta","tada","tacked","systolic","symbolize","swerve","sweepstakes","swami","swabs","suspenders","surfers","superwoman","sunsets","sumo","summertime","succulent","successes","subpoenas","stumper","stosh","stomachache","stewed","steppin","stepatech","stateside","starvation","staff's","squads","spicoli","spic","sparing","soulless","soul's","sonnets","sockets","snit","sneaker","snatching","smothering","slush","sloman","slashing","sitters","simpson's","simpleton","signify","signal's","sighs","sidra","sideshow","sickens","shunned","shrunken","showbiz","shopped","shootings","shimmering","shakespeare's","shagging","seventeenth","semblance","segue","sedation","scuzzlebutt","scumbags","scribble","screwin","scoundrels","scarsdale","scamp","scabs","saucers","sanctioned","saintly","saddened","runaways","runaround","rumored","rudimentary","rubies","rsvp","rots","roman's","ripley's","rheya","revived","residing","resenting","researcher","repertoire","rehashing","rehabilitated","regrettable","regimental","refreshed","reese's","redial","reconnecting","rebirth","ravenous","raping","ralph's","railroads","rafting","rache","quandary","pylea","putrid","punitive","puffing","psychopathic","prunes","protests","protestant","prosecutors","proportional","progressed","prod","probate","prince's","primate","predicting","prayin","practitioner","possessing","pomegranate","polgara","plummeting","planners","planing","plaintiffs","plagues","pitt's","pithy","photographer's","philharmonic","petrol","perversion","personals","perpetrators","perm","peripheral","periodic","perfecto","perched","pees","peeps","pedigree","peckish","pavarotti","partnered","palette","pajama","packin","pacifier","oyez","overstepping","outpatient","optimum","okama","obstetrician","nutso","nuance","noun","noting","normalcy","normal's","nonnegotiable","nomak","nobleman","ninny","nines","nicey","newsflash","nevermore","neutered","nether","nephew's","negligee","necrosis","nebula","navigating","narcissistic","namesake","mylie","muses","munitions","motivational","momento","moisturizer","moderation","mmph","misinformed","misconception","minnifield","mikkos","methodical","mechanisms","mebbe","meager","maybes","matchmaking","masry","markovic","manifesto","malakai","madagascar","m'am","luzhin","lusting","lumberjack","louvre","loopholes","loaning","lightening","liberals","lesbo","leotard","leafs","leader's","layman's","launder","lamaze","kubla","kneeling","kilo","kibosh","kelp","keith's","jumpsuit","joy's","jovi","joliet","jogger","janover","jakovasaurs","irreparable","intervened","inspectors","innovation","innocently","inigo","infomercial","inexplicable","indispensable","indicative","incognito","impregnated","impossibly","imperfect","immaculate","imitating","illnesses","icarus","hunches","hummus","humidity","housewives","houmfort","hothead","hostiles","hooves","hoopla","hooligans","homos","homie","hisself","himalayas","hidy","hickory","heyyy","hesitant","hangout","handsomest","handouts","haitian","hairless","gwennie","guzzling","guinevere","grungy","grunge","grenada","gout","gordon's","goading","gliders","glaring","geology","gems","gavel","garments","gardino","gannon's","gangrene","gaff","gabrielle's","fundraising","fruitful","friendlier","frequencies","freckle","freakish","forthright","forearm","footnote","footer","foot's","flops","flamenco","fixer","firm's","firecracker","finito","figgered","fezzik","favourites","fastened","farfetched","fanciful","familiarize","faire","failsafe","fahrenheit","fabrication","extravaganza","extracted","expulsion","exploratory","exploitation","explanatory","exclusion","evolutionary","everglades","evenly","eunuch","estas","escapade","erasers","entries","enforcing","endorsements","enabling","emptying","emperor's","emblem","embarassing","ecosystem","ebby","ebay","dweeb","dutiful","dumplings","drilled","drafty","doug's","dolt","dollhouse","displaced","dismissing","disgraced","discrepancies","disbelief","disagreeing","disagreed","digestion","didnt","deviled","deviated","deterioration","departmental","departing","demoted","demerol","delectable","deco","decaying","decadent","dears","daze","dateless","d'algout","cultured","cultivating","cryto","crusades","crumpled","crumbled","cronies","critters","crew's","crease","craves","cozying","cortland","corduroy","cook's","consumers","congratulated","conflicting","confidante","condensed","concessions","compressor","compressions","compression","complicating","complexity","compadre","communicated","coerce","coding","coating","coarse","clown's","clockwise","clerk's","classier","clandestine","chums","chumash","christopher's","choreography","choirs","chivalrous","chinpoko","chilean","chihuahua","cheerio","charred","chafing","celibacy","casts","caste","cashier's","carted","carryin","carpeting","carp","carotid","cannibals","candor","caen","cab's","butterscotch","busts","busier","bullcrap","buggin","budding","brookside","brodski","bristow's","brig","bridesmaid's","brassiere","brainwash","brainiac","botrelle","boatload","blimey","blaring","blackness","bipolar","bipartisan","bins","bimbos","bigamist","biebe","biding","betrayals","bestow","bellerophon","beefy","bedpans","battleship","bathroom's","bassinet","basking","basin","barzini","barnyard","barfed","barbarian","bandit","balances","baker's","backups","avid","augh","audited","attribute","attitudes","at's","astor","asteroids","assortment","associations","asinine","asalaam","arouse","architects","aqua","applejack","apparatus","antiquities","annoys","angela's","anew","anchovies","anchors","analysts","ampule","alphabetically","aloe","allure","alameida","aisles","airfield","ahah","aggressively","aggravate","aftermath","affiliation","aesthetic","advertised","advancing","adept","adage","accomplices","accessing","academics","aagh","zoned","zoey's","zeal","yokel","y'ever","wynant's","wringer","witwer","withdrew","withdrawing","withdrawals","windward","wimbledon","wily","willfully","whorfin","whimsical","whimpering","welding","weddin","weathered","wealthiest","weakening","warmest","wanton","waif","volant","vivo","vive","visceral","vindication","vikram","vigorously","verification","veggies","urinate","uproar","upload","unwritten","unwrap","unsung","unsubstantiated","unspeakably","unscrupulous","unraveling","unquote","unqualified","unfulfilled","undetectable","underlined","unconstitutional","unattainable","unappreciated","ummmm","ulcers","tylenol","tweak","tutu","turnin","turk's","tucker's","tuatha","tropez","trends","trellis","traffic's","torque","toppings","tootin","toodles","toodle","tivo","tinkering","thursday's","thrives","thorne's","thespis","thereafter","theatrics","thatherton","texts","testicle","terr","tempers","teammates","taxpayer","tavington","tampon","tackling","systematic","syndicated","synagogue","swelled","sweeney's","sutures","sustenance","surfaces","superstars","sunflowers","sumatra","sublet","subjective","stubbins","strutting","strewn","streams","stowaway","stoic","sternin","stereotypes","steadily","star's","stalker's","stabilizing","sprang","spotter","spiraling","spinster","spell's","speedometer","specified","speakeasy","sparked","soooo","songwriter","soiled","sneakin","smithereens","smelt","smacks","sloan's","slaughterhouse","slang","slacks","skids","sketching","skateboards","sizzling","sixes","sirree","simplistic","sift","side's","shouts","shorted","shoelace","sheeit","shaw's","shards","shackled","sequestered","selmak","seduces","seclusion","seasonal","seamstress","seabeas","scry","scripted","scotia","scoops","scooped","schillinger's","scavenger","saturation","satch","salaries","safety's","s'more","s'il","rudeness","rostov","romanian","romancing","robo","robert's","rioja","rifkin","rieper","revise","reunions","repugnant","replicating","replacements","repaid","renewing","remembrance","relic","relaxes","rekindle","regulate","regrettably","registering","regenerate","referenced","reels","reducing","reconstruct","reciting","reared","reappear","readin","ratting","rapes","rancho","rancher","rammed","rainstorm","railroading","queers","punxsutawney","punishes","pssst","prudy","proudest","protectors","prohibits","profiling","productivity","procrastinating","procession","proactive","priss","primaries","potomac","postmortem","pompoms","polio","poise","piping","pickups","pickings","physiology","philanthropist","phenomena","pheasant","perfectionist","peretti","people'll","peninsula","pecking","peaks","pave","patrolman","participant","paralegal","paragraphs","paparazzi","pankot","pampering","pain's","overstep","overpower","ovation","outweigh","outlawed","orion's","openness","omnipotent","oleg","okra","okie","odious","nuwanda","nurtured","niles's","newsroom","netherlands","nephews","neeson","needlepoint","necklaces","neato","nationals","muggers","muffler","mousy","mourned","mosey","morn","mormon","mopey","mongolians","moldy","moderately","modelling","misinterpret","minneapolis","minion","minibar","millenium","microfilm","metals","mendola","mended","melissande","me's","mathematician","masturbating","massacred","masbath","marler's","manipulates","manifold","malp","maimed","mailboxes","magnetism","magna","m'lord","m'honey","lymph","lunge","lull","luka","lt's","lovelier","loser's","lonigan's","lode","locally","literacy","liners","linear","lefferts","leezak","ledgers","larraby","lamborghini","laloosh","kundun","kozinski","knockoff","kissin","kiosk","khasinau's","kennedys","kellman","karlo","kaleidoscope","jumble","juggernaut","joseph's","jiminy","jesuits","jeffy","jaywalking","jailbird","itsy","irregularities","inventive","introduces","interpreter","instructing","installing","inquest","inhabit","infraction","informer","infarction","incidence","impulsively","impressing","importing","impersonated","impeach","idiocy","hyperbole","hydra","hurray","hungary","humped","huhuh","hsing","hotspot","horsepower","hordes","hoodlums","honky","hitchhiker","hind","hideously","henchmen","heaving","heathrow","heather's","heathcliff","healthcare","headgear","headboard","hazing","hawking","harem","handprint","halves","hairspray","gutiurrez","greener","grandstand","goosebumps","good's","gondola","gnaw","gnat","glitches","glide","gees","gasping","gases","garrison's","frolic","fresca","freeways","frayed","fortnight","fortitude","forgetful","forefathers","foley's","foiled","focuses","foaming","flossing","flailing","fitzgeralds","firehouse","finders","filmmakers","fiftieth","fiddler","fellah","feats","fawning","farquaad","faraway","fancied","extremists","extremes","expresses","exorcist","exhale","excel","evaluations","ethros","escalated","epilepsy","entrust","enraged","ennui","energized","endowment","encephalitis","empties","embezzling","elster","ellie's","ellen's","elixir","electrolytes","elective","elastic","edged","econ","eclectic","eagle's","duplex","dryers","drexl","dredging","drawback","drafting","don'ts","docs","dobisch","divorcee","ditches","distinguishing","distances","disrespected","disprove","disobeying","disobedience","disinfectant","discs","discoveries","dips","diplomas","dingy","digress","dignitaries","digestive","dieting","dictatorship","dictating","devoured","devise","devane's","detonators","detecting","desist","deserter","derriere","deron","derive","derivative","delegates","defects","defeats","deceptive","debilitating","deathwok","dat's","darryl's","dago","daffodils","curtsy","cursory","cuppa","cumin","cultivate","cujo","cubic","cronkite","cremation","credence","cranking","coverup","courted","countin","counselling","cornball","converting","contentment","contention","contamination","consortium","consequently","consensual","consecutive","compressed","compounds","compost","components","comparative","comparable","commenting","color's","collections","coleridge","coincidentally","cluett","cleverly","cleansed","cleanliness","clea","clare's","citizen's","chopec","chomp","cholera","chins","chime","cheswick","chessler","cheapest","chatted","cauliflower","catharsis","categories","catchin","caress","cardigan","capitalism","canopy","cana","camcorder","calorie","cackling","cabot's","bystanders","buttoned","buttering","butted","buries","burgel","bullpen","buffoon","brogna","brah","bragged","boutros","boosted","bohemian","bogeyman","boar","blurting","blurb","blowup","bloodhound","blissful","birthmark","biotech","bigot","bestest","benefited","belted","belligerent","bell's","beggin","befall","beeswax","beer's","becky's","beatnik","beaming","bazaar","bashful","barricade","banners","bangers","baja","baggoli","badness","awry","awoke","autonomy","automobiles","attica","astoria","assessing","ashram","artsy","artful","aroun","armpits","arming","arithmetic","annihilate","anise","angiogram","andre's","anaesthetic","amorous","ambiguous","ambiance","alligators","afforded","adoration","admittance","administering","adama","aclu","abydos","absorption","zonked","zhivago","zealand","zazu","youngster","yorkin","wrongfully","writin","wrappers","worrywart","woops","wonderfalls","womanly","wickedness","wichita","whoopie","wholesale","wholeheartedly","whimper","which'll","wherein","wheelchairs","what'ya","west's","wellness","welcomes","wavy","warren's","warranted","wankers","waltham","wallop","wading","wade's","wacked","vogue","virginal","vill","vets","vermouth","vermeil","verger","verbs","verbally","ventriss","veneer","vecchio's","vampira","utero","ushers","urgently","untoward","unshakable","unsettled","unruly","unrest","unmanned","unlocks","unified","ungodly","undue","undermined","undergoing","undergo","uncooperative","uncontrollably","unbeatable","twitchy","tunh","tumbler","tubs","truest","troublesome","triumphs","triplicate","tribbey","trent's","transmissions","tortures","torpedoes","torah","tongaree","tommi","tightening","thunderbolt","thunderbird","thorazine","thinly","theta","theres","testifies","terre","teenaged","technological","tearful","taxing","taldor","takashi","tach","symbolizes","symbolism","syllabus","swoops","swingin","swede","sutra","suspending","supplement","sunday's","sunburn","succumbed","subtitled","substituting","subsidiary","subdued","stuttering","stupor","stumps","strummer","strides","strategize","strangulation","stooped","stipulation","stingy","stigma","stewart's","statistic","startup","starlet","stapled","squeaks","squawking","spoilsport","splicing","spiel","spencers","specifications","spawned","spasms","spaniard","sous","softener","sodding","soapbox","snow's","smoldering","smithbauer","slogans","slicker","slasher","skittish","skepticism","simulated","similarity","silvio","signifies","signaling","sifting","sickest","sicilians","shuffling","shrivel","shortstop","sensibility","sender","seminary","selecting","segretti","seeping","securely","scurrying","scrunch","scrote","screwups","schoolteacher","schibetta's","schenkman","sawing","savin","satine","saps","sapiens","salvaging","salmonella","safeguard","sacrilege","rumpus","ruffle","rube","routing","roughing","rotted","roshman's","rondall","road's","ridding","rickshaw","rialto","rhinestone","reversible","revenues","retina","restrooms","resides","reroute","requisite","repress","replicate","repetition","removes","relationship's","regent","regatta","reflective","rednecks","redeeming","rectory","recordings","reasoned","rayed","ravell","raked","rainstorm's","raincheck","raids","raffi","racked","query","quantities","pushin","prototypes","proprietor","promotes","prometheus","promenade","projectile","progeny","profess","prodding","procure","primetime","presuming","preppy","prednisone","predecessor","potted","posttraumatic","poppies","poorhouse","pool's","polaroid","podiatrist","plucky","plowed","pledging","playroom","playhouse","play's","plait","placate","pitchfork","pissant","pinback","picketing","photographing","pharoah","petrak","petal","persecuting","perchance","penny's","pellets","peeved","peerless","payable","pauses","pathways","pathologist","pat's","parchment","papi","pagliacci","owls","overwrought","overwhelmingly","overreaction","overqualified","overheated","outward","outlines","outcasts","otherworldly","originality","organisms","opinionated","oodles","oftentimes","octane","occured","obstinate","observatory","o'er","nutritionist","nutrition","numbness","nubile","notification","notary","nooooooo","nodes","nobodies","nepotism","neighborhoods","neanderthals","musicals","mushu","murphy's","multimedia","mucus","mothering","mothballs","monogrammed","monk's","molesting","misspoke","misspelled","misconstrued","miscellaneous","miscalculated","minimums","mince","mildew","mighta","middleman","metabolic","messengers","mementos","mellowed","meditate","medicare","mayol","maximilian","mauled","massaged","marmalade","mardi","mannie","mandates","mammals","malaysia","makings","major's","maim","lundegaard","lovingly","lout","louisville","loudest","lotto","loosing","loompa","looming","longs","lodging","loathes","littlest","littering","linebacker","lifelike","li'l","legalities","lavery's","laundered","lapdog","lacerations","kopalski","knobs","knitted","kittridge","kidnaps","kerosene","katya","karras","jungles","juke","joes","jockeys","jeremy's","jefe","janeiro","jacqueline's","ithaca","irrigation","iranoff","invoices","invigorating","intestinal","interactive","integration","insolence","insincere","insectopia","inhumane","inhaling","ingrates","infrastructure","infestation","infants","individuality","indianapolis","indeterminate","indefinite","inconsistent","incomprehensible","inaugural","inadequacy","impropriety","importer","imaginations","illuminating","ignited","ignite","iggy","i'da","hysterics","hypodermic","hyperventilate","hypertension","hyperactive","humoring","hotdogs","honeymooning","honed","hoist","hoarding","hitching","hinted","hill's","hiker","hijo","hightail","highlands","hemoglobin","helo","hell'd","heinie","hanoi","hags","gush","guerrillas","growin","grog","grissom's","gregory's","grasped","grandparent","granddaughters","gouged","goblins","gleam","glades","gigantor","get'em","geriatric","geared","gawk","gawd","gatekeeper","gargoyles","gardenias","garcon","garbo","gallows","gabe's","gabby's","gabbing","futon","fulla","frightful","freshener","freedoms","fountains","fortuitous","formulas","forceps","fogged","fodder","foamy","flogging","flaun","flared","fireplaces","firefighters","fins","filtered","feverish","favell","fattest","fattening","fate's","fallow","faculties","fabricated","extraordinaire","expressly","expressive","explorers","evade","evacuating","euclid","ethanol","errant","envied","enchant","enamored","enact","embarking","election's","egocentric","eeny","dussander","dunwitty","dullest","dru's","dropout","dredged","dorsia","dormitory","doot","doornail","dongs","dogged","dodgy","do's","ditty","dishonorable","discriminating","discontinue","dings","dilly","diffuse","diets","dictation","dialysis","deteriorated","delly","delightfully","definitions","decreased","declining","deadliest","daryll","dandruff","cynthia's","cush","cruddy","croquet","crocodiles","cringe","crimp","credo","cranial","crackling","coyotes","courtside","coupling","counteroffer","counterfeiting","corrupting","corrective","copter","copping","conway's","conveyor","contusions","contusion","conspirator","consoling","connoisseur","conjecture","confetti","composure","competitor","compel","commanders","coloured","collector's","colic","coldest","coincide","coddle","cocksuckers","coax","coattails","cloned","cliff's","clerical","claustrophobia","classrooms","clamoring","civics","churn","chugga","chromosomes","christened","chopper's","chirping","chasin","characterized","chapped","chalkboard","centimeter","caymans","catheter","caspian","casings","cartilage","carlton's","card's","caprica","capelli","cannolis","cannoli","canals","campaigns","camogli","camembert","butchers","butchered","busboys","bureaucrats","bungalow","buildup","budweiser","buckled","bubbe","brownstone","bravely","brackley","bouquets","botox","boozing","boosters","bodhi","blunders","blunder","blockage","blended","blackberry","bitch's","birthplace","biocyte","biking","bike's","betrays","bestowed","bested","beryllium","beheading","beginner's","beggar","begbie","beamed","bayou","bastille","bask","barstool","barricades","baron's","barbecues","barbecued","barb's","bandwagon","bandits","ballots","ballads","backfiring","bacarra","avoidance","avenged","autopsies","austrian","aunties","attache","atrium","associating","artichoke","arrowhead","arrivals","arose","armory","appendage","apostrophe","apostles","apathy","antacid","ansel","anon","annul","annihilation","andrew's","anderson's","anastasia's","amuses","amped","amicable","amendments","amberg","alluring","allotted","alfalfa","alcoholism","airs","ailing","affinity","adversaries","admirers","adlai","adjective","acupuncture","acorn","abnormality","aaaahhhh","zooming","zippity","zipping","zeroed","yuletide","yoyodyne","yengeese","yeahhh","xena","wrinkly","wracked","wording","withered","winks","windmills","widow's","whopping","wholly","wendle","weigart","weekend's","waterworks","waterford","waterbed","watchful","wantin","wally's","wail","wagging","waal","waaah","vying","voter","ville","vertebrae","versatile","ventures","ventricle","varnish","vacuumed","uugh","utilities","uptake","updating","unreachable","unprovoked","unmistakable","unky","unfriendly","unfolding","undesirable","undertake","underpaid","uncuff","unchanged","unappealing","unabomber","ufos","tyres","typhoid","tweek's","tuxedos","tushie","turret","turds","tumnus","tude","truman's","troubadour","tropic","trinium","treaters","treads","transpired","transient","transgression","tournaments","tought","touchdowns","totem","tolstoy","thready","thins","thinners","thas","terrible's","television's","techs","teary","tattaglia","tassels","tarzana","tape's","tanking","tallahassee","tablecloths","synonymous","synchronize","symptomatic","symmetrical","sycophant","swimmingly","sweatshop","surrounds","surfboard","superpowers","sunroom","sunflower","sunblock","sugarplum","sudan","subsidies","stupidly","strumpet","streetcar","strategically","strapless","straits","stooping","stools","stifler","stems","stealthy","stalks","stairmaster","staffer","sshhh","squatting","squatters","spores","spelt","spectacularly","spaniel","soulful","sorbet","socked","society's","sociable","snubbed","snub","snorting","sniffles","snazzy","snakebite","smuggler","smorgasbord","smooching","slurping","sludge","slouch","slingshot","slicer","slaved","skimmed","skier","sisterhood","silliest","sideline","sidarthur","shrink's","shipwreck","shimmy","sheraton","shebang","sharpening","shanghaied","shakers","sendoff","scurvy","scoliosis","scaredy","scaled","scagnetti","saxophone","sawchuk","saviour","saugus","saturated","sasquatch","sandbag","saltines","s'pose","royalties","routinely","roundabout","roston","rostle","riveting","ristle","righ","rifling","revulsion","reverently","retrograde","restriction","restful","resolving","resents","rescinded","reptilian","repository","reorganize","rentals","rent's","renovating","renal","remedies","reiterate","reinvent","reinmar","reibers","reechard","recuse","recorders","record's","reconciling","recognizance","recognised","reclaiming","recitation","recieved","rebate","reacquainted","rations","rascals","raptors","railly","quintuplets","quahog","pygmies","puzzling","punctuality","psychoanalysis","psalm","prosthetic","proposes","proms","proliferation","prohibition","probie","printers","preys","pretext","preserver","preppie","prag","practise","postmaster","portrayed","pollen","polled","poachers","plummet","plumbers","pled","plannin","pitying","pitfalls","piqued","pinecrest","pinches","pillage","pigheaded","pied","physique","pessimistic","persecute","perjure","perch","percentile","pentothal","pensky","penises","peking","peini","peacetime","pazzi","pastels","partisan","parlour","parkway","parallels","paperweight","pamper","palsy","palaces","pained","overwhelm","overview","overalls","ovarian","outrank","outpouring","outhouse","outage","ouija","orbital","old's","offset","offer's","occupying","obstructed","obsessions","objectives","obeying","obese","o'riley","o'neal","o'higgins","nylon","notoriously","nosebleeds","norman's","norad","noooooooo","nononono","nonchalant","nominal","nome","nitrous","nippy","neurosis","nekhorvich","necronomicon","nativity","naquada","nano","nani","n'est","mystik","mystified","mums","mumps","multinational","muddle","mothership","moped","monumentally","monogamous","mondesi","molded","mixes","misogynistic","misinterpreting","miranda's","mindlock","mimic","midtown","microphones","mending","megaphone","meeny","medicating","meanings","meanie","masseur","maru","marshal's","markstrom","marklars","mariachi","margueritas","manifesting","maintains","mail's","maharajah","lurk","lulu's","lukewarm","loveliest","loveable","lordship","looting","lizardo","liquored","lipped","lingers","limey","limestone","lieutenants","lemkin","leisurely","laureate","lathe","latched","lars","lapping","ladle","kuala","krevlorneswath","kosygin","khakis","kenaru","keats","kath","kaitlan","justin's","julliard","juliet's","journeys","jollies","jiff","jaundice","jargon","jackals","jabot's","invoked","invisibility","interacting","instituted","insipid","innovative","inflamed","infinitely","inferiority","inexperience","indirectly","indications","incompatible","incinerated","incinerate","incidental","incendiary","incan","inbred","implicitly","implicating","impersonator","impacted","ida's","ichiro","iago","hypo","hurricanes","hunks","host's","hospice","horsing","hooded","honey's","homestead","hippopotamus","hindus","hiked","hetson","hetero","hessian","henslowe","hendler","hellstrom","hecate","headstone","hayloft","hater","hast","harold's","harbucks","handguns","hallucinate","halliwell's","haldol","hailing","haggling","hadj","gynaecologist","gumball","gulag","guilder","guaranteeing","groundskeeper","ground's","grindstone","grimoir","grievance","griddle","gribbit","greystone","graceland","gooders","goeth","glossy","glam","giddyup","gentlemanly","gels","gelatin","gazelle","gawking","gaulle","gate's","ganged","fused","fukes","fromby","frenchmen","franny","foursome","forsley","foreman's","forbids","footwork","foothold","fonz","fois","foie","floater","flinging","flicking","fittest","fistfight","fireballs","filtration","fillings","fiddling","festivals","fertilization","fennyman","felonious","felonies","feces","favoritism","fatten","fanfare","fanatics","faceman","extensions","executions","executing","excusing","excepted","examiner's","ex's","evaluating","eugh","erroneous","enzyme","envoy","entwined","entrances","ensconced","enrollment","england's","enemy's","emit","emerges","embankment","em's","ellison's","electrons","eladio","ehrlichman","easterland","dylan's","dwellers","dueling","dubbed","dribbling","drape","doze","downtrodden","doused","dosed","dorleen","dopamine","domesticated","dokie","doggone","disturbances","distort","displeased","disown","dismount","disinherited","disarmed","disapproves","disabilities","diperna","dioxide","dined","diligent","dicaprio","diameter","dialect","detonated","destitute","designate","depress","demolish","demographics","degraded","deficient","decoded","debatable","dealey","darsh","dapper","damsels","damning","daisy's","dad'll","d'oeuvre","cutter's","curlers","curie","cubed","cryo","critically","crikey","crepes","crackhead","countrymen","count's","correlation","cornfield","coppers","copilot","copier","coordinating","cooing","converge","contributor","conspiracies","consolidated","consigliere","consecrated","configuration","conducts","condoning","condemnation","communities","commoner","commies","commented","comical","combust","comas","colds","clod","clique","clay's","clawed","clamped","cici","christianity","choosy","chomping","chimps","chigorin","chianti","cheval","chet's","cheep","checkups","check's","cheaters","chase's","charted","celibate","cautiously","cautionary","castell","carpentry","caroling","carjacking","caritas","caregiver","cardiology","carb","capturing","canteen","candlesticks","candies","candidacy","canasta","calendars","cain't","caboose","buster's","burro","burnin","buon","bunking","bumming","bullwinkle","budgets","brummel","brooms","broadcasts","britt's","brews","breech","breathin","braslow","bracing","bouts","botulism","bosnia","boorish","bluenote","bloodless","blayne","blatantly","blankie","birdy","bene","beetles","bedbugs","becuase","becks","bearers","bazooka","baywatch","bavarian","baseman","bartender's","barrister","barmaid","barges","bared","baracus","banal","bambino","baltic","baku","bakes","badminton","bacon's","backpacks","authorizing","aurelius","attentions","atrocious","ativan","athame","asunder","astound","assuring","aspirins","asphyxiation","ashtrays","aryans","artistry","arnon","aren","approximate","apprehension","appraisal","applauding","anya's","anvil","antiquing","antidepressants","annoyingly","amputate","altruistic","alotta","allegation","alienation","algerian","algae","alerting","airport's","aided","agricultural","afterthought","affront","affirm","adapted","actuality","acoustics","acoustic","accumulate","accountability","abysmal","absentee","zimm","yves","yoohoo","ymca","yeller","yakushova","wuzzy","wriggle","worrier","workmen","woogyman","womanizer","windpipe","windex","windbag","willy's","willin","widening","whisking","whimsy","wendall","weeny","weensy","weasels","watery","watcha","wasteful","waski","washcloth","wartime","waaay","vowel","vouched","volkswagen","viznick","visuals","visitor's","veteran's","ventriloquist","venomous","vendors","vendettas","veils","vehicular","vayhue","vary","varies","van's","vamanos","vadimus","uuhh","upstage","uppity","upheaval","unsaid","unlocking","universally","unintentionally","undisputed","undetected","undergraduate","undergone","undecided","uncaring","unbearably","twos","tween","tuscan","turkey's","tumor's","tryout","trotting","tropics","trini","trimmings","trickier","tree's","treatin","treadstone","trashcan","transports","transistor","transcendent","tramps","toxicity","townsfolk","torturous","torrid","toothpicks","tombs","tolerable","toenail","tireless","tiptoeing","tins","tinkerbell","tink","timmay","tillinghouse","tidying","tibia","thumbing","thrusters","thrashing","thompson's","these'll","testicular","terminology","teriyaki","tenors","tenacity","tellers","telemetry","teas","tea's","tarragon","taliban","switchblade","swicker","swells","sweatshirts","swatches","swatch","swapped","suzanne's","surging","supremely","suntan","sump'n","suga","succumb","subsidize","subordinate","stumbles","stuffs","stronghold","stoppin","stipulate","stewie's","stenographer","steamroll","stds","stately","stasis","stagger","squandered","splint","splendidly","splatter","splashy","splashing","spectra's","specter","sorry's","sorcerers","soot","somewheres","somber","solvent","soldier's","soir","snuggled","snowmobile","snowball's","sniffed","snake's","snags","smugglers","smudged","smirking","smearing","slings","sleet","sleepovers","sleek","slackers","skirmish","siree","siphoning","singed","sincerest","signifying","sidney's","sickened","shuffled","shriveled","shorthanded","shittin","shish","shipwrecked","shins","shingle","sheetrock","shawshank","shamu","sha're","servitude","sequins","seinfeld's","seat's","seascape","seam","sculptor","scripture","scrapings","scoured","scoreboard","scorching","sciences","sara's","sandpaper","salvaged","saluting","salud","salamander","rugrats","ruffles","ruffled","rudolph's","router","roughnecks","rougher","rosslyn","rosses","rosco's","roost","roomy","romping","romeo's","robs","roadie","ride's","riddler","rianna's","revolutionize","revisions","reuniting","retake","retaining","restitution","restaurant's","resorts","reputed","reprimanded","replies","renovate","remnants","refute","refrigerated","reforms","reeled","reefs","reed's","redundancies","rectangle","rectal","recklessly","receding","reassignment","rearing","reapers","realms","readout","ration","raring","ramblings","racetrack","raccoons","quoi","quell","quarantined","quaker","pursuant","purr","purging","punters","pulpit","publishers","publications","psychologists","psychically","provinces","proust","protocols","prose","prophets","project's","priesthood","prevailed","premarital","pregnancies","predisposed","precautionary","poppin","pollute","pollo","podunk","plums","plaything","plateau","pixilated","pivot","pitting","piranhas","pieced","piddles","pickled","picker","photogenic","phosphorous","phases","pffft","petey's","pests","pestilence","pessimist","pesos","peruvian","perspiration","perps","penticoff","pedals","payload","passageways","pardons","paprika","paperboy","panics","pancamo","pam's","paleontologist","painting's","pacifist","ozzie","overwhelms","overstating","overseeing","overpaid","overlap","overflow","overdid","outspoken","outlive","outlaws","orthodontist","orin","orgies","oreos","ordover","ordinates","ooooooh","oooohhh","omelettes","officiate","obtuse","obits","oakwood","nymph","nutritional","nuremberg","nozzle","novocaine","notable","noooooooooo","node","nipping","nilly","nikko","nightstick","nicaragua","neurology","nelson's","negate","neatness","natured","narrowly","narcotic","narcissism","napoleon's","nana's","namun","nakatomi","murky","muchacho","mouthwash","motzah","motherfucker's","mortar","morsel","morrison's","morph","morlocks","moreover","mooch","monoxide","moloch","molest","molding","mohra","modus","modicum","mockolate","mobility","missionaries","misdemeanors","miscalculation","minorities","middies","metric","mermaids","meringue","mercilessly","merchandising","ment","meditating","me'n","mayakovsky","maximillian","martinique","marlee","markovski","marissa's","marginal","mansions","manitoba","maniacal","maneuvered","mags","magnificence","maddening","lyrical","lutze","lunged","lovelies","lou's","lorry","loosening","lookee","liver's","liva","littered","lilac","lightened","lighted","licensing","lexington","lettering","legality","launches","larvae","laredo","landings","lancelot's","laker","ladyship's","laces","kurzon","kurtzweil","kobo","knowledgeable","kinship","kind've","kimono","kenji","kembu","keanu","kazuo","kayaking","juniors","jonesing","joad","jilted","jiggling","jewelers","jewbilee","jeffrey's","jamey's","jacqnoud","jacksons","jabs","ivories","isnt","irritation","iraqis","intellectuals","insurmountable","instances","installments","innocuous","innkeeper","inna","influencing","infantery","indulged","indescribable","incorrectly","incoherent","inactive","inaccurate","improperly","impervious","impertinent","imperfections","imhotep","ideology","identifies","i'il","hymns","huts","hurdles","hunnert","humpty","huffy","hourly","horsies","horseradish","hooo","honours","honduras","hollowed","hogwash","hockley","hissing","hiromitsu","hierarchy","hidin","hereafter","helpmann","haughty","happenings","hankie","handsomely","halliwells","haklar","haise","gunsights","gunn's","grossly","grossed","grope","grocer","grits","gripping","greenpeace","granddad's","grabby","glorificus","gizzard","gilardi","gibarian","geminon","gasses","garnish","galloping","galactic","gairwyn","gail's","futterman","futility","fumigated","fruitless","friendless","freon","fraternities","franc","fractions","foxes","foregone","forego","foliage","flux","floored","flighty","fleshy","flapjacks","fizzled","fittings","fisherman's","finalist","ficus","festering","ferragamo's","federation","fatalities","farbman","familial","famed","factual","fabricate","eyghon","extricate","exchanges","exalted","evolving","eventful","esophagus","eruption","envision","entre","enterprising","entail","ensuring","enrolling","endor","emphatically","eminent","embarrasses","electroshock","electronically","electrodes","efficiently","edinburgh","ecstacy","ecological","easel","dwarves","duffle","drumsticks","drake's","downstream","downed","dollface","divas","distortion","dissent","dissection","dissected","disruptive","disposing","disparaging","disorientation","disintegrated","discounts","disarming","dictated","devoting","deviation","detective's","dessaline","deprecating","deplorable","delve","deity","degenerative","deficiencies","deduct","decomposed","deceased's","debbie's","deathly","dearie","daunting","dankova","czechoslovakia","cyclotron","cyberspace","cutbacks","cusp","culpable","cuddled","crypto","crumpets","cruises","cruisers","cruelly","crowns","crouching","cristo","crip","criminology","cranium","cramming","cowering","couric","counties","cosy","corky's","cordesh","conversational","conservatory","conklin's","conducive","conclusively","competitions","compatibility","coeur","clung","cloud's","clotting","cleanest","classify","clambake","civilizations","cited","cipher","cinematic","chlorine","chipping","china's","chimpanzee","chests","checkpoints","cheapen","chainsaws","censure","censorship","cemeteries","celebrates","ceej","cavities","catapult","cassettes","cartridge","caravaggio","carats","captivating","cancers","campuses","campbell's","calrissian","calibre","calcutta","calamity","butt's","butlers","busybody","bussing","bureau's","bunion","bundy's","bulimic","bulgaria","budging","brung","browbeat","brokerage","brokenhearted","brecher","breakdowns","braun's","bracebridge","boyhood","botanical","bonuses","boning","blowhard","bloc","blisters","blackboard","blackbird","births","birdies","bigotry","biggy","bibliography","bialy","bhamra","bethlehem","bet's","bended","belgrade","begat","bayonet","bawl","battering","baste","basquiat","barrymore","barrington's","barricaded","barometer","balsom's","balled","ballast","baited","badenweiler","backhand","aztec","axle","auschwitz","astrophysics","ascenscion","argumentative","arguably","arby's","arboretum","aramaic","appendicitis","apparition","aphrodite","anxiously","antagonistic","anomalies","anne's","angora","anecdotes","anand","anacott","amniotic","amenities","ambience","alonna","aleck","albert's","akashic","airing","ageless","afro","affiliates","advertisers","adobe","adjustable","acrobat","accommodation","accelerating","absorbing","abouts","abortions","abnormalities","aawwww","aaaaarrrrrrggghhh","zuko's","zoloft","zendi","zamboni","yuppies","yodel","y'hear","wyck","wrangle","wounding","worshippers","worker's","worf","wombosi","wittle","withstanding","wisecracks","williamsburg","wilder's","wiggly","wiggling","wierd","whittlesley","whipper","whattya","whatsamatter","whatchamacallit","whassup","whad'ya","weighted","weakling","waxy","waverly","wasps","warhol","warfarin","waponis","wampum","walled","wadn't","waco","vorash","vogler's","vizzini","visas","virtucon","viridiana","veve","vetoed","vertically","veracity","ventricular","ventilated","varicose","varcon","vandalized","vampire's","vamos","vamoose","val's","vaccinated","vacationing","usted","urinal","uppers","upkeep","unwittingly","unsigned","unsealed","unplanned","unhinged","unhand","unfathomable","unequivocally","unearthed","unbreakable","unanimously","unadvisedly","udall","tynacorp","twisty","tuxes","tussle","turati","tunic","tubing","tsavo","trussed","troublemakers","trollop","trip's","trinket","trilogy","tremors","trekkie","transsexual","transitional","transfusions","tractors","toothbrushes","toned","toke","toddlers","titan's","tita","tinted","timon","timeslot","tightened","thundering","thorpey","thoracic","this'd","thespian","therapist's","theorem","thaddius","texan","tenuous","tenths","tenement","telethon","teleprompter","technicolor","teaspoon","teammate","teacup","taunted","tattle","tardiness","taraka","tappy","tapioca","tapeworm","tanith","tandem","talons","talcum","tais","tacks","synchronized","swivel","swig","swaying","swann's","suppression","supplements","superpower","summed","summarize","sumbitch","sultry","sulfur","sues","subversive","suburbia","substantive","styrofoam","stylings","struts","strolls","strobe","streaks","strategist","stockpile","stewardesses","sterilized","sterilize","stealin","starred","stakeouts","stad","squawk","squalor","squabble","sprinkled","sportsmanship","spokes","spiritus","spectators","specialties","sparklers","spareribs","sowing","sororities","sorbonne","sonovabitch","solicit","softy","softness","softening","socialite","snuggling","snatchers","snarling","snarky","snacking","smythe's","smears","slumped","slowest","slithering","sleepers","sleazebag","slayed","slaughtering","skynet","skidded","skated","sivapathasundaram","sitter's","sitcoms","sissies","sinai","silliness","silences","sidecar","sicced","siam","shylock","shtick","shrugged","shriek","shredder","shoves","should'a","shorten","shortcake","shockingly","shirking","shelly's","shedding","shaves","shatner","sharpener","shapely","shafted","sexless","sequencing","septum","semitic","selflessness","sega","sectors","seabea","scuff","screwball","screened","scoping","scooch","scolding","scholarly","schnitzel","schemed","scalper","sayings","saws","sashimi","santy","sankara","sanest","sanatorium","sampled","samoan","salzburg","saltwater","salma","salesperson","sakulos","safehouse","sabers","rwanda","ruth's","runes","rumblings","rumbling","ruijven","roxie's","round's","ringers","rigorous","righto","rhinestones","reviving","retrieving","resorted","reneging","remodelling","reliance","relentlessly","relegated","relativity","reinforced","reigning","regurgitate","regulated","refills","referencing","reeking","reduces","recreated","reclusive","recklessness","recanted","ranges","ranchers","rallied","rafer","racy","quintet","quaking","quacks","pulses","provision","prophesied","propensity","pronunciation","programmer","profusely","procedural","problema","principals","prided","prerequisite","preferences","preceded","preached","prays","postmark","popsicles","poodles","pollyanna","policing","policeman's","polecat","polaroids","polarity","pokes","poignant","poconos","pocketful","plunging","plugging","pleeease","pleaser","platters","pitied","pinetti","piercings","phyllis's","phooey","phonies","pestering","periscope","perennial","perceptions","pentagram","pelts","patronized","parliamentary","paramour","paralyze","paraguay","parachutes","pancreatic","pales","paella","paducci","oxymoron","owatta","overpass","overgrown","overdone","overcrowded","overcompensating","overcoming","ostracized","orphaned","organise","organisation","ordinate","orbiting","optometrist","oprah's","operandi","oncology","on's","omoc","omens","okayed","oedipal","occupants","obscured","oboe","nuys","nuttier","nuptial","nunheim","noxious","nourish","notepad","notation","nordic","nitroglycerin","niki's","nightmare's","nightlife","nibblet","neuroses","neighbour's","navy's","nationally","nassau","nanosecond","nabbit","mythic","murdock's","munchkins","multiplied","multimillion","mulroney","mulch","mucous","muchas","moxie","mouth's","mountaintop","mounds","morlin","mongorians","moneymaker","moneybags","monde","mom'll","molto","mixup","mitchell's","misgivings","misery's","minerals","mindset","milo's","michalchuk","mesquite","mesmerized","merman","mensa","megan's","media's","meaty","mbwun","materialize","materialistic","mastery","masterminded","mastercard","mario's","marginally","mapuhe","manuscripts","manny's","malvern","malfunctioning","mahatma","mahal","magnify","macnamara","macinerney","machinations","macarena","macadamia","lysol","luxembourg","lurks","lumpur","luminous","lube","lovelorn","lopsided","locator","lobbying","litback","litany","linea","limousines","limo's","limes","lighters","liechtenstein","liebkind","lids","libya","levity","levelheaded","letterhead","lester's","lesabre","leron","lepers","legions","lefts","leftenant","learner's","laziness","layaway","laughlan","lascivious","laryngitis","laptops","lapsed","laos","landok","landfill","laminated","laden","ladders","labelled","kyoto","kurten","kobol","koala","knucklehead","knowed","knotted","kit's","kinsa","kiln","kickboxing","karnovsky","karat","kacl's","judiciary","judaism","journalistic","jolla","joked","jimson","jettison","jet's","jeric","jeeves","jay's","jawed","jankis","janitors","janice's","jango","jamaican","jalopy","jailbreak","jackers","jackasses","j'ai","ivig","invalidate","intoxicated","interstellar","internationally","intercepting","intercede","integrate","instructors","insinuations","insignia","inn's","inflicting","infiltrated","infertile","ineffective","indies","indie","impetuous","imperialist","impaled","immerse","immaterial","imbeciles","imam","imagines","idyllic","idolized","icebox","i'd've","hypochondriac","hyphen","hydraulic","hurtling","hurried","hunchback","hums","humid","hullo","hugger","hubby's","howard's","hostel","horsting","horned","hoooo","homies","homeboys","hollywood's","hollandaise","hoity","hijinks","heya","hesitates","herrero","herndorff","hemp","helplessly","heeyy","heathen","hearin","headband","harv","harrassment","harpies","harmonious","harcourt","harbors","hannah's","hamstring","halstrom","hahahahaha","hackett's","hacer","gunmen","guff","grumbling","grimlocks","grift","greets","grandmothers","grander","granddaughter's","gran's","grafts","governing","gordievsky","gondorff","godorsky","goddesses","glscripts","gillman's","geyser","gettysburg","geological","gentlemen's","genome","gauntlet","gaudy","gastric","gardeners","gardener's","gandolf","gale's","gainful","fuses","fukienese","fucker's","frizzy","freshness","freshening","freb","fraught","frantically","fran's","foxbooks","fortieth","forked","forfeited","forbidding","footed","foibles","flunkies","fleur","fleece","flatbed","flagship","fisted","firefight","fingerpaint","fined","filibuster","fiancee's","fhloston","ferrets","fenceline","femur","fellow's","fatigues","farmhouse","fanucci","fantastically","familiars","falafel","fabulously","eyesore","extracting","extermination","expedient","expectancy","exiles","executor","excluding","ewwww","eviscerated","eventual","evac","eucalyptus","ethnicity","erogenous","equestrian","equator","epidural","enrich","endeavors","enchante","embroidered","embarassed","embarass","embalming","emails","elude","elspeth","electrocute","electrified","eigth","eheh","eggshell","eeyy","echinacea","eases","earpiece","earlobe","dwarfs","dumpsters","dumbshit","dumbasses","duloc","duisberg","drummed","drinkers","dressy","drainage","dracula's","dorma","dolittle","doily","divvy","diverting","ditz","dissuade","disrespecting","displacement","displace","disorganized","dismantled","disgustingly","discriminate","discord","disapproving","dinero","dimwit","diligence","digitally","didja","diddy","dickless","diced","devouring","devlin's","detach","destructing","desperado","desolate","designation","derek's","deposed","dependency","dentist's","demonstrates","demerits","delirium","degrade","deevak","deemesa","deductions","deduce","debriefed","deadbeats","dazs","dateline","darndest","damnable","dalliance","daiquiri","d'agosta","cuvee's","cussing","curate","cryss","cripes","cretins","creature's","crapper","crackerjack","cower","coveting","couriers","countermission","cotswolds","cornholio","copa","convinces","convertibles","conversationalist","contributes","conspirators","consorting","consoled","conservation","consarn","confronts","conformity","confides","confidentially","confederacy","concise","competence","commited","commissioners","commiserate","commencing","comme","commandos","comforter","comeuppance","combative","comanches","colosseum","colling","collaboration","coli","coexist","coaxing","cliffside","clayton's","clauses","cia's","chuy","chutes","chucked","christian's","chokes","chinaman","childlike","childhoods","chickening","chicano","chenowith","chassis","charmingly","changin","championships","chameleon","ceos","catsup","carvings","carlotta's","captioning","capsize","cappucino","capiche","cannonball","cannibal","candlewell","cams","call's","calculation","cakewalk","cagey","caesar's","caddie","buxley","bumbling","bulky","bulgarian","bugle","buggered","brussel","brunettes","brumby","brotha","bros","bronck","brisket","bridegroom","breathing's","breakout","braveheart","braided","bowled","bowed","bovary","bordering","bookkeeper","bluster","bluh","blue's","blot","bloodline","blissfully","blarney","binds","billionaires","billiard","bide","bicycles","bicker","berrisford","bereft","berating","berate","bendy","benches","bellevue","belive","believers","belated","beikoku","beens","bedspread","bed's","bear's","bawdy","barrett's","barreling","baptize","banya","balthazar","balmoral","bakshi","bails","badgered","backstreet","backdrop","awkwardly","avoids","avocado","auras","attuned","attends","atheists","astaire","assuredly","art's","arrivederci","armaments","arises","argyle","argument's","argentine","appetit","appendectomy","appealed","apologetic","antihistamine","antigua","anesthesiologist","amulets","algonquin","alexander's","ales","albie","alarmist","aiight","agility","aforementioned","adstream","adolescents","admirably","adjectives","addison's","activists","acquaint","acids","abound","abominable","abolish","abode","abfc","aaaaaaah","zorg","zoltan","zoe's","zekes","zatunica","yama","wussy","wrcw","worded","wooed","woodrell","wiretap","windowsill","windjammer","windfall","whitey's","whitaker's","whisker","whims","whatiya","whadya","westerns","welded","weirdly","weenies","webster's","waunt","washout","wanto","waning","vitality","vineyards","victimless","vicki's","verdad","veranda","vegan","veer","vandaley","vancouver","vancomycin","valise","validated","vaguest","usefulness","upshot","uprising","upgrading","unzip","unwashed","untrained","unsuitable","unstuck","unprincipled","unmentionables","unjustly","unit's","unfolds","unemployable","uneducated","unduly","undercut","uncovering","unconsciousness","unconsciously","unbeknownst","unaffected","ubiquitous","tyndareus","tutors","turncoat","turlock","tulle","tuesday's","tryouts","truth's","trouper","triplette","trepkos","tremor","treeger","treatment's","traveller","traveler's","trapeze","traipse","tradeoff","trach","torin","tommorow","tollan","toity","timpani","tilted","thumbprint","throat's","this's","theater's","thankless","terrestrial","tenney's","tell'em","telepathy","telemarketing","telekinesis","teevee","teeming","tc's","tarred","tankers","tambourine","talentless","taki","takagi","swooped","switcheroo","swirly","sweatpants","surpassed","surgeon's","supermarkets","sunstroke","suitors","suggestive","sugarcoat","succession","subways","subterfuge","subservient","submitting","subletting","stunningly","student's","strongbox","striptease","stravanavitch","stradling","stoolie","stodgy","stocky","stimuli","stigmata","stifle","stealer","statewide","stark's","stardom","stalemate","staggered","squeezes","squatter","squarely","sprouted","spool","spirit's","spindly","spellman's","speedos","specify","specializing","spacey","soups","soundly","soulmates","somethin's","somebody'll","soliciting","solenoid","sobering","snowflakes","snowballs","snores","slung","slimming","slender","skyscrapers","skulk","skivvies","skillful","skewered","skewer","skaters","sizing","sistine","sidebar","sickos","shushing","shunt","shugga","shone","shol'va","shiv","shifter","sharply","sharpened","shareholder","shapeshifter","shadowing","shadoe","serviced","selwyn","selectman","sefelt","seared","seamen","scrounging","scribbling","scotty's","scooping","scintillating","schmoozing","schenectady","scene's","scattering","scampi","scallops","sat's","sapphires","sans","sanitarium","sanded","sanction","safes","sacrificial","rudely","roust","rosebush","rosasharn","rondell","roadhouse","riveted","rile","ricochet","rhinoceros","rewrote","reverence","revamp","retaliatory","rescues","reprimand","reportedly","replicators","replaceable","repeal","reopening","renown","remo's","remedied","rembrandt","relinquishing","relieving","rejoicing","reincarnated","reimbursed","refinement","referral","reevaluate","redundancy","redid","redefine","recreating","reconnected","recession","rebelling","reassign","rearview","reappeared","readily","rayne","ravings","ravage","ratso","rambunctious","rallying","radiologist","quiver","quiero","queef","quark","qualms","pyrotechnics","pyro","puritan","punky","pulsating","publisher's","psychosomatic","provisional","proverb","protested","proprietary","promiscuous","profanity","prisoner's","prioritize","preying","predisposition","precocious","precludes","preceding","prattling","prankster","povich","potting","postpartum","portray","porter's","porridge","polluting","pogo","plowing","plating","plankton","pistachio","pissin","pinecone","pickpocket","physicists","physicals","pesticides","peruse","pertains","personified","personalize","permitting","perjured","perished","pericles","perfecting","percentages","pepys","pepperdine","pembry","peering","peels","pedophile","patties","pathogen","passkey","parrots","paratroopers","paratrooper","paraphernalia","paralyzing","panned","pandering","paltry","palpable","painkiller","pagers","pachyderm","paced","overtaken","overstay","overestimated","overbite","outwit","outskirts","outgrow","outbid","origins","ordnance","ooze","ooops","oomph","oohhh","omni","oldie","olas","oddball","observers","obscurity","obliterate","oblique","objectionable","objected","oars","o'keefe","nygma","nyet","nouveau","notting","nothin's","noches","nnno","nitty","nighters","nigger's","niche","newsstands","newfoundland","newborns","neurosurgery","networking","nellie's","nein","neighboring","negligible","necron","nauseated","nastiest","nasedo's","narrowing","narrator","narcolepsy","napa","nala","nairobi","mutilate","muscled","murmur","mulva","multitude","multiplex","mulling","mules","mukada","muffled","mueller's","motorized","motif","mortgages","morgues","moonbeams","monogamy","mondays","mollusk","molester","molestation","molars","modifications","modeled","moans","misuse","misprint","mismatched","mirth","minnow","mindful","mimosas","millander","mikhail","mescaline","mercutio","menstrual","menage","mellowing","medicaid","mediator","medevac","meddlesome","mcgarry's","matey","massively","massacres","marky","many's","manifests","manifested","manicures","malevolent","malaysian","majoring","madmen","mache","macarthur's","macaroons","lydell","lycra","lunchroom","lunching","lozenges","lorenzo's","looped","look's","lolly","lofty","lobbyist","litigious","liquidate","linoleum","lingk","lincoln's","limitless","limitation","limber","lilacs","ligature","liftoff","lifeboats","lemmiwinks","leggo","learnin","lazarre","lawyered","landmarks","lament","lambchop","lactose","kringle","knocker","knelt","kirk's","kins","kiev","keynote","kenyon's","kenosha","kemosabe","kazi","kayak","kaon","kama","jussy","junky","joyce's","journey's","jordy","jo's","jimmies","jetson","jeriko","jean's","janet's","jakovasaur","jailed","jace","issacs","isotopes","isabela","irresponsibility","ironed","intravenous","intoxication","intermittent","insufficient","insinuated","inhibitors","inherits","inherently","ingest","ingenue","informs","influenza","inflexible","inflame","inevitability","inefficient","inedible","inducement","indignant","indictments","indentured","indefensible","inconsistencies","incomparable","incommunicado","in's","improvising","impounded","illogical","ignoramus","igneous","idlewild","hydrochloric","hydrate","hungover","humorless","humiliations","humanoid","huhh","hugest","hudson's","hoverdrone","hovel","honor's","hoagie","hmmph","hitters","hitchhike","hit's","hindenburg","hibernating","hermione","herds","henchman","helloooo","heirlooms","heaviest","heartsick","headshot","headdress","hatches","hastily","hartsfield's","harrison's","harrisburg","harebrained","hardships","hapless","hanen","handsomer","hallows","habitual","habeas","guten","gus's","gummy","guiltier","guidebook","gstaad","grunts","gruff","griss","grieved","grids","grey's","greenville","grata","granny's","gorignak","goosed","goofed","goat's","gnarly","glowed","glitz","glimpses","glancing","gilmores","gilligan's","gianelli","geraniums","georgie's","genitalia","gaydar","gart","garroway","gardenia","gangbusters","gamblers","gamble's","galls","fuddy","frumpy","frowning","frothy","fro'tak","friars","frere","freddy's","fragrances","founders","forgettin","footsie","follicles","foes","flowery","flophouse","floor's","floatin","flirts","flings","flatfoot","firefighter","fingerprinting","fingerprinted","fingering","finald","film's","fillet","file's","fianc","femoral","fellini","federated","federales","faze","fawkes","fatally","fascists","fascinates","farfel","familiarity","fambly","falsified","fait","fabricating","fables","extremist","exterminators","extensively","expectant","excusez","excrement","excercises","excavation","examinations","evian","evah","etins","esther's","esque","esophageal","equivalency","equate","equalizer","environmentally","entrees","enquire","enough's","engine's","endorsed","endearment","emulate","empathetic","embodies","emailed","eggroll","edna's","economist","ecology","eased","earmuffs","eared","dyslexic","duper","dupe","dungeons","duncan's","duesouth","drunker","drummers","druggie","dreadfully","dramatics","dragnet","dragline","dowry","downplay","downers","doritos","dominatrix","doers","docket","docile","diversify","distracts","disruption","disloyalty","disinterested","disciple","discharging","disagreeable","dirtier","diplomats","dinghy","diner's","dimwitted","dimoxinil","dimmy","dietary","didi","diatribe","dialects","diagrams","diagnostics","devonshire","devising","deviate","detriment","desertion","derp","derm","dept","depressants","depravity","dependence","denounced","deniability","demolished","delinquents","defiled","defends","defamation","deepcore","deductive","decrease","declares","declarations","decimated","decimate","deb's","deadbolt","dauthuille","dastardly","darla's","dans","daiquiris","daggers","dachau","d'ah","cymbals","customized","curved","curiouser","curdled","cupid's","cults","cucamonga","cruller","cruces","crow's","crosswalk","crossover","crinkle","crescendo","cremate","creeper","craftsman","cox's","counteract","counseled","couches","coronet","cornea","cornbread","corday","copernicus","conveyed","contrition","contracting","contested","contemptible","consultants","constructing","constipated","conqueror","connor's","conjoined","congenital","confounded","condescend","concubine","concoct","conch","concerto","conceded","compounded","compensating","comparisons","commoners","committment","commencement","commandeered","comely","coined","cognitive","codex","coddled","cockfight","cluttered","clunky","clownfish","cloaked","cliches","clenched","cleft","cleanin","cleaner's","civilised","circumcised","cimmeria","cilantro","chutzpah","chutney","chucking","chucker","chronicles","chiseled","chicka","chicago's","chattering","charting","characteristic","chaise","chair's","cervix","cereals","cayenne","carrey","carpal","carnations","caricature","cappuccinos","candy's","candied","cancer's","cameo","calluses","calisthenics","cadre","buzzsaw","bushy","burners","bundled","bum's","budington","buchanans","brock's","britons","brimming","breeders","breakaway","braids","bradley's","boycotting","bouncers","botticelli","botherin","boosting","bookkeeping","booga","bogyman","bogged","bluepoint's","bloodthirsty","blintzes","blanky","blak","biosphere","binturong","billable","bigboote","bewildered","betas","bernard's","bequeath","beirut","behoove","beheaded","beginners","beginner","befriend","beet","bedpost","bedded","bay's","baudelaires","barty","barreled","barboni","barbeque","bangin","baltus","bailout","bag's","backstabber","baccarat","awning","awaited","avenues","austen","augie","auditioned","auctions","astrology","assistant's","assassinations","aspiration","armenians","aristocrat","arguillo","archway","archaeologist","arcane","arabic","apricots","applicant","apologising","antennas","annyong","angered","andretti","anchorman","anchored","amritsar","amour","amidst","amid","americana","amenable","ambassadors","ambassador's","amazement","allspice","alannis","airliner","airfare","airbags","ahhhhhhhhh","ahhhhhhhh","ahhhhhhh","agitator","afternoon's","afghan","affirmation","affiliate","aegean","adrenal","actor's","acidosis","achy","achoo","accessorizing","accentuate","academically","abuses","abrasions","abilene","abductor","aaaahhh","zuzu","zoot","zeroing","zelner","zeldy","yo's","yevgeny","yeup","yeska","yellows","yeesh","yeahh","yamuri","yaks","wyatt's","wspr","writing's","wrestlers","wouldn't've","workmanship","woodsman","winnin","winked","wildness","widespread","whoring","whitewash","whiney","when're","wheezer","wheelman","wheelbarrow","whaling","westerburg","wegener's","weekdays","weeding","weaving","watermelons","watcher's","washboard","warmly","wards","waltzes","walt's","walkway","waged","wafting","voulez","voluptuous","vitone","vision's","villa's","vigilantes","videotaping","viciously","vices","veruca","vermeer","verifying","ventured","vaya","vaults","vases","vasculitis","varieties","vapor","valets","upriver","upholstered","upholding","unwavering","unused","untold","unsympathetic","unromantic","unrecognizable","unpredictability","unmask","unleashing","unintentional","unilaterally","unglued","unequivocal","underside","underrated","underfoot","unchecked","unbutton","unbind","unbiased","unagi","uhhhhh","turnovers","tugging","trouble's","triads","trespasses","treehorn","traviata","trappers","transplants","transforming","trannie","tramping","trainers","traders","tracheotomy","tourniquet","tooty","toothless","tomarrow","toasters","tine","tilting","thruster","thoughtfulness","thornwood","therapies","thanksgiving's","tha's","terri's","tengo","tenfold","telltale","telephoto","telephoned","telemarketer","teddy's","tearin","tastic","tastefully","tasking","taser","tamed","tallow","taketh","taillight","tadpoles","tachibana","syringes","sweated","swarthy","swagger","surrey","surges","surf's","supermodels","superhighway","sunup","sun'll","summaries","sumerian","sulu","sulphur","sullivan's","sulfa","suis","sugarless","sufficed","substituted","subside","submerged","subdue","styling","strolled","stringy","strengthens","street's","straightest","straightens","storyteller","storefront","stopper","stockpiling","stimulant","stiffed","steyne","sternum","stereotypical","stepladder","stepbrother","steers","steeple","steelheads","steakhouse","statue's","stathis","stankylecartmankennymr","standoffish","stalwart","stallions","stacy's","squirted","squeaker","squad's","spuds","spritz","sprig","sprawl","spousal","sportsman","sphincter","spenders","spearmint","spatter","sparrows","spangled","southey","soured","sonuvabitch","somethng","societies","snuffed","snowfall","snowboarding","sniffs","snafu","smokescreen","smilin","slurred","slurpee","slums","slobs","sleepwalker","sleds","slays","slayage","skydiving","sketched","skateboarding","skanks","sixed","siri","sired","siphoned","siphon","singer's","simpering","silencer","sigfried","siena","sidearm","siddons","sickie","siberian","shuteye","shuk","shuffleboard","shrubberies","shrouded","showmanship","shower's","shouldn't've","shortwave","shoplift","shooter's","shiatsu","sheriffs","shak","shafts","serendipity","serena's","sentries","sentance","sensuality","semesters","seething","sedition","secular","secretions","searing","scuttlebutt","sculpt","scowling","scouring","scorecard","schwarzenegger","schoolers","schmucks","scepters","scaly","scalps","scaling","scaffolding","sauces","sartorius","santen","sampler","salivating","salinger","sainthood","said's","saget","saddens","rygalski","rusting","rumson's","ruination","rueland","rudabaga","rubles","rowr","rottweiler","rotations","roofies","romantics","rollerblading","roldy","rob's","roadshow","rike","rickets","rible","rheza","revisiting","revisited","reverted","retrospective","retentive","resurface","restores","respite","resounding","resorting","resolutions","resists","repulse","repressing","repaying","reneged","relays","relayed","reinforce","regulator","registers","refunds","reflections","rediscover","redecorated","recruitment","reconstructive","reconstructed","recommitted","recollect","recoil","recited","receptor","receptacle","receivers","reassess","reanimation","realtors","razinin","ravaged","ratios","rationalization","ratified","ratatouille","rashum","rasczak","rarer","rapping","rancheros","rampler","rain's","railway","racehorse","quotient","quizzing","quips","question's","quartered","qualification","purring","pummeling","puede","publicized","psychedelic","proximo","proteins","protege","prospectus","pronouncing","pronoun","prolonging","program's","proficient","procreation","proclamations","prio","principled","prides","pricing","presbyterian","preoccupation","prego","preferential","predicts","precog","prattle","pounced","potshots","potpourri","portsmouth","porque","poppie's","poms","pomeranian","pomegranates","polynesian","polymer","polenta","plying","plume","plumber's","pluie","plough","plesac","playoff","playmates","planter","plantains","plaintiff's","pituitary","pisano's","pillowcase","piddle","pickers","phys","photocopied","philistine","pfeiffer's","peyton's","petitioned","persuading","perpetuate","perpetually","periodically","perilous","pensacola","pawned","pausing","pauper","patterned","pats","patronage","passover","partition","parter","parlez","parlay","parkinson's","parades","paperwork's","pally","pairing","ovulation","overtake","overstate","overpowering","overpowered","overconfident","overbooked","ovaltine","ouzo","outweighs","outings","outfit's","out's","ottos","orrin","originate","orifice","orangutan","optimal","optics","opportunistic","ooww","oopsy","ooooooooh","ooohhhh","onyx","onslaught","oldsmobile","ocular","ocean's","obstruct","obscenely","o'dwyer","o'brien's","nutjob","nunur","notifying","nostrand","nonny","nonfat","noblest","nimble","nikes","nicht","newsworthy","network's","nestled","nessie","necessities","nearsighted","ne'er","nazareth","navidad","nastier","nasa's","narco","nakedness","muted","mummified","multiplying","mudda","mtv's","mozzarella","moxica","motorists","motivator","motility","mothafucka","mortmain","mortgaged","mortally","moroccan","mores","moonshine","mongers","moe's","modify","mobster's","mobilization","mobbed","mitigating","mistah","misrepresented","mishke","misfortunes","misdirection","mischievous","mirrored","mineshaft","mimosa","millers","millaney","miho","midday","microwaves","mick's","metzenbaum","metres","merc","mentoring","medicine's","mccovey","maya's","mau's","masterful","masochistic","martie","marliston","market's","marijawana","marie's","marian's","manya","manuals","mantumbi","mannheim","mania","mane","mami's","malarkey","magnifique","magics","magician's","madrona","madox","madison's","machida","m'mm","m'hm","m'hidi","lyric","luxe","luther's","lusty","lullabies","loveliness","lotions","looka","lompoc","loader","litterbug","litigator","lithe","liquorice","lins","linguistics","linds","limericks","lightbulb","lewises","letch","lemec","lecter's","leavenworth","leasing","leases","layover","layered","lavatory","laurels","launchers","laude","latvian","lateness","lasky's","laparotomy","landlord's","laboring","la's","kumquat","kuato","kroff","krispy","kree","krauts","kona","knuckleheads","knighthood","kiva","kitschy","kippers","kip's","kimbrow","kike","keypad","keepsake","kebab","keane's","kazakhstan","karloff","justices","junket","juicer","judy's","judgemental","jsut","jointed","jogs","jezzie","jetting","jekyll","jehovah's","jeff's","jeeze","jeeter","jeesus","jeebs","janeane","jalapeno","jails","jailbait","jagged","jackin","jackhammer","jacket's","ixnay","ivanovich","issue's","isotope","island's","irritates","irritability","irrevocable","irrefutable","irma's","irked","invoking","intricacies","interferon","intents","inte","insubordinate","instructive","instinctive","inspector's","inserting","inscribed","inquisitive","inlay","injuns","inhibited","infringement","information's","infer","inebriated","indignity","indecisive","incisors","incacha","inauguration","inalienable","impresses","impregnate","impregnable","implosion","immersed","ikea","idolizes","ideological","idealism","icepick","hypothyroidism","hypoglycemic","hyde's","hutz","huseni","humvee","hummingbird","hugely","huddling","housekeeper's","honing","hobnobbing","hobnob","histrionics","histamine","hirohito","hippocratic","hindquarters","hinder","himalayan","hikita","hikes","hightailed","hieroglyphics","heyy","heuh","heretofore","herbalist","her's","henryk","henceforth","hehey","hedriks","heartstrings","headmistress","headlight","harvested","hardheaded","happend","handlers","handlebars","hagitha","habla","gyroscope","guys'd","guy'd","guttersnipe","grump","growed","grovelling","grooves","groan","greenbacks","greats","gravedigger","grating","grasshoppers","grappling","graph","granger's","grandiose","grandest","gram's","grains","grafted","gradual","grabthar's","goop","gooood","goood","gooks","godsakes","goaded","gloria's","glamorama","giveth","gingham","ghostbusters","germane","georgy","geisha","gazzo","gazelles","gargle","garbled","galgenstein","galapagos","gaffe","g'day","fyarl","furnish","furies","fulfills","frowns","frowned","frommer's","frighteningly","fresco","freebies","freakshow","freakishly","fraudulent","fragrant","forewarned","foreclose","forearms","fordson","ford's","fonics","follies","foghorn","fly's","flushes","fluffy's","flitting","flintstone","flemmer","flatline","flamboyant","flabby","fishbowl","firsts","finger's","financier","figs","fidgeting","fictitious","fevers","feur","ferns","feminism","fema","feigning","faxing","fatigued","fathoms","fatherless","fares","fancier","fanatical","fairs","factored","eyelid","eyeglasses","eye's","expresso","exponentially","expletive","expectin","excruciatingly","evidentiary","ever'thing","evelyn's","eurotrash","euphoria","eugene's","eubie","ethiopian","ethiopia","estrangement","espanol","erupted","ernie's","erlich","eres","epitome","epitaph","environments","environmentalists","entrap","enthusiastically","entertainers","entangled","enclose","encased","empowering","empires","emphysema","embers","embargo","emasculating","elizabethan","elephant's","eighths","egyptians","effigy","editions","echoing","eardrum","dyslexia","duplicitous","duplicated","dumpty","dumbledore","dufus","dudley's","duddy","duck's","duchamp","drunkenness","drumlin","drowns","droid","drinky","drifts","drawbridge","dramamine","downey's","douggie","douchebag","dostoyevsky","dorian's","doodling","don'tcha","domo","domineering","doings","dogcatcher","documenting","doctoring","doctoral","dockers","divides","ditzy","dissimilar","dissecting","disparage","disliking","disintegrating","dishwalla","dishonored","dishing","disengaged","discretionary","discard","disavowed","directives","dippy","diorama","dimmed","diminishing","dilate","dijon","digitalis","diggory","dicing","diagnosing","devout","devola","developmental","deter","destiny's","desolation","descendant","derived","derevko's","deployment","dennings","denials","deliverance","deliciously","delicacies","degenerates","degas","deflector","defile","deference","defenders","deduced","decrepit","decreed","decoding","deciphered","dazed","dawdle","dauphine","daresay","dangles","dampen","damndest","customer's","curricular","cucumbers","cucaracha","cryogenically","cruella","crowd's","croaks","croaked","criticise","crit","crisper","creepiest","creep's","credit's","creams","crawford's","crackle","crackin","covertly","cover's","county's","counterintelligence","corrosive","corpsman","cordially","cops'll","convulsions","convoluted","convincingly","conversing","contradictions","conga","confucius","confrontational","confab","condolence","conditional","condition's","condiments","composing","complicit","compiled","compile","compiegne","commuter","commodus","commissions","comings","cometh","combining","colossus","collusion","collared","cockeyed","coastline","clobber","clemonds","clashes","clarithromycin","clarified","cinq","cienega","chronological","christmasy","christmassy","chloroform","chippie","childless","chested","chemistry's","cheerios","cheeco","checklist","chaz","chauvinist","char","chang's","chandlers","chamois","chambermaid","chakras","chak","censored","cemented","cellophane","celestial","celebrations","caveat","catholicism","cataloguing","cartmanland","carples","carny","carded","caramels","captors","caption","cappy","caped","canvassing","cannibalism","canada's","camille's","callback","calibrated","calamine","cal's","cabo","bypassed","buzzy","buttermilk","butterfingers","bushed","burlesque","bunsen","bung","bulimia","bukatari","buildin","budged","bronck's","brom","brobich","bringer","brine","brendell","brawling","bratty","brasi","braking","braised","brackett's","braced","boyish","boundless","botch","borough","boosh","bookies","bonbons","bois","bodes","bobunk","bluntly","blossoming","bloopers","bloomers","bloodstains","bloodhounds","blitzen","blinker","blech","blasts","blanca's","bitterly","biter","biometric","bioethics","bilk","bijan","bigoted","bicep","betrothed","bergdorf's","bereaved","bequeathed","belo","bellowing","belching","beholden","befriended","beached","bawk","battled","batmobile","batman's","baseline","baseball's","barcodes","barch","barbie's","barbecuing","bandanna","baldy","bailey's","baghdad","backwater","backtrack","backdraft","ayuh","awgh","augustino","auctioned","attaching","attaches","atrophy","atrocity","atley","athletics","atchoo","asymmetrical","asthmatic","assoc","assists","ascending","ascend","articulated","arrr","armstrong's","armchair","arisen","archeology","archeological","arachnids","aptly","applesauce","appetizing","antisocial","antagonizing","anorexia","anini","angie's","andersons","anarchist","anagram","amputation","amherst","alleluia","algorithms","albemarle","ajar","airlock","airbag","aims","aimless","ailments","agua","agonized","agitate","aggravating","affirming","aerosol","aerosmith","aeroplane","acing","accumulated","accomplishing","accolades","accidently","academia","abuser","abstain","abso","abnormally","aberration","abandons","aaww","aaaaahh","zlotys","zesty","zerzura","zapruder","zany","zantopia","yugoslavia","youo","yoru","yipe","yeow","yello","yelburton","yeess","yaah","y'knowwhati'msayin","wwhat","wussies","wrenched","would'a","worryin","wormser","wooooo","wookiee","wolfe's","wolchek","woes","wishin","wiseguys","winston's","winky","wine's","windbreaker","wiggy","wieners","wiedersehen","whoopin","whittled","whey","whet","wherefore","wharvey","welts","welt","wellstone","weee","wednesday's","wedges","wavered","watchit","wastebasket","ward's","wank","wango","wallet's","wall's","waken","waiver","waitressed","wacquiem","wabbit","vrykolaka","voula","vote's","volt","volga","volcanoes","vocals","vitally","visualizing","viscous","virgo","virg","violet's","viciousness","vewy","vespers","vertes","verily","vegetarians","vater","vaseline","varied","vaporize","vannacutt","vallens","valenti's","vacated","uterine","usta","ussher","urns","urinating","urchin","upping","upheld","unwitting","untreated","untangle","untamed","unsanitary","unraveled","unopened","unisex","uninvolved","uninteresting","unintelligible","unimaginative","undisclosed","undeserving","undermines","undergarments","unconcerned","unbroken","ukrainian","tyrants","typist","tykes","tybalt","twosome","twits","tutti","turndown","tularemia","tuberculoma","tsimshian","truffaut","truer","truant","trove","triumphed","tripe","trigonometry","trifled","trifecta","tricycle","trickle","tribulations","trevor's","tremont","tremoille","treaties","trawler","translators","transcends","trafficker","touchin","tonnage","tomfoolery","tolls","tokens","tinkered","tinfoil","tightrope","ticket's","thth","thousan","thoracotomy","theses","thesaurus","theologian","themed","thawing","thatta","thar","textiles","testimonies","tessio","terminating","temps","taxidermist","tator","tarkin","tangent","tactile","tachycardia","t'akaya","synthesize","symbolically","swelco","sweetbreads","swedes","swatting","swastika","swamps","suze","supernova","supercollider","sunbathing","summarily","suffocation","sueleen","succinct","subtitle","subsided","submissive","subjecting","subbing","subatomic","stupendous","stunted","stubble","stubbed","striving","streetwalker","strategizing","straining","straightaway","storyline","stoli","stock's","stipulated","stimulus","stiffer","stickup","stens","steamroller","steadwell","steadfast","stave","statutes","stateroom","stans","stacey's","sshhhh","squishing","squinting","squealed","sprouting","sprimp","spreadsheets","sprawled","spotlights","spooning","spoiler","spirals","spinner's","speedboat","spectacles","speakerphone","spar","spaniards","spacing","sovereignty","southglen","souse","soundproof","soothsayer","soon's","sommes","somethings","solidify","soars","snorted","snorkeling","snitches","sniping","sniper's","snifter","sniffin","snickering","sneer","snarl","smila","slinking","sleuth","slater's","slated","slanted","slanderous","slammin","skyscraper","skimp","skilosh","skeletal","skag","siteid","sirloin","singe","simulate","signaled","sighing","sidekicks","sicken","shrubs","shrub","showstopper","shot's","shostakovich","shoreline","shoppin","shoplifter","shop's","shoe's","shoal","shitter","shirt's","shimokawa","sherborne","sheds","shawna's","shavadai","sharpshooters","sharking","shane's","shakespearean","shagged","shaddup","sexism","sexes","sesterces","serotonin","sequences","sentient","sensuous","seminal","selections","seismic","seashell","seaplane","sealing","seahaven","seagrave","scuttled","scullery","scow","scots","scorcher","scorch","schotzie","schnoz","schmooze","schlep","schizo","schindler's","scents","scalping","scalped","scallop","scalding","sayeth","saybrooke","sawed","savoring","sardine","sandy's","sandstorm","sandalwood","samoa","samo","salutations","salad's","saki","sailor's","sagman","s'okay","rudy's","rsvp'd","royale","rousted","rootin","roofs","romper","romanovs","rollercoaster","rolfie","rockers","rock's","robinsons","ritzy","ritualistic","ringwald","rhymed","rheingold","rewrites","revolved","revolutionaries","revoking","reviewer","reverts","retrofit","retort","retinas","resurfaced","respirations","respectively","resolute","resin","reprobate","replaying","repayment","repaint","renquist","renege","renders","rename","remarked","relapsing","rekindled","rejuvenating","rejuvenated","reinstating","reinstatement","reigns","referendums","recriminations","recitals","rechecked","reception's","recaptured","rebounds","reassemble","rears","reamed","realty","reader's","reacquaint","rayanne","ravish","rava","rathole","raspail","rarest","rapists","rants","ramone","ragnar","radiating","radial","racketeer","quotation","quittin","quitters","quintessential","quincy's","queremos","quellek","quelle","quasimodo","quarterbacks","quarter's","pyromaniac","puttanesca","puritanical","purged","purer","puree","punishments","pungent","pummel","puedo","pudge","puce","psychotherapist","psycho's","prosecutorial","prosciutto","propositioning","propellers","pronouns","progresses","procured","procrastination","processes","probationary","primping","primates","priest's","preventative","prevails","presided","preserves","preservatives","prefix","predecessors","preachy","prancer","praetorians","practicality","powders","potus","pot's","postop","positives","poser","portolano","portokalos","poolside","poltergeists","pocketed","poach","plunder","plummeted","plucking","plop","plimpton","plethora","playthings","player's","playboys","plastique","plainclothes","pious","pinpointed","pinkus","pinks","pilgrimage","pigskin","piffle","pictionary","piccata","photocopy","phobias","persia","permissible","perils","perignon","perfumes","peon","penned","penalized","peg's","pecks","pecked","paving","patriarch","patents","patently","passable","participants","parasitic","parasailing","paramus","paramilitary","parabolic","parable","papier","paperback","paintbrush","pacer","paaiint","oxen","owen's","overtures","overthink","overstayed","overrule","overlapping","overestimate","overcooked","outlandish","outgrew","outdoorsy","outdo","outbound","ostensibly","originating","orchestrate","orally","oppress","opposable","opponent's","operation's","oooohh","oomupwah","omitted","okeydokey","okaaay","ohashi","offerings","of'em","od'd","occurrences","occupant","observable","obscenities","obligatory","oakie","o'malley's","o'gar","nyah's","nurection","nun's","nougat","nostradamus","norther","norcom","nooch","nonviolent","nonsensical","nominating","nomadic","noel's","nkay","nipped","nimbala","nigeria","nigel's","nicklaus","newscast","nervously","nell's","nehru","neckline","nebbleman","navigator","nasdaq","narwhal","nametag","n'n't","mycenae","myanmar","muzak","muumuu","murderer's","mumbled","mulvehill","multiplication","multiples","muggings","muffet","mozart's","mouthy","motorbike","motivations","motivates","motaba","mortars","mordred","mops","moocher","moniker","mongi","mondo","monday's","moley","molds","moisturize","mohair","mocky","mmkay","mistuh","missis","mission's","misdeeds","minuscule","minty","mined","mincemeat","milton's","milt","millennia","mikes","miggs","miffed","mieke's","midwestern","methadone","metaphysics","messieur","merging","mergers","menopausal","menagerie","meee","mckenna's","mcgillicuddy","mayflowers","maxim's","matrimonial","matisse","matick","masculinity","mascots","masai","marzipan","marika","maplewood","manzelle","manufactures","manticore's","mannequins","manhole","manhandle","manatee","mallory's","malfunctions","mainline","magua's","madwoman","madeline's","machiavelli","lynley","lynching","lynched","lurconis","lujack","lubricant","looove","loons","loom","loofah","longevity","lonelyhearts","lollipops","loca","llama","liquidation","lineswoman","lindsey's","lindbergh","lilith's","lila's","lifers","lichen","liberty's","lias","lexter","levee","letter's","lessen","lepner","leonard's","lemony","leggy","leafy","leaflets","leadeth","lazerus","lazare","lawford","languishing","langford's","landslide","landlords","lagoda","ladman","lad's","kuwait","kundera","krist's","krinkle","krendler","kreigel","kowolski","kosovo","knockdown","knifed","kneed","kneecap","kids'll","kevlar","kennie","keeled","kazootie","kaufman's","katzenmoyer","kasdan","karl's","karak","kapowski","kakistos","jumpers","julyan","juanito","jockstrap","jobless","jiggly","jesuit","jaunt","jarring","jabbering","israelites","irrigate","irrevocably","irrationally","ironies","ions","invitro","inventions","intrigues","intimated","interview's","intervening","interchangeable","intently","intentioned","intelligently","insulated","institutional","instill","instigator","instigated","instep","inopportune","innuendoes","inheriting","inflate","infiltration","infects","infamy","inducing","indiscretions","indiscreet","indio","indignities","indict","indecision","incurred","incubation","inconspicuous","inappropriately","impunity","impudent","improves","impotence","implicates","implausible","imperfection","impatience","immutable","immobilize","illustration","illumination","idiot's","idealized","idealist","icelandic","iambic","hysterically","hyperspace","hygienist","hydraulics","hydrated","huzzah","husks","hurricane's","hunt's","hunched","huffed","hubris","hubbub","hovercraft","houngan","hotel's","hosed","horoscopes","hoppy","hopelessness","hoodwinked","honourable","honorably","honeysuckle","homeowners","homegirl","holiest","hoisted","hoho","ho's","hippity","hildie","hikers","hieroglyphs","hexton","herein","helicopter's","heckle","heats","heartbeat's","heaping","healthilizer","headmaster's","headfirst","hawk's","haviland's","hatsue","harlot","hardwired","hanno's","hams","hamilton's","halothane","hairstyles","hails","hailed","haagen","haaaaa","gyno","gutting","gurl","gumshoe","gummi","gull","guerilla","gttk","grover's","grouping","groundless","groaning","gristle","grills","graynamore","grassy","graham's","grabbin","governmental","goodes","goggle","godlike","glittering","glint","gliding","gleaming","glassy","girth","gimbal","gilmore's","gibson's","giblets","gert","geometric","geographical","genealogy","gellers","geller's","geezers","geeze","garshaw","gargantuan","garfunkel","gardner's","garcia's","garb","gangway","gandarium","gamut","galoshes","gallivanting","galleries","gainfully","gack","gachnar","fusionlips","fusilli","furiously","fulfil","fugu","frugal","fron","friendship's","fricking","frederika","freckling","frauds","fraternal","fountainhead","forthwith","forgo","forgettable","foresight","foresaw","footnotes","fondling","fondled","fondle","folksy","fluttering","flutie","fluffing","floundering","florin","florentine","flirtatious","flexing","flatterer","flaring","fizz","fixating","five's","fishnet","firs","firestorm","finchy","figurehead","fifths","fiendish","fertilize","ferment","fending","fellahs","feeny's","feelers","feeders","fatality","fascinate","fantabulous","falsify","fallopian","faithless","fairy's","fairer","fair's","fainter","failings","facto","facets","facetious","eyepatch","exxon","extraterrestrials","extradite","extracurriculars","extinguish","expunged","exports","expenditure","expelling","exorbitant","exigent","exhilarated","exertion","exerting","exemption","excursions","excludes","excessively","excercise","exceeds","exceeding","everbody","evaporated","euthanasia","euros","europeans","escargot","escapee","erases","epizootics","epithelials","ephrum","enthusiast","entanglements","enslaved","enslave","engrossed","endeavour","enables","enabled","empowerment","employer's","emphatic","emeralds","embroiled","embraces","ember","embellished","emancipated","ello","elisa's","elevates","ejaculate","ego's","effeminate","economically","eccentricities","easygoing","earshot","durp","dunks","dunes","dullness","dulli","dulled","drumstick","dropper","driftwood","dregs","dreck","dreamboat","draggin","downsizing","dost","doofer","donowitz","dominoes","dominance","doe's","diversions","distinctions","distillery","distended","dissolving","dissipate","disraeli","disqualify","disowned","dishwashing","discusses","discontent","disclosed","disciplining","discerning","disappoints","dinged","diluted","digested","dicking","diablos","deux","detonating","destinations","despising","designer's","deserts","derelict","depressor","depose","deport","dents","demonstrations","deliberations","defused","deflection","deflecting","decryption","decoys","decoupage","decompress","decibel","decadence","dealer's","deafening","deadlock","dawning","dater","darkened","darcy's","dappy","dancing's","damon's","dallying","dagon","d'etat","czechoslovakians","cuticles","cuteness","curacao","cupboards","cumulative","culottes","culmination","culminating","csi's","cruisin","crosshairs","cronyn","croc","criminalistics","crimean","creatively","creaming","crapping","cranny","cowed","countermeasures","corsica","corinne's","corey's","cooker","convened","contradicting","continuity","constitutionally","constipation","consort","consolidate","consisted","connection's","confining","confidences","confessor","confederates","condensation","concluding","conceiving","conceivably","concealment","compulsively","complainin","complacent","compiling","compels","communing","commonplace","commode","commission's","commissary","comming","commensurate","columnists","colonoscopy","colonists","collagen","collaborate","colchicine","coddling","clump","clubbed","clowning","closet's","clones","clinton's","clinic's","cliffhanger","classification","clang","citrus","cissy","circuitry","chronology","christophe","choosers","choker","chloride","chippewa","chip's","chiffon","chesty","chesapeake","chernobyl","chants","channeled","champagne's","chalet","chaka","cervical","cellphone","cellmates","caverns","catwalk","cathartic","catcher's","cassandra's","caseload","carpenter's","carolyn's","carnivorous","carjack","carbohydrates","capt","capitalists","canvass","cantonese","canisters","candlestick","candlelit","canaries","camry","camel's","calzones","calitri","caldy","cabin's","byline","butterball","bustier","burmese","burlap","burgeoning","bureaucrat","buffoons","buenas","bryan's","brookline","bronzed","broiled","broda","briss","brioche","briar","breathable","brea","brays","brassieres","braille","brahms","braddock's","boysenberry","bowman's","bowline","boutiques","botticelli's","boooo","boonies","booklets","bookish","boogeyman","boogey","bomb's","boldly","bogs","bogas","boardinghouse","bluuch","blundering","bluffs","bluer","blowed","blotto","blotchy","blossomed","blooms","bloodwork","bloodied","blithering","blinks","blathering","blasphemous","blacking","bison","birdson","bings","bilateral","bfmid","bfast","berserker","berkshires","bequest","benjamins","benevolence","benched","benatar","belthazor's","bellybutton","belabor","bela's","behooves","beddy","beaujolais","beattle","baxworth","batted","baseless","baring","barfing","barbi","bannish","bankrolled","banek","ballsy","ballpoint","balkans","balconies","bakers","bahama","baffling","badder","badda","bada","bactine","backgammon","baako","aztreonam","aztecs","awed","avon","autobiographical","autistic","authoritah","auspicious","august's","auditing","audible","auctioning","attitude's","atrocities","athlete's","astronomer","assessed","ascot","aristocratic","arid","argues","arachtoids","arachnid","aquaman","apropos","aprons","apprised","apprehensive","apex","anythng","antivenin","antichrist","antennae","anorexic","anoint","annum","annihilated","animal's","anguished","angioplasty","angio","amply","ampicillin","amphetamines","amino","american's","ambiguity","ambient","amarillo","alyssa's","alternator","alcove","albacore","alarm's","alabaster","airlifted","ahta","agrabah","affidavits","advocacy","advises","adversely","admonished","admonish","adler's","addled","addendum","acknowledgement","accuser","accompli","acclaim","acceleration","abut","abundant","absurdity","absolved","abrusso","abreast","abrasive","aboot","abductions","abducting","abbots","aback","ababwa","aand","aaahhhh","zorin","zinthar","zinfandel","zimbabwe","zillions","zephyrs","zatarcs","zacks","youuu","youths","yokels","yech","yardstick","yammer","y'understand","wynette","wrung","wrought","wreaths","wowed","wouldn'ta","worshiped","worming","wormed","workday","wops","woolly","wooh","woodsy","woodshed","woodchuck","wojadubakowski","withering","witching","wiseass","wiretaps","winner's","wining","willoby","wiccaning","whupped","whoopi","whoomp","wholesaler","whiteness","whiner","whatchya","wharves","whah","wetlands","westward","wenus","weirdoes","weds","webs","weaver's","wearer","weaning","watusi","wastes","warlock's","warfield's","waponi","waiting's","waistband","waht","wackos","vouching","votre","voight's","voiced","vivica","viveca","vivant","vivacious","visor","visitin","visage","virgil's","violins","vinny","vinci's","villas","vigor","video's","vicrum","vibrator","vetted","versailles","vernon's","venues","ventriloquism","venison","venerable","varnsen","variant","variance","vaporized","vapid","vanstock","vandals","vader's","vaccination","uuuuh","utilize","ushering","usda","usable","urur","urologist","urination","urinary","upstart","uprooted","unsubtitled","unspoiled","unseat","unseasonably","unseal","unsatisfying","unnerve","unlikable","unleaded","university's","universe's","uninsured","uninspired","uniformity","unicycle","unhooked","ungh","unfunny","unfreezing","unflattering","unfairness","unexpressed","unending","unencumbered","unearth","undiscovered","undisciplined","undertaken","understan","undershirt","underlings","underline","undercurrent","uncontrolled","uncivilized","uncharacteristic","umpteenth","uglies","u're","tut's","turner's","turbine","tunnel's","tuney","trustee","trumps","truckasaurus","trubshaw","trouser","trippy","tringle","trifling","trickster","triangular","trespassers","trespasser","traverse","traumas","trattoria","trashes","transgressions","tranquil","trampling","trainees","tracy's","tp'ed","toxoplasmosis","tounge","tortillas","torrent","torpedoed","topsy","topple","topnotch","top's","tonsil","tippin's","tions","timmuh","timithious","tilney","tighty","tightness","tightens","tidbits","ticketed","thyme","thrones","threepio","thoughtfully","thornhart's","thorkel","thommo","thing'll","theological","thel","theh","thefts","that've","thanksgivings","tetherball","testikov","terraforming","terminus","tepid","tendonitis","tenboom","telex","teleport","telepathic","teenybopper","taxicab","taxed","taut","tattered","tattaglias","tapered","tantric","tanneke","takedown","tailspin","tacs","tacit","tablet","tablecloth","systemic","syria","syphon","synthesis","symbiotic","swooping","swizzle","swiping","swindled","swilling","swerving","sweatshops","swayzak's","swaddling","swackhammer","svetkoff","suzie's","surpass","supossed","superdad","super's","sumptuous","sula","suit's","sugary","sugar's","sugai","suey","subvert","suburb","substantiate","subsidy","submersible","sublimating","subjugation","styx","stymied","stuntman","studded","strychnine","strikingly","strenuous","streetlights","strassmans","stranglehold","strangeness","straddling","straddle","stowaways","stotch","stockbrokers","stifling","stepford","stepdad's","steerage","steena","staunch","statuary","starlets","stanza","stanley's","stagnant","staggeringly","ssshhh","squaw","spurt","spungeon","sprightly","sprays","sportswear","spoonful","splittin","splitsville","spirituality","spiny","spider's","speedily","speculative","specialise","spatial","spastic","spas","sparrin","soybean","souvlaki","southie","southampton","sourpuss","soupy","soup's","soundstage","sophie's","soothes","somebody'd","solicited","softest","sociopathic","socialized","socialism","snyders","snowmobiles","snowballed","snatches","smugness","smoothest","smashes","slurp","slur","sloshed","sleight","skyrocket","skied","skewed","sizeable","sixpence","sipowicz","singling","simulations","simulates","similarly","silvery","silverstone","siesta","siempre","sidewinder","shyness","shuvanis","showoff","shortsighted","shopkeeper","shoehorn","shithouse","shirtless","shipshape","shingles","shifu","shes","sherman's","shelve","shelbyville","sheepskin","shat","sharpens","shaquille","shaq","shanshu","shania's","set's","servings","serpico","sequined","sensibilities","seizes","seesaw","seep","seconded","sebastian's","seashells","scrapped","scrambler","scorpions","scopes","schnauzer","schmo","schizoid","scampered","scag","savagely","saudis","satire","santas","sanskrit","sandovals","sanding","sandal","salient","saleswoman","sagging","s'cuse","rutting","ruthlessly","runoff","runneth","rulers","ruffians","rubes","roughriders","rotates","rotated","roswell's","rosalita","rookies","ron's","rollerblades","rohypnol","rogues","robinson's","roasts","roadies","river's","ritten","rippling","ripples","ring's","rigor","rigoletto","richardo","ribbed","revolutions","revlon's","reverend's","retreating","retractable","rethought","retaliated","retailers","reshoot","reserving","reseda","researchers","rescuer","reread","requisitions","repute","reprogram","representations","report's","replenish","repetitive","repetitious","repentance","reorganizing","renton","renee's","remodeled","religiously","relics","reinventing","reinvented","reheat","rehabilitate","registrar","regeneration","refueling","refrigerators","refining","reenter","redress","recruiter","recliner","reciprocal","reappears","razors","rawdy","rashes","rarity","ranging","rajeski","raison","raisers","rainier","ragtime","rages","radar's","quinine","questscape","queller","quartermaine's","pyre","pygmalion","pushers","pusan","purview","purification","pumpin","puller","pubescent","psychiatrist's","prudes","provolone","protestants","prospero","propriety","propped","prom's","procrastinate","processors","processional","princely","preyed","preventive","pretrial","preside","premiums","preface","preachers","pounder","ports","portrays","portrayal","portent","populations","poorest","pooling","poofy","pontoon","pompeii","polymerization","polloi","policia","poacher","pluses","pleasuring","pleads","playgrounds","platitudes","platforms","plateaued","plate's","plantations","plaguing","pittance","pitcher's","pinky's","pinheads","pincushion","pimply","pimped","piggyback","pierce's","piecing","physiological","physician's","phosphate","phillipe","philipse","philby","phased","pharaohs","petyr","petitioner","peshtigo","pesaram","perspectives","persnickety","perpetrate","percolating","pepto","pensions","penne","penell","pemmican","peeks","pedaling","peacemaker","pawnshop","patting","pathologically","patchouli","pasts","pasties","passin","parlors","panda's","panache","paltrow","palamon","padlock","paddy's","paddling","oversleep","overheating","overdosed","overcharge","overcame","overblown","outset","outrageously","outfitted","orsini's","ornery","origami","orgasmic","orga","order's","opportune","ooow","oooooooooh","oohhhh","olympian","olfactory","okum","ohhhhhh","ogres","odysseus","odorless","occupations","occupancy","obscenity","obliterated","nyong","nymphomaniac","nutsack","numa","ntozake","novocain","nough","noth","nosh","norwegians","northstar","nonnie","nonissue","nodules","nightmarish","nightline","nighthawk","niggas","nicu","nicolae","nicknamed","niceties","newsman","neverland","negatively","needra","nedry","necking","navour","nauseam","nauls","narim","nanda","namath","nagged","nads","naboo","n'sync","mythological","mysticism","myslexia","mutator","mustafi","mussels","muskie","musketeer","murtaugh","murderess","murder's","murals","munching","mumsy","muley","mouseville","mosque","mosh","mortifying","morgendorffers","moola","montel","mongoloid","molten","molestered","moldings","mocarbies","mo'ss","mixers","misrell","misnomer","misheard","mishandled","miscreant","misconceptions","miniscule","minimalist","millie's","millgate","migrate","michelangelo's","mettle","metricconverter","methodology","meter's","meteors","mesozoic","menorah","mengele","mendy's","membranes","melding","meanness","mcneil's","mcgruff","mcarnold","matzoh","matted","mathematically","materialized","mated","masterpieces","mastectomy","massager","masons","marveling","marta's","marquee","marooned","marone's","marmaduke","marick","marcie's","manhandled","mangoes","manatees","managerial","man'll","maltin","maliciously","malfeasance","malahide","maketh","makeshift","makeovers","maiming","magazine's","machismo","maarten","lutheran","lumpectomy","lumbering","luigi's","luge","lubrication","lording","lorca","lookouts","loogie","loners","london's","loin","lodgings","locomotive","lobes","loathed","lissen","linus","lighthearted","ligament","lifetime's","lifer","lier","lido","lickin","lewen","levitation","lestercorp","lessee","lentils","lena's","lemur","lein","legislate","legalizing","lederhosen","lawmen","laundry's","lasskopf","lardner","landscapes","landfall","lambeau","lamagra","lagging","ladonn","lactic","lacquer","laborers","labatier","kwan's","krit","krabappel","kpxy","kooks","knobby","knickknacks","klutzy","kleynach","klendathu","kinross","kinko's","kinkaid","kind'a","kimberly's","kilometer","khruschev's","khaki","keyboards","kewl","ketch","kesher","ken's","karikos","karenina","kanamits","junshi","juno's","jumbled","jujitsu","judith's","jt's","joust","journeyed","jotted","jonathan's","jizz","jingling","jigalong","jerseys","jerries","jellybean","jellies","jeeps","jeannie's","javna","jamestown","james's","jamboree","jail's","islanders","irresistable","irene's","ious","investigation's","investigates","invaders","inundated","introductory","interviewer","interrupts","interpreting","interplanetary","internist","intercranial","inspections","inspecting","inseminated","inquisitor","inland","infused","infuriate","influx","inflating","infidelities","inference","inexpensive","industrialist","incessantly","inception","incensed","incase","incapacitate","inca","inasmuch","inaccuracies","imus","improvised","imploding","impeding","impediments","immaturity","ills","illegible","idols","iditarod","identifiable","id'n","icicles","ibuprofen","i'i'm","hymie","hydrolase","hybrids","hunsecker's","hunker","humps","humons","humidor","humdinger","humbling","humankind","huggin","huffing","households","housecleaning","hothouse","hotcakes","hosty","hootenanny","hootchie","hoosegow","honouring","honks","honeymooners","homophobic","homily","homeopathic","hoffman's","hnnn","hitchhikers","hissed","hispanics","hillnigger","hexavalent","hewwo","heston's","hershe","herodotus","hermey","hergott","heresy","henny","hennigans","henhouse","hemolytic","hells","helipad","heifer","hebrews","hebbing","heaved","heartland","heah","headlock","hatchback","harvard's","harrowing","harnessed","harding's","happy's","hannibal's","hangovers","handi","handbasket","handbags","halloween's","hall's","halfrek","halfback","hagrid","hacene","gyges","guys're","gut's","gundersons","gumption","guardia","gruntmaster","grubs","group's","grouch","grossie","grosser","groped","grins","grime","grigio","griff's","greaseball","gravesite","gratuity","graphite","granma","grandfathers","grandbaby","gradski","gracing","got's","gossips","goonie","gooble","goobers","goners","golitsyn","gofer","godsake","goddaughter","gnats","gluing","glub","global's","glares","gizmos","givers","ginza","gimmie","gimmee","georgia's","gennero","gazpacho","gazed","gato","gated","gassy","gargling","gandhiji","galvanized","gallery's","gallbladder","gabriel's","gaaah","furtive","furthering","fungal","fumigation","fudd","fucka","fronkonsteen","fromby's","frills","fresher","freezin","freewald","freeloader","franklin's","framework","frailty","fortified","forger","forestry","foreclosure","forbade","foray","football's","foolhardy","fondest","fomin","followin","follower","follicle","flue","flowering","flotation","flopping","floodgates","flogged","flog","flicked","flenders","fleabag","flanks","fixings","fixable","fistful","firewater","firestarter","firelight","fingerbang","finalizing","fillin","filipov","fido","fiderer","feminists","felling","feldberg","feign","favorably","fave","faunia","faun","fatale","fasting","farkus","fared","fallible","faithfulness","factoring","facilitated","fable","eyeful","extramarital","extracts","extinguished","exterminated","exposes","exporter","exponential","exhumed","exhume","exasperated","eviscerate","evidenced","evanston","estoy","estimating","esmerelda","esme","escapades","erosion","erie","equitable","epsom","epoxy","enticed","enthused","entendre","ensued","enhances","engulfed","engrossing","engraving","endorphins","enamel","emptive","empirical","emmys","emission","eminently","embody","embezzler","embarressed","embarrassingly","embalmed","emancipation","eludes","eling","elevation","electorate","elated","eirie","egotitis","effecting","eerily","eeew","eecom","editorials","edict","eczema","ecumenical","ecklie's","earthy","earlobes","eally","dyeing","dwells","dvds","duvet","duncans","dulcet","duckling","droves","droppin","drools","drey'auc","dreamers","dowser's","downriver","downgraded","doping","doodie","dominicans","dominating","domesticity","dollop","doesnt","doer","dobler","divulged","divisional","diversionary","distancing","dissolves","dissipated","displaying","dispensers","dispensation","disorienting","disneyworld","dismissive","dismantling","disingenuous","disheveled","disfiguring","discourse","discontinued","disallowed","dinning","dimming","diminutive","diligently","dilettante","dilation","diggity","diggers","dickensian","diaphragms","diagnoses","dewy","developer","devastatingly","determining","destabilize","desecrate","derives","deposing","denzel","denouncing","denominations","denominational","deniece","demony","delving","delt","delicates","deigned","degrassi's","degeneration","defraud","deflower","defibrillator","defiantly","deferred","defenceless","defacing","dedicating","deconstruction","decompose","deciphering","decibels","deceptively","deceptions","decapitation","debutantes","debonair","deadlier","dawdling","davic","databases","darwinism","darnit","darks","danke","danieljackson","dangled","daimler","cytoxan","cylinders","cutout","cutlery","cuss","cushing's","curveball","curiously","curfews","cummerbund","cuckoo's","crunches","crucifixion","crouched","croix","criterion","crisps","cripples","crilly","cribs","crewman","cretaceous","creepin","creeds","credenza","creak","crawly","crawlin","crawlers","crated","crasher","crackheads","coworker","counterpart","councillor","coun","couldn't've","cots","costanza's","cosgrove's","corwins","corset","correspondents","coriander","copiously","convenes","contraceptives","continuously","contingencies","contaminating","consul","constantinople","conniption","connie's","conk","conjugate","condiment","concurrently","concocting","conclave","concert's","con's","comprehending","compliant","complacency","compilation","competitiveness","commendatore","comedies","comedians","comebacks","combines","com'on","colonized","colonization","collided","collectively","collarbone","collaborating","collaborated","colitis","coldly","coiffure","coffers","coeds","codependent","cocksucking","cockney","cockles","clutched","cluett's","cloverleaf","closeted","cloistered","clinched","clicker","cleve","clergyman","cleats","clarifying","clapped","citations","cinnabar","cinco","chunnel","chumps","chucks","christof","cholinesterase","choirboy","chocolatey","chlamydia","chili's","chigliak","cheesie","cheeses","chechnya","chauvinistic","chasm","chartreuse","charnier","chapil","chapel's","chalked","chadway","cerveza","cerulean","certifiably","celsius","cellulite","celled","ceiling's","cavalry's","cavalcade","catty","caters","cataloging","casy","castrated","cassio","cashman's","cashews","carwash","cartouche","carnivore","carcinogens","carasco's","carano's","capulet","captives","captivated","capt'n","capsized","canoes","cannes","candidate's","cancellations","camshaft","campin","callate","callar","calendar's","calculators","cair","caffeinated","cadavers","cacophony","cackle","byproduct","bwana","buzzes","buyout","buttoning","busload","burglaries","burbs","bura","buona","bunions","bungalows","bundles","bunches","bullheaded","buffs","bucyk","buckling","bruschetta","browbeating","broomsticks","broody","bromly","brolin","brigadier","briefings","bridgeport","brewskies","breathalyzer","breakups","breadth","bratwurst","brania","branching","braiding","brags","braggin","bradywood","bozo's","bottomed","bottom's","bottling","botany","boston's","bossa","bordello","booo","bookshelf","boogida","bondsman","bolsheviks","bolder","boggles","boarder","boar's","bludgeoned","blowtorch","blotter","blips","blends","blemish","bleaching","blainetologists","blading","blabbermouth","bismarck","bishops","biscayne","birdseed","birdcage","bionic","biographies","biographical","bimmel","biloxi","biggly","bianchinni","bette's","betadine","berg's","berenson","belus","belt's","belly's","belloq","bella's","belfast","behavior's","begets","befitting","beethoven's","beepers","beelzebub","beefed","bedroom's","bedrock","bedridden","bedevere","beckons","beckett's","beauty's","beaded","baubles","bauble","battlestar","battleground","battle's","bathrobes","basketballs","basements","barroom","barnacle","barkin","barked","barium","baretta","bangles","bangler","banality","bambang","baltar","ballplayers","baio","bahrain","bagman","baffles","backstroke","backroom","bachelor's","babysat","babylonian","baboons","aviv","avez","averse","availability","augmentation","auditory","auditor","audiotape","auctioneer","atten","attained","attackers","atcha","astonishment","asshole's","assembler","arugula","arsonist's","arroz","arigato","arif","ardent","archaic","approximation","approving","appointing","apartheid","antihistamines","antarctica","annoyances","annals","annabelle's","angrily","angelou","angelo's","anesthesiology","android","anatomically","anarchists","analyse","anachronism","amiable","amex","ambivalent","amassed","amaretto","alumnus","alternating","alternates","alteration","aloft","alluding","allen's","allahu","alight","alfred's","alfie","airlift","aimin","ailment","aground","agile","ageing","afterglow","africans","affronte","affectionately","aerobic","adviser","advil","adventist","advancements","adrenals","admiral's","administrators","adjutant","adherence","adequately","additives","additions","adapting","adaptable","actualization","activating","acrost","ached","accursed","accoutrements","absconded","aboveboard","abou","abetted","abbot's","abbey's","aargh","aaaahh","zuzu's","zuwicky","zolda","zits","ziploc","zakamatak","yutz","yumm","youve","yolk","yippie","yields","yiddish","yesterdays","yella","yearns","yearnings","yearned","yawning","yalta","yahtzee","yacht's","y'mean","y'are","xand","wuthering","wreaks","woul","worsened","worrisome","workstation","workiiing","worcestershire","woop","wooooooo","wooded","wonky","womanizing","wolodarsky","wnkw","wnat","wiwith","withdraws","wishy","wisht","wipers","wiper","winos","winery","windthorne","windsurfing","windermere","wiggles","wiggled","wiggen","whys","whwhat","whuh","whos","whore's","whodunit","whoaaa","whittling","whitesnake","whirling","whereof","wheezing","wheeze","whatley's","whatd'ya","whataya","whammo","whackin","wets","westbound","wellll","wellesley","welch's","weirdo's","weightless","weevil","wedgies","webbing","weasly","weapon's","wean","wayside","waxes","wavelengths","waturi","washy","washrooms","warton's","wandell","wakeup","waitaminute","waddya","wabash","waaaah","vornac","voir","voicing","vocational","vocalist","vixens","vishnoor","viscount","virulent","virtuoso","vindictiveness","vinceres","vince's","villier","viii","vigeous","viennese","viceroy","vestigial","vernacular","venza's","ventilate","vented","venereal","vell","vegetative","veering","veered","veddy","vaslova","valosky","vailsburg","vaginas","vagas","vacation's","uuml","urethra","upstaged","uploading","upgrades","unwrapping","unwieldy","untenable","untapped","unsatisfied","unsatisfactory","unquenchable","unnerved","unmentionable","unlovable","unknowns","universes","uninformed","unimpressed","unhappily","unguarded","unexplored","underpass","undergarment","underdeveloped","undeniably","uncompromising","unclench","unclaimed","uncharacteristically","unbuttoned","unblemished","unas","umpa","ululd","uhhhm","tweeze","tutsami","tusk","tushy","tuscarora","turkle","turghan","turbulent","turbinium","tuffy","tubers","tsun","trucoat","troxa","trou","tropicana","triquetra","tripled","trimmers","triceps","tribeca","trespassed","traya","travellers","traumatizing","transvestites","transatlantic","tran's","trainors","tradin","trackers","townies","tourelles","toughness","toucha","totals","totalled","tossin","tortious","topshop","topes","tonics","tongs","tomsk","tomorrows","toiling","toddle","tobs","tizzy","tiramisu","tippers","timmi","timbre","thwap","thusly","ththe","thruway","thrusts","throwers","throwed","throughway","thrice","thomas's","thickening","thia","thermonuclear","therapy's","thelwall","thataway","th's","textile","texans","terry's","terrifically","tenets","tendons","tendon","telescopic","teleportation","telepathically","telekinetic","teetering","teaspoons","teamsters","taunts","tatoo","tarantulas","tapas","tanzania","tanned","tank's","tangling","tangerine","tamales","tallied","tailors","tai's","tahitian","tag's","tactful","tackles","tachy","tablespoon","tableau","syrah","syne","synchronicity","synch","synaptic","synapses","swooning","switchman","swimsuits","swimmer's","sweltering","swelling's","sweetly","sweeper","suvolte","suss","suslov","surname","surfed","supremacy","supposition","suppertime","supervillains","superman's","superfluous","superego","sunspots","sunnydale's","sunny's","sunning","sunless","sundress","sump","suki","suffolk","sue's","suckah","succotash","substation","subscriptions","submarines","sublevel","subbasement","styled","studious","studio's","striping","stresses","strenuously","streamlined","strains","straights","stony","stonewalled","stonehenge","stomper","stipulates","stinging","stimulated","stillness","stilettos","stewards","stevesy","steno","sten","stemmed","steenwyck","statesmen","statehood","stargates","standstill","stammering","staedert","squiggly","squiggle","squashing","squaring","spurred","sprints","spreadsheet","spramp","spotters","sporto","spooking","sponsorship","splendido","spittin","spirulina","spiky","speculations","spectral","spate","spartacus","spans","spacerun","sown","southbound","sorr","sorcery","soonest","sono","sondheim","something'll","someth","somepin","someone'll","solicitor","sofas","sodomy","sobs","soberly","sobered","soared","soapy","snowmen","snowbank","snowballing","snorkel","snivelling","sniffling","snakeskin","snagging","smush","smooter","smidgen","smackers","smackdown","slumlord","slugging","slossum","slimmer","slighted","sleepwalk","sleazeball","skokie","skirmishes","skipper's","skeptic","sitka","sitarides","sistah","sipped","sindell","simpletons","simp","simony","simba's","silkwood","silks","silken","silicone","sightless","sideboard","shuttles","shrugging","shrouds","showy","shoveled","shouldn'ta","shoplifters","shitstorm","shipyard","shielded","sheldon's","sheeny","shaven","shapetype","shankar","shaming","shallows","shale","shading","shackle","shabbily","shabbas","severus","settlements","seppuku","senility","semite","semiautomatic","semester's","selznick","secretarial","sebacio","sear","seamless","scuzzy","scummy","scud","scrutinized","scrunchie","scriptures","scribbled","scouted","scotches","scolded","scissor","schooner","schmidt's","schlub","scavenging","scarin","scarfing","scarecrow's","scant","scallions","scald","scabby","say's","savour","savored","sarcoidosis","sandbar","saluted","salted","salish","saith","sailboats","sagittarius","sagan","safeguards","sacre","saccharine","sacamano","sabe","rushdie","rumpled","rumba","rulebook","rubbers","roughage","rotterdam","roto","rotisserie","rosebuds","rootie","roosters","roosevelt's","rooney's","roofy","roofie","romanticize","roma's","rolodex","rolf's","roland's","rodney's","robotic","robin's","rittle","ristorante","rippin","rioting","rinsing","ringin","rincess","rickety","rewritten","revising","reveling","rety","retreats","retest","retaliating","resumed","restructuring","restrict","restorative","reston","restaurateur","residences","reshoots","resetting","resentments","rescuers","rerouted","reprogramming","reprisals","reprisal","repossess","repartee","renzo","renfield","remore","remitting","remeber","reliability","relaxants","rejuvenate","rejections","rehu","regularity","registrar's","regionals","regimes","regenerated","regency","refocus","referrals","reeno","reelected","redevelopment","recycles","recrimination","recombinant","reclining","recanting","recalling","reattach","reassigning","realises","reactors","reactionary","rbis","razor's","razgul","raved","rattlesnakes","rattles","rashly","raquetball","rappers","rapido","ransack","rankings","rajah","raisinettes","raheem","radisson","radishes","radically","radiance","rabbi's","raban","quoth","qumari","quints","quilts","quilting","quien","queue","quarreled","qualifying","pygmy","purty","puritans","purblind","puppy's","punctuation","punchbowl","puget","publically","psychotics","psychopaths","psychoanalyze","pruning","provasik","protruding","protracted","protons","protections","protectin","prospector","prosecutor's","propping","proportioned","prophylactic","propelled","proofed","prompting","prompter","professed","procreate","proclivities","prioritizing","prinze","princess's","pricked","press'll","presets","prescribes","preocupe","prejudicial","prefex","preconceived","precipice","preamble","pram","pralines","pragmatist","powering","powerbar","pottie","pottersville","potsie","potholes","potency","posses","posner's","posies","portkey","porterhouse","pornographers","poring","poppycock","poppet","poppers","poopsie","pomponi","pokin","poitier","poes","podiatry","plush","pleeze","pleadings","playbook","platelets","plane'arium","placebos","place'll","pj's","pixels","pitted","pistachios","pisa","pirated","pirate's","pinochle","pineapples","pinafore","pimples","piggly","piggies","pie's","piddling","picon","pickpockets","picchu","physiologically","physic","photo's","phobic","philosophies","philosophers","philly's","philandering","phenomenally","pheasants","phasing","phantoms","pewter","petticoat","petronis","petitioning","perturbed","perth","persists","persians","perpetuating","permutat","perishable","periphery","perimeters","perfumed","percocet","per'sus","pepperjack","pensioners","penalize","pelting","pellet","peignoir","pedicures","pedestrians","peckers","pecans","payback's","pay's","pawning","paulsson","pattycake","patrolmen","patrolled","patois","pathos","pasted","passer","partnerships","parp","parishioners","parishioner","parcheesi","parachuting","pappa","paperclip","papayas","paolo's","pantheon","pantaloons","panhandle","pampers","palpitations","paler","palantine","paintballing","pago","owow","overtired","overstress","oversensitive","overnights","overexcited","overanxious","overachiever","outwitted","outvoted","outnumber","outlived","outlined","outlast","outlander","outfield","out've","ortolani's","orphey","ornate","ornamental","orienteering","orchestrating","orator","oppressive","operator's","openers","opec","ooky","oliver's","olde","okies","okee","ohhhhhhhhh","ohhhhhhhh","ogling","offline","offbeat","oceanographic","obsessively","obeyed","oaths","o'leary's","o'hana","o'bannon","o'bannion","numpce","nummy","nuked","nuff","nuances","nourishing","noticeably","notably","nosedive","northeastern","norbu","nomlies","nomine","nomads","noge","nixed","niro","nihilist","nightshift","newmeat","nevis","nemo's","neighborhood's","neglectful","neediness","needin","necromancer","neck's","ncic","nathaniel's","nashua","naphthalene","nanotechnology","nanocytes","nanite","naivete","nacho","n'yeah","mystifying","myhnegon","mutating","muskrat","musing","museum's","muppets","mumbles","mulled","muggy","muerto","muckraker","muchachos","mris","move's","mourners","mountainside","moulin","mould","motherless","motherfuck","mosquitos","morphed","mopped","moodoo","montage","monsignor","moncho","monarchs","mollem","moisturiser","moil","mohicans","moderator","mocks","mobs","mizz","mites","mistresses","misspent","misinterpretation","mishka","miscarry","minuses","minotaur","minoan","mindee","mimicking","millisecond","milked","militants","migration","mightn't","mightier","mierzwiak","midwives","micronesia","microchips","microbes","michele's","mhmm","mezzanine","meyerling","meticulously","meteorite","metaphorical","mesmerizing","mershaw","meir","meg's","meecrob","medicate","medea","meddled","mckinnons","mcgewan","mcdunnough","mcats","mbien","maytag","mayors","matzah","matriarch","matic","mathematicians","masturbated","masselin","marxist","martyrs","martini's","martialed","marten's","marlboros","marksmanship","marishka","marion's","marinate","marge's","marchin","manifestations","manicured","mandela","mamma's","mame","malnourished","malk","malign","majorek","maidens","mahoney's","magnon","magnificently","maestro's","macking","machiavellian","macdougal","macchiato","macaws","macanaw","m'self","lynx","lynn's","lyman's","lydells","lusts","lures","luna's","ludwig's","lucite","lubricants","louise's","lopper","lopped","loneliest","lonelier","lomez","lojack","localized","locale","loath","lloyd's","literate","liquidated","liquefy","lippy","linguistic","limps","lillian's","likin","lightness","liesl","liebchen","licious","libris","libation","lhamo","lewis's","leveraged","leticia's","leotards","leopards","leonid","leonardo's","lemmings","leland's","legitimacy","leanin","laxatives","lavished","latka","later's","larval","lanyard","lans","lanky","landscaping","landmines","lameness","lakeshore","laddies","lackluster","lacerated","labored","laboratories","l'amour","kyrgyzstan","kreskin","krazy","kovitch","kournikova","kootchy","konoss","know's","knknow","knickety","knackety","kmart","klicks","kiwanis","kitty's","kitties","kites","kissable","kirby's","kingdoms","kindergartners","kimota","kimble's","kilter","kidnet","kidman","kid'll","kicky","kickbacks","kickback","kickass","khrushchev","kholokov","kewpie","kent's","keno","kendo","keller's","kcdm","katrina's","katra","kareoke","kaia","kafelnikov","kabob","ka's","junjun","jumba","julep","jordie","jondy","jolson","jinnah","jeweler's","jerkin","jenoff","jefferson's","jaye's","jawbone","janitorial","janiro","janie's","iron's","ipecac","invigorated","inverted","intruded","intros","intravenously","interruptus","interrogations","interracial","interpretive","internment","intermediate","intermediary","interject","interfacing","interestin","insuring","instilled","instantaneous","insistence","insensitivity","inscrutable","inroads","innards","inlaid","injector","initiatives","inhe","ingratitude","infuriates","infra","informational","infliction","infighting","induction","indonesian","indochina","indistinguishable","indicators","indian's","indelicate","incubators","incrimination","increments","inconveniencing","inconsolable","incite","incestuous","incas","incarnation","incarcerate","inbreeding","inaccessible","impudence","impressionists","implemented","impeached","impassioned","impacts","imipenem","idling","idiosyncrasies","icicle","icebreaker","icebergs","i'se","hyundai","hypotensive","hydrochloride","huuh","hushed","humus","humph","hummm","hulking","hubcaps","hubald","http","howya","howbout","how'll","houseguests","housebroken","hotwire","hotspots","hotheaded","horticulture","horrace","horde","horace's","hopsfield","honto","honkin","honeymoons","homophobia","homewrecker","hombres","hollow's","hollers","hollerin","hokkaido","hohh","hogwarts","hoedown","hoboes","hobbling","hobble","hoarse","hinky","himmler","hillcrest","hijacking","highlighters","hiccup","hibernation","hexes","heru'ur","hernias","herding","heppleman","henderson's","hell're","heine's","heighten","heheheheheh","heheheh","hedging","heckling","heckled","heavyset","heatshield","heathens","heartthrob","headpiece","headliner","he'p","hazelnut","hazards","hayseed","haveo","hauls","hattie's","hathor's","hasten","harriers","harridan","harpoons","harlin's","hardens","harcesis","harbouring","hangouts","hangman","handheld","halkein","haleh","halberstam","hairpin","hairnet","hairdressers","hacky","haah","haaaa","h'yah","gyms","gusta","gushy","gusher","gurgling","gunnery","guilted","guilt's","gruel","grudging","grrrrrr","grouse","grossing","grosses","groomsmen","griping","gretchen's","gregorian","gray's","gravest","gratified","grated","graphs","grandad","goulash","goopy","goonies","goona","goodman's","goodly","goldwater","godliness","godawful","godamn","gobs","gob's","glycerin","glutes","glowy","glop","globetrotters","glimpsed","glenville","glaucoma","girlscout","giraffes","gimp","gilbey","gil's","gigglepuss","ghora","gestating","geologists","geographically","gelato","gekko's","geishas","geek's","gearshift","gear's","gayness","gasped","gaslighting","garretts","garba","gams","gags","gablyczyck","g'head","fungi","fumigating","fumbling","fulton's","fudged","fuckwad","fuck're","fuchsia","fruition","freud's","fretting","freshest","frenchies","freezers","fredrica","fraziers","francesca's","fraidy","foxholes","fourty","fossilized","forsake","formulate","forfeits","foreword","foreclosed","foreal","foraging","footsies","focussed","focal","florists","flopped","floorshow","floorboard","flinching","flecks","flavours","flaubert","flatware","flatulence","flatlined","flashdance","flail","flagging","fizzle","fiver","fitzy","fishsticks","finster","finetti","finelli","finagle","filko","filipino","figurines","figurative","fifi","fieldstone","fibber","fiance's","feuds","feta","ferrini","female's","feedin","fedora","fect","feasting","favore","fathering","farrouhk","farmin","far's","fanny's","fajita","fairytale","fairservice","fairgrounds","fads","factoid","facet","facedown","fabled","eyeballin","extortionist","exquisitely","exporting","explicitly","expenditures","expedited","expands","exorcise","existentialist","exhaustive","execs","exculpatory","excommunicated","exacerbate","everthing","eventuality","evander","eustace","euphoric","euphemisms","eton","esto","estimation","estamos","establishes","erred","environmentalist","entrepreneurial","entitle","enquiries","enormity","engages","enfants","enen","endive","end's","encyclopedias","emulating","emts","employee's","emphasized","embossed","embittered","embassies","eliot","elicit","electrolyte","ejection","effortless","effectiveness","edvard","educators","edmonton's","ecuador","ectopic","ecirc","easely","earphones","earmarks","earmarked","earl's","dysentery","dwindling","dwight's","dweller","dusky","durslar","durned","dunois","dunking","dunked","dumdum","dullard","dudleys","duce","druthers","druggist","drug's","drossos","drosophila","drooled","driveways","drippy","dreamless","drawstring","drang","drainpipe","dragoons","dozing","down's","dour","dougie's","dotes","dorsal","dorkface","doorknobs","doohickey","donnell's","donnatella","doncha","don's","dominates","domicile","dokos","dobermans","djez","dizzying","divola","dividends","ditsy","distaste","disservice","disregarded","dispensed","dismay","dislodged","dislodge","disinherit","disinformation","discrete","discounting","disciplines","disapproved","dirtball","dinka","dimly","dilute","dilucca's","digesting","diello","diddling","dictatorships","dictators","diagonal","diagnostician","devours","devilishly","detract","detoxing","detours","detente","destructs","desecrated","descends","derris","deplore","deplete","depicts","depiction","depicted","denver's","denounce","demure","demolitions","demean","deluge","dell's","delish","deliberation","delbruck","delaford","deities","degaulle","deftly","deft","deformity","deflate","definatly","defense's","defector","deducted","decrypted","decontamination","decker's","decapitate","decanter","deadline's","dardis","danger's","dampener","damme","daddy'll","dabbling","dabbled","d'etre","d'argent","d'alene","d'agnasti","czechs","czechoslovakian","cyrillic","cymbal","cyberdyne","cutoffs","cuticle","cut's","curvaceous","curiousity","curfew's","culturally","cued","cubby","cruised","crucible","crowing","crowed","croutons","cropped","croaker","cristobel's","criminy","crested","crescentis","cred","cream's","crashers","crapola","cranwell","coverin","cousteau","courtrooms","counterattack","countenance","counselor's","cottages","cosmically","cosign","cosa","corroboration","corresponds","correspond","coroners","coro","cornflakes","corbett's","copy's","copperpot","copperhead","copacetic","coordsize","convulsing","contradicted","contract's","continuation","consults","consultations","constraints","conjures","congenial","confluence","conferring","confederation","condominium","concourse","concealer","compulsory","complexities","comparatively","compactor","commodities","commercialism","colleague's","collaborator","cokey","coiled","cognizant","cofell's","cobweb","co's","cnbc","clyde's","clunkers","clumsily","clucking","cloves","cloven","cloths","clothe","clop","clods","clocking","clings","climbers","clef","clearances","clavicle","claudia's","classless","clashing","clanking","clanging","clamping","civvies","citywide","citing","circulatory","circuited","circ","chung's","chronisters","chromic","choppy","choos","chongo","chloroformed","chilton's","chillun","chil","chicky","cheetos","cheesed","chatterbox","charlies","chaperoned","channukah","chamberlain's","chairman's","chaim","cessation","cerebellum","centred","centerpieces","centerfold","cellars","ceecee","ccedil","cavorting","cavemen","cavaliers","cauterized","caustic","cauldwell","catting","cathy's","caterine","castor's","cassiopeia","cascade's","carves","cartwheel","cartridges","carpeted","carob","carlsbad","caressing","carelessly","careening","carcinoma","capricious","capitalistic","capillaries","capes","candle's","candidly","canaan","camaraderie","calumet","callously","calligraphy","calfskin","cake's","caddies","cabinet's","buzzers","buttholes","butler's","busywork","busses","burps","burgomeister","buoy","bunny's","bunkhouse","bungchow","bulkhead","builders","bugler","buffets","buffed","buckaroo's","brutish","brusque","browser","bronchitis","bromden","brolly","brody's","broached","brewskis","brewski","brewin","brewers","brean","breadwinner","brana","brackets","bozz","bountiful","bounder","bouncin","bosoms","borgnine","bopping","bootlegs","booing","bons","boneyard","bombosity","bolting","bolivia","boilerplate","boba","bluey","blowback","blouses","bloodsuckers","bloodstained","blonde's","bloat","bleeth","blazed","blaine's","blackhawk","blackface","blackest","blackened","blacken","blackballed","blabs","blabbering","birdbrain","bipartisanship","biodegradable","binghamton","biltmore","billiards","bilked","big'uns","bidwell's","bidet","bessie's","besotted","beset","berth","bernheim","benson's","beni","benegas","bendiga","belushi","beltway","bellboys","belittling","belinda's","behinds","behemoth","begone","beeline","beehive","bedsheets","beckoning","beaute","beaudine","beastly","beachfront","be's","bauk","bathes","batak","bastion","baser","baseballs","barker's","barber's","barbella","bans","bankrolling","bangladesh","bandaged","bamba","bally's","bagpipe","bagger","baerly","backlog","backin","babying","azkaban","ayatollah","axes","awwwww","awakens","aviary","avery's","autonomic","authorizes","austero","aunty","augustine's","attics","atreus","astronomers","astounded","astonish","assertion","asserting","assailants","asha's","artemus","arses","arousal","armin","arintero","argon's","arduous","archers","archdiocese","archaeology","arbitrarily","ararat","appropriated","appraiser","applicable","apathetic","anybody'd","anxieties","anwar's","anticlimactic","antar","ankle's","anima","anglos","angleman","anesthetist","androscoggin","andromeda","andover","andolini","andale","anan","amway","amuck","amphibian","amniocentesis","amnesiac","ammonium","americano","amara","alway","alvah","alum","altruism","alternapalooza","alphabetize","alpaca","almanac","ally's","allus","alluded","allocation","alliances","allergist","alleges","alexandros","alec's","alaikum","alabam","akimbo","airy","ahab's","agoraphobia","agides","aggrhh","agatha's","aftertaste","affiliations","aegis","adoptions","adjuster","addictions","adamantium","acumen","activator","activates","acrylic","accomplishes","acclaimed","absorbs","aberrant","abbu","aarp","aaaaargh","aaaaaaaaaaaaa","a'ight","zucchini","zoos","zookeeper","zirconia","zippers","zequiel","zephyr's","zellary","zeitgeist","zanuck","zambia","zagat","ylang","yielded","yes'm","yenta","yegg","yecchh","yecch","yayo","yawp","yawns","yankin","yahdah","yaaah","y'got","xeroxed","wwooww","wristwatch","wrangled","wouldst","worthiness","wort","worshiping","worsen","wormy","wormtail","wormholes","woosh","woodworking","wonka","womens","wolverines","wollsten","wolfing","woefully","wobbling","witter's","wisp","wiry","wire's","wintry","wingding","windstorm","windowtext","wiluna","wilting","wilted","willick","willenholly","wildflowers","wildebeest","wilco","wiggum","wields","widened","whyyy","whoppers","whoaa","whizzing","whizz","whitest","whitefish","whistled","whist","whinny","whereupon","whereby","wheelies","wheaties","whazzup","whatwhatwhaaat","whato","whatdya","what'dya","whar","whacks","wexler's","wewell","wewe","wetsuit","wetland","westport","welluh","weight's","weeps","webpage","waylander","wavin","watercolors","wassail","wasnt","warships","warns","warneford","warbucks","waltons","wallbanger","waiving","waitwait","vowing","voucher","vornoff","vork","vorhees","voldemort","vivre","vittles","vishnu","vips","vindaloo","videogames","victors","vicky's","vichyssoise","vicarious","vet's","vesuvius","verve","verguenza","venturing","ventura's","venezuelan","ven't","velveteen","velour","velociraptor","vegetation","vaudeville","vastness","vasectomies","vapors","vanderhof","valmont","validates","valiantly","valerian","vacuums","vaccines","uzbekistan","usurp","usernum","us'll","urinals","unyielding","unwillingness","unvarnished","unturned","untouchables","untangled","unsecured","unscramble","unreturned","unremarkable","unregistered","unpublished","unpretentious","unopposed","unnerstand","unmade","unlicensed","unites","union's","uninhabited","unimpeachable","unilateral","unicef","unfolded","unfashionable","undisturbed","underwriting","underwrite","underlining","underling","underestimates","underappreciated","undamaged","uncouth","uncork","uncontested","uncommonly","unclog","uncircumcised","unchallenged","uncas","unbuttoning","unapproved","unamerican","unafraid","umpteen","umhmm","uhwhy","uhmm","ughuh","ughh","ufo's","typewriters","twitches","twitched","twirly","twinkling","twink","twinges","twiddling","twiddle","tutored","tutelage","turners","turnabout","ture","tunisian","tumultuous","tumour","tumblin","tryed","truckin","trubshaw's","trowel","trousseau","trivialize","trifles","tribianni","trib","triangulation","trenchcoat","trembled","traumatize","transplanted","translations","transitory","transients","transfuse","transforms","transcribing","transcend","tranq","trampy","traipsed","trainin","trail's","trafalgar","trachea","traceable","touristy","toughie","totality","totaling","toscanini","tortola","tortilla","tories","toreador","tooo","tonka","tommorrow","tollbooth","tollans","toidy","togs","togas","tofurkey","toddling","toddies","tobruk","toasties","toadstool","to've","tive","tingles","timin","timey","timetables","tightest","tide's","tibetans","thunderstorms","thuggee","thrusting","thrombus","throes","throated","thrifty","thoroughbred","thornharts","thinnest","thicket","thetas","thesulac","tethered","testimonial","testaburger","tersenadine","terrif","teresa's","terdlington","tepui","tenured","tentacle","temping","temperance","temp's","teller's","televisions","telefono","tele","teddies","tector","taxidermy","taxi's","taxation","tastebuds","tasker's","tartlets","tartabull","tard","tar'd","tantamount","tans","tangy","tangles","tamer","talmud","taiwan's","tabula","tabletops","tabithia","tabernacle","szechwan","syrian","synthedyne","synopsis","synonyms","swaps","swahili","svenjolly","svengali","suvs","sush","survivalists","surmise","surfboards","surefire","suprise","supremacists","suppositories","supervisors","superstore","supermen","supercop","supercilious","suntac","sunburned","summercliff","sullied","suite's","sugared","sufficiency","suerte","suckle","sucker's","sucka","succumbing","subtleties","substantiated","subsidiaries","subsides","subliminal","subhuman","stst","strowman","stroked","stroganoff","strikers","strengthening","streetlight","straying","strainer","straighter","straightener","storytelling","stoplight","stockade","stirrups","stink's","sting's","stimulates","stifler's","stewing","stetson's","stereotyping","ster","stepmommy","stephano","steeped","statesman","stashing","starshine","stand's","stamping","stamford","stairwells","stabilization","squatsie","squandering","squalid","squabbling","squab","sprinkling","spring's","spreader","spongy","spongebob","spokeswoman","spokesmen","splintered","spittle","spitter","spiced","spews","spendin","spect","speckled","spearchucker","spatulas","sparse","sparking","spares","spaceboy","soybeans","southtown","southside","southport","southland","soused","sotheby's","soshi","sorter","sorrowful","sorceress","sooth","songwriters","some'in","solstice","soliloquy","sods","sodomized","sode","sociologist","sobriki","soaping","snows","snowcone","snowcat","snitching","snitched","sneering","snausages","snaking","smoothed","smoochies","smolensk","smarten","smallish","slushy","slurring","sluman","slobber","slithers","slippin","sleuthing","sleeveless","slade's","skinner's","skinless","skillfully","sketchbook","skagnetti","sista","sioux","sinning","sinjin","singularly","sinewy","sinclair's","simultaneous","silverlake","silva's","siguto","signorina","signature's","signalling","sieve","sids","sidearms","shyster","shying","shunning","shtud","shrooms","shrieks","shorting","shortbread","shopkeepers","shmuck","shmancy","shizzit","shitheads","shitfaced","shitbag","shipmates","shiftless","sherpa","shelving","shelley's","sheik","shedlow","shecky","sheath","shavings","shatters","sharifa","shampoos","shallots","shafter","sha'nauc","sextant","settlers","setter","seti","serviceable","serrated","serbian","sequentially","sepsis","senores","sendin","semis","semanski","seller's","selflessly","selects","selectively","seinfelds","seers","seer's","seeps","see's","seductress","sedimentary","sediment","second's","secaucus","seater","seashore","sealant","seaborn's","scuttling","scusa","sculpting","scrunched","scrimmage","screenwriter","scotsman","scorer","sclerosis","scissorhands","schreber","scholastic","schmancy","schlong","scathing","scandinavia","scamps","scalloped","savoir","savagery","sasha's","sarong","sarnia","santangel","samool","samba","salons","sallow","salino","safecracker","sadism","saddles","sacrilegious","sabrini","sabath","s'aright","ruttheimer","russia's","rudest","rubbery","rousting","rotarian","roslin","rosey","rosa's","roomed","romari","romanticism","romanica","rolltop","rolfski","rod's","rockland","rockettes","roared","riverfront","rinpoche","ringleader","rims","riker's","riffing","ricans","ribcage","riana's","rhythmic","rhah","rewired","retroactive","retrial","reting","reticulum","resuscitated","resuming","restricting","restorations","restock","resilience","reservoirs","resembled","resale","requisitioned","reprogrammed","reproducing","repressive","replicant","repentant","repellant","repays","repainting","reorganization","renounced","renegotiating","rendez","renamed","reminiscent","remem","remade","relived","relinquishes","reliant","relearn","relaxant","rekindling","rehydrate","regulatory","regiments","regan's","refueled","refrigeration","refreshingly","reflector","refine","refilling","reexamine","reeseman","redness","redirected","redeemable","redder","redcoats","rectangles","recoup","reconstituted","reciprocated","recipients","recessed","recalls","rebounded","reassessing","realy","reality's","realisation","realer","reachin","re'kali","rawlston","ravages","rattlers","rasa","raps","rappaports","ramoray","ramming","ramadan","raindrops","rahesh","radioactivity","radials","racists","racin","rabartu","quotas","quintus","quiches","ques","queries","quench","quel","quarrels","quarreling","quaintly","quagmire","quadrants","pylon","putumayo","put'em","purifier","purified","pureed","punitis","pullout","pukin","pudgy","puddings","puckering","puccini","pterodactyl","psychodrama","pseudonym","psats","proximal","providers","protestations","protectee","prospered","prosaic","propositioned","prolific","progressively","proficiency","professions","prodigious","proclivity","probed","probabilities","pro's","prison's","printouts","principally","prig","prevision","prevailing","presumptive","pressers","preset","presentations","preposition","preparatory","preliminaries","preempt","preemie","predetermined","preconceptions","precipitate","prancan","powerpuff","powerfully","potties","potters","potpie","poseur","portraying","portico","porthole","portfolios","poops","pooping","pone","pomp","pomade","polyps","polymerized","politic","politeness","polisher","polack","pokers","pocketknife","poatia","plebeian","playgroup","platonically","plato's","platitude","platelet","plastering","plasmapheresis","plaques","plaids","placemats","place's","pizzazz","piracy","pipelines","pip's","pintauro","pinstripes","pinpoints","pinkner","pincer","pimento","pillaged","pileup","pilates","pigment","pigmen","pieter","pieeee","picturesque","piano's","phrasing","phrased","photojournalist","photocopies","phosphorus","phonograph","phoebes","phoe","philistines","philippine","philanderer","pheromone","phasers","pharaoh's","pfff","pfeffernuesse","petrov","petitions","peterman's","peso","pervs","perspire","personify","perservere","perplexed","perpetrating","perp's","perkiness","perjurer","periodontist","perfunctory","performa","perdido","percodan","penzance","pentameter","pentagon's","pentacle","pensive","pensione","pennybaker","pennbrooke","penhall","pengin","penetti","penetrates","pegs","pegnoir","peeve","peephole","pectorals","peckin","peaky","peaksville","payout","paxcow","paused","pauline's","patted","pasteur","passe","parochial","parkland","parkishoff","parkers","pardoning","paraplegic","paraphrasing","parapet","paperers","papered","panoramic","pangs","paneling","pander","pandemonium","pamela's","palooza","palmed","palmdale","palisades","palestinian","paleolithic","palatable","pakistanis","pageants","packaged","pacify","pacified","oyes","owwwww","overthrown","overt","oversexed","overriding","overrides","overpaying","overdrawn","overcompensate","overcomes","overcharged","outtakes","outmaneuver","outlying","outlining","outfoxed","ousted","oust","ouse","ould","oughtn't","ough","othe","ostentatious","oshun","oscillation","orthopedist","organizational","organization's","orca","orbits","or'derves","opting","ophthalmologist","operatic","operagirl","oozes","oooooooh","only's","onesie","omnis","omelets","oktoberfest","okeydoke","ofthe","ofher","obstetrics","obstetrical","obeys","obeah","o'rourke","o'reily's","o'henry","nyquil","nyanyanyanyah","nuttin","nutsy","nutrients","nutball","nurhachi","numbskull","nullifies","nullification","nucking","nubbin","ntnt","nourished","notoriety","northland","nonspecific","nonfiction","noing","noinch","nohoho","nobler","nitwits","nitric","nips","nibs","nibbles","newton's","newsprint","newspaperman","newspaper's","newscaster","never's","neuter","neuropathy","netherworld","nests","nerf","neee","neediest","neath","navasky","naturalization","nat's","narcissists","napped","nando","nags","nafta","myocardial","mylie's","mykonos","mutilating","mutherfucker","mutha","mutations","mutates","mutate","musn't","muskets","murray's","murchy","mulwray's","multitasking","muldoon's","mujeeb","muerte","mudslinging","muckraking","mrsa","mown","mousie","mousetrap","mourns","mournful","motivating","motherland","motherf","mostro","mosaic","morphing","morphate","mormons","moralistic","moored","moochy","mooching","monotonous","monorail","monopolize","monogram","monocle","molehill","molar","moland","mofet","modestly","mockup","moca","mobilizing","mitzvahs","mitre","mistreating","misstep","misrepresentation","misjudge","misinformation","miserables","misdirected","miscarriages","minute's","miniskirt","minimizing","mindwarped","minced","milquetoast","millimeters","miguelito","migrating","mightily","midsummer","midstream","midriff","mideast","midas","microbe","metropolis","methuselah","mesdames","mescal","mercury's","menudo","menu's","mentors","men'll","memorial's","memma","melvins","melanie's","megaton","megara","megalomaniac","meeee","medulla","medivac","mediate","meaninglessness","mcnuggets","mccarthyism","maypole","may've","mauve","maturing","matter's","mateys","mate's","mastering","masher","marxism","martimmy's","marshack","marseille","markles","marketed","marketable","mansiere","manservant","manse","manhandling","manco's","manana","maman","malnutrition","mallomars","malkovich's","malcontent","malaise","makeup's","majesties","mainsail","mailmen","mahandra","magnolias","magnified","magev","maelstrom","madcap","mack's","machu","macfarlane's","macado","ma'm","m'boy","m'appelle","lying's","lustrous","lureen","lunges","lumped","lumberyard","lulled","luego","lucks","lubricated","loveseat","loused","lounger","loski","lorre","loora","looong","loonies","lonnegan's","lola's","loire","loincloth","logistical","lofts","lodges","lodgers","lobbing","loaner","livered","lithuania","liqueur","linkage","ling's","lillienfield's","ligourin","lighter's","lifesaving","lifeguards","lifeblood","library's","liberte","liaisons","liabilities","let'em","lesbianism","lenny's","lennart","lence","lemonlyman","legz","legitimize","legalized","legalization","leadin","lazars","lazarro","layoffs","lawyering","lawson's","lawndale's","laugher","laudanum","latte's","latrines","lations","laters","lastly","lapels","lansing's","lan's","lakefront","lait","lahit","lafortunata","lachrymose","laborer","l'italien","l'il","kwaini","kuzmich","kuato's","kruczynski","kramerica","krakatoa","kowtow","kovinsky","koufax","korsekov","kopek","knoxville","knowakowski","knievel","knacks","klux","klein's","kiran","kiowas","kinshasa","kinkle's","kincaid's","killington","kidnapper's","kickoff","kickball","khan's","keyworth","keymaster","kevie","keveral","kenyons","keggers","keepsakes","kechner","keaty","kavorka","katmandu","katan's","karajan","kamerev","kamal's","kaggs","juvi","jurisdictional","jujyfruit","judeo","jostled","joni's","jonestown","jokey","joists","joint's","johnnie's","jocko","jimmied","jiggled","jig's","jests","jessy","jenzen","jensen's","jenko","jellyman","jeet","jedediah","jealitosis","jaya's","jaunty","jarmel","jankle","jagoff","jagielski","jacky","jackrabbits","jabbing","jabberjaw","izzat","iuml","isolating","irreverent","irresponsibly","irrepressible","irregularity","irredeemable","investigator's","inuvik","intuitions","intubated","introspective","intrinsically","intra","intimates","interval","intersections","interred","interned","interminable","interloper","intercostal","interchange","integer","intangible","instyle","instrumentation","instigate","instantaneously","innumerable","inns","injustices","ining","inhabits","ings","ingrown","inglewood","ingestion","ingesting","infusion","infusing","infringing","infringe","inflection","infinitum","infact","inexplicably","inequities","ineligible","industry's","induces","indubitably","indisputable","indirect","indescribably","independents","indentation","indefinable","incursion","incontrovertible","inconsequential","incompletes","incoherently","inclement","inciting","incidentals","inarticulate","inadequacies","imprudent","improvisation","improprieties","imprison","imprinted","impressively","impostors","importante","implicit","imperious","impale","immortalized","immodest","immobile","imbued","imbedded","imbecilic","illustrates","illegals","iliad","idn't","idiom","icons","hysteric","hypotenuse","hygienic","hyeah","hushpuppies","hunhh","hungarians","humpback","humored","hummed","humiliates","humidifier","huggy","huggers","huckster","html","hows","howlin","hoth","hotbed","hosing","hosers","horsehair","homegrown","homebody","homebake","holographic","holing","holies","hoisting","hogwallop","hogan's","hocks","hobbits","hoaxes","hmmmmm","hisses","hippos","hippest","hindrance","hindi","him's","hillbillies","hilarity","highball","hibiscus","heyday","heurh","hershey's","herniated","hermaphrodite","hera","hennifer","hemlines","hemline","hemery","helplessness","helmsley","hellhound","heheheheh","heey","heeey","hedda","heck's","heartbeats","heaped","healers","headstart","headsets","headlong","headlining","hawkland","havta","havana's","haulin","hastened","hasn","harvey'll","harpo","hardass","haps","hanta","hansom","hangnail","handstand","handrail","handoff","hander","han's","hamlet's","hallucinogen","hallor","halitosis","halen","hahah","hado","haberdashery","gypped","guy'll","guni","gumbel","gulch","gues","guerillas","guava","guatemalan","guardrail","guadalajara","grunther","grunick","grunemann's","growers","groppi","groomer","grodin","gris","gripes","grinds","grimaldi's","grifters","griffins","gridlock","gretch","greevey","greasing","graveyards","grandkid","grainy","graced","governed","gouging","gordie's","gooney","googly","golfers","goldmuff","goldenrod","goingo","godly","gobbledygook","gobbledegook","goa'uld's","glues","gloriously","glengarry","glassware","glamor","glaciers","ginseng","gimmicks","gimlet","gilded","giggly","gig's","giambetti","ghoulish","ghettos","ghandi","ghali","gether","get's","gestation","geriatrics","gerbils","gerace's","geosynchronous","georgio","geopolitical","genus","gente","genital","geneticist","generation's","generates","gendarme","gelbman","gazillionth","gayest","gauging","gastro","gaslight","gasbag","garters","garish","garas","garages","gantu","gangy","gangly","gangland","gamer","galling","galilee","galactica's","gaiety","gadda","gacy","futuristic","futs","furrowed","funny's","funnies","funkytown","fundraisers","fundamentalist","fulcrum","fugimotto","fuente","fueling","fudging","fuckup","fuckeen","frutt's","frustrates","froufrou","froot","frontiers","fromberge","frog's","frizzies","fritters","fringes","frightfully","frigate","friendliest","freeloading","freelancing","fredonia","freakazoid","fraternization","frankfurter","francine's","franchises","framers","fostered","fortune's","fornication","fornicating","formulating","formations","forman's","forgeries","forethought","forage","footstool","foisting","focussing","focking","foal","flutes","flurries","fluffed","flourished","florida's","floe","flintstones","fleischman's","fledgling","fledermaus","flayed","flay","flawlessly","flatters","flashbang","flapped","flanking","flamer","fission","fishies","firmer","fireproof","fireman's","firebug","firebird","fingerpainting","finessed","findin","financials","finality","fillets","fighter's","fiercest","fiefdom","fibrosis","fiberglass","fibbing","feudal","festus","fervor","fervent","fentanyl","fenelon","fenders","fedorchuk","feckless","feathering","fearsome","fauna","faucets","farmland","farewells","fantasyland","fanaticism","faltered","fallacy","fairway","faggy","faberge","extremism","extorting","extorted","exterminating","exhumation","exhilaration","exhausts","exfoliate","exemptions","excesses","excels","exasperating","exacting","evoked","evocative","everyman","everybody'd","evasions","evangelical","establishments","espressos","esoteric","esmail","errrr","erratically","eroding","erode","ernswiler","episcopalian","ephemeral","epcot","entrenched","entomology","entomologist","enthralled","ensuing","ensenada","enriching","enrage","enlisting","enhancer","enhancements","endorsing","endear","encrusted","encino","enacted","employing","emperors","empathic","embodied","embezzle","embarked","emanates","elton's","eloquence","eloi","elmwood","elliptical","ellenor's","elemental","electricians","electing","elapsed","eking","egomaniacal","eggo","egging","effected","effacing","eeww","edits","editor's","edging","ectoplasm","economical","ecch","eavesdropped","eastbound","earwig","e'er","durable","dunbar's","dummkopf","dugray","duchaisne","duality","drusilla's","drunkard","drudge","drucilla's","droop","droids","drips","dripped","dribbles","drew's","dressings","drazens","downy","downsize","downpour","dowager","dote","dosages","dorothy's","doppler","doppelganger","dopes","doorman's","doohicky","doof","dontcha","donovon's","doneghy","domi","domes","dojo","documentaries","divinity","divining","divest","diuretics","diuretic","distrustful","distortions","dissident","disrupts","disruptions","disproportionate","dispensary","disparity","dismemberment","dismember","disinfect","disillusionment","disheartening","discriminated","discourteous","discotheque","discolored","disassembled","disabling","dirtiest","diphtheria","dinks","dimpled","digg","diffusion","differs","didya","dickweed","dickwad","dickson's","diatribes","diathesis","diabetics","dewars","deviants","detrimental","detonates","detests","detestable","detaining","despondent","desecration","descriptive","derision","derailing","deputized","depressors","depo","depicting","depict","dependant","dentures","denominators","demur","demonstrators","demonology","delts","dellarte","delinquency","delacour","deflated","definitively","defib","defected","defaced","deeded","decorators","debit","deaqon","davola","datin","dasilva's","darwinian","darling's","darklighters","dandelions","dandelion","dancer's","dampened","dame's","damaskinos","dama","dalrimple","dagobah","dack","d'peshu","d'hoffryn","d'astier","cystic","cynics","cybernetic","cutoff","cutesy","cutaway","customarily","curtain's","cursive","curmudgeon","curdle","cuneiform","cultivated","culpability","culo","cuisinart","cuffing","crypts","cryptid","cryogenic","crux","crunched","crumblers","crudely","crosscheck","croon","crissake","crime's","cribbage","crevasse","creswood","creepo","creases","creased","creaky","cranks","cran","craftsmen","crafting","crabgrass","cowboy's","coveralls","couple'a","councilors","coughs","cotton's","cosmology","coslaw","corresponded","corporeal","corollary","cornucopia","cornering","corks","cordoned","coolly","coolin","cooley's","coolant","cookbooks","converging","contrived","contrite","contributors","contradictory","contra","contours","contented","contenders","contemplated","contact's","constrictor","congressman's","congestion","confrontations","confound","conform","confit","confiscating","conferred","condoned","conditioners","concussions","concentric","conceding","coms","comprised","comprise","comprendo","composers","commuted","commercially","commentator","commentaries","commemorating","commander's","comers","comedic","combustible","combusted","columbo","columbia's","colourful","colonials","collingswood","coliseum","coldness","cojones","coitus","cohesive","cohesion","cohen's","coffey's","codicil","cochran's","coasting","clydesdale","cluttering","clunker","clunk","clumsiness","clumps","clotted","clothesline","clinches","clincher","cleverness","clench","clein","cleave","cleanses","claymores","clarisse","clarissa's","clammed","civilisation","ciudad","circumvent","circulated","circuit's","cinnamon's","cind","church's","chugging","chronically","christsakes","chris's","choque","chompers","choco","chiseling","chirpy","chirp","chinks","chingachgook","chigger","chicklet","chickenpox","chickadee","chewin","chessboard","cherub","chemo's","chauffeur's","chaucer","chariots","chargin","characterizing","chanteuse","chandeliers","chamdo","chalupa","chagrined","chaff","certs","certify","certification","certainties","cerreno","cerebrum","cerebro","century's","centennial","censured","cemetary","cellist","celine's","cedar's","cayo","caterwauling","caterpillars","categorized","catchers","cataclysmic","cassidy's","casitas","casino's","cased","carvel","cartographers","carting","cartels","carriages","carrear","carr's","carolling","carolinas","carolers","carnie","carne","cardiovascular","cardiogram","carbuncle","caramba","capulets","capping","canyons","canines","candaules","canape","canadiens","campaigned","cambodian","camberwell","caldecott","calamitous","caff","cadillacs","cachet","cabeza","cabdriver","byzantium","buzzkill","buzzards","buzz's","buyer's","butai","bustling","businesswomen","bunyan","bungled","bumpkins","bummers","bulletins","bullet's","bulldoze","bulbous","bug's","buffybot","budgeted","budda","bubut","bubbies","brunei","brrrrr","brownout","brouhaha","bronzing","bronchial","broiler","broadening","briskly","briefcases","bricked","breezing","breeher","breckinridge","breakwater","breakable","breadstick","bravenet","braved","brass's","brandies","brandeis","branched","brainwaves","brainiest","braggart","bradlee","boys're","boys'll","boys'd","boyd's","boutonniere","bottle's","bossed","bosomy","bosnian","borans","boosts","boombox","bookshelves","bookmark","booklet","bookends","bontecou's","bongos","boneless","bone's","bond's","bombarding","bombarded","bollo","boinked","boink","boilers","bogart's","bobbo","bobbin","bluest","bluebells","blowjobs","bloodshot","blondie's","blockhead","blockbusters","blithely","blim","bleh","blather","blasters","blankly","bladders","blackhawks","blackbeard","bjorn","bitte","bippy","bios","biohazard","biogenetics","biochemistry","biochemist","bilingual","bilge","bigmouth","bighorn","bigglesworth","bicuspids","beususe","betaseron","besmirch","besieged","bernece","bergman's","bereavement","bentonville","benthic","benjie","benji's","benefactors","benchley","benching","bembe","bellyaching","bellhops","belie","beleaguered","being's","behrle","beginnin","begining","beenie","beefs","beechwood","bee's","bedbug","becau","beaverhausen","beakers","beacon's","bazillion","baudouin","bat's","bartlett's","barrytown","barringtons","baroque","baronet","barneys","barbs","barbers","barbatus","baptists","bankrupted","banker's","bamn","bambi's","ballon's","balinese","bakeries","bailiffs","backslide","baby'd","baaad","b'fore","awwwk","aways","awakes","averages","avengers","avatars","autonomous","automotive","automaton","automatics","autism","authoritative","authenticated","authenticate","aught","audition's","aubyn","attired","attagirl","atrophied","atonement","atherton's","asystole","astroturf","assimilated","assimilate","assertiveness","assemblies","assassin's","artiste","article's","artichokes","arsehole","arrears","arquillians","arnie's","aright","archenemy","arched","arcade's","aquatic","apps","appraise","applauded","appendages","appeased","apostle","apollo's","antwerp","antler","antiquity","antin","antidepressant","antibody","anthropologists","anthology","anthea","antagonism","ant's","anspaugh","annually","anka","angola","anesthetics","anda","ancients","anchoring","anaphylactic","anaheim","ana's","amtrak","amscray","amputated","amounted","americas","amended","ambivalence","amalio","amah","altoid","alriiight","alphabetized","alpena","alouette","allowable","allora","alliteration","allenwood","alleging","allegiances","aligning","algerians","alerts","alchemist","alcerro","alastor","airway's","airmen","ahaha","ah'm","agitators","agitation","aforethought","afis","aesthetics","aerospace","aerodynamics","advertises","advert","advantageous","admonition","administration's","adirondacks","adenoids","adebisi's","acupuncturist","acula","actuarial","activators","actionable","acme's","acknowledges","achmed","achingly","acetate","accusers","accumulation","accorded","acclimated","acclimate","absurdly","absorbent","absolvo","absolutes","absences","abraham's","aboriginal","ablaze","abdomenizer","aaaaaaaaah","aaaaaaaaaa","a'right"] },module.exports=frequency_lists; },{}],3:[function(require,module,exports){ var matching,scoring,time,zxcvbn;matching=require("./matching"),scoring=require("./scoring"),time=function(){return(new Date).getTime()},zxcvbn=function(n,e){var t,i,r,c,m,o,a,u;for(null==e&&(e=[]),u=time(),a=[],i=0,r=e.length;r>i;i++)t=e[i],("string"==(m=typeof t)||"number"===m||"boolean"===m)&&a.push(t.toString().toLowerCase());return matching.set_user_input_dictionary(a),c=matching.omnimatch(n),o=scoring.minimum_entropy_match_sequence(n,c),o.calc_time=time()-u,o},module.exports=zxcvbn; },{"./matching":4,"./scoring":5}],4:[function(require,module,exports){ var GRAPHS,RANKED_DICTIONARIES,SEQUENCES,adjacency_graphs,build_ranked_dict,frequency_lists,matching;frequency_lists=require("./frequency_lists"),adjacency_graphs=require("./adjacency_graphs"),build_ranked_dict=function(e){var t,n,r,a,i;for(a={},t=1,n=0,r=e.length;r>n;n++)i=e[n],a[i]=t,t+=1;return a},RANKED_DICTIONARIES={passwords:build_ranked_dict(frequency_lists.passwords),english:build_ranked_dict(frequency_lists.english),surnames:build_ranked_dict(frequency_lists.surnames),male_names:build_ranked_dict(frequency_lists.male_names),female_names:build_ranked_dict(frequency_lists.female_names)},GRAPHS={qwerty:adjacency_graphs.qwerty,dvorak:adjacency_graphs.dvorak,keypad:adjacency_graphs.keypad,mac_keypad:adjacency_graphs.mac_keypad},SEQUENCES={lower:"abcdefghijklmnopqrstuvwxyz",upper:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",digits:"01234567890"},matching={empty:function(e){var t;return 0===function(){var n;n=[];for(t in e)n.push(t);return n}().length},extend:function(e,t){return e.push.apply(e,t)},translate:function(e,t){var n;return function(){var r,a,i,s;for(i=e.split(""),s=[],r=0,a=i.length;a>r;r++)n=i[r],s.push(t[n]||n);return s}().join("")},omnimatch:function(e){var t,n,r,a,i;for(i=[],a=[this.dictionary_match,this.l33t_match,this.digits_match,this.year_match,this.date_match,this.repeat_match,this.sequence_match,this.spatial_match],t=0,n=a.length;n>t;t++)r=a[t],this.extend(i,r.call(this,e));return i.sort(function(e,t){return e.i-t.i||e.j-t.j})},dictionary_match:function(e){var t,n,r,a,i,s,h,c,u,l,o,d,f,_;f=[],i=e.length,h=e.toLowerCase();for(t in RANKED_DICTIONARIES)for(u=RANKED_DICTIONARIES[t],n=a=0,l=i;l>=0?l>a:a>l;n=l>=0?++a:--a)for(r=s=o=n,d=i;d>=o?d>s:s>d;r=d>=o?++s:--s)h.slice(n,+r+1||9e9)in u&&(_=h.slice(n,+r+1||9e9),c=u[_],f.push({pattern:"dictionary",i:n,j:r,token:e.slice(n,+r+1||9e9),matched_word:_,rank:c,dictionary_name:t}));return f},set_user_input_dictionary:function(e){return RANKED_DICTIONARIES.user_inputs=build_ranked_dict(e.slice())},l33t_table:{a:["4","@"],b:["8"],c:["(","{","[","<"],e:["3"],g:["6","9"],i:["1","!","|"],l:["1","|","7"],o:["0"],s:["$","5"],t:["+","7"],x:["%"],z:["2"]},relevant_l33t_subtable:function(e){var t,n,r,a,i,s,h,c,u,l,o;for(s={},h=e.split(""),r=0,a=h.length;a>r;r++)t=h[r],s[t]=!0;n={},c=this.l33t_table;for(i in c)o=c[i],u=function(){var e,t,n;for(n=[],t=0,e=o.length;e>t;t++)l=o[t],l in s&&n.push(l);return n}(),u.length>0&&(n[i]=u);return n},enumerate_l33t_subs:function(e){var t,n,r,a,i,s,h,c,u,l,o,d,f,_,p;i=function(){var t;t=[];for(a in e)t.push(a);return t}(),p=[[]],n=function(e){var t,n,r,i,s,h,c,u;for(n=[],h={},r=0,s=e.length;s>r;r++)c=e[r],t=function(){var e,t,n;for(n=[],u=t=0,e=c.length;e>t;u=++t)a=c[u],n.push([a,u]);return n}(),t.sort(),i=function(){var e,n,r;for(r=[],u=n=0,e=t.length;e>n;u=++n)a=t[u],r.push(a+","+u);return r}().join("-"),i in h||(h[i]=!0,n.push(c));return n},r=function(t){var a,i,s,h,c,u,l,o,d,f,_,y,m,g,j,v;if(t.length){for(i=t[0],m=t.slice(1),d=[],_=e[i],h=0,u=_.length;u>h;h++)for(c=_[h],o=0,l=p.length;l>o;o++){for(g=p[o],a=-1,s=f=0,y=g.length;y>=0?y>f:f>y;s=y>=0?++f:--f)if(g[s][0]===c){a=s;break}-1===a?(v=g.concat([[c,i]]),d.push(v)):(j=g.slice(0),j.splice(a,1),j.push([c,i]),d.push(g),d.push(j))}return p=n(d),r(m)}},r(i),_=[];for(s=0,c=p.length;c>s;s++){for(d=p[s],f={},l=0,u=d.length;u>l;l++)o=d[l],h=o[0],t=o[1],f[h]=t;_.push(f)}return _},l33t_match:function(e){var t,n,r,a,i,s,h,c,u,l,o,d,f,_,p,y;for(u=[],l=this.enumerate_l33t_subs(this.relevant_l33t_subtable(e)),r=0,a=l.length;a>r&&(d=l[r],!this.empty(d));r++)for(_=this.translate(e,d),o=this.dictionary_match(_),s=0,i=o.length;i>s;s++)if(h=o[s],p=e.slice(h.i,+h.j+1||9e9),p.toLowerCase()!==h.matched_word){c={};for(f in d)t=d[f],-1!==p.indexOf(f)&&(c[f]=t);h.l33t=!0,h.token=p,h.sub=c,h.sub_display=function(){var e;e=[];for(n in c)y=c[n],e.push(n+" -> "+y);return e}().join(", "),u.push(h)}return u},spatial_match:function(e){var t,n,r;r=[];for(n in GRAPHS)t=GRAPHS[n],this.extend(r,this.spatial_match_helper(e,t,n));return r},spatial_match_helper:function(e,t,n){var r,a,i,s,h,c,u,l,o,d,f,_,p,y,m;for(p=[],u=0;u<e.length-1;)for(l=u+1,d=null,m=0,y=0;;){if(_=e.charAt(l-1),h=!1,c=-1,s=-1,a=t[_]||[],l<e.length)for(i=e.charAt(l),o=0,f=a.length;f>o;o++)if(r=a[o],s+=1,r&&-1!==r.indexOf(i)){h=!0,c=s,1===r.indexOf(i)&&(y+=1),d!==c&&(m+=1,d=c);break}if(!h){l-u>2&&p.push({pattern:"spatial",i:u,j:l-1,token:e.slice(u,l),graph:n,turns:m,shifted_count:y}),u=l;break}l+=1}return p},repeat_match:function(e){var t,n,r,a,i,s;for(s=[],n=0;n<e.length;){for(r=n+1;;){if(i=e.slice(r-1,+r+1||9e9),a=i[0],t=i[1],e.charAt(r-1)!==e.charAt(r)){r-n>2&&s.push({pattern:"repeat",i:n,j:r-1,token:e.slice(n,r),repeated_char:e.charAt(n)});break}r+=1}n=r}return s},sequence_match:function(e){var t,n,r,a,i,s,h,c,u,l,o,d,f,_,p,y,m,g,j;for(_=[],i=0;i<e.length;){h=i+1,p=null,j=null,g=null;for(m in SEQUENCES)if(y=SEQUENCES[m],o=function(){var n,r,a,s;for(a=[e.charAt(i),e.charAt(h)],s=[],n=0,r=a.length;r>n;n++)t=a[n],s.push(y.indexOf(t));return s}(),s=o[0],c=o[1],s>-1&&c>-1&&(a=c-s,1===a||-1===a)){p=y,j=m,g=a;break}if(p)for(;;){if(d=e.slice(h-1,+h+1||9e9),u=d[0],n=d[1],f=function(){var e,r,a,i;for(a=[u,n],i=[],e=0,r=a.length;r>e;e++)t=a[e],i.push(y.indexOf(t));return i}(),l=f[0],r=f[1],r-l!==g){h-i>2&&_.push({pattern:"sequence",i:i,j:h-1,token:e.slice(i,h),sequence_name:j,sequence_space:p.length,ascending:1===g});break}h+=1}i=h}return _},repeat:function(e,t){var n;return function(){var r,a,i;for(i=[],n=r=1,a=t;a>=1?a>=r:r>=a;n=a>=1?++r:--r)i.push(e);return i}().join("")},findall:function(e,t){var n,r;for(r=[];;){if(n=e.match(t),!n)break;n.i=n.index,n.j=n.index+n[0].length-1,r.push(n),e=e.replace(n[0],this.repeat(" ",n[0].length))}return r},digits_rx:/\d{3,}/,digits_match:function(e){var t,n,r,a,i,s,h,c;for(s=this.findall(e,this.digits_rx),c=[],r=0,a=s.length;a>r;r++)i=s[r],h=[i.i,i.j],t=h[0],n=h[1],c.push({pattern:"digits",i:t,j:n,token:e.slice(t,+n+1||9e9)});return c},year_rx:/19\d\d|200\d|201\d/,year_match:function(e){var t,n,r,a,i,s,h,c;for(s=this.findall(e,this.year_rx),c=[],r=0,a=s.length;a>r;r++)i=s[r],h=[i.i,i.j],t=h[0],n=h[1],c.push({pattern:"year",i:t,j:n,token:e.slice(t,+n+1||9e9)});return c},date_match:function(e){return this.date_without_sep_match(e).concat(this.date_sep_match(e))},date_without_sep_match:function(e){var t,n,r,a,i,s,h,c,u,l,o,d,f,_,p,y,m,g,j,v,k,b,x;for(a=[],m=this.findall(e,/\d{4,8}/),l=0,o=m.length;o>l;l++){for(s=m[l],g=[s.i,s.j],c=g[0],u=g[1],k=e.slice(c,+u+1||9e9),h=k.length,n=[],k.length<=6&&(n.push({daymonth:k.slice(2),year:k.slice(0,2),i:c,j:u}),n.push({daymonth:k.slice(0,h-2),year:k.slice(h-2),i:c,j:u})),k.length>=6&&(n.push({daymonth:k.slice(4),year:k.slice(0,4),i:c,j:u}),n.push({daymonth:k.slice(0,h-4),year:k.slice(h-4),i:c,j:u})),r=[],_=0,d=n.length;d>_;_++)switch(t=n[_],t.daymonth.length){case 2:r.push({day:t.daymonth[0],month:t.daymonth[1],year:t.year,i:t.i,j:t.j});break;case 3:r.push({day:t.daymonth.slice(0,2),month:t.daymonth[2],year:t.year,i:t.i,j:t.j}),r.push({day:t.daymonth[0],month:t.daymonth.slice(1,3),year:t.year,i:t.i,j:t.j});break;case 4:r.push({day:t.daymonth.slice(0,2),month:t.daymonth.slice(2,4),year:t.year,i:t.i,j:t.j})}for(y=0,f=r.length;f>y;y++)t=r[y],i=parseInt(t.day),p=parseInt(t.month),x=parseInt(t.year),j=this.check_date(i,p,x),b=j[0],v=j[1],i=v[0],p=v[1],x=v[2],b&&a.push({pattern:"date",i:t.i,j:t.j,token:e.slice(c,+u+1||9e9),separator:"",day:i,month:p,year:x})}return a},date_rx_year_suffix:/(\d{1,2})(\s|-|\/|\\|_|\.)(\d{1,2})\2(19\d{2}|200\d|201\d|\d{2})/,date_rx_year_prefix:/(19\d{2}|200\d|201\d|\d{2})(\s|-|\/|\\|_|\.)(\d{1,2})\2(\d{1,2})/,date_sep_match:function(e){var t,n,r,a,i,s,h,c,u,l,o,d,f,_,p,y,m,g,j,v;for(u=[],d=this.findall(e,this.date_rx_year_suffix),r=0,a=d.length;a>r;r++)c=d[r],f=function(){var e,t,r,a;for(r=[1,3,4],a=[],t=0,e=r.length;e>t;t++)n=r[t],a.push(parseInt(c[n]));return a}(),c.day=f[0],c.month=f[1],c.year=f[2],c.sep=c[2],u.push(c);for(_=this.findall(e,this.date_rx_year_prefix),h=0,i=_.length;i>h;h++)c=_[h],p=function(){var e,t,r,a;for(r=[4,3,1],a=[],t=0,e=r.length;e>t;t++)n=r[t],a.push(parseInt(c[n]));return a}(),c.day=p[0],c.month=p[1],c.year=p[2],c.sep=c[2],u.push(c);for(g=[],o=0,s=u.length;s>o;o++)c=u[o],y=this.check_date(c.day,c.month,c.year),j=y[0],m=y[1],t=m[0],l=m[1],v=m[2],j&&g.push({pattern:"date",i:c.i,j:c.j,token:e.slice(c.i,+c.j+1||9e9),separator:c.sep,day:t,month:l,year:v});return g},check_date:function(e,t,n){var r;return t>=12&&31>=t&&12>=e&&(r=[t,e],e=r[0],t=r[1]),e>31||t>12?[!1,[]]:n>=1900&&2019>=n?[!0,[e,t,n]]:[!1,[]]}},module.exports=matching; },{"./adjacency_graphs":1,"./frequency_lists":2}],5:[function(require,module,exports){ var KEYBOARD_AVERAGE_DEGREE,KEYBOARD_STARTING_POSITIONS,KEYPAD_AVERAGE_DEGREE,KEYPAD_STARTING_POSITIONS,adjacency_graphs,calc_average_degree,k,scoring,v;adjacency_graphs=require("./adjacency_graphs"),calc_average_degree=function(t){var r,e,n,a,i,o;r=0;for(n in t)i=t[n],r+=function(){var t,r,e;for(e=[],t=0,r=i.length;r>t;t++)a=i[t],a&&e.push(a);return e}().length;return r/=function(){var r;r=[];for(e in t)o=t[e],r.push(e);return r}().length},KEYBOARD_AVERAGE_DEGREE=calc_average_degree(adjacency_graphs.qwerty),KEYPAD_AVERAGE_DEGREE=calc_average_degree(adjacency_graphs.keypad),KEYBOARD_STARTING_POSITIONS=function(){var t,r;t=adjacency_graphs.qwerty,r=[];for(k in t)v=t[k],r.push(k);return r}().length,KEYPAD_STARTING_POSITIONS=function(){var t,r;t=adjacency_graphs.keypad,r=[];for(k in t)v=t[k],r.push(k);return r}().length,scoring={nCk:function(t,r){var e,n,a,i;if(r>t)return 0;if(0===r)return 1;for(a=1,e=n=1,i=r;i>=1?i>=n:n>=i;e=i>=1?++n:--n)a*=t,a/=e,t-=1;return a},lg:function(t){return Math.log(t)/Math.log(2)},minimum_entropy_match_sequence:function(t,r){var e,n,a,i,o,h,c,s,_,u,p,l,g,f,y,E,A,d,R,S;for(n=this.calc_bruteforce_cardinality(t),S=[],e=[],k=c=0,A=t.length;A>=0?A>c:c>A;k=A>=0?++c:--c)for(S[k]=(S[k-1]||0)+this.lg(n),e[k]=null,u=0,s=r.length;s>u;u++)l=r[u],l.j===k&&(d=[l.i,l.j],o=d[0],h=d[1],a=(S[o-1]||0)+this.calc_entropy(l),a<S[h]&&(S[h]=a,e[h]=l));for(g=[],k=t.length-1;k>=0;)l=e[k],l?(g.push(l),k=l.i-1):k-=1;for(g.reverse(),p=function(r){return function(e,a){return{pattern:"bruteforce",i:e,j:a,token:t.slice(e,+a+1||9e9),entropy:r.lg(Math.pow(n,a-e+1)),cardinality:n}}}(this),k=0,f=[],E=0,_=g.length;_>E;E++)l=g[E],R=[l.i,l.j],o=R[0],h=R[1],o-k>0&&f.push(p(k,o-1)),k=h+1,f.push(l);return k<t.length&&f.push(p(k,t.length-1)),g=f,y=S[t.length-1]||0,i=this.entropy_to_crack_time(y),{password:t,entropy:this.round_to_x_digits(y,3),match_sequence:g,crack_time:this.round_to_x_digits(i,3),crack_time_display:this.display_time(i),score:this.crack_time_to_score(i)}},round_to_x_digits:function(t,r){return Math.round(t*Math.pow(10,r))/Math.pow(10,r)},SECONDS_PER_GUESS:1e-4,entropy_to_crack_time:function(t){return.5*Math.pow(2,t)*this.SECONDS_PER_GUESS},crack_time_to_score:function(t){return t<Math.pow(10,2)?0:t<Math.pow(10,4)?1:t<Math.pow(10,6)?2:t<Math.pow(10,8)?3:4},calc_entropy:function(t){var r;return null!=t.entropy?t.entropy:(r=function(){switch(t.pattern){case"repeat":return this.repeat_entropy;case"sequence":return this.sequence_entropy;case"digits":return this.digits_entropy;case"year":return this.year_entropy;case"date":return this.date_entropy;case"spatial":return this.spatial_entropy;case"dictionary":return this.dictionary_entropy}}.call(this),t.entropy=r.call(this,t))},repeat_entropy:function(t){var r;return r=this.calc_bruteforce_cardinality(t.token),this.lg(r*t.token.length)},sequence_entropy:function(t){var r,e;return e=t.token.charAt(0),r="a"===e||"1"===e?1:e.match(/\d/)?this.lg(10):e.match(/[a-z]/)?this.lg(26):this.lg(26)+1,t.ascending||(r+=1),r+this.lg(t.token.length)},digits_entropy:function(t){return this.lg(Math.pow(10,t.token.length))},NUM_YEARS:119,NUM_MONTHS:12,NUM_DAYS:31,year_entropy:function(t){return this.lg(this.NUM_YEARS)},date_entropy:function(t){var r;return r=t.year<100?this.lg(this.NUM_DAYS*this.NUM_MONTHS*100):this.lg(this.NUM_DAYS*this.NUM_MONTHS*this.NUM_YEARS),t.separator&&(r+=2),r},spatial_entropy:function(t){var r,e,n,a,i,o,h,c,s,_,u,p,l,g,f,y,E,k;for("qwerty"===(l=t.graph)||"dvorak"===l?(E=KEYBOARD_STARTING_POSITIONS,a=KEYBOARD_AVERAGE_DEGREE):(E=KEYPAD_STARTING_POSITIONS,a=KEYPAD_AVERAGE_DEGREE),u=0,r=t.token.length,k=t.turns,o=c=2,g=r;g>=2?g>=c:c>=g;o=g>=2?++c:--c)for(p=Math.min(k,o-1),h=s=1,f=p;f>=1?f>=s:s>=f;h=f>=1?++s:--s)u+=this.nCk(o-1,h-1)*E*Math.pow(a,h);if(i=this.lg(u),t.shifted_count){for(e=t.shifted_count,n=t.token.length-t.shifted_count,u=0,o=_=0,y=Math.min(e,n);y>=0?y>=_:_>=y;o=y>=0?++_:--_)u+=this.nCk(e+n,o);i+=this.lg(u)}return i},dictionary_entropy:function(t){return t.base_entropy=this.lg(t.rank),t.uppercase_entropy=this.extra_uppercase_entropy(t),t.l33t_entropy=this.extra_l33t_entropy(t),t.base_entropy+t.uppercase_entropy+t.l33t_entropy},START_UPPER:/^[A-Z][^A-Z]+$/,END_UPPER:/^[^A-Z]+[A-Z]$/,ALL_UPPER:/^[^a-z]+$/,ALL_LOWER:/^[^A-Z]+$/,extra_uppercase_entropy:function(t){var r,e,n,a,i,o,h,c,s,_,u,p;if(p=t.token,p.match(this.ALL_LOWER))return 0;for(s=[this.START_UPPER,this.END_UPPER,this.ALL_UPPER],i=0,o=s.length;o>i;i++)if(u=s[i],p.match(u))return 1;for(e=function(){var t,r,e,a;for(e=p.split(""),a=[],r=0,t=e.length;t>r;r++)n=e[r],n.match(/[A-Z]/)&&a.push(n);return a}().length,r=function(){var t,r,e,a;for(e=p.split(""),a=[],r=0,t=e.length;t>r;r++)n=e[r],n.match(/[a-z]/)&&a.push(n);return a}().length,c=0,a=h=0,_=Math.min(e,r);_>=0?_>=h:h>=_;a=_>=0?++h:--h)c+=this.nCk(e+r,a);return this.lg(c)},extra_l33t_entropy:function(t){var r,e,n,a,i,o,h,c,s,_;if(!t.l33t)return 0;o=0,h=t.sub;for(s in h)for(_=h[s],r=function(){var r,e,a,i;for(a=t.token.split(""),i=[],r=0,e=a.length;e>r;r++)n=a[r],n===s&&i.push(n);return i}().length,e=function(){var r,e,a,i;for(a=t.token.split(""),i=[],r=0,e=a.length;e>r;r++)n=a[r],n===_&&i.push(n);return i}().length,a=i=0,c=Math.min(e,r);c>=0?c>=i:i>=c;a=c>=0?++i:--i)o+=this.nCk(e+r,a);return this.lg(o)||1},calc_bruteforce_cardinality:function(t){var r,e,n,a,i,o,h,c,s,_,u,p;for(c=[!1,!1,!1,!1,!1],o=c[0],p=c[1],n=c[2],_=c[3],u=c[4],s=t.split(""),a=0,i=s.length;i>a;a++)e=s[a],h=e.charCodeAt(0),h>=48&&57>=h?n=!0:h>=65&&90>=h?p=!0:h>=97&&122>=h?o=!0:127>=h?_=!0:u=!0;return r=0,n&&(r+=10),p&&(r+=26),o&&(r+=26),_&&(r+=33),u&&(r+=100),r},display_time:function(t){var r,e,n,a,i,o;return a=60,n=60*a,e=24*n,i=31*e,o=12*i,r=100*o,a>t?"instant":n>t?1+Math.ceil(t/a)+" minutes":e>t?1+Math.ceil(t/n)+" hours":i>t?1+Math.ceil(t/e)+" days":o>t?1+Math.ceil(t/i)+" months":r>t?1+Math.ceil(t/o)+" years":"centuries"}},module.exports=scoring; },{"./adjacency_graphs":1}]},{},[3])(3) }); //# sourceMappingURL=zxcvbn.js.map
site/src/pages/native/QuickStart.js
appbaseio/reactivesearch
import React from 'react'; import config from '../../constants/config/learn/native'; import Learn from '../../components/Learn'; import theme from '../../constants/theme/native'; export default () => <Learn config={config} theme={theme} />;
vendor/jquery/jquery.min.js
carolinamlinhares/convite-digital
/*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0; }return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",j.childNodes[0].style.borderCollapse="separate",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ra(a),g=l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Sa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Oa.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+eb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{ marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g,sb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(sb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var tb,ub,vb=n.expr.attrHandle,wb=/^(?:checked|selected)$/i,xb=l.getSetAttribute,yb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ub:tb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?yb&&xb||!wb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(xb?c:d)}}),ub={set:function(a,b,c){return b===!1?n.removeAttr(a,c):yb&&xb||!wb.test(c)?a.setAttribute(!xb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=vb[b]||n.find.attr;yb&&xb||!wb.test(b)?vb[b]=function(a,b,d){var e,f;return d||(f=vb[b],vb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,vb[b]=f),e}:vb[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),yb&&xb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):tb&&tb.set(a,b,c)}}),xb||(tb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},vb.id=vb.name=vb.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:tb.set},n.attrHooks.contenteditable={set:function(a,b,c){tb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var zb=/^(?:input|select|textarea|button|object)$/i,Ab=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):zb.test(a.nodeName)||Ab.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Bb=/[\t\r\n\f]/g;function Cb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Cb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Cb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Cb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=Cb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Cb(c)+" ").replace(Bb," ").indexOf(b)>-1)return!0;return!1}}),n.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(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Db=a.location,Eb=n.now(),Fb=/\?/,Gb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Gb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Hb=/#.*$/,Ib=/([?&])_=[^&]*/,Jb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Kb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lb=/^(?:GET|HEAD)$/,Mb=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ob={},Pb={},Qb="*/".concat("*"),Rb=Db.href,Sb=Nb.exec(Rb.toLowerCase())||[];function Tb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Ub(a,b,c,d){var e={},f=a===Pb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Vb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Wb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Xb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Rb,type:"GET",isLocal:Kb.test(Sb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Vb(Vb(a,n.ajaxSettings),b):Vb(n.ajaxSettings,a)},ajaxPrefilter:Tb(Ob),ajaxTransport:Tb(Pb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Jb.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Rb)+"").replace(Hb,"").replace(Mb,Sb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Sb[1]&&d[2]===Sb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Sb[3]||("http:"===Sb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Ub(Ob,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Lb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Fb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ib.test(f)?f.replace(Ib,"$1_="+Eb++):f+(Fb.test(f)?"&":"?")+"_="+Eb++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Qb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Ub(Pb,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Wb(l,w,d)),v=Xb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Yb(a){return a.style&&a.style.display||n.css(a,"display")}function Zb(a){if(!n.contains(a.ownerDocument||d,a))return!0;while(a&&1===a.nodeType){if("none"===Yb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Zb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var $b=/%20/g,_b=/\[\]$/,ac=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,cc=/^(?:input|select|textarea|keygen)/i;function dc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||_b.test(a)?d(a,e):dc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)dc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)dc(c,a[c],b,e);return d.join("&").replace($b,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&cc.test(this.nodeName)&&!bc.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(ac,"\r\n")}}):{name:b.name,value:c.replace(ac,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?ic():d.documentMode>8?hc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&hc()||ic()}:hc;var ec=0,fc={},gc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in fc)fc[a](void 0,!0)}),l.cors=!!gc&&"withCredentials"in gc,gc=l.ajax=!!gc,gc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++ec;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete fc[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=fc[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function hc(){try{return new a.XMLHttpRequest}catch(b){}}function ic(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var jc=[],kc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=jc.pop()||n.expando+"_"+Eb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(kc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&kc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(kc,"$1"+e):b.jsonp!==!1&&(b.url+=(Fb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,jc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var lc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&lc)return lc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function mc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=mc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=mc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({ padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});
node_modules/bower/node_modules/inquirer/node_modules/rx/dist/rx.all.js
leonarther16th/eslhunter
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. ;(function (undefined) { var objectTypes = { 'boolean': false, 'function': true, 'object': true, 'number': false, 'string': false, 'undefined': false }; var root = (objectTypes[typeof window] && window) || this, freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, freeModule = objectTypes[typeof module] && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports && freeExports, freeGlobal = objectTypes[typeof global] && global; if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { root = freeGlobal; } var Rx = { internals: {}, config: { Promise: root.Promise, }, helpers: { } }; // Defaults var noop = Rx.helpers.noop = function () { }, notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; }, isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; }, identity = Rx.helpers.identity = function (x) { return x; }, pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; }, just = Rx.helpers.just = function (value) { return function () { return value; }; }, defaultNow = Rx.helpers.defaultNow = Date.now, defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, defaultError = Rx.helpers.defaultError = function (err) { throw err; }, isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.then === 'function'; }, asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); }, not = Rx.helpers.not = function (a) { return !a; }, isFunction = Rx.helpers.isFunction = (function () { var isFn = function (value) { return typeof value == 'function' || false; } // fallback for older versions of Chrome and Safari if (isFn(/x/)) { isFn = function(value) { return typeof value == 'function' && toString.call(value) == '[object Function]'; }; } return isFn; }()); // Errors var sequenceContainsNoElements = 'Sequence contains no elements.'; var argumentOutOfRange = 'Argument out of range'; var objectDisposed = 'Object has been disposed'; function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } } Rx.config.longStackSupport = false; var hasStacks = false; try { throw new Error(); } catch (e) { hasStacks = !!e.stack; } // All code after this point will be filtered from stack traces reported by RxJS var rStartingLine = captureLine(), rFileName; var STACK_JUMP_SEPARATOR = "From previous event:"; function makeStackTraceLong(error, observable) { // If possible, transform the error stack trace by removing Node and RxJS // cruft, then concatenating with the stack trace of `observable`. if (hasStacks && observable.stack && typeof error === "object" && error !== null && error.stack && error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1 ) { var stacks = []; for (var o = observable; !!o; o = o.source) { if (o.stack) { stacks.unshift(o.stack); } } stacks.unshift(error.stack); var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n"); error.stack = filterStackString(concatedStacks); } } function filterStackString(stackString) { var lines = stackString.split("\n"), desiredLines = []; for (var i = 0, len = lines.length; i < len; i++) { var line = lines[i]; if (!isInternalFrame(line) && !isNodeFrame(line) && line) { desiredLines.push(line); } } return desiredLines.join("\n"); } function isInternalFrame(stackLine) { var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine); if (!fileNameAndLineNumber) { return false; } var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1]; return fileName === rFileName && lineNumber >= rStartingLine && lineNumber <= rEndingLine; } function isNodeFrame(stackLine) { return stackLine.indexOf("(module.js:") !== -1 || stackLine.indexOf("(node.js:") !== -1; } function captureLine() { if (!hasStacks) { return; } try { throw new Error(); } catch (e) { var lines = e.stack.split("\n"); var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2]; var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine); if (!fileNameAndLineNumber) { return; } rFileName = fileNameAndLineNumber[0]; return fileNameAndLineNumber[1]; } } function getFileNameAndLineNumber(stackLine) { // Named functions: "at functionName (filename:lineNumber:columnNumber)" var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine); if (attempt1) { return [attempt1[1], Number(attempt1[2])]; } // Anonymous functions: "at filename:lineNumber:columnNumber" var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine); if (attempt2) { return [attempt2[1], Number(attempt2[2])]; } // Firefox style: "function@filename:lineNumber or @filename:lineNumber" var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine); if (attempt3) { return [attempt3[1], Number(attempt3[2])]; } } // Shim in iterator support var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || '_es6shim_iterator_'; // Bug for mozilla version if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined }; var isIterable = Rx.helpers.isIterable = function (o) { return o[$iterator$] !== undefined; } var isArrayLike = Rx.helpers.isArrayLike = function (o) { return o && o.length !== undefined; } Rx.helpers.iterator = $iterator$; var deprecate = Rx.helpers.deprecate = function (name, alternative) { /*if (typeof console !== "undefined" && typeof console.warn === "function") { console.warn(name + ' is deprecated, use ' + alternative + ' instead.', new Error('').stack); }*/ } /** `Object#toString` result shortcuts */ var argsClass = '[object Arguments]', arrayClass = '[object Array]', boolClass = '[object Boolean]', dateClass = '[object Date]', errorClass = '[object Error]', funcClass = '[object Function]', numberClass = '[object Number]', objectClass = '[object Object]', regexpClass = '[object RegExp]', stringClass = '[object String]'; var toString = Object.prototype.toString, hasOwnProperty = Object.prototype.hasOwnProperty, supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4 supportNodeClass, errorProto = Error.prototype, objectProto = Object.prototype, stringProto = String.prototype, propertyIsEnumerable = objectProto.propertyIsEnumerable; // Fix for Tessel if (!propertyIsEnumerable) { propertyIsEnumerable = objectProto.propertyIsEnumerable = function (key) { for (var k in this) { if (k === key) { return true; } } return false; }; } try { supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); } catch (e) { supportNodeClass = true; } var shadowedProps = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var nonEnumProps = {}; nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; nonEnumProps[objectClass] = { 'constructor': true }; var support = {}; (function () { var ctor = function() { this.x = 1; }, props = []; ctor.prototype = { 'valueOf': 1, 'y': 1 }; for (var key in new ctor) { props.push(key); } for (key in arguments) { } // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); // Detect if `prototype` properties are enumerable by default. support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); // Detect if `arguments` object indexes are non-enumerable support.nonEnumArgs = key != 0; // Detect if properties shadowing those on `Object.prototype` are non-enumerable. support.nonEnumShadows = !/valueOf/.test(props); }(1)); function isObject(value) { // check if the value is the ECMAScript language type of Object // http://es5.github.io/#x8 // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; return value && (type == 'function' || type == 'object') || false; } function keysIn(object) { var result = []; if (!isObject(object)) { return result; } if (support.nonEnumArgs && object.length && isArguments(object)) { object = slice.call(object); } var skipProto = support.enumPrototypes && typeof object == 'function', skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error); for (var key in object) { if (!(skipProto && key == 'prototype') && !(skipErrorProps && (key == 'message' || key == 'name'))) { result.push(key); } } if (support.nonEnumShadows && object !== objectProto) { var ctor = object.constructor, index = -1, length = shadowedProps.length; if (object === (ctor && ctor.prototype)) { var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object), nonEnum = nonEnumProps[className]; } while (++index < length) { key = shadowedProps[index]; if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) { result.push(key); } } } return result; } function internalFor(object, callback, keysFunc) { var index = -1, props = keysFunc(object), length = props.length; while (++index < length) { var key = props[index]; if (callback(object[key], key, object) === false) { break; } } return object; } function internalForIn(object, callback) { return internalFor(object, callback, keysIn); } function isNode(value) { // IE < 9 presents DOM nodes as `Object` objects except they have `toString` // methods that are `typeof` "string" and still can coerce nodes to strings return typeof value.toString != 'function' && typeof (value + '') == 'string'; } var isArguments = function(value) { return (value && typeof value == 'object') ? toString.call(value) == argsClass : false; } // fallback for browsers that can't detect `arguments` objects by [[Class]] if (!supportsArgsClass) { isArguments = function(value) { return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false; }; } var isEqual = Rx.internals.isEqual = function (x, y) { return deepEquals(x, y, [], []); }; /** @private * Used for deep comparison **/ function deepEquals(a, b, stackA, stackB) { // exit early for identical values if (a === b) { // treat `+0` vs. `-0` as not equal return a !== 0 || (1 / a == 1 / b); } var type = typeof a, otherType = typeof b; // exit early for unlike primitive values if (a === a && (a == null || b == null || (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) { return false; } // compare [[Class]] names var className = toString.call(a), otherClass = toString.call(b); if (className == argsClass) { className = objectClass; } if (otherClass == argsClass) { otherClass = objectClass; } if (className != otherClass) { return false; } switch (className) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0` treating invalid dates coerced to `NaN` as not equal return +a == +b; case numberClass: // treat `NaN` vs. `NaN` as equal return (a != +a) ? b != +b : // but treat `-0` vs. `+0` as not equal (a == 0 ? (1 / a == 1 / b) : a == +b); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal return a == String(b); } var isArr = className == arrayClass; if (!isArr) { // exit for functions and DOM nodes if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { return false; } // in older versions of Opera, `arguments` objects have `Array` constructors var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; // non `Object` object instances with different constructors are not equal if (ctorA != ctorB && !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) && !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && ('constructor' in a && 'constructor' in b) ) { return false; } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) var initedStack = !stackA; stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] == a) { return stackB[length] == b; } } var size = 0; var result = true; // add `a` and `b` to the stack of traversed objects stackA.push(a); stackB.push(b); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { // compare lengths to determine if a deep comparison is necessary length = a.length; size = b.length; result = size == length; if (result) { // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, value = b[size]; if (!(result = deepEquals(a[size], value, stackA, stackB))) { break; } } } } else { // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` // which, in this case, is more costly internalForIn(b, function(value, key, b) { if (hasOwnProperty.call(b, key)) { // count the number of properties. size++; // deep compare each property value. return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB)); } }); if (result) { // ensure both objects have the same number of properties internalForIn(a, function(value, key, a) { if (hasOwnProperty.call(a, key)) { // `size` will be `-1` if `a` has more properties than `b` return (result = --size > -1); } }); } } stackA.pop(); stackB.pop(); return result; } var slice = Array.prototype.slice; function argsOrArray(args, idx) { return args.length === 1 && Array.isArray(args[idx]) ? args[idx] : slice.call(args); } var hasProp = {}.hasOwnProperty; var inherits = this.inherits = Rx.internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; var addProperties = Rx.internals.addProperties = function (obj) { var sources = slice.call(arguments, 1); for (var i = 0, len = sources.length; i < len; i++) { var source = sources[i]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } // Collections function IndexedItem(id, value) { this.id = id; this.value = value; } IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); c === 0 && (c = this.id - other.id); return c; }; // Priority Queue for Scheduling var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { +index || (index = 0); if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; delete this.items[this.length]; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { this.disposables = argsOrArray(arguments, 0); this.isDisposed = false; this.length = this.disposables.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Converts the existing CompositeDisposable to an array of disposables * @returns {Array} An array of disposable objects. */ CompositeDisposablePrototype.toArray = function () { return this.disposables.slice(0); }; /** * Provides a set of static methods for creating Disposables. * * @constructor * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function () { function BooleanDisposable () { this.isDisposed = false; this.current = null; } var booleanDisposablePrototype = BooleanDisposable.prototype; /** * Gets the underlying disposable. * @return The underlying disposable. */ booleanDisposablePrototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * @param {Disposable} value The new underlying disposable. */ booleanDisposablePrototype.setDisposable = function (value) { var shouldDispose = this.isDisposed, old; if (!shouldDispose) { old = this.current; this.current = value; } old && old.dispose(); shouldDispose && value && value.dispose(); }; /** * Disposes the underlying disposable as well as all future replacements. */ booleanDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } old && old.dispose(); }; return BooleanDisposable; }()); var SerialDisposable = Rx.SerialDisposable = SingleAssignmentDisposable; /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed) { if (!this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed) { if (!this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); function ScheduledDisposable(scheduler, disposable) { this.scheduler = scheduler; this.disposable = disposable; this.isDisposed = false; } ScheduledDisposable.prototype.dispose = function () { var parent = this; this.scheduler.schedule(function () { if (!parent.isDisposed) { parent.isDisposed = true; parent.disposable.dispose(); } }); }; var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); } ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return this.action(this.scheduler, this.state); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { this.now = now; this._schedule = schedule; this._scheduleRelative = scheduleRelative; this._scheduleAbsolute = scheduleAbsolute; } function invokeAction(scheduler, action) { action(); return disposableEmpty; } var schedulerProto = Scheduler.prototype; /** * Schedules an action to be executed. * @param {Function} action Action to execute. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (action) { return this._schedule(action, invokeAction); }; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithState = function (state, action) { return this._schedule(state, action); }; /** * Schedules an action to be executed after the specified relative due time. * @param {Function} action Action to execute. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelative = function (dueTime, action) { return this._scheduleRelative(action, dueTime, invokeAction); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative(state, dueTime, action); }; /** * Schedules an action to be executed at the specified absolute due time. * @param {Function} action Action to execute. * @param {Number} dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsolute = function (dueTime, action) { return this._scheduleAbsolute(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute(state, dueTime, action); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { timeSpan < 0 && (timeSpan = 0); return timeSpan; }; return Scheduler; }()); var normalizeTime = Scheduler.normalize; (function (schedulerProto) { function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function scheduleInnerRecursive(action, self) { action(function(dt) { self(action, dt); }); } /** * Schedules an action to be executed recursively. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (action) { return this.scheduleRecursiveWithState(action, function (_action, self) { _action(function () { self(_action); }); }); }; /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithState = function (state, action) { return this.scheduleWithState({ first: state, second: action }, invokeRecImmediate); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodic = function (period, action) { return this.schedulePeriodicWithState(null, period, action); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) { if (typeof root.setInterval === 'undefined') { throw new Error('Periodic scheduling not supported.'); } var s = state; var id = root.setInterval(function () { s = action(s); }, period); return disposableCreate(function () { root.clearInterval(id); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions. * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false. * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling. */ schedulerProto.catchError = schedulerProto['catch'] = function (handler) { return new CatchScheduler(this, handler); }; }(Scheduler.prototype)); var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () { function tick(command, recurse) { recurse(0, this._period); try { this._state = this._action(this._state); } catch (e) { this._cancel.dispose(); throw e; } } function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this))); return d; }; return SchedulePeriodicRecursive; }()); /** Gets a scheduler that schedules work immediately on the current thread. */ var immediateScheduler = Scheduler.immediate = (function () { function scheduleNow(state, action) { return action(this, state); } function scheduleRelative(state, dueTime, action) { var dt = normalizeTime(dueTime); while (dt - this.now() > 0) { } return action(this, state); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); }()); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var currentThreadScheduler = Scheduler.currentThread = (function () { var queue; function runTrampoline (q) { var item; while (q.length > 0) { item = q.dequeue(); if (!item.isCancelled()) { // Note, do not schedule blocking work! while (item.dueTime - Scheduler.now() > 0) { } if (!item.isCancelled()) { item.invoke(); } } } } function scheduleNow(state, action) { return this.scheduleWithRelativeAndState(state, 0, action); } function scheduleRelative(state, dueTime, action) { var dt = this.now() + Scheduler.normalize(dueTime), si = new ScheduledItem(this, state, action, dt); if (!queue) { queue = new PriorityQueue(4); queue.enqueue(si); try { runTrampoline(queue); } catch (e) { throw e; } finally { queue = null; } } else { queue.enqueue(si); } return si.disposable; } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); currentScheduler.scheduleRequired = function () { return !queue; }; currentScheduler.ensureTrampoline = function (action) { if (!queue) { this.schedule(action); } else { action(); } }; return currentScheduler; }()); var scheduleMethod, clearMethod = noop; var localTimer = (function () { var localSetTimeout, localClearTimeout = noop; if ('WScript' in this) { localSetTimeout = function (fn, time) { WScript.Sleep(time); fn(); }; } else if (!!root.setTimeout) { localSetTimeout = root.setTimeout; localClearTimeout = root.clearTimeout; } else { throw new Error('No concurrency detected!'); } return { setTimeout: localSetTimeout, clearTimeout: localClearTimeout }; }()); var localSetTimeout = localTimer.setTimeout, localClearTimeout = localTimer.clearTimeout; (function () { var reNative = RegExp('^' + String(toString) .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') .replace(/toString| for [^\]]+/g, '.*?') + '$' ); var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && !reNative.test(setImmediate) && setImmediate, clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' && !reNative.test(clearImmediate) && clearImmediate; function postMessageSupported () { // Ensure not in a worker if (!root.postMessage || root.importScripts) { return false; } var isAsync = false, oldHandler = root.onmessage; // Test for async root.onmessage = function () { isAsync = true; }; root.postMessage('', '*'); root.onmessage = oldHandler; return isAsync; } // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout if (typeof setImmediate === 'function') { scheduleMethod = setImmediate; clearMethod = clearImmediate; } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = process.nextTick; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(), tasks = {}, taskId = 0; var onGlobalPostMessage = function (event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { var handleId = event.data.substring(MSG_PREFIX.length), action = tasks[handleId]; action(); delete tasks[handleId]; } } if (root.addEventListener) { root.addEventListener('message', onGlobalPostMessage, false); } else { root.attachEvent('onmessage', onGlobalPostMessage, false); } scheduleMethod = function (action) { var currentId = taskId++; tasks[currentId] = action; root.postMessage(MSG_PREFIX + currentId, '*'); }; } else if (!!root.MessageChannel) { var channel = new root.MessageChannel(), channelTasks = {}, channelTaskId = 0; channel.port1.onmessage = function (event) { var id = event.data, action = channelTasks[id]; action(); delete channelTasks[id]; }; scheduleMethod = function (action) { var id = channelTaskId++; channelTasks[id] = action; channel.port2.postMessage(id); }; } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = root.document.createElement('script'); scriptElement.onreadystatechange = function () { action(); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; root.document.documentElement.appendChild(scriptElement); }; } else { scheduleMethod = function (action) { return localSetTimeout(action, 0); }; clearMethod = localClearTimeout; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var timeoutScheduler = Scheduler.timeout = (function () { function scheduleNow(state, action) { var scheduler = this, disposable = new SingleAssignmentDisposable(); var id = scheduleMethod(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }); return new CompositeDisposable(disposable, disposableCreate(function () { clearMethod(id); })); } function scheduleRelative(state, dueTime, action) { var scheduler = this, dt = Scheduler.normalize(dueTime); if (dt === 0) { return scheduler.scheduleWithState(state, action); } var disposable = new SingleAssignmentDisposable(); var id = localSetTimeout(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }, dt); return new CompositeDisposable(disposable, disposableCreate(function () { localClearTimeout(id); })); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); })(); var CatchScheduler = (function (__super__) { function scheduleNow(state, action) { return this._scheduler.scheduleWithState(state, this._wrap(action)); } function scheduleRelative(state, dueTime, action) { return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action)); } function scheduleAbsolute(state, dueTime, action) { return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action)); } inherits(CatchScheduler, __super__); function CatchScheduler(scheduler, handler) { this._scheduler = scheduler; this._handler = handler; this._recursiveOriginal = null; this._recursiveWrapper = null; __super__.call(this, this._scheduler.now.bind(this._scheduler), scheduleNow, scheduleRelative, scheduleAbsolute); } CatchScheduler.prototype._clone = function (scheduler) { return new CatchScheduler(scheduler, this._handler); }; CatchScheduler.prototype._wrap = function (action) { var parent = this; return function (self, state) { try { return action(parent._getRecursiveWrapper(self), state); } catch (e) { if (!parent._handler(e)) { throw e; } return disposableEmpty; } }; }; CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) { if (this._recursiveOriginal !== scheduler) { this._recursiveOriginal = scheduler; var wrapper = this._clone(scheduler); wrapper._recursiveOriginal = scheduler; wrapper._recursiveWrapper = wrapper; this._recursiveWrapper = wrapper; } return this._recursiveWrapper; }; CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) { var self = this, failed = false, d = new SingleAssignmentDisposable(); d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) { if (failed) { return null; } try { return action(state1); } catch (e) { failed = true; if (!self._handler(e)) { throw e; } d.dispose(); return null; } })); return d; }; return CatchScheduler; }(Scheduler)); /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification(kind, hasValue) { this.hasValue = hasValue == null ? false : hasValue; this.kind = kind; } /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * * @memberOf Notification * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Delegate to invoke for an OnError notification. * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { return observerOrOnNext && typeof observerOrOnNext === 'object' ? this._acceptObservable(observerOrOnNext) : this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notifications * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ Notification.prototype.toObservable = function (scheduler) { var notification = this; isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { notification._acceptObservable(observer); notification.kind === 'N' && observer.onCompleted(); }); }); }; return Notification; })(); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = (function () { function _accept (onNext) { return onNext(this.value); } function _acceptObservable(observer) { return observer.onNext(this.value); } function toString () { return 'OnNext(' + this.value + ')'; } return function (value) { var notification = new Notification('N', true); notification.value = value; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = (function () { function _accept (onNext, onError) { return onError(this.exception); } function _acceptObservable(observer) { return observer.onError(this.exception); } function toString () { return 'OnError(' + this.exception + ')'; } return function (e) { var notification = new Notification('E'); notification.exception = e; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { function _accept (onNext, onError, onCompleted) { return onCompleted(); } function _acceptObservable(observer) { return observer.onCompleted(); } function toString () { return 'OnCompleted()'; } return function () { var notification = new Notification('C'); notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); var Enumerator = Rx.internals.Enumerator = function (next) { this._next = next; }; Enumerator.prototype.next = function () { return this._next(); }; Enumerator.prototype[$iterator$] = function () { return this; } var Enumerable = Rx.internals.Enumerable = function (iterator) { this._iterator = iterator; }; Enumerable.prototype[$iterator$] = function () { return this._iterator(); }; Enumerable.prototype.concat = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch (err) { observer.onError(err); return; } var isDisposed, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var currentItem; if (isDisposed) { return; } try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { observer.onCompleted(); return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { self(); }) ); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; Enumerable.prototype.catchError = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch (err) { observer.onError(err); return; } var isDisposed, lastException, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { if (isDisposed) { return; } var currentItem; try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { if (lastException) { observer.onError(lastException); } else { observer.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), function (exn) { lastException = exn; self(); }, observer.onCompleted.bind(observer))); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { if (repeatCount == null) { repeatCount = -1; } return new Enumerable(function () { var left = repeatCount; return new Enumerator(function () { if (left === 0) { return doneEnumerator; } if (left > 0) { left--; } return { done: false, value: value }; }); }); }; var enumerableOf = Enumerable.of = function (source, selector, thisArg) { selector || (selector = identity); return new Enumerable(function () { var index = -1; return new Enumerator( function () { return ++index < source.length ? { done: false, value: selector.call(thisArg, source[index], index, source) } : doneEnumerator; }); }); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this)); }; /** * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. * If a violation is detected, an Error is thrown from the offending observer method call. * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer. */ Observer.prototype.checked = function () { return new CheckedObserver(this); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * * @static * @memberOf Observer * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler, thisArg) { return new AnonymousObserver(function (x) { return handler.call(thisArg, notificationCreateOnNext(x)); }, function (e) { return handler.call(thisArg, notificationCreateOnError(e)); }, function () { return handler.call(thisArg, notificationCreateOnCompleted()); }); }; /** * Schedules the invocation of observer methods on the given scheduler. * @param {Scheduler} scheduler Scheduler to schedule observer messages on. * @returns {Observer} Observer whose messages are scheduled on the given scheduler. */ Observer.prototype.notifyOn = function (scheduler) { return new ObserveOnObserver(scheduler, this); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) { inherits(AbstractObserver, __super__); /** * Creates a new observer in a non-stopped state. */ function AbstractObserver() { this.isStopped = false; __super__.call(this); } /** * Notifies the observer of a new element in the sequence. * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { if (!this.isStopped) { this.next(value); } }; /** * Notifies the observer that an exception has occurred. * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) { inherits(AnonymousObserver, __super__); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { __super__.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * @param {Any} error The error that has occurred. */ AnonymousObserver.prototype.error = function (error) { this._onError(error); }; /** * Calls the onCompleted action. */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var CheckedObserver = (function (_super) { inherits(CheckedObserver, _super); function CheckedObserver(observer) { _super.call(this); this._observer = observer; this._state = 0; // 0 - idle, 1 - busy, 2 - done } var CheckedObserverPrototype = CheckedObserver.prototype; CheckedObserverPrototype.onNext = function (value) { this.checkAccess(); try { this._observer.onNext(value); } catch (e) { throw e; } finally { this._state = 0; } }; CheckedObserverPrototype.onError = function (err) { this.checkAccess(); try { this._observer.onError(err); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.onCompleted = function () { this.checkAccess(); try { this._observer.onCompleted(); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.checkAccess = function () { if (this._state === 1) { throw new Error('Re-entrancy detected'); } if (this._state === 2) { throw new Error('Observer completed'); } if (this._state === 0) { this._state = 1; } }; return CheckedObserver; }(Observer)); var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) { inherits(ScheduledObserver, __super__); function ScheduledObserver(scheduler, observer) { __super__.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } ScheduledObserver.prototype.next = function (value) { var self = this; this.queue.push(function () { self.observer.onNext(value); }); }; ScheduledObserver.prototype.error = function (e) { var self = this; this.queue.push(function () { self.observer.onError(e); }); }; ScheduledObserver.prototype.completed = function () { var self = this; this.queue.push(function () { self.observer.onCompleted(); }); }; ScheduledObserver.prototype.ensureActive = function () { var isOwner = false, parent = this; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); } else { parent.isAcquired = false; return; } try { work(); } catch (ex) { parent.queue = []; parent.hasFaulted = true; throw ex; } self(); })); } }; ScheduledObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); var ObserveOnObserver = (function (__super__) { inherits(ObserveOnObserver, __super__); function ObserveOnObserver(scheduler, observer, cancel) { __super__.call(this, scheduler, observer); this._cancel = cancel; } ObserveOnObserver.prototype.next = function (value) { __super__.prototype.next.call(this, value); this.ensureActive(); }; ObserveOnObserver.prototype.error = function (e) { __super__.prototype.error.call(this, e); this.ensureActive(); }; ObserveOnObserver.prototype.completed = function () { __super__.prototype.completed.call(this); this.ensureActive(); }; ObserveOnObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this._cancel && this._cancel.dispose(); this._cancel = null; }; return ObserveOnObserver; })(ScheduledObserver); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { function Observable(subscribe) { if (Rx.config.longStackSupport && hasStacks) { try { throw new Error(); } catch (e) { this.stack = e.stack.substring(e.stack.indexOf("\n") + 1); } var self = this; this._subscribe = function (observer) { var oldOnError = observer.onError.bind(observer); observer.onError = function (err) { makeStackTraceLong(err, self); oldOnError(err); }; return subscribe(observer); }; } else { this._subscribe = subscribe; } } observableProto = Observable.prototype; /** * Subscribes an observer to the observable sequence. * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { return this._subscribe(typeof observerOrOnNext === 'object' ? observerOrOnNext : observerCreate(observerOrOnNext, onError, onCompleted)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onNext The function to invoke on each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnNext = function (onNext, thisArg) { return this._subscribe(observerCreate(arguments.length === 2 ? function(x) { onNext.call(thisArg, x); } : onNext)); }; /** * Subscribes to an exceptional condition in the sequence with an optional "this" argument. * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnError = function (onError, thisArg) { return this._subscribe(observerCreate(null, arguments.length === 2 ? function(e) { onError.call(thisArg, e); } : onError)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) { return this._subscribe(observerCreate(null, null, arguments.length === 2 ? function() { onCompleted.call(thisArg); } : onCompleted)); }; return Observable; })(); /** * Wraps the source sequence in order to run its observer callbacks on the specified scheduler. * * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects * that require to be run on a scheduler, use subscribeOn. * * @param {Scheduler} scheduler Scheduler to notify observers on. * @returns {Observable} The source sequence whose observations happen on the specified scheduler. */ observableProto.observeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(new ObserveOnObserver(scheduler, observer)); }, source); }; /** * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; * see the remarks section for more information on the distinction between subscribeOn and observeOn. * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer * callbacks on a scheduler, use observeOn. * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on. * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), d = new SerialDisposable(); d.setDisposable(m); m.setDisposable(scheduler.schedule(function () { d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer))); })); return d; }, source); }; /** * Converts a Promise to an Observable sequence * @param {Promise} An ES6 Compliant promise. * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. */ var observableFromPromise = Observable.fromPromise = function (promise) { return observableDefer(function () { var subject = new Rx.AsyncSubject(); promise.then( function (value) { subject.onNext(value); subject.onCompleted(); }, subject.onError.bind(subject)); return subject; }); }; /* * Converts an existing observable sequence to an ES6 Compatible Promise * @example * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); * * // With config * Rx.config.Promise = RSVP.Promise; * var promise = Rx.Observable.return(42).toPromise(); * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence. */ observableProto.toPromise = function (promiseCtor) { promiseCtor || (promiseCtor = Rx.config.Promise); if (!promiseCtor) { throw new TypeError('Promise type not provided nor in Rx.config.Promise'); } var source = this; return new promiseCtor(function (resolve, reject) { // No cancellation can be done var value, hasValue = false; source.subscribe(function (v) { value = v; hasValue = true; }, reject, function () { hasValue && resolve(value); }); }); }; /** * Creates an array from an observable sequence. * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { var source = this; return new AnonymousObservable(function(observer) { var arr = []; return source.subscribe( arr.push.bind(arr), observer.onError.bind(observer), function () { observer.onNext(arr); observer.onCompleted(); }); }, source); }; /** * Creates an observable sequence from a specified subscribe method implementation. * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = Observable.createWithDisposable = function (subscribe, parent) { return new AnonymousObservable(subscribe, parent); }; /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new AnonymousObservable(function (observer) { var result; try { result = observableFactory(); } catch (e) { return observableThrow(e).subscribe(observer); } isPromise(result) && (result = observableFromPromise(result)); return result.subscribe(observer); }); }; /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onCompleted(); }); }); }; var maxSafeInteger = Math.pow(2, 53) - 1; function StringIterable(str) { this._s = s; } StringIterable.prototype[$iterator$] = function () { return new StringIterator(this._s); }; function StringIterator(str) { this._s = s; this._l = s.length; this._i = 0; } StringIterator.prototype[$iterator$] = function () { return this; }; StringIterator.prototype.next = function () { if (this._i < this._l) { var val = this._s.charAt(this._i++); return { done: false, value: val }; } else { return doneEnumerator; } }; function ArrayIterable(a) { this._a = a; } ArrayIterable.prototype[$iterator$] = function () { return new ArrayIterator(this._a); }; function ArrayIterator(a) { this._a = a; this._l = toLength(a); this._i = 0; } ArrayIterator.prototype[$iterator$] = function () { return this; }; ArrayIterator.prototype.next = function () { if (this._i < this._l) { var val = this._a[this._i++]; return { done: false, value: val }; } else { return doneEnumerator; } }; function numberIsFinite(value) { return typeof value === 'number' && root.isFinite(value); } function isNan(n) { return n !== n; } function getIterable(o) { var i = o[$iterator$], it; if (!i && typeof o === 'string') { it = new StringIterable(o); return it[$iterator$](); } if (!i && o.length !== undefined) { it = new ArrayIterable(o); return it[$iterator$](); } if (!i) { throw new TypeError('Object is not iterable'); } return o[$iterator$](); } function sign(value) { var number = +value; if (number === 0) { return number; } if (isNaN(number)) { return number; } return number < 0 ? -1 : 1; } function toLength(o) { var len = +o.length; if (isNaN(len)) { return 0; } if (len === 0 || !numberIsFinite(len)) { return len; } len = sign(len) * Math.floor(Math.abs(len)); if (len <= 0) { return 0; } if (len > maxSafeInteger) { return maxSafeInteger; } return len; } /** * This method creates a new Observable sequence from an array-like or iterable object. * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. * @param {Function} [mapFn] Map function to call on every element of the array. * @param {Any} [thisArg] The context to use calling the mapFn if provided. * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) { if (iterable == null) { throw new Error('iterable cannot be null.') } if (mapFn && !isFunction(mapFn)) { throw new Error('mapFn when provided must be a function'); } isScheduler(scheduler) || (scheduler = currentThreadScheduler); var list = Object(iterable), it = getIterable(list); return new AnonymousObservable(function (observer) { var i = 0; return scheduler.scheduleRecursive(function (self) { var next; try { next = it.next(); } catch (e) { observer.onError(e); return; } if (next.done) { observer.onCompleted(); return; } var result = next.value; if (mapFn && isFunction(mapFn)) { try { result = mapFn.call(thisArg, result, i); } catch (e) { observer.onError(e); return; } } observer.onNext(result); i++; self(); }); }); }; /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * @deprecated use Observable.from or Observable.of * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { deprecate('fromArray', 'from'); isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0, len = array.length; return scheduler.scheduleRecursive(function (self) { if (count < len) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. * @returns {Observable} The generated sequence. */ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var first = true, state = initialState; return scheduler.scheduleRecursive(function (self) { var hasResult, result; try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); } } catch (exception) { observer.onError(exception); return; } if (hasResult) { observer.onNext(result); self(); } else { observer.onCompleted(); } }); }); }; function observableOf (scheduler, array) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0, len = array.length; return scheduler.scheduleRecursive(function (self) { if (count < len) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); } /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.of = function () { return observableOf(null, arguments); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.ofWithScheduler = function (scheduler) { return observableOf(scheduler, slice.call(arguments, 1)); }; /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return new AnonymousObservable(function () { return disposableEmpty; }); }; /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.range(0, 10); * var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout); * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { return scheduler.scheduleRecursiveWithState(0, function (i, self) { if (i < count) { observer.onNext(start + i); self(i + 1); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.repeat(42); * var res = Rx.Observable.repeat(42, 4); * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout); * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout); * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount); }; /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'just', and 'returnValue' for browsers <IE9. * * @example * var res = Rx.Observable.return(42); * var res = Rx.Observable.return(42, Rx.Scheduler.timeout); * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable['return'] = Observable.just = function (value, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onNext(value); observer.onCompleted(); }); }); }; /** @deprecated use return or just */ Observable.returnValue = function () { deprecate('returnValue', 'return or just'); return observableReturn.apply(null, arguments); }; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * There is an alias to this method called 'throwError' for browsers <IE9. * @param {Mixed} exception An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable['throw'] = Observable.throwException = Observable.throwError = function (exception, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onError(exception); }); }); }; /** * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. * @param {Function} resourceFactory Factory function to obtain a resource object. * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource. * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object. */ Observable.using = function (resourceFactory, observableFactory) { return new AnonymousObservable(function (observer) { var disposable = disposableEmpty, resource, source; try { resource = resourceFactory(); resource && (disposable = resource); source = observableFactory(resource); } catch (exception) { return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable); } return new CompositeDisposable(source.subscribe(observer), disposable); }); }; /** * Propagates the observable sequence or Promise that reacts first. * @param {Observable} rightSource Second observable sequence or Promise. * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first. */ observableProto.amb = function (rightSource) { var leftSource = this; return new AnonymousObservable(function (observer) { var choice, leftChoice = 'L', rightChoice = 'R', leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable(); isPromise(rightSource) && (rightSource = observableFromPromise(rightSource)); function choiceL() { if (!choice) { choice = leftChoice; rightSubscription.dispose(); } } function choiceR() { if (!choice) { choice = rightChoice; leftSubscription.dispose(); } } leftSubscription.setDisposable(leftSource.subscribe(function (left) { choiceL(); if (choice === leftChoice) { observer.onNext(left); } }, function (err) { choiceL(); if (choice === leftChoice) { observer.onError(err); } }, function () { choiceL(); if (choice === leftChoice) { observer.onCompleted(); } })); rightSubscription.setDisposable(rightSource.subscribe(function (right) { choiceR(); if (choice === rightChoice) { observer.onNext(right); } }, function (err) { choiceR(); if (choice === rightChoice) { observer.onError(err); } }, function () { choiceR(); if (choice === rightChoice) { observer.onCompleted(); } })); return new CompositeDisposable(leftSubscription, rightSubscription); }); }; /** * Propagates the observable sequence or Promise that reacts first. * * @example * var = Rx.Observable.amb(xs, ys, zs); * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first. */ Observable.amb = function () { var acc = observableNever(), items = argsOrArray(arguments, 0); function func(previous, current) { return previous.amb(current); } for (var i = 0, len = items.length; i < len; i++) { acc = func(acc, items[i]); } return acc; }; function observableCatchHandler(source, handler) { return new AnonymousObservable(function (observer) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) { var d, result; try { result = handler(exception); } catch (ex) { observer.onError(ex); return; } isPromise(result) && (result = observableFromPromise(result)); d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(result.subscribe(observer)); }, observer.onCompleted.bind(observer))); return subscription; }, source); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @example * 1 - xs.catchException(ys) * 2 - xs.catchException(function (ex) { return ys(ex); }) * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto['catch'] = observableProto.catchError = function (handlerOrSecond) { return typeof handlerOrSecond === 'function' ? observableCatchHandler(this, handlerOrSecond) : observableCatch([this, handlerOrSecond]); }; /** * @deprecated use #catch or #catchError instead. */ observableProto.catchException = function (handlerOrSecond) { deprecate('catchException', 'catch or catchError'); return this.catchError(handlerOrSecond); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs. * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable.catchError = Observable['catch'] = function () { return enumerableOf(argsOrArray(arguments, 0)).catchError(); }; /** * @deprecated use #catch or #catchError instead. */ Observable.catchException = function () { deprecate('catchException', 'catch or catchError'); return observableCatch.apply(null, arguments); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var args = slice.call(arguments); if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var args = slice.call(arguments), resultSelector = args.pop(); if (Array.isArray(args[0])) { args = args[0]; } return new AnonymousObservable(function (observer) { var falseFactory = function () { return false; }, n = args.length, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), values = new Array(n); function next(i) { var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } } function done (i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = args[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { values[i] = x; next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; }(idx)); } return new CompositeDisposable(subscriptions); }, this); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * * @example * 1 - concatenated = xs.concat(ys, zs); * 2 - concatenated = xs.concat([ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { var items = slice.call(arguments, 0); items.unshift(this); return observableConcat.apply(this, items); }; /** * Concatenates all the observable sequences. * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence. * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { return enumerableOf(argsOrArray(arguments, 0)).concat(); }; /** * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatAll = function () { return this.merge(1); }; /** @deprecated Use `concatAll` instead. */ observableProto.concatObservable = function () { deprecate('concatObservable', 'concatAll'); return this.merge(1); }; /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * * @example * 1 - merged = sources.merge(1); * 2 - merged = source.merge(otherSource); * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); } var sources = this; return new AnonymousObservable(function (observer) { var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = []; function subscribe(xs) { var subscription = new SingleAssignmentDisposable(); group.add(subscription); // Check for promises support isPromise(xs) && (xs = observableFromPromise(xs)); subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { group.remove(subscription); if (q.length > 0) { subscribe(q.shift()); } else { activeCount--; isStopped && activeCount === 0 && observer.onCompleted(); } })); } group.add(sources.subscribe(function (innerSource) { if (activeCount < maxConcurrentOrOther) { activeCount++; subscribe(innerSource); } else { q.push(innerSource); } }, observer.onError.bind(observer), function () { isStopped = true; activeCount === 0 && observer.onCompleted(); })); return group; }, sources); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources; if (!arguments[0]) { scheduler = immediateScheduler; sources = slice.call(arguments, 1); } else if (isScheduler(arguments[0])) { scheduler = arguments[0]; sources = slice.call(arguments, 1); } else { scheduler = immediateScheduler; sources = slice.call(arguments, 0); } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableOf(scheduler, sources).mergeAll(); }; /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeAll = function () { var sources = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(), isStopped = false, m = new SingleAssignmentDisposable(); group.add(m); m.setDisposable(sources.subscribe(function (innerSource) { var innerSubscription = new SingleAssignmentDisposable(); group.add(innerSubscription); // Check for promises support isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); innerSubscription.setDisposable(innerSource.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { group.remove(innerSubscription); isStopped && group.length === 1 && observer.onCompleted(); })); }, observer.onError.bind(observer), function () { isStopped = true; group.length === 1 && observer.onCompleted(); })); return group; }, sources); }; /** * @deprecated use #mergeAll instead. */ observableProto.mergeObservable = function () { deprecate('mergeObservable', 'mergeAll'); return this.mergeAll.apply(this, arguments); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates. * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. */ observableProto.onErrorResumeNext = function (second) { if (!second) { throw new Error('Second observable is required'); } return onErrorResumeNext([this, second]); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs); * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]); * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. */ var onErrorResumeNext = Observable.onErrorResumeNext = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var pos = 0, subscription = new SerialDisposable(), cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, d; if (pos < sources.length) { current = sources[pos++]; isPromise(current) && (current = observableFromPromise(current)); d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self)); } else { observer.onCompleted(); } }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { var isOpen = false; var disposables = new CompositeDisposable(source.subscribe(function (left) { isOpen && observer.onNext(left); }, observer.onError.bind(observer), function () { isOpen && observer.onCompleted(); })); isPromise(other) && (other = observableFromPromise(other)); var rightSubscription = new SingleAssignmentDisposable(); disposables.add(rightSubscription); rightSubscription.setDisposable(other.subscribe(function () { isOpen = true; rightSubscription.dispose(); }, observer.onError.bind(observer), function () { rightSubscription.dispose(); })); return disposables; }, source); }; /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasLatest = false, innerSubscription = new SerialDisposable(), isStopped = false, latest = 0, subscription = sources.subscribe( function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++latest; hasLatest = true; innerSubscription.setDisposable(d); // Check if Promise or Observable isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); d.setDisposable(innerSource.subscribe( function (x) { latest === id && observer.onNext(x); }, function (e) { latest === id && observer.onError(e); }, function () { if (latest === id) { hasLatest = false; isStopped && observer.onCompleted(); } })); }, observer.onError.bind(observer), function () { isStopped = true; !hasLatest && observer.onCompleted(); }); return new CompositeDisposable(subscription, innerSubscription); }, sources); }; /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { isPromise(other) && (other = observableFromPromise(other)); return new CompositeDisposable( source.subscribe(observer), other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop) ); }, source); }; function zipArray(second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var index = 0, len = second.length; return first.subscribe(function (left) { if (index < len) { var right = second[index++], result; try { result = resultSelector(left, right); } catch (e) { observer.onError(e); return; } observer.onNext(result); } else { observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, first); } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources. * * @example * 1 - res = obs1.zip(obs2, fn); * 1 - res = x1.zip([1,2,3], fn); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.zip = function () { if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } var parent = this, sources = slice.call(arguments), resultSelector = sources.pop(); sources.unshift(parent); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { var res, queuedValues; if (queues.every(function (x) { return x.length > 0; })) { try { queuedValues = queues.map(function (x) { return x.shift(); }); res = resultSelector.apply(parent, queuedValues); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } }; function done(i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = sources[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; })(idx); } return new CompositeDisposable(subscriptions); }, parent); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var args = slice.call(arguments, 0), first = args.shift(); return first.zip.apply(first, args); }; /** * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. * @param arguments Observable sources. * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes. */ Observable.zipArray = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { if (queues.every(function (x) { return x.length > 0; })) { var res = queues.map(function (x) { return x.shift(); }); observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); return; } }; function done(i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); return; } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } var compositeDisposable = new CompositeDisposable(subscriptions); compositeDisposable.add(disposableCreate(function () { for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) { queues[qIdx] = []; } })); return compositeDisposable; }); }; /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { return new AnonymousObservable(this.subscribe.bind(this), this); }; /** * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. * * @example * var res = xs.bufferWithCount(10); * var res = xs.bufferWithCount(10, 1); * @param {Number} count Length of each buffer. * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithCount = function (count, skip) { if (typeof skip !== 'number') { skip = count; } return this.windowWithCount(count, skip).selectMany(function (x) { return x.toArray(); }).where(function (x) { return x.length > 0; }); }; /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { return x.accept(observer); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, this); }; /** * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. * * var obs = observable.distinctUntilChanged(); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); * * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keySelector, comparer) { var source = this; keySelector || (keySelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hasCurrentKey = false, currentKey; return source.subscribe(function (value) { var comparerEquals = false, key; try { key = keySelector(value); } catch (e) { observer.onError(e); return; } if (hasCurrentKey) { try { comparerEquals = comparer(currentKey, key); } catch (e) { observer.onError(e); return; } } if (!hasCurrentKey || !comparerEquals) { hasCurrentKey = true; currentKey = key; observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, this); }; /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an observer. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.tap = function (observerOrOnNext, onError, onCompleted) { var source = this, onNextFunc; if (typeof observerOrOnNext === 'function') { onNextFunc = observerOrOnNext; } else { onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext); onError = observerOrOnNext.onError.bind(observerOrOnNext); onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext); } return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { try { onNextFunc(x); } catch (e) { observer.onError(e); } observer.onNext(x); }, function (err) { if (onError) { try { onError(err); } catch (e) { observer.onError(e); } } observer.onError(err); }, function () { if (onCompleted) { try { onCompleted(); } catch (e) { observer.onError(e); } } observer.onCompleted(); }); }, this); }; /** @deprecated use #do or #tap instead. */ observableProto.doAction = function () { deprecate('doAction', 'do or tap'); return this.tap.apply(this, arguments); }; /** * Invokes an action for each element in the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onNext Action to invoke for each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) { return this.tap(arguments.length === 2 ? function (x) { onNext.call(thisArg, x); } : onNext); }; /** * Invokes an action upon exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) { return this.tap(noop, arguments.length === 2 ? function (e) { onError.call(thisArg, e); } : onError); }; /** * Invokes an action upon graceful termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) { return this.tap(noop, null, arguments.length === 2 ? function () { onCompleted.call(thisArg); } : onCompleted); }; /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = observableProto.ensure = function (action) { var source = this; return new AnonymousObservable(function (observer) { var subscription; try { subscription = source.subscribe(observer); } catch (e) { action(); throw e; } return disposableCreate(function () { try { subscription.dispose(); } catch (e) { throw e; } finally { action(); } }); }, this); }; /** * @deprecated use #finally or #ensure instead. */ observableProto.finallyAction = function (action) { deprecate('finallyAction', 'finally or ensure'); return this.ensure(action); }; /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, source); }; /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (value) { observer.onNext(notificationCreateOnNext(value)); }, function (e) { observer.onNext(notificationCreateOnError(e)); observer.onCompleted(); }, function () { observer.onNext(notificationCreateOnCompleted()); observer.onCompleted(); }); }, source); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * Note if you encounter an error and want it to retry once, then you must use .retry(2); * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(2); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchError(); }; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(0, function (acc, x) { return acc + x; }); * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator, source = this; if (arguments.length === 2) { hasSeed = true; seed = arguments[0]; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return new AnonymousObservable(function (observer) { var hasAccumulation, accumulation, hasValue; return source.subscribe ( function (x) { !hasValue && (hasValue = true); try { if (hasAccumulation) { accumulation = accumulator(accumulation, x); } else { accumulation = hasSeed ? accumulator(seed, x) : x; hasAccumulation = true; } } catch (e) { observer.onError(e); return; } observer.onNext(accumulation); }, observer.onError.bind(observer), function () { !hasValue && hasSeed && observer.onNext(seed); observer.onCompleted(); } ); }, source); }; /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && observer.onNext(q.shift()); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, source); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * @example * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * @param {Arguments} args The specified values to prepend to the observable sequence * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && isScheduler(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } values = slice.call(arguments, start); return enumerableOf([observableFromArray(values, scheduler), this]).concat(); }; /** * Returns a specified number of contiguous elements from the end of an observable sequence. * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { while (q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); }); }, source); }; /** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { observer.onNext(q); observer.onCompleted(); }); }, source); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on element count information. * * var res = xs.windowWithCount(10); * var res = xs.windowWithCount(10, 1); * @param {Number} count Length of each window. * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithCount = function (count, skip) { var source = this; +count || (count = 0); Math.abs(count) === Infinity && (count = 0); if (count <= 0) { throw new Error(argumentOutOfRange); } skip == null && (skip = count); +skip || (skip = 0); Math.abs(skip) === Infinity && (skip = 0); if (skip <= 0) { throw new Error(argumentOutOfRange); } return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), refCountDisposable = new RefCountDisposable(m), n = 0, q = []; function createWindow () { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); } createWindow(); m.setDisposable(source.subscribe( function (x) { for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } var c = n - count + 1; c >= 0 && c % skip === 0 && q.shift().onCompleted(); ++n % skip === 0 && createWindow(); }, function (e) { while (q.length > 0) { q.shift().onError(e); } observer.onError(e); }, function () { while (q.length > 0) { q.shift().onCompleted(); } observer.onCompleted(); } )); return refCountDisposable; }, source); }; function concatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i, source); isPromise(result) && (result = observableFromPromise(result)); (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result)); return result; }).concatAll(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.concatMap(Rx.Observable.fromArray([1,2,3])); * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the * source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) { if (isFunction(selector) && isFunction(resultSelector)) { return this.concatMap(function (x, i) { var selectorResult = selector(x, i); isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult)); (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult)); return selectorResult.map(function (y, i2) { return resultSelector(x, y, i, i2); }); }); } return isFunction(selector) ? concatMap(this, selector, thisArg) : concatMap(this, function () { return selector; }); }; /** * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNext.call(thisArg, x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onError.call(thisArg, err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompleted.call(thisArg); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }, this).concatAll(); }; /** * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. * * var res = obs = xs.defaultIfEmpty(); * 2 - obs = xs.defaultIfEmpty(false); * * @memberOf Observable# * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null. * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. */ observableProto.defaultIfEmpty = function (defaultValue) { var source = this; defaultValue === undefined && (defaultValue = null); return new AnonymousObservable(function (observer) { var found = false; return source.subscribe(function (x) { found = true; observer.onNext(x); }, observer.onError.bind(observer), function () { !found && observer.onNext(defaultValue); observer.onCompleted(); }); }, this); }; // Swap out for Array.findIndex function arrayIndexOfComparer(array, item, comparer) { for (var i = 0, len = array.length; i < len; i++) { if (comparer(array[i], item)) { return i; } } return -1; } function HashSet(comparer) { this.comparer = comparer; this.set = []; } HashSet.prototype.push = function(value) { var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1; retValue && this.set.push(value); return retValue; }; /** * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. * * @example * var res = obs = xs.distinct(); * 2 - obs = xs.distinct(function (x) { return x.id; }); * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; }); * @param {Function} [keySelector] A function to compute the comparison key for each element. * @param {Function} [comparer] Used to compare items in the collection. * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. */ observableProto.distinct = function (keySelector, comparer) { var source = this; comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hashSet = new HashSet(comparer); return source.subscribe(function (x) { var key = x; if (keySelector) { try { key = keySelector(x); } catch (e) { observer.onError(e); return; } } hashSet.push(key) && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, this); }; /** * Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function. * * @example * var res = observable.groupBy(function (x) { return x.id; }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); }); * @param {Function} keySelector A function to extract the key for each element. * @param {Function} [elementSelector] A function to map each source element to an element in an observable group. * @param {Function} [comparer] Used to determine whether the objects are equal. * @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. */ observableProto.groupBy = function (keySelector, elementSelector, comparer) { return this.groupByUntil(keySelector, elementSelector, observableNever, comparer); }; /** * Groups the elements of an observable sequence according to a specified key selector function. * A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same * key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. * * @example * var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); }); * @param {Function} keySelector A function to extract the key for each element. * @param {Function} durationSelector A function to signal the expiration of a group. * @param {Function} [comparer] Used to compare objects. When not specified, the default comparer is used. * @returns {Observable} * A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. * If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered. * */ observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, comparer) { var source = this; elementSelector || (elementSelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { function handleError(e) { return function (item) { item.onError(e); }; } var map = new Dictionary(0, comparer), groupDisposable = new CompositeDisposable(), refCountDisposable = new RefCountDisposable(groupDisposable); groupDisposable.add(source.subscribe(function (x) { var key; try { key = keySelector(x); } catch (e) { map.getValues().forEach(handleError(e)); observer.onError(e); return; } var fireNewMapEntry = false, writer = map.tryGetValue(key); if (!writer) { writer = new Subject(); map.set(key, writer); fireNewMapEntry = true; } if (fireNewMapEntry) { var group = new GroupedObservable(key, writer, refCountDisposable), durationGroup = new GroupedObservable(key, writer); try { duration = durationSelector(durationGroup); } catch (e) { map.getValues().forEach(handleError(e)); observer.onError(e); return; } observer.onNext(group); var md = new SingleAssignmentDisposable(); groupDisposable.add(md); var expire = function () { map.remove(key) && writer.onCompleted(); groupDisposable.remove(md); }; md.setDisposable(duration.take(1).subscribe( noop, function (exn) { map.getValues().forEach(handleError(exn)); observer.onError(exn); }, expire) ); } var element; try { element = elementSelector(x); } catch (e) { map.getValues().forEach(handleError(e)); observer.onError(e); return; } writer.onNext(element); }, function (ex) { map.getValues().forEach(handleError(ex)); observer.onError(ex); }, function () { map.getValues().forEach(function (item) { item.onCompleted(); }); observer.onCompleted(); })); return refCountDisposable; }, source); }; /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.select = observableProto.map = function (selector, thisArg) { var selectorFn = isFunction(selector) ? selector : function () { return selector; }, source = this; return new AnonymousObservable(function (observer) { var count = 0; return source.subscribe(function (value) { var result; try { result = selectorFn.call(thisArg, value, count++, source); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, source); }; /** * Retrieves the value of a specified property from all elements in the Observable sequence. * @param {String} prop The property to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function (prop) { return this.map(function (x) { return x[prop]; }); }; function flatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i, source); isPromise(result) && (result = observableFromPromise(result)); (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result)); return result; }).mergeAll(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.selectMany(Rx.Observable.fromArray([1,2,3])); * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) { if (isFunction(selector) && isFunction(resultSelector)) { return this.flatMap(function (x, i) { var selectorResult = selector(x, i); isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult)); (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult)); return selectorResult.map(function (y, i2) { return resultSelector(x, y, i, i2); }); }, thisArg); } return isFunction(selector) ? flatMap(this, selector, thisArg) : flatMap(this, function () { return selector; }); }; /** * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNext.call(thisArg, x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onError.call(thisArg, err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompleted.call(thisArg); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }, source).mergeAll(); }; /** * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) { return this.select(selector, thisArg).switchLatest(); }; /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new Error(argumentOutOfRange); } var source = this; return new AnonymousObservable(function (observer) { var remaining = count; return source.subscribe(function (x) { if (remaining <= 0) { observer.onNext(x); } else { remaining--; } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, source); }; /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = false; return source.subscribe(function (x) { if (!running) { try { running = !predicate.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } } running && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, source); }; /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * * var res = source.take(5); * var res = source.take(0, Rx.Scheduler.timeout); * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new RangeError(argumentOutOfRange); } if (count === 0) { return observableEmpty(scheduler); } var source = this; return new AnonymousObservable(function (observer) { var remaining = count; return source.subscribe(function (x) { if (remaining-- > 0) { observer.onNext(x); remaining === 0 && observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, source); }; /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = true; return source.subscribe(function (x) { if (running) { try { running = predicate.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } if (running) { observer.onNext(x); } else { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, source); }; /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * * @example * var res = source.where(function (value) { return value < 10; }); * var res = source.where(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.where = observableProto.filter = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var count = 0; return source.subscribe(function (value) { var shouldRun; try { shouldRun = predicate.call(thisArg, value, count++, source); } catch (e) { observer.onError(e); return; } shouldRun && observer.onNext(value); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, source); }; observableProto.finalValue = function () { var source = this; return new AnonymousObservable(function (observer) { var hasValue = false, value; return source.subscribe(function (x) { hasValue = true; value = x; }, observer.onError.bind(observer), function () { if (!hasValue) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }, source); }; function extremaBy(source, keySelector, comparer) { return new AnonymousObservable(function (observer) { var hasValue = false, lastKey = null, list = []; return source.subscribe(function (x) { var comparison, key; try { key = keySelector(x); } catch (ex) { observer.onError(ex); return; } comparison = 0; if (!hasValue) { hasValue = true; lastKey = key; } else { try { comparison = comparer(key, lastKey); } catch (ex1) { observer.onError(ex1); return; } } if (comparison > 0) { lastKey = key; list = []; } if (comparison >= 0) { list.push(x); } }, observer.onError.bind(observer), function () { observer.onNext(list); observer.onCompleted(); }); }, source); } function firstOnly(x) { if (x.length === 0) { throw new Error(sequenceContainsNoElements); } return x[0]; } /** * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value. * For aggregation behavior with incremental intermediate results, see Observable.scan. * @deprecated Use #reduce instead * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing a single element with the final accumulator value. */ observableProto.aggregate = function () { deprecate('aggregate', 'reduce'); var seed, hasSeed, accumulator; if (arguments.length === 2) { seed = arguments[0]; hasSeed = true; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return hasSeed ? this.scan(seed, accumulator).startWith(seed).finalValue() : this.scan(accumulator).finalValue(); }; /** * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value. * For aggregation behavior with incremental intermediate results, see Observable.scan. * @param {Function} accumulator An accumulator function to be invoked on each element. * @param {Any} [seed] The initial accumulator value. * @returns {Observable} An observable sequence containing a single element with the final accumulator value. */ observableProto.reduce = function (accumulator) { var seed, hasSeed; if (arguments.length === 2) { hasSeed = true; seed = arguments[1]; } return hasSeed ? this.scan(seed, accumulator).startWith(seed).finalValue() : this.scan(accumulator).finalValue(); }; /** * Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence. * @param {Function} [predicate] A function to test each element for a condition. * @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence. */ observableProto.some = function (predicate, thisArg) { var source = this; return predicate ? source.filter(predicate, thisArg).some() : new AnonymousObservable(function (observer) { return source.subscribe(function () { observer.onNext(true); observer.onCompleted(); }, observer.onError.bind(observer), function () { observer.onNext(false); observer.onCompleted(); }); }, source); }; /** @deprecated use #some instead */ observableProto.any = function () { deprecate('any', 'some'); return this.some.apply(this, arguments); }; /** * Determines whether an observable sequence is empty. * @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty. */ observableProto.isEmpty = function () { return this.any().map(not); }; /** * Determines whether all elements of an observable sequence satisfy a condition. * @param {Function} [predicate] A function to test each element for a condition. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate. */ observableProto.every = function (predicate, thisArg) { return this.filter(function (v) { return !predicate(v); }, thisArg).some().map(not); }; /** @deprecated use #every instead */ observableProto.all = function () { deprecate('all', 'every'); return this.every.apply(this, arguments); }; /** * Determines whether an observable sequence contains a specified element with an optional equality comparer. * @param searchElement The value to locate in the source sequence. * @param {Number} [fromIndex] An equality comparer to compare elements. * @returns {Observable} An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value from the given index. */ observableProto.contains = function (searchElement, fromIndex) { var source = this; function comparer(a, b) { return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b))); } return new AnonymousObservable(function (observer) { var i = 0, n = +fromIndex || 0; Math.abs(n) === Infinity && (n = 0); if (n < 0) { observer.onNext(false); observer.onCompleted(); return disposableEmpty; } return source.subscribe( function (x) { if (i++ >= n && comparer(x, searchElement)) { observer.onNext(true); observer.onCompleted(); } }, observer.onError.bind(observer), function () { observer.onNext(false); observer.onCompleted(); }); }, this); }; /** * Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items. * @example * res = source.count(); * res = source.count(function (x) { return x > 3; }); * @param {Function} [predicate]A function to test each element for a condition. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence. */ observableProto.count = function (predicate, thisArg) { return predicate ? this.where(predicate, thisArg).count() : this.aggregate(0, function (count) { return count + 1; }); }; /** * Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present. * @param {Any} searchElement Element to locate in the array. * @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0. * @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present. */ observableProto.indexOf = function(searchElement, fromIndex) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, n = +fromIndex || 0; Math.abs(n) === Infinity && (n = 0); if (n < 0) { observer.onNext(-1); observer.onCompleted(); return disposableEmpty; } return source.subscribe( function (x) { if (i >= n && x === searchElement) { observer.onNext(i); observer.onCompleted(); } i++; }, observer.onError.bind(observer), function () { observer.onNext(-1); observer.onCompleted(); }); }, source); }; /** * Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence. * @param {Function} [selector] A transform function to apply to each element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence. */ observableProto.sum = function (keySelector, thisArg) { return keySelector && isFunction(keySelector) ? this.map(keySelector, thisArg).sum() : this.reduce(function (prev, curr) { return prev + curr; }, 0); }; /** * Returns the elements in an observable sequence with the minimum key value according to the specified comparer. * @example * var res = source.minBy(function (x) { return x.value; }); * var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; }); * @param {Function} keySelector Key selector function. * @param {Function} [comparer] Comparer used to compare key values. * @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value. */ observableProto.minBy = function (keySelector, comparer) { comparer || (comparer = defaultSubComparer); return extremaBy(this, keySelector, function (x, y) { return comparer(x, y) * -1; }); }; /** * Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check. * @example * var res = source.min(); * var res = source.min(function (x, y) { return x.value - y.value; }); * @param {Function} [comparer] Comparer used to compare elements. * @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence. */ observableProto.min = function (comparer) { return this.minBy(identity, comparer).map(function (x) { return firstOnly(x); }); }; /** * Returns the elements in an observable sequence with the maximum key value according to the specified comparer. * @example * var res = source.maxBy(function (x) { return x.value; }); * var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; }); * @param {Function} keySelector Key selector function. * @param {Function} [comparer] Comparer used to compare key values. * @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value. */ observableProto.maxBy = function (keySelector, comparer) { comparer || (comparer = defaultSubComparer); return extremaBy(this, keySelector, comparer); }; /** * Returns the maximum value in an observable sequence according to the specified comparer. * @example * var res = source.max(); * var res = source.max(function (x, y) { return x.value - y.value; }); * @param {Function} [comparer] Comparer used to compare elements. * @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence. */ observableProto.max = function (comparer) { return this.maxBy(identity, comparer).map(function (x) { return firstOnly(x); }); }; /** * Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present. * @param {Function} [selector] A transform function to apply to each element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with the average of the sequence of values. */ observableProto.average = function (keySelector, thisArg) { return keySelector && isFunction(keySelector) ? this.select(keySelector, thisArg).average() : this.scan({sum: 0, count: 0 }, function (prev, cur) { return { sum: prev.sum + cur, count: prev.count + 1 }; }).finalValue().map(function (s) { if (s.count === 0) { throw new Error('The input sequence was empty'); } return s.sum / s.count; }); }; /** * Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer. * * @example * var res = res = source.sequenceEqual([1,2,3]); * var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; }); * 3 - res = source.sequenceEqual(Rx.Observable.returnValue(42)); * 4 - res = source.sequenceEqual(Rx.Observable.returnValue({ value: 42 }), function (x, y) { return x.value === y.value; }); * @param {Observable} second Second observable sequence or array to compare. * @param {Function} [comparer] Comparer used to compare elements of both sequences. * @returns {Observable} An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer. */ observableProto.sequenceEqual = function (second, comparer) { var first = this; comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var donel = false, doner = false, ql = [], qr = []; var subscription1 = first.subscribe(function (x) { var equal, v; if (qr.length > 0) { v = qr.shift(); try { equal = comparer(v, x); } catch (e) { observer.onError(e); return; } if (!equal) { observer.onNext(false); observer.onCompleted(); } } else if (doner) { observer.onNext(false); observer.onCompleted(); } else { ql.push(x); } }, observer.onError.bind(observer), function () { donel = true; if (ql.length === 0) { if (qr.length > 0) { observer.onNext(false); observer.onCompleted(); } else if (doner) { observer.onNext(true); observer.onCompleted(); } } }); (isArrayLike(second) || isIterable(second)) && (second = observableFrom(second)); isPromise(second) && (second = observableFromPromise(second)); var subscription2 = second.subscribe(function (x) { var equal; if (ql.length > 0) { var v = ql.shift(); try { equal = comparer(v, x); } catch (exception) { observer.onError(exception); return; } if (!equal) { observer.onNext(false); observer.onCompleted(); } } else if (donel) { observer.onNext(false); observer.onCompleted(); } else { qr.push(x); } }, observer.onError.bind(observer), function () { doner = true; if (qr.length === 0) { if (ql.length > 0) { observer.onNext(false); observer.onCompleted(); } else if (donel) { observer.onNext(true); observer.onCompleted(); } } }); return new CompositeDisposable(subscription1, subscription2); }, first); }; function elementAtOrDefault(source, index, hasDefault, defaultValue) { if (index < 0) { throw new Error(argumentOutOfRange); } return new AnonymousObservable(function (observer) { var i = index; return source.subscribe(function (x) { if (i-- === 0) { observer.onNext(x); observer.onCompleted(); } }, observer.onError.bind(observer), function () { if (!hasDefault) { observer.onError(new Error(argumentOutOfRange)); } else { observer.onNext(defaultValue); observer.onCompleted(); } }); }, source); } /** * Returns the element at a specified index in a sequence. * @example * var res = source.elementAt(5); * @param {Number} index The zero-based index of the element to retrieve. * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence. */ observableProto.elementAt = function (index) { return elementAtOrDefault(this, index, false); }; /** * Returns the element at a specified index in a sequence or a default value if the index is out of range. * @example * var res = source.elementAtOrDefault(5); * var res = source.elementAtOrDefault(5, 0); * @param {Number} index The zero-based index of the element to retrieve. * @param [defaultValue] The default value if the index is outside the bounds of the source sequence. * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence. */ observableProto.elementAtOrDefault = function (index, defaultValue) { return elementAtOrDefault(this, index, true, defaultValue); }; function singleOrDefaultAsync(source, hasDefault, defaultValue) { return new AnonymousObservable(function (observer) { var value = defaultValue, seenValue = false; return source.subscribe(function (x) { if (seenValue) { observer.onError(new Error('Sequence contains more than one element')); } else { value = x; seenValue = true; } }, observer.onError.bind(observer), function () { if (!seenValue && !hasDefault) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }, source); } /** * Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence. * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate. */ observableProto.single = function (predicate, thisArg) { return predicate && isFunction(predicate) ? this.where(predicate, thisArg).single() : singleOrDefaultAsync(this, false); }; /** * Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence. * @example * var res = res = source.singleOrDefault(); * var res = res = source.singleOrDefault(function (x) { return x === 42; }); * res = source.singleOrDefault(function (x) { return x === 42; }, 0); * res = source.singleOrDefault(null, 0); * @memberOf Observable# * @param {Function} predicate A predicate function to evaluate for elements in the source sequence. * @param [defaultValue] The default value if the index is outside the bounds of the source sequence. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. */ observableProto.singleOrDefault = function (predicate, defaultValue, thisArg) { return predicate && isFunction(predicate) ? this.where(predicate, thisArg).singleOrDefault(null, defaultValue) : singleOrDefaultAsync(this, true, defaultValue); }; function firstOrDefaultAsync(source, hasDefault, defaultValue) { return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { observer.onNext(x); observer.onCompleted(); }, observer.onError.bind(observer), function () { if (!hasDefault) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(defaultValue); observer.onCompleted(); } }); }, source); } /** * Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence. * @example * var res = res = source.first(); * var res = res = source.first(function (x) { return x > 3; }); * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence. */ observableProto.first = function (predicate, thisArg) { return predicate ? this.where(predicate, thisArg).first() : firstOrDefaultAsync(this, false); }; /** * Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param {Any} [defaultValue] The default value if no such element exists. If not specified, defaults to null. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. */ observableProto.firstOrDefault = function (predicate, defaultValue, thisArg) { return predicate ? this.where(predicate).firstOrDefault(null, defaultValue) : firstOrDefaultAsync(this, true, defaultValue); }; function lastOrDefaultAsync(source, hasDefault, defaultValue) { return new AnonymousObservable(function (observer) { var value = defaultValue, seenValue = false; return source.subscribe(function (x) { value = x; seenValue = true; }, observer.onError.bind(observer), function () { if (!seenValue && !hasDefault) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }, source); } /** * Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element. * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate. */ observableProto.last = function (predicate, thisArg) { return predicate ? this.where(predicate, thisArg).last() : lastOrDefaultAsync(this, false); }; /** * Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence. * @param [defaultValue] The default value if no such element exists. If not specified, defaults to null. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists. */ observableProto.lastOrDefault = function (predicate, defaultValue, thisArg) { return predicate ? this.where(predicate, thisArg).lastOrDefault(null, defaultValue) : lastOrDefaultAsync(this, true, defaultValue); }; function findValue (source, predicate, thisArg, yieldIndex) { return new AnonymousObservable(function (observer) { var i = 0; return source.subscribe(function (x) { var shouldRun; try { shouldRun = predicate.call(thisArg, x, i, source); } catch (e) { observer.onError(e); return; } if (shouldRun) { observer.onNext(yieldIndex ? i : x); observer.onCompleted(); } else { i++; } }, observer.onError.bind(observer), function () { observer.onNext(yieldIndex ? -1 : undefined); observer.onCompleted(); }); }, source); } /** * Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence. * @param {Function} predicate The predicate that defines the conditions of the element to search for. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined. */ observableProto.find = function (predicate, thisArg) { return findValue(this, predicate, thisArg, false); }; /** * Searches for an element that matches the conditions defined by the specified predicate, and returns * an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence. * @param {Function} predicate The predicate that defines the conditions of the element to search for. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. */ observableProto.findIndex = function (predicate, thisArg) { return findValue(this, predicate, thisArg, true); }; /** * Converts the observable sequence to a Set if it exists. * @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence. */ observableProto.toSet = function () { if (typeof root.Set === 'undefined') { throw new TypeError(); } var source = this; return new AnonymousObservable(function (observer) { var s = new root.Set(); return source.subscribe( s.add.bind(s), observer.onError.bind(observer), function () { observer.onNext(s); observer.onCompleted(); }); }, source); }; /** * Converts the observable sequence to a Map if it exists. * @param {Function} keySelector A function which produces the key for the Map. * @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence. * @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence. */ observableProto.toMap = function (keySelector, elementSelector) { if (typeof root.Map === 'undefined') { throw new TypeError(); } var source = this; return new AnonymousObservable(function (observer) { var m = new root.Map(); return source.subscribe( function (x) { var key; try { key = keySelector(x); } catch (e) { observer.onError(e); return; } var element = x; if (elementSelector) { try { element = elementSelector(x); } catch (e) { observer.onError(e); return; } } m.set(key, element); }, observer.onError.bind(observer), function () { observer.onNext(m); observer.onCompleted(); }); }, source); }; var fnString = 'function', throwString = 'throw'; function toThunk(obj, ctx) { if (Array.isArray(obj)) { return objectToThunk.call(ctx, obj); } if (isGeneratorFunction(obj)) { return observableSpawn(obj.call(ctx)); } if (isGenerator(obj)) { return observableSpawn(obj); } if (isObservable(obj)) { return observableToThunk(obj); } if (isPromise(obj)) { return promiseToThunk(obj); } if (typeof obj === fnString) { return obj; } if (isObject(obj) || Array.isArray(obj)) { return objectToThunk.call(ctx, obj); } return obj; } function objectToThunk(obj) { var ctx = this; return function (done) { var keys = Object.keys(obj), pending = keys.length, results = new obj.constructor(), finished; if (!pending) { timeoutScheduler.schedule(function () { done(null, results); }); return; } for (var i = 0, len = keys.length; i < len; i++) { run(obj[keys[i]], keys[i]); } function run(fn, key) { if (finished) { return; } try { fn = toThunk(fn, ctx); if (typeof fn !== fnString) { results[key] = fn; return --pending || done(null, results); } fn.call(ctx, function(err, res) { if (finished) { return; } if (err) { finished = true; return done(err); } results[key] = res; --pending || done(null, results); }); } catch (e) { finished = true; done(e); } } } } function observableToThunk(observable) { return function (fn) { var value, hasValue = false; observable.subscribe( function (v) { value = v; hasValue = true; }, fn, function () { hasValue && fn(null, value); }); } } function promiseToThunk(promise) { return function(fn) { promise.then(function(res) { fn(null, res); }, fn); } } function isObservable(obj) { return obj && typeof obj.subscribe === fnString; } function isGeneratorFunction(obj) { return obj && obj.constructor && obj.constructor.name === 'GeneratorFunction'; } function isGenerator(obj) { return obj && typeof obj.next === fnString && typeof obj[throwString] === fnString; } function isObject(val) { return val && val.constructor === Object; } /* * Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions. * @param {Function} The spawning function. * @returns {Function} a function which has a done continuation. */ var observableSpawn = Rx.spawn = function (fn) { var isGenFun = isGeneratorFunction(fn); return function (done) { var ctx = this, gen = fn; if (isGenFun) { var args = slice.call(arguments), len = args.length, hasCallback = len && typeof args[len - 1] === fnString; done = hasCallback ? args.pop() : error; gen = fn.apply(this, args); } else { done = done || error; } next(); function exit(err, res) { timeoutScheduler.schedule(done.bind(ctx, err, res)); } function next(err, res) { var ret; // multiple args if (arguments.length > 2) { res = slice.call(arguments, 1); } if (err) { try { ret = gen[throwString](err); } catch (e) { return exit(e); } } if (!err) { try { ret = gen.next(res); } catch (e) { return exit(e); } } if (ret.done) { return exit(null, ret.value); } ret.value = toThunk(ret.value, ctx); if (typeof ret.value === fnString) { var called = false; try { ret.value.call(ctx, function() { if (called) { return; } called = true; next.apply(ctx, arguments); }); } catch (e) { timeoutScheduler.schedule(function () { if (called) { return; } called = true; next.call(ctx, e); }); } return; } // Not supported next(new TypeError('Rx.spawn only supports a function, Promise, Observable, Object or Array.')); } } }; /** * Takes a function with a callback and turns it into a thunk. * @param {Function} A function with a callback such as fs.readFile * @returns {Function} A function, when executed will continue the state machine. */ Rx.denodify = function (fn) { return function () { var args = slice.call(arguments), results, called, callback; args.push(function() { results = arguments; if (callback && !called) { called = true; cb.apply(this, results); } }); fn.apply(this, args); return function (fn) { callback = fn; if (results && !called) { called = true; fn.apply(this, results); } } } }; function error(err) { if (!err) { return; } timeoutScheduler.schedule(function() { throw err; }); } /** * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence. * * @example * var res = Rx.Observable.start(function () { console.log('hello'); }); * var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout); * var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console); * * @param {Function} func Function to run asynchronously. * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @returns {Observable} An observable sequence exposing the function's result value, or an exception. * * Remarks * * The function is called immediately, not during the subscription of the resulting sequence. * * Multiple subscriptions to the resulting sequence can observe the function's result. */ Observable.start = function (func, context, scheduler) { return observableToAsync(func, context, scheduler)(); }; /** * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. * @param {Function} function Function to convert to an asynchronous function. * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @returns {Function} Asynchronous function. */ var observableToAsync = Observable.toAsync = function (func, context, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return function () { var args = arguments, subject = new AsyncSubject(); scheduler.schedule(function () { var result; try { result = func.apply(context, args); } catch (e) { subject.onError(e); return; } subject.onNext(result); subject.onCompleted(); }); return subject.asObservable(); }; }; /** * Converts a callback function to an observable sequence. * * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence. * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next. * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array. */ Observable.fromCallback = function (func, context, selector) { return function () { var args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler() { var results = arguments; if (selector) { try { results = selector(results); } catch (err) { observer.onError(err); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }).publishLast().refCount(); }; }; /** * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format. * @param {Function} func The function to call * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next. * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array. */ Observable.fromNodeCallback = function (func, context, selector) { return function () { var args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler(err) { if (err) { observer.onError(err); return; } var results = slice.call(arguments, 1); if (selector) { try { results = selector(results); } catch (e) { observer.onError(e); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }).publishLast().refCount(); }; }; function createListener (element, name, handler) { if (element.addEventListener) { element.addEventListener(name, handler, false); return disposableCreate(function () { element.removeEventListener(name, handler, false); }); } throw new Error('No listener found'); } function createEventListener (el, eventName, handler) { var disposables = new CompositeDisposable(); // Asume NodeList if (Object.prototype.toString.call(el) === '[object NodeList]') { for (var i = 0, len = el.length; i < len; i++) { disposables.add(createEventListener(el.item(i), eventName, handler)); } } else if (el) { disposables.add(createListener(el, eventName, handler)); } return disposables; } /** * Configuration option to determine whether to use native events only */ Rx.config.useNativeEvents = false; // Check for Angular/jQuery/Zepto support var jq = !!root.angular && !!angular.element ? angular.element : (!!root.jQuery ? root.jQuery : ( !!root.Zepto ? root.Zepto : null)); // Check for ember var ember = !!root.Ember && typeof root.Ember.addListener === 'function'; // Check for Backbone.Marionette. Note if using AMD add Marionette as a dependency of rxjs // for proper loading order! var marionette = !!root.Backbone && !!root.Backbone.Marionette; /** * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList. * * @example * var source = Rx.Observable.fromEvent(element, 'mouseup'); * * @param {Object} element The DOMElement or NodeList to attach a listener. * @param {String} eventName The event name to attach the observable sequence. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence of events from the specified element and the specified event. */ Observable.fromEvent = function (element, eventName, selector) { // Node.js specific if (element.addListener) { return fromEventPattern( function (h) { element.addListener(eventName, h); }, function (h) { element.removeListener(eventName, h); }, selector); } // Use only if non-native events are allowed if (!Rx.config.useNativeEvents) { if (marionette) { return fromEventPattern( function (h) { element.on(eventName, h); }, function (h) { element.off(eventName, h); }, selector); } if (ember) { return fromEventPattern( function (h) { Ember.addListener(element, eventName, h); }, function (h) { Ember.removeListener(element, eventName, h); }, selector); } if (jq) { var $elem = jq(element); return fromEventPattern( function (h) { $elem.on(eventName, h); }, function (h) { $elem.off(eventName, h); }, selector); } } return new AnonymousObservable(function (observer) { return createEventListener( element, eventName, function handler (e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return } } observer.onNext(results); }); }).publish().refCount(); }; /** * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair. * @param {Function} addHandler The function to add a handler to the emitter. * @param {Function} [removeHandler] The optional function to remove a handler from an emitter. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence which wraps an event from an event emitter */ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) { return new AnonymousObservable(function (observer) { function innerHandler (e) { var result = e; if (selector) { try { result = selector(arguments); } catch (err) { observer.onError(err); return; } } observer.onNext(result); } var returnValue = addHandler(innerHandler); return disposableCreate(function () { if (removeHandler) { removeHandler(innerHandler, returnValue); } }); }).publish().refCount(); }; /** * Invokes the asynchronous function, surfacing the result through an observable sequence. * @param {Function} functionAsync Asynchronous function which returns a Promise to run. * @returns {Observable} An observable sequence exposing the function's result value, or an exception. */ Observable.startAsync = function (functionAsync) { var promise; try { promise = functionAsync(); } catch (e) { return observableThrow(e); } return observableFromPromise(promise); } var PausableObservable = (function (__super__) { inherits(PausableObservable, __super__); function subscribe(observer) { var conn = this.source.publish(), subscription = conn.subscribe(observer), connection = disposableEmpty; var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) { if (b) { connection = conn.connect(); } else { connection.dispose(); connection = disposableEmpty; } }); return new CompositeDisposable(subscription, connection, pausable); } function PausableObservable(source, pauser) { this.source = source; this.controller = new Subject(); if (pauser && pauser.subscribe) { this.pauser = this.controller.merge(pauser); } else { this.pauser = this.controller; } __super__.call(this, subscribe, source); } PausableObservable.prototype.pause = function () { this.controller.onNext(false); }; PausableObservable.prototype.resume = function () { this.controller.onNext(true); }; return PausableObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausable(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausable = function (pauser) { return new PausableObservable(this, pauser); }; function combineLatestSource(source, subject, resultSelector) { return new AnonymousObservable(function (observer) { var hasValue = [false, false], hasValueAll = false, isDone = false, values = new Array(2), err; function next(x, i) { values[i] = x var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { if (err) { observer.onError(err); return; } try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } if (isDone && values[1]) { observer.onCompleted(); } } return new CompositeDisposable( source.subscribe( function (x) { next(x, 0); }, function (e) { if (values[1]) { observer.onError(e); } else { err = e; } }, function () { isDone = true; values[1] && observer.onCompleted(); }), subject.subscribe( function (x) { next(x, 1); }, observer.onError.bind(observer), function () { isDone = true; next(true, 1); }) ); }, source); } var PausableBufferedObservable = (function (__super__) { inherits(PausableBufferedObservable, __super__); function subscribe(observer) { var q = [], previousShouldFire; var subscription = combineLatestSource( this.source, this.pauser.distinctUntilChanged().startWith(false), function (data, shouldFire) { return { data: data, shouldFire: shouldFire }; }) .subscribe( function (results) { if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) { previousShouldFire = results.shouldFire; // change in shouldFire if (results.shouldFire) { while (q.length > 0) { observer.onNext(q.shift()); } } } else { previousShouldFire = results.shouldFire; // new data if (results.shouldFire) { observer.onNext(results.data); } else { q.push(results.data); } } }, function (err) { // Empty buffer before sending error while (q.length > 0) { observer.onNext(q.shift()); } observer.onError(err); }, function () { // Empty buffer before sending completion while (q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); } ); return subscription; } function PausableBufferedObservable(source, pauser) { this.source = source; this.controller = new Subject(); if (pauser && pauser.subscribe) { this.pauser = this.controller.merge(pauser); } else { this.pauser = this.controller; } __super__.call(this, subscribe, source); } PausableBufferedObservable.prototype.pause = function () { this.controller.onNext(false); }; PausableBufferedObservable.prototype.resume = function () { this.controller.onNext(true); }; return PausableBufferedObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, * and yields the values that were buffered while paused. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausableBuffered(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausableBuffered = function (subject) { return new PausableBufferedObservable(this, subject); }; var ControlledObservable = (function (__super__) { inherits(ControlledObservable, __super__); function subscribe (observer) { return this.source.subscribe(observer); } function ControlledObservable (source, enableQueue) { __super__.call(this, subscribe, source); this.subject = new ControlledSubject(enableQueue); this.source = source.multicast(this.subject).refCount(); } ControlledObservable.prototype.request = function (numberOfItems) { if (numberOfItems == null) { numberOfItems = -1; } return this.subject.request(numberOfItems); }; return ControlledObservable; }(Observable)); var ControlledSubject = (function (__super__) { function subscribe (observer) { return this.subject.subscribe(observer); } inherits(ControlledSubject, __super__); function ControlledSubject(enableQueue) { enableQueue == null && (enableQueue = true); __super__.call(this, subscribe); this.subject = new Subject(); this.enableQueue = enableQueue; this.queue = enableQueue ? [] : null; this.requestedCount = 0; this.requestedDisposable = disposableEmpty; this.error = null; this.hasFailed = false; this.hasCompleted = false; this.controlledDisposable = disposableEmpty; } addProperties(ControlledSubject.prototype, Observer, { onCompleted: function () { this.hasCompleted = true; (!this.enableQueue || this.queue.length === 0) && this.subject.onCompleted(); }, onError: function (error) { this.hasFailed = true; this.error = error; (!this.enableQueue || this.queue.length === 0) && this.subject.onError(error); }, onNext: function (value) { var hasRequested = false; if (this.requestedCount === 0) { this.enableQueue && this.queue.push(value); } else { (this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest(); hasRequested = true; } hasRequested && this.subject.onNext(value); }, _processRequest: function (numberOfItems) { if (this.enableQueue) { while (this.queue.length >= numberOfItems && numberOfItems > 0) { this.subject.onNext(this.queue.shift()); numberOfItems--; } return this.queue.length !== 0 ? { numberOfItems: numberOfItems, returnValue: true } : { numberOfItems: numberOfItems, returnValue: false }; } if (this.hasFailed) { this.subject.onError(this.error); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } else if (this.hasCompleted) { this.subject.onCompleted(); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } return { numberOfItems: numberOfItems, returnValue: false }; }, request: function (number) { this.disposeCurrentRequest(); var self = this, r = this._processRequest(number); var number = r.numberOfItems; if (!r.returnValue) { this.requestedCount = number; this.requestedDisposable = disposableCreate(function () { self.requestedCount = 0; }); return this.requestedDisposable } else { return disposableEmpty; } }, disposeCurrentRequest: function () { this.requestedDisposable.dispose(); this.requestedDisposable = disposableEmpty; } }); return ControlledSubject; }(Observable)); /** * Attaches a controller to the observable sequence with the ability to queue. * @example * var source = Rx.Observable.interval(100).controlled(); * source.request(3); // Reads 3 values * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.controlled = function (enableQueue) { if (enableQueue == null) { enableQueue = true; } return new ControlledObservable(this, enableQueue); }; var StopAndWaitObservable = (function (__super__) { function subscribe (observer) { this.subscription = this.source.subscribe(new StopAndWaitObserver(observer, this, this.subscription)); var self = this; timeoutScheduler.schedule(function () { self.source.request(1); }); return this.subscription; } inherits(StopAndWaitObservable, __super__); function StopAndWaitObservable (source) { __super__.call(this, subscribe, source); this.source = source; } var StopAndWaitObserver = (function (__sub__) { inherits(StopAndWaitObserver, __sub__); function StopAndWaitObserver (observer, observable, cancel) { __sub__.call(this); this.observer = observer; this.observable = observable; this.cancel = cancel; } var stopAndWaitObserverProto = StopAndWaitObserver.prototype; stopAndWaitObserverProto.completed = function () { this.observer.onCompleted(); this.dispose(); }; stopAndWaitObserverProto.error = function (error) { this.observer.onError(error); this.dispose(); } stopAndWaitObserverProto.next = function (value) { this.observer.onNext(value); var self = this; timeoutScheduler.schedule(function () { self.observable.source.request(1); }); }; stopAndWaitObserverProto.dispose = function () { this.observer = null; if (this.cancel) { this.cancel.dispose(); this.cancel = null; } __sub__.prototype.dispose.call(this); }; return StopAndWaitObserver; }(AbstractObserver)); return StopAndWaitObservable; }(Observable)); /** * Attaches a stop and wait observable to the current observable. * @returns {Observable} A stop and wait observable. */ ControlledObservable.prototype.stopAndWait = function () { return new StopAndWaitObservable(this); }; var WindowedObservable = (function (__super__) { function subscribe (observer) { this.subscription = this.source.subscribe(new WindowedObserver(observer, this, this.subscription)); var self = this; timeoutScheduler.schedule(function () { self.source.request(self.windowSize); }); return this.subscription; } inherits(WindowedObservable, __super__); function WindowedObservable(source, windowSize) { __super__.call(this, subscribe, source); this.source = source; this.windowSize = windowSize; } var WindowedObserver = (function (__sub__) { inherits(WindowedObserver, __sub__); function WindowedObserver(observer, observable, cancel) { this.observer = observer; this.observable = observable; this.cancel = cancel; this.received = 0; } var windowedObserverPrototype = WindowedObserver.prototype; windowedObserverPrototype.completed = function () { this.observer.onCompleted(); this.dispose(); }; windowedObserverPrototype.error = function (error) { this.observer.onError(error); this.dispose(); }; windowedObserverPrototype.next = function (value) { this.observer.onNext(value); this.received = ++this.received % this.observable.windowSize; if (this.received === 0) { var self = this; timeoutScheduler.schedule(function () { self.observable.source.request(self.observable.windowSize); }); } }; windowedObserverPrototype.dispose = function () { this.observer = null; if (this.cancel) { this.cancel.dispose(); this.cancel = null; } __sub__.prototype.dispose.call(this); }; return WindowedObserver; }(AbstractObserver)); return WindowedObservable; }(Observable)); /** * Creates a sliding windowed observable based upon the window size. * @param {Number} windowSize The number of items in the window * @returns {Observable} A windowed observable based upon the window size. */ ControlledObservable.prototype.windowed = function (windowSize) { return new WindowedObservable(this, windowSize); }; /** * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay. * * @example * 1 - res = source.multicast(observable); * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; }); * * @param {Function|Subject} subjectOrSubjectSelector * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. * Or: * Subject to push source elements into. * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.multicast = function (subjectOrSubjectSelector, selector) { var source = this; return typeof subjectOrSubjectSelector === 'function' ? new AnonymousObservable(function (observer) { var connectable = source.multicast(subjectOrSubjectSelector()); return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect()); }, source) : new ConnectableObservable(source, subjectOrSubjectSelector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of Multicast using a regular Subject. * * @example * var resres = source.publish(); * var res = source.publish(function (x) { return x; }); * * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publish = function (selector) { return selector && isFunction(selector) ? this.multicast(function () { return new Subject(); }, selector) : this.multicast(new Subject()); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.share = function () { return this.publish().refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification. * This operator is a specialization of Multicast using a AsyncSubject. * * @example * var res = source.publishLast(); * var res = source.publishLast(function (x) { return x; }); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishLast = function (selector) { return selector && isFunction(selector) ? this.multicast(function () { return new AsyncSubject(); }, selector) : this.multicast(new AsyncSubject()); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue. * This operator is a specialization of Multicast using a BehaviorSubject. * * @example * var res = source.publishValue(42); * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42); * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on. * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishValue = function (initialValueOrSelector, initialValue) { return arguments.length === 2 ? this.multicast(function () { return new BehaviorSubject(initialValue); }, initialValueOrSelector) : this.multicast(new BehaviorSubject(initialValueOrSelector)); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareValue = function (initialValue) { return this.publishValue(initialValue).refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of Multicast using a ReplaySubject. * * @example * var res = source.replay(null, 3); * var res = source.replay(null, 3, 500); * var res = source.replay(null, 3, 500, scheduler); * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.replay = function (selector, bufferSize, window, scheduler) { return selector && isFunction(selector) ? this.multicast(function () { return new ReplaySubject(bufferSize, window, scheduler); }, selector) : this.multicast(new ReplaySubject(bufferSize, window, scheduler)); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareReplay(3); * var res = source.shareReplay(3, 500); * var res = source.shareReplay(3, 500, scheduler); * * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareReplay = function (bufferSize, window, scheduler) { return this.replay(null, bufferSize, window, scheduler).refCount(); }; /** @private */ var InnerSubscription = function (subject, observer) { this.subject = subject; this.observer = observer; }; /** * @private * @memberOf InnerSubscription */ InnerSubscription.prototype.dispose = function () { if (!this.subject.isDisposed && this.observer !== null) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); this.observer = null; } }; /** * Represents a value that changes over time. * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications. */ var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); observer.onNext(this.value); return new InnerSubscription(this, observer); } var ex = this.exception; if (ex) { observer.onError(ex); } else { observer.onCompleted(); } return disposableEmpty; } inherits(BehaviorSubject, __super__); /** * @constructor * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value. * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet. */ function BehaviorSubject(value) { __super__.call(this, subscribe); this.value = value, this.observers = [], this.isDisposed = false, this.isStopped = false, this.exception = null; } addProperties(BehaviorSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; for (var i = 0, os = this.observers.slice(0), len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; this.exception = error; for (var i = 0, os = this.observers.slice(0), len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } this.value = value; for (var i = 0, os = this.observers.slice(0), len = os.length; i < len; i++) { os[i].onNext(value); } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.value = null; this.exception = null; } }); return BehaviorSubject; }(Observable)); /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies. */ var ReplaySubject = Rx.ReplaySubject = (function (__super__) { function createRemovableDisposable(subject, observer) { return disposableCreate(function () { observer.dispose(); !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1); }); } function subscribe(observer) { var so = new ScheduledObserver(this.scheduler, observer), subscription = createRemovableDisposable(this, so); checkDisposed.call(this); this._trim(this.scheduler.now()); this.observers.push(so); for (var i = 0, len = this.q.length; i < len; i++) { so.onNext(this.q[i].value); } if (this.hasError) { so.onError(this.error); } else if (this.isStopped) { so.onCompleted(); } so.ensureActive(); return subscription; } inherits(ReplaySubject, __super__); /** * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler. * @param {Number} [bufferSize] Maximum element count of the replay buffer. * @param {Number} [windowSize] Maximum time length of the replay buffer. * @param {Scheduler} [scheduler] Scheduler the observers are invoked on. */ function ReplaySubject(bufferSize, windowSize, scheduler) { this.bufferSize = bufferSize == null ? Number.MAX_VALUE : bufferSize; this.windowSize = windowSize == null ? Number.MAX_VALUE : windowSize; this.scheduler = scheduler || currentThreadScheduler; this.q = []; this.observers = []; this.isStopped = false; this.isDisposed = false; this.hasError = false; this.error = null; __super__.call(this, subscribe); } addProperties(ReplaySubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, _trim: function (now) { while (this.q.length > this.bufferSize) { this.q.shift(); } while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) { this.q.shift(); } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } var now = this.scheduler.now(); this.q.push({ interval: now, value: value }); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { var observer = o[i]; observer.onNext(value); observer.ensureActive(); } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; this.error = error; this.hasError = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { var observer = o[i]; observer.onError(error); observer.ensureActive(); } this.observers = []; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { var observer = o[i]; observer.onCompleted(); observer.ensureActive(); } this.observers = []; }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); return ReplaySubject; }(Observable)); var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) { inherits(ConnectableObservable, __super__); function ConnectableObservable(source, subject) { var hasSubscription = false, subscription, sourceObservable = source.asObservable(); this.connect = function () { if (!hasSubscription) { hasSubscription = true; subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () { hasSubscription = false; })); } return subscription; }; __super__.call(this, subject.subscribe.bind(subject)); } ConnectableObservable.prototype.refCount = function () { var connectableSubscription, count = 0, source = this; return new AnonymousObservable(function (observer) { var shouldConnect = ++count === 1, subscription = source.subscribe(observer); shouldConnect && (connectableSubscription = source.connect()); return function () { subscription.dispose(); --count === 0 && connectableSubscription.dispose(); }; }); }; return ConnectableObservable; }(Observable)); var Dictionary = (function () { var primes = [1, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, 268435399, 536870909, 1073741789, 2147483647], noSuchkey = "no such key", duplicatekey = "duplicate key"; function isPrime(candidate) { if ((candidate & 1) === 0) { return candidate === 2; } var num1 = Math.sqrt(candidate), num2 = 3; while (num2 <= num1) { if (candidate % num2 === 0) { return false; } num2 += 2; } return true; } function getPrime(min) { var index, num, candidate; for (index = 0; index < primes.length; ++index) { num = primes[index]; if (num >= min) { return num; } } candidate = min | 1; while (candidate < primes[primes.length - 1]) { if (isPrime(candidate)) { return candidate; } candidate += 2; } return min; } function stringHashFn(str) { var hash = 757602046; if (!str.length) { return hash; } for (var i = 0, len = str.length; i < len; i++) { var character = str.charCodeAt(i); hash = ((hash << 5) - hash) + character; hash = hash & hash; } return hash; } function numberHashFn(key) { var c2 = 0x27d4eb2d; key = (key ^ 61) ^ (key >>> 16); key = key + (key << 3); key = key ^ (key >>> 4); key = key * c2; key = key ^ (key >>> 15); return key; } var getHashCode = (function () { var uniqueIdCounter = 0; return function (obj) { if (obj == null) { throw new Error(noSuchkey); } // Check for built-ins before tacking on our own for any object if (typeof obj === 'string') { return stringHashFn(obj); } if (typeof obj === 'number') { return numberHashFn(obj); } if (typeof obj === 'boolean') { return obj === true ? 1 : 0; } if (obj instanceof Date) { return numberHashFn(obj.valueOf()); } if (obj instanceof RegExp) { return stringHashFn(obj.toString()); } if (typeof obj.valueOf === 'function') { // Hack check for valueOf var valueOf = obj.valueOf(); if (typeof valueOf === 'number') { return numberHashFn(valueOf); } if (typeof obj === 'string') { return stringHashFn(valueOf); } } if (obj.hashCode) { return obj.hashCode(); } var id = 17 * uniqueIdCounter++; obj.hashCode = function () { return id; }; return id; }; }()); function newEntry() { return { key: null, value: null, next: 0, hashCode: 0 }; } function Dictionary(capacity, comparer) { if (capacity < 0) { throw new Error('out of range'); } if (capacity > 0) { this._initialize(capacity); } this.comparer = comparer || defaultComparer; this.freeCount = 0; this.size = 0; this.freeList = -1; } var dictionaryProto = Dictionary.prototype; dictionaryProto._initialize = function (capacity) { var prime = getPrime(capacity), i; this.buckets = new Array(prime); this.entries = new Array(prime); for (i = 0; i < prime; i++) { this.buckets[i] = -1; this.entries[i] = newEntry(); } this.freeList = -1; }; dictionaryProto.add = function (key, value) { this._insert(key, value, true); }; dictionaryProto._insert = function (key, value, add) { if (!this.buckets) { this._initialize(0); } var index3, num = getHashCode(key) & 2147483647, index1 = num % this.buckets.length; for (var index2 = this.buckets[index1]; index2 >= 0; index2 = this.entries[index2].next) { if (this.entries[index2].hashCode === num && this.comparer(this.entries[index2].key, key)) { if (add) { throw new Error(duplicatekey); } this.entries[index2].value = value; return; } } if (this.freeCount > 0) { index3 = this.freeList; this.freeList = this.entries[index3].next; --this.freeCount; } else { if (this.size === this.entries.length) { this._resize(); index1 = num % this.buckets.length; } index3 = this.size; ++this.size; } this.entries[index3].hashCode = num; this.entries[index3].next = this.buckets[index1]; this.entries[index3].key = key; this.entries[index3].value = value; this.buckets[index1] = index3; }; dictionaryProto._resize = function () { var prime = getPrime(this.size * 2), numArray = new Array(prime); for (index = 0; index < numArray.length; ++index) { numArray[index] = -1; } var entryArray = new Array(prime); for (index = 0; index < this.size; ++index) { entryArray[index] = this.entries[index]; } for (var index = this.size; index < prime; ++index) { entryArray[index] = newEntry(); } for (var index1 = 0; index1 < this.size; ++index1) { var index2 = entryArray[index1].hashCode % prime; entryArray[index1].next = numArray[index2]; numArray[index2] = index1; } this.buckets = numArray; this.entries = entryArray; }; dictionaryProto.remove = function (key) { if (this.buckets) { var num = getHashCode(key) & 2147483647, index1 = num % this.buckets.length, index2 = -1; for (var index3 = this.buckets[index1]; index3 >= 0; index3 = this.entries[index3].next) { if (this.entries[index3].hashCode === num && this.comparer(this.entries[index3].key, key)) { if (index2 < 0) { this.buckets[index1] = this.entries[index3].next; } else { this.entries[index2].next = this.entries[index3].next; } this.entries[index3].hashCode = -1; this.entries[index3].next = this.freeList; this.entries[index3].key = null; this.entries[index3].value = null; this.freeList = index3; ++this.freeCount; return true; } else { index2 = index3; } } } return false; }; dictionaryProto.clear = function () { var index, len; if (this.size <= 0) { return; } for (index = 0, len = this.buckets.length; index < len; ++index) { this.buckets[index] = -1; } for (index = 0; index < this.size; ++index) { this.entries[index] = newEntry(); } this.freeList = -1; this.size = 0; }; dictionaryProto._findEntry = function (key) { if (this.buckets) { var num = getHashCode(key) & 2147483647; for (var index = this.buckets[num % this.buckets.length]; index >= 0; index = this.entries[index].next) { if (this.entries[index].hashCode === num && this.comparer(this.entries[index].key, key)) { return index; } } } return -1; }; dictionaryProto.count = function () { return this.size - this.freeCount; }; dictionaryProto.tryGetValue = function (key) { var entry = this._findEntry(key); return entry >= 0 ? this.entries[entry].value : undefined; }; dictionaryProto.getValues = function () { var index = 0, results = []; if (this.entries) { for (var index1 = 0; index1 < this.size; index1++) { if (this.entries[index1].hashCode >= 0) { results[index++] = this.entries[index1].value; } } } return results; }; dictionaryProto.get = function (key) { var entry = this._findEntry(key); if (entry >= 0) { return this.entries[entry].value; } throw new Error(noSuchkey); }; dictionaryProto.set = function (key, value) { this._insert(key, value, false); }; dictionaryProto.containskey = function (key) { return this._findEntry(key) >= 0; }; return Dictionary; }()); /** * Correlates the elements of two sequences based on overlapping durations. * * @param {Observable} right The right observable sequence to join elements for. * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap. * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap. * @param {Function} resultSelector A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. The parameters passed to the function correspond with the elements from the left and right source sequences for which overlap occurs. * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration. */ observableProto.join = function (right, leftDurationSelector, rightDurationSelector, resultSelector) { var left = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(); var leftDone = false, rightDone = false; var leftId = 0, rightId = 0; var leftMap = new Dictionary(), rightMap = new Dictionary(); group.add(left.subscribe( function (value) { var id = leftId++; var md = new SingleAssignmentDisposable(); leftMap.add(id, value); group.add(md); var expire = function () { leftMap.remove(id) && leftMap.count() === 0 && leftDone && observer.onCompleted(); group.remove(md); }; var duration; try { duration = leftDurationSelector(value); } catch (e) { observer.onError(e); return; } md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire)); rightMap.getValues().forEach(function (v) { var result; try { result = resultSelector(value, v); } catch (exn) { observer.onError(exn); return; } observer.onNext(result); }); }, observer.onError.bind(observer), function () { leftDone = true; (rightDone || leftMap.count() === 0) && observer.onCompleted(); }) ); group.add(right.subscribe( function (value) { var id = rightId++; var md = new SingleAssignmentDisposable(); rightMap.add(id, value); group.add(md); var expire = function () { rightMap.remove(id) && rightMap.count() === 0 && rightDone && observer.onCompleted(); group.remove(md); }; var duration; try { duration = rightDurationSelector(value); } catch (e) { observer.onError(e); return; } md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire)); leftMap.getValues().forEach(function (v) { var result; try { result = resultSelector(v, value); } catch (exn) { observer.onError(exn); return; } observer.onNext(result); }); }, observer.onError.bind(observer), function () { rightDone = true; (leftDone || rightMap.count() === 0) && observer.onCompleted(); }) ); return group; }, left); }; /** * Correlates the elements of two sequences based on overlapping durations, and groups the results. * * @param {Observable} right The right observable sequence to join elements for. * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap. * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap. * @param {Function} resultSelector A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. The first parameter passed to the function is an element of the left sequence. The second parameter passed to the function is an observable sequence with elements from the right sequence that overlap with the left sequence's element. * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration. */ observableProto.groupJoin = function (right, leftDurationSelector, rightDurationSelector, resultSelector) { var left = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(); var r = new RefCountDisposable(group); var leftMap = new Dictionary(), rightMap = new Dictionary(); var leftId = 0, rightId = 0; function handleError(e) { return function (v) { v.onError(e); }; }; group.add(left.subscribe( function (value) { var s = new Subject(); var id = leftId++; leftMap.add(id, s); var result; try { result = resultSelector(value, addRef(s, r)); } catch (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); return; } observer.onNext(result); rightMap.getValues().forEach(function (v) { s.onNext(v); }); var md = new SingleAssignmentDisposable(); group.add(md); var expire = function () { leftMap.remove(id) && s.onCompleted(); group.remove(md); }; var duration; try { duration = leftDurationSelector(value); } catch (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); return; } md.setDisposable(duration.take(1).subscribe( noop, function (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); }, expire) ); }, function (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); }, observer.onCompleted.bind(observer)) ); group.add(right.subscribe( function (value) { var id = rightId++; rightMap.add(id, value); var md = new SingleAssignmentDisposable(); group.add(md); var expire = function () { rightMap.remove(id); group.remove(md); }; var duration; try { duration = rightDurationSelector(value); } catch (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); return; } md.setDisposable(duration.take(1).subscribe( noop, function (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); }, expire) ); leftMap.getValues().forEach(function (v) { v.onNext(value); }); }, function (e) { leftMap.getValues().forEach(handleError(e)); observer.onError(e); }) ); return r; }, left); }; /** * Projects each element of an observable sequence into zero or more buffers. * * @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows). * @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored. * @returns {Observable} An observable sequence of windows. */ observableProto.buffer = function (bufferOpeningsOrClosingSelector, bufferClosingSelector) { return this.window.apply(this, arguments).selectMany(function (x) { return x.toArray(); }); }; /** * Projects each element of an observable sequence into zero or more windows. * * @param {Mixed} windowOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows). * @param {Function} [windowClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored. * @returns {Observable} An observable sequence of windows. */ observableProto.window = function (windowOpeningsOrClosingSelector, windowClosingSelector) { if (arguments.length === 1 && typeof arguments[0] !== 'function') { return observableWindowWithBounaries.call(this, windowOpeningsOrClosingSelector); } return typeof windowOpeningsOrClosingSelector === 'function' ? observableWindowWithClosingSelector.call(this, windowOpeningsOrClosingSelector) : observableWindowWithOpenings.call(this, windowOpeningsOrClosingSelector, windowClosingSelector); }; function observableWindowWithOpenings(windowOpenings, windowClosingSelector) { return windowOpenings.groupJoin(this, windowClosingSelector, observableEmpty, function (_, win) { return win; }); } function observableWindowWithBounaries(windowBoundaries) { var source = this; return new AnonymousObservable(function (observer) { var win = new Subject(), d = new CompositeDisposable(), r = new RefCountDisposable(d); observer.onNext(addRef(win, r)); d.add(source.subscribe(function (x) { win.onNext(x); }, function (err) { win.onError(err); observer.onError(err); }, function () { win.onCompleted(); observer.onCompleted(); })); isPromise(windowBoundaries) && (windowBoundaries = observableFromPromise(windowBoundaries)); d.add(windowBoundaries.subscribe(function (w) { win.onCompleted(); win = new Subject(); observer.onNext(addRef(win, r)); }, function (err) { win.onError(err); observer.onError(err); }, function () { win.onCompleted(); observer.onCompleted(); })); return r; }, source); } function observableWindowWithClosingSelector(windowClosingSelector) { var source = this; return new AnonymousObservable(function (observer) { var m = new SerialDisposable(), d = new CompositeDisposable(m), r = new RefCountDisposable(d), win = new Subject(); observer.onNext(addRef(win, r)); d.add(source.subscribe(function (x) { win.onNext(x); }, function (err) { win.onError(err); observer.onError(err); }, function () { win.onCompleted(); observer.onCompleted(); })); function createWindowClose () { var windowClose; try { windowClose = windowClosingSelector(); } catch (e) { observer.onError(e); return; } isPromise(windowClose) && (windowClose = observableFromPromise(windowClose)); var m1 = new SingleAssignmentDisposable(); m.setDisposable(m1); m1.setDisposable(windowClose.take(1).subscribe(noop, function (err) { win.onError(err); observer.onError(err); }, function () { win.onCompleted(); win = new Subject(); observer.onNext(addRef(win, r)); createWindowClose(); })); } createWindowClose(); return r; }, source); } /** * Returns a new observable that triggers on the second and subsequent triggerings of the input observable. * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair. * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. * @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array. */ observableProto.pairwise = function () { var source = this; return new AnonymousObservable(function (observer) { var previous, hasPrevious = false; return source.subscribe( function (x) { if (hasPrevious) { observer.onNext([previous, x]); } else { hasPrevious = true; } previous = x; }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }, source); }; /** * Returns two observables which partition the observations of the source by the given function. * The first will trigger observations for those values for which the predicate returns true. * The second will trigger observations for those values where the predicate returns false. * The predicate is executed once for each subscribed observer. * Both also propagate all error observations arising from the source and each completes * when the source completes. * @param {Function} predicate * The function to determine which output Observable will trigger a particular observation. * @returns {Array} * An array of observables. The first triggers when the predicate returns true, * and the second triggers when the predicate returns false. */ observableProto.partition = function(predicate, thisArg) { var published = this.publish().refCount(); return [ published.filter(predicate, thisArg), published.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); }) ]; }; function enumerableWhile(condition, source) { return new Enumerable(function () { return new Enumerator(function () { return condition() ? { done: false, value: source } : { done: true, value: undefined }; }); }); } /** * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. * This operator allows for a fluent style of writing queries that use the same sequence multiple times. * * @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.letBind = observableProto['let'] = function (func) { return func(this); }; /** * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9 * * @example * 1 - res = Rx.Observable.if(condition, obs1); * 2 - res = Rx.Observable.if(condition, obs1, obs2); * 3 - res = Rx.Observable.if(condition, obs1, scheduler); * @param {Function} condition The condition which determines if the thenSource or elseSource will be run. * @param {Observable} thenSource The observable sequence or Promise that will be run if the condition function returns true. * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the condition function returns false. If this is not provided, it defaults to Rx.Observabe.Empty with the specified scheduler. * @returns {Observable} An observable sequence which is either the thenSource or elseSource. */ Observable['if'] = Observable.ifThen = function (condition, thenSource, elseSourceOrScheduler) { return observableDefer(function () { elseSourceOrScheduler || (elseSourceOrScheduler = observableEmpty()); isPromise(thenSource) && (thenSource = observableFromPromise(thenSource)); isPromise(elseSourceOrScheduler) && (elseSourceOrScheduler = observableFromPromise(elseSourceOrScheduler)); // Assume a scheduler for empty only typeof elseSourceOrScheduler.now === 'function' && (elseSourceOrScheduler = observableEmpty(elseSourceOrScheduler)); return condition() ? thenSource : elseSourceOrScheduler; }); }; /** * Concatenates the observable sequences obtained by running the specified result selector for each element in source. * There is an alias for this method called 'forIn' for browsers <IE9 * @param {Array} sources An array of values to turn into an observable sequence. * @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence. * @returns {Observable} An observable sequence from the concatenated observable sequences. */ Observable['for'] = Observable.forIn = function (sources, resultSelector, thisArg) { return enumerableOf(sources, resultSelector, thisArg).concat(); }; /** * Repeats source as long as condition holds emulating a while loop. * There is an alias for this method called 'whileDo' for browsers <IE9 * * @param {Function} condition The condition which determines if the source will be repeated. * @param {Observable} source The observable sequence that will be run if the condition function returns true. * @returns {Observable} An observable sequence which is repeated as long as the condition holds. */ var observableWhileDo = Observable['while'] = Observable.whileDo = function (condition, source) { isPromise(source) && (source = observableFromPromise(source)); return enumerableWhile(condition, source).concat(); }; /** * Repeats source as long as condition holds emulating a do while loop. * * @param {Function} condition The condition which determines if the source will be repeated. * @param {Observable} source The observable sequence that will be run if the condition function returns true. * @returns {Observable} An observable sequence which is repeated as long as the condition holds. */ observableProto.doWhile = function (condition) { return observableConcat([this, observableWhileDo(condition, this)]); }; /** * Uses selector to determine which source in sources to use. * There is an alias 'switchCase' for browsers <IE9. * * @example * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }); * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0); * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler); * * @param {Function} selector The function which extracts the value for to test in a case statement. * @param {Array} sources A object which has keys which correspond to the case statement labels. * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the sources are not matched. If this is not provided, it defaults to Rx.Observabe.empty with the specified scheduler. * * @returns {Observable} An observable sequence which is determined by a case statement. */ Observable['case'] = Observable.switchCase = function (selector, sources, defaultSourceOrScheduler) { return observableDefer(function () { isPromise(defaultSourceOrScheduler) && (defaultSourceOrScheduler = observableFromPromise(defaultSourceOrScheduler)); defaultSourceOrScheduler || (defaultSourceOrScheduler = observableEmpty()); typeof defaultSourceOrScheduler.now === 'function' && (defaultSourceOrScheduler = observableEmpty(defaultSourceOrScheduler)); var result = sources[selector()]; isPromise(result) && (result = observableFromPromise(result)); return result || defaultSourceOrScheduler; }); }; /** * Expands an observable sequence by recursively invoking selector. * * @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again. * @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler. * @returns {Observable} An observable sequence containing all the elements produced by the recursive expansion. */ observableProto.expand = function (selector, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); var source = this; return new AnonymousObservable(function (observer) { var q = [], m = new SerialDisposable(), d = new CompositeDisposable(m), activeCount = 0, isAcquired = false; var ensureActive = function () { var isOwner = false; if (q.length > 0) { isOwner = !isAcquired; isAcquired = true; } if (isOwner) { m.setDisposable(scheduler.scheduleRecursive(function (self) { var work; if (q.length > 0) { work = q.shift(); } else { isAcquired = false; return; } var m1 = new SingleAssignmentDisposable(); d.add(m1); m1.setDisposable(work.subscribe(function (x) { observer.onNext(x); var result = null; try { result = selector(x); } catch (e) { observer.onError(e); } q.push(result); activeCount++; ensureActive(); }, observer.onError.bind(observer), function () { d.remove(m1); activeCount--; if (activeCount === 0) { observer.onCompleted(); } })); self(); })); } }; q.push(source); activeCount++; ensureActive(); return d; }, this); }; /** * Runs all observable sequences in parallel and collect their last elements. * * @example * 1 - res = Rx.Observable.forkJoin([obs1, obs2]); * 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...); * @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences. */ Observable.forkJoin = function () { var allSources = argsOrArray(arguments, 0); return new AnonymousObservable(function (subscriber) { var count = allSources.length; if (count === 0) { subscriber.onCompleted(); return disposableEmpty; } var group = new CompositeDisposable(), finished = false, hasResults = new Array(count), hasCompleted = new Array(count), results = new Array(count); for (var idx = 0; idx < count; idx++) { (function (i) { var source = allSources[i]; isPromise(source) && (source = observableFromPromise(source)); group.add( source.subscribe( function (value) { if (!finished) { hasResults[i] = true; results[i] = value; } }, function (e) { finished = true; subscriber.onError(e); group.dispose(); }, function () { if (!finished) { if (!hasResults[i]) { subscriber.onCompleted(); return; } hasCompleted[i] = true; for (var ix = 0; ix < count; ix++) { if (!hasCompleted[ix]) { return; } } finished = true; subscriber.onNext(results); subscriber.onCompleted(); } })); })(idx); } return group; }); }; /** * Runs two observable sequences in parallel and combines their last elemenets. * * @param {Observable} second Second observable sequence. * @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences. * @returns {Observable} An observable sequence with the result of calling the selector function with the last elements of both input sequences. */ observableProto.forkJoin = function (second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var leftStopped = false, rightStopped = false, hasLeft = false, hasRight = false, lastLeft, lastRight, leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable(); isPromise(second) && (second = observableFromPromise(second)); leftSubscription.setDisposable( first.subscribe(function (left) { hasLeft = true; lastLeft = left; }, function (err) { rightSubscription.dispose(); observer.onError(err); }, function () { leftStopped = true; if (rightStopped) { if (!hasLeft) { observer.onCompleted(); } else if (!hasRight) { observer.onCompleted(); } else { var result; try { result = resultSelector(lastLeft, lastRight); } catch (e) { observer.onError(e); return; } observer.onNext(result); observer.onCompleted(); } } }) ); rightSubscription.setDisposable( second.subscribe(function (right) { hasRight = true; lastRight = right; }, function (err) { leftSubscription.dispose(); observer.onError(err); }, function () { rightStopped = true; if (leftStopped) { if (!hasLeft) { observer.onCompleted(); } else if (!hasRight) { observer.onCompleted(); } else { var result; try { result = resultSelector(lastLeft, lastRight); } catch (e) { observer.onError(e); return; } observer.onNext(result); observer.onCompleted(); } } }) ); return new CompositeDisposable(leftSubscription, rightSubscription); }, first); }; /** * Comonadic bind operator. * @param {Function} selector A transform function to apply to each element. * @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler. * @returns {Observable} An observable sequence which results from the comonadic bind operation. */ observableProto.manySelect = function (selector, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); var source = this; return observableDefer(function () { var chain; return source .map(function (x) { var curr = new ChainObservable(x); chain && chain.onNext(x); chain = curr; return curr; }) .tap( noop, function (e) { chain && chain.onError(e); }, function () { chain && chain.onCompleted(); } ) .observeOn(scheduler) .map(selector); }, source); }; var ChainObservable = (function (__super__) { function subscribe (observer) { var self = this, g = new CompositeDisposable(); g.add(currentThreadScheduler.schedule(function () { observer.onNext(self.head); g.add(self.tail.mergeAll().subscribe(observer)); })); return g; } inherits(ChainObservable, __super__); function ChainObservable(head) { __super__.call(this, subscribe); this.head = head; this.tail = new AsyncSubject(); } addProperties(ChainObservable.prototype, Observer, { onCompleted: function () { this.onNext(Observable.empty()); }, onError: function (e) { this.onNext(Observable.throwException(e)); }, onNext: function (v) { this.tail.onNext(v); this.tail.onCompleted(); } }); return ChainObservable; }(Observable)); /** @private */ var Map = root.Map || (function () { function Map() { this._keys = []; this._values = []; } Map.prototype.get = function (key) { var i = this._keys.indexOf(key); return i !== -1 ? this._values[i] : undefined; }; Map.prototype.set = function (key, value) { var i = this._keys.indexOf(key); i !== -1 && (this._values[i] = value); this._values[this._keys.push(key) - 1] = value; }; Map.prototype.forEach = function (callback, thisArg) { for (var i = 0, len = this._keys.length; i < len; i++) { callback.call(thisArg, this._values[i], this._keys[i]); } }; return Map; }()); /** * @constructor * Represents a join pattern over observable sequences. */ function Pattern(patterns) { this.patterns = patterns; } /** * Creates a pattern that matches the current plan matches and when the specified observable sequences has an available value. * @param other Observable sequence to match in addition to the current pattern. * @return {Pattern} Pattern object that matches when all observable sequences in the pattern have an available value. */ Pattern.prototype.and = function (other) { return new Pattern(this.patterns.concat(other)); }; /** * Matches when all observable sequences in the pattern (specified using a chain of and operators) have an available value and projects the values. * @param {Function} selector Selector that will be invoked with available values from the source sequences, in the same order of the sequences in the pattern. * @return {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator. */ Pattern.prototype.thenDo = function (selector) { return new Plan(this, selector); }; function Plan(expression, selector) { this.expression = expression; this.selector = selector; } Plan.prototype.activate = function (externalSubscriptions, observer, deactivate) { var self = this; var joinObservers = []; for (var i = 0, len = this.expression.patterns.length; i < len; i++) { joinObservers.push(planCreateObserver(externalSubscriptions, this.expression.patterns[i], observer.onError.bind(observer))); } var activePlan = new ActivePlan(joinObservers, function () { var result; try { result = self.selector.apply(self, arguments); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, function () { for (var j = 0, jlen = joinObservers.length; j < jlen; j++) { joinObservers[j].removeActivePlan(activePlan); } deactivate(activePlan); }); for (i = 0, len = joinObservers.length; i < len; i++) { joinObservers[i].addActivePlan(activePlan); } return activePlan; }; function planCreateObserver(externalSubscriptions, observable, onError) { var entry = externalSubscriptions.get(observable); if (!entry) { var observer = new JoinObserver(observable, onError); externalSubscriptions.set(observable, observer); return observer; } return entry; } function ActivePlan(joinObserverArray, onNext, onCompleted) { this.joinObserverArray = joinObserverArray; this.onNext = onNext; this.onCompleted = onCompleted; this.joinObservers = new Map(); for (var i = 0, len = this.joinObserverArray.length; i < len; i++) { var joinObserver = this.joinObserverArray[i]; this.joinObservers.set(joinObserver, joinObserver); } } ActivePlan.prototype.dequeue = function () { this.joinObservers.forEach(function (v) { v.queue.shift(); }); }; ActivePlan.prototype.match = function () { var i, len, hasValues = true; for (i = 0, len = this.joinObserverArray.length; i < len; i++) { if (this.joinObserverArray[i].queue.length === 0) { hasValues = false; break; } } if (hasValues) { var firstValues = [], isCompleted = false; for (i = 0, len = this.joinObserverArray.length; i < len; i++) { firstValues.push(this.joinObserverArray[i].queue[0]); this.joinObserverArray[i].queue[0].kind === 'C' && (isCompleted = true); } if (isCompleted) { this.onCompleted(); } else { this.dequeue(); var values = []; for (i = 0, len = firstValues.length; i < firstValues.length; i++) { values.push(firstValues[i].value); } this.onNext.apply(this, values); } } }; var JoinObserver = (function (__super__) { inherits(JoinObserver, __super__); function JoinObserver(source, onError) { __super__.call(this); this.source = source; this.onError = onError; this.queue = []; this.activePlans = []; this.subscription = new SingleAssignmentDisposable(); this.isDisposed = false; } var JoinObserverPrototype = JoinObserver.prototype; JoinObserverPrototype.next = function (notification) { if (!this.isDisposed) { if (notification.kind === 'E') { this.onError(notification.exception); return; } this.queue.push(notification); var activePlans = this.activePlans.slice(0); for (var i = 0, len = activePlans.length; i < len; i++) { activePlans[i].match(); } } }; JoinObserverPrototype.error = noop; JoinObserverPrototype.completed = noop; JoinObserverPrototype.addActivePlan = function (activePlan) { this.activePlans.push(activePlan); }; JoinObserverPrototype.subscribe = function () { this.subscription.setDisposable(this.source.materialize().subscribe(this)); }; JoinObserverPrototype.removeActivePlan = function (activePlan) { this.activePlans.splice(this.activePlans.indexOf(activePlan), 1); this.activePlans.length === 0 && this.dispose(); }; JoinObserverPrototype.dispose = function () { __super__.prototype.dispose.call(this); if (!this.isDisposed) { this.isDisposed = true; this.subscription.dispose(); } }; return JoinObserver; } (AbstractObserver)); /** * Creates a pattern that matches when both observable sequences have an available value. * * @param right Observable sequence to match with the current sequence. * @return {Pattern} Pattern object that matches when both observable sequences have an available value. */ observableProto.and = function (right) { return new Pattern([this, right]); }; /** * Matches when the observable sequence has an available value and projects the value. * * @param selector Selector that will be invoked for values in the source sequence. * @returns {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator. */ observableProto.thenDo = function (selector) { return new Pattern([this]).thenDo(selector); }; /** * Joins together the results from several patterns. * * @param plans A series of plans (specified as an Array of as a series of arguments) created by use of the Then operator on patterns. * @returns {Observable} Observable sequence with the results form matching several patterns. */ Observable.when = function () { var plans = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var activePlans = [], externalSubscriptions = new Map(); var outObserver = observerCreate( observer.onNext.bind(observer), function (err) { externalSubscriptions.forEach(function (v) { v.onError(err); }); observer.onError(err); }, observer.onCompleted.bind(observer) ); try { for (var i = 0, len = plans.length; i < len; i++) { activePlans.push(plans[i].activate(externalSubscriptions, outObserver, function (activePlan) { var idx = activePlans.indexOf(activePlan); activePlans.splice(idx, 1); activePlans.length === 0 && observer.onCompleted(); })); } } catch (e) { observableThrow(e).subscribe(observer); } var group = new CompositeDisposable(); externalSubscriptions.forEach(function (joinObserver) { joinObserver.subscribe(); group.add(joinObserver); }); return group; }); }; function observableTimerDate(dueTime, scheduler) { return new AnonymousObservable(function (observer) { return scheduler.scheduleWithAbsolute(dueTime, function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerDateAndPeriod(dueTime, period, scheduler) { return new AnonymousObservable(function (observer) { var count = 0, d = dueTime, p = normalizeTime(period); return scheduler.scheduleRecursiveWithAbsolute(d, function (self) { if (p > 0) { var now = scheduler.now(); d = d + p; d <= now && (d = now + p); } observer.onNext(count++); self(d); }); }); } function observableTimerTimeSpan(dueTime, scheduler) { return new AnonymousObservable(function (observer) { return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) { return dueTime === period ? new AnonymousObservable(function (observer) { return scheduler.schedulePeriodicWithState(0, period, function (count) { observer.onNext(count); return count + 1; }); }) : observableDefer(function () { return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler); }); } /** * Returns an observable sequence that produces a value after each period. * * @example * 1 - res = Rx.Observable.interval(1000); * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout); * * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used. * @returns {Observable} An observable sequence that produces a value after each period. */ var observableinterval = Observable.interval = function (period, scheduler) { return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler); }; /** * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period. * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value. * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period. */ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) { var period; isScheduler(scheduler) || (scheduler = timeoutScheduler); if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') { period = periodOrScheduler; } else if (isScheduler(periodOrScheduler)) { scheduler = periodOrScheduler; } if (dueTime instanceof Date && period === undefined) { return observableTimerDate(dueTime.getTime(), scheduler); } if (dueTime instanceof Date && period !== undefined) { period = periodOrScheduler; return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler); } return period === undefined ? observableTimerTimeSpan(dueTime, scheduler) : observableTimerTimeSpanAndPeriod(dueTime, period, scheduler); }; function observableDelayTimeSpan(source, dueTime, scheduler) { return new AnonymousObservable(function (observer) { var active = false, cancelable = new SerialDisposable(), exception = null, q = [], running = false, subscription; subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) { var d, shouldRun; if (notification.value.kind === 'E') { q = []; q.push(notification); exception = notification.value.exception; shouldRun = !running; } else { q.push({ value: notification.value, timestamp: notification.timestamp + dueTime }); shouldRun = !active; active = true; } if (shouldRun) { if (exception !== null) { observer.onError(exception); } else { d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) { var e, recurseDueTime, result, shouldRecurse; if (exception !== null) { return; } running = true; do { result = null; if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) { result = q.shift().value; } if (result !== null) { result.accept(observer); } } while (result !== null); shouldRecurse = false; recurseDueTime = 0; if (q.length > 0) { shouldRecurse = true; recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now()); } else { active = false; } e = exception; running = false; if (e !== null) { observer.onError(e); } else if (shouldRecurse) { self(recurseDueTime); } })); } } }); return new CompositeDisposable(subscription, cancelable); }, source); } function observableDelayDate(source, dueTime, scheduler) { return observableDefer(function () { return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler); }); } /** * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved. * * @example * 1 - res = Rx.Observable.delay(new Date()); * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout); * * 3 - res = Rx.Observable.delay(5000); * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout); * @memberOf Observable# * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence. * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delay = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return dueTime instanceof Date ? observableDelayDate(this, dueTime.getTime(), scheduler) : observableDelayTimeSpan(this, dueTime, scheduler); }; /** * Ignores values from an observable sequence which are followed by another value before dueTime. * @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The debounced sequence. */ observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0; var subscription = source.subscribe( function (x) { hasvalue = true; value = x; id++; var currentId = id, d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () { hasvalue && id === currentId && observer.onNext(value); hasvalue = false; })); }, function (e) { cancelable.dispose(); observer.onError(e); hasvalue = false; id++; }, function () { cancelable.dispose(); hasvalue && observer.onNext(value); observer.onCompleted(); hasvalue = false; id++; }); return new CompositeDisposable(subscription, cancelable); }, this); }; /** * @deprecated use #debounce or #throttleWithTimeout instead. */ observableProto.throttle = function(dueTime, scheduler) { deprecate('throttle', 'debounce or throttleWithTimeout'); return this.debounce(dueTime, scheduler); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on timing information. * @param {Number} timeSpan Length of each window (specified as an integer denoting milliseconds). * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive windows (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent windows. * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) { var source = this, timeShift; timeShiftOrScheduler == null && (timeShift = timeSpan); isScheduler(scheduler) || (scheduler = timeoutScheduler); if (typeof timeShiftOrScheduler === 'number') { timeShift = timeShiftOrScheduler; } else if (isScheduler(timeShiftOrScheduler)) { timeShift = timeSpan; scheduler = timeShiftOrScheduler; } return new AnonymousObservable(function (observer) { var groupDisposable, nextShift = timeShift, nextSpan = timeSpan, q = [], refCountDisposable, timerD = new SerialDisposable(), totalTime = 0; groupDisposable = new CompositeDisposable(timerD), refCountDisposable = new RefCountDisposable(groupDisposable); function createTimer () { var m = new SingleAssignmentDisposable(), isSpan = false, isShift = false; timerD.setDisposable(m); if (nextSpan === nextShift) { isSpan = true; isShift = true; } else if (nextSpan < nextShift) { isSpan = true; } else { isShift = true; } var newTotalTime = isSpan ? nextSpan : nextShift, ts = newTotalTime - totalTime; totalTime = newTotalTime; if (isSpan) { nextSpan += timeShift; } if (isShift) { nextShift += timeShift; } m.setDisposable(scheduler.scheduleWithRelative(ts, function () { if (isShift) { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); } isSpan && q.shift().onCompleted(); createTimer(); })); }; q.push(new Subject()); observer.onNext(addRef(q[0], refCountDisposable)); createTimer(); groupDisposable.add(source.subscribe( function (x) { for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } }, function (e) { for (var i = 0, len = q.length; i < len; i++) { q[i].onError(e); } observer.onError(e); }, function () { for (var i = 0, len = q.length; i < len; i++) { q[i].onCompleted(); } observer.onCompleted(); } )); return refCountDisposable; }, source); }; /** * Projects each element of an observable sequence into a window that is completed when either it's full or a given amount of time has elapsed. * @param {Number} timeSpan Maximum time length of a window. * @param {Number} count Maximum element count of a window. * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithTimeOrCount = function (timeSpan, count, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var timerD = new SerialDisposable(), groupDisposable = new CompositeDisposable(timerD), refCountDisposable = new RefCountDisposable(groupDisposable), n = 0, windowId = 0, s = new Subject(); function createTimer(id) { var m = new SingleAssignmentDisposable(); timerD.setDisposable(m); m.setDisposable(scheduler.scheduleWithRelative(timeSpan, function () { if (id !== windowId) { return; } n = 0; var newId = ++windowId; s.onCompleted(); s = new Subject(); observer.onNext(addRef(s, refCountDisposable)); createTimer(newId); })); } observer.onNext(addRef(s, refCountDisposable)); createTimer(0); groupDisposable.add(source.subscribe( function (x) { var newId = 0, newWindow = false; s.onNext(x); if (++n === count) { newWindow = true; n = 0; newId = ++windowId; s.onCompleted(); s = new Subject(); observer.onNext(addRef(s, refCountDisposable)); } newWindow && createTimer(newId); }, function (e) { s.onError(e); observer.onError(e); }, function () { s.onCompleted(); observer.onCompleted(); } )); return refCountDisposable; }, source); }; /** * Projects each element of an observable sequence into zero or more buffers which are produced based on timing information. * * @example * 1 - res = xs.bufferWithTime(1000, scheduler); // non-overlapping segments of 1 second * 2 - res = xs.bufferWithTime(1000, 500, scheduler; // segments of 1 second with time shift 0.5 seconds * * @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds). * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers. * @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) { return this.windowWithTime.apply(this, arguments).selectMany(function (x) { return x.toArray(); }); }; /** * Projects each element of an observable sequence into a buffer that is completed when either it's full or a given amount of time has elapsed. * * @example * 1 - res = source.bufferWithTimeOrCount(5000, 50); // 5s or 50 items in an array * 2 - res = source.bufferWithTimeOrCount(5000, 50, scheduler); // 5s or 50 items in an array * * @param {Number} timeSpan Maximum time length of a buffer. * @param {Number} count Maximum element count of a buffer. * @param {Scheduler} [scheduler] Scheduler to run bufferin timers on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithTimeOrCount = function (timeSpan, count, scheduler) { return this.windowWithTimeOrCount(timeSpan, count, scheduler).selectMany(function (x) { return x.toArray(); }); }; /** * Records the time interval between consecutive values in an observable sequence. * * @example * 1 - res = source.timeInterval(); * 2 - res = source.timeInterval(Rx.Scheduler.timeout); * * @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence with time interval information on values. */ observableProto.timeInterval = function (scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return observableDefer(function () { var last = scheduler.now(); return source.map(function (x) { var now = scheduler.now(), span = now - last; last = now; return { value: x, interval: span }; }); }); }; /** * Records the timestamp for each value in an observable sequence. * * @example * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts } * 2 - res = source.timestamp(Rx.Scheduler.timeout); * * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence with timestamp information on values. */ observableProto.timestamp = function (scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return this.map(function (x) { return { value: x, timestamp: scheduler.now() }; }); }; function sampleObservable(source, sampler) { return new AnonymousObservable(function (observer) { var atEnd, value, hasValue; function sampleSubscribe() { if (hasValue) { hasValue = false; observer.onNext(value); } atEnd && observer.onCompleted(); } return new CompositeDisposable( source.subscribe(function (newValue) { hasValue = true; value = newValue; }, observer.onError.bind(observer), function () { atEnd = true; }), sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleSubscribe) ); }, source); } /** * Samples the observable sequence at each interval. * * @example * 1 - res = source.sample(sampleObservable); // Sampler tick sequence * 2 - res = source.sample(5000); // 5 seconds * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable. * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Sampled observable sequence. */ observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return typeof intervalOrSampler === 'number' ? sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) : sampleObservable(this, intervalOrSampler); }; /** * Returns the source observable sequence or the other observable sequence if dueTime elapses. * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs. * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used. * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeout = function (dueTime, other, scheduler) { (other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout'))); isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this, schedulerMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; return new AnonymousObservable(function (observer) { var id = 0, original = new SingleAssignmentDisposable(), subscription = new SerialDisposable(), switched = false, timer = new SerialDisposable(); subscription.setDisposable(original); function createTimer() { var myId = id; timer.setDisposable(scheduler[schedulerMethod](dueTime, function () { if (id === myId) { isPromise(other) && (other = observableFromPromise(other)); subscription.setDisposable(other.subscribe(observer)); } })); } createTimer(); original.setDisposable(source.subscribe(function (x) { if (!switched) { id++; observer.onNext(x); createTimer(); } }, function (e) { if (!switched) { id++; observer.onError(e); } }, function () { if (!switched) { id++; observer.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }, source); }; /** * Generates an observable sequence by iterating a state from an initial state until the condition fails. * * @example * res = source.generateWithAbsoluteTime(0, * function (x) { return return true; }, * function (x) { return x + 1; }, * function (x) { return x; }, * function (x) { return new Date(); } * }); * * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning Date values. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used. * @returns {Observable} The generated sequence. */ Observable.generateWithAbsoluteTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var first = true, hasResult = false, result, state = initialState, time; return scheduler.scheduleRecursiveWithAbsolute(scheduler.now(), function (self) { hasResult && observer.onNext(result); try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); time = timeSelector(state); } } catch (e) { observer.onError(e); return; } if (hasResult) { self(time); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence by iterating a state from an initial state until the condition fails. * * @example * res = source.generateWithRelativeTime(0, * function (x) { return return true; }, * function (x) { return x + 1; }, * function (x) { return x; }, * function (x) { return 500; } * ); * * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used. * @returns {Observable} The generated sequence. */ Observable.generateWithRelativeTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var first = true, hasResult = false, result, state = initialState, time; return scheduler.scheduleRecursiveWithRelative(0, function (self) { hasResult && observer.onNext(result); try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); time = timeSelector(state); } } catch (e) { observer.onError(e); return; } if (hasResult) { self(time); } else { observer.onCompleted(); } }); }); }; /** * Time shifts the observable sequence by delaying the subscription. * * @example * 1 - res = source.delaySubscription(5000); // 5s * 2 - res = source.delaySubscription(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Number} dueTime Absolute or relative time to perform the subscription at. * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delaySubscription = function (dueTime, scheduler) { return this.delayWithSelector(observableTimer(dueTime, isScheduler(scheduler) ? scheduler : timeoutScheduler), observableEmpty); }; /** * Time shifts the observable sequence based on a subscription delay and a delay selector function for each element. * * @example * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only * 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector * * @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source. * @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element. * @returns {Observable} Time-shifted sequence. */ observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) { var source = this, subDelay, selector; if (typeof subscriptionDelay === 'function') { selector = subscriptionDelay; } else { subDelay = subscriptionDelay; selector = delayDurationSelector; } return new AnonymousObservable(function (observer) { var delays = new CompositeDisposable(), atEnd = false, done = function () { if (atEnd && delays.length === 0) { observer.onCompleted(); } }, subscription = new SerialDisposable(), start = function () { subscription.setDisposable(source.subscribe(function (x) { var delay; try { delay = selector(x); } catch (error) { observer.onError(error); return; } var d = new SingleAssignmentDisposable(); delays.add(d); d.setDisposable(delay.subscribe(function () { observer.onNext(x); delays.remove(d); done(); }, observer.onError.bind(observer), function () { observer.onNext(x); delays.remove(d); done(); })); }, observer.onError.bind(observer), function () { atEnd = true; subscription.dispose(); done(); })); }; if (!subDelay) { start(); } else { subscription.setDisposable(subDelay.subscribe(start, observer.onError.bind(observer), start)); } return new CompositeDisposable(subscription, delays); }, this); }; /** * Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled. * @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never(). * @param {Function} [timeoutDurationSelector] Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. * @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException(). * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) { if (arguments.length === 1) { timeoutdurationSelector = firstTimeout; firstTimeout = observableNever(); } other || (other = observableThrow(new Error('Timeout'))); var source = this; return new AnonymousObservable(function (observer) { var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable(); subscription.setDisposable(original); var id = 0, switched = false; function setTimer(timeout) { var myId = id; function timerWins () { return id === myId; } var d = new SingleAssignmentDisposable(); timer.setDisposable(d); d.setDisposable(timeout.subscribe(function () { timerWins() && subscription.setDisposable(other.subscribe(observer)); d.dispose(); }, function (e) { timerWins() && observer.onError(e); }, function () { timerWins() && subscription.setDisposable(other.subscribe(observer)); })); }; setTimer(firstTimeout); function observerWins() { var res = !switched; if (res) { id++; } return res; } original.setDisposable(source.subscribe(function (x) { if (observerWins()) { observer.onNext(x); var timeout; try { timeout = timeoutdurationSelector(x); } catch (e) { observer.onError(e); return; } setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout); } }, function (e) { observerWins() && observer.onError(e); }, function () { observerWins() && observer.onCompleted(); })); return new CompositeDisposable(subscription, timer); }, source); }; /** * Ignores values from an observable sequence which are followed by another value within a computed throttle duration. * @param {Function} durationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element. * @returns {Observable} The debounced sequence. */ observableProto.debounceWithSelector = function (durationSelector) { var source = this; return new AnonymousObservable(function (observer) { var value, hasValue = false, cancelable = new SerialDisposable(), id = 0; var subscription = source.subscribe(function (x) { var throttle; try { throttle = durationSelector(x); } catch (e) { observer.onError(e); return; } isPromise(throttle) && (throttle = observableFromPromise(throttle)); hasValue = true; value = x; id++; var currentid = id, d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(throttle.subscribe(function () { hasValue && id === currentid && observer.onNext(value); hasValue = false; d.dispose(); }, observer.onError.bind(observer), function () { hasValue && id === currentid && observer.onNext(value); hasValue = false; d.dispose(); })); }, function (e) { cancelable.dispose(); observer.onError(e); hasValue = false; id++; }, function () { cancelable.dispose(); hasValue && observer.onNext(value); observer.onCompleted(); hasValue = false; id++; }); return new CompositeDisposable(subscription, cancelable); }, source); }; observableProto.throttleWithSelector = function () { deprecate('throttleWithSelector', 'debounceWithSelector'); return this.debounceWithSelector.apply(this, arguments); }; /** * Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. * * 1 - res = source.skipLastWithTime(5000); * 2 - res = source.skipLastWithTime(5000, scheduler); * * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for skipping elements from the end of the sequence. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence. */ observableProto.skipLastWithTime = function (duration, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } }, observer.onError.bind(observer), function () { var now = scheduler.now(); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } observer.onCompleted(); }); }, source); }; /** * Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements. * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the end of the sequence. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence. */ observableProto.takeLastWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { q.shift(); } }, observer.onError.bind(observer), function () { var now = scheduler.now(); while (q.length > 0) { var next = q.shift(); if (now - next.interval <= duration) { observer.onNext(next.value); } } observer.onCompleted(); }); }, source); }; /** * Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the end of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence. */ observableProto.takeLastBufferWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { q.shift(); } }, observer.onError.bind(observer), function () { var now = scheduler.now(), res = []; while (q.length > 0) { var next = q.shift(); if (now - next.interval <= duration) { res.push(next.value); } } observer.onNext(res); observer.onCompleted(); }); }, source); }; /** * Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.takeWithTime(5000, [optional scheduler]); * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence. */ observableProto.takeWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { return new CompositeDisposable(scheduler.scheduleWithRelative(duration, observer.onCompleted.bind(observer)), source.subscribe(observer)); }, source); }; /** * Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.skipWithTime(5000, [optional scheduler]); * * @description * Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence. * This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded * may not execute immediately, despite the zero due time. * * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration. * @param {Number} duration Duration for skipping elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence. */ observableProto.skipWithTime = function (duration, scheduler) { var source = this; isScheduler(scheduler) || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var open = false; return new CompositeDisposable( scheduler.scheduleWithRelative(duration, function () { open = true; }), source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer))); }, source); }; /** * Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers. * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time. * * @examples * 1 - res = source.skipUntilWithTime(new Date(), [scheduler]); * 2 - res = source.skipUntilWithTime(5000, [scheduler]); * @param {Date|Number} startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements skipped until the specified start time. */ observableProto.skipUntilWithTime = function (startTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this, schedulerMethod = startTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; return new AnonymousObservable(function (observer) { var open = false; return new CompositeDisposable( scheduler[schedulerMethod](startTime, function () { open = true; }), source.subscribe( function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer))); }, source); }; /** * Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers. * @param {Number | Date} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately. * @param {Scheduler} [scheduler] Scheduler to run the timer on. * @returns {Observable} An observable sequence with the elements taken until the specified end time. */ observableProto.takeUntilWithTime = function (endTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this, schedulerMethod = endTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; return new AnonymousObservable(function (observer) { return new CompositeDisposable( scheduler[schedulerMethod](endTime, observer.onCompleted.bind(observer)), source.subscribe(observer)); }, source); }; /** * Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration. * @param {Number} windowDuration time to wait before emitting another item after emitting the last item * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout. * @returns {Observable} An Observable that performs the throttle operation. */ observableProto.throttleFirst = function (windowDuration, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var duration = +windowDuration || 0; if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); } var source = this; return new AnonymousObservable(function (observer) { var lastOnNext = 0; return source.subscribe( function (x) { var now = scheduler.now(); if (lastOnNext === 0 || now - lastOnNext >= duration) { lastOnNext = now; observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer) ); }, source); }; /** * Executes a transducer to transform the observable sequence * @param {Transducer} transducer A transducer to execute * @returns {Observable} An Observable sequence containing the results from the transducer. */ observableProto.transduce = function(transducer) { var source = this; function transformForObserver(observer) { return { init: function() { return observer; }, step: function(obs, input) { return obs.onNext(input); }, result: function(obs) { return obs.onCompleted(); } }; } return new AnonymousObservable(function(observer) { var xform = transducer(transformForObserver(observer)); return source.subscribe( function(v) { try { xform.step(observer, v); } catch (e) { observer.onError(e); } }, observer.onError.bind(observer), function() { xform.result(observer); } ); }, source); }; /* * Performs a exclusive waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @returns {Observable} A exclusive observable with only the results that happen when subscribed. */ observableProto.exclusive = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasCurrent = false, isStopped = false, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); var innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); innerSubscription.setDisposable(innerSource.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (!hasCurrent && g.length === 1) { observer.onCompleted(); } })); return g; }, this); }; /* * Performs a exclusive map waiting for the first to finish before subscribing to another observable. * Observables that come in between subscriptions will be dropped on the floor. * @param {Function} selector Selector to invoke for every item in the current subscription. * @param {Any} [thisArg] An optional context to invoke with the selector parameter. * @returns {Observable} An exclusive observable with only the results that happen when subscribed. */ observableProto.exclusiveMap = function (selector, thisArg) { var sources = this; return new AnonymousObservable(function (observer) { var index = 0, hasCurrent = false, isStopped = true, m = new SingleAssignmentDisposable(), g = new CompositeDisposable(); g.add(m); m.setDisposable(sources.subscribe( function (innerSource) { if (!hasCurrent) { hasCurrent = true; innerSubscription = new SingleAssignmentDisposable(); g.add(innerSubscription); isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); innerSubscription.setDisposable(innerSource.subscribe( function (x) { var result; try { result = selector.call(thisArg, x, index++, innerSource); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, observer.onError.bind(observer), function () { g.remove(innerSubscription); hasCurrent = false; if (isStopped && g.length === 1) { observer.onCompleted(); } })); } }, observer.onError.bind(observer), function () { isStopped = true; if (g.length === 1 && !hasCurrent) { observer.onCompleted(); } })); return g; }, this); }; /** Provides a set of extension methods for virtual time scheduling. */ Rx.VirtualTimeScheduler = (function (__super__) { function notImplemented() { throw new Error('Not implemented'); } function localNow() { return this.toDateTimeOffset(this.clock); } function scheduleNow(state, action) { return this.scheduleAbsoluteWithState(state, this.clock, action); } function scheduleRelative(state, dueTime, action) { return this.scheduleRelativeWithState(state, this.toRelative(dueTime), action); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleRelativeWithState(state, this.toRelative(dueTime - this.now()), action); } function invokeAction(scheduler, action) { action(); return disposableEmpty; } inherits(VirtualTimeScheduler, __super__); /** * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer. * * @constructor * @param {Number} initialClock Initial value for the clock. * @param {Function} comparer Comparer to determine causality of events based on absolute time. */ function VirtualTimeScheduler(initialClock, comparer) { this.clock = initialClock; this.comparer = comparer; this.isEnabled = false; this.queue = new PriorityQueue(1024); __super__.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute); } var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype; /** * Adds a relative time value to an absolute time value. * @param {Number} absolute Absolute virtual time value. * @param {Number} relative Relative virtual time value to add. * @return {Number} Resulting absolute virtual time sum value. */ VirtualTimeSchedulerPrototype.add = notImplemented; /** * Converts an absolute time to a number * @param {Any} The absolute time. * @returns {Number} The absolute time in ms */ VirtualTimeSchedulerPrototype.toDateTimeOffset = notImplemented; /** * Converts the TimeSpan value to a relative virtual time value. * @param {Number} timeSpan TimeSpan value to convert. * @return {Number} Corresponding relative virtual time value. */ VirtualTimeSchedulerPrototype.toRelative = notImplemented; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ VirtualTimeSchedulerPrototype.schedulePeriodicWithState = function (state, period, action) { var s = new SchedulePeriodicRecursive(this, state, period, action); return s.start(); }; /** * Schedules an action to be executed after dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleRelativeWithState = function (state, dueTime, action) { var runAt = this.add(this.clock, dueTime); return this.scheduleAbsoluteWithState(state, runAt, action); }; /** * Schedules an action to be executed at dueTime. * @param {Number} dueTime Relative time after which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleRelative = function (dueTime, action) { return this.scheduleRelativeWithState(action, dueTime, invokeAction); }; /** * Starts the virtual time scheduler. */ VirtualTimeSchedulerPrototype.start = function () { if (!this.isEnabled) { this.isEnabled = true; do { var next = this.getNext(); if (next !== null) { this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime); next.invoke(); } else { this.isEnabled = false; } } while (this.isEnabled); } }; /** * Stops the virtual time scheduler. */ VirtualTimeSchedulerPrototype.stop = function () { this.isEnabled = false; }; /** * Advances the scheduler's clock to the specified time, running all work till that point. * @param {Number} time Absolute time to advance the scheduler's clock to. */ VirtualTimeSchedulerPrototype.advanceTo = function (time) { var dueToClock = this.comparer(this.clock, time); if (this.comparer(this.clock, time) > 0) { throw new Error(argumentOutOfRange); } if (dueToClock === 0) { return; } if (!this.isEnabled) { this.isEnabled = true; do { var next = this.getNext(); if (next !== null && this.comparer(next.dueTime, time) <= 0) { this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime); next.invoke(); } else { this.isEnabled = false; } } while (this.isEnabled); this.clock = time; } }; /** * Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan. * @param {Number} time Relative time to advance the scheduler's clock by. */ VirtualTimeSchedulerPrototype.advanceBy = function (time) { var dt = this.add(this.clock, time), dueToClock = this.comparer(this.clock, dt); if (dueToClock > 0) { throw new Error(argumentOutOfRange); } if (dueToClock === 0) { return; } this.advanceTo(dt); }; /** * Advances the scheduler's clock by the specified relative time. * @param {Number} time Relative time to advance the scheduler's clock by. */ VirtualTimeSchedulerPrototype.sleep = function (time) { var dt = this.add(this.clock, time); if (this.comparer(this.clock, dt) >= 0) { throw new Error(argumentOutOfRange); } this.clock = dt; }; /** * Gets the next scheduled item to be executed. * @returns {ScheduledItem} The next scheduled item. */ VirtualTimeSchedulerPrototype.getNext = function () { while (this.queue.length > 0) { var next = this.queue.peek(); if (next.isCancelled()) { this.queue.dequeue(); } else { return next; } } return null; }; /** * Schedules an action to be executed at dueTime. * @param {Scheduler} scheduler Scheduler to execute the action on. * @param {Number} dueTime Absolute time at which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleAbsolute = function (dueTime, action) { return this.scheduleAbsoluteWithState(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Number} dueTime Absolute time at which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleAbsoluteWithState = function (state, dueTime, action) { var self = this; function run(scheduler, state1) { self.queue.remove(si); return action(scheduler, state1); } var si = new ScheduledItem(this, state, run, dueTime, this.comparer); this.queue.enqueue(si); return si.disposable; }; return VirtualTimeScheduler; }(Scheduler)); /** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */ Rx.HistoricalScheduler = (function (__super__) { inherits(HistoricalScheduler, __super__); /** * Creates a new historical scheduler with the specified initial clock value. * @constructor * @param {Number} initialClock Initial value for the clock. * @param {Function} comparer Comparer to determine causality of events based on absolute time. */ function HistoricalScheduler(initialClock, comparer) { var clock = initialClock == null ? 0 : initialClock; var cmp = comparer || defaultSubComparer; __super__.call(this, clock, cmp); } var HistoricalSchedulerProto = HistoricalScheduler.prototype; /** * Adds a relative time value to an absolute time value. * @param {Number} absolute Absolute virtual time value. * @param {Number} relative Relative virtual time value to add. * @return {Number} Resulting absolute virtual time sum value. */ HistoricalSchedulerProto.add = function (absolute, relative) { return absolute + relative; }; HistoricalSchedulerProto.toDateTimeOffset = function (absolute) { return new Date(absolute).getTime(); }; /** * Converts the TimeSpan value to a relative virtual time value. * @memberOf HistoricalScheduler * @param {Number} timeSpan TimeSpan value to convert. * @return {Number} Corresponding relative virtual time value. */ HistoricalSchedulerProto.toRelative = function (timeSpan) { return timeSpan; }; return HistoricalScheduler; }(Rx.VirtualTimeScheduler)); var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) { inherits(AnonymousObservable, __super__); // Fix subscriber to check for undefined or function returned to decorate as Disposable function fixSubscriber(subscriber) { if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; } return typeof subscriber === 'function' ? disposableCreate(subscriber) : disposableEmpty; } function AnonymousObservable(subscribe, parent) { this.source = parent; if (!(this instanceof AnonymousObservable)) { return new AnonymousObservable(subscribe); } function s(observer) { var setDisposable = function () { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } }; var autoDetachObserver = new AutoDetachObserver(observer); if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(setDisposable); } else { setDisposable(); } return autoDetachObserver; } __super__.call(this, s); } return AnonymousObservable; }(Observable)); var AutoDetachObserver = (function (__super__) { inherits(AutoDetachObserver, __super__); function AutoDetachObserver(observer) { __super__.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype; AutoDetachObserverPrototype.next = function (value) { var noError = false; try { this.observer.onNext(value); noError = true; } catch (e) { throw e; } finally { !noError && this.dispose(); } }; AutoDetachObserverPrototype.error = function (err) { try { this.observer.onError(err); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.completed = function () { try { this.observer.onCompleted(); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); }; AutoDetachObserverPrototype.dispose = function () { __super__.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); var GroupedObservable = (function (__super__) { inherits(GroupedObservable, __super__); function subscribe(observer) { return this.underlyingObservable.subscribe(observer); } function GroupedObservable(key, underlyingObservable, mergedDisposable) { __super__.call(this, subscribe); this.key = key; this.underlyingObservable = !mergedDisposable ? underlyingObservable : new AnonymousObservable(function (observer) { return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer)); }); } return GroupedObservable; }(Observable)); /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed observers. */ var Subject = Rx.Subject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } if (this.exception) { observer.onError(this.exception); return disposableEmpty; } observer.onCompleted(); return disposableEmpty; } inherits(Subject, _super); /** * Creates a subject. * @constructor */ function Subject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.observers = []; } addProperties(Subject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (__super__) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } var ex = this.exception, hv = this.hasValue, v = this.value; if (ex) { observer.onError(ex); } else if (hv) { observer.onNext(v); observer.onCompleted(); } else { observer.onCompleted(); } return disposableEmpty; } inherits(AsyncSubject, __super__); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * @constructor */ function AsyncSubject() { __super__.call(this, subscribe); this.isDisposed = false; this.isStopped = false; this.value = null; this.hasValue = false; this.observers = []; this.exception = null; } addProperties(AsyncSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { checkDisposed.call(this); return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). */ onCompleted: function () { var o, i, len; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; var os = this.observers.slice(0), v = this.value, hv = this.hasValue; if (hv) { for (i = 0, len = os.length; i < len; i++) { o = os[i]; o.onNext(v); o.onCompleted(); } } else { for (i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } } this.observers = []; } }, /** * Notifies all subscribed observers about the error. * @param {Mixed} error The Error to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = error; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } this.value = value; this.hasValue = true; }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.exception = null; this.value = null; } }); return AsyncSubject; }(Observable)); var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) { inherits(AnonymousSubject, __super__); function AnonymousSubject(observer, observable) { this.observer = observer; this.observable = observable; __super__.call(this, this.observable.subscribe.bind(this.observable)); } addProperties(AnonymousSubject.prototype, Observer, { onCompleted: function () { this.observer.onCompleted(); }, onError: function (exception) { this.observer.onError(exception); }, onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { root.Rx = Rx; define(function() { return Rx; }); } else if (freeExports && freeModule) { // in Node.js or RingoJS if (moduleExports) { (freeModule.exports = Rx).Rx = Rx; } else { freeExports.Rx = Rx; } } else { // in a browser or Rhino root.Rx = Rx; } // All code before this point will be filtered from stack traces. var rEndingLine = captureLine(); }.call(this));
components/Provider/index.js
shinosakarb/tebukuro-client
// @flow import React from 'react' import type { ComponentType } from 'react' import { Provider } from 'react-redux' import configure from '../../store' const store = configure() type Props = {} const withProvider = (Component: ComponentType<Props>) => { const Wrapper = (props: Props) => ( <Provider store={store}> <Component {...props} /> </Provider> ) Wrapper.displayName = `withProvider${Component.displayName || Component.name}` return Wrapper } export default withProvider
fields/types/text/TextFilter.js
stunjiturner/keystone
import React from 'react'; import { FormField, FormInput, FormSelect, SegmentedControl } from 'elemental'; const TOGGLE_OPTIONS = [ { label: 'Matches', value: false }, { label: 'Does NOT Match', value: true }, ]; const MODE_OPTIONS = [ { label: 'Contains', value: 'contains' }, { label: 'Exactly', value: 'exactly' }, { label: 'Begins with', value: 'beginsWith' }, { label: 'Ends with', value: 'endsWith' }, ]; function getDefaultValue () { return { mode: MODE_OPTIONS[0].value, inverted: TOGGLE_OPTIONS[0].value, value: '', }; } var TextFilter = React.createClass({ statics: { getDefaultValue: getDefaultValue, }, propTypes: { filter: React.PropTypes.shape({ mode: React.PropTypes.oneOf(MODE_OPTIONS.map(i => i.value)), inverted: React.PropTypes.boolean, value: React.PropTypes.string, }) }, getDefaultProps () { return { filter: getDefaultValue(), }; }, updateFilter (value) { this.props.onChange({ ...this.props.filter, ...value }); }, selectMode (mode) { this.updateFilter({ mode }); React.findDOMNode(this.refs.focusTarget).focus(); }, toggleInverted (inverted) { this.updateFilter({ inverted }); React.findDOMNode(this.refs.focusTarget).focus(); }, updateValue (e) { this.updateFilter({ value: e.target.value }); }, render () { const { field, filter } = this.props; const mode = MODE_OPTIONS.filter((i => i.value === filter.mode))[0]; const placeholder = field.label + ' ' + mode.label.toLowerCase() + '...'; return ( <div> <FormField> <SegmentedControl equalWidthSegments options={TOGGLE_OPTIONS} value={filter.inverted} onChange={this.toggleInverted} /> </FormField> <FormSelect options={MODE_OPTIONS} onChange={this.selectMode} value={mode.value} /> <FormField> <FormInput autofocus ref="focusTarget" value={this.props.filter.value} onChange={this.updateValue} placeholder={placeholder} /> </FormField> </div> ); } }); module.exports = TextFilter;
frontend/src/Settings/Profiles/Metadata/PrimaryTypeItem.js
lidarr/Lidarr
import classNames from 'classnames'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import CheckInput from 'Components/Form/CheckInput'; import styles from './TypeItem.css'; class PrimaryTypeItem extends Component { // // Listeners onAllowedChange = ({ value }) => { const { albumTypeId, onMetadataPrimaryTypeItemAllowedChange } = this.props; onMetadataPrimaryTypeItemAllowedChange(albumTypeId, value); } // // Render render() { const { name, allowed } = this.props; return ( <div className={classNames( styles.metadataProfileItem )} > <label className={styles.albumTypeName} > <CheckInput containerClassName={styles.checkContainer} name={name} value={allowed} onChange={this.onAllowedChange} /> {name} </label> </div> ); } } PrimaryTypeItem.propTypes = { albumTypeId: PropTypes.number.isRequired, name: PropTypes.string.isRequired, allowed: PropTypes.bool.isRequired, sortIndex: PropTypes.number.isRequired, onMetadataPrimaryTypeItemAllowedChange: PropTypes.func }; export default PrimaryTypeItem;
Gryffindor/app/components/Results.js
Acheron-VAF/Acheron
import React, { Component } from 'react'; export default class Results extends Component { constructor(props) { super(props); this.state = {}; } componentDidMount() { $.ajax({ url: this.props.dataURL, dataType: 'json', cache: false, success: function(data) { this.setState({data: data}); console.log(this.props.dataURL); this.handlePageData(); }.bind(this), error: function(xhr, status, err) { console.error(this.props.url, status, err.toString()); }.bind(this) }); } handlePageData() { console.log(this.props.router.pathname.split("/")[1]) for (var i = 0; i < this.state.data.length; i++) { if (this.state.data[i].link.includes(this.props.router.pathname.split("/")[1])) { this.setState({ pageData: this.state.data[i].content.rendered, pageTitle: this.state.data[i].title.rendered }); } ; } } render() { return ( <div> <div className="blog-header"> <div className="container"> <h1 className="blog-title title-style" dangerouslySetInnerHTML={{__html: this.state.pageTitle }} /> </div> </div> <div className = "blog-post"> <div className = "blog-main"> <div className = "text-style"> <div dangerouslySetInnerHTML={{__html: this.state.pageData }} /> <br /> </div> </div> </div> </div> ); } }
src/domain/metric/container/Root.js
hellowin/kanca
// @flow import React from 'react'; import { connect } from 'react-redux'; import loc from 'infra/service/location'; import Loading from 'infra/component/Loading'; import MetricRoute from './Route'; export const Route = MetricRoute; const mapStateToProps = state => ({ loggedIn: state.user.loggedIn, posts: state.group.feeds, comments: state.group.comments, members: state.group.members, loading: state.group.loading, }); const checkMetricAvailability = props => { const { loggedIn, loading, posts, comments, members } = props; if (!loggedIn && !loading && posts.length < 1 && comments.length < 1 && members.length < 1) loc.push('/welcome'); }; class Metric extends React.Component { componentDidMount() { checkMetricAvailability(this.props); } componentWillReceiveProps(nextProps) { checkMetricAvailability(nextProps); } render(){ const { loading, children } = this.props; return !loading ? children : <Loading />; } } export default connect(mapStateToProps)(Metric);
index.ios.js
mastermel/wwg_battle_tool
import React, { Component } from 'react'; import { AppRegistry } from 'react-native'; import App from './app/App'; export default class wwg_battle_tool extends Component { render() { return ( <App /> ); } } AppRegistry.registerComponent('wwg_battle_tool', () => wwg_battle_tool);
ajax/libs/backbone-react-component/0.6.4/backbone-react-component-min.js
askehansen/cdnjs
"use strict";!function(a,b){if("function"==typeof define&&define.amd)define(["react","backbone","underscore"],b);else if("undefined"!=typeof module&&module.exports){var c=require("react"),d=require("backbone"),e=require("underscore");module.exports=b(c,d,e)}else b(a.React,a.Backbone,a._)}(this,function(a,b,c){function d(a,f){f=f||{};var g,h=f.model,i=f.collection;(c.isElement(f.el)||b.$&&f.el instanceof b.$)&&(g=f.el,delete f.el),"undefined"!=typeof h&&(h.attributes||"object"==typeof h&&c.values(h)[0].attributes)&&(delete f.model,this.model=h,this.setPropsBackbone(h,void 0,f)),"undefined"!=typeof i&&(i.models||"object"==typeof i&&c.values(i)[0].models)&&(delete f.collection,this.collection=i,this.setPropsBackbone(i,void 0,f));var j;a.prototype?(j=this.virtualComponent=c.defaults(a.apply(this,c.rest(arguments)).__realComponentInstance,b.Events,c.omit(b.React.Component,"mixin"),{clone:function(b,c){return new d(a,b,c).virtualComponent},cid:c.uniqueId(),wrapper:this}),g&&e.setElement.call(j,g)):(j=a,this.component=j),j._owner||(this.startModelListeners(),this.startCollectionListeners())}b.React||(b.React={}),b.React.Component={extend:function(f){function g(){var a=Array.prototype.slice.call(arguments),b=function(){return d.apply(this,[h].concat(a))};return b.prototype=d.prototype,(new b).virtualComponent}g.extend=function(){return b.React.Component.extend(c.extend({},f,arguments[0]))},f.mixins?f.mixins[0]!==e&&f.mixins.splice(0,0,e):f.mixins=[e];var h=a.createClass(c.extend(g.prototype,f));return g},mount:function(b,c){if(!b&&!this.el)throw new Error("No element to mount on");return b||(b=this.el),this.wrapper.component=a.renderComponent(this,b,c),this},remove:function(){this.wrapper.component&&this.wrapper.component.isMounted()&&this.unmount(),this.wrapper.stopListening(),this.stopListening()},toHTML:function(){var b=this.clone(c.extend({},this.props,{collection:this.wrapper.collection,model:this.wrapper.model}));return a.renderComponentToString(b)},unmount:function(){var b=this.el.parentNode;if(!a.unmountComponentAtNode(b))throw new Error("There was an error unmounting the component");delete this.wrapper.component,this.setElement(b)}};var e=b.React.Component.mixin={componentDidMount:function(){this.setElement(this.getDOMNode())},componentDidUpdate:function(){this.setElement(this.getDOMNode())},componentWillMount:function(){this.wrapper||(this.isBackboneMixin=!0,this.wrapper=new d(this,this.props))},componentWillUnmount:function(){this.wrapper&&this.isBackboneMixin&&(this.wrapper.stopListening(),delete this.wrapper)},$:function(){return this.$el?this.$el.find.apply(this.$el,arguments):void 0},getCollection:function(){for(var a=this,b=a.wrapper;!b.collection;){if(a=a._owner,!a)throw new Error("Collection not found");b=a.wrapper}return b.collection},getModel:function(){for(var a=this,b=a.wrapper;!b.model;){if(a=a._owner,!a)throw new Error("Model not found");b=a.wrapper}return b.model},getOwner:function(){for(var a=this;a._owner;)a=a._owner;return a},setElement:function(a){if(a&&b.$&&a instanceof b.$){if(a.length>1)throw new Error("You can only assign one element to a component");this.el=a[0],this.$el=a}else a&&(this.el=a,b.$&&(this.$el=b.$(a)));return this}};return c.extend(d.prototype,b.Events,{onError:function(a,b,c){c.silent||this.setProps({isRequesting:!1,hasError:!0,error:b})},onRequest:function(a,b,c){c.silent||this.setProps({isRequesting:!0,hasError:!1})},onSync:function(a,b,c){c.silent||this.setProps({isRequesting:!1})},setPropsBackbone:function(a,b,c){if(a.models||a.attributes)this.setProps.apply(this,arguments);else for(b in a)this.setPropsBackbone(a[b],b,c)},setProps:function(a,d,e){e||this.component&&this.component.isMounted()||(e=this.virtualComponent.props);var f={},g=a.toJSON?a.toJSON():a;d?f[d]=g:a instanceof b.Collection?f.collection=g:f=g,e?c.extend(e,f):(this.nextProps=c.extend(this.nextProps||{},f),c.defer(c.bind(function(){this.nextProps&&(this.component&&this.component.setProps(this.nextProps),delete this.nextProps)},this)))},startCollectionListeners:function(a,b){if(a||(a=this.collection),a)if(a.models)this.listenTo(a,"add remove change sort reset",c.partial(this.setPropsBackbone,a,b,void 0)).listenTo(a,"error",this.onError).listenTo(a,"request",this.onRequest).listenTo(a,"sync",this.onSync);else if("object"==typeof a)for(b in a)a.hasOwnProperty(b)&&this.startCollectionListeners(a[b],b)},startModelListeners:function(a,b){if(a||(a=this.model),a)if(a.attributes)this.listenTo(a,"change",c.partial(this.setPropsBackbone,a,b,void 0)).listenTo(a,"error",this.onError).listenTo(a,"request",this.onRequest).listenTo(a,"sync",this.onSync);else if("object"==typeof a)for(b in a)this.startModelListeners(a[b],b)}}),b.React.Component});
sites/default/files/js/js__bON3AZxVh3GO6COMon74i1HzoraB-OT1f054H8v5oI.js
mouna16/Drupal8
/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c; }catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={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,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ca(b),i="border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Fa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Ba.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+Oa(b,c,e||(i?"border":"content"),f,h)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b, e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.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(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function xb(a,b,c,d){var e={},f=a===tb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function yb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function zb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Ab(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Mb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Mb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n}); ; // Underscore.js 1.8.3 // http://underscorejs.org // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. (function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i},m.indexOf=r(1,m.findIndex,m.sortedIndex),m.lastIndexOf=r(-1,m.findLastIndex),m.range=function(n,t,r){null==t&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e<arguments.length;)i.push(arguments[e++]);return E(n,r,this,this,i)};return r},m.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this); (function(t){var e=typeof self=="object"&&self.self==self&&self||typeof global=="object"&&global.global==global&&global;if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,n){e.Backbone=t(e,n,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore"),r;try{r=require("jquery")}catch(n){}t(e,exports,i,r)}else{e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}})(function(t,e,i,r){var n=t.Backbone;var s=Array.prototype.slice;e.VERSION="1.2.3";e.$=r;e.noConflict=function(){t.Backbone=n;return this};e.emulateHTTP=false;e.emulateJSON=false;var a=function(t,e,r){switch(t){case 1:return function(){return i[e](this[r])};case 2:return function(t){return i[e](this[r],t)};case 3:return function(t,n){return i[e](this[r],h(t,this),n)};case 4:return function(t,n,s){return i[e](this[r],h(t,this),n,s)};default:return function(){var t=s.call(arguments);t.unshift(this[r]);return i[e].apply(i,t)}}};var o=function(t,e,r){i.each(e,function(e,n){if(i[n])t.prototype[n]=a(e,n,r)})};var h=function(t,e){if(i.isFunction(t))return t;if(i.isObject(t)&&!e._isModel(t))return u(t);if(i.isString(t))return function(e){return e.get(t)};return t};var u=function(t){var e=i.matches(t);return function(t){return e(t.attributes)}};var l=e.Events={};var c=/\s+/;var f=function(t,e,r,n,s){var a=0,o;if(r&&typeof r==="object"){if(n!==void 0&&"context"in s&&s.context===void 0)s.context=n;for(o=i.keys(r);a<o.length;a++){e=f(t,e,o[a],r[o[a]],s)}}else if(r&&c.test(r)){for(o=r.split(c);a<o.length;a++){e=t(e,o[a],n,s)}}else{e=t(e,r,n,s)}return e};l.on=function(t,e,i){return d(this,t,e,i)};var d=function(t,e,i,r,n){t._events=f(v,t._events||{},e,i,{context:r,ctx:t,listening:n});if(n){var s=t._listeners||(t._listeners={});s[n.id]=n}return t};l.listenTo=function(t,e,r){if(!t)return this;var n=t._listenId||(t._listenId=i.uniqueId("l"));var s=this._listeningTo||(this._listeningTo={});var a=s[n];if(!a){var o=this._listenId||(this._listenId=i.uniqueId("l"));a=s[n]={obj:t,objId:n,id:o,listeningTo:s,count:0}}d(t,e,r,this,a);return this};var v=function(t,e,i,r){if(i){var n=t[e]||(t[e]=[]);var s=r.context,a=r.ctx,o=r.listening;if(o)o.count++;n.push({callback:i,context:s,ctx:s||a,listening:o})}return t};l.off=function(t,e,i){if(!this._events)return this;this._events=f(g,this._events,t,e,{context:i,listeners:this._listeners});return this};l.stopListening=function(t,e,r){var n=this._listeningTo;if(!n)return this;var s=t?[t._listenId]:i.keys(n);for(var a=0;a<s.length;a++){var o=n[s[a]];if(!o)break;o.obj.off(e,r,this)}if(i.isEmpty(n))this._listeningTo=void 0;return this};var g=function(t,e,r,n){if(!t)return;var s=0,a;var o=n.context,h=n.listeners;if(!e&&!r&&!o){var u=i.keys(h);for(;s<u.length;s++){a=h[u[s]];delete h[a.id];delete a.listeningTo[a.objId]}return}var l=e?[e]:i.keys(t);for(;s<l.length;s++){e=l[s];var c=t[e];if(!c)break;var f=[];for(var d=0;d<c.length;d++){var v=c[d];if(r&&r!==v.callback&&r!==v.callback._callback||o&&o!==v.context){f.push(v)}else{a=v.listening;if(a&&--a.count===0){delete h[a.id];delete a.listeningTo[a.objId]}}}if(f.length){t[e]=f}else{delete t[e]}}if(i.size(t))return t};l.once=function(t,e,r){var n=f(p,{},t,e,i.bind(this.off,this));return this.on(n,void 0,r)};l.listenToOnce=function(t,e,r){var n=f(p,{},e,r,i.bind(this.stopListening,this,t));return this.listenTo(t,n)};var p=function(t,e,r,n){if(r){var s=t[e]=i.once(function(){n(e,s);r.apply(this,arguments)});s._callback=r}return t};l.trigger=function(t){if(!this._events)return this;var e=Math.max(0,arguments.length-1);var i=Array(e);for(var r=0;r<e;r++)i[r]=arguments[r+1];f(m,this._events,t,void 0,i);return this};var m=function(t,e,i,r){if(t){var n=t[e];var s=t.all;if(n&&s)s=s.slice();if(n)_(n,r);if(s)_(s,[e].concat(r))}return t};var _=function(t,e){var i,r=-1,n=t.length,s=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<n)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<n)(i=t[r]).callback.call(i.ctx,s);return;case 2:while(++r<n)(i=t[r]).callback.call(i.ctx,s,a);return;case 3:while(++r<n)(i=t[r]).callback.call(i.ctx,s,a,o);return;default:while(++r<n)(i=t[r]).callback.apply(i.ctx,e);return}};l.bind=l.on;l.unbind=l.off;i.extend(e,l);var y=e.Model=function(t,e){var r=t||{};e||(e={});this.cid=i.uniqueId(this.cidPrefix);this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)r=this.parse(r,e)||{};r=i.defaults({},r,i.result(this,"defaults"));this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};i.extend(y.prototype,l,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return this.get(t)!=null},matches:function(t){return!!i.iteratee(t,this)(this.attributes)},set:function(t,e,r){if(t==null)return this;var n;if(typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r||(r={});if(!this._validate(n,r))return false;var s=r.unset;var a=r.silent;var o=[];var h=this._changing;this._changing=true;if(!h){this._previousAttributes=i.clone(this.attributes);this.changed={}}var u=this.attributes;var l=this.changed;var c=this._previousAttributes;for(var f in n){e=n[f];if(!i.isEqual(u[f],e))o.push(f);if(!i.isEqual(c[f],e)){l[f]=e}else{delete l[f]}s?delete u[f]:u[f]=e}this.id=this.get(this.idAttribute);if(!a){if(o.length)this._pending=r;for(var d=0;d<o.length;d++){this.trigger("change:"+o[d],this,u[o[d]],r)}}if(h)return this;if(!a){while(this._pending){r=this._pending;this._pending=false;this.trigger("change",this,r)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:true}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,i.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!i.isEmpty(this.changed);return i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):false;var e=this._changing?this._previousAttributes:this.attributes;var r={};for(var n in t){var s=t[n];if(i.isEqual(e[n],s))continue;r[n]=s}return i.size(r)?r:false},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=i.extend({parse:true},t);var e=this;var r=t.success;t.success=function(i){var n=t.parse?e.parse(i,t):i;if(!e.set(n,t))return false;if(r)r.call(t.context,e,i,t);e.trigger("sync",e,i,t)};z(this,t);return this.sync("read",this,t)},save:function(t,e,r){var n;if(t==null||typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r=i.extend({validate:true,parse:true},r);var s=r.wait;if(n&&!s){if(!this.set(n,r))return false}else{if(!this._validate(n,r))return false}var a=this;var o=r.success;var h=this.attributes;r.success=function(t){a.attributes=h;var e=r.parse?a.parse(t,r):t;if(s)e=i.extend({},n,e);if(e&&!a.set(e,r))return false;if(o)o.call(r.context,a,t,r);a.trigger("sync",a,t,r)};z(this,r);if(n&&s)this.attributes=i.extend({},h,n);var u=this.isNew()?"create":r.patch?"patch":"update";if(u==="patch"&&!r.attrs)r.attrs=n;var l=this.sync(u,this,r);this.attributes=h;return l},destroy:function(t){t=t?i.clone(t):{};var e=this;var r=t.success;var n=t.wait;var s=function(){e.stopListening();e.trigger("destroy",e,e.collection,t)};t.success=function(i){if(n)s();if(r)r.call(t.context,e,i,t);if(!e.isNew())e.trigger("sync",e,i,t)};var a=false;if(this.isNew()){i.defer(t.success)}else{z(this,t);a=this.sync("delete",this,t)}if(!n)s();return a},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||F();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.defaults({validate:true},t))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=i.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;if(!r)return true;this.trigger("invalid",this,r,i.extend(e,{validationError:r}));return false}});var b={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};o(y,b,"attributes");var x=e.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,i.extend({silent:true},e))};var w={add:true,remove:true,merge:true};var E={add:true,remove:false};var k=function(t,e,i){i=Math.min(Math.max(i,0),t.length);var r=Array(t.length-i);var n=e.length;for(var s=0;s<r.length;s++)r[s]=t[s+i];for(s=0;s<n;s++)t[s+i]=e[s];for(s=0;s<r.length;s++)t[s+n+i]=r[s]};i.extend(x.prototype,l,{model:y,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:false},e,E))},remove:function(t,e){e=i.extend({},e);var r=!i.isArray(t);t=r?[t]:i.clone(t);var n=this._removeModels(t,e);if(!e.silent&&n)this.trigger("update",this,e);return r?n[0]:n},set:function(t,e){if(t==null)return;e=i.defaults({},e,w);if(e.parse&&!this._isModel(t))t=this.parse(t,e);var r=!i.isArray(t);t=r?[t]:t.slice();var n=e.at;if(n!=null)n=+n;if(n<0)n+=this.length+1;var s=[];var a=[];var o=[];var h={};var u=e.add;var l=e.merge;var c=e.remove;var f=false;var d=this.comparator&&n==null&&e.sort!==false;var v=i.isString(this.comparator)?this.comparator:null;var g;for(var p=0;p<t.length;p++){g=t[p];var m=this.get(g);if(m){if(l&&g!==m){var _=this._isModel(g)?g.attributes:g;if(e.parse)_=m.parse(_,e);m.set(_,e);if(d&&!f)f=m.hasChanged(v)}if(!h[m.cid]){h[m.cid]=true;s.push(m)}t[p]=m}else if(u){g=t[p]=this._prepareModel(g,e);if(g){a.push(g);this._addReference(g,e);h[g.cid]=true;s.push(g)}}}if(c){for(p=0;p<this.length;p++){g=this.models[p];if(!h[g.cid])o.push(g)}if(o.length)this._removeModels(o,e)}var y=false;var b=!d&&u&&c;if(s.length&&b){y=this.length!=s.length||i.some(this.models,function(t,e){return t!==s[e]});this.models.length=0;k(this.models,s,0);this.length=this.models.length}else if(a.length){if(d)f=true;k(this.models,a,n==null?this.length:n);this.length=this.models.length}if(f)this.sort({silent:true});if(!e.silent){for(p=0;p<a.length;p++){if(n!=null)e.index=n+p;g=a[p];g.trigger("add",g,this,e)}if(f||y)this.trigger("sort",this,e);if(a.length||o.length)this.trigger("update",this,e)}return r?t[0]:t},reset:function(t,e){e=e?i.clone(e):{};for(var r=0;r<this.models.length;r++){this._removeReference(this.models[r],e)}e.previousModels=this.models;this._reset();t=this.add(t,i.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return s.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;var e=this.modelId(this._isModel(t)?t.attributes:t);return this._byId[t]||this._byId[e]||this._byId[t.cid]},at:function(t){if(t<0)t+=this.length;return this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,true)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var r=e.length;if(i.isFunction(e))e=i.bind(e,this);if(r===1||i.isString(e)){this.models=this.sortBy(e)}else{this.models.sort(e)}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=i.extend({parse:true},t);var e=t.success;var r=this;t.success=function(i){var n=t.reset?"reset":"set";r[n](i,t);if(e)e.call(t.context,r,i,t);r.trigger("sync",r,i,t)};z(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?i.clone(e):{};var r=e.wait;t=this._prepareModel(t,e);if(!t)return false;if(!r)this.add(t,e);var n=this;var s=e.success;e.success=function(t,e,i){if(r)n.add(t,i);if(s)s.call(i.context,t,e,i)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(this._isModel(t)){if(!t.collection)t.collection=this;return t}e=e?i.clone(e):{};e.collection=this;var r=new this.model(t,e);if(!r.validationError)return r;this.trigger("invalid",this,r.validationError,e);return false},_removeModels:function(t,e){var i=[];for(var r=0;r<t.length;r++){var n=this.get(t[r]);if(!n)continue;var s=this.indexOf(n);this.models.splice(s,1);this.length--;if(!e.silent){e.index=s;n.trigger("remove",n,this,e)}i.push(n);this._removeReference(n,e)}return i.length?i:false},_isModel:function(t){return t instanceof y},_addReference:function(t,e){this._byId[t.cid]=t;var i=this.modelId(t.attributes);if(i!=null)this._byId[i]=t;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var i=this.modelId(t.attributes);if(i!=null)delete this._byId[i];if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(t==="change"){var n=this.modelId(e.previousAttributes());var s=this.modelId(e.attributes);if(n!==s){if(n!=null)delete this._byId[n];if(s!=null)this._byId[s]=e}}this.trigger.apply(this,arguments)}});var S={forEach:3,each:3,map:3,collect:3,reduce:4,foldl:4,inject:4,reduceRight:4,foldr:4,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3};o(x,S,"models");var I=e.View=function(t){this.cid=i.uniqueId("view");i.extend(this,i.pick(t,P));this._ensureElement();this.initialize.apply(this,arguments)};var T=/^(\S+)\s*(.*)$/;var P=["model","collection","el","id","attributes","className","tagName","events"];i.extend(I.prototype,l,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this._removeElement();this.stopListening();return this},_removeElement:function(){this.$el.remove()},setElement:function(t){this.undelegateEvents();this._setElement(t);this.delegateEvents();return this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t);this.el=this.$el[0]},delegateEvents:function(t){t||(t=i.result(this,"events"));if(!t)return this;this.undelegateEvents();for(var e in t){var r=t[e];if(!i.isFunction(r))r=this[r];if(!r)continue;var n=e.match(T);this.delegate(n[1],n[2],i.bind(r,this))}return this},delegate:function(t,e,i){this.$el.on(t+".delegateEvents"+this.cid,e,i);return this},undelegateEvents:function(){if(this.$el)this.$el.off(".delegateEvents"+this.cid);return this},undelegate:function(t,e,i){this.$el.off(t+".delegateEvents"+this.cid,e,i);return this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(!this.el){var t=i.extend({},i.result(this,"attributes"));if(this.id)t.id=i.result(this,"id");if(this.className)t["class"]=i.result(this,"className");this.setElement(this._createElement(i.result(this,"tagName")));this._setAttributes(t)}else{this.setElement(i.result(this,"el"))}},_setAttributes:function(t){this.$el.attr(t)}});e.sync=function(t,r,n){var s=H[t];i.defaults(n||(n={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:s,dataType:"json"};if(!n.url){a.url=i.result(r,"url")||F()}if(n.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(n.attrs||r.toJSON(n))}if(n.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(n.emulateHTTP&&(s==="PUT"||s==="DELETE"||s==="PATCH")){a.type="POST";if(n.emulateJSON)a.data._method=s;var o=n.beforeSend;n.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",s);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!n.emulateJSON){a.processData=false}var h=n.error;n.error=function(t,e,i){n.textStatus=e;n.errorThrown=i;if(h)h.call(n.context,t,e,i)};var u=n.xhr=e.ajax(i.extend(a,n));r.trigger("request",r,u,n);return u};var H={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var A=/\((.*?)\)/g;var C=/(\(\?)?:\w+/g;var R=/\*\w+/g;var j=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,l,{initialize:function(){},route:function(t,r,n){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){n=r;r=""}if(!n)n=this[r];var s=this;e.history.route(t,function(i){var a=s._extractParameters(t,i);if(s.execute(n,a,r)!==false){s.trigger.apply(s,["route:"+r].concat(a));s.trigger("route",r,a);e.history.trigger("route",s,r,a)}});return this},execute:function(t,e,i){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(j,"\\$&").replace(A,"(?:$1)?").replace(C,function(t,e){return e?t:"([^/?]+)"}).replace(R,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var M=e.History=function(){this.handlers=[];this.checkUrl=i.bind(this.checkUrl,this);if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var U=/#.*$/;M.started=false;i.extend(M.prototype,l,{interval:50,atRoot:function(){var t=this.location.pathname.replace(/[^\/]$/,"$&/");return t===this.root&&!this.getSearch()},matchRoot:function(){var t=this.decodeFragment(this.location.pathname);var e=t.slice(0,this.root.length-1)+"/";return e===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return t.charAt(0)==="/"?t.slice(1):t},getFragment:function(t){if(t==null){if(this._usePushState||!this._wantsHashChange){t=this.getPath()}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(M.started)throw new Error("Backbone.history has already been started");M.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._hasHashChange="onhashchange"in window&&(document.documentMode===void 0||document.documentMode>7);this._useHashChange=this._wantsHashChange&&this._hasHashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.history&&this.history.pushState);this._usePushState=this._wantsPushState&&this._hasPushState;this.fragment=this.getFragment();this.root=("/"+this.root+"/").replace(O,"/");if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";this.location.replace(e+"#"+this.getPath());return true}else if(this._hasPushState&&this.atRoot()){this.navigate(this.getHash(),{replace:true})}}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe");this.iframe.src="javascript:0";this.iframe.style.display="none";this.iframe.tabIndex=-1;var r=document.body;var n=r.insertBefore(this.iframe,r.firstChild).contentWindow;n.document.open();n.document.close();n.location.hash="#"+this.fragment}var s=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState){s("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){s("hashchange",this.checkUrl,false)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}if(!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};if(this._usePushState){t("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){t("hashchange",this.checkUrl,false)}if(this.iframe){document.body.removeChild(this.iframe);this.iframe=null}if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);M.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getHash(this.iframe.contentWindow)}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){if(!this.matchRoot())return false;t=this.fragment=this.getFragment(t);return i.some(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!M.started)return false;if(!e||e===true)e={trigger:!!e};t=this.getFragment(t||"");var i=this.root;if(t===""||t.charAt(0)==="?"){i=i.slice(0,-1)||"/"}var r=i+t;t=this.decodeFragment(t.replace(U,""));if(this.fragment===t)return;this.fragment=t;if(this._usePushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,r)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var n=this.iframe.contentWindow;if(!e.replace){n.document.open();n.document.close()}this._updateHash(n.location,t,e.replace)}}else{return this.location.assign(r)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});e.history=new M;var q=function(t,e){var r=this;var n;if(t&&i.has(t,"constructor")){n=t.constructor}else{n=function(){return r.apply(this,arguments)}}i.extend(n,r,e);var s=function(){this.constructor=n};s.prototype=r.prototype;n.prototype=new s;if(t)i.extend(n.prototype,t);n.__super__=r.prototype;return n};y.extend=x.extend=$.extend=I.extend=M.extend=q;var F=function(){throw new Error('A "url" property or function must be specified')};var z=function(t,e){var i=e.error;e.error=function(r){if(i)i.call(e.context,t,r,e);t.trigger("error",t,r,e)}};return e}); /*! * jQuery Once v2.1.1 - http://github.com/robloach/jquery-once * @license MIT, GPL-2.0 * http://opensource.org/licenses/MIT * http://opensource.org/licenses/GPL-2.0 */ (function(e){"use strict";if(typeof exports==="object"){e(require("jquery"))}else if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){"use strict";var n=function(e){e=e||"once";if(typeof e!=="string"){throw new Error("The jQuery Once id parameter must be a string")}return e};e.fn.once=function(t){var r="jquery-once-"+n(t);return this.filter(function(){return e(this).data(r)!==true}).data(r,true)};e.fn.removeOnce=function(e){return this.findOnce(e).removeData("jquery-once-"+n(e))};e.fn.findOnce=function(t){var r="jquery-once-"+n(t);return this.filter(function(){return e(this).data(r)===true})}}); /** * @file * Parse inline JSON and initialize the drupalSettings global object. */ (function () { 'use strict'; // Use direct child elements to harden against XSS exploits when CSP is on. var settingsElement = document.querySelector('head > script[type="application/json"][data-drupal-selector="drupal-settings-json"], body > script[type="application/json"][data-drupal-selector="drupal-settings-json"]'); /** * Variable generated by Drupal with all the configuration created from PHP. * * @global * * @type {object} */ window.drupalSettings = {}; if (settingsElement !== null) { window.drupalSettings = JSON.parse(settingsElement.textContent); } })(); ; window.drupalTranslations = {"strings":{"":{"An AJAX HTTP error occurred.":"Une erreur HTTP AJAX s\u0027est produite.","HTTP Result Code: !status":"Code de statut HTTP : !status","An AJAX HTTP request terminated abnormally.":"Une requ\u00eate HTTP AJAX s\u0027est termin\u00e9e anormalement.","Debugging information follows.":"Informations de d\u00e9bogage ci-dessous.","Path: !uri":"Chemin : !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText : !responseText","ReadyState: !readyState":"ReadyState : !readyState","CustomMessage: !customMessage":"Message personalis\u00e9 : !customMessage","Please wait...":"Veuillez patienter...","The response failed verification so will not be processed.":"La v\u00e9rification de la r\u00e9ponse \u00e0 \u00e9chou\u00e9e, elle ne sera pas trait\u00e9e.","The callback URL is not local and not trusted: !url":"L\u0027URL de retour n\u0027est pas locale et n\u0027est pas de confiance : !url","Changed":"Modifi\u00e9","Home":"Accueil","Next":"Suivant","closed":"ferm\u00e9","Cancel":"Annuler","Edit":"Modifier","Link":"Lien","Image":"Image","Save":"Enregistrer","Open":"Ouvert","Sunday":"Dimanche","Monday":"Lundi","Tuesday":"Mardi","Wednesday":"Mercredi","Thursday":"Jeudi","Friday":"Vendredi","Saturday":"Samedi","Add":"Ajouter","Continue":"Continuer","Done":"Termin\u00e9","OK":"OK","Prev":"Pr\u00e9c.","Mon":"lun","Tue":"mar","Wed":"mer","Thu":"jeu","Fri":"ven","Sat":"sam","Sun":"dim","May":"mai","Select all":"Tout s\u00e9lectionner","Close":"Fermer","Show":"Afficher","Select all rows in this table":"S\u00e9lectionner toutes les lignes du tableau","Deselect all rows in this table":"D\u00e9s\u00e9lectionner toutes les lignes du tableau","Today":"Aujourd\u0027hui","Jan":"jan","Feb":"f\u00e9v","Mar":"mar","Apr":"avr","Jun":"juin","Jul":"juil","Aug":"ao\u00fb","Sep":"sep","Oct":"oct","Nov":"nov","Dec":"d\u00e9c","Extend":"Extension","Su":"Di","Mo":"Lu","Tu":"Ma","We":"Me","Th":"Je","Fr":"Ve","Sa":"Sa","Not published":"Non publi\u00e9","Loading...":"En cours de chargement...","Hide":"Masquer","Unlink":"Supprimer le lien","Not promoted":"Non promu","mm\/dd\/yy":"dd\/mm\/yy","Quick edit":"\u00c9dition rapide","Edit Link":"Lien de modification","Remove group":"Supprimer le groupe","By @name on @date":"Par @name le @date","By @name":"Par @name","Not in menu":"Pas dans le menu","Alias: @alias":"Alias : @alias","No alias":"Aucun alias","@label":"@label","New revision":"Nouvelle r\u00e9vision","Drag to re-order":"Cliquer-d\u00e9poser pour r\u00e9-organiser","Discard changes":"Annuler les changements","Lock":"Verrouiller","Saving":"Enregistrement","This permission is inherited from the authenticated user role.":"Ce droit est h\u00e9rit\u00e9e du r\u00f4le de l\u0027utilisateur authentifi\u00e9.","No revision":"Aucune r\u00e9vision","Requires a title":"Titre obligatoire","Not restricted":"Non restreint","(active tab)":"(onglet actif)","The block cannot be placed in this region.":"Le bloc ne peut pas \u00eatre plac\u00e9 dans cette r\u00e9gion.","Hide summary":"Masquer le r\u00e9sum\u00e9","Edit summary":"Modifier le r\u00e9sum\u00e9","Don\u0027t display post information":"Ne pas afficher les informations de la contribution","Unlock":"D\u00e9verrouiller","Collapse":"Replier","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Le fichier s\u00e9lectionn\u00e9 %filename ne peut pas \u00eatre transf\u00e9r\u00e9. Seulement les fichiers avec les extensions suivantes sont permis : %extensions.","Re-order rows by numerical weight instead of dragging.":"R\u00e9-ordonner les lignes avec des poids num\u00e9riques plut\u00f4t qu\u0027en les d\u00e9pla\u00e7ant.","Show row weights":"Afficher le poids des lignes","Hide row weights":"Cacher le poids des lignes","Apply (all displays)":"Appliquer (tous les affichages)","Apply (this display)":"Appliquer (cet affichage)","Revert to default":"R\u00e9tablir par d\u00e9faut","You have unsaved changes":"Vous avez des changements non enregistr\u00e9s","Needs to be updated":"N\u00e9cessite une mise \u00e0 jour","Does not need to be updated":"Ne n\u00e9cessite aucune mise \u00e0 jour","Show all columns":"Montrer toutes les colonnes","Show table cells that were hidden to make the table fit within a small screen.":"Montrer les cellules de tableau qui ont \u00e9t\u00e9 cach\u00e9es pour que le tableau rentre dans un petit \u00e9cran.","List additional actions":"Lister les actions suppl\u00e9mentaires","Flag other translations as outdated":"Marquer les autres traductions comme p\u00e9rim\u00e9es","Do not flag other translations as outdated":"Ne pas marquer les autres traductions comme p\u00e9rim\u00e9es","opened":"ouvert","Horizontal orientation":"Orientation horizontale","Vertical orientation":"Orientation verticale","Tray orientation changed to @orientation.":"L\u0027orientation du sous-menu est maintenant @orientation.","You have unsaved changes.":"Vous avez des changements non enregistr\u00e9s.","@action @title configuration options":"options de configuration @action @title","Tabbing is no longer constrained by the Contextual module.":"La tabulation n\u0027est plus contrainte par le module Contextual.","Tabbing is constrained to a set of @contextualsCount and the edit mode toggle.":"La tabulation est contrainte par un ensemble de @contextualsCount et l\u0027activation\/d\u00e9saction du mode d\u0027\u00e9dition.","Press the esc key to exit.":"Pressez la touche Echap pour quitter.","@count contextual link\u0003@count contextual links":"@count lien contextuel\u0003@count liens contextuels","!tour_item of !total":"!tour_item sur !total","End tour":"Terminer la visite","Discard changes?":"Annuler les changements ?","The toolbar cannot be set to a horizontal orientation when it is locked.":"La barre d\u0027outils ne peut \u00eatre orient\u00e9e horizontalement lorsqu\u0027elle est verrouill\u00e9e.","Could not load the form for \u003Cq\u003E@field-label\u003C\/q\u003E, either due to a website problem or a network connection problem.\u003Cbr\u003EPlease try again.":"Impossible de charger le formulaire de \u003Cq\u003E@field-label\u003C\/q\u003E, soit \u00e0 cause d\u0027un probl\u00e8me dans le site web, soit \u00e0 cause d\u0027un probl\u00e8me de connexion r\u00e9seau. \u003Cbr \/\u003EVeuillez r\u00e9essayer.","Your changes to \u003Cq\u003E@entity-title\u003C\/q\u003E could not be saved, either due to a website problem or a network connection problem.\u003Cbr\u003EPlease try again.":"Vos modifications dans \u003Cq\u003E@entity-title\u003C\/q\u003E n\u0027ont pas pu \u00eatre enregistr\u00e9es, soit \u00e0 cause d\u0027un probl\u00e8me dans le site web, soit \u00e0 cause d\u0027un probl\u00e8me de connexion r\u00e9seau. \u003Cbr \/\u003EVeuillez recommencer.","Changing the text format to %text_format will permanently remove content that is not allowed in that text format.\u003Cbr\u003E\u003Cbr\u003ESave your changes before switching the text format to avoid losing data.":"Basculer le format de texte en %text_format retirera d\u00e9finitivement le contenu qui n\u0027est pas autoris\u00e9 dans ce format de texte.\u003Cbr\u003E\u003Cbr\u003EPour \u00e9viter de perdre des donn\u00e9es, enregistrez vos changements avant de basculer le format de texte.","Change text format?":"Changer le format de texte ?","Rich Text Editor, !label field":"\u00c9diteur de texte riche, champ !label","Tray \u0022@tray\u0022 @action.":"Sous-menu \u0022@tray\u0022 @action.","Tray @action.":"Sous-menu @action.","Hide lower priority columns":"Cacher les colonnes de plus faible priorit\u00e9","!modules modules are available in the modified list.":"Les modules !modules sont disponibles dans la liste modifi\u00e9e.","Network problem!":"Probl\u00e8me de r\u00e9seau !","Authored on @date":"R\u00e9dig\u00e9 le @date","Deselect all":"Tout d\u00e9s\u00e9lectionner"},"Long month name":{"January":"janvier","February":"f\u00e9vrier","March":"mars","April":"avril","May":"mai","June":"juin","July":"juillet","August":"ao\u00fbt","September":"septembre","October":"octobre","November":"novembre","December":"d\u00e9cembre"}},"pluralFormula":{"0":0,"1":0,"default":1}};; /** * @file * Defines the Drupal JavaScript API. */ /** * A jQuery object, typically the return value from a `$(selector)` call. * * Holds an HTMLElement or a collection of HTMLElements. * * @typedef {object} jQuery * * @prop {number} length=0 * Number of elements contained in the jQuery object. */ /** * Variable generated by Drupal that holds all translated strings from PHP. * * Content of this variable is automatically created by Drupal when using the * Interface Translation module. It holds the translation of strings used on * the page. * * This variable is used to pass data from the backend to the frontend. Data * contained in `drupalSettings` is used during behavior initialization. * * @global * * @var {object} drupalTranslations */ /** * Global Drupal object. * * All Drupal JavaScript APIs are contained in this namespace. * * @global * * @namespace */ window.Drupal = {behaviors: {}, locale: {}}; // Class indicating that JavaScript is enabled; used for styling purpose. document.documentElement.className += ' js'; // Allow other JavaScript libraries to use $. if (window.jQuery) { jQuery.noConflict(); } // JavaScript should be made compatible with libraries other than jQuery by // wrapping it in an anonymous closure. (function (domready, Drupal, drupalSettings, drupalTranslations) { 'use strict'; /** * Helper to rethrow errors asynchronously. * * This way Errors bubbles up outside of the original callstack, making it * easier to debug errors in the browser. * * @param {Error|string} error * The error to be thrown. */ Drupal.throwError = function (error) { setTimeout(function () { throw error; }, 0); }; /** * Custom error thrown after attach/detach if one or more behaviors failed. * Initializes the JavaScript behaviors for page loads and Ajax requests. * * @callback Drupal~behaviorAttach * * @param {HTMLDocument|HTMLElement} context * An element to detach behaviors from. * @param {?object} settings * An object containing settings for the current context. It is rarely used. * * @see Drupal.attachBehaviors */ /** * Reverts and cleans up JavaScript behavior initialization. * * @callback Drupal~behaviorDetach * * @param {HTMLDocument|HTMLElement} context * An element to attach behaviors to. * @param {object} settings * An object containing settings for the current context. * @param {string} trigger * One of `'unload'`, `'move'`, or `'serialize'`. * * @see Drupal.detachBehaviors */ /** * @typedef {object} Drupal~behavior * * @prop {Drupal~behaviorAttach} attach * Function run on page load and after an Ajax call. * @prop {Drupal~behaviorDetach} detach * Function run when content is serialized or removed from the page. */ /** * Holds all initialization methods. * * @namespace Drupal.behaviors * * @type {Object.<string, Drupal~behavior>} */ /** * Defines a behavior to be run during attach and detach phases. * * Attaches all registered behaviors to a page element. * * Behaviors are event-triggered actions that attach to page elements, * enhancing default non-JavaScript UIs. Behaviors are registered in the * {@link Drupal.behaviors} object using the method 'attach' and optionally * also 'detach'. * * {@link Drupal.attachBehaviors} is added below to the `jQuery.ready` event * and therefore runs on initial page load. Developers implementing Ajax in * their solutions should also call this function after new page content has * been loaded, feeding in an element to be processed, in order to attach all * behaviors to the new content. * * Behaviors should use `var elements = * $(context).find(selector).once('behavior-name');` to ensure the behavior is * attached only once to a given element. (Doing so enables the reprocessing * of given elements, which may be needed on occasion despite the ability to * limit behavior attachment to a particular element.) * * @example * Drupal.behaviors.behaviorName = { * attach: function (context, settings) { * // ... * }, * detach: function (context, settings, trigger) { * // ... * } * }; * * @param {HTMLDocument|HTMLElement} [context=document] * An element to attach behaviors to. * @param {object} [settings=drupalSettings] * An object containing settings for the current context. If none is given, * the global {@link drupalSettings} object is used. * * @see Drupal~behaviorAttach * @see Drupal.detachBehaviors * * @throws {Drupal~DrupalBehaviorError} */ Drupal.attachBehaviors = function (context, settings) { context = context || document; settings = settings || drupalSettings; var behaviors = Drupal.behaviors; // Execute all of them. for (var i in behaviors) { if (behaviors.hasOwnProperty(i) && typeof behaviors[i].attach === 'function') { // Don't stop the execution of behaviors in case of an error. try { behaviors[i].attach(context, settings); } catch (e) { Drupal.throwError(e); } } } }; // Attach all behaviors. domready(function () { Drupal.attachBehaviors(document, drupalSettings); }); /** * Detaches registered behaviors from a page element. * * Developers implementing Ajax in their solutions should call this function * before page content is about to be removed, feeding in an element to be * processed, in order to allow special behaviors to detach from the content. * * Such implementations should use `.findOnce()` and `.removeOnce()` to find * elements with their corresponding `Drupal.behaviors.behaviorName.attach` * implementation, i.e. `.removeOnce('behaviorName')`, to ensure the behavior * is detached only from previously processed elements. * * @param {HTMLDocument|HTMLElement} [context=document] * An element to detach behaviors from. * @param {object} [settings=drupalSettings] * An object containing settings for the current context. If none given, * the global {@link drupalSettings} object is used. * @param {string} [trigger='unload'] * A string containing what's causing the behaviors to be detached. The * possible triggers are: * - `'unload'`: The context element is being removed from the DOM. * - `'move'`: The element is about to be moved within the DOM (for example, * during a tabledrag row swap). After the move is completed, * {@link Drupal.attachBehaviors} is called, so that the behavior can undo * whatever it did in response to the move. Many behaviors won't need to * do anything simply in response to the element being moved, but because * IFRAME elements reload their "src" when being moved within the DOM, * behaviors bound to IFRAME elements (like WYSIWYG editors) may need to * take some action. * - `'serialize'`: When an Ajax form is submitted, this is called with the * form as the context. This provides every behavior within the form an * opportunity to ensure that the field elements have correct content * in them before the form is serialized. The canonical use-case is so * that WYSIWYG editors can update the hidden textarea to which they are * bound. * * @throws {Drupal~DrupalBehaviorError} * * @see Drupal~behaviorDetach * @see Drupal.attachBehaviors */ Drupal.detachBehaviors = function (context, settings, trigger) { context = context || document; settings = settings || drupalSettings; trigger = trigger || 'unload'; var behaviors = Drupal.behaviors; // Execute all of them. for (var i in behaviors) { if (behaviors.hasOwnProperty(i) && typeof behaviors[i].detach === 'function') { // Don't stop the execution of behaviors in case of an error. try { behaviors[i].detach(context, settings, trigger); } catch (e) { Drupal.throwError(e); } } } }; /** * Encodes special characters in a plain-text string for display as HTML. * * @param {string} str * The string to be encoded. * * @return {string} * The encoded string. * * @ingroup sanitization */ Drupal.checkPlain = function (str) { str = str.toString() .replace(/&/g, '&amp;') .replace(/"/g, '&quot;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;'); return str; }; /** * Replaces placeholders with sanitized values in a string. * * @param {string} str * A string with placeholders. * @param {object} args * An object of replacements pairs to make. Incidences of any key in this * array are replaced with the corresponding value. Based on the first * character of the key, the value is escaped and/or themed: * - `'!variable'`: inserted as is. * - `'@variable'`: escape plain text to HTML ({@link Drupal.checkPlain}). * - `'%variable'`: escape text and theme as a placeholder for user- * submitted content ({@link Drupal.checkPlain} + * `{@link Drupal.theme}('placeholder')`). * * @return {string} * The formatted string. * * @see Drupal.t */ Drupal.formatString = function (str, args) { // Keep args intact. var processedArgs = {}; // Transform arguments before inserting them. for (var key in args) { if (args.hasOwnProperty(key)) { switch (key.charAt(0)) { // Escaped only. case '@': processedArgs[key] = Drupal.checkPlain(args[key]); break; // Pass-through. case '!': processedArgs[key] = args[key]; break; // Escaped and placeholder. default: processedArgs[key] = Drupal.theme('placeholder', args[key]); break; } } } return Drupal.stringReplace(str, processedArgs, null); }; /** * Replaces substring. * * The longest keys will be tried first. Once a substring has been replaced, * its new value will not be searched again. * * @param {string} str * A string with placeholders. * @param {object} args * Key-value pairs. * @param {Array|null} keys * Array of keys from `args`. Internal use only. * * @return {string} * The replaced string. */ Drupal.stringReplace = function (str, args, keys) { if (str.length === 0) { return str; } // If the array of keys is not passed then collect the keys from the args. if (!Array.isArray(keys)) { keys = []; for (var k in args) { if (args.hasOwnProperty(k)) { keys.push(k); } } // Order the keys by the character length. The shortest one is the first. keys.sort(function (a, b) { return a.length - b.length; }); } if (keys.length === 0) { return str; } // Take next longest one from the end. var key = keys.pop(); var fragments = str.split(key); if (keys.length) { for (var i = 0; i < fragments.length; i++) { // Process each fragment with a copy of remaining keys. fragments[i] = Drupal.stringReplace(fragments[i], args, keys.slice(0)); } } return fragments.join(args[key]); }; /** * Translates strings to the page language, or a given language. * * See the documentation of the server-side t() function for further details. * * @param {string} str * A string containing the English text to translate. * @param {Object.<string, string>} [args] * An object of replacements pairs to make after translation. Incidences * of any key in this array are replaced with the corresponding value. * See {@link Drupal.formatString}. * @param {object} [options] * Additional options for translation. * @param {string} [options.context=''] * The context the source string belongs to. * * @return {string} * The formatted string. * The translated string. */ Drupal.t = function (str, args, options) { options = options || {}; options.context = options.context || ''; // Fetch the localized version of the string. if (typeof drupalTranslations !== 'undefined' && drupalTranslations.strings && drupalTranslations.strings[options.context] && drupalTranslations.strings[options.context][str]) { str = drupalTranslations.strings[options.context][str]; } if (args) { str = Drupal.formatString(str, args); } return str; }; /** * Returns the URL to a Drupal page. * * @param {string} path * Drupal path to transform to URL. * * @return {string} * The full URL. */ Drupal.url = function (path) { return drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + path; }; /** * Returns the passed in URL as an absolute URL. * * @param {string} url * The URL string to be normalized to an absolute URL. * * @return {string} * The normalized, absolute URL. * * @see https://github.com/angular/angular.js/blob/v1.4.4/src/ng/urlUtils.js * @see https://grack.com/blog/2009/11/17/absolutizing-url-in-javascript * @see https://github.com/jquery/jquery-ui/blob/1.11.4/ui/tabs.js#L53 */ Drupal.url.toAbsolute = function (url) { var urlParsingNode = document.createElement('a'); // Decode the URL first; this is required by IE <= 6. Decoding non-UTF-8 // strings may throw an exception. try { url = decodeURIComponent(url); } catch (e) { // Empty. } urlParsingNode.setAttribute('href', url); // IE <= 7 normalizes the URL when assigned to the anchor node similar to // the other browsers. return urlParsingNode.cloneNode(false).href; }; /** * Returns true if the URL is within Drupal's base path. * * @param {string} url * The URL string to be tested. * * @return {bool} * `true` if local. * * @see https://github.com/jquery/jquery-ui/blob/1.11.4/ui/tabs.js#L58 */ Drupal.url.isLocal = function (url) { // Always use browser-derived absolute URLs in the comparison, to avoid // attempts to break out of the base path using directory traversal. var absoluteUrl = Drupal.url.toAbsolute(url); var protocol = location.protocol; // Consider URLs that match this site's base URL but use HTTPS instead of HTTP // as local as well. if (protocol === 'http:' && absoluteUrl.indexOf('https:') === 0) { protocol = 'https:'; } var baseUrl = protocol + '//' + location.host + drupalSettings.path.baseUrl.slice(0, -1); // Decoding non-UTF-8 strings may throw an exception. try { absoluteUrl = decodeURIComponent(absoluteUrl); } catch (e) { // Empty. } try { baseUrl = decodeURIComponent(baseUrl); } catch (e) { // Empty. } // The given URL matches the site's base URL, or has a path under the site's // base URL. return absoluteUrl === baseUrl || absoluteUrl.indexOf(baseUrl + '/') === 0; }; /** * Formats a string containing a count of items. * * This function ensures that the string is pluralized correctly. Since * {@link Drupal.t} is called by this function, make sure not to pass * already-localized strings to it. * * See the documentation of the server-side * \Drupal\Core\StringTranslation\TranslationInterface::formatPlural() * function for more details. * * @param {number} count * The item count to display. * @param {string} singular * The string for the singular case. Please make sure it is clear this is * singular, to ease translation (e.g. use "1 new comment" instead of "1 * new"). Do not use @count in the singular string. * @param {string} plural * The string for the plural case. Please make sure it is clear this is * plural, to ease translation. Use @count in place of the item count, as in * "@count new comments". * @param {object} [args] * An object of replacements pairs to make after translation. Incidences * of any key in this array are replaced with the corresponding value. * See {@link Drupal.formatString}. * Note that you do not need to include @count in this array. * This replacement is done automatically for the plural case. * @param {object} [options] * The options to pass to the {@link Drupal.t} function. * * @return {string} * A translated string. */ Drupal.formatPlural = function (count, singular, plural, args, options) { args = args || {}; args['@count'] = count; var pluralDelimiter = drupalSettings.pluralDelimiter; var translations = Drupal.t(singular + pluralDelimiter + plural, args, options).split(pluralDelimiter); var index = 0; // Determine the index of the plural form. if (typeof drupalTranslations !== 'undefined' && drupalTranslations.pluralFormula) { index = count in drupalTranslations.pluralFormula ? drupalTranslations.pluralFormula[count] : drupalTranslations.pluralFormula['default']; } else if (args['@count'] !== 1) { index = 1; } return translations[index]; }; /** * Encodes a Drupal path for use in a URL. * * For aesthetic reasons slashes are not escaped. * * @param {string} item * Unencoded path. * * @return {string} * The encoded path. */ Drupal.encodePath = function (item) { return window.encodeURIComponent(item).replace(/%2F/g, '/'); }; /** * Generates the themed representation of a Drupal object. * * All requests for themed output must go through this function. It examines * the request and routes it to the appropriate theme function. If the current * theme does not provide an override function, the generic theme function is * called. * * @example * <caption>To retrieve the HTML for text that should be emphasized and * displayed as a placeholder inside a sentence.</caption> * Drupal.theme('placeholder', text); * * @namespace * * @param {function} func * The name of the theme function to call. * @param {...args} * Additional arguments to pass along to the theme function. * * @return {string|object|HTMLElement|jQuery} * Any data the theme function returns. This could be a plain HTML string, * but also a complex object. */ Drupal.theme = function (func) { var args = Array.prototype.slice.apply(arguments, [1]); if (func in Drupal.theme) { return Drupal.theme[func].apply(this, args); } }; /** * Formats text for emphasized display in a placeholder inside a sentence. * * @param {string} str * The text to format (plain-text). * * @return {string} * The formatted text (html). */ Drupal.theme.placeholder = function (str) { return '<em class="placeholder">' + Drupal.checkPlain(str) + '</em>'; }; })(domready, Drupal, window.drupalSettings, window.drupalTranslations); ; /*! * jQuery UI Core 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/category/ui-core/ */(function(e){typeof define=="function"&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,r){var i,s,o,u=t.nodeName.toLowerCase();return"area"===u?(i=t.parentNode,s=i.name,!t.href||!s||i.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap='#"+s+"']")[0],!!o&&n(o))):(/^(input|select|textarea|button|object)$/.test(u)?!t.disabled:"a"===u?t.href||r:r)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return e.css(this,"visibility")==="hidden"}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var n=this.css("position"),r=n==="absolute",i=t?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var t=e(this);return r&&t.css("position")==="static"?!1:i.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return n==="fixed"||!s.length?e(this[0].ownerDocument||document):s},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(n){return t(n,!isNaN(e.attr(n,"tabindex")))},tabbable:function(n){var r=e.attr(n,"tabindex"),i=isNaN(r);return(i||r>=0)&&t(n,!i)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,n){function o(t,n,i,s){return e.each(r,function(){n-=parseFloat(e.css(t,"padding"+this))||0,i&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var r=n==="Width"?["Left","Right"]:["Top","Bottom"],i=n.toLowerCase(),s={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(t){return t===undefined?s["inner"+n].call(this):this.each(function(){e(this).css(i,o(this,t)+"px")})},e.fn["outer"+n]=function(t,r){return typeof t!="number"?s["outer"+n].call(this,t):this.each(function(){e(this).css(i,o(this,t,!0,r)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(n,r){return typeof n=="number"?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),r&&r.call(t)},n)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(t!==undefined)return this.css("zIndex",t);if(this.length){var n=e(this[0]),r,i;while(n.length&&n[0]!==document){r=n.css("position");if(r==="absolute"||r==="relative"||r==="fixed"){i=parseInt(n.css("zIndex"),10);if(!isNaN(i)&&i!==0)return i}n=n.parent()}}return 0}}),e.ui.plugin={add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n,r){var i,s=e.plugins[t];if(!s)return;if(!r&&(!e.element[0].parentNode||e.element[0].parentNode.nodeType===11))return;for(i=0;i<s.length;i++)e.options[s[i][0]]&&s[i][1].apply(e.element,n)}}});; /*! * jQuery UI Widget 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/jQuery.widget/ */(function(e){typeof define=="function"&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){var t=0,n=Array.prototype.slice;return e.cleanData=function(t){return function(n){var r,i,s;for(s=0;(i=n[s])!=null;s++)try{r=e._data(i,"events"),r&&r.remove&&e(i).triggerHandler("remove")}catch(o){}t(n)}}(e.cleanData),e.widget=function(t,n,r){var i,s,o,u,a={},f=t.split(".")[0];return t=t.split(".")[1],i=f+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[f]=e[f]||{},s=e[f][t],o=e[f][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,r){if(!e.isFunction(r)){a[t]=r;return}a[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},i=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=i,s=r.apply(this,arguments),this._super=t,this._superApply=n,s}}()}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix||t:t},a,{constructor:o,namespace:f,widgetName:t,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){var r=n.call(arguments,1),i=0,s=r.length,o,u;for(;i<s;i++)for(o in r[i])u=r[i][o],r[i].hasOwnProperty(o)&&u!==undefined&&(e.isPlainObject(u)?t[o]=e.isPlainObject(t[o])?e.widget.extend({},t[o],u):e.widget.extend({},u):t[o]=u);return t},e.widget.bridge=function(t,r){var i=r.prototype.widgetFullName||t;e.fn[t]=function(s){var o=typeof s=="string",u=n.call(arguments,1),a=this;return o?this.each(function(){var n,r=e.data(this,i);if(s==="instance")return a=r,!1;if(!r)return e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+s+"'");if(!e.isFunction(r[s])||s.charAt(0)==="_")return e.error("no such method '"+s+"' for "+t+" widget instance");n=r[s].apply(r,u);if(n!==r&&n!==undefined)return a=n&&n.jquery?a.pushStack(n.get()):n,!1}):(u.length&&(s=e.widget.extend.apply(null,[s].concat(u))),this.each(function(){var t=e.data(this,i);t?(t.option(s||{}),t._init&&t._init()):e.data(this,i,new r(s,this))})),a}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(n,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),n),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var r=t,i,s,o;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof t=="string"){r={},i=t.split("."),t=i.shift();if(i.length){s=r[t]=e.widget.extend({},this.options[t]);for(o=0;o<i.length-1;o++)s[i[o]]=s[i[o]]||{},s=s[i[o]];t=i.pop();if(arguments.length===1)return s[t]===undefined?null:s[t];s[t]=n}else{if(arguments.length===1)return this.options[t]===undefined?null:this.options[t];r[t]=n}}return this._setOptions(r),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^([\w:-]*)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(n).undelegate(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.widget});; /** * @file * Attaches behaviors for the Contextual module. */ (function ($, Drupal, drupalSettings, _, Backbone, JSON, storage) { 'use strict'; var options = $.extend(drupalSettings.contextual, // Merge strings on top of drupalSettings so that they are not mutable. { strings: { open: Drupal.t('Open'), close: Drupal.t('Close') } } ); // Clear the cached contextual links whenever the current user's set of // permissions changes. var cachedPermissionsHash = storage.getItem('Drupal.contextual.permissionsHash'); var permissionsHash = drupalSettings.user.permissionsHash; if (cachedPermissionsHash !== permissionsHash) { if (typeof permissionsHash === 'string') { _.chain(storage).keys().each(function (key) { if (key.substring(0, 18) === 'Drupal.contextual.') { storage.removeItem(key); } }); } storage.setItem('Drupal.contextual.permissionsHash', permissionsHash); } /** * Initializes a contextual link: updates its DOM, sets up model and views. * * @param {jQuery} $contextual * A contextual links placeholder DOM element, containing the actual * contextual links as rendered by the server. * @param {string} html * The server-side rendered HTML for this contextual link. */ function initContextual($contextual, html) { var $region = $contextual.closest('.contextual-region'); var contextual = Drupal.contextual; $contextual // Update the placeholder to contain its rendered contextual links. .html(html) // Use the placeholder as a wrapper with a specific class to provide // positioning and behavior attachment context. .addClass('contextual') // Ensure a trigger element exists before the actual contextual links. .prepend(Drupal.theme('contextualTrigger')); // Set the destination parameter on each of the contextual links. var destination = 'destination=' + Drupal.encodePath(drupalSettings.path.currentPath); $contextual.find('.contextual-links a').each(function () { var url = this.getAttribute('href'); var glue = (url.indexOf('?') === -1) ? '?' : '&'; this.setAttribute('href', url + glue + destination); }); // Create a model and the appropriate views. var model = new contextual.StateModel({ title: $region.find('h2').eq(0).text().trim() }); var viewOptions = $.extend({el: $contextual, model: model}, options); contextual.views.push({ visual: new contextual.VisualView(viewOptions), aural: new contextual.AuralView(viewOptions), keyboard: new contextual.KeyboardView(viewOptions) }); contextual.regionViews.push(new contextual.RegionView( $.extend({el: $region, model: model}, options)) ); // Add the model to the collection. This must happen after the views have // been associated with it, otherwise collection change event handlers can't // trigger the model change event handler in its views. contextual.collection.add(model); // Let other JavaScript react to the adding of a new contextual link. $(document).trigger('drupalContextualLinkAdded', { $el: $contextual, $region: $region, model: model }); // Fix visual collisions between contextual link triggers. adjustIfNestedAndOverlapping($contextual); } /** * Determines if a contextual link is nested & overlapping, if so: adjusts it. * * This only deals with two levels of nesting; deeper levels are not touched. * * @param {jQuery} $contextual * A contextual links placeholder DOM element, containing the actual * contextual links as rendered by the server. */ function adjustIfNestedAndOverlapping($contextual) { var $contextuals = $contextual // @todo confirm that .closest() is not sufficient .parents('.contextual-region').eq(-1) .find('.contextual'); // Early-return when there's no nesting. if ($contextuals.length === 1) { return; } // If the two contextual links overlap, then we move the second one. var firstTop = $contextuals.eq(0).offset().top; var secondTop = $contextuals.eq(1).offset().top; if (firstTop === secondTop) { var $nestedContextual = $contextuals.eq(1); // Retrieve height of nested contextual link. var height = 0; var $trigger = $nestedContextual.find('.trigger'); // Elements with the .visually-hidden class have no dimensions, so this // class must be temporarily removed to the calculate the height. $trigger.removeClass('visually-hidden'); height = $nestedContextual.height(); $trigger.addClass('visually-hidden'); // Adjust nested contextual link's position. $nestedContextual.css({top: $nestedContextual.position().top + height}); } } /** * Attaches outline behavior for regions associated with contextual links. * * Events * Contextual triggers an event that can be used by other scripts. * - drupalContextualLinkAdded: Triggered when a contextual link is added. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches the outline behavior to the right context. */ Drupal.behaviors.contextual = { attach: function (context) { var $context = $(context); // Find all contextual links placeholders, if any. var $placeholders = $context.find('[data-contextual-id]').once('contextual-render'); if ($placeholders.length === 0) { return; } // Collect the IDs for all contextual links placeholders. var ids = []; $placeholders.each(function () { ids.push($(this).attr('data-contextual-id')); }); // Update all contextual links placeholders whose HTML is cached. var uncachedIDs = _.filter(ids, function initIfCached(contextualID) { var html = storage.getItem('Drupal.contextual.' + contextualID); if (html !== null) { // Initialize after the current execution cycle, to make the AJAX // request for retrieving the uncached contextual links as soon as // possible, but also to ensure that other Drupal behaviors have had // the chance to set up an event listener on the Backbone collection // Drupal.contextual.collection. window.setTimeout(function () { initContextual($context.find('[data-contextual-id="' + contextualID + '"]'), html); }); return false; } return true; }); // Perform an AJAX request to let the server render the contextual links // for each of the placeholders. if (uncachedIDs.length > 0) { $.ajax({ url: Drupal.url('contextual/render'), type: 'POST', data: {'ids[]': uncachedIDs}, dataType: 'json', success: function (results) { _.each(results, function (html, contextualID) { // Store the metadata. storage.setItem('Drupal.contextual.' + contextualID, html); // If the rendered contextual links are empty, then the current // user does not have permission to access the associated links: // don't render anything. if (html.length > 0) { // Update the placeholders to contain its rendered contextual // links. Usually there will only be one placeholder, but it's // possible for multiple identical placeholders exist on the // page (probably because the same content appears more than // once). $placeholders = $context.find('[data-contextual-id="' + contextualID + '"]'); // Initialize the contextual links. for (var i = 0; i < $placeholders.length; i++) { initContextual($placeholders.eq(i), html); } } }); } }); } } }; /** * Namespace for contextual related functionality. * * @namespace */ Drupal.contextual = { /** * The {@link Drupal.contextual.View} instances associated with each list * element of contextual links. * * @type {Array} */ views: [], /** * The {@link Drupal.contextual.RegionView} instances associated with each * contextual region element. * * @type {Array} */ regionViews: [] }; /** * A Backbone.Collection of {@link Drupal.contextual.StateModel} instances. * * @type {Backbone.Collection} */ Drupal.contextual.collection = new Backbone.Collection([], {model: Drupal.contextual.StateModel}); /** * A trigger is an interactive element often bound to a click handler. * * @return {string} * A string representing a DOM fragment. */ Drupal.theme.contextualTrigger = function () { return '<button class="trigger visually-hidden focusable" type="button"></button>'; }; })(jQuery, Drupal, drupalSettings, _, Backbone, window.JSON, window.sessionStorage); ; /** * @file * A Backbone Model for the state of a contextual link's trigger, list & region. */ (function (Drupal, Backbone) { 'use strict'; /** * Models the state of a contextual link's trigger, list & region. * * @constructor * * @augments Backbone.Model */ Drupal.contextual.StateModel = Backbone.Model.extend(/** @lends Drupal.contextual.StateModel# */{ /** * @type {object} * * @prop {string} title * @prop {bool} regionIsHovered * @prop {bool} hasFocus * @prop {bool} isOpen * @prop {bool} isLocked */ defaults: /** @lends Drupal.contextual.StateModel# */{ /** * The title of the entity to which these contextual links apply. * * @type {string} */ title: '', /** * Represents if the contextual region is being hovered. * * @type {bool} */ regionIsHovered: false, /** * Represents if the contextual trigger or options have focus. * * @type {bool} */ hasFocus: false, /** * Represents if the contextual options for an entity are available to * be selected (i.e. whether the list of options is visible). * * @type {bool} */ isOpen: false, /** * When the model is locked, the trigger remains active. * * @type {bool} */ isLocked: false }, /** * Opens or closes the contextual link. * * If it is opened, then also give focus. * * @return {Drupal.contextual.StateModel} * The current contextual state model. */ toggleOpen: function () { var newIsOpen = !this.get('isOpen'); this.set('isOpen', newIsOpen); if (newIsOpen) { this.focus(); } return this; }, /** * Closes this contextual link. * * Does not call blur() because we want to allow a contextual link to have * focus, yet be closed for example when hovering. * * @return {Drupal.contextual.StateModel} * The current contextual state model. */ close: function () { this.set('isOpen', false); return this; }, /** * Gives focus to this contextual link. * * Also closes + removes focus from every other contextual link. * * @return {Drupal.contextual.StateModel} * The current contextual state model. */ focus: function () { this.set('hasFocus', true); var cid = this.cid; this.collection.each(function (model) { if (model.cid !== cid) { model.close().blur(); } }); return this; }, /** * Removes focus from this contextual link, unless it is open. * * @return {Drupal.contextual.StateModel} * The current contextual state model. */ blur: function () { if (!this.get('isOpen')) { this.set('hasFocus', false); } return this; } }); })(Drupal, Backbone); ; /** * @file * A Backbone View that provides the aural view of a contextual link. */ (function (Drupal, Backbone) { 'use strict'; Drupal.contextual.AuralView = Backbone.View.extend(/** @lends Drupal.contextual.AuralView# */{ /** * Renders the aural view of a contextual link (i.e. screen reader support). * * @constructs * * @augments Backbone.View * * @param {object} options * Options for the view. */ initialize: function (options) { this.options = options; this.listenTo(this.model, 'change', this.render); // Use aria-role form so that the number of items in the list is spoken. this.$el.attr('role', 'form'); // Initial render. this.render(); }, /** * @inheritdoc */ render: function () { var isOpen = this.model.get('isOpen'); // Set the hidden property of the links. this.$el.find('.contextual-links') .prop('hidden', !isOpen); // Update the view of the trigger. this.$el.find('.trigger') .text(Drupal.t('@action @title configuration options', { '@action': (!isOpen) ? this.options.strings.open : this.options.strings.close, '@title': this.model.get('title') })) .attr('aria-pressed', isOpen); } }); })(Drupal, Backbone); ; /** * @file * A Backbone View that provides keyboard interaction for a contextual link. */ (function (Drupal, Backbone) { 'use strict'; Drupal.contextual.KeyboardView = Backbone.View.extend(/** @lends Drupal.contextual.KeyboardView# */{ /** * @type {object} */ events: { 'focus .trigger': 'focus', 'focus .contextual-links a': 'focus', 'blur .trigger': function () { this.model.blur(); }, 'blur .contextual-links a': function () { // Set up a timeout to allow a user to tab between the trigger and the // contextual links without the menu dismissing. var that = this; this.timer = window.setTimeout(function () { that.model.close().blur(); }, 150); } }, /** * Provides keyboard interaction for a contextual link. * * @constructs * * @augments Backbone.View */ initialize: function () { /** * The timer is used to create a delay before dismissing the contextual * links on blur. This is only necessary when keyboard users tab into * contextual links without edit mode (i.e. without TabbingManager). * That means that if we decide to disable tabbing of contextual links * without edit mode, all this timer logic can go away. * * @type {NaN|number} */ this.timer = NaN; }, /** * Sets focus on the model; Clears the timer that dismisses the links. */ focus: function () { // Clear the timeout that might have been set by blurring a link. window.clearTimeout(this.timer); this.model.focus(); } }); })(Drupal, Backbone); ; /** * @file * A Backbone View that renders the visual view of a contextual region element. */ (function (Drupal, Backbone, Modernizr) { 'use strict'; Drupal.contextual.RegionView = Backbone.View.extend(/** @lends Drupal.contextual.RegionView# */{ /** * Events for the Backbone view. * * @return {object} * A mapping of events to be used in the view. */ events: function () { var mapping = { mouseenter: function () { this.model.set('regionIsHovered', true); }, mouseleave: function () { this.model.close().blur().set('regionIsHovered', false); } }; // We don't want mouse hover events on touch. if (Modernizr.touchevents) { mapping = {}; } return mapping; }, /** * Renders the visual view of a contextual region element. * * @constructs * * @augments Backbone.View */ initialize: function () { this.listenTo(this.model, 'change:hasFocus', this.render); }, /** * @inheritdoc * * @return {Drupal.contextual.RegionView} * The current contextual region view. */ render: function () { this.$el.toggleClass('focus', this.model.get('hasFocus')); return this; } }); })(Drupal, Backbone, Modernizr); ; /** * @file * A Backbone View that provides the visual view of a contextual link. */ (function (Drupal, Backbone, Modernizr) { 'use strict'; Drupal.contextual.VisualView = Backbone.View.extend(/** @lends Drupal.contextual.VisualView# */{ /** * Events for the Backbone view. * * @return {object} * A mapping of events to be used in the view. */ events: function () { // Prevents delay and simulated mouse events. var touchEndToClick = function (event) { event.preventDefault(); event.target.click(); }; var mapping = { 'click .trigger': function () { this.model.toggleOpen(); }, 'touchend .trigger': touchEndToClick, 'click .contextual-links a': function () { this.model.close().blur(); }, 'touchend .contextual-links a': touchEndToClick }; // We only want mouse hover events on non-touch. if (!Modernizr.touchevents) { mapping.mouseenter = function () { this.model.focus(); }; } return mapping; }, /** * Renders the visual view of a contextual link. Listens to mouse & touch. * * @constructs * * @augments Backbone.View */ initialize: function () { this.listenTo(this.model, 'change', this.render); }, /** * @inheritdoc * * @return {Drupal.contextual.VisualView} * The current contextual visual view. */ render: function () { var isOpen = this.model.get('isOpen'); // The trigger should be visible when: // - the mouse hovered over the region, // - the trigger is locked, // - and for as long as the contextual menu is open. var isVisible = this.model.get('isLocked') || this.model.get('regionIsHovered') || isOpen; this.$el // The open state determines if the links are visible. .toggleClass('open', isOpen) // Update the visibility of the trigger. .find('.trigger').toggleClass('visually-hidden', !isVisible); // Nested contextual region handling: hide any nested contextual triggers. if ('isOpen' in this.model.changed) { this.$el.closest('.contextual-region') .find('.contextual .trigger:not(:first)') .toggle(!isOpen); } return this; } }); })(Drupal, Backbone, Modernizr); ; /** * @file * Attaches behaviors for Drupal's active link marking. */ (function (Drupal, drupalSettings) { 'use strict'; /** * Append is-active class. * * The link is only active if its path corresponds to the current path, the * language of the linked path is equal to the current language, and if the * query parameters of the link equal those of the current request, since the * same request with different query parameters may yield a different page * (e.g. pagers, exposed View filters). * * Does not discriminate based on element type, so allows you to set the * is-active class on any element: a, li… * * @type {Drupal~behavior} */ Drupal.behaviors.activeLinks = { attach: function (context) { // Start by finding all potentially active links. var path = drupalSettings.path; var queryString = JSON.stringify(path.currentQuery); var querySelector = path.currentQuery ? "[data-drupal-link-query='" + queryString + "']" : ':not([data-drupal-link-query])'; var originalSelectors = ['[data-drupal-link-system-path="' + path.currentPath + '"]']; var selectors; // If this is the front page, we have to check for the <front> path as // well. if (path.isFront) { originalSelectors.push('[data-drupal-link-system-path="<front>"]'); } // Add language filtering. selectors = [].concat( // Links without any hreflang attributes (most of them). originalSelectors.map(function (selector) { return selector + ':not([hreflang])'; }), // Links with hreflang equals to the current language. originalSelectors.map(function (selector) { return selector + '[hreflang="' + path.currentLanguage + '"]'; }) ); // Add query string selector for pagers, exposed filters. selectors = selectors.map(function (current) { return current + querySelector; }); // Query the DOM. var activeLinks = context.querySelectorAll(selectors.join(',')); var il = activeLinks.length; for (var i = 0; i < il; i++) { activeLinks[i].classList.add('is-active'); } }, detach: function (context, settings, trigger) { if (trigger === 'unload') { var activeLinks = context.querySelectorAll('[data-drupal-link-system-path].is-active'); var il = activeLinks.length; for (var i = 0; i < il; i++) { activeLinks[i].classList.remove('is-active'); } } } }; })(Drupal, drupalSettings); ; /** * @file * Adapted from underscore.js with the addition Drupal namespace. */ /** * Limits the invocations of a function in a given time frame. * * The debounce function wrapper should be used sparingly. One clear use case * is limiting the invocation of a callback attached to the window resize event. * * Before using the debounce function wrapper, consider first whether the * callback could be attached to an event that fires less frequently or if the * function can be written in such a way that it is only invoked under specific * conditions. * * @param {function} func * The function to be invoked. * @param {number} wait * The time period within which the callback function should only be * invoked once. For example if the wait period is 250ms, then the callback * will only be called at most 4 times per second. * @param {bool} immediate * Whether we wait at the beginning or end to execute the function. * * @return {function} * The debounced function. */ Drupal.debounce = function (func, wait, immediate) { 'use strict'; var timeout; var result; return function () { var context = this; var args = arguments; var later = function () { timeout = null; if (!immediate) { result = func.apply(context, args); } }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) { result = func.apply(context, args); } return result; }; }; ; /*! jquery.cookie v1.4.1 | MIT */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});; /** * @file * Form features. */ /** * Triggers when a value in the form changed. * * The event triggers when content is typed or pasted in a text field, before * the change event triggers. * * @event formUpdated */ (function ($, Drupal, debounce) { 'use strict'; /** * Retrieves the summary for the first element. * * @return {string} * The text of the summary. */ $.fn.drupalGetSummary = function () { var callback = this.data('summaryCallback'); return (this[0] && callback) ? $.trim(callback(this[0])) : ''; }; /** * Sets the summary for all matched elements. * * @param {function} callback * Either a function that will be called each time the summary is * retrieved or a string (which is returned each time). * * @return {jQuery} * jQuery collection of the current element. * * @fires event:summaryUpdated * * @listens event:formUpdated */ $.fn.drupalSetSummary = function (callback) { var self = this; // To facilitate things, the callback should always be a function. If it's // not, we wrap it into an anonymous function which just returns the value. if (typeof callback !== 'function') { var val = callback; callback = function () { return val; }; } return this .data('summaryCallback', callback) // To prevent duplicate events, the handlers are first removed and then // (re-)added. .off('formUpdated.summary') .on('formUpdated.summary', function () { self.trigger('summaryUpdated'); }) // The actual summaryUpdated handler doesn't fire when the callback is // changed, so we have to do this manually. .trigger('summaryUpdated'); }; /** * Prevents consecutive form submissions of identical form values. * * Repetitive form submissions that would submit the identical form values * are prevented, unless the form values are different to the previously * submitted values. * * This is a simplified re-implementation of a user-agent behavior that * should be natively supported by major web browsers, but at this time, only * Firefox has a built-in protection. * * A form value-based approach ensures that the constraint is triggered for * consecutive, identical form submissions only. Compared to that, a form * button-based approach would (1) rely on [visible] buttons to exist where * technically not required and (2) require more complex state management if * there are multiple buttons in a form. * * This implementation is based on form-level submit events only and relies * on jQuery's serialize() method to determine submitted form values. As such, * the following limitations exist: * * - Event handlers on form buttons that preventDefault() do not receive a * double-submit protection. That is deemed to be fine, since such button * events typically trigger reversible client-side or server-side * operations that are local to the context of a form only. * - Changed values in advanced form controls, such as file inputs, are not * part of the form values being compared between consecutive form submits * (due to limitations of jQuery.serialize()). That is deemed to be * acceptable, because if the user forgot to attach a file, then the size of * HTTP payload will most likely be small enough to be fully passed to the * server endpoint within (milli)seconds. If a user mistakenly attached a * wrong file and is technically versed enough to cancel the form submission * (and HTTP payload) in order to attach a different file, then that * edge-case is not supported here. * * Lastly, all forms submitted via HTTP GET are idempotent by definition of * HTTP standards, so excluded in this implementation. * * @type {Drupal~behavior} */ Drupal.behaviors.formSingleSubmit = { attach: function () { function onFormSubmit(e) { var $form = $(e.currentTarget); var formValues = $form.serialize(); var previousValues = $form.attr('data-drupal-form-submit-last'); if (previousValues === formValues) { e.preventDefault(); } else { $form.attr('data-drupal-form-submit-last', formValues); } } $('body').once('form-single-submit') .on('submit.singleSubmit', 'form:not([method~="GET"])', onFormSubmit); } }; /** * Sends a 'formUpdated' event each time a form element is modified. * * @param {HTMLElement} element * The element to trigger a form updated event on. * * @fires event:formUpdated */ function triggerFormUpdated(element) { $(element).trigger('formUpdated'); } /** * Collects the IDs of all form fields in the given form. * * @param {HTMLFormElement} form * The form element to search. * * @return {Array} * Array of IDs for form fields. */ function fieldsList(form) { var $fieldList = $(form).find('[name]').map(function (index, element) { // We use id to avoid name duplicates on radio fields and filter out // elements with a name but no id. return element.getAttribute('id'); }); // Return a true array. return $.makeArray($fieldList); } /** * Triggers the 'formUpdated' event on form elements when they are modified. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches formUpdated behaviors. * @prop {Drupal~behaviorDetach} detach * Detaches formUpdated behaviors. * * @fires event:formUpdated */ Drupal.behaviors.formUpdated = { attach: function (context) { var $context = $(context); var contextIsForm = $context.is('form'); var $forms = (contextIsForm ? $context : $context.find('form')).once('form-updated'); var formFields; if ($forms.length) { // Initialize form behaviors, use $.makeArray to be able to use native // forEach array method and have the callback parameters in the right // order. $.makeArray($forms).forEach(function (form) { var events = 'change.formUpdated input.formUpdated '; var eventHandler = debounce(function (event) { triggerFormUpdated(event.target); }, 300); formFields = fieldsList(form).join(','); form.setAttribute('data-drupal-form-fields', formFields); $(form).on(events, eventHandler); }); } // On ajax requests context is the form element. if (contextIsForm) { formFields = fieldsList(context).join(','); // @todo replace with form.getAttribute() when #1979468 is in. var currentFields = $(context).attr('data-drupal-form-fields'); // If there has been a change in the fields or their order, trigger // formUpdated. if (formFields !== currentFields) { triggerFormUpdated(context); } } }, detach: function (context, settings, trigger) { var $context = $(context); var contextIsForm = $context.is('form'); if (trigger === 'unload') { var $forms = (contextIsForm ? $context : $context.find('form')).removeOnce('form-updated'); if ($forms.length) { $.makeArray($forms).forEach(function (form) { form.removeAttribute('data-drupal-form-fields'); $(form).off('.formUpdated'); }); } } } }; /** * Prepopulate form fields with information from the visitor browser. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches the behavior for filling user info from browser. */ Drupal.behaviors.fillUserInfoFromBrowser = { attach: function (context, settings) { var userInfo = ['name', 'mail', 'homepage']; var $forms = $('[data-user-info-from-browser]').once('user-info-from-browser'); if ($forms.length) { userInfo.map(function (info) { var $element = $forms.find('[name=' + info + ']'); var browserData = localStorage.getItem('Drupal.visitor.' + info); var emptyOrDefault = ($element.val() === '' || ($element.attr('data-drupal-default-value') === $element.val())); if ($element.length && emptyOrDefault && browserData) { $element.val(browserData); } }); } $forms.on('submit', function () { userInfo.map(function (info) { var $element = $forms.find('[name=' + info + ']'); if ($element.length) { localStorage.setItem('Drupal.visitor.' + info, $element.val()); } }); }); } }; })(jQuery, Drupal, Drupal.debounce); ; /** * @file * Add aria attribute handling for details and summary elements. */ (function ($, Drupal) { 'use strict'; /** * Handles `aria-expanded` and `aria-pressed` attributes on details elements. * * @type {Drupal~behavior} */ Drupal.behaviors.detailsAria = { attach: function () { $('body').once('detailsAria').on('click.detailsAria', 'summary', function (event) { var $summary = $(event.currentTarget); var open = $(event.currentTarget.parentNode).attr('open') === 'open' ? 'false' : 'true'; $summary.attr({ 'aria-expanded': open, 'aria-pressed': open }); }); } }; })(jQuery, Drupal); ; /** * @file * Polyfill for HTML5 details elements. */ (function ($, Modernizr, Drupal) { 'use strict'; /** * The collapsible details object represents a single details element. * * @constructor Drupal.CollapsibleDetails * * @param {HTMLElement} node * The details element. */ function CollapsibleDetails(node) { this.$node = $(node); this.$node.data('details', this); // Expand details if there are errors inside, or if it contains an // element that is targeted by the URI fragment identifier. var anchor = location.hash && location.hash !== '#' ? ', ' + location.hash : ''; if (this.$node.find('.error' + anchor).length) { this.$node.attr('open', true); } // Initialize and setup the summary, this.setupSummary(); // Initialize and setup the legend. this.setupLegend(); } $.extend(CollapsibleDetails, /** @lends Drupal.CollapsibleDetails */{ /** * Holds references to instantiated CollapsibleDetails objects. * * @type {Array.<Drupal.CollapsibleDetails>} */ instances: [] }); $.extend(CollapsibleDetails.prototype, /** @lends Drupal.CollapsibleDetails# */{ /** * Initialize and setup summary events and markup. * * @fires event:summaryUpdated * * @listens event:summaryUpdated */ setupSummary: function () { this.$summary = $('<span class="summary"></span>'); this.$node .on('summaryUpdated', $.proxy(this.onSummaryUpdated, this)) .trigger('summaryUpdated'); }, /** * Initialize and setup legend markup. */ setupLegend: function () { // Turn the summary into a clickable link. var $legend = this.$node.find('> summary'); $('<span class="details-summary-prefix visually-hidden"></span>') .append(this.$node.attr('open') ? Drupal.t('Hide') : Drupal.t('Show')) .prependTo($legend) .after(document.createTextNode(' ')); // .wrapInner() does not retain bound events. $('<a class="details-title"></a>') .attr('href', '#' + this.$node.attr('id')) .prepend($legend.contents()) .appendTo($legend); $legend .append(this.$summary) .on('click', $.proxy(this.onLegendClick, this)); }, /** * Handle legend clicks. * * @param {jQuery.Event} e * The event triggered. */ onLegendClick: function (e) { this.toggle(); e.preventDefault(); }, /** * Update summary. */ onSummaryUpdated: function () { var text = $.trim(this.$node.drupalGetSummary()); this.$summary.html(text ? ' (' + text + ')' : ''); }, /** * Toggle the visibility of a details element using smooth animations. */ toggle: function () { var isOpen = !!this.$node.attr('open'); var $summaryPrefix = this.$node.find('> summary span.details-summary-prefix'); if (isOpen) { $summaryPrefix.html(Drupal.t('Show')); } else { $summaryPrefix.html(Drupal.t('Hide')); } // Delay setting the attribute to emulate chrome behavior and make // details-aria.js work as expected with this polyfill. setTimeout(function () { this.$node.attr('open', !isOpen); }.bind(this), 0); } }); /** * Polyfill HTML5 details element. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches behavior for the details element. */ Drupal.behaviors.collapse = { attach: function (context) { if (Modernizr.details) { return; } var $collapsibleDetails = $(context).find('details').once('collapse').addClass('collapse-processed'); if ($collapsibleDetails.length) { for (var i = 0; i < $collapsibleDetails.length; i++) { CollapsibleDetails.instances.push(new CollapsibleDetails($collapsibleDetails[i])); } } } }; // Expose constructor in the public space. Drupal.CollapsibleDetails = CollapsibleDetails; })(jQuery, Modernizr, Drupal); ; /** * @file * Attaches behavior for the Filter module. */ (function ($, Drupal) { 'use strict'; /** * Displays the guidelines of the selected text format automatically. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches behavior for updating filter guidelines. */ Drupal.behaviors.filterGuidelines = { attach: function (context) { function updateFilterGuidelines(event) { var $this = $(event.target); var value = $this.val(); $this.closest('.filter-wrapper') .find('.filter-guidelines-item').hide() .filter('.filter-guidelines-' + value).show(); } $(context).find('.filter-guidelines').once('filter-guidelines') .find(':header').hide() .closest('.filter-wrapper').find('select.filter-list') .on('change.filterGuidelines', updateFilterGuidelines) // Need to trigger the namespaced event to avoid triggering formUpdated // when initializing the select. .trigger('change.filterGuidelines'); } }; })(jQuery, Drupal); ; /** * @file * Manages elements that can offset the size of the viewport. * * Measures and reports viewport offset dimensions from elements like the * toolbar that can potentially displace the positioning of other elements. */ /** * @typedef {object} Drupal~displaceOffset * * @prop {number} top * @prop {number} left * @prop {number} right * @prop {number} bottom */ /** * Triggers when layout of the page changes. * * This is used to position fixed element on the page during page resize and * Toolbar toggling. * * @event drupalViewportOffsetChange */ (function ($, Drupal, debounce) { 'use strict'; /** * @name Drupal.displace.offsets * * @type {Drupal~displaceOffset} */ var offsets = { top: 0, right: 0, bottom: 0, left: 0 }; /** * Registers a resize handler on the window. * * @type {Drupal~behavior} */ Drupal.behaviors.drupalDisplace = { attach: function () { // Mark this behavior as processed on the first pass. if (this.displaceProcessed) { return; } this.displaceProcessed = true; $(window).on('resize.drupalDisplace', debounce(displace, 200)); } }; /** * Informs listeners of the current offset dimensions. * * @function Drupal.displace * * @prop {Drupal~displaceOffset} offsets * * @param {bool} [broadcast] * When true or undefined, causes the recalculated offsets values to be * broadcast to listeners. * * @return {Drupal~displaceOffset} * An object whose keys are the for sides an element -- top, right, bottom * and left. The value of each key is the viewport displacement distance for * that edge. * * @fires event:drupalViewportOffsetChange */ function displace(broadcast) { offsets = Drupal.displace.offsets = calculateOffsets(); if (typeof broadcast === 'undefined' || broadcast) { $(document).trigger('drupalViewportOffsetChange', offsets); } return offsets; } /** * Determines the viewport offsets. * * @return {Drupal~displaceOffset} * An object whose keys are the for sides an element -- top, right, bottom * and left. The value of each key is the viewport displacement distance for * that edge. */ function calculateOffsets() { return { top: calculateOffset('top'), right: calculateOffset('right'), bottom: calculateOffset('bottom'), left: calculateOffset('left') }; } /** * Gets a specific edge's offset. * * Any element with the attribute data-offset-{edge} e.g. data-offset-top will * be considered in the viewport offset calculations. If the attribute has a * numeric value, that value will be used. If no value is provided, one will * be calculated using the element's dimensions and placement. * * @function Drupal.displace.calculateOffset * * @param {string} edge * The name of the edge to calculate. Can be 'top', 'right', * 'bottom' or 'left'. * * @return {number} * The viewport displacement distance for the requested edge. */ function calculateOffset(edge) { var edgeOffset = 0; var displacingElements = document.querySelectorAll('[data-offset-' + edge + ']'); var n = displacingElements.length; for (var i = 0; i < n; i++) { var el = displacingElements[i]; // If the element is not visible, do consider its dimensions. if (el.style.display === 'none') { continue; } // If the offset data attribute contains a displacing value, use it. var displacement = parseInt(el.getAttribute('data-offset-' + edge), 10); // If the element's offset data attribute exits // but is not a valid number then get the displacement // dimensions directly from the element. if (isNaN(displacement)) { displacement = getRawOffset(el, edge); } // If the displacement value is larger than the current value for this // edge, use the displacement value. edgeOffset = Math.max(edgeOffset, displacement); } return edgeOffset; } /** * Calculates displacement for element based on its dimensions and placement. * * @param {HTMLElement} el * The jQuery element whose dimensions and placement will be measured. * * @param {string} edge * The name of the edge of the viewport that the element is associated * with. * * @return {number} * The viewport displacement distance for the requested edge. */ function getRawOffset(el, edge) { var $el = $(el); var documentElement = document.documentElement; var displacement = 0; var horizontal = (edge === 'left' || edge === 'right'); // Get the offset of the element itself. var placement = $el.offset()[horizontal ? 'left' : 'top']; // Subtract scroll distance from placement to get the distance // to the edge of the viewport. placement -= window['scroll' + (horizontal ? 'X' : 'Y')] || document.documentElement['scroll' + (horizontal ? 'Left' : 'Top')] || 0; // Find the displacement value according to the edge. switch (edge) { // Left and top elements displace as a sum of their own offset value // plus their size. case 'top': // Total displacement is the sum of the elements placement and size. displacement = placement + $el.outerHeight(); break; case 'left': // Total displacement is the sum of the elements placement and size. displacement = placement + $el.outerWidth(); break; // Right and bottom elements displace according to their left and // top offset. Their size isn't important. case 'bottom': displacement = documentElement.clientHeight - placement; break; case 'right': displacement = documentElement.clientWidth - placement; break; default: displacement = 0; } return displacement; } /** * Assign the displace function to a property of the Drupal global object. * * @ignore */ Drupal.displace = displace; $.extend(Drupal.displace, { /** * Expose offsets to other scripts to avoid having to recalculate offsets. * * @ignore */ offsets: offsets, /** * Expose method to compute a single edge offsets. * * @ignore */ calculateOffset: calculateOffset }); })(jQuery, Drupal, Drupal.debounce); ; /*! * jQuery UI Button 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/button/ */(function(e){typeof define=="function"&&define.amd?define(["jquery","./core","./widget"],e):e(jQuery)})(function(e){var t,n="ui-button ui-widget ui-state-default ui-corner-all",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",i=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},s=function(t){var n=t.name,r=t.form,i=e([]);return n&&(n=n.replace(/'/g,"\\'"),r?i=e(r).find("[name='"+n+"'][type=radio]"):i=e("[name='"+n+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),i};return e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,i),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var r=this,o=this.options,u=this.type==="checkbox"||this.type==="radio",a=u?"":"ui-state-active";o.label===null&&(o.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(n).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(o.disabled)return;this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(o.disabled)return;e(this).removeClass(a)}).bind("click"+this.eventNamespace,function(e){o.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),u&&this.element.bind("change"+this.eventNamespace,function(){r.refresh()}),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(o.disabled)return!1}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).addClass("ui-state-active"),r.buttonElement.attr("aria-pressed","true");var t=r.element[0];s(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).addClass("ui-state-active"),t=this,r.document.one("mouseup",function(){t=null})}).bind("mouseup"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(o.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",o.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(n+" ui-state-active "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&(this.type==="checkbox"||this.type==="radio"?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active"));return}this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?s(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(r),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),i=this.options.icons,s=i.primary&&i.secondary,o=[];i.primary||i.secondary?(this.options.text&&o.push("ui-button-text-icon"+(s?"s":i.primary?"-primary":"-secondary")),i.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+i.primary+"'></span>"),i.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+i.secondary+"'></span>"),this.options.text||(o.push(s?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl",n=this.element.find(this.options.items),r=n.filter(":ui-button");n.not(":ui-button").button(),r.button("refresh"),this.buttons=n.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button});; /*! * jQuery UI Mouse 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/mouse/ */(function(e){typeof define=="function"&&define.amd?define(["jquery","./widget"],e):e(jQuery)})(function(e){var t=!1;return e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(n){if(t)return;this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(n),this._mouseDownEvent=n;var r=this,i=n.which===1,s=typeof this.options.cancel=="string"&&n.target.nodeName?e(n.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(n))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(n)&&this._mouseDelayMet(n)){this._mouseStarted=this._mouseStart(n)!==!1;if(!this._mouseStarted)return n.preventDefault(),!0}return!0===e.data(n.target,this.widgetName+".preventClickEvent")&&e.removeData(n.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),n.preventDefault(),t=!0,!0},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}if(t.which||t.button)this._mouseMoved=!0;return this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(n){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,n.target===this._mouseDownEvent.target&&e.data(n.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(n)),t=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})});; /*! * jQuery UI Draggable 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/draggable/ */(function(e){typeof define=="function"&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)})(function(e){return e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){this.options.helper==="original"&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),e==="handle"&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=!0;return}this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this._blurActiveElement(t),this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(n.iframeFix===!0?"iframe":n.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var n=this.document[0];if(!this.handleElement.is(t.target))return;try{n.activeElement&&n.activeElement.nodeName.toLowerCase()!=="body"&&e(n.activeElement).blur()}catch(r){}},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return e(this).css("position")==="fixed"}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,n){this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=this,r=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(r=e.ui.ddmanager.drop(this,t)),this.dropped&&(r=this.dropped,this.dropped=!1),this.options.revert==="invalid"&&!r||this.options.revert==="valid"&&r||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,r)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){n._trigger("stop",t)!==!1&&n._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper),i=r?e(n.helper.apply(this.element[0],[t])):n.helper==="clone"?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo(n.appendTo==="parent"?this.element[0].parentNode:n.appendTo),r&&i[0]===this.element[0]&&this._setPositionRelative(),i[0]!==this.element[0]&&!/(fixed|absolute)/.test(i.css("position"))&&i.css("position","absolute"),i},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),n=this.document[0];return this.cssPosition==="absolute"&&this.scrollParent[0]!==n&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative")return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options,s=this.document[0];this.relativeContainer=null;if(!i.containment){this.containment=null;return}if(i.containment==="window"){this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(i.containment==="document"){this.containment=[0,0,e(s).width()-this.helperProportions.width-this.margins.left,(e(s).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(i.containment.constructor===Array){this.containment=i.containment;return}i.containment==="parent"&&(i.containment=this.helper[0].parentNode),n=e(i.containment),r=n[0];if(!r)return;t=/(scroll|auto)/.test(n.css("overflow")),this.containment=[(parseInt(n.css("borderLeftWidth"),10)||0)+(parseInt(n.css("paddingLeft"),10)||0),(parseInt(n.css("borderTopWidth"),10)||0)+(parseInt(n.css("paddingTop"),10)||0),(t?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(n.css("borderBottomWidth"),10)||0)-(parseInt(n.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=n},_convertPositionTo:function(e,t){t||(t=this.position);var n=e==="absolute"?1:-1,r=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-(this.cssPosition==="fixed"?-this.offset.scroll.top:r?0:this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-(this.cssPosition==="fixed"?-this.offset.scroll.left:r?0:this.offset.scroll.left)*n}},_generatePosition:function(e,t){var n,r,i,s,o=this.options,u=this._isRootNode(this.scrollParent[0]),a=e.pageX,f=e.pageY;if(!u||!this.offset.scroll)this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()};return t&&(this.containment&&(this.relativeContainer?(r=this.relativeContainer.offset(),n=[this.containment[0]+r.left,this.containment[1]+r.top,this.containment[2]+r.left,this.containment[3]+r.top]):n=this.containment,e.pageX-this.offset.click.left<n[0]&&(a=n[0]+this.offset.click.left),e.pageY-this.offset.click.top<n[1]&&(f=n[1]+this.offset.click.top),e.pageX-this.offset.click.left>n[2]&&(a=n[2]+this.offset.click.left),e.pageY-this.offset.click.top>n[3]&&(f=n[3]+this.offset.click.top)),o.grid&&(i=o.grid[1]?this.originalPageY+Math.round((f-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,f=n?i-this.offset.click.top>=n[1]||i-this.offset.click.top>n[3]?i:i-this.offset.click.top>=n[1]?i-o.grid[1]:i+o.grid[1]:i,s=o.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,a=n?s-this.offset.click.left>=n[0]||s-this.offset.click.left>n[2]?s:s-this.offset.click.left>=n[0]?s-o.grid[0]:s+o.grid[0]:s),o.axis==="y"&&(a=this.originalPageX),o.axis==="x"&&(f=this.originalPageY)),{top:f-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:u?0:this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:u?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){this.options.axis!=="y"&&this.helper.css("right")!=="auto"&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),this.options.axis!=="x"&&this.helper.css("bottom")!=="auto"&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),r.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n,r){var i=e.extend({},n,{item:r.element});r.sortables=[],e(r.options.connectToSortable).each(function(){var n=e(this).sortable("instance");n&&!n.options.disabled&&(r.sortables.push(n),n.refreshPositions(),n._trigger("activate",t,i))})},stop:function(t,n,r){var i=e.extend({},n,{item:r.element});r.cancelHelperRemoval=!1,e.each(r.sortables,function(){var e=this;e.isOver?(e.isOver=0,r.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,i))})},drag:function(t,n,r){e.each(r.sortables,function(){var i=!1,s=this;s.positionAbs=r.positionAbs,s.helperProportions=r.helperProportions,s.offset.click=r.offset.click,s._intersectsWith(s.containerCache)&&(i=!0,e.each(r.sortables,function(){return this.positionAbs=r.positionAbs,this.helperProportions=r.helperProportions,this.offset.click=r.offset.click,this!==s&&this._intersectsWith(this.containerCache)&&e.contains(s.element[0],this.element[0])&&(i=!1),i})),i?(s.isOver||(s.isOver=1,r._parent=n.helper.parent(),s.currentItem=n.helper.appendTo(s.element).data("ui-sortable-item",!0),s.options._helper=s.options.helper,s.options.helper=function(){return n.helper[0]},t.target=s.currentItem[0],s._mouseCapture(t,!0),s._mouseStart(t,!0,!0),s.offset.click.top=r.offset.click.top,s.offset.click.left=r.offset.click.left,s.offset.parent.left-=r.offset.parent.left-s.offset.parent.left,s.offset.parent.top-=r.offset.parent.top-s.offset.parent.top,r._trigger("toSortable",t),r.dropped=s.element,e.each(r.sortables,function(){this.refreshPositions()}),r.currentItem=r.element,s.fromOutside=r),s.currentItem&&(s._mouseDrag(t),n.position=s.position)):s.isOver&&(s.isOver=0,s.cancelHelperRemoval=!0,s.options._revert=s.options.revert,s.options.revert=!1,s._trigger("out",t,s._uiHash(s)),s._mouseStop(t,!0),s.options.revert=s.options._revert,s.options.helper=s.options._helper,s.placeholder&&s.placeholder.remove(),n.helper.appendTo(r._parent),r._refreshOffsets(t),n.position=r._generatePosition(t,!0),r._trigger("fromSortable",t),r.dropped=!1,e.each(r.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n,r){var i=e("body"),s=r.options;i.css("cursor")&&(s._cursor=i.css("cursor")),i.css("cursor",s.cursor)},stop:function(t,n,r){var i=r.options;i._cursor&&e("body").css("cursor",i._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("opacity")&&(s._opacity=i.css("opacity")),i.css("opacity",s.opacity)},stop:function(t,n,r){var i=r.options;i._opacity&&e(n.helper).css("opacity",i._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&n.scrollParentNotHidden[0].tagName!=="HTML"&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(t,n,r){var i=r.options,s=!1,o=r.scrollParentNotHidden[0],u=r.document[0];if(o!==u&&o.tagName!=="HTML"){if(!i.axis||i.axis!=="x")r.overflowOffset.top+o.offsetHeight-t.pageY<i.scrollSensitivity?o.scrollTop=s=o.scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(o.scrollTop=s=o.scrollTop-i.scrollSpeed);if(!i.axis||i.axis!=="y")r.overflowOffset.left+o.offsetWidth-t.pageX<i.scrollSensitivity?o.scrollLeft=s=o.scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(o.scrollLeft=s=o.scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!=="x")t.pageY-e(u).scrollTop()<i.scrollSensitivity?s=e(u).scrollTop(e(u).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(u).scrollTop())<i.scrollSensitivity&&(s=e(u).scrollTop(e(u).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!=="y")t.pageX-e(u).scrollLeft()<i.scrollSensitivity?s=e(u).scrollLeft(e(u).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(u).scrollLeft())<i.scrollSensitivity&&(s=e(u).scrollLeft(e(u).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n,r){var i=r.options;r.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!==r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n,r){var i,s,o,u,a,f,l,c,h,p,d=r.options,v=d.snapTolerance,m=n.offset.left,g=m+r.helperProportions.width,y=n.offset.top,b=y+r.helperProportions.height;for(h=r.snapElements.length-1;h>=0;h--){a=r.snapElements[h].left-r.margins.left,f=a+r.snapElements[h].width,l=r.snapElements[h].top-r.margins.top,c=l+r.snapElements[h].height;if(g<a-v||m>f+v||b<l-v||y>c+v||!e.contains(r.snapElements[h].item.ownerDocument,r.snapElements[h].item)){r.snapElements[h].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=!1;continue}d.snapMode!=="inner"&&(i=Math.abs(l-b)<=v,s=Math.abs(c-y)<=v,o=Math.abs(a-g)<=v,u=Math.abs(f-m)<=v,i&&(n.position.top=r._convertPositionTo("relative",{top:l-r.helperProportions.height,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a-r.helperProportions.width}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f}).left)),p=i||s||o||u,d.snapMode!=="outer"&&(i=Math.abs(l-y)<=v,s=Math.abs(c-b)<=v,o=Math.abs(a-m)<=v,u=Math.abs(f-g)<=v,i&&(n.position.top=r._convertPositionTo("relative",{top:l,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c-r.helperProportions.height,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f-r.helperProportions.width}).left)),!r.snapElements[h].snapping&&(i||s||o||u||p)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=i||s||o||u||p}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n,r){var i,s=r.options,o=e.makeArray(e(s.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!o.length)return;i=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",i+t)}),this.css("zIndex",i+o.length)}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("zIndex")&&(s._zIndex=i.css("zIndex")),i.css("zIndex",s.zIndex)},stop:function(t,n,r){var i=r.options;i._zIndex&&e(n.helper).css("zIndex",i._zIndex)}}),e.ui.draggable});; /*! * jQuery UI Position 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/position/ */(function(e){typeof define=="function"&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){return function(){function h(e,t,n){return[parseFloat(e[0])*(l.test(e[0])?t/100:1),parseFloat(e[1])*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}function d(t){var n=t[0];return n.nodeType===9?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var t,n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(t!==undefined)return t;var n,r,i=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),s=i.children()[0];return e("body").append(i),n=s.offsetWidth,i.css("overflow","scroll"),r=s.offsetWidth,n===r&&(r=i[0].clientWidth),i.remove(),t=n-r},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),r=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:s?e.position.scrollbarWidth():0,height:i?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]),i=!!n[0]&&n[0].nodeType===9;return{element:n,isWindow:r,isDocument:i,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r||i?n.width():n.outerWidth(),height:r||i?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var l,v,m,g,y,b,w=e(t.of),E=e.position.getWithinInfo(t.within),S=e.position.getScrollInfo(E),x=(t.collision||"flip").split(" "),T={};return b=d(w),w[0].preventDefault&&(t.at="left top"),v=b.width,m=b.height,g=b.offset,y=e.extend({},g),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),T[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),x.length===1&&(x[1]=x[0]),t.at[0]==="right"?y.left+=v:t.at[0]==="center"&&(y.left+=v/2),t.at[1]==="bottom"?y.top+=m:t.at[1]==="center"&&(y.top+=m/2),l=h(T.at,v,m),y.left+=l[0],y.top+=l[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),d=p(this,"marginLeft"),b=p(this,"marginTop"),N=f+d+p(this,"marginRight")+S.width,C=c+b+p(this,"marginBottom")+S.height,k=e.extend({},y),L=h(T.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?k.left-=f:t.my[0]==="center"&&(k.left-=f/2),t.my[1]==="bottom"?k.top-=c:t.my[1]==="center"&&(k.top-=c/2),k.left+=L[0],k.top+=L[1],n||(k.left=s(k.left),k.top=s(k.top)),o={marginLeft:d,marginTop:b},e.each(["left","top"],function(n,r){e.ui.position[x[n]]&&e.ui.position[x[n]][r](k,{targetWidth:v,targetHeight:m,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:N,collisionHeight:C,offset:[l[0]+L[0],l[1]+L[1]],my:t.my,at:t.at,within:E,elem:a})}),t.using&&(u=function(e){var n=g.left-k.left,s=n+v-f,o=g.top-k.top,u=o+m-c,l={target:{element:w,left:g.left,top:g.top,width:v,height:m},element:{element:a,left:k.left,top:k.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};v<f&&i(n+s)<v&&(l.horizontal="center"),m<c&&i(o+u)<m&&(l.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?l.important="horizontal":l.important="vertical",t.using.call(this,e,l)}),a.offset(e.extend(k,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;if(a<0){v=e.top+c+h+p+t.collisionHeight-s-r;if(v<0||v<i(a))e.top+=c+h+p}else if(f>0){d=e.top-t.collisionPosition.marginTop+c+h+p-o;if(d>0||i(d)<f)e.top+=c+h+p}}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,r,i,s,o,u=document.getElementsByTagName("body")[0],a=document.createElement("div");t=document.createElement(u?"div":"body"),i={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},u&&e.extend(i,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in i)t.style[o]=i[o];t.appendChild(a),r=u||document.documentElement,r.insertBefore(t,r.firstChild),a.style.cssText="position: absolute; left: 10.7432222px;",s=e(a).offset().left,n=s>10&&s<11,t.innerHTML="",r.removeChild(t)}()}(),e.ui.position});; /*! * jQuery UI Resizable 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/resizable/ */(function(e){typeof define=="function"&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)})(function(e){return e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},_create:function(){var t,n,r,i,s,o=this,u=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!u.aspectRatio,aspectRatio:u.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:u.helper||u.ghost||u.animate?u.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=u.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e();if(this.handles.constructor===String){this.handles==="all"&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={};for(n=0;n<t.length;n++)r=e.trim(t[n]),s="ui-resizable-"+r,i=e("<div class='ui-resizable-handle "+s+"'></div>"),i.css({zIndex:u.zIndex}),"se"===r&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[r]=".ui-resizable-"+r,this.element.append(i)}this._renderAxis=function(t){var n,r,i,s;t=t||this.element;for(n in this.handles){if(this.handles[n].constructor===String)this.handles[n]=this.element.children(this.handles[n]).first().show();else if(this.handles[n].jquery||this.handles[n].nodeType)this.handles[n]=e(this.handles[n]),this._on(this.handles[n],{mousedown:o._mouseDown});this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(r=e(this.handles[n],this.element),s=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth(),i=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[n])}},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=i&&i[1]?i[1]:"se")}),u.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(u.disabled)return;e(this).removeClass("ui-resizable-autohide"),o._handles.show()}).mouseleave(function(){if(u.disabled)return;o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,n=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(n(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),n(this.originalElement),this},_mouseCapture:function(t){var n,r,i=!1;for(n in this.handles){r=e(this.handles[n])[0];if(r===t.target||e.contains(r,t.target))i=!0}return!this.options.disabled&&i},_mouseStart:function(t){var n,r,i,s=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),n=this._num(this.helper.css("left")),r=this._num(this.helper.css("top")),s.containment&&(n+=e(s.containment).scrollLeft()||0,r+=e(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:r},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:n,top:r},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof s.aspectRatio=="number"?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,i=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor",i==="auto"?this.axis+"-resize":i),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var n,r,i=this.originalMousePosition,s=this.axis,o=t.pageX-i.left||0,u=t.pageY-i.top||0,a=this._change[s];this._updatePrevProperties();if(!a)return!1;n=a.apply(this,[t,o,u]),this._updateVirtualBoundaries(t.shiftKey);if(this._aspectRatio||t.shiftKey)n=this._updateRatio(n,t);return n=this._respectSize(n,t),this._updateCache(n),this._propagate("resize",t),r=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(r)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1},_mouseStop:function(t){this.resizing=!1;var n,r,i,s,o,u,a,f=this.options,l=this;return this._helper&&(n=this._proportionallyResizeElements,r=n.length&&/textarea/i.test(n[0].nodeName),i=r&&this._hasScroll(n[0],"left")?0:l.sizeDiff.height,s=r?0:l.sizeDiff.width,o={width:l.helper.width()-s,height:l.helper.height()-i},u=parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left)||null,a=parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top)||null,f.animate||this.element.css(e.extend(o,{top:a,left:u})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!f.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,n,r,i,s,o=this.options;s={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:Infinity};if(this._aspectRatio||e)t=s.minHeight*this.aspectRatio,r=s.minWidth/this.aspectRatio,n=s.maxHeight*this.aspectRatio,i=s.maxWidth/this.aspectRatio,t>s.minWidth&&(s.minWidth=t),r>s.minHeight&&(s.minHeight=r),n<s.maxWidth&&(s.maxWidth=n),i<s.maxHeight&&(s.maxHeight=i);this._vBoundaries=s},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,n=this.size,r=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),r==="sw"&&(e.left=t.left+(n.width-e.width),e.top=null),r==="nw"&&(e.top=t.top+(n.height-e.height),e.left=t.left+(n.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,n=this.axis,r=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,i=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,s=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,u=this.originalPosition.left+this.originalSize.width,a=this.position.top+this.size.height,f=/sw|nw|w/.test(n),l=/nw|ne|n/.test(n);return s&&(e.width=t.minWidth),o&&(e.height=t.minHeight),r&&(e.width=t.maxWidth),i&&(e.height=t.maxHeight),s&&f&&(e.left=u-t.minWidth),r&&f&&(e.left=u-t.maxWidth),o&&l&&(e.top=a-t.minHeight),i&&l&&(e.top=a-t.maxHeight),!e.width&&!e.height&&!e.left&&e.top?e.top=null:!e.width&&!e.height&&!e.top&&e.left&&(e.left=null),e},_getPaddingPlusBorderDimensions:function(e){var t=0,n=[],r=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],i=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];for(;t<4;t++)n[t]=parseInt(r[t],10)||0,n[t]+=parseInt(i[t],10)||0;return{height:n[0]+n[2],width:n[1]+n[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length)return;var e,t=0,n=this.helper||this.element;for(;t<this._proportionallyResizeElements.length;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:n.height()-this.outerDimensions.height||0,width:n.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var n=this.originalSize,r=this.originalPosition;return{left:r.left+t,width:n.width-t}},n:function(e,t,n){var r=this.originalSize,i=this.originalPosition;return{top:i.top+n,height:r.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!=="resize"&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var n=e(this).resizable("instance"),r=n.options,i=n._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&n._hasScroll(i[0],"left")?0:n.sizeDiff.height,u=s?0:n.sizeDiff.width,a={width:n.size.width-u,height:n.size.height-o},f=parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left)||null,l=parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top)||null;n.element.animate(e.extend(a,l&&f?{top:l,left:f}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var r={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};i&&i.length&&e(i[0]).css({width:r.width,height:r.height}),n._updateCache(r),n._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,n,r,i,s,o,u,a=e(this).resizable("instance"),f=a.options,l=a.element,c=f.containment,h=c instanceof e?c.get(0):/parent/.test(c)?l.parent().get(0):c;if(!h)return;a.containerElement=e(h),/document/.test(c)||c===document?(a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(h),n=[],e(["Top","Right","Left","Bottom"]).each(function(e,r){n[e]=a._num(t.css("padding"+r))}),a.containerOffset=t.offset(),a.containerPosition=t.position(),a.containerSize={height:t.innerHeight()-n[3],width:t.innerWidth()-n[1]},r=a.containerOffset,i=a.containerSize.height,s=a.containerSize.width,o=a._hasScroll(h,"left")?h.scrollWidth:s,u=a._hasScroll(h)?h.scrollHeight:i,a.parentData={element:h,left:r.left,top:r.top,width:o,height:u})},resize:function(t){var n,r,i,s,o=e(this).resizable("instance"),u=o.options,a=o.containerOffset,f=o.position,l=o._aspectRatio||t.shiftKey,c={top:0,left:0},h=o.containerElement,p=!0;h[0]!==document&&/static/.test(h.css("position"))&&(c=a),f.left<(o._helper?a.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-a.left:o.position.left-c.left),l&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=u.helper?a.left:0),f.top<(o._helper?a.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-a.top:o.position.top),l&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?a.top:0),i=o.containerElement.get(0)===o.element.parent().get(0),s=/relative|absolute/.test(o.containerElement.css("position")),i&&s?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),n=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-c.left:o.offset.left-a.left)),r=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-c.top:o.offset.top-a.top)),n+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-n,l&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),r+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-r,l&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),n=t.options,r=t.containerOffset,i=t.containerPosition,s=t.containerElement,o=e(t.helper),u=o.offset(),a=o.outerWidth()-t.sizeDiff.width,f=o.outerHeight()-t.sizeDiff.height;t._helper&&!n.animate&&/relative/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f}),t._helper&&!n.animate&&/static/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),n=t.options;e(n.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,n){var r=e(this).resizable("instance"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0};e(i.alsoResize).each(function(){var t=e(this),r=e(this).data("ui-resizable-alsoresize"),i={},s=t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(s,function(e,t){var n=(r[t]||0)+(u[t]||0);n&&n>=0&&(i[t]=n||null)}),t.css(i)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),n=t.options,r=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:r.height,width:r.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof n.ghost=="string"?n.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,n=e(this).resizable("instance"),r=n.options,i=n.size,s=n.originalSize,o=n.originalPosition,u=n.axis,a=typeof r.grid=="number"?[r.grid,r.grid]:r.grid,f=a[0]||1,l=a[1]||1,c=Math.round((i.width-s.width)/f)*f,h=Math.round((i.height-s.height)/l)*l,p=s.width+c,d=s.height+h,v=r.maxWidth&&r.maxWidth<p,m=r.maxHeight&&r.maxHeight<d,g=r.minWidth&&r.minWidth>p,y=r.minHeight&&r.minHeight>d;r.grid=a,g&&(p+=f),y&&(d+=l),v&&(p-=f),m&&(d-=l);if(/^(se|s|e)$/.test(u))n.size.width=p,n.size.height=d;else if(/^(ne)$/.test(u))n.size.width=p,n.size.height=d,n.position.top=o.top-h;else if(/^(sw)$/.test(u))n.size.width=p,n.size.height=d,n.position.left=o.left-c;else{if(d-l<=0||p-f<=0)t=n._getPaddingPlusBorderDimensions(this);d-l>0?(n.size.height=d,n.position.top=o.top-h):(d=l-t.height,n.size.height=d,n.position.top=o.top+s.height-d),p-f>0?(n.size.width=p,n.position.left=o.left-c):(p=f-t.width,n.size.width=p,n.position.left=o.left+s.width-p)}}}),e.ui.resizable});; /*! * jQuery UI Dialog 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/dialog/ */(function(e){typeof define=="function"&&define.amd?define(["jquery","./core","./widget","./button","./draggable","./mouse","./position","./resizable"],e):e(jQuery)})(function(e){return e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var n,r=this;if(!this._isOpen||this._trigger("beforeClose",t)===!1)return;this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance();if(!this.opener.filter(":focusable").focus().length)try{n=this.document[0].activeElement,n&&n.nodeName.toLowerCase()!=="body"&&e(n).blur()}catch(i){}this._hide(this.uiDialog,this.options.hide,function(){r._trigger("close",t)})},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,n){var r=!1,i=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),s=Math.max.apply(null,i);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),r=!0),r&&!n&&this._trigger("focus",t),r},open:function(){var t=this;if(this._isOpen){this._moveToTop()&&this._focusTabbable();return}this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open")},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function n(){var t=this.document[0].activeElement,n=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);n||this._focusTabbable()}t.preventDefault(),n.call(this),this._delay(n)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE){t.preventDefault(),this.close(t);return}if(t.keyCode!==e.ui.keyCode.TAB||t.isDefaultPrevented())return;var n=this.uiDialog.find(":tabbable"),r=n.filter(":first"),i=n.filter(":last");t.target!==i[0]&&t.target!==this.uiDialog[0]||!!t.shiftKey?(t.target===r[0]||t.target===this.uiDialog[0])&&t.shiftKey&&(this._delay(function(){i.focus()}),t.preventDefault()):(this._delay(function(){r.focus()}),t.preventDefault())},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,n=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty();if(e.isEmptyObject(n)||e.isArray(n)&&!n.length){this.uiDialog.removeClass("ui-dialog-buttons");return}e.each(n,function(n,r){var i,s;r=e.isFunction(r)?{click:r,text:n}:r,r=e.extend({type:"button"},r),i=r.click,r.click=function(){i.apply(t.element[0],arguments)},s={icons:r.icons,text:r.showText},delete r.icons,delete r.showText,e("<button></button>",r).button(s).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._blockFrames(),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){var o=s.offset.left-t.document.scrollLeft(),u=s.offset.top-t.document.scrollTop();n.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(u>=0?"+":"")+u,of:t.window},e(this).removeClass("ui-dialog-dragging"),t._unblockFrames(),t._trigger("dragStop",i,r(s))}})},_makeResizable:function(){function o(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var t=this,n=this.options,r=n.resizable,i=this.uiDialog.css("position"),s=typeof r=="string"?r:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:s,start:function(n,r){e(this).addClass("ui-dialog-resizing"),t._blockFrames(),t._trigger("resizeStart",n,o(r))},resize:function(e,n){t._trigger("resize",e,o(n))},stop:function(r,i){var s=t.uiDialog.offset(),u=s.left-t.document.scrollLeft(),a=s.top-t.document.scrollTop();n.height=t.uiDialog.height(),n.width=t.uiDialog.width(),n.position={my:"left top",at:"left"+(u>=0?"+":"")+u+" "+"top"+(a>=0?"+":"")+a,of:t.window},e(this).removeClass("ui-dialog-resizing"),t._unblockFrames(),t._trigger("resizeStop",r,o(i))}}).css("position",i)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),n=e.inArray(this,t);n!==-1&&t.splice(n,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var n=this,r=!1,i={};e.each(t,function(e,t){n._setOption(e,t),e in n.sizeRelatedOptions&&(r=!0),e in n.resizableRelatedOptions&&(i[e]=t)}),r&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",i)},_setOption:function(e,t){var n,r,i=this.uiDialog;e==="dialogClass"&&i.removeClass(this.options.dialogClass).addClass(t);if(e==="disabled")return;this._super(e,t),e==="appendTo"&&this.uiDialog.appendTo(this._appendTo()),e==="buttons"&&this._createButtons(),e==="closeText"&&this.uiDialogTitlebarClose.button({label:""+t}),e==="draggable"&&(n=i.is(":data(ui-draggable)"),n&&!t&&i.draggable("destroy"),!n&&t&&this._makeDraggable()),e==="position"&&this._position(),e==="resizable"&&(r=i.is(":data(ui-resizable)"),r&&!t&&i.resizable("destroy"),r&&typeof t=="string"&&i.resizable("option","handles",t),!r&&t!==!1&&this._makeResizable()),e==="title"&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))},_size:function(){var e,t,n,r=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),t=Math.max(0,r.minHeight-e),n=typeof r.maxHeight=="number"?Math.max(0,r.maxHeight-e):"none",r.height==="auto"?this.element.css({minHeight:t,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,r.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(!this.options.modal)return;var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){if(t)return;this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)},_destroyOverlay:function(){if(!this.options.modal)return;if(this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}})});; /** * @file * Dialog API inspired by HTML5 dialog element. * * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#the-dialog-element */ (function ($, Drupal, drupalSettings) { 'use strict'; /** * Default dialog options. * * @type {object} * * @prop {bool} [autoOpen=true] * @prop {string} [dialogClass=''] * @prop {string} [buttonClass='button'] * @prop {string} [buttonPrimaryClass='button--primary'] * @prop {function} close */ drupalSettings.dialog = { autoOpen: true, dialogClass: '', // Drupal-specific extensions: see dialog.jquery-ui.js. buttonClass: 'button', buttonPrimaryClass: 'button--primary', // When using this API directly (when generating dialogs on the client // side), you may want to override this method and do // `jQuery(event.target).remove()` as well, to remove the dialog on // closing. close: function (event) { Drupal.dialog(event.target).close(); Drupal.detachBehaviors(event.target, null, 'unload'); } }; /** * @typedef {object} Drupal.dialog~dialogDefinition * * @prop {boolean} open * Is the dialog open or not. * @prop {*} returnValue * Return value of the dialog. * @prop {function} show * Method to display the dialog on the page. * @prop {function} showModal * Method to display the dialog as a modal on the page. * @prop {function} close * Method to hide the dialog from the page. */ /** * Polyfill HTML5 dialog element with jQueryUI. * * @param {HTMLElement} element * The element that holds the dialog. * @param {object} options * jQuery UI options to be passed to the dialog. * * @return {Drupal.dialog~dialogDefinition} * The dialog instance. */ Drupal.dialog = function (element, options) { var undef; var $element = $(element); var dialog = { open: false, returnValue: undef, show: function () { openDialog({modal: false}); }, showModal: function () { openDialog({modal: true}); }, close: closeDialog }; function openDialog(settings) { settings = $.extend({}, drupalSettings.dialog, options, settings); // Trigger a global event to allow scripts to bind events to the dialog. $(window).trigger('dialog:beforecreate', [dialog, $element, settings]); $element.dialog(settings); dialog.open = true; $(window).trigger('dialog:aftercreate', [dialog, $element, settings]); } function closeDialog(value) { $(window).trigger('dialog:beforeclose', [dialog, $element]); $element.dialog('close'); dialog.returnValue = value; dialog.open = false; $(window).trigger('dialog:afterclose', [dialog, $element]); } return dialog; }; })(jQuery, Drupal, drupalSettings); ; /** * @file * Positioning extensions for dialogs. */ /** * Triggers when content inside a dialog changes. * * @event dialogContentResize */ (function ($, Drupal, drupalSettings, debounce, displace) { 'use strict'; // autoResize option will turn off resizable and draggable. drupalSettings.dialog = $.extend({autoResize: true, maxHeight: '95%'}, drupalSettings.dialog); /** * Resets the current options for positioning. * * This is used as a window resize and scroll callback to reposition the * jQuery UI dialog. Although not a built-in jQuery UI option, this can * be disabled by setting autoResize: false in the options array when creating * a new {@link Drupal.dialog}. * * @function Drupal.dialog~resetSize * * @param {jQuery.Event} event * The event triggered. * * @fires event:dialogContentResize */ function resetSize(event) { var positionOptions = ['width', 'height', 'minWidth', 'minHeight', 'maxHeight', 'maxWidth', 'position']; var adjustedOptions = {}; var windowHeight = $(window).height(); var option; var optionValue; var adjustedValue; for (var n = 0; n < positionOptions.length; n++) { option = positionOptions[n]; optionValue = event.data.settings[option]; if (optionValue) { // jQuery UI does not support percentages on heights, convert to pixels. if (typeof optionValue === 'string' && /%$/.test(optionValue) && /height/i.test(option)) { // Take offsets in account. windowHeight -= displace.offsets.top + displace.offsets.bottom; adjustedValue = parseInt(0.01 * parseInt(optionValue, 10) * windowHeight, 10); // Don't force the dialog to be bigger vertically than needed. if (option === 'height' && event.data.$element.parent().outerHeight() < adjustedValue) { adjustedValue = 'auto'; } adjustedOptions[option] = adjustedValue; } } } // Offset the dialog center to be at the center of Drupal.displace.offsets. if (!event.data.settings.modal) { adjustedOptions = resetPosition(adjustedOptions); } event.data.$element .dialog('option', adjustedOptions) .trigger('dialogContentResize'); } /** * Position the dialog's center at the center of displace.offsets boundaries. * * @function Drupal.dialog~resetPosition * * @param {object} options * Options object. * * @return {object} * Altered options object. */ function resetPosition(options) { var offsets = displace.offsets; var left = offsets.left - offsets.right; var top = offsets.top - offsets.bottom; var leftString = (left > 0 ? '+' : '-') + Math.abs(Math.round(left / 2)) + 'px'; var topString = (top > 0 ? '+' : '-') + Math.abs(Math.round(top / 2)) + 'px'; options.position = { my: 'center' + (left !== 0 ? leftString : '') + ' center' + (top !== 0 ? topString : ''), of: window }; return options; } $(window).on({ 'dialog:aftercreate': function (event, dialog, $element, settings) { var autoResize = debounce(resetSize, 20); var eventData = {settings: settings, $element: $element}; if (settings.autoResize === true || settings.autoResize === 'true') { $element .dialog('option', {resizable: false, draggable: false}) .dialog('widget').css('position', 'fixed'); $(window) .on('resize.dialogResize scroll.dialogResize', eventData, autoResize) .trigger('resize.dialogResize'); $(document).on('drupalViewportOffsetChange.dialogResize', eventData, autoResize); } }, 'dialog:beforeclose': function (event, dialog, $element) { $(window).off('.dialogResize'); $(document).off('.dialogResize'); } }); })(jQuery, Drupal, drupalSettings, Drupal.debounce, Drupal.displace); ; /** * @file * Adds default classes to buttons for styling purposes. */ (function ($) { 'use strict'; $.widget('ui.dialog', $.ui.dialog, { options: { buttonClass: 'button', buttonPrimaryClass: 'button--primary' }, _createButtons: function () { var opts = this.options; var primaryIndex; var $buttons; var index; var il = opts.buttons.length; for (index = 0; index < il; index++) { if (opts.buttons[index].primary && opts.buttons[index].primary === true) { primaryIndex = index; delete opts.buttons[index].primary; break; } } this._super(); $buttons = this.uiButtonSet.children().addClass(opts.buttonClass); if (typeof primaryIndex !== 'undefined') { $buttons.eq(index).addClass(opts.buttonPrimaryClass); } } }); })(jQuery); ; /** * @file * Attaches behavior for the Editor module. */ (function ($, Drupal, drupalSettings) { 'use strict'; /** * Finds the text area field associated with the given text format selector. * * @param {jQuery} $formatSelector * A text format selector DOM element. * * @return {HTMLElement} * The text area DOM element, if it was found. */ function findFieldForFormatSelector($formatSelector) { var field_id = $formatSelector.attr('data-editor-for'); // This selector will only find text areas in the top-level document. We do // not support attaching editors on text areas within iframes. return $('#' + field_id).get(0); } /** * Changes the text editor on a text area. * * @param {HTMLElement} field * The text area DOM element. * @param {string} newFormatID * The text format we're changing to; the text editor for the currently * active text format will be detached, and the text editor for the new text * format will be attached. */ function changeTextEditor(field, newFormatID) { var previousFormatID = field.getAttribute('data-editor-active-text-format'); // Detach the current editor (if any) and attach a new editor. if (drupalSettings.editor.formats[previousFormatID]) { Drupal.editorDetach(field, drupalSettings.editor.formats[previousFormatID]); } // When no text editor is currently active, stop tracking changes. else { $(field).off('.editor'); } // Attach the new text editor (if any). if (drupalSettings.editor.formats[newFormatID]) { var format = drupalSettings.editor.formats[newFormatID]; filterXssWhenSwitching(field, format, previousFormatID, Drupal.editorAttach); } // Store the new active format. field.setAttribute('data-editor-active-text-format', newFormatID); } /** * Handles changes in text format. * * @param {jQuery.Event} event * The text format change event. */ function onTextFormatChange(event) { var $select = $(event.target); var field = event.data.field; var activeFormatID = field.getAttribute('data-editor-active-text-format'); var newFormatID = $select.val(); // Prevent double-attaching if the change event is triggered manually. if (newFormatID === activeFormatID) { return; } // When changing to a text format that has a text editor associated // with it that supports content filtering, then first ask for // confirmation, because switching text formats might cause certain // markup to be stripped away. var supportContentFiltering = drupalSettings.editor.formats[newFormatID] && drupalSettings.editor.formats[newFormatID].editorSupportsContentFiltering; // If there is no content yet, it's always safe to change the text format. var hasContent = field.value !== ''; if (hasContent && supportContentFiltering) { var message = Drupal.t('Changing the text format to %text_format will permanently remove content that is not allowed in that text format.<br><br>Save your changes before switching the text format to avoid losing data.', { '%text_format': $select.find('option:selected').text() }); var confirmationDialog = Drupal.dialog('<div>' + message + '</div>', { title: Drupal.t('Change text format?'), dialogClass: 'editor-change-text-format-modal', resizable: false, buttons: [ { text: Drupal.t('Continue'), class: 'button button--primary', click: function () { changeTextEditor(field, newFormatID); confirmationDialog.close(); } }, { text: Drupal.t('Cancel'), class: 'button', click: function () { // Restore the active format ID: cancel changing text format. We // cannot simply call event.preventDefault() because jQuery's // change event is only triggered after the change has already // been accepted. $select.val(activeFormatID); confirmationDialog.close(); } } ], // Prevent this modal from being closed without the user making a choice // as per http://stackoverflow.com/a/5438771. closeOnEscape: false, create: function () { $(this).parent().find('.ui-dialog-titlebar-close').remove(); }, beforeClose: false, close: function (event) { // Automatically destroy the DOM element that was used for the dialog. $(event.target).remove(); } }); confirmationDialog.showModal(); } else { changeTextEditor(field, newFormatID); } } /** * Initialize an empty object for editors to place their attachment code. * * @namespace */ Drupal.editors = {}; /** * Enables editors on text_format elements. * * @type {Drupal~behavior} * * @prop {Drupal~behaviorAttach} attach * Attaches an editor to an input element. * @prop {Drupal~behaviorDetach} detach * Detaches an editor from an input element. */ Drupal.behaviors.editor = { attach: function (context, settings) { // If there are no editor settings, there are no editors to enable. if (!settings.editor) { return; } $(context).find('[data-editor-for]').once('editor').each(function () { var $this = $(this); var field = findFieldForFormatSelector($this); // Opt-out if no supported text area was found. if (!field) { return; } // Store the current active format. var activeFormatID = $this.val(); field.setAttribute('data-editor-active-text-format', activeFormatID); // Directly attach this text editor, if the text format is enabled. if (settings.editor.formats[activeFormatID]) { // XSS protection for the current text format/editor is performed on // the server side, so we don't need to do anything special here. Drupal.editorAttach(field, settings.editor.formats[activeFormatID]); } // When there is no text editor for this text format, still track // changes, because the user has the ability to switch to some text // editor, otherwise this code would not be executed. $(field).on('change.editor keypress.editor', function () { field.setAttribute('data-editor-value-is-changed', 'true'); // Just knowing that the value was changed is enough, stop tracking. $(field).off('.editor'); }); // Attach onChange handler to text format selector element. if ($this.is('select')) { $this.on('change.editorAttach', {field: field}, onTextFormatChange); } // Detach any editor when the containing form is submitted. $this.parents('form').on('submit', function (event) { // Do not detach if the event was canceled. if (event.isDefaultPrevented()) { return; } // Detach the current editor (if any). if (settings.editor.formats[activeFormatID]) { Drupal.editorDetach(field, settings.editor.formats[activeFormatID], 'serialize'); } }); }); }, detach: function (context, settings, trigger) { var editors; // The 'serialize' trigger indicates that we should simply update the // underlying element with the new text, without destroying the editor. if (trigger === 'serialize') { // Removing the editor-processed class guarantees that the editor will // be reattached. Only do this if we're planning to destroy the editor. editors = $(context).find('[data-editor-for]').findOnce('editor'); } else { editors = $(context).find('[data-editor-for]').removeOnce('editor'); } editors.each(function () { var $this = $(this); var activeFormatID = $this.val(); var field = findFieldForFormatSelector($this); if (field && activeFormatID in settings.editor.formats) { Drupal.editorDetach(field, settings.editor.formats[activeFormatID], trigger); } }); } }; /** * Attaches editor behaviors to the field. * * @param {HTMLElement} field * The textarea DOM element. * @param {object} format * The text format that's being activated, from * drupalSettings.editor.formats. * * @listens event:change * * @fires event:formUpdated */ Drupal.editorAttach = function (field, format) { if (format.editor) { // Attach the text editor. Drupal.editors[format.editor].attach(field, format); // Ensures form.js' 'formUpdated' event is triggered even for changes that // happen within the text editor. Drupal.editors[format.editor].onChange(field, function () { $(field).trigger('formUpdated'); // Keep track of changes, so we know what to do when switching text // formats and guaranteeing XSS protection. field.setAttribute('data-editor-value-is-changed', 'true'); }); } }; /** * Detaches editor behaviors from the field. * * @param {HTMLElement} field * The textarea DOM element. * @param {object} format * The text format that's being activated, from * drupalSettings.editor.formats. * @param {string} trigger * Trigger value from the detach behavior. */ Drupal.editorDetach = function (field, format, trigger) { if (format.editor) { Drupal.editors[format.editor].detach(field, format, trigger); // Restore the original value if the user didn't make any changes yet. if (field.getAttribute('data-editor-value-is-changed') === 'false') { field.value = field.getAttribute('data-editor-value-original'); } } }; /** * Filter away XSS attack vectors when switching text formats. * * @param {HTMLElement} field * The textarea DOM element. * @param {object} format * The text format that's being activated, from * drupalSettings.editor.formats. * @param {string} originalFormatID * The text format ID of the original text format. * @param {function} callback * A callback to be called (with no parameters) after the field's value has * been XSS filtered. */ function filterXssWhenSwitching(field, format, originalFormatID, callback) { // A text editor that already is XSS-safe needs no additional measures. if (format.editor.isXssSafe) { callback(field, format); } // Otherwise, ensure XSS safety: let the server XSS filter this value. else { $.ajax({ url: Drupal.url('editor/filter_xss/' + format.format), type: 'POST', data: { value: field.value, original_format_id: originalFormatID }, dataType: 'json', success: function (xssFilteredValue) { // If the server returns false, then no XSS filtering is needed. if (xssFilteredValue !== false) { field.value = xssFilteredValue; } callback(field, format); } }); } } })(jQuery, Drupal, drupalSettings); ;
storybook/config.js
librize/mastodon
import { configure, setAddon } from '@kadira/storybook'; import IntlAddon from 'react-storybook-addon-intl'; import React from 'react'; import { storiesOf, action } from '@kadira/storybook'; import { addLocaleData } from 'react-intl'; import en from 'react-intl/locale-data/en'; import '../app/assets/stylesheets/components.scss' import './storybook.scss' setAddon(IntlAddon); addLocaleData(en); window.storiesOf = storiesOf; window.action = action; window.React = React; let req = require.context('./stories/', true, /.story.jsx$/); function loadStories () { req.keys().forEach((filename) => req(filename)) } configure(loadStories, module);
src/components/BookCardPage/BookCardPage.js
chengjianhua/book-share
/** * Created by cjh95414 on 2016/5/5. */ import React, { Component } from 'react'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import RaisedButton from 'material-ui/RaisedButton'; import { Link } from 'react-router'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; // import {List, Map} from 'immutable'; import { fetchBookList } from '../../actions/Book'; import BriefShareCard from './BriefShareCard'; import s from './BookCardPage.scss'; class BookCardPage extends Component { componentWillMount() { const { bookList } = this.props; if (bookList.size === 0) { this.loadBooksByPage(1); } } handleLoadMore = () => { const { page } = this.props; this.loadBooksByPage(page); }; loadBooksByPage(page) { const { actions } = this.props; actions.fetchBookList(page); } render() { const { bookList } = this.props; const bookCards = bookList.map((book, index) => { const bookName = book.get('bookTitle'); const bookImg = book.getIn(['detail', 'images', 'large']); const title = book.get('shareTitle'); const content = book.get('shareContent'); const commentsCount = book.get('commentsCount'); return ( <Link key={index} to={{ pathname: `/share/book/${book.get('_id')}`, }} > <BriefShareCard key={index} id={book.get('_id')} img={bookImg} title={title} content={content} username={'chengjianhua'} bookName={bookName} commentsCount={commentsCount} /> </Link> ); }); return ( <div className={s.root}> {bookCards} <div className={s.loadButton}> <RaisedButton label="点击加载更多" onTouchTap={this.handleLoadMore} primary fullWidth style={{ marginTop: '1rem', width: '100%' }} /> </div> </div> ); } } function mapStateToProps(state) { return { bookList: state.book.getIn(['bookList', 'data']), page: state.book.getIn(['bookList', 'page']), }; } function mapDispatchToProps(dispatch) { return { actions: bindActionCreators(Object.assign({}, { fetchBookList }), dispatch), }; } export default connect(mapStateToProps, mapDispatchToProps)(withStyles(s)(BookCardPage));
src/routes.js
8881/react-starter
import React from 'react'; import { Route, Switch } from 'react-router-dom'; import DefaultPage from './containers/default/index'; import Test from './containers/test/index'; import Foo from './containers/foo/index'; const Routes = () => ( <Switch> <Route exact path="/" component={DefaultPage}></Route> <Route exact path="/test" component={Test}></Route> <Route exact path="/foo" component={Foo}></Route> </Switch> ); export default Routes;
L/my-app/src/stories/index.js
imuntil/React
import React from 'react' import { storiesOf } from '@storybook/react' import { action } from '@storybook/addon-actions' import { linkTo } from '@storybook/addon-links' import { Welcome } from '@storybook/react/demo' import Button from '../components/Button' import SearchBar from '../components/SearchBar' storiesOf('Welcome', module).add('to Storybook', () => ( <Welcome showApp={linkTo('Button')} /> )) // storiesOf('Button', module) // .add('with text', () => ( // <Button onClick={action('clicked')}>Hello Button</Button> // )) // .add('with some emoji', () => ( // <Button onClick={action('clicked')}> // <span role="img" aria-label="so cool"> // 😀 😎 👍 💯 // </span> // </Button> // )) storiesOf('Button', module).add('with text', () => <Button text={'lala'} />) storiesOf('SearchBar', module).add('default', () => ( <SearchBar typeOptions={['动画', '季度全集', 'RAW']} subOptions={['动漫国字幕组', '诸神Kamigami字幕组', '悠哈C9字幕社']} onChange={(type, v) => { console.log(type, v) }} onSearch={() => console.log('search')} onFilter={() => console.log('filter')} /> ))
ajax/libs/ember-data.js/1.0.0-beta.1/ember-data.js
aaqibrasheed/cdnjs
// Version: v1.0.0-beta.1 // Last commit: cafab9d (2013-09-01 00:42:39 -0700) (function() { var define, requireModule; (function() { var registry = {}, seen = {}; define = function(name, deps, callback) { registry[name] = { deps: deps, callback: callback }; }; requireModule = function(name) { if (seen[name]) { return seen[name]; } seen[name] = {}; var mod, deps, callback, reified , exports; mod = registry[name]; if (!mod) { throw new Error("Module '" + name + "' not found."); } deps = mod.deps; callback = mod.callback; reified = []; exports; for (var i=0, l=deps.length; i<l; i++) { if (deps[i] === 'exports') { reified.push(exports = {}); } else { reified.push(requireModule(deps[i])); } } var value = callback.apply(this, reified); return seen[name] = exports || value; }; })(); (function() { /** @module ember-data */ /** All Ember Data methods and functions are defined inside of this namespace. @class DS @static */ if ('undefined' === typeof DS) { DS = Ember.Namespace.create({ VERSION: '1.0.0-beta.1' }); if ('undefined' !== typeof window) { window.DS = DS; } } })(); (function() { /** @module ember-data */ var isNone = Ember.isNone, isEmpty = Ember.isEmpty; /** DS.JSONTransforms is a hash of transforms used by DS.Serializer. @class JSONTransforms @static @namespace DS */ DS.JSONTransforms = { string: { deserialize: function(serialized) { return isNone(serialized) ? null : String(serialized); }, serialize: function(deserialized) { return isNone(deserialized) ? null : String(deserialized); } }, number: { deserialize: function(serialized) { return isEmpty(serialized) ? null : Number(serialized); }, serialize: function(deserialized) { return isEmpty(deserialized) ? null : Number(deserialized); } }, // Handles the following boolean inputs: // "TrUe", "t", "f", "FALSE", 0, (non-zero), or boolean true/false 'boolean': { deserialize: function(serialized) { var type = typeof serialized; if (type === "boolean") { return serialized; } else if (type === "string") { return serialized.match(/^true$|^t$|^1$/i) !== null; } else if (type === "number") { return serialized === 1; } else { return false; } }, serialize: function(deserialized) { return Boolean(deserialized); } }, date: { deserialize: function(serialized) { var type = typeof serialized; if (type === "string") { return new Date(Ember.Date.parse(serialized)); } else if (type === "number") { return new Date(serialized); } else if (serialized === null || serialized === undefined) { // if the value is not present in the data, // return undefined, not null. return serialized; } else { return null; } }, serialize: function(date) { if (date instanceof Date) { var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; var pad = function(num) { return num < 10 ? "0"+num : ""+num; }; var utcYear = date.getUTCFullYear(), utcMonth = date.getUTCMonth(), utcDayOfMonth = date.getUTCDate(), utcDay = date.getUTCDay(), utcHours = date.getUTCHours(), utcMinutes = date.getUTCMinutes(), utcSeconds = date.getUTCSeconds(); var dayOfWeek = days[utcDay]; var dayOfMonth = pad(utcDayOfMonth); var month = months[utcMonth]; return dayOfWeek + ", " + dayOfMonth + " " + month + " " + utcYear + " " + pad(utcHours) + ":" + pad(utcMinutes) + ":" + pad(utcSeconds) + " GMT"; } else { return null; } } } }; })(); (function() { var get = Ember.get, set = Ember.set, isNone = Ember.isNone; var transforms = DS.JSONTransforms; // Simple dispatcher to support overriding the aliased // method in subclasses. function aliasMethod(methodName) { return function() { return this[methodName].apply(this, arguments); }; } DS.JSONSerializer = Ember.Object.extend({ primaryKey: 'id', deserialize: function(type, data) { var store = get(this, 'store'); type.eachTransformedAttribute(function(key, type) { data[key] = transforms[type].deserialize(data[key]); }); type.eachRelationship(function(key, relationship) { // A link (usually a URL) was already provided in // normalized form if (data.links && data.links[key]) { return; } var type = relationship.type, value = data[key]; if (value == null) { return; } if (relationship.kind === 'belongsTo') { this.deserializeRecordId(data, key, relationship, value); } else if (relationship.kind === 'hasMany') { this.deserializeRecordIds(data, key, relationship, value); } }, this); return data; }, deserializeRecordId: function(data, key, relationship, id) { if (isNone(id) || id instanceof DS.Model) { return; } var type; if (typeof id === 'number' || typeof id === 'string') { type = this.typeFor(relationship, key, data); data[key] = get(this, 'store').recordForId(type, id); } else if (typeof id === 'object') { // polymorphic data[key] = get(this, 'store').recordForId(id.type, id.id); } }, deserializeRecordIds: function(data, key, relationship, ids) { for (var i=0, l=ids.length; i<l; i++) { this.deserializeRecordId(ids, i, relationship, ids[i]); } }, // SERIALIZE serialize: function(record, options) { var store = get(this, 'store'); var json = {}; if (options && options.includeId) { var id = get(record, 'id'); if (id) { json[get(this, 'primaryKey')] = get(record, 'id'); } } var attrs = get(this, 'attrs'); record.eachAttribute(function(key, attribute) { var value = get(record, key), type = attribute.type; if (type) { value = transforms[type].serialize(value); } // if provided, use the mapping provided by `attrs` in // the serializer key = attrs && attrs[key] || key; json[key] = value; }, this); record.eachRelationship(function(key, relationship) { if (relationship.kind === 'belongsTo') { this.serializeBelongsTo(record, json, relationship); } else if (relationship.kind === 'hasMany') { this.serializeHasMany(record, json, relationship); } }, this); return json; }, serializeBelongsTo: function(record, json, relationship) { var key = relationship.key; var belongsTo = get(record, key); if (isNone(belongsTo)) { return; } json[key] = get(belongsTo, 'id'); if (relationship.options.polymorphic) { json[key + "_type"] = belongsTo.constructor.typeKey; } }, serializeHasMany: Ember.K, // EXTRACT extract: function(store, type, payload, id, requestType) { var specificExtract = "extract" + requestType.charAt(0).toUpperCase() + requestType.substr(1); return this[specificExtract](store, type, payload, id, requestType); }, extractFindAll: aliasMethod('extractArray'), extractFindQuery: aliasMethod('extractArray'), extractFindMany: aliasMethod('extractArray'), extractFindHasMany: aliasMethod('extractArray'), extractCreateRecord: aliasMethod('extractSave'), extractUpdateRecord: aliasMethod('extractSave'), extractDeleteRecord: aliasMethod('extractSave'), extractFind: aliasMethod('extractSingle'), extractSave: aliasMethod('extractSingle'), extractSingle: function(store, type, payload) { return payload; }, extractArray: function(store, type, payload) { return payload; }, // HELPERS typeFor: function(relationship, key, data) { if (relationship.options.polymorphic) { return data[key + "_type"]; } else { return relationship.type; } }, eachEmbeddedRecord: function() { // this is used by transaction.add } }); })(); (function() { /** @module ember-data */ var get = Ember.get, capitalize = Ember.String.capitalize, underscore = Ember.String.underscore, DS = window.DS ; /** Extend `Ember.DataAdapter` with ED specific code. */ DS.DebugAdapter = Ember.DataAdapter.extend({ getFilters: function() { return [ { name: 'isNew', desc: 'New' }, { name: 'isModified', desc: 'Modified' }, { name: 'isClean', desc: 'Clean' } ]; }, detect: function(klass) { return klass !== DS.Model && DS.Model.detect(klass); }, columnsForType: function(type) { var columns = [{ name: 'id', desc: 'Id' }], count = 0, self = this; Ember.A(get(type, 'attributes')).forEach(function(name, meta) { if (count++ > self.attributeLimit) { return false; } var desc = capitalize(underscore(name).replace('_', ' ')); columns.push({ name: name, desc: desc }); }); return columns; }, getRecords: function(type) { return this.get('store').all(type); }, getRecordColumnValues: function(record) { var self = this, count = 0, columnValues = { id: get(record, 'id') }; record.eachAttribute(function(key) { if (count++ > self.attributeLimit) { return false; } var value = get(record, key); columnValues[key] = value; }); return columnValues; }, getRecordKeywords: function(record) { var keywords = [], keys = Ember.A(['id']); record.eachAttribute(function(key) { keys.push(key); }); keys.forEach(function(key) { keywords.push(get(record, key)); }); return keywords; }, getRecordFilterValues: function(record) { return { isNew: record.get('isNew'), isModified: record.get('isDirty') && !record.get('isNew'), isClean: !record.get('isDirty') }; }, getRecordColor: function(record) { var color = 'black'; if (record.get('isNew')) { color = 'green'; } else if (record.get('isDirty')) { color = 'blue'; } return color; }, observeRecord: function(record, recordUpdated) { var releaseMethods = Ember.A(), self = this, keysToObserve = Ember.A(['id', 'isNew', 'isDirty']); record.eachAttribute(function(key) { keysToObserve.push(key); }); keysToObserve.forEach(function(key) { var handler = function() { recordUpdated(self.wrapRecord(record)); }; Ember.addObserver(record, key, handler); releaseMethods.push(function() { Ember.removeObserver(record, key, handler); }); }); var release = function() { releaseMethods.forEach(function(fn) { fn(); } ); }; return release; } }); })(); (function() { /** @module ember-data */ var set = Ember.set; /* This code registers an injection for Ember.Application. If an Ember.js developer defines a subclass of DS.Store on their application, this code will automatically instantiate it and make it available on the router. Additionally, after an application's controllers have been injected, they will each have the store made available to them. For example, imagine an Ember.js application with the following classes: App.Store = DS.Store.extend({ adapter: 'App.MyCustomAdapter' }); App.PostsController = Ember.ArrayController.extend({ // ... }); When the application is initialized, `App.Store` will automatically be instantiated, and the instance of `App.PostsController` will have its `store` property set to that instance. Note that this code will only be run if the `ember-application` package is loaded. If Ember Data is being used in an environment other than a typical application (e.g., node.js where only `ember-runtime` is available), this code will be ignored. */ Ember.onLoad('Ember.Application', function(Application) { Application.initializer({ name: "store", initialize: function(container, application) { application.register('store:main', application.Store || DS.Store); application.register('serializer:_default', DS.JSONSerializer); application.register('serializer:_rest', DS.RESTSerializer); application.register('adapter:_rest', DS.RESTAdapter); // Eagerly generate the store so defaultStore is populated. // TODO: Do this in a finisher hook container.lookup('store:main'); } }); // Keep ED compatible with previous versions of ember // TODO: Remove the if statement for Ember 1.0 if (DS.DebugAdapter) { Application.initializer({ name: "dataAdapter", initialize: function(container, application) { application.register('dataAdapter:main', DS.DebugAdapter); } }); } Application.initializer({ name: "dataAdapter", initialize: function(container, application) { application.register('dataAdapter:main', DS.DebugAdapter); } }); Application.initializer({ name: "injectStore", initialize: function(container, application) { application.inject('controller', 'store', 'store:main'); application.inject('route', 'store', 'store:main'); application.inject('serializer', 'store', 'store:main'); application.inject('dataAdapter', 'store', 'store:main'); } }); }); })(); (function() { /** @module ember-data */ /** Date.parse with progressive enhancement for ISO 8601 <https://github.com/csnover/js-iso8601> © 2011 Colin Snover <http://zetafleet.com> Released under MIT license. @class Date @namespace Ember @static */ Ember.Date = Ember.Date || {}; var origParse = Date.parse, numericKeys = [ 1, 4, 5, 6, 7, 10, 11 ]; /** @method parse @param date */ Ember.Date.parse = function (date) { var timestamp, struct, minutesOffset = 0; // ES5 §15.9.4.2 states that the string should attempt to be parsed as a Date Time String Format string // before falling back to any implementation-specific date parsing, so that’s what we do, even if native // implementations could be faster // 1 YYYY 2 MM 3 DD 4 HH 5 mm 6 ss 7 msec 8 Z 9 ± 10 tzHH 11 tzmm if ((struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(date))) { // avoid NaN timestamps caused by “undefined” values being passed to Date.UTC for (var i = 0, k; (k = numericKeys[i]); ++i) { struct[k] = +struct[k] || 0; } // allow undefined days and months struct[2] = (+struct[2] || 1) - 1; struct[3] = +struct[3] || 1; if (struct[8] !== 'Z' && struct[9] !== undefined) { minutesOffset = struct[10] * 60 + struct[11]; if (struct[9] === '+') { minutesOffset = 0 - minutesOffset; } } timestamp = Date.UTC(struct[1], struct[2], struct[3], struct[4], struct[5] + minutesOffset, struct[6], struct[7]); } else { timestamp = origParse ? origParse(date) : NaN; } return timestamp; }; if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Date) { Date.parse = Ember.Date.parse; } })(); (function() { })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set; /** A record array is an array that contains records of a certain type. The record array materializes records as needed when they are retrieved for the first time. You should not create record arrays yourself. Instead, an instance of DS.RecordArray or its subclasses will be returned by your application's store in response to queries. @class RecordArray @namespace DS @extends Ember.ArrayProxy @uses Ember.Evented */ DS.RecordArray = Ember.ArrayProxy.extend(Ember.Evented, { /** The model type contained by this record array. @property type @type DS.Model */ type: null, // The array of client ids backing the record array. When a // record is requested from the record array, the record // for the client id at the same index is materialized, if // necessary, by the store. content: null, isLoaded: false, isUpdating: false, // The store that created this record array. store: null, objectAtContent: function(index) { var content = get(this, 'content'); return content.objectAt(index); }, update: function() { if (get(this, 'isUpdating')) { return; } var store = get(this, 'store'), type = get(this, 'type'); store.fetchAll(type, this); }, addRecord: function(record) { get(this, 'content').addObject(record); }, removeRecord: function(record) { get(this, 'content').removeObject(record); } }); })(); (function() { /** @module ember-data */ var get = Ember.get; /** @class FilteredRecordArray @namespace DS @extends DS.RecordArray */ DS.FilteredRecordArray = DS.RecordArray.extend({ filterFunction: null, isLoaded: true, replace: function() { var type = get(this, 'type').toString(); throw new Error("The result of a client-side filter (on " + type + ") is immutable."); }, updateFilter: Ember.observer(function() { var manager = get(this, 'manager'); manager.updateFilter(this, get(this, 'type'), get(this, 'filterFunction')); }, 'filterFunction') }); })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set; /** @class AdapterPopulatedRecordArray @namespace DS @extends DS.RecordArray */ DS.AdapterPopulatedRecordArray = DS.RecordArray.extend({ query: null, replace: function() { var type = get(this, 'type').toString(); throw new Error("The result of a server query (on " + type + ") is immutable."); }, load: function(data) { var store = get(this, 'store'), type = get(this, 'type'), records = store.pushMany(type, data); this.setProperties({ content: Ember.A(records), isLoaded: true }); // TODO: does triggering didLoad event should be the last action of the runLoop? Ember.run.once(this, 'trigger', 'didLoad'); } }); })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set; var map = Ember.EnumerableUtils.map; /** A ManyArray is a RecordArray that represents the contents of a has-many relationship. The ManyArray is instantiated lazily the first time the relationship is requested. ### Inverses Often, the relationships in Ember Data applications will have an inverse. For example, imagine the following models are defined: App.Post = DS.Model.extend({ comments: DS.hasMany('App.Comment') }); App.Comment = DS.Model.extend({ post: DS.belongsTo('App.Post') }); If you created a new instance of `App.Post` and added a `App.Comment` record to its `comments` has-many relationship, you would expect the comment's `post` property to be set to the post that contained the has-many. We call the record to which a relationship belongs the relationship's _owner_. @class ManyArray @namespace DS @extends DS.RecordArray */ DS.ManyArray = DS.RecordArray.extend({ init: function() { this._super.apply(this, arguments); this._changesToSync = Ember.OrderedSet.create(); }, /** The record to which this relationship belongs. @property {DS.Model} @private */ owner: null, /** `true` if the relationship is polymorphic, `false` otherwise. @property {Boolean} @private */ isPolymorphic: false, // LOADING STATE isLoaded: false, loadingRecordsCount: function(count) { this.loadingRecordsCount = count; }, loadedRecord: function() { this.loadingRecordsCount--; if (this.loadingRecordsCount === 0) { set(this, 'isLoaded', true); this.trigger('didLoad'); } }, fetch: function() { var records = get(this, 'content'), store = get(this, 'store'), owner = get(this, 'owner'); var unloadedRecords = records.filterProperty('isEmpty', true); store.fetchMany(unloadedRecords, owner); }, // Overrides Ember.Array's replace method to implement replaceContent: function(index, removed, added) { // Map the array of record objects into an array of client ids. added = map(added, function(record) { Ember.assert("You cannot add '" + record.constructor.typeKey + "' records to this relationship (only '" + this.type.typeKey + "' allowed)", !this.type || record instanceof this.type); return record; }, this); this._super(index, removed, added); }, arrangedContentDidChange: function() { this.fetch(); }, arrayContentWillChange: function(index, removed, added) { var owner = get(this, 'owner'), name = get(this, 'name'); if (!owner._suspendedRelationships) { // This code is the first half of code that continues inside // of arrayContentDidChange. It gets or creates a change from // the child object, adds the current owner as the old // parent if this is the first time the object was removed // from a ManyArray, and sets `newParent` to null. // // Later, if the object is added to another ManyArray, // the `arrayContentDidChange` will set `newParent` on // the change. for (var i=index; i<index+removed; i++) { var record = get(this, 'content').objectAt(i); var change = DS.RelationshipChange.createChange(owner, record, get(this, 'store'), { parentType: owner.constructor, changeType: "remove", kind: "hasMany", key: name }); this._changesToSync.add(change); } } return this._super.apply(this, arguments); }, arrayContentDidChange: function(index, removed, added) { this._super.apply(this, arguments); var owner = get(this, 'owner'), name = get(this, 'name'), store = get(this, 'store'); if (!owner._suspendedRelationships) { // This code is the second half of code that started in // `arrayContentWillChange`. It gets or creates a change // from the child object, and adds the current owner as // the new parent. for (var i=index; i<index+added; i++) { var record = get(this, 'content').objectAt(i); var change = DS.RelationshipChange.createChange(owner, record, store, { parentType: owner.constructor, changeType: "add", kind:"hasMany", key: name }); change.hasManyName = name; this._changesToSync.add(change); } // We wait until the array has finished being // mutated before syncing the OneToManyChanges created // in arrayContentWillChange, so that the array // membership test in the sync() logic operates // on the final results. this._changesToSync.forEach(function(change) { change.sync(); }); this._changesToSync.clear(); } }, // Create a child record within the owner createRecord: function(hash) { var owner = get(this, 'owner'), store = get(owner, 'store'), type = get(this, 'type'), record; Ember.assert("You cannot add '" + type.typeKey + "' records to this polymorphic relationship.", !get(this, 'isPolymorphic')); record = store.createRecord.call(store, type, hash); this.pushObject(record); return record; } }); })(); (function() { /** @module ember-data */ })(); (function() { /** @module ember-data */ var get = Ember.get; var resolveMapConflict = function(oldValue, newValue) { return oldValue; }; var transformMapKey = function(key, value) { return key; }; var transformMapValue = function(key, value) { return value; }; /** The Mappable mixin is designed for classes that would like to behave as a map for configuration purposes. For example, the DS.Adapter class can behave like a map, with more semantic API, via the `map` API: DS.Adapter.map('App.Person', { firstName: { key: 'FIRST' } }); Class configuration via a map-like API has a few common requirements that differentiate it from the standard Ember.Map implementation. First, values often are provided as strings that should be normalized into classes the first time the configuration options are used. Second, the values configured on parent classes should also be taken into account. Finally, setting the value of a key sometimes should merge with the previous value, rather than replacing it. This mixin provides a instance method, `createInstanceMapFor`, that will reify all of the configuration options set on an instance's constructor and provide it for the instance to use. Classes can implement certain hooks that allow them to customize the requirements listed above: * `resolveMapConflict` - called when a value is set for an existing value * `transformMapKey` - allows a key name (for example, a global path to a class) to be normalized * `transformMapValue` - allows a value (for example, a class that should be instantiated) to be normalized Classes that implement this mixin should also implement a class method built using the `generateMapFunctionFor` method: DS.Adapter.reopenClass({ map: DS.Mappable.generateMapFunctionFor('attributes', function(key, newValue, map) { var existingValue = map.get(key); for (var prop in newValue) { if (!newValue.hasOwnProperty(prop)) { continue; } existingValue[prop] = newValue[prop]; } }) }); The function passed to `generateMapFunctionFor` is invoked every time a new value is added to the map. @class _Mappable @private @namespace DS **/ DS._Mappable = Ember.Mixin.create({ createInstanceMapFor: function(mapName) { var instanceMeta = getMappableMeta(this); instanceMeta.values = instanceMeta.values || {}; if (instanceMeta.values[mapName]) { return instanceMeta.values[mapName]; } var instanceMap = instanceMeta.values[mapName] = new Ember.Map(); var klass = this.constructor; while (klass && klass !== DS.Store) { this._copyMap(mapName, klass, instanceMap); klass = klass.superclass; } instanceMeta.values[mapName] = instanceMap; return instanceMap; }, _copyMap: function(mapName, klass, instanceMap) { var classMeta = getMappableMeta(klass); var classMap = classMeta[mapName]; if (classMap) { classMap.forEach(eachMap, this); } function eachMap(key, value) { var transformedKey = (klass.transformMapKey || transformMapKey)(key, value); var transformedValue = (klass.transformMapValue || transformMapValue)(key, value); var oldValue = instanceMap.get(transformedKey); var newValue = transformedValue; if (oldValue) { newValue = (this.constructor.resolveMapConflict || resolveMapConflict)(oldValue, newValue); } instanceMap.set(transformedKey, newValue); } } }); DS._Mappable.generateMapFunctionFor = function(mapName, transform) { return function(key, value) { var meta = getMappableMeta(this); var map = meta[mapName] || Ember.MapWithDefault.create({ defaultValue: function() { return {}; } }); transform.call(this, key, value, map); meta[mapName] = map; }; }; function getMappableMeta(obj) { var meta = Ember.meta(obj, true), keyName = 'DS.Mappable', value = meta[keyName]; if (!value) { meta[keyName] = {}; } if (!meta.hasOwnProperty(keyName)) { meta[keyName] = Ember.create(meta[keyName]); } return meta[keyName]; } })(); (function() { /*globals Ember*/ /*jshint eqnull:true*/ /** @module ember-data */ var get = Ember.get, set = Ember.set; var once = Ember.run.once; var isNone = Ember.isNone; var forEach = Ember.EnumerableUtils.forEach; var indexOf = Ember.EnumerableUtils.indexOf; var map = Ember.EnumerableUtils.map; var OrderedSet = Ember.OrderedSet; var resolve = Ember.RSVP.resolve; // Implementors Note: // // The variables in this file are consistently named according to the following // scheme: // // * +id+ means an identifier managed by an external source, provided inside // the data provided by that source. These are always coerced to be strings // before being used internally. // * +clientId+ means a transient numerical identifier generated at runtime by // the data store. It is important primarily because newly created objects may // not yet have an externally generated id. // * +reference+ means a record reference object, which holds metadata about a // record, even if it has not yet been fully materialized. // * +type+ means a subclass of DS.Model. // Used by the store to normalize IDs entering the store. Despite the fact // that developers may provide IDs as numbers (e.g., `store.find(Person, 1)`), // it is important that internally we use strings, since IDs may be serialized // and lose type information. For example, Ember's router may put a record's // ID into the URL, and if we later try to deserialize that URL and find the // corresponding record, we will not know if it is a string or a number. var coerceId = function(id) { return id == null ? null : id+''; }; /** The store contains all of the data for records loaded from the server. It is also responsible for creating instances of DS.Model that wrap the individual data for a record, so that they can be bound to in your Handlebars templates. Define your application's store like this: MyApp.Store = DS.Store.extend(); Most Ember.js applications will only have a single `DS.Store` that is automatically created by their `Ember.Application`. You can retrieve models from the store in several ways. To retrieve a record for a specific id, use `DS.Model`'s `find()` method: var person = App.Person.find(123); If your application has multiple `DS.Store` instances (an unusual case), you can specify which store should be used: var person = store.find(App.Person, 123); In general, you should retrieve models using the methods on `DS.Model`; you should rarely need to interact with the store directly. By default, the store will talk to your backend using a standard REST mechanism. You can customize how the store talks to your backend by specifying a custom adapter: MyApp.store = DS.Store.create({ adapter: 'MyApp.CustomAdapter' }); You can learn more about writing a custom adapter by reading the `DS.Adapter` documentation. @class Store @namespace DS @extends Ember.Object @uses DS._Mappable */ DS.Store = Ember.Object.extend(DS._Mappable, { /** @method init @private */ init: function() { // internal bookkeeping; not observable this.typeMaps = {}; this.recordArrayManager = DS.RecordArrayManager.create({ store: this }); this._relationshipChanges = {}; this._pendingSave = []; }, /** The adapter to use to communicate to a backend server or other persistence layer. This can be specified as an instance, class, or string. If you want to specify `App.CustomAdapter` as a string, do: ```js adapter: 'custom' ``` @property adapter @default DS.RESTAdapter @type {DS.Adapter|String} */ adapter: '_rest', /** Returns a JSON representation of the record using a custom type-specific serializer, if one exists. The available options are: * `includeId`: `true` if the record's ID should be included in the JSON representation @method serialize @private @param {DS.Model} record the record to serialize @param {Object} options an options hash */ serialize: function(record, options) { return this.serializerFor(record.constructor.typeKey).serialize(record, options); }, /** This property returns the adapter, after resolving a possible string key. If the supplied `adapter` was a class, or a String property path resolved to a class, this property will instantiate the class. This property is cacheable, so the same instance of a specified adapter class should be used for the lifetime of the store. @property _adapter @private @returns DS.Adapter */ _adapter: Ember.computed(function() { var adapter = get(this, 'adapter'); if (typeof adapter === 'string') { adapter = this.container.lookup('adapter:' + adapter) || this.container.lookup('adapter:application') || this.container.lookup('adapter:_rest'); } if (DS.Adapter.detect(adapter)) { adapter = adapter.create({ container: this.container }); } return adapter; }).property('adapter'), // ..................... // . CREATE NEW RECORD . // ..................... /** Create a new record in the current store. The properties passed to this method are set on the newly created record. To create a new instance of `App.Post`: ```js store.createRecord('post', { title: "Rails is omakase" }); ``` @method createRecord @param {String} type @param {Object} properties a hash of properties to set on the newly created record. @returns DS.Model */ createRecord: function(type, properties) { type = this.modelFor(type); properties = properties || {}; // If the passed properties do not include a primary key, // give the adapter an opportunity to generate one. Typically, // client-side ID generators will use something like uuid.js // to avoid conflicts. if (isNone(properties.id)) { properties.id = this._generateId(type); } // Coerce ID to a string properties.id = coerceId(properties.id); var record = this.buildRecord(type, properties.id); // Move the record out of its initial `empty` state into // the `loaded` state. record.loadedData(); // Set the properties specified on the record. record.setProperties(properties); return record; }, /** If possible, this method asks the adapter to generate an ID for a newly created record. @method generateId @param {String} type @returns String if the adapter can generate one, an ID */ _generateId: function(type) { var adapter = this.adapterForType(type); if (adapter && adapter.generateIdForRecord) { return adapter.generateIdForRecord(this); } return null; }, // ................. // . DELETE RECORD . // ................. /** For symmetry, a record can be deleted via the store. @method deleteRecord @param {DS.Model} record */ deleteRecord: function(record) { record.deleteRecord(); }, /** For symmetry, a record can be unloaded via the store. @method unloadRecord @param {DS.Model} record */ unloadRecord: function(record) { record.unloadRecord(); }, // ................ // . FIND RECORDS . // ................ /** This is the main entry point into finding records. The first parameter to this method is the model's name as a string. --- To find a record by ID, pass the `id` as the second parameter: store.find('person', 1); The `find` method will always return a **promise** that will be resolved with the record. If the record was already in the store, the promise will be resolved immediately. Otherwise, the store will ask the adapter's `find` method to find the necessary data. The `find` method will always resolve its promise with the same object for a given type and `id`. --- To find all records for a type, call `find` with no additional parameters: store.find('person'); This will ask the adapter's `findAll` method to find the records for the given type, and return a promise that will be resolved once the server returns the values. --- To find a record by a query, call `find` with a hash as the second parameter: store.find(App.Person, { page: 1 }); This will ask the adapter's `findQuery` method to find the records for the query, and return a promise that will be resolved once the server responds. @method find @param {DS.Model} type @param {Object|String|Integer|null} id */ find: function(type, id) { if (id === undefined) { return this.findAll(type); } // We are passed a query instead of an id. if (Ember.typeOf(id) === 'object') { return this.findQuery(type, id); } return this.findById(type, coerceId(id)); }, /** This method returns a record for a given type and id combination. @method findById @private @param type @param id */ findById: function(type, id) { type = this.modelFor(type); var record = this.getById(type, id); if (get(record, 'isEmpty')) { return promiseObject(this.fetchRecord(record)); } else { return promiseObject(resolve(record)); } }, /** This method makes a series of requests to the adapter's `find` method and returns a promise that resolves once they are all loaded. @method findByIds @param {String} type @param {Array} ids @returns Promise */ findByIds: function(type, ids) { var store = this; return promiseArray(Ember.RSVP.all(map(ids, function(id) { return store.findById(type, id); })).then(function(array) { return Ember.A(array); })); }, /** This method is called by `findById` if it discovers that a particular type/id pair hasn't been loaded yet to kick off a request to the adapter. @method fetchRecord @private @param {DS.Model} record @returns Promise */ fetchRecord: function(record) { var type = record.constructor, id = get(record, 'id'), resolver = Ember.RSVP.defer(); record.loadingData(); var adapter = this.adapterForType(type); Ember.assert("You tried to find a record but you have no adapter (for " + type + ")", adapter); Ember.assert("You tried to find a record but your adapter (for " + type + ") does not implement 'find'", adapter.find); _find(adapter, this, type, id, resolver); return resolver.promise; }, /** Get a record by a given type and ID without triggering a fetch. This method will synchronously return the record if it's available. Otherwise, it will return undefined. ```js var post = store.getById('post', 1); ``` @method getById @param type @param id */ getById: function(type, id) { type = this.modelFor(type); if (this.hasRecordForId(type, id)) { return this.recordForId(type, id); } else { return this.buildRecord(type, id); } }, /** This method is called by the record's `reload` method. The record's `reload` passes in a resolver for the promise it returns. This method calls the adapter's `find` method, which returns a promise. When **that** promise resolves, `reloadRecord` will resolve the promise returned by the record's `reload`. @method reloadRecord @private @param {DS.Model} record @param {Resolver} resolver */ reloadRecord: function(record, resolver) { var type = record.constructor, adapter = this.adapterForType(type), store = this, id = get(record, 'id'); Ember.assert("You cannot reload a record without an ID", id); Ember.assert("You tried to reload a record but you have no adapter (for " + type + ")", adapter); Ember.assert("You tried to reload a record but your adapter does not implement `find`", adapter.find); return _find(adapter, this, type, id, resolver); }, /** This method takes a list of records, groups the records by type, converts the records into IDs, and then invokes the adapter's `findMany` method. The records are grouped by type to invoke `findMany` on adapters for each unique type in records. It is used both by a brand new relationship (via the `findMany` method) or when the data underlying an existing relationship changes. @method fetchMany @private @param records @param owner */ fetchMany: function(records, owner, resolver) { if (!records.length) { return; } // Group By Type var recordsByTypeMap = Ember.MapWithDefault.create({ defaultValue: function() { return Ember.A(); } }); forEach(records, function(record) { recordsByTypeMap.get(record.constructor).push(record); }); forEach(recordsByTypeMap, function(type, records) { var ids = records.mapProperty('id'), adapter = this.adapterForType(type); Ember.assert("You tried to load many records but you have no adapter (for " + type + ")", adapter); Ember.assert("You tried to load many records but your adapter does not implement `findMany`", adapter.findMany); _findMany(adapter, this, type, ids, owner, resolver); }, this); }, /** Returns true if a record for a given type and ID is already loaded. @param {String} type @param {String|Integer} id @returns Boolean */ hasRecordForId: function(type, id) { id = coerceId(id); return !!this.typeMapFor(type).idToRecord[id]; }, /** Returns id record for a given type and ID. If one isn't already loaded, it builds a new record and leaves it in the `empty` state. @param {String} type @param {String|Integer} id @returns DS.Model */ recordForId: function(type, id) { type = this.modelFor(type); id = coerceId(id); var record = this.typeMapFor(type).idToRecord[id]; if (!record) { record = this.buildRecord(type, id); } return record; }, /** @method findMany @private @param {DS.Model} owner @param {Array<DS.Model>} records @param {String} type @param {Resolver} resolver @return DS.ManyArray */ findMany: function(owner, records, type, resolver) { type = this.modelFor(type); records = Ember.A(records); var unloadedRecords = records.filterProperty('isEmpty', true), manyArray = this.recordArrayManager.createManyArray(type, records); unloadedRecords.forEach(function(record) { record.loadingData(); }); manyArray.loadingRecordsCount = unloadedRecords.length; if (unloadedRecords.length) { unloadedRecords.forEach(function(record) { this.recordArrayManager.registerWaitingRecordArray(record, manyArray); }, this); this.fetchMany(unloadedRecords, owner, resolver); } else { manyArray.set('isLoaded', true); Ember.run.once(manyArray, 'trigger', 'didLoad'); } return manyArray; }, /** If a relationship was originally populated by the adapter as a link (as opposed to a list of IDs), this method is called when the relationship is fetched. The link (which is usually a URL) is passed through unchanged, so the adapter can make whatever request it wants. The usual use-case is for the server to register a URL as a link, and then use that URL in the future to make a request for the relationship. @private @param {DS.Model} owner @param {any} link @param {String} type @param {Resolver} resolver @return DS.ManyArray */ findHasMany: function(owner, link, relationship, resolver) { var adapter = this.adapterForType(owner.constructor); Ember.assert("You tried to load a hasMany relationship but you have no adapter (for " + owner.constructor + ")", adapter); Ember.assert("You tried to load a hasMany relationship from a specified `link` in the original payload but your adapter does not implement `findHasMany`", adapter.findHasMany); var records = this.recordArrayManager.createManyArray(relationship.type, Ember.A([])); _findHasMany(adapter, this, owner, link, relationship, resolver); return records; }, /** This method delegates a query to the adapter. This is the one place where adapter-level semantics are exposed to the application. Exposing queries this way seems preferable to creating an abstract query language for all server-side queries, and then require all adapters to implement them. This method returns a promise, which is resolved with a `RecordArray` once the server returns. @method findQuery @private @param {String} type @param {any} query an opaque query to be used by the adapter @return Promise */ findQuery: function(type, query) { type = this.modelFor(type); var array = DS.AdapterPopulatedRecordArray.create({ type: type, query: query, content: Ember.A(), store: this }); var adapter = this.adapterForType(type), resolver = Ember.RSVP.defer(); Ember.assert("You tried to load a query but you have no adapter (for " + type + ")", adapter); Ember.assert("You tried to load a query but your adapter does not implement `findQuery`", adapter.findQuery); _findQuery(adapter, this, type, query, array, resolver); return promiseArray(resolver.promise); }, /** This method returns an array of all records adapter can find. It triggers the adapter's `findAll` method to give it an opportunity to populate the array with records of that type. @method findAll @private @param {Class} type @return {DS.AdapterPopulatedRecordArray} */ findAll: function(type) { type = this.modelFor(type); return this.fetchAll(type, this.all(type)); }, /** @method fetchAll @private @param type @param array @returns Promise */ fetchAll: function(type, array) { var adapter = this.adapterForType(type), sinceToken = this.typeMapFor(type).metadata.since, resolver = Ember.RSVP.defer(); set(array, 'isUpdating', true); Ember.assert("You tried to load all records but you have no adapter (for " + type + ")", adapter); Ember.assert("You tried to load all records but your adapter does not implement `findAll`", adapter.findAll); _findAll(adapter, this, type, sinceToken, resolver); return promiseArray(resolver.promise); }, /** @method didUpdateAll @param type */ didUpdateAll: function(type) { var findAllCache = this.typeMapFor(type).findAllCache; set(findAllCache, 'isUpdating', false); }, /** This method returns a filtered array that contains all of the known records for a given type. Note that because it's just a filter, it will have any locally created records of the type. Also note that multiple calls to `all` for a given type will always return the same RecordArray. @method all @param {Class} type @return {DS.RecordArray} */ all: function(type) { var typeMap = this.typeMapFor(type), findAllCache = typeMap.findAllCache; if (findAllCache) { return findAllCache; } var array = DS.RecordArray.create({ type: type, content: Ember.A(), store: this, isLoaded: true }); this.recordArrayManager.registerFilteredRecordArray(array, type); typeMap.findAllCache = array; return array; }, /** Takes a type and filter function, and returns a live RecordArray that remains up to date as new records are loaded into the store or created locally. The callback function takes a materialized record, and returns true if the record should be included in the filter and false if it should not. The filter function is called once on all records for the type when it is created, and then once on each newly loaded or created record. If any of a record's properties change, or if it changes state, the filter function will be invoked again to determine whether it should still be in the array. Note that the existence of a filter on a type will trigger immediate materialization of all loaded data for a given type, so you might not want to use filters for a type if you are loading many records into the store, many of which are not active at any given time. In this scenario, you might want to consider filtering the raw data before loading it into the store. @method filter @param {Class} type @param {Function} filter @return {DS.FilteredRecordArray} */ filter: function(type, query, filter) { var promise; // allow an optional server query if (arguments.length === 3) { promise = this.findQuery(type, query); } else if (arguments.length === 2) { filter = query; } type = this.modelFor(type); var array = DS.FilteredRecordArray.create({ type: type, content: Ember.A(), store: this, manager: this.recordArrayManager, filterFunction: filter }); this.recordArrayManager.registerFilteredRecordArray(array, type, filter); if (promise) { return promise.then(function() { return array; }); } else { return array; } }, /** This method returns if a certain record is already loaded in the store. Use this function to know beforehand if a find() will result in a request or that it will be a cache hit. @method recordIsLoaded @param {Class} type @param {string} id @return {boolean} */ recordIsLoaded: function(type, id) { if (!this.hasRecordForId(type, id)) { return false; } return !get(this.recordForId(type, id), 'isEmpty'); }, // ............ // . UPDATING . // ............ /** If the adapter updates attributes or acknowledges creation or deletion, the record will notify the store to update its membership in any filters. To avoid thrashing, this method is invoked only once per run loop per record. @method dataWasUpdated @private @param {Class} type @param {Number|String} clientId @param {DS.Model} record */ dataWasUpdated: function(type, record) { // Because data updates are invoked at the end of the run loop, // it is possible that a record might be deleted after its data // has been modified and this method was scheduled to be called. // // If that's the case, the record would have already been removed // from all record arrays; calling updateRecordArrays would just // add it back. If the record is deleted, just bail. It shouldn't // give us any more trouble after this. if (get(record, 'isDeleted')) { return; } if (get(record, 'isLoaded')) { this.recordArrayManager.recordDidChange(record); } }, // .............. // . PERSISTING . // .............. /** This method is called by `record.save`, and gets passed a resolver for the promise that `record.save` returns. It schedules saving to happen at the end of the run loop. @method scheduleSave @private @param {DS.Model} record @param {Resolver} resolver */ scheduleSave: function(record, resolver) { record.adapterWillCommit(); this._pendingSave.push([record, resolver]); once(this, 'flushPendingSave'); }, /** This method is called at the end of the run loop, and flushes any records passed into `scheduleSave` @method flushPendingSave @private */ flushPendingSave: function() { var pending = this._pendingSave.slice(); this._pendingSave = []; forEach(pending, function(tuple) { var record = tuple[0], resolver = tuple[1], adapter = this.adapterForType(record.constructor), operation; if (get(record, 'isNew')) { operation = 'createRecord'; } else if (get(record, 'isDeleted')) { operation = 'deleteRecord'; } else { operation = 'updateRecord'; } _commit(adapter, this, operation, record, resolver); }, this); }, /** This method is called once the promise returned by an adapter's `createRecord`, `updateRecord` or `deleteRecord` is resolved. If the data provides a server-generated ID, it will update the record and the store's indexes. @method didSaveRecord @private @param {DS.Model} record the in-flight record @param {Object} data optional data (see above) */ didSaveRecord: function(record, data) { if (data) { this.updateId(record, data); } record.adapterDidCommit(data); }, /** This method is called once the promise returned by an adapter's `createRecord`, `updateRecord` or `deleteRecord` is rejected with a `DS.InvalidError`. @method recordWasInvalid @private @param {DS.Model} record @param {Object} errors */ recordWasInvalid: function(record, errors) { record.adapterDidInvalidate(errors); }, /** This method is called once the promise returned by an adapter's `createRecord`, `updateRecord` or `deleteRecord` is rejected (with anything other than a `DS.InvalidError`). @method recordWasError @private @param {DS.Model} record */ recordWasError: function(record) { record.adapterDidError(); }, /** When an adapter's `createRecord`, `updateRecord` or `deleteRecord` resolves with data, this method extracts the ID from the supplied data. @method updateId @private @param {DS.Model} record @param {Object} data */ updateId: function(record, data) { var oldId = get(record, 'id'), id = coerceId(data.id); Ember.assert("An adapter cannot assign a new id to a record that already has an id. " + record + " had id: " + oldId + " and you tried to update it with " + id + ". This likely happened because your server returned data in response to a find or update that had a different id than the one you sent.", oldId === null || id === oldId); this.typeMapFor(record.constructor).idToRecord[id] = record; set(record, 'id', id); }, /** Returns a map of IDs to client IDs for a given type. @method typeMapFor @private @param type */ typeMapFor: function(type) { var typeMaps = get(this, 'typeMaps'), guid = Ember.guidFor(type), typeMap; typeMap = typeMaps[guid]; if (typeMap) { return typeMap; } typeMap = { idToRecord: {}, records: [], metadata: {} }; typeMaps[guid] = typeMap; return typeMap; }, // ................ // . LOADING DATA . // ................ /** This internal method is used by `push`. @method _load @private @param {DS.Model} type @param data @param prematerialized */ _load: function(type, data) { var id = coerceId(data.id), record = this.recordForId(type, id); record.setupData(data); this.recordArrayManager.recordDidChange(record); return record; }, /** Returns a model class for a particular key. Used by methods that take a type key (like `find`, `createRecord`, etc.) @param {String} key @returns {subclass of DS.Model} */ modelFor: function(key) { if (typeof key !== 'string') { return key; } var factory = this.container.lookupFactory('model:'+key); Ember.assert("No model was found for '" + key + "'", factory); factory.store = this; factory.typeKey = key; return factory; }, /** Push some data for a given type into the store. This method expects normalized data: * The ID is a key named `id` (an ID is mandatory) * The names of attributes are the ones you used in your model's `DS.attr`s. * Your relationships must be: * represented as IDs or Arrays of IDs * represented as model instances * represented as URLs, under the `links` key For this model: ```js App.Person = DS.Model.extend({ firstName: DS.attr(), lastName: DS.attr(), children: DS.hasMany('person') }); ``` To represent the children as IDs: ```js { id: 1, firstName: "Tom", lastName: "Dale", children: [1, 2, 3] } ``` To represent the children relationship as a URL: ```js { id: 1, firstName: "Tom", lastName: "Dale", links: { children: "/people/1/children" } } ``` If you're streaming data or implementing an adapter, make sure that you have converted the incoming data into this form. This method can be used both to push in brand new records, as well as to update existing records. @method push @param {String} type @param {Object} data @returns DS.Model the record that was created or updated. */ push: function(type, data) { var serializer = this.serializerFor(type); type = this.modelFor(type); data = serializer.deserialize(type, data); this._load(type, data); return this.recordForId(type, data.id); }, /** If you have an Array of normalized data to push, you can call `pushMany` with the Array, and it will call `push` repeatedly for you. @method pushMany @param {String} type @param {Array} datas @return {Array<DS.Model>} */ pushMany: function(type, datas) { return map(datas, function(data) { return this.push(type, data); }, this); }, /** Build a brand new record for a given type, ID, and initial data. @method buildRecord @private @param {subclass of DS.Model} type @param {String} id @param {Object} data @returns DS.Model */ buildRecord: function(type, id, data) { var typeMap = this.typeMapFor(type), idToRecord = typeMap.idToRecord; Ember.assert('The id ' + id + ' has already been used with another record of type ' + type.toString() + '.', !id || !idToRecord[id]); var record = type._create({ id: id, store: this, }); if (data) { record.setupData(data); } // if we're creating an item, this process will be done // later, once the object has been persisted. if (id) { idToRecord[id] = record; } typeMap.records.push(record); return record; }, // ............... // . DESTRUCTION . // ............... /** When a record is destroyed, this un-indexes it and removes it from any record arrays so it can be GCed. @method dematerializeRecord @private @param {DS.Model} record */ dematerializeRecord: function(record) { var type = record.constructor, typeMap = this.typeMapFor(type), id = get(record, 'id'); record.updateRecordArrays(); if (id) { delete typeMap.idToRecord[id]; } var loc = indexOf(typeMap.records, record); typeMap.records.splice(loc, 1); }, // ........................ // . RELATIONSHIP CHANGES . // ........................ addRelationshipChangeFor: function(childRecord, childKey, parentRecord, parentKey, change) { var clientId = childRecord.clientId, parentClientId = parentRecord ? parentRecord : parentRecord; var key = childKey + parentKey; var changes = this._relationshipChanges; if (!(clientId in changes)) { changes[clientId] = {}; } if (!(parentClientId in changes[clientId])) { changes[clientId][parentClientId] = {}; } if (!(key in changes[clientId][parentClientId])) { changes[clientId][parentClientId][key] = {}; } changes[clientId][parentClientId][key][change.changeType] = change; }, removeRelationshipChangeFor: function(clientRecord, childKey, parentRecord, parentKey, type) { var clientId = clientRecord.clientId, parentClientId = parentRecord ? parentRecord.clientId : parentRecord; var changes = this._relationshipChanges; var key = childKey + parentKey; if (!(clientId in changes) || !(parentClientId in changes[clientId]) || !(key in changes[clientId][parentClientId])){ return; } delete changes[clientId][parentClientId][key][type]; }, relationshipChangePairsFor: function(record){ var toReturn = []; if( !record ) { return toReturn; } //TODO(Igor) What about the other side var changesObject = this._relationshipChanges[record.clientId]; for (var objKey in changesObject){ if(changesObject.hasOwnProperty(objKey)){ for (var changeKey in changesObject[objKey]){ if(changesObject[objKey].hasOwnProperty(changeKey)){ toReturn.push(changesObject[objKey][changeKey]); } } } } return toReturn; }, // ...................... // . PER-TYPE ADAPTERS // ...................... /** Returns the adapter for a given type. @method adapterForType @private @param {subclass of DS.Model} type @returns DS.Adapter */ adapterForType: function(type) { var container = this.container, adapter; if (container) { adapter = container.lookup('adapter:' + type.typeKey) || container.lookup('adapter:application'); } return adapter || get(this, '_adapter'); }, // .............................. // . RECORD CHANGE NOTIFICATION . // .............................. /** Returns an instance of the serializer for a given type. For example, `serializerFor('person')` will return an instance of `App.PersonSerializer`. If no `App.PersonSerializer` is found, this method will look for an `App.ApplicationSerializer` (the default serializer for your entire application). If no `App.ApplicationSerializer` is found, it will fall back to an instance of `DS.JSONSerializer`. @method serializerFor @private @param {String} type the record to serialize */ serializerFor: function(type) { var container = this.container; // TODO: Make tests pass without this if (!container) { return DS.JSONSerializer.create({ store: this }); } return container.lookup('serializer:'+type) || container.lookup('serializer:application') || container.lookup('serializer:_default'); } }); // Delegation to the adapter and promise management DS.PromiseArray = Ember.ArrayProxy.extend(Ember.PromiseProxyMixin); DS.PromiseObject = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); function promiseObject(promise) { return DS.PromiseObject.create({ promise: promise }); } function promiseArray(promise) { return DS.PromiseArray.create({ promise: promise }); } function isThenable(object) { return object && typeof object.then === 'function'; } function serializerFor(adapter, type) { var serializer = adapter.serializer, defaultSerializer = adapter.defaultSerializer, container = adapter.container; if (container && serializer === undefined) { serializer = container.lookup('serializer:'+type.typeKey) || container.lookup('serializer:application') || container.lookup('serializer:' + defaultSerializer || 'serializer:_default'); } if (serializer === null || serializer === undefined) { serializer = { extract: function(store, type, payload) { return payload; } }; } return serializer; } function _find(adapter, store, type, id, resolver) { var promise = adapter.find(store, type, id), serializer = serializerFor(adapter, type); return resolve(promise).then(function(payload) { Ember.assert("You made a request for a " + type.typeKey + " with id " + id + ", but the adapter's response did not have any data", payload); payload = serializer.extract(store, type, payload, id, 'find'); return store.push(type, payload); }).then(resolver.resolve, resolver.reject); } function _findMany(adapter, store, type, ids, owner, resolver) { var promise = adapter.findMany(store, type, ids, owner), serializer = serializerFor(adapter, type); return resolve(promise).then(function(payload) { payload = serializer.extract(store, type, payload, null, 'findMany'); store.pushMany(type, payload); }).then(resolver.resolve, resolver.reject); } function _findHasMany(adapter, store, record, link, relationship, resolver) { var promise = adapter.findHasMany(store, record, link, relationship), serializer = serializerFor(adapter, relationship.type); return resolve(promise).then(function(payload) { payload = serializer.extract(store, relationship.type, payload, null, 'findHasMany'); var records = store.pushMany(relationship.type, payload); record.updateHasMany(relationship.key, records); }).then(resolver.resolve, resolver.reject); } function _findAll(adapter, store, type, sinceToken, resolver) { var promise = adapter.findAll(store, type, sinceToken), serializer = serializerFor(adapter, type); return resolve(promise).then(function(payload) { payload = serializer.extract(store, type, payload, null, 'findAll'); store.pushMany(type, payload); store.didUpdateAll(type); return store.all(type); }).then(resolver.resolve, resolver.reject); } function _findQuery(adapter, store, type, query, recordArray, resolver) { var promise = adapter.findQuery(store, type, query, recordArray), serializer = serializerFor(adapter, type); return resolve(promise).then(function(payload) { payload = serializer.extract(store, type, payload, null, 'findAll'); recordArray.load(payload); return recordArray; }).then(resolver.resolve, resolver.reject); } function _commit(adapter, store, operation, record, resolver) { var type = record.constructor, promise = adapter[operation](store, type, record), serializer = serializerFor(adapter, type); Ember.assert("Your adapter's '" + operation + "' method must return a promise, but it returned " + promise, isThenable(promise)); return promise.then(function(payload) { payload = serializer.extract(store, type, payload, get(record, 'id'), operation); store.didSaveRecord(record, payload); return record; }, function(reason) { if (reason instanceof DS.InvalidError) { store.recordWasInvalid(record, reason.errors); } else { store.recordWasError(record, reason); } throw reason; }).then(resolver.resolve, resolver.reject); } })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set, once = Ember.run.once, arrayMap = Ember.ArrayPolyfills.map; /* WARNING: Much of these docs are inaccurate as of bf8497. This file encapsulates the various states that a record can transition through during its lifecycle. ### State Manager A record's state manager explicitly tracks what state a record is in at any given time. For instance, if a record is newly created and has not yet been sent to the adapter to be saved, it would be in the `created.uncommitted` state. If a record has had local modifications made to it that are in the process of being saved, the record would be in the `updated.inFlight` state. (These state paths will be explained in more detail below.) Events are sent by the record or its store to the record's state manager. How the state manager reacts to these events is dependent on which state it is in. In some states, certain events will be invalid and will cause an exception to be raised. States are hierarchical. For example, a record can be in the `deleted.start` state, then transition into the `deleted.inFlight` state. If a child state does not implement an event handler, the state manager will attempt to invoke the event on all parent states until the root state is reached. The state hierarchy of a record is described in terms of a path string. You can determine a record's current state by getting its manager's current state path: record.get('stateManager.currentPath'); //=> "created.uncommitted" The `DS.Model` states are themselves stateless. What we mean is that, though each instance of a record also has a unique instance of a `DS.StateManager`, the hierarchical states that each of *those* points to is a shared data structure. For performance reasons, instead of each record getting its own copy of the hierarchy of states, each state manager points to this global, immutable shared instance. How does a state know which record it should be acting on? We pass a reference to the current state manager as the first parameter to every method invoked on a state. The state manager passed as the first parameter is where you should stash state about the record if needed; you should never store data on the state object itself. If you need access to the record being acted on, you can retrieve the state manager's `record` property. For example, if you had an event handler `myEvent`: myEvent: function(manager) { var record = manager.get('record'); record.doSomething(); } For more information about state managers in general, see the Ember.js documentation on `Ember.StateManager`. ### Events, Flags, and Transitions A state may implement zero or more events, flags, or transitions. #### Events Events are named functions that are invoked when sent to a record. The state manager will first look for a method with the given name on the current state. If no method is found, it will search the current state's parent, and then its grandparent, and so on until reaching the top of the hierarchy. If the root is reached without an event handler being found, an exception will be raised. This can be very helpful when debugging new features. Here's an example implementation of a state with a `myEvent` event handler: aState: DS.State.create({ myEvent: function(manager, param) { console.log("Received myEvent with "+param); } }) To trigger this event: record.send('myEvent', 'foo'); //=> "Received myEvent with foo" Note that an optional parameter can be sent to a record's `send()` method, which will be passed as the second parameter to the event handler. Events should transition to a different state if appropriate. This can be done by calling the state manager's `transitionTo()` method with a path to the desired state. The state manager will attempt to resolve the state path relative to the current state. If no state is found at that path, it will attempt to resolve it relative to the current state's parent, and then its parent, and so on until the root is reached. For example, imagine a hierarchy like this: * created * start <-- currentState * inFlight * updated * inFlight If we are currently in the `start` state, calling `transitionTo('inFlight')` would transition to the `created.inFlight` state, while calling `transitionTo('updated.inFlight')` would transition to the `updated.inFlight` state. Remember that *only events* should ever cause a state transition. You should never call `transitionTo()` from outside a state's event handler. If you are tempted to do so, create a new event and send that to the state manager. #### Flags Flags are Boolean values that can be used to introspect a record's current state in a more user-friendly way than examining its state path. For example, instead of doing this: var statePath = record.get('stateManager.currentPath'); if (statePath === 'created.inFlight') { doSomething(); } You can say: if (record.get('isNew') && record.get('isSaving')) { doSomething(); } If your state does not set a value for a given flag, the value will be inherited from its parent (or the first place in the state hierarchy where it is defined). The current set of flags are defined below. If you want to add a new flag, in addition to the area below, you will also need to declare it in the `DS.Model` class. #### Transitions Transitions are like event handlers but are called automatically upon entering or exiting a state. To implement a transition, just call a method either `enter` or `exit`: myState: DS.State.create({ // Gets called automatically when entering // this state. enter: function(manager) { console.log("Entered myState"); } }) Note that enter and exit events are called once per transition. If the current state changes, but changes to another child state of the parent, the transition event on the parent will not be triggered. */ var hasDefinedProperties = function(object) { // Ignore internal property defined by simulated `Ember.create`. var names = Ember.keys(object); var i, l, name; for (i = 0, l = names.length; i < l; i++ ) { name = names[i]; if (object.hasOwnProperty(name) && object[name]) { return true; } } return false; }; var didSetProperty = function(record, context) { if (context.value !== context.oldValue) { record.send('becomeDirty'); record.updateRecordArraysLater(); } }; // Implementation notes: // // Each state has a boolean value for all of the following flags: // // * isLoaded: The record has a populated `data` property. When a // record is loaded via `store.find`, `isLoaded` is false // until the adapter sets it. When a record is created locally, // its `isLoaded` property is always true. // * isDirty: The record has local changes that have not yet been // saved by the adapter. This includes records that have been // created (but not yet saved) or deleted. // * isSaving: The record has been committed, but // the adapter has not yet acknowledged that the changes have // been persisted to the backend. // * isDeleted: The record was marked for deletion. When `isDeleted` // is true and `isDirty` is true, the record is deleted locally // but the deletion was not yet persisted. When `isSaving` is // true, the change is in-flight. When both `isDirty` and // `isSaving` are false, the change has persisted. // * isError: The adapter reported that it was unable to save // local changes to the backend. This may also result in the // record having its `isValid` property become false if the // adapter reported that server-side validations failed. // * isNew: The record was created on the client and the adapter // did not yet report that it was successfully saved. // * isValid: No client-side validations have failed and the // adapter did not report any server-side validation failures. // The dirty state is a abstract state whose functionality is // shared between the `created` and `updated` states. // // The deleted state shares the `isDirty` flag with the // subclasses of `DirtyState`, but with a very different // implementation. // // Dirty states have three child states: // // `uncommitted`: the store has not yet handed off the record // to be saved. // `inFlight`: the store has handed off the record to be saved, // but the adapter has not yet acknowledged success. // `invalid`: the record has invalid information and cannot be // send to the adapter yet. var DirtyState = { initialState: 'uncommitted', // FLAGS isDirty: true, // SUBSTATES // When a record first becomes dirty, it is `uncommitted`. // This means that there are local pending changes, but they // have not yet begun to be saved, and are not invalid. uncommitted: { // EVENTS didSetProperty: didSetProperty, pushedData: Ember.K, becomeDirty: Ember.K, willCommit: function(record) { record.transitionTo('inFlight'); }, reloadRecord: function(record, resolver) { get(record, 'store').reloadRecord(record, resolver); }, becameClean: function(record) { record.transitionTo('loaded.saved'); }, becameInvalid: function(record) { record.transitionTo('invalid'); }, rollback: function(record) { record.rollback(); } }, // Once a record has been handed off to the adapter to be // saved, it is in the 'in flight' state. Changes to the // record cannot be made during this window. inFlight: { // FLAGS isSaving: true, // EVENTS didSetProperty: didSetProperty, becomeDirty: Ember.K, pushedData: Ember.K, // TODO: More robust semantics around save-while-in-flight willCommit: Ember.K, didCommit: function(record) { var dirtyType = get(this, 'dirtyType'); record.transitionTo('saved'); record.send('invokeLifecycleCallbacks', dirtyType); }, becameInvalid: function(record, errors) { set(record, 'errors', errors); record.transitionTo('invalid'); record.send('invokeLifecycleCallbacks'); }, becameError: function(record) { record.transitionTo('uncommitted'); record.triggerLater('becameError', record); } }, // A record is in the `invalid` state when its client-side // invalidations have failed, or if the adapter has indicated // the the record failed server-side invalidations. invalid: { // FLAGS isValid: false, // EVENTS deleteRecord: function(record) { record.transitionTo('deleted.uncommitted'); record.clearRelationships(); }, didSetProperty: function(record, context) { var errors = get(record, 'errors'), key = context.name; set(errors, key, null); if (!hasDefinedProperties(errors)) { record.send('becameValid'); } didSetProperty(record, context); }, becomeDirty: Ember.K, rollback: function(record) { record.send('becameValid'); record.send('rollback'); }, becameValid: function(record) { record.transitionTo('uncommitted'); }, invokeLifecycleCallbacks: function(record) { record.triggerLater('becameInvalid', record); } } }; // The created and updated states are created outside the state // chart so we can reopen their substates and add mixins as // necessary. function deepClone(object) { var clone = {}, value; for (var prop in object) { value = object[prop]; if (value && typeof value === 'object') { clone[prop] = deepClone(value); } else { clone[prop] = value; } } return clone; } function mixin(original, hash) { for (var prop in hash) { original[prop] = hash[prop]; } return original; } function dirtyState(options) { var newState = deepClone(DirtyState); return mixin(newState, options); } var createdState = dirtyState({ dirtyType: 'created', // FLAGS isNew: true }); var updatedState = dirtyState({ dirtyType: 'updated' }); createdState.uncommitted.deleteRecord = function(record) { record.clearRelationships(); record.transitionTo('deleted.saved'); }; createdState.uncommitted.rollback = function(record) { DirtyState.uncommitted.rollback.apply(this, arguments); record.transitionTo('deleted.saved'); }; updatedState.uncommitted.deleteRecord = function(record) { record.transitionTo('deleted.uncommitted'); record.clearRelationships(); }; var RootState = { // FLAGS isEmpty: false, isLoading: false, isLoaded: false, isDirty: false, isSaving: false, isDeleted: false, isNew: false, isValid: true, // SUBSTATES // A record begins its lifecycle in the `empty` state. // If its data will come from the adapter, it will // transition into the `loading` state. Otherwise, if // the record is being created on the client, it will // transition into the `created` state. empty: { isEmpty: true, // EVENTS loadingData: function(record) { record.transitionTo('loading'); }, loadedData: function(record) { record.transitionTo('loaded.created.uncommitted'); record.suspendRelationshipObservers(function() { record.notifyPropertyChange('data'); }); }, pushedData: function(record) { record.transitionTo('loaded.saved'); } }, // A record enters this state when the store askes // the adapter for its data. It remains in this state // until the adapter provides the requested data. // // Usually, this process is asynchronous, using an // XHR to retrieve the data. loading: { // FLAGS isLoading: true, // EVENTS pushedData: function(record) { record.transitionTo('loaded.saved'); record.triggerLater('didLoad'); set(record, 'isError', false); }, becameError: function(record) { record.triggerLater('becameError', record); } }, // A record enters this state when its data is populated. // Most of a record's lifecycle is spent inside substates // of the `loaded` state. loaded: { initialState: 'saved', // FLAGS isLoaded: true, // SUBSTATES // If there are no local changes to a record, it remains // in the `saved` state. saved: { setup: function(record) { var attrs = record._attributes, isDirty = false; for (var prop in attrs) { if (attrs.hasOwnProperty(prop)) { isDirty = true; break; } } if (isDirty) { record.adapterDidDirty(); } }, // EVENTS didSetProperty: didSetProperty, pushedData: Ember.K, becomeDirty: function(record) { record.transitionTo('updated.uncommitted'); }, willCommit: function(record) { record.transitionTo('updated.inFlight'); }, reloadRecord: function(record, resolver) { get(record, 'store').reloadRecord(record, resolver); }, deleteRecord: function(record) { record.transitionTo('deleted.uncommitted'); record.clearRelationships(); }, unloadRecord: function(record) { // clear relationships before moving to deleted state // otherwise it fails record.clearRelationships(); record.transitionTo('deleted.saved'); }, didCommit: function(record) { record.send('invokeLifecycleCallbacks', get(record, 'lastDirtyType')); }, }, // A record is in this state after it has been locally // created but before the adapter has indicated that // it has been saved. created: createdState, // A record is in this state if it has already been // saved to the server, but there are new local changes // that have not yet been saved. updated: updatedState }, // A record is in this state if it was deleted from the store. deleted: { initialState: 'uncommitted', dirtyType: 'deleted', // FLAGS isDeleted: true, isLoaded: true, isDirty: true, // TRANSITIONS setup: function(record) { var store = get(record, 'store'); store.recordArrayManager.remove(record); }, // SUBSTATES // When a record is deleted, it enters the `start` // state. It will exit this state when the record // starts to commit. uncommitted: { // EVENTS willCommit: function(record) { record.transitionTo('inFlight'); }, rollback: function(record) { record.rollback(); }, becomeDirty: Ember.K, deleteRecord: Ember.K, becameClean: function(record) { record.transitionTo('loaded.saved'); } }, // After a record starts committing, but // before the adapter indicates that the deletion // has saved to the server, a record is in the // `inFlight` substate of `deleted`. inFlight: { // FLAGS isSaving: true, // EVENTS // TODO: More robust semantics around save-while-in-flight willCommit: Ember.K, didCommit: function(record) { record.transitionTo('saved'); record.send('invokeLifecycleCallbacks'); } }, // Once the adapter indicates that the deletion has // been saved, the record enters the `saved` substate // of `deleted`. saved: { // FLAGS isDirty: false, setup: function(record) { var store = get(record, 'store'); store.dematerializeRecord(record); }, invokeLifecycleCallbacks: function(record) { record.triggerLater('didDelete', record); record.triggerLater('didCommit', record); } } }, invokeLifecycleCallbacks: function(record, dirtyType) { if (dirtyType === 'created') { record.triggerLater('didCreate', record); } else { record.triggerLater('didUpdate', record); } record.triggerLater('didCommit', record); } }; var hasOwnProp = {}.hasOwnProperty; function wireState(object, parent, name) { /*jshint proto:true*/ // TODO: Use Object.create and copy instead object = mixin(parent ? Ember.create(parent) : {}, object); object.parentState = parent; object.stateName = name; for (var prop in object) { if (!object.hasOwnProperty(prop) || prop === 'parentState' || prop === 'stateName') { continue; } if (typeof object[prop] === 'object') { object[prop] = wireState(object[prop], object, name + "." + prop); } } return object; } RootState = wireState(RootState, null, "root"); DS.RootState = RootState; })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set, map = Ember.EnumerableUtils.map, merge = Ember.merge, once = Ember.run.once; var arrayMap = Ember.ArrayPolyfills.map; var retrieveFromCurrentState = Ember.computed(function(key, value) { return get(get(this, 'currentState'), key); }).property('currentState').readOnly(); /** The model class that all Ember Data records descend from. @class Model @namespace DS @extends Ember.Object @uses Ember.Evented */ DS.Model = Ember.Object.extend(Ember.Evented, { isEmpty: retrieveFromCurrentState, isLoading: retrieveFromCurrentState, isLoaded: retrieveFromCurrentState, isDirty: retrieveFromCurrentState, isSaving: retrieveFromCurrentState, isDeleted: retrieveFromCurrentState, isNew: retrieveFromCurrentState, isValid: retrieveFromCurrentState, dirtyType: retrieveFromCurrentState, isError: false, isReloading: false, clientId: null, id: null, transaction: null, currentState: null, errors: null, /** Create a JSON representation of the record, using the serialization strategy of the store's adapter. @method serialize @param {Object} options Available options: * `includeId`: `true` if the record's ID should be included in the JSON representation. @returns {Object} an object whose values are primitive JSON values only */ serialize: function(options) { var store = get(this, 'store'); return store.serialize(this, options); }, /** Use {{#crossLink "DS.JSONSerializer"}}DS.JSONSerializer{{/crossLink}} to get the JSON representation of a record. @method toJSON @param {Object} options Available options: * `includeId`: `true` if the record's ID should be included in the JSON representation. @returns {Object} A JSON representation of the object. */ toJSON: function(options) { var serializer = DS.JSONSerializer.create(); return serializer.serialize(this, options); }, /** Fired when the record is loaded from the server. @event didLoad */ didLoad: Ember.K, /** Fired when the record is reloaded from the server. @event didReload */ didReload: Ember.K, /** Fired when the record is updated. @event didUpdate */ didUpdate: Ember.K, /** Fired when the record is created. @event didCreate */ didCreate: Ember.K, /** Fired when the record is deleted. @event didDelete */ didDelete: Ember.K, /** Fired when the record becomes invalid. @event becameInvalid */ becameInvalid: Ember.K, /** Fired when the record enters the error state. @event becameError */ becameError: Ember.K, data: Ember.computed(function() { this._data = this._data || {}; return this._data; }).property(), _data: null, init: function() { set(this, 'currentState', DS.RootState.empty); this._super(); this._setup(); }, _setup: function() { this._changesToSync = {}; this._deferredTriggers = []; this._data = {}; this._attributes = {}; this._inFlightAttributes = {}; this._relationships = {}; }, send: function(name, context) { var currentState = get(this, 'currentState'); if (!currentState[name]) { this._unhandledEvent(currentState, name, context); } return currentState[name](this, context); }, transitionTo: function(name) { // POSSIBLE TODO: Remove this code and replace with // always having direct references to state objects var pivotName = name.split(".", 1), currentState = get(this, 'currentState'), state = currentState; do { if (state.exit) { state.exit(this); } state = state.parentState; } while (!state.hasOwnProperty(pivotName)); var path = name.split("."); var setups = [], enters = [], i, l; for (i=0, l=path.length; i<l; i++) { state = state[path[i]]; if (state.enter) { enters.push(state); } if (state.setup) { setups.push(state); } } for (i=0, l=enters.length; i<l; i++) { enters[i].enter(this); } set(this, 'currentState', state); for (i=0, l=setups.length; i<l; i++) { setups[i].setup(this); } }, _unhandledEvent: function(state, name, context) { var errorMessage = "Attempted to handle event `" + name + "` "; errorMessage += "on " + String(this) + " while in state "; errorMessage += state.stateName + ". "; if (context !== undefined) { errorMessage += "Called with " + Ember.inspect(context) + "."; } throw new Ember.Error(errorMessage); }, withTransaction: function(fn) { var transaction = get(this, 'transaction'); if (transaction) { fn(transaction); } }, loadingData: function() { this.send('loadingData'); }, loadedData: function() { this.send('loadedData'); }, pushedData: function() { this.send('pushedData'); }, deleteRecord: function() { this.send('deleteRecord'); }, unloadRecord: function() { Ember.assert("You can only unload a loaded, non-dirty record.", !get(this, 'isDirty')); this.send('unloadRecord'); }, clearRelationships: function() { this.eachRelationship(function(name, relationship) { if (relationship.kind === 'belongsTo') { set(this, name, null); } else if (relationship.kind === 'hasMany') { var hasMany = this._relationships[relationship.name]; if (hasMany) { hasMany.clear(); } } }, this); }, updateRecordArrays: function() { var store = get(this, 'store'); if (store) { store.dataWasUpdated(this.constructor, this); } }, adapterWillCommit: function() { this.send('willCommit'); }, /** If the adapter did not return a hash in response to a commit, merge the changed attributes and relationships into the existing saved data. @method adapterDidCommit */ adapterDidCommit: function(data) { set(this, 'isError', false); if (data) { this._data = data; } else { Ember.mixin(this._data, this._inFlightAttributes); } this._inFlightAttributes = {}; this.send('didCommit'); this.updateRecordArraysLater(); if (!data) { return; } this.suspendRelationshipObservers(function() { this.notifyPropertyChange('data'); }); }, adapterDidDirty: function() { this.send('becomeDirty'); this.updateRecordArraysLater(); }, dataDidChange: Ember.observer(function() { this.reloadHasManys(); }, 'data'), reloadHasManys: function() { var relationships = get(this.constructor, 'relationshipsByName'); this.updateRecordArraysLater(); relationships.forEach(function(name, relationship) { if (relationship.kind === 'hasMany') { this.hasManyDidChange(relationship.key); } }, this); }, hasManyDidChange: function(key) { var hasMany = this._relationships[key]; if (hasMany) { var type = get(this.constructor, 'relationshipsByName').get(key).type; var store = get(this, 'store'); var records = this._data[key] || []; set(hasMany, 'content', Ember.A(records)); set(hasMany, 'isLoaded', true); hasMany.trigger('didLoad'); } }, updateRecordArraysLater: function() { Ember.run.once(this, this.updateRecordArrays); }, setupData: function(data) { this._data = data; if (data) { this.pushedData(); } this.suspendRelationshipObservers(function() { this.notifyPropertyChange('data'); }); }, materializeId: function(id) { set(this, 'id', id); }, materializeAttributes: function(attributes) { Ember.assert("Must pass a hash of attributes to materializeAttributes", !!attributes); merge(this._data, attributes); }, materializeAttribute: function(name, value) { this._data[name] = value; }, updateHasMany: function(name, records) { this._data[name] = records; this.hasManyDidChange(name); }, rollback: function() { this._setup(); this.send('becameClean'); this.suspendRelationshipObservers(function() { this.notifyPropertyChange('data'); }); }, toStringExtension: function() { return get(this, 'id'); }, /** The goal of this method is to temporarily disable specific observers that take action in response to application changes. This allows the system to make changes (such as materialization and rollback) that should not trigger secondary behavior (such as setting an inverse relationship or marking records as dirty). The specific implementation will likely change as Ember proper provides better infrastructure for suspending groups of observers, and if Array observation becomes more unified with regular observers. @method suspendRelationshipObservers @private @param callback @param binding */ suspendRelationshipObservers: function(callback, binding) { var observers = get(this.constructor, 'relationshipNames').belongsTo; var self = this; try { this._suspendedRelationships = true; Ember._suspendObservers(self, observers, null, 'belongsToDidChange', function() { Ember._suspendBeforeObservers(self, observers, null, 'belongsToWillChange', function() { callback.call(binding || self); }); }); } finally { this._suspendedRelationships = false; } }, /** Save the record. @method save */ save: function() { var resolver = Ember.RSVP.defer(), record = this; this.get('store').scheduleSave(this, resolver); this._inFlightAttributes = this._attributes; this._attributes = {}; return DS.PromiseObject.create({ promise: resolver.promise }); }, /** Reload the record from the adapter. This will only work if the record has already finished loading and has not yet been modified (`isLoaded` but not `isDirty`, or `isSaving`). @method reload */ reload: function() { set(this, 'isReloading', true); var resolver = Ember.RSVP.defer(), record = this; resolver.promise = resolver.promise.then(function() { record.set('isReloading', false); record.set('isError', false); return record; }, function(reason) { record.set('isError', true); throw reason; }); this.send('reloadRecord', resolver); return DS.PromiseObject.create({ promise: resolver.promise }); }, // FOR USE DURING COMMIT PROCESS adapterDidUpdateAttribute: function(attributeName, value) { // If a value is passed in, update the internal attributes and clear // the attribute cache so it picks up the new value. Otherwise, // collapse the current value into the internal attributes because // the adapter has acknowledged it. if (value !== undefined) { this._data[attributeName] = value; this.notifyPropertyChange(attributeName); } else { this._data[attributeName] = this._inFlightAttributes[attributeName]; } this.updateRecordArraysLater(); }, adapterDidInvalidate: function(errors) { this.send('becameInvalid', errors); }, adapterDidError: function() { this.send('becameError'); set(this, 'isError', true); }, /** Override the default event firing from Ember.Evented to also call methods with the given name. @method trigger @private @param name */ trigger: function(name) { Ember.tryInvoke(this, name, [].slice.call(arguments, 1)); this._super.apply(this, arguments); }, triggerLater: function() { this._deferredTriggers.push(arguments); once(this, '_triggerDeferredTriggers'); }, _triggerDeferredTriggers: function() { for (var i=0, l=this._deferredTriggers.length; i<l; i++) { this.trigger.apply(this, this._deferredTriggers[i]); } this._deferredTriggers = []; } }); DS.Model.reopenClass({ /** Alias DS.Model's `create` method to `_create`. This allows us to create DS.Model instances from within the store, but if end users accidentally call `create()` (instead of `createRecord()`), we can raise an error. @method _create @private @static */ _create: DS.Model.create, /** Override the class' `create()` method to raise an error. This prevents end users from inadvertently calling `create()` instead of `createRecord()`. The store is still able to create instances by calling the `_create()` method. @method create @private @static */ create: function() { throw new Ember.Error("You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set."); } }); })(); (function() { /** @module ember-data */ var get = Ember.get; /** @class Model @namespace DS */ DS.Model.reopenClass({ attributes: Ember.computed(function() { var map = Ember.Map.create(); this.eachComputedProperty(function(name, meta) { if (meta.isAttribute) { Ember.assert("You may not set `id` as an attribute on your model. Please remove any lines that look like: `id: DS.attr('<type>')` from " + this.toString(), name !== 'id'); meta.name = name; map.set(name, meta); } }); return map; }), transformedAttributes: Ember.computed(function() { var map = Ember.Map.create(); this.eachAttribute(function(key, meta) { if (meta.type) { map.set(key, meta.type); } }); return map; }), eachAttribute: function(callback, binding) { get(this, 'attributes').forEach(function(name, meta) { callback.call(binding, name, meta); }, binding); }, eachTransformedAttribute: function(callback, binding) { get(this, 'transformedAttributes').forEach(function(name, type) { callback.call(binding, name, type); }); } }); DS.Model.reopen({ eachAttribute: function(callback, binding) { this.constructor.eachAttribute(callback, binding); } }); function getAttr(record, options, key) { var attributes = get(record, 'data'); var value = attributes[key]; if (value === undefined) { if (typeof options.defaultValue === "function") { value = options.defaultValue(); } else { value = options.defaultValue; } } return value; } DS.attr = function(type, options) { options = options || {}; var meta = { type: type, isAttribute: true, options: options }; return Ember.computed(function(key, value, oldValue) { if (arguments.length > 1) { Ember.assert("You may not set `id` as an attribute on your model. Please remove any lines that look like: `id: DS.attr('<type>')` from " + this.constructor.toString(), key !== 'id'); this.send('didSetProperty', { name: key, oldValue: this._attributes[key] || this._inFlightAttributes[key] || this._data[key], value: value }); this._attributes[key] = value; } else if (this._attributes[key]) { return this._attributes[key]; } else { value = getAttr(this, options, key); } return value; // `data` is never set directly. However, it may be // invalidated from the state manager's setData // event. }).property('data').meta(meta); }; })(); (function() { /** @module ember-data */ })(); (function() { /** @module ember-data */ /** An AttributeChange object is created whenever a record's attribute changes value. It is used to track changes to a record between transaction commits. @class AttributeChange @namespace DS @private @constructor */ var AttributeChange = DS.AttributeChange = function(options) { this.record = options.record; this.store = options.store; this.name = options.name; this.value = options.value; this.oldValue = options.oldValue; }; AttributeChange.createChange = function(options) { return new AttributeChange(options); }; AttributeChange.prototype = { sync: function() { if (this.value !== this.oldValue) { this.record.send('becomeDirty'); this.record.updateRecordArraysLater(); } // TODO: Use this object in the commit process this.destroy(); }, /** If the AttributeChange is destroyed (either by being rolled back or being committed), remove it from the list of pending changes on the record. @method destroy */ destroy: function() { delete this.record._changesToSync[this.name]; } }; })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set; var forEach = Ember.EnumerableUtils.forEach; /** @class RelationshipChange @namespace DS @private @construtor */ DS.RelationshipChange = function(options) { this.parentRecord = options.parentRecord; this.childRecord = options.childRecord; this.firstRecord = options.firstRecord; this.firstRecordKind = options.firstRecordKind; this.firstRecordName = options.firstRecordName; this.secondRecord = options.secondRecord; this.secondRecordKind = options.secondRecordKind; this.secondRecordName = options.secondRecordName; this.changeType = options.changeType; this.store = options.store; this.committed = {}; }; /** @class RelationshipChangeAdd @namespace DS @private @construtor */ DS.RelationshipChangeAdd = function(options){ DS.RelationshipChange.call(this, options); }; /** @class RelationshipChangeRemove @namespace DS @private @construtor */ DS.RelationshipChangeRemove = function(options){ DS.RelationshipChange.call(this, options); }; DS.RelationshipChange.create = function(options) { return new DS.RelationshipChange(options); }; DS.RelationshipChangeAdd.create = function(options) { return new DS.RelationshipChangeAdd(options); }; DS.RelationshipChangeRemove.create = function(options) { return new DS.RelationshipChangeRemove(options); }; DS.OneToManyChange = {}; DS.OneToNoneChange = {}; DS.ManyToNoneChange = {}; DS.OneToOneChange = {}; DS.ManyToManyChange = {}; DS.RelationshipChange._createChange = function(options){ if(options.changeType === "add"){ return DS.RelationshipChangeAdd.create(options); } if(options.changeType === "remove"){ return DS.RelationshipChangeRemove.create(options); } }; DS.RelationshipChange.determineRelationshipType = function(recordType, knownSide){ var knownKey = knownSide.key, key, otherKind; var knownKind = knownSide.kind; var inverse = recordType.inverseFor(knownKey); if (inverse){ key = inverse.name; otherKind = inverse.kind; } if (!inverse){ return knownKind === "belongsTo" ? "oneToNone" : "manyToNone"; } else{ if(otherKind === "belongsTo"){ return knownKind === "belongsTo" ? "oneToOne" : "manyToOne"; } else{ return knownKind === "belongsTo" ? "oneToMany" : "manyToMany"; } } }; DS.RelationshipChange.createChange = function(firstRecord, secondRecord, store, options){ // Get the type of the child based on the child's client ID var firstRecordType = firstRecord.constructor, changeType; changeType = DS.RelationshipChange.determineRelationshipType(firstRecordType, options); if (changeType === "oneToMany"){ return DS.OneToManyChange.createChange(firstRecord, secondRecord, store, options); } else if (changeType === "manyToOne"){ return DS.OneToManyChange.createChange(secondRecord, firstRecord, store, options); } else if (changeType === "oneToNone"){ return DS.OneToNoneChange.createChange(firstRecord, secondRecord, store, options); } else if (changeType === "manyToNone"){ return DS.ManyToNoneChange.createChange(firstRecord, secondRecord, store, options); } else if (changeType === "oneToOne"){ return DS.OneToOneChange.createChange(firstRecord, secondRecord, store, options); } else if (changeType === "manyToMany"){ return DS.ManyToManyChange.createChange(firstRecord, secondRecord, store, options); } }; DS.OneToNoneChange.createChange = function(childRecord, parentRecord, store, options) { var key = options.key; var change = DS.RelationshipChange._createChange({ parentRecord: parentRecord, childRecord: childRecord, firstRecord: childRecord, store: store, changeType: options.changeType, firstRecordName: key, firstRecordKind: "belongsTo" }); store.addRelationshipChangeFor(childRecord, key, parentRecord, null, change); return change; }; DS.ManyToNoneChange.createChange = function(childRecord, parentRecord, store, options) { var key = options.key; var change = DS.RelationshipChange._createChange({ parentRecord: childRecord, childRecord: parentRecord, secondRecord: childRecord, store: store, changeType: options.changeType, secondRecordName: options.key, secondRecordKind: "hasMany" }); store.addRelationshipChangeFor(childRecord, key, parentRecord, null, change); return change; }; DS.ManyToManyChange.createChange = function(childRecord, parentRecord, store, options) { // If the name of the belongsTo side of the relationship is specified, // use that // If the type of the parent is specified, look it up on the child's type // definition. var key = options.key; var change = DS.RelationshipChange._createChange({ parentRecord: parentRecord, childRecord: childRecord, firstRecord: childRecord, secondRecord: parentRecord, firstRecordKind: "hasMany", secondRecordKind: "hasMany", store: store, changeType: options.changeType, firstRecordName: key }); store.addRelationshipChangeFor(childRecord, key, parentRecord, null, change); return change; }; DS.OneToOneChange.createChange = function(childRecord, parentRecord, store, options) { var key; // If the name of the belongsTo side of the relationship is specified, // use that // If the type of the parent is specified, look it up on the child's type // definition. if (options.parentType) { key = options.parentType.inverseFor(options.key).name; } else if (options.key) { key = options.key; } else { Ember.assert("You must pass either a parentType or belongsToName option to OneToManyChange.forChildAndParent", false); } var change = DS.RelationshipChange._createChange({ parentRecord: parentRecord, childRecord: childRecord, firstRecord: childRecord, secondRecord: parentRecord, firstRecordKind: "belongsTo", secondRecordKind: "belongsTo", store: store, changeType: options.changeType, firstRecordName: key }); store.addRelationshipChangeFor(childRecord, key, parentRecord, null, change); return change; }; DS.OneToOneChange.maintainInvariant = function(options, store, childRecord, key){ if (options.changeType === "add" && store.recordIsMaterialized(childRecord)) { var oldParent = get(childRecord, key); if (oldParent){ var correspondingChange = DS.OneToOneChange.createChange(childRecord, oldParent, store, { parentType: options.parentType, hasManyName: options.hasManyName, changeType: "remove", key: options.key }); store.addRelationshipChangeFor(childRecord, key, options.parentRecord , null, correspondingChange); correspondingChange.sync(); } } }; DS.OneToManyChange.createChange = function(childRecord, parentRecord, store, options) { var key; // If the name of the belongsTo side of the relationship is specified, // use that // If the type of the parent is specified, look it up on the child's type // definition. if (options.parentType) { key = options.parentType.inverseFor(options.key).name; DS.OneToManyChange.maintainInvariant( options, store, childRecord, key ); } else if (options.key) { key = options.key; } else { Ember.assert("You must pass either a parentType or belongsToName option to OneToManyChange.forChildAndParent", false); } var change = DS.RelationshipChange._createChange({ parentRecord: parentRecord, childRecord: childRecord, firstRecord: childRecord, secondRecord: parentRecord, firstRecordKind: "belongsTo", secondRecordKind: "hasMany", store: store, changeType: options.changeType, firstRecordName: key }); store.addRelationshipChangeFor(childRecord, key, parentRecord, change.getSecondRecordName(), change); return change; }; DS.OneToManyChange.maintainInvariant = function(options, store, childRecord, key){ if (options.changeType === "add" && childRecord) { var oldParent = get(childRecord, key); if (oldParent){ var correspondingChange = DS.OneToManyChange.createChange(childRecord, oldParent, store, { parentType: options.parentType, hasManyName: options.hasManyName, changeType: "remove", key: options.key }); store.addRelationshipChangeFor(childRecord, key, options.parentRecord, correspondingChange.getSecondRecordName(), correspondingChange); correspondingChange.sync(); } } }; /** @class RelationshipChange @namespace DS */ DS.RelationshipChange.prototype = { getSecondRecordName: function() { var name = this.secondRecordName, parent; if (!name) { parent = this.secondRecord; if (!parent) { return; } var childType = this.firstRecord.constructor; var inverse = childType.inverseFor(this.firstRecordName); this.secondRecordName = inverse.name; } return this.secondRecordName; }, /** Get the name of the relationship on the belongsTo side. @method getFirstRecordName @return {String} */ getFirstRecordName: function() { var name = this.firstRecordName; return name; }, /** @method destroy @private */ destroy: function() { var childRecord = this.childRecord, belongsToName = this.getFirstRecordName(), hasManyName = this.getSecondRecordName(), store = this.store; store.removeRelationshipChangeFor(childRecord, belongsToName, this.parentRecord, hasManyName, this.changeType); }, getSecondRecord: function(){ return this.secondRecord; }, /** @method getFirstRecord @private */ getFirstRecord: function() { return this.firstRecord; }, coalesce: function(){ var relationshipPairs = this.store.relationshipChangePairsFor(this.firstRecord); forEach(relationshipPairs, function(pair){ var addedChange = pair["add"]; var removedChange = pair["remove"]; if(addedChange && removedChange) { addedChange.destroy(); removedChange.destroy(); } }); } }; DS.RelationshipChangeAdd.prototype = Ember.create(DS.RelationshipChange.create({})); DS.RelationshipChangeRemove.prototype = Ember.create(DS.RelationshipChange.create({})); // the object is a value, and not a promise function isValue(object) { return typeof object === 'object' && (!object.then || typeof object.then !== 'function'); } DS.RelationshipChangeAdd.prototype.changeType = "add"; DS.RelationshipChangeAdd.prototype.sync = function() { var secondRecordName = this.getSecondRecordName(), firstRecordName = this.getFirstRecordName(), firstRecord = this.getFirstRecord(), secondRecord = this.getSecondRecord(); //Ember.assert("You specified a hasMany (" + hasManyName + ") on " + (!belongsToName && (newParent || oldParent || this.lastParent).constructor) + " but did not specify an inverse belongsTo on " + child.constructor, belongsToName); //Ember.assert("You specified a belongsTo (" + belongsToName + ") on " + child.constructor + " but did not specify an inverse hasMany on " + (!hasManyName && (newParent || oldParent || this.lastParentRecord).constructor), hasManyName); if (secondRecord instanceof DS.Model && firstRecord instanceof DS.Model) { if(this.secondRecordKind === "belongsTo"){ secondRecord.suspendRelationshipObservers(function(){ set(secondRecord, secondRecordName, firstRecord); }); } else if(this.secondRecordKind === "hasMany"){ secondRecord.suspendRelationshipObservers(function(){ var relationship = get(secondRecord, secondRecordName); if (isValue(relationship)) { relationship.addObject(firstRecord); } }); } } if (firstRecord instanceof DS.Model && secondRecord instanceof DS.Model && get(firstRecord, firstRecordName) !== secondRecord) { if(this.firstRecordKind === "belongsTo"){ firstRecord.suspendRelationshipObservers(function(){ set(firstRecord, firstRecordName, secondRecord); }); } else if(this.firstRecordKind === "hasMany"){ firstRecord.suspendRelationshipObservers(function(){ var relationship = get(firstRecord, firstRecordName); if (isValue(relationship)) { relationship.addObject(secondRecord); } }); } } this.coalesce(); }; DS.RelationshipChangeRemove.prototype.changeType = "remove"; DS.RelationshipChangeRemove.prototype.sync = function() { var secondRecordName = this.getSecondRecordName(), firstRecordName = this.getFirstRecordName(), firstRecord = this.getFirstRecord(), secondRecord = this.getSecondRecord(); //Ember.assert("You specified a hasMany (" + hasManyName + ") on " + (!belongsToName && (newParent || oldParent || this.lastParent).constructor) + " but did not specify an inverse belongsTo on " + child.constructor, belongsToName); //Ember.assert("You specified a belongsTo (" + belongsToName + ") on " + child.constructor + " but did not specify an inverse hasMany on " + (!hasManyName && (newParent || oldParent || this.lastParentRecord).constructor), hasManyName); if (secondRecord instanceof DS.Model && firstRecord instanceof DS.Model) { if(this.secondRecordKind === "belongsTo"){ secondRecord.suspendRelationshipObservers(function(){ set(secondRecord, secondRecordName, null); }); } else if(this.secondRecordKind === "hasMany"){ secondRecord.suspendRelationshipObservers(function(){ var relationship = get(secondRecord, secondRecordName); if (isValue(relationship)) { relationship.removeObject(firstRecord); } }); } } if (firstRecord instanceof DS.Model && get(firstRecord, firstRecordName)) { if(this.firstRecordKind === "belongsTo"){ firstRecord.suspendRelationshipObservers(function(){ set(firstRecord, firstRecordName, null); }); } else if(this.firstRecordKind === "hasMany"){ firstRecord.suspendRelationshipObservers(function(){ var relationship = get(firstRecord, firstRecordName); if (isValue(relationship)) { relationship.removeObject(secondRecord); } }); } } this.coalesce(); }; })(); (function() { /** @module ember-data */ })(); (function() { var get = Ember.get, set = Ember.set, isNone = Ember.isNone; /** @module ember-data */ function asyncBelongsTo(type, options, meta) { return Ember.computed(function(key, value) { var data = get(this, 'data'), store = get(this, 'store'); if (arguments.length === 2) { Ember.assert("You can only add a '" + type + "' record to this relationship", !value || store.modelFor(type).detectInstance(value)); return value === undefined ? null : value; } return store.fetchRecord(data[key]); }).property('data').meta(meta); } DS.belongsTo = function(type, options) { Ember.assert("The first argument DS.belongsTo must be a model type or string, like DS.belongsTo(App.Person)", !!type && (typeof type === 'string' || DS.Model.detect(type))); options = options || {}; var meta = { type: type, isRelationship: true, options: options, kind: 'belongsTo' }; if (options.async) { return asyncBelongsTo(type, options, meta); } return Ember.computed(function(key, value) { var data = get(this, 'data'), store = get(this, 'store'), belongsTo, typeClass; if (typeof type === 'string') { if (type.indexOf(".") === -1) { typeClass = store.modelFor(type); } else { typeClass = get(Ember.lookup, type); } } else { typeClass = type; } if (arguments.length === 2) { Ember.assert("You can only add a '" + type + "' record to this relationship", !value || typeClass.detectInstance(value)); return value === undefined ? null : value; } belongsTo = data[key]; if (isNone(belongsTo)) { return null; } if (get(belongsTo, 'isEmpty')) { store.fetchRecord(belongsTo); } return belongsTo; }).property('data').meta(meta); }; /* These observers observe all `belongsTo` relationships on the record. See `relationships/ext` to see how these observers get their dependencies. @class Model @namespace DS */ DS.Model.reopen({ /** @method belongsToWillChange @private @static @param record @param key */ belongsToWillChange: Ember.beforeObserver(function(record, key) { if (get(record, 'isLoaded')) { var oldParent = get(record, key), store = get(record, 'store'); if (oldParent){ var change = DS.RelationshipChange.createChange(record, oldParent, store, { key: key, kind: "belongsTo", changeType: "remove" }); change.sync(); this._changesToSync[key] = change; } } }), /** @method belongsToDidChange @private @static @param record @param key */ belongsToDidChange: Ember.immediateObserver(function(record, key) { if (get(record, 'isLoaded')) { var newParent = get(record, key); if(newParent){ var store = get(record, 'store'), change = DS.RelationshipChange.createChange(record, newParent, store, { key: key, kind: "belongsTo", changeType: "add" }); change.sync(); } } delete this._changesToSync[key]; }) }); })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set, setProperties = Ember.setProperties; var forEach = Ember.EnumerableUtils.forEach; function asyncHasMany(type, options, meta) { return Ember.computed(function(key, value) { var resolver = Ember.RSVP.defer(); var relationship = buildRelationship(this, key, options, function(store, data) { var link = data.links && data.links[key]; if (link) { return store.findHasMany(this, link, meta, resolver); } else { return store.findMany(this, data[key], meta.type, resolver); } }); var promise = resolver.promise.then(function() { return relationship; }); return DS.PromiseArray.create({ promise: promise }); }).property('data').meta(meta); } function buildRelationship(record, key, options, callback) { var rels = record._relationships; if (rels[key]) { return rels[key]; } var data = get(record, 'data'), store = get(record, 'store'); var relationship = rels[key] = callback.call(record, store, data); return setProperties(relationship, { owner: record, name: key, isPolymorphic: options.polymorphic }); } function hasRelationship(type, options) { options = options || {}; var meta = { type: type, isRelationship: true, options: options, kind: 'hasMany' }; if (options.async) { return asyncHasMany(type, options, meta); } return Ember.computed(function(key, value) { return buildRelationship(this, key, options, function(store, data) { var records = data[key]; Ember.assert("You looked up the '" + key + "' relationship on '" + this + "' but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async (`DS.attr({ async: true })`)", Ember.A(records).everyProperty('isEmpty', false)); return store.findMany(this, data[key], meta.type); }); }).property('data').meta(meta); } DS.hasMany = function(type, options) { Ember.assert("The type passed to DS.hasMany must be defined", !!type); return hasRelationship(type, options); }; })(); (function() { var get = Ember.get, set = Ember.set; /** @module ember-data */ /* This file defines several extensions to the base `DS.Model` class that add support for one-to-many relationships. */ /** @class Model @namespace DS */ DS.Model.reopen({ /** This Ember.js hook allows an object to be notified when a property is defined. In this case, we use it to be notified when an Ember Data user defines a belongs-to relationship. In that case, we need to set up observers for each one, allowing us to track relationship changes and automatically reflect changes in the inverse has-many array. This hook passes the class being set up, as well as the key and value being defined. So, for example, when the user does this: DS.Model.extend({ parent: DS.belongsTo(App.User) }); This hook would be called with "parent" as the key and the computed property returned by `DS.belongsTo` as the value. @method didDefineProperty @param proto @param key @param value */ didDefineProperty: function(proto, key, value) { // Check if the value being set is a computed property. if (value instanceof Ember.Descriptor) { // If it is, get the metadata for the relationship. This is // populated by the `DS.belongsTo` helper when it is creating // the computed property. var meta = value.meta(); if (meta.isRelationship && meta.kind === 'belongsTo') { Ember.addObserver(proto, key, null, 'belongsToDidChange'); Ember.addBeforeObserver(proto, key, null, 'belongsToWillChange'); } meta.parentType = proto.constructor; } } }); /* These DS.Model extensions add class methods that provide relationship introspection abilities about relationships. A note about the computed properties contained here: **These properties are effectively sealed once called for the first time.** To avoid repeatedly doing expensive iteration over a model's fields, these values are computed once and then cached for the remainder of the runtime of your application. If your application needs to modify a class after its initial definition (for example, using `reopen()` to add additional attributes), make sure you do it before using your model with the store, which uses these properties extensively. */ DS.Model.reopenClass({ /** For a given relationship name, returns the model type of the relationship. For example, if you define a model like this: App.Post = DS.Model.extend({ comments: DS.hasMany(App.Comment) }); Calling `App.Post.typeForRelationship('comments')` will return `App.Comment`. @method typeForRelationship @static @param {String} name the name of the relationship @return {subclass of DS.Model} the type of the relationship, or undefined */ typeForRelationship: function(name) { var relationship = get(this, 'relationshipsByName').get(name); return relationship && relationship.type; }, inverseFor: function(name) { var inverseType = this.typeForRelationship(name); if (!inverseType) { return null; } var options = this.metaForProperty(name).options; if (options.inverse === null) { return null; } var inverseName, inverseKind; if (options.inverse) { inverseName = options.inverse; inverseKind = Ember.get(inverseType, 'relationshipsByName').get(inverseName).kind; } else { var possibleRelationships = findPossibleInverses(this, inverseType); if (possibleRelationships.length === 0) { return null; } Ember.assert("You defined the '" + name + "' relationship on " + this + ", but multiple possible inverse relationships of type " + this + " were found on " + inverseType + ".", possibleRelationships.length === 1); inverseName = possibleRelationships[0].name; inverseKind = possibleRelationships[0].kind; } function findPossibleInverses(type, inverseType, possibleRelationships) { possibleRelationships = possibleRelationships || []; var relationshipMap = get(inverseType, 'relationships'); if (!relationshipMap) { return; } var relationships = relationshipMap.get(type); if (relationships) { possibleRelationships.push.apply(possibleRelationships, relationshipMap.get(type)); } if (type.superclass) { findPossibleInverses(type.superclass, inverseType, possibleRelationships); } return possibleRelationships; } return { type: inverseType, name: inverseName, kind: inverseKind }; }, /** The model's relationships as a map, keyed on the type of the relationship. The value of each entry is an array containing a descriptor for each relationship with that type, describing the name of the relationship as well as the type. For example, given the following model definition: App.Blog = DS.Model.extend({ users: DS.hasMany(App.User), owner: DS.belongsTo(App.User), posts: DS.hasMany(App.Post) }); This computed property would return a map describing these relationships, like this: var relationships = Ember.get(App.Blog, 'relationships'); relationships.get(App.User); //=> [ { name: 'users', kind: 'hasMany' }, // { name: 'owner', kind: 'belongsTo' } ] relationships.get(App.Post); //=> [ { name: 'posts', kind: 'hasMany' } ] @property relationships @static @type Ember.Map @readOnly */ relationships: Ember.computed(function() { var map = new Ember.MapWithDefault({ defaultValue: function() { return []; } }); // Loop through each computed property on the class this.eachComputedProperty(function(name, meta) { // If the computed property is a relationship, add // it to the map. if (meta.isRelationship) { if (typeof meta.type === 'string') { meta.type = Ember.get(Ember.lookup, meta.type); } var relationshipsForType = map.get(meta.type); relationshipsForType.push({ name: name, kind: meta.kind }); } }); return map; }), /** A hash containing lists of the model's relationships, grouped by the relationship kind. For example, given a model with this definition: App.Blog = DS.Model.extend({ users: DS.hasMany(App.User), owner: DS.belongsTo(App.User), posts: DS.hasMany(App.Post) }); This property would contain the following: var relationshipNames = Ember.get(App.Blog, 'relationshipNames'); relationshipNames.hasMany; //=> ['users', 'posts'] relationshipNames.belongsTo; //=> ['owner'] @property relationshipNames @static @type Object @readOnly */ relationshipNames: Ember.computed(function() { var names = { hasMany: [], belongsTo: [] }; this.eachComputedProperty(function(name, meta) { if (meta.isRelationship) { names[meta.kind].push(name); } }); return names; }), /** An array of types directly related to a model. Each type will be included once, regardless of the number of relationships it has with the model. For example, given a model with this definition: App.Blog = DS.Model.extend({ users: DS.hasMany(App.User), owner: DS.belongsTo(App.User), posts: DS.hasMany(App.Post) }); This property would contain the following: var relatedTypes = Ember.get(App.Blog, 'relatedTypes'); //=> [ App.User, App.Post ] @property relatedTypes @static @type Ember.Array @readOnly */ relatedTypes: Ember.computed(function() { var type, types = Ember.A(); // Loop through each computed property on the class, // and create an array of the unique types involved // in relationships this.eachComputedProperty(function(name, meta) { if (meta.isRelationship) { type = meta.type; if (typeof type === 'string') { type = get(this, type, false) || get(Ember.lookup, type); } Ember.assert("You specified a hasMany (" + meta.type + ") on " + meta.parentType + " but " + meta.type + " was not found.", type); if (!types.contains(type)) { Ember.assert("Trying to sideload " + name + " on " + this.toString() + " but the type doesn't exist.", !!type); types.push(type); } } }); return types; }), /** A map whose keys are the relationships of a model and whose values are relationship descriptors. For example, given a model with this definition: App.Blog = DS.Model.extend({ users: DS.hasMany(App.User), owner: DS.belongsTo(App.User), posts: DS.hasMany(App.Post) }); This property would contain the following: var relationshipsByName = Ember.get(App.Blog, 'relationshipsByName'); relationshipsByName.get('users'); //=> { key: 'users', kind: 'hasMany', type: App.User } relationshipsByName.get('owner'); //=> { key: 'owner', kind: 'belongsTo', type: App.User } @property relationshipsByName @static @type Ember.Map @readOnly */ relationshipsByName: Ember.computed(function() { var map = Ember.Map.create(), type; this.eachComputedProperty(function(name, meta) { if (meta.isRelationship) { meta.key = name; type = meta.type; if (typeof type === 'string') { meta.type = this.store.modelFor(type); } map.set(name, meta); } }); return map; }), /** A map whose keys are the fields of the model and whose values are strings describing the kind of the field. A model's fields are the union of all of its attributes and relationships. For example: App.Blog = DS.Model.extend({ users: DS.hasMany(App.User), owner: DS.belongsTo(App.User), posts: DS.hasMany(App.Post), title: DS.attr('string') }); var fields = Ember.get(App.Blog, 'fields'); fields.forEach(function(field, kind) { console.log(field, kind); }); // prints: // users, hasMany // owner, belongsTo // posts, hasMany // title, attribute @property fields @static @type Ember.Map @readOnly */ fields: Ember.computed(function() { var map = Ember.Map.create(); this.eachComputedProperty(function(name, meta) { if (meta.isRelationship) { map.set(name, meta.kind); } else if (meta.isAttribute) { map.set(name, 'attribute'); } }); return map; }), /** Given a callback, iterates over each of the relationships in the model, invoking the callback with the name of each relationship and its relationship descriptor. @method eachRelationship @static @param {Function} callback the callback to invoke @param {any} binding the value to which the callback's `this` should be bound */ eachRelationship: function(callback, binding) { get(this, 'relationshipsByName').forEach(function(name, relationship) { callback.call(binding, name, relationship); }); }, /** Given a callback, iterates over each of the types related to a model, invoking the callback with the related type's class. Each type will be returned just once, regardless of how many different relationships it has with a model. @method eachRelatedType @static @param {Function} callback the callback to invoke @param {any} binding the value to which the callback's `this` should be bound */ eachRelatedType: function(callback, binding) { get(this, 'relatedTypes').forEach(function(type) { callback.call(binding, type); }); } }); DS.Model.reopen({ /** Given a callback, iterates over each of the relationships in the model, invoking the callback with the name of each relationship and its relationship descriptor. @method eachRelationship @param {Function} callback the callback to invoke @param {any} binding the value to which the callback's `this` should be bound */ eachRelationship: function(callback, binding) { this.constructor.eachRelationship(callback, binding); } }); })(); (function() { /** @module ember-data */ })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set; var once = Ember.run.once; var forEach = Ember.EnumerableUtils.forEach; /** @class RecordArrayManager @namespace DS @private @extends Ember.Object */ DS.RecordArrayManager = Ember.Object.extend({ init: function() { this.filteredRecordArrays = Ember.MapWithDefault.create({ defaultValue: function() { return []; } }); this.changedRecords = []; }, recordDidChange: function(record) { this.changedRecords.push(record); once(this, this.updateRecordArrays); }, recordArraysForRecord: function(record) { record._recordArrays = record._recordArrays || Ember.OrderedSet.create(); return record._recordArrays; }, /** This method is invoked whenever data is loaded into the store by the adapter or updated by the adapter, or when an attribute changes on a record. It updates all filters that a record belongs to. To avoid thrashing, it only runs once per run loop per record. @method updateRecordArrays @param {Class} type @param {Number|String} clientId */ updateRecordArrays: function() { forEach(this.changedRecords, function(record) { var type = record.constructor, recordArrays = this.filteredRecordArrays.get(type), filter; forEach(recordArrays, function(array) { filter = get(array, 'filterFunction'); this.updateRecordArray(array, filter, type, record); }, this); // loop through all manyArrays containing an unloaded copy of this // clientId and notify them that the record was loaded. var manyArrays = record._loadingRecordArrays; if (manyArrays) { for (var i=0, l=manyArrays.length; i<l; i++) { manyArrays[i].loadedRecord(); } record._loadingRecordArrays = []; } }, this); this.changedRecords = []; }, /** Update an individual filter. @method updateRecordArray @param {DS.FilteredRecordArray} array @param {Function} filter @param {Class} type @param {Number|String} clientId */ updateRecordArray: function(array, filter, type, record) { var shouldBeInArray; if (!filter) { shouldBeInArray = true; } else { shouldBeInArray = filter(record); } var recordArrays = this.recordArraysForRecord(record); if (shouldBeInArray) { recordArrays.add(array); array.addRecord(record); } else if (!shouldBeInArray) { recordArrays.remove(array); array.removeRecord(record); } }, /** When a record is deleted, it is removed from all its record arrays. @method remove @param {DS.Model} record */ remove: function(record) { var recordArrays = record._recordArrays; if (!recordArrays) { return; } forEach(recordArrays, function(array) { array.removeRecord(record); }); }, /** This method is invoked if the `filterFunction` property is changed on a `DS.FilteredRecordArray`. It essentially re-runs the filter from scratch. This same method is invoked when the filter is created in th first place. @method updateFilter @param array @param type @param filter */ updateFilter: function(array, type, filter) { var typeMap = this.store.typeMapFor(type), records = typeMap.records, record; for (var i=0, l=records.length; i<l; i++) { record = records[i]; if (!get(record, 'isDeleted') && !get(record, 'isEmpty')) { this.updateRecordArray(array, filter, type, record); } } }, /** Create a `DS.ManyArray` for a type and list of record references, and index the `ManyArray` under each reference. This allows us to efficiently remove records from `ManyArray`s when they are deleted. @method createManyArray @param {Class} type @param {Array} references @return {DS.ManyArray} */ createManyArray: function(type, records) { var manyArray = DS.ManyArray.create({ type: type, content: records, store: this.store }); forEach(records, function(record) { var arrays = this.recordArraysForRecord(record); arrays.add(manyArray); }, this); return manyArray; }, /** Register a RecordArray for a given type to be backed by a filter function. This will cause the array to update automatically when records of that type change attribute values or states. @method registerFilteredRecordArray @param {DS.RecordArray} array @param {Class} type @param {Function} filter */ registerFilteredRecordArray: function(array, type, filter) { var recordArrays = this.filteredRecordArrays.get(type); recordArrays.push(array); this.updateFilter(array, type, filter); }, // Internally, we maintain a map of all unloaded IDs requested by // a ManyArray. As the adapter loads data into the store, the // store notifies any interested ManyArrays. When the ManyArray's // total number of loading records drops to zero, it becomes // `isLoaded` and fires a `didLoad` event. registerWaitingRecordArray: function(record, array) { var loadingRecordArrays = record._loadingRecordArrays || []; loadingRecordArrays.push(array); record._loadingRecordArrays = loadingRecordArrays; } }); })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set, merge = Ember.merge; var forEach = Ember.EnumerableUtils.forEach; var resolve = Ember.RSVP.resolve; var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; DS.InvalidError = function(errors) { var tmp = Error.prototype.constructor.call(this, "The backend rejected the commit because it was invalid: " + Ember.inspect(errors)); this.errors = errors; for (var i=0, l=errorProps.length; i<l; i++) { this[errorProps[i]] = tmp[errorProps[i]]; } }; DS.InvalidError.prototype = Ember.create(Error.prototype); function isThenable(object) { return object && typeof object.then === 'function'; } // Simple dispatcher to support overriding the aliased // method in subclasses. function aliasMethod(methodName) { return function() { return this[methodName].apply(this, arguments); }; } /** An adapter is an object that receives requests from a store and translates them into the appropriate action to take against your persistence layer. The persistence layer is usually an HTTP API, but may be anything, such as the browser's local storage. ### Creating an Adapter First, create a new subclass of `DS.Adapter`: App.MyAdapter = DS.Adapter.extend({ // ...your code here }); To tell your store which adapter to use, set its `adapter` property: App.store = DS.Store.create({ adapter: App.MyAdapter.create() }); `DS.Adapter` is an abstract base class that you should override in your application to customize it for your backend. The minimum set of methods that you should implement is: * `find()` * `createRecord()` * `updateRecord()` * `deleteRecord()` To improve the network performance of your application, you can optimize your adapter by overriding these lower-level methods: * `findMany()` * `createRecords()` * `updateRecords()` * `deleteRecords()` * `commit()` For an example implementation, see `DS.RestAdapter`, the included REST adapter. @class Adapter @namespace DS @extends Ember.Object @uses DS._Mappable */ DS.Adapter = Ember.Object.extend(DS._Mappable, { /** The `find()` method is invoked when the store is asked for a record that has not previously been loaded. In response to `find()` being called, you should query your persistence layer for a record with the given ID. Once found, you can asynchronously call the store's `load()` method to load the record. Here is an example `find` implementation: find: function(store, type, id) { var url = type.url; url = url.fmt(id); jQuery.getJSON(url, function(data) { // data is a hash of key/value pairs. If your server returns a // root, simply do something like: // store.load(type, id, data.person) store.load(type, id, data); }); } @method find */ find: Ember.required(Function), /** Optional @method findAll @param store @param type @param since */ findAll: null, /** Optional @method findQuery @param store @param type @param query @param recordArray */ findQuery: null, /** If the globally unique IDs for your records should be generated on the client, implement the `generateIdForRecord()` method. This method will be invoked each time you create a new record, and the value returned from it will be assigned to the record's `primaryKey`. Most traditional REST-like HTTP APIs will not use this method. Instead, the ID of the record will be set by the server, and your adapter will update the store with the new ID when it calls `didCreateRecord()`. Only implement this method if you intend to generate record IDs on the client-side. The `generateIdForRecord()` method will be invoked with the requesting store as the first parameter and the newly created record as the second parameter: generateIdForRecord: function(store, record) { var uuid = App.generateUUIDWithStatisticallyLowOddsOfCollision(); return uuid; } @method generateIdForRecord @param {DS.Store} store @param {DS.Model} record */ generateIdForRecord: null, /** Proxies to the serializer's `serialize` method. @method serialize @param {DS.Model} record @param {Object} options */ serialize: function(record, options) { return get(record, 'store').serializerFor(record.constructor.typeKey).serialize(record, options); }, /** Implement this method in a subclass to handle the creation of new records. Serializes the record and send it to the server. This implementation should call the adapter's `didCreateRecord` method on success or `didError` method on failure. @method createRecord @property {DS.Store} store @property {subclass of DS.Model} type the DS.Model class of the record @property {DS.Model} record */ createRecord: Ember.required(Function), /** Implement this method in a subclass to handle the updating of a record. Serializes the record update and send it to the server. @method updateRecord @property {DS.Store} store @property {subclass of DS.Model} type the DS.Model class of the record @property {DS.Model} record */ updateRecord: Ember.required(Function), /** Implement this method in a subclass to handle the deletion of a record. Sends a delete request for the record to the server. @method deleteRecord @property {DS.Store} store @property {subclass of DS.Model} type the DS.Model class of the record @property {DS.Model} record */ deleteRecord: Ember.required(Function), /** Find multiple records at once. By default, it loops over the provided ids and calls `find` on each. May be overwritten to improve performance and reduce the number of server requests. @method findMany @property {DS.Store} store @property {subclass of DS.Model} type the DS.Model class of the records @property {Array} ids */ findMany: function(store, type, ids) { var promises = ids.map(function(id) { return this.find(store, type, id); }, this); return Ember.RSVP.all(promises); } }); })(); (function() { /** @module ember-data */ var get = Ember.get, fmt = Ember.String.fmt, indexOf = Ember.EnumerableUtils.indexOf; var counter = 0; /** `DS.FixtureAdapter` is an adapter that loads records from memory. Its primarily used for development and testing. You can also use `DS.FixtureAdapter` while working on the API but are not ready to integrate yet. It is a fully functioning adapter. All CRUD methods are implemented. You can also implement query logic that a remote system would do. Its possible to do develop your entire application with `DS.FixtureAdapter`. @class FixtureAdapter @namespace DS @extends DS.Adapter */ DS.FixtureAdapter = DS.Adapter.extend({ // by default, fixtures are already in normalized form serializer: null, simulateRemoteResponse: true, latency: 50, /** Implement this method in order to provide data associated with a type @method fixturesForType @param type */ fixturesForType: function(type) { if (type.FIXTURES) { var fixtures = Ember.A(type.FIXTURES); return fixtures.map(function(fixture){ var fixtureIdType = typeof fixture.id; if(fixtureIdType !== "number" && fixtureIdType !== "string"){ throw new Error(fmt('the id property must be defined as a number or string for fixture %@', [fixture])); } fixture.id = fixture.id + ''; return fixture; }); } return null; }, /** Implement this method in order to query fixtures data @method queryFixtures @param fixture @param query @param type */ queryFixtures: function(fixtures, query, type) { Ember.assert('Not implemented: You must override the DS.FixtureAdapter::queryFixtures method to support querying the fixture store.'); }, /** @method updateFixtures @param type @param fixture */ updateFixtures: function(type, fixture) { if(!type.FIXTURES) { type.FIXTURES = []; } var fixtures = type.FIXTURES; this.deleteLoadedFixture(type, fixture); fixtures.push(fixture); }, /** Implement this method in order to provide provide json for CRUD methods @method mockJSON @param type @param record */ mockJSON: function(store, type, record) { return store.serializerFor(type).serialize(record, { includeId: true }); }, /** @method generateIdForRecord @param store @param record */ generateIdForRecord: function(store) { return counter++; }, /** @method find @param store @param type @param id */ find: function(store, type, id) { var fixtures = this.fixturesForType(type), fixture; Ember.warn("Unable to find fixtures for model type " + type.toString(), fixtures); if (fixtures) { fixture = Ember.A(fixtures).findProperty('id', id); } if (fixture) { return this.simulateRemoteCall(function() { return fixture; }, this); } }, /** @method findMany @param store @param type @param ids */ findMany: function(store, type, ids) { var fixtures = this.fixturesForType(type); Ember.assert("Unable to find fixtures for model type "+type.toString(), !!fixtures); if (fixtures) { fixtures = fixtures.filter(function(item) { return indexOf(ids, item.id) !== -1; }); } if (fixtures) { return this.simulateRemoteCall(function() { return fixtures; }, this); } }, /** @method findAll @param store @param type */ findAll: function(store, type) { var fixtures = this.fixturesForType(type); Ember.assert("Unable to find fixtures for model type "+type.toString(), !!fixtures); return this.simulateRemoteCall(function() { return fixtures; }, this); }, /** @method findQuery @param store @param type @param query @param array */ findQuery: function(store, type, query, array) { var fixtures = this.fixturesForType(type); Ember.assert("Unable to find fixtures for model type "+type.toString(), !!fixtures); fixtures = this.queryFixtures(fixtures, query, type); if (fixtures) { return this.simulateRemoteCall(function() { return fixtures; }, this); } }, /** @method createRecord @param store @param type @param record */ createRecord: function(store, type, record) { var fixture = this.mockJSON(store, type, record); this.updateFixtures(type, fixture); return this.simulateRemoteCall(function() { return fixture; }, this); }, /** @method updateRecord @param store @param type @param record */ updateRecord: function(store, type, record) { var fixture = this.mockJSON(store, type, record); this.updateFixtures(type, fixture); return this.simulateRemoteCall(function() { return fixture; }, this); }, /** @method deleteRecord @param store @param type @param record */ deleteRecord: function(store, type, record) { var fixture = this.mockJSON(store, type, record); this.deleteLoadedFixture(type, fixture); return this.simulateRemoteCall(function() { // no payload in a deletion return null; }); }, /* @method deleteLoadedFixture @private @param type @param record */ deleteLoadedFixture: function(type, record) { var existingFixture = this.findExistingFixture(type, record); if(existingFixture) { var index = indexOf(type.FIXTURES, existingFixture); type.FIXTURES.splice(index, 1); return true; } }, /* @method findExistingFixture @private @param type @param record */ findExistingFixture: function(type, record) { var fixtures = this.fixturesForType(type); var id = get(record, 'id'); return this.findFixtureById(fixtures, id); }, /* @method findFixtureById @private @param type @param record */ findFixtureById: function(fixtures, id) { return Ember.A(fixtures).find(function(r) { if(''+get(r, 'id') === ''+id) { return true; } else { return false; } }); }, /* @method simulateRemoteCall @private @param callback @param context */ simulateRemoteCall: function(callback, context) { var adapter = this; return new Ember.RSVP.Promise(function(resolve) { if (get(adapter, 'simulateRemoteResponse')) { // Schedule with setTimeout Ember.run.later(function() { resolve(callback.call(context)); }, get(adapter, 'latency')); } else { // Asynchronous, but at the of the runloop with zero latency Ember.run.once(function() { resolve(callback.call(context)); }); } }); } }); })(); (function() { /** @module ember-data */ var get = Ember.get, set = Ember.set; DS.rejectionHandler = function(reason) { Ember.Logger.assert([reason, reason.message, reason.stack]); throw reason; }; function coerceId(id) { return id == null ? null : id+''; } DS.RESTSerializer = DS.JSONSerializer.extend({ /** Normalizes a part of the JSON payload returned by the server. You should override this method, munge the hash and call super if you have generic normalization to do. It takes the type of the record that is being normalized (as a DS.Model class), the property where the hash was originally found, and the hash to normalize. For example, if you have a payload that looks like this: ```js { "post": { "id": 1, "title": "Rails is omakase", "comments": [ 1, 2 ] }, "comments": [{ "id": 1, "body": "FIRST" }, { "id": 2, "body": "Rails is unagi" }] } ``` The `normalize` method will be called three times: * With `App.Post`, `"posts"` and `{ id: 1, title: "Rails is omakase", ... }` * With `App.Comment`, `"comments"` and `{ id: 1, body: "FIRST" }` * With `App.Comment`, `"comments"` and `{ id: 2, body: "Rails is unagi" }` You can use this method, for example, to normalize underscored keys to camelized or other general-purpose normalizations. If you want to do normalizations specific to some part of the payload, you can specify those under `normalizeHash`. For example, if the `IDs` under `"comments"` are provided as `_id` instead of `id`, you can specify how to normalize just the comments: ```js App.PostSerializer = DS.RESTSerializer.extend({ normalizeHash: { comments: function(hash) { hash.id = hash._id; delete hash._id; return hash; } } }); ``` The key under `normalizeHash` is just the original key that was in the original payload. @method normalize @param {subclass of DS.Model} type @param {String} prop @param {Object} hash @returns Object */ normalize: function(type, prop, hash) { this.normalizeId(hash); this.normalizeAttributes(hash); if (this.normalizeHash && this.normalizeHash[prop]) { return this.normalizeHash[prop](hash); } return hash; }, /** @method normalizeId @private */ normalizeId: function(hash) { var primaryKey = get(this, 'primaryKey'); if (primaryKey === 'id') { return; } hash.id = hash[primaryKey]; delete hash[primaryKey]; }, /** @method normalizeAttributes @private */ normalizeAttributes: function(hash) { var attrs = get(this, 'attrs'); if (!attrs) { return; } for (var key in attrs) { var payloadKey = attrs[key]; hash[key] = hash[payloadKey]; delete hash[payloadKey]; } }, /** Called when the server has returned a payload representing a single record, such as in response to a `find` or `save`. It is your opportunity to clean up the server's response into the normalized form expected by Ember Data. If you want, you can just restructure the top-level of your payload, and do more fine-grained normalization in the `normalize` method. For example, if you have a payload like this in response to a request for post 1: ```js { "id": 1, "title": "Rails is omakase", "_embedded": { "comment": [{ "_id": 1, "comment_title": "FIRST" }, { "_id": 2, "comment_title": "Rails is unagi" }] } } ``` You could implement a serializer that looks like this to get your payload into shape: ```js App.PostSerializer = DS.RESTSerializer.extend({ // First, restructure the top-level so it's organized by type extractSingle: function(store, type, payload, id, requestType) { var comments = payload._embedded.comment; delete payload._embedded; payload = { comments: comments, post: payload }; return this._super(store, type, payload, id, requestType); }, normalizeHash: { // Next, normalize individual comments, which (after `extract`) // are now located under `comments` comments: function(hash) { hash.id = hash._id; hash.title = hash.comment_title; delete hash._id; delete hash.comment_title; return hash; } } }) ``` When you call super from your own implementation of `extractSingle`, the built-in implementation will find the primary record in your normalized payload and push the remaining records into the store. The primary record is the single hash found under `post` or the first element of the `posts` array. The primary record has special meaning when the record is being created for the first time or updated (`createRecord` or `updateRecord`). In particular, it will update the properties of the record that was saved. @param {DS.Store} store @param {subclass of DS.Model} type @param {Object} payload @param {String} id @param {'find'|'createRecord'|'updateRecord'|'deleteRecord'} requestType @returns Object the primary response to the original request */ extractSingle: function(store, primaryType, payload, recordId, requestType) { var primaryTypeName = primaryType.typeKey, primaryRecord; for (var prop in payload) { // legacy support for singular names if (prop === primaryTypeName) { primaryRecord = this.normalize(primaryType, prop, payload[prop]); continue; } var typeName = this.singularize(prop), type = store.modelFor(typeName); /*jshint loopfunc:true*/ payload[prop].forEach(function(hash) { hash = this.normalize(type, prop, hash); var isFirstCreatedRecord = typeName === primaryTypeName && !recordId && !primaryRecord, isUpdatedRecord = typeName === primaryTypeName && coerceId(hash.id) === recordId; // find the primary record. // // It's either: // * the record with the same ID as the original request // * in the case of a newly created record that didn't have an ID, the first // record in the Array if (isFirstCreatedRecord || isUpdatedRecord) { primaryRecord = hash; } else { store.push(typeName, hash); } }, this); } return primaryRecord; }, /** Called when the server has returned a payload representing multiple records, such as in response to a `findAll` or `findQuery`. It is your opportunity to clean up the server's response into the normalized form expected by Ember Data. If you want, you can just restructure the top-level of your payload, and do more fine-grained normalization in the `normalize` method. For example, if you have a payload like this in response to a request for all posts: ```js { "_embedded": { "post": [{ "id": 1, "title": "Rails is omakase" }, { "id": 2, "title": "The Parley Letter" }], "comment": [{ "_id": 1, "comment_title": "Rails is unagi" "post_id": 1 }, { "_id": 2, "comment_title": "Don't tread on me", "post_id": 2 }] } } ``` You could implement a serializer that looks like this to get your payload into shape: ```js App.PostSerializer = DS.RESTSerializer.extend({ // First, restructure the top-level so it's organized by type // and the comments are listed under a post's `comments` key. extractArray: function(store, type, payload, id, requestType) { var posts = payload._embedded.post; var comments = []; var postCache = {}; posts.forEach(function(post) { post.comments = []; postCache[post.id] = post; }); payload._embedded.comment.forEach(function(comment) { comments.push(comment); postCache[comment.post_id].comments.push(comment); delete comment.post_id; } payload = { comments: comments, posts: payload }; return this._super(store, type, payload, id, requestType); }, normalizeHash: { // Next, normalize individual comments, which (after `extract`) // are now located under `comments` comments: function(hash) { hash.id = hash._id; hash.title = hash.comment_title; delete hash._id; delete hash.comment_title; return hash; } } }) ``` When you call super from your own implementation of `extractArray`, the built-in implementation will find the primary array in your normalized payload and push the remaining records into the store. The primary array is the array found under `posts`. The primary record has special meaning when responding to `findQuery` or `findHasMany`. In particular, the primary array will become the list of records in the record array that kicked off the request. @param {DS.Store} store @param {subclass of DS.Model} type @param {Object} payload @param {'findAll'|'findMany'|'findHasMany'|'findQuery'} requestType @returns {Array<Object>} The primary array that was returned in response to the original query. */ extractArray: function(store, primaryType, payload) { var primaryTypeName = primaryType.typeKey, primaryArray; for (var prop in payload) { var typeName = this.singularize(prop), type = store.modelFor(typeName), isPrimary = typeName === primaryTypeName; /*jshint loopfunc:true*/ var normalizedArray = payload[prop].map(function(hash) { return this.normalize(type, prop, hash); }, this); if (isPrimary) { primaryArray = normalizedArray; } else { store.pushMany(typeName, normalizedArray); } } return primaryArray; }, /** @private @method pluralize @param {String} key */ pluralize: function(key) { return Ember.String.pluralize(key); }, /** @private @method singularize @param {String} key */ singularize: function(key) { return Ember.String.singularize(key); }, // SERIALIZE /** Called when a record is saved in order to convert the record into JSON. By default, it creates a JSON object with a key for each attribute and belongsTo relationship. For example, consider this model: ```js App.Comment = DS.Model.extend({ title: DS.attr(), body: DS.attr(), author: DS.belongsTo('user') }); ``` The default serialization would create a JSON object like: ```js { "title": "Rails is unagi", "body": "Rails? Omakase? O_O", "author": 12 } ``` By default, attributes are passed through as-is, unless you specified an attribute type (`DS.attr('date')`). If you specify a transform, the JavaScript value will be serialized when inserted into the JSON hash. By default, belongs-to relationships are converted into IDs when inserted into the JSON hash. ## IDs `serialize` takes an options hash with a single option: `includeId`. If this option is `true`, `serialize` will, by default include the ID in the JSON object it builds. The adapter passes in `includeId: true` when serializing a record for `createRecord`, but not for `updateRecord`. ## Customization Your server may expect a different JSON format than the built-in serialization format. In that case, you can implement `serialize` yourself and return a JSON hash of your choosing. ```js App.PostSerializer = DS.RESTSerializer.extend({ serialize: function(post, options) { var json = { POST_TTL: post.get('title'), POST_BDY: post.get('body'), POST_CMS: post.get('comments').mapProperty('id') } if (options.includeId) { json.POST_ID_ = post.get('id'); } return json; } }); ``` ## Customizing an App-Wide Serializer If you want to define a serializer for your entire application, you'll probably want to use `eachAttribute` and `eachRelationship` on the record. ```js App.ApplicationSerializer = DS.RESTSerializer.extend({ serialize: function(record, options) { var json = {}; record.eachAttribute(function(name) { json[serverAttributeName(name)] = record.get(name); }) record.eachRelationship(function(name, relationship) { if (relationship.kind === 'hasMany') { json[serverHasManyName(name)] = record.get(name).mapBy('id'); } }); if (options.includeId) { json.ID_ = record.get('id'); } return json; } }); function serverAttributeName(attribute) { return attribute.underscore().toUpperCase(); } function serverHasManyName(name) { return serverAttributeName(name.singularize()) + "_IDS"; } ``` This serializer will generate JSON that looks like this: ```js { "TITLE": "Rails is omakase", "BODY": "Yep. Omakase.", "COMMENT_IDS": [ 1, 2, 3 ] } ``` ## Tweaking the Default JSON If you just want to do some small tweaks on the default JSON, you can call super first and make the tweaks on the returned JSON. ```js App.PostSerializer = DS.RESTSerializer.extend({ serialize: function(record, options) { var json = this._super(record, options); json.subject = json.title; delete json.title; return json; } }); ``` */ serialize: function(record, options) { return this._super.apply(this, arguments); } }); /** The REST adapter allows your store to communicate with an HTTP server by transmitting JSON via XHR. Most Ember.js apps that consume a JSON API should use the REST adapter. This adapter is designed around the idea that the JSON exchanged with the server should be conventional. ## JSON Structure The REST adapter expects the JSON returned from your server to follow these conventions. ### Object Root The JSON payload should be an object that contains the record inside a root property. For example, in response to a `GET` request for `/posts/1`, the JSON should look like this: ```js { "post": { title: "I'm Running to Reform the W3C's Tag", author: "Yehuda Katz" } } ``` ### Conventional Names Attribute names in your JSON payload should be the underscored versions of the attributes in your Ember.js models. For example, if you have a `Person` model: ```js App.Person = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string'), occupation: DS.attr('string') }); ``` The JSON returned should look like this: ```js { "person": { "first_name": "Barack", "last_name": "Obama", "occupation": "President" } } ``` ## Customization ### Endpoint path customization Endpoint paths can be prefixed with a `namespace` by setting the namespace property on the adapter: ```js DS.RESTAdapter.reopen({ namespace: 'api/1' }); ``` Requests for `App.Person` would now target `/api/1/people/1`. ### Host customization An adapter can target other hosts by setting the `url` property. ```js DS.RESTAdapter.reopen({ url: 'https://api.example.com' }); ``` ### Headers customization Some APIs require HTTP headers, eg to provide an API key. An array of headers can be added to the adapter which are passed with every request: ```js DS.RESTAdapter.reopen({ headers: { "API_KEY": "secret key", "ANOTHER_HEADER": "asdsada" } }); ``` @class RESTAdapter @constructor @namespace DS @extends DS.Adapter */ DS.RESTAdapter = DS.Adapter.extend({ defaultSerializer: '_rest', /** Called by the store in order to fetch the JSON for a given type and ID. It makes an Ajax request to a URL computed by `buildURL`, and returns a promise for the resulting payload. @method find @see RESTAdapter/buildURL @see RESTAdapter/ajax @param {DS.Store} store @param {subclass of DS.Model} type @param {String} id @returns Promise */ find: function(store, type, id) { return this.ajax(this.buildURL(type, id), 'GET'); }, /** Called by the store in order to fetch a JSON array for all of the records for a given type. It makes an Ajax request to a URL computed by `buildURL`, and returns a promise for the resulting payload. @method findAll @see RESTAdapter/buildURL @see RESTAdapter/ajax @param {DS.Store} store @param {subclass of DS.Model} type @returns Promise */ findAll: function(store, type) { return this.ajax(this.buildURL(type), 'GET'); }, /** Called by the store in order to fetch a JSON array for the records that match a particular query. The query is a simple JavaScript object that will be passed directly to the server as parameters. It makes an Ajax request to a URL computed by `buildURL`, and returns a promise for the resulting payload. @method findQuery @see RESTAdapter/buildURL @see RESTAdapter/ajax @param {DS.Store} store @param {subclass of DS.Model} type @param {Object} query @returns Promise */ findQuery: function(store, type, query) { return this.ajax(this.buildURL(type), 'GET', query); }, /** Called by the store in order to fetch a JSON array for the unloaded records in a has-many relationship that were originally specified as IDs. For example, if the original payload looks like: ```js { "id": 1, "title": "Rails is omakase", "comments": [ 1, 2, 3 ] } ``` The IDs will be passed as a URL-encoded Array of IDs, in this form: ``` ids[]=1&ids[]=2&ids[]=3 ``` Many servers, such as Rails and PHP, will automatically convert this into an Array for you on the server-side. If you want to encode the IDs, differently, just override this (one-line) method. It makes an Ajax request to a URL computed by `buildURL`, and returns a promise for the resulting payload. @method findMany @see RESTAdapter/buildURL @see RESTAdapter/ajax @param {DS.Store} store @param {subclass of DS.Model} type @param {Array<String>} ids @returns Promise */ findMany: function(store, type, ids) { return this.ajax(this.buildURL(type), 'GET', { ids: ids }); }, /** Called by the store in order to fetch a JSON array for the unloaded records in a has-many relationship that were originally specified as a URL (inside of `links`). For example, if your original payload looks like this: ```js { "post": { "id": 1, "title": "Rails is omakase", "links": { "comments": "/posts/1/comments" } } } ``` This method will be called with the parent record and `/posts/1/comments`. It will make an Ajax request to the originally specified URL. @method findHasMany @see RESTAdapter/buildURL @see RESTAdapter/ajax @param {DS.Store} store @param {DS.Model} record @param {String} url @returns Promise */ findHasMany: function(store, record, url) { return this.ajax(url, 'GET'); }, /** Called by the store when a newly created record is `save`d. It serializes the record, and `POST`s it to a URL generated by `buildURL`. See `serialize` for information on how to customize the serialized form of a record. @method createRecord @see RESTAdapter/buildURL @see RESTAdapter/ajax @see RESTAdapter/serialize @param {DS.Store} store @param {subclass of DS.Model} type @param {DS.Model} record @returns Promise */ createRecord: function(store, type, record) { var data = {}; data[type.typeKey] = this.serializerFor(type.typeKey).serialize(record, { includeId: true }); return this.ajax(this.buildURL(type), "POST", { data: data }); }, /** Called by the store when an existing record is `save`d. It serializes the record, and `POST`s it to a URL generated by `buildURL`. See `serialize` for information on how to customize the serialized form of a record. @method updateRecord @see RESTAdapter/buildURL @see RESTAdapter/ajax @see RESTAdapter/serialize @param {DS.Store} store @param {subclass of DS.Model} type @param {DS.Model} record @returns Promise */ updateRecord: function(store, type, record) { var data = {}; data[type.typeKey] = this.serializerFor(type.typeKey).serialize(record); var id = get(record, 'id'); return this.ajax(this.buildURL(type, id), "PUT", { data: data }); }, /** Called by the store when an deleted record is `save`d. It serializes the record, and `POST`s it to a URL generated by `buildURL`. @method deleteRecord @see RESTAdapter/buildURL @see RESTAdapter/ajax @see RESTAdapter/serialize @param {DS.Store} store @param {subclass of DS.Model} type @param {DS.Model} record @returns Promise */ deleteRecord: function(store, type, record) { var id = get(record, 'id'); return this.ajax(this.buildURL(type, id), "DELETE"); }, /** Builds a URL for a given type and optional ID. By default, it pluralizes the type's name (for example, 'post' becomes 'posts' and 'person' becomes 'people'). If an ID is specified, it adds the ID to the plural form of the type, separated by a `/`. @method buildURL @param {subclass of DS.Model} type @param {String} id @returns String */ buildURL: function(type, id) { var url = "/" + Ember.String.pluralize(type.typeKey); if (id) { url += "/" + id; } return url; }, serializerFor: function(type) { // This logic has to be kept in sync with DS.Store#serializerFor return this.container.lookup('serializer:' + type) || this.container.lookup('serializer:application') || this.container.lookup('serializer:_rest'); }, /** Takes a URL, an HTTP method and a hash of data, and makes an HTTP request. When the server responds with a payload, Ember Data will call into `extractSingle` or `extractArray` (depending on whether the original query was for one record or many records). By default, it has the following behavior: * It sets the response `dataType` to `"json"` * If the HTTP method is not `"GET"`, it sets the `Content-Type` to be `application/json; charset=utf-8` * If the HTTP method is not `"GET"`, it stringifies the data passed in. The data is the serialized record in the case of a save. * Registers success and failure handlers. @method ajax @private @param url @param type @param hash */ ajax: function(url, type, hash) { var adapter = this; return new Ember.RSVP.Promise(function(resolve, reject) { hash = hash || {}; hash.url = url; hash.type = type; hash.dataType = 'json'; hash.context = adapter; if (hash.data && type !== 'GET') { hash.contentType = 'application/json; charset=utf-8'; hash.data = JSON.stringify(hash.data); } if (adapter.headers !== undefined) { var headers = adapter.headers; hash.beforeSend = function (xhr) { Ember.keys(headers).forEach(function(key) { xhr.setRequestHeader(key, headers[key]); }); }; } hash.success = function(json) { Ember.run(null, resolve, json); }; hash.error = function(jqXHR, textStatus, errorThrown) { if (jqXHR) { jqXHR.then = null; } Ember.run(null, reject, jqXHR); }; Ember.$.ajax(hash); }); } }); })(); (function() { /** @module ember-data */ })(); (function() { DS.Model.reopen({ /** Provides info about the model for debugging purposes by grouping the properties into more semantic groups. Meant to be used by debugging tools such as the Chrome Ember Extension. - Groups all attributes in "Attributes" group. - Groups all belongsTo relationships in "Belongs To" group. - Groups all hasMany relationships in "Has Many" group. - Groups all flags in "Flags" group. - Flags relationship CPs as expensive properties. */ _debugInfo: function() { var attributes = ['id'], relationships = { belongsTo: [], hasMany: [] }, expensiveProperties = []; this.eachAttribute(function(name, meta) { attributes.push(name); }, this); this.eachRelationship(function(name, relationship) { relationships[relationship.kind].push(name); expensiveProperties.push(name); }); var groups = [ { name: 'Attributes', properties: attributes, expand: true, }, { name: 'Belongs To', properties: relationships.belongsTo, expand: true }, { name: 'Has Many', properties: relationships.hasMany, expand: true }, { name: 'Flags', properties: ['isLoaded', 'isDirty', 'isSaving', 'isDeleted', 'isError', 'isNew', 'isValid'] } ]; return { propertyInfo: { // include all other mixins / properties (not just the grouped ones) includeOtherProperties: true, groups: groups, // don't pre-calculate unless cached expensiveProperties: expensiveProperties } }; } }); })(); (function() { /** @module ember-data */ })(); (function() { //Copyright (C) 2011 by Living Social, Inc. //Permission is hereby granted, free of charge, to any person obtaining a copy of //this software and associated documentation files (the "Software"), to deal in //the Software without restriction, including without limitation the rights to //use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies //of the Software, and to permit persons to whom the Software is furnished to do //so, subject to the following conditions: //The above copyright notice and this permission notice shall be included in all //copies or substantial portions of the Software. //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE //SOFTWARE. /** Ember Data @module ember-data @main ember-data */ })(); (function() { Ember.String.pluralize = function(word) { return Ember.Inflector.inflector.pluralize(word); }; Ember.String.singularize = function(word) { return Ember.Inflector.inflector.singularize(word); }; })(); (function() { var BLANK_REGEX = /^\s*$/; function loadUncountable(rules, uncountable) { for (var i = 0, length = uncountable.length; i < length; i++) { rules.uncountable[uncountable[i]] = true; } } function loadIrregular(rules, irregularPairs) { var pair; for (var i = 0, length = irregularPairs.length; i < length; i++) { pair = irregularPairs[i]; rules.irregular[pair[0]] = pair[1]; rules.irregularInverse[pair[1]] = pair[0]; } } function Inflector(ruleSet) { ruleSet = ruleSet || {}; ruleSet.uncountable = ruleSet.uncountable || {}; ruleSet.irregularPairs= ruleSet.irregularPairs|| {}; var rules = this.rules = { plurals: ruleSet.plurals || [], singular: ruleSet.singular || [], irregular: {}, irregularInverse: {}, uncountable: {} }; loadUncountable(rules, ruleSet.uncountable); loadIrregular(rules, ruleSet.irregularPairs); } Inflector.prototype = { pluralize: function(word) { return this.inflect(word, this.rules.plurals); }, singularize: function(word) { return this.inflect(word, this.rules.singular); }, inflect: function(word, typeRules) { var inflection, substitution, result, lowercase, isBlank, isUncountable, isIrregular, isIrregularInverse, rule; isBlank = BLANK_REGEX.test(word); if (isBlank) { return word; } lowercase = word.toLowerCase(); isUncountable = this.rules.uncountable[lowercase]; if (isUncountable) { return word; } isIrregular = this.rules.irregular[lowercase]; if (isIrregular) { return isIrregular; } isIrregularInverse = this.rules.irregularInverse[lowercase]; if (isIrregularInverse) { return isIrregularInverse; } for (var i = typeRules.length, min = 0; i > min; i--) { inflection = typeRules[i-1]; rule = inflection[0]; if (rule.test(word)) { break; } } inflection = inflection || []; rule = inflection[0]; substitution = inflection[1]; result = word.replace(rule, substitution); return result; } }; Ember.Inflector = Inflector; })(); (function() { Ember.Inflector.defaultRules = { plurals: [ [/$/, 's'], [/s$/i, 's'], [/^(ax|test)is$/i, '$1es'], [/(octop|vir)us$/i, '$1i'], [/(octop|vir)i$/i, '$1i'], [/(alias|status)$/i, '$1es'], [/(bu)s$/i, '$1ses'], [/(buffal|tomat)o$/i, '$1oes'], [/([ti])um$/i, '$1a'], [/([ti])a$/i, '$1a'], [/sis$/i, 'ses'], [/(?:([^f])fe|([lr])f)$/i, '$1$2ves'], [/(hive)$/i, '$1s'], [/([^aeiouy]|qu)y$/i, '$1ies'], [/(x|ch|ss|sh)$/i, '$1es'], [/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'], [/^(m|l)ouse$/i, '$1ice'], [/^(m|l)ice$/i, '$1ice'], [/^(ox)$/i, '$1en'], [/^(oxen)$/i, '$1'], [/(quiz)$/i, '$1zes'] ], singular: [ [/s$/i, ''], [/(ss)$/i, '$1'], [/(n)ews$/i, '$1ews'], [/([ti])a$/i, '$1um'], [/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i, '$1sis'], [/(^analy)(sis|ses)$/i, '$1sis'], [/([^f])ves$/i, '$1fe'], [/(hive)s$/i, '$1'], [/(tive)s$/i, '$1'], [/([lr])ves$/i, '$1f'], [/([^aeiouy]|qu)ies$/i, '$1y'], [/(s)eries$/i, '$1eries'], [/(m)ovies$/i, '$1ovie'], [/(x|ch|ss|sh)es$/i, '$1'], [/^(m|l)ice$/i, '$1ouse'], [/(bus)(es)?$/i, '$1'], [/(o)es$/i, '$1'], [/(shoe)s$/i, '$1'], [/(cris|test)(is|es)$/i, '$1is'], [/^(a)x[ie]s$/i, '$1xis'], [/(octop|vir)(us|i)$/i, '$1us'], [/(alias|status)(es)?$/i, '$1'], [/^(ox)en/i, '$1'], [/(vert|ind)ices$/i, '$1ex'], [/(matr)ices$/i, '$1ix'], [/(quiz)zes$/i, '$1'], [/(database)s$/i, '$1'] ], irregularPairs: [ ['person', 'people'], ['man', 'men'], ['child', 'children'], ['sex', 'sexes'], ['move', 'moves'], ['cow', 'kine'], ['zombie', 'zombies'] ], uncountable: [ 'equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep', 'jeans', 'police' ] }; })(); (function() { if (Ember.EXTEND_PROTOTYPES) { /** See {{#crossLink "Ember.String/pluralize"}}{{/crossLink}} @method pluralize @for String */ String.prototype.pluralize = function() { return Ember.String.pluralize(this); }; /** See {{#crossLink "Ember.String/singularize"}}{{/crossLink}} @method singularize @for String */ String.prototype.singularize = function() { return Ember.String.singularize(this); }; } })(); (function() { Ember.Inflector.inflector = new Ember.Inflector(Ember.Inflector.defaultRules); })(); (function() { })(); })();
ajax/libs/jquery/1.11.0-beta3/jquery.min.js
honestree/cdnjs
/*! jQuery v1.11.0-beta3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}(this,function(a){var b=[],c=b.slice,d=b.concat,e=b.push,f=b.indexOf,g={},h=g.toString,i=g.hasOwnProperty,j="".trim,k={},l="1.11.0-beta3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return c.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:c.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(c.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:e,sort:b.sort,splice:b.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!i.call(a,"constructor")&&!i.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return i.call(a,b);for(b in a);return void 0===b||i.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?g[h.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:j&&!j.call("\ufeff\xa0")?function(a){return null==a?"":j.call(a)}:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):e.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(f)return f.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var e,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)e=b(a[f],f,c),null!=e&&i.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&i.push(e);return d.apply([],i)},guid:1,proxy:function(a,b){var d,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(d=c.call(arguments,2),e=function(){return a.apply(b||this,d.concat(c.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){g["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t="sizzle"+-new Date,u=a.document,v=0,w=0,x=fb(),y=fb(),z=fb(),A=function(a,b){return a===b&&(k=!0),0},B="undefined",C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=E.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")"+L+"*(?:([*^$|!~]?=)"+L+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+N+")|)|)"+L+"*\\]",P=":("+M+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+O.replace(3,8)+")*)|.*)\\)|)",Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(P),V=new RegExp("^"+N+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,ab=/'|\\/g,bb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),cb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{H.apply(E=I.call(u.childNodes),u.childNodes),E[u.childNodes.length].nodeType}catch(db){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function eb(a,b,d,e){var f,g,h,i,j,k,n,q,r,v;if((b?b.ownerDocument||b:u)!==m&&l(b),b=b||m,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(o&&!e){if(f=$.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&s(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!p||!p.test(a))){if(q=n=t,r=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){k=pb(a),(n=b.getAttribute("id"))?q=n.replace(ab,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=k.length;while(j--)k[j]=q+qb(k[j]);r=_.test(a)&&nb(b.parentNode)||b,v=k.join(",")}if(v)try{return H.apply(d,r.querySelectorAll(v)),d}catch(w){}finally{n||b.removeAttribute("id")}}}return yb(a.replace(Q,"$1"),b,d,e)}function fb(){var a=[];function b(c,d){return a.push(c+" ")>e.cacheLength&&delete b[a.shift()],b[c+" "]=d}return b}function gb(a){return a[t]=!0,a}function hb(a){var b=m.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ib(a,b){var c=a.split("|"),d=a.length;while(d--)e.attrHandle[c[d]]=b}function jb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function mb(a){return gb(function(b){return b=+b,gb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function nb(a){return a&&typeof a.getElementsByTagName!==B&&a}c=eb.support={},g=eb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},l=eb.setDocument=function(a){var b,d=a?a.ownerDocument||a:u,f=d.defaultView;return d!==m&&9===d.nodeType&&d.documentElement?(m=d,n=d.documentElement,o=!g(d),f&&f!==f.top&&(f.addEventListener?f.addEventListener("unload",function(){l()},!1):f.attachEvent&&f.attachEvent("onunload",function(){l()})),c.attributes=hb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=hb(function(a){return a.appendChild(d.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(d.getElementsByClassName)&&hb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=hb(function(a){return n.appendChild(a).id=t,!d.getElementsByName||!d.getElementsByName(t).length}),c.getById?(e.find.ID=function(a,b){if(typeof b.getElementById!==B&&o){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},e.filter.ID=function(a){var b=a.replace(bb,cb);return function(a){return a.getAttribute("id")===b}}):(delete e.find.ID,e.filter.ID=function(a){var b=a.replace(bb,cb);return function(a){var c=typeof a.getAttributeNode!==B&&a.getAttributeNode("id");return c&&c.value===b}}),e.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==B?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},e.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==B&&o?b.getElementsByClassName(a):void 0},q=[],p=[],(c.qsa=Z.test(d.querySelectorAll))&&(hb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&p.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||p.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll(":checked").length||p.push(":checked")}),hb(function(a){var b=d.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&p.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||p.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),p.push(",.*:")})),(c.matchesSelector=Z.test(r=n.webkitMatchesSelector||n.mozMatchesSelector||n.oMatchesSelector||n.msMatchesSelector))&&hb(function(a){c.disconnectedMatch=r.call(a,"div"),r.call(a,"[s!='']:x"),q.push("!=",P)}),p=p.length&&new RegExp(p.join("|")),q=q.length&&new RegExp(q.join("|")),b=Z.test(n.compareDocumentPosition),s=b||Z.test(n.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},A=b?function(a,b){if(a===b)return k=!0,0;var e=!a.compareDocumentPosition-!b.compareDocumentPosition;return e?e:(e=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&e||!c.sortDetached&&b.compareDocumentPosition(a)===e?a===d||a.ownerDocument===u&&s(u,a)?-1:b===d||b.ownerDocument===u&&s(u,b)?1:j?J.call(j,a)-J.call(j,b):0:4&e?-1:1)}:function(a,b){if(a===b)return k=!0,0;var c,e=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===d?-1:b===d?1:f?-1:g?1:j?J.call(j,a)-J.call(j,b):0;if(f===g)return jb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[e]===i[e])e++;return e?jb(h[e],i[e]):h[e]===u?-1:i[e]===u?1:0},d):m},eb.matches=function(a,b){return eb(a,null,null,b)},eb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==m&&l(a),b=b.replace(T,"='$1']"),!(!c.matchesSelector||!o||q&&q.test(b)||p&&p.test(b)))try{var d=r.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return eb(b,m,null,[a]).length>0},eb.contains=function(a,b){return(a.ownerDocument||a)!==m&&l(a),s(a,b)},eb.attr=function(a,b){(a.ownerDocument||a)!==m&&l(a);var d=e.attrHandle[b.toLowerCase()],f=d&&D.call(e.attrHandle,b.toLowerCase())?d(a,b,!o):void 0;return void 0!==f?f:c.attributes||!o?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},eb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},eb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(k=!c.detectDuplicates,j=!c.sortStable&&a.slice(0),a.sort(A),k){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return j=null,a},f=eb.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(3===e||4===e)return a.nodeValue}else while(b=a[d++])c+=f(b);return c},e=eb.selectors={cacheLength:50,createPseudo:gb,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(bb,cb),a[3]=(a[4]||a[5]||"").replace(bb,cb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||eb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&eb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return W.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&U.test(c)&&(b=pb(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(bb,cb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=x[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&x(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==B&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=eb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[t]||(q[t]={}),j=k[a]||[],n=j[0]===v&&j[1],m=j[0]===v&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[v,n,m];break}}else if(s&&(j=(b[t]||(b[t]={}))[a])&&j[0]===v)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[t]||(l[t]={}))[a]=[v,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||eb.error("unsupported pseudo: "+a);return d[t]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?gb(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=J.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:gb(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[t]?gb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:gb(function(a){return function(b){return eb(a,b).length>0}}),contains:gb(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),lang:gb(function(a){return V.test(a||"")||eb.error("unsupported lang: "+a),a=a.replace(bb,cb).toLowerCase(),function(b){var c;do if(c=o?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===n},focus:function(a){return a===m.activeElement&&(!m.hasFocus||m.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!e.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:mb(function(){return[0]}),last:mb(function(a,b){return[b-1]}),eq:mb(function(a,b,c){return[0>c?c+b:c]}),even:mb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:mb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:mb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:mb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},e.pseudos.nth=e.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[b]=kb(b);for(b in{submit:!0,reset:!0})e.pseudos[b]=lb(b);function ob(){}ob.prototype=e.filters=e.pseudos,e.setFilters=new ob;function pb(a,b){var c,d,f,g,h,i,j,k=y[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){(!c||(d=R.exec(h)))&&(d&&(h=h.slice(d[0].length)||h),i.push(f=[])),c=!1,(d=S.exec(h))&&(c=d.shift(),f.push({value:c,type:d[0].replace(Q," ")}),h=h.slice(c.length));for(g in e.filter)!(d=W[g].exec(h))||j[g]&&!(d=j[g](d))||(c=d.shift(),f.push({value:c,type:g,matches:d}),h=h.slice(c.length));if(!c)break}return b?h.length:h?eb.error(a):y(a,i).slice(0)}function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var e=b.dir,f=c&&"parentNode"===e,g=w++;return b.first?function(b,c,d){while(b=b[e])if(1===b.nodeType||f)return a(b,c,d)}:function(b,c,h){var i,j,k,l=v+" "+g;if(h){while(b=b[e])if((1===b.nodeType||f)&&a(b,c,h))return!0}else while(b=b[e])if(1===b.nodeType||f)if(k=b[t]||(b[t]={}),(j=k[e])&&j[0]===l){if((i=j[1])===!0||i===d)return i===!0}else if(j=k[e]=[l],j[1]=a(b,c,h)||d,j[1]===!0)return!0}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function ub(a,b,c,d,e,f){return d&&!d[t]&&(d=ub(d)),e&&!e[t]&&(e=ub(e,f)),gb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||xb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:tb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=tb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=tb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function vb(a){for(var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],j=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return J.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==i)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=e.relative[a[j].type])m=[rb(sb(m),c)];else{if(c=e.filter[a[j].type].apply(null,a[j].matches),c[t]){for(d=++j;f>d;d++)if(e.relative[a[d].type])break;return ub(j>1&&sb(m),j>1&&qb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(Q,"$1"),c,d>j&&vb(a.slice(j,d)),f>d&&vb(a=a.slice(d)),f>d&&qb(a))}m.push(c)}return sb(m)}function wb(a,b){var c=0,f=b.length>0,g=a.length>0,h=function(h,j,k,l,n){var o,p,q,r=0,s="0",t=h&&[],u=[],w=i,x=h||g&&e.find.TAG("*",n),y=v+=null==w?1:Math.random()||.1,z=x.length;for(n&&(i=j!==m&&j,d=c);s!==z&&null!=(o=x[s]);s++){if(g&&o){p=0;while(q=a[p++])if(q(o,j,k)){l.push(o);break}n&&(v=y,d=++c)}f&&((o=!q&&o)&&r--,h&&t.push(o))}if(r+=s,f&&s!==r){p=0;while(q=b[p++])q(t,u,j,k);if(h){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(l));u=tb(u)}H.apply(l,u),n&&!h&&u.length>0&&r+b.length>1&&eb.uniqueSort(l)}return n&&(v=y,i=w),t};return f?gb(h):h}h=eb.compile=function(a,b){var c,d=[],e=[],f=z[a+" "];if(!f){b||(b=pb(a)),c=b.length;while(c--)f=vb(b[c]),f[t]?d.push(f):e.push(f);f=z(a,wb(e,d))}return f};function xb(a,b,c){for(var d=0,e=b.length;e>d;d++)eb(a,b[d],c);return c}function yb(a,b,d,f){var g,i,j,k,l,m=pb(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&o&&e.relative[i[1].type]){if(b=(e.find.ID(j.matches[0].replace(bb,cb),b)||[])[0],!b)return d;a=a.slice(i.shift().value.length)}g=W.needsContext.test(a)?0:i.length;while(g--){if(j=i[g],e.relative[k=j.type])break;if((l=e.find[k])&&(f=l(j.matches[0].replace(bb,cb),_.test(i[0].type)&&nb(b.parentNode)||b))){if(i.splice(g,1),a=f.length&&qb(i),!a)return H.apply(d,f),d;break}}}return h(a,m)(f,b,!o,d,_.test(a)&&nb(b.parentNode)||b),d}return c.sortStable=t.split("").sort(A).join("")===t,c.detectDuplicates=!!k,l(),c.sortDetached=hb(function(a){return 1&a.compareDocumentPosition(m.createElement("div"))}),hb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ib("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&hb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ib("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),hb(function(a){return null==a.getAttribute("disabled")})||ib(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),eb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){var c="string"==typeof a?m(a,b):m.makeArray(a&&a.nodeType?[a]:a),d=m.merge(this.get(),c);return this.pushStack(m.unique(d))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,d=c.call(arguments),e=d.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,d){return function(e){b[a]=this,d[a]=arguments.length>1?c.call(arguments):e,d===i?g.notifyWith(b,d):--f||g.resolveWith(b,d)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)d[b]&&m.isFunction(d[b].promise)?d[b].promise().done(h(b,k,d)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,d),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.trigger&&m(y).trigger("ready").off("ready"))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c=y.getElementsByTagName("body")[0];c&&(a=y.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=y.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(k.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,c,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof c)return k||(k=i?a[h]=b.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof c||"function"==typeof c)&&(e?j[k]=m.extend(j[k],c):j[k].data=m.extend(j[k].data,c)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(c)]=d),"string"==typeof c?(f=g[c],null==f&&(f=g[m.camelCase(c)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d]));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createDocumentFragment(),b=y.createElement("div"),c=y.createElement("input");if(c.type="checkbox",b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,c.checked=!0,k.noCloneChecked=c.cloneNode(!0).checked,a.appendChild(c),k.appendChecked=c.checked,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,j,k,l,n,o=[d||y],p=i.call(b,"type")?b.type:b,q=i.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(j=k.delegateType||p,$.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?j:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,d,e,f,g,h=[],i=c.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,d=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):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(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),this[m.expando]=!0,void 0):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ab,this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:(m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))}),void 0)},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:(m.event.remove(this,"._submit"),void 0)}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):(m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))}),void 0)},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,c){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((c||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,b.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=d.apply([],a);var c,e,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)e=i,j!==o&&(e=m.clone(e,!0,!0),f&&m.merge(g,ub(e,"script"))),b.call(this[j],e,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)e=g[j],ob.test(e.type||"")&&!m._data(e,"globalEval")&&m.contains(h,e)&&(e.src?m._evalUrl&&m._evalUrl(e.src):m.globalEval((e.text||e.textContent||e.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,f=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),e.apply(f,c.get());return this.pushStack(f)}});var Cb,Db={};function Eb(b,c){var d=m(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:m.css(d[0],"display");return d.detach(),e}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a,b,c=y.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",k.opacity=/^0.5/.test(a.style.opacity),k.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,k.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=y.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=y.createElement("div"),e=y.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==K&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?(delete this.get,void 0):(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=y.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",k.opacity=/^0.5/.test(b.style.opacity),k.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,m.extend(k,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=y.createElement("div"),f=y.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=y.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&l(),d},boxSizingReliable:function(){return null==e&&l(),e},pixelPosition:function(){return null==f&&l(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=y.getElementsByTagName("body")[0],!b)return;c=y.createElement("div"),d=y.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(y.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function l(){var b,c,h=y.getElementsByTagName("body")[0];h&&(b=y.createElement("div"),c=y.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",m.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:0,fontWeight:400},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):f[g]||(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing()&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Ob.test(m.css(a,"display"))?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing()&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0]; return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l=Fb(a.nodeName),"none"===j&&(j=l),"inline"===j&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==l?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}if(!m.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){a()&&m.timers.push(a)&&m.fx.start()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=y.createElement("div");e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=y.createElement("select"),d=c.appendChild(y.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",k.getSetAttribute="t"!==e.className,k.style=/top/.test(a.getAttribute("style")),k.hrefNormalized="/a"===a.getAttribute("href"),k.checkOn=!!b.value,k.optSelected=d.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!d.disabled,b=y.createElement("input"),b.setAttribute("value",""),k.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),k.radioValue="t"===b.value,a=b=c=d=e=null}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:a.text}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=m.inArray(m(d).val(),f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):(m.removeAttr(a,b),void 0))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?(a.defaultValue=b,void 0):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):m.isFunction(a)?this.each(function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.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(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,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":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return m.isFunction(a)?this.each(function(b){m(this).wrapInner(a.call(this,b))}):this.each(function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e,void 0)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m },a.jQuery=a.$=m,m}); //# sourceMappingURL=jquery.min.map
src/app.js
suaing49/kitematic
require.main.paths.splice(0, 0, process.env.NODE_PATH); import remote from 'remote'; var Menu = remote.require('menu'); import React from 'react'; import SetupStore from './stores/SetupStore'; import ipc from 'ipc'; import machine from './utils/DockerMachineUtil'; import metrics from './utils/MetricsUtil'; import template from './menutemplate'; import webUtil from './utils/WebUtil'; import hubUtil from './utils/HubUtil'; var urlUtil = require('./utils/URLUtil'); var app = remote.require('app'); import request from 'request'; import docker from './utils/DockerUtil'; import hub from './utils/HubUtil'; import Router from 'react-router'; import routes from './routes'; import routerContainer from './router'; import repositoryActions from './actions/RepositoryActions'; hubUtil.init(); if (hubUtil.loggedin()) { repositoryActions.repos(); } repositoryActions.recommended(); webUtil.addWindowSizeSaving(); webUtil.addLiveReload(); webUtil.addBugReporting(); webUtil.disableGlobalBackspace(); Menu.setApplicationMenu(Menu.buildFromTemplate(template())); metrics.track('Started App'); metrics.track('app heartbeat'); setInterval(function () { metrics.track('app heartbeat'); }, 14400000); var router = Router.create({ routes: routes }); router.run(Handler => React.render(<Handler/>, document.body)); routerContainer.set(router); SetupStore.setup().then(() => { Menu.setApplicationMenu(Menu.buildFromTemplate(template())); docker.init(); if (!hub.prompted() && !hub.loggedin()) { router.transitionTo('login'); } else { router.transitionTo('search'); } }).catch(err => { metrics.track('Setup Failed', { step: 'catch', message: err.message }); throw err; }); ipc.on('application:quitting', () => { if (localStorage.getItem('settings.closeVMOnQuit') === 'true') { machine.stop(); } }); // Event fires when the app receives a docker:// URL such as // docker://repository/run/redis ipc.on('application:open-url', opts => { request.get('https://kitematic.com/flags.json', (err, response, body) => { if (err || response.statusCode !== 200) { return; } var flags = JSON.parse(body); if (!flags) { return; } urlUtil.openUrl(opts.url, flags, app.getVersion()); }); }); module.exports = { router: router };
app/containers/LandingContainer.js
oeb25/colio
import React from 'react'; import { connect } from 'redux/react'; import Landing from '../components/Landing'; import * as RoomActions from '../actions/RoomActions'; import { bindActionCreators } from 'redux'; @connect(state => ({ room: state.room })) export default class LandingContainer extends React.Component { render() { const { dispatch } = this.props; return ( <Landing {...bindActionCreators(RoomActions, dispatch)}/> ); } }
client/src/pages/Position/index.js
paulvoloschuk/ncms-back
import React, { Component } from 'react' import Header from 'containers/Header' import Wrapper from 'components/Wrapper' import Button from 'components/Button' import HotOpenings from 'containers/HotOpenings' import { Helmet } from 'react-helmet' import { identity } from 'index/constants' import { connect } from 'react-redux' import { combineClasses as combine } from 'index/helpers' import { Loader } from 'semantic-ui-react' import { Link } from 'react-router-dom' import ShareButton from 'components/ShareButton' import classes from './styles.scss' let init = false @connect( state => ({ positions: state.positions }), dispatch => ({ fetchPositions: () => dispatch({type: 'positions/FETCH_START'}) }) ) class Position extends Component { componentDidMount() { if(!init && !this.props.positions) { this.props.fetchPositions() init = false } } renderList(string) { let list = string.split('\n') return ( <ul> {list.map((item, index) => { if (index == list.length - 1 && item[item.length - 1] !== '.') item = item + '.' else if (item[item.length - 1] !== ';') item = item + ';' return <li key={index}>{item}</li> })} </ul> ) } render () { let { renderList } = this, { positions, match } = this.props, data = Array.from(positions).filter(({id}) => id == match.params.id)[0], title = data && data.name || 'Loading position...', responsibilities = data && data.responsibilities ? <div><h1>Responsibilities </h1>{renderList(data.responsibilities)}</div> : null, requirements = data && data.requirements ? <div><h1>Requirements</h1>{renderList(data.requirements)}</div> : null, projectDescription = data && data.projectDescription ? <div><h1>About project </h1>{data.projectDescription}</div> : null, offerings = data && data.offerings ? <div><h1>What we offer</h1>{renderList(data.offerings)}</div> : null, shareData = { title: identity.companyName + " | " + title, description: data && data.projectDescription || '' }, header = data ? <Wrapper> <h1>{data.name}</h1> <p>Check opportunities with us!</p> </Wrapper> : <Loader inverted active inline="centered" size="large">Loading</Loader>, content = data ? <Wrapper className={classes.flexContainer}> <article> {requirements} {offerings} {responsibilities} {projectDescription} <div className={classes.applyBox}> <p>We are waiting for you!</p> <Button statical >Apply for this job</Button> </div> </article> <aside> <p> <ShareButton.Facebook {...shareData} /> <ShareButton.Linkedin {...shareData} /> </p> <h2>Hot Openings</h2> <HotOpenings currentId={match.params.id}/> <Link to="/careers" className={classes.backLink}>Back to Job List</Link> </aside> </Wrapper> : null return ( <div className={classes.container}> <Header/> <Helmet> <title>{identity.companyName + " | " + title}</title> <meta property="og:title" content={title + " - " + identity.companyName}/> </Helmet> <div className={classes.content}> {content} <div className={classes.extraJob}> <h1>Didn’t find suitable vacancy?</h1> <p>Drop us a letter telling about yourself and let’s talk!</p> <Button href="mailto:jobs@sdsolutions.tech">jobs@sdsolutions.tech</Button> </div> </div> <div className={combine(classes.header, !data && classes.header__loading)}> {header} </div> </div> ) } } export default Position
fixtures/packaging/webpack-alias/dev/config.js
chicoxyzzy/react
var path = require('path'); module.exports = { entry: './input', output: { filename: 'output.js', }, resolve: { root: path.resolve('../../../../build/node_modules'), alias: { react: 'react/umd/react.development', 'react-dom': 'react-dom/umd/react-dom.development', }, }, };
wp-content/plugins/head-cleaner/includes/js/jquery-1.4.2.min.js
quetz-design/wordpress-sample1
/*! * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Sat Feb 13 22:33:48 2010 -0500 */ (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i? e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r= j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g, "&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e= true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)|| c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded", L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype, "isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+ a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f], d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]=== a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&& !c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari= true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ", i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ", " ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className= this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i= e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!= null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type= e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this, "events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent= a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y, isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit= {setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}}; if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&& !a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}}, toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector, u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.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".split(" "), function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q]; if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[]; for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length- 1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}}, relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]= l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[]; h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m= m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition|| !h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m= h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>"; if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); (function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/, gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length; c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= {},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)? a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]|| u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length=== 1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay"); this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a], "olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)}, animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing= j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]); this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length|| c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement? function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b= this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle; k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&& f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
src/configs/routes.js
alexandreneves/react-redux-boilerplate
import React from 'react'; import {Route, IndexRoute} from 'react-router'; // COMPONENTS import App from '../containers/App'; import List from '../containers/List'; import ItemDetail from '../containers/ItemDetail'; export default ( <Route path="/" component={App}> <IndexRoute component={List} />, <Route path="/g/:id" component={ItemDetail} /> </Route> );
files/react/0.12.0-rc1/JSXTransformer.js
2947721120/cuddly-fibula
/** * JSXTransformer v0.12.0-rc1 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSXTransformer=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ /* jshint browser: true */ /* jslint evil: true */ 'use strict'; var buffer = _dereq_('buffer'); var transform = _dereq_('jstransform').transform; var visitors = _dereq_('./fbtransform/visitors'); var headEl; var dummyAnchor; var inlineScriptCount = 0; // The source-map library relies on Object.defineProperty, but IE8 doesn't // support it fully even with es5-sham. Indeed, es5-sham's defineProperty // throws when Object.prototype.__defineGetter__ is missing, so we skip building // the source map in that case. var supportsAccessors = Object.prototype.hasOwnProperty('__defineGetter__'); /** * Run provided code through jstransform. * * @param {string} source Original source code * @param {object?} options Options to pass to jstransform * @return {object} object as returned from jstransform */ function transformReact(source, options) { // TODO: just use react-tools options = options || {}; var visitorList; if (options.harmony) { visitorList = visitors.getAllVisitors(); } else { visitorList = visitors.transformVisitors.react; } return transform(visitorList, source, { sourceMap: supportsAccessors && options.sourceMap }); } /** * Eval provided source after transforming it. * * @param {string} source Original source code * @param {object?} options Options to pass to jstransform */ function exec(source, options) { return eval(transformReact(source, options).code); } /** * This method returns a nicely formated line of code pointing to the exact * location of the error `e`. The line is limited in size so big lines of code * are also shown in a readable way. * * Example: * ... x', overflow:'scroll'}} id={} onScroll={this.scroll} class=" ... * ^ * * @param {string} code The full string of code * @param {Error} e The error being thrown * @return {string} formatted message * @internal */ function createSourceCodeErrorMessage(code, e) { var sourceLines = code.split('\n'); var erroneousLine = sourceLines[e.lineNumber - 1]; // Removes any leading indenting spaces and gets the number of // chars indenting the `erroneousLine` var indentation = 0; erroneousLine = erroneousLine.replace(/^\s+/, function(leadingSpaces) { indentation = leadingSpaces.length; return ''; }); // Defines the number of characters that are going to show // before and after the erroneous code var LIMIT = 30; var errorColumn = e.column - indentation; if (errorColumn > LIMIT) { erroneousLine = '... ' + erroneousLine.slice(errorColumn - LIMIT); errorColumn = 4 + LIMIT; } if (erroneousLine.length - errorColumn > LIMIT) { erroneousLine = erroneousLine.slice(0, errorColumn + LIMIT) + ' ...'; } var message = '\n\n' + erroneousLine + '\n'; message += new Array(errorColumn - 1).join(' ') + '^'; return message; } /** * Actually transform the code. * * @param {string} code * @param {string?} url * @param {object?} options * @return {string} The transformed code. * @internal */ function transformCode(code, url, options) { try { var transformed = transformReact(code, options); } catch(e) { e.message += '\n at '; if (url) { if ('fileName' in e) { // We set `fileName` if it's supported by this error object and // a `url` was provided. // The error will correctly point to `url` in Firefox. e.fileName = url; } e.message += url + ':' + e.lineNumber + ':' + e.column; } else { e.message += location.href; } e.message += createSourceCodeErrorMessage(code, e); throw e; } if (!transformed.sourceMap) { return transformed.code; } var map = transformed.sourceMap.toJSON(); var source; if (url == null) { source = "Inline JSX script"; inlineScriptCount++; if (inlineScriptCount > 1) { source += ' (' + inlineScriptCount + ')'; } } else if (dummyAnchor) { // Firefox has problems when the sourcemap source is a proper URL with a // protocol and hostname, so use the pathname. We could use just the // filename, but hopefully using the full path will prevent potential // issues where the same filename exists in multiple directories. dummyAnchor.href = url; source = dummyAnchor.pathname.substr(1); } map.sources = [source]; map.sourcesContent = [code]; return ( transformed.code + '\n//# sourceMappingURL=data:application/json;base64,' + buffer.Buffer(JSON.stringify(map)).toString('base64') ); } /** * Appends a script element at the end of the <head> with the content of code, * after transforming it. * * @param {string} code The original source code * @param {string?} url Where the code came from. null if inline * @param {object?} options Options to pass to jstransform * @internal */ function run(code, url, options) { var scriptEl = document.createElement('script'); scriptEl.text = transformCode(code, url, options); headEl.appendChild(scriptEl); } /** * Load script from the provided url and pass the content to the callback. * * @param {string} url The location of the script src * @param {function} callback Function to call with the content of url * @internal */ function load(url, successCallback, errorCallback) { var xhr; xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest(); // async, however scripts will be executed in the order they are in the // DOM to mirror normal script loading. xhr.open('GET', url, true); if ('overrideMimeType' in xhr) { xhr.overrideMimeType('text/plain'); } xhr.onreadystatechange = function() { if (xhr.readyState === 4) { if (xhr.status === 0 || xhr.status === 200) { successCallback(xhr.responseText); } else { errorCallback(); throw new Error("Could not load " + url); } } }; return xhr.send(null); } /** * Loop over provided script tags and get the content, via innerHTML if an * inline script, or by using XHR. Transforms are applied if needed. The scripts * are executed in the order they are found on the page. * * @param {array} scripts The <script> elements to load and run. * @internal */ function loadScripts(scripts) { var result = []; var count = scripts.length; function check() { var script, i; for (i = 0; i < count; i++) { script = result[i]; if (script.loaded && !script.executed) { script.executed = true; run(script.content, script.url, script.options); } else if (!script.loaded && !script.error && !script.async) { break; } } } scripts.forEach(function(script, i) { var options = { sourceMap: true }; if (/;harmony=true(;|$)/.test(script.type)) { options.harmony = true } // script.async is always true for non-javascript script tags var async = script.hasAttribute('async'); if (script.src) { result[i] = { async: async, error: false, executed: false, content: null, loaded: false, url: script.src, options: options }; load(script.src, function(content) { result[i].loaded = true; result[i].content = content; check(); }, function() { result[i].error = true; check(); }); } else { result[i] = { async: async, error: false, executed: false, content: script.innerHTML, loaded: true, url: null, options: options }; } }); check(); } /** * Find and run all script tags with type="text/jsx". * * @internal */ function runScripts() { var scripts = document.getElementsByTagName('script'); // Array.prototype.slice cannot be used on NodeList on IE8 var jsxScripts = []; for (var i = 0; i < scripts.length; i++) { if (/^text\/jsx(;|$)/.test(scripts.item(i).type)) { jsxScripts.push(scripts.item(i)); } } if (jsxScripts.length < 1) { return; } console.warn( 'You are using the in-browser JSX transformer. Be sure to precompile ' + 'your JSX for production - ' + 'http://facebook.github.io/react/docs/tooling-integration.html#jsx' ); loadScripts(jsxScripts); } // Listen for load event if we're in a browser and then kick off finding and // running of scripts. if (typeof window !== "undefined" && window !== null) { headEl = document.getElementsByTagName('head')[0]; dummyAnchor = document.createElement('a'); if (window.addEventListener) { window.addEventListener('DOMContentLoaded', runScripts, false); } else { window.attachEvent('onload', runScripts); } } module.exports = { transform: transformReact, exec: exec }; },{"./fbtransform/visitors":37,"buffer":2,"jstransform":21}],2:[function(_dereq_,module,exports){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ var base64 = _dereq_('base64-js') var ieee754 = _dereq_('ieee754') var isArray = _dereq_('is-array') exports.Buffer = Buffer exports.SlowBuffer = Buffer exports.INSPECT_MAX_BYTES = 50 Buffer.poolSize = 8192 // not used by this implementation var kMaxLength = 0x3fffffff /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Use Object implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * Note: * * - Implementation must support adding new properties to `Uint8Array` instances. * Firefox 4-29 lacked support, fixed in Firefox 30+. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. * * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. * * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of * incorrect length in some situations. * * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they will * get the Object implementation, which is slower but will work correctly. */ Buffer.TYPED_ARRAY_SUPPORT = (function () { try { var buf = new ArrayBuffer(0) var arr = new Uint8Array(buf) arr.foo = function () { return 42 } return 42 === arr.foo() && // typed array instances can be augmented typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` new Uint8Array(1).subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` } catch (e) { return false } })() /** * Class: Buffer * ============= * * The Buffer constructor returns instances of `Uint8Array` that are augmented * with function properties for all the node `Buffer` API functions. We use * `Uint8Array` so that square bracket notation works as expected -- it returns * a single octet. * * By augmenting the instances, we can avoid modifying the `Uint8Array` * prototype. */ function Buffer (subject, encoding, noZero) { if (!(this instanceof Buffer)) return new Buffer(subject, encoding, noZero) var type = typeof subject // Find the length var length if (type === 'number') length = subject > 0 ? subject >>> 0 : 0 else if (type === 'string') { if (encoding === 'base64') subject = base64clean(subject) length = Buffer.byteLength(subject, encoding) } else if (type === 'object' && subject !== null) { // assume object is array-like if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data length = +subject.length > 0 ? Math.floor(+subject.length) : 0 } else throw new TypeError('must start with number, buffer, array or string') if (this.length > kMaxLength) throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength.toString(16) + ' bytes') var buf if (Buffer.TYPED_ARRAY_SUPPORT) { // Preferred: Return an augmented `Uint8Array` instance for best performance buf = Buffer._augment(new Uint8Array(length)) } else { // Fallback: Return THIS instance of Buffer (created by `new`) buf = this buf.length = length buf._isBuffer = true } var i if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') { // Speed optimization -- use set if we're copying from a typed array buf._set(subject) } else if (isArrayish(subject)) { // Treat array-ish objects as a byte array if (Buffer.isBuffer(subject)) { for (i = 0; i < length; i++) buf[i] = subject.readUInt8(i) } else { for (i = 0; i < length; i++) buf[i] = ((subject[i] % 256) + 256) % 256 } } else if (type === 'string') { buf.write(subject, 0, encoding) } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT && !noZero) { for (i = 0; i < length; i++) { buf[i] = 0 } } return buf } Buffer.isBuffer = function (b) { return !!(b != null && b._isBuffer) } Buffer.compare = function (a, b) { if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) throw new TypeError('Arguments must be Buffers') var x = a.length var y = b.length for (var i = 0, len = Math.min(x, y); i < len && a[i] === b[i]; i++) {} if (i !== len) { x = a[i] y = b[i] } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function (encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'raw': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true default: return false } } Buffer.concat = function (list, totalLength) { if (!isArray(list)) throw new TypeError('Usage: Buffer.concat(list[, length])') if (list.length === 0) { return new Buffer(0) } else if (list.length === 1) { return list[0] } var i if (totalLength === undefined) { totalLength = 0 for (i = 0; i < list.length; i++) { totalLength += list[i].length } } var buf = new Buffer(totalLength) var pos = 0 for (i = 0; i < list.length; i++) { var item = list[i] item.copy(buf, pos) pos += item.length } return buf } Buffer.byteLength = function (str, encoding) { var ret str = str + '' switch (encoding || 'utf8') { case 'ascii': case 'binary': case 'raw': ret = str.length break case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': ret = str.length * 2 break case 'hex': ret = str.length >>> 1 break case 'utf8': case 'utf-8': ret = utf8ToBytes(str).length break case 'base64': ret = base64ToBytes(str).length break default: ret = str.length } return ret } // pre-set for values that may exist in the future Buffer.prototype.length = undefined Buffer.prototype.parent = undefined // toString(encoding, start=0, end=buffer.length) Buffer.prototype.toString = function (encoding, start, end) { var loweredCase = false start = start >>> 0 end = end === undefined || end === Infinity ? this.length : end >>> 0 if (!encoding) encoding = 'utf8' if (start < 0) start = 0 if (end > this.length) end = this.length if (end <= start) return '' while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end) case 'utf8': case 'utf-8': return utf8Slice(this, start, end) case 'ascii': return asciiSlice(this, start, end) case 'binary': return binarySlice(this, start, end) case 'base64': return base64Slice(this, start, end) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = (encoding + '').toLowerCase() loweredCase = true } } } Buffer.prototype.equals = function (b) { if(!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function () { var str = '' var max = exports.INSPECT_MAX_BYTES if (this.length > 0) { str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') if (this.length > max) str += ' ... ' } return '<Buffer ' + str + '>' } Buffer.prototype.compare = function (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') return Buffer.compare(this, b) } // `get` will be removed in Node 0.13+ Buffer.prototype.get = function (offset) { console.log('.get() is deprecated. Access using array indexes instead.') return this.readUInt8(offset) } // `set` will be removed in Node 0.13+ Buffer.prototype.set = function (v, offset) { console.log('.set() is deprecated. Access using array indexes instead.') return this.writeUInt8(v, offset) } function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 var remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } // must be an even number of digits var strLen = string.length if (strLen % 2 !== 0) throw new Error('Invalid hex string') if (length > strLen / 2) { length = strLen / 2 } for (var i = 0; i < length; i++) { var byte = parseInt(string.substr(i * 2, 2), 16) if (isNaN(byte)) throw new Error('Invalid hex string') buf[offset + i] = byte } return i } function utf8Write (buf, string, offset, length) { var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length) return charsWritten } function asciiWrite (buf, string, offset, length) { var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length) return charsWritten } function binaryWrite (buf, string, offset, length) { return asciiWrite(buf, string, offset, length) } function base64Write (buf, string, offset, length) { var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length) return charsWritten } function utf16leWrite (buf, string, offset, length) { var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length) return charsWritten } Buffer.prototype.write = function (string, offset, length, encoding) { // Support both (string, offset, length, encoding) // and the legacy (string, encoding, offset, length) if (isFinite(offset)) { if (!isFinite(length)) { encoding = length length = undefined } } else { // legacy var swap = encoding encoding = offset offset = length length = swap } offset = Number(offset) || 0 var remaining = this.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } encoding = String(encoding || 'utf8').toLowerCase() var ret switch (encoding) { case 'hex': ret = hexWrite(this, string, offset, length) break case 'utf8': case 'utf-8': ret = utf8Write(this, string, offset, length) break case 'ascii': ret = asciiWrite(this, string, offset, length) break case 'binary': ret = binaryWrite(this, string, offset, length) break case 'base64': ret = base64Write(this, string, offset, length) break case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': ret = utf16leWrite(this, string, offset, length) break default: throw new TypeError('Unknown encoding: ' + encoding) } return ret } Buffer.prototype.toJSON = function () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } } function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } } function utf8Slice (buf, start, end) { var res = '' var tmp = '' end = Math.min(buf.length, end) for (var i = start; i < end; i++) { if (buf[i] <= 0x7F) { res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]) tmp = '' } else { tmp += '%' + buf[i].toString(16) } } return res + decodeUtf8Char(tmp) } function asciiSlice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; i++) { ret += String.fromCharCode(buf[i]) } return ret } function binarySlice (buf, start, end) { return asciiSlice(buf, start, end) } function hexSlice (buf, start, end) { var len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len var out = '' for (var i = start; i < end; i++) { out += toHex(buf[i]) } return out } function utf16leSlice (buf, start, end) { var bytes = buf.slice(start, end) var res = '' for (var i = 0; i < bytes.length; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) } return res } Buffer.prototype.slice = function (start, end) { var len = this.length start = ~~start end = end === undefined ? len : ~~end if (start < 0) { start += len; if (start < 0) start = 0 } else if (start > len) { start = len } if (end < 0) { end += len if (end < 0) end = 0 } else if (end > len) { end = len } if (end < start) end = start if (Buffer.TYPED_ARRAY_SUPPORT) { return Buffer._augment(this.subarray(start, end)) } else { var sliceLen = end - start var newBuf = new Buffer(sliceLen, undefined, true) for (var i = 0; i < sliceLen; i++) { newBuf[i] = this[i + start] } return newBuf } } /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } Buffer.prototype.readUInt8 = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUInt16LE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | (this[offset + 1] << 8) } Buffer.prototype.readUInt16BE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return (this[offset] << 8) | this[offset + 1] } Buffer.prototype.readUInt32LE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ((this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16)) + (this[offset + 3] * 0x1000000) } Buffer.prototype.readUInt32BE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] * 0x1000000) + ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3]) } Buffer.prototype.readInt8 = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) if (!(this[offset] & 0x80)) return (this[offset]) return ((0xff - this[offset] + 1) * -1) } Buffer.prototype.readInt16LE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset] | (this[offset + 1] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt16BE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset + 1] | (this[offset] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt32LE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16) | (this[offset + 3] << 24) } Buffer.prototype.readInt32BE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] << 24) | (this[offset + 1] << 16) | (this[offset + 2] << 8) | (this[offset + 3]) } Buffer.prototype.readFloatLE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, false, 52, 8) } function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance') if (value > max || value < min) throw new TypeError('value is out of bounds') if (offset + ext > buf.length) throw new TypeError('index out of range') } Buffer.prototype.writeUInt8 = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) this[offset] = value return offset + 1 } function objectWriteUInt16 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> (littleEndian ? i : 1 - i) * 8 } } Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value this[offset + 1] = (value >>> 8) } else objectWriteUInt16(this, value, offset, true) return offset + 2 } Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = value } else objectWriteUInt16(this, value, offset, false) return offset + 2 } function objectWriteUInt32 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffffffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff } } Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset + 3] = (value >>> 24) this[offset + 2] = (value >>> 16) this[offset + 1] = (value >>> 8) this[offset] = value } else objectWriteUInt32(this, value, offset, true) return offset + 4 } Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = value } else objectWriteUInt32(this, value, offset, false) return offset + 4 } Buffer.prototype.writeInt8 = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) if (value < 0) value = 0xff + value + 1 this[offset] = value return offset + 1 } Buffer.prototype.writeInt16LE = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value this[offset + 1] = (value >>> 8) } else objectWriteUInt16(this, value, offset, true) return offset + 2 } Buffer.prototype.writeInt16BE = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = value } else objectWriteUInt16(this, value, offset, false) return offset + 2 } Buffer.prototype.writeInt32LE = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = value this[offset + 1] = (value >>> 8) this[offset + 2] = (value >>> 16) this[offset + 3] = (value >>> 24) } else objectWriteUInt32(this, value, offset, true) return offset + 4 } Buffer.prototype.writeInt32BE = function (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (value < 0) value = 0xffffffff + value + 1 if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = value } else objectWriteUInt32(this, value, offset, false) return offset + 4 } function checkIEEE754 (buf, value, offset, ext, max, min) { if (value > max || value < min) throw new TypeError('value is out of bounds') if (offset + ext > buf.length) throw new TypeError('index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { if (!noAssert) checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) ieee754.write(buf, value, offset, littleEndian, 23, 4) return offset + 4 } Buffer.prototype.writeFloatLE = function (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function (value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert) } function writeDouble (buf, value, offset, littleEndian, noAssert) { if (!noAssert) checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) ieee754.write(buf, value, offset, littleEndian, 52, 8) return offset + 8 } Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function (target, target_start, start, end) { var source = this if (!start) start = 0 if (!end && end !== 0) end = this.length if (!target_start) target_start = 0 // Copy 0 bytes; we're done if (end === start) return if (target.length === 0 || source.length === 0) return // Fatal error conditions if (end < start) throw new TypeError('sourceEnd < sourceStart') if (target_start < 0 || target_start >= target.length) throw new TypeError('targetStart out of bounds') if (start < 0 || start >= source.length) throw new TypeError('sourceStart out of bounds') if (end < 0 || end > source.length) throw new TypeError('sourceEnd out of bounds') // Are we oob? if (end > this.length) end = this.length if (target.length - target_start < end - start) end = target.length - target_start + start var len = end - start if (len < 100 || !Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < len; i++) { target[i + target_start] = this[i + start] } } else { target._set(this.subarray(start, start + len), target_start) } } // fill(value, start=0, end=buffer.length) Buffer.prototype.fill = function (value, start, end) { if (!value) value = 0 if (!start) start = 0 if (!end) end = this.length if (end < start) throw new TypeError('end < start') // Fill 0 bytes; we're done if (end === start) return if (this.length === 0) return if (start < 0 || start >= this.length) throw new TypeError('start out of bounds') if (end < 0 || end > this.length) throw new TypeError('end out of bounds') var i if (typeof value === 'number') { for (i = start; i < end; i++) { this[i] = value } } else { var bytes = utf8ToBytes(value.toString()) var len = bytes.length for (i = start; i < end; i++) { this[i] = bytes[i % len] } } return this } /** * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. * Added in Node 0.12. Only available in browsers that support ArrayBuffer. */ Buffer.prototype.toArrayBuffer = function () { if (typeof Uint8Array !== 'undefined') { if (Buffer.TYPED_ARRAY_SUPPORT) { return (new Buffer(this)).buffer } else { var buf = new Uint8Array(this.length) for (var i = 0, len = buf.length; i < len; i += 1) { buf[i] = this[i] } return buf.buffer } } else { throw new TypeError('Buffer.toArrayBuffer not supported in this browser') } } // HELPER FUNCTIONS // ================ var BP = Buffer.prototype /** * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods */ Buffer._augment = function (arr) { arr._isBuffer = true // save reference to original Uint8Array get/set methods before overwriting arr._get = arr.get arr._set = arr.set // deprecated, will be removed in node 0.13+ arr.get = BP.get arr.set = BP.set arr.write = BP.write arr.toString = BP.toString arr.toLocaleString = BP.toString arr.toJSON = BP.toJSON arr.equals = BP.equals arr.compare = BP.compare arr.copy = BP.copy arr.slice = BP.slice arr.readUInt8 = BP.readUInt8 arr.readUInt16LE = BP.readUInt16LE arr.readUInt16BE = BP.readUInt16BE arr.readUInt32LE = BP.readUInt32LE arr.readUInt32BE = BP.readUInt32BE arr.readInt8 = BP.readInt8 arr.readInt16LE = BP.readInt16LE arr.readInt16BE = BP.readInt16BE arr.readInt32LE = BP.readInt32LE arr.readInt32BE = BP.readInt32BE arr.readFloatLE = BP.readFloatLE arr.readFloatBE = BP.readFloatBE arr.readDoubleLE = BP.readDoubleLE arr.readDoubleBE = BP.readDoubleBE arr.writeUInt8 = BP.writeUInt8 arr.writeUInt16LE = BP.writeUInt16LE arr.writeUInt16BE = BP.writeUInt16BE arr.writeUInt32LE = BP.writeUInt32LE arr.writeUInt32BE = BP.writeUInt32BE arr.writeInt8 = BP.writeInt8 arr.writeInt16LE = BP.writeInt16LE arr.writeInt16BE = BP.writeInt16BE arr.writeInt32LE = BP.writeInt32LE arr.writeInt32BE = BP.writeInt32BE arr.writeFloatLE = BP.writeFloatLE arr.writeFloatBE = BP.writeFloatBE arr.writeDoubleLE = BP.writeDoubleLE arr.writeDoubleBE = BP.writeDoubleBE arr.fill = BP.fill arr.inspect = BP.inspect arr.toArrayBuffer = BP.toArrayBuffer return arr } var INVALID_BASE64_RE = /[^+\/0-9A-z]/g function base64clean (str) { // Node strips out invalid characters like \n and \t from the string, base64-js does not str = stringtrim(str).replace(INVALID_BASE64_RE, '') // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '=' } return str } function stringtrim (str) { if (str.trim) return str.trim() return str.replace(/^\s+|\s+$/g, '') } function isArrayish (subject) { return isArray(subject) || Buffer.isBuffer(subject) || subject && typeof subject === 'object' && typeof subject.length === 'number' } function toHex (n) { if (n < 16) return '0' + n.toString(16) return n.toString(16) } function utf8ToBytes (str) { var byteArray = [] for (var i = 0; i < str.length; i++) { var b = str.charCodeAt(i) if (b <= 0x7F) { byteArray.push(b) } else { var start = i if (b >= 0xD800 && b <= 0xDFFF) i++ var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%') for (var j = 0; j < h.length; j++) { byteArray.push(parseInt(h[j], 16)) } } } return byteArray } function asciiToBytes (str) { var byteArray = [] for (var i = 0; i < str.length; i++) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF) } return byteArray } function utf16leToBytes (str) { var c, hi, lo var byteArray = [] for (var i = 0; i < str.length; i++) { c = str.charCodeAt(i) hi = c >> 8 lo = c % 256 byteArray.push(lo) byteArray.push(hi) } return byteArray } function base64ToBytes (str) { return base64.toByteArray(str) } function blitBuffer (src, dst, offset, length) { for (var i = 0; i < length; i++) { if ((i + offset >= dst.length) || (i >= src.length)) break dst[i + offset] = src[i] } return i } function decodeUtf8Char (str) { try { return decodeURIComponent(str) } catch (err) { return String.fromCharCode(0xFFFD) // UTF 8 invalid char } } },{"base64-js":3,"ieee754":4,"is-array":5}],3:[function(_dereq_,module,exports){ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; ;(function (exports) { 'use strict'; var Arr = (typeof Uint8Array !== 'undefined') ? Uint8Array : Array var PLUS = '+'.charCodeAt(0) var SLASH = '/'.charCodeAt(0) var NUMBER = '0'.charCodeAt(0) var LOWER = 'a'.charCodeAt(0) var UPPER = 'A'.charCodeAt(0) function decode (elt) { var code = elt.charCodeAt(0) if (code === PLUS) return 62 // '+' if (code === SLASH) return 63 // '/' if (code < NUMBER) return -1 //no match if (code < NUMBER + 10) return code - NUMBER + 26 + 26 if (code < UPPER + 26) return code - UPPER if (code < LOWER + 26) return code - LOWER + 26 } function b64ToByteArray (b64) { var i, j, l, tmp, placeHolders, arr if (b64.length % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } // the number of equal signs (place holders) // if there are two placeholders, than the two characters before it // represent one byte // if there is only one, then the three characters before it represent 2 bytes // this is just a cheap hack to not do indexOf twice var len = b64.length placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 // base64 is 4/3 + up to two characters of the original data arr = new Arr(b64.length * 3 / 4 - placeHolders) // if there are placeholders, only get up to the last complete 4 chars l = placeHolders > 0 ? b64.length - 4 : b64.length var L = 0 function push (v) { arr[L++] = v } for (i = 0, j = 0; i < l; i += 4, j += 3) { tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) push((tmp & 0xFF0000) >> 16) push((tmp & 0xFF00) >> 8) push(tmp & 0xFF) } if (placeHolders === 2) { tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) push(tmp & 0xFF) } else if (placeHolders === 1) { tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) push((tmp >> 8) & 0xFF) push(tmp & 0xFF) } return arr } function uint8ToBase64 (uint8) { var i, extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes output = "", temp, length function encode (num) { return lookup.charAt(num) } function tripletToBase64 (num) { return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) } // go through the array every three bytes, we'll deal with trailing stuff later for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) output += tripletToBase64(temp) } // pad the end with zeros, but make sure to not forget the extra bytes switch (extraBytes) { case 1: temp = uint8[uint8.length - 1] output += encode(temp >> 2) output += encode((temp << 4) & 0x3F) output += '==' break case 2: temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) output += encode(temp >> 10) output += encode((temp >> 4) & 0x3F) output += encode((temp << 2) & 0x3F) output += '=' break } return output } exports.toByteArray = b64ToByteArray exports.fromByteArray = uint8ToBase64 }(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) },{}],4:[function(_dereq_,module,exports){ exports.read = function(buffer, offset, isLE, mLen, nBytes) { var e, m, eLen = nBytes * 8 - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, nBits = -7, i = isLE ? (nBytes - 1) : 0, d = isLE ? -1 : 1, s = buffer[offset + i]; i += d; e = s & ((1 << (-nBits)) - 1); s >>= (-nBits); nBits += eLen; for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); m = e & ((1 << (-nBits)) - 1); e >>= (-nBits); nBits += mLen; for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); if (e === 0) { e = 1 - eBias; } else if (e === eMax) { return m ? NaN : ((s ? -1 : 1) * Infinity); } else { m = m + Math.pow(2, mLen); e = e - eBias; } return (s ? -1 : 1) * m * Math.pow(2, e - mLen); }; exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { var e, m, c, eLen = nBytes * 8 - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), i = isLE ? 0 : (nBytes - 1), d = isLE ? 1 : -1, s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; value = Math.abs(value); if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0; e = eMax; } else { e = Math.floor(Math.log(value) / Math.LN2); if (value * (c = Math.pow(2, -e)) < 1) { e--; c *= 2; } if (e + eBias >= 1) { value += rt / c; } else { value += rt * Math.pow(2, 1 - eBias); } if (value * c >= 2) { e++; c /= 2; } if (e + eBias >= eMax) { m = 0; e = eMax; } else if (e + eBias >= 1) { m = (value * c - 1) * Math.pow(2, mLen); e = e + eBias; } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); e = 0; } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8); e = (e << mLen) | m; eLen += mLen; for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8); buffer[offset + i - d] |= s * 128; }; },{}],5:[function(_dereq_,module,exports){ /** * isArray */ var isArray = Array.isArray; /** * toString */ var str = Object.prototype.toString; /** * Whether or not the given `val` * is an array. * * example: * * isArray([]); * // > true * isArray(arguments); * // > false * isArray(''); * // > false * * @param {mixed} val * @return {bool} */ module.exports = isArray || function (val) { return !! val && '[object Array]' == str.call(val); }; },{}],6:[function(_dereq_,module,exports){ (function (process){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // resolves . and .. elements in a path array with directory names there // must be no slashes, empty elements, or device names (c:\) in the array // (so also no leading and trailing slashes - it does not distinguish // relative and absolute paths) function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = parts.length - 1; i >= 0; i--) { var last = parts[i]; if (last === '.') { parts.splice(i, 1); } else if (last === '..') { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; } // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; var splitPath = function(filename) { return splitPathRe.exec(filename).slice(1); }; // path.resolve([from ...], to) // posix version exports.resolve = function() { var resolvedPath = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = (i >= 0) ? arguments[i] : process.cwd(); // Skip empty and invalid entries if (typeof path !== 'string') { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } resolvedPath = path + '/' + resolvedPath; resolvedAbsolute = path.charAt(0) === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { return !!p; }), !resolvedAbsolute).join('/'); return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; }; // path.normalize(path) // posix version exports.normalize = function(path) { var isAbsolute = exports.isAbsolute(path), trailingSlash = substr(path, -1) === '/'; // Normalize the path path = normalizeArray(filter(path.split('/'), function(p) { return !!p; }), !isAbsolute).join('/'); if (!path && !isAbsolute) { path = '.'; } if (path && trailingSlash) { path += '/'; } return (isAbsolute ? '/' : '') + path; }; // posix version exports.isAbsolute = function(path) { return path.charAt(0) === '/'; }; // posix version exports.join = function() { var paths = Array.prototype.slice.call(arguments, 0); return exports.normalize(filter(paths, function(p, index) { if (typeof p !== 'string') { throw new TypeError('Arguments to path.join must be strings'); } return p; }).join('/')); }; // path.relative(from, to) // posix version exports.relative = function(from, to) { from = exports.resolve(from).substr(1); to = exports.resolve(to).substr(1); function trim(arr) { var start = 0; for (; start < arr.length; start++) { if (arr[start] !== '') break; } var end = arr.length - 1; for (; end >= 0; end--) { if (arr[end] !== '') break; } if (start > end) return []; return arr.slice(start, end - start + 1); } var fromParts = trim(from.split('/')); var toParts = trim(to.split('/')); var length = Math.min(fromParts.length, toParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); }; exports.sep = '/'; exports.delimiter = ':'; exports.dirname = function(path) { var result = splitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.substr(0, dir.length - 1); } return root + dir; }; exports.basename = function(path, ext) { var f = splitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; exports.extname = function(path) { return splitPath(path)[3]; }; function filter (xs, f) { if (xs.filter) return xs.filter(f); var res = []; for (var i = 0; i < xs.length; i++) { if (f(xs[i], i, xs)) res.push(xs[i]); } return res; } // String.prototype.substr - negative index don't work in IE8 var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) { return str.substr(start, len) } : function (str, start, len) { if (start < 0) start = str.length + start; return str.substr(start, len); } ; }).call(this,_dereq_('_process')) },{"_process":7}],7:[function(_dereq_,module,exports){ // shim for using process in browser var process = module.exports = {}; process.nextTick = (function () { var canSetImmediate = typeof window !== 'undefined' && window.setImmediate; var canMutationObserver = typeof window !== 'undefined' && window.MutationObserver; var canPost = typeof window !== 'undefined' && window.postMessage && window.addEventListener ; if (canSetImmediate) { return function (f) { return window.setImmediate(f) }; } var queue = []; if (canMutationObserver) { var hiddenDiv = document.createElement("div"); var observer = new MutationObserver(function () { var queueList = queue.slice(); queue.length = 0; queueList.forEach(function (fn) { fn(); }); }); observer.observe(hiddenDiv, { attributes: true }); return function nextTick(fn) { if (!queue.length) { hiddenDiv.setAttribute('yes', 'no'); } queue.push(fn); }; } if (canPost) { window.addEventListener('message', function (ev) { var source = ev.source; if ((source === window || source === null) && ev.data === 'process-tick') { ev.stopPropagation(); if (queue.length > 0) { var fn = queue.shift(); fn(); } } }, true); return function nextTick(fn) { queue.push(fn); window.postMessage('process-tick', '*'); }; } return function nextTick(fn) { setTimeout(fn, 0); }; })(); process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); }; // TODO(shtylman) process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; },{}],8:[function(_dereq_,module,exports){ /* Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com> Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com> Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com> Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be> Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl> Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com> Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com> Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com> Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*jslint bitwise:true plusplus:true */ /*global esprima:true, define:true, exports:true, window: true, throwError: true, generateStatement: true, peek: true, parseAssignmentExpression: true, parseBlock: true, parseClassExpression: true, parseClassDeclaration: true, parseExpression: true, parseForStatement: true, parseFunctionDeclaration: true, parseFunctionExpression: true, parseFunctionSourceElements: true, parseVariableIdentifier: true, parseImportSpecifier: true, parseLeftHandSideExpression: true, parseParams: true, validateParam: true, parseSpreadOrAssignmentExpression: true, parseStatement: true, parseSourceElement: true, parseModuleBlock: true, parseConciseBody: true, advanceXJSChild: true, isXJSIdentifierStart: true, isXJSIdentifierPart: true, scanXJSStringLiteral: true, scanXJSIdentifier: true, parseXJSAttributeValue: true, parseXJSChild: true, parseXJSElement: true, parseXJSExpressionContainer: true, parseXJSEmptyExpression: true, parseTypeAnnotation: true, parseTypeAnnotatableIdentifier: true, parseYieldExpression: true */ (function (root, factory) { 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, // Rhino, and plain browser loading. if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { factory(exports); } else { factory((root.esprima = {})); } }(this, function (exports) { 'use strict'; var Token, TokenName, FnExprTokens, Syntax, PropertyKind, Messages, Regex, SyntaxTreeDelegate, XHTMLEntities, ClassPropertyType, source, strict, index, lineNumber, lineStart, length, delegate, lookahead, state, extra; Token = { BooleanLiteral: 1, EOF: 2, Identifier: 3, Keyword: 4, NullLiteral: 5, NumericLiteral: 6, Punctuator: 7, StringLiteral: 8, RegularExpression: 9, Template: 10, XJSIdentifier: 11, XJSText: 12 }; TokenName = {}; TokenName[Token.BooleanLiteral] = 'Boolean'; TokenName[Token.EOF] = '<end>'; TokenName[Token.Identifier] = 'Identifier'; TokenName[Token.Keyword] = 'Keyword'; TokenName[Token.NullLiteral] = 'Null'; TokenName[Token.NumericLiteral] = 'Numeric'; TokenName[Token.Punctuator] = 'Punctuator'; TokenName[Token.StringLiteral] = 'String'; TokenName[Token.XJSIdentifier] = 'XJSIdentifier'; TokenName[Token.XJSText] = 'XJSText'; TokenName[Token.RegularExpression] = 'RegularExpression'; // A function following one of those tokens is an expression. FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new', 'return', 'case', 'delete', 'throw', 'void', // assignment operators '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=', '&=', '|=', '^=', ',', // binary/unary operators '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&', '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=', '<=', '<', '>', '!=', '!==']; Syntax = { ArrayExpression: 'ArrayExpression', ArrayPattern: 'ArrayPattern', ArrowFunctionExpression: 'ArrowFunctionExpression', AssignmentExpression: 'AssignmentExpression', BinaryExpression: 'BinaryExpression', BlockStatement: 'BlockStatement', BreakStatement: 'BreakStatement', CallExpression: 'CallExpression', CatchClause: 'CatchClause', ClassBody: 'ClassBody', ClassDeclaration: 'ClassDeclaration', ClassExpression: 'ClassExpression', ClassProperty: 'ClassProperty', ComprehensionBlock: 'ComprehensionBlock', ComprehensionExpression: 'ComprehensionExpression', ConditionalExpression: 'ConditionalExpression', ContinueStatement: 'ContinueStatement', DebuggerStatement: 'DebuggerStatement', DoWhileStatement: 'DoWhileStatement', EmptyStatement: 'EmptyStatement', ExportDeclaration: 'ExportDeclaration', ExportBatchSpecifier: 'ExportBatchSpecifier', ExportSpecifier: 'ExportSpecifier', ExpressionStatement: 'ExpressionStatement', ForInStatement: 'ForInStatement', ForOfStatement: 'ForOfStatement', ForStatement: 'ForStatement', FunctionDeclaration: 'FunctionDeclaration', FunctionExpression: 'FunctionExpression', Identifier: 'Identifier', IfStatement: 'IfStatement', ImportDeclaration: 'ImportDeclaration', ImportSpecifier: 'ImportSpecifier', LabeledStatement: 'LabeledStatement', Literal: 'Literal', LogicalExpression: 'LogicalExpression', MemberExpression: 'MemberExpression', MethodDefinition: 'MethodDefinition', ModuleDeclaration: 'ModuleDeclaration', NewExpression: 'NewExpression', ObjectExpression: 'ObjectExpression', ObjectPattern: 'ObjectPattern', ObjectTypeAnnotation: 'ObjectTypeAnnotation', OptionalParameter: 'OptionalParameter', ParametricTypeAnnotation: 'ParametricTypeAnnotation', ParametricallyTypedIdentifier: 'ParametricallyTypedIdentifier', Program: 'Program', Property: 'Property', ReturnStatement: 'ReturnStatement', SequenceExpression: 'SequenceExpression', SpreadElement: 'SpreadElement', SpreadProperty: 'SpreadProperty', SwitchCase: 'SwitchCase', SwitchStatement: 'SwitchStatement', TaggedTemplateExpression: 'TaggedTemplateExpression', TemplateElement: 'TemplateElement', TemplateLiteral: 'TemplateLiteral', ThisExpression: 'ThisExpression', ThrowStatement: 'ThrowStatement', TryStatement: 'TryStatement', TypeAnnotatedIdentifier: 'TypeAnnotatedIdentifier', TypeAnnotation: 'TypeAnnotation', UnaryExpression: 'UnaryExpression', UpdateExpression: 'UpdateExpression', VariableDeclaration: 'VariableDeclaration', VariableDeclarator: 'VariableDeclarator', VoidTypeAnnotation: 'VoidTypeAnnotation', WhileStatement: 'WhileStatement', WithStatement: 'WithStatement', XJSIdentifier: 'XJSIdentifier', XJSNamespacedName: 'XJSNamespacedName', XJSMemberExpression: 'XJSMemberExpression', XJSEmptyExpression: 'XJSEmptyExpression', XJSExpressionContainer: 'XJSExpressionContainer', XJSElement: 'XJSElement', XJSClosingElement: 'XJSClosingElement', XJSOpeningElement: 'XJSOpeningElement', XJSAttribute: 'XJSAttribute', XJSSpreadAttribute: 'XJSSpreadAttribute', XJSText: 'XJSText', YieldExpression: 'YieldExpression' }; PropertyKind = { Data: 1, Get: 2, Set: 4 }; ClassPropertyType = { 'static': 'static', prototype: 'prototype' }; // Error messages should be identical to V8. Messages = { UnexpectedToken: 'Unexpected token %0', UnexpectedNumber: 'Unexpected number', UnexpectedString: 'Unexpected string', UnexpectedIdentifier: 'Unexpected identifier', UnexpectedReserved: 'Unexpected reserved word', UnexpectedTemplate: 'Unexpected quasi %0', UnexpectedEOS: 'Unexpected end of input', NewlineAfterThrow: 'Illegal newline after throw', InvalidRegExp: 'Invalid regular expression', UnterminatedRegExp: 'Invalid regular expression: missing /', InvalidLHSInAssignment: 'Invalid left-hand side in assignment', InvalidLHSInFormalsList: 'Invalid left-hand side in formals list', InvalidLHSInForIn: 'Invalid left-hand side in for-in', MultipleDefaultsInSwitch: 'More than one default clause in switch statement', NoCatchOrFinally: 'Missing catch or finally after try', UnknownLabel: 'Undefined label \'%0\'', Redeclaration: '%0 \'%1\' has already been declared', IllegalContinue: 'Illegal continue statement', IllegalBreak: 'Illegal break statement', IllegalDuplicateClassProperty: 'Illegal duplicate property in class definition', IllegalReturn: 'Illegal return statement', IllegalYield: 'Illegal yield expression', IllegalSpread: 'Illegal spread element', StrictModeWith: 'Strict mode code may not include a with statement', StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', StrictVarName: 'Variable name may not be eval or arguments in strict mode', StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', StrictParamDupe: 'Strict mode function may not have duplicate parameter names', ParameterAfterRestParameter: 'Rest parameter must be final parameter of an argument list', DefaultRestParameter: 'Rest parameter can not have a default value', ElementAfterSpreadElement: 'Spread must be the final element of an element list', PropertyAfterSpreadProperty: 'A rest property must be the final property of an object literal', ObjectPatternAsRestParameter: 'Invalid rest parameter', ObjectPatternAsSpread: 'Invalid spread argument', StrictFunctionName: 'Function name may not be eval or arguments in strict mode', StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', StrictDelete: 'Delete of an unqualified identifier in strict mode.', StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', StrictReservedWord: 'Use of future reserved word in strict mode', NewlineAfterModule: 'Illegal newline after module', NoFromAfterImport: 'Missing from after import', InvalidModuleSpecifier: 'Invalid module specifier', NestedModule: 'Module declaration can not be nested', NoUnintializedConst: 'Const must be initialized', ComprehensionRequiresBlock: 'Comprehension must have at least one block', ComprehensionError: 'Comprehension Error', EachNotAllowed: 'Each is not supported', InvalidXJSAttributeValue: 'XJS value should be either an expression or a quoted XJS text', ExpectedXJSClosingTag: 'Expected corresponding XJS closing tag for %0', AdjacentXJSElements: 'Adjacent XJS elements must be wrapped in an enclosing tag' }; // See also tools/generate-unicode-regex.py. Regex = { NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'), NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]') }; // Ensure the condition is true, otherwise throw an error. // This is only to have a better contract semantic, i.e. another safety net // to catch a logic error. The condition shall be fulfilled in normal case. // Do NOT use this to enforce a certain condition on any user input. function assert(condition, message) { if (!condition) { throw new Error('ASSERT: ' + message); } } function isDecimalDigit(ch) { return (ch >= 48 && ch <= 57); // 0..9 } function isHexDigit(ch) { return '0123456789abcdefABCDEF'.indexOf(ch) >= 0; } function isOctalDigit(ch) { return '01234567'.indexOf(ch) >= 0; } // 7.2 White Space function isWhiteSpace(ch) { return (ch === 32) || // space (ch === 9) || // tab (ch === 0xB) || (ch === 0xC) || (ch === 0xA0) || (ch >= 0x1680 && '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(String.fromCharCode(ch)) > 0); } // 7.3 Line Terminators function isLineTerminator(ch) { return (ch === 10) || (ch === 13) || (ch === 0x2028) || (ch === 0x2029); } // 7.6 Identifier Names and Identifiers function isIdentifierStart(ch) { return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore) (ch >= 65 && ch <= 90) || // A..Z (ch >= 97 && ch <= 122) || // a..z (ch === 92) || // \ (backslash) ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))); } function isIdentifierPart(ch) { return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore) (ch >= 65 && ch <= 90) || // A..Z (ch >= 97 && ch <= 122) || // a..z (ch >= 48 && ch <= 57) || // 0..9 (ch === 92) || // \ (backslash) ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))); } // 7.6.1.2 Future Reserved Words function isFutureReservedWord(id) { switch (id) { case 'class': case 'enum': case 'export': case 'extends': case 'import': case 'super': return true; default: return false; } } function isStrictModeReservedWord(id) { switch (id) { case 'implements': case 'interface': case 'package': case 'private': case 'protected': case 'public': case 'static': case 'yield': case 'let': return true; default: return false; } } function isRestrictedWord(id) { return id === 'eval' || id === 'arguments'; } // 7.6.1.1 Keywords function isKeyword(id) { if (strict && isStrictModeReservedWord(id)) { return true; } // 'const' is specialized as Keyword in V8. // 'yield' is only treated as a keyword in strict mode. // 'let' is for compatiblity with SpiderMonkey and ES.next. // Some others are from future reserved words. switch (id.length) { case 2: return (id === 'if') || (id === 'in') || (id === 'do'); case 3: return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try') || (id === 'let'); case 4: return (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with') || (id === 'enum'); case 5: return (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw') || (id === 'const') || (id === 'class') || (id === 'super'); case 6: return (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch') || (id === 'export') || (id === 'import'); case 7: return (id === 'default') || (id === 'finally') || (id === 'extends'); case 8: return (id === 'function') || (id === 'continue') || (id === 'debugger'); case 10: return (id === 'instanceof'); default: return false; } } // 7.4 Comments function skipComment() { var ch, blockComment, lineComment; blockComment = false; lineComment = false; while (index < length) { ch = source.charCodeAt(index); if (lineComment) { ++index; if (isLineTerminator(ch)) { lineComment = false; if (ch === 13 && source.charCodeAt(index) === 10) { ++index; } ++lineNumber; lineStart = index; } } else if (blockComment) { if (isLineTerminator(ch)) { if (ch === 13) { ++index; } if (ch !== 13 || source.charCodeAt(index) === 10) { ++lineNumber; ++index; lineStart = index; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } } else { ch = source.charCodeAt(index++); if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } // Block comment ends with '*/' (char #42, char #47). if (ch === 42) { ch = source.charCodeAt(index); if (ch === 47) { ++index; blockComment = false; } } } } else if (ch === 47) { ch = source.charCodeAt(index + 1); // Line comment starts with '//' (char #47, char #47). if (ch === 47) { index += 2; lineComment = true; } else if (ch === 42) { // Block comment starts with '/*' (char #47, char #42). index += 2; blockComment = true; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } else { break; } } else if (isWhiteSpace(ch)) { ++index; } else if (isLineTerminator(ch)) { ++index; if (ch === 13 && source.charCodeAt(index) === 10) { ++index; } ++lineNumber; lineStart = index; } else { break; } } } function scanHexEscape(prefix) { var i, len, ch, code = 0; len = (prefix === 'u') ? 4 : 2; for (i = 0; i < len; ++i) { if (index < length && isHexDigit(source[index])) { ch = source[index++]; code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); } else { return ''; } } return String.fromCharCode(code); } function scanUnicodeCodePointEscape() { var ch, code, cu1, cu2; ch = source[index]; code = 0; // At least, one hex digit is required. if (ch === '}') { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } while (index < length) { ch = source[index++]; if (!isHexDigit(ch)) { break; } code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); } if (code > 0x10FFFF || ch !== '}') { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } // UTF-16 Encoding if (code <= 0xFFFF) { return String.fromCharCode(code); } cu1 = ((code - 0x10000) >> 10) + 0xD800; cu2 = ((code - 0x10000) & 1023) + 0xDC00; return String.fromCharCode(cu1, cu2); } function getEscapedIdentifier() { var ch, id; ch = source.charCodeAt(index++); id = String.fromCharCode(ch); // '\u' (char #92, char #117) denotes an escaped character. if (ch === 92) { if (source.charCodeAt(index) !== 117) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } ++index; ch = scanHexEscape('u'); if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } id = ch; } while (index < length) { ch = source.charCodeAt(index); if (!isIdentifierPart(ch)) { break; } ++index; id += String.fromCharCode(ch); // '\u' (char #92, char #117) denotes an escaped character. if (ch === 92) { id = id.substr(0, id.length - 1); if (source.charCodeAt(index) !== 117) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } ++index; ch = scanHexEscape('u'); if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } id += ch; } } return id; } function getIdentifier() { var start, ch; start = index++; while (index < length) { ch = source.charCodeAt(index); if (ch === 92) { // Blackslash (char #92) marks Unicode escape sequence. index = start; return getEscapedIdentifier(); } if (isIdentifierPart(ch)) { ++index; } else { break; } } return source.slice(start, index); } function scanIdentifier() { var start, id, type; start = index; // Backslash (char #92) starts an escaped character. id = (source.charCodeAt(index) === 92) ? getEscapedIdentifier() : getIdentifier(); // There is no keyword or literal with only one character. // Thus, it must be an identifier. if (id.length === 1) { type = Token.Identifier; } else if (isKeyword(id)) { type = Token.Keyword; } else if (id === 'null') { type = Token.NullLiteral; } else if (id === 'true' || id === 'false') { type = Token.BooleanLiteral; } else { type = Token.Identifier; } return { type: type, value: id, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } // 7.7 Punctuators function scanPunctuator() { var start = index, code = source.charCodeAt(index), code2, ch1 = source[index], ch2, ch3, ch4; switch (code) { // Check for most common single-character punctuators. case 40: // ( open bracket case 41: // ) close bracket case 59: // ; semicolon case 44: // , comma case 123: // { open curly brace case 125: // } close curly brace case 91: // [ case 93: // ] case 58: // : case 63: // ? case 126: // ~ ++index; if (extra.tokenize) { if (code === 40) { extra.openParenToken = extra.tokens.length; } else if (code === 123) { extra.openCurlyToken = extra.tokens.length; } } return { type: Token.Punctuator, value: String.fromCharCode(code), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; default: code2 = source.charCodeAt(index + 1); // '=' (char #61) marks an assignment or comparison operator. if (code2 === 61) { switch (code) { case 37: // % case 38: // & case 42: // *: case 43: // + case 45: // - case 47: // / case 60: // < case 62: // > case 94: // ^ case 124: // | index += 2; return { type: Token.Punctuator, value: String.fromCharCode(code) + String.fromCharCode(code2), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; case 33: // ! case 61: // = index += 2; // !== and === if (source.charCodeAt(index) === 61) { ++index; } return { type: Token.Punctuator, value: source.slice(start, index), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; default: break; } } break; } // Peek more characters. ch2 = source[index + 1]; ch3 = source[index + 2]; ch4 = source[index + 3]; // 4-character punctuator: >>>= if (ch1 === '>' && ch2 === '>' && ch3 === '>') { if (ch4 === '=') { index += 4; return { type: Token.Punctuator, value: '>>>=', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } } // 3-character punctuators: === !== >>> <<= >>= if (ch1 === '>' && ch2 === '>' && ch3 === '>') { index += 3; return { type: Token.Punctuator, value: '>>>', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '<' && ch2 === '<' && ch3 === '=') { index += 3; return { type: Token.Punctuator, value: '<<=', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '>' && ch2 === '>' && ch3 === '=') { index += 3; return { type: Token.Punctuator, value: '>>=', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '.' && ch2 === '.' && ch3 === '.') { index += 3; return { type: Token.Punctuator, value: '...', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } // Other 2-character punctuators: ++ -- << >> && || if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0)) { index += 2; return { type: Token.Punctuator, value: ch1 + ch2, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '=' && ch2 === '>') { index += 2; return { type: Token.Punctuator, value: '=>', lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { ++index; return { type: Token.Punctuator, value: ch1, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch1 === '.') { ++index; return { type: Token.Punctuator, value: ch1, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } // 7.8.3 Numeric Literals function scanHexLiteral(start) { var number = ''; while (index < length) { if (!isHexDigit(source[index])) { break; } number += source[index++]; } if (number.length === 0) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } if (isIdentifierStart(source.charCodeAt(index))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.NumericLiteral, value: parseInt('0x' + number, 16), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanOctalLiteral(prefix, start) { var number, octal; if (isOctalDigit(prefix)) { octal = true; number = '0' + source[index++]; } else { octal = false; ++index; number = ''; } while (index < length) { if (!isOctalDigit(source[index])) { break; } number += source[index++]; } if (!octal && number.length === 0) { // only 0o or 0O throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.NumericLiteral, value: parseInt(number, 8), octal: octal, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanNumericLiteral() { var number, start, ch, octal; ch = source[index]; assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point'); start = index; number = ''; if (ch !== '.') { number = source[index++]; ch = source[index]; // Hex number starts with '0x'. // Octal number starts with '0'. // Octal number in ES6 starts with '0o'. // Binary number in ES6 starts with '0b'. if (number === '0') { if (ch === 'x' || ch === 'X') { ++index; return scanHexLiteral(start); } if (ch === 'b' || ch === 'B') { ++index; number = ''; while (index < length) { ch = source[index]; if (ch !== '0' && ch !== '1') { break; } number += source[index++]; } if (number.length === 0) { // only 0b or 0B throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } if (index < length) { ch = source.charCodeAt(index); if (isIdentifierStart(ch) || isDecimalDigit(ch)) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } return { type: Token.NumericLiteral, value: parseInt(number, 2), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } if (ch === 'o' || ch === 'O' || isOctalDigit(ch)) { return scanOctalLiteral(ch, start); } // decimal number starts with '0' such as '09' is illegal. if (ch && isDecimalDigit(ch.charCodeAt(0))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } ch = source[index]; } if (ch === '.') { number += source[index++]; while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } ch = source[index]; } if (ch === 'e' || ch === 'E') { number += source[index++]; ch = source[index]; if (ch === '+' || ch === '-') { number += source[index++]; } if (isDecimalDigit(source.charCodeAt(index))) { while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } } else { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } if (isIdentifierStart(source.charCodeAt(index))) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.NumericLiteral, value: parseFloat(number), lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } // 7.8.4 String Literals function scanStringLiteral() { var str = '', quote, start, ch, code, unescaped, restore, octal = false; quote = source[index]; assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote'); start = index; ++index; while (index < length) { ch = source[index++]; if (ch === quote) { quote = ''; break; } else if (ch === '\\') { ch = source[index++]; if (!ch || !isLineTerminator(ch.charCodeAt(0))) { switch (ch) { case 'n': str += '\n'; break; case 'r': str += '\r'; break; case 't': str += '\t'; break; case 'u': case 'x': if (source[index] === '{') { ++index; str += scanUnicodeCodePointEscape(); } else { restore = index; unescaped = scanHexEscape(ch); if (unescaped) { str += unescaped; } else { index = restore; str += ch; } } break; case 'b': str += '\b'; break; case 'f': str += '\f'; break; case 'v': str += '\x0B'; break; default: if (isOctalDigit(ch)) { code = '01234567'.indexOf(ch); // \0 is not octal escape sequence if (code !== 0) { octal = true; } if (index < length && isOctalDigit(source[index])) { octal = true; code = code * 8 + '01234567'.indexOf(source[index++]); // 3 digits are only allowed when string starts // with 0, 1, 2, 3 if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) { code = code * 8 + '01234567'.indexOf(source[index++]); } } str += String.fromCharCode(code); } else { str += ch; } break; } } else { ++lineNumber; if (ch === '\r' && source[index] === '\n') { ++index; } lineStart = index; } } else if (isLineTerminator(ch.charCodeAt(0))) { break; } else { str += ch; } } if (quote !== '') { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.StringLiteral, value: str, octal: octal, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanTemplate() { var cooked = '', ch, start, terminated, tail, restore, unescaped, code, octal; terminated = false; tail = false; start = index; ++index; while (index < length) { ch = source[index++]; if (ch === '`') { tail = true; terminated = true; break; } else if (ch === '$') { if (source[index] === '{') { ++index; terminated = true; break; } cooked += ch; } else if (ch === '\\') { ch = source[index++]; if (!isLineTerminator(ch.charCodeAt(0))) { switch (ch) { case 'n': cooked += '\n'; break; case 'r': cooked += '\r'; break; case 't': cooked += '\t'; break; case 'u': case 'x': if (source[index] === '{') { ++index; cooked += scanUnicodeCodePointEscape(); } else { restore = index; unescaped = scanHexEscape(ch); if (unescaped) { cooked += unescaped; } else { index = restore; cooked += ch; } } break; case 'b': cooked += '\b'; break; case 'f': cooked += '\f'; break; case 'v': cooked += '\v'; break; default: if (isOctalDigit(ch)) { code = '01234567'.indexOf(ch); // \0 is not octal escape sequence if (code !== 0) { octal = true; } if (index < length && isOctalDigit(source[index])) { octal = true; code = code * 8 + '01234567'.indexOf(source[index++]); // 3 digits are only allowed when string starts // with 0, 1, 2, 3 if ('0123'.indexOf(ch) >= 0 && index < length && isOctalDigit(source[index])) { code = code * 8 + '01234567'.indexOf(source[index++]); } } cooked += String.fromCharCode(code); } else { cooked += ch; } break; } } else { ++lineNumber; if (ch === '\r' && source[index] === '\n') { ++index; } lineStart = index; } } else if (isLineTerminator(ch.charCodeAt(0))) { ++lineNumber; if (ch === '\r' && source[index] === '\n') { ++index; } lineStart = index; cooked += '\n'; } else { cooked += ch; } } if (!terminated) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } return { type: Token.Template, value: { cooked: cooked, raw: source.slice(start + 1, index - ((tail) ? 1 : 2)) }, tail: tail, octal: octal, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanTemplateElement(option) { var startsWith, template; lookahead = null; skipComment(); startsWith = (option.head) ? '`' : '}'; if (source[index] !== startsWith) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } template = scanTemplate(); peek(); return template; } function scanRegExp() { var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false; lookahead = null; skipComment(); start = index; ch = source[index]; assert(ch === '/', 'Regular expression literal must start with a slash'); str = source[index++]; while (index < length) { ch = source[index++]; str += ch; if (classMarker) { if (ch === ']') { classMarker = false; } } else { if (ch === '\\') { ch = source[index++]; // ECMA-262 7.8.5 if (isLineTerminator(ch.charCodeAt(0))) { throwError({}, Messages.UnterminatedRegExp); } str += ch; } else if (ch === '/') { terminated = true; break; } else if (ch === '[') { classMarker = true; } else if (isLineTerminator(ch.charCodeAt(0))) { throwError({}, Messages.UnterminatedRegExp); } } } if (!terminated) { throwError({}, Messages.UnterminatedRegExp); } // Exclude leading and trailing slash. pattern = str.substr(1, str.length - 2); flags = ''; while (index < length) { ch = source[index]; if (!isIdentifierPart(ch.charCodeAt(0))) { break; } ++index; if (ch === '\\' && index < length) { ch = source[index]; if (ch === 'u') { ++index; restore = index; ch = scanHexEscape('u'); if (ch) { flags += ch; for (str += '\\u'; restore < index; ++restore) { str += source[restore]; } } else { index = restore; flags += 'u'; str += '\\u'; } } else { str += '\\'; } } else { flags += ch; str += ch; } } try { value = new RegExp(pattern, flags); } catch (e) { throwError({}, Messages.InvalidRegExp); } peek(); if (extra.tokenize) { return { type: Token.RegularExpression, value: value, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } return { literal: str, value: value, range: [start, index] }; } function isIdentifierName(token) { return token.type === Token.Identifier || token.type === Token.Keyword || token.type === Token.BooleanLiteral || token.type === Token.NullLiteral; } function advanceSlash() { var prevToken, checkToken; // Using the following algorithm: // https://github.com/mozilla/sweet.js/wiki/design prevToken = extra.tokens[extra.tokens.length - 1]; if (!prevToken) { // Nothing before that: it cannot be a division. return scanRegExp(); } if (prevToken.type === 'Punctuator') { if (prevToken.value === ')') { checkToken = extra.tokens[extra.openParenToken - 1]; if (checkToken && checkToken.type === 'Keyword' && (checkToken.value === 'if' || checkToken.value === 'while' || checkToken.value === 'for' || checkToken.value === 'with')) { return scanRegExp(); } return scanPunctuator(); } if (prevToken.value === '}') { // Dividing a function by anything makes little sense, // but we have to check for that. if (extra.tokens[extra.openCurlyToken - 3] && extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') { // Anonymous function. checkToken = extra.tokens[extra.openCurlyToken - 4]; if (!checkToken) { return scanPunctuator(); } } else if (extra.tokens[extra.openCurlyToken - 4] && extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') { // Named function. checkToken = extra.tokens[extra.openCurlyToken - 5]; if (!checkToken) { return scanRegExp(); } } else { return scanPunctuator(); } // checkToken determines whether the function is // a declaration or an expression. if (FnExprTokens.indexOf(checkToken.value) >= 0) { // It is an expression. return scanPunctuator(); } // It is a declaration. return scanRegExp(); } return scanRegExp(); } if (prevToken.type === 'Keyword') { return scanRegExp(); } return scanPunctuator(); } function advance() { var ch; if (!state.inXJSChild) { skipComment(); } if (index >= length) { return { type: Token.EOF, lineNumber: lineNumber, lineStart: lineStart, range: [index, index] }; } if (state.inXJSChild) { return advanceXJSChild(); } ch = source.charCodeAt(index); // Very common: ( and ) and ; if (ch === 40 || ch === 41 || ch === 58) { return scanPunctuator(); } // String literal starts with single quote (#39) or double quote (#34). if (ch === 39 || ch === 34) { if (state.inXJSTag) { return scanXJSStringLiteral(); } return scanStringLiteral(); } if (state.inXJSTag && isXJSIdentifierStart(ch)) { return scanXJSIdentifier(); } if (ch === 96) { return scanTemplate(); } if (isIdentifierStart(ch)) { return scanIdentifier(); } // Dot (.) char #46 can also start a floating-point number, hence the need // to check the next character. if (ch === 46) { if (isDecimalDigit(source.charCodeAt(index + 1))) { return scanNumericLiteral(); } return scanPunctuator(); } if (isDecimalDigit(ch)) { return scanNumericLiteral(); } // Slash (/) char #47 can also start a regex. if (extra.tokenize && ch === 47) { return advanceSlash(); } return scanPunctuator(); } function lex() { var token; token = lookahead; index = token.range[1]; lineNumber = token.lineNumber; lineStart = token.lineStart; lookahead = advance(); index = token.range[1]; lineNumber = token.lineNumber; lineStart = token.lineStart; return token; } function peek() { var pos, line, start; pos = index; line = lineNumber; start = lineStart; lookahead = advance(); index = pos; lineNumber = line; lineStart = start; } function lookahead2() { var adv, pos, line, start, result; // If we are collecting the tokens, don't grab the next one yet. adv = (typeof extra.advance === 'function') ? extra.advance : advance; pos = index; line = lineNumber; start = lineStart; // Scan for the next immediate token. if (lookahead === null) { lookahead = adv(); } index = lookahead.range[1]; lineNumber = lookahead.lineNumber; lineStart = lookahead.lineStart; // Grab the token right after. result = adv(); index = pos; lineNumber = line; lineStart = start; return result; } function markerCreate() { if (!extra.loc && !extra.range) { return undefined; } skipComment(); return {offset: index, line: lineNumber, col: index - lineStart}; } function markerCreatePreserveWhitespace() { if (!extra.loc && !extra.range) { return undefined; } return {offset: index, line: lineNumber, col: index - lineStart}; } function processComment(node) { var lastChild, trailingComments, bottomRight = extra.bottomRightStack, last = bottomRight[bottomRight.length - 1]; if (node.type === Syntax.Program) { if (node.body.length > 0) { return; } } if (extra.trailingComments.length > 0) { if (extra.trailingComments[0].range[0] >= node.range[1]) { trailingComments = extra.trailingComments; extra.trailingComments = []; } else { extra.trailingComments.length = 0; } } else { if (last && last.trailingComments && last.trailingComments[0].range[0] >= node.range[1]) { trailingComments = last.trailingComments; delete last.trailingComments; } } // Eating the stack. if (last) { while (last && last.range[0] >= node.range[0]) { lastChild = last; last = bottomRight.pop(); } } if (lastChild) { if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) { node.leadingComments = lastChild.leadingComments; delete lastChild.leadingComments; } } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) { node.leadingComments = extra.leadingComments; extra.leadingComments = []; } if (trailingComments) { node.trailingComments = trailingComments; } bottomRight.push(node); } function markerApply(marker, node) { if (extra.range) { node.range = [marker.offset, index]; } if (extra.loc) { node.loc = { start: { line: marker.line, column: marker.col }, end: { line: lineNumber, column: index - lineStart } }; node = delegate.postProcess(node); } if (extra.attachComment) { processComment(node); } return node; } SyntaxTreeDelegate = { name: 'SyntaxTree', postProcess: function (node) { return node; }, createArrayExpression: function (elements) { return { type: Syntax.ArrayExpression, elements: elements }; }, createAssignmentExpression: function (operator, left, right) { return { type: Syntax.AssignmentExpression, operator: operator, left: left, right: right }; }, createBinaryExpression: function (operator, left, right) { var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression; return { type: type, operator: operator, left: left, right: right }; }, createBlockStatement: function (body) { return { type: Syntax.BlockStatement, body: body }; }, createBreakStatement: function (label) { return { type: Syntax.BreakStatement, label: label }; }, createCallExpression: function (callee, args) { return { type: Syntax.CallExpression, callee: callee, 'arguments': args }; }, createCatchClause: function (param, body) { return { type: Syntax.CatchClause, param: param, body: body }; }, createConditionalExpression: function (test, consequent, alternate) { return { type: Syntax.ConditionalExpression, test: test, consequent: consequent, alternate: alternate }; }, createContinueStatement: function (label) { return { type: Syntax.ContinueStatement, label: label }; }, createDebuggerStatement: function () { return { type: Syntax.DebuggerStatement }; }, createDoWhileStatement: function (body, test) { return { type: Syntax.DoWhileStatement, body: body, test: test }; }, createEmptyStatement: function () { return { type: Syntax.EmptyStatement }; }, createExpressionStatement: function (expression) { return { type: Syntax.ExpressionStatement, expression: expression }; }, createForStatement: function (init, test, update, body) { return { type: Syntax.ForStatement, init: init, test: test, update: update, body: body }; }, createForInStatement: function (left, right, body) { return { type: Syntax.ForInStatement, left: left, right: right, body: body, each: false }; }, createForOfStatement: function (left, right, body) { return { type: Syntax.ForOfStatement, left: left, right: right, body: body }; }, createFunctionDeclaration: function (id, params, defaults, body, rest, generator, expression, returnType, parametricType) { return { type: Syntax.FunctionDeclaration, id: id, params: params, defaults: defaults, body: body, rest: rest, generator: generator, expression: expression, returnType: returnType, parametricType: parametricType }; }, createFunctionExpression: function (id, params, defaults, body, rest, generator, expression, returnType, parametricType) { return { type: Syntax.FunctionExpression, id: id, params: params, defaults: defaults, body: body, rest: rest, generator: generator, expression: expression, returnType: returnType, parametricType: parametricType }; }, createIdentifier: function (name) { return { type: Syntax.Identifier, name: name, // Only here to initialize the shape of the object to ensure // that the 'typeAnnotation' key is ordered before others that // are added later (like 'loc' and 'range'). This just helps // keep the shape of Identifier nodes consistent with everything // else. typeAnnotation: undefined }; }, createTypeAnnotation: function (typeIdentifier, parametricType, params, returnType, nullable) { return { type: Syntax.TypeAnnotation, id: typeIdentifier, parametricType: parametricType, params: params, returnType: returnType, nullable: nullable }; }, createParametricTypeAnnotation: function (parametricTypes) { return { type: Syntax.ParametricTypeAnnotation, params: parametricTypes }; }, createVoidTypeAnnotation: function () { return { type: Syntax.VoidTypeAnnotation }; }, createObjectTypeAnnotation: function (properties, nullable) { return { type: Syntax.ObjectTypeAnnotation, properties: properties, nullable: nullable }; }, createTypeAnnotatedIdentifier: function (identifier, annotation, isOptionalParam) { return { type: Syntax.TypeAnnotatedIdentifier, id: identifier, annotation: annotation }; }, createOptionalParameter: function (identifier) { return { type: Syntax.OptionalParameter, id: identifier }; }, createXJSAttribute: function (name, value) { return { type: Syntax.XJSAttribute, name: name, value: value || null }; }, createXJSSpreadAttribute: function (argument) { return { type: Syntax.XJSSpreadAttribute, argument: argument }; }, createXJSIdentifier: function (name) { return { type: Syntax.XJSIdentifier, name: name }; }, createXJSNamespacedName: function (namespace, name) { return { type: Syntax.XJSNamespacedName, namespace: namespace, name: name }; }, createXJSMemberExpression: function (object, property) { return { type: Syntax.XJSMemberExpression, object: object, property: property }; }, createXJSElement: function (openingElement, closingElement, children) { return { type: Syntax.XJSElement, openingElement: openingElement, closingElement: closingElement, children: children }; }, createXJSEmptyExpression: function () { return { type: Syntax.XJSEmptyExpression }; }, createXJSExpressionContainer: function (expression) { return { type: Syntax.XJSExpressionContainer, expression: expression }; }, createXJSOpeningElement: function (name, attributes, selfClosing) { return { type: Syntax.XJSOpeningElement, name: name, selfClosing: selfClosing, attributes: attributes }; }, createXJSClosingElement: function (name) { return { type: Syntax.XJSClosingElement, name: name }; }, createIfStatement: function (test, consequent, alternate) { return { type: Syntax.IfStatement, test: test, consequent: consequent, alternate: alternate }; }, createLabeledStatement: function (label, body) { return { type: Syntax.LabeledStatement, label: label, body: body }; }, createLiteral: function (token) { return { type: Syntax.Literal, value: token.value, raw: source.slice(token.range[0], token.range[1]) }; }, createMemberExpression: function (accessor, object, property) { return { type: Syntax.MemberExpression, computed: accessor === '[', object: object, property: property }; }, createNewExpression: function (callee, args) { return { type: Syntax.NewExpression, callee: callee, 'arguments': args }; }, createObjectExpression: function (properties) { return { type: Syntax.ObjectExpression, properties: properties }; }, createPostfixExpression: function (operator, argument) { return { type: Syntax.UpdateExpression, operator: operator, argument: argument, prefix: false }; }, createProgram: function (body) { return { type: Syntax.Program, body: body }; }, createProperty: function (kind, key, value, method, shorthand, computed) { return { type: Syntax.Property, key: key, value: value, kind: kind, method: method, shorthand: shorthand, computed: computed }; }, createReturnStatement: function (argument) { return { type: Syntax.ReturnStatement, argument: argument }; }, createSequenceExpression: function (expressions) { return { type: Syntax.SequenceExpression, expressions: expressions }; }, createSwitchCase: function (test, consequent) { return { type: Syntax.SwitchCase, test: test, consequent: consequent }; }, createSwitchStatement: function (discriminant, cases) { return { type: Syntax.SwitchStatement, discriminant: discriminant, cases: cases }; }, createThisExpression: function () { return { type: Syntax.ThisExpression }; }, createThrowStatement: function (argument) { return { type: Syntax.ThrowStatement, argument: argument }; }, createTryStatement: function (block, guardedHandlers, handlers, finalizer) { return { type: Syntax.TryStatement, block: block, guardedHandlers: guardedHandlers, handlers: handlers, finalizer: finalizer }; }, createUnaryExpression: function (operator, argument) { if (operator === '++' || operator === '--') { return { type: Syntax.UpdateExpression, operator: operator, argument: argument, prefix: true }; } return { type: Syntax.UnaryExpression, operator: operator, argument: argument, prefix: true }; }, createVariableDeclaration: function (declarations, kind) { return { type: Syntax.VariableDeclaration, declarations: declarations, kind: kind }; }, createVariableDeclarator: function (id, init) { return { type: Syntax.VariableDeclarator, id: id, init: init }; }, createWhileStatement: function (test, body) { return { type: Syntax.WhileStatement, test: test, body: body }; }, createWithStatement: function (object, body) { return { type: Syntax.WithStatement, object: object, body: body }; }, createTemplateElement: function (value, tail) { return { type: Syntax.TemplateElement, value: value, tail: tail }; }, createTemplateLiteral: function (quasis, expressions) { return { type: Syntax.TemplateLiteral, quasis: quasis, expressions: expressions }; }, createSpreadElement: function (argument) { return { type: Syntax.SpreadElement, argument: argument }; }, createSpreadProperty: function (argument) { return { type: Syntax.SpreadProperty, argument: argument }; }, createTaggedTemplateExpression: function (tag, quasi) { return { type: Syntax.TaggedTemplateExpression, tag: tag, quasi: quasi }; }, createArrowFunctionExpression: function (params, defaults, body, rest, expression) { return { type: Syntax.ArrowFunctionExpression, id: null, params: params, defaults: defaults, body: body, rest: rest, generator: false, expression: expression }; }, createMethodDefinition: function (propertyType, kind, key, value) { return { type: Syntax.MethodDefinition, key: key, value: value, kind: kind, 'static': propertyType === ClassPropertyType["static"] }; }, createClassProperty: function (propertyIdentifier) { return { type: Syntax.ClassProperty, id: propertyIdentifier }; }, createClassBody: function (body) { return { type: Syntax.ClassBody, body: body }; }, createClassExpression: function (id, superClass, body, parametricType) { return { type: Syntax.ClassExpression, id: id, superClass: superClass, body: body, parametricType: parametricType }; }, createClassDeclaration: function (id, superClass, body, parametricType, superParametricType) { return { type: Syntax.ClassDeclaration, id: id, superClass: superClass, body: body, parametricType: parametricType, superParametricType: superParametricType }; }, createExportSpecifier: function (id, name) { return { type: Syntax.ExportSpecifier, id: id, name: name }; }, createExportBatchSpecifier: function () { return { type: Syntax.ExportBatchSpecifier }; }, createExportDeclaration: function (declaration, specifiers, source) { return { type: Syntax.ExportDeclaration, declaration: declaration, specifiers: specifiers, source: source }; }, createImportSpecifier: function (id, name) { return { type: Syntax.ImportSpecifier, id: id, name: name }; }, createImportDeclaration: function (specifiers, kind, source) { return { type: Syntax.ImportDeclaration, specifiers: specifiers, kind: kind, source: source }; }, createYieldExpression: function (argument, delegate) { return { type: Syntax.YieldExpression, argument: argument, delegate: delegate }; }, createModuleDeclaration: function (id, source, body) { return { type: Syntax.ModuleDeclaration, id: id, source: source, body: body }; }, createComprehensionExpression: function (filter, blocks, body) { return { type: Syntax.ComprehensionExpression, filter: filter, blocks: blocks, body: body }; } }; // Return true if there is a line terminator before the next token. function peekLineTerminator() { var pos, line, start, found; pos = index; line = lineNumber; start = lineStart; skipComment(); found = lineNumber !== line; index = pos; lineNumber = line; lineStart = start; return found; } // Throw an exception function throwError(token, messageFormat) { var error, args = Array.prototype.slice.call(arguments, 2), msg = messageFormat.replace( /%(\d)/g, function (whole, index) { assert(index < args.length, 'Message reference must be in range'); return args[index]; } ); if (typeof token.lineNumber === 'number') { error = new Error('Line ' + token.lineNumber + ': ' + msg); error.index = token.range[0]; error.lineNumber = token.lineNumber; error.column = token.range[0] - lineStart + 1; } else { error = new Error('Line ' + lineNumber + ': ' + msg); error.index = index; error.lineNumber = lineNumber; error.column = index - lineStart + 1; } error.description = msg; throw error; } function throwErrorTolerant() { try { throwError.apply(null, arguments); } catch (e) { if (extra.errors) { extra.errors.push(e); } else { throw e; } } } // Throw an exception because of the token. function throwUnexpected(token) { if (token.type === Token.EOF) { throwError(token, Messages.UnexpectedEOS); } if (token.type === Token.NumericLiteral) { throwError(token, Messages.UnexpectedNumber); } if (token.type === Token.StringLiteral || token.type === Token.XJSText) { throwError(token, Messages.UnexpectedString); } if (token.type === Token.Identifier) { throwError(token, Messages.UnexpectedIdentifier); } if (token.type === Token.Keyword) { if (isFutureReservedWord(token.value)) { throwError(token, Messages.UnexpectedReserved); } else if (strict && isStrictModeReservedWord(token.value)) { throwErrorTolerant(token, Messages.StrictReservedWord); return; } throwError(token, Messages.UnexpectedToken, token.value); } if (token.type === Token.Template) { throwError(token, Messages.UnexpectedTemplate, token.value.raw); } // BooleanLiteral, NullLiteral, or Punctuator. throwError(token, Messages.UnexpectedToken, token.value); } // Expect the next token to match the specified punctuator. // If not, an exception will be thrown. function expect(value) { var token = lex(); if (token.type !== Token.Punctuator || token.value !== value) { throwUnexpected(token); } } // Expect the next token to match the specified keyword. // If not, an exception will be thrown. function expectKeyword(keyword) { var token = lex(); if (token.type !== Token.Keyword || token.value !== keyword) { throwUnexpected(token); } } // Return true if the next token matches the specified punctuator. function match(value) { return lookahead.type === Token.Punctuator && lookahead.value === value; } // Return true if the next token matches the specified keyword function matchKeyword(keyword) { return lookahead.type === Token.Keyword && lookahead.value === keyword; } // Return true if the next token matches the specified contextual keyword function matchContextualKeyword(keyword) { return lookahead.type === Token.Identifier && lookahead.value === keyword; } // Return true if the next token is an assignment operator function matchAssign() { var op; if (lookahead.type !== Token.Punctuator) { return false; } op = lookahead.value; return op === '=' || op === '*=' || op === '/=' || op === '%=' || op === '+=' || op === '-=' || op === '<<=' || op === '>>=' || op === '>>>=' || op === '&=' || op === '^=' || op === '|='; } function consumeSemicolon() { var line, oldIndex = index, oldLineNumber = lineNumber, oldLineStart = lineStart, oldLookahead = lookahead; // Catch the very common case first: immediately a semicolon (char #59). if (source.charCodeAt(index) === 59) { lex(); return; } line = lineNumber; skipComment(); if (lineNumber !== line) { index = oldIndex; lineNumber = oldLineNumber; lineStart = oldLineStart; lookahead = oldLookahead; return; } if (match(';')) { lex(); return; } if (lookahead.type !== Token.EOF && !match('}')) { throwUnexpected(lookahead); } } // Return true if provided expression is LeftHandSideExpression function isLeftHandSide(expr) { return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression; } function isAssignableLeftHandSide(expr) { return isLeftHandSide(expr) || expr.type === Syntax.ObjectPattern || expr.type === Syntax.ArrayPattern; } // 11.1.4 Array Initialiser function parseArrayInitialiser() { var elements = [], blocks = [], filter = null, tmp, possiblecomprehension = true, body, marker = markerCreate(); expect('['); while (!match(']')) { if (lookahead.value === 'for' && lookahead.type === Token.Keyword) { if (!possiblecomprehension) { throwError({}, Messages.ComprehensionError); } matchKeyword('for'); tmp = parseForStatement({ignoreBody: true}); tmp.of = tmp.type === Syntax.ForOfStatement; tmp.type = Syntax.ComprehensionBlock; if (tmp.left.kind) { // can't be let or const throwError({}, Messages.ComprehensionError); } blocks.push(tmp); } else if (lookahead.value === 'if' && lookahead.type === Token.Keyword) { if (!possiblecomprehension) { throwError({}, Messages.ComprehensionError); } expectKeyword('if'); expect('('); filter = parseExpression(); expect(')'); } else if (lookahead.value === ',' && lookahead.type === Token.Punctuator) { possiblecomprehension = false; // no longer allowed. lex(); elements.push(null); } else { tmp = parseSpreadOrAssignmentExpression(); elements.push(tmp); if (tmp && tmp.type === Syntax.SpreadElement) { if (!match(']')) { throwError({}, Messages.ElementAfterSpreadElement); } } else if (!(match(']') || matchKeyword('for') || matchKeyword('if'))) { expect(','); // this lexes. possiblecomprehension = false; } } } expect(']'); if (filter && !blocks.length) { throwError({}, Messages.ComprehensionRequiresBlock); } if (blocks.length) { if (elements.length !== 1) { throwError({}, Messages.ComprehensionError); } return markerApply(marker, delegate.createComprehensionExpression(filter, blocks, elements[0])); } return markerApply(marker, delegate.createArrayExpression(elements)); } // 11.1.5 Object Initialiser function parsePropertyFunction(options) { var previousStrict, previousYieldAllowed, params, defaults, body, marker = markerCreate(); previousStrict = strict; previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = options.generator; params = options.params || []; defaults = options.defaults || []; body = parseConciseBody(); if (options.name && strict && isRestrictedWord(params[0].name)) { throwErrorTolerant(options.name, Messages.StrictParamName); } strict = previousStrict; state.yieldAllowed = previousYieldAllowed; return markerApply(marker, delegate.createFunctionExpression( null, params, defaults, body, options.rest || null, options.generator, body.type !== Syntax.BlockStatement, options.returnType, options.parametricType )); } function parsePropertyMethodFunction(options) { var previousStrict, tmp, method; previousStrict = strict; strict = true; tmp = parseParams(); if (tmp.stricted) { throwErrorTolerant(tmp.stricted, tmp.message); } method = parsePropertyFunction({ params: tmp.params, defaults: tmp.defaults, rest: tmp.rest, generator: options.generator, returnType: tmp.returnType, parametricType: options.parametricType }); strict = previousStrict; return method; } function parseObjectPropertyKey() { var marker = markerCreate(), token = lex(), propertyKey, result; // Note: This function is called only from parseObjectProperty(), where // EOF and Punctuator tokens are already filtered out. if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { if (strict && token.octal) { throwErrorTolerant(token, Messages.StrictOctalLiteral); } return markerApply(marker, delegate.createLiteral(token)); } if (token.type === Token.Punctuator && token.value === '[') { // For computed properties we should skip the [ and ], and // capture in marker only the assignment expression itself. marker = markerCreate(); propertyKey = parseAssignmentExpression(); result = markerApply(marker, propertyKey); expect(']'); return result; } return markerApply(marker, delegate.createIdentifier(token.value)); } function parseObjectProperty() { var token, key, id, value, param, expr, computed, marker = markerCreate(); token = lookahead; computed = (token.value === '['); if (token.type === Token.Identifier || computed) { id = parseObjectPropertyKey(); // Property Assignment: Getter and Setter. if (token.value === 'get' && !(match(':') || match('('))) { computed = (lookahead.value === '['); key = parseObjectPropertyKey(); expect('('); expect(')'); return markerApply(marker, delegate.createProperty('get', key, parsePropertyFunction({ generator: false }), false, false, computed)); } if (token.value === 'set' && !(match(':') || match('('))) { computed = (lookahead.value === '['); key = parseObjectPropertyKey(); expect('('); token = lookahead; param = [ parseTypeAnnotatableIdentifier() ]; expect(')'); return markerApply(marker, delegate.createProperty('set', key, parsePropertyFunction({ params: param, generator: false, name: token }), false, false, computed)); } if (match(':')) { lex(); return markerApply(marker, delegate.createProperty('init', id, parseAssignmentExpression(), false, false, computed)); } if (match('(')) { return markerApply(marker, delegate.createProperty('init', id, parsePropertyMethodFunction({ generator: false }), true, false, computed)); } if (computed) { // Computed properties can only be used with full notation. throwUnexpected(lookahead); } return markerApply(marker, delegate.createProperty('init', id, id, false, true, false)); } if (token.type === Token.EOF || token.type === Token.Punctuator) { if (!match('*')) { throwUnexpected(token); } lex(); computed = (lookahead.type === Token.Punctuator && lookahead.value === '['); id = parseObjectPropertyKey(); if (!match('(')) { throwUnexpected(lex()); } return markerApply(marker, delegate.createProperty('init', id, parsePropertyMethodFunction({ generator: true }), true, false, computed)); } key = parseObjectPropertyKey(); if (match(':')) { lex(); return markerApply(marker, delegate.createProperty('init', key, parseAssignmentExpression(), false, false, false)); } if (match('(')) { return markerApply(marker, delegate.createProperty('init', key, parsePropertyMethodFunction({ generator: false }), true, false, false)); } throwUnexpected(lex()); } function parseObjectSpreadProperty() { var marker = markerCreate(); expect('...'); return markerApply(marker, delegate.createSpreadProperty(parseAssignmentExpression())); } function parseObjectInitialiser() { var properties = [], property, name, key, kind, map = {}, toString = String, marker = markerCreate(); expect('{'); while (!match('}')) { if (match('...')) { property = parseObjectSpreadProperty(); } else { property = parseObjectProperty(); if (property.key.type === Syntax.Identifier) { name = property.key.name; } else { name = toString(property.key.value); } kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set; key = '$' + name; if (Object.prototype.hasOwnProperty.call(map, key)) { if (map[key] === PropertyKind.Data) { if (strict && kind === PropertyKind.Data) { throwErrorTolerant({}, Messages.StrictDuplicateProperty); } else if (kind !== PropertyKind.Data) { throwErrorTolerant({}, Messages.AccessorDataProperty); } } else { if (kind === PropertyKind.Data) { throwErrorTolerant({}, Messages.AccessorDataProperty); } else if (map[key] & kind) { throwErrorTolerant({}, Messages.AccessorGetSet); } } map[key] |= kind; } else { map[key] = kind; } } properties.push(property); if (!match('}')) { expect(','); } } expect('}'); return markerApply(marker, delegate.createObjectExpression(properties)); } function parseTemplateElement(option) { var marker = markerCreate(), token = scanTemplateElement(option); if (strict && token.octal) { throwError(token, Messages.StrictOctalLiteral); } return markerApply(marker, delegate.createTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail)); } function parseTemplateLiteral() { var quasi, quasis, expressions, marker = markerCreate(); quasi = parseTemplateElement({ head: true }); quasis = [ quasi ]; expressions = []; while (!quasi.tail) { expressions.push(parseExpression()); quasi = parseTemplateElement({ head: false }); quasis.push(quasi); } return markerApply(marker, delegate.createTemplateLiteral(quasis, expressions)); } // 11.1.6 The Grouping Operator function parseGroupExpression() { var expr; expect('('); ++state.parenthesizedCount; expr = parseExpression(); expect(')'); return expr; } // 11.1 Primary Expressions function parsePrimaryExpression() { var marker, type, token, expr; type = lookahead.type; if (type === Token.Identifier) { marker = markerCreate(); return markerApply(marker, delegate.createIdentifier(lex().value)); } if (type === Token.StringLiteral || type === Token.NumericLiteral) { if (strict && lookahead.octal) { throwErrorTolerant(lookahead, Messages.StrictOctalLiteral); } marker = markerCreate(); return markerApply(marker, delegate.createLiteral(lex())); } if (type === Token.Keyword) { if (matchKeyword('this')) { marker = markerCreate(); lex(); return markerApply(marker, delegate.createThisExpression()); } if (matchKeyword('function')) { return parseFunctionExpression(); } if (matchKeyword('class')) { return parseClassExpression(); } if (matchKeyword('super')) { marker = markerCreate(); lex(); return markerApply(marker, delegate.createIdentifier('super')); } } if (type === Token.BooleanLiteral) { marker = markerCreate(); token = lex(); token.value = (token.value === 'true'); return markerApply(marker, delegate.createLiteral(token)); } if (type === Token.NullLiteral) { marker = markerCreate(); token = lex(); token.value = null; return markerApply(marker, delegate.createLiteral(token)); } if (match('[')) { return parseArrayInitialiser(); } if (match('{')) { return parseObjectInitialiser(); } if (match('(')) { return parseGroupExpression(); } if (match('/') || match('/=')) { marker = markerCreate(); return markerApply(marker, delegate.createLiteral(scanRegExp())); } if (type === Token.Template) { return parseTemplateLiteral(); } if (match('<')) { return parseXJSElement(); } throwUnexpected(lex()); } // 11.2 Left-Hand-Side Expressions function parseArguments() { var args = [], arg; expect('('); if (!match(')')) { while (index < length) { arg = parseSpreadOrAssignmentExpression(); args.push(arg); if (match(')')) { break; } else if (arg.type === Syntax.SpreadElement) { throwError({}, Messages.ElementAfterSpreadElement); } expect(','); } } expect(')'); return args; } function parseSpreadOrAssignmentExpression() { if (match('...')) { var marker = markerCreate(); lex(); return markerApply(marker, delegate.createSpreadElement(parseAssignmentExpression())); } return parseAssignmentExpression(); } function parseNonComputedProperty() { var marker = markerCreate(), token = lex(); if (!isIdentifierName(token)) { throwUnexpected(token); } return markerApply(marker, delegate.createIdentifier(token.value)); } function parseNonComputedMember() { expect('.'); return parseNonComputedProperty(); } function parseComputedMember() { var expr; expect('['); expr = parseExpression(); expect(']'); return expr; } function parseNewExpression() { var callee, args, marker = markerCreate(); expectKeyword('new'); callee = parseLeftHandSideExpression(); args = match('(') ? parseArguments() : []; return markerApply(marker, delegate.createNewExpression(callee, args)); } function parseLeftHandSideExpressionAllowCall() { var expr, args, marker = markerCreate(); expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); while (match('.') || match('[') || match('(') || lookahead.type === Token.Template) { if (match('(')) { args = parseArguments(); expr = markerApply(marker, delegate.createCallExpression(expr, args)); } else if (match('[')) { expr = markerApply(marker, delegate.createMemberExpression('[', expr, parseComputedMember())); } else if (match('.')) { expr = markerApply(marker, delegate.createMemberExpression('.', expr, parseNonComputedMember())); } else { expr = markerApply(marker, delegate.createTaggedTemplateExpression(expr, parseTemplateLiteral())); } } return expr; } function parseLeftHandSideExpression() { var expr, marker = markerCreate(); expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); while (match('.') || match('[') || lookahead.type === Token.Template) { if (match('[')) { expr = markerApply(marker, delegate.createMemberExpression('[', expr, parseComputedMember())); } else if (match('.')) { expr = markerApply(marker, delegate.createMemberExpression('.', expr, parseNonComputedMember())); } else { expr = markerApply(marker, delegate.createTaggedTemplateExpression(expr, parseTemplateLiteral())); } } return expr; } // 11.3 Postfix Expressions function parsePostfixExpression() { var marker = markerCreate(), expr = parseLeftHandSideExpressionAllowCall(), token; if (lookahead.type !== Token.Punctuator) { return expr; } if ((match('++') || match('--')) && !peekLineTerminator()) { // 11.3.1, 11.3.2 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { throwErrorTolerant({}, Messages.StrictLHSPostfix); } if (!isLeftHandSide(expr)) { throwError({}, Messages.InvalidLHSInAssignment); } token = lex(); expr = markerApply(marker, delegate.createPostfixExpression(token.value, expr)); } return expr; } // 11.4 Unary Operators function parseUnaryExpression() { var marker, token, expr; if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) { return parsePostfixExpression(); } if (match('++') || match('--')) { marker = markerCreate(); token = lex(); expr = parseUnaryExpression(); // 11.4.4, 11.4.5 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { throwErrorTolerant({}, Messages.StrictLHSPrefix); } if (!isLeftHandSide(expr)) { throwError({}, Messages.InvalidLHSInAssignment); } return markerApply(marker, delegate.createUnaryExpression(token.value, expr)); } if (match('+') || match('-') || match('~') || match('!')) { marker = markerCreate(); token = lex(); expr = parseUnaryExpression(); return markerApply(marker, delegate.createUnaryExpression(token.value, expr)); } if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { marker = markerCreate(); token = lex(); expr = parseUnaryExpression(); expr = markerApply(marker, delegate.createUnaryExpression(token.value, expr)); if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { throwErrorTolerant({}, Messages.StrictDelete); } return expr; } return parsePostfixExpression(); } function binaryPrecedence(token, allowIn) { var prec = 0; if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { return 0; } switch (token.value) { case '||': prec = 1; break; case '&&': prec = 2; break; case '|': prec = 3; break; case '^': prec = 4; break; case '&': prec = 5; break; case '==': case '!=': case '===': case '!==': prec = 6; break; case '<': case '>': case '<=': case '>=': case 'instanceof': prec = 7; break; case 'in': prec = allowIn ? 7 : 0; break; case '<<': case '>>': case '>>>': prec = 8; break; case '+': case '-': prec = 9; break; case '*': case '/': case '%': prec = 11; break; default: break; } return prec; } // 11.5 Multiplicative Operators // 11.6 Additive Operators // 11.7 Bitwise Shift Operators // 11.8 Relational Operators // 11.9 Equality Operators // 11.10 Binary Bitwise Operators // 11.11 Binary Logical Operators function parseBinaryExpression() { var expr, token, prec, previousAllowIn, stack, right, operator, left, i, marker, markers; previousAllowIn = state.allowIn; state.allowIn = true; marker = markerCreate(); left = parseUnaryExpression(); token = lookahead; prec = binaryPrecedence(token, previousAllowIn); if (prec === 0) { return left; } token.prec = prec; lex(); markers = [marker, markerCreate()]; right = parseUnaryExpression(); stack = [left, token, right]; while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) { // Reduce: make a binary expression from the three topmost entries. while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) { right = stack.pop(); operator = stack.pop().value; left = stack.pop(); expr = delegate.createBinaryExpression(operator, left, right); markers.pop(); marker = markers.pop(); markerApply(marker, expr); stack.push(expr); markers.push(marker); } // Shift. token = lex(); token.prec = prec; stack.push(token); markers.push(markerCreate()); expr = parseUnaryExpression(); stack.push(expr); } state.allowIn = previousAllowIn; // Final reduce to clean-up the stack. i = stack.length - 1; expr = stack[i]; markers.pop(); while (i > 1) { expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr); i -= 2; marker = markers.pop(); markerApply(marker, expr); } return expr; } // 11.12 Conditional Operator function parseConditionalExpression() { var expr, previousAllowIn, consequent, alternate, marker = markerCreate(); expr = parseBinaryExpression(); if (match('?')) { lex(); previousAllowIn = state.allowIn; state.allowIn = true; consequent = parseAssignmentExpression(); state.allowIn = previousAllowIn; expect(':'); alternate = parseAssignmentExpression(); expr = markerApply(marker, delegate.createConditionalExpression(expr, consequent, alternate)); } return expr; } // 11.13 Assignment Operators function reinterpretAsAssignmentBindingPattern(expr) { var i, len, property, element; if (expr.type === Syntax.ObjectExpression) { expr.type = Syntax.ObjectPattern; for (i = 0, len = expr.properties.length; i < len; i += 1) { property = expr.properties[i]; if (property.type === Syntax.SpreadProperty) { if (i < len - 1) { throwError({}, Messages.PropertyAfterSpreadProperty); } reinterpretAsAssignmentBindingPattern(property.argument); } else { if (property.kind !== 'init') { throwError({}, Messages.InvalidLHSInAssignment); } reinterpretAsAssignmentBindingPattern(property.value); } } } else if (expr.type === Syntax.ArrayExpression) { expr.type = Syntax.ArrayPattern; for (i = 0, len = expr.elements.length; i < len; i += 1) { element = expr.elements[i]; if (element) { reinterpretAsAssignmentBindingPattern(element); } } } else if (expr.type === Syntax.Identifier) { if (isRestrictedWord(expr.name)) { throwError({}, Messages.InvalidLHSInAssignment); } } else if (expr.type === Syntax.SpreadElement) { reinterpretAsAssignmentBindingPattern(expr.argument); if (expr.argument.type === Syntax.ObjectPattern) { throwError({}, Messages.ObjectPatternAsSpread); } } else { if (expr.type !== Syntax.MemberExpression && expr.type !== Syntax.CallExpression && expr.type !== Syntax.NewExpression) { throwError({}, Messages.InvalidLHSInAssignment); } } } function reinterpretAsDestructuredParameter(options, expr) { var i, len, property, element; if (expr.type === Syntax.ObjectExpression) { expr.type = Syntax.ObjectPattern; for (i = 0, len = expr.properties.length; i < len; i += 1) { property = expr.properties[i]; if (property.type === Syntax.SpreadProperty) { if (i < len - 1) { throwError({}, Messages.PropertyAfterSpreadProperty); } reinterpretAsDestructuredParameter(options, property.argument); } else { if (property.kind !== 'init') { throwError({}, Messages.InvalidLHSInFormalsList); } reinterpretAsDestructuredParameter(options, property.value); } } } else if (expr.type === Syntax.ArrayExpression) { expr.type = Syntax.ArrayPattern; for (i = 0, len = expr.elements.length; i < len; i += 1) { element = expr.elements[i]; if (element) { reinterpretAsDestructuredParameter(options, element); } } } else if (expr.type === Syntax.Identifier) { validateParam(options, expr, expr.name); } else { if (expr.type !== Syntax.MemberExpression) { throwError({}, Messages.InvalidLHSInFormalsList); } } } function reinterpretAsCoverFormalsList(expressions) { var i, len, param, params, defaults, defaultCount, options, rest; params = []; defaults = []; defaultCount = 0; rest = null; options = { paramSet: {} }; for (i = 0, len = expressions.length; i < len; i += 1) { param = expressions[i]; if (param.type === Syntax.Identifier) { params.push(param); defaults.push(null); validateParam(options, param, param.name); } else if (param.type === Syntax.ObjectExpression || param.type === Syntax.ArrayExpression) { reinterpretAsDestructuredParameter(options, param); params.push(param); defaults.push(null); } else if (param.type === Syntax.SpreadElement) { assert(i === len - 1, 'It is guaranteed that SpreadElement is last element by parseExpression'); reinterpretAsDestructuredParameter(options, param.argument); rest = param.argument; } else if (param.type === Syntax.AssignmentExpression) { params.push(param.left); defaults.push(param.right); ++defaultCount; validateParam(options, param.left, param.left.name); } else { return null; } } if (options.message === Messages.StrictParamDupe) { throwError( strict ? options.stricted : options.firstRestricted, options.message ); } if (defaultCount === 0) { defaults = []; } return { params: params, defaults: defaults, rest: rest, stricted: options.stricted, firstRestricted: options.firstRestricted, message: options.message }; } function parseArrowFunctionExpression(options, marker) { var previousStrict, previousYieldAllowed, body; expect('=>'); previousStrict = strict; previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = false; body = parseConciseBody(); if (strict && options.firstRestricted) { throwError(options.firstRestricted, options.message); } if (strict && options.stricted) { throwErrorTolerant(options.stricted, options.message); } strict = previousStrict; state.yieldAllowed = previousYieldAllowed; return markerApply(marker, delegate.createArrowFunctionExpression( options.params, options.defaults, body, options.rest, body.type !== Syntax.BlockStatement )); } function parseAssignmentExpression() { var marker, expr, token, params, oldParenthesizedCount; // Note that 'yield' is treated as a keyword in strict mode, but a // contextual keyword (identifier) in non-strict mode, so we need // to use matchKeyword and matchContextualKeyword appropriately. if ((state.yieldAllowed && matchContextualKeyword('yield')) || (strict && matchKeyword('yield'))) { return parseYieldExpression(); } oldParenthesizedCount = state.parenthesizedCount; marker = markerCreate(); if (match('(')) { token = lookahead2(); if ((token.type === Token.Punctuator && token.value === ')') || token.value === '...') { params = parseParams(); if (!match('=>')) { throwUnexpected(lex()); } return parseArrowFunctionExpression(params, marker); } } token = lookahead; expr = parseConditionalExpression(); if (match('=>') && (state.parenthesizedCount === oldParenthesizedCount || state.parenthesizedCount === (oldParenthesizedCount + 1))) { if (expr.type === Syntax.Identifier) { params = reinterpretAsCoverFormalsList([ expr ]); } else if (expr.type === Syntax.SequenceExpression) { params = reinterpretAsCoverFormalsList(expr.expressions); } if (params) { return parseArrowFunctionExpression(params, marker); } } if (matchAssign()) { // 11.13.1 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { throwErrorTolerant(token, Messages.StrictLHSAssignment); } // ES.next draf 11.13 Runtime Semantics step 1 if (match('=') && (expr.type === Syntax.ObjectExpression || expr.type === Syntax.ArrayExpression)) { reinterpretAsAssignmentBindingPattern(expr); } else if (!isLeftHandSide(expr)) { throwError({}, Messages.InvalidLHSInAssignment); } expr = markerApply(marker, delegate.createAssignmentExpression(lex().value, expr, parseAssignmentExpression())); } return expr; } // 11.14 Comma Operator function parseExpression() { var marker, expr, expressions, sequence, coverFormalsList, spreadFound, oldParenthesizedCount; oldParenthesizedCount = state.parenthesizedCount; marker = markerCreate(); expr = parseAssignmentExpression(); expressions = [ expr ]; if (match(',')) { while (index < length) { if (!match(',')) { break; } lex(); expr = parseSpreadOrAssignmentExpression(); expressions.push(expr); if (expr.type === Syntax.SpreadElement) { spreadFound = true; if (!match(')')) { throwError({}, Messages.ElementAfterSpreadElement); } break; } } sequence = markerApply(marker, delegate.createSequenceExpression(expressions)); } if (match('=>')) { // Do not allow nested parentheses on the LHS of the =>. if (state.parenthesizedCount === oldParenthesizedCount || state.parenthesizedCount === (oldParenthesizedCount + 1)) { expr = expr.type === Syntax.SequenceExpression ? expr.expressions : expressions; coverFormalsList = reinterpretAsCoverFormalsList(expr); if (coverFormalsList) { return parseArrowFunctionExpression(coverFormalsList, marker); } } throwUnexpected(lex()); } if (spreadFound && lookahead2().value !== '=>') { throwError({}, Messages.IllegalSpread); } return sequence || expr; } // 12.1 Block function parseStatementList() { var list = [], statement; while (index < length) { if (match('}')) { break; } statement = parseSourceElement(); if (typeof statement === 'undefined') { break; } list.push(statement); } return list; } function parseBlock() { var block, marker = markerCreate(); expect('{'); block = parseStatementList(); expect('}'); return markerApply(marker, delegate.createBlockStatement(block)); } // 12.2 Variable Statement function parseObjectTypeAnnotation(nullable) { var isMethod, marker, properties = [], property, propertyKey, propertyTypeAnnotation; expect('{'); while (!match('}')) { marker = markerCreate(); propertyKey = parseObjectPropertyKey(); isMethod = match('('); propertyTypeAnnotation = parseTypeAnnotation(); properties.push(markerApply(marker, delegate.createProperty( 'init', propertyKey, propertyTypeAnnotation, isMethod, false ))); if (!match('}')) { if (match(',') || match(';')) { lex(); } else { throwUnexpected(lookahead); } } } expect('}'); return delegate.createObjectTypeAnnotation(properties, nullable); } function parseVoidTypeAnnotation() { var marker = markerCreate(); expectKeyword('void'); return markerApply(marker, delegate.createVoidTypeAnnotation()); } function parseParametricTypeAnnotation() { var marker = markerCreate(), typeIdentifier, paramTypes = []; expect('<'); while (!match('>')) { paramTypes.push(parseVariableIdentifier()); if (!match('>')) { expect(','); } } expect('>'); return markerApply(marker, delegate.createParametricTypeAnnotation( paramTypes )); } function parseTypeAnnotation(dontExpectColon) { var typeIdentifier = null, params = null, returnType = null, nullable = false, marker = markerCreate(), returnTypeMarker = null, parametricType, annotation; if (!dontExpectColon) { expect(':'); } if (match('?')) { lex(); nullable = true; } if (match('{')) { return markerApply(marker, parseObjectTypeAnnotation(nullable)); } if (lookahead.type === Token.Identifier) { typeIdentifier = parseVariableIdentifier(); if (match('<')) { parametricType = parseParametricTypeAnnotation(); } } else if (match('(')) { lex(); params = []; while (lookahead.type === Token.Identifier || match('?')) { params.push(parseTypeAnnotatableIdentifier( true, /* requireTypeAnnotation */ true /* canBeOptionalParam */ )); if (!match(')')) { expect(','); } } expect(')'); returnTypeMarker = markerCreate(); expect('=>'); returnType = parseTypeAnnotation(true); } else { if (!matchKeyword('void')) { throwUnexpected(lookahead); } else { return markerApply(marker, parseVoidTypeAnnotation()); } } return markerApply(marker, delegate.createTypeAnnotation( typeIdentifier, parametricType, params, returnType, nullable )); } function parseVariableIdentifier() { var marker = markerCreate(), token = lex(); if (token.type !== Token.Identifier) { throwUnexpected(token); } return markerApply(marker, delegate.createIdentifier(token.value)); } function parseTypeAnnotatableIdentifier(requireTypeAnnotation, canBeOptionalParam) { var marker = markerCreate(), ident = parseVariableIdentifier(), isOptionalParam = false; if (canBeOptionalParam && match('?')) { expect('?'); isOptionalParam = true; } if (requireTypeAnnotation || match(':')) { ident = markerApply(marker, delegate.createTypeAnnotatedIdentifier( ident, parseTypeAnnotation() )); } if (isOptionalParam) { ident = markerApply(marker, delegate.createOptionalParameter(ident)); } return ident; } function parseVariableDeclaration(kind) { var id, marker = markerCreate(), init = null; if (match('{')) { id = parseObjectInitialiser(); reinterpretAsAssignmentBindingPattern(id); } else if (match('[')) { id = parseArrayInitialiser(); reinterpretAsAssignmentBindingPattern(id); } else { id = state.allowKeyword ? parseNonComputedProperty() : parseTypeAnnotatableIdentifier(); // 12.2.1 if (strict && isRestrictedWord(id.name)) { throwErrorTolerant({}, Messages.StrictVarName); } } if (kind === 'const') { if (!match('=')) { throwError({}, Messages.NoUnintializedConst); } expect('='); init = parseAssignmentExpression(); } else if (match('=')) { lex(); init = parseAssignmentExpression(); } return markerApply(marker, delegate.createVariableDeclarator(id, init)); } function parseVariableDeclarationList(kind) { var list = []; do { list.push(parseVariableDeclaration(kind)); if (!match(',')) { break; } lex(); } while (index < length); return list; } function parseVariableStatement() { var declarations, marker = markerCreate(); expectKeyword('var'); declarations = parseVariableDeclarationList(); consumeSemicolon(); return markerApply(marker, delegate.createVariableDeclaration(declarations, 'var')); } // kind may be `const` or `let` // Both are experimental and not in the specification yet. // see http://wiki.ecmascript.org/doku.php?id=harmony:const // and http://wiki.ecmascript.org/doku.php?id=harmony:let function parseConstLetDeclaration(kind) { var declarations, marker = markerCreate(); expectKeyword(kind); declarations = parseVariableDeclarationList(kind); consumeSemicolon(); return markerApply(marker, delegate.createVariableDeclaration(declarations, kind)); } // http://wiki.ecmascript.org/doku.php?id=harmony:modules function parseModuleDeclaration() { var id, src, body, marker = markerCreate(); lex(); // 'module' if (peekLineTerminator()) { throwError({}, Messages.NewlineAfterModule); } switch (lookahead.type) { case Token.StringLiteral: id = parsePrimaryExpression(); body = parseModuleBlock(); src = null; break; case Token.Identifier: id = parseVariableIdentifier(); body = null; if (!matchContextualKeyword('from')) { throwUnexpected(lex()); } lex(); src = parsePrimaryExpression(); if (src.type !== Syntax.Literal) { throwError({}, Messages.InvalidModuleSpecifier); } break; } consumeSemicolon(); return markerApply(marker, delegate.createModuleDeclaration(id, src, body)); } function parseExportBatchSpecifier() { var marker = markerCreate(); expect('*'); return markerApply(marker, delegate.createExportBatchSpecifier()); } function parseExportSpecifier() { var id, name = null, marker = markerCreate(); id = parseVariableIdentifier(); if (matchContextualKeyword('as')) { lex(); name = parseNonComputedProperty(); } return markerApply(marker, delegate.createExportSpecifier(id, name)); } function parseExportDeclaration() { var previousAllowKeyword, decl, def, src, specifiers, marker = markerCreate(); expectKeyword('export'); if (lookahead.type === Token.Keyword) { switch (lookahead.value) { case 'let': case 'const': case 'var': case 'class': case 'function': return markerApply(marker, delegate.createExportDeclaration(parseSourceElement(), null, null)); } } if (isIdentifierName(lookahead)) { previousAllowKeyword = state.allowKeyword; state.allowKeyword = true; decl = parseVariableDeclarationList('let'); state.allowKeyword = previousAllowKeyword; return markerApply(marker, delegate.createExportDeclaration(decl, null, null)); } specifiers = []; src = null; if (match('*')) { specifiers.push(parseExportBatchSpecifier()); } else { expect('{'); do { specifiers.push(parseExportSpecifier()); } while (match(',') && lex()); expect('}'); } if (matchContextualKeyword('from')) { lex(); src = parsePrimaryExpression(); if (src.type !== Syntax.Literal) { throwError({}, Messages.InvalidModuleSpecifier); } } consumeSemicolon(); return markerApply(marker, delegate.createExportDeclaration(null, specifiers, src)); } function parseImportDeclaration() { var specifiers, kind, src, marker = markerCreate(); expectKeyword('import'); specifiers = []; if (isIdentifierName(lookahead)) { kind = 'default'; specifiers.push(parseImportSpecifier()); if (!matchContextualKeyword('from')) { throwError({}, Messages.NoFromAfterImport); } lex(); } else if (match('{')) { kind = 'named'; lex(); do { specifiers.push(parseImportSpecifier()); } while (match(',') && lex()); expect('}'); if (!matchContextualKeyword('from')) { throwError({}, Messages.NoFromAfterImport); } lex(); } src = parsePrimaryExpression(); if (src.type !== Syntax.Literal) { throwError({}, Messages.InvalidModuleSpecifier); } consumeSemicolon(); return markerApply(marker, delegate.createImportDeclaration(specifiers, kind, src)); } function parseImportSpecifier() { var id, name = null, marker = markerCreate(); id = parseNonComputedProperty(); if (matchContextualKeyword('as')) { lex(); name = parseVariableIdentifier(); } return markerApply(marker, delegate.createImportSpecifier(id, name)); } // 12.3 Empty Statement function parseEmptyStatement() { var marker = markerCreate(); expect(';'); return markerApply(marker, delegate.createEmptyStatement()); } // 12.4 Expression Statement function parseExpressionStatement() { var marker = markerCreate(), expr = parseExpression(); consumeSemicolon(); return markerApply(marker, delegate.createExpressionStatement(expr)); } // 12.5 If statement function parseIfStatement() { var test, consequent, alternate, marker = markerCreate(); expectKeyword('if'); expect('('); test = parseExpression(); expect(')'); consequent = parseStatement(); if (matchKeyword('else')) { lex(); alternate = parseStatement(); } else { alternate = null; } return markerApply(marker, delegate.createIfStatement(test, consequent, alternate)); } // 12.6 Iteration Statements function parseDoWhileStatement() { var body, test, oldInIteration, marker = markerCreate(); expectKeyword('do'); oldInIteration = state.inIteration; state.inIteration = true; body = parseStatement(); state.inIteration = oldInIteration; expectKeyword('while'); expect('('); test = parseExpression(); expect(')'); if (match(';')) { lex(); } return markerApply(marker, delegate.createDoWhileStatement(body, test)); } function parseWhileStatement() { var test, body, oldInIteration, marker = markerCreate(); expectKeyword('while'); expect('('); test = parseExpression(); expect(')'); oldInIteration = state.inIteration; state.inIteration = true; body = parseStatement(); state.inIteration = oldInIteration; return markerApply(marker, delegate.createWhileStatement(test, body)); } function parseForVariableDeclaration() { var marker = markerCreate(), token = lex(), declarations = parseVariableDeclarationList(); return markerApply(marker, delegate.createVariableDeclaration(declarations, token.value)); } function parseForStatement(opts) { var init, test, update, left, right, body, operator, oldInIteration, marker = markerCreate(); init = test = update = null; expectKeyword('for'); // http://wiki.ecmascript.org/doku.php?id=proposals:iterators_and_generators&s=each if (matchContextualKeyword('each')) { throwError({}, Messages.EachNotAllowed); } expect('('); if (match(';')) { lex(); } else { if (matchKeyword('var') || matchKeyword('let') || matchKeyword('const')) { state.allowIn = false; init = parseForVariableDeclaration(); state.allowIn = true; if (init.declarations.length === 1) { if (matchKeyword('in') || matchContextualKeyword('of')) { operator = lookahead; if (!((operator.value === 'in' || init.kind !== 'var') && init.declarations[0].init)) { lex(); left = init; right = parseExpression(); init = null; } } } } else { state.allowIn = false; init = parseExpression(); state.allowIn = true; if (matchContextualKeyword('of')) { operator = lex(); left = init; right = parseExpression(); init = null; } else if (matchKeyword('in')) { // LeftHandSideExpression if (!isAssignableLeftHandSide(init)) { throwError({}, Messages.InvalidLHSInForIn); } operator = lex(); left = init; right = parseExpression(); init = null; } } if (typeof left === 'undefined') { expect(';'); } } if (typeof left === 'undefined') { if (!match(';')) { test = parseExpression(); } expect(';'); if (!match(')')) { update = parseExpression(); } } expect(')'); oldInIteration = state.inIteration; state.inIteration = true; if (!(opts !== undefined && opts.ignoreBody)) { body = parseStatement(); } state.inIteration = oldInIteration; if (typeof left === 'undefined') { return markerApply(marker, delegate.createForStatement(init, test, update, body)); } if (operator.value === 'in') { return markerApply(marker, delegate.createForInStatement(left, right, body)); } return markerApply(marker, delegate.createForOfStatement(left, right, body)); } // 12.7 The continue statement function parseContinueStatement() { var label = null, key, marker = markerCreate(); expectKeyword('continue'); // Optimize the most common form: 'continue;'. if (source.charCodeAt(index) === 59) { lex(); if (!state.inIteration) { throwError({}, Messages.IllegalContinue); } return markerApply(marker, delegate.createContinueStatement(null)); } if (peekLineTerminator()) { if (!state.inIteration) { throwError({}, Messages.IllegalContinue); } return markerApply(marker, delegate.createContinueStatement(null)); } if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); key = '$' + label.name; if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { throwError({}, Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !state.inIteration) { throwError({}, Messages.IllegalContinue); } return markerApply(marker, delegate.createContinueStatement(label)); } // 12.8 The break statement function parseBreakStatement() { var label = null, key, marker = markerCreate(); expectKeyword('break'); // Catch the very common case first: immediately a semicolon (char #59). if (source.charCodeAt(index) === 59) { lex(); if (!(state.inIteration || state.inSwitch)) { throwError({}, Messages.IllegalBreak); } return markerApply(marker, delegate.createBreakStatement(null)); } if (peekLineTerminator()) { if (!(state.inIteration || state.inSwitch)) { throwError({}, Messages.IllegalBreak); } return markerApply(marker, delegate.createBreakStatement(null)); } if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); key = '$' + label.name; if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { throwError({}, Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !(state.inIteration || state.inSwitch)) { throwError({}, Messages.IllegalBreak); } return markerApply(marker, delegate.createBreakStatement(label)); } // 12.9 The return statement function parseReturnStatement() { var argument = null, marker = markerCreate(); expectKeyword('return'); if (!state.inFunctionBody) { throwErrorTolerant({}, Messages.IllegalReturn); } // 'return' followed by a space and an identifier is very common. if (source.charCodeAt(index) === 32) { if (isIdentifierStart(source.charCodeAt(index + 1))) { argument = parseExpression(); consumeSemicolon(); return markerApply(marker, delegate.createReturnStatement(argument)); } } if (peekLineTerminator()) { return markerApply(marker, delegate.createReturnStatement(null)); } if (!match(';')) { if (!match('}') && lookahead.type !== Token.EOF) { argument = parseExpression(); } } consumeSemicolon(); return markerApply(marker, delegate.createReturnStatement(argument)); } // 12.10 The with statement function parseWithStatement() { var object, body, marker = markerCreate(); if (strict) { throwErrorTolerant({}, Messages.StrictModeWith); } expectKeyword('with'); expect('('); object = parseExpression(); expect(')'); body = parseStatement(); return markerApply(marker, delegate.createWithStatement(object, body)); } // 12.10 The swith statement function parseSwitchCase() { var test, consequent = [], sourceElement, marker = markerCreate(); if (matchKeyword('default')) { lex(); test = null; } else { expectKeyword('case'); test = parseExpression(); } expect(':'); while (index < length) { if (match('}') || matchKeyword('default') || matchKeyword('case')) { break; } sourceElement = parseSourceElement(); if (typeof sourceElement === 'undefined') { break; } consequent.push(sourceElement); } return markerApply(marker, delegate.createSwitchCase(test, consequent)); } function parseSwitchStatement() { var discriminant, cases, clause, oldInSwitch, defaultFound, marker = markerCreate(); expectKeyword('switch'); expect('('); discriminant = parseExpression(); expect(')'); expect('{'); cases = []; if (match('}')) { lex(); return markerApply(marker, delegate.createSwitchStatement(discriminant, cases)); } oldInSwitch = state.inSwitch; state.inSwitch = true; defaultFound = false; while (index < length) { if (match('}')) { break; } clause = parseSwitchCase(); if (clause.test === null) { if (defaultFound) { throwError({}, Messages.MultipleDefaultsInSwitch); } defaultFound = true; } cases.push(clause); } state.inSwitch = oldInSwitch; expect('}'); return markerApply(marker, delegate.createSwitchStatement(discriminant, cases)); } // 12.13 The throw statement function parseThrowStatement() { var argument, marker = markerCreate(); expectKeyword('throw'); if (peekLineTerminator()) { throwError({}, Messages.NewlineAfterThrow); } argument = parseExpression(); consumeSemicolon(); return markerApply(marker, delegate.createThrowStatement(argument)); } // 12.14 The try statement function parseCatchClause() { var param, body, marker = markerCreate(); expectKeyword('catch'); expect('('); if (match(')')) { throwUnexpected(lookahead); } param = parseExpression(); // 12.14.1 if (strict && param.type === Syntax.Identifier && isRestrictedWord(param.name)) { throwErrorTolerant({}, Messages.StrictCatchVariable); } expect(')'); body = parseBlock(); return markerApply(marker, delegate.createCatchClause(param, body)); } function parseTryStatement() { var block, handlers = [], finalizer = null, marker = markerCreate(); expectKeyword('try'); block = parseBlock(); if (matchKeyword('catch')) { handlers.push(parseCatchClause()); } if (matchKeyword('finally')) { lex(); finalizer = parseBlock(); } if (handlers.length === 0 && !finalizer) { throwError({}, Messages.NoCatchOrFinally); } return markerApply(marker, delegate.createTryStatement(block, [], handlers, finalizer)); } // 12.15 The debugger statement function parseDebuggerStatement() { var marker = markerCreate(); expectKeyword('debugger'); consumeSemicolon(); return markerApply(marker, delegate.createDebuggerStatement()); } // 12 Statements function parseStatement() { var type = lookahead.type, marker, expr, labeledBody, key; if (type === Token.EOF) { throwUnexpected(lookahead); } if (type === Token.Punctuator) { switch (lookahead.value) { case ';': return parseEmptyStatement(); case '{': return parseBlock(); case '(': return parseExpressionStatement(); default: break; } } if (type === Token.Keyword) { switch (lookahead.value) { case 'break': return parseBreakStatement(); case 'continue': return parseContinueStatement(); case 'debugger': return parseDebuggerStatement(); case 'do': return parseDoWhileStatement(); case 'for': return parseForStatement(); case 'function': return parseFunctionDeclaration(); case 'class': return parseClassDeclaration(); case 'if': return parseIfStatement(); case 'return': return parseReturnStatement(); case 'switch': return parseSwitchStatement(); case 'throw': return parseThrowStatement(); case 'try': return parseTryStatement(); case 'var': return parseVariableStatement(); case 'while': return parseWhileStatement(); case 'with': return parseWithStatement(); default: break; } } marker = markerCreate(); expr = parseExpression(); // 12.12 Labelled Statements if ((expr.type === Syntax.Identifier) && match(':')) { lex(); key = '$' + expr.name; if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) { throwError({}, Messages.Redeclaration, 'Label', expr.name); } state.labelSet[key] = true; labeledBody = parseStatement(); delete state.labelSet[key]; return markerApply(marker, delegate.createLabeledStatement(expr, labeledBody)); } consumeSemicolon(); return markerApply(marker, delegate.createExpressionStatement(expr)); } // 13 Function Definition function parseConciseBody() { if (match('{')) { return parseFunctionSourceElements(); } return parseAssignmentExpression(); } function parseFunctionSourceElements() { var sourceElement, sourceElements = [], token, directive, firstRestricted, oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesizedCount, marker = markerCreate(); expect('{'); while (index < length) { if (lookahead.type !== Token.StringLiteral) { break; } token = lookahead; sourceElement = parseSourceElement(); sourceElements.push(sourceElement); if (sourceElement.expression.type !== Syntax.Literal) { // this is not directive break; } directive = source.slice(token.range[0] + 1, token.range[1] - 1); if (directive === 'use strict') { strict = true; if (firstRestricted) { throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); } } else { if (!firstRestricted && token.octal) { firstRestricted = token; } } } oldLabelSet = state.labelSet; oldInIteration = state.inIteration; oldInSwitch = state.inSwitch; oldInFunctionBody = state.inFunctionBody; oldParenthesizedCount = state.parenthesizedCount; state.labelSet = {}; state.inIteration = false; state.inSwitch = false; state.inFunctionBody = true; state.parenthesizedCount = 0; while (index < length) { if (match('}')) { break; } sourceElement = parseSourceElement(); if (typeof sourceElement === 'undefined') { break; } sourceElements.push(sourceElement); } expect('}'); state.labelSet = oldLabelSet; state.inIteration = oldInIteration; state.inSwitch = oldInSwitch; state.inFunctionBody = oldInFunctionBody; state.parenthesizedCount = oldParenthesizedCount; return markerApply(marker, delegate.createBlockStatement(sourceElements)); } function validateParam(options, param, name) { var key = '$' + name; if (strict) { if (isRestrictedWord(name)) { options.stricted = param; options.message = Messages.StrictParamName; } if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { options.stricted = param; options.message = Messages.StrictParamDupe; } } else if (!options.firstRestricted) { if (isRestrictedWord(name)) { options.firstRestricted = param; options.message = Messages.StrictParamName; } else if (isStrictModeReservedWord(name)) { options.firstRestricted = param; options.message = Messages.StrictReservedWord; } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { options.firstRestricted = param; options.message = Messages.StrictParamDupe; } } options.paramSet[key] = true; } function parseParam(options) { var token, rest, param, def; token = lookahead; if (token.value === '...') { token = lex(); rest = true; } if (match('[')) { param = parseArrayInitialiser(); reinterpretAsDestructuredParameter(options, param); } else if (match('{')) { if (rest) { throwError({}, Messages.ObjectPatternAsRestParameter); } param = parseObjectInitialiser(); reinterpretAsDestructuredParameter(options, param); } else { // Typing rest params is awkward, so punting on that for now param = rest ? parseVariableIdentifier() : parseTypeAnnotatableIdentifier( false, /* requireTypeAnnotation */ true /* canBeOptionalParam */ ); validateParam(options, token, token.value); } if (match('=')) { if (rest) { throwErrorTolerant(lookahead, Messages.DefaultRestParameter); } lex(); def = parseAssignmentExpression(); ++options.defaultCount; } if (rest) { if (!match(')')) { throwError({}, Messages.ParameterAfterRestParameter); } options.rest = param; return false; } options.params.push(param); options.defaults.push(def); return !match(')'); } function parseParams(firstRestricted) { var options, marker = markerCreate(); options = { params: [], defaultCount: 0, defaults: [], rest: null, firstRestricted: firstRestricted }; expect('('); if (!match(')')) { options.paramSet = {}; while (index < length) { if (!parseParam(options)) { break; } expect(','); } } expect(')'); if (options.defaultCount === 0) { options.defaults = []; } if (match(':')) { options.returnType = parseTypeAnnotation(); } return markerApply(marker, options); } function parseFunctionDeclaration() { var id, body, token, tmp, firstRestricted, message, previousStrict, previousYieldAllowed, generator, marker = markerCreate(), parametricType; expectKeyword('function'); generator = false; if (match('*')) { lex(); generator = true; } token = lookahead; id = parseVariableIdentifier(); if (match('<')) { parametricType = parseParametricTypeAnnotation(); } if (strict) { if (isRestrictedWord(token.value)) { throwErrorTolerant(token, Messages.StrictFunctionName); } } else { if (isRestrictedWord(token.value)) { firstRestricted = token; message = Messages.StrictFunctionName; } else if (isStrictModeReservedWord(token.value)) { firstRestricted = token; message = Messages.StrictReservedWord; } } tmp = parseParams(firstRestricted); firstRestricted = tmp.firstRestricted; if (tmp.message) { message = tmp.message; } previousStrict = strict; previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = generator; body = parseFunctionSourceElements(); if (strict && firstRestricted) { throwError(firstRestricted, message); } if (strict && tmp.stricted) { throwErrorTolerant(tmp.stricted, message); } strict = previousStrict; state.yieldAllowed = previousYieldAllowed; return markerApply(marker, delegate.createFunctionDeclaration(id, tmp.params, tmp.defaults, body, tmp.rest, generator, false, tmp.returnType, parametricType)); } function parseFunctionExpression() { var token, id = null, firstRestricted, message, tmp, body, previousStrict, previousYieldAllowed, generator, marker = markerCreate(), parametricType; expectKeyword('function'); generator = false; if (match('*')) { lex(); generator = true; } if (!match('(')) { if (!match('<')) { token = lookahead; id = parseVariableIdentifier(); if (strict) { if (isRestrictedWord(token.value)) { throwErrorTolerant(token, Messages.StrictFunctionName); } } else { if (isRestrictedWord(token.value)) { firstRestricted = token; message = Messages.StrictFunctionName; } else if (isStrictModeReservedWord(token.value)) { firstRestricted = token; message = Messages.StrictReservedWord; } } } if (match('<')) { parametricType = parseParametricTypeAnnotation(); } } tmp = parseParams(firstRestricted); firstRestricted = tmp.firstRestricted; if (tmp.message) { message = tmp.message; } previousStrict = strict; previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = generator; body = parseFunctionSourceElements(); if (strict && firstRestricted) { throwError(firstRestricted, message); } if (strict && tmp.stricted) { throwErrorTolerant(tmp.stricted, message); } strict = previousStrict; state.yieldAllowed = previousYieldAllowed; return markerApply(marker, delegate.createFunctionExpression(id, tmp.params, tmp.defaults, body, tmp.rest, generator, false, tmp.returnType, parametricType)); } function parseYieldExpression() { var yieldToken, delegateFlag, expr, marker = markerCreate(); yieldToken = lex(); assert(yieldToken.value === 'yield', 'Called parseYieldExpression with non-yield lookahead.'); if (!state.yieldAllowed) { throwErrorTolerant({}, Messages.IllegalYield); } delegateFlag = false; if (match('*')) { lex(); delegateFlag = true; } expr = parseAssignmentExpression(); return markerApply(marker, delegate.createYieldExpression(expr, delegateFlag)); } // 14 Classes function parseMethodDefinition(existingPropNames) { var token, key, param, propType, isValidDuplicateProp = false, marker = markerCreate(), token2, parametricType, parametricTypeMarker, annotationMarker; if (lookahead.value === 'static') { propType = ClassPropertyType["static"]; lex(); } else { propType = ClassPropertyType.prototype; } if (match('*')) { lex(); return markerApply(marker, delegate.createMethodDefinition( propType, '', parseObjectPropertyKey(), parsePropertyMethodFunction({ generator: true }) )); } token = lookahead; //parametricTypeMarker = markerCreate(); key = parseObjectPropertyKey(); if (token.value === 'get' && !match('(')) { key = parseObjectPropertyKey(); // It is a syntax error if any other properties have a name // duplicating this one unless they are a setter if (existingPropNames[propType].hasOwnProperty(key.name)) { isValidDuplicateProp = // There isn't already a getter for this prop existingPropNames[propType][key.name].get === undefined // There isn't already a data prop by this name && existingPropNames[propType][key.name].data === undefined // The only existing prop by this name is a setter && existingPropNames[propType][key.name].set !== undefined; if (!isValidDuplicateProp) { throwError(key, Messages.IllegalDuplicateClassProperty); } } else { existingPropNames[propType][key.name] = {}; } existingPropNames[propType][key.name].get = true; expect('('); expect(')'); return markerApply(marker, delegate.createMethodDefinition( propType, 'get', key, parsePropertyFunction({ generator: false }) )); } if (token.value === 'set' && !match('(')) { key = parseObjectPropertyKey(); // It is a syntax error if any other properties have a name // duplicating this one unless they are a getter if (existingPropNames[propType].hasOwnProperty(key.name)) { isValidDuplicateProp = // There isn't already a setter for this prop existingPropNames[propType][key.name].set === undefined // There isn't already a data prop by this name && existingPropNames[propType][key.name].data === undefined // The only existing prop by this name is a getter && existingPropNames[propType][key.name].get !== undefined; if (!isValidDuplicateProp) { throwError(key, Messages.IllegalDuplicateClassProperty); } } else { existingPropNames[propType][key.name] = {}; } existingPropNames[propType][key.name].set = true; expect('('); token = lookahead; param = [ parseTypeAnnotatableIdentifier() ]; expect(')'); return markerApply(marker, delegate.createMethodDefinition( propType, 'set', key, parsePropertyFunction({ params: param, generator: false, name: token }) )); } if (match('<')) { parametricType = parseParametricTypeAnnotation(); } // It is a syntax error if any other properties have the same name as a // non-getter, non-setter method if (existingPropNames[propType].hasOwnProperty(key.name)) { throwError(key, Messages.IllegalDuplicateClassProperty); } else { existingPropNames[propType][key.name] = {}; } existingPropNames[propType][key.name].data = true; return markerApply(marker, delegate.createMethodDefinition( propType, '', key, parsePropertyMethodFunction({ generator: false, parametricType: parametricType }) )); } function parseClassProperty(existingPropNames) { var marker = markerCreate(), propertyIdentifier; propertyIdentifier = parseTypeAnnotatableIdentifier(); expect(';'); return markerApply(marker, delegate.createClassProperty( propertyIdentifier )); } function parseClassElement(existingProps) { if (match(';')) { lex(); return; } var doubleLookahead = lookahead2(); if (doubleLookahead.type === Token.Punctuator) { if (doubleLookahead.value === ':') { return parseClassProperty(existingProps); } } return parseMethodDefinition(existingProps); } function parseClassBody() { var classElement, classElements = [], existingProps = {}, marker = markerCreate(); existingProps[ClassPropertyType["static"]] = {}; existingProps[ClassPropertyType.prototype] = {}; expect('{'); while (index < length) { if (match('}')) { break; } classElement = parseClassElement(existingProps); if (typeof classElement !== 'undefined') { classElements.push(classElement); } } expect('}'); return markerApply(marker, delegate.createClassBody(classElements)); } function parseClassExpression() { var id, previousYieldAllowed, superClass = null, marker = markerCreate(), parametricType; expectKeyword('class'); if (!matchKeyword('extends') && !match('{')) { id = parseVariableIdentifier(); } if (match('<')) { parametricType = parseParametricTypeAnnotation(); } if (matchKeyword('extends')) { expectKeyword('extends'); previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = false; superClass = parseAssignmentExpression(); state.yieldAllowed = previousYieldAllowed; } return markerApply(marker, delegate.createClassExpression(id, superClass, parseClassBody(), parametricType)); } function parseClassDeclaration() { var id, previousYieldAllowed, superClass = null, marker = markerCreate(), parametricType, superParametricType; expectKeyword('class'); id = parseVariableIdentifier(); if (match('<')) { parametricType = parseParametricTypeAnnotation(); } if (matchKeyword('extends')) { expectKeyword('extends'); previousYieldAllowed = state.yieldAllowed; state.yieldAllowed = false; superClass = parseAssignmentExpression(); state.yieldAllowed = previousYieldAllowed; } return markerApply(marker, delegate.createClassDeclaration(id, superClass, parseClassBody(), parametricType, superParametricType)); } // 15 Program function matchModuleDeclaration() { var id; if (matchContextualKeyword('module')) { id = lookahead2(); return id.type === Token.StringLiteral || id.type === Token.Identifier; } return false; } function parseSourceElement() { if (lookahead.type === Token.Keyword) { switch (lookahead.value) { case 'const': case 'let': return parseConstLetDeclaration(lookahead.value); case 'function': return parseFunctionDeclaration(); case 'export': return parseExportDeclaration(); case 'import': return parseImportDeclaration(); default: return parseStatement(); } } if (matchModuleDeclaration()) { throwError({}, Messages.NestedModule); } if (lookahead.type !== Token.EOF) { return parseStatement(); } } function parseProgramElement() { if (lookahead.type === Token.Keyword) { switch (lookahead.value) { case 'export': return parseExportDeclaration(); case 'import': return parseImportDeclaration(); } } if (matchModuleDeclaration()) { return parseModuleDeclaration(); } return parseSourceElement(); } function parseProgramElements() { var sourceElement, sourceElements = [], token, directive, firstRestricted; while (index < length) { token = lookahead; if (token.type !== Token.StringLiteral) { break; } sourceElement = parseProgramElement(); sourceElements.push(sourceElement); if (sourceElement.expression.type !== Syntax.Literal) { // this is not directive break; } directive = source.slice(token.range[0] + 1, token.range[1] - 1); if (directive === 'use strict') { strict = true; if (firstRestricted) { throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); } } else { if (!firstRestricted && token.octal) { firstRestricted = token; } } } while (index < length) { sourceElement = parseProgramElement(); if (typeof sourceElement === 'undefined') { break; } sourceElements.push(sourceElement); } return sourceElements; } function parseModuleElement() { return parseSourceElement(); } function parseModuleElements() { var list = [], statement; while (index < length) { if (match('}')) { break; } statement = parseModuleElement(); if (typeof statement === 'undefined') { break; } list.push(statement); } return list; } function parseModuleBlock() { var block, marker = markerCreate(); expect('{'); block = parseModuleElements(); expect('}'); return markerApply(marker, delegate.createBlockStatement(block)); } function parseProgram() { var body, marker = markerCreate(); strict = false; peek(); body = parseProgramElements(); return markerApply(marker, delegate.createProgram(body)); } // The following functions are needed only when the option to preserve // the comments is active. function addComment(type, value, start, end, loc) { var comment; assert(typeof start === 'number', 'Comment must have valid position'); // Because the way the actual token is scanned, often the comments // (if any) are skipped twice during the lexical analysis. // Thus, we need to skip adding a comment if the comment array already // handled it. if (state.lastCommentStart >= start) { return; } state.lastCommentStart = start; comment = { type: type, value: value }; if (extra.range) { comment.range = [start, end]; } if (extra.loc) { comment.loc = loc; } extra.comments.push(comment); if (extra.attachComment) { extra.leadingComments.push(comment); extra.trailingComments.push(comment); } } function scanComment() { var comment, ch, loc, start, blockComment, lineComment; comment = ''; blockComment = false; lineComment = false; while (index < length) { ch = source[index]; if (lineComment) { ch = source[index++]; if (isLineTerminator(ch.charCodeAt(0))) { loc.end = { line: lineNumber, column: index - lineStart - 1 }; lineComment = false; addComment('Line', comment, start, index - 1, loc); if (ch === '\r' && source[index] === '\n') { ++index; } ++lineNumber; lineStart = index; comment = ''; } else if (index >= length) { lineComment = false; comment += ch; loc.end = { line: lineNumber, column: length - lineStart }; addComment('Line', comment, start, length, loc); } else { comment += ch; } } else if (blockComment) { if (isLineTerminator(ch.charCodeAt(0))) { if (ch === '\r') { ++index; comment += '\r'; } if (ch !== '\r' || source[index] === '\n') { comment += source[index]; ++lineNumber; ++index; lineStart = index; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } } else { ch = source[index++]; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } comment += ch; if (ch === '*') { ch = source[index]; if (ch === '/') { comment = comment.substr(0, comment.length - 1); blockComment = false; ++index; loc.end = { line: lineNumber, column: index - lineStart }; addComment('Block', comment, start, index, loc); comment = ''; } } } } else if (ch === '/') { ch = source[index + 1]; if (ch === '/') { loc = { start: { line: lineNumber, column: index - lineStart } }; start = index; index += 2; lineComment = true; if (index >= length) { loc.end = { line: lineNumber, column: index - lineStart }; lineComment = false; addComment('Line', comment, start, index, loc); } } else if (ch === '*') { start = index; index += 2; blockComment = true; loc = { start: { line: lineNumber, column: index - lineStart - 2 } }; if (index >= length) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } } else { break; } } else if (isWhiteSpace(ch.charCodeAt(0))) { ++index; } else if (isLineTerminator(ch.charCodeAt(0))) { ++index; if (ch === '\r' && source[index] === '\n') { ++index; } ++lineNumber; lineStart = index; } else { break; } } } // 16 XJS XHTMLEntities = { quot: '\u0022', amp: '&', apos: '\u0027', lt: '<', gt: '>', nbsp: '\u00A0', iexcl: '\u00A1', cent: '\u00A2', pound: '\u00A3', curren: '\u00A4', yen: '\u00A5', brvbar: '\u00A6', sect: '\u00A7', uml: '\u00A8', copy: '\u00A9', ordf: '\u00AA', laquo: '\u00AB', not: '\u00AC', shy: '\u00AD', reg: '\u00AE', macr: '\u00AF', deg: '\u00B0', plusmn: '\u00B1', sup2: '\u00B2', sup3: '\u00B3', acute: '\u00B4', micro: '\u00B5', para: '\u00B6', middot: '\u00B7', cedil: '\u00B8', sup1: '\u00B9', ordm: '\u00BA', raquo: '\u00BB', frac14: '\u00BC', frac12: '\u00BD', frac34: '\u00BE', iquest: '\u00BF', Agrave: '\u00C0', Aacute: '\u00C1', Acirc: '\u00C2', Atilde: '\u00C3', Auml: '\u00C4', Aring: '\u00C5', AElig: '\u00C6', Ccedil: '\u00C7', Egrave: '\u00C8', Eacute: '\u00C9', Ecirc: '\u00CA', Euml: '\u00CB', Igrave: '\u00CC', Iacute: '\u00CD', Icirc: '\u00CE', Iuml: '\u00CF', ETH: '\u00D0', Ntilde: '\u00D1', Ograve: '\u00D2', Oacute: '\u00D3', Ocirc: '\u00D4', Otilde: '\u00D5', Ouml: '\u00D6', times: '\u00D7', Oslash: '\u00D8', Ugrave: '\u00D9', Uacute: '\u00DA', Ucirc: '\u00DB', Uuml: '\u00DC', Yacute: '\u00DD', THORN: '\u00DE', szlig: '\u00DF', agrave: '\u00E0', aacute: '\u00E1', acirc: '\u00E2', atilde: '\u00E3', auml: '\u00E4', aring: '\u00E5', aelig: '\u00E6', ccedil: '\u00E7', egrave: '\u00E8', eacute: '\u00E9', ecirc: '\u00EA', euml: '\u00EB', igrave: '\u00EC', iacute: '\u00ED', icirc: '\u00EE', iuml: '\u00EF', eth: '\u00F0', ntilde: '\u00F1', ograve: '\u00F2', oacute: '\u00F3', ocirc: '\u00F4', otilde: '\u00F5', ouml: '\u00F6', divide: '\u00F7', oslash: '\u00F8', ugrave: '\u00F9', uacute: '\u00FA', ucirc: '\u00FB', uuml: '\u00FC', yacute: '\u00FD', thorn: '\u00FE', yuml: '\u00FF', OElig: '\u0152', oelig: '\u0153', Scaron: '\u0160', scaron: '\u0161', Yuml: '\u0178', fnof: '\u0192', circ: '\u02C6', tilde: '\u02DC', Alpha: '\u0391', Beta: '\u0392', Gamma: '\u0393', Delta: '\u0394', Epsilon: '\u0395', Zeta: '\u0396', Eta: '\u0397', Theta: '\u0398', Iota: '\u0399', Kappa: '\u039A', Lambda: '\u039B', Mu: '\u039C', Nu: '\u039D', Xi: '\u039E', Omicron: '\u039F', Pi: '\u03A0', Rho: '\u03A1', Sigma: '\u03A3', Tau: '\u03A4', Upsilon: '\u03A5', Phi: '\u03A6', Chi: '\u03A7', Psi: '\u03A8', Omega: '\u03A9', alpha: '\u03B1', beta: '\u03B2', gamma: '\u03B3', delta: '\u03B4', epsilon: '\u03B5', zeta: '\u03B6', eta: '\u03B7', theta: '\u03B8', iota: '\u03B9', kappa: '\u03BA', lambda: '\u03BB', mu: '\u03BC', nu: '\u03BD', xi: '\u03BE', omicron: '\u03BF', pi: '\u03C0', rho: '\u03C1', sigmaf: '\u03C2', sigma: '\u03C3', tau: '\u03C4', upsilon: '\u03C5', phi: '\u03C6', chi: '\u03C7', psi: '\u03C8', omega: '\u03C9', thetasym: '\u03D1', upsih: '\u03D2', piv: '\u03D6', ensp: '\u2002', emsp: '\u2003', thinsp: '\u2009', zwnj: '\u200C', zwj: '\u200D', lrm: '\u200E', rlm: '\u200F', ndash: '\u2013', mdash: '\u2014', lsquo: '\u2018', rsquo: '\u2019', sbquo: '\u201A', ldquo: '\u201C', rdquo: '\u201D', bdquo: '\u201E', dagger: '\u2020', Dagger: '\u2021', bull: '\u2022', hellip: '\u2026', permil: '\u2030', prime: '\u2032', Prime: '\u2033', lsaquo: '\u2039', rsaquo: '\u203A', oline: '\u203E', frasl: '\u2044', euro: '\u20AC', image: '\u2111', weierp: '\u2118', real: '\u211C', trade: '\u2122', alefsym: '\u2135', larr: '\u2190', uarr: '\u2191', rarr: '\u2192', darr: '\u2193', harr: '\u2194', crarr: '\u21B5', lArr: '\u21D0', uArr: '\u21D1', rArr: '\u21D2', dArr: '\u21D3', hArr: '\u21D4', forall: '\u2200', part: '\u2202', exist: '\u2203', empty: '\u2205', nabla: '\u2207', isin: '\u2208', notin: '\u2209', ni: '\u220B', prod: '\u220F', sum: '\u2211', minus: '\u2212', lowast: '\u2217', radic: '\u221A', prop: '\u221D', infin: '\u221E', ang: '\u2220', and: '\u2227', or: '\u2228', cap: '\u2229', cup: '\u222A', 'int': '\u222B', there4: '\u2234', sim: '\u223C', cong: '\u2245', asymp: '\u2248', ne: '\u2260', equiv: '\u2261', le: '\u2264', ge: '\u2265', sub: '\u2282', sup: '\u2283', nsub: '\u2284', sube: '\u2286', supe: '\u2287', oplus: '\u2295', otimes: '\u2297', perp: '\u22A5', sdot: '\u22C5', lceil: '\u2308', rceil: '\u2309', lfloor: '\u230A', rfloor: '\u230B', lang: '\u2329', rang: '\u232A', loz: '\u25CA', spades: '\u2660', clubs: '\u2663', hearts: '\u2665', diams: '\u2666' }; function getQualifiedXJSName(object) { if (object.type === Syntax.XJSIdentifier) { return object.name; } if (object.type === Syntax.XJSNamespacedName) { return object.namespace.name + ':' + object.name.name; } if (object.type === Syntax.XJSMemberExpression) { return ( getQualifiedXJSName(object.object) + '.' + getQualifiedXJSName(object.property) ); } } function isXJSIdentifierStart(ch) { // exclude backslash (\) return (ch !== 92) && isIdentifierStart(ch); } function isXJSIdentifierPart(ch) { // exclude backslash (\) and add hyphen (-) return (ch !== 92) && (ch === 45 || isIdentifierPart(ch)); } function scanXJSIdentifier() { var ch, start, value = ''; start = index; while (index < length) { ch = source.charCodeAt(index); if (!isXJSIdentifierPart(ch)) { break; } value += source[index++]; } return { type: Token.XJSIdentifier, value: value, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanXJSEntity() { var ch, str = '', count = 0, entity; ch = source[index]; assert(ch === '&', 'Entity must start with an ampersand'); index++; while (index < length && count++ < 10) { ch = source[index++]; if (ch === ';') { break; } str += ch; } if (str[0] === '#' && str[1] === 'x') { entity = String.fromCharCode(parseInt(str.substr(2), 16)); } else if (str[0] === '#') { entity = String.fromCharCode(parseInt(str.substr(1), 10)); } else { entity = XHTMLEntities[str]; } return entity; } function scanXJSText(stopChars) { var ch, str = '', start; start = index; while (index < length) { ch = source[index]; if (stopChars.indexOf(ch) !== -1) { break; } if (ch === '&') { str += scanXJSEntity(); } else { index++; if (ch === '\r' && source[index] === '\n') { str += ch; ch = source[index]; index++; } if (isLineTerminator(ch.charCodeAt(0))) { ++lineNumber; lineStart = index; } str += ch; } } return { type: Token.XJSText, value: str, lineNumber: lineNumber, lineStart: lineStart, range: [start, index] }; } function scanXJSStringLiteral() { var innerToken, quote, start; quote = source[index]; assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote'); start = index; ++index; innerToken = scanXJSText([quote]); if (quote !== source[index]) { throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); } ++index; innerToken.range = [start, index]; return innerToken; } /** * Between XJS opening and closing tags (e.g. <foo>HERE</foo>), anything that * is not another XJS tag and is not an expression wrapped by {} is text. */ function advanceXJSChild() { var ch = source.charCodeAt(index); // { (123) and < (60) if (ch !== 123 && ch !== 60) { return scanXJSText(['<', '{']); } return scanPunctuator(); } function parseXJSIdentifier() { var token, marker = markerCreate(); if (lookahead.type !== Token.XJSIdentifier) { throwUnexpected(lookahead); } token = lex(); return markerApply(marker, delegate.createXJSIdentifier(token.value)); } function parseXJSNamespacedName() { var namespace, name, marker = markerCreate(); namespace = parseXJSIdentifier(); expect(':'); name = parseXJSIdentifier(); return markerApply(marker, delegate.createXJSNamespacedName(namespace, name)); } function parseXJSMemberExpression() { var marker = markerCreate(), expr = parseXJSIdentifier(); while (match('.')) { lex(); expr = markerApply(marker, delegate.createXJSMemberExpression(expr, parseXJSIdentifier())); } return expr; } function parseXJSElementName() { if (lookahead2().value === ':') { return parseXJSNamespacedName(); } if (lookahead2().value === '.') { return parseXJSMemberExpression(); } return parseXJSIdentifier(); } function parseXJSAttributeName() { if (lookahead2().value === ':') { return parseXJSNamespacedName(); } return parseXJSIdentifier(); } function parseXJSAttributeValue() { var value, marker; if (match('{')) { value = parseXJSExpressionContainer(); if (value.expression.type === Syntax.XJSEmptyExpression) { throwError( value, 'XJS attributes must only be assigned a non-empty ' + 'expression' ); } } else if (match('<')) { value = parseXJSElement(); } else if (lookahead.type === Token.XJSText) { marker = markerCreate(); value = markerApply(marker, delegate.createLiteral(lex())); } else { throwError({}, Messages.InvalidXJSAttributeValue); } return value; } function parseXJSEmptyExpression() { var marker = markerCreatePreserveWhitespace(); while (source.charAt(index) !== '}') { index++; } return markerApply(marker, delegate.createXJSEmptyExpression()); } function parseXJSExpressionContainer() { var expression, origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; state.inXJSChild = false; state.inXJSTag = false; expect('{'); if (match('}')) { expression = parseXJSEmptyExpression(); } else { expression = parseExpression(); } state.inXJSChild = origInXJSChild; state.inXJSTag = origInXJSTag; expect('}'); return markerApply(marker, delegate.createXJSExpressionContainer(expression)); } function parseXJSSpreadAttribute() { var expression, origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; state.inXJSChild = false; state.inXJSTag = false; expect('{'); expect('...'); expression = parseAssignmentExpression(); state.inXJSChild = origInXJSChild; state.inXJSTag = origInXJSTag; expect('}'); return markerApply(marker, delegate.createXJSSpreadAttribute(expression)); } function parseXJSAttribute() { var name, marker; if (match('{')) { return parseXJSSpreadAttribute(); } marker = markerCreate(); name = parseXJSAttributeName(); // HTML empty attribute if (match('=')) { lex(); return markerApply(marker, delegate.createXJSAttribute(name, parseXJSAttributeValue())); } return markerApply(marker, delegate.createXJSAttribute(name)); } function parseXJSChild() { var token, marker; if (match('{')) { token = parseXJSExpressionContainer(); } else if (lookahead.type === Token.XJSText) { marker = markerCreatePreserveWhitespace(); token = markerApply(marker, delegate.createLiteral(lex())); } else { token = parseXJSElement(); } return token; } function parseXJSClosingElement() { var name, origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; state.inXJSChild = false; state.inXJSTag = true; expect('<'); expect('/'); name = parseXJSElementName(); // Because advance() (called by lex() called by expect()) expects there // to be a valid token after >, it needs to know whether to look for a // standard JS token or an XJS text node state.inXJSChild = origInXJSChild; state.inXJSTag = origInXJSTag; expect('>'); return markerApply(marker, delegate.createXJSClosingElement(name)); } function parseXJSOpeningElement() { var name, attribute, attributes = [], selfClosing = false, origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; state.inXJSChild = false; state.inXJSTag = true; expect('<'); name = parseXJSElementName(); while (index < length && lookahead.value !== '/' && lookahead.value !== '>') { attributes.push(parseXJSAttribute()); } state.inXJSTag = origInXJSTag; if (lookahead.value === '/') { expect('/'); // Because advance() (called by lex() called by expect()) expects // there to be a valid token after >, it needs to know whether to // look for a standard JS token or an XJS text node state.inXJSChild = origInXJSChild; expect('>'); selfClosing = true; } else { state.inXJSChild = true; expect('>'); } return markerApply(marker, delegate.createXJSOpeningElement(name, attributes, selfClosing)); } function parseXJSElement() { var openingElement, closingElement = null, children = [], origInXJSChild, origInXJSTag, marker = markerCreate(); origInXJSChild = state.inXJSChild; origInXJSTag = state.inXJSTag; openingElement = parseXJSOpeningElement(); if (!openingElement.selfClosing) { while (index < length) { state.inXJSChild = false; // Call lookahead2() with inXJSChild = false because </ should not be considered in the child if (lookahead.value === '<' && lookahead2().value === '/') { break; } state.inXJSChild = true; children.push(parseXJSChild()); } state.inXJSChild = origInXJSChild; state.inXJSTag = origInXJSTag; closingElement = parseXJSClosingElement(); if (getQualifiedXJSName(closingElement.name) !== getQualifiedXJSName(openingElement.name)) { throwError({}, Messages.ExpectedXJSClosingTag, getQualifiedXJSName(openingElement.name)); } } // When (erroneously) writing two adjacent tags like // // var x = <div>one</div><div>two</div>; // // the default error message is a bit incomprehensible. Since it's // rarely (never?) useful to write a less-than sign after an XJS // element, we disallow it here in the parser in order to provide a // better error message. (In the rare case that the less-than operator // was intended, the left tag can be wrapped in parentheses.) if (!origInXJSChild && match('<')) { throwError(lookahead, Messages.AdjacentXJSElements); } return markerApply(marker, delegate.createXJSElement(openingElement, closingElement, children)); } function collectToken() { var start, loc, token, range, value; if (!state.inXJSChild) { skipComment(); } start = index; loc = { start: { line: lineNumber, column: index - lineStart } }; token = extra.advance(); loc.end = { line: lineNumber, column: index - lineStart }; if (token.type !== Token.EOF) { range = [token.range[0], token.range[1]]; value = source.slice(token.range[0], token.range[1]); extra.tokens.push({ type: TokenName[token.type], value: value, range: range, loc: loc }); } return token; } function collectRegex() { var pos, loc, regex, token; skipComment(); pos = index; loc = { start: { line: lineNumber, column: index - lineStart } }; regex = extra.scanRegExp(); loc.end = { line: lineNumber, column: index - lineStart }; if (!extra.tokenize) { // Pop the previous token, which is likely '/' or '/=' if (extra.tokens.length > 0) { token = extra.tokens[extra.tokens.length - 1]; if (token.range[0] === pos && token.type === 'Punctuator') { if (token.value === '/' || token.value === '/=') { extra.tokens.pop(); } } } extra.tokens.push({ type: 'RegularExpression', value: regex.literal, range: [pos, index], loc: loc }); } return regex; } function filterTokenLocation() { var i, entry, token, tokens = []; for (i = 0; i < extra.tokens.length; ++i) { entry = extra.tokens[i]; token = { type: entry.type, value: entry.value }; if (extra.range) { token.range = entry.range; } if (extra.loc) { token.loc = entry.loc; } tokens.push(token); } extra.tokens = tokens; } function patch() { if (extra.comments) { extra.skipComment = skipComment; skipComment = scanComment; } if (typeof extra.tokens !== 'undefined') { extra.advance = advance; extra.scanRegExp = scanRegExp; advance = collectToken; scanRegExp = collectRegex; } } function unpatch() { if (typeof extra.skipComment === 'function') { skipComment = extra.skipComment; } if (typeof extra.scanRegExp === 'function') { advance = extra.advance; scanRegExp = extra.scanRegExp; } } // This is used to modify the delegate. function extend(object, properties) { var entry, result = {}; for (entry in object) { if (object.hasOwnProperty(entry)) { result[entry] = object[entry]; } } for (entry in properties) { if (properties.hasOwnProperty(entry)) { result[entry] = properties[entry]; } } return result; } function tokenize(code, options) { var toString, token, tokens; toString = String; if (typeof code !== 'string' && !(code instanceof String)) { code = toString(code); } delegate = SyntaxTreeDelegate; source = code; index = 0; lineNumber = (source.length > 0) ? 1 : 0; lineStart = 0; length = source.length; lookahead = null; state = { allowKeyword: true, allowIn: true, labelSet: {}, inFunctionBody: false, inIteration: false, inSwitch: false, lastCommentStart: -1 }; extra = {}; // Options matching. options = options || {}; // Of course we collect tokens here. options.tokens = true; extra.tokens = []; extra.tokenize = true; // The following two fields are necessary to compute the Regex tokens. extra.openParenToken = -1; extra.openCurlyToken = -1; extra.range = (typeof options.range === 'boolean') && options.range; extra.loc = (typeof options.loc === 'boolean') && options.loc; if (typeof options.comment === 'boolean' && options.comment) { extra.comments = []; } if (typeof options.tolerant === 'boolean' && options.tolerant) { extra.errors = []; } if (length > 0) { if (typeof source[0] === 'undefined') { // Try first to convert to a string. This is good as fast path // for old IE which understands string indexing for string // literals only and not for string object. if (code instanceof String) { source = code.valueOf(); } } } patch(); try { peek(); if (lookahead.type === Token.EOF) { return extra.tokens; } token = lex(); while (lookahead.type !== Token.EOF) { try { token = lex(); } catch (lexError) { token = lookahead; if (extra.errors) { extra.errors.push(lexError); // We have to break on the first error // to avoid infinite loops. break; } else { throw lexError; } } } filterTokenLocation(); tokens = extra.tokens; if (typeof extra.comments !== 'undefined') { tokens.comments = extra.comments; } if (typeof extra.errors !== 'undefined') { tokens.errors = extra.errors; } } catch (e) { throw e; } finally { unpatch(); extra = {}; } return tokens; } function parse(code, options) { var program, toString; toString = String; if (typeof code !== 'string' && !(code instanceof String)) { code = toString(code); } delegate = SyntaxTreeDelegate; source = code; index = 0; lineNumber = (source.length > 0) ? 1 : 0; lineStart = 0; length = source.length; lookahead = null; state = { allowKeyword: false, allowIn: true, labelSet: {}, parenthesizedCount: 0, inFunctionBody: false, inIteration: false, inSwitch: false, inXJSChild: false, inXJSTag: false, lastCommentStart: -1, yieldAllowed: false }; extra = {}; if (typeof options !== 'undefined') { extra.range = (typeof options.range === 'boolean') && options.range; extra.loc = (typeof options.loc === 'boolean') && options.loc; extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment; if (extra.loc && options.source !== null && options.source !== undefined) { delegate = extend(delegate, { 'postProcess': function (node) { node.loc.source = toString(options.source); return node; } }); } if (typeof options.tokens === 'boolean' && options.tokens) { extra.tokens = []; } if (typeof options.comment === 'boolean' && options.comment) { extra.comments = []; } if (typeof options.tolerant === 'boolean' && options.tolerant) { extra.errors = []; } if (extra.attachComment) { extra.range = true; extra.comments = []; extra.bottomRightStack = []; extra.trailingComments = []; extra.leadingComments = []; } } if (length > 0) { if (typeof source[0] === 'undefined') { // Try first to convert to a string. This is good as fast path // for old IE which understands string indexing for string // literals only and not for string object. if (code instanceof String) { source = code.valueOf(); } } } patch(); try { program = parseProgram(); if (typeof extra.comments !== 'undefined') { program.comments = extra.comments; } if (typeof extra.tokens !== 'undefined') { filterTokenLocation(); program.tokens = extra.tokens; } if (typeof extra.errors !== 'undefined') { program.errors = extra.errors; } } catch (e) { throw e; } finally { unpatch(); extra = {}; } return program; } // Sync with *.json manifests. exports.version = '6001.0001.0000-dev-harmony-fb'; exports.tokenize = tokenize; exports.parse = parse; // Deep copy. exports.Syntax = (function () { var name, types = {}; if (typeof Object.create === 'function') { types = Object.create(null); } for (name in Syntax) { if (Syntax.hasOwnProperty(name)) { types[name] = Syntax[name]; } } if (typeof Object.freeze === 'function') { Object.freeze(types); } return types; }()); })); /* vim: set sw=4 ts=4 et tw=80 : */ },{}],9:[function(_dereq_,module,exports){ var Base62 = (function (my) { my.chars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] my.encode = function(i){ if (i === 0) {return '0'} var s = '' while (i > 0) { s = this.chars[i % 62] + s i = Math.floor(i/62) } return s }; my.decode = function(a,b,c,d){ for ( b = c = ( a === (/\W|_|^$/.test(a += "") || a) ) - 1; d = a.charCodeAt(c++); ) b = b * 62 + d - [, 48, 29, 87][d >> 5]; return b }; return my; }({})); module.exports = Base62 },{}],10:[function(_dereq_,module,exports){ /* * Copyright 2009-2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE.txt or: * http://opensource.org/licenses/BSD-3-Clause */ exports.SourceMapGenerator = _dereq_('./source-map/source-map-generator').SourceMapGenerator; exports.SourceMapConsumer = _dereq_('./source-map/source-map-consumer').SourceMapConsumer; exports.SourceNode = _dereq_('./source-map/source-node').SourceNode; },{"./source-map/source-map-consumer":15,"./source-map/source-map-generator":16,"./source-map/source-node":17}],11:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var util = _dereq_('./util'); /** * A data structure which is a combination of an array and a set. Adding a new * member is O(1), testing for membership is O(1), and finding the index of an * element is O(1). Removing elements from the set is not supported. Only * strings are supported for membership. */ function ArraySet() { this._array = []; this._set = {}; } /** * Static method for creating ArraySet instances from an existing array. */ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { var set = new ArraySet(); for (var i = 0, len = aArray.length; i < len; i++) { set.add(aArray[i], aAllowDuplicates); } return set; }; /** * Add the given string to this set. * * @param String aStr */ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { var isDuplicate = this.has(aStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { this._array.push(aStr); } if (!isDuplicate) { this._set[util.toSetString(aStr)] = idx; } }; /** * Is the given string a member of this set? * * @param String aStr */ ArraySet.prototype.has = function ArraySet_has(aStr) { return Object.prototype.hasOwnProperty.call(this._set, util.toSetString(aStr)); }; /** * What is the index of the given string in the array? * * @param String aStr */ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { if (this.has(aStr)) { return this._set[util.toSetString(aStr)]; } throw new Error('"' + aStr + '" is not in the set.'); }; /** * What is the element at the given index? * * @param Number aIdx */ ArraySet.prototype.at = function ArraySet_at(aIdx) { if (aIdx >= 0 && aIdx < this._array.length) { return this._array[aIdx]; } throw new Error('No element indexed by ' + aIdx); }; /** * Returns the array representation of this set (which has the proper indices * indicated by indexOf). Note that this is a copy of the internal array used * for storing the members so that no one can mess with internal state. */ ArraySet.prototype.toArray = function ArraySet_toArray() { return this._array.slice(); }; exports.ArraySet = ArraySet; }); },{"./util":18,"amdefine":19}],12:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause * * Based on the Base 64 VLQ implementation in Closure Compiler: * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java * * Copyright 2011 The Closure Compiler Authors. All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var base64 = _dereq_('./base64'); // A single base 64 digit can contain 6 bits of data. For the base 64 variable // length quantities we use in the source map spec, the first bit is the sign, // the next four bits are the actual value, and the 6th bit is the // continuation bit. The continuation bit tells us whether there are more // digits in this value following this digit. // // Continuation // | Sign // | | // V V // 101011 var VLQ_BASE_SHIFT = 5; // binary: 100000 var VLQ_BASE = 1 << VLQ_BASE_SHIFT; // binary: 011111 var VLQ_BASE_MASK = VLQ_BASE - 1; // binary: 100000 var VLQ_CONTINUATION_BIT = VLQ_BASE; /** * Converts from a two-complement value to a value where the sign bit is * is placed in the least significant bit. For example, as decimals: * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) */ function toVLQSigned(aValue) { return aValue < 0 ? ((-aValue) << 1) + 1 : (aValue << 1) + 0; } /** * Converts to a two-complement value from a value where the sign bit is * is placed in the least significant bit. For example, as decimals: * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ function fromVLQSigned(aValue) { var isNegative = (aValue & 1) === 1; var shifted = aValue >> 1; return isNegative ? -shifted : shifted; } /** * Returns the base 64 VLQ encoded value. */ exports.encode = function base64VLQ_encode(aValue) { var encoded = ""; var digit; var vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; vlq >>>= VLQ_BASE_SHIFT; if (vlq > 0) { // There are still more digits in this value, so we must make sure the // continuation bit is marked. digit |= VLQ_CONTINUATION_BIT; } encoded += base64.encode(digit); } while (vlq > 0); return encoded; }; /** * Decodes the next base 64 VLQ value from the given string and returns the * value and the rest of the string. */ exports.decode = function base64VLQ_decode(aStr) { var i = 0; var strLen = aStr.length; var result = 0; var shift = 0; var continuation, digit; do { if (i >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); } digit = base64.decode(aStr.charAt(i++)); continuation = !!(digit & VLQ_CONTINUATION_BIT); digit &= VLQ_BASE_MASK; result = result + (digit << shift); shift += VLQ_BASE_SHIFT; } while (continuation); return { value: fromVLQSigned(result), rest: aStr.slice(i) }; }; }); },{"./base64":13,"amdefine":19}],13:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var charToIntMap = {}; var intToCharMap = {}; 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' .split('') .forEach(function (ch, index) { charToIntMap[ch] = index; intToCharMap[index] = ch; }); /** * Encode an integer in the range of 0 to 63 to a single base 64 digit. */ exports.encode = function base64_encode(aNumber) { if (aNumber in intToCharMap) { return intToCharMap[aNumber]; } throw new TypeError("Must be between 0 and 63: " + aNumber); }; /** * Decode a single base 64 digit to an integer. */ exports.decode = function base64_decode(aChar) { if (aChar in charToIntMap) { return charToIntMap[aChar]; } throw new TypeError("Not a valid base 64 digit: " + aChar); }; }); },{"amdefine":19}],14:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { /** * Recursive implementation of binary search. * * @param aLow Indices here and lower do not contain the needle. * @param aHigh Indices here and higher do not contain the needle. * @param aNeedle The element being searched for. * @param aHaystack The non-empty array being searched. * @param aCompare Function which takes two elements and returns -1, 0, or 1. */ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) { // This function terminates when one of the following is true: // // 1. We find the exact element we are looking for. // // 2. We did not find the exact element, but we can return the next // closest element that is less than that element. // // 3. We did not find the exact element, and there is no next-closest // element which is less than the one we are searching for, so we // return null. var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. return aHaystack[mid]; } else if (cmp > 0) { // aHaystack[mid] is greater than our needle. if (aHigh - mid > 1) { // The element is in the upper half. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare); } // We did not find an exact match, return the next closest one // (termination case 2). return aHaystack[mid]; } else { // aHaystack[mid] is less than our needle. if (mid - aLow > 1) { // The element is in the lower half. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare); } // The exact needle element was not found in this haystack. Determine if // we are in termination case (2) or (3) and return the appropriate thing. return aLow < 0 ? null : aHaystack[aLow]; } } /** * This is an implementation of binary search which will always try and return * the next lowest value checked if there is no exact hit. This is because * mappings between original and generated line/col pairs are single points, * and there is an implicit region between each of them, so a miss just means * that you aren't on the very start of a region. * * @param aNeedle The element you are looking for. * @param aHaystack The array that is being searched. * @param aCompare A function which takes the needle and an element in the * array and returns -1, 0, or 1 depending on whether the needle is less * than, equal to, or greater than the element, respectively. */ exports.search = function search(aNeedle, aHaystack, aCompare) { return aHaystack.length > 0 ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) : null; }; }); },{"amdefine":19}],15:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var util = _dereq_('./util'); var binarySearch = _dereq_('./binary-search'); var ArraySet = _dereq_('./array-set').ArraySet; var base64VLQ = _dereq_('./base64-vlq'); /** * A SourceMapConsumer instance represents a parsed source map which we can * query for information about the original file positions by giving it a file * position in the generated source. * * The only parameter is the raw source map (either as a JSON string, or * already parsed to an object). According to the spec, source maps have the * following attributes: * * - version: Which version of the source map spec this map is following. * - sources: An array of URLs to the original source files. * - names: An array of identifiers which can be referrenced by individual mappings. * - sourceRoot: Optional. The URL root from which all sources are relative. * - sourcesContent: Optional. An array of contents of the original source files. * - mappings: A string of base64 VLQs which contain the actual mappings. * - file: The generated file this source map is associated with. * * Here is an example source map, taken from the source map spec[0]: * * { * version : 3, * file: "out.js", * sourceRoot : "", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AA,AB;;ABCDE;" * } * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# */ function SourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); } var version = util.getArg(sourceMap, 'version'); var sources = util.getArg(sourceMap, 'sources'); // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which // requires the array) to play nice here. var names = util.getArg(sourceMap, 'names', []); var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); var mappings = util.getArg(sourceMap, 'mappings'); var file = util.getArg(sourceMap, 'file', null); // Once again, Sass deviates from the spec and supplies the version as a // string rather than a number, so we use loose equality checking here. if (version != this._version) { throw new Error('Unsupported version: ' + version); } // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue // #72 and bugzil.la/889492. this._names = ArraySet.fromArray(names, true); this._sources = ArraySet.fromArray(sources, true); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; this._mappings = mappings; this.file = file; } /** * Create a SourceMapConsumer from a SourceMapGenerator. * * @param SourceMapGenerator aSourceMap * The source map that will be consumed. * @returns SourceMapConsumer */ SourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) { var smc = Object.create(SourceMapConsumer.prototype); smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); smc.sourceRoot = aSourceMap._sourceRoot; smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); smc.file = aSourceMap._file; smc.__generatedMappings = aSourceMap._mappings.slice() .sort(util.compareByGeneratedPositions); smc.__originalMappings = aSourceMap._mappings.slice() .sort(util.compareByOriginalPositions); return smc; }; /** * The version of the source mapping spec that we are consuming. */ SourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(SourceMapConsumer.prototype, 'sources', { get: function () { return this._sources.toArray().map(function (s) { return this.sourceRoot ? util.join(this.sourceRoot, s) : s; }, this); } }); // `__generatedMappings` and `__originalMappings` are arrays that hold the // parsed mapping coordinates from the source map's "mappings" attribute. They // are lazily instantiated, accessed via the `_generatedMappings` and // `_originalMappings` getters respectively, and we only parse the mappings // and create these arrays once queried for a source location. We jump through // these hoops because there can be many thousands of mappings, and parsing // them is expensive, so we only want to do it if we must. // // Each object in the arrays is of the form: // // { // generatedLine: The line number in the generated code, // generatedColumn: The column number in the generated code, // source: The path to the original source file that generated this // chunk of code, // originalLine: The line number in the original source that // corresponds to this chunk of generated code, // originalColumn: The column number in the original source that // corresponds to this chunk of generated code, // name: The name of the original symbol which generated this chunk of // code. // } // // All properties except for `generatedLine` and `generatedColumn` can be // `null`. // // `_generatedMappings` is ordered by the generated positions. // // `_originalMappings` is ordered by the original positions. SourceMapConsumer.prototype.__generatedMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { get: function () { if (!this.__generatedMappings) { this.__generatedMappings = []; this.__originalMappings = []; this._parseMappings(this._mappings, this.sourceRoot); } return this.__generatedMappings; } }); SourceMapConsumer.prototype.__originalMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { get: function () { if (!this.__originalMappings) { this.__generatedMappings = []; this.__originalMappings = []; this._parseMappings(this._mappings, this.sourceRoot); } return this.__originalMappings; } }); /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { var generatedLine = 1; var previousGeneratedColumn = 0; var previousOriginalLine = 0; var previousOriginalColumn = 0; var previousSource = 0; var previousName = 0; var mappingSeparator = /^[,;]/; var str = aStr; var mapping; var temp; while (str.length > 0) { if (str.charAt(0) === ';') { generatedLine++; str = str.slice(1); previousGeneratedColumn = 0; } else if (str.charAt(0) === ',') { str = str.slice(1); } else { mapping = {}; mapping.generatedLine = generatedLine; // Generated column. temp = base64VLQ.decode(str); mapping.generatedColumn = previousGeneratedColumn + temp.value; previousGeneratedColumn = mapping.generatedColumn; str = temp.rest; if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { // Original source. temp = base64VLQ.decode(str); mapping.source = this._sources.at(previousSource + temp.value); previousSource += temp.value; str = temp.rest; if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { throw new Error('Found a source, but no line and column'); } // Original line. temp = base64VLQ.decode(str); mapping.originalLine = previousOriginalLine + temp.value; previousOriginalLine = mapping.originalLine; // Lines are stored 0-based mapping.originalLine += 1; str = temp.rest; if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { throw new Error('Found a source and line, but no column'); } // Original column. temp = base64VLQ.decode(str); mapping.originalColumn = previousOriginalColumn + temp.value; previousOriginalColumn = mapping.originalColumn; str = temp.rest; if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { // Original name. temp = base64VLQ.decode(str); mapping.name = this._names.at(previousName + temp.value); previousName += temp.value; str = temp.rest; } } this.__generatedMappings.push(mapping); if (typeof mapping.originalLine === 'number') { this.__originalMappings.push(mapping); } } } this.__originalMappings.sort(util.compareByOriginalPositions); }; /** * Find the mapping that best matches the hypothetical "needle" mapping that * we are searching for in the given "haystack" of mappings. */ SourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator) { // To return the position we are searching for, we must first find the // mapping for the given position and then return the opposite position it // points to. Because the mappings are sorted, we can use binary search to // find the best mapping. if (aNeedle[aLineName] <= 0) { throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]); } if (aNeedle[aColumnName] < 0) { throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]); } return binarySearch.search(aNeedle, aMappings, aComparator); }; /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. * - column: The column number in the generated source. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. * - column: The column number in the original source, or null. * - name: The original identifier, or null. */ SourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; var mapping = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositions); if (mapping) { var source = util.getArg(mapping, 'source', null); if (source && this.sourceRoot) { source = util.join(this.sourceRoot, source); } return { source: source, line: util.getArg(mapping, 'originalLine', null), column: util.getArg(mapping, 'originalColumn', null), name: util.getArg(mapping, 'name', null) }; } return { source: null, line: null, column: null, name: null }; }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * availible. */ SourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource) { if (!this.sourcesContent) { return null; } if (this.sourceRoot) { aSource = util.relative(this.sourceRoot, aSource); } if (this._sources.has(aSource)) { return this.sourcesContent[this._sources.indexOf(aSource)]; } var url; if (this.sourceRoot && (url = util.urlParse(this.sourceRoot))) { // XXX: file:// URIs and absolute paths lead to unexpected behavior for // many users. We can help them out when they expect file:// URIs to // behave like it would if they were running a local HTTP server. See // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] } if ((!url.path || url.path == "/") && this._sources.has("/" + aSource)) { return this.sourcesContent[this._sources.indexOf("/" + aSource)]; } } throw new Error('"' + aSource + '" is not in the SourceMap.'); }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. * - column: The column number in the original source. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. * - column: The column number in the generated source, or null. */ SourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { var needle = { source: util.getArg(aArgs, 'source'), originalLine: util.getArg(aArgs, 'line'), originalColumn: util.getArg(aArgs, 'column') }; if (this.sourceRoot) { needle.source = util.relative(this.sourceRoot, needle.source); } var mapping = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions); if (mapping) { return { line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null) }; } return { line: null, column: null }; }; SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; /** * Iterate over each mapping between an original source/line/column and a * generated line/column in this source map. * * @param Function aCallback * The function that is called with each mapping. * @param Object aContext * Optional. If specified, this object will be the value of `this` every * time that `aCallback` is called. * @param aOrder * Either `SourceMapConsumer.GENERATED_ORDER` or * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to * iterate over the mappings sorted by the generated file's line/column * order or the original's source/line/column order, respectively. Defaults to * `SourceMapConsumer.GENERATED_ORDER`. */ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { var context = aContext || null; var order = aOrder || SourceMapConsumer.GENERATED_ORDER; var mappings; switch (order) { case SourceMapConsumer.GENERATED_ORDER: mappings = this._generatedMappings; break; case SourceMapConsumer.ORIGINAL_ORDER: mappings = this._originalMappings; break; default: throw new Error("Unknown order of iteration."); } var sourceRoot = this.sourceRoot; mappings.map(function (mapping) { var source = mapping.source; if (source && sourceRoot) { source = util.join(sourceRoot, source); } return { source: source, generatedLine: mapping.generatedLine, generatedColumn: mapping.generatedColumn, originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: mapping.name }; }).forEach(aCallback, context); }; exports.SourceMapConsumer = SourceMapConsumer; }); },{"./array-set":11,"./base64-vlq":12,"./binary-search":14,"./util":18,"amdefine":19}],16:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var base64VLQ = _dereq_('./base64-vlq'); var util = _dereq_('./util'); var ArraySet = _dereq_('./array-set').ArraySet; /** * An instance of the SourceMapGenerator represents a source map which is * being built incrementally. To create a new one, you must pass an object * with the following properties: * * - file: The filename of the generated source. * - sourceRoot: An optional root for all URLs in this source map. */ function SourceMapGenerator(aArgs) { this._file = util.getArg(aArgs, 'file'); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = []; this._sourcesContents = null; } SourceMapGenerator.prototype._version = 3; /** * Creates a new SourceMapGenerator based on a SourceMapConsumer * * @param aSourceMapConsumer The SourceMap. */ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { var sourceRoot = aSourceMapConsumer.sourceRoot; var generator = new SourceMapGenerator({ file: aSourceMapConsumer.file, sourceRoot: sourceRoot }); aSourceMapConsumer.eachMapping(function (mapping) { var newMapping = { generated: { line: mapping.generatedLine, column: mapping.generatedColumn } }; if (mapping.source) { newMapping.source = mapping.source; if (sourceRoot) { newMapping.source = util.relative(sourceRoot, newMapping.source); } newMapping.original = { line: mapping.originalLine, column: mapping.originalColumn }; if (mapping.name) { newMapping.name = mapping.name; } } generator.addMapping(newMapping); }); aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content) { generator.setSourceContent(sourceFile, content); } }); return generator; }; /** * Add a single mapping from original source line and column to the generated * source's line and column for this source map being created. The mapping * object should have the following properties: * * - generated: An object with the generated line and column positions. * - original: An object with the original line and column positions. * - source: The original source file (relative to the sourceRoot). * - name: An optional original token name for this mapping. */ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { var generated = util.getArg(aArgs, 'generated'); var original = util.getArg(aArgs, 'original', null); var source = util.getArg(aArgs, 'source', null); var name = util.getArg(aArgs, 'name', null); this._validateMapping(generated, original, source, name); if (source && !this._sources.has(source)) { this._sources.add(source); } if (name && !this._names.has(name)) { this._names.add(name); } this._mappings.push({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, originalColumn: original != null && original.column, source: source, name: name }); }; /** * Set the source content for a source file. */ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { var source = aSourceFile; if (this._sourceRoot) { source = util.relative(this._sourceRoot, source); } if (aSourceContent !== null) { // Add the source content to the _sourcesContents map. // Create a new _sourcesContents map if the property is null. if (!this._sourcesContents) { this._sourcesContents = {}; } this._sourcesContents[util.toSetString(source)] = aSourceContent; } else { // Remove the source file from the _sourcesContents map. // If the _sourcesContents map is empty, set the property to null. delete this._sourcesContents[util.toSetString(source)]; if (Object.keys(this._sourcesContents).length === 0) { this._sourcesContents = null; } } }; /** * Applies the mappings of a sub-source-map for a specific source file to the * source map being generated. Each mapping to the supplied source file is * rewritten using the supplied source map. Note: The resolution for the * resulting mappings is the minimium of this map and the supplied map. * * @param aSourceMapConsumer The source map to be applied. * @param aSourceFile Optional. The filename of the source file. * If omitted, SourceMapConsumer's file property will be used. */ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) { // If aSourceFile is omitted, we will use the file property of the SourceMap if (!aSourceFile) { aSourceFile = aSourceMapConsumer.file; } var sourceRoot = this._sourceRoot; // Make "aSourceFile" relative if an absolute Url is passed. if (sourceRoot) { aSourceFile = util.relative(sourceRoot, aSourceFile); } // Applying the SourceMap can add and remove items from the sources and // the names array. var newSources = new ArraySet(); var newNames = new ArraySet(); // Find mappings for the "aSourceFile" this._mappings.forEach(function (mapping) { if (mapping.source === aSourceFile && mapping.originalLine) { // Check if it can be mapped by the source map, then update the mapping. var original = aSourceMapConsumer.originalPositionFor({ line: mapping.originalLine, column: mapping.originalColumn }); if (original.source !== null) { // Copy mapping if (sourceRoot) { mapping.source = util.relative(sourceRoot, original.source); } else { mapping.source = original.source; } mapping.originalLine = original.line; mapping.originalColumn = original.column; if (original.name !== null && mapping.name !== null) { // Only use the identifier name if it's an identifier // in both SourceMaps mapping.name = original.name; } } } var source = mapping.source; if (source && !newSources.has(source)) { newSources.add(source); } var name = mapping.name; if (name && !newNames.has(name)) { newNames.add(name); } }, this); this._sources = newSources; this._names = newNames; // Copy sourcesContents of applied map. aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content) { if (sourceRoot) { sourceFile = util.relative(sourceRoot, sourceFile); } this.setSourceContent(sourceFile, content); } }, this); }; /** * A mapping can have one of the three levels of data: * * 1. Just the generated position. * 2. The Generated position, original position, and original source. * 3. Generated and original position, original source, as well as a name * token. * * To maintain consistency, we validate that any new mapping being added falls * in to one of these categories. */ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { // Case 1. return; } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { // Cases 2 and 3. return; } else { throw new Error('Invalid mapping: ' + JSON.stringify({ generated: aGenerated, source: aSource, orginal: aOriginal, name: aName })); } }; /** * Serialize the accumulated mappings in to the stream of base 64 VLQs * specified by the source map format. */ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { var previousGeneratedColumn = 0; var previousGeneratedLine = 1; var previousOriginalColumn = 0; var previousOriginalLine = 0; var previousName = 0; var previousSource = 0; var result = ''; var mapping; // The mappings must be guaranteed to be in sorted order before we start // serializing them or else the generated line numbers (which are defined // via the ';' separators) will be all messed up. Note: it might be more // performant to maintain the sorting as we insert them, rather than as we // serialize them, but the big O is the same either way. this._mappings.sort(util.compareByGeneratedPositions); for (var i = 0, len = this._mappings.length; i < len; i++) { mapping = this._mappings[i]; if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; while (mapping.generatedLine !== previousGeneratedLine) { result += ';'; previousGeneratedLine++; } } else { if (i > 0) { if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) { continue; } result += ','; } } result += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); previousGeneratedColumn = mapping.generatedColumn; if (mapping.source) { result += base64VLQ.encode(this._sources.indexOf(mapping.source) - previousSource); previousSource = this._sources.indexOf(mapping.source); // lines are stored 0-based in SourceMap spec version 3 result += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); previousOriginalLine = mapping.originalLine - 1; result += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); previousOriginalColumn = mapping.originalColumn; if (mapping.name) { result += base64VLQ.encode(this._names.indexOf(mapping.name) - previousName); previousName = this._names.indexOf(mapping.name); } } } return result; }; SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { return aSources.map(function (source) { if (!this._sourcesContents) { return null; } if (aSourceRoot) { source = util.relative(aSourceRoot, source); } var key = util.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); }; /** * Externalize the source map. */ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { var map = { version: this._version, file: this._file, sources: this._sources.toArray(), names: this._names.toArray(), mappings: this._serializeMappings() }; if (this._sourceRoot) { map.sourceRoot = this._sourceRoot; } if (this._sourcesContents) { map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); } return map; }; /** * Render the source map being generated to a string. */ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { return JSON.stringify(this); }; exports.SourceMapGenerator = SourceMapGenerator; }); },{"./array-set":11,"./base64-vlq":12,"./util":18,"amdefine":19}],17:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { var SourceMapGenerator = _dereq_('./source-map-generator').SourceMapGenerator; var util = _dereq_('./util'); /** * SourceNodes provide a way to abstract over interpolating/concatenating * snippets of generated JavaScript source code while maintaining the line and * column information associated with the original source code. * * @param aLine The original line number. * @param aColumn The original column number. * @param aSource The original source's filename. * @param aChunks Optional. An array of strings which are snippets of * generated JS, or other SourceNodes. * @param aName The original identifier. */ function SourceNode(aLine, aColumn, aSource, aChunks, aName) { this.children = []; this.sourceContents = {}; this.line = aLine === undefined ? null : aLine; this.column = aColumn === undefined ? null : aColumn; this.source = aSource === undefined ? null : aSource; this.name = aName === undefined ? null : aName; if (aChunks != null) this.add(aChunks); } /** * Creates a SourceNode from generated code and a SourceMapConsumer. * * @param aGeneratedCode The generated code * @param aSourceMapConsumer The SourceMap for the generated code */ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) { // The SourceNode we want to fill with the generated code // and the SourceMap var node = new SourceNode(); // The generated code // Processed fragments are removed from this array. var remainingLines = aGeneratedCode.split('\n'); // We need to remember the position of "remainingLines" var lastGeneratedLine = 1, lastGeneratedColumn = 0; // The generate SourceNodes we need a code range. // To extract it current and last mapping is used. // Here we store the last mapping. var lastMapping = null; aSourceMapConsumer.eachMapping(function (mapping) { if (lastMapping === null) { // We add the generated code until the first mapping // to the SourceNode without any mapping. // Each line is added as separate string. while (lastGeneratedLine < mapping.generatedLine) { node.add(remainingLines.shift() + "\n"); lastGeneratedLine++; } if (lastGeneratedColumn < mapping.generatedColumn) { var nextLine = remainingLines[0]; node.add(nextLine.substr(0, mapping.generatedColumn)); remainingLines[0] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } } else { // We add the code from "lastMapping" to "mapping": // First check if there is a new line in between. if (lastGeneratedLine < mapping.generatedLine) { var code = ""; // Associate full lines with "lastMapping" do { code += remainingLines.shift() + "\n"; lastGeneratedLine++; lastGeneratedColumn = 0; } while (lastGeneratedLine < mapping.generatedLine); // When we reached the correct line, we add code until we // reach the correct column too. if (lastGeneratedColumn < mapping.generatedColumn) { var nextLine = remainingLines[0]; code += nextLine.substr(0, mapping.generatedColumn); remainingLines[0] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } // Create the SourceNode. addMappingWithCode(lastMapping, code); } else { // There is no new line in between. // Associate the code between "lastGeneratedColumn" and // "mapping.generatedColumn" with "lastMapping" var nextLine = remainingLines[0]; var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); remainingLines[0] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); lastGeneratedColumn = mapping.generatedColumn; addMappingWithCode(lastMapping, code); } } lastMapping = mapping; }, this); // We have processed all mappings. // Associate the remaining code in the current line with "lastMapping" // and add the remaining lines without any mapping addMappingWithCode(lastMapping, remainingLines.join("\n")); // Copy sourcesContent into SourceNode aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content) { node.setSourceContent(sourceFile, content); } }); return node; function addMappingWithCode(mapping, code) { if (mapping === null || mapping.source === undefined) { node.add(code); } else { node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, mapping.source, code, mapping.name)); } } }; /** * Add a chunk of generated JS to this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.add = function SourceNode_add(aChunk) { if (Array.isArray(aChunk)) { aChunk.forEach(function (chunk) { this.add(chunk); }, this); } else if (aChunk instanceof SourceNode || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; /** * Add a chunk of generated JS to the beginning of this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { if (Array.isArray(aChunk)) { for (var i = aChunk.length-1; i >= 0; i--) { this.prepend(aChunk[i]); } } else if (aChunk instanceof SourceNode || typeof aChunk === "string") { this.children.unshift(aChunk); } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; /** * Walk over the tree of JS snippets in this node and its children. The * walking function is called once for each snippet of JS and is passed that * snippet and the its original associated source's line/column location. * * @param aFn The traversal function. */ SourceNode.prototype.walk = function SourceNode_walk(aFn) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; if (chunk instanceof SourceNode) { chunk.walk(aFn); } else { if (chunk !== '') { aFn(chunk, { source: this.source, line: this.line, column: this.column, name: this.name }); } } } }; /** * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between * each of `this.children`. * * @param aSep The separator. */ SourceNode.prototype.join = function SourceNode_join(aSep) { var newChildren; var i; var len = this.children.length; if (len > 0) { newChildren = []; for (i = 0; i < len-1; i++) { newChildren.push(this.children[i]); newChildren.push(aSep); } newChildren.push(this.children[i]); this.children = newChildren; } return this; }; /** * Call String.prototype.replace on the very right-most source snippet. Useful * for trimming whitespace from the end of a source node, etc. * * @param aPattern The pattern to replace. * @param aReplacement The thing to replace the pattern with. */ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; if (lastChild instanceof SourceNode) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === 'string') { this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); } else { this.children.push(''.replace(aPattern, aReplacement)); } return this; }; /** * Set the source content for a source file. This will be added to the SourceMapGenerator * in the sourcesContent field. * * @param aSourceFile The filename of the source file * @param aSourceContent The content of the source file */ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; }; /** * Walk over the tree of SourceNodes. The walking function is called for each * source file content and is passed the filename and source content. * * @param aFn The traversal function. */ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { if (this.children[i] instanceof SourceNode) { this.children[i].walkSourceContents(aFn); } } var sources = Object.keys(this.sourceContents); for (var i = 0, len = sources.length; i < len; i++) { aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); } }; /** * Return the string representation of this source node. Walks over the tree * and concatenates all the various snippets together to one string. */ SourceNode.prototype.toString = function SourceNode_toString() { var str = ""; this.walk(function (chunk) { str += chunk; }); return str; }; /** * Returns the string representation of this source node along with a source * map. */ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { var generated = { code: "", line: 1, column: 0 }; var map = new SourceMapGenerator(aArgs); var sourceMappingActive = false; var lastOriginalSource = null; var lastOriginalLine = null; var lastOriginalColumn = null; var lastOriginalName = null; this.walk(function (chunk, original) { generated.code += chunk; if (original.source !== null && original.line !== null && original.column !== null) { if(lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } lastOriginalSource = original.source; lastOriginalLine = original.line; lastOriginalColumn = original.column; lastOriginalName = original.name; sourceMappingActive = true; } else if (sourceMappingActive) { map.addMapping({ generated: { line: generated.line, column: generated.column } }); lastOriginalSource = null; sourceMappingActive = false; } chunk.split('').forEach(function (ch) { if (ch === '\n') { generated.line++; generated.column = 0; } else { generated.column++; } }); }); this.walkSourceContents(function (sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); }); return { code: generated.code, map: map }; }; exports.SourceNode = SourceNode; }); },{"./source-map-generator":16,"./util":18,"amdefine":19}],18:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = _dereq_('amdefine')(module, _dereq_); } define(function (_dereq_, exports, module) { /** * This is a helper function for getting values from parameter/options * objects. * * @param args The object we are extracting values from * @param name The name of the property we are getting. * @param defaultValue An optional value to return if the property is missing * from the object. If this is not specified and the property is missing, an * error will be thrown. */ function getArg(aArgs, aName, aDefaultValue) { if (aName in aArgs) { return aArgs[aName]; } else if (arguments.length === 3) { return aDefaultValue; } else { throw new Error('"' + aName + '" is a required argument.'); } } exports.getArg = getArg; var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/; var dataUrlRegexp = /^data:.+\,.+/; function urlParse(aUrl) { var match = aUrl.match(urlRegexp); if (!match) { return null; } return { scheme: match[1], auth: match[3], host: match[4], port: match[6], path: match[7] }; } exports.urlParse = urlParse; function urlGenerate(aParsedUrl) { var url = aParsedUrl.scheme + "://"; if (aParsedUrl.auth) { url += aParsedUrl.auth + "@" } if (aParsedUrl.host) { url += aParsedUrl.host; } if (aParsedUrl.port) { url += ":" + aParsedUrl.port } if (aParsedUrl.path) { url += aParsedUrl.path; } return url; } exports.urlGenerate = urlGenerate; function join(aRoot, aPath) { var url; if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) { return aPath; } if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) { url.path = aPath; return urlGenerate(url); } return aRoot.replace(/\/$/, '') + '/' + aPath; } exports.join = join; /** * Because behavior goes wacky when you set `__proto__` on objects, we * have to prefix all the strings in our set with an arbitrary character. * * See https://github.com/mozilla/source-map/pull/31 and * https://github.com/mozilla/source-map/issues/30 * * @param String aStr */ function toSetString(aStr) { return '$' + aStr; } exports.toSetString = toSetString; function fromSetString(aStr) { return aStr.substr(1); } exports.fromSetString = fromSetString; function relative(aRoot, aPath) { aRoot = aRoot.replace(/\/$/, ''); var url = urlParse(aRoot); if (aPath.charAt(0) == "/" && url && url.path == "/") { return aPath.slice(1); } return aPath.indexOf(aRoot + '/') === 0 ? aPath.substr(aRoot.length + 1) : aPath; } exports.relative = relative; function strcmp(aStr1, aStr2) { var s1 = aStr1 || ""; var s2 = aStr2 || ""; return (s1 > s2) - (s1 < s2); } /** * Comparator between two mappings where the original positions are compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same original source/line/column, but different generated * line and column the same. Useful when searching for a mapping with a * stubbed out mapping. */ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { var cmp; cmp = strcmp(mappingA.source, mappingB.source); if (cmp) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp || onlyCompareOriginal) { return cmp; } cmp = strcmp(mappingA.name, mappingB.name); if (cmp) { return cmp; } cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp) { return cmp; } return mappingA.generatedColumn - mappingB.generatedColumn; }; exports.compareByOriginalPositions = compareByOriginalPositions; /** * Comparator between two mappings where the generated positions are * compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same generated line and column, but different * source/name/original line and column the same. Useful when searching for a * mapping with a stubbed out mapping. */ function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) { var cmp; cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp || onlyCompareGenerated) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp) { return cmp; } return strcmp(mappingA.name, mappingB.name); }; exports.compareByGeneratedPositions = compareByGeneratedPositions; }); },{"amdefine":19}],19:[function(_dereq_,module,exports){ (function (process,__filename){ /** vim: et:ts=4:sw=4:sts=4 * @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/amdefine for details */ /*jslint node: true */ /*global module, process */ 'use strict'; /** * Creates a define for node. * @param {Object} module the "module" object that is defined by Node for the * current module. * @param {Function} [requireFn]. Node's require function for the current module. * It only needs to be passed in Node versions before 0.5, when module.require * did not exist. * @returns {Function} a define function that is usable for the current node * module. */ function amdefine(module, requireFn) { 'use strict'; var defineCache = {}, loaderCache = {}, alreadyCalled = false, path = _dereq_('path'), makeRequire, stringRequire; /** * Trims the . and .. from an array of path segments. * It will keep a leading path segment if a .. will become * the first path segment, to help with module name lookups, * which act like paths, but can be remapped. But the end result, * all paths that use this function should look normalized. * NOTE: this method MODIFIES the input array. * @param {Array} ary the array of path segments. */ function trimDots(ary) { var i, part; for (i = 0; ary[i]; i+= 1) { part = ary[i]; if (part === '.') { ary.splice(i, 1); i -= 1; } else if (part === '..') { if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { //End of the line. Keep at least one non-dot //path segment at the front so it can be mapped //correctly to disk. Otherwise, there is likely //no path mapping for a path starting with '..'. //This can still fail, but catches the most reasonable //uses of .. break; } else if (i > 0) { ary.splice(i - 1, 2); i -= 2; } } } } function normalize(name, baseName) { var baseParts; //Adjust any relative paths. if (name && name.charAt(0) === '.') { //If have a base name, try to normalize against it, //otherwise, assume it is a top-level require that will //be relative to baseUrl in the end. if (baseName) { baseParts = baseName.split('/'); baseParts = baseParts.slice(0, baseParts.length - 1); baseParts = baseParts.concat(name.split('/')); trimDots(baseParts); name = baseParts.join('/'); } } return name; } /** * Create the normalize() function passed to a loader plugin's * normalize method. */ function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; } function makeLoad(id) { function load(value) { loaderCache[id] = value; } load.fromText = function (id, text) { //This one is difficult because the text can/probably uses //define, and any relative paths and requires should be relative //to that id was it would be found on disk. But this would require //bootstrapping a module/require fairly deeply from node core. //Not sure how best to go about that yet. throw new Error('amdefine does not implement load.fromText'); }; return load; } makeRequire = function (systemRequire, exports, module, relId) { function amdRequire(deps, callback) { if (typeof deps === 'string') { //Synchronous, single module require('') return stringRequire(systemRequire, exports, module, deps, relId); } else { //Array of dependencies with a callback. //Convert the dependencies to modules. deps = deps.map(function (depName) { return stringRequire(systemRequire, exports, module, depName, relId); }); //Wait for next tick to call back the require call. process.nextTick(function () { callback.apply(null, deps); }); } } amdRequire.toUrl = function (filePath) { if (filePath.indexOf('.') === 0) { return normalize(filePath, path.dirname(module.filename)); } else { return filePath; } }; return amdRequire; }; //Favor explicit value, passed in if the module wants to support Node 0.4. requireFn = requireFn || function req() { return module.require.apply(module, arguments); }; function runFactory(id, deps, factory) { var r, e, m, result; if (id) { e = loaderCache[id] = {}; m = { id: id, uri: __filename, exports: e }; r = makeRequire(requireFn, e, m, id); } else { //Only support one define call per file if (alreadyCalled) { throw new Error('amdefine with no module ID cannot be called more than once per file.'); } alreadyCalled = true; //Use the real variables from node //Use module.exports for exports, since //the exports in here is amdefine exports. e = module.exports; m = module; r = makeRequire(requireFn, e, m, module.id); } //If there are dependencies, they are strings, so need //to convert them to dependency values. if (deps) { deps = deps.map(function (depName) { return r(depName); }); } //Call the factory with the right dependencies. if (typeof factory === 'function') { result = factory.apply(m.exports, deps); } else { result = factory; } if (result !== undefined) { m.exports = result; if (id) { loaderCache[id] = m.exports; } } } stringRequire = function (systemRequire, exports, module, id, relId) { //Split the ID by a ! so that var index = id.indexOf('!'), originalId = id, prefix, plugin; if (index === -1) { id = normalize(id, relId); //Straight module lookup. If it is one of the special dependencies, //deal with it, otherwise, delegate to node. if (id === 'require') { return makeRequire(systemRequire, exports, module, relId); } else if (id === 'exports') { return exports; } else if (id === 'module') { return module; } else if (loaderCache.hasOwnProperty(id)) { return loaderCache[id]; } else if (defineCache[id]) { runFactory.apply(null, defineCache[id]); return loaderCache[id]; } else { if(systemRequire) { return systemRequire(originalId); } else { throw new Error('No module with ID: ' + id); } } } else { //There is a plugin in play. prefix = id.substring(0, index); id = id.substring(index + 1, id.length); plugin = stringRequire(systemRequire, exports, module, prefix, relId); if (plugin.normalize) { id = plugin.normalize(id, makeNormalize(relId)); } else { //Normalize the ID normally. id = normalize(id, relId); } if (loaderCache[id]) { return loaderCache[id]; } else { plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {}); return loaderCache[id]; } } }; //Create a define function specific to the module asking for amdefine. function define(id, deps, factory) { if (Array.isArray(id)) { factory = deps; deps = id; id = undefined; } else if (typeof id !== 'string') { factory = id; id = deps = undefined; } if (deps && !Array.isArray(deps)) { factory = deps; deps = undefined; } if (!deps) { deps = ['require', 'exports', 'module']; } //Set up properties for this module. If an ID, then use //internal cache. If no ID, then use the external variables //for this node module. if (id) { //Put the module in deep freeze until there is a //require call for it. defineCache[id] = [id, deps, factory]; } else { runFactory(id, deps, factory); } } //define.require, which has access to all the values in the //cache. Useful for AMD modules that all have IDs in the file, //but need to finally export a value to node based on one of those //IDs. define.require = function (id) { if (loaderCache[id]) { return loaderCache[id]; } if (defineCache[id]) { runFactory.apply(null, defineCache[id]); return loaderCache[id]; } }; define.amd = {}; return define; } module.exports = amdefine; }).call(this,_dereq_('_process'),"/node_modules/jstransform/node_modules/source-map/node_modules/amdefine/amdefine.js") },{"_process":7,"path":6}],20:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var docblockRe = /^\s*(\/\*\*(.|\r?\n)*?\*\/)/; var ltrimRe = /^\s*/; /** * @param {String} contents * @return {String} */ function extract(contents) { var match = contents.match(docblockRe); if (match) { return match[0].replace(ltrimRe, '') || ''; } return ''; } var commentStartRe = /^\/\*\*?/; var commentEndRe = /\*+\/$/; var wsRe = /[\t ]+/g; var stringStartRe = /(\r?\n|^) *\*/g; var multilineRe = /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *([^@\r\n\s][^@\r\n]+?) *\r?\n/g; var propertyRe = /(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g; /** * @param {String} contents * @return {Array} */ function parse(docblock) { docblock = docblock .replace(commentStartRe, '') .replace(commentEndRe, '') .replace(wsRe, ' ') .replace(stringStartRe, '$1'); // Normalize multi-line directives var prev = ''; while (prev != docblock) { prev = docblock; docblock = docblock.replace(multilineRe, "\n$1 $2\n"); } docblock = docblock.trim(); var result = []; var match; while (match = propertyRe.exec(docblock)) { result.push([match[1], match[2]]); } return result; } /** * Same as parse but returns an object of prop: value instead of array of paris * If a property appers more than once the last one will be returned * * @param {String} contents * @return {Object} */ function parseAsObject(docblock) { var pairs = parse(docblock); var result = {}; for (var i = 0; i < pairs.length; i++) { result[pairs[i][0]] = pairs[i][1]; } return result; } exports.extract = extract; exports.parse = parse; exports.parseAsObject = parseAsObject; },{}],21:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint node: true*/ "use strict"; var esprima = _dereq_('esprima-fb'); var utils = _dereq_('./utils'); var getBoundaryNode = utils.getBoundaryNode; var declareIdentInScope = utils.declareIdentInLocalScope; var initScopeMetadata = utils.initScopeMetadata; var Syntax = esprima.Syntax; /** * @param {object} node * @param {object} parentNode * @return {boolean} */ function _nodeIsClosureScopeBoundary(node, parentNode) { if (node.type === Syntax.Program) { return true; } var parentIsFunction = parentNode.type === Syntax.FunctionDeclaration || parentNode.type === Syntax.FunctionExpression || parentNode.type === Syntax.ArrowFunctionExpression; return node.type === Syntax.BlockStatement && parentIsFunction; } function _nodeIsBlockScopeBoundary(node, parentNode) { if (node.type === Syntax.Program) { return false; } return node.type === Syntax.BlockStatement && parentNode.type === Syntax.CatchClause; } /** * @param {object} node * @param {function} visitor * @param {array} path * @param {object} state */ function traverse(node, path, state) { // Create a scope stack entry if this is the first node we've encountered in // its local scope var parentNode = path[0]; if (!Array.isArray(node) && state.localScope.parentNode !== parentNode) { if (_nodeIsClosureScopeBoundary(node, parentNode)) { var scopeIsStrict = state.scopeIsStrict || node.body.length > 0 && node.body[0].type === Syntax.ExpressionStatement && node.body[0].expression.type === Syntax.Literal && node.body[0].expression.value === 'use strict'; if (node.type === Syntax.Program) { state = utils.updateState(state, { scopeIsStrict: scopeIsStrict }); } else { state = utils.updateState(state, { localScope: { parentNode: parentNode, parentScope: state.localScope, identifiers: {}, tempVarIndex: 0 }, scopeIsStrict: scopeIsStrict }); // All functions have an implicit 'arguments' object in scope declareIdentInScope('arguments', initScopeMetadata(node), state); // Include function arg identifiers in the scope boundaries of the // function if (parentNode.params.length > 0) { var param; for (var i = 0; i < parentNode.params.length; i++) { param = parentNode.params[i]; if (param.type === Syntax.Identifier) { declareIdentInScope( param.name, initScopeMetadata(parentNode), state ); } } } // Named FunctionExpressions scope their name within the body block of // themselves only if (parentNode.type === Syntax.FunctionExpression && parentNode.id) { var metaData = initScopeMetadata(parentNode, path.parentNodeslice, parentNode); declareIdentInScope(parentNode.id.name, metaData, state); } } // Traverse and find all local identifiers in this closure first to // account for function/variable declaration hoisting collectClosureIdentsAndTraverse(node, path, state); } if (_nodeIsBlockScopeBoundary(node, parentNode)) { state = utils.updateState(state, { localScope: { parentNode: parentNode, parentScope: state.localScope, identifiers: {} } }); if (parentNode.type === Syntax.CatchClause) { declareIdentInScope( parentNode.param.name, initScopeMetadata(parentNode), state ); } collectBlockIdentsAndTraverse(node, path, state); } } // Only catchup() before and after traversing a child node function traverser(node, path, state) { node.range && utils.catchup(node.range[0], state); traverse(node, path, state); node.range && utils.catchup(node.range[1], state); } utils.analyzeAndTraverse(walker, traverser, node, path, state); } function collectClosureIdentsAndTraverse(node, path, state) { utils.analyzeAndTraverse( visitLocalClosureIdentifiers, collectClosureIdentsAndTraverse, node, path, state ); } function collectBlockIdentsAndTraverse(node, path, state) { utils.analyzeAndTraverse( visitLocalBlockIdentifiers, collectBlockIdentsAndTraverse, node, path, state ); } function visitLocalClosureIdentifiers(node, path, state) { var metaData; switch (node.type) { case Syntax.FunctionExpression: // Function expressions don't get their names (if there is one) added to // the closure scope they're defined in return false; case Syntax.ClassDeclaration: case Syntax.ClassExpression: case Syntax.FunctionDeclaration: if (node.id) { metaData = initScopeMetadata(getBoundaryNode(path), path.slice(), node); declareIdentInScope(node.id.name, metaData, state); } return false; case Syntax.VariableDeclarator: // Variables have function-local scope if (path[0].kind === 'var') { metaData = initScopeMetadata(getBoundaryNode(path), path.slice(), node); declareIdentInScope(node.id.name, metaData, state); } break; } } function visitLocalBlockIdentifiers(node, path, state) { // TODO: Support 'let' here...maybe...one day...or something... if (node.type === Syntax.CatchClause) { return false; } } function walker(node, path, state) { var visitors = state.g.visitors; for (var i = 0; i < visitors.length; i++) { if (visitors[i].test(node, path, state)) { return visitors[i](traverse, node, path, state); } } } var _astCache = {}; /** * Applies all available transformations to the source * @param {array} visitors * @param {string} source * @param {?object} options * @return {object} */ function transform(visitors, source, options) { options = options || {}; var ast; try { var cachedAst = _astCache[source]; ast = cachedAst || (_astCache[source] = esprima.parse(source, { comment: true, loc: true, range: true })); } catch (e) { e.message = 'Parse Error: ' + e.message; throw e; } var state = utils.createState(source, ast, options); state.g.visitors = visitors; if (options.sourceMap) { var SourceMapGenerator = _dereq_('source-map').SourceMapGenerator; state.g.sourceMap = new SourceMapGenerator({file: options.filename || 'transformed.js'}); } traverse(ast, [], state); utils.catchup(source.length, state); var ret = {code: state.g.buffer, extra: state.g.extra}; if (options.sourceMap) { ret.sourceMap = state.g.sourceMap; ret.sourceMapFilename = options.filename || 'source.js'; } return ret; } exports.transform = transform; exports.Syntax = Syntax; },{"./utils":22,"esprima-fb":8,"source-map":10}],22:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint node: true*/ var Syntax = _dereq_('esprima-fb').Syntax; var leadingIndentRegexp = /(^|\n)( {2}|\t)/g; var nonWhiteRegexp = /(\S)/g; /** * A `state` object represents the state of the parser. It has "local" and * "global" parts. Global contains parser position, source, etc. Local contains * scope based properties like current class name. State should contain all the * info required for transformation. It's the only mandatory object that is * being passed to every function in transform chain. * * @param {string} source * @param {object} transformOptions * @return {object} */ function createState(source, rootNode, transformOptions) { return { /** * A tree representing the current local scope (and its lexical scope chain) * Useful for tracking identifiers from parent scopes, etc. * @type {Object} */ localScope: { parentNode: rootNode, parentScope: null, identifiers: {}, tempVarIndex: 0 }, /** * The name (and, if applicable, expression) of the super class * @type {Object} */ superClass: null, /** * The namespace to use when munging identifiers * @type {String} */ mungeNamespace: '', /** * Ref to the node for the current MethodDefinition * @type {Object} */ methodNode: null, /** * Ref to the node for the FunctionExpression of the enclosing * MethodDefinition * @type {Object} */ methodFuncNode: null, /** * Name of the enclosing class * @type {String} */ className: null, /** * Whether we're currently within a `strict` scope * @type {Bool} */ scopeIsStrict: null, /** * Indentation offset * @type {Number} */ indentBy: 0, /** * Global state (not affected by updateState) * @type {Object} */ g: { /** * A set of general options that transformations can consider while doing * a transformation: * * - minify * Specifies that transformation steps should do their best to minify * the output source when possible. This is useful for places where * minification optimizations are possible with higher-level context * info than what jsxmin can provide. * * For example, the ES6 class transform will minify munged private * variables if this flag is set. */ opts: transformOptions, /** * Current position in the source code * @type {Number} */ position: 0, /** * Auxiliary data to be returned by transforms * @type {Object} */ extra: {}, /** * Buffer containing the result * @type {String} */ buffer: '', /** * Source that is being transformed * @type {String} */ source: source, /** * Cached parsed docblock (see getDocblock) * @type {object} */ docblock: null, /** * Whether the thing was used * @type {Boolean} */ tagNamespaceUsed: false, /** * If using bolt xjs transformation * @type {Boolean} */ isBolt: undefined, /** * Whether to record source map (expensive) or not * @type {SourceMapGenerator|null} */ sourceMap: null, /** * Filename of the file being processed. Will be returned as a source * attribute in the source map */ sourceMapFilename: 'source.js', /** * Only when source map is used: last line in the source for which * source map was generated * @type {Number} */ sourceLine: 1, /** * Only when source map is used: last line in the buffer for which * source map was generated * @type {Number} */ bufferLine: 1, /** * The top-level Program AST for the original file. */ originalProgramAST: null, sourceColumn: 0, bufferColumn: 0 } }; } /** * Updates a copy of a given state with "update" and returns an updated state. * * @param {object} state * @param {object} update * @return {object} */ function updateState(state, update) { var ret = Object.create(state); Object.keys(update).forEach(function(updatedKey) { ret[updatedKey] = update[updatedKey]; }); return ret; } /** * Given a state fill the resulting buffer from the original source up to * the end * * @param {number} end * @param {object} state * @param {?function} contentTransformer Optional callback to transform newly * added content. */ function catchup(end, state, contentTransformer) { if (end < state.g.position) { // cannot move backwards return; } var source = state.g.source.substring(state.g.position, end); var transformed = updateIndent(source, state); if (state.g.sourceMap && transformed) { // record where we are state.g.sourceMap.addMapping({ generated: { line: state.g.bufferLine, column: state.g.bufferColumn }, original: { line: state.g.sourceLine, column: state.g.sourceColumn }, source: state.g.sourceMapFilename }); // record line breaks in transformed source var sourceLines = source.split('\n'); var transformedLines = transformed.split('\n'); // Add line break mappings between last known mapping and the end of the // added piece. So for the code piece // (foo, bar); // > var x = 2; // > var b = 3; // var c = // only add lines marked with ">": 2, 3. for (var i = 1; i < sourceLines.length - 1; i++) { state.g.sourceMap.addMapping({ generated: { line: state.g.bufferLine, column: 0 }, original: { line: state.g.sourceLine, column: 0 }, source: state.g.sourceMapFilename }); state.g.sourceLine++; state.g.bufferLine++; } // offset for the last piece if (sourceLines.length > 1) { state.g.sourceLine++; state.g.bufferLine++; state.g.sourceColumn = 0; state.g.bufferColumn = 0; } state.g.sourceColumn += sourceLines[sourceLines.length - 1].length; state.g.bufferColumn += transformedLines[transformedLines.length - 1].length; } state.g.buffer += contentTransformer ? contentTransformer(transformed) : transformed; state.g.position = end; } /** * Returns original source for an AST node. * @param {object} node * @param {object} state * @return {string} */ function getNodeSourceText(node, state) { return state.g.source.substring(node.range[0], node.range[1]); } function replaceNonWhite(value) { return value.replace(nonWhiteRegexp, ' '); } /** * Removes all non-whitespace characters */ function stripNonWhite(value) { return value.replace(nonWhiteRegexp, ''); } /** * Catches up as `catchup` but replaces non-whitespace chars with spaces. */ function catchupWhiteOut(end, state) { catchup(end, state, replaceNonWhite); } /** * Catches up as `catchup` but removes all non-whitespace characters. */ function catchupWhiteSpace(end, state) { catchup(end, state, stripNonWhite); } /** * Removes all non-newline characters */ var reNonNewline = /[^\n]/g; function stripNonNewline(value) { return value.replace(reNonNewline, function() { return ''; }); } /** * Catches up as `catchup` but removes all non-newline characters. * * Equivalent to appending as many newlines as there are in the original source * between the current position and `end`. */ function catchupNewlines(end, state) { catchup(end, state, stripNonNewline); } /** * Same as catchup but does not touch the buffer * * @param {number} end * @param {object} state */ function move(end, state) { // move the internal cursors if (state.g.sourceMap) { if (end < state.g.position) { state.g.position = 0; state.g.sourceLine = 1; state.g.sourceColumn = 0; } var source = state.g.source.substring(state.g.position, end); var sourceLines = source.split('\n'); if (sourceLines.length > 1) { state.g.sourceLine += sourceLines.length - 1; state.g.sourceColumn = 0; } state.g.sourceColumn += sourceLines[sourceLines.length - 1].length; } state.g.position = end; } /** * Appends a string of text to the buffer * * @param {string} str * @param {object} state */ function append(str, state) { if (state.g.sourceMap && str) { state.g.sourceMap.addMapping({ generated: { line: state.g.bufferLine, column: state.g.bufferColumn }, original: { line: state.g.sourceLine, column: state.g.sourceColumn }, source: state.g.sourceMapFilename }); var transformedLines = str.split('\n'); if (transformedLines.length > 1) { state.g.bufferLine += transformedLines.length - 1; state.g.bufferColumn = 0; } state.g.bufferColumn += transformedLines[transformedLines.length - 1].length; } state.g.buffer += str; } /** * Update indent using state.indentBy property. Indent is measured in * double spaces. Updates a single line only. * * @param {string} str * @param {object} state * @return {string} */ function updateIndent(str, state) { var indentBy = state.indentBy; if (indentBy < 0) { for (var i = 0; i < -indentBy; i++) { str = str.replace(leadingIndentRegexp, '$1'); } } else { for (var i = 0; i < indentBy; i++) { str = str.replace(leadingIndentRegexp, '$1$2$2'); } } return str; } /** * Calculates indent from the beginning of the line until "start" or the first * character before start. * @example * " foo.bar()" * ^ * start * indent will be " " * * @param {number} start * @param {object} state * @return {string} */ function indentBefore(start, state) { var end = start; start = start - 1; while (start > 0 && state.g.source[start] != '\n') { if (!state.g.source[start].match(/[ \t]/)) { end = start; } start--; } return state.g.source.substring(start + 1, end); } function getDocblock(state) { if (!state.g.docblock) { var docblock = _dereq_('./docblock'); state.g.docblock = docblock.parseAsObject(docblock.extract(state.g.source)); } return state.g.docblock; } function identWithinLexicalScope(identName, state, stopBeforeNode) { var currScope = state.localScope; while (currScope) { if (currScope.identifiers[identName] !== undefined) { return true; } if (stopBeforeNode && currScope.parentNode === stopBeforeNode) { break; } currScope = currScope.parentScope; } return false; } function identInLocalScope(identName, state) { return state.localScope.identifiers[identName] !== undefined; } /** * @param {object} boundaryNode * @param {?array} path * @return {?object} node */ function initScopeMetadata(boundaryNode, path, node) { return { boundaryNode: boundaryNode, bindingPath: path, bindingNode: node }; } function declareIdentInLocalScope(identName, metaData, state) { state.localScope.identifiers[identName] = { boundaryNode: metaData.boundaryNode, path: metaData.path, node: metaData.node, state: Object.create(state) }; } function getLexicalBindingMetadata(identName, state) { return state.localScope.identifiers[identName]; } /** * Apply the given analyzer function to the current node. If the analyzer * doesn't return false, traverse each child of the current node using the given * traverser function. * * @param {function} analyzer * @param {function} traverser * @param {object} node * @param {function} visitor * @param {array} path * @param {object} state */ function analyzeAndTraverse(analyzer, traverser, node, path, state) { if (node.type) { if (analyzer(node, path, state) === false) { return; } path.unshift(node); } getOrderedChildren(node).forEach(function(child) { traverser(child, path, state); }); node.type && path.shift(); } /** * It is crucial that we traverse in order, or else catchup() on a later * node that is processed out of order can move the buffer past a node * that we haven't handled yet, preventing us from modifying that node. * * This can happen when a node has multiple properties containing children. * For example, XJSElement nodes have `openingElement`, `closingElement` and * `children`. If we traverse `openingElement`, then `closingElement`, then * when we get to `children`, the buffer has already caught up to the end of * the closing element, after the children. * * This is basically a Schwartzian transform. Collects an array of children, * each one represented as [child, startIndex]; sorts the array by start * index; then traverses the children in that order. */ function getOrderedChildren(node) { var queue = []; for (var key in node) { if (node.hasOwnProperty(key)) { enqueueNodeWithStartIndex(queue, node[key]); } } queue.sort(function(a, b) { return a[1] - b[1]; }); return queue.map(function(pair) { return pair[0]; }); } /** * Helper function for analyzeAndTraverse which queues up all of the children * of the given node. * * Children can also be found in arrays, so we basically want to merge all of * those arrays together so we can sort them and then traverse the children * in order. * * One example is the Program node. It contains `body` and `comments`, both * arrays. Lexographically, comments are interspersed throughout the body * nodes, but esprima's AST groups them together. */ function enqueueNodeWithStartIndex(queue, node) { if (typeof node !== 'object' || node === null) { return; } if (node.range) { queue.push([node, node.range[0]]); } else if (Array.isArray(node)) { for (var ii = 0; ii < node.length; ii++) { enqueueNodeWithStartIndex(queue, node[ii]); } } } /** * Checks whether a node or any of its sub-nodes contains * a syntactic construct of the passed type. * @param {object} node - AST node to test. * @param {string} type - node type to lookup. */ function containsChildOfType(node, type) { var foundMatchingChild = false; function nodeTypeAnalyzer(node) { if (node.type === type) { foundMatchingChild = true; return false; } } function nodeTypeTraverser(child, path, state) { if (!foundMatchingChild) { foundMatchingChild = containsChildOfType(child, type); } } analyzeAndTraverse( nodeTypeAnalyzer, nodeTypeTraverser, node, [] ); return foundMatchingChild; } var scopeTypes = {}; scopeTypes[Syntax.FunctionExpression] = true; scopeTypes[Syntax.FunctionDeclaration] = true; scopeTypes[Syntax.Program] = true; function getBoundaryNode(path) { for (var ii = 0; ii < path.length; ++ii) { if (scopeTypes[path[ii].type]) { return path[ii]; } } throw new Error( 'Expected to find a node with one of the following types in path:\n' + JSON.stringify(Object.keys(scopeTypes)) ); } exports.append = append; exports.catchup = catchup; exports.catchupWhiteOut = catchupWhiteOut; exports.catchupWhiteSpace = catchupWhiteSpace; exports.catchupNewlines = catchupNewlines; exports.containsChildOfType = containsChildOfType; exports.createState = createState; exports.declareIdentInLocalScope = declareIdentInLocalScope; exports.getBoundaryNode = getBoundaryNode; exports.getDocblock = getDocblock; exports.getLexicalBindingMetadata = getLexicalBindingMetadata; exports.initScopeMetadata = initScopeMetadata; exports.identWithinLexicalScope = identWithinLexicalScope; exports.identInLocalScope = identInLocalScope; exports.indentBefore = indentBefore; exports.move = move; exports.scopeTypes = scopeTypes; exports.updateIndent = updateIndent; exports.updateState = updateState; exports.analyzeAndTraverse = analyzeAndTraverse; exports.getOrderedChildren = getOrderedChildren; exports.getNodeSourceText = getNodeSourceText; },{"./docblock":20,"esprima-fb":8}],23:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*global exports:true*/ /** * Desugars ES6 Arrow functions to ES3 function expressions. * If the function contains `this` expression -- automatically * binds the function to current value of `this`. * * Single parameter, simple expression: * * [1, 2, 3].map(x => x * x); * * [1, 2, 3].map(function(x) { return x * x; }); * * Several parameters, complex block: * * this.users.forEach((user, idx) => { * return this.isActive(idx) && this.send(user); * }); * * this.users.forEach(function(user, idx) { * return this.isActive(idx) && this.send(user); * }.bind(this)); * */ var restParamVisitors = _dereq_('./es6-rest-param-visitors'); var destructuringVisitors = _dereq_('./es6-destructuring-visitors'); var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); /** * @public */ function visitArrowFunction(traverse, node, path, state) { var notInExpression = (path[0].type === Syntax.ExpressionStatement); // Wrap a function into a grouping operator, if it's not // in the expression position. if (notInExpression) { utils.append('(', state); } utils.append('function', state); renderParams(traverse, node, path, state); // Skip arrow. utils.catchupWhiteSpace(node.body.range[0], state); var renderBody = node.body.type == Syntax.BlockStatement ? renderStatementBody : renderExpressionBody; path.unshift(node); renderBody(traverse, node, path, state); path.shift(); // Bind the function only if `this` value is used // inside it or inside any sub-expression. if (utils.containsChildOfType(node.body, Syntax.ThisExpression)) { utils.append('.bind(this)', state); } utils.catchupWhiteSpace(node.range[1], state); // Close wrapper if not in the expression. if (notInExpression) { utils.append(')', state); } return false; } function renderParams(traverse, node, path, state) { // To preserve inline typechecking directives, we // distinguish between parens-free and paranthesized single param. if (isParensFreeSingleParam(node, state) || !node.params.length) { utils.append('(', state); } if (node.params.length !== 0) { path.unshift(node); traverse(node.params, path, state); path.unshift(); } utils.append(')', state); } function isParensFreeSingleParam(node, state) { return node.params.length === 1 && state.g.source[state.g.position] !== '('; } function renderExpressionBody(traverse, node, path, state) { // Wrap simple expression bodies into a block // with explicit return statement. utils.append('{', state); // Special handling of rest param. if (node.rest) { utils.append( restParamVisitors.renderRestParamSetup(node), state ); } // Special handling of destructured params. destructuringVisitors.renderDestructuredComponents( node, utils.updateState(state, { localScope: { parentNode: state.parentNode, parentScope: state.parentScope, identifiers: state.identifiers, tempVarIndex: 0 } }) ); utils.append('return ', state); renderStatementBody(traverse, node, path, state); utils.append(';}', state); } function renderStatementBody(traverse, node, path, state) { traverse(node.body, path, state); utils.catchup(node.body.range[1], state); } visitArrowFunction.test = function(node, path, state) { return node.type === Syntax.ArrowFunctionExpression; }; exports.visitorList = [ visitArrowFunction ]; },{"../src/utils":22,"./es6-destructuring-visitors":25,"./es6-rest-param-visitors":28,"esprima-fb":8}],24:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint node:true*/ /** * @typechecks */ 'use strict'; var base62 = _dereq_('base62'); var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); var reservedWordsHelper = _dereq_('./reserved-words-helper'); var declareIdentInLocalScope = utils.declareIdentInLocalScope; var initScopeMetadata = utils.initScopeMetadata; var SUPER_PROTO_IDENT_PREFIX = '____SuperProtoOf'; var _anonClassUUIDCounter = 0; var _mungedSymbolMaps = {}; function resetSymbols() { _anonClassUUIDCounter = 0; _mungedSymbolMaps = {}; } /** * Used to generate a unique class for use with code-gens for anonymous class * expressions. * * @param {object} state * @return {string} */ function _generateAnonymousClassName(state) { var mungeNamespace = state.mungeNamespace || ''; return '____Class' + mungeNamespace + base62.encode(_anonClassUUIDCounter++); } /** * Given an identifier name, munge it using the current state's mungeNamespace. * * @param {string} identName * @param {object} state * @return {string} */ function _getMungedName(identName, state) { var mungeNamespace = state.mungeNamespace; var shouldMinify = state.g.opts.minify; if (shouldMinify) { if (!_mungedSymbolMaps[mungeNamespace]) { _mungedSymbolMaps[mungeNamespace] = { symbolMap: {}, identUUIDCounter: 0 }; } var symbolMap = _mungedSymbolMaps[mungeNamespace].symbolMap; if (!symbolMap[identName]) { symbolMap[identName] = base62.encode(_mungedSymbolMaps[mungeNamespace].identUUIDCounter++); } identName = symbolMap[identName]; } return '$' + mungeNamespace + identName; } /** * Extracts super class information from a class node. * * Information includes name of the super class and/or the expression string * (if extending from an expression) * * @param {object} node * @param {object} state * @return {object} */ function _getSuperClassInfo(node, state) { var ret = { name: null, expression: null }; if (node.superClass) { if (node.superClass.type === Syntax.Identifier) { ret.name = node.superClass.name; } else { // Extension from an expression ret.name = _generateAnonymousClassName(state); ret.expression = state.g.source.substring( node.superClass.range[0], node.superClass.range[1] ); } } return ret; } /** * Used with .filter() to find the constructor method in a list of * MethodDefinition nodes. * * @param {object} classElement * @return {boolean} */ function _isConstructorMethod(classElement) { return classElement.type === Syntax.MethodDefinition && classElement.key.type === Syntax.Identifier && classElement.key.name === 'constructor'; } /** * @param {object} node * @param {object} state * @return {boolean} */ function _shouldMungeIdentifier(node, state) { return ( !!state.methodFuncNode && !utils.getDocblock(state).hasOwnProperty('preventMunge') && /^_(?!_)/.test(node.name) ); } /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitClassMethod(traverse, node, path, state) { if (!state.g.opts.es5 && (node.kind === 'get' || node.kind === 'set')) { throw new Error( 'This transform does not support ' + node.kind + 'ter methods for ES6 ' + 'classes. (line: ' + node.loc.start.line + ', col: ' + node.loc.start.column + ')' ); } state = utils.updateState(state, { methodNode: node }); utils.catchup(node.range[0], state); path.unshift(node); traverse(node.value, path, state); path.shift(); return false; } visitClassMethod.test = function(node, path, state) { return node.type === Syntax.MethodDefinition; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitClassFunctionExpression(traverse, node, path, state) { var methodNode = path[0]; var isGetter = methodNode.kind === 'get'; var isSetter = methodNode.kind === 'set'; state = utils.updateState(state, { methodFuncNode: node }); if (methodNode.key.name === 'constructor') { utils.append('function ' + state.className, state); } else { var methodAccessor; var prototypeOrStatic = methodNode["static"] ? '' : '.prototype'; var objectAccessor = state.className + prototypeOrStatic; if (methodNode.key.type === Syntax.Identifier) { // foo() {} methodAccessor = methodNode.key.name; if (_shouldMungeIdentifier(methodNode.key, state)) { methodAccessor = _getMungedName(methodAccessor, state); } if (isGetter || isSetter) { methodAccessor = JSON.stringify(methodAccessor); } else if (reservedWordsHelper.isReservedWord(methodAccessor)) { methodAccessor = '[' + JSON.stringify(methodAccessor) + ']'; } else { methodAccessor = '.' + methodAccessor; } } else if (methodNode.key.type === Syntax.Literal) { // 'foo bar'() {} | get 'foo bar'() {} | set 'foo bar'() {} methodAccessor = JSON.stringify(methodNode.key.value); if (!(isGetter || isSetter)) { methodAccessor = '[' + methodAccessor + ']'; } } if (isSetter || isGetter) { utils.append( 'Object.defineProperty(' + objectAccessor + ',' + methodAccessor + ',' + '{enumerable:true,configurable:true,' + methodNode.kind + ':function', state ); } else { utils.append( objectAccessor + methodAccessor + '=function' + (node.generator ? '*' : ''), state ); } } utils.move(methodNode.key.range[1], state); utils.append('(', state); var params = node.params; if (params.length > 0) { utils.move(params[0].range[0], state); for (var i = 0; i < params.length; i++) { utils.catchup(node.params[i].range[0], state); path.unshift(node); traverse(params[i], path, state); path.shift(); } } utils.append(')', state); utils.catchupWhiteSpace(node.body.range[0], state); utils.append('{', state); if (!state.scopeIsStrict) { utils.append('"use strict";', state); state = utils.updateState(state, { scopeIsStrict: true }); } utils.move(node.body.range[0] + '{'.length, state); path.unshift(node); traverse(node.body, path, state); path.shift(); utils.catchup(node.body.range[1], state); if (methodNode.key.name !== 'constructor') { if (isGetter || isSetter) { utils.append('})', state); } utils.append(';', state); } return false; } visitClassFunctionExpression.test = function(node, path, state) { return node.type === Syntax.FunctionExpression && path[0].type === Syntax.MethodDefinition; }; function visitClassMethodParam(traverse, node, path, state) { var paramName = node.name; if (_shouldMungeIdentifier(node, state)) { paramName = _getMungedName(node.name, state); } utils.append(paramName, state); utils.move(node.range[1], state); } visitClassMethodParam.test = function(node, path, state) { if (!path[0] || !path[1]) { return; } var parentFuncExpr = path[0]; var parentClassMethod = path[1]; return parentFuncExpr.type === Syntax.FunctionExpression && parentClassMethod.type === Syntax.MethodDefinition && node.type === Syntax.Identifier; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function _renderClassBody(traverse, node, path, state) { var className = state.className; var superClass = state.superClass; // Set up prototype of constructor on same line as `extends` for line-number // preservation. This relies on function-hoisting if a constructor function is // defined in the class body. if (superClass.name) { // If the super class is an expression, we need to memoize the output of the // expression into the generated class name variable and use that to refer // to the super class going forward. Example: // // class Foo extends mixin(Bar, Baz) {} // --transforms to-- // function Foo() {} var ____Class0Blah = mixin(Bar, Baz); if (superClass.expression !== null) { utils.append( 'var ' + superClass.name + '=' + superClass.expression + ';', state ); } var keyName = superClass.name + '____Key'; var keyNameDeclarator = ''; if (!utils.identWithinLexicalScope(keyName, state)) { keyNameDeclarator = 'var '; declareIdentInLocalScope(keyName, initScopeMetadata(node), state); } utils.append( 'for(' + keyNameDeclarator + keyName + ' in ' + superClass.name + '){' + 'if(' + superClass.name + '.hasOwnProperty(' + keyName + ')){' + className + '[' + keyName + ']=' + superClass.name + '[' + keyName + '];' + '}' + '}', state ); var superProtoIdentStr = SUPER_PROTO_IDENT_PREFIX + superClass.name; if (!utils.identWithinLexicalScope(superProtoIdentStr, state)) { utils.append( 'var ' + superProtoIdentStr + '=' + superClass.name + '===null?' + 'null:' + superClass.name + '.prototype;', state ); declareIdentInLocalScope(superProtoIdentStr, initScopeMetadata(node), state); } utils.append( className + '.prototype=Object.create(' + superProtoIdentStr + ');', state ); utils.append( className + '.prototype.constructor=' + className + ';', state ); utils.append( className + '.__superConstructor__=' + superClass.name + ';', state ); } // If there's no constructor method specified in the class body, create an // empty constructor function at the top (same line as the class keyword) if (!node.body.body.filter(_isConstructorMethod).pop()) { utils.append('function ' + className + '(){', state); if (!state.scopeIsStrict) { utils.append('"use strict";', state); } if (superClass.name) { utils.append( 'if(' + superClass.name + '!==null){' + superClass.name + '.apply(this,arguments);}', state ); } utils.append('}', state); } utils.move(node.body.range[0] + '{'.length, state); traverse(node.body, path, state); utils.catchupWhiteSpace(node.range[1], state); } /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitClassDeclaration(traverse, node, path, state) { var className = node.id.name; var superClass = _getSuperClassInfo(node, state); state = utils.updateState(state, { mungeNamespace: className, className: className, superClass: superClass }); _renderClassBody(traverse, node, path, state); return false; } visitClassDeclaration.test = function(node, path, state) { return node.type === Syntax.ClassDeclaration; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitClassExpression(traverse, node, path, state) { var className = node.id && node.id.name || _generateAnonymousClassName(state); var superClass = _getSuperClassInfo(node, state); utils.append('(function(){', state); state = utils.updateState(state, { mungeNamespace: className, className: className, superClass: superClass }); _renderClassBody(traverse, node, path, state); utils.append('return ' + className + ';})()', state); return false; } visitClassExpression.test = function(node, path, state) { return node.type === Syntax.ClassExpression; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitPrivateIdentifier(traverse, node, path, state) { utils.append(_getMungedName(node.name, state), state); utils.move(node.range[1], state); } visitPrivateIdentifier.test = function(node, path, state) { if (node.type === Syntax.Identifier && _shouldMungeIdentifier(node, state)) { // Always munge non-computed properties of MemberExpressions // (a la preventing access of properties of unowned objects) if (path[0].type === Syntax.MemberExpression && path[0].object !== node && path[0].computed === false) { return true; } // Always munge identifiers that were declared within the method function // scope if (utils.identWithinLexicalScope(node.name, state, state.methodFuncNode)) { return true; } // Always munge private keys on object literals defined within a method's // scope. if (path[0].type === Syntax.Property && path[1].type === Syntax.ObjectExpression) { return true; } // Always munge function parameters if (path[0].type === Syntax.FunctionExpression || path[0].type === Syntax.FunctionDeclaration || path[0].type === Syntax.ArrowFunctionExpression) { for (var i = 0; i < path[0].params.length; i++) { if (path[0].params[i] === node) { return true; } } } } return false; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitSuperCallExpression(traverse, node, path, state) { var superClassName = state.superClass.name; if (node.callee.type === Syntax.Identifier) { if (_isConstructorMethod(state.methodNode)) { utils.append(superClassName + '.call(', state); } else { var protoProp = SUPER_PROTO_IDENT_PREFIX + superClassName; if (state.methodNode.key.type === Syntax.Identifier) { protoProp += '.' + state.methodNode.key.name; } else if (state.methodNode.key.type === Syntax.Literal) { protoProp += '[' + JSON.stringify(state.methodNode.key.value) + ']'; } utils.append(protoProp + ".call(", state); } utils.move(node.callee.range[1], state); } else if (node.callee.type === Syntax.MemberExpression) { utils.append(SUPER_PROTO_IDENT_PREFIX + superClassName, state); utils.move(node.callee.object.range[1], state); if (node.callee.computed) { // ["a" + "b"] utils.catchup(node.callee.property.range[1] + ']'.length, state); } else { // .ab utils.append('.' + node.callee.property.name, state); } utils.append('.call(', state); utils.move(node.callee.range[1], state); } utils.append('this', state); if (node.arguments.length > 0) { utils.append(',', state); utils.catchupWhiteSpace(node.arguments[0].range[0], state); traverse(node.arguments, path, state); } utils.catchupWhiteSpace(node.range[1], state); utils.append(')', state); return false; } visitSuperCallExpression.test = function(node, path, state) { if (state.superClass && node.type === Syntax.CallExpression) { var callee = node.callee; if (callee.type === Syntax.Identifier && callee.name === 'super' || callee.type == Syntax.MemberExpression && callee.object.name === 'super') { return true; } } return false; }; /** * @param {function} traverse * @param {object} node * @param {array} path * @param {object} state */ function visitSuperMemberExpression(traverse, node, path, state) { var superClassName = state.superClass.name; utils.append(SUPER_PROTO_IDENT_PREFIX + superClassName, state); utils.move(node.object.range[1], state); } visitSuperMemberExpression.test = function(node, path, state) { return state.superClass && node.type === Syntax.MemberExpression && node.object.type === Syntax.Identifier && node.object.name === 'super'; }; exports.resetSymbols = resetSymbols; exports.visitorList = [ visitClassDeclaration, visitClassExpression, visitClassFunctionExpression, visitClassMethod, visitClassMethodParam, visitPrivateIdentifier, visitSuperCallExpression, visitSuperMemberExpression ]; },{"../src/utils":22,"./reserved-words-helper":32,"base62":9,"esprima-fb":8}],25:[function(_dereq_,module,exports){ /** * Copyright 2014 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*global exports:true*/ /** * Implements ES6 destructuring assignment and pattern matchng. * * function init({port, ip, coords: [x, y]}) { * return (x && y) ? {id, port} : {ip}; * }; * * function init($__0) { * var * port = $__0.port, * ip = $__0.ip, * $__1 = $__0.coords, * x = $__1[0], * y = $__1[1]; * return (x && y) ? {id, port} : {ip}; * } * * var x, {ip, port} = init({ip, port}); * * var x, $__0 = init({ip, port}), ip = $__0.ip, port = $__0.port; * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); var reservedWordsHelper = _dereq_('./reserved-words-helper'); var restParamVisitors = _dereq_('./es6-rest-param-visitors'); var restPropertyHelpers = _dereq_('./es7-rest-property-helpers'); // ------------------------------------------------------- // 1. Structured variable declarations. // // var [a, b] = [b, a]; // var {x, y} = {y, x}; // ------------------------------------------------------- function visitStructuredVariable(traverse, node, path, state) { // Allocate new temp for the pattern. utils.append(getTmpVar(state.localScope.tempVarIndex) + '=', state); // Skip the pattern and assign the init to the temp. utils.catchupWhiteSpace(node.init.range[0], state); traverse(node.init, path, state); utils.catchup(node.init.range[1], state); // Render the destructured data. utils.append(',' + getDestructuredComponents(node.id, state), state); state.localScope.tempVarIndex++; return false; } visitStructuredVariable.test = function(node, path, state) { return node.type === Syntax.VariableDeclarator && isStructuredPattern(node.id); }; function isStructuredPattern(node) { return node.type === Syntax.ObjectPattern || node.type === Syntax.ArrayPattern; } // Main function which does actual recursive destructuring // of nested complex structures. function getDestructuredComponents(node, state) { var tmpIndex = state.localScope.tempVarIndex; var components = []; var patternItems = getPatternItems(node); for (var idx = 0; idx < patternItems.length; idx++) { var item = patternItems[idx]; if (!item) { continue; } if (item.type === Syntax.SpreadElement) { // Spread/rest of an array. // TODO(dmitrys): support spread in the middle of a pattern // and also for function param patterns: [x, ...xs, y] components.push(item.argument.name + '=Array.prototype.slice.call(' + getTmpVar(tmpIndex) + ',' + idx + ')' ); continue; } if (item.type === Syntax.SpreadProperty) { var restExpression = restPropertyHelpers.renderRestExpression( getTmpVar(tmpIndex), patternItems ); components.push(item.argument.name + '=' + restExpression); continue; } // Depending on pattern type (Array or Object), we get // corresponding pattern item parts. var accessor = getPatternItemAccessor(node, item, tmpIndex, idx); var value = getPatternItemValue(node, item); // TODO(dmitrys): implement default values: {x, y=5} if (value.type === Syntax.Identifier) { // Simple pattern item. components.push(value.name + '=' + accessor); } else { // Complex sub-structure. components.push( getInitialValue(++state.localScope.tempVarIndex, accessor) + ',' + getDestructuredComponents(value, state) ); } } return components.join(','); } function getPatternItems(node) { return node.properties || node.elements; } function getPatternItemAccessor(node, patternItem, tmpIndex, idx) { var tmpName = getTmpVar(tmpIndex); if (node.type === Syntax.ObjectPattern) { if (reservedWordsHelper.isReservedWord(patternItem.key.name)) { return tmpName + '["' + patternItem.key.name + '"]'; } else { return tmpName + '.' + patternItem.key.name; } } else { return tmpName + '[' + idx + ']'; } } function getPatternItemValue(node, patternItem) { return node.type === Syntax.ObjectPattern ? patternItem.value : patternItem; } function getInitialValue(index, value) { return getTmpVar(index) + '=' + value; } function getTmpVar(index) { return '$__' + index; } // ------------------------------------------------------- // 2. Assignment expression. // // [a, b] = [b, a]; // ({x, y} = {y, x}); // ------------------------------------------------------- function visitStructuredAssignment(traverse, node, path, state) { var exprNode = node.expression; utils.append('var ' + getTmpVar(state.localScope.tempVarIndex) + '=', state); utils.catchupWhiteSpace(exprNode.right.range[0], state); traverse(exprNode.right, path, state); utils.catchup(exprNode.right.range[1], state); utils.append( ',' + getDestructuredComponents(exprNode.left, state) + ';', state ); utils.catchupWhiteSpace(node.range[1], state); state.localScope.tempVarIndex++; return false; } visitStructuredAssignment.test = function(node, path, state) { // We consider the expression statement rather than just assignment // expression to cover case with object patters which should be // wrapped in grouping operator: ({x, y} = {y, x}); return node.type === Syntax.ExpressionStatement && node.expression.type === Syntax.AssignmentExpression && isStructuredPattern(node.expression.left); }; // ------------------------------------------------------- // 3. Structured parameter. // // function foo({x, y}) { ... } // ------------------------------------------------------- function visitStructuredParameter(traverse, node, path, state) { utils.append(getTmpVar(getParamIndex(node, path)), state); utils.catchupWhiteSpace(node.range[1], state); return true; } function getParamIndex(paramNode, path) { var funcNode = path[0]; var tmpIndex = 0; for (var k = 0; k < funcNode.params.length; k++) { var param = funcNode.params[k]; if (param === paramNode) { break; } if (isStructuredPattern(param)) { tmpIndex++; } } return tmpIndex; } visitStructuredParameter.test = function(node, path, state) { return isStructuredPattern(node) && isFunctionNode(path[0]); }; function isFunctionNode(node) { return (node.type == Syntax.FunctionDeclaration || node.type == Syntax.FunctionExpression || node.type == Syntax.MethodDefinition || node.type == Syntax.ArrowFunctionExpression); } // ------------------------------------------------------- // 4. Function body for structured parameters. // // function foo({x, y}) { x; y; } // ------------------------------------------------------- function visitFunctionBodyForStructuredParameter(traverse, node, path, state) { var funcNode = path[0]; utils.catchup(funcNode.body.range[0] + 1, state); renderDestructuredComponents(funcNode, state); if (funcNode.rest) { utils.append( restParamVisitors.renderRestParamSetup(funcNode), state ); } return true; } function renderDestructuredComponents(funcNode, state) { var destructuredComponents = []; for (var k = 0; k < funcNode.params.length; k++) { var param = funcNode.params[k]; if (isStructuredPattern(param)) { destructuredComponents.push( getDestructuredComponents(param, state) ); state.localScope.tempVarIndex++; } } if (destructuredComponents.length) { utils.append('var ' + destructuredComponents.join(',') + ';', state); } } visitFunctionBodyForStructuredParameter.test = function(node, path, state) { return node.type === Syntax.BlockStatement && isFunctionNode(path[0]); }; exports.visitorList = [ visitStructuredVariable, visitStructuredAssignment, visitStructuredParameter, visitFunctionBodyForStructuredParameter ]; exports.renderDestructuredComponents = renderDestructuredComponents; },{"../src/utils":22,"./es6-rest-param-visitors":28,"./es7-rest-property-helpers":30,"./reserved-words-helper":32,"esprima-fb":8}],26:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint node:true*/ /** * Desugars concise methods of objects to function expressions. * * var foo = { * method(x, y) { ... } * }; * * var foo = { * method: function(x, y) { ... } * }; * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); var reservedWordsHelper = _dereq_('./reserved-words-helper'); function visitObjectConciseMethod(traverse, node, path, state) { var isGenerator = node.value.generator; if (isGenerator) { utils.catchupWhiteSpace(node.range[0] + 1, state); } if (node.computed) { // [<expr>]() { ...} utils.catchup(node.key.range[1] + 1, state); } else if (reservedWordsHelper.isReservedWord(node.key.name)) { utils.catchup(node.key.range[0], state); utils.append('"', state); utils.catchup(node.key.range[1], state); utils.append('"', state); } utils.catchup(node.key.range[1], state); utils.append( ':function' + (isGenerator ? '*' : ''), state ); path.unshift(node); traverse(node.value, path, state); path.shift(); return false; } visitObjectConciseMethod.test = function(node, path, state) { return node.type === Syntax.Property && node.value.type === Syntax.FunctionExpression && node.method === true; }; exports.visitorList = [ visitObjectConciseMethod ]; },{"../src/utils":22,"./reserved-words-helper":32,"esprima-fb":8}],27:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint node: true*/ /** * Desugars ES6 Object Literal short notations into ES3 full notation. * * // Easier return values. * function foo(x, y) { * return {x, y}; // {x: x, y: y} * }; * * // Destrucruting. * function init({port, ip, coords: {x, y}}) { ... } * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); /** * @public */ function visitObjectLiteralShortNotation(traverse, node, path, state) { utils.catchup(node.key.range[1], state); utils.append(':' + node.key.name, state); return false; } visitObjectLiteralShortNotation.test = function(node, path, state) { return node.type === Syntax.Property && node.kind === 'init' && node.shorthand === true && path[0].type !== Syntax.ObjectPattern; }; exports.visitorList = [ visitObjectLiteralShortNotation ]; },{"../src/utils":22,"esprima-fb":8}],28:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint node:true*/ /** * Desugars ES6 rest parameters into ES3 arguments slicing. * * function printf(template, ...args) { * args.forEach(...); * }; * * function printf(template) { * var args = [].slice.call(arguments, 1); * args.forEach(...); * }; * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); function _nodeIsFunctionWithRestParam(node) { return (node.type === Syntax.FunctionDeclaration || node.type === Syntax.FunctionExpression || node.type === Syntax.ArrowFunctionExpression) && node.rest; } function visitFunctionParamsWithRestParam(traverse, node, path, state) { if (node.parametricType) { utils.catchup(node.parametricType.range[0], state); path.unshift(node); traverse(node.parametricType, path, state); path.shift(); } // Render params. if (node.params.length) { path.unshift(node); traverse(node.params, path, state); path.shift(); } else { // -3 is for ... of the rest. utils.catchup(node.rest.range[0] - 3, state); } utils.catchupWhiteSpace(node.rest.range[1], state); path.unshift(node); traverse(node.body, path, state); path.shift(); return false; } visitFunctionParamsWithRestParam.test = function(node, path, state) { return _nodeIsFunctionWithRestParam(node); }; function renderRestParamSetup(functionNode) { return 'var ' + functionNode.rest.name + '=Array.prototype.slice.call(' + 'arguments,' + functionNode.params.length + ');'; } function visitFunctionBodyWithRestParam(traverse, node, path, state) { utils.catchup(node.range[0] + 1, state); var parentNode = path[0]; utils.append(renderRestParamSetup(parentNode), state); return true; } visitFunctionBodyWithRestParam.test = function(node, path, state) { return node.type === Syntax.BlockStatement && _nodeIsFunctionWithRestParam(path[0]); }; exports.renderRestParamSetup = renderRestParamSetup; exports.visitorList = [ visitFunctionParamsWithRestParam, visitFunctionBodyWithRestParam ]; },{"../src/utils":22,"esprima-fb":8}],29:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint node:true*/ /** * @typechecks */ 'use strict'; var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); /** * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.1.9 */ function visitTemplateLiteral(traverse, node, path, state) { var templateElements = node.quasis; utils.append('(', state); for (var ii = 0; ii < templateElements.length; ii++) { var templateElement = templateElements[ii]; if (templateElement.value.raw !== '') { utils.append(getCookedValue(templateElement), state); if (!templateElement.tail) { // + between element and substitution utils.append(' + ', state); } // maintain line numbers utils.move(templateElement.range[0], state); utils.catchupNewlines(templateElement.range[1], state); } else { // templateElement.value.raw === '' // Concatenat adjacent substitutions, e.g. `${x}${y}`. Empty templates // appear before the first and after the last element - nothing to add in // those cases. if (ii > 0 && !templateElement.tail) { // + between substitution and substitution utils.append(' + ', state); } } utils.move(templateElement.range[1], state); if (!templateElement.tail) { var substitution = node.expressions[ii]; if (substitution.type === Syntax.Identifier || substitution.type === Syntax.MemberExpression || substitution.type === Syntax.CallExpression) { utils.catchup(substitution.range[1], state); } else { utils.append('(', state); traverse(substitution, path, state); utils.catchup(substitution.range[1], state); utils.append(')', state); } // if next templateElement isn't empty... if (templateElements[ii + 1].value.cooked !== '') { utils.append(' + ', state); } } } utils.move(node.range[1], state); utils.append(')', state); return false; } visitTemplateLiteral.test = function(node, path, state) { return node.type === Syntax.TemplateLiteral; }; /** * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.2.6 */ function visitTaggedTemplateExpression(traverse, node, path, state) { var template = node.quasi; var numQuasis = template.quasis.length; // print the tag utils.move(node.tag.range[0], state); traverse(node.tag, path, state); utils.catchup(node.tag.range[1], state); // print array of template elements utils.append('(function() { var siteObj = [', state); for (var ii = 0; ii < numQuasis; ii++) { utils.append(getCookedValue(template.quasis[ii]), state); if (ii !== numQuasis - 1) { utils.append(', ', state); } } utils.append(']; siteObj.raw = [', state); for (ii = 0; ii < numQuasis; ii++) { utils.append(getRawValue(template.quasis[ii]), state); if (ii !== numQuasis - 1) { utils.append(', ', state); } } utils.append( ']; Object.freeze(siteObj.raw); Object.freeze(siteObj); return siteObj; }()', state ); // print substitutions if (numQuasis > 1) { for (ii = 0; ii < template.expressions.length; ii++) { var expression = template.expressions[ii]; utils.append(', ', state); // maintain line numbers by calling catchupWhiteSpace over the whole // previous TemplateElement utils.move(template.quasis[ii].range[0], state); utils.catchupNewlines(template.quasis[ii].range[1], state); utils.move(expression.range[0], state); traverse(expression, path, state); utils.catchup(expression.range[1], state); } } // print blank lines to push the closing ) down to account for the final // TemplateElement. utils.catchupNewlines(node.range[1], state); utils.append(')', state); return false; } visitTaggedTemplateExpression.test = function(node, path, state) { return node.type === Syntax.TaggedTemplateExpression; }; function getCookedValue(templateElement) { return JSON.stringify(templateElement.value.cooked); } function getRawValue(templateElement) { return JSON.stringify(templateElement.value.raw); } exports.visitorList = [ visitTemplateLiteral, visitTaggedTemplateExpression ]; },{"../src/utils":22,"esprima-fb":8}],30:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint node:true*/ /** * Desugars ES7 rest properties into ES5 object iteration. */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); // TODO: This is a pretty massive helper, it should only be defined once, in the // transform's runtime environment. We don't currently have a runtime though. var restFunction = '(function(source, exclusion) {' + 'var rest = {};' + 'var hasOwn = Object.prototype.hasOwnProperty;' + 'if (source == null) {' + 'throw new TypeError();' + '}' + 'for (var key in source) {' + 'if (hasOwn.call(source, key) && !hasOwn.call(exclusion, key)) {' + 'rest[key] = source[key];' + '}' + '}' + 'return rest;' + '})'; function getPropertyNames(properties) { var names = []; for (var i = 0; i < properties.length; i++) { var property = properties[i]; if (property.type === Syntax.SpreadProperty) { continue; } if (property.type === Syntax.Identifier) { names.push(property.name); } else { names.push(property.key.name); } } return names; } function getRestFunctionCall(source, exclusion) { return restFunction + '(' + source + ',' + exclusion + ')'; } function getSimpleShallowCopy(accessorExpression) { // This could be faster with 'Object.assign({}, ' + accessorExpression + ')' // but to unify code paths and avoid a ES6 dependency we use the same // helper as for the exclusion case. return getRestFunctionCall(accessorExpression, '{}'); } function renderRestExpression(accessorExpression, excludedProperties) { var excludedNames = getPropertyNames(excludedProperties); if (!excludedNames.length) { return getSimpleShallowCopy(accessorExpression); } return getRestFunctionCall( accessorExpression, '{' + excludedNames.join(':1,') + ':1}' ); } exports.renderRestExpression = renderRestExpression; },{"../src/utils":22,"esprima-fb":8}],31:[function(_dereq_,module,exports){ /** * Copyright 2004-present Facebook. All Rights Reserved. */ /*global exports:true*/ /** * Implements ES7 object spread property. * https://gist.github.com/sebmarkbage/aa849c7973cb4452c547 * * { ...a, x: 1 } * * Object.assign({}, a, {x: 1 }) * */ var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('../src/utils'); function visitObjectLiteralSpread(traverse, node, path, state) { utils.catchup(node.range[0], state); utils.append('Object.assign({', state); // Skip the original { utils.move(node.range[0] + 1, state); var previousWasSpread = false; for (var i = 0; i < node.properties.length; i++) { var property = node.properties[i]; if (property.type === Syntax.SpreadProperty) { // Close the previous object or initial object if (!previousWasSpread) { utils.append('}', state); } if (i === 0) { // Normally there will be a comma when we catch up, but not before // the first property. utils.append(',', state); } utils.catchup(property.range[0], state); // skip ... utils.move(property.range[0] + 3, state); traverse(property.argument, path, state); utils.catchup(property.range[1], state); previousWasSpread = true; } else { utils.catchup(property.range[0], state); if (previousWasSpread) { utils.append('{', state); } traverse(property, path, state); utils.catchup(property.range[1], state); previousWasSpread = false; } } utils.catchup(node.range[1] - 1, state); // Skip the trailing } utils.move(node.range[1], state); if (!previousWasSpread) { utils.append('}', state); } utils.append(')', state); return false; } visitObjectLiteralSpread.test = function(node, path, state) { if (node.type !== Syntax.ObjectExpression) { return false; } // Tight loop optimization var hasAtLeastOneSpreadProperty = false; for (var i = 0; i < node.properties.length; i++) { var property = node.properties[i]; if (property.type === Syntax.SpreadProperty) { hasAtLeastOneSpreadProperty = true; } else if (property.kind !== 'init') { return false; } } return hasAtLeastOneSpreadProperty; }; exports.visitorList = [ visitObjectLiteralSpread ]; },{"../src/utils":22,"esprima-fb":8}],32:[function(_dereq_,module,exports){ /** * Copyright 2014 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var KEYWORDS = [ 'break', 'do', 'in', 'typeof', 'case', 'else', 'instanceof', 'var', 'catch', 'export', 'new', 'void', 'class', 'extends', 'return', 'while', 'const', 'finally', 'super', 'with', 'continue', 'for', 'switch', 'yield', 'debugger', 'function', 'this', 'default', 'if', 'throw', 'delete', 'import', 'try' ]; var FUTURE_RESERVED_WORDS = [ 'enum', 'await', 'implements', 'package', 'protected', 'static', 'interface', 'private', 'public' ]; var LITERALS = [ 'null', 'true', 'false' ]; // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-reserved-words var RESERVED_WORDS = [].concat( KEYWORDS, FUTURE_RESERVED_WORDS, LITERALS ); var reservedWordsMap = {}; RESERVED_WORDS.forEach(function(k) { reservedWordsMap[k] = true; }); exports.isReservedWord = function(word) { return !!reservedWordsMap[word]; }; },{}],33:[function(_dereq_,module,exports){ var esprima = _dereq_('esprima-fb'); var utils = _dereq_('jstransform/src/utils'); var Syntax = esprima.Syntax; function _isFunctionNode(node) { return node.type === Syntax.FunctionDeclaration || node.type === Syntax.FunctionExpression || node.type === Syntax.ArrowFunctionExpression; } function visitClassProperty(traverse, node, path, state) { utils.catchupWhiteOut(node.range[1], state); return false; } visitClassProperty.test = function(node, path, state) { return node.type === Syntax.ClassProperty; }; function visitFunctionParametricAnnotation(traverse, node, path, state) { utils.catchupWhiteOut(node.range[1], state); return false; } visitFunctionParametricAnnotation.test = function(node, path, state) { return node.type === Syntax.ParametricTypeAnnotation && path[0] && _isFunctionNode(path[0]) && node === path[0].parametricType; }; function visitFunctionReturnAnnotation(traverse, node, path, state) { utils.catchupWhiteOut(node.range[1], state); return false; } visitFunctionReturnAnnotation.test = function(node, path, state) { return path[0] && _isFunctionNode(path[0]) && node === path[0].returnType; }; function visitOptionalFunctionParameterAnnotation(traverse, node, path, state) { path.unshift(node); traverse(node.id, path, state); path.shift(); utils.catchup(node.id.range[1], state); utils.catchupWhiteOut(node.range[1], state); return false; } visitOptionalFunctionParameterAnnotation.test = function(node, path, state) { return node.type === Syntax.OptionalParameter && path[0] && _isFunctionNode(path[0]); }; function visitTypeAnnotatedIdentifier(traverse, node, path, state) { traverse(node.id, path, state); utils.catchup(node.id.range[1], state); utils.catchupWhiteOut(node.range[1], state); return false; } visitTypeAnnotatedIdentifier.test = function(node, path, state) { return node.type === Syntax.TypeAnnotatedIdentifier; }; exports.visitorList = [ visitClassProperty, visitFunctionParametricAnnotation, visitFunctionReturnAnnotation, visitOptionalFunctionParameterAnnotation, visitTypeAnnotatedIdentifier ]; },{"esprima-fb":8,"jstransform/src/utils":22}],34:[function(_dereq_,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ /*global exports:true*/ "use strict"; var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('jstransform/src/utils'); var FALLBACK_TAGS = _dereq_('./xjs').knownTags; var renderXJSExpressionContainer = _dereq_('./xjs').renderXJSExpressionContainer; var renderXJSLiteral = _dereq_('./xjs').renderXJSLiteral; var quoteAttrName = _dereq_('./xjs').quoteAttrName; var trimLeft = _dereq_('./xjs').trimLeft; /** * Customized desugar processor for React JSX. Currently: * * <X> </X> => React.createElement(X, null) * <X prop="1" /> => React.createElement(X, {prop: '1'}, null) * <X prop="2"><Y /></X> => React.createElement(X, {prop:'2'}, * React.createElement(Y, null) * ) * <div /> => React.createElement("div", null) */ /** * Removes all non-whitespace/parenthesis characters */ var reNonWhiteParen = /([^\s\(\)])/g; function stripNonWhiteParen(value) { return value.replace(reNonWhiteParen, ''); } var tagConvention = /^[a-z]|\-/; function isTagName(name) { return tagConvention.test(name); } function visitReactTag(traverse, object, path, state) { var openingElement = object.openingElement; var nameObject = openingElement.name; var attributesObject = openingElement.attributes; utils.catchup(openingElement.range[0], state, trimLeft); if (nameObject.type === Syntax.XJSNamespacedName && nameObject.namespace) { throw new Error('Namespace tags are not supported. ReactJSX is not XML.'); } // We assume that the React runtime is already in scope utils.append('React.createElement(', state); // Identifiers with lower case or hypthens are fallback tags (strings). // XJSMemberExpressions are not. if (nameObject.type === Syntax.XJSIdentifier && isTagName(nameObject.name)) { // This is a temporary error message to assist upgrades if (!FALLBACK_TAGS.hasOwnProperty(nameObject.name)) { throw new Error( 'Lower case component names (' + nameObject.name + ') are no longer ' + 'supported in JSX: See http://fb.me/react-jsx-lower-case' ); } utils.append('"' + nameObject.name + '"', state); utils.move(nameObject.range[1], state); } else { // Use utils.catchup in this case so we can easily handle // XJSMemberExpressions which look like Foo.Bar.Baz. This also handles // XJSIdentifiers that aren't fallback tags. utils.move(nameObject.range[0], state); utils.catchup(nameObject.range[1], state); } utils.append(', ', state); var hasAttributes = attributesObject.length; var hasAtLeastOneSpreadProperty = attributesObject.some(function(attr) { return attr.type === Syntax.XJSSpreadAttribute; }); // if we don't have any attributes, pass in null if (hasAtLeastOneSpreadProperty) { utils.append('React.__spread({', state); } else if (hasAttributes) { utils.append('{', state); } else { utils.append('null', state); } // keep track of if the previous attribute was a spread attribute var previousWasSpread = false; // write attributes attributesObject.forEach(function(attr, index) { var isLast = index === attributesObject.length - 1; if (attr.type === Syntax.XJSSpreadAttribute) { // Close the previous object or initial object if (!previousWasSpread) { utils.append('}, ', state); } // Move to the expression start, ignoring everything except parenthesis // and whitespace. utils.catchup(attr.range[0], state, stripNonWhiteParen); // Plus 1 to skip `{`. utils.move(attr.range[0] + 1, state); utils.catchup(attr.argument.range[0], state, stripNonWhiteParen); traverse(attr.argument, path, state); utils.catchup(attr.argument.range[1], state); // Move to the end, ignoring parenthesis and the closing `}` utils.catchup(attr.range[1] - 1, state, stripNonWhiteParen); if (!isLast) { utils.append(', ', state); } utils.move(attr.range[1], state); previousWasSpread = true; return; } // If the next attribute is a spread, we're effective last in this object if (!isLast) { isLast = attributesObject[index + 1].type === Syntax.XJSSpreadAttribute; } if (attr.name.namespace) { throw new Error( 'Namespace attributes are not supported. ReactJSX is not XML.'); } var name = attr.name.name; utils.catchup(attr.range[0], state, trimLeft); if (previousWasSpread) { utils.append('{', state); } utils.append(quoteAttrName(name), state); utils.append(': ', state); if (!attr.value) { state.g.buffer += 'true'; state.g.position = attr.name.range[1]; if (!isLast) { utils.append(', ', state); } } else { utils.move(attr.name.range[1], state); // Use catchupNewlines to skip over the '=' in the attribute utils.catchupNewlines(attr.value.range[0], state); if (attr.value.type === Syntax.Literal) { renderXJSLiteral(attr.value, isLast, state); } else { renderXJSExpressionContainer(traverse, attr.value, isLast, path, state); } } utils.catchup(attr.range[1], state, trimLeft); previousWasSpread = false; }); if (!openingElement.selfClosing) { utils.catchup(openingElement.range[1] - 1, state, trimLeft); utils.move(openingElement.range[1], state); } if (hasAttributes && !previousWasSpread) { utils.append('}', state); } if (hasAtLeastOneSpreadProperty) { utils.append(')', state); } // filter out whitespace var childrenToRender = object.children.filter(function(child) { return !(child.type === Syntax.Literal && typeof child.value === 'string' && child.value.match(/^[ \t]*[\r\n][ \t\r\n]*$/)); }); if (childrenToRender.length > 0) { var lastRenderableIndex; childrenToRender.forEach(function(child, index) { if (child.type !== Syntax.XJSExpressionContainer || child.expression.type !== Syntax.XJSEmptyExpression) { lastRenderableIndex = index; } }); if (lastRenderableIndex !== undefined) { utils.append(', ', state); } childrenToRender.forEach(function(child, index) { utils.catchup(child.range[0], state, trimLeft); var isLast = index >= lastRenderableIndex; if (child.type === Syntax.Literal) { renderXJSLiteral(child, isLast, state); } else if (child.type === Syntax.XJSExpressionContainer) { renderXJSExpressionContainer(traverse, child, isLast, path, state); } else { traverse(child, path, state); if (!isLast) { utils.append(', ', state); } } utils.catchup(child.range[1], state, trimLeft); }); } if (openingElement.selfClosing) { // everything up to /> utils.catchup(openingElement.range[1] - 2, state, trimLeft); utils.move(openingElement.range[1], state); } else { // everything up to </ sdflksjfd> utils.catchup(object.closingElement.range[0], state, trimLeft); utils.move(object.closingElement.range[1], state); } utils.append(')', state); return false; } visitReactTag.test = function(object, path, state) { return object.type === Syntax.XJSElement; }; exports.visitorList = [ visitReactTag ]; },{"./xjs":36,"esprima-fb":8,"jstransform/src/utils":22}],35:[function(_dereq_,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ /*global exports:true*/ "use strict"; var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('jstransform/src/utils'); function addDisplayName(displayName, object, state) { if (object && object.type === Syntax.CallExpression && object.callee.type === Syntax.MemberExpression && object.callee.object.type === Syntax.Identifier && object.callee.object.name === 'React' && object.callee.property.type === Syntax.Identifier && object.callee.property.name === 'createClass' && object['arguments'].length === 1 && object['arguments'][0].type === Syntax.ObjectExpression) { // Verify that the displayName property isn't already set var properties = object['arguments'][0].properties; var safe = properties.every(function(property) { var value = property.key.type === Syntax.Identifier ? property.key.name : property.key.value; return value !== 'displayName'; }); if (safe) { utils.catchup(object['arguments'][0].range[0] + 1, state); utils.append("displayName: '" + displayName + "',", state); } } } /** * Transforms the following: * * var MyComponent = React.createClass({ * render: ... * }); * * into: * * var MyComponent = React.createClass({ * displayName: 'MyComponent', * render: ... * }); * * Also catches: * * MyComponent = React.createClass(...); * exports.MyComponent = React.createClass(...); * module.exports = {MyComponent: React.createClass(...)}; */ function visitReactDisplayName(traverse, object, path, state) { var left, right; if (object.type === Syntax.AssignmentExpression) { left = object.left; right = object.right; } else if (object.type === Syntax.Property) { left = object.key; right = object.value; } else if (object.type === Syntax.VariableDeclarator) { left = object.id; right = object.init; } if (left && left.type === Syntax.MemberExpression) { left = left.property; } if (left && left.type === Syntax.Identifier) { addDisplayName(left.name, right, state); } } visitReactDisplayName.test = function(object, path, state) { return ( object.type === Syntax.AssignmentExpression || object.type === Syntax.Property || object.type === Syntax.VariableDeclarator ); }; exports.visitorList = [ visitReactDisplayName ]; },{"esprima-fb":8,"jstransform/src/utils":22}],36:[function(_dereq_,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ /*global exports:true*/ "use strict"; var Syntax = _dereq_('esprima-fb').Syntax; var utils = _dereq_('jstransform/src/utils'); var knownTags = { a: true, abbr: true, address: true, applet: true, area: true, article: true, aside: true, audio: true, b: true, base: true, bdi: true, bdo: true, big: true, blockquote: true, body: true, br: true, button: true, canvas: true, caption: true, circle: true, cite: true, code: true, col: true, colgroup: true, command: true, data: true, datalist: true, dd: true, defs: true, del: true, details: true, dfn: true, dialog: true, div: true, dl: true, dt: true, ellipse: true, em: true, embed: true, fieldset: true, figcaption: true, figure: true, footer: true, form: true, g: true, h1: true, h2: true, h3: true, h4: true, h5: true, h6: true, head: true, header: true, hgroup: true, hr: true, html: true, i: true, iframe: true, img: true, input: true, ins: true, kbd: true, keygen: true, label: true, legend: true, li: true, line: true, linearGradient: true, link: true, main: true, map: true, mark: true, marquee: true, mask: false, menu: true, menuitem: true, meta: true, meter: true, nav: true, noscript: true, object: true, ol: true, optgroup: true, option: true, output: true, p: true, param: true, path: true, pattern: false, picture: true, polygon: true, polyline: true, pre: true, progress: true, q: true, radialGradient: true, rect: true, rp: true, rt: true, ruby: true, s: true, samp: true, script: true, section: true, select: true, small: true, source: true, span: true, stop: true, strong: true, style: true, sub: true, summary: true, sup: true, svg: true, table: true, tbody: true, td: true, text: true, textarea: true, tfoot: true, th: true, thead: true, time: true, title: true, tr: true, track: true, tspan: true, u: true, ul: true, 'var': true, video: true, wbr: true }; function renderXJSLiteral(object, isLast, state, start, end) { var lines = object.value.split(/\r\n|\n|\r/); if (start) { utils.append(start, state); } var lastNonEmptyLine = 0; lines.forEach(function (line, index) { if (line.match(/[^ \t]/)) { lastNonEmptyLine = index; } }); lines.forEach(function (line, index) { var isFirstLine = index === 0; var isLastLine = index === lines.length - 1; var isLastNonEmptyLine = index === lastNonEmptyLine; // replace rendered whitespace tabs with spaces var trimmedLine = line.replace(/\t/g, ' '); // trim whitespace touching a newline if (!isFirstLine) { trimmedLine = trimmedLine.replace(/^[ ]+/, ''); } if (!isLastLine) { trimmedLine = trimmedLine.replace(/[ ]+$/, ''); } if (!isFirstLine) { utils.append(line.match(/^[ \t]*/)[0], state); } if (trimmedLine || isLastNonEmptyLine) { utils.append( JSON.stringify(trimmedLine) + (!isLastNonEmptyLine ? " + ' ' +" : ''), state); if (isLastNonEmptyLine) { if (end) { utils.append(end, state); } if (!isLast) { utils.append(', ', state); } } // only restore tail whitespace if line had literals if (trimmedLine && !isLastLine) { utils.append(line.match(/[ \t]*$/)[0], state); } } if (!isLastLine) { utils.append('\n', state); } }); utils.move(object.range[1], state); } function renderXJSExpressionContainer(traverse, object, isLast, path, state) { // Plus 1 to skip `{`. utils.move(object.range[0] + 1, state); traverse(object.expression, path, state); if (!isLast && object.expression.type !== Syntax.XJSEmptyExpression) { // If we need to append a comma, make sure to do so after the expression. utils.catchup(object.expression.range[1], state, trimLeft); utils.append(', ', state); } // Minus 1 to skip `}`. utils.catchup(object.range[1] - 1, state, trimLeft); utils.move(object.range[1], state); return false; } function quoteAttrName(attr) { // Quote invalid JS identifiers. if (!/^[a-z_$][a-z\d_$]*$/i.test(attr)) { return "'" + attr + "'"; } return attr; } function trimLeft(value) { return value.replace(/^[ ]+/, ''); } exports.knownTags = knownTags; exports.renderXJSExpressionContainer = renderXJSExpressionContainer; exports.renderXJSLiteral = renderXJSLiteral; exports.quoteAttrName = quoteAttrName; exports.trimLeft = trimLeft; },{"esprima-fb":8,"jstransform/src/utils":22}],37:[function(_dereq_,module,exports){ /*global exports:true*/ var es6ArrowFunctions = _dereq_('jstransform/visitors/es6-arrow-function-visitors'); var es6Classes = _dereq_('jstransform/visitors/es6-class-visitors'); var es6Destructuring = _dereq_('jstransform/visitors/es6-destructuring-visitors'); var es6ObjectConciseMethod = _dereq_('jstransform/visitors/es6-object-concise-method-visitors'); var es6ObjectShortNotation = _dereq_('jstransform/visitors/es6-object-short-notation-visitors'); var es6RestParameters = _dereq_('jstransform/visitors/es6-rest-param-visitors'); var es6Templates = _dereq_('jstransform/visitors/es6-template-visitors'); var es7SpreadProperty = _dereq_('jstransform/visitors/es7-spread-property-visitors'); var react = _dereq_('./transforms/react'); var reactDisplayName = _dereq_('./transforms/reactDisplayName'); var typesSyntax = _dereq_('jstransform/visitors/type-syntax'); /** * Map from transformName => orderedListOfVisitors. */ var transformVisitors = { 'es6-arrow-functions': es6ArrowFunctions.visitorList, 'es6-classes': es6Classes.visitorList, 'es6-destructuring': es6Destructuring.visitorList, 'es6-object-concise-method': es6ObjectConciseMethod.visitorList, 'es6-object-short-notation': es6ObjectShortNotation.visitorList, 'es6-rest-params': es6RestParameters.visitorList, 'es6-templates': es6Templates.visitorList, 'es7-spread-property': es7SpreadProperty.visitorList, 'react': react.visitorList.concat(reactDisplayName.visitorList), 'types': typesSyntax.visitorList }; var transformSets = { 'harmony': [ 'es6-arrow-functions', 'es6-object-concise-method', 'es6-object-short-notation', 'es6-classes', 'es6-rest-params', 'es6-templates', 'es6-destructuring', 'es7-spread-property' ], 'react': [ 'react' ], 'type-annotations': [ 'types' ] }; /** * Specifies the order in which each transform should run. */ var transformRunOrder = [ 'types', 'es6-arrow-functions', 'es6-object-concise-method', 'es6-object-short-notation', 'es6-classes', 'es6-rest-params', 'es6-templates', 'es6-destructuring', 'es7-spread-property', 'react' ]; /** * Given a list of transform names, return the ordered list of visitors to be * passed to the transform() function. * * @param {array?} excludes * @return {array} */ function getAllVisitors(excludes) { var ret = []; for (var i = 0, il = transformRunOrder.length; i < il; i++) { if (!excludes || excludes.indexOf(transformRunOrder[i]) === -1) { ret = ret.concat(transformVisitors[transformRunOrder[i]]); } } return ret; } /** * Given a list of visitor set names, return the ordered list of visitors to be * passed to jstransform. * * @param {array} * @return {array} */ function getVisitorsBySet(sets) { var visitorsToInclude = sets.reduce(function(visitors, set) { if (!transformSets.hasOwnProperty(set)) { throw new Error('Unknown visitor set: ' + set); } transformSets[set].forEach(function(visitor) { visitors[visitor] = true; }); return visitors; }, {}); var visitorList = []; for (var i = 0; i < transformRunOrder.length; i++) { if (visitorsToInclude.hasOwnProperty(transformRunOrder[i])) { visitorList = visitorList.concat(transformVisitors[transformRunOrder[i]]); } } return visitorList; } exports.getVisitorsBySet = getVisitorsBySet; exports.getAllVisitors = getAllVisitors; exports.transformVisitors = transformVisitors; },{"./transforms/react":34,"./transforms/reactDisplayName":35,"jstransform/visitors/es6-arrow-function-visitors":23,"jstransform/visitors/es6-class-visitors":24,"jstransform/visitors/es6-destructuring-visitors":25,"jstransform/visitors/es6-object-concise-method-visitors":26,"jstransform/visitors/es6-object-short-notation-visitors":27,"jstransform/visitors/es6-rest-param-visitors":28,"jstransform/visitors/es6-template-visitors":29,"jstransform/visitors/es7-spread-property-visitors":31,"jstransform/visitors/type-syntax":33}]},{},[1])(1) });
src/svg-icons/action/thumbs-up-down.js
jacklam718/react-svg-iconx
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionThumbsUpDown = (props) => ( <SvgIcon {...props}> <path d="M12 6c0-.55-.45-1-1-1H5.82l.66-3.18.02-.23c0-.31-.13-.59-.33-.8L5.38 0 .44 4.94C.17 5.21 0 5.59 0 6v6.5c0 .83.67 1.5 1.5 1.5h6.75c.62 0 1.15-.38 1.38-.91l2.26-5.29c.07-.17.11-.36.11-.55V6zm10.5 4h-6.75c-.62 0-1.15.38-1.38.91l-2.26 5.29c-.07.17-.11.36-.11.55V18c0 .55.45 1 1 1h5.18l-.66 3.18-.02.24c0 .31.13.59.33.8l.79.78 4.94-4.94c.27-.27.44-.65.44-1.06v-6.5c0-.83-.67-1.5-1.5-1.5z"/> </SvgIcon> ); ActionThumbsUpDown = pure(ActionThumbsUpDown); ActionThumbsUpDown.displayName = 'ActionThumbsUpDown'; ActionThumbsUpDown.muiName = 'SvgIcon'; export default ActionThumbsUpDown;
src/components/Feedback/Feedback.js
louisukiri/react-starter-kit
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './Feedback.css'; class Feedback extends React.Component { render() { return ( <div className={s.root}> <div className={s.container}> <a className={s.link} href="https://gitter.im/kriasoft/react-starter-kit" > Ask a question </a> <span className={s.spacer}>|</span> <a className={s.link} href="https://github.com/kriasoft/react-starter-kit/issues/new" > Report an issue </a> </div> </div> ); } } export default withStyles(s)(Feedback);
packages/mineral-ui-icons/src/IconStarHalf.js
mineral-ui/mineral-ui
/* @flow */ import React from 'react'; import Icon from 'mineral-ui/Icon'; import type { IconProps } from 'mineral-ui/Icon/types'; /* eslint-disable prettier/prettier */ export default function IconStarHalf(props: IconProps) { const iconProps = { rtl: true, ...props }; return ( <Icon {...iconProps}> <g> <path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4V6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/> </g> </Icon> ); } IconStarHalf.displayName = 'IconStarHalf'; IconStarHalf.category = 'toggle';
src/pages/TodoPage.js
pekkis/react-broilerplate-project
// @flow import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { List } from 'immutable'; type Props = { todos: List<TodoType>, params: { uuid: string, }, }; const TodoPage = (props: Props) => { const { todos, params } = props; const currentTodo = todos.find(todo => todo.id === params.uuid); if (!currentTodo) { return ( <div>Not found</div> ); } return ( <div> {currentTodo.text} </div> ); }; TodoPage.propTypes = { todos: ImmutablePropTypes.list.isRequired, params: React.PropTypes.object.isRequired, }; export default TodoPage;
samples/06.recomposing-ui/c.smart-display/src/SpeechInterims.js
billba/botchat
import './SpeechInterims.css'; import { hooks } from 'botframework-webchat'; import React from 'react'; const { useDictateInterims, useSendBoxSpeechInterimsVisible } = hooks; const CustomDictationInterims = () => { const [dictateInterims] = useDictateInterims(); const [speechInterimsVisible] = useSendBoxSpeechInterimsVisible(); return ( speechInterimsVisible && ( <div className="App-SpeechInterims"> {!!speechInterimsVisible && dictateInterims.map((interim, index) => <span key={index}>{interim}&nbsp;</span>)} </div> ) ); }; export default CustomDictationInterims;
src/svg-icons/content/mail.js
rscnt/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ContentMail = (props) => ( <SvgIcon {...props}> <path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/> </SvgIcon> ); ContentMail = pure(ContentMail); ContentMail.displayName = 'ContentMail'; export default ContentMail;
features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/source/src/app/components/Apis/Details/LifeCycle/TransitionStateButton.js
lakmali/carbon-apimgt
import React from 'react' import {Radio} from 'antd' const Button = Radio.Button; const TransitionStateButton = (props) => { return ( <Button value={props.state.targetState}>{props.state.event}</Button> ); }; export default TransitionStateButton
example/components/App.js
idolize/redux-react-router-transitions
import React from 'react'; import { RouteHandler, Link } from 'react-router'; export default class App { handleLoginClick = (e) => { this.props.login(); } handleLogoutClick = (e) => { this.props.logout(); } handleRootClick = (e) => { this.props.transitionToRoot(); } render() { return ( <div> <button onClick={this.handleLoginClick}>Log in</button> <button onClick={this.handleLogoutClick}>Log out</button> <button onClick={this.handleRootClick}>Transition to root</button> <Link to="/item-list">List items</Link> <p>Logged in: {this.props.loggedIn ? 'yes': 'no'}</p> <RouteHandler /> </div> ); } }
src/components/framework/checkbox.js
colinmegill/polis-admin-console
/* * Copyright 2012-present, Polis Technology Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights for non-commercial use can be found in the PATENTS file * in the same directory. */ import React from "react"; import Radium from "radium"; import Color from "color"; import settings from "../../settings"; @Radium export default class Checkbox extends React.Component { constructor(props) { super(props); this.state = { checked: this.props.checked, active: false }; } static defaultProps = { checked: true, clickHandler: (x) => { return x }, color: settings.darkGray, } activeHandler () { this.setState({ active: !this.state.active }); } clickHandler () { this.setState({ checked: !this.state.checked }); if (this.props.clickHandler) { this.props.clickHandler(); } } getWrapperStyles () { return { display: "block", marginBottom: 10, position: "relative" }; } getLabelWrapperStyles () { return { color: this.props.labelWrapperColor, cursor: "pointer", display: "inline-block", fontFamily: settings.fontFamilySansSerif, fontSize: 14, fontWeight: 400, lineHeight: "20px", paddingLeft: 22, "-webkit-user-select": "none" }; } getCheckboxStyles () { const activeColor = Color(this.props.color).lighten(0.2).hexString(); return { base: { backgroundColor: settings.gray, borderRadius: 2, display: "inline-block", height: 12, left: -17, position: "relative", top: 1, transition: "background-color ease .3s", width: 12 }, checked: { backgroundColor: this.props.color }, active: { backgroundColor: activeColor } }; } getLabelStyles () { return { display: "inline", left: -12, marginRight: 4, position: "relative" }; } getHelpTextStyles () { return { color: "#ccc", cursor: "pointer", display: "inline", fontFamily: settings.fontFamilySansSerif, fontSize: 12, fontWeight: 200, lineHeight: "20px", marginLeft: 5 }; } render () { const checkboxStyles = this.getCheckboxStyles(); return ( <div style={this.getWrapperStyles()}> <span style={this.getLabelWrapperStyles()} onClick={this.clickHandler.bind(this)} onMouseDown={this.activeHandler.bind(this)} onMouseUp={this.activeHandler.bind(this)}> <span style={[ checkboxStyles.base, this.state.checked && checkboxStyles.checked, this.state.active && checkboxStyles.active ]}> </span> <span style={this.getLabelStyles()}> {this.props.label} {this.props.helpText ? ( <span style={this.getHelpTextStyles()}> ({this.props.helpText}) </span> ) : null } </span> </span> </div> ); } }
packages/material-ui-icons/src/LinkedCameraTwoTone.js
Kagami/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M20 20H4V8h4.05l1.83-2H15V4H9L7.17 6H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9h-2v11zM16 2v1.33c2.58 0 4.66 2.09 4.67 4.66H22C21.99 4.68 19.31 2 16 2z" /><path d="M16 4.67V6c1.11 0 1.99.89 2 1.99h1.33c-.01-1.84-1.49-3.32-3.33-3.32z" /><path d="M14.98 10.01c-.13-.09-.26-.18-.39-.26.14.08.27.17.39.26z" opacity=".3" /><path d="M17 9c0-.37-.11-.71-.28-1.01-.18-.3-.43-.55-.73-.72C15.7 7.1 15.36 7 15 7V6H9.88L8.05 8H4v12h16V9h-3zm-5 10c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z" opacity=".3" /><path d="M12 9c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0 8c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z" /></g></React.Fragment> , 'LinkedCameraTwoTone');
src/svg-icons/notification/confirmation-number.js
pradel/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NotificationConfirmationNumber = (props) => ( <SvgIcon {...props}> <path d="M22 10V6c0-1.11-.9-2-2-2H4c-1.1 0-1.99.89-1.99 2v4c1.1 0 1.99.9 1.99 2s-.89 2-2 2v4c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-4c-1.1 0-2-.9-2-2s.9-2 2-2zm-9 7.5h-2v-2h2v2zm0-4.5h-2v-2h2v2zm0-4.5h-2v-2h2v2z"/> </SvgIcon> ); NotificationConfirmationNumber = pure(NotificationConfirmationNumber); NotificationConfirmationNumber.displayName = 'NotificationConfirmationNumber'; export default NotificationConfirmationNumber;
ajax/libs/react/0.6.3/react.min.js
ColinEberhardt/cdnjs
// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. !function(e,t){function i(){this._events=new Object}function s(e){e&&(e.delimiter&&(this.delimiter=e.delimiter),e.wildcard&&(this.wildcard=e.wildcard),this.wildcard&&(this.listenerTree=new Object))}function o(e){this._events=new Object,s.call(this,e)}function u(e,t,n,r){if(!n)return[];var i=[],s,o,a,f,l,c,h,p=t.length,d=t[r],v=t[r+1];if(r===p&&n._listeners){if(typeof n._listeners=="function")return e&&e.push(n._listeners),[n];for(s=0,o=n._listeners.length;s<o;s++)e&&e.push(n._listeners[s]);return[n]}if(d==="*"||d==="**"||n[d]){if(d==="*"){for(a in n)a!=="_listeners"&&n.hasOwnProperty(a)&&(i=i.concat(u(e,t,n[a],r+1)));return i}if(d==="**"){h=r+1===p||r+2===p&&v==="*",h&&n._listeners&&(i=i.concat(u(e,t,n,p)));for(a in n)a!=="_listeners"&&n.hasOwnProperty(a)&&(a==="*"||a==="**"?(n[a]._listeners&&!h&&(i=i.concat(u(e,t,n[a],p))),i=i.concat(u(e,t,n[a],r))):a===v?i=i.concat(u(e,t,n[a],r+2)):i=i.concat(u(e,t,n[a],r)));return i}i=i.concat(u(e,t,n[d],r+1))}f=n["*"],f&&u(e,t,f,r+1),l=n["**"];if(l)if(r<p){l._listeners&&u(e,t,l,p);for(a in l)a!=="_listeners"&&l.hasOwnProperty(a)&&(a===v?u(e,t,l[a],r+2):a===d?u(e,t,l[a],r+1):(c={},c[a]=l[a],u(e,t,{"**":c},r+1)))}else l._listeners?u(e,t,l,p):l["*"]&&l["*"]._listeners&&u(e,t,l["*"],p);return i}function a(e,t){e=typeof e=="string"?e.split(this.delimiter):e.slice();for(var i=0,s=e.length;i+1<s;i++)if(e[i]==="**"&&e[i+1]==="**")return;var o=this.listenerTree,u=e.shift();while(u){o[u]||(o[u]=new Object),o=o[u];if(e.length===0){if(!o._listeners)o._listeners=t;else if(typeof o._listeners=="function")o._listeners=[o._listeners,t];else if(n(o._listeners)){o._listeners.push(t);if(!o._listeners.warned){var a=r;typeof this._events.maxListeners!="undefined"&&(a=this._events.maxListeners),a>0&&o._listeners.length>a&&(o._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",o._listeners.length),console.trace())}}return!0}u=e.shift()}return!0}var n=Array.isArray?Array.isArray:function(t){return Object.prototype.toString.call(t)==="[object Array]"},r=10;o.prototype.delimiter=".",o.prototype.setMaxListeners=function(e){this._events||i.call(this),this._events.maxListeners=e},o.prototype.event="",o.prototype.once=function(e,t){return this.many(e,1,t),this},o.prototype.many=function(e,t,n){function i(){--t===0&&r.off(e,i),n.apply(this,arguments)}var r=this;if(typeof n!="function")throw new Error("many only accepts instances of Function");return i._origin=n,this.on(e,i),r},o.prototype.emit=function(){this._events||i.call(this);var e=arguments[0];if(e==="newListener"&&!this._events.newListener)return!1;if(this._all){var t=arguments.length,n=new Array(t-1);for(var r=1;r<t;r++)n[r-1]=arguments[r];for(r=0,t=this._all.length;r<t;r++)this.event=e,this._all[r].apply(this,n)}if(e==="error"&&!this._all&&!this._events.error&&(!this.wildcard||!this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var s;if(this.wildcard){s=[];var o=typeof e=="string"?e.split(this.delimiter):e.slice();u.call(this,s,o,this.listenerTree,0)}else s=this._events[e];if(typeof s=="function"){this.event=e;if(arguments.length===1)s.call(this);else if(arguments.length>1)switch(arguments.length){case 2:s.call(this,arguments[1]);break;case 3:s.call(this,arguments[1],arguments[2]);break;default:var t=arguments.length,n=new Array(t-1);for(var r=1;r<t;r++)n[r-1]=arguments[r];s.apply(this,n)}return!0}if(s){var t=arguments.length,n=new Array(t-1);for(var r=1;r<t;r++)n[r-1]=arguments[r];var a=s.slice();for(var r=0,t=a.length;r<t;r++)this.event=e,a[r].apply(this,n);return a.length>0||this._all}return this._all},o.prototype.on=function(e,t){if(typeof e=="function")return this.onAny(e),this;if(typeof t!="function")throw new Error("on only accepts instances of Function");this._events||i.call(this),this.emit("newListener",e,t);if(this.wildcard)return a.call(this,e,t),this;if(!this._events[e])this._events[e]=t;else if(typeof this._events[e]=="function")this._events[e]=[this._events[e],t];else if(n(this._events[e])){this._events[e].push(t);if(!this._events[e].warned){var s=r;typeof this._events.maxListeners!="undefined"&&(s=this._events.maxListeners),s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}}return this},o.prototype.onAny=function(e){this._all||(this._all=[]);if(typeof e!="function")throw new Error("onAny only accepts instances of Function");return this._all.push(e),this},o.prototype.addListener=o.prototype.on,o.prototype.off=function(e,t){if(typeof t!="function")throw new Error("removeListener only takes instances of Function");var r,i=[];if(this.wildcard){var s=typeof e=="string"?e.split(this.delimiter):e.slice();i=u.call(this,null,s,this.listenerTree,0)}else{if(!this._events[e])return this;r=this._events[e],i.push({_listeners:r})}for(var o=0;o<i.length;o++){var a=i[o];r=a._listeners;if(n(r)){var f=-1;for(var l=0,c=r.length;l<c;l++)if(r[l]===t||r[l].listener&&r[l].listener===t||r[l]._origin&&r[l]._origin===t){f=l;break}if(f<0)return this;this.wildcard?a._listeners.splice(f,1):this._events[e].splice(f,1),r.length===0&&(this.wildcard?delete a._listeners:delete this._events[e])}else if(r===t||r.listener&&r.listener===t||r._origin&&r._origin===t)this.wildcard?delete a._listeners:delete this._events[e]}return this},o.prototype.offAny=function(e){var t=0,n=0,r;if(e&&this._all&&this._all.length>0){r=this._all;for(t=0,n=r.length;t<n;t++)if(e===r[t])return r.splice(t,1),this}else this._all=[];return this},o.prototype.removeListener=o.prototype.off,o.prototype.removeAllListeners=function(e){if(arguments.length===0)return!this._events||i.call(this),this;if(this.wildcard){var t=typeof e=="string"?e.split(this.delimiter):e.slice(),n=u.call(this,null,t,this.listenerTree,0);for(var r=0;r<n.length;r++){var s=n[r];s._listeners=null}}else{if(!this._events[e])return this;this._events[e]=null}return this},o.prototype.listeners=function(e){if(this.wildcard){var t=[],r=typeof e=="string"?e.split(this.delimiter):e.slice();return u.call(this,t,r,this.listenerTree,0),t}return this._events||i.call(this),this._events[e]||(this._events[e]=[]),n(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]},o.prototype.listenersAny=function(){return this._all?this._all:[]},typeof define=="function"&&define.amd?define("eventemitter2",[],function(){return o}):e.EventEmitter2=o}(typeof process!="undefined"&&typeof process.title!="undefined"&&typeof exports!="undefined"?exports:window),define("react/eventemitter",["eventemitter2"],function(e){var t=e?e.EventEmitter2?e.EventEmitter2:e:EventEmitter2;return t}),define("util",["require","exports","module"],function(e,t,n){function s(e,t,n,r){var i={showHidden:t,seen:[],stylize:r?a:f};return l(i,e,typeof n=="undefined"?2:n)}function a(e,t){var n=u[t];return n?"["+o[n][0]+"m"+e+"["+o[n][1]+"m":e}function f(e,t){return e}function l(e,n,r){if(n&&typeof n.inspect=="function"&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n))return n.inspect(r);var i=c(e,n);if(i)return i;var s=Object.keys(n),o=e.showHidden?Object.getOwnPropertyNames(n):s;if(o.length===0){if(typeof n=="function"){var u=n.name?": "+n.name:"";return e.stylize("[Function"+u+"]","special")}if(g(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(y(n))return e.stylize(Date.prototype.toString.call(n),"date");if(b(n))return h(n)}var a="",f=!1,l=["{","}"];m(n)&&(f=!0,l=["[","]"]);if(typeof n=="function"){var w=n.name?": "+n.name:"";a=" [Function"+w+"]"}g(n)&&(a=" "+RegExp.prototype.toString.call(n)),y(n)&&(a=" "+Date.prototype.toUTCString.call(n)),b(n)&&(a=" "+h(n));if(o.length!==0||!!f&&n.length!==0){if(r<0)return g(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var E;return f?E=p(e,n,r,s,o):E=o.map(function(t){return d(e,n,r,s,t,f)}),e.seen.pop(),v(E,a,l)}return l[0]+a+l[1]}function c(e,t){switch(typeof t){case"undefined":return e.stylize("undefined","undefined");case"string":var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string");case"number":return e.stylize(""+t,"number");case"boolean":return e.stylize(""+t,"boolean")}if(t===null)return e.stylize("null","null")}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i){var s=[];for(var o=0,u=t.length;o<u;++o)Object.prototype.hasOwnProperty.call(t,String(o))?s.push(d(e,t,n,r,String(o),!0)):s.push("");return i.forEach(function(i){i.match(/^\d+$/)||s.push(d(e,t,n,r,i,!0))}),s}function d(e,t,n,r,i,s){var o,u,a;a=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},a.get?a.set?u=e.stylize("[Getter/Setter]","special"):u=e.stylize("[Getter]","special"):a.set&&(u=e.stylize("[Setter]","special")),r.indexOf(i)<0&&(o="["+i+"]"),u||(e.seen.indexOf(a.value)<0?(n===null?u=l(e,a.value,null):u=l(e,a.value,n-1),u.indexOf("\n")>-1&&(s?u=u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):u="\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special"));if(typeof o=="undefined"){if(s&&i.match(/^\d+$/))return u;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+u}function v(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.length+1},0);return i>60?n[0]+(t===""?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function m(e){return Array.isArray(e)||typeof e=="object"&&w(e)==="[object Array]"}function g(e){return typeof e=="object"&&w(e)==="[object RegExp]"}function y(e){return typeof e=="object"&&w(e)==="[object Date]"}function b(e){return typeof e=="object"&&w(e)==="[object Error]"}function w(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}function x(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":");return[e.getDate(),S[e.getMonth()],t].join(" ")}var r=/%[sdj%]/g;t.format=function(e){if(typeof e!="string"){var t=[];for(var n=0;n<arguments.length;n++)t.push(s(arguments[n]));return t.join(" ")}var i=1,o=arguments,u=o.length,a=String(e).replace(r,function(e){if(e==="%%")return"%";if(i>=u)return e;switch(e){case"%s":return String(o[i++]);case"%d":return Number(o[i++]);case"%j":return JSON.stringify(o[i++]);default:return e}});for(var f=o[i];i<u;f=o[++i])f===null||typeof f!="object"?a+=" "+f:a+=" "+s(f);return a},t.print=function(){for(var e=0,t=arguments.length;e<t;++e)process.stdout.write(String(arguments[e]))},t.puts=function(){for(var e=0,t=arguments.length;e<t;++e)process.stdout.write(arguments[e]+"\n")},t.debug=function(e){process.stderr.write("DEBUG: "+e+"\n")};var i=t.error=function(e){for(var t=0,n=arguments.length;t<n;++t)process.stderr.write(arguments[t]+"\n")};t.inspect=s;var o={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u={special:"cyan",number:"yellow","boolean":"yellow","undefined":"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};t.isArray=m,t.isRegExp=g,t.isDate=y,t.isError=b;var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(e){t.puts(x()+" - "+e.toString())},t.pump=function(e,t,n){function i(e,t,i){n&&!r&&(n(e,t,i),r=!0)}var r=!1;e.addListener("data",function(n){t.write(n)===!1&&e.pause()}),t.addListener("drain",function(){e.resume()}),e.addListener("end",function(){t.end()}),e.addListener("close",function(){i()}),e.addListener("error",function(e){t.end(),i(e)}),t.addListener("error",function(t){e.destroy(),i(t)})},t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t._extend=function(e,t){if(!t)return e;var n=Object.keys(t),r=n.length;while(r--)e[n[r]]=t[n[r]];return e}}),define("react/error",["util"],function(e){function t(e){if(!Error.stackTraceLimit||Error.stackTraceLimit<e)Error.stackTraceLimit=e}function n(e){return e?e&&e.name?e.name:e:"undefined"}function r(t){if(!t.meta)return;var r=t.meta.vcon,i=t.meta.task,s="\n\n";return i&&i.f&&i.a&&(s+="Error occurs in Task function: "+n(i.f)+"("+i.a.join(",")+")\n\n"),r&&(s+="Variable Context: \n",s+=e.inspect(r),s+="\n\n"),i&&i.f&&(s+="Task Source:\n\n",s+=i.f.toString(),s+="\n\n"),s}function i(e,t){typeof e=="string"&&(e=new Error(e));var n=e.toString();return e.meta=t,e.toString=function(){return n+r(e)},e}return{ensureStackTraceLimitSet:t,augmentError:i}}),define("react/sprintf",["util"],function(e){var t=e.format;return t}),function(e,t){typeof exports=="object"?module.exports=t():typeof define=="function"&&define.amd?define("ensure-array",[],t):e.ensureArray=t()}(this,function(){function e(e,t,n){if(arguments.length===0)return[];if(arguments.length===1){if(e===undefined||e===null)return[];if(Array.isArray(e))return e}return Array.prototype.slice.call(arguments)}return e}),define("react/status",[],function(){var e={READY:"ready",RUNNING:"running",ERRORED:"errored",COMPLETE:"complete"};return e}),define("react/event-manager",["./eventemitter"],function(e){function i(){}var t={wildcard:!0,delimiter:".",maxListeners:30},n=/^ast.defined$/,r={AST_DEFINED:"ast.defined",FLOW_BEGIN:"flow.begin",TASK_BEGIN:"task.begin",TASK_COMPLETE:"task.complete",TASK_ERRORED:"task.errored",FLOW_COMPLETE:"flow.complete",FLOW_ERRORED:"flow.errored",EXEC_FLOW_START:"exec.flow.start",EXEC_INPUT_PREPROCESS:"exec.input.preprocess",EXEC_TASKS_PRECREATE:"exec.tasks.precreate",EXEC_OUTTASK_CREATE:"exec.outTask.create",EXEC_TASK_START:"exec.task.start",EXEC_TASK_COMPLETE:"exec.task.complete",EXEC_TASK_ERRORED:"exec.task.errored",EXEC_FLOW_COMPLETE:"exec.flow.complete",EXEC_FLOW_ERRORED:"exec.flow.errored"};return i.create=function(){return new i},i.TYPES=r,i.prototype.TYPES=r,i.prototype.isEnabled=function(){return!!(this.emitter||this.parent&&this.parent.isEnabled())},i.prototype.on=function(n,r){this.emitter||(this.emitter=new e(t)),n==="*"?this.emitter.onAny(r):this.emitter.on(n,r)},i.prototype.emit=function(e,t,r,i){if(e===undefined)throw new Error("event is undefined");this.emitter&&this.emitter.emit.apply(this.emitter,arguments),this.parent&&this.parent.isEnabled()&&this.parent.emit.apply(this.parent,arguments),n.test(e)&&typeof process!="undefined"&&process.emit&&process.emit.apply(process,arguments)},i.prototype.removeListener=function(e,t){this.emitter&&this.emitter.removeListener.apply(this.emitter,arguments)},i.prototype.removeAllListeners=function(e){this.emitter&&this.emitter.removeAllListeners.apply(this.emitter,arguments)},i.global=i.create(),i}),define("react/base-task",["ensure-array","./status","./event-manager"],function(e,t,n){function r(){}function i(e){return e.indexOf(".")!==-1}return r.prototype.getOutParams=function(){return e(this.out)},r.prototype.isComplete=function(){return this.status===t.COMPLETE},r.prototype.start=function(e){this.args=e,this.env.currentTask=this,this.env.flowEmitter.emit(n.TYPES.EXEC_TASK_START,this)},r.prototype.complete=function(e){this.status=t.COMPLETE,this.results=e,this.env.currentTask=this,this.env.flowEmitter.emit(n.TYPES.EXEC_TASK_COMPLETE,this)},r.prototype.functionExists=function(e){var t=this.f;if(!t)return!1;if(t instanceof Function)return!0;if(typeof t=="string"){var n=e.getVar(t);if(n&&n instanceof Function)return!0}return!1},r.prototype.areAllDepArgsDefined=function(e){return this.a.every(function(t){return e.getVar(t)!==undefined})},r.prototype.depTasksAreDone=function(e){return!this.after||!this.after.length||this.after.every(function(t){return e[t].isComplete()})},r.prototype.parentExists=function(e,t){if(!i(e))return!0;var n=e.split(".");n.pop();var r=n.reduce(function(e,t){return e===undefined||e===null?undefined:e[t]},t.values);return r!==undefined&&r!==null},r.prototype.outParentsExist=function(e){var t=this;return this.getOutParams().every(function(n){return n===null?!0:t.parentExists(n,e)})},r.prototype.isReady=function(e,t){return!this.status&&this.functionExists(e)&&this.areAllDepArgsDefined(e)&&this.depTasksAreDone(t)&&(!this.outParentsExist||this.outParentsExist(e))},r.prototype.isMethodCall=function(){return typeof this.f=="string"&&/^.*\..*$/.test(this.f)},r.prototype.getMethodObj=function(e){var t=this.f;if(!t)return undefined;var n=t.split(".");n.pop();if(!n.length)return undefined;var r=n.reduce(function(e,t){return e===undefined||e===null?undefined:e[t]},e.values);return r},r}),define("react/cb-task",["util","./sprintf","./base-task"],function(e,t,n){function r(n,r){return t("%s - %s",n,e.inspect(r))}function a(e){var t=this;Object.keys(e).forEach(function(n){t[n]=e[n]})}var i="cbTask requires f, a, out",s="cbTask requires f to be a function or string",o="cbTask requires a to be an array of string param names",u="cbTask requires out to be an array of string param names";return a.prototype=new n,a.prototype.constructor=a,a.validate=function(e){var t=[];if(!e.f||!e.a||!e.out)t.push(r(i,e));else{var n=typeof e.f;e.f instanceof Function||n==="string"||t.push(r(s,e)),(!Array.isArray(e.a)||!e.a.every(function(e){return typeof e=="string"}))&&t.push(r(o,e)),(!Array.isArray(e.out)||!e.out.every(function(e){return typeof e=="string"}))&&t.push(r(u,e))}return t},a.prototype.prepare=function(t,n,r){var i=this;this.cbFun=function(e,s,o,u){var a=Array.prototype.slice.call(arguments,1);if(e){t(i,e);return}n.saveResults(i.out,a),i.complete(a),r()}},a.prototype.exec=function(t,n,r){try{var i=this.a.map(function(e){return t.getVar(e)});this.start(i),i.push(this.cbFun);var s=this.f,o=t.getVar("this");this.isMethodCall()?(s=t.getVar(this.f),o=this.getMethodObj(t)):typeof s=="string"&&(s=t.getVar(s)),s.apply(o,i)}catch(u){n(this,u)}},a}),define("react/promise-task",["util","./sprintf","./base-task"],function(e,t,n){function r(n,r){return t("%s - %s",n,e.inspect(r))}function a(e){var t=this;Object.keys(e).forEach(function(n){t[n]=e[n]})}var i="promiseTask requires f, a, out",s="promiseTask requires f to be a function or string",o="promiseTask requires a to be an array of string param names",u="promiseTask requires out to be an array[1] of string param names";return a.prototype=new n,a.prototype.constructor=a,a.validate=function(e){var t=[];if(!e.f||!e.a||!e.out)t.push(r(i,e));else{var n=typeof e.f;e.f instanceof Function||n==="string"||t.push(r(s,e)),(!Array.isArray(e.a)||!e.a.every(function(e){return typeof e=="string"}))&&t.push(r(o,e)),Array.isArray(e.out)&&e.out.length<=1&&e.out.every(function(e){return typeof e=="string"})||t.push(r(u,e))}return t},a.prototype.prepare=function(t,n,r){var i=this;this.nextFn=function(e){var t=Array.prototype.slice.call(arguments);n.saveResults(i.out,t),i.complete(t),r()},this.failFn=function(e){t(i,e)}},a.prototype.exec=function(t,n,r){try{var i=this.a.map(function(e){return t.getVar(e)});this.start(i);var s=this.f,o=t.getVar("this");this.isMethodCall()?(s=t.getVar(this.f),o=this.getMethodObj(t)):typeof s=="string"&&(s=t.getVar(s));var u=s.apply(o,i);u&&typeof u.then=="function"?u.then(this.nextFn,this.failFn):this.nextFn(u)}catch(a){n(this,a)}},a}),define("react/ret-task",["util","./sprintf","./base-task"],function(e,t,n){function r(n,r){return t("%s - %s",n,e.inspect(r))}function a(e){var t=this;Object.keys(e).forEach(function(n){t[n]=e[n]})}var i="retTask requires f, a, out",s="retTask requires f to be a function or string",o="retTask requires a to be an array of string param names",u="retTask requires out to be an array with single string param name or []";return a.prototype=new n,a.prototype.constructor=a,a.validate=function(e){var t=[];if(!e.f||!e.a||!e.out)t.push(r(i,e));else{var n=typeof e.f;e.f instanceof Function||n==="string"||t.push(r(s,e)),(!Array.isArray(e.a)||!e.a.every(function(e){return typeof e=="string"}))&&t.push(r(o,e)),(!Array.isArray(e.out)||!(e.out.length===0||e.out.length===1&&typeof (e.out[0]==="string")))&&t.push(r(u,e))}return t},a.prototype.exec=function(t,n,r){try{var i=this.a.map(function(e){return t.getVar(e)});this.start(i);var s=this.f,o=t.getVar("this");this.isMethodCall()?(s=t.getVar(this.f),o=this.getMethodObj(t)):typeof s=="string"&&(s=t.getVar(s));var u=[s.apply(o,i)];t.saveResults(this.out,u),this.complete(u),r()}catch(a){n(this,a)}},a}),define("react/when-task",["util","./sprintf","./base-task"],function(e,t,n){function r(n,r){return t("%s - %s",n,e.inspect(r))}function u(e){var t=this;Object.keys(e).forEach(function(n){t[n]=e[n]})}var i="whenTask requires a, out",s="whenTask requires a to be an array[1] of string param names",o="whenTask requires out to be an array[1] of string param names";return u.prototype=new n,u.prototype.constructor=u,u.prototype.f=function(){},u.validate=function(e){var t=[];return!e.a||!e.out?t.push(r(i,e)):((!Array.isArray(e.a)||e.a.length!==1||!e.a.every(function(e){return typeof e=="string"}))&&t.push(r(s,e)),Array.isArray(e.out)&&e.out.length<=1&&e.out.every(function(e){return typeof e=="string"})||t.push(r(o,e))),t},u.prototype.prepare=function(t,n,r){var i=this;this.nextFn=function(e){var t=Array.prototype.slice.call(arguments);n.saveResults(i.out,t),i.complete(t),r()},this.failFn=function(e){t(i,e)}},u.prototype.exec=function(t,n,r){try{var i=this.a.map(function(e){return t.getVar(e)});this.start(i);var s=i[0];s&&typeof s.then=="function"?s.then(this.nextFn,this.failFn):this.nextFn(s)}catch(o){n(this,o)}},u}),define("react/finalcb-task",["./sprintf","util","./status","./event-manager"],function(e,t,n,r){function s(e){var t=e.taskDef;if(typeof e.cbFunc!="function")throw new Error("callback is not a function");var n=this;for(var r in t)n[r]=t[r];this.f=e.cbFunc,this.tasks=e.tasks,this.vCon=e.vCon,this.retValue=e.retValue,this.execOptions=e.execOptions,this.env=e.env}function o(n,r){return e("%s - %s",n,t.inspect(r))}var i="ast.outTask.a should be an array of string param names";return s.validate=function(e){var t=[];return(!Array.isArray(e.a)||!e.a.every(function(e){return typeof e=="string"}))&&t.push(o(i,e)),t},s.prototype.isReady=function(){return this.tasks.every(function(e){return e.status===n.COMPLETE})},s.prototype.exec=function(e){if(!this.f)return;if(e)this.env.error=e,this.env.flowEmitter.emit(r.TYPES.EXEC_FLOW_ERRORED,this.env),this.f.call(null,e);else{var t=this.vCon,n=this.a.map(function(e){return t.getVar(e)});n.unshift(null),this.env.results=n,this.env.flowEmitter.emit(r.TYPES.EXEC_FLOW_COMPLETE,this.env),this.f.apply(null,n)}this.f=null},s}),define("react/vcon",[],function(){function t(){}var e=":LAST_RESULTS";return t.prototype.getLastResults=function(){return this.getVar(e)},t.prototype.setLastResults=function(t){this.setVar(e,t)},t.prototype.getVar=function(e){var t=this.values;if(typeof e!="string")return e;e=e.trim();if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(/^-?[0-9]+$/.test(e))return parseInt(e,10);if(/^-?[0-9.]+$/.test(e))return parseFloat(e);var n=/^("|')([^\1]*)\1$/.exec(e);if(n)return n[2];var r=e.split(".");return r.reduce(function(e,t){return e===undefined||e===null?undefined:e[t]},t)},t.prototype.saveResults=function(e,t){var n=this;e.forEach(function(e,r){n.setVar(e,t[r]!==undefined?t[r]:null)}),this.setLastResults(t)},t.prototype.setVar=function(e,t){if(!e)return;var n=this.values,r=e.split("."),i=r.pop(),s=r.reduce(function(e,t){var n=e[t];if(n===undefined||n===null)n=e[t]={};return n},n);s[i]=t},t.create=function(e,n,r,i){var s={};i&&(s["this"]=i),r&&Object.keys(r).forEach(function(e){s[e]=r[e]});var o=new t;return o.values=e.reduce(function(e,t,r){var i=n[r];return i&&(e[i]=t!==undefined?t:null),e},s),o},t}),define("react/finalcb-first-task",["./sprintf","util","./status","./vcon","./event-manager"],function(e,t,n,r,i){function o(e){var t=e.taskDef;if(typeof e.cbFunc!="function")throw new Error("callback is not a function");var n=this;for(var r in t)n[r]=t[r];this.f=e.cbFunc,this.tasks=e.tasks,this.vCon=e.vCon,this.retValue=e.retValue,this.env=e.env}function u(n,r){return e("%s - %s",n,t.inspect(r))}var s="ast.outTask.a should be an array of string param names";return o.validate=function(e){var t=[];return(!Array.isArray(e.a)||!e.a.every(function(e){return typeof e=="string"}))&&t.push(u(s,e)),t},o.prototype.isReady=function(){var e=this.vCon.getLastResults();return e?e.some(function(e){return e!==undefined&&e!==null}):!1},o.prototype.exec=function(e){if(!this.f)return;if(e)this.env.error=e,this.env.flowEmitter.emit(i.TYPES.EXEC_FLOW_ERRORED,this.env),this.f.call(null,e);else{var t=this.vCon,n=this.a.map(function(e){return t.getVar(e)});n.unshift(null),this.env.results=n,this.env.flowEmitter.emit(i.TYPES.EXEC_FLOW_COMPLETE,this.env),this.f.apply(null,n)}this.f=null},o}),define("react/task",["util","./sprintf","ensure-array","./cb-task","./promise-task","./ret-task","./when-task","./finalcb-task","./finalcb-first-task","./status","./error","./vcon","./event-manager"],function(e,t,n,r,i,s,o,u,a,f,l,c,h){function v(){return Object.keys(p)}function g(){return Object.keys(m)}function S(n,r){return t("%s - %s",n,e.inspect(r))}function x(e){return e.type?e:(e.type="cb",e)}function T(e){e.type||(e.type=Object.keys(m)[0])}function N(e){if(!e.after)return;var t=n(e.after);t=t.map(function(e){return typeof e=="function"?e.name:e}),e.after=t}function C(e){if(!e||typeof e!="object")return[S(b,e)];x(e),N(e);var t=[];return t=t.concat(k(e)),t=t.concat(L(e)),t}function k(e){var t=[];return Object.keys(p).some(function(t){return e.type===t})||t.push(S(E,e)),t}function L(e){var t=[],n=p[e.type];return n&&(t=t.concat(n.validate(e))),t}function A(e){var t=[];T(e);var n=m[e.type];return t=t.concat(n.validate(e)),t}function O(e,n,r){function s(){}var i=[],o=e.map(function(e){return s}),u=c.create(o,e,r),a=n.map(D),f=a.filter(function(e){return e.type!=="when"});return f.forEach(function(e,n){if(!e.functionExists(u))if(!e.isMethodCall())i.push(t(y,e.f,n));else{var r=e.getMethodObj(u);r&&r!==s&&i.push(t(y,e.f,n))}}),i}function M(e){return typeof e=="function"?e.name:e?e:""}function _(e){var n=e.reduce(function(e,t){return t.name&&(e[t.name]=t),e},{});return e.forEach(function(e,r){if(!e.name){var i=M(e.f);i||(i=t(d,r));if(!i||n[i])i=t("%s_%s",i,r);e.name=i,n[i]=e}}),n}function D(e){var t=p[e.type];return new t(e)}function P(e,t,n,r,i,s){T(e);var o={taskDef:e,cbFunc:t,tasks:n,vCon:r,execOptions:i,env:s,TaskConstructor:m[e.type]};h.global.emit(h.TYPES.EXEC_OUTTASK_CREATE,o);var u=o.TaskConstructor;return new u(o)}function H(e,t){return function(r,i){r.status=f.ERRORED,r.error=i,t.env.currentTask=r,t.env.flowEmitter.emit(h.TYPES.EXEC_TASK_ERRORED,r);var s=l.augmentError(i,{task:r,vcon:e});t.exec(s)}}function B(e,t,n){return t.filter(function(t){return t.isReady(e,n)})}function j(e,t,n,r){e.forEach(function(e){e.status=f.READY}),e.forEach(function(e){e.exec(t,n,r)})}function F(e,n,r,i){var s=n.filter(function(e){return e.status===f.RUNNING||e.status===f.READY});if(!s.length){var o=n.filter(function(e){return!e.status}),u=o.map(function(e){return e.name}),a=t(w,u.join(", ")),l={env:i};r(l,new Error(a))}}function I(e,t,n,r,i,s){var o=B(e,t,n);o.length||F(e,t,r,s),j(o,e,r,i)}function q(e){return _(e),e.forEach(function(e,t,n){t!==0&&(e.after=[n[t-1].name])}),e}var p={cb:r,ret:s,promise:i,when:o},d="task_%s",m={finalcb:u,finalcbFirst:a},y="function: %s not found in locals or input params - task[%s]",b="task must be an object",w="no tasks running, flow will not complete, remaining tasks: %s",E="task.type should match one of "+Object.keys(p).join(", ");return{serializeTasks:q,TASK_TYPES:p,taskTypeKeys:v,OUT_TASK_TYPES:m,outTaskTypeKeys:g,setMissingType:x,validate:C,validateOutTask:A,validateLocalFunctions:O,nameTasks:_,create:D,createOutTask:P,createErrorHandler:H,findReadyAndExec:I}}),define("react/validate",["util","./sprintf","ensure-array","./task"],function(e,t,n,r){function h(n,r){return t("%s - %s",n,e.inspect(r))}function p(e){return c.test(e)}function d(e){if(!e||!e.inParams||!e.tasks||!e.outTask)return[i];var t=[];return t=t.concat(v(e.inParams)),t=t.concat(m(e.tasks)),t=t.concat(g(e.tasks)),t=t.concat(r.validateOutTask(e.outTask)),t=t.concat(y(e.locals)),t.length===0&&(e.outTask.type!=="finalcbFirst"&&(t=t.concat(w(e.tasks))),t=t.concat(r.validateLocalFunctions(e.inParams,e.tasks,e.locals)),t=t.concat(E(e))),t}function v(e){return!Array.isArray(e)||!e.every(function(e){return typeof e=="string"})?[s]:[]}function m(e){if(!Array.isArray(e))return[o];var t=[];return e.forEach(function(e){t=t.concat(r.validate(e))}),t}function g(e){if(!Array.isArray(e))return[];var n=[],r=e.filter(function(e){return e.name}),i=r.map(function(e){return e.name});return i.reduce(function(e,r){return e[r]?n.push(t("%s %s",u,r)):e[r]=!0,e},{}),n}function y(e){var t=[];return e===null&&t.push(a),t}function b(e){return n(e.out)}function w(e){var n=[];return e.reduce(function(e,r){return b(r).forEach(function(r){e[r]!==undefined?n.push(t("%s: %s",f,r)):e[r]=!0}),e},{}),n}function E(e){var n=[],r={};return e.locals&&(r=Object.keys(e.locals).reduce(function(e,t){return e[t]=!0,e},r)),e.inParams.reduce(function(e,t){return e[t]=!0,e},r),e.tasks.reduce(function(e,t){return t.out.reduce(function(e,t){return e[t]=!0,e},e)},r),e.tasks.reduce(function(e,n){return n.a.reduce(function(e,n){return!p(n)&&!r[n]&&e.push(t(l,n)),e},e)},n),e.outTask.a.reduce(function(e,n){return!p(n)&&!r[n]&&e.push(t(l,n)),e},n),n}var i="ast must be an object with inParams, tasks, and outTask",s="ast.inParams must be an array of strings",o="ast.tasks must be an array of tasks",u="ast.tasks that specify name need to be unique, duplicate:",a="ast.locals should not be null",f="multiple tasks output the same param, must be unique. param",l="missing or mispelled variable referenced in flow definition: %s",c=/^(true|false|this|null|\-?[0-9\.]+)$|'|"|\./i;return d}),define("react/input-parser",["./event-manager"],function(e){function r(e){return e&&e.reactExecOptions}function i(e){return r(e)}function s(e){return!r(e)}function o(e,t){return Object.keys(t).forEach(function(n){e[n]=t[n]}),e}function u(e,t,r){var i={};return i.args=t.map(function(t){return e.shift()}),r===n.CALLBACK&&e.length&&(i.cb=e.shift()),i.extra=e,i}function a(n,r){var a={},f=n.filter(i);f.unshift(t),a.options=f.reduce(o,{});var l=n.filter(s),c=u(l,r.inParams,a.options.outputStyle);return a.args=c.args,a.cb=c.cb,c.outputStyle&&(a.options.outputStyle=c.outputStyle),c.extra&&(a.extraArgs=c.extra),e.global.emit(e.TYPES.EXEC_INPUT_PREPROCESS,a),a}var t={reactExecOptions:!0,outputStyle:"cb"},n={CALLBACK:"cb",NONE:"none"};return a.defaultExecOptions=t,a}),define("react/id",[],function(){function t(){return e+=1,e===Number.MAX_VALUE&&(e=0),e}var e=0;return{createUniqueId:t}}),define("react/core",["./eventemitter","./error","./validate","./task","./status","./vcon","./event-manager","./input-parser","./id","./sprintf"],function(e,t,n,r,i,s,o,u,a,f){function h(e){return Object.keys(l).reduce(function(e,t){return e[t]||(e[t]=l[t]),e},e)}function p(){return f("flow_%s",a.createUniqueId())}function d(){function f(t){Object.keys(t).forEach(function(e){i[e]=t[e]});var s=n(i);return s.length||(i.name||(i.name=p()),r.nameTasks(i.tasks)),Object.freeze&&(Object.keys(t).forEach(function(e){typeof t[e]=="object"&&Object.freeze(t[e])}),Object.freeze(t)),e.emit(o.TYPES.AST_DEFINED,i),s}function d(t,n,f,l){function E(){if(!b.f)return;if(b.isReady())return b.exec();r.findReadyAndExec(m,g,y,w,E,d)}var p=Array.prototype.slice.call(arguments),d={execId:a.createUniqueId(),args:p,ast:i,flowEmitter:e};d.name=i.name||d.execId,e.emit(o.TYPES.EXEC_FLOW_START,d);var v=u(p,i),m=s.create(v.args,i.inParams,i.locals,this);d.parsedInput=v,d.options=h(v.options),d.vCon=m,d.taskDefs=i.tasks.slice(),d.outTaskDef=Object.create(i.outTask),c.emit(o.TYPES.EXEC_TASKS_PRECREATE,d);var g=d.taskDefs.map(r.create),y=r.nameTasks(g),b=r.createOutTask(d.outTaskDef,v.cb,g,m,d.options,d),w=r.createErrorHandler(m,b);return g.forEach(function(t){t.id=a.createUniqueId(),t.env=d,t.prepare&&t.prepare(w,m,E,e)}),E(),b.retValue}if(arguments.length)throw new Error("react() takes no args, check API");t.ensureStackTraceLimitSet(l.stackTraceLimitMin);var e=o.create();e.parent=c;var i={name:undefined,inParams:[],tasks:[],outTask:{},locals:{}},v=d;return v.ast=i,v.setAndValidateAST=f,v.events=e,v}var l={stackTraceLimitMin:30},c=o.global;return d.options=l,d.events=c,d}),define("react/parse",["./sprintf"],function(e){function t(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e}):[]}function n(e,t){if(typeof e!="string")return e;var n=t.regex?t.regex.exec(e):e.split(t.splitStr);return n?t.fn(n,e):e}function r(t,r,i){var s=r.reduce(n,t);if(typeof s!="string")return s;throw new Error(e(i,t))}return{splitTrimFilterArgs:t,parseStr:r}}),define("react/dsl",["./sprintf","./core","./parse","./task"],function(e,t,n,r){function h(e){return e.length&&e[e.length-1].match(l)&&e.pop(),e}function p(e){return e.length&&e[0].match(c)&&e.shift(),e}function v(e){var t=n.parseStr(e,[d],s);return t.inDef=h(t.inDef),t}function m(t){var n=[],r,i,s;while(t.length>=2){i={},r=t.shift(),s=v(t.shift()),typeof t[0]=="object"&&(i=t.shift()),i.f=r,i.a=s.inDef;var o=s.type;i.out=s.outDef,i.type=o,n.push(i)}if(t.length)throw new Error(e(a,t[0]));return n}function g(e){var t=e.shift()||"",n=e.length&&typeof e[0]=="object"?e.shift():{},r=e,i={inOutParamStr:t,taskDefArr:r,options:n};return i}function y(n,r,s,o){var u=t();if(n&&f.test(n))throw new Error(e(i,n));var a=g(Array.prototype.slice.call(arguments,1)),l=v(a.inOutParamStr),c={name:n,inParams:l.inDef,tasks:m(a.taskDefArr),outTask:{a:l.outDef}};a.options&&Object.keys(a.options).forEach(function(e){c[e]=a.options[e]});var h=u.setAndValidateAST(c);if(h.length){var p=h.join("\n");throw new Error(p)}return u}function b(e,n,i,s){var o=t(),u=g(Array.prototype.slice.call(arguments,1)),a=v(u.inOutParamStr),f=r.serializeTasks(m(u.taskDefArr)),l={name:e,inParams:a.inDef,tasks:f,outTask:{type:"finalcbFirst",a:a.outDef}};u.options&&Object.keys(u.options).forEach(function(e){l[e]=u.options[e]});var c=o.setAndValidateAST(l);if(c.length){var h=c.join("\n");throw new Error(h)}return o}var i="first flow parameter should be the flow name, but found in/out def: %s",s='params in wrong format, wanted "foo, bar, cb -> err, baz" - found: %s',o='callback specified, but first out param was not "err", use for clarity. Found in/out def: %s',u="found err param, but cb/callback is not specified, is this cb-style async or sync function? Found in/out def: %s",a="extra unmatched task arg: %s",f=/\->/,l=/^cb|callback$/i,c=/^err$/i,d={splitStr:"->",fn:function(t,r){var i=n.splitTrimFilterArgs(t[0]),s=i[i.length-1],a=s&&l.test(s)?"cb":"ret",f=n.splitTrimFilterArgs(t[1]),d=f[0];if(a==="cb"&&(!d||!c.test(d)))throw new Error(e(o,r));if(a==="ret"&&d&&c.test(d))throw new Error(e(u,r));return{type:a,inDef:h(i),outDef:p(f)}}};return y.selectFirst=b,y}),define("react/track-tasks",[],function(){function t(t){if(e)return;e=!0,t.events.on(t.events.TYPES.EXEC_FLOW_START,function(e){e.startTime=Date.now(),e.flowEmitter.emit(t.events.TYPES.FLOW_BEGIN,e)}),t.events.on(t.events.TYPES.EXEC_TASK_START,function(e){e.startTime=Date.now(),e.env.flowEmitter.emit(t.events.TYPES.TASK_BEGIN,e)}),t.events.on(t.events.TYPES.EXEC_TASK_COMPLETE,function(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime,e.env.flowEmitter.emit(t.events.TYPES.TASK_COMPLETE,e)}),t.events.on(t.events.TYPES.EXEC_TASK_ERRORED,function(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime,e.env.flowEmitter.emit(t.events.TYPES.TASK_ERRORED,e)}),t.events.on(t.events.TYPES.EXEC_FLOW_COMPLETE,function(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime,e.flowEmitter.emit(t.events.TYPES.FLOW_COMPLETE,e)}),t.events.on(t.events.TYPES.EXEC_FLOW_ERRORED,function(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime,e.flowEmitter.emit(t.events.TYPES.FLOW_ERRORED,e)})}var e=!1;return t}),define("react/log-events",["util"],function(e){function s(t){var n=new Date;n.setTime(t.startTime);var r=t.args.filter(function(e){return typeof e!="function"}),i=n.toISOString();if(this.event==="flow.complete"){var s=t;console.error("%s: %s msecs: %s \n args: %s \n results: %s\n",this.event,s.name,s.elapsedTime,e.inspect(r),e.inspect(s.results))}else{var o=t.name,u=t.args;console.error("%s: %s \n args: %s\n",this.event,o,e.inspect(r))}}function o(t){var n=new Date;n.setTime(t.startTime);var r=t.args.filter(function(e){return typeof e!="function"}),i=n.toISOString();if(this.event==="task.complete"){var s=t;console.error("%s: %s:%s msecs: %s \n args: %s \n results: %s\n",this.event,s.env.name,s.name,s.elapsedTime,e.inspect(r),e.inspect(s.results))}else{var o=t.name,u=t.args;console.error("%s: %s:%s \n args: %s\n",this.event,t.env.name,t.name,e.inspect(r))}}function u(e,t){if(!e)throw new Error("flowFn is required");e.events._loggingEvents||(e.events._loggingEvents=[]);if(t===!1)e.events._loggingEvents.forEach(function(t){e.events.removeAllListeners(t)}),e.events._loggingEvents.length=0;else if(t&&t!=="*"){var u=i.test(t)?s:o;e.events.removeListener(t,u),e.events.on(t,u),e.events._loggingEvents.push(t)}else e.events.removeListener(n,s),e.events.on(n,s),e.events._loggingEvents.push(n),e.events.removeListener(r,o),e.events.on(r,o),e.events._loggingEvents.push(r)}var t={},n="flow.*",r="task.*",i=/^flow\./;return t.logEvents=u,t}),define("react/promise-resolve",[],function(){function n(n){if(t)return;t=!0,n.events.on(n.events.TYPES.EXEC_TASKS_PRECREATE,function(t){var n=t.vCon.values,r=t.ast.inParams.filter(function(e){var t=n[e];return t&&typeof t.then=="function"});r.forEach(function(r){var i=r+e;n[i]=n[r],n[r]=undefined,t.taskDefs.push({type:"when",a:[i],out:[r]})})})}var e="__promise",t=!1;return n}),define("react/event-collector",[],function(){function e(e){function i(){this.events=[]}e.trackTasks();var t=/^ast\./,n=/^task\./,r=/^flow\./;return i.prototype.capture=function(i,s){function a(e){var i={event:this.event,time:Date.now()};r.test(this.event)?i.env=e:n.test(this.event)?i.task=e:t.test(this.event)&&(i.ast=e),u.events.push(i)}!s&&typeof i=="string"?(s=i,i=e):i||(i=e),s||(s="*");var o=i.events,u=this;o.on(s,a)},i.prototype.list=function(){return this.events},i.prototype.clear=function(){this.events=[]},new i}return e}),define("react/react",["./core","./dsl","./track-tasks","./log-events","./promise-resolve","./event-collector"],function(e,t,n,r,i,s){function u(){i(o)}function a(){n(o)}function f(e,t){return typeof e!="function"&&(t=e,e=undefined),e||(e=o),a(),r.logEvents(e,t)}function l(){return s(o)}var o=t;return o.options=e.options,o.events=e.events,o.logEvents=f,o.resolvePromises=u,o.trackTasks=a,o.createEventCollector=l,o}),define("react",["react/react"],function(e){return e})
src/components/VmDetails/cards/NicsCard/index.js
mareklibra/userportal
import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { Icon } from 'patternfly-react' import { msg } from '_/intl' import { addVmNic, deleteVmNic, editVmNic } from '_/actions' import { Grid, Row, Col } from '_/components/Grid' import { suggestNicName } from '_/components/utils' import BaseCard from '../../BaseCard' import itemStyle from '../../itemListStyle.css' import baseStyle from '../../style.css' import style from './style.css' import NicEditor from './NicEditor' import NicListItem from './NicListItem' /* * Filter the set of vNIC profiles to display to the user such that: * - each vNIC is in the same data center as the VM * - each vNIC's network is available on the same cluster as the VM */ function filterVnicProfiles (vm, clusters, vnicProfiles) { const clusterId = vm.getIn(['cluster', 'id']) const clusterNetworks = clusters.getIn([clusterId, 'networks']) const dataCenterId = clusters.getIn([clusterId, 'dataCenterId']) return vnicProfiles .filter(vnic => vnic.get('dataCenterId') === dataCenterId && clusterNetworks.contains(vnic.getIn(['network', 'id'])) && vnic.get('canUserUseProfile') ) .toList() } function suggestNicName_ (vm) { return suggestNicName(vm.get('nics', []).map(nic => nic.get('name'))) } /** * List of NICs connected to a VM and provide creation of NICs, editing NICs and * deleting NICs. */ class NicsCard extends React.Component { constructor (props) { super(props) this.state = { nextNicName: suggestNicName_(props.vm), filteredVnicList: filterVnicProfiles(props.vm, props.clusters, props.vnicProfiles), } this.onCreateConfirm = this.onCreateConfirm.bind(this) this.onEditConfirm = this.onEditConfirm.bind(this) this.onDeleteConfirm = this.onDeleteConfirm.bind(this) } /* eslint-disable react/no-did-update-set-state */ componentDidUpdate (prevProps, prevState) { const { vm, clusters, vnicProfiles } = this.props const changes = {} if (prevProps.vm !== vm) { changes.nextNicName = suggestNicName_(vm) } if (prevProps.vm !== vm || prevProps.clusters !== clusters || prevProps.vnicProfiles !== vnicProfiles) { changes.filteredVnicList = filterVnicProfiles(vm, clusters, vnicProfiles) } if (Object.values(changes).length > 0) { this.setState(changes) } } onCreateConfirm (nic) { this.props.addNic({ nic }) } onEditConfirm (nic) { this.props.editNic({ nic }) } onDeleteConfirm (nicId) { this.props.deleteNic({ nicId }) } render () { const { vm, vnicProfiles, onEditChange } = this.props const idPrefix = 'vmdetail-nics' const canEditTheCard = vm.get('canUserEditVm') && vm.getIn(['pool', 'id']) === undefined const vmStatus = vm.get('status') const canCreateNic = this.state.filteredVnicList.size > 0 const showNicIPs = vm.get('status') === 'up' const nicList = vm.get('nics') .sort((a, b) => a.get('name').localeCompare(b.get('name'))) .map(nic => ({ id: nic.get('id'), name: nic.get('name'), plugged: nic.get('plugged'), linked: nic.get('linked'), interface: nic.get('interface'), vnicProfile: { id: nic.getIn(['vnicProfile', 'id']), name: vnicProfiles.getIn([nic.getIn(['vnicProfile', 'id']), 'name']), network: vnicProfiles.getIn([nic.getIn(['vnicProfile', 'id']), 'network', 'name']), }, ipv4: showNicIPs ? nic.get('ipv4').toJS() : [], ipv6: showNicIPs ? nic.get('ipv6').toJS() : [], canEdit: true, // TODO: True for admins, may need permission checks for users canDelete: vmStatus === 'down' || !nic.get('plugged'), })) .toJS() return ( <BaseCard icon={{ type: 'pf', name: 'network' }} title={msg.nic()} editTooltip={msg.nicCardEditTooltip({ vmName: vm.get('name') })} editable={canEditTheCard} idPrefix={idPrefix} className={baseStyle['cell-card']} itemCount={vm.get('nics').size} onStartEdit={() => { onEditChange(true) }} onCancel={() => { onEditChange(false) }} onSave={() => { onEditChange(false) }} > {({ isEditing }) => <Grid className={style['nics-container']}> { isEditing && canCreateNic && <Row key={`${idPrefix}-new`} id={`${idPrefix}-new`}> <Col> <NicEditor idPrefix={`${idPrefix}-new`} nextNicName={this.state.nextNicName} vnicProfileList={this.state.filteredVnicList} onSave={this.onCreateConfirm} trigger={({ onClick }) => ( <div className={itemStyle['create-block']}> <a href='#' id={`${idPrefix}-new-button`} onClick={onClick}> <Icon className={itemStyle['create-icon']} type='fa' name='plus' /> <span className={itemStyle['create-text']} >{msg.nicActionCreateNew()}</span> </a> </div> )} /> </Col> </Row> } { nicList.length === 0 && <Row> <Col> <div className={itemStyle['no-items']} id={`${idPrefix}-no-nics`}>{msg.noNics()}</div> </Col> </Row> } { nicList.length > 0 && nicList.map(nic => <Row key={nic.id} id={`${idPrefix}-${nic.name}`}> <Col style={{ display: 'block' }}> <NicListItem idPrefix={`${idPrefix}-${nic.name}`} nic={nic} vmStatus={vmStatus} vnicProfileList={this.state.filteredVnicList} isEditing={isEditing} onEdit={nic.canEdit ? this.onEditConfirm : undefined} onDelete={nic.canDelete ? this.onDeleteConfirm : undefined} /> </Col> </Row> )} </Grid> } </BaseCard> ) } } NicsCard.propTypes = { vm: PropTypes.object.isRequired, onEditChange: PropTypes.func.isRequired, vnicProfiles: PropTypes.object.isRequired, // Map<id, vnic> clusters: PropTypes.object.isRequired, addNic: PropTypes.func.isRequired, // eslint-disable-line react/no-unused-prop-types editNic: PropTypes.func.isRequired, // eslint-disable-line react/no-unused-prop-types deleteNic: PropTypes.func.isRequired, // eslint-disable-line react/no-unused-prop-types } export default connect( (state) => ({ vnicProfiles: state.vnicProfiles, clusters: state.clusters, }), (dispatch, { vm }) => ({ addNic: ({ nic }) => dispatch(addVmNic({ vmId: vm.get('id'), nic })), editNic: ({ nic }) => dispatch(editVmNic({ vmId: vm.get('id'), nic })), deleteNic: ({ nicId }) => dispatch(deleteVmNic({ vmId: vm.get('id'), nicId })), }) )(NicsCard)
fields/types/relationship/RelationshipFilter.js
Redmart/keystone
import async from 'async'; import React from 'react'; import xhr from 'xhr'; import { Button, FormField, FormInput, InputGroup, SegmentedControl } from 'elemental'; import PopoutList from '../../../admin/client/components/PopoutList'; const TOGGLE_OPTIONS = [ { label: 'Linked To', value: false }, { label: 'NOT Linked To', value: true }, ]; function getDefaultValue () { return { inverted: TOGGLE_OPTIONS[0].value, value: [], }; } var RelationshipFilter = React.createClass({ statics: { getDefaultValue: getDefaultValue, }, propTypes: { field: React.PropTypes.object, filter: React.PropTypes.shape({ inverted: React.PropTypes.bool, value: React.PropTypes.array, }), onHeightChange: React.PropTypes.func, }, getDefaultProps () { return { filter: getDefaultValue(), }; }, getInitialState () { return { searchIsLoading: false, searchResults: [], searchString: '', selectedItems: [], valueIsLoading: true, }; }, componentDidMount () { this._itemsCache = {}; this.loadSearchResults(true); }, componentWillReceiveProps (nextProps) { if (nextProps.filter.value !== this.props.filter.value) { this.populateValue(nextProps.filter.value); } }, isLoading () { return this.state.searchIsLoading || this.state.valueIsLoading; }, populateValue (value) { async.map(value, (id, next) => { if (this._itemsCache[id]) return next(null, this._itemsCache[id]); xhr({ url: Keystone.adminPath + '/api/' + this.props.field.refList.path + '/' + id + '?basic', responseType: 'json', }, (err, resp, data) => { if (err || !data) return done(err); this.cacheItem(data); done(err, data); }); }, (err, items) => { if (err) { // TODO: Handle errors better console.error('Error loading items:', err); } this.setState({ valueIsLoading: false, selectedItems: items || [], }, () => { this.refs.focusTarget.focus(); }); }); }, cacheItem (item) { this._itemsCache[item.id] = item; }, buildFilters () { var filters = {}; _.each(this.props.field.filters, function(value, key) { filters[key] = value; }, this); var parts = []; _.each(filters, function (val, key) { parts.push('filters[' + key + '][value]=' + encodeURIComponent(val)); }); return parts.join('&'); }, loadSearchResults (thenPopulateValue) { let searchString = this.state.searchString; let filters = this.buildFilters(); xhr({ url: Keystone.adminPath + '/api/' + this.props.field.refList.path + '?basic&search=' + searchString + '&' + filters, responseType: 'json', }, (err, resp, data) => { if (err) { // TODO: Handle errors better console.error('Error loading items:', err); this.setState({ searchIsLoading: false, }); return; } data.results.forEach(this.cacheItem); if (thenPopulateValue) { this.populateValue(this.props.filter.value); } if (searchString !== this.state.searchString) return; this.setState({ searchIsLoading: false, searchResults: data.results, }, this.updateHeight); }); }, updateHeight () { if (this.props.onHeightChange) { this.props.onHeightChange(this.refs.container.offsetHeight); } }, toggleInverted (inverted) { this.updateFilter({ inverted }); }, updateSearch (e) { this.setState({ searchString: e.target.value }, this.loadSearchResults); }, selectItem (item) { let value = this.props.filter.value.concat(item.id); this.updateFilter({ value }); }, removeItem (item) { let value = this.props.filter.value.filter(i => { return i !== item.id; }); this.updateFilter({ value }); }, updateFilter (value) { this.props.onChange({ ...this.props.filter, ...value }); }, renderItems (items, selected) { let itemIconHover = selected ? 'x' : 'check'; return items.map((item, i) => { return ( <PopoutList.Item key={`item-${i}-${item.id}`} icon="dash" iconHover={itemIconHover} label={item.name} onClick={() => { if (selected) this.removeItem(item); else this.selectItem(item); }} /> ); }); }, render () { let selectedItems = this.state.selectedItems; let searchResults = this.state.searchResults.filter(i => { return this.props.filter.value.indexOf(i.id) === -1; }); let placeholder = this.isLoading() ? 'Loading...' : 'Find a ' + this.props.field.label + '...'; return ( <div ref="container"> <FormField> <SegmentedControl equalWidthSegments options={TOGGLE_OPTIONS} value={this.props.filter.inverted} onChange={this.toggleInverted} /> </FormField> <FormField style={{ borderBottom: '1px dashed rgba(0,0,0,0.1)', paddingBottom: '1em' }}> <FormInput autofocus ref="focusTarget" value={this.state.searchString} onChange={this.updateSearch} placeholder={placeholder} /> </FormField> {selectedItems.length ? ( <PopoutList> <PopoutList.Heading>Selected</PopoutList.Heading> {this.renderItems(selectedItems, true)} </PopoutList> ) : null} {searchResults.length ? ( <PopoutList> <PopoutList.Heading style={selectedItems.length ? { marginTop: '2em' } : null}>Items</PopoutList.Heading> {this.renderItems(searchResults)} </PopoutList> ) : null} </div> ); } }); module.exports = RelationshipFilter;
src/page/MovieTabPageNow.js
REBOOTERS/BestPracticesRN
/** * Created by Rookie on 2017/8/3. */ import React, {Component} from 'react'; import {View, StyleSheet, Text, ToastAndroid, ActivityIndicator} from 'react-native'; import VerticalListView from "../components/VerticalListView"; import Api from "../util/Api"; import Loading from "../components/widgets/Loading"; let in_threaters_data = require('../localdata/in_theaters.json'); let coming_soon_data = require('../localdata/coming_soon.json'); export default class MovieTabPageNow extends Component { constructor(props) { super(props); this.state = { url_in_theaters: 'https://api.douban.com/v2/movie/in_theaters', url_coming_soon: 'https://api.douban.com/v2/movie/coming_soon', Data: [], done: false, }; } componentDidMount() { Api.Get(this.state.url_in_theaters, null, this._success, this._error); // this._error(); } _success = (resData) => { console.log('成功'); console.log(resData.count); this.setState({ Data: resData.subjects, done: true, }); }; _error = (resData) => { console.log('失败'); console.log(resData); ToastAndroid.show("请求数据失败-1", ToastAndroid.SHORT); this.setState({ Data: in_threaters_data.subjects, done: true, }) }; render() { let navigation = this.props.screenProps.appNavigation; if (this.state.done) { return ( <VerticalListView showIndex={false} subjects={this.state.Data } navigation={navigation}/>) } else { return (<Loading/>) } } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'white' } });
startbootstrap-grayscale-gh-pages/vendor/jquery/jquery.js
lucngo/portfolio
/*! * jQuery JavaScript Library v1.12.4 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2016-05-20T17:17Z */ (function( global, factory ) { if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` // (such as Node.js), expose a factory as module.exports. // This accentuates the need for the creation of a real `window`. // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info. module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Support: Firefox 18+ // Can't be in strict mode, several libs including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) //"use strict"; var deletedIds = []; var document = window.document; var slice = deletedIds.slice; var concat = deletedIds.concat; var push = deletedIds.push; var indexOf = deletedIds.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var support = {}; var version = "1.12.4", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, // Support: Android<4.1, IE<9 // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num != null ? // Return just the one element from the set ( num < 0 ? this[ num + this.length ] : this[ num ] ) : // Return all the elements in a clean array slice.call( this ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. each: function( callback ) { return jQuery.each( this, callback ); }, map: function( callback ) { return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); } ) ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { return this.prevObject || this.constructor(); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: deletedIds.sort, splice: deletedIds.splice }; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( ( options = arguments[ i ] ) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject( copy ) || ( copyIsArray = jQuery.isArray( copy ) ) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray( src ) ? src : []; } else { clone = src && jQuery.isPlainObject( src ) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend( { // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type( obj ) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type( obj ) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN // adding 1 corrects loss of precision from parseFloat (#15100) var realStringObj = obj && obj.toString(); return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call( obj, "constructor" ) && !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( !support.ownFirst ) { for ( key in obj ) { return hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, type: function( obj ) { if ( obj == null ) { return obj + ""; } return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; }, // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, each: function( obj, callback ) { var length, i = 0; if ( isArrayLike( obj ) ) { length = obj.length; for ( ; i < length; i++ ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } else { for ( i in obj ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } return obj; }, // Support: Android<4.1, IE<9 trim: function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( indexOf ) { return indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; while ( j < len ) { first[ i++ ] = second[ j++ ]; } // Support: IE<9 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) if ( len !== len ) { while ( second[ j ] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var length, value, i = 0, ret = []; // Go through the array, translating each of the items to their new values if ( isArrayLike( elems ) ) { length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, now: function() { return +( new Date() ); }, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support } ); // JSHint would error on this code due to the Symbol not being defined in ES5. // Defining this global in .jshintrc would create a danger of using the global // unguarded in another place, it seems safer to just disable JSHint for these // three lines. /* jshint ignore: start */ if ( typeof Symbol === "function" ) { jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ]; } /* jshint ignore: end */ // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); function isArrayLike( obj ) { // Support: iOS 8.2 (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE var length = !!obj && "length" in obj && obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v2.2.1 * http://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2015-10-17 */ (function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // General-purpose constants MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf as it's faster than native // http://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; for ( ; i < len; i++ ) { if ( list[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + identifier + ")" ), "CLASS": new RegExp( "^\\.(" + identifier + ")" ), "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox<24 // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, // Used for iframes // See setDocument() // Removing the function wrapper causes a "Permission Denied" // error in IE unloadHandler = function() { setDocument(); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var m, i, elem, nid, nidselect, match, groups, newSelector, newContext = context && context.ownerDocument, // nodeType defaults to 9, since context defaults to document nodeType = context ? context.nodeType : 9; results = results || []; // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } // Try to shortcut find operations (as opposed to filters) in HTML documents if ( !seed ) { if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; if ( documentIsHTML ) { // If the selector is sufficiently simple, try using a "get*By*" DOM method // (excepting DocumentFragment context, where the methods don't exist) if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { // ID selector if ( (m = match[1]) ) { // Document context if ( nodeType === 9 ) { if ( (elem = context.getElementById( m )) ) { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } // Element context } else { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( newContext && (elem = newContext.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Type selector } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Class selector } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // Take advantage of querySelectorAll if ( support.qsa && !compilerCache[ selector + " " ] && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { if ( nodeType !== 1 ) { newContext = context; newSelector = selector; // qSA looks outside Element context, which is not what we want // Thanks to Andrew Dupont for this workaround technique // Support: IE <=8 // Exclude object elements } else if ( context.nodeName.toLowerCase() !== "object" ) { // Capture the context ID, setting it first if necessary if ( (nid = context.getAttribute( "id" )) ) { nid = nid.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", (nid = expando) ); } // Prefix every selector in the list groups = tokenize( selector ); i = groups.length; nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; while ( i-- ) { groups[i] = nidselect + " " + toSelector( groups[i] ); } newSelector = groups.join( "," ); // Expand context for sibling selectors newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch ( qsaError ) { } finally { if ( nid === expando ) { context.removeAttribute( "id" ); } } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key + " " ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Checks a node for validity as a Sizzle context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { return context && typeof context.getElementsByTagName !== "undefined" && context; } // Expose support vars for convenience support = Sizzle.support = {}; /** * Detects XML nodes * @param {Element|Object} elem An element or a document * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, parent, doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Update global variables document = doc; docElem = document.documentElement; documentIsHTML = !isXML( document ); // Support: IE 9-11, Edge // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) if ( (parent = document.defaultView) && parent.top !== parent ) { // Support: IE 11 if ( parent.addEventListener ) { parent.addEventListener( "unload", unloadHandler, false ); // Support: IE 9 - 10 only } else if ( parent.attachEvent ) { parent.attachEvent( "onunload", unloadHandler ); } } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties // (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( document.createComment("") ); return !div.getElementsByTagName("*").length; }); // Support: IE<9 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !document.getElementsByName || !document.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var m = context.getElementById( id ); return m ? [ m ] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( tag ); // DocumentFragment nodes don't have gEBTN } else if ( support.qsa ) { return context.querySelectorAll( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + "<select id='" + expando + "-\r\\' msallowcapture=''>" + "<option selected=''></option></select>"; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section if ( div.querySelectorAll("[msallowcapture^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { rbuggyQSA.push("~="); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } // Support: Safari 8+, iOS 8+ // https://bugs.webkit.org/show_bug.cgi?id=136851 // In-page `selector#id sibing-combinator selector` fails if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { rbuggyQSA.push(".#.+[+~]"); } }); assert(function( div ) { // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment var input = document.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute if ( div.querySelectorAll("[name=d]").length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another // Purposefully self-exclusive // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = hasCompare ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } // Sort on method existence if only one input has compareDocumentPosition var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if ( compare ) { return compare; } // Calculate position if both inputs belong to the same document compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected 1; // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { return -1; } if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } : function( a, b ) { // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { return a === document ? -1 : b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && !compilerCache[ expr + " " ] && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch (e) {} } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } // Clear input after sorting to release objects // See https://github.com/jquery/sizzle/pull/225 sortInput = null; return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( (node = elem[i++]) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[6] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] ) { match[2] = match[4] || match[5] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index // ...in a gzip-friendly way node = parent; outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } } else { // Use previously-cached element index if available if ( useCache ) { // ...in a gzip-friendly way node = elem; outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex; } // xml :nth-child(...) // or :nth-last-child(...) or :nth(-last)?-of-type(...) if ( diff === false ) { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); uniqueCache[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); // Don't keep the element (issue #299) input[0] = null; return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { text = text.replace( runescape, funescape ); return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeType < 6 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( (tokens = []) ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var oldCache, uniqueCache, outerCache, newCache = [ dirruns, doneName ]; // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); if ( (oldCache = uniqueCache[ dir ]) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return (newCache[ 2 ] = oldCache[ 2 ]); } else { // Reuse newcache so results back-propagate to previous elements uniqueCache[ dir ] = newCache; // A match means we're done; a fail means we have to keep checking if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); // Avoid hanging onto element (issue #299) checkContext = null; return ret; } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, outermost ) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, // We must always have either seed elements or outermost context elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length; if ( outermost ) { outermostContext = context === document || context || outermost; } // Add elements passing elementMatchers directly to results // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id for ( ; i !== len && (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; if ( !context && elem.ownerDocument !== document ) { setDocument( elem ); xml = !documentIsHTML; } while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context || document, xml) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // `i` is now the count of elements visited above, and adding it to `matchedCount` // makes the latter nonnegative. matchedCount += i; // Apply set filters to unmatched elements // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` // equals `i`), unless we didn't visit _any_ elements in the above loop because we have // no element matchers and no seed. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that // case, which will result in a "00" `matchedCount` that differs from `i` but is also // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { cached = matcherFromTokens( match[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; }; /** * A low-level selection function that works with Sizzle's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled * selector function built with Sizzle.compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize( (selector = compiled.selector || selector) ); results = results || []; // Try to minimize operations if there is only one selector in the list and no seed // (the latter of which guarantees us context) if ( match.length === 1 ) { // Reduce context if the leading compound selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; // Precompiled matchers will still verify ancestry, so step up a level } else if ( compiled ) { context = context.parentNode; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, !context || rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome 14-35+ // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : (val = elem.getAttributeNode( name )) && val.specified ? val.value : null; } }); } return Sizzle; })( window ); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[ ":" ] = jQuery.expr.pseudos; jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; var dir = function( elem, dir, until ) { var matched = [], truncate = until !== undefined; while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { if ( elem.nodeType === 1 ) { if ( truncate && jQuery( elem ).is( until ) ) { break; } matched.push( elem ); } } return matched; }; var siblings = function( n, elem ) { var matched = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { matched.push( n ); } } return matched; }; var rneedsContext = jQuery.expr.match.needsContext; var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); var risSimple = /^.[^:#\[\.,]*$/; // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; } ); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; } ); } if ( typeof qualifier === "string" ) { if ( risSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not; } ); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; } ) ); }; jQuery.fn.extend( { find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } } ) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, filter: function( selector ) { return this.pushStack( winnow( this, selector || [], false ) ); }, not: function( selector ) { return this.pushStack( winnow( this, selector || [], true ) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } } ); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, init = jQuery.fn.init = function( selector, context, root ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // init accepts an alternate rootjQuery // so migrate can support jQuery.sub (gh-2101) root = root || rootjQuery; // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt( 0 ) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && ( match[ 1 ] || !context ) ) { // HANDLE: $(html) -> $(array) if ( match[ 1 ] ) { context = context instanceof jQuery ? context[ 0 ] : context; // scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[ 2 ] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[ 2 ] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[ 0 ] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || root ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[ 0 ] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return typeof root.ready !== "undefined" ? root.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend( { has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[ i ] ) ) { return true; } } } ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && ( pos ? pos.index( cur ) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector( cur, selectors ) ) ) { matched.push( cur ); break; } } } return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[ 0 ], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[ 0 ] : elem, this ); }, add: function( selector, context ) { return this.pushStack( jQuery.uniqueSort( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter( selector ) ); } } ); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each( { parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return siblings( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return siblings( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.uniqueSort( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; } ); var rnotwhite = ( /\S+/g ); // Convert String-formatted options into Object-formatted ones function createOptions( options ) { var object = {}; jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; } ); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? createOptions( options ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value for non-forgettable lists memory, // Flag to know if list was already fired fired, // Flag to prevent firing locked, // Actual callback list list = [], // Queue of execution data for repeatable lists queue = [], // Index of currently firing callback (modified by add/remove as needed) firingIndex = -1, // Fire callbacks fire = function() { // Enforce single-firing locked = options.once; // Execute callbacks for all pending executions, // respecting firingIndex overrides and runtime changes fired = firing = true; for ( ; queue.length; firingIndex = -1 ) { memory = queue.shift(); while ( ++firingIndex < list.length ) { // Run callback and check for early termination if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && options.stopOnFalse ) { // Jump to end and forget the data so .add doesn't re-fire firingIndex = list.length; memory = false; } } } // Forget the data if we're done with it if ( !options.memory ) { memory = false; } firing = false; // Clean up if we're done firing for good if ( locked ) { // Keep an empty list if we have data for future add calls if ( memory ) { list = []; // Otherwise, this object is spent } else { list = ""; } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // If we have memory from a past run, we should fire after adding if ( memory && !firing ) { firingIndex = list.length - 1; queue.push( memory ); } ( function add( args ) { jQuery.each( args, function( _, arg ) { if ( jQuery.isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { // Inspect recursively add( arg ); } } ); } )( arguments ); if ( memory && !firing ) { fire(); } } return this; }, // Remove a callback from the list remove: function() { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( index <= firingIndex ) { firingIndex--; } } } ); return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : list.length > 0; }, // Remove all callbacks from the list empty: function() { if ( list ) { list = []; } return this; }, // Disable .fire and .add // Abort any current/pending executions // Clear all callbacks and values disable: function() { locked = queue = []; list = memory = ""; return this; }, disabled: function() { return !list; }, // Disable .fire // Also disable .add unless we have memory (since it would have no effect) // Abort any pending executions lock: function() { locked = true; if ( !memory ) { self.disable(); } return this; }, locked: function() { return !!locked; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( !locked ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; queue.push( args ); if ( !firing ) { fire(); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend( { Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], [ "notify", "progress", jQuery.Callbacks( "memory" ) ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .progress( newDefer.notify ) .done( newDefer.resolve ) .fail( newDefer.reject ); } else { newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } } ); } ); fns = null; } ).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[ 1 ] ] = list.add; // Handle state if ( stateString ) { list.add( function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[ 0 ] ] = function() { deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[ 0 ] + "With" ] = list.fireWith; } ); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. // If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .progress( updateFunc( i, progressContexts, progressValues ) ) .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } } ); // The deferred used on DOM ready var readyList; jQuery.fn.ready = function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }; jQuery.extend( { // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.triggerHandler ) { jQuery( document ).triggerHandler( "ready" ); jQuery( document ).off( "ready" ); } } } ); /** * Clean-up method for dom ready events */ function detach() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed ); window.removeEventListener( "load", completed ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } } /** * The ready event handler and self cleanup method */ function completed() { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || window.event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } } jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called // after the browser event has already occurred. // Support: IE6-10 // Older IE sometimes signals "interactive" too soon if ( document.readyState === "complete" || ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { // Handle it asynchronously to allow scripts the opportunity to delay ready window.setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch ( e ) {} if ( top && top.doScroll ) { ( function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll( "left" ); } catch ( e ) { return window.setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } } )(); } } } return readyList.promise( obj ); }; // Kick off the DOM ready check even if the user does not jQuery.ready.promise(); // Support: IE<9 // Iteration over object's inherited properties before its own var i; for ( i in jQuery( support ) ) { break; } support.ownFirst = i === "0"; // Note: most support tests are defined in their respective modules. // false until the test is run support.inlineBlockNeedsLayout = false; // Execute ASAP in case we need to set body.style.zoom jQuery( function() { // Minified: var a,b,c,d var val, div, body, container; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Return for frameset docs that don't have a body return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); if ( typeof div.style.zoom !== "undefined" ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; if ( val ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); } ); ( function() { var div = document.createElement( "div" ); // Support: IE<9 support.deleteExpando = true; try { delete div.test; } catch ( e ) { support.deleteExpando = false; } // Null elements to avoid leaks in IE. div = null; } )(); var acceptData = function( elem ) { var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], nodeType = +elem.nodeType || 1; // Do not set data on non-element DOM nodes because it will not be cleared (#8335). return nodeType !== 1 && nodeType !== 9 ? false : // Nodes accept data unless otherwise specified; rejection can be conditional !noData || noData !== true && elem.getAttribute( "classid" ) === noData; }; var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /([A-Z])/g; function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch ( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } function internalData( elem, name, data, pvt /* Internal Use Only */ ) { if ( !acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split( " " ); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[ i ] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, undefined } else { cache[ id ] = undefined; } } jQuery.extend( { cache: {}, // The following elements (space-suffixed to avoid Object.prototype collisions) // throw uncatchable exceptions if you attempt to set expando properties noData: { "applet ": true, "embed ": true, // ...but Flash objects (which have this classid) *can* handle expandos "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); } } ); jQuery.fn.extend( { data: function( key, value ) { var i, name, data, elem = this[ 0 ], attrs = elem && elem.attributes; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE11+ // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.slice( 5 ) ); dataAttr( elem, name, data[ name ] ); } } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each( function() { jQuery.data( this, key ); } ); } return arguments.length > 1 ? // Sets one value this.each( function() { jQuery.data( this, key, value ); } ) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; }, removeData: function( key ) { return this.each( function() { jQuery.removeData( this, key ); } ); } } ); jQuery.extend( { queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray( data ) ) { queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, // or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks( "once memory" ).add( function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); } ) } ); } } ); jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : this.each( function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } } ); }, dequeue: function( type ) { return this.each( function() { jQuery.dequeue( this, type ); } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } } ); ( function() { var shrinkWrapBlocksVal; support.shrinkWrapBlocks = function() { if ( shrinkWrapBlocksVal != null ) { return shrinkWrapBlocksVal; } // Will be changed later if needed. shrinkWrapBlocksVal = false; // Minified: var b,c,d var div, body, container; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Test fired too early or in an unsupported environment, exit. return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); // Support: IE6 // Check if elements with layout shrink-wrap their children if ( typeof div.style.zoom !== "undefined" ) { // Reset CSS: box-sizing; display; margin; border div.style.cssText = // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;" + "padding:1px;width:1px;zoom:1"; div.appendChild( document.createElement( "div" ) ).style.width = "5px"; shrinkWrapBlocksVal = div.offsetWidth !== 3; } body.removeChild( container ); return shrinkWrapBlocksVal; }; } )(); var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var isHidden = function( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); }; function adjustCSS( elem, prop, valueParts, tween ) { var adjusted, scale = 1, maxIterations = 20, currentValue = tween ? function() { return tween.cur(); } : function() { return jQuery.css( elem, prop, "" ); }, initial = currentValue(), unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && rcssNum.exec( jQuery.css( elem, prop ) ); if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || initialInUnit[ 3 ]; // Make sure we update the tween properties later on valueParts = valueParts || []; // Iteratively approximate from a nonzero starting point initialInUnit = +initial || 1; do { // If previous iteration zeroed out, double until we get *something*. // Use string for doubling so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply initialInUnit = initialInUnit / scale; jQuery.style( elem, prop, initialInUnit + unit ); // Update scale, tolerating zero or NaN from tween.cur() // Break the loop if scale is unchanged or perfect, or if we've just had enough. } while ( scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations ); } if ( valueParts ) { initialInUnit = +initialInUnit || +initial || 0; // Apply relative offset (+=/-=) if specified adjusted = valueParts[ 1 ] ? initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : +valueParts[ 2 ]; if ( tween ) { tween.unit = unit; tween.start = initialInUnit; tween.end = adjusted; } } return adjusted; } // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { access( elems, fn, i, key[ i ], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[ i ], key, raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[ 0 ], key ) : emptyGet; }; var rcheckableType = ( /^(?:checkbox|radio)$/i ); var rtagName = ( /<([\w:-]+)/ ); var rscriptType = ( /^$|\/(?:java|ecma)script/i ); var rleadingWhitespace = ( /^\s+/ ); var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + "details|dialog|figcaption|figure|footer|header|hgroup|main|" + "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } ( function() { var div = document.createElement( "div" ), fragment = document.createDocumentFragment(), input = document.createElement( "input" ); // Setup div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName( "tbody" ).length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) input.type = "checkbox"; input.checked = true; fragment.appendChild( input ); support.appendChecked = input.checked; // Make sure textarea (and checkbox) defaultValue is properly cloned // Support: IE6-IE11+ div.innerHTML = "<textarea>x</textarea>"; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; // #11217 - WebKit loses check when the name is after the checked attribute fragment.appendChild( div ); // Support: Windows Web Apps (WWA) // `name` and `type` must use .setAttribute for WWA (#14901) input = document.createElement( "input" ); input.setAttribute( "type", "radio" ); input.setAttribute( "checked", "checked" ); input.setAttribute( "name", "t" ); div.appendChild( input ); // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // old WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ support.noCloneEvent = !!div.addEventListener; // Support: IE<9 // Since attributes and properties are the same in IE, // cleanData must set properties to undefined rather than use removeAttribute div[ jQuery.expando ] = 1; support.attributes = !div.getAttribute( jQuery.expando ); } )(); // We have to close these tags to support XHTML (#13200) var wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], // Support: IE8 param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }; // Support: IE8-IE9 wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; ( elem = elems[ i ] ) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; ( elem = elems[ i ] ) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[ i ], "globalEval" ) ); } } var rhtml = /<|&#?\w+;/, rtbody = /<tbody/i; function fixDefaultChecked( elem ) { if ( rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } function buildFragment( elems, context, scripts, selection, ignored ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement( "div" ) ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; // Descend through wrappers to the right content j = wrap[ 0 ]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[ 0 ] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[ 1 ] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( ( elem = nodes[ i++ ] ) ) { // Skip elements already in the context collection (trac-4087) if ( selection && jQuery.inArray( elem, selection ) > -1 ) { if ( ignored ) { ignored.push( elem ); } continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( ( elem = tmp[ j++ ] ) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; } ( function() { var i, eventName, div = document.createElement( "div" ); // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) for ( i in { submit: true, change: true, focusin: true } ) { eventName = "on" + i; if ( !( support[ i ] = eventName in window ) ) { // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) div.setAttribute( eventName, "t" ); support[ i ] = div.attributes[ eventName ].expando === false; } } // Null elements to avoid leaks in IE. div = null; } )(); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; } function returnFalse() { return false; } // Support: IE9 // See #13393 for more info function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } function on( elem, types, selector, data, fn, one ) { var origFn, type; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { on( elem, type, selector, data, types[ type ], one ); } return elem; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return elem; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return elem.each( function() { jQuery.event.add( this, types, fn, data, selector ); } ); } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !( events = elemData.events ) ) { events = elemData.events = {}; } if ( !( eventHandle = elemData.handle ) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== "undefined" && ( !e || jQuery.event.triggered !== e.type ) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak // with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend( { type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join( "." ) }, handleObjIn ); // Init the event handler queue if we're the first if ( !( handlers = events[ type ] ) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !( events = elemData.events ) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[ 2 ] && new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf( "." ) > -1 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split( "." ); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf( ":" ) < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join( "." ); event.rnamespace = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === ( elem.ownerDocument || document ) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && handle.apply && acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); } } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( ( !special._default || special._default.apply( eventPath.pop(), data ) === false ) && acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, j, ret, matched, handleObj, handlerQueue = [], args = slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[ 0 ] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( ( handleObj = matched.handlers[ j++ ] ) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or 2) have namespace(s) // a subset or equal to those in the bound event (both can have no namespace). if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || handleObj.handler ).apply( matched.elem, args ); if ( ret !== undefined ) { if ( ( event.result = ret ) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var i, matches, sel, handleObj, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Support (at least): Chrome, IE9 // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // // Support: Firefox<=42+ // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) if ( delegateCount && cur.nodeType && ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) > -1 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push( { elem: cur, handlers: matches } ); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Safari 6-8+ // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split( " " ), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: ( "button buttons clientX clientY fromElement offsetX offsetY " + "pageX pageY screenX screenY toElement" ).split( " " ), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } }, // Piggyback on a donor event to simulate a different one simulate: function( type, elem, event ) { var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true // Previously, `originalEvent: {}` was set here, so stopPropagation call // would not be triggered on donor event, since in our own // jQuery.event.stopPropagation function we had a check for existence of // originalEvent.stopPropagation method, so, consequently it would be a noop. // // Guard for simulated events was moved to jQuery.event.stopPropagation function // since `originalEvent` should point to the original event for the // constancy with other events and for more focused logic } ); jQuery.event.trigger( e, null, elem ); if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { // This "if" is needed for plain objects if ( elem.removeEventListener ) { elem.removeEventListener( type, handle ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, // to properly expose it to GC if ( typeof elem[ name ] === "undefined" ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !( this instanceof jQuery.Event ) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: IE < 9, Android < 4.0 src.returnValue === false ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e || this.isSimulated ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && e.stopImmediatePropagation ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks // so that event delegation works in jQuery. // Do the same for pointerenter/pointerleave and pointerover/pointerout // // Support: Safari 7 only // Safari sends mouseenter too often; see: // https://code.google.com/p/chromium/issues/detail?id=470258 // for the description of the bug (it existed in older Chrome versions as well). jQuery.each( { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mouseenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; } ); // IE submit delegation if ( !support.submit ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? // Support: IE <=8 // We use jQuery.prop instead of elem.form // to allow fixing the IE8 delegated submit issue (gh-2332) // by 3rd party polyfills/workarounds. jQuery.prop( elem, "form" ) : undefined; if ( form && !jQuery._data( form, "submit" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submitBubble = true; } ); jQuery._data( form, "submit", true ); } } ); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submitBubble ) { delete event._submitBubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !support.change ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._justChanged = true; } } ); jQuery.event.add( this, "click._change", function( event ) { if ( this._justChanged && !event.isTrigger ) { this._justChanged = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event ); } ); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event ); } } ); jQuery._data( elem, "change", true ); } } ); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Support: Firefox // Firefox doesn't have focus(in | out) events // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 // // Support: Chrome, Safari // focus(in | out) events fire after focus & blur events, // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order // Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 if ( !support.focusin ) { jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); }; jQuery.event.special[ fix ] = { setup: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ); if ( !attaches ) { doc.addEventListener( orig, handler, true ); } jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ) - 1; if ( !attaches ) { doc.removeEventListener( orig, handler, true ); jQuery._removeData( doc, fix ); } else { jQuery._data( doc, fix, attaches ); } } }; } ); } jQuery.fn.extend( { on: function( types, selector, data, fn ) { return on( this, types, selector, data, fn ); }, one: function( types, selector, data, fn ) { return on( this, types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each( function() { jQuery.event.remove( this, types, fn, selector ); } ); }, trigger: function( type, data ) { return this.each( function() { jQuery.event.trigger( type, data, this ); } ); }, triggerHandler: function( type, data ) { var elem = this[ 0 ]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } } ); var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, // Support: IE 10-11, Edge 10240+ // In IE/Edge using regex groups here causes severe slowdowns. // See https://connect.microsoft.com/IE/feedback/details/1736512/ rnoInnerhtml = /<script|<style|<link/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName( "tbody" )[ 0 ] || elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[ 1 ]; } else { elem.removeAttribute( "type" ); } return elem; } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } function domManip( collection, args, callback, ignored ) { // Flatten any nested arrays args = concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = collection.length, iNoClone = l - 1, value = args[ 0 ], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return collection.each( function( index ) { var self = collection.eq( index ); if ( isFunction ) { args[ 0 ] = value.call( this, index, self.html() ); } domManip( self, args, callback, ignored ); } ); } if ( l ) { fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } // Require either new content or an interest in ignored elements to invoke the callback if ( first || ignored ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item // instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { // Support: Android<4.1, PhantomJS<2 // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( collection[ i ], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl ) { jQuery._evalUrl( node.src ); } } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ) .replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return collection; } function remove( elem, selector, keepData ) { var node, elems = selector ? jQuery.filter( selector, elem ) : elem, i = 0; for ( ; ( node = elems[ i ] ) != null; i++ ) { if ( !keepData && node.nodeType === 1 ) { jQuery.cleanData( getAll( node ) ); } if ( node.parentNode ) { if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { setGlobalEval( getAll( node, "script" ) ); } node.parentNode.removeChild( node ); } } return elem; } jQuery.extend( { htmlPrefilter: function( html ) { return html.replace( rxhtmlTag, "<$1></$2>" ); }, clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( support.html5Clone || jQuery.isXMLDoc( elem ) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( ( !support.noCloneEvent || !support.noCloneChecked ) && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[ i ] ) { fixCloneNodeIssues( node, destElements[ i ] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { cloneCopyEvent( node, destElements[ i ] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, cleanData: function( elems, /* internal */ forceAcceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, attributes = support.attributes, special = jQuery.event.special; for ( ; ( elem = elems[ i ] ) != null; i++ ) { if ( forceAcceptData || acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // Support: IE<9 // IE does not allow us to delete expando properties from nodes // IE creates expando attributes along with the property // IE does not have a removeAttribute function on Document nodes if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { elem.removeAttribute( internalKey ); // Webkit & Blink performance suffers when deleting properties // from DOM nodes, so set to undefined instead // https://code.google.com/p/chromium/issues/detail?id=378607 } else { elem[ internalKey ] = undefined; } deletedIds.push( id ); } } } } } } ); jQuery.fn.extend( { // Keep domManip exposed until 3.0 (gh-2225) domManip: domManip, detach: function( selector ) { return remove( this, selector, true ); }, remove: function( selector ) { return remove( this, selector ); }, text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } } ); }, prepend: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } } ); }, before: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } } ); }, after: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } } ); }, empty: function() { var elem, i = 0; for ( ; ( elem = this[ i ] ) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); } ); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( support.htmlSerialize || !rnoshimcache.test( value ) ) && ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { value = jQuery.htmlPrefilter( value ); try { for ( ; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[ i ] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch ( e ) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var ignored = []; // Make the changes, replacing each non-ignored context element with the new content return domManip( this, arguments, function( elem ) { var parent = this.parentNode; if ( jQuery.inArray( this, ignored ) < 0 ) { jQuery.cleanData( getAll( this ) ); if ( parent ) { parent.replaceChild( elem, this ); } } // Force callback invocation }, ignored ); } } ); jQuery.each( { appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone( true ); jQuery( insert[ i ] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; } ); var iframe, elemdisplay = { // Support: Firefox // We have to pre-define these values for FF (#10227) HTML: "block", BODY: "block" }; /** * Retrieve the actual display of a element * @param {String} name nodeName of the element * @param {Object} doc Document object */ // Called only from within defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[ 0 ], "display" ); // We don't have any data stored on the element, // so use "detach" method as fast way to get rid of the element elem.detach(); return display; } /** * Try to determine the default display value of an element * @param {String} nodeName */ function defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) ) .appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; // Support: IE doc.write(); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } var rmargin = ( /^margin/ ); var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); var swap = function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; }; var documentElement = document.documentElement; ( function() { var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal, reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal, container = document.createElement( "div" ), div = document.createElement( "div" ); // Finish early in limited (non-browser) environments if ( !div.style ) { return; } div.style.cssText = "float:left;opacity:.5"; // Support: IE<9 // Make sure that element opacity exists (as opposed to filter) support.opacity = div.style.opacity === "0.5"; // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!div.style.cssFloat; div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; container = document.createElement( "div" ); container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + "padding:0;margin-top:1px;position:absolute"; div.innerHTML = ""; container.appendChild( div ); // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" || div.style.WebkitBoxSizing === ""; jQuery.extend( support, { reliableHiddenOffsets: function() { if ( pixelPositionVal == null ) { computeStyleTests(); } return reliableHiddenOffsetsVal; }, boxSizingReliable: function() { // We're checking for pixelPositionVal here instead of boxSizingReliableVal // since that compresses better and they're computed together anyway. if ( pixelPositionVal == null ) { computeStyleTests(); } return boxSizingReliableVal; }, pixelMarginRight: function() { // Support: Android 4.0-4.3 if ( pixelPositionVal == null ) { computeStyleTests(); } return pixelMarginRightVal; }, pixelPosition: function() { if ( pixelPositionVal == null ) { computeStyleTests(); } return pixelPositionVal; }, reliableMarginRight: function() { // Support: Android 2.3 if ( pixelPositionVal == null ) { computeStyleTests(); } return reliableMarginRightVal; }, reliableMarginLeft: function() { // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 if ( pixelPositionVal == null ) { computeStyleTests(); } return reliableMarginLeftVal; } } ); function computeStyleTests() { var contents, divStyle, documentElement = document.documentElement; // Setup documentElement.appendChild( container ); div.style.cssText = // Support: Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:border-box;box-sizing:border-box;" + "position:relative;display:block;" + "margin:auto;border:1px;padding:1px;" + "top:1%;width:50%"; // Support: IE<9 // Assume reasonable values in the absence of getComputedStyle pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false; pixelMarginRightVal = reliableMarginRightVal = true; // Check for getComputedStyle so that this code is not run in IE<9. if ( window.getComputedStyle ) { divStyle = window.getComputedStyle( div ); pixelPositionVal = ( divStyle || {} ).top !== "1%"; reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px"; boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px"; // Support: Android 4.0 - 4.3 only // Some styles come back with percentage values, even though they shouldn't div.style.marginRight = "50%"; pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px"; // Support: Android 2.3 only // Div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container (#3333) // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right contents = div.appendChild( document.createElement( "div" ) ); // Reset CSS: box-sizing; display; margin; border; padding contents.style.cssText = div.style.cssText = // Support: Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; contents.style.marginRight = contents.style.width = "0"; div.style.width = "1px"; reliableMarginRightVal = !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight ); div.removeChild( contents ); } // Support: IE6-8 // First check that getClientRects works as expected // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.style.display = "none"; reliableHiddenOffsetsVal = div.getClientRects().length === 0; if ( reliableHiddenOffsetsVal ) { div.style.display = ""; div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; div.childNodes[ 0 ].style.borderCollapse = "separate"; contents = div.getElementsByTagName( "td" ); contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; if ( reliableHiddenOffsetsVal ) { contents[ 0 ].style.display = ""; contents[ 1 ].style.display = "none"; reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; } } // Teardown documentElement.removeChild( container ); } } )(); var getStyles, curCSS, rposition = /^(top|right|bottom|left)$/; if ( window.getComputedStyle ) { getStyles = function( elem ) { // Support: IE<=11+, Firefox<=30+ (#15098, #14150) // IE throws on elements created in popups // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" var view = elem.ownerDocument.defaultView; if ( !view || !view.opener ) { view = window; } return view.getComputedStyle( elem ); }; curCSS = function( elem, name, computed ) { var width, minWidth, maxWidth, ret, style = elem.style; computed = computed || getStyles( elem ); // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; // Support: Opera 12.1x only // Fall back to style even without computed // computed is undefined for elems on document fragments if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } if ( computed ) { // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" // instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, // but width seems to be reliably pixels // this is against the CSSOM draft spec: // http://dev.w3.org/csswg/cssom/#resolved-values if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } // Support: IE // IE returns zIndex value as an integer. return ret === undefined ? ret : ret + ""; }; } else if ( documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, computed ) { var left, rs, rsLeft, ret, style = elem.style; computed = computed || getStyles( elem ); ret = computed ? computed[ name ] : undefined; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are // proportional to the parent element instead // and we can't measure the parent instead because it // might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } // Support: IE // IE returns zIndex value as an integer. return ret === undefined ? ret : ret + "" || "auto"; }; } function addGetHookIf( conditionFn, hookFn ) { // Define the hook, we'll check on the first run if it's really needed. return { get: function() { if ( conditionFn() ) { // Hook not needed (or it's not possible to use it due // to missing dependency), remove it. delete this.get; return; } // Hook needed; redefine it so that the support test is not executed again. return ( this.get = hookFn ).apply( this, arguments ); } }; } var ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/i, // swappable if display is none or starts with table except // "table", "table-cell", or "table-caption" // see here for display values: // https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: "0", fontWeight: "400" }, cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], emptyStyle = document.createElement( "div" ).style; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( name ) { // shortcut for names that are not vendor prefixed if ( name in emptyStyle ) { return name; } // check for vendor prefixed names var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ), i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in emptyStyle ) { return name; } } } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) ); } } else { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test( val ) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } jQuery.extend( { // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "animationIterationCount": true, "columnCount": true, "fillOpacity": true, "flexGrow": true, "flexShrink": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // Convert "+=" or "-=" to relative numbers (#7345) if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { value = adjustCSS( elem, name, ret ); // Fixes bug #9237 type = "number"; } // Make sure that null and NaN values aren't set. See: #7116 if ( value == null || value !== value ) { return; } // If a number was passed in, add the unit (except for certain CSS properties) if ( type === "number" ) { value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight // (for every problematic property) identical functions if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !( "set" in hooks ) || ( value = hooks.set( elem, value, extra ) ) !== undefined ) { // Support: IE // Swallow errors from 'invalid' CSS values (#5509) try { style[ name ] = value; } catch ( e ) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || isFinite( num ) ? num || 0 : val; } return val; } } ); jQuery.each( [ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); } ) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; } ); if ( !support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( ( computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter ) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - // attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule // or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, function( elem, computed ) { if ( computed ) { return swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } ); jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, function( elem, computed ) { if ( computed ) { return ( parseFloat( curCSS( elem, "marginLeft" ) ) || // Support: IE<=11+ // Running getBoundingClientRect on a disconnected node in IE throws an error // Support: IE8 only // getClientRects() errors on disconnected elems ( jQuery.contains( elem.ownerDocument, elem ) ? elem.getBoundingClientRect().left - swap( elem, { marginLeft: 0 }, function() { return elem.getBoundingClientRect().left; } ) : 0 ) ) + "px"; } } ); // These hooks are used by animate to expand properties jQuery.each( { margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split( " " ) : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } } ); jQuery.fn.extend( { css: function( name, value ) { return access( this, function( elem, name, value ) { var styles, len, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each( function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } } ); } } ); function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || jQuery.easing._default; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; // Use a property on the element directly when it is not a DOM element, // or when there is no matching style property that exists. if ( tween.elem.nodeType !== 1 || tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.nodeType === 1 && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p * Math.PI ) / 2; }, _default: "swing" }; jQuery.fx = Tween.prototype.init; // Back Compat <1.8 extension point jQuery.fx.step = {}; var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; // Animations created synchronously will run synchronously function createFxNow() { window.setTimeout( function() { fxNow = undefined; } ); return ( fxNow = jQuery.now() ); } // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth ? 1 : 0; for ( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } function createTween( value, prop, animation ) { var tween, collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { // we're done with this property return tween; } } } function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always( function() { // doing this makes sure that the complete handler will be called // before this completes anim.always( function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } } ); } ); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated display = jQuery.css( elem, "display" ); // Test default display if display is currently "none" checkDisplay = display === "none" ? jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !support.shrinkWrapBlocks() ) { anim.always( function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; } ); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { // If there is dataShow left over from a stopped hide or show // and we are going to proceed with show, we should pretend to be hidden if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { hidden = true; } else { continue; } } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); // Any non-fx value stops us from restoring the original display value } else { display = undefined; } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done( function() { jQuery( elem ).hide(); } ); } anim.done( function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } } ); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } // If this is a noop like .hide().hide(), restore an overwritten display value } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) { style.display = display; } } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; } ), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // Support: Android 2.3 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ] ); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise( { elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {}, easing: jQuery.easing._default }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.notifyWith( elem, [ animation, 1, 0 ] ); deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } } ), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { if ( jQuery.isFunction( result.stop ) ) { jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = jQuery.proxy( result.stop, result ); } return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue } ) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } jQuery.Animation = jQuery.extend( Animation, { tweeners: { "*": [ function( prop, value ) { var tween = this.createTween( prop, value ); adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); return tween; } ] }, tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.match( rnotwhite ); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; Animation.tweeners[ prop ].unshift( callback ); } }, prefilters: [ defaultPrefilter ], prefilter: function( callback, prepend ) { if ( prepend ) { Animation.prefilters.unshift( callback ); } else { Animation.prefilters.push( callback ); } } } ); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.fn.extend( { fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate( { opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each( function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && ( type == null || timers[ index ].queue === type ) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } } ); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each( function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; } ); } } ); jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; } ); // Generate shortcuts for custom animations jQuery.each( { slideDown: genFx( "show" ), slideUp: genFx( "hide" ), slideToggle: genFx( "toggle" ), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; } ); jQuery.timers = []; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { jQuery.timers.push( timer ); if ( timer() ) { jQuery.fx.start(); } else { jQuery.timers.pop(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { window.clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Based off of the plugin by Clint Helfers, with permission. // http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = window.setTimeout( next, time ); hooks.stop = function() { window.clearTimeout( timeout ); }; } ); }; ( function() { var a, input = document.createElement( "input" ), div = document.createElement( "div" ), select = document.createElement( "select" ), opt = select.appendChild( document.createElement( "option" ) ); // Setup div = document.createElement( "div" ); div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; a = div.getElementsByTagName( "a" )[ 0 ]; // Support: Windows Web Apps (WWA) // `type` must use .setAttribute for WWA (#14901) input.setAttribute( "type", "checkbox" ); div.appendChild( input ); a = div.getElementsByTagName( "a" )[ 0 ]; // First batch of tests. a.style.cssText = "top:1px"; // Test setAttribute on camelCase class. // If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute( "style" ) ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute( "href" ) === "/a"; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement( "form" ).enctype; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE8 only // Check if we can trust getAttribute("value") input = document.createElement( "input" ); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; } )(); var rreturn = /\r/g, rspaces = /[\x20\t\r\n\f]+/g; jQuery.fn.extend( { val: function( value ) { var hooks, ret, isFunction, elem = this[ 0 ]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && ( ret = hooks.get( elem, "value" ) ) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace( rreturn, "" ) : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each( function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; } ); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } } ); } } ); jQuery.extend( { valHooks: { option: { get: function( elem ) { var val = jQuery.find.attr( elem, "value" ); return val != null ? val : // Support: IE10-11+ // option.text throws exceptions (#14686, #14858) // Strip and collapse whitespace // https://html.spec.whatwg.org/#strip-and-collapse-whitespace jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) { // Support: IE6 // When new option element is added to select box we need to // force reflow of newly added node in order to workaround delay // of initialization properties try { option.selected = optionSet = true; } catch ( _ ) { // Will be executed only in IE6 option.scrollHeight; } } else { option.selected = false; } } // Force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return options; } } } } ); // Radios and checkboxes getter/setter jQuery.each( [ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); } } }; if ( !support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { return elem.getAttribute( "value" ) === null ? "on" : elem.value; }; } } ); var nodeHook, boolHook, attrHandle = jQuery.expr.attrHandle, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = support.getSetAttribute, getSetInput = support.input; jQuery.fn.extend( { attr: function( name, value ) { return access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each( function() { jQuery.removeAttr( this, name ); } ); } } ); jQuery.extend( { attr: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set attributes on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === "undefined" ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); return; } if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } elem.setAttribute( name, value + "" ); return value; } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; }, attrHooks: { type: { set: function( elem, value ) { if ( !support.radioValue && value === "radio" && jQuery.nodeName( elem, "input" ) ) { // Setting the type on a radio button after the value resets the value in IE8-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( ( name = attrNames[ i++ ] ) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } } } ); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); } else { // Support: IE<9 // Use defaultChecked and defaultSelected for oldIE elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = attrHandle[ name ] || jQuery.find.attr; if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { attrHandle[ name ] = function( elem, name, isXML ) { var ret, handle; if ( !isXML ) { // Avoid an infinite loop by temporarily removing this function from the getter handle = attrHandle[ name ]; attrHandle[ name ] = ret; ret = getter( elem, name, isXML ) != null ? name.toLowerCase() : null; attrHandle[ name ] = handle; } return ret; }; } else { attrHandle[ name ] = function( elem, name, isXML ) { if ( !isXML ) { return elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; } }; } } ); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( ( ret = elem.ownerDocument.createAttribute( name ) ) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) if ( name === "value" || value === elem.getAttribute( name ) ) { return value; } } }; // Some attributes are constructed with empty-string values when not defined attrHandle.id = attrHandle.name = attrHandle.coords = function( elem, name, isXML ) { var ret; if ( !isXML ) { return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ? ret.value : null; } }; // Fixing value retrieval on a button requires this module jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); if ( ret && ret.specified ) { return ret.value; } }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each( [ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; } ); } if ( !support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case sensitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } var rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i; jQuery.fn.extend( { prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each( function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch ( e ) {} } ); } } ); jQuery.extend( { prop: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set properties on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } return ( elem[ name ] = value ); } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } return elem[ name ]; }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the // correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } }, propFix: { "for": "htmlFor", "class": "className" } } ); // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each( [ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; } ); } // Support: Safari, IE9+ // Accessing the selectedIndex property // forces the browser to respect setting selected // on the option // The getter ensures a default option is selected // when in an optgroup if ( !support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; }, set: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } } }; } jQuery.each( [ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; } ); // IE6/7 call enctype encoding if ( !support.enctype ) { jQuery.propFix.enctype = "encoding"; } var rclass = /[\t\r\n\f]/g; function getClass( elem ) { return jQuery.attr( elem, "class" ) || ""; } jQuery.fn.extend( { addClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( jQuery.isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); } ); } if ( typeof value === "string" && value ) { classes = value.match( rnotwhite ) || []; while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); cur = elem.nodeType === 1 && ( " " + curValue + " " ).replace( rclass, " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } // only assign if different to avoid unneeded rendering. finalValue = jQuery.trim( cur ); if ( curValue !== finalValue ) { jQuery.attr( elem, "class", finalValue ); } } } } return this; }, removeClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( jQuery.isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); } ); } if ( !arguments.length ) { return this.attr( "class", "" ); } if ( typeof value === "string" && value ) { classes = value.match( rnotwhite ) || []; while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( " " + curValue + " " ).replace( rclass, " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) > -1 ) { cur = cur.replace( " " + clazz + " ", " " ); } } // Only assign if different to avoid unneeded rendering. finalValue = jQuery.trim( cur ); if ( curValue !== finalValue ) { jQuery.attr( elem, "class", finalValue ); } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each( function( i ) { jQuery( this ).toggleClass( value.call( this, i, getClass( this ), stateVal ), stateVal ); } ); } return this.each( function() { var className, i, self, classNames; if ( type === "string" ) { // Toggle individual class names i = 0; self = jQuery( this ); classNames = value.match( rnotwhite ) || []; while ( ( className = classNames[ i++ ] ) ) { // Check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( value === undefined || type === "boolean" ) { className = getClass( this ); if ( className ) { // store className if set jQuery._data( this, "__className__", className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. jQuery.attr( this, "class", className || value === false ? "" : jQuery._data( this, "__className__" ) || "" ); } } ); }, hasClass: function( selector ) { var className, elem, i = 0; className = " " + selector + " "; while ( ( elem = this[ i++ ] ) ) { if ( elem.nodeType === 1 && ( " " + getClass( elem ) + " " ).replace( rclass, " " ) .indexOf( className ) > -1 ) { return true; } } return false; } } ); // Return jQuery for attributes-only inclusion jQuery.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( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; } ); jQuery.fn.extend( { hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } } ); var location = window.location; var nonce = jQuery.now(); var rquery = ( /\?/ ); var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; jQuery.parseJSON = function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { // Support: Android 2.3 // Workaround failure to string-cast null input return window.JSON.parse( data + "" ); } var requireNonComma, depth = null, str = jQuery.trim( data + "" ); // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains // after removing valid tokens return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { // Force termination if we see a misplaced comma if ( requireNonComma && comma ) { depth = 0; } // Perform no more replacements after returning to outermost depth if ( depth === 0 ) { return token; } // Commas must not follow "[", "{", or "," requireNonComma = open || comma; // Determine new depth // array/object open ("[" or "{"): depth += true - false (increment) // array/object close ("]" or "}"): depth += false - true (decrement) // other cases ("," or primitive): depth += true - true (numeric cast) depth += !close - !open; // Remove this token return ""; } ) ) ? ( Function( "return " + str ) )() : jQuery.error( "Invalid JSON: " + data ); }; // Cross-browser xml parsing jQuery.parseXML = function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new window.DOMParser(); xml = tmp.parseFromString( data, "text/xml" ); } else { // IE xml = new window.ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch ( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }; var rhash = /#.*$/, rts = /([?&])_=[^&]*/, // IE leaves an \r character at EOL rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat( "*" ), // Document location ajaxLocation = location.href, // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( ( dataType = dataTypes[ i++ ] ) ) { // Prepend if requested if ( dataType.charAt( 0 ) === "+" ) { dataType = dataType.slice( 1 ) || "*"; ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); // Otherwise append } else { ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } } ); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while ( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } jQuery.extend( { // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks( "once memory" ), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( ( match = rheaders.exec( responseHeadersString ) ) ) { responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ) .replace( rhash, "" ) .replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) fireGlobals = jQuery.event && s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger( "ajaxStart" ); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + nonce++ ) : // Otherwise add one to the end cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? s.accepts[ s.dataTypes[ 0 ] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // If request was aborted inside ajaxSend, stop there if ( state === 2 ) { return jqXHR; } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = window.setTimeout( function() { jqXHR.abort( "timeout" ); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { window.clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader( "Last-Modified" ); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader( "etag" ); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } } ); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } // The url can be an options object (which then must have .url) return jQuery.ajax( jQuery.extend( { url: url, type: method, dataType: type, data: data, success: callback }, jQuery.isPlainObject( url ) && url ) ); }; } ); jQuery._evalUrl = function( url ) { return jQuery.ajax( { url: url, // Make this explicit, since user can override this through ajaxSetup (#11264) type: "GET", dataType: "script", cache: true, async: false, global: false, "throws": true } ); }; jQuery.fn.extend( { wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each( function( i ) { jQuery( this ).wrapAll( html.call( this, i ) ); } ); } if ( this[ 0 ] ) { // The elements to wrap the target around var wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); if ( this[ 0 ].parentNode ) { wrap.insertBefore( this[ 0 ] ); } wrap.map( function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; } ).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each( function( i ) { jQuery( this ).wrapInner( html.call( this, i ) ); } ); } return this.each( function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } } ); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each( function( i ) { jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); } ); }, unwrap: function() { return this.parent().each( function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } } ).end(); } } ); function getDisplay( elem ) { return elem.style && elem.style.display || jQuery.css( elem, "display" ); } function filterHidden( elem ) { // Disconnected elements are considered hidden if ( !jQuery.contains( elem.ownerDocument || document, elem ) ) { return true; } while ( elem && elem.nodeType === 1 ) { if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) { return true; } elem = elem.parentNode; } return false; } jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return support.reliableHiddenOffsets() ? ( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 && !elem.getClientRects().length ) : filterHidden( elem ); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", v, traditional, add ); } } ); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // Serialize an array of form elements or a set of // key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); } ); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; jQuery.fn.extend( { serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map( function() { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; } ) .filter( function() { var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); } ) .map( function( i, elem ) { var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ) { return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ).get(); } } ); // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? // Support: IE6-IE8 function() { // XHR cannot access local files, always use ActiveX for that case if ( this.isLocal ) { return createActiveXHR(); } // Support: IE 9-11 // IE seems to error on cross-domain PATCH requests when ActiveX XHR // is used. In IE 9+ always use the native XHR. // Note: this condition won't catch Edge as it doesn't define // document.documentMode but it also doesn't support ActiveX so it won't // reach this code. if ( document.documentMode > 8 ) { return createStandardXHR(); } // Support: IE<9 // oldIE XHR does not support non-RFC2616 methods (#13240) // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 // Although this check for six methods instead of eight // since IE also does not support "trace" and "connect" return /^(get|post|head|put|delete|options)$/i.test( this.type ) && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; var xhrId = 0, xhrCallbacks = {}, xhrSupported = jQuery.ajaxSettings.xhr(); // Support: IE<10 // Open requests must be manually aborted on unload (#5280) // See https://support.microsoft.com/kb/2856746 for more info if ( window.attachEvent ) { window.attachEvent( "onunload", function() { for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } } ); } // Determine support properties support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport( function( options ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !options.crossDomain || support.cors ) { var callback; return { send: function( headers, complete ) { var i, xhr = options.xhr(), id = ++xhrId; // Open the socket xhr.open( options.type, options.url, options.async, options.username, options.password ); // Apply custom fields if provided if ( options.xhrFields ) { for ( i in options.xhrFields ) { xhr[ i ] = options.xhrFields[ i ]; } } // Override mime type if needed if ( options.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( options.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { headers[ "X-Requested-With" ] = "XMLHttpRequest"; } // Set headers for ( i in headers ) { // Support: IE<9 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting // request header to a null-value. // // To keep consistent with other XHR implementations, cast the value // to string and ignore `undefined`. if ( headers[ i ] !== undefined ) { xhr.setRequestHeader( i, headers[ i ] + "" ); } } // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( options.hasContent && options.data ) || null ); // Listener callback = function( _, isAbort ) { var status, statusText, responses; // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Clean up delete xhrCallbacks[ id ]; callback = undefined; xhr.onreadystatechange = jQuery.noop; // Abort manually if needed if ( isAbort ) { if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; // Support: IE<10 // Accessing binary-data responseText throws an exception // (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch ( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && options.isLocal && !options.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, xhr.getAllResponseHeaders() ); } }; // Do send the request // `xhr.send` may raise an exception, but it will be // handled in jQuery.ajax (so no try/catch here) if ( !options.async ) { // If we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback window.setTimeout( callback ); } else { // Register the callback, but delay it in case `xhr.send` throws // Add to the list of active xhr callbacks xhr.onreadystatechange = xhrCallbacks[ id ] = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } } ); } // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch ( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch ( e ) {} } // Install script dataType jQuery.ajaxSetup( { accepts: { script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } } ); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } } ); // Bind script tag hack transport jQuery.ajaxTransport( "script", function( s ) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery( "head" )[ 0 ] || document.documentElement; return { send: function( _, callback ) { script = document.createElement( "script" ); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } } ); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup( { jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); this[ callback ] = true; return callback; } } ); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && ( s.contentType || "" ) .indexOf( "application/x-www-form-urlencoded" ) === 0 && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters[ "script json" ] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always( function() { // If previous value didn't exist - remove it if ( overwritten === undefined ) { jQuery( window ).removeProp( callbackName ); // Otherwise restore preexisting value } else { window[ callbackName ] = overwritten; } // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; } ); // Delegate to script return "script"; } } ); // data: string of html // context (optional): If specified, the fragment will be created in this context, // defaults to document // keepScripts (optional): If true, will include scripts passed in the html string jQuery.parseHTML = function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[ 1 ] ) ]; } parsed = buildFragment( [ data ], context, scripts ); if ( scripts && scripts.length ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }; // Keep a copy of the old load method var _load = jQuery.fn.load; /** * Load a url into a page */ jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, type, response, self = this, off = url.indexOf( " " ); if ( off > -1 ) { selector = jQuery.trim( url.slice( off, url.length ) ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax( { url: url, // If "type" variable is undefined, then "GET" method will be used. // Make value of this field explicit since // user can override it through ajaxSetup method type: type || "GET", dataType: "html", data: params } ).done( function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); // If the request succeeds, this function gets "data", "status", "jqXHR" // but they are ignored because response was set above. // If it fails, this function gets "jqXHR", "status", "error" } ).always( callback && function( jqXHR, status ) { self.each( function() { callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); } ); } ); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { jQuery.fn[ type ] = function( fn ) { return this.on( type, fn ); }; } ); jQuery.expr.filters.animated = function( elem ) { return jQuery.grep( jQuery.timers, function( fn ) { return elem === fn.elem; } ).length; }; /** * Gets a window from an element */ function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } jQuery.offset = { setOffset: function( elem, options, i ) { var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css( elem, "position" ), curElem = jQuery( elem ), props = {}; // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } curOffset = curElem.offset(); curCSSTop = jQuery.css( elem, "top" ); curCSSLeft = jQuery.css( elem, "left" ); calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray( "auto", [ curCSSTop, curCSSLeft ] ) > -1; // need to be able to calculate position if either top or left // is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend( { offset: function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each( function( i ) { jQuery.offset.setOffset( this, options, i ); } ); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== "undefined" ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }, position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, // because it is its only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) }; }, offsetParent: function() { return this.map( function() { var offsetParent = this.offsetParent; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || documentElement; } ); } } ); // Create scrollLeft and scrollTop methods jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? ( prop in win ) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; } ); // Support: Safari<7-8+, Chrome<37-44+ // Add the top/left cssHooks using jQuery.fn.position // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } ); } ); // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], // whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, // but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; } ); } ); jQuery.fn.extend( { bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } } ); // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. // Note that for maximum portability, libraries that are not jQuery should // declare themselves as anonymous modules, and avoid setting a global if an // AMD loader is present. jQuery is a special case. For more information, see // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon if ( typeof define === "function" && define.amd ) { define( "jquery", [], function() { return jQuery; } ); } var // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$; jQuery.noConflict = function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }; // Expose jQuery and $ identifiers, even in // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // and CommonJS for browser emulators (#13566) if ( !noGlobal ) { window.jQuery = window.$ = jQuery; } return jQuery; }));
third_party/closure/closure/goog/ui/container.js
ebidel/mdv
// Copyright 2007 The Closure Library Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Base class for containers that host {@link goog.ui.Control}s, * such as menus and toolbars. Provides default keyboard and mouse event * handling and child management, based on a generalized version of * {@link goog.ui.Menu}. * * * @see ../demos/container.html */ // TODO(user): Fix code/logic duplication between this and goog.ui.Control. // TODO(user): Maybe pull common stuff all the way up into Component...? goog.provide('goog.ui.Container'); goog.provide('goog.ui.Container.EventType'); goog.provide('goog.ui.Container.Orientation'); goog.require('goog.dom'); goog.require('goog.dom.a11y'); goog.require('goog.dom.a11y.State'); goog.require('goog.events.EventType'); goog.require('goog.events.KeyCodes'); goog.require('goog.events.KeyHandler'); goog.require('goog.events.KeyHandler.EventType'); goog.require('goog.style'); goog.require('goog.ui.Component'); goog.require('goog.ui.Component.Error'); goog.require('goog.ui.Component.EventType'); goog.require('goog.ui.Component.State'); goog.require('goog.ui.ContainerRenderer'); /** * Base class for containers. Extends {@link goog.ui.Component} by adding * the following: * <ul> * <li>a {@link goog.events.KeyHandler}, to simplify keyboard handling, * <li>a pluggable <em>renderer</em> framework, to simplify the creation of * containers without the need to subclass this class, * <li>methods to manage child controls hosted in the container, * <li>default mouse and keyboard event handling methods. * </ul> * @param {?goog.ui.Container.Orientation=} opt_orientation Container * orientation; defaults to {@code VERTICAL}. * @param {?goog.ui.ContainerRenderer=} opt_renderer Renderer used to render or * decorate the container; defaults to {@link goog.ui.ContainerRenderer}. * @param {?goog.dom.DomHelper=} opt_domHelper DOM helper, used for document * interaction. * @extends {goog.ui.Component} * @constructor */ goog.ui.Container = function(opt_orientation, opt_renderer, opt_domHelper) { goog.ui.Component.call(this, opt_domHelper); this.renderer_ = opt_renderer || goog.ui.ContainerRenderer.getInstance(); this.orientation_ = opt_orientation || this.renderer_.getDefaultOrientation(); }; goog.inherits(goog.ui.Container, goog.ui.Component); /** * Container-specific events. * @enum {string} */ goog.ui.Container.EventType = { /** * Dispatched after a goog.ui.Container becomes visible. Non-cancellable. * NOTE(user): This event really shouldn't exist, because the * goog.ui.Component.EventType.SHOW event should behave like this one. But the * SHOW event for containers has been behaving as other components' * BEFORE_SHOW event for a long time, and too much code relies on that old * behavior to fix it now. */ AFTER_SHOW: 'aftershow', /** * Dispatched after a goog.ui.Container becomes invisible. Non-cancellable. */ AFTER_HIDE: 'afterhide' }; /** * Container orientation constants. * @enum {string} */ goog.ui.Container.Orientation = { HORIZONTAL: 'horizontal', VERTICAL: 'vertical' }; /** * Allows an alternative element to be set to recieve key events, otherwise * defers to the renderer's element choice. * @type {Element|undefined} * @private */ goog.ui.Container.prototype.keyEventTarget_ = null; /** * Keyboard event handler. * @type {goog.events.KeyHandler?} * @private */ goog.ui.Container.prototype.keyHandler_ = null; /** * Renderer for the container. Defaults to {@link goog.ui.ContainerRenderer}. * @type {goog.ui.ContainerRenderer?} * @private */ goog.ui.Container.prototype.renderer_ = null; /** * Container orientation; determines layout and default keyboard navigation. * @type {?goog.ui.Container.Orientation} * @private */ goog.ui.Container.prototype.orientation_ = null; /** * Whether the container is set to be visible. Defaults to true. * @type {boolean} * @private */ goog.ui.Container.prototype.visible_ = true; /** * Whether the container is enabled and reacting to keyboard and mouse events. * Defaults to true. * @type {boolean} * @private */ goog.ui.Container.prototype.enabled_ = true; /** * Whether the container supports keyboard focus. Defaults to true. Focusable * containers have a {@code tabIndex} and can be navigated to via the keyboard. * @type {boolean} * @private */ goog.ui.Container.prototype.focusable_ = true; /** * The 0-based index of the currently highlighted control in the container * (-1 if none). * @type {number} * @private */ goog.ui.Container.prototype.highlightedIndex_ = -1; /** * The currently open (expanded) control in the container (null if none). * @type {goog.ui.Control?} * @private */ goog.ui.Container.prototype.openItem_ = null; /** * Whether the mouse button is held down. Defaults to false. This flag is set * when the user mouses down over the container, and remains set until they * release the mouse button. * @type {boolean} * @private */ goog.ui.Container.prototype.mouseButtonPressed_ = false; /** * Whether focus of child components should be allowed. Only effective if * focusable_ is set to false. * @type {boolean} * @private */ goog.ui.Container.prototype.allowFocusableChildren_ = false; /** * Whether highlighting a child component should also open it. * @type {boolean} * @private */ goog.ui.Container.prototype.openFollowsHighlight_ = true; /** * Map of DOM IDs to child controls. Each key is the DOM ID of a child * control's root element; each value is a reference to the child control * itself. Used for looking up the child control corresponding to a DOM * node in O(1) time. * @type {Object} * @private */ goog.ui.Container.prototype.childElementIdMap_ = null; // Event handler and renderer management. /** * Returns the DOM element on which the container is listening for keyboard * events (null if none). * @return {Element} Element on which the container is listening for key * events. */ goog.ui.Container.prototype.getKeyEventTarget = function() { // Delegate to renderer, unless we've set an explicit target. return this.keyEventTarget_ || this.renderer_.getKeyEventTarget(this); }; /** * Attaches an element on which to listen for key events. * @param {Element|undefined} element The element to attach, or null/undefined * to attach to the default element. */ goog.ui.Container.prototype.setKeyEventTarget = function(element) { if (this.focusable_) { var oldTarget = this.getKeyEventTarget(); var inDocument = this.isInDocument(); this.keyEventTarget_ = element; var newTarget = this.getKeyEventTarget(); if (inDocument) { // Unlisten for events on the old key target. Requires us to reset // key target state temporarily. this.keyEventTarget_ = oldTarget; this.enableFocusHandling_(false); this.keyEventTarget_ = element; // Listen for events on the new key target. this.getKeyHandler().attach(newTarget); this.enableFocusHandling_(true); } } else { throw Error('Can\'t set key event target for container ' + 'that doesn\'t support keyboard focus!'); } }; /** * Returns the keyboard event handler for this container, lazily created the * first time this method is called. The keyboard event handler listens for * keyboard events on the container's key event target, as determined by its * renderer. * @return {goog.events.KeyHandler} Keyboard event handler for this container. */ goog.ui.Container.prototype.getKeyHandler = function() { return this.keyHandler_ || (this.keyHandler_ = new goog.events.KeyHandler(this.getKeyEventTarget())); }; /** * Returns the renderer used by this container to render itself or to decorate * an existing element. * @return {goog.ui.ContainerRenderer} Renderer used by the container. */ goog.ui.Container.prototype.getRenderer = function() { return this.renderer_; }; /** * Registers the given renderer with the container. Changing renderers after * the container has already been rendered or decorated is an error. * @param {goog.ui.ContainerRenderer} renderer Renderer used by the container. */ goog.ui.Container.prototype.setRenderer = function(renderer) { if (this.getElement()) { // Too late. throw Error(goog.ui.Component.Error.ALREADY_RENDERED); } this.renderer_ = renderer; }; // Standard goog.ui.Component implementation. /** * Creates the container's DOM. Overrides {@link goog.ui.Component#createDom}. */ goog.ui.Container.prototype.createDom = function() { // Delegate to renderer. this.setElementInternal(this.renderer_.createDom(this)); }; /** * Returns the DOM element into which child components are to be rendered, * or null if the container itself hasn't been rendered yet. Overrides * {@link goog.ui.Component#getContentElement} by delegating to the renderer. * @return {Element} Element to contain child elements (null if none). */ goog.ui.Container.prototype.getContentElement = function() { // Delegate to renderer. return this.renderer_.getContentElement(this.getElement()); }; /** * Returns true if the given element can be decorated by this container. * Overrides {@link goog.ui.Component#canDecorate}. * @param {Element} element Element to decorate. * @return {boolean} True iff the element can be decorated. */ goog.ui.Container.prototype.canDecorate = function(element) { // Delegate to renderer. return this.renderer_.canDecorate(element); }; /** * Decorates the given element with this container. Overrides {@link * goog.ui.Component#decorateInternal}. Considered protected. * @param {Element} element Element to decorate. */ goog.ui.Container.prototype.decorateInternal = function(element) { // Delegate to renderer. this.setElementInternal(this.renderer_.decorate(this, element)); // Check whether the decorated element is explicitly styled to be invisible. if (element.style.display == 'none') { this.visible_ = false; } }; /** * Configures the container after its DOM has been rendered, and sets up event * handling. Overrides {@link goog.ui.Component#enterDocument}. */ goog.ui.Container.prototype.enterDocument = function() { goog.ui.Container.superClass_.enterDocument.call(this); this.forEachChild(function(child) { if (child.isInDocument()) { this.registerChildId_(child); } }, this); // Detect right-to-left direction. var elem = this.getElement(); // Call the renderer's initializeDom method to initialize the container's DOM. this.renderer_.initializeDom(this); // Initialize visibility (opt_force = true, so we don't dispatch events). this.setVisible(this.visible_, true); // Handle events dispatched by child controls. this.getHandler(). listen(this, goog.ui.Component.EventType.ENTER, this.handleEnterItem). listen(this, goog.ui.Component.EventType.HIGHLIGHT, this.handleHighlightItem). listen(this, goog.ui.Component.EventType.UNHIGHLIGHT, this.handleUnHighlightItem). listen(this, goog.ui.Component.EventType.OPEN, this.handleOpenItem). listen(this, goog.ui.Component.EventType.CLOSE, this.handleCloseItem). // Handle mouse events. listen(elem, goog.events.EventType.MOUSEDOWN, this.handleMouseDown). listen(goog.dom.getOwnerDocument(elem), goog.events.EventType.MOUSEUP, this.handleDocumentMouseUp). // Handle mouse events on behalf of cpresently2ontrols in the container. listen(elem, [ goog.events.EventType.MOUSEDOWN, goog.events.EventType.MOUSEUP, goog.events.EventType.MOUSEOVER, goog.events.EventType.MOUSEOUT ], this.handleChildMouseEvents); // If the container is focusable, set up keyboard event handling. if (this.isFocusable()) { this.enableFocusHandling_(true); } }; /** * Sets up listening for events applicable to focusable containers. * @param {boolean} enable Whether to enable or disable focus handling. * @private */ goog.ui.Container.prototype.enableFocusHandling_ = function(enable) { var handler = this.getHandler(); var keyTarget = this.getKeyEventTarget(); if (enable) { handler. listen(keyTarget, goog.events.EventType.FOCUS, this.handleFocus). listen(keyTarget, goog.events.EventType.BLUR, this.handleBlur). listen(this.getKeyHandler(), goog.events.KeyHandler.EventType.KEY, this.handleKeyEvent); } else { handler. unlisten(keyTarget, goog.events.EventType.FOCUS, this.handleFocus). unlisten(keyTarget, goog.events.EventType.BLUR, this.handleBlur). unlisten(this.getKeyHandler(), goog.events.KeyHandler.EventType.KEY, this.handleKeyEvent); } }; /** * Cleans up the container before its DOM is removed from the document, and * removes event handlers. Overrides {@link goog.ui.Component#exitDocument}. */ goog.ui.Container.prototype.exitDocument = function() { // {@link #setHighlightedIndex} has to be called before // {@link goog.ui.Component#exitDocument}, otherwise it has no effect. this.setHighlightedIndex(-1); if (this.openItem_) { this.openItem_.setOpen(false); } this.mouseButtonPressed_ = false; goog.ui.Container.superClass_.exitDocument.call(this); }; /** @inheritDoc */ goog.ui.Container.prototype.disposeInternal = function() { goog.ui.Container.superClass_.disposeInternal.call(this); if (this.keyHandler_) { this.keyHandler_.dispose(); this.keyHandler_ = null; } this.childElementIdMap_ = null; this.openItem_ = null; this.renderer_ = null; }; // Default event handlers. /** * Handles ENTER events raised by child controls when they are navigated to. * @param {goog.events.Event} e ENTER event to handle. * @return {boolean} Whether to prevent handleMouseOver from handling * the event. */ goog.ui.Container.prototype.handleEnterItem = function(e) { // Allow the Control to highlight itself. return true; }; /** * Handles HIGHLIGHT events dispatched by items in the container when * they are highlighted. * @param {goog.events.Event} e Highlight event to handle. */ goog.ui.Container.prototype.handleHighlightItem = function(e) { var index = this.indexOfChild(/** @type {goog.ui.Control} */ (e.target)); if (index > -1 && index != this.highlightedIndex_) { var item = this.getHighlighted(); if (item) { // Un-highlight previously highlighted item. item.setHighlighted(false); } this.highlightedIndex_ = index; item = this.getHighlighted(); if (this.isMouseButtonPressed()) { // Activate item when mouse button is pressed, to allow MacOS-style // dragging to choose menu items. Although this should only truly // happen if the highlight is due to mouse movements, there is little // harm in doing it for keyboard or programmatic highlights. item.setActive(true); } // Update open item if open item needs follow highlight. if (this.openFollowsHighlight_ && this.openItem_ && item != this.openItem_) { if (item.isSupportedState(goog.ui.Component.State.OPENED)) { item.setOpen(true); } else { this.openItem_.setOpen(false); } } } goog.dom.a11y.setState(this.getElement(), goog.dom.a11y.State.ACTIVEDESCENDANT, e.target.getElement().id); }; /** * Handles UNHIGHLIGHT events dispatched by items in the container when * they are unhighlighted. * @param {goog.events.Event} e Unhighlight event to handle. */ goog.ui.Container.prototype.handleUnHighlightItem = function(e) { if (e.target == this.getHighlighted()) { this.highlightedIndex_ = -1; } goog.dom.a11y.setState(this.getElement(), goog.dom.a11y.State.ACTIVEDESCENDANT, ''); }; /** * Handles OPEN events dispatched by items in the container when they are * opened. * @param {goog.events.Event} e Open event to handle. */ goog.ui.Container.prototype.handleOpenItem = function(e) { var item = /** @type {goog.ui.Control} */ (e.target); if (item && item != this.openItem_ && item.getParent() == this) { if (this.openItem_) { this.openItem_.setOpen(false); } this.openItem_ = item; } }; /** * Handles CLOSE events dispatched by items in the container when they are * closed. * @param {goog.events.Event} e Close event to handle. */ goog.ui.Container.prototype.handleCloseItem = function(e) { if (e.target == this.openItem_) { this.openItem_ = null; } }; /** * Handles mousedown events over the container. The default implementation * sets the "mouse button pressed" flag and, if the container is focusable, * grabs keyboard focus. * @param {goog.events.BrowserEvent} e Mousedown event to handle. */ goog.ui.Container.prototype.handleMouseDown = function(e) { if (this.enabled_) { this.setMouseButtonPressed(true); } var keyTarget = this.getKeyEventTarget(); if (this.renderer_.hasTabIndex(keyTarget)) { // The container is configured to receive keyboard focus. keyTarget.focus(); } else { // The control isn't configured to receive keyboard focus; prevent it // from stealing focus or destroying the selection. e.preventDefault(); } }; /** * Handles mouseup events over the document. The default implementation * clears the "mouse button pressed" flag. * @param {goog.events.BrowserEvent} e Mouseup event to handle. */ goog.ui.Container.prototype.handleDocumentMouseUp = function(e) { this.setMouseButtonPressed(false); }; /** * Handles mouse events originating from nodes belonging to the controls hosted * in the container. Locates the child control based on the DOM node that * dispatched the event, and forwards the event to the control for handling. * @param {goog.events.BrowserEvent} e Mouse event to handle. */ goog.ui.Container.prototype.handleChildMouseEvents = function(e) { var control = this.getOwnerControl(/** @type {Node} */ (e.target)); if (control) { // Child control identified; forward the event. switch (e.type) { case goog.events.EventType.MOUSEDOWN: control.handleMouseDown(e); break; case goog.events.EventType.MOUSEUP: control.handleMouseUp(e); break; case goog.events.EventType.MOUSEOVER: control.handleMouseOver(e); break; case goog.events.EventType.MOUSEOUT: control.handleMouseOut(e); break; } } }; /** * Returns the child control that owns the given DOM node, or null if no such * control is found. * @param {Node} node DOM node whose owner is to be returned. * @return {goog.ui.Control?} Control hosted in the container to which the node * belongs (if found). * @protected */ goog.ui.Container.prototype.getOwnerControl = function(node) { // Ensure that this container actually has child controls before // looking up the owner. if (this.childElementIdMap_) { var elem = this.getElement(); while (node && node.parentNode && node != elem) { var id = node.id; if (id in this.childElementIdMap_) { return this.childElementIdMap_[id]; } node = node.parentNode; } } return null; }; /** * Handles focus events raised when the container's key event target receives * keyboard focus. * @param {goog.events.BrowserEvent} e Focus event to handle. */ goog.ui.Container.prototype.handleFocus = function(e) { // No-op in the base class. }; /** * Handles blur events raised when the container's key event target loses * keyboard focus. The default implementation clears the highlight index. * @param {goog.events.BrowserEvent} e Blur event to handle. */ goog.ui.Container.prototype.handleBlur = function(e) { this.setHighlightedIndex(-1); this.setMouseButtonPressed(false); // If the container loses focus, and one of its children is open, close it. if (this.openItem_) { this.openItem_.setOpen(false); } }; /** * Attempts to handle a keyboard event, if the control is enabled, by calling * {@link handleKeyEventInternal}. Considered protected; should only be used * within this package and by subclasses. * @param {goog.events.KeyEvent} e Key event to handle. * @return {boolean} Whether the key event was handled. */ goog.ui.Container.prototype.handleKeyEvent = function(e) { if (this.isEnabled() && this.isVisible() && (this.getChildCount() != 0 || this.keyEventTarget_) && this.handleKeyEventInternal(e)) { e.preventDefault(); e.stopPropagation(); return true; } return false; }; /** * Attempts to handle a keyboard event; returns true if the event was handled, * false otherwise. If the container is enabled, and a child is highlighted, * calls the child control's {@code handleKeyEvent} method to give the control * a chance to handle the event first. * @param {goog.events.KeyEvent} e Key event to handle. * @return {boolean} Whether the event was handled by the container (or one of * its children). */ goog.ui.Container.prototype.handleKeyEventInternal = function(e) { // Give the highlighted control the chance to handle the key event. var highlighted = this.getHighlighted(); if (highlighted && typeof highlighted.handleKeyEvent == 'function' && highlighted.handleKeyEvent(e)) { return true; } // Give the open control the chance to handle the key event. if (this.openItem_ && this.openItem_ != highlighted && typeof this.openItem_.handleKeyEvent == 'function' && this.openItem_.handleKeyEvent(e)) { return true; } // Either nothing is highlighted, or the highlighted control didn't handle // the key event, so attempt to handle it here. switch (e.keyCode) { case goog.events.KeyCodes.ESC: if (this.isFocusable()) { this.getKeyEventTarget().blur(); } else { return false; } break; case goog.events.KeyCodes.HOME: this.highlightFirst(); break; case goog.events.KeyCodes.END: this.highlightLast(); break; case goog.events.KeyCodes.UP: if (this.orientation_ == goog.ui.Container.Orientation.VERTICAL) { this.highlightPrevious(); } else { return false; } break; case goog.events.KeyCodes.LEFT: if (this.orientation_ == goog.ui.Container.Orientation.HORIZONTAL) { if (this.isRightToLeft()) { this.highlightNext(); } else { this.highlightPrevious(); } } else { return false; } break; case goog.events.KeyCodes.DOWN: if (this.orientation_ == goog.ui.Container.Orientation.VERTICAL) { this.highlightNext(); } else { return false; } break; case goog.events.KeyCodes.RIGHT: if (this.orientation_ == goog.ui.Container.Orientation.HORIZONTAL) { if (this.isRightToLeft()) { this.highlightPrevious(); } else { this.highlightNext(); } } else { return false; } break; default: return false; } return true; }; // Child component management. /** * Creates a DOM ID for the child control and registers it to an internal * hash table to be able to find it fast by id. * @param {goog.ui.Control} child The child control. Its root element has * to be created yet. * @private */ goog.ui.Container.prototype.registerChildId_ = function(child) { // Map the DOM ID of the control's root element to the control itself. var childElem = child.getElement(); // If the control's root element doesn't have a DOM ID assign one. var id = childElem.id || (childElem.id = child.getId()); // Lazily create the child element ID map on first use. if (!this.childElementIdMap_) { this.childElementIdMap_ = {}; } this.childElementIdMap_[id] = child; }; /** * Adds the specified control as the last child of this container. See * {@link goog.ui.Container#addChildAt} for detailed semantics. * @param {goog.ui.Control} child The new child control. * @param {boolean=} opt_render Whether the new child should be rendered * immediately after being added (defaults to false). */ goog.ui.Container.prototype.addChild = function(child, opt_render) { goog.ui.Container.superClass_.addChild.call(this, child, opt_render); }; /** * Overrides {@link goog.ui.Container#getChild} to make it clear that it * only returns {@link goog.ui.Control}s. * @param {string} id Child component ID. * @return {goog.ui.Control} The child with the given ID; null if none. * @override */ goog.ui.Container.prototype.getChild; /** * Overrides {@link goog.ui.Container#getChildAt} to make it clear that it * only returns {@link goog.ui.Control}s. * @param {number} index 0-based index. * @return {goog.ui.Control} The child with the given ID; null if none. * @override */ goog.ui.Container.prototype.getChildAt; /** * Adds the control as a child of this container at the given 0-based index. * Overrides {@link goog.ui.Component#addChildAt} by also updating the * container's highlight index. Since {@link goog.ui.Component#addChild} uses * {@link #addChildAt} internally, we only need to override this method. * @param {goog.ui.Control} control New child. * @param {number} index Index at which the new child is to be added. * @param {boolean=} opt_render Whether the new child should be rendered * immediately after being added (defaults to false). */ goog.ui.Container.prototype.addChildAt = function(control, index, opt_render) { // Make sure the child control dispatches HIGHLIGHT, UNHIGHLIGHT, OPEN, and // CLOSE events, and that it doesn't steal keyboard focus. control.setDispatchTransitionEvents(goog.ui.Component.State.HOVER, true); control.setDispatchTransitionEvents(goog.ui.Component.State.OPENED, true); if (this.isFocusable() || !this.isFocusableChildrenAllowed()) { control.setSupportedState(goog.ui.Component.State.FOCUSED, false); } // Disable mouse event handling by child controls. control.setHandleMouseEvents(false); // Let the superclass implementation do the work. goog.ui.Container.superClass_.addChildAt.call(this, control, index, opt_render); if (opt_render && this.isInDocument()) { this.registerChildId_(control); } // Update the highlight index, if needed. if (index <= this.highlightedIndex_) { this.highlightedIndex_++; } }; /** * Removes a child control. Overrides {@link goog.ui.Component#removeChild} by * updating the highlight index. Since {@link goog.ui.Component#removeChildAt} * uses {@link #removeChild} internally, we only need to override this method. * @param {string|goog.ui.Control} control The ID of the child to remove, or * the control itself. * @param {boolean=} opt_unrender Whether to call {@code exitDocument} on the * removed control, and detach its DOM from the document (defaults to * false). * @return {goog.ui.Control} The removed control, if any. */ goog.ui.Container.prototype.removeChild = function(control, opt_unrender) { control = goog.isString(control) ? this.getChild(control) : control; if (control) { var index = this.indexOfChild(control); if (index != -1) { if (index == this.highlightedIndex_) { control.setHighlighted(false); } else if (index < this.highlightedIndex_) { this.highlightedIndex_--; } } // Remove the mapping from the child element ID map. var childElem = control.getElement(); if (childElem && childElem.id) { goog.object.remove(this.childElementIdMap_, childElem.id); } } control = /** @type {goog.ui.Control} */ ( goog.ui.Container.superClass_.removeChild.call(this, control, opt_unrender)); // Re-enable mouse event handling (in case the control is reused elsewhere). control.setHandleMouseEvents(true); return control; }; // Container state management. /** * Returns the container's orientation. * @return {?goog.ui.Container.Orientation} Container orientation. */ goog.ui.Container.prototype.getOrientation = function() { return this.orientation_; }; /** * Sets the container's orientation. * @param {goog.ui.Container.Orientation} orientation Container orientation. */ // TODO(user): Do we need to support containers with dynamic orientation? goog.ui.Container.prototype.setOrientation = function(orientation) { if (this.getElement()) { // Too late. throw Error(goog.ui.Component.Error.ALREADY_RENDERED); } this.orientation_ = orientation; }; /** * Returns true if the container's visibility is set to visible, false if * it is set to hidden. A container that is set to hidden is guaranteed * to be hidden from the user, but the reverse isn't necessarily true. * A container may be set to visible but can otherwise be obscured by another * element, rendered off-screen, or hidden using direct CSS manipulation. * @return {boolean} Whether the container is set to be visible. */ goog.ui.Container.prototype.isVisible = function() { return this.visible_; }; /** * Shows or hides the container. Does nothing if the container already has * the requested visibility. Otherwise, dispatches a SHOW or HIDE event as * appropriate, giving listeners a chance to prevent the visibility change. * @param {boolean} visible Whether to show or hide the container. * @param {boolean=} opt_force If true, doesn't check whether the container * already has the requested visibility, and doesn't dispatch any events. * @return {boolean} Whether the visibility was changed. */ goog.ui.Container.prototype.setVisible = function(visible, opt_force) { if (opt_force || (this.visible_ != visible && this.dispatchEvent(visible ? goog.ui.Component.EventType.SHOW : goog.ui.Component.EventType.HIDE))) { this.visible_ = visible; var elem = this.getElement(); if (elem) { goog.style.showElement(elem, visible); if (this.isFocusable()) { // Enable keyboard access only for enabled & visible containers. this.renderer_.enableTabIndex(this.getKeyEventTarget(), this.enabled_ && this.visible_); } if (!opt_force) { this.dispatchEvent(this.visible_ ? goog.ui.Container.EventType.AFTER_SHOW : goog.ui.Container.EventType.AFTER_HIDE); } } return true; } return false; }; /** * Returns true if the container is enabled, false otherwise. * @return {boolean} Whether the container is enabled. */ goog.ui.Container.prototype.isEnabled = function() { return this.enabled_; }; /** * Enables/disables the container based on the {@code enable} argument. * Dispatches an {@code ENABLED} or {@code DISABLED} event prior to changing * the container's state, which may be caught and canceled to prevent the * container from changing state. Also enables/disables child controls. * @param {boolean} enable Whether to enable or disable the container. */ goog.ui.Container.prototype.setEnabled = function(enable) { if (this.enabled_ != enable && this.dispatchEvent(enable ? goog.ui.Component.EventType.ENABLE : goog.ui.Component.EventType.DISABLE)) { if (enable) { // Flag the container as enabled first, then update children. This is // because controls can't be enabled if their parent is disabled. this.enabled_ = true; this.forEachChild(function(child) { // Enable child control unless it is flagged. if (child.wasDisabled) { delete child.wasDisabled; } else { child.setEnabled(true); } }); } else { // Disable children first, then flag the container as disabled. This is // because controls can't be disabled if their parent is already disabled. this.forEachChild(function(child) { // Disable child control, or flag it if it's already disabled. if (child.isEnabled()) { child.setEnabled(false); } else { child.wasDisabled = true; } }); this.enabled_ = false; this.setMouseButtonPressed(false); } if (this.isFocusable()) { // Enable keyboard access only for enabled & visible components. this.renderer_.enableTabIndex(this.getKeyEventTarget(), enable && this.visible_); } } }; /** * Returns true if the container is focusable, false otherwise. The default * is true. Focusable containers always have a tab index and allocate a key * handler to handle keyboard events while focused. * @return {boolean} Whether the component is focusable. */ goog.ui.Container.prototype.isFocusable = function() { return this.focusable_; }; /** * Sets whether the container is focusable. The default is true. Focusable * containers always have a tab index and allocate a key handler to handle * keyboard events while focused. * @param {boolean} focusable Whether the component is to be focusable. */ goog.ui.Container.prototype.setFocusable = function(focusable) { if (focusable != this.focusable_ && this.isInDocument()) { this.enableFocusHandling_(focusable); } this.focusable_ = focusable; if (this.enabled_ && this.visible_) { this.renderer_.enableTabIndex(this.getKeyEventTarget(), focusable); } }; /** * Returns true if the container allows children to be focusable, false * otherwise. Only effective if the container is not focusable. * @return {boolean} Whether children should be focusable. */ goog.ui.Container.prototype.isFocusableChildrenAllowed = function() { return this.allowFocusableChildren_; }; /** * Sets whether the container allows children to be focusable, false * otherwise. Only effective if the container is not focusable. * @param {boolean} focusable Whether the children should be focusable. */ goog.ui.Container.prototype.setFocusableChildrenAllowed = function(focusable) { this.allowFocusableChildren_ = focusable; }; /** * @return {boolean} Whether highlighting a child component should also open it. */ goog.ui.Container.prototype.isOpenFollowsHighlight = function() { return this.openFollowsHighlight_; }; /** * Sets whether highlighting a child component should also open it. * @param {boolean} follow Whether highlighting a child component also opens it. */ goog.ui.Container.prototype.setOpenFollowsHighlight = function(follow) { this.openFollowsHighlight_ = follow; }; // Highlight management. /** * Returns the index of the currently highlighted item (-1 if none). * @return {number} Index of the currently highlighted item. */ goog.ui.Container.prototype.getHighlightedIndex = function() { return this.highlightedIndex_; }; /** * Highlights the item at the given 0-based index (if any). If another item * was previously highlighted, it is un-highlighted. * @param {number} index Index of item to highlight (-1 removes the current * highlight). */ goog.ui.Container.prototype.setHighlightedIndex = function(index) { var child = this.getChildAt(index); if (child) { child.setHighlighted(true); } else if (this.highlightedIndex_ > -1) { this.getHighlighted().setHighlighted(false); } }; /** * Highlights the given item if it exists and is a child of the container; * otherwise un-highlights the currently highlighted item. * @param {goog.ui.Control} item Item to highlight. */ goog.ui.Container.prototype.setHighlighted = function(item) { this.setHighlightedIndex(this.indexOfChild(item)); }; /** * Returns the currently highlighted item (if any). * @return {goog.ui.Control?} Highlighted item (null if none). */ goog.ui.Container.prototype.getHighlighted = function() { return this.getChildAt(this.highlightedIndex_); }; /** * Highlights the first highlightable item in the container */ goog.ui.Container.prototype.highlightFirst = function() { this.highlightHelper(function(index, max) { return (index + 1) % max; }, this.getChildCount() - 1); }; /** * Highlights the last highlightable item in the container. */ goog.ui.Container.prototype.highlightLast = function() { this.highlightHelper(function(index, max) { index--; return index < 0 ? max - 1 : index; }, 0); }; /** * Highlights the next highlightable item (or the first if nothing is currently * highlighted). */ goog.ui.Container.prototype.highlightNext = function() { this.highlightHelper(function(index, max) { return (index + 1) % max; }, this.highlightedIndex_); }; /** * Highlights the previous highlightable item (or the last if nothing is * currently highlighted). */ goog.ui.Container.prototype.highlightPrevious = function() { this.highlightHelper(function(index, max) { index--; return index < 0 ? max - 1 : index; }, this.highlightedIndex_); }; /** * Helper function that manages the details of moving the highlight among * child controls in response to keyboard events. * @param {function(number, number) : number} fn Function that accepts the * current and maximum indices, and returns the next index to check. * @param {number} startIndex Start index. * @return {boolean} Whether the highlight has changed. * @protected */ goog.ui.Container.prototype.highlightHelper = function(fn, startIndex) { // If the start index is -1 (meaning there's nothing currently highlighted), // try starting from the currently open item, if any. var curIndex = startIndex < 0 ? this.indexOfChild(this.openItem_) : startIndex; var numItems = this.getChildCount(); curIndex = fn.call(this, curIndex, numItems); var visited = 0; while (visited <= numItems) { var control = this.getChildAt(curIndex); if (control && this.canHighlightItem(control)) { this.setHighlightedIndexFromKeyEvent(curIndex); return true; } visited++; curIndex = fn.call(this, curIndex, numItems); } return false; }; /** * Returns whether the given item can be highlighted. * @param {goog.ui.Control} item The item to check. * @return {boolean} Whether the item can be highlighted. * @protected */ goog.ui.Container.prototype.canHighlightItem = function(item) { return item.isVisible() && item.isEnabled() && item.isSupportedState(goog.ui.Component.State.HOVER); }; /** * Helper method that sets the highlighted index to the given index in response * to a keyboard event. The base class implementation simply calls the * {@link #setHighlightedIndex} method, but subclasses can override this * behavior as needed. * @param {number} index Index of item to highlight. * @protected */ goog.ui.Container.prototype.setHighlightedIndexFromKeyEvent = function(index) { this.setHighlightedIndex(index); }; /** * Returns the currently open (expanded) control in the container (null if * none). * @return {goog.ui.Control?} The currently open control. */ goog.ui.Container.prototype.getOpenItem = function() { return this.openItem_; }; /** * Returns true if the mouse button is pressed, false otherwise. * @return {boolean} Whether the mouse button is pressed. */ goog.ui.Container.prototype.isMouseButtonPressed = function() { return this.mouseButtonPressed_; }; /** * Sets or clears the "mouse button pressed" flag. * @param {boolean} pressed Whether the mouse button is presed. */ goog.ui.Container.prototype.setMouseButtonPressed = function(pressed) { this.mouseButtonPressed_ = pressed; };
conference/static/conference/jquery-flot/jquery.js
barrachri/epcon
/*! * jQuery JavaScript Library v1.5.1 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Wed Feb 23 13:55:29 2011 -0500 */ (function( window, undefined ) { // Use the correct document accordingly with window argument (sandbox) var document = window.document; var jQuery = (function() { // Define a local copy of jQuery var jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // A central reference to the root jQuery(document) rootjQuery, // A simple way to check for HTML strings or ID strings // (both of which we optimize for) quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, // Check if a string has a non-whitespace character in it rnotwhite = /\S/, // Used for trimming whitespace trimLeft = /^\s+/, trimRight = /\s+$/, // Check for digits rdigit = /\d/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, // Useragent RegExp rwebkit = /(webkit)[ \/]([\w.]+)/, ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, rmsie = /(msie) ([\w.]+)/, rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, // Keep a UserAgent string for use with jQuery.browser userAgent = navigator.userAgent, // For matching the engine and version of the browser browserMatch, // Has the ready events already been bound? readyBound = false, // The deferred used on DOM ready readyList, // Promise methods promiseMethods = "then done fail isResolved isRejected promise".split( " " ), // The ready event handler DOMContentLoaded, // Save a reference to some core methods toString = Object.prototype.toString, hasOwn = Object.prototype.hasOwnProperty, push = Array.prototype.push, slice = Array.prototype.slice, trim = String.prototype.trim, indexOf = Array.prototype.indexOf, // [[Class]] -> type pairs class2type = {}; jQuery.fn = jQuery.prototype = { constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem, ret, doc; // Handle $(""), $(null), or $(undefined) if ( !selector ) { return this; } // Handle $(DOMElement) if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; } // The body element only exists once, optimize finding it if ( selector === "body" && !context && document.body ) { this.context = document; this[0] = document.body; this.selector = "body"; this.length = 1; return this; } // Handle HTML strings if ( typeof selector === "string" ) { // Are we dealing with HTML string or an ID? match = quickExpr.exec( selector ); // Verify a match, and that no context was specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; doc = (context ? context.ownerDocument || context : document); // If a single string is passed in and it's a single tag // just do a createElement and skip the rest ret = rsingleTag.exec( selector ); if ( ret ) { if ( jQuery.isPlainObject( context ) ) { selector = [ document.createElement( ret[1] ) ]; jQuery.fn.attr.call( selector, context, true ); } else { selector = [ doc.createElement( ret[1] ) ]; } } else { ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; } return jQuery.merge( this, selector ); // HANDLE: $("#id") } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return (context || rootjQuery).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if (selector.selector !== undefined) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The current version of jQuery being used jquery: "1.5.1", // The default length of a jQuery object is 0 length: 0, // The number of elements contained in the matched element set size: function() { return this.length; }, toArray: function() { return slice.call( this, 0 ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems, name, selector ) { // Build a new jQuery matched element set var ret = this.constructor(); if ( jQuery.isArray( elems ) ) { push.apply( ret, elems ); } else { jQuery.merge( ret, elems ); } // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; if ( name === "find" ) { ret.selector = this.selector + (this.selector ? " " : "") + selector; } else if ( name ) { ret.selector = this.selector + "." + name + "(" + selector + ")"; } // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Attach the listeners jQuery.bindReady(); // Add the callback readyList.done( fn ); return this; }, eq: function( i ) { return i === -1 ? this.slice( i ) : this.slice( i, +i + 1 ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ), "slice", slice.call(arguments).join(",") ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ noConflict: function( deep ) { window.$ = _$; if ( deep ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Handle when the DOM is ready ready: function( wait ) { // A third-party is pushing the ready event forwards if ( wait === true ) { jQuery.readyWait--; } // Make sure that the DOM is not already loaded if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready, 1 ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger( "ready" ).unbind( "ready" ); } } }, bindReady: function() { if ( readyBound ) { return; } readyBound = true; // Catch cases where $(document).ready() is called after the // browser event has already occurred. if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready return setTimeout( jQuery.ready, 1 ); } // Mozilla, Opera and webkit nightlies currently support this event if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", jQuery.ready, false ); // If IE event model is used } else if ( document.attachEvent ) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", DOMContentLoaded); // A fallback to window.onload, that will always work window.attachEvent( "onload", jQuery.ready ); // If IE and not a frame // continually check to see if the document is ready var toplevel = false; try { toplevel = window.frameElement == null; } catch(e) {} if ( document.documentElement.doScroll && toplevel ) { doScrollCheck(); } } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, // A crude way of determining if an object is a window isWindow: function( obj ) { return obj && typeof obj === "object" && "setInterval" in obj; }, isNaN: function( obj ) { return obj == null || !rdigit.test( obj ) || isNaN( obj ); }, type: function( obj ) { return obj == null ? String( obj ) : class2type[ toString.call(obj) ] || "object"; }, isPlainObject: function( obj ) { // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { for ( var name in obj ) { return false; } return true; }, error: function( msg ) { throw msg; }, parseJSON: function( data ) { if ( typeof data !== "string" || !data ) { return null; } // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test(data.replace(rvalidescape, "@") .replace(rvalidtokens, "]") .replace(rvalidbraces, "")) ) { // Try to use the native JSON parser first return window.JSON && window.JSON.parse ? window.JSON.parse( data ) : (new Function("return " + data))(); } else { jQuery.error( "Invalid JSON: " + data ); } }, // Cross-browser xml parsing // (xml & tmp used internally) parseXML: function( data , xml , tmp ) { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } tmp = xml.documentElement; if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evalulates a script in a global context globalEval: function( data ) { if ( data && rnotwhite.test(data) ) { // Inspired by code by Andrea Giammarchi // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement, script = document.createElement( "script" ); if ( jQuery.support.scriptEval() ) { script.appendChild( document.createTextNode( data ) ); } else { script.text = data; } // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709). head.insertBefore( script, head.firstChild ); head.removeChild( script ); } }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); }, // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length, isObj = length === undefined || jQuery.isFunction(object); if ( args ) { if ( isObj ) { for ( name in object ) { if ( callback.apply( object[ name ], args ) === false ) { break; } } } else { for ( ; i < length; ) { if ( callback.apply( object[ i++ ], args ) === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isObj ) { for ( name in object ) { if ( callback.call( object[ name ], name, object[ name ] ) === false ) { break; } } } else { for ( var value = object[0]; i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} } } return object; }, // Use native String.trim function wherever possible trim: trim ? function( text ) { return text == null ? "" : trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); }, // results is for internal usage only makeArray: function( array, results ) { var ret = results || []; if ( array != null ) { // The window, strings (and functions) also have 'length' // The extra typeof function check is to prevent crashes // in Safari 2 (See: #3039) // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 var type = jQuery.type(array); if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { push.call( ret, array ); } else { jQuery.merge( ret, array ); } } return ret; }, inArray: function( elem, array ) { if ( array.indexOf ) { return array.indexOf( elem ); } for ( var i = 0, length = array.length; i < length; i++ ) { if ( array[ i ] === elem ) { return i; } } return -1; }, merge: function( first, second ) { var i = first.length, j = 0; if ( typeof second.length === "number" ) { for ( var l = second.length; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var ret = [], retVal; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( var i = 0, length = elems.length; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var ret = [], value; // Go through the array, translating each of the items to their // new value (or values). for ( var i = 0, length = elems.length; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Flatten any nested arrays return ret.concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, proxy: function( fn, proxy, thisObject ) { if ( arguments.length === 2 ) { if ( typeof proxy === "string" ) { thisObject = fn; fn = thisObject[ proxy ]; proxy = undefined; } else if ( proxy && !jQuery.isFunction( proxy ) ) { thisObject = proxy; proxy = undefined; } } if ( !proxy && fn ) { proxy = function() { return fn.apply( thisObject || this, arguments ); }; } // Set the guid of unique handler to the same of original handler, so it can be removed if ( fn ) { proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; } // So proxy can be declared as an argument return proxy; }, // Mutifunctional method to get and set values to a collection // The value/s can be optionally by executed if its a function access: function( elems, key, value, exec, fn, pass ) { var length = elems.length; // Setting many attributes if ( typeof key === "object" ) { for ( var k in key ) { jQuery.access( elems, k, key[k], exec, fn, value ); } return elems; } // Setting one attribute if ( value !== undefined ) { // Optionally, function values get executed if exec is true exec = !pass && exec && jQuery.isFunction(value); for ( var i = 0; i < length; i++ ) { fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); } return elems; } // Getting an attribute return length ? fn( elems[0], key ) : undefined; }, now: function() { return (new Date()).getTime(); }, // Create a simple deferred (one callbacks list) _Deferred: function() { var // callbacks list callbacks = [], // stored [ context , args ] fired, // to avoid firing when already doing so firing, // flag to know if the deferred has been cancelled cancelled, // the deferred itself deferred = { // done( f1, f2, ...) done: function() { if ( !cancelled ) { var args = arguments, i, length, elem, type, _fired; if ( fired ) { _fired = fired; fired = 0; } for ( i = 0, length = args.length; i < length; i++ ) { elem = args[ i ]; type = jQuery.type( elem ); if ( type === "array" ) { deferred.done.apply( deferred, elem ); } else if ( type === "function" ) { callbacks.push( elem ); } } if ( _fired ) { deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); } } return this; }, // resolve with given context and args resolveWith: function( context, args ) { if ( !cancelled && !fired && !firing ) { firing = 1; try { while( callbacks[ 0 ] ) { callbacks.shift().apply( context, args ); } } // We have to add a catch block for // IE prior to 8 or else the finally // block will never get executed catch (e) { throw e; } finally { fired = [ context, args ]; firing = 0; } } return this; }, // resolve with this as context and given arguments resolve: function() { deferred.resolveWith( jQuery.isFunction( this.promise ) ? this.promise() : this, arguments ); return this; }, // Has this deferred been resolved? isResolved: function() { return !!( firing || fired ); }, // Cancel cancel: function() { cancelled = 1; callbacks = []; return this; } }; return deferred; }, // Full fledged deferred (two callbacks list) Deferred: function( func ) { var deferred = jQuery._Deferred(), failDeferred = jQuery._Deferred(), promise; // Add errorDeferred methods, then and promise jQuery.extend( deferred, { then: function( doneCallbacks, failCallbacks ) { deferred.done( doneCallbacks ).fail( failCallbacks ); return this; }, fail: failDeferred.done, rejectWith: failDeferred.resolveWith, reject: failDeferred.resolve, isRejected: failDeferred.isResolved, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { if ( obj == null ) { if ( promise ) { return promise; } promise = obj = {}; } var i = promiseMethods.length; while( i-- ) { obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ]; } return obj; } } ); // Make sure only one callback list will be used deferred.done( failDeferred.cancel ).fail( deferred.cancel ); // Unexpose cancel delete deferred.cancel; // Call given func if any if ( func ) { func.call( deferred, deferred ); } return deferred; }, // Deferred helper when: function( object ) { var lastIndex = arguments.length, deferred = lastIndex <= 1 && object && jQuery.isFunction( object.promise ) ? object : jQuery.Deferred(), promise = deferred.promise(); if ( lastIndex > 1 ) { var array = slice.call( arguments, 0 ), count = lastIndex, iCallback = function( index ) { return function( value ) { array[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value; if ( !( --count ) ) { deferred.resolveWith( promise, array ); } }; }; while( ( lastIndex-- ) ) { object = array[ lastIndex ]; if ( object && jQuery.isFunction( object.promise ) ) { object.promise().then( iCallback(lastIndex), deferred.reject ); } else { --count; } } if ( !count ) { deferred.resolveWith( promise, array ); } } else if ( deferred !== object ) { deferred.resolve( object ); } return promise; }, // Use of jQuery.browser is frowned upon. // More details: http://docs.jquery.com/Utilities/jQuery.browser uaMatch: function( ua ) { ua = ua.toLowerCase(); var match = rwebkit.exec( ua ) || ropera.exec( ua ) || rmsie.exec( ua ) || ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || []; return { browser: match[1] || "", version: match[2] || "0" }; }, sub: function() { function jQuerySubclass( selector, context ) { return new jQuerySubclass.fn.init( selector, context ); } jQuery.extend( true, jQuerySubclass, this ); jQuerySubclass.superclass = this; jQuerySubclass.fn = jQuerySubclass.prototype = this(); jQuerySubclass.fn.constructor = jQuerySubclass; jQuerySubclass.subclass = this.subclass; jQuerySubclass.fn.init = function init( selector, context ) { if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) { context = jQuerySubclass(context); } return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass ); }; jQuerySubclass.fn.init.prototype = jQuerySubclass.fn; var rootjQuerySubclass = jQuerySubclass(document); return jQuerySubclass; }, browser: {} }); // Create readyList deferred readyList = jQuery._Deferred(); // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); browserMatch = jQuery.uaMatch( userAgent ); if ( browserMatch.browser ) { jQuery.browser[ browserMatch.browser ] = true; jQuery.browser.version = browserMatch.version; } // Deprecated, use jQuery.browser.webkit instead if ( jQuery.browser.webkit ) { jQuery.browser.safari = true; } if ( indexOf ) { jQuery.inArray = function( elem, array ) { return indexOf.call( array, elem ); }; } // IE doesn't match non-breaking spaces with \s if ( rnotwhite.test( "\xA0" ) ) { trimLeft = /^[\s\xA0]+/; trimRight = /[\s\xA0]+$/; } // All jQuery objects should point back to these rootjQuery = jQuery(document); // Cleanup functions for the document ready method if ( document.addEventListener ) { DOMContentLoaded = function() { document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); jQuery.ready(); }; } else if ( document.attachEvent ) { DOMContentLoaded = function() { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", DOMContentLoaded ); jQuery.ready(); } }; } // The DOM ready check for Internet Explorer function doScrollCheck() { if ( jQuery.isReady ) { return; } try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch(e) { setTimeout( doScrollCheck, 1 ); return; } // and execute any waiting functions jQuery.ready(); } // Expose jQuery to the global object return jQuery; })(); (function() { jQuery.support = {}; var div = document.createElement("div"); div.style.display = "none"; div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; var all = div.getElementsByTagName("*"), a = div.getElementsByTagName("a")[0], select = document.createElement("select"), opt = select.appendChild( document.createElement("option") ), input = div.getElementsByTagName("input")[0]; // Can't get basic test support if ( !all || !all.length || !a ) { return; } jQuery.support = { // IE strips leading whitespace when .innerHTML is used leadingWhitespace: div.firstChild.nodeType === 3, // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables tbody: !div.getElementsByTagName("tbody").length, // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE htmlSerialize: !!div.getElementsByTagName("link").length, // Get the style information from getAttribute // (IE uses .cssText insted) style: /red/.test( a.getAttribute("style") ), // Make sure that URLs aren't manipulated // (IE normalizes it by default) hrefNormalized: a.getAttribute("href") === "/a", // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 opacity: /^0.55$/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Make sure that if no value is specified for a checkbox // that it defaults to "on". // (WebKit defaults to "" instead) checkOn: input.value === "on", // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) optSelected: opt.selected, // Will be defined later deleteExpando: true, optDisabled: false, checkClone: false, noCloneEvent: true, noCloneChecked: true, boxModel: null, inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableHiddenOffsets: true }; input.checked = true; jQuery.support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as diabled) select.disabled = true; jQuery.support.optDisabled = !opt.disabled; var _scriptEval = null; jQuery.support.scriptEval = function() { if ( _scriptEval === null ) { var root = document.documentElement, script = document.createElement("script"), id = "script" + jQuery.now(); try { script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); } catch(e) {} root.insertBefore( script, root.firstChild ); // Make sure that the execution of code works by injecting a script // tag with appendChild/createTextNode // (IE doesn't support this, fails, and uses .text instead) if ( window[ id ] ) { _scriptEval = true; delete window[ id ]; } else { _scriptEval = false; } root.removeChild( script ); // release memory in IE root = script = id = null; } return _scriptEval; }; // Test to see if it's possible to delete an expando from an element // Fails in Internet Explorer try { delete div.test; } catch(e) { jQuery.support.deleteExpando = false; } if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { div.attachEvent("onclick", function click() { // Cloning a node shouldn't copy over any // bound event handlers (IE does this) jQuery.support.noCloneEvent = false; div.detachEvent("onclick", click); }); div.cloneNode(true).fireEvent("onclick"); } div = document.createElement("div"); div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>"; var fragment = document.createDocumentFragment(); fragment.appendChild( div.firstChild ); // WebKit doesn't clone checked state correctly in fragments jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; // Figure out if the W3C box model works as expected // document.body must exist before we can do this jQuery(function() { var div = document.createElement("div"), body = document.getElementsByTagName("body")[0]; // Frameset documents with no body should not run this code if ( !body ) { return; } div.style.width = div.style.paddingLeft = "1px"; body.appendChild( div ); jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; if ( "zoom" in div.style ) { // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout // (IE < 8 does this) div.style.display = "inline"; div.style.zoom = 1; jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; // Check if elements with layout shrink-wrap their children // (IE 6 does this) div.style.display = ""; div.innerHTML = "<div style='width:4px;'></div>"; jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; } div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>"; var tds = div.getElementsByTagName("td"); // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). // (only IE 8 fails this test) jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; tds[0].style.display = ""; tds[1].style.display = "none"; // Check if empty table cells still have offsetWidth/Height // (IE < 8 fail this test) jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; div.innerHTML = ""; body.removeChild( div ).style.display = "none"; div = tds = null; }); // Technique from Juriy Zaytsev // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ var eventSupported = function( eventName ) { var el = document.createElement("div"); eventName = "on" + eventName; // We only care about the case where non-standard event systems // are used, namely in IE. Short-circuiting here helps us to // avoid an eval call (in setAttribute) which can cause CSP // to go haywire. See: https://developer.mozilla.org/en/Security/CSP if ( !el.attachEvent ) { return true; } var isSupported = (eventName in el); if ( !isSupported ) { el.setAttribute(eventName, "return;"); isSupported = typeof el[eventName] === "function"; } el = null; return isSupported; }; jQuery.support.submitBubbles = eventSupported("submit"); jQuery.support.changeBubbles = eventSupported("change"); // release memory in IE div = all = a = null; })(); var rbrace = /^(?:\{.*\}|\[.*\])$/; jQuery.extend({ cache: {}, // Please use with caution uuid: 0, // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "applet": true }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data, pvt /* Internal Use Only */ ) { if ( !jQuery.acceptData( elem ) ) { return; } var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { elem[ jQuery.expando ] = id = ++jQuery.uuid; } else { id = jQuery.expando; } } if ( !cache[ id ] ) { cache[ id ] = {}; // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery // metadata on plain JS objects when the object is serialized using // JSON.stringify if ( !isNode ) { cache[ id ].toJSON = jQuery.noop; } } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); } else { cache[ id ] = jQuery.extend(cache[ id ], name); } } thisCache = cache[ id ]; // Internal jQuery data is stored in a separate object inside the object's data // cache in order to avoid key collisions between internal data and user-defined // data if ( pvt ) { if ( !thisCache[ internalKey ] ) { thisCache[ internalKey ] = {}; } thisCache = thisCache[ internalKey ]; } if ( data !== undefined ) { thisCache[ name ] = data; } // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should // not attempt to inspect the internal events object using jQuery.data, as this // internal data object is undocumented and subject to change. if ( name === "events" && !thisCache[name] ) { return thisCache[ internalKey ] && thisCache[ internalKey ].events; } return getByName ? thisCache[ name ] : thisCache; }, removeData: function( elem, name, pvt /* Internal Use Only */ ) { if ( !jQuery.acceptData( elem ) ) { return; } var internalKey = jQuery.expando, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, // See jQuery.data for more information id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; if ( thisCache ) { delete thisCache[ name ]; // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( !isEmptyDataObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( pvt ) { delete cache[ id ][ internalKey ]; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject(cache[ id ]) ) { return; } } var internalCache = cache[ id ][ internalKey ]; // Browsers that fail expando deletion also refuse to delete expandos on // the window, but it will allow it on all other JS objects; other browsers // don't care if ( jQuery.support.deleteExpando || cache != window ) { delete cache[ id ]; } else { cache[ id ] = null; } // We destroyed the entire user cache at once because it's faster than // iterating through each key, but we need to continue to persist internal // data if it existed if ( internalCache ) { cache[ id ] = {}; // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery // metadata on plain JS objects when the object is serialized using // JSON.stringify if ( !isNode ) { cache[ id ].toJSON = jQuery.noop; } cache[ id ][ internalKey ] = internalCache; // Otherwise, we need to eliminate the expando on the node to avoid // false lookups in the cache for entries that no longer exist } else if ( isNode ) { // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( jQuery.support.deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); } else { elem[ jQuery.expando ] = null; } } }, // For internal use only. _data: function( elem, name, data ) { return jQuery.data( elem, name, data, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { if ( elem.nodeName ) { var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; if ( match ) { return !(match === true || elem.getAttribute("classid") !== match); } } return true; } }); jQuery.fn.extend({ data: function( key, value ) { var data = null; if ( typeof key === "undefined" ) { if ( this.length ) { data = jQuery.data( this[0] ); if ( this[0].nodeType === 1 ) { var attr = this[0].attributes, name; for ( var i = 0, l = attr.length; i < l; i++ ) { name = attr[i].name; if ( name.indexOf( "data-" ) === 0 ) { name = name.substr( 5 ); dataAttr( this[0], name, data[ name ] ); } } } } return data; } else if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } var parts = key.split("."); parts[1] = parts[1] ? "." + parts[1] : ""; if ( value === undefined ) { data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); // Try to fetch any internally stored data first if ( data === undefined && this.length ) { data = jQuery.data( this[0], key ); data = dataAttr( this[0], key, data ); } return data === undefined && parts[1] ? this.data( parts[0] ) : data; } else { return this.each(function() { var $this = jQuery( this ), args = [ parts[0], value ]; $this.triggerHandler( "setData" + parts[1] + "!", args ); jQuery.data( this, key, value ); $this.triggerHandler( "changeData" + parts[1] + "!", args ); }); } }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { data = elem.getAttribute( "data-" + key ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : !jQuery.isNaN( data ) ? parseFloat( data ) : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON // property to be considered empty objects; this property always exists in // order to make sure JSON.stringify does not expose internal metadata function isEmptyDataObject( obj ) { for ( var name in obj ) { if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { if ( !elem ) { return; } type = (type || "fx") + "queue"; var q = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( !data ) { return q || []; } if ( !q || jQuery.isArray(data) ) { q = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { q.push( data ); } return q; }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), fn = queue.shift(); // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift("inprogress"); } fn.call(elem, function() { jQuery.dequeue(elem, type); }); } if ( !queue.length ) { jQuery.removeData( elem, type + "queue", true ); } } }); jQuery.fn.extend({ queue: function( type, data ) { if ( typeof type !== "string" ) { data = type; type = "fx"; } if ( data === undefined ) { return jQuery.queue( this[0], type ); } return this.each(function( i ) { var queue = jQuery.queue( this, type, data ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; type = type || "fx"; return this.queue( type, function() { var elem = this; setTimeout(function() { jQuery.dequeue( elem, type ); }, time ); }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); } }); var rclass = /[\n\t\r]/g, rspaces = /\s+/, rreturn = /\r/g, rspecialurl = /^(?:href|src|style)$/, rtype = /^(?:button|input)$/i, rfocusable = /^(?:button|input|object|select|textarea)$/i, rclickable = /^a(?:rea)?$/i, rradiocheck = /^(?:radio|checkbox)$/i; jQuery.props = { "for": "htmlFor", "class": "className", readonly: "readOnly", maxlength: "maxLength", cellspacing: "cellSpacing", rowspan: "rowSpan", colspan: "colSpan", tabindex: "tabIndex", usemap: "useMap", frameborder: "frameBorder" }; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, name, value, true, jQuery.attr ); }, removeAttr: function( name, fn ) { return this.each(function(){ jQuery.attr( this, name, "" ); if ( this.nodeType === 1 ) { this.removeAttribute( name ); } }); }, addClass: function( value ) { if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); self.addClass( value.call(this, i, self.attr("class")) ); }); } if ( value && typeof value === "string" ) { var classNames = (value || "").split( rspaces ); for ( var i = 0, l = this.length; i < l; i++ ) { var elem = this[i]; if ( elem.nodeType === 1 ) { if ( !elem.className ) { elem.className = value; } else { var className = " " + elem.className + " ", setClass = elem.className; for ( var c = 0, cl = classNames.length; c < cl; c++ ) { if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { setClass += " " + classNames[c]; } } elem.className = jQuery.trim( setClass ); } } } } return this; }, removeClass: function( value ) { if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); self.removeClass( value.call(this, i, self.attr("class")) ); }); } if ( (value && typeof value === "string") || value === undefined ) { var classNames = (value || "").split( rspaces ); for ( var i = 0, l = this.length; i < l; i++ ) { var elem = this[i]; if ( elem.nodeType === 1 && elem.className ) { if ( value ) { var className = (" " + elem.className + " ").replace(rclass, " "); for ( var c = 0, cl = classNames.length; c < cl; c++ ) { className = className.replace(" " + classNames[c] + " ", " "); } elem.className = jQuery.trim( className ); } else { elem.className = ""; } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function(i) { var self = jQuery(this); self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), state = stateVal, classNames = value.split( rspaces ); while ( (className = classNames[ i++ ]) ) { // check each className given, space seperated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } } else if ( type === "undefined" || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // toggle whole className this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " "; for ( var i = 0, l = this.length; i < l; i++ ) { if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { return true; } } return false; }, val: function( value ) { if ( !arguments.length ) { var elem = this[0]; if ( elem ) { if ( jQuery.nodeName( elem, "option" ) ) { // attributes.value is undefined in Blackberry 4.7 but // uses .value. See #6932 var val = elem.attributes.value; return !val || val.specified ? elem.value : elem.text; } // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, values = [], options = elem.options, one = elem.type === "select-one"; // Nothing was selected if ( index < 0 ) { return null; } // Loop through all the selected options for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { var option = options[ i ]; // Don't return options that are disabled or in a disabled optgroup if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { // Get the specific value for the option value = jQuery(option).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } // Fixes Bug #2551 -- select.val() broken in IE after form.reset() if ( one && !values.length && options.length ) { return jQuery( options[ index ] ).val(); } return values; } // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { return elem.getAttribute("value") === null ? "on" : elem.value; } // Everything else, we just grab the value return (elem.value || "").replace(rreturn, ""); } return undefined; } var isFunction = jQuery.isFunction(value); return this.each(function(i) { var self = jQuery(this), val = value; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call(this, i, self.val()); } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray(val) ) { val = jQuery.map(val, function (value) { return value == null ? "" : value + ""; }); } if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { this.checked = jQuery.inArray( self.val(), val ) >= 0; } else if ( jQuery.nodeName( this, "select" ) ) { var values = jQuery.makeArray(val); jQuery( "option", this ).each(function() { this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; }); if ( !values.length ) { this.selectedIndex = -1; } } else { this.value = val; } }); } }); jQuery.extend({ attrFn: { val: true, css: true, html: true, text: true, data: true, width: true, height: true, offset: true }, attr: function( elem, name, value, pass ) { // don't get/set attributes on text, comment and attribute nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || elem.nodeType === 2 ) { return undefined; } if ( pass && name in jQuery.attrFn ) { return jQuery(elem)[name](value); } var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), // Whether we are setting (or getting) set = value !== undefined; // Try to normalize/fix the name name = notxml && jQuery.props[ name ] || name; // Only do all the following if this is a node (faster for style) if ( elem.nodeType === 1 ) { // These attributes require special treatment var special = rspecialurl.test( name ); // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( name === "selected" && !jQuery.support.optSelected ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } } // If applicable, access the attribute via the DOM 0 way // 'in' checks fail in Blackberry 4.7 #6931 if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { if ( set ) { // We can't allow the type property to be changed (since it causes problems in IE) if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { jQuery.error( "type property can't be changed" ); } if ( value === null ) { if ( elem.nodeType === 1 ) { elem.removeAttribute( name ); } } else { elem[ name ] = value; } } // browsers index elements by id/name on forms, give priority to attributes. if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { return elem.getAttributeNode( name ).nodeValue; } // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ if ( name === "tabIndex" ) { var attributeNode = elem.getAttributeNode( "tabIndex" ); return attributeNode && attributeNode.specified ? attributeNode.value : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : undefined; } return elem[ name ]; } if ( !jQuery.support.style && notxml && name === "style" ) { if ( set ) { elem.style.cssText = "" + value; } return elem.style.cssText; } if ( set ) { // convert the value to a string (all browsers do this but IE) see #1070 elem.setAttribute( name, "" + value ); } // Ensure that missing attributes return undefined // Blackberry 4.7 returns "" from getAttribute #6938 if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { return undefined; } var attr = !jQuery.support.hrefNormalized && notxml && special ? // Some attributes require a special call on IE elem.getAttribute( name, 2 ) : elem.getAttribute( name ); // Non-existent attributes return null, we normalize to undefined return attr === null ? undefined : attr; } // Handle everything which isn't a DOM element node if ( set ) { elem[ name ] = value; } return elem[ name ]; } }); var rnamespaces = /\.(.*)$/, rformElems = /^(?:textarea|input|select)$/i, rperiod = /\./g, rspace = / /g, rescape = /[^\w\s.|`]/g, fcleanup = function( nm ) { return nm.replace(rescape, "\\$&"); }; /* * A number of helper functions used for managing events. * Many of the ideas behind this code originated from * Dean Edwards' addEvent library. */ jQuery.event = { // Bind an event to an element // Original by Dean Edwards add: function( elem, types, handler, data ) { if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // TODO :: Use a try/catch until it's safe to pull this out (likely 1.6) // Minor release fix for bug #8018 try { // For whatever reason, IE has trouble passing the window object // around, causing it to be cloned in the process if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { elem = window; } } catch ( e ) {} if ( handler === false ) { handler = returnFalse; } else if ( !handler ) { // Fixes bug #7229. Fix recommended by jdalton return; } var handleObjIn, handleObj; if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; } // Make sure that the function being executed has a unique ID if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure var elemData = jQuery._data( elem ); // If no elemData is found then we must be trying to bind to one of the // banned noData elements if ( !elemData ) { return; } var events = elemData.events, eventHandle = elemData.handle; if ( !events ) { elemData.events = events = {}; } if ( !eventHandle ) { elemData.handle = eventHandle = function() { // Handle the second event of a trigger and when // an event is called after a page has unloaded return typeof jQuery !== "undefined" && !jQuery.event.triggered ? jQuery.event.handle.apply( eventHandle.elem, arguments ) : undefined; }; } // Add elem as a property of the handle function // This is to prevent a memory leak with non-native events in IE. eventHandle.elem = elem; // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = types.split(" "); var type, i = 0, namespaces; while ( (type = types[ i++ ]) ) { handleObj = handleObjIn ? jQuery.extend({}, handleObjIn) : { handler: handler, data: data }; // Namespaced event handlers if ( type.indexOf(".") > -1 ) { namespaces = type.split("."); type = namespaces.shift(); handleObj.namespace = namespaces.slice(0).sort().join("."); } else { namespaces = []; handleObj.namespace = ""; } handleObj.type = type; if ( !handleObj.guid ) { handleObj.guid = handler.guid; } // Get the current list of functions bound to this event var handlers = events[ type ], special = jQuery.event.special[ type ] || {}; // Init the event handler queue if ( !handlers ) { handlers = events[ type ] = []; // Check for a special event handler // Only use addEventListener/attachEvent if the special // events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add the function to the element's handler list handlers.push( handleObj ); // Keep track of which events have been used, for global triggering jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, global: {}, // Detach an event or set of events from an element remove: function( elem, types, handler, pos ) { // don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } if ( handler === false ) { handler = returnFalse; } var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ), events = elemData && elemData.events; if ( !elemData || !events ) { return; } // types is actually an event object here if ( types && types.type ) { handler = types.handler; types = types.type; } // Unbind all events for the element if ( !types || typeof types === "string" && types.charAt(0) === "." ) { types = types || ""; for ( type in events ) { jQuery.event.remove( elem, type + types ); } return; } // Handle multiple events separated by a space // jQuery(...).unbind("mouseover mouseout", fn); types = types.split(" "); while ( (type = types[ i++ ]) ) { origType = type; handleObj = null; all = type.indexOf(".") < 0; namespaces = []; if ( !all ) { // Namespaced event handlers namespaces = type.split("."); type = namespaces.shift(); namespace = new RegExp("(^|\\.)" + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); } eventType = events[ type ]; if ( !eventType ) { continue; } if ( !handler ) { for ( j = 0; j < eventType.length; j++ ) { handleObj = eventType[ j ]; if ( all || namespace.test( handleObj.namespace ) ) { jQuery.event.remove( elem, origType, handleObj.handler, j ); eventType.splice( j--, 1 ); } } continue; } special = jQuery.event.special[ type ] || {}; for ( j = pos || 0; j < eventType.length; j++ ) { handleObj = eventType[ j ]; if ( handler.guid === handleObj.guid ) { // remove the given handler for the given type if ( all || namespace.test( handleObj.namespace ) ) { if ( pos == null ) { eventType.splice( j--, 1 ); } if ( special.remove ) { special.remove.call( elem, handleObj ); } } if ( pos != null ) { break; } } } // remove generic event handler if no more handlers exist if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } ret = null; delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { var handle = elemData.handle; if ( handle ) { handle.elem = null; } delete elemData.events; delete elemData.handle; if ( jQuery.isEmptyObject( elemData ) ) { jQuery.removeData( elem, undefined, true ); } } }, // bubbling is internal trigger: function( event, data, elem /*, bubbling */ ) { // Event object or event type var type = event.type || event, bubbling = arguments[3]; if ( !bubbling ) { event = typeof event === "object" ? // jQuery.Event object event[ jQuery.expando ] ? event : // Object literal jQuery.extend( jQuery.Event(type), event ) : // Just the event type (string) jQuery.Event(type); if ( type.indexOf("!") >= 0 ) { event.type = type = type.slice(0, -1); event.exclusive = true; } // Handle a global trigger if ( !elem ) { // Don't bubble custom events when global (to avoid too much overhead) event.stopPropagation(); // Only trigger if we've ever bound an event for it if ( jQuery.event.global[ type ] ) { // XXX This code smells terrible. event.js should not be directly // inspecting the data cache jQuery.each( jQuery.cache, function() { // internalKey variable is just used to make it easier to find // and potentially change this stuff later; currently it just // points to jQuery.expando var internalKey = jQuery.expando, internalCache = this[ internalKey ]; if ( internalCache && internalCache.events && internalCache.events[ type ] ) { jQuery.event.trigger( event, data, internalCache.handle.elem ); } }); } } // Handle triggering a single element // don't do events on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { return undefined; } // Clean up in case it is reused event.result = undefined; event.target = elem; // Clone the incoming data, if any data = jQuery.makeArray( data ); data.unshift( event ); } event.currentTarget = elem; // Trigger the event, it is assumed that "handle" is a function var handle = jQuery._data( elem, "handle" ); if ( handle ) { handle.apply( elem, data ); } var parent = elem.parentNode || elem.ownerDocument; // Trigger an inline bound script try { if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { event.result = false; event.preventDefault(); } } // prevent IE from throwing an error for some elements with some event types, see #3533 } catch (inlineError) {} if ( !event.isPropagationStopped() && parent ) { jQuery.event.trigger( event, data, parent, true ); } else if ( !event.isDefaultPrevented() ) { var old, target = event.target, targetType = type.replace( rnamespaces, "" ), isClick = jQuery.nodeName( target, "a" ) && targetType === "click", special = jQuery.event.special[ targetType ] || {}; if ( (!special._default || special._default.call( elem, event ) === false) && !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { try { if ( target[ targetType ] ) { // Make sure that we don't accidentally re-trigger the onFOO events old = target[ "on" + targetType ]; if ( old ) { target[ "on" + targetType ] = null; } jQuery.event.triggered = true; target[ targetType ](); } // prevent IE from throwing an error for some elements with some event types, see #3533 } catch (triggerError) {} if ( old ) { target[ "on" + targetType ] = old; } jQuery.event.triggered = false; } } }, handle: function( event ) { var all, handlers, namespaces, namespace_re, events, namespace_sort = [], args = jQuery.makeArray( arguments ); event = args[0] = jQuery.event.fix( event || window.event ); event.currentTarget = this; // Namespaced event handlers all = event.type.indexOf(".") < 0 && !event.exclusive; if ( !all ) { namespaces = event.type.split("."); event.type = namespaces.shift(); namespace_sort = namespaces.slice(0).sort(); namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); } event.namespace = event.namespace || namespace_sort.join("."); events = jQuery._data(this, "events"); handlers = (events || {})[ event.type ]; if ( events && handlers ) { // Clone the handlers to prevent manipulation handlers = handlers.slice(0); for ( var j = 0, l = handlers.length; j < l; j++ ) { var handleObj = handlers[ j ]; // Filter the functions by class if ( all || namespace_re.test( handleObj.namespace ) ) { // Pass in a reference to the handler function itself // So that we can later remove it event.handler = handleObj.handler; event.data = handleObj.data; event.handleObj = handleObj; var ret = handleObj.handler.apply( this, args ); if ( ret !== undefined ) { event.result = ret; if ( ret === false ) { event.preventDefault(); event.stopPropagation(); } } if ( event.isImmediatePropagationStopped() ) { break; } } } } return event.result; }, props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // store a copy of the original event object // and "clone" to set read-only properties var originalEvent = event; event = jQuery.Event( originalEvent ); for ( var i = this.props.length, prop; i; ) { prop = this.props[ --i ]; event[ prop ] = originalEvent[ prop ]; } // Fix target property, if necessary if ( !event.target ) { // Fixes #1925 where srcElement might not be defined either event.target = event.srcElement || document; } // check if target is a textnode (safari) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Add relatedTarget, if necessary if ( !event.relatedTarget && event.fromElement ) { event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; } // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && event.clientX != null ) { var doc = document.documentElement, body = document.body; event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); } // Add which for key events if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { event.which = event.charCode != null ? event.charCode : event.keyCode; } // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) if ( !event.metaKey && event.ctrlKey ) { event.metaKey = event.ctrlKey; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && event.button !== undefined ) { event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); } return event; }, // Deprecated, use jQuery.guid instead guid: 1E8, // Deprecated, use jQuery.proxy instead proxy: jQuery.proxy, special: { ready: { // Make sure the ready event is setup setup: jQuery.bindReady, teardown: jQuery.noop }, live: { add: function( handleObj ) { jQuery.event.add( this, liveConvert( handleObj.origType, handleObj.selector ), jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); }, remove: function( handleObj ) { jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); } }, beforeunload: { setup: function( data, namespaces, eventHandle ) { // We only want to do this special case on windows if ( jQuery.isWindow( this ) ) { this.onbeforeunload = eventHandle; } }, teardown: function( namespaces, eventHandle ) { if ( this.onbeforeunload === eventHandle ) { this.onbeforeunload = null; } } } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { if ( elem.detachEvent ) { elem.detachEvent( "on" + type, handle ); } }; jQuery.Event = function( src ) { // Allow instantiation without the 'new' keyword if ( !this.preventDefault ) { return new jQuery.Event( src ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // timeStamp is buggy for some events on Firefox(#3843) // So we won't rely on the native value this.timeStamp = jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; function returnFalse() { return false; } function returnTrue() { return true; } // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { preventDefault: function() { this.isDefaultPrevented = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if preventDefault exists run it on the original event if ( e.preventDefault ) { e.preventDefault(); // otherwise set the returnValue property of the original event to false (IE) } else { e.returnValue = false; } }, stopPropagation: function() { this.isPropagationStopped = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if stopPropagation exists run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // otherwise set the cancelBubble property of the original event to true (IE) e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); }, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse }; // Checks if an event happened on an element within another element // Used in jQuery.event.special.mouseenter and mouseleave handlers var withinElement = function( event ) { // Check if mouse(over|out) are still within the same parent element var parent = event.relatedTarget; // Firefox sometimes assigns relatedTarget a XUL element // which we cannot access the parentNode property of try { // Chrome does something similar, the parentNode property // can be accessed but is null. if ( parent !== document && !parent.parentNode ) { return; } // Traverse up the tree while ( parent && parent !== this ) { parent = parent.parentNode; } if ( parent !== this ) { // set the correct event type event.type = event.data; // handle event if we actually just moused on to a non sub-element jQuery.event.handle.apply( this, arguments ); } // assuming we've left the element since we most likely mousedover a xul element } catch(e) { } }, // In case of event delegation, we only need to rename the event.type, // liveHandler will take care of the rest. delegate = function( event ) { event.type = event.data; jQuery.event.handle.apply( this, arguments ); }; // Create mouseenter and mouseleave events jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { setup: function( data ) { jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); }, teardown: function( data ) { jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); } }; }); // submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function( data, namespaces ) { if ( this.nodeName && this.nodeName.toLowerCase() !== "form" ) { jQuery.event.add(this, "click.specialSubmit", function( e ) { var elem = e.target, type = elem.type; if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { trigger( "submit", this, arguments ); } }); jQuery.event.add(this, "keypress.specialSubmit", function( e ) { var elem = e.target, type = elem.type; if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { trigger( "submit", this, arguments ); } }); } else { return false; } }, teardown: function( namespaces ) { jQuery.event.remove( this, ".specialSubmit" ); } }; } // change delegation, happens here so we have bind. if ( !jQuery.support.changeBubbles ) { var changeFilters, getVal = function( elem ) { var type = elem.type, val = elem.value; if ( type === "radio" || type === "checkbox" ) { val = elem.checked; } else if ( type === "select-multiple" ) { val = elem.selectedIndex > -1 ? jQuery.map( elem.options, function( elem ) { return elem.selected; }).join("-") : ""; } else if ( elem.nodeName.toLowerCase() === "select" ) { val = elem.selectedIndex; } return val; }, testChange = function testChange( e ) { var elem = e.target, data, val; if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { return; } data = jQuery._data( elem, "_change_data" ); val = getVal(elem); // the current data will be also retrieved by beforeactivate if ( e.type !== "focusout" || elem.type !== "radio" ) { jQuery._data( elem, "_change_data", val ); } if ( data === undefined || val === data ) { return; } if ( data != null || val ) { e.type = "change"; e.liveFired = undefined; jQuery.event.trigger( e, arguments[1], elem ); } }; jQuery.event.special.change = { filters: { focusout: testChange, beforedeactivate: testChange, click: function( e ) { var elem = e.target, type = elem.type; if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { testChange.call( this, e ); } }, // Change has to be called before submit // Keydown will be called before keypress, which is used in submit-event delegation keydown: function( e ) { var elem = e.target, type = elem.type; if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || type === "select-multiple" ) { testChange.call( this, e ); } }, // Beforeactivate happens also before the previous element is blurred // with this event you can't trigger a change event, but you can store // information beforeactivate: function( e ) { var elem = e.target; jQuery._data( elem, "_change_data", getVal(elem) ); } }, setup: function( data, namespaces ) { if ( this.type === "file" ) { return false; } for ( var type in changeFilters ) { jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); } return rformElems.test( this.nodeName ); }, teardown: function( namespaces ) { jQuery.event.remove( this, ".specialChange" ); return rformElems.test( this.nodeName ); } }; changeFilters = jQuery.event.special.change.filters; // Handle when the input is .focus()'d changeFilters.focus = changeFilters.beforeactivate; } function trigger( type, elem, args ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. // Don't pass args or remember liveFired; they apply to the donor event. var event = jQuery.extend( {}, args[ 0 ] ); event.type = type; event.originalEvent = {}; event.liveFired = undefined; jQuery.event.handle.call( elem, event ); if ( event.isDefaultPrevented() ) { args[ 0 ].preventDefault(); } } // Create "bubbling" focus and blur events if ( document.addEventListener ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { jQuery.event.special[ fix ] = { setup: function() { this.addEventListener( orig, handler, true ); }, teardown: function() { this.removeEventListener( orig, handler, true ); } }; function handler( e ) { e = jQuery.event.fix( e ); e.type = fix; return jQuery.event.handle.call( this, e ); } }); } jQuery.each(["bind", "one"], function( i, name ) { jQuery.fn[ name ] = function( type, data, fn ) { // Handle object literals if ( typeof type === "object" ) { for ( var key in type ) { this[ name ](key, data, type[key], fn); } return this; } if ( jQuery.isFunction( data ) || data === false ) { fn = data; data = undefined; } var handler = name === "one" ? jQuery.proxy( fn, function( event ) { jQuery( this ).unbind( event, handler ); return fn.apply( this, arguments ); }) : fn; if ( type === "unload" && name !== "one" ) { this.one( type, data, fn ); } else { for ( var i = 0, l = this.length; i < l; i++ ) { jQuery.event.add( this[i], type, handler, data ); } } return this; }; }); jQuery.fn.extend({ unbind: function( type, fn ) { // Handle object literals if ( typeof type === "object" && !type.preventDefault ) { for ( var key in type ) { this.unbind(key, type[key]); } } else { for ( var i = 0, l = this.length; i < l; i++ ) { jQuery.event.remove( this[i], type, fn ); } } return this; }, delegate: function( selector, types, data, fn ) { return this.live( types, data, fn, selector ); }, undelegate: function( selector, types, fn ) { if ( arguments.length === 0 ) { return this.unbind( "live" ); } else { return this.die( types, null, fn, selector ); } }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { if ( this[0] ) { var event = jQuery.Event( type ); event.preventDefault(); event.stopPropagation(); jQuery.event.trigger( event, data, this[0] ); return event.result; } }, toggle: function( fn ) { // Save reference to arguments for access in closure var args = arguments, i = 1; // link all the functions, so any of them can unbind this click handler while ( i < args.length ) { jQuery.proxy( fn, args[ i++ ] ); } return this.click( jQuery.proxy( fn, function( event ) { // Figure out which function to execute var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); // Make sure that clicks stop event.preventDefault(); // and execute the function return args[ lastToggle ].apply( this, arguments ) || false; })); }, hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } }); var liveMap = { focus: "focusin", blur: "focusout", mouseenter: "mouseover", mouseleave: "mouseout" }; jQuery.each(["live", "die"], function( i, name ) { jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { var type, i = 0, match, namespaces, preType, selector = origSelector || this.selector, context = origSelector ? this : jQuery( this.context ); if ( typeof types === "object" && !types.preventDefault ) { for ( var key in types ) { context[ name ]( key, data, types[key], selector ); } return this; } if ( jQuery.isFunction( data ) ) { fn = data; data = undefined; } types = (types || "").split(" "); while ( (type = types[ i++ ]) != null ) { match = rnamespaces.exec( type ); namespaces = ""; if ( match ) { namespaces = match[0]; type = type.replace( rnamespaces, "" ); } if ( type === "hover" ) { types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); continue; } preType = type; if ( type === "focus" || type === "blur" ) { types.push( liveMap[ type ] + namespaces ); type = type + namespaces; } else { type = (liveMap[ type ] || type) + namespaces; } if ( name === "live" ) { // bind live handler for ( var j = 0, l = context.length; j < l; j++ ) { jQuery.event.add( context[j], "live." + liveConvert( type, selector ), { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); } } else { // unbind live handler context.unbind( "live." + liveConvert( type, selector ), fn ); } } return this; }; }); function liveHandler( event ) { var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, elems = [], selectors = [], events = jQuery._data( this, "events" ); // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) { return; } if ( event.namespace ) { namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); } event.liveFired = this; var live = events.live.slice(0); for ( j = 0; j < live.length; j++ ) { handleObj = live[j]; if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { selectors.push( handleObj.selector ); } else { live.splice( j--, 1 ); } } match = jQuery( event.target ).closest( selectors, event.currentTarget ); for ( i = 0, l = match.length; i < l; i++ ) { close = match[i]; for ( j = 0; j < live.length; j++ ) { handleObj = live[j]; if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) { elem = close.elem; related = null; // Those two events require additional checking if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { event.type = handleObj.preType; related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; } if ( !related || related !== elem ) { elems.push({ elem: elem, handleObj: handleObj, level: close.level }); } } } } for ( i = 0, l = elems.length; i < l; i++ ) { match = elems[i]; if ( maxLevel && match.level > maxLevel ) { break; } event.currentTarget = match.elem; event.data = match.handleObj.data; event.handleObj = match.handleObj; ret = match.handleObj.origHandler.apply( match.elem, arguments ); if ( ret === false || event.isPropagationStopped() ) { maxLevel = match.level; if ( ret === false ) { stop = false; } if ( event.isImmediatePropagationStopped() ) { break; } } } return stop; } function liveConvert( type, selector ) { return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); } jQuery.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").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { if ( fn == null ) { fn = data; data = null; } return arguments.length > 0 ? this.bind( name, data, fn ) : this.trigger( name ); }; if ( jQuery.attrFn ) { jQuery.attrFn[ name ] = true; } }); /*! * Sizzle CSS Selector Engine * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, done = 0, toString = Object.prototype.toString, hasDuplicate = false, baseHasDuplicate = true, rBackslash = /\\/g, rNonWord = /\W/; // Here we check if the JavaScript engine is using some sort of // optimization where it does not always call our comparision // function. If that is the case, discard the hasDuplicate value. // Thus far that includes Google Chrome. [0, 0].sort(function() { baseHasDuplicate = false; return 0; }); var Sizzle = function( selector, context, results, seed ) { results = results || []; context = context || document; var origContext = context; if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } if ( !selector || typeof selector !== "string" ) { return results; } var m, set, checkSet, extra, ret, cur, pop, i, prune = true, contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); m = chunker.exec( soFar ); if ( m ) { soFar = m[3]; parts.push( m[1] ); if ( m[2] ) { extra = m[3]; break; } } } while ( m ); if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) { selector += parts.shift(); } set = posProcess( selector, set ); } } } else { // Take a shortcut and set the context if the root selector is an ID // (but not if it'll be faster if the inner selector is an ID) if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { ret = Sizzle.find( parts.shift(), context, contextXML ); context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; } if ( context ) { ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) { checkSet = makeArray( set ); } else { prune = false; } while ( parts.length ) { cur = parts.pop(); pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, contextXML ); } } else { checkSet = parts = []; } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { Sizzle.error( cur || selector ); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context && context.nodeType === 1 ) { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, origContext, results, seed ); Sizzle.uniqueSort( results ); } return results; }; Sizzle.uniqueSort = function( results ) { if ( sortOrder ) { hasDuplicate = baseHasDuplicate; results.sort( sortOrder ); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[ i - 1 ] ) { results.splice( i--, 1 ); } } } } return results; }; Sizzle.matches = function( expr, set ) { return Sizzle( expr, null, null, set ); }; Sizzle.matchesSelector = function( node, expr ) { return Sizzle( expr, null, null, [node] ).length > 0; }; Sizzle.find = function( expr, context, isXML ) { var set; if ( !expr ) { return []; } for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace( rBackslash, "" ); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( "*" ) : []; } return { set: set, expr: expr }; }; Sizzle.filter = function( expr, set, inplace, not ) { var match, anyFound, old = expr, result = [], curLoop = set, isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); while ( expr && set.length ) { for ( var type in Expr.filter ) { if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { var found, item, filter = Expr.filter[ type ], left = match[1]; anyFound = false; match.splice(1,1); if ( left.substr( left.length - 1 ) === "\\" ) { continue; } if ( curLoop === result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } } if ( match ) { for ( var i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, i, curLoop ); var pass = not ^ !!found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } // Improper expression if ( expr === old ) { if ( anyFound == null ) { Sizzle.error( expr ); } else { break; } } old = expr; } return curLoop; }; Sizzle.error = function( msg ) { throw "Syntax error, unrecognized expression: " + msg; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function( elem ) { return elem.getAttribute( "href" ); }, type: function( elem ) { return elem.getAttribute( "type" ); } }, relative: { "+": function(checkSet, part){ var isPartStr = typeof part === "string", isTag = isPartStr && !rNonWord.test( part ), isPartStrNotTag = isPartStr && !isTag; if ( isTag ) { part = part.toLowerCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); } }, ">": function( checkSet, part ) { var elem, isPartStr = typeof part === "string", i = 0, l = checkSet.length; if ( isPartStr && !rNonWord.test( part ) ) { part = part.toLowerCase(); for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; } } } else { for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !rNonWord.test( part ) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); }, "~": function( checkSet, part, isXML ) { var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !rNonWord.test( part ) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); } }, find: { ID: function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }, NAME: function( match, context ) { if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName( match[1] ); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function( match, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( match[1] ); } } }, preFilter: { CLASS: function( match, curLoop, inplace, result, not, isXML ) { match = " " + match[1].replace( rBackslash, "" ) + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { if ( !inplace ) { result.push( elem ); } } else if ( inplace ) { curLoop[i] = false; } } } return false; }, ID: function( match ) { return match[1].replace( rBackslash, "" ); }, TAG: function( match, curLoop ) { return match[1].replace( rBackslash, "" ).toLowerCase(); }, CHILD: function( match ) { if ( match[1] === "nth" ) { if ( !match[2] ) { Sizzle.error( match[0] ); } match[2] = match[2].replace(/^\+|\s*/g, ''); // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); // calculate the numbers (first)n+(last) including if they are negative match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } else if ( match[2] ) { Sizzle.error( match[0] ); } // TODO: Move to normal caching system match[0] = done++; return match; }, ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } // Handle if an un-quoted value was used match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function( match, curLoop, inplace, result, not ) { if ( match[1] === "not" ) { // If we're dealing with a complex expression, or a simple one if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function( match ) { match.unshift( true ); return match; } }, filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; }, disabled: function( elem ) { return elem.disabled === true; }, checked: function( elem ) { return elem.checked === true; }, selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, parent: function( elem ) { return !!elem.firstChild; }, empty: function( elem ) { return !elem.firstChild; }, has: function( elem, i, match ) { return !!Sizzle( match[3], elem ).length; }, header: function( elem ) { return (/h\d/i).test( elem.nodeName ); }, text: function( elem ) { // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return "text" === elem.getAttribute( 'type' ); }, radio: function( elem ) { return "radio" === elem.type; }, checkbox: function( elem ) { return "checkbox" === elem.type; }, file: function( elem ) { return "file" === elem.type; }, password: function( elem ) { return "password" === elem.type; }, submit: function( elem ) { return "submit" === elem.type; }, image: function( elem ) { return "image" === elem.type; }, reset: function( elem ) { return "reset" === elem.type; }, button: function( elem ) { return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; }, input: function( elem ) { return (/input|select|textarea|button/i).test( elem.nodeName ); } }, setFilters: { first: function( elem, i ) { return i === 0; }, last: function( elem, i, match, array ) { return i === array.length - 1; }, even: function( elem, i ) { return i % 2 === 0; }, odd: function( elem, i ) { return i % 2 === 1; }, lt: function( elem, i, match ) { return i < match[3] - 0; }, gt: function( elem, i, match ) { return i > match[3] - 0; }, nth: function( elem, i, match ) { return match[3] - 0 === i; }, eq: function( elem, i, match ) { return match[3] - 0 === i; } }, filter: { PSEUDO: function( elem, match, i, array ) { var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var j = 0, l = not.length; j < l; j++ ) { if ( not[j] === elem ) { return false; } } return true; } else { Sizzle.error( name ); } }, CHILD: function( elem, match ) { var type = match[1], node = elem; switch ( type ) { case "only": case "first": while ( (node = node.previousSibling) ) { if ( node.nodeType === 1 ) { return false; } } if ( type === "first" ) { return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { if ( node.nodeType === 1 ) { return false; } } return true; case "nth": var first = match[2], last = match[3]; if ( first === 1 && last === 0 ) { return true; } var doneName = match[0], parent = elem.parentNode; if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent.sizcache = doneName; } var diff = elem.nodeIndex - last; if ( first === 0 ) { return diff === 0; } else { return ( diff % first === 0 && diff / first >= 0 ); } } }, ID: function( elem, match ) { return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function( elem, match ) { var name = match[1], result = Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value !== check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function( elem, match, i, array ) { var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS, fescape = function(all, num){ return "\\" + (num - 0 + 1); }; for ( var type in Expr.match ) { Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); } var makeArray = function( array, results ) { array = Array.prototype.slice.call( array, 0 ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; // Perform a simple check to determine if the browser is capable of // converting a NodeList to an array using builtin methods. // Also verifies that the returned array holds DOM nodes // (which is not the case in the Blackberry browser) try { Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; // Provide a fallback method if it does not work } catch( e ) { makeArray = function( array, results ) { var i = 0, ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( ; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder, siblingCheck; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { return a.compareDocumentPosition ? -1 : 1; } return a.compareDocumentPosition(b) & 4 ? -1 : 1; }; } else { sortOrder = function( a, b ) { var al, bl, ap = [], bp = [], aup = a.parentNode, bup = b.parentNode, cur = aup; // The nodes are identical, we can exit early if ( a === b ) { hasDuplicate = true; return 0; // If the nodes are siblings (or identical) we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); // If no parents were found then the nodes are disconnected } else if ( !aup ) { return -1; } else if ( !bup ) { return 1; } // Otherwise they're somewhere else in the tree so we need // to build up a full list of the parentNodes for comparison while ( cur ) { ap.unshift( cur ); cur = cur.parentNode; } cur = bup; while ( cur ) { bp.unshift( cur ); cur = cur.parentNode; } al = ap.length; bl = bp.length; // Start walking down the tree looking for a discrepancy for ( var i = 0; i < al && i < bl; i++ ) { if ( ap[i] !== bp[i] ) { return siblingCheck( ap[i], bp[i] ); } } // We ended someplace up the tree so do a sibling check return i === al ? siblingCheck( a, bp[i], -1 ) : siblingCheck( ap[i], b, 1 ); }; siblingCheck = function( a, b, ret ) { if ( a === b ) { return ret; } var cur = a.nextSibling; while ( cur ) { if ( cur === b ) { return -1; } cur = cur.nextSibling; } return 1; }; } // Utility function for retreiving the text value of an array of DOM nodes Sizzle.getText = function( elems ) { var ret = "", elem; for ( var i = 0; elems[i]; i++ ) { elem = elems[i]; // Get the text from text nodes and CDATA nodes if ( elem.nodeType === 3 || elem.nodeType === 4 ) { ret += elem.nodeValue; // Traverse everything else, except comment nodes } else if ( elem.nodeType !== 8 ) { ret += Sizzle.getText( elem.childNodes ); } } return ret; }; // Check to see if the browser returns elements by name when // querying by getElementById (and provide a workaround) (function(){ // We're going to inject a fake input element with a specified name var form = document.createElement("div"), id = "script" + (new Date()).getTime(), root = document.documentElement; form.innerHTML = "<a name='" + id + "'/>"; // Inject it into the root element, check its status, and remove it quickly root.insertBefore( form, root.firstChild ); // The workaround has to do additional checks after a getElementById // Which slows things down for other browsers (hence the branching) if ( document.getElementById( id ) ) { Expr.find.ID = function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function( elem, match ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); // release memory in IE root = form = null; })(); (function(){ // Check to see if the browser returns only elements // when doing getElementsByTagName("*") // Create a fake element var div = document.createElement("div"); div.appendChild( document.createComment("") ); // Make sure no comments are found if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function( match, context ) { var results = context.getElementsByTagName( match[1] ); // Filter out possible comments if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } // Check to see if an attribute returns normalized href attributes div.innerHTML = "<a href='#'></a>"; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function( elem ) { return elem.getAttribute( "href", 2 ); }; } // release memory in IE div = null; })(); if ( document.querySelectorAll ) { (function(){ var oldSizzle = Sizzle, div = document.createElement("div"), id = "__sizzle__"; div.innerHTML = "<p class='TEST'></p>"; // Safari can't handle uppercase or unicode characters when // in quirks mode. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function( query, context, extra, seed ) { context = context || document; // Only use querySelectorAll on non-XML documents // (ID selectors don't work in non-HTML documents) if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } } else { return makeArray( [], extra ); } } try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { var oldContext = context, old = context.getAttribute( "id" ), nid = old || id, hasParent = context.parentNode, relativeHierarchySelector = /^\s*[+~]/.test( query ); if ( !old ) { context.setAttribute( "id", nid ); } else { nid = nid.replace( /'/g, "\\$&" ); } if ( relativeHierarchySelector && hasParent ) { context = context.parentNode; } try { if ( !relativeHierarchySelector || hasParent ) { return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); } } catch(pseudoError) { } finally { if ( !old ) { oldContext.removeAttribute( "id" ); } } } } return oldSizzle(query, context, extra, seed); }; for ( var prop in oldSizzle ) { Sizzle[ prop ] = oldSizzle[ prop ]; } // release memory in IE div = null; })(); } (function(){ var html = document.documentElement, matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, pseudoWorks = false; try { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); } catch( pseudoError ) { pseudoWorks = true; } if ( matches ) { Sizzle.matchesSelector = function( node, expr ) { // Make sure that attribute selectors are quoted expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { return matches.call( node, expr ); } } catch(e) {} } return Sizzle(expr, null, null, [node]).length > 0; }; } })(); (function(){ var div = document.createElement("div"); div.innerHTML = "<div class='test e'></div><div class='test'></div>"; // Opera can't find a second classname (in 9.6) // Also, make sure that getElementsByClassName actually exists if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { return; } // Safari caches class attributes, doesn't catch changes (in 3.2) div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) { return; } Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { return context.getElementsByClassName(match[1]); } }; // release memory in IE div = null; })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem.sizcache = doneName; elem.sizset = i; } if ( elem.nodeName.toLowerCase() === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem.sizcache = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } if ( document.documentElement.contains ) { Sizzle.contains = function( a, b ) { return a !== b && (a.contains ? a.contains(b) : true); }; } else if ( document.documentElement.compareDocumentPosition ) { Sizzle.contains = function( a, b ) { return !!(a.compareDocumentPosition(b) & 16); }; } else { Sizzle.contains = function() { return false; }; } Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; var posProcess = function( selector, context ) { var match, tmpSet = [], later = "", root = context.nodeType ? [context] : context; // Position selectors must be done after the filter // And so must :not(positional) so we move all PSEUDOs to the end while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet ); } return Sizzle.filter( later, tmpSet ); }; // EXPOSE jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.filters; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })(); var runtil = /Until$/, rparentsprev = /^(?:parents|prevUntil|prevAll)/, // Note: This RegExp should be improved, or likely pulled from Sizzle rmultiselector = /,/, isSimple = /^.[^:#\[\.,]*$/, slice = Array.prototype.slice, POS = jQuery.expr.match.POS, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var ret = this.pushStack( "", "find", selector ), length = 0; for ( var i = 0, l = this.length; i < l; i++ ) { length = ret.length; jQuery.find( selector, this[i], ret ); if ( i > 0 ) { // Make sure that the results are unique for ( var n = length; n < ret.length; n++ ) { for ( var r = 0; r < length; r++ ) { if ( ret[r] === ret[n] ) { ret.splice(n--, 1); break; } } } } } return ret; }, has: function( target ) { var targets = jQuery( target ); return this.filter(function() { for ( var i = 0, l = targets.length; i < l; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector, false), "not", selector); }, filter: function( selector ) { return this.pushStack( winnow(this, selector, true), "filter", selector ); }, is: function( selector ) { return !!selector && jQuery.filter( selector, this ).length > 0; }, closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; if ( jQuery.isArray( selectors ) ) { var match, selector, matches = {}, level = 1; if ( cur && selectors.length ) { for ( i = 0, l = selectors.length; i < l; i++ ) { selector = selectors[i]; if ( !matches[selector] ) { matches[selector] = jQuery.expr.match.POS.test( selector ) ? jQuery( selector, context || this.context ) : selector; } } while ( cur && cur.ownerDocument && cur !== context ) { for ( selector in matches ) { match = matches[selector]; if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { ret.push({ selector: selector, elem: cur, level: level }); } } cur = cur.parentNode; level++; } } return ret; } var pos = POS.test( selectors ) ? jQuery( selectors, context || this.context ) : null; for ( i = 0, l = this.length; i < l; i++ ) { cur = this[i]; while ( cur ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; } else { cur = cur.parentNode; if ( !cur || !cur.ownerDocument || cur === context ) { break; } } } } ret = ret.length > 1 ? jQuery.unique(ret) : ret; return this.pushStack( ret, "closest", selectors ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { if ( !elem || typeof elem === "string" ) { return jQuery.inArray( this[0], // If it receives a string, the selector is used // If it receives nothing, the siblings are used elem ? jQuery( elem ) : this.parent().children() ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? all : jQuery.unique( all ) ); }, andSelf: function() { return this.add( this.prevObject ); } }); // A painfully simple check to see if an element is disconnected // from a document (should be improved, where feasible). function isDisconnected( node ) { return !node || !node.parentNode || node.parentNode.nodeType === 11; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return jQuery.nth( elem, 2, "nextSibling" ); }, prev: function( elem ) { return jQuery.nth( elem, 2, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( elem.parentNode.firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.makeArray( elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ), // The variable 'args' was introduced in // https://github.com/jquery/jquery/commit/52a0238 // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. // http://code.google.com/p/v8/issues/detail?id=1050 args = slice.call(arguments); if ( !runtil.test( name ) ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { ret = ret.reverse(); } return this.pushStack( ret, name, args.join(",") ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 ? jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : jQuery.find.matches(expr, elems); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, nth: function( cur, result, dir, elem ) { result = result || 1; var num = 0; for ( ; cur; cur = cur[dir] ) { if ( cur.nodeType === 1 && ++num === result ) { break; } } return cur; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, keep ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { var retVal = !!qualifier.call( elem, i, elem ); return retVal === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem, i ) { return (elem === qualifier) === keep; }); } else if ( typeof qualifier === "string" ) { var filtered = jQuery.grep(elements, function( elem ) { return elem.nodeType === 1; }); if ( isSimple.test( qualifier ) ) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter( qualifier, filtered ); } } return jQuery.grep(elements, function( elem, i ) { return (jQuery.inArray( elem, qualifier ) >= 0) === keep; }); } var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnocache = /<(?:script|object|embed|option|style)/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], area: [ 1, "<map>", "</map>" ], _default: [ 0, "", "" ] }; wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; // IE can't serialize <link> and <script> tags normally if ( !jQuery.support.htmlSerialize ) { wrapMap._default = [ 1, "div<div>", "</div>" ]; } jQuery.fn.extend({ text: function( text ) { if ( jQuery.isFunction(text) ) { return this.each(function(i) { var self = jQuery( this ); self.text( text.call(this, i, self.text()) ); }); } if ( typeof text !== "object" && text !== undefined ) { return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); } return jQuery.text( this ); }, wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append(this); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { return this.each(function() { jQuery( this ).wrapAll( html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); }, append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.appendChild( elem ); } }); }, prepend: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this ); }); } else if ( arguments.length ) { var set = jQuery(arguments[0]); set.push.apply( set, this.toArray() ); return this.pushStack( set, "before", arguments ); } }, after: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this.nextSibling ); }); } else if ( arguments.length ) { var set = this.pushStack( this, "after", arguments ); set.push.apply( set, jQuery(arguments[0]).toArray() ); return set; } }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); jQuery.cleanData( [ elem ] ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } } } return this; }, empty: function() { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { if ( value === undefined ) { return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(rinlinejQuery, "") : null; // See if we can take a shortcut and just use innerHTML } else if ( typeof value === "string" && !rnocache.test( value ) && (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { value = value.replace(rxhtmlTag, "<$1></$2>"); try { for ( var i = 0, l = this.length; i < l; i++ ) { // Remove element nodes and prevent memory leaks if ( this[i].nodeType === 1 ) { jQuery.cleanData( this[i].getElementsByTagName("*") ); this[i].innerHTML = value; } } // If using innerHTML throws an exception, use the fallback method } catch(e) { this.empty().append( value ); } } else if ( jQuery.isFunction( value ) ) { this.each(function(i){ var self = jQuery( this ); self.html( value.call(this, i, self.html()) ); }); } else { this.empty().append( value ); } return this; }, replaceWith: function( value ) { if ( this[0] && this[0].parentNode ) { // Make sure that the elements are removed from the DOM before they are inserted // this can help fix replacing a parent with child elements if ( jQuery.isFunction( value ) ) { return this.each(function(i) { var self = jQuery(this), old = self.html(); self.replaceWith( value.call( this, i, old ) ); }); } if ( typeof value !== "string" ) { value = jQuery( value ).detach(); } return this.each(function() { var next = this.nextSibling, parent = this.parentNode; jQuery( this ).remove(); if ( next ) { jQuery(next).before( value ); } else { jQuery(parent).append( value ); } }); } else { return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ); } }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, table, callback ) { var results, first, fragment, parent, value = args[0], scripts = []; // We can't cloneNode fragments that contain checked, in WebKit if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { return this.each(function() { jQuery(this).domManip( args, table, callback, true ); }); } if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); args[0] = value.call(this, i, table ? self.html() : undefined); self.domManip( args, table, callback ); }); } if ( this[0] ) { parent = value && value.parentNode; // If we're in a fragment, just use that instead of building a new one if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { results = { fragment: parent }; } else { results = jQuery.buildFragment( args, this, scripts ); } fragment = results.fragment; if ( fragment.childNodes.length === 1 ) { first = fragment = fragment.firstChild; } else { first = fragment.firstChild; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) { callback.call( table ? root(this[i], first) : this[i], // Make sure that we do not leak memory by inadvertently discarding // the original fragment (which might have attached data) instead of // using it; in addition, use the original fragment object for the last // item instead of first because it can end up being emptied incorrectly // in certain situations (Bug #8070). // Fragments from the fragment cache must always be cloned and never used // in place. results.cacheable || (l > 1 && i < lastIndex) ? jQuery.clone( fragment, true, true ) : fragment ); } } if ( scripts.length ) { jQuery.each( scripts, evalScript ); } } return this; } }); function root( elem, cur ) { return jQuery.nodeName(elem, "table") ? (elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody"))) : elem; } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var internalKey = jQuery.expando, oldData = jQuery.data( src ), curData = jQuery.data( dest, oldData ); // Switch to use the internal data object, if it exists, for the next // stage of data copying if ( (oldData = oldData[ internalKey ]) ) { var events = oldData.events; curData = curData[ internalKey ] = jQuery.extend({}, oldData); if ( events ) { delete curData.handle; curData.events = {}; for ( var type in events ) { for ( var i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data ); } } } } } function cloneFixAttributes(src, dest) { // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } var nodeName = dest.nodeName.toLowerCase(); // clearAttributes removes the attributes, which we don't want, // but also removes the attachEvent events, which we *do* want dest.clearAttributes(); // mergeAttributes, in contrast, only merges back on the // original attributes, not the events dest.mergeAttributes(src); // IE6-8 fail to clone children inside object elements that use // the proprietary classid attribute value (rather than the type // attribute) to identify the type of content to display if ( nodeName === "object" ) { dest.outerHTML = src.outerHTML; } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set if ( src.checked ) { dest.defaultChecked = dest.checked = src.checked; } // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } // Event data gets referenced instead of copied if the expando // gets copied too dest.removeAttribute( jQuery.expando ); } jQuery.buildFragment = function( args, nodes, scripts ) { var fragment, cacheable, cacheresults, doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document); // Only cache "small" (1/2 KB) HTML strings that are associated with the main document // Cloning options loses the selected state, so don't cache them // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document && args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { cacheable = true; cacheresults = jQuery.fragments[ args[0] ]; if ( cacheresults ) { if ( cacheresults !== 1 ) { fragment = cacheresults; } } } if ( !fragment ) { fragment = doc.createDocumentFragment(); jQuery.clean( args, doc, fragment, scripts ); } if ( cacheable ) { jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1; } return { fragment: fragment, cacheable: cacheable }; }; jQuery.fragments = {}; jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var ret = [], insert = jQuery( selector ), parent = this.length === 1 && this[0].parentNode; if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { insert[ original ]( this[0] ); return this; } else { for ( var i = 0, l = insert.length; i < l; i++ ) { var elems = (i > 0 ? this.clone(true) : this).get(); jQuery( insert[i] )[ original ]( elems ); ret = ret.concat( elems ); } return this.pushStack( ret, name, insert.selector ); } }; }); function getAll( elem ) { if ( "getElementsByTagName" in elem ) { return elem.getElementsByTagName( "*" ); } else if ( "querySelectorAll" in elem ) { return elem.querySelectorAll( "*" ); } else { return []; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var clone = elem.cloneNode(true), srcElements, destElements, i; if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // IE copies events bound via attachEvent when using cloneNode. // Calling detachEvent on the clone will also remove the events // from the original. In order to get around this, we use some // proprietary methods to clear the events. Thanks to MooTools // guys for this hotness. cloneFixAttributes( elem, clone ); // Using Sizzle here is crazy slow, so we use getElementsByTagName // instead srcElements = getAll( elem ); destElements = getAll( clone ); // Weird iteration because IE will replace the length property // with an element if you are cloning the body and one of the // elements on the page has a name or id of "length" for ( i = 0; srcElements[i]; ++i ) { cloneFixAttributes( srcElements[i], destElements[i] ); } } // Copy the events from the original to the clone if ( dataAndEvents ) { cloneCopyEvent( elem, clone ); if ( deepDataAndEvents ) { srcElements = getAll( elem ); destElements = getAll( clone ); for ( i = 0; srcElements[i]; ++i ) { cloneCopyEvent( srcElements[i], destElements[i] ); } } } // Return the cloned set return clone; }, clean: function( elems, context, fragment, scripts ) { context = context || document; // !context.createElement fails in IE with an error but returns typeof 'object' if ( typeof context.createElement === "undefined" ) { context = context.ownerDocument || context[0] && context[0].ownerDocument || document; } var ret = []; for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( typeof elem === "number" ) { elem += ""; } if ( !elem ) { continue; } // Convert html string into DOM nodes if ( typeof elem === "string" && !rhtml.test( elem ) ) { elem = context.createTextNode( elem ); } else if ( typeof elem === "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(rxhtmlTag, "<$1></$2>"); // Trim whitespace, otherwise indexOf won't work as expected var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(), wrap = wrapMap[ tag ] || wrapMap._default, depth = wrap[0], div = context.createElement("div"); // Go to html and back, then peel off extra wrappers div.innerHTML = wrap[1] + elem + wrap[2]; // Move to the right depth while ( depth-- ) { div = div.lastChild; } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> var hasBody = rtbody.test(elem), tbody = tag === "table" && !hasBody ? div.firstChild && div.firstChild.childNodes : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !hasBody ? div.childNodes : []; for ( var j = tbody.length - 1; j >= 0 ; --j ) { if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { tbody[ j ].parentNode.removeChild( tbody[ j ] ); } } } // IE completely kills leading whitespace when innerHTML is used if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); } elem = div.childNodes; } if ( elem.nodeType ) { ret.push( elem ); } else { ret = jQuery.merge( ret, elem ); } } if ( fragment ) { for ( i = 0; ret[i]; i++ ) { if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); } else { if ( ret[i].nodeType === 1 ) { ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); } fragment.appendChild( ret[i] ); } } } return ret; }, cleanData: function( elems ) { var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special, deleteExpando = jQuery.support.deleteExpando; for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { continue; } id = elem[ jQuery.expando ]; if ( id ) { data = cache[ id ] && cache[ id ][ internalKey ]; if ( data && data.events ) { for ( var type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } // Null the DOM reference to avoid IE6/7/8 leak (#7054) if ( data.handle ) { data.handle.elem = null; } } if ( deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); } delete cache[ id ]; } } } }); function evalScript( i, elem ) { if ( elem.src ) { jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); } else { jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } } var ralpha = /alpha\([^)]*\)/i, ropacity = /opacity=([^)]*)/, rdashAlpha = /-([a-z])/ig, rupper = /([A-Z])/g, rnumpx = /^-?\d+(?:px)?$/i, rnum = /^-?\d/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssWidth = [ "Left", "Right" ], cssHeight = [ "Top", "Bottom" ], curCSS, getComputedStyle, currentStyle, fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn.css = function( name, value ) { // Setting 'undefined' is a no-op if ( arguments.length === 2 && value === undefined ) { return this; } return jQuery.access( this, name, value, true, function( elem, name, value ) { return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }); }; jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity", "opacity" ); return ret === "" ? "1" : ret; } else { return elem.style.opacity; } } } }, // Exclude the following css properties to add px cssNumber: { "zIndex": true, "fontWeight": true, "opacity": true, "zoom": true, "lineHeight": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, origName = jQuery.camelCase( name ), style = elem.style, hooks = jQuery.cssHooks[ origName ]; name = jQuery.cssProps[ origName ] || origName; // Check if we're setting a value if ( value !== undefined ) { // Make sure that NaN and null values aren't set. See: #7116 if ( typeof value === "number" && isNaN( value ) || value == null ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra ) { // Make sure that we're working with the right name var ret, origName = jQuery.camelCase( name ), hooks = jQuery.cssHooks[ origName ]; name = jQuery.cssProps[ origName ] || origName; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) { return ret; // Otherwise, if a way to get the computed value exists, use that } else if ( curCSS ) { return curCSS( elem, name, origName ); } }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback ) { var old = {}; // Remember the old values, and insert the new ones for ( var name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } callback.call( elem ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } }, camelCase: function( string ) { return string.replace( rdashAlpha, fcamelCase ); } }); // DEPRECATED, Use jQuery.css() instead jQuery.curCSS = jQuery.css; jQuery.each(["height", "width"], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { var val; if ( computed ) { if ( elem.offsetWidth !== 0 ) { val = getWH( elem, name, extra ); } else { jQuery.swap( elem, cssShow, function() { val = getWH( elem, name, extra ); }); } if ( val <= 0 ) { val = curCSS( elem, name, name ); if ( val === "0px" && currentStyle ) { val = currentStyle( elem, name, name ); } if ( val != null ) { // Should return "auto" instead of 0, use 0 for // temporary backwards-compat return val === "" || val === "auto" ? "0px" : val; } } if ( val < 0 || val == null ) { val = elem.style[ name ]; // Should return "auto" instead of 0, use 0 for // temporary backwards-compat return val === "" || val === "auto" ? "0px" : val; } return typeof val === "string" ? val : val + "px"; } }, set: function( elem, value ) { if ( rnumpx.test( value ) ) { // ignore negative width and height values #1599 value = parseFloat(value); if ( value >= 0 ) { return value + "px"; } } else { return value; } } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? (parseFloat(RegExp.$1) / 100) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // Set the alpha filter to set the opacity var opacity = jQuery.isNaN(value) ? "" : "alpha(opacity=" + value * 100 + ")", filter = style.filter || ""; style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : style.filter + ' ' + opacity; } }; } if ( document.defaultView && document.defaultView.getComputedStyle ) { getComputedStyle = function( elem, newName, name ) { var ret, defaultView, computedStyle; name = name.replace( rupper, "-$1" ).toLowerCase(); if ( !(defaultView = elem.ownerDocument.defaultView) ) { return undefined; } if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) { ret = computedStyle.getPropertyValue( name ); if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { ret = jQuery.style( elem, name ); } } return ret; }; } if ( document.documentElement.currentStyle ) { currentStyle = function( elem, name ) { var left, ret = elem.currentStyle && elem.currentStyle[ name ], rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ], style = elem.style; // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels if ( !rnumpx.test( ret ) && rnum.test( ret ) ) { // Remember the original values left = style.left; // Put in the new values to get a computed value out if ( rsLeft ) { elem.runtimeStyle.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : (ret || 0); ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { elem.runtimeStyle.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } curCSS = getComputedStyle || currentStyle; function getWH( elem, name, extra ) { var which = name === "width" ? cssWidth : cssHeight, val = name === "width" ? elem.offsetWidth : elem.offsetHeight; if ( extra === "border" ) { return val; } jQuery.each( which, function() { if ( !extra ) { val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0; } if ( extra === "margin" ) { val += parseFloat(jQuery.css( elem, "margin" + this )) || 0; } else { val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0; } }); return val; } if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { var width = elem.offsetWidth, height = elem.offsetHeight; return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rhash = /#.*$/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /(?:^file|^widget|\-extension):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rquery = /\?/, rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, rselectTextarea = /^(?:select|textarea)/i, rspacesAjax = /\s+/, rts = /([?&])_=[^&]*/, rucHeaders = /(^|\-)([a-z])/g, rucHeadersFunc = function( _, $1, $2 ) { return $1 + $2.toUpperCase(); }, rurl = /^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Document location ajaxLocation, // Document location segments ajaxLocParts; // #8138, IE may throw an exception when accessing // a field from document.location if document.domain has been set try { ajaxLocation = document.location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ); // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } if ( jQuery.isFunction( func ) ) { var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ), i = 0, length = dataTypes.length, dataType, list, placeBefore; // For each dataType in the dataTypeExpression for(; i < length; i++ ) { dataType = dataTypes[ i ]; // We control if we're asked to add before // any existing element placeBefore = /^\+/.test( dataType ); if ( placeBefore ) { dataType = dataType.substr( 1 ) || "*"; } list = structure[ dataType ] = structure[ dataType ] || []; // then we add to the structure accordingly list[ placeBefore ? "unshift" : "push" ]( func ); } } }; } //Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, dataType /* internal */, inspected /* internal */ ) { dataType = dataType || options.dataTypes[ 0 ]; inspected = inspected || {}; inspected[ dataType ] = true; var list = structure[ dataType ], i = 0, length = list ? list.length : 0, executeOnly = ( structure === prefilters ), selection; for(; i < length && ( executeOnly || !selection ); i++ ) { selection = list[ i ]( options, originalOptions, jqXHR ); // If we got redirected to another dataType // we try there if executing only and not done already if ( typeof selection === "string" ) { if ( !executeOnly || inspected[ selection ] ) { selection = undefined; } else { options.dataTypes.unshift( selection ); selection = inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, selection, inspected ); } } } // If we're only executing or nothing was selected // we try the catchall dataType if not done already if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { selection = inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, "*", inspected ); } // unnecessary when only executing (prefilters) // but it'll be ignored by the caller in that case return selection; } jQuery.fn.extend({ load: function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); // Don't do a request if no elements are being requested } else if ( !this.length ) { return this; } var off = url.indexOf( " " ); if ( off >= 0 ) { var selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // Default to a GET request var type = "GET"; // If the second parameter was provided if ( params ) { // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( typeof params === "object" ) { params = jQuery.param( params, jQuery.ajaxSettings.traditional ); type = "POST"; } } var self = this; // Request the remote document jQuery.ajax({ url: url, type: type, dataType: "html", data: params, // Complete callback (responseText is used internally) complete: function( jqXHR, status, responseText ) { // Store the response as specified by the jqXHR object responseText = jqXHR.responseText; // If successful, inject the HTML into all the matched elements if ( jqXHR.isResolved() ) { // #4825: Get the actual response in case // a dataFilter is present in ajaxSettings jqXHR.done(function( r ) { responseText = r; }); // See if a selector was specified self.html( selector ? // Create a dummy div to hold the results jQuery("<div>") // inject the contents of the document in, removing the scripts // to avoid any 'Permission Denied' errors in IE .append(responseText.replace(rscript, "")) // Locate the specified elements .find(selector) : // If not, just inject the full result responseText ); } if ( callback ) { self.each( callback, [ responseText, status, jqXHR ] ); } } }); return this; }, serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ return this.elements ? jQuery.makeArray( this.elements ) : this; }) .filter(function(){ return this.name && !this.disabled && ( this.checked || rselectTextarea.test( this.nodeName ) || rinput.test( this.type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val, i ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); // Attach a bunch of functions for handling common AJAX events jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ jQuery.fn[ o ] = function( f ){ return this.bind( o, f ); }; } ); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ type: method, url: url, data: data, success: callback, dataType: type }); }; } ); jQuery.extend({ getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function ( target, settings ) { if ( !settings ) { // Only one parameter, we extend ajaxSettings settings = target; target = jQuery.extend( true, jQuery.ajaxSettings, settings ); } else { // target was provided, we extend into it jQuery.extend( true, target, jQuery.ajaxSettings, settings ); } // Flatten fields we don't want deep extended for( var field in { context: 1, url: 1 } ) { if ( field in settings ) { target[ field ] = settings[ field ]; } else if( field in jQuery.ajaxSettings ) { target[ field ] = jQuery.ajaxSettings[ field ]; } } return target; }, ajaxSettings: { url: ajaxLocation, isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, type: "GET", contentType: "application/x-www-form-urlencoded", processData: true, async: true, /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, traditional: false, headers: {}, crossDomain: null, */ accepts: { xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", "*": "*/*" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, // List of data converters // 1) key format is "source_type destination_type" (a single space in-between) // 2) the catchall symbol "*" can be used for source_type converters: { // Convert anything to text "* text": window.String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML } }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events // It's the callbackContext if one was provided in the options // and if it's a DOM node or a jQuery collection globalEventContext = callbackContext !== s && ( callbackContext.nodeType || callbackContext instanceof jQuery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery._Deferred(), // Status-dependent callbacks statusCode = s.statusCode || {}, // ifModified key ifModifiedKey, // Headers (they are sent all at once) requestHeaders = {}, // Response headers responseHeadersString, responseHeaders, // transport transport, // timeout handle timeoutTimer, // Cross-domain detection vars parts, // The jqXHR state state = 0, // To know if global events are to be dispatched fireGlobals, // Loop variable i, // Fake xhr jqXHR = { readyState: 0, // Caches the header setRequestHeader: function( name, value ) { if ( !state ) { requestHeaders[ name.toLowerCase().replace( rucHeaders, rucHeadersFunc ) ] = value; } return this; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while( ( match = rheaders.exec( responseHeadersString ) ) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match === undefined ? null : match; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Cancel the request abort: function( statusText ) { statusText = statusText || "abort"; if ( transport ) { transport.abort( statusText ); } done( 0, statusText ); return this; } }; // Callback for when everything is done // It is defined here because jslint complains if it is declared // at the end of the function (which would be more logical and readable) function done( status, statusText, responses, headers ) { // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status ? 4 : 0; var isSuccess, success, error, response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined, lastModified, etag; // If successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) { jQuery.lastModified[ ifModifiedKey ] = lastModified; } if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) { jQuery.etag[ ifModifiedKey ] = etag; } } // If not modified if ( status === 304 ) { statusText = "notmodified"; isSuccess = true; // If we have data } else { try { success = ajaxConvert( s, response ); statusText = "success"; isSuccess = true; } catch(e) { // We have a parsererror statusText = "parsererror"; error = e; } } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if( !statusText || status ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = statusText; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } } // Attach deferreds deferred.promise( jqXHR ); jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; jqXHR.complete = completeDeferred.done; // Status-dependent callbacks jqXHR.statusCode = function( map ) { if ( map ) { var tmp; if ( state < 2 ) { for( tmp in map ) { statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; } } else { tmp = map[ jqXHR.status ]; jqXHR.then( tmp, tmp ); } } return this; }; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // We also use the url parameter if available s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax ); // Determine if a cross-domain request is in order if ( !s.crossDomain ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefiler, stop there if ( state === 2 ) { return false; } // We can fire global events as of now if asked to fireGlobals = s.global; // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger( "ajaxStart" ); } // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; } // Get ifModifiedKey before adding the anti-cache parameter ifModifiedKey = s.url; // Add anti-cache in url if needed if ( s.cache === false ) { var ts = jQuery.now(), // try replacing _= if it is there ret = s.url.replace( rts, "$1_=" + ts ); // if nothing was replaced, add timestamp to the end s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { requestHeaders[ "Content-Type" ] = s.contentType; } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { ifModifiedKey = ifModifiedKey || s.url; if ( jQuery.lastModified[ ifModifiedKey ] ) { requestHeaders[ "If-Modified-Since" ] = jQuery.lastModified[ ifModifiedKey ]; } if ( jQuery.etag[ ifModifiedKey ] ) { requestHeaders[ "If-None-Match" ] = jQuery.etag[ ifModifiedKey ]; } } // Set the Accepts header for the server, depending on the dataType requestHeaders.Accept = s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) : s.accepts[ "*" ]; // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already jqXHR.abort(); return false; } // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout( function(){ jqXHR.abort( "timeout" ); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch (e) { // Propagate exception as error if not done if ( status < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { jQuery.error( e ); } } } return jqXHR; }, // Serialize an array of form elements or a set of // key/values into a query string param: function( a, traditional ) { var s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : value; s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); } ); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( var prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); } }); function buildParams( prefix, obj, traditional, add ) { if ( jQuery.isArray( obj ) && obj.length ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // If array item is non-scalar (array or object), encode its // numeric index to resolve deserialization ambiguity issues. // Note that rack (as of 1.0.0) can't currently deserialize // nested arrays properly, and attempting to do so may cause // a server error. Possible fixes are to modify rack's // deserialization algorithm or to provide an option or flag // to force array serialization to be shallow. buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && obj != null && typeof obj === "object" ) { // If we see an array here, it is empty and should be treated as an empty // object if ( jQuery.isArray( obj ) || jQuery.isEmptyObject( obj ) ) { add( prefix, "" ); // Serialize object item. } else { for ( var name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } } else { // Serialize scalar item. add( prefix, obj ); } } // This is still on the jQuery object... for now // Want to move this to jQuery.ajax some day jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {} }); /* Handles responses to an ajax request: * - sets all responseXXX fields accordingly * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields, ct, type, finalDataType, firstDataType; // Fill responseXXX fields for( type in responseFields ) { if ( type in responses ) { jqXHR[ responseFields[type] ] = responses[ type ]; } } // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } // Chain conversions given the request and the original response function ajaxConvert( s, response ) { // Apply the dataFilter if provided if ( s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } var dataTypes = s.dataTypes, converters = {}, i, key, length = dataTypes.length, tmp, // Current and previous dataTypes current = dataTypes[ 0 ], prev, // Conversion expression conversion, // Conversion function conv, // Conversion functions (transitive conversion) conv1, conv2; // For each dataType in the chain for( i = 1; i < length; i++ ) { // Create converters map // with lowercased keys if ( i === 1 ) { for( key in s.converters ) { if( typeof key === "string" ) { converters[ key.toLowerCase() ] = s.converters[ key ]; } } } // Get the dataTypes prev = current; current = dataTypes[ i ]; // If current is auto dataType, update it to prev if( current === "*" ) { current = prev; // If no auto and dataTypes are actually different } else if ( prev !== "*" && prev !== current ) { // Get the converter conversion = prev + " " + current; conv = converters[ conversion ] || converters[ "* " + current ]; // If there is no direct converter, search transitively if ( !conv ) { conv2 = undefined; for( conv1 in converters ) { tmp = conv1.split( " " ); if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) { conv2 = converters[ tmp[1] + " " + current ]; if ( conv2 ) { conv1 = converters[ conv1 ]; if ( conv1 === true ) { conv = conv2; } else if ( conv2 === true ) { conv = conv1; } break; } } } } // If we found no converter, dispatch an error if ( !( conv || conv2 ) ) { jQuery.error( "No conversion from " + conversion.replace(" "," to ") ); } // If found converter is not an equivalence if ( conv !== true ) { // Convert with 1 or 2 converters accordingly response = conv ? conv( response ) : conv2( conv1(response) ); } } } return response; } var jsc = jQuery.now(), jsre = /(\=)\?(&|$)|()\?\?()/i; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { return jQuery.expando + "_" + ( jsc++ ); } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var dataIsString = ( typeof s.data === "string" ); if ( s.dataTypes[ 0 ] === "jsonp" || originalSettings.jsonpCallback || originalSettings.jsonp != null || s.jsonp !== false && ( jsre.test( s.url ) || dataIsString && jsre.test( s.data ) ) ) { var responseContainer, jsonpCallback = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback, previous = window[ jsonpCallback ], url = s.url, data = s.data, replace = "$1" + jsonpCallback + "$2", cleanUp = function() { // Set callback back to previous value window[ jsonpCallback ] = previous; // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( previous ) ) { window[ jsonpCallback ]( responseContainer[ 0 ] ); } }; if ( s.jsonp !== false ) { url = url.replace( jsre, replace ); if ( s.url === url ) { if ( dataIsString ) { data = data.replace( jsre, replace ); } if ( s.data === data ) { // Add callback manually url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback; } } } s.url = url; s.data = data; // Install callback window[ jsonpCallback ] = function( response ) { responseContainer = [ response ]; }; // Install cleanUp function jqXHR.then( cleanUp, cleanUp ); // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( jsonpCallback + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Delegate to script return "script"; } } ); // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /javascript|ecmascript/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } } ); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement( "script" ); script.async = "async"; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( head && script.parentNode ) { head.removeChild( script ); } // Dereference the script script = undefined; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709 and #4378). head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( 0, 1 ); } } }; } } ); var // #5280: next active xhr id and list of active xhrs' callbacks xhrId = jQuery.now(), xhrCallbacks, // XHR used to determine supports properties testXHR; // #5280: Internet Explorer will keep connections alive if we don't abort on unload function xhrOnUnloadAbort() { jQuery( window ).unload(function() { // Abort all pending requests for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( 0, 1 ); } }); } // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Test if we can create an xhr object testXHR = jQuery.ajaxSettings.xhr(); jQuery.support.ajax = !!testXHR; // Does this browser support crossDomain XHR requests jQuery.support.cors = testXHR && ( "withCredentials" in testXHR ); // No need for the temporary xhr anymore testXHR = undefined; // Create transport if the browser can provide an xhr if ( jQuery.support.ajax ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var xhr = s.xhr(), handle, i; // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // Requested-With header // Not set for crossDomain requests with no content // (see why at http://trac.dojotoolkit.org/ticket/9486) // Won't change header if already provided if ( !( s.crossDomain && !s.hasContent ) && !headers["X-Requested-With"] ) { headers[ "X-Requested-With" ] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( _ ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, statusText, responseHeaders, responses, xml; // Firefox throws exceptions when accessing properties // of an xhr when a network error occured // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; delete xhrCallbacks[ handle ]; } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); responses = {}; xml = xhr.responseXML; // Construct response list if ( xml && xml.documentElement /* #4958 */ ) { responses.xml = xml; } responses.text = xhr.responseText; // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; // if we're in sync mode or it's in cache // and has been retrieved directly (IE6 & IE7) // we need to manually fire the callback if ( !s.async || xhr.readyState === 4 ) { callback(); } else { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; xhrOnUnloadAbort(); } // Add to list of active xhrs callbacks handle = xhrId++; xhr.onreadystatechange = xhrCallbacks[ handle ] = callback; } }, abort: function() { if ( callback ) { callback(0,1); } } }; } }); } var elemdisplay = {}, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, timerId, fxAttrs = [ // height animations [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], // width animations [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], // opacity animations [ "opacity" ] ]; jQuery.fn.extend({ show: function( speed, easing, callback ) { var elem, display; if ( speed || speed === 0 ) { return this.animate( genFx("show", 3), speed, easing, callback); } else { for ( var i = 0, j = this.length; i < j; i++ ) { elem = this[i]; display = elem.style.display; // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !jQuery._data(elem, "olddisplay") && display === "none" ) { display = elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( display === "" && jQuery.css( elem, "display" ) === "none" ) { jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName)); } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( i = 0; i < j; i++ ) { elem = this[i]; display = elem.style.display; if ( display === "" || display === "none" ) { elem.style.display = jQuery._data(elem, "olddisplay") || ""; } } return this; } }, hide: function( speed, easing, callback ) { if ( speed || speed === 0 ) { return this.animate( genFx("hide", 3), speed, easing, callback); } else { for ( var i = 0, j = this.length; i < j; i++ ) { var display = jQuery.css( this[i], "display" ); if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) { jQuery._data( this[i], "olddisplay", display ); } } // Set the display of the elements in a second loop // to avoid the constant reflow for ( i = 0; i < j; i++ ) { this[i].style.display = "none"; } return this; } }, // Save the old toggle function _toggle: jQuery.fn.toggle, toggle: function( fn, fn2, callback ) { var bool = typeof fn === "boolean"; if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { this._toggle.apply( this, arguments ); } else if ( fn == null || bool ) { this.each(function() { var state = bool ? fn : jQuery(this).is(":hidden"); jQuery(this)[ state ? "show" : "hide" ](); }); } else { this.animate(genFx("toggle", 3), fn, fn2, callback); } return this; }, fadeTo: function( speed, to, easing, callback ) { return this.filter(":hidden").css("opacity", 0).show().end() .animate({opacity: to}, speed, easing, callback); }, animate: function( prop, speed, easing, callback ) { var optall = jQuery.speed(speed, easing, callback); if ( jQuery.isEmptyObject( prop ) ) { return this.each( optall.complete ); } return this[ optall.queue === false ? "each" : "queue" ](function() { // XXX 'this' does not always have a nodeName when running the // test suite var opt = jQuery.extend({}, optall), p, isElement = this.nodeType === 1, hidden = isElement && jQuery(this).is(":hidden"), self = this; for ( p in prop ) { var name = jQuery.camelCase( p ); if ( p !== name ) { prop[ name ] = prop[ p ]; delete prop[ p ]; p = name; } if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) { return opt.complete.call(this); } if ( isElement && ( p === "height" || p === "width" ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height // animated if ( jQuery.css( this, "display" ) === "inline" && jQuery.css( this, "float" ) === "none" ) { if ( !jQuery.support.inlineBlockNeedsLayout ) { this.style.display = "inline-block"; } else { var display = defaultDisplay(this.nodeName); // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( display === "inline" ) { this.style.display = "inline-block"; } else { this.style.display = "inline"; this.style.zoom = 1; } } } } if ( jQuery.isArray( prop[p] ) ) { // Create (if needed) and add to specialEasing (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1]; prop[p] = prop[p][0]; } } if ( opt.overflow != null ) { this.style.overflow = "hidden"; } opt.curAnim = jQuery.extend({}, prop); jQuery.each( prop, function( name, val ) { var e = new jQuery.fx( self, opt, name ); if ( rfxtypes.test(val) ) { e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop ); } else { var parts = rfxnum.exec(val), start = e.cur(); if ( parts ) { var end = parseFloat( parts[2] ), unit = parts[3] || ( jQuery.cssNumber[ name ] ? "" : "px" ); // We need to compute starting value if ( unit !== "px" ) { jQuery.style( self, name, (end || 1) + unit); start = ((end || 1) / e.cur()) * start; jQuery.style( self, name, start + unit); } // If a +=/-= token was provided, we're doing a relative animation if ( parts[1] ) { end = ((parts[1] === "-=" ? -1 : 1) * end) + start; } e.custom( start, end, unit ); } else { e.custom( start, val, "" ); } } }); // For JS strict compliance return true; }); }, stop: function( clearQueue, gotoEnd ) { var timers = jQuery.timers; if ( clearQueue ) { this.queue([]); } this.each(function() { // go in reverse order so anything added to the queue during the loop is ignored for ( var i = timers.length - 1; i >= 0; i-- ) { if ( timers[i].elem === this ) { if (gotoEnd) { // force the next step to be the last timers[i](true); } timers.splice(i, 1); } } }); // start the next in the queue if the last step wasn't forced if ( !gotoEnd ) { this.dequeue(); } return this; } }); function genFx( type, num ) { var obj = {}; jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() { obj[ this ] = type; }); return obj; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show", 1), slideUp: genFx("hide", 1), slideToggle: genFx("toggle", 1), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.extend({ speed: function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction(easing) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default; // Queueing opt.old = opt.complete; opt.complete = function() { if ( opt.queue !== false ) { jQuery(this).dequeue(); } if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } }; return opt; }, easing: { linear: function( p, n, firstNum, diff ) { return firstNum + diff * p; }, swing: function( p, n, firstNum, diff ) { return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; } }, timers: [], fx: function( elem, options, prop ) { this.options = options; this.elem = elem; this.prop = prop; if ( !options.orig ) { options.orig = {}; } } }); jQuery.fx.prototype = { // Simple function for setting a style value update: function() { if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); }, // Get the current size cur: function() { if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) { return this.elem[ this.prop ]; } var parsed, r = jQuery.css( this.elem, this.prop ); // Empty strings, null, undefined and "auto" are converted to 0, // complex values such as "rotate(1rad)" are returned as is, // simple values such as "10px" are parsed to Float. return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed; }, // Start an animation from one number to another custom: function( from, to, unit ) { var self = this, fx = jQuery.fx; this.startTime = jQuery.now(); this.start = from; this.end = to; this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" ); this.now = this.start; this.pos = this.state = 0; function t( gotoEnd ) { return self.step(gotoEnd); } t.elem = this.elem; if ( t() && jQuery.timers.push(t) && !timerId ) { timerId = setInterval(fx.tick, fx.interval); } }, // Simple 'show' function show: function() { // Remember where we started, so that we can go back to it later this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); this.options.show = true; // Begin the animation // Make sure that we start at a small width/height to avoid any // flash of content this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()); // Start by showing the element jQuery( this.elem ).show(); }, // Simple 'hide' function hide: function() { // Remember where we started, so that we can go back to it later this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); this.options.hide = true; // Begin the animation this.custom(this.cur(), 0); }, // Each step of an animation step: function( gotoEnd ) { var t = jQuery.now(), done = true; if ( gotoEnd || t >= this.options.duration + this.startTime ) { this.now = this.end; this.pos = this.state = 1; this.update(); this.options.curAnim[ this.prop ] = true; for ( var i in this.options.curAnim ) { if ( this.options.curAnim[i] !== true ) { done = false; } } if ( done ) { // Reset the overflow if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { var elem = this.elem, options = this.options; jQuery.each( [ "", "X", "Y" ], function (index, value) { elem.style[ "overflow" + value ] = options.overflow[index]; } ); } // Hide the element if the "hide" operation was done if ( this.options.hide ) { jQuery(this.elem).hide(); } // Reset the properties, if the item has been hidden or shown if ( this.options.hide || this.options.show ) { for ( var p in this.options.curAnim ) { jQuery.style( this.elem, p, this.options.orig[p] ); } } // Execute the complete function this.options.complete.call( this.elem ); } return false; } else { var n = t - this.startTime; this.state = n / this.options.duration; // Perform the easing function, defaults to swing var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop]; var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear"); this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration); this.now = this.start + ((this.end - this.start) * this.pos); // Perform the next step of the animation this.update(); } return true; } }; jQuery.extend( jQuery.fx, { tick: function() { var timers = jQuery.timers; for ( var i = 0; i < timers.length; i++ ) { if ( !timers[i]() ) { timers.splice(i--, 1); } } if ( !timers.length ) { jQuery.fx.stop(); } }, interval: 13, stop: function() { clearInterval( timerId ); timerId = null; }, speeds: { slow: 600, fast: 200, // Default speed _default: 400 }, step: { opacity: function( fx ) { jQuery.style( fx.elem, "opacity", fx.now ); }, _default: function( fx ) { if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit; } else { fx.elem[ fx.prop ] = fx.now; } } } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } function defaultDisplay( nodeName ) { if ( !elemdisplay[ nodeName ] ) { var elem = jQuery("<" + nodeName + ">").appendTo("body"), display = elem.css("display"); elem.remove(); if ( display === "none" || display === "" ) { display = "block"; } elemdisplay[ nodeName ] = display; } return elemdisplay[ nodeName ]; } var rtable = /^t(?:able|d|h)$/i, rroot = /^(?:body|html)$/i; if ( "getBoundingClientRect" in document.documentElement ) { jQuery.fn.offset = function( options ) { var elem = this[0], box; if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } if ( !elem || !elem.ownerDocument ) { return null; } if ( elem === elem.ownerDocument.body ) { return jQuery.offset.bodyOffset( elem ); } try { box = elem.getBoundingClientRect(); } catch(e) {} var doc = elem.ownerDocument, docElem = doc.documentElement; // Make sure we're not dealing with a disconnected DOM node if ( !box || !jQuery.contains( docElem, elem ) ) { return box ? { top: box.top, left: box.left } : { top: 0, left: 0 }; } var body = doc.body, win = getWindow(doc), clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, scrollTop = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ), scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft), top = box.top + scrollTop - clientTop, left = box.left + scrollLeft - clientLeft; return { top: top, left: left }; }; } else { jQuery.fn.offset = function( options ) { var elem = this[0]; if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } if ( !elem || !elem.ownerDocument ) { return null; } if ( elem === elem.ownerDocument.body ) { return jQuery.offset.bodyOffset( elem ); } jQuery.offset.initialize(); var computedStyle, offsetParent = elem.offsetParent, prevOffsetParent = elem, doc = elem.ownerDocument, docElem = doc.documentElement, body = doc.body, defaultView = doc.defaultView, prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, top = elem.offsetTop, left = elem.offsetLeft; while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { break; } computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; top -= elem.scrollTop; left -= elem.scrollLeft; if ( elem === offsetParent ) { top += elem.offsetTop; left += elem.offsetLeft; if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevOffsetParent = offsetParent; offsetParent = elem.offsetParent; } if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevComputedStyle = computedStyle; } if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { top += body.offsetTop; left += body.offsetLeft; } if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { top += Math.max( docElem.scrollTop, body.scrollTop ); left += Math.max( docElem.scrollLeft, body.scrollLeft ); } return { top: top, left: left }; }; } jQuery.offset = { initialize: function() { var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0, html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } ); container.innerHTML = html; body.insertBefore( container, body.firstChild ); innerDiv = container.firstChild; checkDiv = innerDiv.firstChild; td = innerDiv.nextSibling.firstChild.firstChild; this.doesNotAddBorder = (checkDiv.offsetTop !== 5); this.doesAddBorderForTableAndCells = (td.offsetTop === 5); checkDiv.style.position = "fixed"; checkDiv.style.top = "20px"; // safari subtracts parent border width here which is 5px this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15); checkDiv.style.position = checkDiv.style.top = ""; innerDiv.style.overflow = "hidden"; innerDiv.style.position = "relative"; this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop); body.removeChild( container ); body = container = innerDiv = checkDiv = table = td = null; jQuery.offset.initialize = jQuery.noop; }, bodyOffset: function( body ) { var top = body.offsetTop, left = body.offsetLeft; jQuery.offset.initialize(); if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) { top += parseFloat( jQuery.css(body, "marginTop") ) || 0; left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; } return { top: top, left: left }; }, setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1), props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is absolute if ( calculatePosition ) { curPosition = curElem.position(); } curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0; curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0; if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if (options.top != null) { props.top = (options.top - curOffset.top) + curTop; } if (options.left != null) { props.left = (options.left - curOffset.left) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[0] ) { return null; } var elem = this[0], // Get *real* offsetParent offsetParent = this.offsetParent(), // Get correct offsets offset = this.offset(), parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; // Add offsetParent borders parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; // Subtract the two offsets return { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || document.body; while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { offsetParent = offsetParent.offsetParent; } return offsetParent; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( ["Left", "Top"], function( i, name ) { var method = "scroll" + name; jQuery.fn[ method ] = function(val) { var elem = this[0], win; if ( !elem ) { return null; } if ( val !== undefined ) { // Set the scroll offset return this.each(function() { win = getWindow( this ); if ( win ) { win.scrollTo( !i ? val : jQuery(win).scrollLeft(), i ? val : jQuery(win).scrollTop() ); } else { this[ method ] = val; } }); } else { win = getWindow( elem ); // Return the scroll offset return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : jQuery.support.boxModel && win.document.documentElement[ method ] || win.document.body[ method ] : elem[ method ]; } }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, outerHeight and outerWidth methods jQuery.each([ "Height", "Width" ], function( i, name ) { var type = name.toLowerCase(); // innerHeight and innerWidth jQuery.fn["inner" + name] = function() { return this[0] ? parseFloat( jQuery.css( this[0], type, "padding" ) ) : null; }; // outerHeight and outerWidth jQuery.fn["outer" + name] = function( margin ) { return this[0] ? parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) : null; }; jQuery.fn[ type ] = function( size ) { // Get window width or height var elem = this[0]; if ( !elem ) { return size == null ? null : this; } if ( jQuery.isFunction( size ) ) { return this.each(function( i ) { var self = jQuery( this ); self[ type ]( size.call( this, i, self[ type ]() ) ); }); } if ( jQuery.isWindow( elem ) ) { // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat var docElemProp = elem.document.documentElement[ "client" + name ]; return elem.document.compatMode === "CSS1Compat" && docElemProp || elem.document.body[ "client" + name ] || docElemProp; // Get document width or height } else if ( elem.nodeType === 9 ) { // Either scroll[Width/Height] or offset[Width/Height], whichever is greater return Math.max( elem.documentElement["client" + name], elem.body["scroll" + name], elem.documentElement["scroll" + name], elem.body["offset" + name], elem.documentElement["offset" + name] ); // Get or set width or height on the element } else if ( size === undefined ) { var orig = jQuery.css( elem, type ), ret = parseFloat( orig ); return jQuery.isNaN( ret ) ? orig : ret; // Set the width or height on the element (default to pixels if value is unitless) } else { return this.css( type, typeof size === "string" ? size : size + "px" ); } }; }); window.jQuery = window.$ = jQuery; })(window);
packages/generator-fluxible/app/templates/components/Nav.js
localnerve/fluxible
import React from 'react'; import { NavLink } from 'fluxible-router'; class Nav extends React.Component { render() { const selected = this.props.currentRoute; const links = this.props.links; const linkHTML = Object.keys(links).map((name) => { var className = ''; var link = links[name]; if (selected && selected.get('name') === name) { className = 'pure-menu-selected'; } return ( <li className={className} key={link.path}> <NavLink routeName={link.page} activeStyle={{backgroundColor: '#eee'}}>{link.title}</NavLink> </li> ); }); return ( <ul className="pure-menu pure-menu-open pure-menu-horizontal"> {linkHTML} </ul> ); } } Nav.defaultProps = { selected: null, links: {} }; export default Nav;
mxcube3/ui/containers/SampleQueueContainer.js
marcus-oscarsson/mxcube3
import React from 'react'; import ReactDOM from 'react-dom'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import CurrentTree from '../components/SampleQueue/CurrentTree'; import TodoTree from '../components/SampleQueue/TodoTree'; import QueueControl from '../components/SampleQueue/QueueControl'; import * as QueueActions from '../actions/queue'; import * as QueueGUIActions from '../actions/queueGUI'; import * as SampleViewActions from '../actions/sampleview'; import * as SampleChangerActions from '../actions/sampleChanger'; import { showTaskForm } from '../actions/taskForm'; import { Nav, NavItem } from 'react-bootstrap'; import { showDialog } from '../actions/general'; import UserMessage from '../components/Notify/UserMessage'; import loader from '../img/loader.gif'; import * as BeamlineActions from '../actions/beamline'; function mapStateToProps(state) { return { searchString: state.queueGUI.searchString, current: state.queue.current, visibleList: state.queueGUI.visibleList, queueStatus: state.queue.queueStatus, queue: state.queue.queue, autoMountNext: state.queue.autoMountNext, autoAddDiffPlan: state.queue.autoAddDiffPlan, centringMethod: state.queue.centringMethod, sampleList: state.sampleGrid.sampleList, sampleOrder: state.sampleGrid.order, checked: state.queue.checked, rootPath: state.queue.rootPath, displayData: state.queueGUI.displayData, loading: state.queueGUI.loading, userMessages: state.general.userMessages, plotsData: state.beamline.plotsData, plotsInfo: state.beamline.plotsInfo, selectedShapes: state.sampleview.selectedShapes, shapes: state.shapes }; } function mapDispatchToProps(dispatch) { return { queueActions: bindActionCreators(QueueActions, dispatch), queueGUIActions: bindActionCreators(QueueGUIActions, dispatch), sampleViewActions: bindActionCreators(SampleViewActions, dispatch), sampleChangerActions: bindActionCreators(SampleChangerActions, dispatch), showForm: bindActionCreators(showTaskForm, dispatch), showDialog: bindActionCreators(showDialog, dispatch), beamlineActions: bindActionCreators(BeamlineActions, dispatch) }; } export default @connect(mapStateToProps, mapDispatchToProps) class SampleQueueContainer extends React.Component { constructor(props) { super(props); this.handleSelect = this.handleSelect.bind(this); } handleSelect(selectedKey) { this.props.queueGUIActions.showList(selectedKey); } render() { const { checked, current, sampleOrder, queue, sampleList, showForm, queueStatus, rootPath, displayData, visibleList, loading, autoMountNext, autoAddDiffPlan, centringMethod } = this.props; const { sendToggleCheckBox, sendPauseQueue, sendUnpauseQueue, sendStopQueue, sendUnmountSample, changeTaskOrderAction, deleteTask, addTask, moveTask, setAutoMountSample, setAutoAddDiffPlan, sendRunSample, sendSetCentringMethod, setEnabledSample } = this.props.queueActions; const { collapseItem, showConfirmCollectDialog, selectItem, showList } = this.props.queueGUIActions; const { sendPrepareForNewSample } = this.props.beamlineActions; const { loadSample } = this.props.sampleChangerActions; // go through the queue, check if sample has been collected or not // to make todo and history lists const todo = []; const history = []; for (const key of sampleOrder) { if (queue.includes(key)) { const sample = sampleList[key]; if (sample.sampleID !== current.sampleID && sample.checked) { todo.push(sample.sampleID); } } } let sampleName = ''; let proteinAcronym = ''; if (current.sampleID) { const sampleData = sampleList[current.sampleID]; sampleName = sampleData.sampleName ? sampleData.sampleName : ''; proteinAcronym = sampleData.proteinAcronym ? `${sampleData.proteinAcronym} -` : ''; } return ( <div style={ { display: 'flex', flexDirection: 'column', width: '100%' } }> <QueueControl ref="queueContainer" historyLength={history.length} queueLength={queue.length} queue={queue} setEnabledSample={setEnabledSample} todoLength={todo.length} queueStatus={queueStatus} runQueue={showConfirmCollectDialog} stopQueue={sendStopQueue} pause={sendPauseQueue} unpause={sendUnpauseQueue} setAutoMountSample={setAutoMountSample} autoMountNext={autoMountNext} setAutoAddDiffPlan={setAutoAddDiffPlan} autoAddDiffPlan={autoAddDiffPlan} mounted={current.sampleID} runSample={sendRunSample} sendSetCentringMethod={sendSetCentringMethod} centringMethod={centringMethod} todoList={todo} sampleList={sampleList} sendUnmountSample={sendUnmountSample} /> <div className="m-tree queue-body"> <Nav bsStyle="tabs" justified activeKey={visibleList} onSelect={this.handleSelect} > <NavItem eventKey={'current'}> <b> { current.sampleID ? `Sample: ${proteinAcronym} ${sampleName}` : 'Current'} </b> </NavItem> <NavItem eventKey={'todo'}><b>Queued Samples ({todo.length})</b></NavItem> </Nav> {loading ? <div className="center-in-box" style={{ zIndex: '1000' }}> <img src={loader} className="img-responsive" alt="" /> </div> : null } <CurrentTree changeOrder={changeTaskOrderAction} show={visibleList === 'current'} mounted={current.sampleID} queue={queue} sampleList={sampleList} toggleCheckBox={sendToggleCheckBox} checked={checked} deleteTask={deleteTask} pause={sendPauseQueue} unpause={sendUnpauseQueue} stop={sendStopQueue} showForm={showForm} unmount={sendUnmountSample} queueStatus={queueStatus} rootPath={rootPath} collapseItem={collapseItem} selectItem={selectItem} displayData={displayData} runSample={sendRunSample} todoList={todo} moveTask={moveTask} addTask={addTask} plotsData={this.props.plotsData} plotsInfo={this.props.plotsInfo} shapes={this.props.shapes} showDialog={this.props.showDialog} /> <TodoTree show={visibleList === 'todo'} list={todo} queue={queue} sampleList={sampleList} collapseItem={collapseItem} displayData={displayData} mount={loadSample} showForm={showForm} queueStatus={queueStatus} showList={showList} sendPrepareForNewSample={sendPrepareForNewSample} /> <UserMessage messages={this.props.userMessages} domTarget={() => ReactDOM.findDOMNode(this.refs.queueContainer)} placement="left" target="queue" /> </div> </div> ); } }
src/svg-icons/image/filter-drama.js
kasra-co/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageFilterDrama = (props) => ( <SvgIcon {...props}> <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.61 5.64 5.36 8.04 2.35 8.36 0 10.9 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4h2c0-2.76-1.86-5.08-4.4-5.78C8.61 6.88 10.2 6 12 6c3.03 0 5.5 2.47 5.5 5.5v.5H19c1.65 0 3 1.35 3 3s-1.35 3-3 3z"/> </SvgIcon> ); ImageFilterDrama = pure(ImageFilterDrama); ImageFilterDrama.displayName = 'ImageFilterDrama'; ImageFilterDrama.muiName = 'SvgIcon'; export default ImageFilterDrama;
example/stories/Animated/Animated1.js
lelandrichardson/react-primitives
import React from 'react'; import { make } from '../../StoryManager'; import { View, Text, Animated, Touchable } from '../../../src/index'; make('Animated 1', () => { class Example extends React.Component{ constructor(props) { super(props) this.state = { anim: new Animated.Value(0), on: false } this.handleClick = this.handleClick.bind(this) } render() { return ( <Animated.View style={{left: this.state.anim}}> <Touchable onPress={this.handleClick}> <View style={{ borderWidth: 1, borderColor: '#000' }}> <Text style={{ fontFamily: 'Helvetica', fontSize: 14, lineHeight: 16, }} > Touch Me! </Text> </View> </Touchable> </Animated.View> ) } handleClick() { if (this.state.on) { Animated.timing(this.state.anim, {toValue: 0}).start(); this.setState({ on: false }) } else { Animated.timing(this.state.anim, {toValue: 400}).start(); this.setState({ on: true }) } } } return <Example /> });
app/javascript/mastodon/features/ui/components/follow_requests_nav_link.js
imas/mastodon
import React from 'react'; import PropTypes from 'prop-types'; import { fetchFollowRequests } from 'mastodon/actions/accounts'; import { connect } from 'react-redux'; import { NavLink, withRouter } from 'react-router-dom'; import IconWithBadge from 'mastodon/components/icon_with_badge'; import { List as ImmutableList } from 'immutable'; import { FormattedMessage } from 'react-intl'; const mapStateToProps = state => ({ count: state.getIn(['user_lists', 'follow_requests', 'items'], ImmutableList()).size, }); export default @withRouter @connect(mapStateToProps) class FollowRequestsNavLink extends React.Component { static propTypes = { dispatch: PropTypes.func.isRequired, count: PropTypes.number.isRequired, }; componentDidMount () { const { dispatch } = this.props; dispatch(fetchFollowRequests()); } render () { const { count } = this.props; if (count === 0) { return null; } return <NavLink className='column-link column-link--transparent' to='/follow_requests'><IconWithBadge className='column-link__icon' id='user-plus' count={count} /><FormattedMessage id='navigation_bar.follow_requests' defaultMessage='Follow requests' /></NavLink>; } }