Skip to content

Instantly share code, notes, and snippets.

@matchdav
Last active August 29, 2015 14:06
Show Gist options
  • Save matchdav/8b071067a7e61966bff8 to your computer and use it in GitHub Desktop.
Save matchdav/8b071067a7e61966bff8 to your computer and use it in GitHub Desktop.
requirebin sketch
var Vue = require('vue'),
Mustache = require('mustache'),
_ = require('lodash');
var obj = {
name:'Roger',
species:'rabbit',
mood:'grumpy'
};
var data = {};
data.wrap = function (){
return function (text, render){
return "{{"+render(text)+"}}";
};
};
data.keys = _.keys(obj).map(function (key){return {key:key}});
var tmpl = [
'<div>',
'{{#keys}}',
'<label>{{key}}</label><br/>',
'<input v-model="{{key}}" type="text" />',
'<p>{{#wrap}}{{key}}{{/wrap}}</p>',
'{{/keys}}',
'</div>'
].join('');
/* compile */
var template = Mustache.render(tmpl,data);
/*
<div>
<label>name</label><br/>
<input v-model="name" type="text" />
<p>{{name}}</p>
<label>species</label><br/>
<input v-model="species" type="text" />
<p>{{species}}</p>
<label>mood</label><br/>
<input v-model="mood" type="text" />
<p>{{mood}}</p>
</div>
*/
/* and bind. */
var vm = new Vue({
el:'body',
template:template,
data:obj
});
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);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 utils=require("./utils");function Batcher(){this.reset()}var BatcherProto=Batcher.prototype;BatcherProto.push=function(job){if(!job.id||!this.has[job.id]){this.queue.push(job);this.has[job.id]=job;if(!this.waiting){this.waiting=true;utils.nextTick(utils.bind(this.flush,this))}}else if(job.override){var oldJob=this.has[job.id];oldJob.cancelled=true;this.queue.push(job);this.has[job.id]=job}};BatcherProto.flush=function(){if(this._preFlush)this._preFlush();for(var i=0;i<this.queue.length;i++){var job=this.queue[i];if(!job.cancelled){job.execute()}}this.reset()};BatcherProto.reset=function(){this.has=utils.hash();this.queue=[];this.waiting=false};module.exports=Batcher},{"./utils":25}],2:[function(require,module,exports){var Batcher=require("./batcher"),bindingBatcher=new Batcher,bindingId=1;function Binding(compiler,key,isExp,isFn){this.id=bindingId++;this.value=undefined;this.isExp=!!isExp;this.isFn=isFn;this.root=!this.isExp&&key.indexOf(".")===-1;this.compiler=compiler;this.key=key;this.dirs=[];this.subs=[];this.deps=[];this.unbound=false}var BindingProto=Binding.prototype;BindingProto.update=function(value){if(!this.isComputed||this.isFn){this.value=value}if(this.dirs.length||this.subs.length){var self=this;bindingBatcher.push({id:this.id,execute:function(){if(!self.unbound){self._update()}}})}};BindingProto._update=function(){var i=this.dirs.length,value=this.val();while(i--){this.dirs[i].$update(value)}this.pub()};BindingProto.val=function(){return this.isComputed&&!this.isFn?this.value.$get():this.value};BindingProto.pub=function(){var i=this.subs.length;while(i--){this.subs[i].update()}};BindingProto.unbind=function(){this.unbound=true;var i=this.dirs.length;while(i--){this.dirs[i].$unbind()}i=this.deps.length;var subs;while(i--){subs=this.deps[i].subs;var j=subs.indexOf(this);if(j>-1)subs.splice(j,1)}};module.exports=Binding},{"./batcher":1}],3:[function(require,module,exports){var Emitter=require("./emitter"),Observer=require("./observer"),config=require("./config"),utils=require("./utils"),Binding=require("./binding"),Directive=require("./directive"),TextParser=require("./text-parser"),DepsParser=require("./deps-parser"),ExpParser=require("./exp-parser"),ViewModel,slice=[].slice,extend=utils.extend,hasOwn={}.hasOwnProperty,def=Object.defineProperty,hooks=["created","ready","beforeDestroy","afterDestroy","attached","detached"],priorityDirectives=["if","repeat","view","component"];function Compiler(vm,options){var compiler=this,key,i;compiler.init=true;compiler.destroyed=false;options=compiler.options=options||{};utils.processOptions(options);extend(compiler,options.compilerOptions);compiler.repeat=compiler.repeat||false;compiler.expCache=compiler.expCache||{};var el=compiler.el=compiler.setupElement(options);utils.log("\nnew VM instance: "+el.tagName+"\n");compiler.vm=el.vue_vm=vm;compiler.bindings=utils.hash();compiler.dirs=[];compiler.deferred=[];compiler.computed=[];compiler.children=[];compiler.emitter=new Emitter(vm);vm.$={};vm.$el=el;vm.$options=options;vm.$compiler=compiler;vm.$event=null;var parentVM=options.parent;if(parentVM){compiler.parent=parentVM.$compiler;parentVM.$compiler.children.push(compiler);vm.$parent=parentVM;if(!("lazy"in options)){options.lazy=compiler.parent.options.lazy}}vm.$root=getRoot(compiler).vm;compiler.setupObserver();if(options.methods){for(key in options.methods){compiler.createBinding(key)}}if(options.computed){for(key in options.computed){compiler.createBinding(key)}}var data=compiler.data=options.data||{},defaultData=options.defaultData;if(defaultData){for(key in defaultData){if(!hasOwn.call(data,key)){data[key]=defaultData[key]}}}var params=options.paramAttributes;if(params){i=params.length;while(i--){data[params[i]]=utils.checkNumber(compiler.eval(el.getAttribute(params[i])))}}extend(vm,data);vm.$data=data;compiler.execHook("created");data=compiler.data=vm.$data;var vmProp;for(key in vm){vmProp=vm[key];if(key.charAt(0)!=="$"&&data[key]!==vmProp&&typeof vmProp!=="function"){data[key]=vmProp}}compiler.observeData(data);if(options.template){this.resolveContent()}compiler.compile(el,true);i=compiler.deferred.length;while(i--){compiler.bindDirective(compiler.deferred[i])}compiler.deferred=null;if(this.computed.length){DepsParser.parse(this.computed)}compiler.init=false;compiler.execHook("ready")}var CompilerProto=Compiler.prototype;CompilerProto.setupElement=function(options){var el=typeof options.el==="string"?document.querySelector(options.el):options.el||document.createElement(options.tagName||"div");var template=options.template,child,replacer,i,attr,attrs;if(template){if(el.hasChildNodes()){this.rawContent=document.createElement("div");while(child=el.firstChild){this.rawContent.appendChild(child)}}if(options.replace&&template.firstChild===template.lastChild){replacer=template.firstChild.cloneNode(true);if(el.parentNode){el.parentNode.insertBefore(replacer,el);el.parentNode.removeChild(el)}if(el.hasAttributes()){i=el.attributes.length;while(i--){attr=el.attributes[i];replacer.setAttribute(attr.name,attr.value)}}el=replacer}else{el.appendChild(template.cloneNode(true))}}if(options.id)el.id=options.id;if(options.className)el.className=options.className;attrs=options.attributes;if(attrs){for(attr in attrs){el.setAttribute(attr,attrs[attr])}}return el};CompilerProto.resolveContent=function(){var outlets=slice.call(this.el.getElementsByTagName("content")),raw=this.rawContent,outlet,select,i,j,main;i=outlets.length;if(i){while(i--){outlet=outlets[i];if(raw){select=outlet.getAttribute("select");if(select){outlet.content=slice.call(raw.querySelectorAll(select))}else{main=outlet}}else{outlet.content=slice.call(outlet.childNodes)}}for(i=0,j=outlets.length;i<j;i++){outlet=outlets[i];if(outlet===main)continue;insert(outlet,outlet.content)}if(raw&&main){insert(main,slice.call(raw.childNodes))}}function insert(outlet,contents){var parent=outlet.parentNode,i=0,j=contents.length;for(;i<j;i++){parent.insertBefore(contents[i],outlet)}parent.removeChild(outlet)}this.rawContent=null};CompilerProto.setupObserver=function(){var compiler=this,bindings=compiler.bindings,options=compiler.options,observer=compiler.observer=new Emitter(compiler.vm);observer.proxies={};observer.on("get",onGet).on("set",onSet).on("mutate",onSet);var i=hooks.length,j,hook,fns;while(i--){hook=hooks[i];fns=options[hook];if(Array.isArray(fns)){j=fns.length;while(j--){registerHook(hook,fns[j])}}else if(fns){registerHook(hook,fns)}}observer.on("hook:attached",function(){broadcast(1)}).on("hook:detached",function(){broadcast(0)});function onGet(key){check(key);DepsParser.catcher.emit("get",bindings[key])}function onSet(key,val,mutation){observer.emit("change:"+key,val,mutation);check(key);bindings[key].update(val)}function registerHook(hook,fn){observer.on("hook:"+hook,function(){fn.call(compiler.vm)})}function broadcast(event){var children=compiler.children;if(children){var child,i=children.length;while(i--){child=children[i];if(child.el.parentNode){event="hook:"+(event?"attached":"detached");child.observer.emit(event);child.emitter.emit(event)}}}}function check(key){if(!bindings[key]){compiler.createBinding(key)}}};CompilerProto.observeData=function(data){var compiler=this,observer=compiler.observer;Observer.observe(data,"",observer);var $dataBinding=compiler.bindings["$data"]=new Binding(compiler,"$data");$dataBinding.update(data);def(compiler.vm,"$data",{get:function(){compiler.observer.emit("get","$data");return compiler.data},set:function(newData){var oldData=compiler.data;Observer.unobserve(oldData,"",observer);compiler.data=newData;Observer.copyPaths(newData,oldData);Observer.observe(newData,"",observer);update()}});observer.on("set",onSet).on("mutate",onSet);function onSet(key){if(key!=="$data")update()}function update(){$dataBinding.update(compiler.data);observer.emit("change:$data",compiler.data)}};CompilerProto.compile=function(node,root){var nodeType=node.nodeType;if(nodeType===1&&node.tagName!=="SCRIPT"){this.compileElement(node,root)}else if(nodeType===3&&config.interpolate){this.compileTextNode(node)}};CompilerProto.checkPriorityDir=function(dirname,node,root){var expression,directive,Ctor;if(dirname==="component"&&root!==true&&(Ctor=this.resolveComponent(node,undefined,true))){directive=this.parseDirective(dirname,"",node);directive.Ctor=Ctor}else{expression=utils.attr(node,dirname);directive=expression&&this.parseDirective(dirname,expression,node)}if(directive){if(root===true){utils.warn("Directive v-"+dirname+" cannot be used on an already instantiated "+"VM's root node. Use it from the parent's template instead.");return}this.deferred.push(directive);return true}};CompilerProto.compileElement=function(node,root){if(node.tagName==="TEXTAREA"&&node.value){node.value=this.eval(node.value)}if(node.hasAttributes()||node.tagName.indexOf("-")>-1){if(utils.attr(node,"pre")!==null){return}var i,l,j,k;for(i=0,l=priorityDirectives.length;i<l;i++){if(this.checkPriorityDir(priorityDirectives[i],node,root)){return}}node.vue_trans=utils.attr(node,"transition");node.vue_anim=utils.attr(node,"animation");node.vue_effect=this.eval(utils.attr(node,"effect"));var prefix=config.prefix+"-",params=this.options.paramAttributes,attr,attrname,isDirective,exp,directives,directive,dirname;if(root){var withExp=utils.attr(node,"with");if(withExp){directives=this.parseDirective("with",withExp,node,true);for(j=0,k=directives.length;j<k;j++){this.bindDirective(directives[j],this.parent)}}}var attrs=slice.call(node.attributes);for(i=0,l=attrs.length;i<l;i++){attr=attrs[i];attrname=attr.name;isDirective=false;if(attrname.indexOf(prefix)===0){isDirective=true;dirname=attrname.slice(prefix.length);directives=this.parseDirective(dirname,attr.value,node,true);for(j=0,k=directives.length;j<k;j++){this.bindDirective(directives[j])}}else if(config.interpolate){exp=TextParser.parseAttr(attr.value);if(exp){directive=this.parseDirective("attr",exp,node);directive.arg=attrname;if(params&&params.indexOf(attrname)>-1){this.bindDirective(directive,this.parent)}else{this.bindDirective(directive)}}}if(isDirective&&dirname!=="cloak"){node.removeAttribute(attrname)}}}if(node.hasChildNodes()){slice.call(node.childNodes).forEach(this.compile,this)}};CompilerProto.compileTextNode=function(node){var tokens=TextParser.parse(node.nodeValue);if(!tokens)return;var el,token,directive;for(var i=0,l=tokens.length;i<l;i++){token=tokens[i];directive=null;if(token.key){if(token.key.charAt(0)===">"){el=document.createComment("ref");directive=this.parseDirective("partial",token.key.slice(1),el)}else{if(!token.html){el=document.createTextNode("");directive=this.parseDirective("text",token.key,el)}else{el=document.createComment(config.prefix+"-html");directive=this.parseDirective("html",token.key,el)}}}else{el=document.createTextNode(token)}node.parentNode.insertBefore(el,node);this.bindDirective(directive)}node.parentNode.removeChild(node)};CompilerProto.parseDirective=function(name,value,el,multiple){var compiler=this,definition=compiler.getOption("directives",name);if(definition){var asts=Directive.parse(value);return multiple?asts.map(build):build(asts[0])}function build(ast){return new Directive(name,ast,definition,compiler,el)}};CompilerProto.bindDirective=function(directive,bindingOwner){if(!directive)return;this.dirs.push(directive);if(directive.isEmpty||directive.isLiteral){if(directive.bind)directive.bind();return}var binding,compiler=bindingOwner||this,key=directive.key;if(directive.isExp){binding=compiler.createBinding(key,directive)}else{while(compiler){if(compiler.hasKey(key)){break}else{compiler=compiler.parent}}compiler=compiler||this;binding=compiler.bindings[key]||compiler.createBinding(key)}binding.dirs.push(directive);directive.binding=binding;var value=binding.val();if(directive.bind){directive.bind(value)}directive.$update(value,true)};CompilerProto.createBinding=function(key,directive){utils.log(" created binding: "+key);var compiler=this,methods=compiler.options.methods,isExp=directive&&directive.isExp,isFn=directive&&directive.isFn||methods&&methods[key],bindings=compiler.bindings,computed=compiler.options.computed,binding=new Binding(compiler,key,isExp,isFn);if(isExp){compiler.defineExp(key,binding,directive)}else if(isFn){bindings[key]=binding;compiler.defineVmProp(key,binding,methods[key])}else{bindings[key]=binding;if(binding.root){if(computed&&computed[key]){compiler.defineComputed(key,binding,computed[key])}else if(key.charAt(0)!=="$"){compiler.defineDataProp(key,binding)}else{compiler.defineVmProp(key,binding,compiler.data[key]);delete compiler.data[key]}}else if(computed&&computed[utils.baseKey(key)]){compiler.defineExp(key,binding)}else{Observer.ensurePath(compiler.data,key);var parentKey=key.slice(0,key.lastIndexOf("."));if(!bindings[parentKey]){compiler.createBinding(parentKey)}}}return binding};CompilerProto.defineDataProp=function(key,binding){var compiler=this,data=compiler.data,ob=data.__emitter__;if(!hasOwn.call(data,key)){data[key]=undefined}if(ob&&!hasOwn.call(ob.values,key)){Observer.convertKey(data,key)}binding.value=data[key];def(compiler.vm,key,{get:function(){return compiler.data[key]},set:function(val){compiler.data[key]=val}})};CompilerProto.defineVmProp=function(key,binding,value){var ob=this.observer;binding.value=value;def(this.vm,key,{get:function(){if(Observer.shouldGet)ob.emit("get",key);return binding.value},set:function(val){ob.emit("set",key,val)}})};CompilerProto.defineExp=function(key,binding,directive){var computedKey=directive&&directive.computedKey,exp=computedKey?directive.expression:key,getter=this.expCache[exp];if(!getter){getter=this.expCache[exp]=ExpParser.parse(computedKey||key,this)}if(getter){this.markComputed(binding,getter)}};CompilerProto.defineComputed=function(key,binding,value){this.markComputed(binding,value);def(this.vm,key,{get:binding.value.$get,set:binding.value.$set})};CompilerProto.markComputed=function(binding,value){binding.isComputed=true;if(binding.isFn){binding.value=value}else{if(typeof value==="function"){value={$get:value}}binding.value={$get:utils.bind(value.$get,this.vm),$set:value.$set?utils.bind(value.$set,this.vm):undefined}}this.computed.push(binding)};CompilerProto.getOption=function(type,id,silent){var opts=this.options,parent=this.parent,globalAssets=config.globalAssets,res=opts[type]&&opts[type][id]||(parent?parent.getOption(type,id,silent):globalAssets[type]&&globalAssets[type][id]);if(!res&&!silent&&typeof id==="string"){utils.warn("Unknown "+type.slice(0,-1)+": "+id)}return res};CompilerProto.execHook=function(event){event="hook:"+event;this.observer.emit(event);this.emitter.emit(event)};CompilerProto.hasKey=function(key){var baseKey=utils.baseKey(key);return hasOwn.call(this.data,baseKey)||hasOwn.call(this.vm,baseKey)};CompilerProto.eval=function(exp,data){var parsed=TextParser.parseAttr(exp);return parsed?ExpParser.eval(parsed,this,data):exp};CompilerProto.resolveComponent=function(node,data,test){ViewModel=ViewModel||require("./viewmodel");var exp=utils.attr(node,"component"),tagName=node.tagName,id=this.eval(exp,data),tagId=tagName.indexOf("-")>0&&tagName.toLowerCase(),Ctor=this.getOption("components",id||tagId,true);if(id&&!Ctor){utils.warn("Unknown component: "+id)}return test?exp===""?ViewModel:Ctor:Ctor||ViewModel};CompilerProto.destroy=function(noRemove){if(this.destroyed)return;var compiler=this,i,j,key,dir,dirs,binding,vm=compiler.vm,el=compiler.el,directives=compiler.dirs,computed=compiler.computed,bindings=compiler.bindings,children=compiler.children,parent=compiler.parent;compiler.execHook("beforeDestroy");Observer.unobserve(compiler.data,"",compiler.observer);i=children.length;while(i--){children[i].destroy(true)}i=directives.length;while(i--){dir=directives[i];if(dir.binding&&dir.binding.compiler!==compiler){dirs=dir.binding.dirs;if(dirs){j=dirs.indexOf(dir);if(j>-1)dirs.splice(j,1)}}dir.$unbind()}i=computed.length;while(i--){computed[i].unbind()}for(key in bindings){binding=bindings[key];if(binding){binding.unbind()}}if(parent){j=parent.children.indexOf(compiler);if(j>-1)parent.children.splice(j,1)}if(!noRemove){if(el===document.body){el.innerHTML=""}else{vm.$remove()}}el.vue_vm=null;compiler.destroyed=true;compiler.execHook("afterDestroy");compiler.observer.off();compiler.emitter.off()};function getRoot(compiler){while(compiler.parent){compiler=compiler.parent}return compiler}module.exports=Compiler},{"./binding":2,"./config":4,"./deps-parser":5,"./directive":6,"./emitter":17,"./exp-parser":18,"./observer":21,"./text-parser":23,"./utils":25,"./viewmodel":26}],4:[function(require,module,exports){var TextParser=require("./text-parser");module.exports={prefix:"v",debug:false,silent:false,enterClass:"v-enter",leaveClass:"v-leave",interpolate:true};Object.defineProperty(module.exports,"delimiters",{get:function(){return TextParser.delimiters},set:function(delimiters){TextParser.setDelimiters(delimiters)}})},{"./text-parser":23}],5:[function(require,module,exports){var Emitter=require("./emitter"),utils=require("./utils"),Observer=require("./observer"),catcher=new Emitter;function catchDeps(binding){if(binding.isFn)return;utils.log("\n- "+binding.key);var got=utils.hash();binding.deps=[];catcher.on("get",function(dep){var has=got[dep.key];if(has&&has.compiler===dep.compiler||dep.compiler.repeat&&!isParentOf(dep.compiler,binding.compiler)){return}got[dep.key]=dep;utils.log(" - "+dep.key);binding.deps.push(dep);dep.subs.push(binding)});binding.value.$get();catcher.off("get")}function isParentOf(a,b){while(b){if(a===b){return true}b=b.parent}}module.exports={catcher:catcher,parse:function(bindings){utils.log("\nparsing dependencies...");Observer.shouldGet=true;bindings.forEach(catchDeps);Observer.shouldGet=false;utils.log("\ndone.")}}},{"./emitter":17,"./observer":21,"./utils":25}],6:[function(require,module,exports){var dirId=1,ARG_RE=/^[\w\$-]+$/,FILTER_TOKEN_RE=/[^\s'"]+|'[^']+'|"[^"]+"/g,NESTING_RE=/^\$(parent|root)\./,SINGLE_VAR_RE=/^[\w\.$]+$/,QUOTE_RE=/"/g,TextParser=require("./text-parser");function Directive(name,ast,definition,compiler,el){this.id=dirId++;this.name=name;this.compiler=compiler;this.vm=compiler.vm;this.el=el;this.computeFilters=false;this.key=ast.key;this.arg=ast.arg;this.expression=ast.expression;var isEmpty=this.expression==="";if(typeof definition==="function"){this[isEmpty?"bind":"update"]=definition}else{for(var prop in definition){this[prop]=definition[prop]}}if(isEmpty||this.isEmpty){this.isEmpty=true;return}if(TextParser.Regex.test(this.key)){this.key=compiler.eval(this.key);if(this.isLiteral){this.expression=this.key}}var filters=ast.filters,filter,fn,i,l,computed;if(filters){this.filters=[];for(i=0,l=filters.length;i<l;i++){filter=filters[i];fn=this.compiler.getOption("filters",filter.name);if(fn){filter.apply=fn;this.filters.push(filter);if(fn.computed){computed=true}}}}if(!this.filters||!this.filters.length){this.filters=null}if(computed){this.computedKey=Directive.inlineFilters(this.key,this.filters);this.filters=null}this.isExp=computed||!SINGLE_VAR_RE.test(this.key)||NESTING_RE.test(this.key)}var DirProto=Directive.prototype;DirProto.$update=function(value,init){if(this.$lock)return;if(init||value!==this.value||value&&typeof value==="object"){this.value=value;if(this.update){this.update(this.filters&&!this.computeFilters?this.$applyFilters(value):value,init)}}};DirProto.$applyFilters=function(value){var filtered=value,filter;for(var i=0,l=this.filters.length;i<l;i++){filter=this.filters[i];filtered=filter.apply.apply(this.vm,[filtered].concat(filter.args))}return filtered};DirProto.$unbind=function(){if(!this.el||!this.vm)return;if(this.unbind)this.unbind();this.vm=this.el=this.binding=this.compiler=null};Directive.parse=function(str){var inSingle=false,inDouble=false,curly=0,square=0,paren=0,begin=0,argIndex=0,dirs=[],dir={},lastFilterIndex=0,arg;for(var c,i=0,l=str.length;i<l;i++){c=str.charAt(i);if(inSingle){if(c==="'")inSingle=!inSingle}else if(inDouble){if(c==='"')inDouble=!inDouble}else if(c===","&&!paren&&!curly&&!square){pushDir();dir={};begin=argIndex=lastFilterIndex=i+1}else if(c===":"&&!dir.key&&!dir.arg){arg=str.slice(begin,i).trim();if(ARG_RE.test(arg)){argIndex=i+1;dir.arg=arg}}else if(c==="|"&&str.charAt(i+1)!=="|"&&str.charAt(i-1)!=="|"){if(dir.key===undefined){lastFilterIndex=i+1;dir.key=str.slice(argIndex,i).trim()}else{pushFilter()}}else if(c==='"'){inDouble=true}else if(c==="'"){inSingle=true}else if(c==="("){paren++}else if(c===")"){paren--}else if(c==="["){square++}else if(c==="]"){square--}else if(c==="{"){curly++}else if(c==="}"){curly--}}if(i===0||begin!==i){pushDir()}function pushDir(){dir.expression=str.slice(begin,i).trim();if(dir.key===undefined){dir.key=str.slice(argIndex,i).trim()}else if(lastFilterIndex!==begin){pushFilter()}if(i===0||dir.key){dirs.push(dir)}}function pushFilter(){var exp=str.slice(lastFilterIndex,i).trim(),filter;if(exp){filter={};var tokens=exp.match(FILTER_TOKEN_RE);filter.name=tokens[0];filter.args=tokens.length>1?tokens.slice(1):null}if(filter){(dir.filters=dir.filters||[]).push(filter)}lastFilterIndex=i+1}return dirs};Directive.inlineFilters=function(key,filters){var args,filter;for(var i=0,l=filters.length;i<l;i++){filter=filters[i];args=filter.args?',"'+filter.args.map(escapeQuote).join('","')+'"':"";key='this.$compiler.getOption("filters", "'+filter.name+'").call(this,'+key+args+")"}return key};function escapeQuote(v){return v.indexOf('"')>-1?v.replace(QUOTE_RE,"'"):v}module.exports=Directive},{"./text-parser":23}],7:[function(require,module,exports){var utils=require("../utils"),slice=[].slice;module.exports={bind:function(){if(this.el.nodeType===8){this.nodes=[]}},update:function(value){value=utils.guard(value);if(this.nodes){this.swap(value)}else{this.el.innerHTML=value}},swap:function(value){var parent=this.el.parentNode,nodes=this.nodes,i=nodes.length;while(i--){parent.removeChild(nodes[i])}var frag=utils.toFragment(value);this.nodes=slice.call(frag.childNodes);parent.insertBefore(frag,this.el)}}},{"../utils":25}],8:[function(require,module,exports){var utils=require("../utils");module.exports={bind:function(){this.parent=this.el.parentNode;this.ref=document.createComment("vue-if");this.Ctor=this.compiler.resolveComponent(this.el);this.parent.insertBefore(this.ref,this.el);this.parent.removeChild(this.el);if(utils.attr(this.el,"view")){utils.warn("Conflict: v-if cannot be used together with v-view. "+"Just set v-view's binding value to empty string to empty it.")}if(utils.attr(this.el,"repeat")){utils.warn("Conflict: v-if cannot be used together with v-repeat. "+"Use `v-show` or the `filterBy` filter instead.")}},update:function(value){if(!value){this.unbind()}else if(!this.childVM){this.childVM=new this.Ctor({el:this.el.cloneNode(true),parent:this.vm});if(this.compiler.init){this.parent.insertBefore(this.childVM.$el,this.ref)}else{this.childVM.$before(this.ref)}}},unbind:function(){if(this.childVM){this.childVM.$destroy();this.childVM=null}}}},{"../utils":25}],9:[function(require,module,exports){var utils=require("../utils"),config=require("../config"),transition=require("../transition"),directives=module.exports=utils.hash();directives.component={isLiteral:true,bind:function(){if(!this.el.vue_vm){this.childVM=new this.Ctor({el:this.el,parent:this.vm})}},unbind:function(){if(this.childVM){this.childVM.$destroy()}}};directives.attr={bind:function(){var params=this.vm.$options.paramAttributes;this.isParam=params&&params.indexOf(this.arg)>-1},update:function(value){if(value||value===0){this.el.setAttribute(this.arg,value)}else{this.el.removeAttribute(this.arg)}if(this.isParam){this.vm[this.arg]=utils.checkNumber(value)}}};directives.text={bind:function(){this.attr=this.el.nodeType===3?"nodeValue":"textContent"},update:function(value){this.el[this.attr]=utils.guard(value)}};directives.show=function(value){var el=this.el,target=value?"":"none",change=function(){el.style.display=target};transition(el,value?1:-1,change,this.compiler)};directives["class"]=function(value){if(this.arg){utils[value?"addClass":"removeClass"](this.el,this.arg)}else{if(this.lastVal){utils.removeClass(this.el,this.lastVal)}if(value){utils.addClass(this.el,value);this.lastVal=value}}};directives.cloak={isEmpty:true,bind:function(){var el=this.el;this.compiler.observer.once("hook:ready",function(){el.removeAttribute(config.prefix+"-cloak")})}};directives.ref={isLiteral:true,bind:function(){var id=this.expression;if(id){this.vm.$parent.$[id]=this.vm}},unbind:function(){var id=this.expression;if(id){delete this.vm.$parent.$[id]}}};directives.on=require("./on");directives.repeat=require("./repeat");directives.model=require("./model");directives["if"]=require("./if");directives["with"]=require("./with");directives.html=require("./html");directives.style=require("./style");directives.partial=require("./partial");directives.view=require("./view")},{"../config":4,"../transition":24,"../utils":25,"./html":7,"./if":8,"./model":10,"./on":11,"./partial":12,"./repeat":13,"./style":14,"./view":15,"./with":16}],10:[function(require,module,exports){var utils=require("../utils"),isIE9=navigator.userAgent.indexOf("MSIE 9.0")>0,filter=[].filter;function getMultipleSelectOptions(select){return filter.call(select.options,function(option){return option.selected}).map(function(option){return option.value||option.text})}module.exports={bind:function(){var self=this,el=self.el,type=el.type,tag=el.tagName;self.lock=false;self.ownerVM=self.binding.compiler.vm;self.event=self.compiler.options.lazy||tag==="SELECT"||type==="checkbox"||type==="radio"?"change":"input";self.attr=type==="checkbox"?"checked":tag==="INPUT"||tag==="SELECT"||tag==="TEXTAREA"?"value":"innerHTML";if(tag==="SELECT"&&el.hasAttribute("multiple")){this.multi=true}var compositionLock=false;self.cLock=function(){compositionLock=true};self.cUnlock=function(){compositionLock=false};el.addEventListener("compositionstart",this.cLock);el.addEventListener("compositionend",this.cUnlock);self.set=self.filters?function(){if(compositionLock)return;var cursorPos;try{cursorPos=el.selectionStart}catch(e){}self._set();utils.nextTick(function(){if(cursorPos!==undefined){el.setSelectionRange(cursorPos,cursorPos)}})}:function(){if(compositionLock)return;self.lock=true;self._set();utils.nextTick(function(){self.lock=false})};el.addEventListener(self.event,self.set);if(isIE9){self.onCut=function(){utils.nextTick(function(){self.set()})};self.onDel=function(e){if(e.keyCode===46||e.keyCode===8){self.set()}};el.addEventListener("cut",self.onCut);el.addEventListener("keyup",self.onDel)}},_set:function(){this.ownerVM.$set(this.key,this.multi?getMultipleSelectOptions(this.el):this.el[this.attr])},update:function(value,init){if(init&&value===undefined){return this._set()}if(this.lock)return;var el=this.el;if(el.tagName==="SELECT"){el.selectedIndex=-1;if(this.multi&&Array.isArray(value)){value.forEach(this.updateSelect,this)}else{this.updateSelect(value)}}else if(el.type==="radio"){el.checked=value==el.value}else if(el.type==="checkbox"){el.checked=!!value}else{el[this.attr]=utils.guard(value)}},updateSelect:function(value){var options=this.el.options,i=options.length;while(i--){if(options[i].value==value){options[i].selected=true;break}}},unbind:function(){var el=this.el;el.removeEventListener(this.event,this.set);el.removeEventListener("compositionstart",this.cLock);el.removeEventListener("compositionend",this.cUnlock);if(isIE9){el.removeEventListener("cut",this.onCut);el.removeEventListener("keyup",this.onDel)}}}},{"../utils":25}],11:[function(require,module,exports){var utils=require("../utils");module.exports={isFn:true,bind:function(){this.context=this.binding.isExp?this.vm:this.binding.compiler.vm;if(this.el.tagName==="IFRAME"&&this.arg!=="load"){var self=this;this.iframeBind=function(){self.el.contentWindow.addEventListener(self.arg,self.handler)};this.el.addEventListener("load",this.iframeBind)}},update:function(handler){if(typeof handler!=="function"){utils.warn('Directive "v-on:'+this.expression+'" expects a method.');return}this.reset();var vm=this.vm,context=this.context;this.handler=function(e){e.targetVM=vm;context.$event=e;var res=handler.call(context,e);context.$event=null;return res};if(this.iframeBind){this.iframeBind()}else{this.el.addEventListener(this.arg,this.handler)}},reset:function(){var el=this.iframeBind?this.el.contentWindow:this.el;if(this.handler){el.removeEventListener(this.arg,this.handler)}},unbind:function(){this.reset();this.el.removeEventListener("load",this.iframeBind)}}},{"../utils":25}],12:[function(require,module,exports){var utils=require("../utils");module.exports={isLiteral:true,bind:function(){var id=this.expression;if(!id)return;var el=this.el,compiler=this.compiler,partial=compiler.getOption("partials",id);if(!partial){if(id==="yield"){utils.warn("{{>yield}} syntax has been deprecated. Use <content> tag instead.")}return}partial=partial.cloneNode(true);if(el.nodeType===8){var nodes=[].slice.call(partial.childNodes),parent=el.parentNode;parent.insertBefore(partial,el);parent.removeChild(el);nodes.forEach(compiler.compile,compiler)}else{el.innerHTML="";el.appendChild(partial)}}}},{"../utils":25}],13:[function(require,module,exports){var utils=require("../utils"),config=require("../config");module.exports={bind:function(){this.identifier="$r"+this.id;this.expCache=utils.hash();var el=this.el,ctn=this.container=el.parentNode;this.childId=this.compiler.eval(utils.attr(el,"ref"));this.ref=document.createComment(config.prefix+"-repeat-"+this.key);ctn.insertBefore(this.ref,el);ctn.removeChild(el);this.collection=null;this.vms=null},update:function(collection){if(!Array.isArray(collection)){if(utils.isObject(collection)){collection=utils.objectToArray(collection)}else{utils.warn("v-repeat only accepts Array or Object values.")}}this.oldVMs=this.vms;this.oldCollection=this.collection;collection=this.collection=collection||[];var isObject=collection[0]&&utils.isObject(collection[0]);this.vms=this.oldCollection?this.diff(collection,isObject):this.init(collection,isObject);if(this.childId){this.vm.$[this.childId]=this.vms}},init:function(collection,isObject){var vm,vms=[];for(var i=0,l=collection.length;i<l;i++){vm=this.build(collection[i],i,isObject);vms.push(vm);if(this.compiler.init){this.container.insertBefore(vm.$el,this.ref)}else{vm.$before(this.ref)}}return vms},diff:function(newCollection,isObject){var i,l,item,vm,oldIndex,targetNext,currentNext,nextEl,ctn=this.container,oldVMs=this.oldVMs,vms=[];vms.length=newCollection.length;for(i=0,l=newCollection.length;i<l;i++){item=newCollection[i];if(isObject){item.$index=i;if(item.__emitter__&&item.__emitter__[this.identifier]){item.$reused=true}else{vms[i]=this.build(item,i,isObject)}}else{oldIndex=indexOf(oldVMs,item);if(oldIndex>-1){oldVMs[oldIndex].$reused=true;oldVMs[oldIndex].$data.$index=i}else{vms[i]=this.build(item,i,isObject)}}}for(i=0,l=oldVMs.length;i<l;i++){vm=oldVMs[i];item=this.arg?vm.$data[this.arg]:vm.$data;if(item.$reused){vm.$reused=true;delete item.$reused}if(vm.$reused){vm.$index=item.$index;if(item.$key&&item.$key!==vm.$key){vm.$key=item.$key}vms[vm.$index]=vm}else{if(item.__emitter__){delete item.__emitter__[this.identifier]}vm.$destroy()}}i=vms.length;while(i--){vm=vms[i];item=vm.$data;targetNext=vms[i+1];if(vm.$reused){nextEl=vm.$el.nextSibling;while(!nextEl.vue_vm&&nextEl!==this.ref){nextEl=nextEl.nextSibling}currentNext=nextEl.vue_vm;if(currentNext!==targetNext){if(!targetNext){ctn.insertBefore(vm.$el,this.ref)}else{nextEl=targetNext.$el;while(!nextEl.parentNode){targetNext=vms[nextEl.vue_vm.$index+1];
nextEl=targetNext?targetNext.$el:this.ref}ctn.insertBefore(vm.$el,nextEl)}}delete vm.$reused;delete item.$index;delete item.$key}else{vm.$before(targetNext?targetNext.$el:this.ref)}}return vms},build:function(data,index,isObject){var raw,alias,wrap=!isObject||this.arg;if(wrap){raw=data;alias=this.arg||"$value";data={};data[alias]=raw}data.$index=index;var el=this.el.cloneNode(true),Ctor=this.compiler.resolveComponent(el,data),vm=new Ctor({el:el,data:data,parent:this.vm,compilerOptions:{repeat:true,expCache:this.expCache}});if(isObject){(raw||data).__emitter__[this.identifier]=true}return vm},unbind:function(){if(this.childId){delete this.vm.$[this.childId]}if(this.vms){var i=this.vms.length;while(i--){this.vms[i].$destroy()}}}};function indexOf(vms,obj){for(var vm,i=0,l=vms.length;i<l;i++){vm=vms[i];if(!vm.$reused&&vm.$value===obj){return i}}return-1}},{"../config":4,"../utils":25}],14:[function(require,module,exports){var prefixes=["-webkit-","-moz-","-ms-"];module.exports={bind:function(){var prop=this.arg;if(!prop)return;if(prop.charAt(0)==="$"){prop=prop.slice(1);this.prefixed=true}this.prop=prop},update:function(value){var prop=this.prop,isImportant;if(value!=null)value+="";if(prop){if(value){isImportant=value.slice(-10)==="!important"?"important":"";if(isImportant){value=value.slice(0,-10).trim()}}this.el.style.setProperty(prop,value,isImportant);if(this.prefixed){var i=prefixes.length;while(i--){this.el.style.setProperty(prefixes[i]+prop,value,isImportant)}}}else{this.el.style.cssText=value}}}},{}],15:[function(require,module,exports){module.exports={bind:function(){var el=this.raw=this.el,parent=el.parentNode,ref=this.ref=document.createComment("v-view");parent.insertBefore(ref,el);parent.removeChild(el);var node,frag=this.inner=document.createElement("div");while(node=el.firstChild){frag.appendChild(node)}},update:function(value){this.unbind();var Ctor=this.compiler.getOption("components",value);if(!Ctor)return;this.childVM=new Ctor({el:this.raw.cloneNode(true),parent:this.vm,compilerOptions:{rawContent:this.inner.cloneNode(true)}});this.el=this.childVM.$el;if(this.compiler.init){this.ref.parentNode.insertBefore(this.el,this.ref)}else{this.childVM.$before(this.ref)}},unbind:function(){if(this.childVM){this.childVM.$destroy()}}}},{}],16:[function(require,module,exports){var utils=require("../utils");module.exports={bind:function(){var self=this,childKey=self.arg,parentKey=self.key,compiler=self.compiler,owner=self.binding.compiler;if(compiler===owner){this.alone=true;return}if(childKey){if(!compiler.bindings[childKey]){compiler.createBinding(childKey)}compiler.observer.on("change:"+childKey,function(val){if(compiler.init)return;if(!self.lock){self.lock=true;utils.nextTick(function(){self.lock=false})}owner.vm.$set(parentKey,val)})}},update:function(value){if(!this.alone&&!this.lock){if(this.arg){this.vm.$set(this.arg,value)}else if(this.vm.$data!==value){this.vm.$data=value}}}}},{"../utils":25}],17:[function(require,module,exports){var slice=[].slice;function Emitter(ctx){this._ctx=ctx||this}var EmitterProto=Emitter.prototype;EmitterProto.on=function(event,fn){this._cbs=this._cbs||{};(this._cbs[event]=this._cbs[event]||[]).push(fn);return this};EmitterProto.once=function(event,fn){var self=this;this._cbs=this._cbs||{};function on(){self.off(event,on);fn.apply(this,arguments)}on.fn=fn;this.on(event,on);return this};EmitterProto.off=function(event,fn){this._cbs=this._cbs||{};if(!arguments.length){this._cbs={};return this}var callbacks=this._cbs[event];if(!callbacks)return this;if(arguments.length===1){delete this._cbs[event];return this}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};EmitterProto.emit=function(event,a,b,c){this._cbs=this._cbs||{};var callbacks=this._cbs[event];if(callbacks){callbacks=callbacks.slice(0);for(var i=0,len=callbacks.length;i<len;i++){callbacks[i].call(this._ctx,a,b,c)}}return this};EmitterProto.applyEmit=function(event){this._cbs=this._cbs||{};var callbacks=this._cbs[event],args;if(callbacks){callbacks=callbacks.slice(0);args=slice.call(arguments,1);for(var i=0,len=callbacks.length;i<len;i++){callbacks[i].apply(this._ctx,args)}}return this};module.exports=Emitter},{}],18:[function(require,module,exports){var utils=require("./utils"),STR_SAVE_RE=/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,STR_RESTORE_RE=/"(\d+)"/g,NEWLINE_RE=/\n/g,CTOR_RE=new RegExp("constructor".split("").join("['\"+, ]*")),UNICODE_RE=/\\u\d\d\d\d/;var KEYWORDS="break,case,catch,continue,debugger,default,delete,do,else,false"+",finally,for,function,if,in,instanceof,new,null,return,switch,this"+",throw,true,try,typeof,var,void,while,with,undefined"+",abstract,boolean,byte,char,class,const,double,enum,export,extends"+",final,float,goto,implements,import,int,interface,long,native"+",package,private,protected,public,short,static,super,synchronized"+",throws,transient,volatile"+",arguments,let,yield"+",Math",KEYWORDS_RE=new RegExp(["\\b"+KEYWORDS.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),REMOVE_RE=/\/\*(?:.|\n)*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|'[^']*'|"[^"]*"|[\s\t\n]*\.[\s\t\n]*[$\w\.]+|[\{,]\s*[\w\$_]+\s*:/g,SPLIT_RE=/[^\w$]+/g,NUMBER_RE=/\b\d[^,]*/g,BOUNDARY_RE=/^,+|,+$/g;function getVariables(code){code=code.replace(REMOVE_RE,"").replace(SPLIT_RE,",").replace(KEYWORDS_RE,"").replace(NUMBER_RE,"").replace(BOUNDARY_RE,"");return code?code.split(/,+/):[]}function traceScope(path,compiler,data){var rel="",dist=0,self=compiler;if(data&&utils.get(data,path)!==undefined){return"$temp."}while(compiler){if(compiler.hasKey(path)){break}else{compiler=compiler.parent;dist++}}if(compiler){while(dist--){rel+="$parent."}if(!compiler.bindings[path]&&path.charAt(0)!=="$"){compiler.createBinding(path)}}else{self.createBinding(path)}return rel}function makeGetter(exp,raw){var fn;try{fn=new Function(exp)}catch(e){utils.warn("Error parsing expression: "+raw)}return fn}function escapeDollar(v){return v.charAt(0)==="$"?"\\"+v:v}exports.parse=function(exp,compiler,data){if(UNICODE_RE.test(exp)||CTOR_RE.test(exp)){utils.warn("Unsafe expression: "+exp);return}var vars=getVariables(exp);if(!vars.length){return makeGetter("return "+exp,exp)}vars=utils.unique(vars);var accessors="",has=utils.hash(),strings=[],pathRE=new RegExp("[^$\\w\\.]("+vars.map(escapeDollar).join("|")+")[$\\w\\.]*\\b","g"),body=(" "+exp).replace(STR_SAVE_RE,saveStrings).replace(pathRE,replacePath).replace(STR_RESTORE_RE,restoreStrings);body=accessors+"return "+body;function saveStrings(str){var i=strings.length;strings[i]=str.replace(NEWLINE_RE,"\\n");return'"'+i+'"'}function replacePath(path){var c=path.charAt(0);path=path.slice(1);var val="this."+traceScope(path,compiler,data)+path;if(!has[path]){accessors+=val+";";has[path]=1}return c+val}function restoreStrings(str,i){return strings[i]}return makeGetter(body,exp)};exports.eval=function(exp,compiler,data){var getter=exports.parse(exp,compiler,data),res;if(getter){compiler.vm.$temp=data;res=getter.call(compiler.vm);delete compiler.vm.$temp}return res}},{"./utils":25}],19:[function(require,module,exports){var utils=require("./utils"),get=utils.get,slice=[].slice,QUOTE_RE=/^'.*'$/,filters=module.exports=utils.hash();filters.capitalize=function(value){if(!value&&value!==0)return"";value=value.toString();return value.charAt(0).toUpperCase()+value.slice(1)};filters.uppercase=function(value){return value||value===0?value.toString().toUpperCase():""};filters.lowercase=function(value){return value||value===0?value.toString().toLowerCase():""};filters.currency=function(value,sign){value=parseFloat(value);if(!value&&value!==0)return"";sign=sign||"$";var s=Math.floor(value).toString(),i=s.length%3,h=i>0?s.slice(0,i)+(s.length>3?",":""):"",f="."+value.toFixed(2).slice(-2);return sign+h+s.slice(i).replace(/(\d{3})(?=\d)/g,"$1,")+f};filters.pluralize=function(value){var args=slice.call(arguments,1);return args.length>1?args[value-1]||args[args.length-1]:args[value-1]||args[0]+"s"};var keyCodes={enter:13,tab:9,"delete":46,up:38,left:37,right:39,down:40,esc:27};filters.key=function(handler,key){if(!handler)return;var code=keyCodes[key];if(!code){code=parseInt(key,10)}return function(e){if(e.keyCode===code){return handler.call(this,e)}}};filters.filterBy=function(arr,searchKey,delimiter,dataKey){if(delimiter&&delimiter!=="in"){dataKey=delimiter}var search=stripQuotes(searchKey)||this.$get(searchKey);if(!search)return arr;search=search.toLowerCase();dataKey=dataKey&&(stripQuotes(dataKey)||this.$get(dataKey));if(!Array.isArray(arr)){arr=utils.objectToArray(arr)}return arr.filter(function(item){return dataKey?contains(get(item,dataKey),search):contains(item,search)})};filters.filterBy.computed=true;filters.orderBy=function(arr,sortKey,reverseKey){var key=stripQuotes(sortKey)||this.$get(sortKey);if(!key)return arr;if(!Array.isArray(arr)){arr=utils.objectToArray(arr)}var order=1;if(reverseKey){if(reverseKey==="-1"){order=-1}else if(reverseKey.charAt(0)==="!"){reverseKey=reverseKey.slice(1);order=this.$get(reverseKey)?1:-1}else{order=this.$get(reverseKey)?-1:1}}return arr.slice().sort(function(a,b){a=get(a,key);b=get(b,key);return a===b?0:a>b?order:-order})};filters.orderBy.computed=true;function contains(val,search){if(utils.isObject(val)){for(var key in val){if(contains(val[key],search)){return true}}}else if(val!=null){return val.toString().toLowerCase().indexOf(search)>-1}}function stripQuotes(str){if(QUOTE_RE.test(str)){return str.slice(1,-1)}}},{"./utils":25}],20:[function(require,module,exports){var map={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};map.td=map.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];map.option=map.optgroup=[1,'<select multiple="multiple">',"</select>"];map.thead=map.tbody=map.colgroup=map.caption=map.tfoot=[1,"<table>","</table>"];map.text=map.circle=map.ellipse=map.line=map.path=map.polygon=map.polyline=map.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var TAG_RE=/<([\w:]+)/;module.exports=function(templateString){var frag=document.createDocumentFragment(),m=TAG_RE.exec(templateString);if(!m){frag.appendChild(document.createTextNode(templateString));return frag}var tag=m[1],wrap=map[tag]||map._default,depth=wrap[0],prefix=wrap[1],suffix=wrap[2],node=document.createElement("div");node.innerHTML=prefix+templateString.trim()+suffix;while(depth--)node=node.lastChild;if(node.firstChild===node.lastChild){frag.appendChild(node.firstChild);return frag}var child;while(child=node.firstChild){if(node.nodeType===1){frag.appendChild(child)}}return frag}},{}],21:[function(require,module,exports){var Emitter=require("./emitter"),utils=require("./utils"),def=utils.defProtected,isObject=utils.isObject,isArray=Array.isArray,hasOwn={}.hasOwnProperty,oDef=Object.defineProperty,slice=[].slice,hasProto={}.__proto__;var ArrayProxy=Object.create(Array.prototype);["push","pop","shift","unshift","splice","sort","reverse"].forEach(watchMutation);def(ArrayProxy,"$set",function(index,data){return this.splice(index,1,data)[0]},!hasProto);def(ArrayProxy,"$remove",function(index){if(typeof index!=="number"){index=this.indexOf(index)}if(index>-1){return this.splice(index,1)[0]}},!hasProto);function watchMutation(method){def(ArrayProxy,method,function(){var args=slice.call(arguments),result=Array.prototype[method].apply(this,args),inserted,removed;if(method==="push"||method==="unshift"){inserted=args}else if(method==="pop"||method==="shift"){removed=[result]}else if(method==="splice"){inserted=args.slice(2);removed=result}linkArrayElements(this,inserted);unlinkArrayElements(this,removed);this.__emitter__.emit("mutate","",this,{method:method,args:args,result:result,inserted:inserted,removed:removed});return result},!hasProto)}function linkArrayElements(arr,items){if(items){var i=items.length,item,owners;while(i--){item=items[i];if(isWatchable(item)){if(!item.__emitter__){convert(item);watch(item)}owners=item.__emitter__.owners;if(owners.indexOf(arr)<0){owners.push(arr)}}}}}function unlinkArrayElements(arr,items){if(items){var i=items.length,item;while(i--){item=items[i];if(item&&item.__emitter__){var owners=item.__emitter__.owners;if(owners)owners.splice(owners.indexOf(arr))}}}}var ObjProxy=Object.create(Object.prototype);def(ObjProxy,"$add",function(key,val){if(hasOwn.call(this,key))return;this[key]=val;convertKey(this,key,true)},!hasProto);def(ObjProxy,"$delete",function(key){if(!hasOwn.call(this,key))return;this[key]=undefined;delete this[key];this.__emitter__.emit("delete",key)},!hasProto);function isWatchable(obj){return typeof obj==="object"&&obj&&!obj.$compiler}function convert(obj){if(obj.__emitter__)return true;var emitter=new Emitter;def(obj,"__emitter__",emitter);emitter.on("set",function(key,val,propagate){if(propagate)propagateChange(obj)}).on("mutate",function(){propagateChange(obj)});emitter.values=utils.hash();emitter.owners=[];return false}function propagateChange(obj){var owners=obj.__emitter__.owners,i=owners.length;while(i--){owners[i].__emitter__.emit("set","","",true)}}function watch(obj){if(isArray(obj)){watchArray(obj)}else{watchObject(obj)}}function augment(target,src){if(hasProto){target.__proto__=src}else{for(var key in src){def(target,key,src[key])}}}function watchObject(obj){augment(obj,ObjProxy);for(var key in obj){convertKey(obj,key)}}function watchArray(arr){augment(arr,ArrayProxy);linkArrayElements(arr,arr)}function convertKey(obj,key,propagate){var keyPrefix=key.charAt(0);if(keyPrefix==="$"||keyPrefix==="_"){return}var emitter=obj.__emitter__,values=emitter.values;init(obj[key],propagate);oDef(obj,key,{enumerable:true,configurable:true,get:function(){var value=values[key];if(pub.shouldGet){emitter.emit("get",key)}return value},set:function(newVal){var oldVal=values[key];unobserve(oldVal,key,emitter);copyPaths(newVal,oldVal);init(newVal,true)}});function init(val,propagate){values[key]=val;emitter.emit("set",key,val,propagate);if(isArray(val)){emitter.emit("set",key+".length",val.length,propagate)}observe(val,key,emitter)}}function emitSet(obj){var emitter=obj&&obj.__emitter__;if(!emitter)return;if(isArray(obj)){emitter.emit("set","length",obj.length)}else{var key,val;for(key in obj){val=obj[key];emitter.emit("set",key,val);emitSet(val)}}}function copyPaths(newObj,oldObj){if(!isObject(newObj)||!isObject(oldObj)){return}var path,oldVal,newVal;for(path in oldObj){if(!hasOwn.call(newObj,path)){oldVal=oldObj[path];if(isArray(oldVal)){newObj[path]=[]}else if(isObject(oldVal)){newVal=newObj[path]={};copyPaths(newVal,oldVal)}else{newObj[path]=undefined}}}}function ensurePath(obj,key){var path=key.split("."),sec;for(var i=0,d=path.length-1;i<d;i++){sec=path[i];if(!obj[sec]){obj[sec]={};if(obj.__emitter__)convertKey(obj,sec)}obj=obj[sec]}if(isObject(obj)){sec=path[i];if(!hasOwn.call(obj,sec)){obj[sec]=undefined;if(obj.__emitter__)convertKey(obj,sec)}}}function observe(obj,rawPath,observer){if(!isWatchable(obj))return;var path=rawPath?rawPath+".":"",alreadyConverted=convert(obj),emitter=obj.__emitter__;observer.proxies=observer.proxies||{};var proxies=observer.proxies[path]={get:function(key){observer.emit("get",path+key)},set:function(key,val,propagate){if(key)observer.emit("set",path+key,val);if(rawPath&&propagate){observer.emit("set",rawPath,obj,true)}},mutate:function(key,val,mutation){var fixedPath=key?path+key:rawPath;observer.emit("mutate",fixedPath,val,mutation);var m=mutation.method;if(m!=="sort"&&m!=="reverse"){observer.emit("set",fixedPath+".length",val.length)}}};emitter.on("get",proxies.get).on("set",proxies.set).on("mutate",proxies.mutate);if(alreadyConverted){emitSet(obj)}else{watch(obj)}}function unobserve(obj,path,observer){if(!obj||!obj.__emitter__)return;path=path?path+".":"";var proxies=observer.proxies[path];if(!proxies)return;obj.__emitter__.off("get",proxies.get).off("set",proxies.set).off("mutate",proxies.mutate);observer.proxies[path]=null}var pub=module.exports={shouldGet:false,observe:observe,unobserve:unobserve,ensurePath:ensurePath,copyPaths:copyPaths,watch:watch,convert:convert,convertKey:convertKey}},{"./emitter":17,"./utils":25}],22:[function(require,module,exports){var toFragment=require("./fragment");module.exports=function(template){var templateNode;if(template instanceof window.DocumentFragment){return template}if(typeof template==="string"){if(template.charAt(0)==="#"){templateNode=document.getElementById(template.slice(1));if(!templateNode)return}else{return toFragment(template)}}else if(template.nodeType){templateNode=template}else{return}if(templateNode.tagName==="TEMPLATE"&&templateNode.content){return templateNode.content}if(templateNode.tagName==="SCRIPT"){return toFragment(templateNode.innerHTML)}return toFragment(templateNode.outerHTML)}},{"./fragment":20}],23:[function(require,module,exports){var openChar="{",endChar="}",ESCAPE_RE=/[-.*+?^${}()|[\]\/\\]/g,Directive;exports.Regex=buildInterpolationRegex();function buildInterpolationRegex(){var open=escapeRegex(openChar),end=escapeRegex(endChar);return new RegExp(open+open+open+"?(.+?)"+end+"?"+end+end)}function escapeRegex(str){return str.replace(ESCAPE_RE,"\\$&")}function setDelimiters(delimiters){openChar=delimiters[0];endChar=delimiters[1];exports.delimiters=delimiters;exports.Regex=buildInterpolationRegex()}function parse(text){if(!exports.Regex.test(text))return null;var m,i,token,match,tokens=[];while(m=text.match(exports.Regex)){i=m.index;if(i>0)tokens.push(text.slice(0,i));token={key:m[1].trim()};match=m[0];token.html=match.charAt(2)===openChar&&match.charAt(match.length-3)===endChar;tokens.push(token);text=text.slice(i+m[0].length)}if(text.length)tokens.push(text);return tokens}function parseAttr(attr){Directive=Directive||require("./directive");var tokens=parse(attr);if(!tokens)return null;if(tokens.length===1)return tokens[0].key;var res=[],token;for(var i=0,l=tokens.length;i<l;i++){token=tokens[i];res.push(token.key?inlineFilters(token.key):'"'+token+'"')}return res.join("+")}function inlineFilters(key){if(key.indexOf("|")>-1){var dirs=Directive.parse(key),dir=dirs&&dirs[0];if(dir&&dir.filters){key=Directive.inlineFilters(dir.key,dir.filters)}}return"("+key+")"}exports.parse=parse;exports.parseAttr=parseAttr;exports.setDelimiters=setDelimiters;exports.delimiters=[openChar,endChar]},{"./directive":6}],24:[function(require,module,exports){var endEvents=sniffEndEvents(),config=require("./config"),Batcher=require("./batcher"),batcher=new Batcher,setTO=window.setTimeout,clearTO=window.clearTimeout,codes={CSS_E:1,CSS_L:2,JS_E:3,JS_L:4,CSS_SKIP:-1,JS_SKIP:-2,JS_SKIP_E:-3,JS_SKIP_L:-4,INIT:-5,SKIP:-6};batcher._preFlush=function(){var f=document.body.offsetHeight};var transition=module.exports=function(el,stage,cb,compiler){var changeState=function(){cb();compiler.execHook(stage>0?"attached":"detached")};if(compiler.init){changeState();return codes.INIT}var hasTransition=el.vue_trans==="",hasAnimation=el.vue_anim==="",effectId=el.vue_effect;if(effectId){return applyTransitionFunctions(el,stage,changeState,effectId,compiler)}else if(hasTransition||hasAnimation){return applyTransitionClass(el,stage,changeState,hasAnimation)}else{changeState();return codes.SKIP}};function applyTransitionClass(el,stage,changeState,hasAnimation){if(!endEvents.trans){changeState();return codes.CSS_SKIP}var onEnd,classList=el.classList,existingCallback=el.vue_trans_cb,enterClass=config.enterClass,leaveClass=config.leaveClass,endEvent=hasAnimation?endEvents.anim:endEvents.trans;if(existingCallback){el.removeEventListener(endEvent,existingCallback);classList.remove(enterClass);classList.remove(leaveClass);el.vue_trans_cb=null}if(stage>0){classList.add(enterClass);changeState();if(!hasAnimation){batcher.push({execute:function(){classList.remove(enterClass)}})}else{onEnd=function(e){if(e.target===el){el.removeEventListener(endEvent,onEnd);el.vue_trans_cb=null;classList.remove(enterClass)}};el.addEventListener(endEvent,onEnd);el.vue_trans_cb=onEnd}return codes.CSS_E}else{if(el.offsetWidth||el.offsetHeight){classList.add(leaveClass);onEnd=function(e){if(e.target===el){el.removeEventListener(endEvent,onEnd);el.vue_trans_cb=null;changeState();classList.remove(leaveClass)}};el.addEventListener(endEvent,onEnd);el.vue_trans_cb=onEnd}else{changeState()}return codes.CSS_L}}function applyTransitionFunctions(el,stage,changeState,effectId,compiler){var funcs=compiler.getOption("effects",effectId);if(!funcs){changeState();return codes.JS_SKIP}var enter=funcs.enter,leave=funcs.leave,timeouts=el.vue_timeouts;if(timeouts){var i=timeouts.length;while(i--){clearTO(timeouts[i])}}timeouts=el.vue_timeouts=[];function timeout(cb,delay){var id=setTO(function(){cb();timeouts.splice(timeouts.indexOf(id),1);if(!timeouts.length){el.vue_timeouts=null}},delay);timeouts.push(id)}if(stage>0){if(typeof enter!=="function"){changeState();return codes.JS_SKIP_E}enter(el,changeState,timeout);return codes.JS_E}else{if(typeof leave!=="function"){changeState();return codes.JS_SKIP_L}leave(el,changeState,timeout);return codes.JS_L}}function sniffEndEvents(){var el=document.createElement("vue"),defaultEvent="transitionend",events={webkitTransition:"webkitTransitionEnd",transition:defaultEvent,mozTransition:defaultEvent},ret={};for(var name in events){if(el.style[name]!==undefined){ret.trans=events[name];break}}ret.anim=el.style.animation===""?"animationend":"webkitAnimationEnd";return ret}transition.codes=codes;transition.sniff=sniffEndEvents},{"./batcher":1,"./config":4}],25:[function(require,module,exports){var config=require("./config"),toString={}.toString,win=window,console=win.console,def=Object.defineProperty,OBJECT="object",THIS_RE=/[^\w]this[^\w]/,BRACKET_RE_S=/\['([^']+)'\]/g,BRACKET_RE_D=/\["([^"]+)"\]/g,hasClassList="classList"in document.documentElement,ViewModel;var defer=win.requestAnimationFrame||win.webkitRequestAnimationFrame||win.setTimeout;function normalizeKeypath(key){return key.indexOf("[")<0?key:key.replace(BRACKET_RE_S,".$1").replace(BRACKET_RE_D,".$1")}var utils=module.exports={toFragment:require("./fragment"),parseTemplateOption:require("./template-parser.js"),get:function(obj,key){key=normalizeKeypath(key);if(key.indexOf(".")<0){return obj[key]}var path=key.split("."),d=-1,l=path.length;while(++d<l&&obj!=null){obj=obj[path[d]]}return obj},set:function(obj,key,val){key=normalizeKeypath(key);if(key.indexOf(".")<0){obj[key]=val;return}var path=key.split("."),d=-1,l=path.length-1;while(++d<l){if(obj[path[d]]==null){obj[path[d]]={}}obj=obj[path[d]]}obj[path[d]]=val},baseKey:function(key){return key.indexOf(".")>0?key.split(".")[0]:key},hash:function(){return Object.create(null)},attr:function(el,type){var attr=config.prefix+"-"+type,val=el.getAttribute(attr);if(val!==null){el.removeAttribute(attr)}return val},defProtected:function(obj,key,val,enumerable,writable){def(obj,key,{value:val,enumerable:enumerable,writable:writable,configurable:true})},isObject:function(obj){return typeof obj===OBJECT&&obj&&!Array.isArray(obj)},isTrueObject:function(obj){return toString.call(obj)==="[object Object]"},bind:function(fn,ctx){return function(arg){return fn.call(ctx,arg)}},guard:function(value){return value==null?"":typeof value=="object"?JSON.stringify(value):value},checkNumber:function(value){return isNaN(value)||value===null||typeof value==="boolean"?value:Number(value)},extend:function(obj,ext){for(var key in ext){if(obj[key]!==ext[key]){obj[key]=ext[key]}}return obj},unique:function(arr){var hash=utils.hash(),i=arr.length,key,res=[];while(i--){key=arr[i];if(hash[key])continue;hash[key]=1;res.push(key)}return res},toConstructor:function(obj){ViewModel=ViewModel||require("./viewmodel");return utils.isObject(obj)?ViewModel.extend(obj):typeof obj==="function"?obj:null},checkFilter:function(filter){if(THIS_RE.test(filter.toString())){filter.computed=true}},processOptions:function(options){var components=options.components,partials=options.partials,template=options.template,filters=options.filters,key;if(components){for(key in components){components[key]=utils.toConstructor(components[key])}}if(partials){for(key in partials){partials[key]=utils.parseTemplateOption(partials[key])}}if(filters){for(key in filters){utils.checkFilter(filters[key])}}if(template){options.template=utils.parseTemplateOption(template)}},nextTick:function(cb){defer(cb,0)},addClass:function(el,cls){if(hasClassList){el.classList.add(cls)}else{var cur=" "+el.className+" ";if(cur.indexOf(" "+cls+" ")<0){el.className=(cur+cls).trim()}}},removeClass:function(el,cls){if(hasClassList){el.classList.remove(cls)}else{var cur=" "+el.className+" ",tar=" "+cls+" ";while(cur.indexOf(tar)>=0){cur=cur.replace(tar," ")}el.className=cur.trim()}},objectToArray:function(obj){var res=[],val,data;for(var key in obj){val=obj[key];data=utils.isObject(val)?val:{$value:val};data.$key=key;res.push(data)}return res}};enableDebug();function enableDebug(){utils.log=function(msg){if(config.debug&&console){console.log(msg)}};utils.warn=function(msg){if(!config.silent&&console){console.warn(msg);if(config.debug&&console.trace){console.trace()}}}}},{"./config":4,"./fragment":20,"./template-parser.js":22,"./viewmodel":26}],26:[function(require,module,exports){var Compiler=require("./compiler"),utils=require("./utils"),transition=require("./transition"),Batcher=require("./batcher"),slice=[].slice,def=utils.defProtected,nextTick=utils.nextTick,watcherBatcher=new Batcher,watcherId=1;function ViewModel(options){if(options===false)return;new Compiler(this,options)}var VMProto=ViewModel.prototype;def(VMProto,"$init",function(options){new Compiler(this,options)});def(VMProto,"$get",function(key){var val=utils.get(this,key);return val===undefined&&this.$parent?this.$parent.$get(key):val});def(VMProto,"$set",function(key,value){utils.set(this,key,value)});def(VMProto,"$watch",function(key,callback){var id=watcherId++,self=this;function on(){var args=slice.call(arguments);watcherBatcher.push({id:id,override:true,execute:function(){callback.apply(self,args)}})}callback._fn=on;self.$compiler.observer.on("change:"+key,on)});def(VMProto,"$unwatch",function(key,callback){var args=["change:"+key],ob=this.$compiler.observer;if(callback)args.push(callback._fn);ob.off.apply(ob,args)});def(VMProto,"$destroy",function(noRemove){this.$compiler.destroy(noRemove)});def(VMProto,"$broadcast",function(){var children=this.$compiler.children,i=children.length,child;while(i--){child=children[i];child.emitter.applyEmit.apply(child.emitter,arguments);child.vm.$broadcast.apply(child.vm,arguments)}});def(VMProto,"$dispatch",function(){var compiler=this.$compiler,emitter=compiler.emitter,parent=compiler.parent;emitter.applyEmit.apply(emitter,arguments);if(parent){parent.vm.$dispatch.apply(parent.vm,arguments)}});["emit","on","off","once"].forEach(function(method){var realMethod=method==="emit"?"applyEmit":method;def(VMProto,"$"+method,function(){var emitter=this.$compiler.emitter;emitter[realMethod].apply(emitter,arguments)})});def(VMProto,"$appendTo",function(target,cb){target=query(target);var el=this.$el;transition(el,1,function(){target.appendChild(el);if(cb)nextTick(cb)},this.$compiler)});def(VMProto,"$remove",function(cb){var el=this.$el;transition(el,-1,function(){if(el.parentNode){el.parentNode.removeChild(el)}if(cb)nextTick(cb)},this.$compiler)});def(VMProto,"$before",function(target,cb){target=query(target);var el=this.$el;transition(el,1,function(){target.parentNode.insertBefore(el,target);if(cb)nextTick(cb)},this.$compiler)});def(VMProto,"$after",function(target,cb){target=query(target);var el=this.$el;transition(el,1,function(){if(target.nextSibling){target.parentNode.insertBefore(el,target.nextSibling)}else{target.parentNode.appendChild(el)}if(cb)nextTick(cb)},this.$compiler)});function query(el){return typeof el==="string"?document.querySelector(el):el}module.exports=ViewModel},{"./batcher":1,"./compiler":3,"./transition":24,"./utils":25}],vue:[function(require,module,exports){var config=require("./config"),ViewModel=require("./viewmodel"),utils=require("./utils"),makeHash=utils.hash,assetTypes=["directive","filter","partial","effect","component"],pluginAPI={utils:utils,config:config,transition:require("./transition"),observer:require("./observer")};ViewModel.options=config.globalAssets={directives:require("./directives"),filters:require("./filters"),partials:makeHash(),effects:makeHash(),components:makeHash()};assetTypes.forEach(function(type){ViewModel[type]=function(id,value){var hash=this.options[type+"s"];if(!hash){hash=this.options[type+"s"]=makeHash()}if(!value)return hash[id];if(type==="partial"){value=utils.parseTemplateOption(value)}else if(type==="component"){value=utils.toConstructor(value)}else if(type==="filter"){utils.checkFilter(value)}hash[id]=value;return this}});ViewModel.config=function(opts,val){if(typeof opts==="string"){if(val===undefined){return config[opts]}else{config[opts]=val}}else{utils.extend(config,opts)}return this};ViewModel.use=function(plugin){if(typeof plugin==="string"){try{plugin=require(plugin)}catch(e){utils.warn("Cannot find plugin: "+plugin);return}}var args=[].slice.call(arguments,1);args.unshift(this);if(typeof plugin.install==="function"){plugin.install.apply(plugin,args)}else{plugin.apply(null,args)}return this};ViewModel.require=function(module){return pluginAPI[module]};ViewModel.extend=extend;ViewModel.nextTick=utils.nextTick;function extend(options){var ParentVM=this;if(options.data){options.defaultData=options.data;delete options.data}if(ParentVM!==ViewModel){options=inheritOptions(options,ParentVM.options,true)}utils.processOptions(options);var ExtendedVM=function(opts,asParent){if(!asParent){opts=inheritOptions(opts,options,true)}ParentVM.call(this,opts,true)};var proto=ExtendedVM.prototype=Object.create(ParentVM.prototype);utils.defProtected(proto,"constructor",ExtendedVM);ExtendedVM.extend=extend;ExtendedVM.super=ParentVM;ExtendedVM.options=options;assetTypes.forEach(function(type){ExtendedVM[type]=ViewModel[type]});ExtendedVM.use=ViewModel.use;ExtendedVM.require=ViewModel.require;return ExtendedVM}function inheritOptions(child,parent,topLevel){child=child||{};if(!parent)return child;for(var key in parent){if(key==="el")continue;var val=child[key],parentVal=parent[key];if(topLevel&&typeof val==="function"&&parentVal){child[key]=[val];if(Array.isArray(parentVal)){child[key]=child[key].concat(parentVal)}else{child[key].push(parentVal)}}else if(topLevel&&(utils.isTrueObject(val)||utils.isTrueObject(parentVal))&&!(parentVal instanceof ViewModel)){child[key]=inheritOptions(val,parentVal)}else if(val===undefined){child[key]=parentVal}}return child}module.exports=ViewModel},{"./config":4,"./directives":9,"./filters":19,"./observer":21,"./transition":24,"./utils":25,"./viewmodel":26}]},{},[]);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);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}({mustache:[function(require,module,exports){(function(root,factory){if(typeof exports==="object"&&exports){factory(exports)}else{var mustache={};factory(mustache);if(typeof define==="function"&&define.amd){define(mustache)}else{root.Mustache=mustache}}})(this,function(mustache){var RegExp_test=RegExp.prototype.test;function testRegExp(re,string){return RegExp_test.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var Object_toString=Object.prototype.toString;var isArray=Array.isArray||function(object){return Object_toString.call(object)==="[object Array]"};function isFunction(object){return typeof object==="function"}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")
}var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function escapeHtml(string){return String(string).replace(/[&<>"'\/]/g,function(s){return entityMap[s]})}function escapeTags(tags){if(!isArray(tags)||tags.length!==2){throw new Error("Invalid tags: "+tags)}return[new RegExp(escapeRegExp(tags[0])+"\\s*"),new RegExp("\\s*"+escapeRegExp(tags[1]))]}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){tags=tags||mustache.tags;template=template||"";if(typeof tags==="string"){tags=tags.split(spaceRe)}var tagRes=escapeTags(tags);var scanner=new Scanner(template);var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length){delete tokens[spaces.pop()]}}else{spaces=[]}hasTag=false;nonSpace=false}var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(tagRes[0]);if(value){for(var i=0,len=value.length;i<len;++i){chr=value.charAt(i);if(isWhitespace(chr)){spaces.push(tokens.length)}else{nonSpace=true}tokens.push(["text",chr,start,start+1]);start+=1;if(chr==="\n"){stripSpace()}}}if(!scanner.scan(tagRes[0]))break;hasTag=true;type=scanner.scan(tagRe)||"name";scanner.scan(whiteRe);if(type==="="){value=scanner.scanUntil(equalsRe);scanner.scan(equalsRe);scanner.scanUntil(tagRes[1])}else if(type==="{"){value=scanner.scanUntil(new RegExp("\\s*"+escapeRegExp("}"+tags[1])));scanner.scan(curlyRe);scanner.scanUntil(tagRes[1]);type="&"}else{value=scanner.scanUntil(tagRes[1])}if(!scanner.scan(tagRes[1])){throw new Error("Unclosed tag at "+scanner.pos)}token=[type,value,start,scanner.pos];tokens.push(token);if(type==="#"||type==="^"){sections.push(token)}else if(type==="/"){openSection=sections.pop();if(!openSection){throw new Error('Unopened section "'+value+'" at '+start)}if(openSection[1]!==value){throw new Error('Unclosed section "'+openSection[1]+'" at '+start)}}else if(type==="name"||type==="{"||type==="&"){nonSpace=true}else if(type==="="){tagRes=escapeTags(tags=value.split(spaceRe))}}openSection=sections.pop();if(openSection){throw new Error('Unclosed section "'+openSection[1]+'" at '+scanner.pos)}return nestTokens(squashTokens(tokens))}function squashTokens(tokens){var squashedTokens=[];var token,lastToken;for(var i=0,len=tokens.length;i<len;++i){token=tokens[i];if(token){if(token[0]==="text"&&lastToken&&lastToken[0]==="text"){lastToken[1]+=token[1];lastToken[3]=token[3]}else{squashedTokens.push(token);lastToken=token}}}return squashedTokens}function nestTokens(tokens){var nestedTokens=[];var collector=nestedTokens;var sections=[];var token,section;for(var i=0,len=tokens.length;i<len;++i){token=tokens[i];switch(token[0]){case"#":case"^":collector.push(token);sections.push(token);collector=token[4]=[];break;case"/":section=sections.pop();section[5]=token[2];collector=sections.length>0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function(){return this.tail===""};Scanner.prototype.scan=function(re){var match=this.tail.match(re);if(match&&match.index===0){var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string}return""};Scanner.prototype.scanUntil=function(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view==null?{}:view;this.cache={".":this.view};this.parent=parentContext}Context.prototype.push=function(view){return new Context(view,this)};Context.prototype.lookup=function(name){var value;if(name in this.cache){value=this.cache[name]}else{var context=this;while(context){if(name.indexOf(".")>0){value=context.view;var names=name.split("."),i=0;while(value!=null&&i<names.length){value=value[names[i++]]}}else{value=context.view[name]}if(value!=null)break;context=context.parent}this.cache[name]=value}if(isFunction(value)){value=value.call(this.view)}return value};function Writer(){this.cache={}}Writer.prototype.clearCache=function(){this.cache={}};Writer.prototype.parse=function(template,tags){var cache=this.cache;var tokens=cache[template];if(tokens==null){tokens=cache[template]=parseTemplate(template,tags)}return tokens};Writer.prototype.render=function(template,view,partials){var tokens=this.parse(template);var context=view instanceof Context?view:new Context(view);return this.renderTokens(tokens,context,partials,template)};Writer.prototype.renderTokens=function(tokens,context,partials,originalTemplate){var buffer="";var self=this;function subRender(template){return self.render(template,context,partials)}var token,value;for(var i=0,len=tokens.length;i<len;++i){token=tokens[i];switch(token[0]){case"#":value=context.lookup(token[1]);if(!value)continue;if(isArray(value)){for(var j=0,jlen=value.length;j<jlen;++j){buffer+=this.renderTokens(token[4],context.push(value[j]),partials,originalTemplate)}}else if(typeof value==="object"||typeof value==="string"){buffer+=this.renderTokens(token[4],context.push(value),partials,originalTemplate)}else if(isFunction(value)){if(typeof originalTemplate!=="string"){throw new Error("Cannot use higher-order sections without the original template")}value=value.call(context.view,originalTemplate.slice(token[3],token[5]),subRender);if(value!=null)buffer+=value}else{buffer+=this.renderTokens(token[4],context,partials,originalTemplate)}break;case"^":value=context.lookup(token[1]);if(!value||isArray(value)&&value.length===0){buffer+=this.renderTokens(token[4],context,partials,originalTemplate)}break;case">":if(!partials)continue;value=isFunction(partials)?partials(token[1]):partials[token[1]];if(value!=null)buffer+=this.renderTokens(this.parse(value),context,partials,value);break;case"&":value=context.lookup(token[1]);if(value!=null)buffer+=value;break;case"name":value=context.lookup(token[1]);if(value!=null)buffer+=mustache.escape(value);break;case"text":buffer+=token[1];break}}return buffer};mustache.name="mustache.js";mustache.version="0.8.1";mustache.tags=["{{","}}"];var defaultWriter=new Writer;mustache.clearCache=function(){return defaultWriter.clearCache()};mustache.parse=function(template,tags){return defaultWriter.parse(template,tags)};mustache.render=function(template,view,partials){return defaultWriter.render(template,view,partials)};mustache.to_html=function(template,view,partials,send){var result=mustache.render(template,view,partials);if(isFunction(send)){send(result)}else{return result}};mustache.escape=escapeHtml;mustache.Scanner=Scanner;mustache.Context=Context;mustache.Writer=Writer})},{}]},{},[]);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);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}({lodash:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ᠎              ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index<length){if(array[index]===value){return index}}return-1}function cacheIndexOf(cache,value){var type=typeof value;cache=cache.cache;if(type=="boolean"||value==null){return cache[value]?0:-1}if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value;cache=(cache=cache[type])&&cache[key];return type=="object"?cache&&baseIndexOf(cache,value)>-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++index<length){var value=ac[index],other=bc[index];if(value!==other){if(value>other||typeof value=="undefined"){return 1}if(value<other||typeof other=="undefined"){return-1}}}return a.index-b.index}function createCache(array){var index=-1,length=array.length,first=array[0],mid=array[length/2|0],last=array[length-1];if(first&&typeof first=="object"&&mid&&typeof mid=="object"&&last&&typeof last=="object"){return false}var cache=getObject();cache["false"]=cache["null"]=cache["true"]=cache["undefined"]=false;var result=getObject();result.array=array;result.cache=cache;result.push=cachePush;while(++index<length){result.push(array[index])}return result}function escapeStringChar(match){return"\\"+stringEscapes[match]}function getArray(){return arrayPool.pop()||[]}function getObject(){return objectPool.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function releaseArray(array){array.length=0;if(arrayPool.length<maxPoolSize){arrayPool.push(array)}}function releaseObject(object){var cache=object.cache;if(cache){releaseObject(cache)}object.array=object.cache=object.criteria=object.object=object.number=object.string=object.value=null;if(objectPool.length<maxPoolSize){objectPool.push(object)}}function slice(array,start,end){start||(start=0);if(typeof end=="undefined"){end=array?array.length:0}var index=-1,length=end-start||0,result=Array(length<0?0:length);while(++index<length){result[index]=array[start+index]}return result}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Boolean=context.Boolean,Date=context.Date,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayRef=[];var objectProto=Object.prototype;var oldDash=context._;var toString=objectProto.toString;var reNative=RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,fnToString=Function.prototype.toString,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,hasOwnProperty=objectProto.hasOwnProperty,push=arrayRef.push,setTimeout=context.setTimeout,splice=arrayRef.splice,unshift=arrayRef.unshift;var defineProperty=function(){try{var o={},func=isNative(func=Object.defineProperty)&&func,result=func(o,o,o)&&func}catch(e){}return result}();var nativeCreate=isNative(nativeCreate=Object.create)&&nativeCreate,nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeIsFinite=context.isFinite,nativeIsNaN=context.isNaN,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeParseInt=context.parseInt,nativeRandom=Math.random;var ctorByClass={};ctorByClass[arrayClass]=Array;ctorByClass[boolClass]=Boolean;ctorByClass[dateClass]=Date;ctorByClass[funcClass]=Function;ctorByClass[objectClass]=Object;ctorByClass[numberClass]=Number;ctorByClass[regexpClass]=RegExp;ctorByClass[stringClass]=String;function lodash(value){return value&&typeof value=="object"&&!isArray(value)&&hasOwnProperty.call(value,"__wrapped__")?value:new lodashWrapper(value)}function lodashWrapper(value,chainAll){this.__chain__=!!chainAll;this.__wrapped__=value}lodashWrapper.prototype=lodash.prototype;var support=lodash.support={};support.funcDecomp=!isNative(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";lodash.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length<arity){bitmask|=16&~32;return baseCreateWrapper([func,isCurryBound?bitmask:bitmask&~3,args,null,thisArg,arity])}}args||(args=arguments);if(isBindKey){func=thisBinding[key]}if(this instanceof bound){thisBinding=baseCreate(func.prototype);var result=func.apply(thisBinding,args);return isObject(result)?result:thisBinding}return func.apply(thisBinding,args)}setBindData(bound,bindData);return bound}function baseDifference(array,values){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,isLarge=length>=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index<length){var value=array[index];if(indexOf(values,value)<0){result.push(value)}}if(isLarge){releaseObject(values)}return result}function baseFlatten(array,isShallow,isStrict,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value&&typeof value=="object"&&typeof value.length=="number"&&(isArray(value)||isArguments(value))){if(!isShallow){value=baseFlatten(value,isShallow,isStrict)}var valIndex=-1,valLength=value.length,resIndex=result.length;result.length+=valLength;while(++valIndex<valLength){result[resIndex++]=value[valIndex]}}else if(!isStrict){result.push(value)}}return result}function baseIsEqual(a,b,callback,isWhere,stackA,stackB){if(callback){var result=callback(a,b);if(typeof result!="undefined"){return!!result}}if(a===b){return a!==0||1/a==1/b}var type=typeof a,otherType=typeof b;if(a===a&&!(a&&objectTypes[type])&&!(b&&objectTypes[otherType])){return false}if(a==null||b==null){return a===b}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:return+a==+b;case numberClass:return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case regexpClass:case stringClass:return a==String(b)}var isArr=className==arrayClass;if(!isArr){var aWrapped=hasOwnProperty.call(a,"__wrapped__"),bWrapped=hasOwnProperty.call(b,"__wrapped__");if(aWrapped||bWrapped){return baseIsEqual(aWrapped?a.__wrapped__:a,bWrapped?b.__wrapped__:b,callback,isWhere,stackA,stackB)}if(className!=objectClass){return false}var ctorA=a.constructor,ctorB=b.constructor;if(ctorA!=ctorB&&!(isFunction(ctorA)&&ctorA instanceof ctorA&&isFunction(ctorB)&&ctorB instanceof ctorB)&&("constructor"in a&&"constructor"in b)){return false}}var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==a){return stackB[length]==b}}var size=0;result=true;stackA.push(a);stackB.push(b);if(isArr){length=a.length;size=b.length;result=size==length;if(result||isWhere){while(size--){var index=length,value=b[size];if(isWhere){while(index--){if(result=baseIsEqual(a[index],value,callback,isWhere,stackA,stackB)){break}}}else if(!(result=baseIsEqual(a[size],value,callback,isWhere,stackA,stackB))){break}}}}else{forIn(b,function(value,key,b){if(hasOwnProperty.call(b,key)){size++;return result=hasOwnProperty.call(a,key)&&baseIsEqual(a[key],value,callback,isWhere,stackA,stackB)}});if(result&&!isWhere){forIn(a,function(value,key,a){if(hasOwnProperty.call(a,key)){return result=--size>-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index<length){var value=array[index],computed=callback?callback(value,index,array):value;if(isSorted?!index||seen[seen.length-1]!==computed:indexOf(seen,computed)<0){if(callback||isLarge){seen.push(computed)}result.push(value)}}if(isLarge){releaseArray(seen.array);releaseObject(seen)}else if(callback){releaseArray(seen)}return result}function createAggregator(setter){return function(collection,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];setter(result,value,callback(value,index,collection),collection)}}else{forOwn(collection,function(value,key,collection){setter(result,value,callback(value,key,collection),collection)})}return result}}function createWrapper(func,bitmask,partialArgs,partialRightArgs,thisArg,arity){var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,isPartial=bitmask&16,isPartialRight=bitmask&32;if(!isBindKey&&!isFunction(func)){throw new TypeError}if(isPartial&&!partialArgs.length){bitmask&=~16;isPartial=partialArgs=false}if(isPartialRight&&!partialRightArgs.length){bitmask&=~32;isPartialRight=partialRightArgs=false}var bindData=func&&func.__bindData__;if(bindData&&bindData!==true){bindData=slice(bindData);if(bindData[2]){bindData[2]=slice(bindData[2])}if(bindData[3]){bindData[3]=slice(bindData[3])}if(isBind&&!(bindData[1]&1)){bindData[4]=thisArg}if(!isBind&&bindData[1]&1){bitmask|=8}if(isCurry&&!(bindData[1]&4)){bindData[5]=arity}if(isPartial){push.apply(bindData[2]||(bindData[2]=[]),partialArgs)}if(isPartialRight){unshift.apply(bindData[3]||(bindData[3]=[]),partialRightArgs)}bindData[1]|=bitmask;return createWrapper.apply(null,bindData)}var creater=bitmask==1||bitmask===17?baseBind:baseCreateWrapper;return creater([func,bitmask,partialArgs,partialRightArgs,thisArg,arity])}function escapeHtmlChar(match){return htmlEscapes[match]}function getIndexOf(){var result=(result=lodash.indexOf)===indexOf?baseIndexOf:result;return result}function isNative(value){return typeof value=="function"&&reNative.test(value)}var setBindData=!defineProperty?noop:function(func,value){descriptor.value=value;defineProperty(func,"__bindData__",descriptor)};function shimIsPlainObject(value){var ctor,result;if(!(value&&toString.call(value)==objectClass)||(ctor=value.constructor,isFunction(ctor)&&!(ctor instanceof ctor))){return false}forIn(value,function(value,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function unescapeHtmlChar(match){return htmlUnescapes[match]}function isArguments(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==argsClass||false}var isArray=nativeIsArray||function(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==arrayClass||false};var shimKeys=function(object){var index,iterable=object,result=[];if(!iterable)return result;if(!objectTypes[typeof object])return result;for(index in iterable){if(hasOwnProperty.call(iterable,index)){result.push(index)}}return result};var keys=!nativeKeys?shimKeys:function(object){if(!isObject(object)){return[]}return nativeKeys(object)};var htmlEscapes={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];result[index]=callback?callback(result[index],iterable[index]):iterable[index]}}}return result};function clone(value,isDeep,callback,thisArg){if(typeof isDeep!="boolean"&&isDeep!=null){thisArg=callback;callback=isDeep;isDeep=false}return baseClone(value,isDeep,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function cloneDeep(value,callback,thisArg){return baseClone(value,true,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function create(prototype,properties){var result=baseCreate(prototype);return properties?assign(result,properties):result}var defaults=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(typeof result[index]=="undefined")result[index]=iterable[index]}}}return result};function findKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}function findLastKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwnRight(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}var forIn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);for(index in iterable){if(callback(iterable[index],index,collection)===false)return result}return result};function forInRight(object,callback,thisArg){var pairs=[];forIn(object,function(value,key){pairs.push(key,value)});var length=pairs.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){if(callback(pairs[length--],pairs[length],object)===false){break}}return object}var forOwn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(callback(iterable[index],index,collection)===false)return result}return result};function forOwnRight(object,callback,thisArg){var props=keys(object),length=props.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){var key=props[length];if(callback(object[key],key,object)===false){break}}return object}function functions(object){var result=[];forIn(object,function(value,key){if(isFunction(value)){result.push(key)}});return result.sort()}function has(object,key){return object?hasOwnProperty.call(object,key):false}function invert(object){var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index];result[object[key]]=key}return result}function isBoolean(value){return value===true||value===false||value&&typeof value=="object"&&toString.call(value)==boolClass||false}function isDate(value){return value&&typeof value=="object"&&toString.call(value)==dateClass||false}function isElement(value){return value&&value.nodeType===1||false}function isEmpty(value){var result=true;if(!value){return result}var className=toString.call(value),length=value.length;if(className==arrayClass||className==stringClass||className==argsClass||className==objectClass&&typeof length=="number"&&isFunction(value.splice)){return!length}forOwn(value,function(){return result=false});return result}function isEqual(a,b,callback,thisArg){return baseIsEqual(a,b,typeof callback=="function"&&baseCreateCallback(callback,thisArg,2))}function isFinite(value){return nativeIsFinite(value)&&!nativeIsNaN(parseFloat(value))}function isFunction(value){return typeof value=="function"}function isObject(value){return!!(value&&objectTypes[typeof value])}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||value&&typeof value=="object"&&toString.call(value)==numberClass||false}var isPlainObject=!getPrototypeOf?shimIsPlainObject:function(value){if(!(value&&toString.call(value)==objectClass)){return false}var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return value&&typeof value=="object"&&toString.call(value)==regexpClass||false}function isString(value){return typeof value=="string"||value&&typeof value=="object"&&toString.call(value)==stringClass||false}function isUndefined(value){return typeof value=="undefined"}function mapValues(object,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){result[key]=callback(value,key,object)
});return result}function merge(object){var args=arguments,length=2;if(!isObject(object)){return object}if(typeof args[2]!="number"){length=args.length}if(length>3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index<length){baseMerge(object,sources[index],callback,stackA,stackB)}releaseArray(stackA);releaseArray(stackB);return object}function omit(object,callback,thisArg){var result={};if(typeof callback!="function"){var props=[];forIn(object,function(value,key){props.push(key)});props=baseDifference(props,baseFlatten(arguments,true,false,1));var index=-1,length=props.length;while(++index<length){var key=props[index];result[key]=object[key]}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(!callback(value,key,object)){result[key]=value}})}return result}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,callback,thisArg){var result={};if(typeof callback!="function"){var index=-1,props=baseFlatten(arguments,true,false,1),length=isObject(object)?props.length:0;while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(callback(value,key,object)){result[key]=value}})}return result}function transform(object,callback,accumulator,thisArg){var isArr=isArray(object);if(accumulator==null){if(isArr){accumulator=[]}else{var ctor=object&&object.constructor,proto=ctor&&ctor.prototype;accumulator=baseCreate(proto)}}if(callback){callback=lodash.createCallback(callback,thisArg,4);(isArr?forEach:forOwn)(object,function(value,index,object){return callback(accumulator,value,index,object)})}return accumulator}function values(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}function at(collection){var args=arguments,index=-1,props=baseFlatten(args,true,false,1),length=args[2]&&args[2][args[1]]===collection?1:props.length,result=Array(length);while(++index<length){result[index]=collection[props[index]]}return result}function contains(collection,target,fromIndex){var index=-1,indexOf=getIndexOf(),length=collection?collection.length:0,result=false;fromIndex=(fromIndex<0?nativeMax(0,length+fromIndex):fromIndex)||0;if(isArray(collection)){result=indexOf(collection,target,fromIndex)>-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(!(result=!!callback(collection[index],index,collection))){break}}}else{forOwn(collection,function(value,index,collection){return result=!!callback(value,index,collection)})}return result}function filter(collection,callback,thisArg){var result=[];callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){result.push(value)}}}else{forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result.push(value)}})}return result}function find(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){return value}}}else{var result;forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}}function findLast(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forEachRight(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}function forEach(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(++index<length){if(callback(collection[index],index,collection)===false){break}}}else{forOwn(collection,callback)}return collection}function forEachRight(collection,callback,thisArg){var length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(length--){if(callback(collection[length],length,collection)===false){break}}}else{var props=keys(collection);length=props.length;forOwn(collection,function(value,key,collection){key=props?props[--length]:--length;return callback(collection[key],key,collection)})}return collection}var groupBy=createAggregator(function(result,value,key){(hasOwnProperty.call(result,key)?result[key]:result[key]=[]).push(value)});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){var args=slice(arguments,2),index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){result[++index]=(isFunc?methodName:value[methodName]).apply(value,args)});return result}function map(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=lodash.createCallback(callback,thisArg,3);if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=callback(collection[index],index,collection)}}else{result=[];forOwn(collection,function(value,key,collection){result[++index]=callback(value,key,collection)})}return result}function max(collection,callback,thisArg){var computed=-Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value>result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value<result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current<computed){computed=current;result=value}})}return result}var pluck=map;function reduce(collection,callback,accumulator,thisArg){if(!collection)return accumulator;var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);var index=-1,length=collection.length;if(typeof length=="number"){if(noaccum){accumulator=collection[++index]}while(++index<length){accumulator=callback(accumulator,collection[index],index,collection)}}else{forOwn(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)})}return accumulator}function reduceRight(collection,callback,accumulator,thisArg){var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);forEachRight(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)});return accumulator}function reject(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);return filter(collection,function(value,index,collection){return!callback(value,index,collection)})}function sample(collection,n,guard){if(collection&&typeof collection.length!="number"){collection=values(collection)}if(n==null||guard){return collection?collection[baseRandom(0,collection.length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(nativeMax(0,n),result.length);return result}function shuffle(collection){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){var rand=baseRandom(0,++index);result[index]=result[rand];result[rand]=value});return result}function size(collection){var length=collection?collection.length:0;return typeof length=="number"?length:keys(collection).length}function some(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(result=callback(collection[index],index,collection)){break}}}else{forOwn(collection,function(value,index,collection){return!(result=callback(value,index,collection))})}return!!result}function sortBy(collection,callback,thisArg){var index=-1,isArr=isArray(callback),length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);if(!isArr){callback=lodash.createCallback(callback,thisArg,3)}forEach(collection,function(value,key,collection){var object=result[++index]=getObject();if(isArr){object.criteria=map(callback,function(key){return value[key]})}else{(object.criteria=getArray())[0]=callback(value,key,collection)}object.index=index;object.value=value});length=result.length;result.sort(compareAscending);while(length--){var object=result[length];result[length]=object.value;if(!isArr){releaseArray(object.criteria)}releaseObject(object)}return result}function toArray(collection){if(collection&&typeof collection.length=="number"){return slice(collection)}return values(collection)}var where=filter;function compact(array){var index=-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value){result.push(value)}}return result}function difference(array){return baseDifference(array,baseFlatten(arguments,true,true,1))}function findIndex(array,callback,thisArg){var index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length){if(callback(array[index],index,array)){return index}}return-1}function findLastIndex(array,callback,thisArg){var length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(length--){if(callback(array[length],length,array)){return length}}return-1}function first(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=-1;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[0]:undefined}}return slice(array,0,nativeMin(nativeMax(0,n),length))}function flatten(array,isShallow,callback,thisArg){if(typeof isShallow!="boolean"&&isShallow!=null){thisArg=callback;callback=typeof isShallow!="function"&&thisArg&&thisArg[isShallow]===array?null:isShallow;isShallow=false}if(callback!=null){array=map(array,callback,thisArg)}return baseFlatten(array,isShallow)}function indexOf(array,value,fromIndex){if(typeof fromIndex=="number"){var length=array?array.length:0;fromIndex=fromIndex<0?nativeMax(0,length+fromIndex):fromIndex||0}else if(fromIndex){var index=sortedIndex(array,value);return array[index]===value?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:callback||n}return slice(array,0,nativeMin(nativeMax(0,length-n),length))}function intersection(){var args=[],argsIndex=-1,argsLength=arguments.length,caches=getArray(),indexOf=getIndexOf(),trustIndexOf=indexOf===baseIndexOf,seen=getArray();while(++argsIndex<argsLength){var value=arguments[argsIndex];if(isArray(value)||isArguments(value)){args.push(value);caches.push(trustIndexOf&&value.length>=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index<length){var cache=caches[0];value=array[index];if((cache?cacheIndexOf(cache,value):indexOf(seen,value))<0){argsIndex=argsLength;(cache||seen).push(value);while(--argsIndex){cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}result.push(value)}}while(argsLength--){cache=caches[argsLength];if(cache){releaseObject(cache)}}releaseArray(caches);releaseArray(seen);return result}function last(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[length-1]:undefined}}return slice(array,nativeMax(0,length-n))}function lastIndexOf(array,value,fromIndex){var index=array?array.length:0;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(0,index+fromIndex):nativeMin(fromIndex,index-1))+1}while(index--){if(array[index]===value){return index}}return-1}function pull(array){var args=arguments,argsIndex=0,argsLength=args.length,length=array?array.length:0;while(++argsIndex<argsLength){var index=-1,value=args[argsIndex];while(++index<length){if(array[index]===value){splice.call(array,index--,1);length--}}}return array}function range(start,end,step){start=+start||0;step=typeof step=="number"?step:+step||1;if(end==null){end=start;start=0}var index=-1,length=nativeMax(0,ceil((end-start)/(step||1))),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function remove(array,callback,thisArg){var index=-1,length=array?array.length:0,result=[];callback=lodash.createCallback(callback,thisArg,3);while(++index<length){var value=array[index];if(callback(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array,callback,thisArg){if(typeof callback!="number"&&callback!=null){var n=0,index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:nativeMax(0,callback)}return slice(array,n)}function sortedIndex(array,value,callback,thisArg){var low=0,high=array?array.length:low;callback=callback?lodash.createCallback(callback,thisArg,1):identity;value=callback(value);while(low<high){var mid=low+high>>>1;callback(array[mid])<value?low=mid+1:high=mid}return low}function union(){return baseUniq(baseFlatten(arguments,true,true))}function uniq(array,isSorted,callback,thisArg){if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=callback;callback=typeof isSorted!="function"&&thisArg&&thisArg[isSorted]===array?null:isSorted;isSorted=false}if(callback!=null){callback=lodash.createCallback(callback,thisArg,3)}return baseUniq(array,isSorted,callback)}function without(array){return baseDifference(array,slice(arguments,1))}function xor(){var index=-1,length=arguments.length;while(++index<length){var array=arguments[index];if(isArray(array)||isArguments(array)){var result=result?baseUniq(baseDifference(result,array).concat(baseDifference(array,result))):array}}return result||[]}function zip(){var array=arguments.length>1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index<length){result[index]=pluck(array,index)}return result}function zipObject(keys,values){var index=-1,length=keys?keys.length:0,result={};if(!values&&length&&!isArray(keys[0])){values=[]}while(++index<length){var key=keys[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function after(n,func){if(!isFunction(func)){throw new TypeError}return function(){if(--n<1){return func.apply(this,arguments)}}}function bind(func,thisArg){return arguments.length>2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index<length){var key=funcs[index];object[key]=createWrapper(object[key],1,null,null,object)}return object}function bindKey(object,key){return arguments.length>2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index<n){result[index]=callback(index)}return result}function unescape(string){return string==null?"":String(string).replace(reEscapedHtml,unescapeHtmlChar)}function uniqueId(prefix){var id=++idCounter;return String(prefix==null?"":prefix)+id}function chain(value){value=new lodashWrapper(value);value.__chain__=true;return value}function tap(value,interceptor){interceptor(value);return value}function wrapperChain(){this.__chain__=true;return this}function wrapperToString(){return String(this.__wrapped__)}function wrapperValueOf(){return this.__wrapped__}lodash.after=after;lodash.assign=assign;lodash.at=at;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.chain=chain;lodash.compact=compact;lodash.compose=compose;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.createCallback=createCallback;lodash.curry=curry;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.filter=filter;lodash.flatten=flatten;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.map=map;lodash.mapValues=mapValues;lodash.max=max;lodash.memoize=memoize;lodash.merge=merge;lodash.min=min;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.pick=pick;lodash.pluck=pluck;lodash.property=property;lodash.pull=pull;lodash.range=range;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.sortBy=sortBy;lodash.tap=tap;lodash.throttle=throttle;lodash.times=times;lodash.toArray=toArray;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.values=values;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.xor=xor;lodash.zip=zip;lodash.zipObject=zipObject;lodash.collect=map;lodash.drop=rest;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;lodash.unzip=zip;mixin(lodash);lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.contains=contains;lodash.escape=escape;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.has=has;lodash.identity=identity;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isNaN=isNaN;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isUndefined=isUndefined;lodash.lastIndexOf=lastIndexOf;lodash.mixin=mixin;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.template=template;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.all=every;lodash.any=some;lodash.detect=find;lodash.findWhere=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.include=contains;lodash.inject=reduce;mixin(function(){var source={};forOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){source[methodName]=func}});return source}(),false);lodash.first=first;lodash.last=last;lodash.sample=sample;lodash.take=first;lodash.head=first;forOwn(lodash,function(func,methodName){var callbackable=methodName!=="sample";if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(n,guard){var chainAll=this.__chain__,result=func(this.__wrapped__,n,guard);return!chainAll&&(n==null||guard&&!(callbackable&&typeof n=="function"))?result:new lodashWrapper(result,chainAll)}}});lodash.VERSION="2.4.1";lodash.prototype.chain=wrapperChain;lodash.prototype.toString=wrapperToString;lodash.prototype.value=wrapperValueOf;lodash.prototype.valueOf=wrapperValueOf;forEach(["join","pop","shift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){var chainAll=this.__chain__,result=func.apply(this.__wrapped__,arguments);return chainAll?new lodashWrapper(result,chainAll):result}});forEach(["push","reverse","sort","unshift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){func.apply(this.__wrapped__,arguments);return this}});forEach(["concat","slice","splice"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){return new lodashWrapper(func.apply(this.__wrapped__,arguments),this.__chain__)}});return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}]},{},[]);var Vue=require("vue"),Mustache=require("mustache"),_=require("lodash");var obj={name:"Roger",species:"rabbit",mood:"grumpy"};var data={};data.wrap=function(){return function(text,render){return"{{"+render(text)+"}}"}};data.keys=_.keys(obj).map(function(key){return{key:key}});var tmpl=["<div>","{{#keys}}","<label>{{key}}</label><br/>",'<input v-model="{{key}}" type="text" />',"<p>{{#wrap}}{{key}}{{/wrap}}</p>","{{/keys}}","</div>"].join("");var template=Mustache.render(tmpl,data);var vm=new Vue({el:"body",template:template,data:obj});
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"vue": "0.10.6",
"mustache": "0.8.2",
"lodash": "2.4.1"
}
}
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment