/* ractive.min.js v0.6.1 2014-10-25 - commit 3a576eb3 http://ractivejs.org http://twitter.com/RactiveJS Released under the MIT License. */ !function(a){"use strict";var b=a.Ractive,c=function(){var a={el:void 0,append:!1,template:{v:1,t:[]},"yield":null,preserveWhitespace:!1,sanitize:!1,stripComments:!0,data:{},computed:{},magic:!1,modifyArrays:!0,adapt:[],isolated:!1,twoway:!0,lazy:!1,noIntro:!1,transitionsEnabled:!0,complete:void 0,noCssTransform:!1,debug:!1};return a}(),d={linear:function(a){return a},easeIn:function(a){return Math.pow(a,3)},easeOut:function(a){return Math.pow(a-1,3)+1},easeInOut:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)}},e=[],f=Object.prototype.hasOwnProperty,g=function(){var a=Object.prototype.toString;return function(b){return"[object Array]"===a.call(b)}}(),h=function(){var a=Object.prototype.toString;return function(b){return b&&"[object Object]"===a.call(b)}}(),i=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},j=function(a,b,c,d,e){var f,g,h;return a.push(function(){g=a.interpolate}),h=/^([+-]?[0-9]+\.?(?:[0-9]+)?)(px|em|ex|%|in|cm|mm|pt|pc)$/,f={number:function(a,b){var c;return e(a)&&e(b)?(a=+a,b=+b,c=b-a,c?function(b){return a+b*c}:function(){return a}):null},array:function(a,b){var d,e,f,h;if(!c(a)||!c(b))return null;for(d=[],e=[],h=f=Math.min(a.length,b.length);h--;)e[h]=g(a[h],b[h]);for(h=f;h{name}}}) cannot contain nested inline partials",evaluationError:'Error evaluating "{uniqueString}": {err}',badArguments:"Bad arguments \"{arguments}\". I'm not allowed to argue unless you've paid.",failedComputation:'Failed to compute "{key}": {err}',missingPlugin:'Missing "{name}" {plugin} plugin. You may need to download a {plugin} via http://docs.ractivejs.org/latest/plugins#{plugin}s',badRadioInputBinding:"A radio input can have two-way binding on its name attribute, or its checked attribute - not both",noRegistryFunctionReturn:'A function was specified for "{name}" {registry}, but no {registry} was returned',defaultElSpecified:"The <{name}/> component has a default `el` property; it has been disregarded",noElementProxyEventWildcards:'Only component proxy-events may contain "*" wildcards, <{element} on-{event}/> is not valid.',methodDeprecated:'The method "{deprecated}" has been deprecated in favor of "{replacement}" and will likely be removed in a future release. See http://docs.ractivejs.org/latest/migrating for more information.'},n=function(a,b){function c(a){var c=b[a.message]||a.message||"";return d(c,a.args)}function d(a,b){return a.replace(/{([^{}]*)}/g,function(a,c){return b[c]})}var e={warn:function(a,b){(a.debug||b)&&this.warnAlways(a)},warnAlways:function(a){this.logger(c(a),a.allowDuplicates)},error:function(a){this.errorOnly(a),a.debug||this.warn(a,!0)},errorOnly:function(a){a.debug&&this.critical(a)},critical:function(a){var b=a.err||new Error(c(a));this.thrower(b)},logger:a,thrower:function(a){throw a}};return e}(l,m),o=function(a){function b(a){this.event=a,this.method="on"+a,this.deprecate=c[a]}var c={construct:{deprecated:"beforeInit",replacement:"onconstruct"},render:{deprecated:"init",message:'The "init" method has been deprecated and will likely be removed in a future release. You can either use the "oninit" method which will fire only once prior to, and regardless of, any eventual ractive instance being rendered, or if you need to access the rendered DOM, use "onrender" instead. See http://docs.ractivejs.org/latest/migrating for more information.'},complete:{deprecated:"complete",replacement:"oncomplete"}};return b.prototype.fire=function(b,c){function d(a){return b[a]?(c?b[a](c):b[a](),!0):void 0}d(this.method),!b[this.method]&&this.deprecate&&d(this.deprecate.deprecated)&&a.warnAlways({debug:b.debug,message:this.deprecate.message||"methodDeprecated",args:this.deprecate}),c?b.fire(this.event,c):b.fire(this.event)},b}(n),p=function(a,b){var c=a.indexOf(b);-1!==c&&a.splice(c,1)},q=function(){function a(a){setTimeout(a,0)}function b(a,b){return function(){for(var c;c=a.shift();)c(b)}}function c(a,b,d,f){var g;if(b===a)throw new TypeError("A promise's fulfillment handler cannot return the same promise");if(b instanceof e)b.then(d,f);else if(!b||"object"!=typeof b&&"function"!=typeof b)d(b);else{try{g=b.then}catch(h){return void f(h)}if("function"==typeof g){var i,j,k;j=function(b){i||(i=!0,c(a,b,d,f))},k=function(a){i||(i=!0,f(a))};try{g.call(b,j,k)}catch(h){if(!i)return f(h),void(i=!0)}}else d(b)}}var d,e,f={},g={},h={};return"function"==typeof q?e=q:(e=function(d){var i,j,k,l,m,n,o=[],p=[],q=f;k=function(c){return function(d){q===f&&(i=d,q=c,j=b(q===g?o:p,i),a(j))}},l=k(g),m=k(h);try{d(l,m)}catch(r){m(r)}return n={then:function(b,d){var g=new e(function(e,h){var i=function(a,b,d){b.push("function"==typeof a?function(b){var d;try{d=a(b),c(g,d,e,h)}catch(f){h(f)}}:d)};i(b,o,e),i(d,p,h),q!==f&&a(j)});return g}},n["catch"]=function(a){return this.then(null,a)},n},e.all=function(a){return new e(function(b,c){var d,e,f,g=[];if(!a.length)return void b(g);for(f=function(e){a[e].then(function(a){g[e]=a,--d||b(g)},c)},d=e=a.length;e--;)f(e)})},e.resolve=function(a){return new e(function(b){b(a)})},e.reject=function(a){return new e(function(b,c){c(a)})}),d=e}(),r=function(){var a=/\[\s*(\*|[0-9]|[1-9][0-9]+)\s*\]/g;return function(b){return(b||"").replace(a,".$1")}}(),s=function(a){do if(void 0!==a.context)return a.context;while(a=a.parent);return""},t=function(a,b){return null===a&&null===b?!0:"object"==typeof a||"object"==typeof b?!1:a===b},u=function(a,b){function c(a,b){var c=a.computations[b];return!c||c.setter}var d;a.push(function(){return d=a.runloop});var e=function(a,b,c,d){var e=this;this.root=a,this.keypath=b,this.otherInstance=c,this.otherKeypath=d,this.lock=function(){return e.updating=!0},this.unlock=function(){return e.updating=!1},this.bind(),this.value=this.root.viewmodel.get(this.keypath)};return e.prototype={isLocked:function(){return this.updating||this.counterpart&&this.counterpart.updating},shuffle:function(a,b){this.propagateChange(b,a)},setValue:function(a){this.propagateChange(a)},propagateChange:function(a,e){var f;return this.isLocked()?void(this.value=a):void(b(a,this.value)||(this.lock(),d.addViewmodel(f=this.otherInstance.viewmodel)||this.counterpart.value===a||d.scheduleTask(function(){return d.addViewmodel(f)}),e?f.smartUpdate(this.otherKeypath,a,e):c(f,this.otherKeypath)&&f.set(this.otherKeypath,a),this.value=a,d.scheduleTask(this.unlock)))},refineValue:function(a){var b,c=this;this.isLocked()||(this.lock(),d.addViewmodel(b=this.otherInstance.viewmodel),a.map(function(a){return c.otherKeypath+a.substr(c.keypath.length)}).forEach(function(a){return b.mark(a)}),d.scheduleTask(this.unlock))},bind:function(){this.root.viewmodel.register(this.keypath,this)},rebind:function(a){this.unbind(),this.keypath=a,this.counterpart.otherKeypath=a,this.bind()},unbind:function(){this.root.viewmodel.unregister(this.keypath,this)}},function(a,b,c,d){var f,g,h,i,j;f=c+"="+d,h=a.bindings,h[f]||(g=a.instance,i=new e(b,c,g,d),h.push(i),g.twoway&&(j=new e(g,d,b,c),h.push(j),i.counterpart=j,j.counterpart=i),h[f]=i)}}(e,t),v=function(a,b,c){function d(a,b){var c;if("."===b)return a;if(c=a?a.split("."):[],"../"===b.substr(0,3)){for(;"../"===b.substr(0,3);){if(!c.length)throw new Error(f);c.pop(),b=b.substring(3)}return c.push(b),c.join(".")}return a?a+b.replace(/^\.\//,"."):b.replace(/^\.\/?/,"")}var e,f,g;return f='Could not resolve reference - too many "../" prefixes',g={evaluateWrapped:!0},e=function h(e,f,i,j){var k,l,m,n,o,p,q,r,s,t;if(f=a(f),"~/"===f.substr(0,2))return f.substring(2);if("."===f.charAt(0))return d(b(i),f);l=f.split(".")[0],i=i||{};do if(k=i.context,k&&(p=!0,o=e.viewmodel.get(k,g),o&&("object"==typeof o||"function"==typeof o)&&l in o))return k+"."+f;while(i=i.parent);if(l in e.data||l in e.viewmodel.computations)return f;if(e._parent&&!e.isolated){if(p=!0,i=e.component.parentFragment,i.indexRefs&&void 0!==(m=i.indexRefs[f]))return e.component.indexRefBindings[f]=f,void e.viewmodel.set(f,m,!0);if(n=h(e._parent,f,i,!0)){for(q=n.split("."),r=f.split(".");q.length>1&&r.length>1&&q[q.length-1]===r[r.length-1];)q.pop(),r.pop();return s=q.join("."),t=r.join("."),e.viewmodel.set(t,e._parent.viewmodel.get(s),!0),c(e.component,e._parent,s,t),f}}return j||p?void 0!==e.viewmodel.get(f)?f:void 0:(e.viewmodel.set(f,void 0),f)}}(r,s,u),w=function(a){function b(a){a.detach()}function c(a){a.detachNodes()}function d(a){!a.ready||a.outros.length||a.outroChildren||(a.outrosComplete||(a.parent?a.parent.decrementOutros(a):a.detachNodes(),a.outrosComplete=!0),a.intros.length||a.totalChildren||("function"==typeof a.callback&&a.callback(),a.parent&&a.parent.decrementTotal()))}var e=function(a,b){this.callback=a,this.parent=b,this.intros=[],this.outros=[],this.children=[],this.totalChildren=this.outroChildren=0,this.detachQueue=[],this.outrosComplete=!1,b&&b.addChild(this)};return e.prototype={addChild:function(a){this.children.push(a),this.totalChildren+=1,this.outroChildren+=1},decrementOutros:function(){this.outroChildren-=1,d(this)},decrementTotal:function(){this.totalChildren-=1,d(this)},add:function(a){var b=a.isIntro?this.intros:this.outros;b.push(a)},remove:function(b){var c=b.isIntro?this.intros:this.outros;a(c,b),d(this)},init:function(){this.ready=!0,d(this)},detachNodes:function(){this.detachQueue.forEach(b),this.children.forEach(c)}},e}(p),x=function(a,b,c,d,e,f){function g(){var a,b,c;for(a=0;a\~:]))+)((?::[^\s\+\>\~]+)?\s*[\s\+\>\~]?)\s*/g,g=/^@media/,h=/\[data-rvcguid="[a-z0-9-]+"]/g;return c=function(c,i){var j,k;return k=function(a){var c,d,e,g,h,j,k,l,m=[];for(c=[];d=f.exec(a);)c.push({str:d[0],base:d[1],modifiers:d[2]});for(g='[data-rvcguid="'+i+'"]',h=c.map(b),l=c.length;l--;)k=h.slice(),e=c[l],k[l]=e.base+g+e.modifiers||"",j=h.slice(),j[l]=g+" "+j[l],m.push(k.join(" "),j.join(" "));return m.join(", ")},j=h.test(c)?c.replace(h,'[data-rvcguid="'+i+'"]'):c.replace(e,"").replace(d,function(b,c){var d,e;return g.test(c)?b:(d=c.split(",").map(a),e=d.map(k).join(", ")+" ",b.replace(c,e))})}}(),O=function(a){function b(a,b,d){var e,f=b.constructor._guid;(e=c(d.css,d,f)||c(a.css,a,f))&&(b.constructor.css=e)}function c(b,c,d){return b?c.noCssTransform?b:a(b,d):void 0}var d={name:"css",extend:b,init:function(){}};return d}(N),P=function(){function a(a,b){return"function"==typeof b&&/_super/.test(a)}var b;return b=function(b,c,d){return d||a(b,c)?function(){var a,d="_super"in this,e=this._super;return this._super=c,a=b.apply(this,arguments),d&&(this._super=e),a}:b}}(),Q=function(a){function b(a,b,c){var d=c.data||{},e=f(a.prototype.data);if("object"!=typeof d&&"function"!=typeof d)throw new TypeError('data option must be an object or a function, "'+d+'" is not valid');return g(e,d)}function c(a,c,d){c.data=b(a,c,d)}function d(a,c,d){var e=d.data,f=b(a,c,d);return"function"==typeof f&&(f=f.call(c,e)||e),c.data=f||{}}function e(a){var b=this.init(a.constructor,a,a);return b?(a.data=b,!0):void 0}function f(a){if("function"!=typeof a||!Object.keys(a).length)return a;var b={};return h(a,b),g(a,b)}function g(a,b){return"function"==typeof b?k(b,a):"function"==typeof a?j(b,a):i(b,a)}function h(a,b,c){for(var d in a)c&&d in b||(b[d]=a[d])}function i(a,b){return a=a||{},b?(h(b,a,!0),a):a}function j(a,b){return function(c){var d;if(a){d=[];for(var e in a)c&&e in c||d.push(e)}return c=b.call(this,c)||c,d&&d.length&&(c=c||{},d.forEach(function(b){c[b]=a[b]})),c}}function k(b,c){var d;return d="function"!=typeof c?function(a){i(a,c)}:function(b){return c=a(c,function(){},!0),c.call(this,b)||b},a(b,d)}var l,m={name:"data",extend:c,init:d,reset:e};return l=m}(P),R={TEXT:1,INTERPOLATOR:2,TRIPLE:3,SECTION:4,INVERTED:5,CLOSING:6,ELEMENT:7,PARTIAL:8,COMMENT:9,DELIMCHANGE:10,MUSTACHE:11,TAG:12,ATTRIBUTE:13,CLOSING_TAG:14,COMPONENT:15,NUMBER_LITERAL:20,STRING_LITERAL:21,ARRAY_LITERAL:22,OBJECT_LITERAL:23,BOOLEAN_LITERAL:24,GLOBAL:26,KEY_VALUE_PAIR:27,REFERENCE:30,REFINEMENT:31,MEMBER:32,PREFIX_OPERATOR:33,BRACKETED:34,CONDITIONAL:35,INFIX_OPERATOR:36,INVOCATION:40,SECTION_IF:50,SECTION_UNLESS:51,SECTION_EACH:52,SECTION_WITH:53,SECTION_IF_WITH:54},S=function(){var a;try{Object.create(null),a=Object.create}catch(b){a=function(){var a=function(){};return function(b,c){var d;return null===b?{}:(a.prototype=b,d=new a,c&&Object.defineProperties(d,c),d)}}()}return a}(),T={expectedExpression:"Expected a JavaScript expression",expectedParen:"Expected closing paren"},U=function(a){var b=/^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/;return function(c){var d;return(d=c.matchPattern(b))?{t:a.NUMBER_LITERAL,v:d}:null}}(R),V=function(a){return function(b){var c=b.remaining();return"true"===c.substr(0,4)?(b.pos+=4,{t:a.BOOLEAN_LITERAL,v:"true"}):"false"===c.substr(0,5)?(b.pos+=5,{t:a.BOOLEAN_LITERAL,v:"false"}):null}}(R),W=function(){var a,b,c;return a=/^(?=.)[^"'\\]+?(?:(?!.)|(?=["'\\]))/,b=/^\\(?:['"\\bfnrt]|0(?![0-9])|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|(?=.)[^ux0-9])/,c=/^\\(?:\r\n|[\u000A\u000D\u2028\u2029])/,function(d){return function(e){var f,g,h,i;for(f=e.pos,g='"',h=!1;!h;)i=e.matchPattern(a)||e.matchPattern(b)||e.matchString(d),i?g+='"'===i?'\\"':"\\'"===i?"'":i:(i=e.matchPattern(c),i?g+="\\u"+("000"+i.charCodeAt(1).toString(16)).slice(-4):h=!0);return g+='"',JSON.parse(g)}}}(),X=function(a){return a('"')}(W),Y=function(a){return a("'")}(W),Z=function(a,b,c){return function(d){var e,f;return e=d.pos,d.matchString('"')?(f=c(d),d.matchString('"')?{t:a.STRING_LITERAL,v:f}:(d.pos=e,null)):d.matchString("'")?(f=b(d),d.matchString("'")?{t:a.STRING_LITERAL,v:f}:(d.pos=e,null)):null}}(R,X,Y),$={name:/^[a-zA-Z_$][a-zA-Z_$0-9]*/},_=function(a,b,c){var d=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;return function(e){var f;return(f=a(e))?d.test(f.v)?f.v:'"'+f.v.replace(/"/g,'\\"')+'"':(f=b(e))?f.v:(f=e.matchPattern(c.name))?f:void 0}}(Z,U,$),ab=function(a,b){return function(c){var d,e,f;return d=c.pos,c.allowWhitespace(),e=b(c),null===e?(c.pos=d,null):(c.allowWhitespace(),c.matchString(":")?(c.allowWhitespace(),f=c.readExpression(),null===f?(c.pos=d,null):{t:a.KEY_VALUE_PAIR,k:e,v:f}):(c.pos=d,null))}}(R,_),bb=function(a){return function b(c){var d,e,f,g;return d=c.pos,f=a(c),null===f?null:(e=[f],c.matchString(",")?(g=b(c),g?e.concat(g):(c.pos=d,null)):e)}}(ab),cb=function(a,b){return function(c){var d,e;return d=c.pos,c.allowWhitespace(),c.matchString("{")?(e=b(c),c.allowWhitespace(),c.matchString("}")?{t:a.OBJECT_LITERAL,m:e}:(c.pos=d,null)):(c.pos=d,null)}}(R,bb),db=function(a){return function b(c){function d(a){f.push(a)}var e,f,g,h;return e=c.pos,c.allowWhitespace(),g=c.readExpression(),null===g?null:(f=[g],c.allowWhitespace(),c.matchString(",")&&(h=b(c),null===h&&c.error(a.expectedExpression),h.forEach(d)),f)}}(T),eb=function(a,b){return function(c){var d,e;return d=c.pos,c.allowWhitespace(),c.matchString("[")?(e=b(c),c.matchString("]")?{t:a.ARRAY_LITERAL,m:e}:(c.pos=d,null)):(c.pos=d,null)}}(R,db),fb=function(a,b,c,d,e){return function(f){var g=a(f)||b(f)||c(f)||d(f)||e(f);return g}}(U,V,Z,cb,eb),gb=function(a,b){var c,d,e,f,g;return c=/^\.[a-zA-Z_$0-9]+/,e=function(a){var b=a.matchPattern(d);return b?"."+b:null},d=/^\[(0|[1-9][0-9]*)\]/,f=/^(?:Array|console|Date|RegExp|decodeURIComponent|decodeURI|encodeURIComponent|encodeURI|isFinite|isNaN|parseFloat|parseInt|JSON|Math|NaN|undefined|null)$/,g=/^(?:break|case|catch|continue|debugger|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|void|while|with)$/,function(d){var h,i,j,k,l,m,n;if(h=d.pos,d.matchString("~/"))i="~/";else for(i="";d.matchString("../");)i+="../";if(i||(k=d.matchString("./")||d.matchString(".")||""),j=d.matchPattern(/^@(?:keypath|index|key)/)||d.matchPattern(b.name)||"",g.test(j))return d.pos=h,null;if(!i&&!k&&f.test(j))return{t:a.GLOBAL,v:j};if(l=(i||k)+j,!l)return null;for(;m=d.matchPattern(c)||e(d);)l+=m;return d.matchString("(")&&(n=l.lastIndexOf("."),-1!==n?(l=l.substr(0,n),d.pos=h+l.length):d.pos-=1),{t:a.REFERENCE,n:l.replace(/^this\./,"./").replace(/^this$/,".")}}}(R,$),hb=function(a,b){return function(c){var d,e;return d=c.pos,c.matchString("(")?(c.allowWhitespace(),e=c.readExpression(),e||c.error(b.expectedExpression),c.allowWhitespace(),c.matchString(")")||c.error(b.expectedParen),{t:a.BRACKETED,x:e}):null}}(R,T),ib=function(a,b,c){return function(d){return a(d)||b(d)||c(d)}}(fb,gb,hb),jb=function(a,b,c){return function(d){var e,f,g;if(e=d.pos,d.allowWhitespace(),d.matchString(".")){if(d.allowWhitespace(),f=d.matchPattern(c.name))return{t:a.REFINEMENT,n:f};d.error("Expected a property name")}return d.matchString("[")?(d.allowWhitespace(),g=d.readExpression(),g||d.error(b.expectedExpression),d.allowWhitespace(),d.matchString("]")||d.error("Expected ']'"),{t:a.REFINEMENT,x:g}):null}}(R,T,$),kb=function(a,b,c,d,e){return function(f){var g,h,i,j;if(h=b(f),!h)return null;for(;h;)if(g=f.pos,i=d(f))h={t:a.MEMBER,x:h,r:i};else{if(!f.matchString("("))break;f.allowWhitespace(),j=c(f),f.allowWhitespace(),f.matchString(")")||f.error(e.expectedParen),h={t:a.INVOCATION,x:h},j&&(h.o=j)}return h}}(R,ib,db,jb,T),lb=function(a,b,c){var d,e;return e=function(c,d){return function(e){var f;return(f=d(e))?f:e.matchString(c)?(e.allowWhitespace(),f=e.readExpression(),f||e.error(b.expectedExpression),{s:c,o:f,t:a.PREFIX_OPERATOR}):null}},function(){var a,b,f,g,h;for(g="! ~ + - typeof".split(" "),h=c,a=0,b=g.length;b>a;a+=1)f=e(g[a],h),h=f;d=h}(),d}(R,T,kb),mb=function(a,b){var c,d;return d=function(b,c){return function(d){var e,f,g;if(f=c(d),!f)return null;for(;;){if(e=d.pos,d.allowWhitespace(),!d.matchString(b))return d.pos=e,f;if("in"===b&&/[a-zA-Z_$0-9]/.test(d.remaining().charAt(0)))return d.pos=e,f;if(d.allowWhitespace(),g=c(d),!g)return d.pos=e,f;f={t:a.INFIX_OPERATOR,s:b,o:[f,g]}}}},function(){var a,e,f,g,h;for(g="* / % + - << >> >>> < <= > >= in instanceof == != === !== & ^ | && ||".split(" "),h=b,a=0,e=g.length;e>a;a+=1)f=d(g[a],h),h=f;c=h}(),c}(R,lb),nb=function(a,b,c){return function(d){var e,f,g,h;return(f=b(d))?(e=d.pos,d.allowWhitespace(),d.matchString("?")?(d.allowWhitespace(),g=d.readExpression(),g||d.error(c.expectedExpression),d.allowWhitespace(),d.matchString(":")||d.error('Expected ":"'),d.allowWhitespace(),h=d.readExpression(),h||d.error(c.expectedExpression),{t:a.CONDITIONAL,o:[f,g,h]}):(d.pos=e,f)):null}}(R,mb,T),ob=function(a,b){function c(a){return JSON.stringify(String(a))}function d(c,e){var f,g;if(c.t===a.REFERENCE&&-1===e.indexOf(c.n)&&e.unshift(c.n),g=c.o||c.m)if(b(g))d(g,e);else for(f=g.length;f--;)d(g[f],e);c.x&&d(c.x,e),c.r&&d(c.r,e),c.v&&d(c.v,e)}function e(b,d,f){var g=function(a){return e(b,a,f)};switch(d.t){case a.BOOLEAN_LITERAL:case a.GLOBAL:case a.NUMBER_LITERAL:return d.v;case a.STRING_LITERAL:return c(d.v);case a.ARRAY_LITERAL:return"["+(d.m?d.m.map(g).join(","):"")+"]";case a.OBJECT_LITERAL:return"{"+(d.m?d.m.map(g).join(","):"")+"}";case a.KEY_VALUE_PAIR:return d.k+":"+e(b,d.v,f);case a.PREFIX_OPERATOR:return("typeof"===d.s?"typeof ":d.s)+e(b,d.o,f);case a.INFIX_OPERATOR:return e(b,d.o[0],f)+("in"===d.s.substr(0,2)?" "+d.s+" ":d.s)+e(b,d.o[1],f);case a.INVOCATION:return e(b,d.x,f)+"("+(d.o?d.o.map(g).join(","):"")+")";case a.BRACKETED:return"("+e(b,d.x,f)+")";case a.MEMBER:return e(b,d.x,f)+e(b,d.r,f);case a.REFINEMENT:return d.n?"."+d.n:"["+e(b,d.x,f)+"]";case a.CONDITIONAL:return e(b,d.o[0],f)+"?"+e(b,d.o[1],f)+":"+e(b,d.o[2],f);case a.REFERENCE:return"_"+f.indexOf(d.n);default:b.error("Expected legal JavaScript")}}var f;return f=function(a){var b,c=[];return d(a,c),b={r:c,s:e(this,a,c)}}}(R,h),pb=function(a,b,c,d,e){var f,g,h=/^\s+/;return g=function(a){this.name="ParseError",this.message=a;try{throw new Error(a)}catch(b){this.stack=b.stack}},g.prototype=Error.prototype,f=function(a,b){var c,d,e=0;for(this.str=a,this.options=b||{},this.pos=0,this.lines=this.str.split("\n"),this.lineEnds=this.lines.map(function(a){var b=e+a.length+1;return e=b,b},0),this.init&&this.init(a,b),c=[];this.posc;c+=1)if(this.pos=b,e=a[c](this))return e;return null},readExpression:function(){return d(this)},flattenExpression:e,getLinePos:function(a){for(var b,c=0,d=0;a>=this.lineEnds[c];)d=this.lineEnds[c],c+=1;return b=a-d,[c+1,b+1,a]},error:function(a){var b,c,d,e,f,h;throw b=this.getLinePos(this.pos),c=b[0],d=b[1],e=this.lines[b[0]-1],f=e+"\n"+new Array(b[1]).join(" ")+"^----",h=new g(a+" at line "+c+" character "+d+":\n"+f),h.line=b[0],h.character=b[1],h.shortMessage=a,h},matchString:function(a){return this.str.substr(this.pos,a.length)===a?(this.pos+=a.length,a):void 0},matchPattern:function(a){var b;return(b=a.exec(this.remaining()))?(this.pos+=b[0].length,b[1]||b[0]):void 0},allowWhitespace:function(){this.matchPattern(h)},remaining:function(){return this.str.substring(this.pos)},nextChar:function(){return this.str.charAt(this.pos)}},f.extend=function(a){var d,e,g=this;d=function(a,b){f.call(this,a,b)},d.prototype=b(g.prototype);for(e in a)c.call(a,e)&&(d.prototype[e]=a[e]);return d.extend=f.extend,d},a.Parser=f,f}(e,S,f,nb,ob),qb=function(){var a=/^[^\s=]+/,b=/^\s+/;return function(c){var d,e,f;return c.matchString("=")?(d=c.pos,c.allowWhitespace(),(e=c.matchPattern(a))?c.matchPattern(b)?(f=c.matchPattern(a))?(c.allowWhitespace(),c.matchString("=")?[e,f]:(c.pos=d,null)):(c.pos=d,null):null:(c.pos=d,null)):null}}(),rb=[{delimiters:"delimiters",isTriple:!1,isStatic:!1},{delimiters:"tripleDelimiters",isTriple:!0,isStatic:!1},{delimiters:"staticDelimiters",isTriple:!1,isStatic:!0},{delimiters:"staticTripleDelimiters",isTriple:!0,isStatic:!0}],sb=function(a){var b={"#":a.SECTION,"^":a.INVERTED,"/":a.CLOSING,">":a.PARTIAL,"!":a.COMMENT,"&":a.TRIPLE};return function(a){var c=b[a.str.charAt(a.pos)];return c?(a.pos+=1,c):null}}(R),tb=function(a){return{each:a.SECTION_EACH,"if":a.SECTION_IF,"if-with":a.SECTION_IF_WITH,"with":a.SECTION_WITH,unless:a.SECTION_UNLESS}}(R),ub=null,vb=function(a,b,c){function d(b,c,d){var f;if(c){for(;c.t===a.BRACKETED&&c.x;)c=c.x;return c.t===a.REFERENCE?d.r=c.n:c.t===a.NUMBER_LITERAL&&i.test(c.v)?d.r=c.v:(f=e(b,c))?d.rx=f:d.x=b.flattenExpression(c),d}}function e(b,c){for(var d,e=[];c.t===a.MEMBER&&c.r.t===a.REFINEMENT;)d=c.r,e.unshift(d.x?d.x.t===a.REFERENCE?d.x:b.flattenExpression(d.x):d.n),c=c.x;return c.t!==a.REFERENCE?null:{r:c.n,m:e}}var f,g,h=/^\s*:\s*([a-zA-Z_$][a-zA-Z_$0-9]*)/,i=/^[0-9][1-9]*$/,j=new RegExp("^("+Object.keys(c).join("|")+")\\b");return g=/^[a-zA-Z$_0-9]+(?:(\.[a-zA-Z$_0-9]+)|(\[[a-zA-Z$_0-9]+\]))*$/,f=function(c,e){var f,i,k,l,m,n,o,p,q,r;if(f=c.pos,k={},r=c[e.delimiters],e.isStatic&&(k.s=!0),e.isTriple)k.t=a.TRIPLE;else{if("!"===c.remaining()[0]){try{n=c.readExpression(),c.allowWhitespace(),c.remaining().indexOf(r[1])?n=null:k.t=a.INTERPOLATOR}catch(s){}if(!n)return q=c.remaining().indexOf(r[1]),~q?c.pos+=q:c.error("Expected closing delimiter ('"+r[1]+"')"),{t:a.COMMENT}}if(!n)if(l=b(c),k.t=l||a.INTERPOLATOR,l===a.SECTION)(m=c.matchPattern(j))&&(k.n=m),c.allowWhitespace();else if((l===a.COMMENT||l===a.CLOSING)&&(p=c.remaining(),q=p.indexOf(r[1]),-1!==q))return k.r=p.substr(0,q).split(" ")[0],c.pos+=q,k}if(!n){c.allowWhitespace(),n=c.readExpression();var t;if(k.t===a.PARTIAL&&n&&(t=c.readExpression())&&(k={contextPartialExpression:n},n=t),p=c.remaining(),p.substr(0,r[1].length)!==r[1]&&":"!==p.charAt(0)){if(i=c.pos,c.pos=f,p=c.remaining(),q=p.indexOf(r[1]),-1!==q)return k.r=p.substr(0,q).trim(),g.test(k.r)||c.error("Expected a legal Mustache reference"),c.pos+=q,k;c.pos=i}}return d(c,n,k),k.contextPartialExpression&&(k.contextPartialExpression=[d(c,k.contextPartialExpression,{t:a.PARTIAL})]),(o=c.matchPattern(h))&&(k.i=o),k}}(R,sb,tb,ub),wb=function(a,b,c,d,e){function f(a){var b;return a.interpolate[a.inside]===!1?null:(b=c.slice().sort(function(b,c){return a[c.delimiters][0].length-a[b.delimiters][0].length}),function d(c){return c?g(a,c)||d(b.shift()):null}(b.shift()))}function g(c,f){var g,i,k,l,m,n,o,p;if(g=c.pos,k=c[f.delimiters],!c.matchString(k[0]))return null;if(i=b(c))return c.matchString(k[1])?(c[f.delimiters]=i,j):null;if(c.allowWhitespace(),i=d(c,f),null===i)return c.pos=g,null;if(c.allowWhitespace(),c.matchString(k[1])||c.error("Expected closing delimiter '"+k[1]+"' after reference"),i.t===a.COMMENT&&(i.exclude=!0),i.t===a.CLOSING&&(c.sectionDepth-=1,c.sectionDepth<0&&(c.pos=g,c.error("Attempted to close a section that wasn't open"))),i.contextPartialExpression)i.f=i.contextPartialExpression,i.t=a.SECTION,i.n="with",delete i.contextPartialExpression; else if(h(i)){for(c.sectionDepth+=1,l=[],o=l,m=i.n;p=c.read();){if(p.t===a.CLOSING){m&&p.r!==m&&c.error("Expected {{/"+m+"}}");break}if(p.t===a.INTERPOLATOR&&"else"===p.r){if("unless"!==i.n){o=n=[];continue}c.error("{{else}} not allowed in {{#unless}}")}o.push(p)}l.length&&(i.f=l),n&&n.length&&(i.l=n,"with"===i.n&&(i.n="if-with"))}return c.includeLinePositions&&(i.p=c.getLinePos(g)),i.n?i.n=e[i.n]:i.t===a.INVERTED&&(i.t=a.SECTION,i.n=a.SECTION_UNLESS),i}function h(b){return b.t===a.SECTION||b.t===a.INVERTED}var i,j={t:a.DELIMCHANGE,exclude:!0};return i=f}(R,qb,rb,vb,tb),xb=function(a){var b="";return function(d){var e,f,g,h,i;return e=d.pos,d.matchString(b)?(g=d.remaining(),h=g.indexOf(c),-1===h&&d.error("Illegal HTML - expected closing comment sequence ('-->')"),f=g.substr(0,h),d.pos+=h+3,i={t:a.COMMENT,c:f},d.includeLinePositions&&(i.p=d.getLinePos(e)),i):null}}(R),yb=function(){var a=/^(?:area|base|br|col|command|doctype|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/i;return a}(),zb=function(a,b){var c,d,e;for(c=b.length;c--;){if(d=a.indexOf(b[c]),!d)return 0;-1!==d&&(!e||e>d)&&(e=d)}return e||-1},Ab=function(){function a(a){return a?10===a?32:128>a?a:159>=a?d[a-128]:55296>a?a:57343>=a?65533:65535>=a?a:65533:65533}var b,c,d,e;return c={quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},d=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376],e=new RegExp("&(#?(?:x[\\w\\d]+|\\d+|"+Object.keys(c).join("|")+"));?","g"),b=function(b){return b.replace(e,function(b,d){var e;return e="#"!==d[0]?c[d]:"x"===d[1]?parseInt(d.substring(2),16):parseInt(d.substring(1),10),e?String.fromCharCode(a(e)):b})}}(ub),Bb=function(a,b){return function(c){var d,e,f,g;return e=c.remaining(),g=c.inside?"","`"):f.push(c.inAttribute?c.inAttribute:g),d=a(e,f)),d?(-1===d&&(d=e.length),c.pos+=d,c.inside?e.substr(0,d):b(e.substr(0,d))):null}}(zb,Ab),Cb=function(a){var b=/^([a-zA-Z]{1,}:?[a-zA-Z0-9\-]*)\s*\>/;return function(c){var d;return c.matchString("\/=]+/,l=/^[^\s"'=<>`]+/;return j=d}(zb,wb,Ab),Eb=function(a,b,c){function d(a){var b,d,e;return a.allowWhitespace(),(b=c(a))?(e={key:b},a.allowWhitespace(),a.matchString(":")?(a.allowWhitespace(),(d=a.read())?(e.value=d.v,e):null):null):null}var e,f,g,h,i,j,k;return f={"true":!0,"false":!1,undefined:void 0,"null":null},g=new RegExp("^(?:"+Object.keys(f).join("|")+")"),h=/^(?:[+-]?)(?:(?:(?:0|[1-9]\d*)?\.\d+)|(?:(?:0|[1-9]\d*)\.)|(?:0|[1-9]\d*))(?:[eE][+-]?\d+)?/,i=/\$\{([^\}]+)\}/g,j=/^\$\{([^\}]+)\}/,k=/^\s*$/,e=a.extend({init:function(a,b){this.values=b.values,this.allowWhitespace()},postProcess:function(a){return 1===a.length&&k.test(this.leftover)?{value:a[0].v}:null},converters:[function(a){var b;return a.values?(b=a.matchPattern(j),b&&a.values.hasOwnProperty(b)?{v:a.values[b]}:void 0):null},function(a){var b;return(b=a.matchPattern(g))?{v:f[b]}:void 0},function(a){var b;return(b=a.matchPattern(h))?{v:+b}:void 0},function(a){var c,d=b(a);return d&&(c=a.values)?{v:d.v.replace(i,function(a,b){return b in c?c[b]:b})}:d},function(a){var b,c;if(!a.matchString("{"))return null;if(b={},a.allowWhitespace(),a.matchString("}"))return{v:b};for(;c=d(a);){if(b[c.key]=c.value,a.allowWhitespace(),a.matchString("}"))return{v:b};if(!a.matchString(","))return null}return null},function(a){var b,c;if(!a.matchString("["))return null;if(b=[],a.allowWhitespace(),a.matchString("]"))return{v:b};for(;c=a.read();){if(b.push(c.v),a.allowWhitespace(),a.matchString("]"))return{v:b};if(!a.matchString(","))return null;a.allowWhitespace()}return null}]}),function(a,b){var c=new e(a,{values:b});return c.result}}(pb,Z,_),Fb=function(a,b,c,d){var e,f=/^([a-zA-Z_$][a-zA-Z_$0-9]*)\(/;return e=a.extend({converters:[b]}),function(a){var b,g,h,i,j,k,l,m,n;if("string"==typeof a){if(g=f.exec(a))return b={m:g[1]},i="["+a.slice(b.m.length+1,-1)+"]",h=new e(i),b.a=c(h.result[0]),b;if(-1===a.indexOf(":"))return a.trim();a=[a]}if(b={},l=[],m=[],a){for(;a.length;)if(j=a.shift(),"string"==typeof j){if(k=j.indexOf(":"),-1!==k){k&&l.push(j.substr(0,k)),j.length>k+1&&(m[0]=j.substring(k+1));break}l.push(j)}else l.push(j);m=m.concat(a)}return l.length?m.length||"string"!=typeof l?(b={n:1===l.length&&"string"==typeof l[0]?l[0]:l},1===m.length&&"string"==typeof m[0]?(n=d("["+m[0]+"]"),b.a=n?n.value:m[0].trim()):b.d=m):b=l:b="",b}}(pb,nb,ob,Eb),Gb=function(a,b,c,d,e,f,g,h){function i(d){var e,f,i,k,m,u,v,w,x,y,z;if(e=d.pos,d.inside||d.inAttribute)return null;if(!d.matchString("<"))return null;if("/"===d.nextChar())return null;if(f={t:a.ELEMENT},d.includeLinePositions&&(f.p=d.getLinePos(e)),d.matchString("!")&&(f.y=1),f.e=d.matchPattern(n),!f.e)return null;for(o.test(d.nextChar())||d.error("Illegal tag name"),u=function(a,b){var c=b.n||b;r.test(c)&&(d.pos-=c.length,d.error("Cannot use reserved event names (change, reset, teardown, update, construct, config, init, render, unrender, detach, insert)")),f.v[a]=b},d.allowWhitespace();v=c(d)||g(d);)v.name?(k=s[v.name])?f[k]=h(v.value):(m=q.exec(v.name))?(f.v||(f.v={}),w=h(v.value),u(m[1],w)):d.sanitizeEventAttributes&&p.test(v.name)||(f.a||(f.a={}),f.a[v.name]=v.value||0):(f.m||(f.m=[]),f.m.push(v)),d.allowWhitespace();if(d.allowWhitespace(),d.matchString("/")&&(x=!0),!d.matchString(">"))return null;if(i=f.e.toLowerCase(),!x&&!b.test(f.e)){for(("script"===i||"style"===i)&&(d.inside=i),y=[];j(i,d.remaining())&&(z=d.read(l))&&z.t!==a.CLOSING&&z.t!==a.CLOSING_TAG;)y.push(z);y.length&&(f.f=y)}return d.inside=null,d.sanitizeElements&&-1!==d.sanitizeElements.indexOf(i)?t:f}function j(a,b){var c,d;return c=/^<([a-zA-Z][a-zA-Z0-9]*)/.exec(b),d=m[a],c&&d?!~d.indexOf(c[1].toLowerCase()):!0}var k,l,m,n=/^[a-zA-Z]{1,}:?[a-zA-Z0-9\-]*/,o=/^[\s\n\/>]/,p=/^on/,q=/^on-([a-zA-Z\\*\\.$_][a-zA-Z\\*\\.$_0-9\-]+)$/,r=/^(?:change|reset|teardown|update|construct|config|init|render|unrender|detach|insert)$/,s={"intro-outro":"t0",intro:"t1",outro:"t2",decorator:"o"},t={exclude:!0};return l=[c,d,i,e,f],m={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]},k=i}(R,yb,wb,xb,Bb,Cb,Db,Fb),Hb=function(){var a=/^[ \t\f\r\n]+/,b=/[ \t\f\r\n]+$/;return function(c,d,e){var f;d&&(f=c[0],"string"==typeof f&&(f=f.replace(a,""),f?c[0]=f:c.shift())),e&&(f=c[c.length-1],"string"==typeof f&&(f=f.replace(b,""),f?c[c.length-1]=f:c.pop()))}}(),Ib=function(a){function b(a){return"string"==typeof a}function c(b){return b.t===a.COMMENT||b.t===a.DELIMCHANGE}function d(b){return(b.t===a.SECTION||b.t===a.INVERTED)&&b.f}var e,f=/^\s*\r?\n/,g=/\r?\n\s*$/;return e=function(a){var e,h,i,j,k;for(e=1;e0&&this.error("A section was left open"),j(a,b.stripComments!==!1,b.preserveWhitespace,!b.preserveWhitespace,!b.preserveWhitespace,b.rewriteElse!==!1),a},converters:[c,d,e,f]}),n=function(a){var b=arguments[1];void 0===b&&(b={});var c,d,e,f,g,h,j,l;if(k(b),j=new RegExp(""),l=new RegExp(""),c={v:1},j.test(a)){for(d=a,a="";g=j.exec(d);){if(f=g[1],a+=d.substr(0,g.index),d=d.substring(g.index+g[0].length),h=l.exec(d),!h||h[1]!==f)throw new Error('Inline partials must have a closing delimiter, and cannot be nested. Expected closing for "'+f+'", but '+(h?'instead found "'+h[1]+'"':" no closing found"));(e||(e={}))[f]=new m(d.substr(0,h.index),b).result,d=d.substring(h.index+h[0].length)}a+=d,c.p=e}return c.t=new m(a,b).result,c},l=n}(R,pb,wb,xb,Gb,Bb,Hb,Ib,Jb),Lb=function(){return function(a,b){var c=a.map(b);return a.forEach(function(a,b){c[a]=c[b]}),c}}(ub),Mb=function(a){var b,c;return b=["preserveWhitespace","sanitize","stripComments","delimiters","tripleDelimiters","interpolate"],c=a(b,function(a){return a})}(Lb),Nb=function(a,b,c,d,e){function f(a){var b=d(l);return b.parse=function(b,c){return g(b,c||a)},b}function g(b,d){if(!c)throw new Error(a.missingParser);return c(b,d||this.options)}function h(a,c){var d;if(!b){if(c&&c.noThrow)return;throw new Error("Cannot retrieve template #"+a+" as Ractive is not running in a browser.")}if(i(a)&&(a=a.substring(1)),!(d=document.getElementById(a))){if(c&&c.noThrow)return;throw new Error("Could not find template element with id #"+a)}if("SCRIPT"!==d.tagName.toUpperCase()){if(c&&c.noThrow)return;throw new Error("Template element with id #"+a+", must be a