forked from mattwiebe/Better-Google-Fonts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
2 lines (2 loc) · 32.2 KB
/
app.js
1
2
(function(){var t=this,e=t._,n={},i=Array.prototype,r=Object.prototype,s=Function.prototype,a=i.push,o=i.slice,u=i.concat,c=r.toString,l=r.hasOwnProperty,h=i.forEach,f=i.map,p=i.reduce,d=i.reduceRight,g=i.filter,v=i.every,m=i.some,y=i.indexOf,_=i.lastIndexOf,b=Array.isArray,x=Object.keys,w=s.bind,k=function(t){return t instanceof k?t:this instanceof k?(this._wrapped=t,void 0):new k(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports._=k):t._=k,k.VERSION="1.4.3";var E=k.each=k.forEach=function(t,e,i){if(null!=t)if(h&&t.forEach===h)t.forEach(e,i);else if(t.length===+t.length){for(var r=0,s=t.length;s>r;r++)if(e.call(i,t[r],r,t)===n)return}else for(var a in t)if(k.has(t,a)&&e.call(i,t[a],a,t)===n)return};k.map=k.collect=function(t,e,n){var i=[];return null==t?i:f&&t.map===f?t.map(e,n):(E(t,function(t,r,s){i[i.length]=e.call(n,t,r,s)}),i)};var A="Reduce of empty array with no initial value";k.reduce=k.foldl=k.inject=function(t,e,n,i){var r=arguments.length>2;if(null==t&&(t=[]),p&&t.reduce===p)return i&&(e=k.bind(e,i)),r?t.reduce(e,n):t.reduce(e);if(E(t,function(t,s,a){r?n=e.call(i,n,t,s,a):(n=t,r=!0)}),!r)throw new TypeError(A);return n},k.reduceRight=k.foldr=function(t,e,n,i){var r=arguments.length>2;if(null==t&&(t=[]),d&&t.reduceRight===d)return i&&(e=k.bind(e,i)),r?t.reduceRight(e,n):t.reduceRight(e);var s=t.length;if(s!==+s){var a=k.keys(t);s=a.length}if(E(t,function(o,u,c){u=a?a[--s]:--s,r?n=e.call(i,n,t[u],u,c):(n=t[u],r=!0)}),!r)throw new TypeError(A);return n},k.find=k.detect=function(t,e,n){var i;return j(t,function(t,r,s){return e.call(n,t,r,s)?(i=t,!0):void 0}),i},k.filter=k.select=function(t,e,n){var i=[];return null==t?i:g&&t.filter===g?t.filter(e,n):(E(t,function(t,r,s){e.call(n,t,r,s)&&(i[i.length]=t)}),i)},k.reject=function(t,e,n){return k.filter(t,function(t,i,r){return!e.call(n,t,i,r)},n)},k.every=k.all=function(t,e,i){e||(e=k.identity);var r=!0;return null==t?r:v&&t.every===v?t.every(e,i):(E(t,function(t,s,a){return(r=r&&e.call(i,t,s,a))?void 0:n}),!!r)};var j=k.some=k.any=function(t,e,i){e||(e=k.identity);var r=!1;return null==t?r:m&&t.some===m?t.some(e,i):(E(t,function(t,s,a){return r||(r=e.call(i,t,s,a))?n:void 0}),!!r)};k.contains=k.include=function(t,e){return null==t?!1:y&&t.indexOf===y?-1!=t.indexOf(e):j(t,function(t){return t===e})},k.invoke=function(t,e){var n=o.call(arguments,2);return k.map(t,function(t){return(k.isFunction(e)?e:t[e]).apply(t,n)})},k.pluck=function(t,e){return k.map(t,function(t){return t[e]})},k.where=function(t,e){return k.isEmpty(e)?[]:k.filter(t,function(t){for(var n in e)if(e[n]!==t[n])return!1;return!0})},k.max=function(t,e,n){if(!e&&k.isArray(t)&&t[0]===+t[0]&&65535>t.length)return Math.max.apply(Math,t);if(!e&&k.isEmpty(t))return-1/0;var i={computed:-1/0,value:-1/0};return E(t,function(t,r,s){var a=e?e.call(n,t,r,s):t;a>=i.computed&&(i={value:t,computed:a})}),i.value},k.min=function(t,e,n){if(!e&&k.isArray(t)&&t[0]===+t[0]&&65535>t.length)return Math.min.apply(Math,t);if(!e&&k.isEmpty(t))return 1/0;var i={computed:1/0,value:1/0};return E(t,function(t,r,s){var a=e?e.call(n,t,r,s):t;i.computed>a&&(i={value:t,computed:a})}),i.value},k.shuffle=function(t){var e,n=0,i=[];return E(t,function(t){e=k.random(n++),i[n-1]=i[e],i[e]=t}),i};var S=function(t){return k.isFunction(t)?t:function(e){return e[t]}};k.sortBy=function(t,e,n){var i=S(e);return k.pluck(k.map(t,function(t,e,r){return{value:t,index:e,criteria:i.call(n,t,e,r)}}).sort(function(t,e){var n=t.criteria,i=e.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(i>n||void 0===i)return-1}return t.index<e.index?-1:1}),"value")};var O=function(t,e,n,i){var r={},s=S(e||k.identity);return E(t,function(e,a){var o=s.call(n,e,a,t);i(r,o,e)}),r};k.groupBy=function(t,e,n){return O(t,e,n,function(t,e,n){(k.has(t,e)?t[e]:t[e]=[]).push(n)})},k.countBy=function(t,e,n){return O(t,e,n,function(t,e){k.has(t,e)||(t[e]=0),t[e]++})},k.sortedIndex=function(t,e,n,i){n=null==n?k.identity:S(n);for(var r=n.call(i,e),s=0,a=t.length;a>s;){var o=s+a>>>1;r>n.call(i,t[o])?s=o+1:a=o}return s},k.toArray=function(t){return t?k.isArray(t)?o.call(t):t.length===+t.length?k.map(t,k.identity):k.values(t):[]},k.size=function(t){return null==t?0:t.length===+t.length?t.length:k.keys(t).length},k.first=k.head=k.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:o.call(t,0,e)},k.initial=function(t,e,n){return o.call(t,0,t.length-(null==e||n?1:e))},k.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:o.call(t,Math.max(t.length-e,0))},k.rest=k.tail=k.drop=function(t,e,n){return o.call(t,null==e||n?1:e)},k.compact=function(t){return k.filter(t,k.identity)};var T=function(t,e,n){return E(t,function(t){k.isArray(t)?e?a.apply(n,t):T(t,e,n):n.push(t)}),n};k.flatten=function(t,e){return T(t,e,[])},k.without=function(t){return k.difference(t,o.call(arguments,1))},k.uniq=k.unique=function(t,e,n,i){k.isFunction(e)&&(i=n,n=e,e=!1);var r=n?k.map(t,n,i):t,s=[],a=[];return E(r,function(n,i){(e?i&&a[a.length-1]===n:k.contains(a,n))||(a.push(n),s.push(t[i]))}),s},k.union=function(){return k.uniq(u.apply(i,arguments))},k.intersection=function(t){var e=o.call(arguments,1);return k.filter(k.uniq(t),function(t){return k.every(e,function(e){return k.indexOf(e,t)>=0})})},k.difference=function(t){var e=u.apply(i,o.call(arguments,1));return k.filter(t,function(t){return!k.contains(e,t)})},k.zip=function(){for(var t=o.call(arguments),e=k.max(k.pluck(t,"length")),n=Array(e),i=0;e>i;i++)n[i]=k.pluck(t,""+i);return n},k.object=function(t,e){if(null==t)return{};for(var n={},i=0,r=t.length;r>i;i++)e?n[t[i]]=e[i]:n[t[i][0]]=t[i][1];return n},k.indexOf=function(t,e,n){if(null==t)return-1;var i=0,r=t.length;if(n){if("number"!=typeof n)return i=k.sortedIndex(t,e),t[i]===e?i:-1;i=0>n?Math.max(0,r+n):n}if(y&&t.indexOf===y)return t.indexOf(e,n);for(;r>i;i++)if(t[i]===e)return i;return-1},k.lastIndexOf=function(t,e,n){if(null==t)return-1;var i=null!=n;if(_&&t.lastIndexOf===_)return i?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var r=i?n:t.length;r--;)if(t[r]===e)return r;return-1},k.range=function(t,e,n){1>=arguments.length&&(e=t||0,t=0),n=arguments[2]||1;for(var i=Math.max(Math.ceil((e-t)/n),0),r=0,s=Array(i);i>r;)s[r++]=t,t+=n;return s};var N=function(){};k.bind=function(t,e){var n,i;if(t.bind===w&&w)return w.apply(t,o.call(arguments,1));if(!k.isFunction(t))throw new TypeError;return n=o.call(arguments,2),i=function(){if(!(this instanceof i))return t.apply(e,n.concat(o.call(arguments)));N.prototype=t.prototype;var r=new N;N.prototype=null;var s=t.apply(r,n.concat(o.call(arguments)));return Object(s)===s?s:r}},k.bindAll=function(t){var e=o.call(arguments,1);return 0==e.length&&(e=k.functions(t)),E(e,function(e){t[e]=k.bind(t[e],t)}),t},k.memoize=function(t,e){var n={};return e||(e=k.identity),function(){var i=e.apply(this,arguments);return k.has(n,i)?n[i]:n[i]=t.apply(this,arguments)}},k.delay=function(t,e){var n=o.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},k.defer=function(t){return k.delay.apply(k,[t,1].concat(o.call(arguments,1)))},k.throttle=function(t,e){var n,i,r,s,a=0,o=function(){a=new Date,r=null,s=t.apply(n,i)};return function(){var u=new Date,c=e-(u-a);return n=this,i=arguments,0>=c?(clearTimeout(r),r=null,a=u,s=t.apply(n,i)):r||(r=setTimeout(o,c)),s}},k.debounce=function(t,e,n){var i,r;return function(){var s=this,a=arguments,o=function(){i=null,n||(r=t.apply(s,a))},u=n&&!i;return clearTimeout(i),i=setTimeout(o,e),u&&(r=t.apply(s,a)),r}},k.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},k.wrap=function(t,e){return function(){var n=[t];return a.apply(n,arguments),e.apply(this,n)}},k.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},k.after=function(t,e){return 0>=t?e():function(){return 1>--t?e.apply(this,arguments):void 0}},k.keys=x||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var n in t)k.has(t,n)&&(e[e.length]=n);return e},k.values=function(t){var e=[];for(var n in t)k.has(t,n)&&e.push(t[n]);return e},k.pairs=function(t){var e=[];for(var n in t)k.has(t,n)&&e.push([n,t[n]]);return e},k.invert=function(t){var e={};for(var n in t)k.has(t,n)&&(e[t[n]]=n);return e},k.functions=k.methods=function(t){var e=[];for(var n in t)k.isFunction(t[n])&&e.push(n);return e.sort()},k.extend=function(t){return E(o.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},k.pick=function(t){var e={},n=u.apply(i,o.call(arguments,1));return E(n,function(n){n in t&&(e[n]=t[n])}),e},k.omit=function(t){var e={},n=u.apply(i,o.call(arguments,1));for(var r in t)k.contains(n,r)||(e[r]=t[r]);return e},k.defaults=function(t){return E(o.call(arguments,1),function(e){if(e)for(var n in e)null==t[n]&&(t[n]=e[n])}),t},k.clone=function(t){return k.isObject(t)?k.isArray(t)?t.slice():k.extend({},t):t},k.tap=function(t,e){return e(t),t};var $=function(t,e,n,i){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof k&&(t=t._wrapped),e instanceof k&&(e=e._wrapped);var r=c.call(t);if(r!=c.call(e))return!1;switch(r){case"[object String]":return t==e+"";case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var s=n.length;s--;)if(n[s]==t)return i[s]==e;n.push(t),i.push(e);var a=0,o=!0;if("[object Array]"==r){if(a=t.length,o=a==e.length)for(;a--&&(o=$(t[a],e[a],n,i)););}else{var u=t.constructor,l=e.constructor;if(u!==l&&!(k.isFunction(u)&&u instanceof u&&k.isFunction(l)&&l instanceof l))return!1;for(var h in t)if(k.has(t,h)&&(a++,!(o=k.has(e,h)&&$(t[h],e[h],n,i))))break;if(o){for(h in e)if(k.has(e,h)&&!a--)break;o=!a}}return n.pop(),i.pop(),o};k.isEqual=function(t,e){return $(t,e,[],[])},k.isEmpty=function(t){if(null==t)return!0;if(k.isArray(t)||k.isString(t))return 0===t.length;for(var e in t)if(k.has(t,e))return!1;return!0},k.isElement=function(t){return!(!t||1!==t.nodeType)},k.isArray=b||function(t){return"[object Array]"==c.call(t)},k.isObject=function(t){return t===Object(t)},E(["Arguments","Function","String","Number","Date","RegExp"],function(t){k["is"+t]=function(e){return c.call(e)=="[object "+t+"]"}}),k.isArguments(arguments)||(k.isArguments=function(t){return!(!t||!k.has(t,"callee"))}),k.isFunction=function(t){return"function"==typeof t},k.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},k.isNaN=function(t){return k.isNumber(t)&&t!=+t},k.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==c.call(t)},k.isNull=function(t){return null===t},k.isUndefined=function(t){return void 0===t},k.has=function(t,e){return l.call(t,e)},k.noConflict=function(){return t._=e,this},k.identity=function(t){return t},k.times=function(t,e,n){for(var i=Array(t),r=0;t>r;r++)i[r]=e.call(n,r);return i},k.random=function(t,e){return null==e&&(e=t,t=0),t+(0|Math.random()*(e-t+1))};var I={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};I.unescape=k.invert(I.escape);var C={escape:RegExp("["+k.keys(I.escape).join("")+"]","g"),unescape:RegExp("("+k.keys(I.unescape).join("|")+")","g")};k.each(["escape","unescape"],function(t){k[t]=function(e){return null==e?"":(""+e).replace(C[t],function(e){return I[t][e]})}}),k.result=function(t,e){if(null==t)return null;var n=t[e];return k.isFunction(n)?n.call(t):n},k.mixin=function(t){E(k.functions(t),function(e){var n=k[e]=t[e];k.prototype[e]=function(){var t=[this._wrapped];return a.apply(t,arguments),M.call(this,n.apply(k,t))}})};var F=0;k.uniqueId=function(t){var e=""+ ++F;return t?t+e:e},k.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var R=/(.)^/,P={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\t|\u2028|\u2029/g;k.template=function(t,e,n){n=k.defaults({},n,k.templateSettings);var i=RegExp([(n.escape||R).source,(n.interpolate||R).source,(n.evaluate||R).source].join("|")+"|$","g"),r=0,s="__p+='";t.replace(i,function(e,n,i,a,o){return s+=t.slice(r,o).replace(H,function(t){return"\\"+P[t]}),n&&(s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),i&&(s+="'+\n((__t=("+i+"))==null?'':__t)+\n'"),a&&(s+="';\n"+a+"\n__p+='"),r=o+e.length,e}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var a=Function(n.variable||"obj","_",s)}catch(o){throw o.source=s,o}if(e)return a(e,k);var u=function(t){return a.call(this,t,k)};return u.source="function("+(n.variable||"obj")+"){\n"+s+"}",u},k.chain=function(t){return k(t).chain()};var M=function(t){return this._chain?k(t).chain():t};k.mixin(k),E(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=i[t];k.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],M.call(this,n)}}),E(["concat","join","slice"],function(t){var e=i[t];k.prototype[t]=function(){return M.call(this,e.apply(this._wrapped,arguments))}}),k.extend(k.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this),function(){var t,e=this,n=e.Backbone,i=[],r=i.push,s=i.slice,a=i.splice;t="undefined"!=typeof exports?exports:e.Backbone={},t.VERSION="0.9.9";var o=e._;!o&&"undefined"!=typeof require&&(o=require("underscore")),t.$=e.jQuery||e.Zepto||e.ender,t.noConflict=function(){return e.Backbone=n,this},t.emulateHTTP=!1,t.emulateJSON=!1;var u=/\s+/,c=function(t,e,n,i){if(!n)return!0;if("object"==typeof n)for(var r in n)t[e].apply(t,[r,n[r]].concat(i));else{if(!u.test(n))return!0;n=n.split(u),r=0;for(var s=n.length;s>r;r++)t[e].apply(t,[n[r]].concat(i))}},l=function(t,e,n){var i,t=-1,r=e.length;switch(n.length){case 0:for(;++t<r;)(i=e[t]).callback.call(i.ctx);break;case 1:for(;++t<r;)(i=e[t]).callback.call(i.ctx,n[0]);break;case 2:for(;++t<r;)(i=e[t]).callback.call(i.ctx,n[0],n[1]);break;case 3:for(;++t<r;)(i=e[t]).callback.call(i.ctx,n[0],n[1],n[2]);break;default:for(;++t<r;)(i=e[t]).callback.apply(i.ctx,n)}},i=t.Events={on:function(t,e,n){return c(this,"on",t,[e,n])&&e?(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:n,ctx:n||this}),this):this},once:function(t,e,n){if(!c(this,"once",t,[e,n])||!e)return this;var i=this,r=o.once(function(){i.off(t,r),e.apply(this,arguments)});return r._callback=e,this.on(t,r,n),this},off:function(t,e,n){var i,r,s,a,u,l,h,f;if(!this._events||!c(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events={},this;for(a=t?[t]:o.keys(this._events),u=0,l=a.length;l>u;u++)if(t=a[u],i=this._events[t]){if(s=[],e||n)for(h=0,f=i.length;f>h;h++)r=i[h],(e&&e!==(r.callback._callback||r.callback)||n&&n!==r.context)&&s.push(r);this._events[t]=s}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!c(this,"trigger",t,e))return this;var n=this._events[t],i=this._events.all;return n&&l(this,n,e),i&&l(this,i,arguments),this},listenTo:function(t,e,n){var i=this._listeners||(this._listeners={}),r=t._listenerId||(t._listenerId=o.uniqueId("l"));return i[r]=t,t.on(e,n||this,this),this},stopListening:function(t,e,n){var i=this._listeners;if(i){if(t)t.off(e,n,this),!e&&!n&&delete i[t._listenerId];else{for(var r in i)i[r].off(null,null,this);this._listeners={}}return this}}};i.bind=i.on,i.unbind=i.off,o.extend(t,i);var h=t.Model=function(t,e){var n,i=t||{};this.cid=o.uniqueId("c"),this.changed={},this.attributes={},this._changes=[],e&&e.collection&&(this.collection=e.collection),e&&e.parse&&(i=this.parse(i)),(n=o.result(this,"defaults"))&&o.defaults(i,n),this.set(i,{silent:!0}),this._currentAttributes=o.clone(this.attributes),this._previousAttributes=o.clone(this.attributes),this.initialize.apply(this,arguments)};o.extend(h.prototype,i,{changed:null,idAttribute:"id",initialize:function(){},toJSON:function(){return o.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return o.escape(this.get(t))},has:function(t){return null!=this.get(t)},set:function(t,e,n){var i,r;if(null==t)return this;o.isObject(t)?(r=t,n=e):(r={})[t]=e;var t=n&&n.silent,s=n&&n.unset;if(!this._validate(r,n))return!1;this.idAttribute in r&&(this.id=r[this.idAttribute]);var a=this.attributes;for(i in r)e=r[i],s?delete a[i]:a[i]=e,this._changes.push(i,e);return this._hasComputed=!1,t||this.change(n),this},unset:function(t,e){return this.set(t,void 0,o.extend({},e,{unset:!0}))},clear:function(t){var e,n={};for(e in this.attributes)n[e]=void 0;return this.set(n,o.extend({},t,{unset:!0}))},fetch:function(t){t=t?o.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=this,n=t.success;return t.success=function(i){return e.set(e.parse(i),t)?(n&&n(e,i,t),void 0):!1},this.sync("read",this,t)},save:function(t,e,n){var i,r,s;if(null==t||o.isObject(t)?(i=t,n=e):null!=t&&((i={})[t]=e),n=n?o.clone(n):{},n.wait){if(i&&!this._validate(i,n))return!1;r=o.clone(this.attributes)}if(t=o.extend({},n,{silent:!0}),i&&!this.set(i,n.wait?t:n)||!i&&!this._validate(null,n))return!1;var a=this,u=n.success;return n.success=function(t){s=!0;var e=a.parse(t);return n.wait&&(e=o.extend(i||{},e)),a.set(e,n)?(u&&u(a,t,n),void 0):!1},e=this.isNew()?"create":n.patch?"patch":"update","patch"==e&&(n.attrs=i),e=this.sync(e,this,n),!s&&n.wait&&(this.clear(t),this.set(r,t)),e},destroy:function(t){var t=t?o.clone(t):{},e=this,n=t.success,i=function(){e.trigger("destroy",e,e.collection,t)};if(t.success=function(r){(t.wait||e.isNew())&&i(),n&&n(e,r,t)},this.isNew())return t.success(),!1;var r=this.sync("delete",this,t);return t.wait||i(),r},url:function(){var t=o.result(this,"urlRoot")||o.result(this.collection,"url")||S();return this.isNew()?t:t+("/"===t.charAt(t.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(t){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(t){var e=this._changing;this._changing=!0;var n=this._computeChanges(!0);this._pending=!!n.length;for(var i=n.length-2;i>=0;i-=2)this.trigger("change:"+n[i],this,n[i+1],t);if(e)return this;for(;this._pending;)this._pending=!1,this.trigger("change",this,t),this._previousAttributes=o.clone(this.attributes);return this._changing=!1,this},hasChanged:function(t){return this._hasComputed||this._computeChanges(),null==t?!o.isEmpty(this.changed):o.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?o.clone(this.changed):!1;var e,n,i=!1,r=this._previousAttributes;for(n in t)o.isEqual(r[n],e=t[n])||((i||(i={}))[n]=e);return i},_computeChanges:function(t){this.changed={};for(var e={},n=[],i=this._currentAttributes,r=this._changes,s=r.length-2;s>=0;s-=2){var a=r[s],o=r[s+1];e[a]||(e[a]=!0,i[a]!==o&&(this.changed[a]=o,t&&(n.push(a,o),i[a]=o)))}return t&&(this._changes=[]),this._hasComputed=!0,n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return o.clone(this._previousAttributes)},_validate:function(t,e){if(!this.validate)return!0;var t=o.extend({},this.attributes,t),n=this.validate(t,e);return n?(e&&e.error&&e.error(this,n,e),this.trigger("error",this,n,e),!1):!0}});var f=t.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,o.extend({silent:!0},e))};o.extend(f.prototype,i,{model:h,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return t.sync.apply(this,arguments)},add:function(t,e){var n,i,s,u,c=e&&e.at,l=null==(e&&e.sort)?!0:e.sort,t=o.isArray(t)?t.slice():[t];for(n=t.length-1;n>=0;n--)(i=this._prepareModel(t[n],e))?(t[n]=i,(s=null!=i.id&&this._byId[i.id])||this._byCid[i.cid]?(e&&e.merge&&s&&(s.set(i.attributes,e),u=l),t.splice(n,1)):(i.on("all",this._onModelEvent,this),this._byCid[i.cid]=i,null!=i.id&&(this._byId[i.id]=i))):(this.trigger("error",this,t[n],e),t.splice(n,1));if(t.length&&(u=l),this.length+=t.length,n=[null!=c?c:this.models.length,0],r.apply(n,t),a.apply(this.models,n),u&&this.comparator&&null==c&&this.sort({silent:!0}),e&&e.silent)return this;for(;i=t.shift();)i.trigger("add",i,this,e);return this},remove:function(t,e){var n,i,r,s;for(e||(e={}),t=o.isArray(t)?t.slice():[t],n=0,i=t.length;i>n;n++)(s=this.get(t[n]))&&(delete this._byId[s.id],delete this._byCid[s.cid],r=this.indexOf(s),this.models.splice(r,1),this.length--,e.silent||(e.index=r,s.trigger("remove",s,this,e)),this._removeReference(s));return this},push:function(t,e){return t=this._prepareModel(t,e),this.add(t,o.extend({at:this.length},e)),t},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t),e},unshift:function(t,e){return t=this._prepareModel(t,e),this.add(t,o.extend({at:0},e)),t},shift:function(t){var e=this.at(0);return this.remove(e,t),e},slice:function(t,e){return this.models.slice(t,e)},get:function(t){return null==t?void 0:this._byId[null!=t.id?t.id:t]||this._byCid[t.cid||t]},at:function(t){return this.models[t]},where:function(t){return o.isEmpty(t)?[]:this.filter(function(e){for(var n in t)if(t[n]!==e.get(n))return!1;return!0})},sort:function(t){if(!this.comparator)throw Error("Cannot sort a set without a comparator");return o.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(o.bind(this.comparator,this)),(!t||!t.silent)&&this.trigger("sort",this,t),this},pluck:function(t){return o.invoke(this.models,"get",t)},update:function(t,e){var n,i,r,s,a=[],u=[],c={},l=this.model.prototype.idAttribute,e=o.extend({add:!0,merge:!0,remove:!0},e);if(e.parse&&(t=this.parse(t)),o.isArray(t)||(t=t?[t]:[]),e.add&&!e.remove)return this.add(t,e);for(i=0,r=t.length;r>i;i++)n=t[i],s=this.get(n.id||n.cid||n[l]),e.remove&&s&&(c[s.cid]=!0),(e.add&&!s||e.merge&&s)&&a.push(n);if(e.remove)for(i=0,r=this.models.length;r>i;i++)n=this.models[i],c[n.cid]||u.push(n);return u.length&&this.remove(u,e),a.length&&this.add(a,e),this},reset:function(t,e){e||(e={}),e.parse&&(t=this.parse(t));for(var n=0,i=this.models.length;i>n;n++)this._removeReference(this.models[n]);return e.previousModels=this.models,this._reset(),t&&this.add(t,o.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),this},fetch:function(t){t=t?o.clone(t):{},void 0===t.parse&&(t.parse=!0);var e=this,n=t.success;return t.success=function(i){e[t.update?"update":"reset"](i,t),n&&n(e,i,t)},this.sync("read",this,t)},create:function(t,e){var n=this,e=e?o.clone(e):{},t=this._prepareModel(t,e);if(!t)return!1;e.wait||n.add(t,e);var i=e.success;return e.success=function(t,e,r){r.wait&&n.add(t,r),i&&i(t,e,r)},t.save(null,e),t},parse:function(t){return t},clone:function(){return new this.constructor(this.models)},chain:function(){return o(this.models).chain()},_reset:function(){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(t,e){if(t instanceof h)return t.collection||(t.collection=this),t;e||(e={}),e.collection=this;var n=new this.model(t,e);return n._validate(t,e)?n:!1},_removeReference:function(t){this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,i){("add"===t||"remove"===t)&&n!==this||("destroy"===t&&this.remove(e,i),e&&t==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],null!=e.id&&(this._byId[e.id]=e)),this.trigger.apply(this,arguments))}}),o.each("forEach each map collect reduce foldl inject reduceRight foldr find detect filter select reject every all some any include contains invoke max min sortedIndex toArray size first head take initial rest tail last without indexOf shuffle lastIndexOf isEmpty".split(" "),function(t){f.prototype[t]=function(){var e=s.call(arguments);return e.unshift(this.models),o[t].apply(o,e)}}),o.each(["groupBy","countBy","sortBy"],function(t){f.prototype[t]=function(e,n){var i=o.isFunction(e)?e:function(t){return t.get(e)};return o[t](this.models,i,n)}});var p=t.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},d=/\((.*?)\)/g,g=/:\w+/g,v=/\*\w+/g,m=/[\-{}\[\]+?.,\\\^$|#\s]/g;o.extend(p.prototype,i,{initialize:function(){},route:function(e,n,i){return o.isRegExp(e)||(e=this._routeToRegExp(e)),i||(i=this[n]),t.history.route(e,o.bind(function(r){r=this._extractParameters(e,r),i&&i.apply(this,r),this.trigger.apply(this,["route:"+n].concat(r)),t.history.trigger("route",this,n,r)},this)),this},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(this.routes)for(var t,e=o.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])},_routeToRegExp:function(t){return t=t.replace(m,"\\$&").replace(d,"(?:$1)?").replace(g,"([^/]+)").replace(v,"(.*?)"),RegExp("^"+t+"$")},_extractParameters:function(t,e){return t.exec(e).slice(1)}});var y=t.History=function(){this.handlers=[],o.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},_=/^[#\/]|\s+$/g,b=/^\/+|\/+$/g,x=/msie [\w.]+/,w=/\/$/;y.started=!1,o.extend(y.prototype,i,{interval:50,getHash:function(t){return(t=(t||this).location.href.match(/#(.*)$/))?t[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||!this._wantsHashChange||e){var t=this.location.pathname,n=this.root.replace(w,"");t.indexOf(n)||(t=t.substr(n.length))}else t=this.getHash();return t.replace(_,"")},start:function(e){if(y.started)throw Error("Backbone.history has already been started");y.started=!0,this.options=o.extend({},{root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.options.pushState||!this.history||!this.history.pushState);var e=this.getFragment(),n=document.documentMode,n=x.exec(navigator.userAgent.toLowerCase())&&(!n||7>=n);return this.root=("/"+this.root+"/").replace(b,"/"),n&&this._wantsHashChange&&(this.iframe=t.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(e)),this._hasPushState?t.$(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!n?t.$(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=e,e=this.location,n=e.pathname.replace(/[^\/]$/,"$&/")===this.root,this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!n?(this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0):(this._wantsPushState&&this._hasPushState&&n&&e.hash&&(this.fragment=this.getHash().replace(_,""),this.history.replaceState({},document.title,this.root+this.fragment+e.search)),this.options.silent?void 0:this.loadUrl())},stop:function(){t.$(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),y.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(){var t=this.getFragment();return t===this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe))),t===this.fragment?!1:(this.iframe&&this.navigate(t),this.loadUrl()||this.loadUrl(this.getHash()),void 0)},loadUrl:function(t){var e=this.fragment=this.getFragment(t);return o.any(this.handlers,function(t){return t.route.test(e)?(t.callback(e),!0):void 0})},navigate:function(t,e){if(!y.started)return!1;if(e&&!0!==e||(e={trigger:e}),t=this.getFragment(t||""),this.fragment!==t){this.fragment=t;var n=this.root+t;if(this._hasPushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getFragment(this.getHash(this.iframe))&&(e.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,t,e.replace))}e.trigger&&this.loadUrl(t)}},_updateHash:function(t,e,n){n?(n=t.href.replace(/(javascript:|#).*$/,""),t.replace(n+"#"+e)):t.hash="#"+e}}),t.history=new y;var k=t.View=function(t){this.cid=o.uniqueId("view"),this._configure(t||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},E=/^(\S+)\s*(.*)$/,A="model collection el id attributes className tagName events".split(" ");o.extend(k.prototype,i,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},make:function(e,n,i){return e=document.createElement(e),n&&t.$(e).attr(n),null!=i&&t.$(e).html(i),e},setElement:function(e,n){return this.$el&&this.undelegateEvents(),this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0],!1!==n&&this.delegateEvents(),this},delegateEvents:function(t){if(t||(t=o.result(this,"events"))){this.undelegateEvents();for(var e in t){var n=t[e];if(o.isFunction(n)||(n=this[t[e]]),!n)throw Error('Method "'+t[e]+'" does not exist');var i=e.match(E),r=i[1],i=i[2],n=o.bind(n,this),r=r+(".delegateEvents"+this.cid);""===i?this.$el.bind(r,n):this.$el.delegate(i,r,n)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(t){this.options&&(t=o.extend({},o.result(this,"options"),t)),o.extend(this,o.pick(t,A)),this.options=t},_ensureElement:function(){if(this.el)this.setElement(o.result(this,"el"),!1);else{var t=o.extend({},o.result(this,"attributes"));this.id&&(t.id=o.result(this,"id")),this.className&&(t["class"]=o.result(this,"className")),this.setElement(this.make(o.result(this,"tagName"),t),!1)}}});var j={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};t.sync=function(e,n,i){var r=j[e];o.defaults(i||(i={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var s={type:r,dataType:"json"};if(i.url||(s.url=o.result(n,"url")||S()),null!=i.data||!n||"create"!==e&&"update"!==e&&"patch"!==e||(s.contentType="application/json",s.data=JSON.stringify(i.attrs||n.toJSON(i))),i.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),i.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){s.type="POST",i.emulateJSON&&(s.data._method=r);var a=i.beforeSend;i.beforeSend=function(t){return t.setRequestHeader("X-HTTP-Method-Override",r),a?a.apply(this,arguments):void 0}}"GET"!==s.type&&!i.emulateJSON&&(s.processData=!1);var u=i.success;i.success=function(t,e,r){u&&u(t,e,r),n.trigger("sync",n,t,i)};var c=i.error;return i.error=function(t){c&&c(n,t,i),n.trigger("error",n,t,i)},e=t.ajax(o.extend(s,i)),n.trigger("request",n,e,i),e},t.ajax=function(){return t.$.ajax.apply(t.$,arguments)},h.extend=f.extend=p.extend=k.extend=y.extend=function(t,e){var n,i=this;n=t&&o.has(t,"constructor")?t.constructor:function(){i.apply(this,arguments)},o.extend(n,i,e);var r=function(){this.constructor=n};return r.prototype=i.prototype,n.prototype=new r,t&&o.extend(n.prototype,t),n.__super__=i.prototype,n};var S=function(){throw Error('A "url" property or function must be specified')}}.call(this),function(t){var e,n="https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyBUK3PeqSEzwPNIyg94dBQpziFOPvm7-aA&sort=style",i=t("head"),r=4,s=_.template(t("#font-template").html()),a=["Averia Libre","Averia Sans Libre","Averia Serif Libre"],o=Backbone.Model.extend({extUrlRoot:"http://www.google.com/webfonts/specimen/",getFontData:function(){var t=this.toJSON();return t.extlink=this.extUrlRoot+encodeURIComponent(t.family),t.variants=_.map(t.variants,function(t){return t.replace(/italic$/," italic")}),t}}),u=Backbone.View.extend({className:"font",template:s,apiBase:"http://fonts.googleapis.com/css?family=",render:function(){var t=this.model.getFontData(),e='"'+t.family+'"';
this.getFont(),this.$el.html(this.template(t)).css({fontFamily:e})},getFont:function(){var e=this.model.toJSON(),n=e.family+":"+e.variants.join(",")+"&text="+e.family+"Iitalic1234567890",r=this.apiBase+n;t('<link rel="stylesheet" href="'+r+'" >').appendTo(i)}}),c=Backbone.Collection.extend({model:o}),l=new c,h=Backbone.View.extend({collection:l,render:function(){t("h1").prepend(this.collection.length+" "),this.collection.forEach(this.addOne,this)},addOne:function(t){var e=new u({model:t});e.render(),this.$el.append(e.el)}}),f=new h,p=function(n){if("webfonts#webfontList"===n.kind){var i=_.filter(n.items,function(t){return t.variants.length>=r&&-1==a.indexOf(t.family)});e=i,l.reset(i),f.render(),t("#fonts").html(f.el)}};jQuery(document).ready(function(){t.ajax(n,{dataType:"jsonp",jsonpCallback:"callback",success:p})})}(jQuery);