/** * Real v2.1.3 * (c) 2015 switer * Released under the MIT License. */ !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Real=b():a.Real=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(a){a=a||{};var b,c=a.optimise||{},d=c.precompile,e=c.compileCache,f=this,h=s.namespace,j=a.ready,k=a.created,p=a.destroy;e?b=e.hasBinding:(b=r.hasOwn(a,"binding")?a.binding:!0,d&&(d.hasBinding=b));var q;c.noMessage||(q=this._message=new D),this.$id=S++,this.$name=a.name||"",this.$parent=a.parent||null,this.$binding=!!b,this.$shouldUpdate=a.shouldUpdate,this.$directives=[],this.$components=[],this.$watchers=[],this._$beforeDestroy=function(){g(s[U],p,f)};var u=a.el,w=r.hasOwn(a,"replace")?a.replace:!1;if("string"==r.type(u)){var x=u;if(F?u=document.querySelector(x):/^\./.test(x)?(u=o(x.replace(/^\./,"")),u&&(u=u[0])):u=/^#/.test(x)?document.getElementById(x.replace(/^#/,"")):null,!u)return v.error("Can't resolve element by \""+x+'"')}var y,z=t.Element(u);if(z&&a.template)if(r.hasAttribute(u,h+"notemplate")||a.notemplate);else if(w){var A=m(a.template);if(y=n(A),!y.length)throw new Error("Component with 'replace' must has a child element of template.",a.template);var B=y[0],E=u.parentNode;E&&E.replaceChild(B,u),l(u,B),u=B}else t.Fragment(u)?v.warn('Container element should\'nt a fragment node when "template" is given. Template:\n',a.template):u.innerHTML=a.template;else if(!u&&a.template){if(w){var G=m(a.template);u=n(G)[0],u||v.warn("Component's template should has a child element when using 'replace' option.",a.template)}u||(u=document.createElement("div"),u.innerHTML=a.template)}else{if(!z)throw new Error('illegal "el" option.');if(w){y=t.Fragment(u)?n(u):u.children;var H=y&&y.length;if(!H&&v.warn('Component\'s container element should has children when "replace" option given.'),H){var I=u;u=y[0],I.parentNode&&I.parentNode.replaceChild(u,I)}}}var J,K,L=h+"component";if(w&&r.hasAttribute(u,L)&&R(u,L)!==a.name)J=!0;else{var M=R(u,L);M&&M===this.$name?i(u,L):M&&(K=!0);var N="_"+h+"cid",O=R(u,N)||"";O?O+=","+this.$id:O=this.$id}this.$methods={},this.$refs={};var P=T(a.data),Q=K?null:this._$parseProps(u),V=T(a._data);this.$data=r.extend(P,Q,V),c.bindMethods===!1?this.$methods=a.methods:r.objEach(a.methods,function(a,b){f.$methods[a]=f[a]=r.bind(b,f)}),g(s[U],k,f),this.$el=u;try{r.objEach(a.watch||{},function(a,b){f.$watchers.push(new C(f,a,b))})}catch(W){v.error("Watch catch error:",W)}try{var X=this.$compile(u,null,d,e);J&&(this.$el=X)}finally{try{g(s[U],j,f)}finally{q&&q.emit("ready")}}}function e(a){function b(b){var f=T(a.data),g=r.extend({},a,b,{data:b?T(b.data):null});g.methods=r.extend({},c,g.methods),g.data=r.extend({},f,g.data),this.$classid=e,d.call(this,g)}a=a||{};var c=a.methods,e=V++;return b.__id=e,r.inherit(b,d),b}function f(){K=r.extend({},y,z,I),L=r.keys(K),M=r.keys(z),N=M.concat(J),O=[s.namespace+"component"].concat(r.map(N,function(a){return s.namespace+a}))}function g(a,b,c){if(b)if(a)try{b.call(c)}catch(d){v.errorTrace(d)}else b.call(c)}function h(a,b,c){if(!P(a))return{};a=a.replace(s.directiveSep_regexp,",").replace(/,\s*}$/,"}");var d=G(b,a,c);return d[0]?{}:d[1]}function i(a,b){return a&&a.removeAttribute(b)}function j(a,b,c){return a&&a.setAttribute&&a.setAttribute(b,c)}function k(a,b){if(P(a)&&P(b)){var c=s.directiveSep,d=Q(b)+c+Q(a),e={};return r.forEach(d.split(c),function(a){if(a=r.trim(a)){var b,c;c=a.replace(/^[^:]+\:/,function(a){return b=r.trim(a.replace(/:$/,"")),""}),b&&(e[b]=c)}}),A.wrapExpr(r.map(r.keys(e),function(a){return a+":"+e[a]}).join(c))}return a}function l(a,b){var c=r.slice(a.attributes),d=r.map(["data","style","methods","attr","on","props"],function(a){return s.namespace+a});return r.forEach(c,function(a){var c=a.name,e=a.value;if("function"!=r.type(e)&&(!/^on/.test(c)||"null"!==e))try{if("class"==c)return void(b.className=b.className+(b.className?" ":"")+e);r.some(d,function(a){return c===a})&&(e=k(e,R(b,c))),b.setAttribute(c,e)}catch(f){v.warn("set attribute fail:"+f+", name:"+c+", value:"+e)}}),b}function m(a){var b,c=/^\s*<(th|tr|td|thead|tbody)\b/i.exec(a),d=document.createDocumentFragment(),e=document.createElement("div");if(c)switch(c[1].toLowerCase()){case"thead":case"tbody":e.innerHTML=""+a+"
",b=e.childNodes[0].childNodes;break;case"th":case"tr":e.innerHTML=""+a+"
",b=e.childNodes[0].childNodes[0].childNodes;break;case"td":e.innerHTML=""+a+"
",b=e.childNodes[0].childNodes[0].childNodes[0].childNodes}for(b||(e.innerHTML=a,b=e.childNodes);b.length;)d.appendChild(b[0]);return d}function n(a){var b=[];return r.forEach(a.childNodes,function(a){1===a.nodeType&&b.push(a)}),b}function o(a){if(document.getElementsByClassName)return document.getElementsByClassName(a);var b,c,d,e=document,f=[];if(e.querySelectorAll)return e.querySelectorAll("."+a);if(e.evaluate)for(c=".//*[contains(concat(' ', @class, ' '), ' "+a+" ')]",b=e.evaluate(c,e,null,0,null);d=b.iterateNext();)f.push(d);else for(b=e.getElementsByTagName("*"),c=new RegExp("(^|\\s)"+a+"(\\s|$)"),d=0;d0))return v.error('Invalid expression of "{'+e+'}", it should be in this format: '+name+'="{ key: expression }".');j[b-1]+=s.directiveSep+a}}),r.forEach(j,function(c){g=new B(o,a,f,d,"{"+c+"}",b),k.push(g)})}else g=new B(o,a,f,d,e,b),k.push(g)}})}),C||a},d.prototype.$appendTo=function(a,b){if(!a||!a.$el)throw new Error("Unvalid parent viewmodel instance.");this.$parent=a,b=b||function(a,b){b.appendChild(a)},b.call(this,this.$el,a.$el)},d.prototype.$update=function(a,b){var c=this.$components,d=this.$directives,e=this.$watchers;if(a&&a.length){var f="array"==r.type(a)?!0:!1,g=function(c){return function(d){(!f||~a.indexOf(d.$updateId))&&(f||d.$updateId===a)&&("function"==r.type(b)?b.call(d,c,d.$updateId)&&d.$update():d.$update())}};return r.forEach(c,g("component")),r.forEach(d,g("directive"))}r.forEach(e,function(a){a.$update()}),r.forEach(c,function(a){a.$binding&&(a.$componentShouldUpdate?a.$componentShouldUpdate():a.$update())}),r.forEach(d,function(a){a.$update()})},d.prototype.$destroy=function(){this.$destroyed||(this._$beforeDestroy&&this._$beforeDestroy(),r.forEach(this.$watchers,function(a){a.$destroy()}),r.forEach(this.$components,function(a){a.$destroy()}),r.forEach(this.$directives,function(a){a.$destroy()}),this.$el=this.$components=this.$directives=this.$watchers=this.$data=this.$methods=this.$refs=null,this.$set=this.$update=this.$compile=this.$root=this.$appendTo=p,this.$destroyed=!0)},d.prototype.$watch=function(a,b){var c=this,d=new C(this,a,b),e=d.$id;return this.$watchers.push(d),function(){var a=c.$watchers;if(a&&a.length){var b=[];r.forEach(a,function(a){a.$id===e?a.$destroy():b.push(a)}),c.$watchers=b}}};var V=0;D.assign(d,["on","off","emit"]),d.create=function(a){return e(a)},d.component=function(a,b){var c=e(b);return H[a]=c,c},d.directive=function(a,b){b.scoped&&J.push(a),I[a]=b,f()},d.set=function(a,b){return s[a]=b,d},d.$=q,d.util=r,d.consoler=v,d.nextTick=x,a.exports=d},function(a,b,c){"use strict";function d(a){if("string"==j.type(a))return e(j.copyArray(document.querySelectorAll(a)));if("array"==j.type(a))return e(a);if(a instanceof e)return a;if(k.DOM(a))return e(new f(a));throw new Error("Unexpect selector !")}function e(a){if(a instanceof e)return a;var b=new f;return j.forEach(a,function(a){b.push(a)}),b}function f(){var a=this._arr=j.slice(arguments),b=this;this.forEach(function(a,c){b[c]=a}),this.length=a.length}function g(a){return a&&a.parentNode}function h(){return document.createDocumentFragment()}function i(a,b){return a.appendChild(b)}var j=c(2),k=c(4),l=e.prototype;l.push=function(a){this._arr.push(a),this[this._arr.length-1]=a,this.length=this._arr.length},l.forEach=function(a){j.forEach(this._arr,a)},l.find=function(a){var b=[];return this.forEach(function(c){b=b.concat(j.copyArray(c.querySelectorAll(a)))}),e(b)},l.attr=function(a,b){var c=arguments.length,d=this[0];if(c>1)d.setAttribute(a,b);else if(1==c)return(d.getAttribute(a)||"").toString();return this},l.removeAttr=function(a){return this.forEach(function(b){b.removeAttribute(a)}),this},l.addClass=function(a){return this.forEach(function(b){var c=a;if("string"==j.type(a)&&(c=[a]),b.classList&&b.classList.add)j.forEach(c,function(a){b.classList.add(a)});else{var d=b.className.split(/\s+/);j.forEach(c,function(a){~j.indexOf(d,a)||d.push(a)}),b.className=d.join(" ")}}),this},l.removeClass=function(a){return this.forEach(function(b){var c=a;if("string"==j.type(a)&&(c=[a]),b.classList&&b.classList.remove)j.forEach(c,function(a){b.classList.remove(a)});else{var d=b.className.split(" ");j.forEach(c,function(a){var b=j.indexOf(d,a);~b&&d.splice(b,1)}),b.className=d.join(" ")}}),this},l.hasClass=function(a){if(!this[0])return!1;var b=this[0].className.split(" ");return!!~j.indexOf(b,a)},l.each=function(a){return this.forEach(a),this};var m=!document.addEventListener;l.on=function(a,b,c){return this.forEach(function(d){m?d.attachEvent("on"+a,b):d.addEventListener(a,b,c)}),this},l.off=function(a,b,c){return this.forEach(function(d){m?d.detachEvent("on"+a,b):d.removeEventListener(a,b,c)}),this},l.html=function(a){var b=arguments.length;if(b>=1)this.forEach(function(b){b.innerHTML=a});else if(this.length)return this[0].innerHTML;return this},l.parent=function(){return this.length?e([g(this[0])]):null},l.remove=function(){return this.forEach(function(a){var b=g(a);b&&b.removeChild(a)}),this},l.insertBefore=function(a){var b;return this.length?(1==this.length?b=this[0]:(b=h(),this.forEach(function(a){i(b,a)})),g(a).insertBefore(b,a),this):this},l.insertAfter=function(a){var b;return this.length?(1==this.length?b=this[0]:(b=h(),this.forEach(function(a){i(b,a)})),g(a).insertBefore(b,a.nextSibling),this):this},l.get=function(a){return this[a]},l.append=function(a){return this.length&&i(this[0],a),this},l.appendTo=function(a){if(1==this.length)i(a,this[0]);else if(this.length>1){var b=h();this.forEach(function(a){i(b,a)}),i(a,b)}},l.replace=function(a){var b=this[0];return g(b).replaceChild(a,b),this},j.extend(f.prototype,l),d.DOM=e,a.exports=d},function(a,b,c){"use strict";function d(a,b){return a&&a.hasOwnProperty(b)}function e(a){var b=[];for(var c in a)d(a,c)&&b.push(c);return b}function f(a){var b=j[a];if(b)return b;i.innerHTML=a;var c=i.childNodes;return b=c&&c.length?c[0].nodeValue:a,j[a]=b,b}var g=c(3),h={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},i=document.createElement("div"),j={},k=void 0,l=new RegExp(e(h).join("|"),"g"),m=5,n={type:function(a){if(null===a)return"null";if(a===k)return"undefined";var b=/\[object (\w+)\]/.exec(Object.prototype.toString.call(a));return b?b[1].toLowerCase():""},keys:function(a){var b=[];return a?Object.keys?Object.keys(a):(this.objEach(a,function(a){b.push(a)}),b):b},bind:function(a,b){return a.bind?a.bind(b):function(){return a.apply(b,arguments)}},extend:function(a){if(Object.assign)return Object.assign.apply(Object,arguments);if("object"!=this.type(a))return a;for(var b,c,d=1,e=arguments.length;e>d;d++){b=arguments[d];for(c in b)a[c]=b[c]}return a},trim:function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/gm,"")},strip:function(a){return a.replace(/^['"]|['"]$/gm,"")},indexOf:function(a,b){if(a.indexOf)return a.indexOf(b);var c=-1;return n.some(a,function(a,d){return a===b?(c=d,!0):void 0}),c},forEach:function(a,b){if(a.forEach)return a.forEach(b);for(var c=a.length,d=0;c>d;d++)b(a[d],d);return a},some:function(a,b){if(a.some)return a.some(b);for(var c=a.length,d=!1,e=0;c>e;e++)if(b(a[e],e)){d=!0;break}return d},map:function(a,b){if(a.map)return a.map(b);for(var c=a.length,d=[],e=0;c>e;e++)d.push(b(a[e],e));return d},objEach:function(a,b){if(a)for(var c in a)if(d(a,c)&&b(c,a[c])===!1)break},domRange:function(a,b,c){for(var d=[],e=a.childNodes,f=!1,g=0;g=c)return a!==b;var e=this.type(a),f=this.type(b);if("array"==e&&"array"==f)return a.length!==b.length?!0:n.some(a,function(a,e){return d.diff(a,b[e],c-1)});if("object"==e&&"object"==f){var g=n.keys(a),h=n.keys(b);if(g.length!=h.length)return!0;var d=this;return n.some(g,function(e){return!~n.indexOf(h,e)||d.diff(a[e],b[e],c-1)})}return a!==b},cloneAndDiff:function(a,b,c){var d=this,e=this.type(a),f=this.type(b);if("array"==e&&"array"==f)return a.length!==b.length&&(c.diff=!0),n.map(a,function(a,e){return d.cloneAndDiff(a,b[e],c)});if("object"==e&&"object"==f){var g=n.keys(a),h={};return n.forEach(g,function(e){b.hasOwnProperty(e)||(c.diff=!0),h[e]=d.cloneAndDiff(a[e],b[e],c)}),h}return c.diff=!0,a},slice:function(a){if(!a||!a.length)return[];if(a.slice)return a.slice(0);for(var b=a.length,c=[],d=0;b>d;d++)c.push(a[d]);return c},walk:function(a,b){var c=b(a)!==!1,d=this;if(c){var e=n.slice(a.childNodes);n.forEach(e,function(a){d.walk(a,b)})}},isUndef:function(a){return void 0===a},escape:function(a){return"string"!==this.type(a)?a:a.replace(l,function(a){return h[a]})},hasOwn:d,hasAttribute:function(a,b){return a.hasAttribute?a.hasAttribute(b):a.getAttribute?null!==a.getAttribute(b):!1},getAttribute:function(a,b){return a&&a.getAttribute(b)},split:function(a,b){if(g.ie&&g.ie<=8){var c="[￳|￴]";return a=a.replace(b,function(){return c}),a.split(c)}return a.split(b)},inherit:function(a,b){function c(){}return c.prototype=b.prototype,a.prototype=new c,a},entity:function(a){return a&&a.replace?a.replace(/(&[#a-zA-Z0-9]+;)/g,function(a,b){return f(b)}):a},isObj:function(a){return"[object Object]"==Object.prototype.toString.call(a)}};a.exports=n},function(a,b){"use strict";function c(){for(var a,b=3,c=document.createElement("div"),d=c.getElementsByTagName("i");c.innerHTML="",d[0];);return b>4?b:a}var d=c(),e=document.createElement("input");a.exports={ie:d,supportQuerySelector:document.querySelector&&document.querySelectorAll,supportChangeEvent:"onchange"in e,supportKeyupEvent:"onkeyup"in e}},function(a,b){"use strict";a.exports={Element:function(a){return a&&(1==a.nodeType||11==a.nodeType)},Fragment:function(a){return a&&11==a.nodeType},DOM:function(a){return a&&(this.Element(a)||8==a.nodeType)}}},function(a,b){var c={namespace:"r-",directiveSep:";",directiveSep_regexp:/;/g,directiveKey_regexp:/^\s*['"]?[^:]+['"]?\s*:/m,mutable_dirtives:["html","text"]};c["CATCH".toLowerCase()]=!1,a.exports=c},function(a,b,c){"use strict";var d=c(2),e=c(4),f=c(3).supportQuerySelector;a.exports=function(a,b,c){if(!f){var g={};d.walk(a,function(a){if(!e.Element(a))return!1;d.forEach(c,function(b){d.hasAttribute(a,b)&&(g[b]||(g[b]=[]),g[b].push(a))});var f;return d.forEach(b,function(b){d.hasAttribute(a,b)&&(f=!0,g[b]||(g[b]=[]),g[b].push(a))}),f?!1:!0})}return function(b){if(f)return a.querySelectorAll(b.join(","));var c=[],e={};return d.forEach(b,function(a){var b=a.match(/^\[(.+?)\]$/)[1];if(!e[b]){e[b]=!0;var f=g[b]||[];c.length?d.forEach(f,function(a){~d.indexOf(c,a)||c.push(a)}):c=c.concat(f)}}),c}}},function(a,b){"use strict";function c(a,b){if(d){var c=d[a];if(c&&"function"==typeof c.apply)c.apply(d,b);else{var e=[];e.push("["+a.toUpperCase()+"]");for(var f=0;f"+f),x=document.createComment("");v.appendChild(w),v.appendChild(x),s.replaceChild(v,this.$el),this._render=function(){s=w.parentNode;var a=b(),c=n.domRange(s,w,x);t.innerHTML=a,n.forEach(n.slice(t.childNodes),function(a){v.appendChild(a)}),n.forEach(c,function(a){s.removeChild(a)}),s.insertBefore(v,x)}}else this._render=function(){this.$el.innerHTML=b()}},shouldUpdate:function(){return e(this)},update:function(){this._render()},unbind:function(){this._render=d,this._expressions=this._caches=null}},show:{update:function(a){this.$el.style.display=a?"":"none"}},style:{multi:!0,bind:function(a){this.sheet=a},update:function(a){this.$el.style&&(this.$el.style[this.sheet]=a)}},text:{constant:!0,bind:function(a){var b,c,d="replace"==a||"inner"!=a,e="replace"!=a&&"inner"!=a&&!!a,f=this.expr=e?a:this.$el.innerHTML,g=v[f];if(!g){var h=q.exprRegexp,i=q.veil(f),c=this._expressions=n.map(i.match(h)||[],function(a){return q.angleBrackets(q.strip(a))})||[i],b=n.split(i,h);g=v[f]={expressions:c,parts:b}}c=this._expressions=g.expressions,b=g.parts;var j,l=this._caches=new Array(c.length),p=this,r=this.$el;if(this.render=function(){n.forEach(c,function(a,b){var c=p.$exec(a);c[0]||(l[b]=c[1])});var a="";n.forEach(b,function(b,d){a+=k(b),d").replace(/&/g,"&")}}},function(a,b,c){"use strict";function d(){var a=document.body;if(!a)return null;var b=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector,c=a.querySelectorAll,d=document.createElement("div");return!b&&c?b=function(a,b){if(!a||!b)return!1;var c;a.parentNode?c=a.parentNode.querySelectorAll(b):(d.appendChild(a),c=a.parentNode.querySelectorAll(b),d.removeChild(a));for(var e=c.length,f=0;e>f;f++)if(c[f]===a)return!0;return!1}:b||(b=function(a){var b,c=this;if(b=f(a))return c.id===b;if(b=i(a))return-1===c.className.split(/\s+/).indexOf(b)?!1:!0;if(b=h(a))return c.tagName.toLowerCase()===b.toLowerCase();if(b=g(a)){if(b.length>1){var d=c.getAttribute(b[0]);return d+""===b[1]}return c.hasAttribute(b[0])}return!1}),b}function e(a,b,c){return a&&a!==c.parentNode&&a!==document.body.parentNode?(k=k||d(),k?k.call(a,b,c)?a:e(a.parentNode,b,c):null):null}function f(a){var b=a.match(/^\#([\w\-]+)$/);return b?b[1]:!1}function g(a){var b=a.match(/^\[(.+)\]$/);if(!b)return!1;var c=b[1].match(/^[\w\-]+$/);if(c)return[c[0]];var d=b[1].match(/^([\w\-]+)\="([^\"]*)"$/);return d?[d[1],d[2]]:!1}function h(a){var b=a.match(/^[\w\-]+$/);return b?b[0]:!1}function i(a){var b=a.match(/^\.([\w\-]+)$/);return b?b[1]:!1}var j=c(1),k=d();a.exports=function(a,b,c,f){var g=function(b){var d=e(b.target,c,a);d&&(b.$currentTarget=d,f.call(d,b))},h=j(a);return h.on(b,g),k||(k=d()),function(){h.off(b,g)}}},function(a,b,c){"use strict";function d(){}function e(a){a.$el.parentNode&&a.$el.parentNode.removeChild(a.$el),a.$destroy()}function f(a,b){var c=document.createDocumentFragment();h.forEach(a,function(a){c.appendChild(a.vm.$el)}),b.parentNode.insertBefore(c,b)}var g=c(1),h=c(2),i=c(8),j=c(7),k=c(5),l={};a.exports=function(a){var b={},c="FOR".toLowerCase();b[c]={mutable:!0,bind:function(a){var b=this.$el,c=k.namespace+"listid",d=k.namespace+"key";this._listId=b.getAttribute(c),this._key=b.getAttribute(d);var e=this._tagExpr="<"+k.namespace+'for="'+this.$rawExpr+'" '+d+'="'+this._key+'"/>';this._key||j.error('Missing attribute, the directive need specify "'+k.namespace+'key".',e),this._isSelfStrKey="*this"===this._key,this._isIndexKey="*index"===this._key,this.$after=document.createComment("'),this.$el.parentNode?this.$el.parentNode.replaceChild(this.$after,this.$el):j.error("ElementNode of the directive must not the root node. ",e),this.diff(a),this._compileCache=null},diff:function(b){if(this._key)if("array"==h.type(b)){var c=this;this._v=b;var d=c._vms||[],g=c._vmMap||{},k=c.$vm,m=[],n=[],o=[],p=c._vms=new Array(c._v.length),q=c._vmMap={},r=-1,s=0,t=-1,u=!0,v=!0,w=0;h.forEach(c._v,function(b,d){var e,f=h.isObj(b);e=c._isIndexKey?d:!f||c._isSelfStrKey?b+"":i.get(b,c._key);var m=g[e];m&&(m=m.vm);var x={key:e,vm:m};if(q[e])return j.warn('Key for the directive is not unique { "'+e+'" :',b,"}. ",c._tagExpr),p;if(m){var y=m.$data.$index;d=w,m.$data.$index!==d&&(n.push(x),v&&(0>t?(s=d-y,t=d):t+1!=d||s!=d-y?v=!1:t=d)),h.extend(m.$data,k.$data,f?b:null,{$index:d,$value:b,$parent:k.$data}),m.$update(),p[d]=x,w++}else{d=w;var z=c.$el.cloneNode(!0),b=h.extend({},k.$data,f?b:null,{$index:d,$value:b,$parent:k.$data});!c._compileCache&&c._listId&&l[c._listId]&&(c._compileCache=l[c._listId]);var A=!!c._compileCache;A||(c._compileCache={}),m=new a({lite:!0,parent:k,el:z,optimise:{precompile:A?null:c._compileCache,compileCache:A?c._compileCache:null,bindMethods:!1,noMessage:!0},methods:k.$methods,data:b}),c._listId&&!l[c._listId]&&(l[c._listId]=c._compileCache),u&&(0>r?r=d:r+1!=d?u=!1:r=d), x.vm=m,p[d]=x,o.push(x),w++}return q[e]=x,p}),h.forEach(d,function(a){q[a.key]||m.push(a)});var x,y=n.length,z=o.length,A=m.length;if(z)!u||y&&!v||(x=!0,f(o,r+1");g(a).attr("_"+k.namespace+"if",this.$rawExpr),this._mount=function(){c||(c=!0,!a.parentNode&&d.parentNode&&b.replaceChild(a,d))},this._unmount=function(){c&&(c=!1,a.parentNode&&b.replaceChild(d,a))}},unbind:function(){this._mount=this._unmount=d},update:function(a){return a?this._compiled?this._mount():(this._compiled=!0,this.$vm.$compile(this.$el),this._mount(),void 0):this._unmount()}},b}},function(a,b,c){"use strict";function d(){}function e(a,b,c,d,e,g){function j(){if(q.$destroyed)return h.warn('Directive "'+d+'" already destroyed.');var a=!1;if(!s||C)A&&A.call(q)&&z&&z.call(q);else{var b=q.$exec(e,D||!G),c=b[1],f={};if(!b[0]&&(G?a=G.call(q,c,x):(c=i.cloneAndDiff(c,x,f),a=!!f.diff),a&&(!A||A.call(q,c,x)))){var g=x;x=c,z&&z.call(q,c,g)}}B&&B.call(q,a)}function p(){H&&H(),y&&y.apply(q,r),!F&&z&&z.call(q,x)}var q=this,r=[],s=!!k(e),t=e;if(s&&(e=l(e)),c.multi){var u,v=o[e];if(v)u=v.key,e=v.expr;else{var w;e=e.replace(/^\s*['"](.+?)['"]\s*:/m,function(a,b){return w=!0,u=b,""}),w||(e=e.replace(/^([^:]+):/m,function(a,b){return u=i.trim(b),""})),e=i.trim(e),o[e]={key:u,expr:e}}r.push(u)}q.$el=b,q.$vm=a,q.$id=++m,q.$expr=e,q.$rawExpr=t,q.$name=d,q.$destroyed=!1,q.$scoped=!!c.scoped,q.$scope=g,q.$updateId=i.getAttribute(b,f.namespace+"updateid")||"",this._$unbind=c.unbind;var x,y=c.bind,z=c.update,A=c.shouldUpdate,B=c.afterUpdate,C=c.constant,D=!!c.mutable,E=c.needReady;i.objEach(c,function(a,b){q[a]=b}),this.$diff=n;var F,G=c.diff;s&&!C?(x=q.$exec(e,D),F=x[0],x=x[1]):x=t,r.push(x),r.push(e),q.$update=j;var H;E?H=a.$on("ready",p):p()}var f=c(5),g=c(11),h=c(7),i=c(2),j=c(15),k=g.isExpr,l=g.strip,m=0,n=function(){return i.diff.apply(i,arguments)},o={};e.prototype.$exec=function(a){return j(this.$vm,a,this.$name)},e.prototype.$destroy=function(){this.$destroyed||(this._$unbind&&this._$unbind.call(this),this.$update=this.$destroy=this.$exec=d,this.$el=null,this.$destroyed=!0)},a.exports=e},function(a,b,c){function d(a){var b=e.slice(arguments),d=b[1],h=g[d];try{return h||(h=g[d]=f(d)),[null,e.immutable(h(e.extend({},a.$methods,a.$data)))]}catch(i){b[1]=". "+b[2]+"="+(/^\{/.test(b[1])?b[1]:"{"+b[1]+"}");var j=c(7);switch(i.name){case"ReferenceError":j.warn(i.message+b[1],"@VM: ",a);break;default:j.error(b[2]?"'"+b[2]+"': ":"",i.message+b[1],b[3]||"","@VM: ",a)}return[i]}}var e=c(2),f=c(16),g={};a.exports=d},function(a,b){a.exports=function(a){return/^[_$][\w$]*$/.test(a)?function(b){return b[a]}:new Function("$scope","with($scope){return ("+a+")}")}},function(a,b,c){function d(){}function e(a,b,c){var d=this;d.$id=++h,d.$vm=a,d.$expr=b,d.$destroyed=!1;var e=d.$exec(b)[1];d.$update=function(){var a=d.$exec(b);if(!a[0]&&f.diff(e,a[1])){var g=e;e=a[1],c.call(d,e,g)}},c.call(d,e)}var f=c(2),g=c(15),h=0;e.prototype.$exec=function(a){return g(this.$vm,a)},e.prototype.$destroy=function(){this.$destroyed||(this.$update=this.$destroy=this.$exec=d,this.$expr="",this.$destroyed=!0)},a.exports=e},function(a,b,c){"use strict";function d(){this._evtObjs={},this._outdatedMsgs={}}function e(){}var f=c(2);d.prototype.on=function(a,b,c){this._evtObjs[a]||(this._evtObjs[a]=[]),this._evtObjs[a].push({handler:b,once:c});var d=this;return function(){d.off(a,b)}},d.prototype.wait=function(a,b){return this._outdatedMsgs[a]?(b.apply(null,this._outdatedMsgs[a]),e):this.on(a,b,!0)},d.prototype.off=function(a,b){var c,d=this;return c=a?[a]:f.keys(this._evtObjs),f.forEach(c,function(a){if(b){var c=d._evtObjs[a]||[],e=[];f.forEach(c,function(a){a.handler!==b&&e.push(a)}),d._evtObjs[a]=e}else d._evtObjs[a]=[]}),this},d.prototype.emit=function(a){var b=Array.prototype.slice.call(arguments,1);this._outdatedMsgs[a]=b;var c=this._evtObjs[a]||[];f.forEach(c,function(a){a.once&&a.called||(a.called=!0,a.handler&&a.handler.apply(null,b))})},d.prototype.emitAsync=function(){var a=arguments,b=this;setTimeout(function(){b.emit.apply(b,a)},0)},d.prototype.assign=function(a,b){var c=this;f.forEach(b||["on","off","wait","emit","emitAsync","assign"],function(b){var d=c[b];a[b]=function(){return d.apply(c,arguments)}})},(new d).assign(d),a.exports=d}])});