!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(){e.console&&avalon.config.debug&&Function.apply.call(console.log,console,arguments)}function r(){}function i(e,t){"string"==typeof e&&(e=e.match(_t)||[]);for(var n={},r=void 0!==t?t:1,a=0,i=e.length;i>a;a++)n[e[a]]=r;return n}function o(){if(e.VBArray){var t=document.documentMode;return t?t:e.XMLHttpRequest?7:6}return 0}function l(e){return Lt.test(Pt.call(e))}function s(e,t){return e=Math.floor(e)||0,0>e?Math.max(t+e,0):Math.min(e,t)}function c(e){if(!e)return!1;var t=e.length;if(t===t>>>0){var n=Pt.call(e).slice(8,-1);if(/(?:regexp|string|function|window|global)$/i.test(n))return!1;if("Array"===n)return!0;try{return{}.propertyIsEnumerable.call(e,"length")===!1?/^\s?function/.test(e.item||e.callee):!0}catch(r){return!e.window}}return!1}function u(e,t,n){var r="for(var "+e+"i=0,n = this.length; i < n; i++){"+t.replace("_","((i in this) && fn.call(scope,this[i],i,this))")+"}"+n;return Function("fn,scope",r)}function f(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}}function p(){return(new XMLSerializer).serializeToString(this)}function d(e,t){if(e&&e.childNodes)for(var n,r=e.childNodes,a=0;n=r[a++];)if(n.tagName){var i=$t.createElementNS(an,n.tagName.toLowerCase());Dt.forEach.call(n.attributes,function(e){i.setAttribute(e.name,e.value)}),d(n,i),t.appendChild(i)}}function v(e){var t={};for(var n in e)t[n]=e[n];var r=t.target=e.srcElement;if(0===e.type.indexOf("key"))t.which=null!=e.charCode?e.charCode:e.keyCode;else if(ln.test(e.type)){var a=r.ownerDocument||$t,i="BackCompat"===a.compatMode?a.body:a.documentElement;t.pageX=e.clientX+(i.scrollLeft>>0)-(i.clientLeft>>0),t.pageY=e.clientY+(i.scrollTop>>0)-(i.clientTop>>0),t.wheelDeltaY=t.wheelDelta,t.wheelDeltaX=0}return t.timeStamp=new Date-0,t.originalEvent=e,t.preventDefault=function(){e.returnValue=!1},t.stopPropagation=function(){e.cancelBubble=!0},t}function h(e){for(var t in e)if(Ht.call(e,t)){var n=e[t];"function"==typeof h.plugins[t]?h.plugins[t](n):"object"==typeof h[t]?avalon.mix(h[t],n):h[t]=n}return this}function m(e){return(e+"").replace(mn,"\\$&")}function g(e,t,n){if(Xt(t)||t&&t.nodeType)return!1;if(-1!==n.indexOf(e))return!1;if(-1!==wn.indexOf(e))return!1;var r=n.$special;return e&&"$"===e.charAt(0)&&!r[e]?!1:!0}function y(e,t,n,r){switch(e.type){case 0:var a=e.get,i=e.set;if(Xt(i)){var o=r.$events,l=o[t];o[t]=[],i.call(r,n),o[t]=l}return a.call(r);case 1:return n;case 2:if(n!==r.$model[t]){var s=e.svmodel=$(r,t,n,e.valueType);n=s.$model;var c=Cn[s.$id];c&&c()}return n}}function b(e,t,n){if(Array.isArray(e)){var a=e.concat();e.length=0;var i=C(e);return i.pushArray(a),i}if(!e||e.nodeType>0||e.$id&&e.$events)return e;Array.isArray(e.$skipArray)||(e.$skipArray=[]),e.$skipArray.$special=t||{};var o={};n=n||{};var l={},s={},c=[];for(var u in e)!function(t,a){if(n[t]=a,g(t,a,e.$skipArray)){l[t]=[];var i=avalon.type(a),u=function(e){var t=u._name,n=this,r=n.$model,a=r[t],i=n.$events;return arguments.length?void(Ot||(1===u.type||(e=y(u,t,e,n),u.type))&&(Mn(a,e)||(r[t]=e,S(i[t]),x(n,t,e,a)))):0===u.type?(e=u.get.call(n),a!==e&&(r[t]=e,x(n,t,e,a)),e):(k(i[t]),u.svmodel||a)};"object"===i&&Xt(a.get)&&Object.keys(a).length<=2?(u.set=a.set,u.get=a.get,u.type=0,c.push(function(){var e={evaluator:function(){e.type=Math.random(),e.element=null,n[t]=u.get.call(o)},element:wt,type:Math.random(),handler:r,args:[]};Bt[xt]=e,u.call(o),delete Bt[xt]})):Nt.test(i)?(u.type=2,u.valueType=i,c.push(function(){var e=b(a,0,n[t]);u.svmodel=e,e.$events[At]=l[t]})):u.type=1,u._name=t,s[t]=u}}(u,e[u]);wn.forEach(function(t){delete e[t],delete n[t]}),o=An(o,On(s),e);for(var f in e)s[f]||(o[f]=e[f]);o.$id=qt(),o.$model=n,o.$events=l;for(u in xn){var p=xn[u];It||(p=p.bind(o)),o[u]=p}return En?Object.defineProperty(o,"hasOwnProperty",{value:function(e){return e in this.$model},writable:!1,enumerable:!1,configurable:!0}):o.hasOwnProperty=function(e){return e in o.$model},c.forEach(function(e){e()}),o}function x(e,t,n,r){e.$events&&xn.$fire.call(e,t,n,r)}function $(e,t,n,r){var a=e[t];if("array"===r)return Array.isArray(n)&&a!==n?(a._.$unwatch(),a.clear(),a._.$watch(),a.pushArray(n.concat()),a):a;var i=e.$events[t],o=a.$events.$withProxyPool;o&&(mt(o,"with"),a.$events.$withProxyPool=null);var l=b(n);return l.$events[At]=i,Cn[l.$id]=function(e){for(;e=i.shift();)!function(e){avalon.nextTick(function(){var t=e.type;t&&Jt[t]&&(e.rollback&&e.rollback(),Jt[t](e,e.vmodels))})}(e);delete Cn[l.$id]},l}function w(e,t,n,r){var a=t[n];return 4!==arguments.length?a.call(e):void a.call(e,r)}function C(e){var t=[];t.$id=qt(),t.$model=e,t.$events={},t.$events[At]=[],t._=b({length:e.length}),t._.$watch("length",function(e,n){t.$fire("length",e,n)});for(var n in xn)t[n]=xn[n];return avalon.mix(t,Nn),t}function T(e,t,n,r,a,i,o){for(var l=this.length,s=2;--s;){switch(e){case"add":var c=this.$model.slice(t,t+n).map(function(e){return Nt.test(avalon.type(e))?e.$id?e:b(e,0,e):e});_n.apply(this,[t,0].concat(c)),this._fire("add",t,n);break;case"del":var u=this._splice(t,n);this._fire("del",t,n)}a&&(e=a,t=i,n=o,s=2,a=0)}return this._fire("index",r),this.length!==l&&(this._.length=this.length),u}function E(e,t){for(var n={},r=0,a=t.length;a>r;r++){n[r]=e[r];var i=t[r];i in n?(e[r]=n[i],delete n[i]):e[r]=e[i]}}function A(e){Bt[xt]=e,avalon.openComputedCollect=!0;var t=e.evaluator;if(t)try{var n=Sn.test(e.type)?e:t.apply(0,e.args);e.handler(n,e.element,e)}catch(r){delete e.evaluator;var a=e.element;if(3===a.nodeType){var i=a.parentNode;h.commentInterpolate?i.replaceChild($t.createComment(e.value),a):a.data=fn+e.value+pn}}avalon.openComputedCollect=!1,delete Bt[xt]}function k(e){var t=Bt[xt];e&&t&&avalon.Array.ensure(e,t)&&t.element&&M(t,e)}function M(e,t){e.$uuid=e.$uuid||qt(),t.$uuid=t.$uuid||qt();var n={data:e,list:t,$$uuid:e.$uuid+t.$uuid};Ln[n.$$uuid]||(Ln[n.$$uuid]=1,Ln.push(n))}function O(e){e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function _(e){try{if(!e.parentNode)return!0}catch(t){return!0}return e.msRetain?0:1===e.nodeType?"number"==typeof e.sourceIndex?0===e.sourceIndex:!Rt.contains(e):!avalon.contains(Rt,e)}function N(){for(var e,t=Ln.length,n=t,r=0,a=[],i={},o={};e=Ln[--t];){var l=e.data,s=l.type;i[s]?i[s]++:(i[s]=1,a.push(s))}var c=!1;if(a.forEach(function(e){Hn[e]!==i[e]&&(o[e]=1,c=!0)}),t=n,c)for(;e=Ln[--t];)l=e.data,void 0!==l.element&&o[l.type]&&_(l.element)&&(r++,Ln.splice(t,1),delete Ln[e.$$uuid],avalon.Array.remove(e.list,l),O(l),e.data=e.list=null);Hn=i,jn=new Date}function S(e){if(e&&e.length){new Date-jn>444&&"object"==typeof e[0]&&N();for(var t,n=Ft.call(arguments,1),a=e.length;t=e[--a];){var i=t.element;if(i&&i.parentNode)if(t.$repeat)t.handler.apply(t,n);else if("on"!==t.type){var o=t.evaluator||r;t.handler(o.apply(0,t.args||[]),i,t)}}}}function L(e){var t=e.nodeName;return t.toLowerCase()===t&&e.scopeName&&""===e.outerText}function j(e){"url(#default#VML)"!==e.currentStyle.behavior&&(e.style.behavior="url(#default#VML)",e.style.display="inline-block",e.style.zoom=1)}function H(e,t,n){var r=setTimeout(function(){var a=e.innerHTML;clearTimeout(r),a===n?t():H(e,t,a)})}function P(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]'}function D(e,t){for(var n,r=0;n=e[r++];)n.vmodels=t,Jt[n.type](n,t),n.evaluator&&n.element&&1===n.element.nodeType&&n.element.removeAttribute(n.name);e.length=0}function F(e,t){return e.priority-t.priority}function B(e,t){for(var r,a,i=ar?ar(e):avalon.slice(e.attributes),o=[],l={},s=0;a=i[s++];)if(a.specified&&(r=a.name.match(Xn))){var c=r[1],u=r[2]||"",f=a.value,p=a.name;if(l[p]=f,Gn[c]?(u=c,c="on"):Jn[c]&&(n("warning!请改用ms-attr-"+c+"代替ms-"+c+"!"),"enabled"===c&&(n("warning!ms-enabled或ms-attr-enabled已经被废弃"),c="disabled",f="!("+f+")"),u=c,c="attr",e.removeAttribute(p),p="ms-attr-"+u,e.setAttribute(p,f),r=[p],l[p]=f),"function"==typeof Jt[c]){var d={type:c,param:u,element:e,name:r[0],value:f,priority:c in Yn?Yn[c]:10*c.charCodeAt(0)+(Number(u)||0)};if("html"===c||"text"===c){var v=W(f);avalon.mix(d,v),d.filters=d.filters.replace(ir,function(){return d.type="html",d.group=1,""})}"ms-if-loop"===p&&(d.priority+=100),t.length&&(o.push(d),"widget"===c&&(e.msData=e.msData||l))}}o.sort(F);var h=e.type;h&&l["ms-duplex"]&&(l["ms-attr-checked"]&&/radio|checkbox/.test(h)&&n("warning!"+h+"控件不能同时定义ms-attr-checked与ms-duplex"),l["ms-attr-value"]&&/text|password/.test(h)&&n("warning!"+h+"控件不能同时定义ms-attr-value与ms-duplex"));var m=!0;for(s=0;d=o[s];s++){if(c=d.type,Zn.test(c))return D(o.slice(0,s+1),t);m&&(m=!Qn.test(c))}D(o,t),m&&!Wn[e.tagName]&&hn.test(e.innerHTML.replace(lr,"<").replace(sr,">"))&&(zn&&zn(e),I(e,t))}function I(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;V(n,n.nodeType,t),n=r}}function R(e,t){for(var n,r=0;n=e[r++];)V(n,n.nodeType,t)}function V(e,t,n){1===t?U(e,n):3===t&&dn.test(e.data)?z(e,n):h.commentInterpolate&&8===t&&!dn.test(e.nodeValue)&&z(e,n)}function U(e,t,r){var a=e.getAttribute("ms-skip");if(!e.getAttributeNode)return n("warning "+e.tagName+" no getAttributeNode method");var i=e.getAttributeNode("ms-important"),o=e.getAttributeNode("ms-controller");if("string"!=typeof a){if(r=i||o){var l=avalon.vmodels[r.value];if(!l)return;t=r===i?[l]:[l].concat(t);var s=r.name;e.removeAttribute(s),avalon(e).removeClass(s),P(e,l)}B(e,t)}}function W(e){if(e.indexOf("|")>0){var t=e.replace(rstringLiteral,function(e){return Array(e.length+1).join("1")}),n=t.replace(or,"??").indexOf("|");if(n>-1)return{filters:e.slice(n),value:e.slice(0,n),expr:!0}}return{value:e,filters:"",expr:!0}}function q(e){for(var t,n,r=[],a=0;;){if(n=e.indexOf(fn,a),-1===n)break;if(t=e.slice(a,n),t&&r.push({value:t,filters:"",expr:!1}),a=n+fn.length,n=e.indexOf(pn,a),-1===n)break;t=e.slice(a,n),t&&r.push(W(t)),a=n+pn.length}return t=e.slice(a),t&&r.push({value:t,expr:!1,filters:""}),r}function z(e,t){var n=[];if(8===e.nodeType)var r=W(e.nodeValue),a=[r];else a=q(e.data);if(a.length){for(var i=0;r=a[i++];){var o=$t.createTextNode(r.value);r.expr&&(r.type="text",r.element=o,r.filters=r.filters.replace(ir,function(){return r.type="html",r.group=1,""}),n.push(r)),Vt.appendChild(o)}e.parentNode.replaceChild(Vt,e),n.length&&D(n,t)}}function X(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function Y(e){return e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function G(e){if(!("classList"in e)){e.classList={node:e};for(var t in cr)e.classList[t.slice(1)]=cr[t]}return e.classList}function J(e){try{if("object"==typeof e)return e;e="true"===e?!0:"false"===e?!1:"null"===e?null:+e+""===e?+e:ur.test(e)?avalon.parseJSON(e):e}catch(t){}return e}function Z(e){return e.window&&e.document?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}function Q(e,t){if(e.offsetWidth<=0){if(Er.test(hr["@:get"](e,"display"))){var n={node:e};for(var r in Tr)n[r]=e.style[r],e.style[r]=Tr[r];t.push(n)}var a=e.parentNode;a&&1===a.nodeType&&Q(a,t)}}function K(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}function et(e,t,n,r){for(var a,i=[],o=" = "+n+".",l=e.length;a=e[--l];)t.hasOwnProperty(a)&&(i.push(a+o+a),r.vars.push(a),"duplex"===r.type&&(e.get=n+"."+a),e.splice(l,1));return i}function tt(e){for(var t=[],n={},r=0;rd;d++)if(s.length){var h="vm"+xt+"_"+d;u.push(h),f.push(t[d]),c.push.apply(c,et(s,t[d],h,a))}if(c.length||"duplex"!==i){"duplex"!==i&&(e.indexOf("||")>-1||e.indexOf("&&")>-1)&&a.vars.forEach(function(t){var n=new RegExp("\\b"+t+"(?:\\.\\w+|\\[\\w+\\])+","ig");e=e.replace(n,function(n){var r=n.charAt(t.length),a=zt?e.slice(arguments[1]+n.length):RegExp.rightContext,i=/^\s*\(/.test(a);if("."===r||"["===r||i){var o="var"+String(Math.random()).replace(/^0\./,"");if(i){var l=n.split(".");if(l.length>2){var s=l.pop();return c.push(o+" = "+l.join(".")),o+"."+s}return n}return c.push(o+" = "+n),o}return n})}),a.args=f;var m=Fr.get(l);if(m)return void(a.evaluator=m);if(p=c.join(", "),p&&(p="var "+p),/\S/.test(o)){if(!/text|html/.test(a.type))throw Error("ms-"+a.type+"不支持过滤器");e="\nvar ret"+xt+" = "+e+";\r\n",e+=nt("ret"+xt,o)}else{if("duplex"===i){var g="'use strict';\nreturn function(vvv){\n "+p+";\n if(!arguments.length){\n return "+e+"\n }\n "+(Br.test(e)?e:s.get)+"= vvv;\n} ";try{m=Function.apply(r,u.concat(g)),a.evaluator=Fr.put(l,m)}catch(y){n("debug: parse error,"+y.message)}return}if("on"===i){-1===e.indexOf("(")?e+=".call(this, $event)":e=e.replace("(",".call(this,"),u.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),x=e.slice(0,b),$=e.slice(b);e=x+"\n"+$}else e="\nreturn "+e+";"}try{m=Function.apply(r,u.concat("'use strict';\n"+p+e)),a.evaluator=Fr.put(l,m)}catch(y){n("debug: parse error,"+y.message)}finally{s=c=u=null}}}function at(e,t,n,r,a){Array.isArray(r)&&(e=r.map(function(e){return e.expr?"("+e.value+")":Or(e.value)}).join(" + ")),rt(e,t,n),n.evaluator&&!a&&(n.handler=Zt[n.handlerName||n.type],A(n))}function it(e,t,n){var r=e.templateCache&&e.templateCache[t];if(r){for(var a,i=$t.createDocumentFragment();a=r.firstChild;)i.appendChild(a);return i}return avalon.parseHTML(n)}function ot(e){return null==e?"":e}function lt(e,t,n){return t.param.replace(/\w+/g,function(r){var a=avalon.duplexHooks[r];a&&"function"==typeof a[n]&&(e=a[n](e,t))}),e}function st(){for(var e=na.length-1;e>=0;e--){var t=na[e];t()===!1&&na.splice(e,1)}na.length||clearInterval(ta)}function ct(e,t,n,r){var a=e.template.cloneNode(!0),i=avalon.slice(a.childNodes);n.$stamp&&a.insertBefore(n.$stamp,a.firstChild),t.appendChild(a);var o=[n].concat(e.vmodels),l={nodes:i,vmodels:o};r.push(l)}function ut(e,t){var n=e.proxies[t];return n?n.$stamp:e.element}function ft(e,t,n){for(;;){var r=t.previousSibling;if(!r)break;if(r.parentNode.removeChild(r),n&&n.call(r),r===e)break}}function pt(e){var t={$host:[],$outer:{},$stamp:1,$index:0,$first:!1,$last:!1,$remove:avalon.noop};t[e]={get:function(){return this.$host[this.$index]},set:function(e){this.$host.set(this.$index,e)}};var n={$last:1,$first:1,$index:1},r=b(t,n),a=r.$events;return a[e]=a.$first=a.$last=a.$index,r.$id=qt("$proxy$each"),r}function dt(e,t){for(var n,r=t.param||"el",a=0,i=oa.length;i>a;a++){var o=oa[a];o&&o.hasOwnProperty(r)&&(n=o,oa.splice(a,1))}n||(n=pt(r));var l=t.$repeat,s=l.length-1;return n.$index=e,n.$first=0===e,n.$last=e===s,n.$host=l,n.$outer=t.$outer,n.$stamp=t.clone.cloneNode(!1),n.$remove=function(){return l.removeAt(n.$index)},n}function vt(){var e=b({$key:"",$outer:{},$host:{},$val:{get:function(){return this.$host[this.$key]},set:function(e){this.$host[this.$key]=e}}},{$val:1});return e.$id=qt("$proxy$with"),e}function ht(e,t){var n=la.pop();n||(n=vt());var r=t.$repeat;return n.$key=e,n.$host=r,n.$outer=t.$outer,r.$events?n.$events.$val=r.$events[e]:n.$events={},n}function mt(e,t){var n="each"===t?oa:la;avalon.each(e,function(e,t){if(t.$events){for(var r in t.$events)Array.isArray(t.$events[r])&&(t.$events[r].forEach(function(e){"object"==typeof e&&O(e)}),t.$events[r].length=0);t.$host=t.$outer={},n.unshift(t)>h.maxRepeatSize&&n.pop()}}),"each"===t&&(e.length=0)}function gt(e,t){var n="_"+e;if(!gt[n]){var r=$t.createElement(e);Rt.appendChild(r),t=It?getComputedStyle(r,null).display:r.currentStyle.display,Rt.removeChild(r),gt[n]=t}return gt[n]}function yt(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var a=isFinite(+e)?+e:0,i=isFinite(+t)?Math.abs(t):3,o=r||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(i?c(a,i):""+Math.round(a)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(s[1]||"").length.avalonHide{ display: none!important }",Ct.setAttribute("ms-skip","1"),Ct.className="avalonHide";var Tt,Et=/\[native code\]/,At="$"+xt,kt=e.require,Mt=e.define,Ot=!1,_t=/[^, ]+/g,Nt=/^(?:object|array)$/,St=/^\[object SVG\w*Element\]$/,Lt=/^\[object (?:Window|DOMWindow|global)\]$/,jt=Object.prototype,Ht=jt.hasOwnProperty,Pt=jt.toString,Dt=Array.prototype,Ft=Dt.slice,Bt={},It=e.dispatchEvent,Rt=$t.documentElement,Vt=$t.createDocumentFragment(),Ut=$t.createElement("div"),Wt={};"Boolean Number String Function Array Date RegExp Object Error".replace(_t,function(e){Wt["[object "+e+"]"]=e.toLowerCase()});var qt=function(e){return e=e||"avalon",(e+Math.random()+Math.random()).replace(/0\./g,"")},zt=o();avalon=function(e){return new avalon.init(e)},avalon.nextTick=new function(){function t(){for(var e=i.length,t=0;e>t;t++)i[t]();i=i.slice(e)}var n=e.setImmediate,r=e.MutationObserver,a=It&&e.postMessage;if(n)return n.bind(e);var i=[];if(r){var o=document.createTextNode("avalon");return new r(t).observe(o,{characterData:!0}),function(e){i.push(e),o.data=Math.random()}}return a?(e.addEventListener("message",function(n){var r=n.source;r!==e&&null!==r||"process-tick"!==n.data||(n.stopPropagation(),t())}),function(t){i.push(t),e.postMessage("process-tick","*")}):function(e){setTimeout(e,0)}},avalon.init=function(e){this[0]=this.element=e},avalon.fn=avalon.prototype=avalon.init.prototype,avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?Wt[Pt.call(e)]||"object":typeof e};var Xt="object"==typeof alert?function(e){try{return/^\s*\bfunction\b/.test(e+"")}catch(t){return!1}}:function(e){return"[object Function]"===Pt.call(e)};avalon.isFunction=Xt,avalon.isWindow=function(e){return e?e==e.document&&e.document!=e:!1},l(e)&&(avalon.isWindow=l);var Yt;for(Yt in avalon({}))break;var Gt="0"!==Yt;avalon.isPlainObject=function(e,t){if(!e||"object"!==avalon.type(e)||e.nodeType||avalon.isWindow(e))return!1;try{if(e.constructor&&!Ht.call(e,"constructor")&&!Ht.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(Gt)for(t in e)return Ht.call(e,t);for(t in e);return void 0===t||Ht.call(e,t)},Et.test(Object.getPrototypeOf)&&(avalon.isPlainObject=function(e){return"[object Object]"===Pt.call(e)&&Object.getPrototypeOf(e)===jt}),avalon.mix=avalon.fn.mix=function(){var e,t,n,r,a,i,o=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[1]||{},l++),"object"==typeof o||Xt(o)||(o={}),l===s&&(o=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e){n=o[t];try{r=e[t]}catch(u){continue}o!==r&&(c&&r&&(avalon.isPlainObject(r)||(a=Array.isArray(r)))?(a?(a=!1,i=n&&Array.isArray(n)?n:[]):i=n&&avalon.isPlainObject(n)?n:{},o[t]=avalon.mix(c,i,r)):void 0!==r&&(o[t]=r))}return o},avalon.mix({rword:_t,subscribers:At,version:1.42,ui:{},log:n,slice:It?function(e,t,n){return Ft.call(e,t,n)}:function(e,t,n){var r=[],a=e.length;if(void 0===n&&(n=a),"number"==typeof n&&isFinite(n)){t=s(t,a),n=s(n,a);for(var i=t;n>i;++i)r[i-t]=e[i]}return r},noop:r,error:function(e,t){throw(t||Error)(e)},oneObject:i,range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n)),i=new Array(a);++rn&&t(n,e[n])!==!1;n++);else for(n in e)if(e.hasOwnProperty(n)&&t(n,e[n])===!1)break}},getWidgetData:function(e,t){var n=avalon(e).data(),r={};for(var a in n)0===a.indexOf(t)&&(r[a.replace(t,"").replace(/\w/,function(e){return e.toLowerCase()})]=n[a]);return r},Array:{ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}});var Jt=avalon.bindingHandlers={},Zt=avalon.bindingExecutors={},Qt=new function(){function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var t=e.prototype;return t.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},t.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0)},t.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e};if(!"司徒正美".trim){var Kt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim=function(){return this.replace(Kt,"")}}var en=!{toString:null}.propertyIsEnumerable("toString"),tn=function(){}.propertyIsEnumerable("prototype"),nn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],rn=nn.length;if(Object.keys||(Object.keys=function(e){var t=[],n=tn&&"function"==typeof e;if("string"==typeof e||e&&e.callee)for(var r=0;rl;l++){var s=nn[l];o&&"constructor"===s||!Ht.call(e,s)||t.push(s)}return t}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Pt.call(e)}),r.bind||(Function.prototype.bind=function(e){if(arguments.length<2&&void 0===e)return this;var t=this,n=arguments;return function(){var r,a=[];for(r=1;rr&&(r+=n);n>r;r++)if(this[r]===e)return r;return-1},lastIndexOf:function(e,t){var n=this.length,r=null==t?n-1:t;for(0>r&&(r=Math.max(0,n+r));r>=0;r--)if(this[r]===e)return r;return-1},forEach:u("","_",""),filter:u("r=[],j=0,","if(_)r[j++]=this[i]","return r"),map:u("r=[],","r[i]=_","return r"),some:u("","if(_)return true","return false"),every:u("","if(!_)return false","return true")}),avalon.contains=f,$t.contains||($t.contains=function(e){return f($t,e)}),e.SVGElement){$t.createTextNode("x").contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))});var an="http://www.w3.org/2000/svg",on=$t.createElementNS(an,"svg");on.innerHTML='',St.test(on.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:p,set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,r=avalon.parseHTML(e);if("svg"===t)n.insertBefore(r,this);else{var a=$t.createDocumentFragment();d(r,a),n.insertBefore(a,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);d(t,this)}}}})}!Rt.outerHTML&&e.HTMLElement&&HTMLElement.prototype.__defineGetter__("outerHTML",p);var ln=/^(?:mouse|contextmenu|drag)|click/,sn=avalon.eventHooks;if("onmouseenter"in Rt||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){sn[e]={type:t,deel:function(t,n,r){return function(n){var a=n.relatedTarget;return a&&(a===t||16&t.compareDocumentPosition(a))?void 0:(delete n.type,n.type=e,r.call(t,n))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!sn.animationend&&(sn.animationend={type:n})}),"oninput"in $t.createElement("input")||(sn.input={type:"propertychange",deel:function(e,t,n){return function(t){return"value"===t.propertyName?(t.type="input",n.call(e,t)):void 0}}}),void 0===$t.onmousewheel){var cn=void 0!==$t.onwheel?"wheel":"DOMMouseScroll",un="wheel"===cn?"deltaY":"detail";sn.mousewheel={type:cn,deel:function(e,t,n){return function(t){t.wheelDeltaY=t.wheelDelta=t[un]>0?-120:120,t.wheelDeltaX=0,Object.defineProperty&&Object.defineProperty(t,"type",{value:"mousewheel"}),n.call(e,t)}}}}var fn,pn,dn,vn,hn,mn=/[-.*+?^${}()|[\]\/\\]/g,gn={loader:function(t){var n=Tt&&t;e.require=n?Tt:kt,e.define=n?Tt.define:Mt},interpolate:function(e){if(fn=e[0],pn=e[1],fn===pn)throw new SyntaxError("openTag!==closeTag");if(e+""=="")h.commentInterpolate=!0;else{var t=fn+"test"+pn;if(Ut.innerHTML=t,Ut.innerHTML!==t&&Ut.innerHTML.indexOf("<")>-1)throw new SyntaxError("此定界符不合法");Ut.innerHTML=""}var n=m(fn),r=m(pn);dn=new RegExp(n+"(.*?)"+r),vn=new RegExp(n+"(.*?)"+r,"g"),hn=new RegExp(n+".*?"+r+"|\\sms-")}};h.debug=!0,h.plugins=gn,h.plugins.interpolate(["{{","}}"]),h.paths={},h.shim={},h.maxRepeatSize=100,avalon.config=h;var yn=/(\w+)\[(avalonctrl)="(\S+)"\]/,bn=$t.querySelectorAll?function(e){return $t.querySelectorAll(e)}:function(e){for(var t,n=e.match(yn),r=$t.getElementsByTagName(n[1]),a=[],i=0;t=r[i++];)t.getAttribute(n[2])===n[3]&&a.push(t);return a},xn={$watch:function(e,t){if("function"==typeof t){var n=this.$events[e];n?n.push(t):this.$events[e]=[t]}else this.$events=this.$watch.backup;return this},$unwatch:function(e,t){var n=arguments.length;if(0===n)this.$watch.backup=this.$events,this.$events={};else if(1===n)this.$events[e]=[];else for(var r=this.$events[e]||[],a=r.length;~--a<0;)if(r[a]===t)return r.splice(a,1);return this},$fire:function(e){var t,n,r,a;/^(\w+)!(\S+)$/.test(e)&&(t=RegExp.$1,e=RegExp.$2);var i=this.$events;if(i){var o=Ft.call(arguments,1),l=[e].concat(o);if("all"===t)for(n in avalon.vmodels)r=avalon.vmodels[n],r!==this&&r.$fire.apply(r,l);else if("up"===t||"down"===t){var s=i.expr?bn(i.expr):[];if(0===s.length)return;for(n in avalon.vmodels)if(r=avalon.vmodels[n],r!==this&&r.$events.expr){var c=bn(r.$events.expr);if(0===c.length)continue;Array.prototype.forEach.call(c,function(e){Array.prototype.forEach.call(s,function(n){var a="down"===t?n.contains(e):e.contains(n);a&&(e._avalon=r)})})}var u=$t.getElementsByTagName("*"),f=[];for(Array.prototype.forEach.call(u,function(e){e._avalon&&(f.push(e._avalon),e._avalon="",e.removeAttribute("_avalon"))}),"up"===t&&f.reverse(),n=0;(a=f[n++])&&a.$fire.apply(a,l)!==!1;);}else{var p=i[e]||[],d=i.$all||[];for(n=0;a=p[n++];)Xt(a)&&a.apply(this,o);for(n=0;a=d[n++];)Xt(a)&&a.apply(this,arguments)}}}},$n=avalon.vmodels={};avalon.define=function(e,t){var a=e.$id||e;if(a||n("warning: vm必须指定$id"),$n[a]&&n("warning: "+a+" 已经存在于avalon.vmodels中"),"object"==typeof e)var i=b(e);else{var o={$watch:r};t(o),i=b(o),Ot=!0,t(i),Ot=!1}return i.$id=a,$n[a]=i};var wn=String("$id,$watch,$unwatch,$fire,$events,$model,$skipArray").match(_t),Cn={},Tn=Object.defineProperty,En=!0;try{Tn({},"_",{value:"x"});var An=Object.defineProperties}catch(kn){En=!1}var Mn=Object.is||function(e,t){return 0===e&&0===t?1/e===1/t:e!==e?t!==t:e===t},On=It?function(e){var t={};for(var n in e)t[n]={get:e[n],set:e[n],enumerable:!0,configurable:!0};return t}:function(e){return e};En||("__defineGetter__"in avalon&&(Tn=function(e,t,n){return"value"in n&&(e[t]=n.value),"get"in n&&e.__defineGetter__(t,n.get),"set"in n&&e.__defineSetter__(t,n.set),e},An=function(e,t){for(var n in t)t.hasOwnProperty(n)&&Tn(e,n,t[n]);return e}),zt&&(e.execScript(["Function parseVB(code)"," ExecuteGlobal(code)","End Function","Dim VBClassBodies",'Set VBClassBodies=CreateObject("Scripting.Dictionary")',"Function findOrDefineVBClass(name,body)"," Dim found",' found=""'," For Each key in VBClassBodies"," If body=VBClassBodies.Item(key) Then"," found=key"," Exit For"," End If"," next",' If found="" Then',' parseVB("Class " + name + body)'," VBClassBodies.Add name, body"," found=name"," End If"," findOrDefineVBClass=found","End Function"].join("\n"),"VBScript"),An=function(t,n,r){var a="VBClass"+setTimeout("1"),i=[];i.push("\r\n Private [__data__], [__proxy__]"," Public Default Function [__const__](d, p)"," Set [__data__] = d: set [__proxy__] = p"," Set [__const__] = Me"," End Function");for(t in r)n.hasOwnProperty(t)||i.push(" Public ["+t+"]");wn.forEach(function(e){n.hasOwnProperty(e)||i.push(" Public ["+e+"]")}),i.push(" Public [hasOwnProperty]");for(t in n)i.push(" Public Property Let ["+t+"](val"+xt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+xt+")"," End Property"," Public Property Set ["+t+"](val"+xt+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+xt+")"," End Property"," Public Property Get ["+t+"]"," On Error Resume Next"," Set["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," If Err.Number <> 0 Then"," ["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," End If"," On Error Goto 0"," End Property");i.push("End Class");var o=i.join("\r\n"),l=e.findOrDefineVBClass(a,o);l===a&&e.parseVB(["Function "+a+"Factory(a, b)"," Dim o"," Set o = (New "+a+")(a, b)"," Set "+a+"Factory = o","End Function"].join("\r\n"));var s=e[l+"Factory"](n,w);return s}));var _n=Dt.splice,Nn={_splice:_n,_fire:function(e,t,n){S(this.$events[At],e,t,n)},size:function(){return this._.length},pushArray:function(e){var t=e.length,n=this.length;return t&&(Dt.push.apply(this.$model,e),T.call(this,"add",n,t,Math.max(0,n-1))),t+n},push:function(){var e,t=[],n=arguments.length;for(e=0;n>e;e++)t[e]=arguments[e];return this.pushArray(t)},unshift:function(){var e=arguments.length,t=this.length;return e&&(Dt.unshift.apply(this.$model,arguments),T.call(this,"add",0,e,0)),e+t},shift:function(){if(this.length){var e=this.$model.shift();return T.call(this,"del",0,1,0),e}},pop:function(){var e=this.length;if(e){var t=this.$model.pop();return T.call(this,"del",e-1,1,Math.max(0,e-2)),t}},splice:function(e){var t,n=arguments.length,r=[],a=_n.apply(this.$model,arguments);return a.length&&(r.push("del",e,a.length,0),t=!0),n>2&&(t?r.splice(3,1,0,"add",e,n-2):r.push("add",e,n-2,0),t=!0),t?T.apply(this,r):[]},contains:function(e){return-1!==this.indexOf(e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>=0?(this.$model.splice(e,1),T.call(this,"del",e,1,0)):[]},clear:function(){return this.$model.length=this.length=this._.length=0,this._fire("clear",0),this},removeAll:function(e){if(Array.isArray(e))e.forEach(function(e){this.remove(e)},this);else if("function"==typeof e)for(var t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&this.removeAt(t)}else this.clear()},ensure:function(e){return this.contains(e)||this.push(e),this},set:function(e,t){if(e>=0){var n=avalon.type(t);t&&t.$model&&(t=t.$model);var r=this[e];if("object"===n)for(var a in t)r.hasOwnProperty(a)&&(r[a]=t[a]); else"array"===n?r.clear().push.apply(r,t):r!==t&&(this[e]=t,this.$model[e]=t,this._fire("set",e,t))}return this}};"sort,reverse".replace(_t,function(e){Nn[e]=function(){var t,n=this.$model,r=n.concat(),a=Math.random(),i=[];Dt[e].apply(n,arguments);for(var o=0,l=r.length;l>o;o++){var s=n[o],c=r[o];if(Mn(s,c))i.push(o);else{var u=r.indexOf(s);i.push(u),r[u]=a,t=!0}}return t&&(E(this,i),this._fire("move",i),this._fire("index",0)),this}});var Sn=/^(duplex|on)$/,Ln=avalon.$$subscribers=[],jn=new Date,Hn={},Pn={area:[1,"",""],param:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],option:[1,""],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],g:[1,'',""],_default:It?[0,"",""]:[1,"X
","
"]};Pn.th=Pn.td,Pn.optgroup=Pn.option,Pn.tbody=Pn.tfoot=Pn.colgroup=Pn.caption=Pn.thead,String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(_t,function(e){Pn[e]=Pn.g});var Dn=/<([\w:]+)/,Fn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Bn=It?/[^\d\D]/:/(<(?:script|link|style|meta|noscript))/gi,In=i(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Rn=/<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/,Vn=$t.createElement("script"),Un=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=Vt.cloneNode(!1);if("string"!=typeof e)return t;if(!Un.test(e))return t.appendChild($t.createTextNode(e)),t;e=e.replace(Fn,"<$1>").trim();var n,r,a=(Dn.exec(e)||["",""])[1].toLowerCase(),i=Pn[a]||Pn._default,o=Ut;It||(e=e.replace(Bn,"
$1")),o.innerHTML=i[1]+e+i[2];var l=o.getElementsByTagName("script");if(l.length)for(var s,c=0;s=l[c++];)In[s.type]&&(r=Vn.cloneNode(!1),Dt.forEach.call(s.attributes,function(e){e&&e.specified&&(r[e.name]=e.value,r.setAttribute(e.name,e.value))}),r.text=s.text,s.parentNode.replaceChild(r,s));if(!It){var u="X
"===i[1]?o.lastChild.firstChild:o.lastChild;if(u&&"TABLE"===u.tagName&&"tbody"!==a)for(l=u.childNodes,c=0;s=l[c++];)if("TBODY"===s.tagName&&!s.innerHTML){u.removeChild(s);break}l=o.getElementsByTagName("br");for(var f=l.length;s=l[--f];)"msNoScope"===s.className&&s.parentNode.removeChild(s);for(l=o.all,c=0;s=l[c++];)L(s)&&j(s)}for(c=i[0];c--;o=o.lastChild);for(;n=o.firstChild;)t.appendChild(n);return t},avalon.innerHTML=function(e,t){if(!It&&!Bn.test(t)&&!Rn.test(t))try{return void(e.innerHTML=t)}catch(n){}var r=this.parseHTML(t);this.clearHTML(e).appendChild(r)},avalon.clearHTML=function(e){for(e.textContent="";e.firstChild;)e.removeChild(e.firstChild);return e},avalon.scan=function(e,t){e=e||Rt;var n=t?[].concat(t):[];U(e,n)};var Wn=i("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),qn=function(e,t,n){var r=e.getAttribute(t);if(r)for(var a,i=0;a=n[i++];)if(a.hasOwnProperty(r)&&"function"==typeof a[r])return a[r]},zn=zt&&e.MutationObserver?function(e){for(var t,n=e.firstChild;n;){var r=n.nextSibling;3===n.nodeType?t?(t.nodeValue+=n.nodeValue,e.removeChild(n)):t=n:t=null,n=r}}:0,Xn=/ms-(\w+)-?(.*)/,Yn={"if":10,repeat:90,data:100,widget:110,each:1400,"with":1500,duplex:2e3,on:3e3},Gn=i("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),Jn=i("value,title,alt,checked,selected,disabled,readonly,enabled"),Zn=/^if|widget|repeat$/,Qn=/^each|with|html|include$/;if(!"1"[0])var Kn=new Qt(512),er=/\s+(ms-[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,tr=/^['"]/,nr=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i,rr=/&/g,ar=function(e){var t=e.outerHTML;if("-1},_add:function(e){this.contains(e)||this._set(this+" "+e)},_remove:function(e){this._set((" "+this+" ").replace(" "+e+" "," "))},__set:function(e){e=e.trim();var t=this.node;St.test(t)?t.setAttribute("class",e):t.className=e}};"add,remove".replace(_t,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&"string"==typeof t&&n&&1===n.nodeType&&t.replace(/\S+/g,function(t){G(n)[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&G(t).contains(e)},toggleClass:function(e,t){for(var n,r=0,a=e.split(/\s+/),i="boolean"==typeof t;n=a[r++];){var o=i?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){switch(e="data-"+X(e||""),arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return J(n);case 0:var r={};return Dt.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=Y(e.slice(5)),r[e]=J(t.value)))}),r}},removeData:function(e){return e="data-"+X(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var r=avalon.css(this,e,t);return void 0!==r?r:this},position:function(){var e,t,n=this[0],r={top:0,left:0};if(n)return"fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(r=e.offset()),r.top+=avalon.css(e[0],"borderTopWidth",!0),r.left+=avalon.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-avalon.css(n,"marginTop",!0),left:t.left-r.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||Rt)},bind:function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&1===t.nodeType){var n=0===arguments.length,r=n?":get":":set",a=kr[K(t)+r];if(a)var i=a(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?i:this}});var ur=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,fr=/^[\],:{}\s]*$/,pr=/(?:^|:|,)(?:\s*\[)+/g,dr=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,vr=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;avalon.parseJSON=e.JSON?JSON.parse:function(e){if("string"==typeof e){if(e=e.trim(),e&&fr.test(e.replace(dr,"@").replace(vr,"]").replace(pr,"")))return new Function("return "+e)();avalon.error("Invalid JSON: "+e)}return e},avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var r=this[0]||{},a=Z(r),i="scrollTop"===e;return arguments.length?void(a?a.scrollTo(i?avalon(a).scrollLeft():n,i?n:avalon(a).scrollTop()):r[e]=n):a?t in a?a[t]:Rt[e]:r[e]}});var hr=avalon.cssHooks={},mr=["","-webkit-","-o-","-moz-","-ms-"],gr={"float":It?"cssFloat":"styleFloat"};if(avalon.cssNumber=i("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(gr[e])return gr[e];t=t||Rt.style;for(var r=0,a=mr.length;a>r;r++)if(n=Y(mr[r]+e),n in t)return gr[e]=n;return null},hr["@:set"]=function(e,t,n){try{e.style[t]=n}catch(r){}},e.getComputedStyle)hr["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,r=getComputedStyle(e,null);return r&&(n="filter"===t?r.getPropertyValue(t):r[t],""===n&&(n=e.style[t])),n},hr["opacity:get"]=function(e){var t=hr["@:get"](e,"opacity");return""===t?"1":t};else{var yr=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,br=/^(top|right|bottom|left)$/,xr=/alpha\([^)]*\)/i,$r=!!e.XDomainRequest,wr="DXImageTransform.Microsoft.Alpha",Cr={thin:$r?"1px":"2px",medium:$r?"3px":"4px",thick:$r?"5px":"6px"};hr["@:get"]=function(e,t){var n=e.currentStyle,r=n[t];if(yr.test(r)&&!br.test(r)){var a=e.style,i=a.left,o=e.runtimeStyle.left;e.runtimeStyle.left=n.left,a.left="fontSize"===t?"1em":r||0,r=a.pixelLeft+"px",a.left=i,e.runtimeStyle.left=o}return"medium"===r&&(t=t.replace("Width","Style"),"none"===n[t]&&(r="0px")),""===r?"auto":Cr[r]||r},hr["opacity:set"]=function(e,t,n){var r=e.style,a=isFinite(n)&&1>=n?"alpha(opacity="+100*n+")":"",i=r.filter||"";r.zoom=1,r.filter=(xr.test(i)?i.replace(xr,a):i+" "+a).trim(),r.filter||r.removeAttribute("filter")},hr["opacity:get"]=function(e){var t=e.filters.alpha||e.filters[wr],n=t&&t.enabled?t.opacity:100;return n/100+""}}"top,left".replace(_t,function(e){hr[e+":get"]=function(t){var n=hr["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var Tr={position:"absolute",visibility:"hidden",display:"block"},Er=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(_t,function(e){var t=e.toLowerCase(),n="client"+e,r="scroll"+e,a="offset"+e;hr[t+":get"]=function(t,n,r){var i=-4;"number"==typeof r&&(i=r),n="Width"===e?["Left","Right"]:["Top","Bottom"];var o=t[a];return 2===i?o+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>i&&(o=o-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===i&&(o=o-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),o)},hr[t+"&get"]=function(e){var n=[];Q(e,n);for(var r,a=hr[t+":get"](e),i=0;r=n[i++];){e=r.node;for(var o in r)"string"==typeof r[o]&&(e.style[o]=r[o])}return a},avalon.fn[t]=function(i){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e]||o.document.documentElement[n];if(9===o.nodeType){var l=o.documentElement;return Math.max(o.body[r],l[r],o.body[a],l[a],l[n])}return hr[t+"&get"](o)}return this.css(t,i)},avalon.fn["inner"+e]=function(){return hr[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return hr[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0],t={left:0,top:0};if(!e||!e.tagName||!e.ownerDocument)return t;var n=e.ownerDocument,r=n.body,a=n.documentElement,i=n.defaultView||n.parentWindow;if(!avalon.contains(a,e))return t;e.getBoundingClientRect&&(t=e.getBoundingClientRect());var o=a.clientTop||r.clientTop,l=a.clientLeft||r.clientLeft,s=Math.max(i.pageYOffset||0,a.scrollTop,r.scrollTop),c=Math.max(i.pageXOffset||0,a.scrollLeft,r.scrollLeft);return{top:t.top+s-o,left:t.left+c-l}};var Ar=/^]+))?)*\s+value[\s=]/i,kr={"option:get":zt?function(e){return Ar.test(e.outerHTML)?e.value:e.text.trim()}:function(e){return e.value},"select:get":function(e,t){for(var n,r=e.options,a=e.selectedIndex,i=kr["option:get"],o="select-one"===e.type||0>a,l=o?null:[],s=o?a+1:r.length,c=0>a?s:o?a:0;s>c;c++)if(n=r[c],(n.selected||c===a)&&!n.disabled){if(t=i(n),o)return t;l.push(t)}return l},"select:set":function(e,t,n){t=[].concat(t);for(var r,a=kr["option:get"],i=0;r=e.options[i++];)(r.selected=t.indexOf(a(r))>-1)&&(n=!0);n||(e.selectedIndex=-1)}},Mr={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},Or=e.JSON&&JSON.stringify||function(e){return'"'+e.replace(/[\\\"\x00-\x1f]/g,function(e){var t=Mr[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"'},_r=["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","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,undefined"].join(","),Nr=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g,Sr=/[^\w$]+/g,Lr=new RegExp(["\\b"+_r.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),jr=/\b\d[^,]*/g,Hr=/^,+|,+$/g,Pr=new Qt(512),Dr=function(e){var t=","+e.trim(),n=Pr.get(t);if(n)return n;var r=e.replace(Nr,"").replace(Sr,",").replace(Lr,"").replace(jr,"").replace(Hr,"").split(/^$|,+/);return Pr.put(t,tt(r))},Fr=new Qt(128),Br=/\w\[.*\]|\w\.\w/,Ir=/(\$proxy\$[a-z]+)\d+$/,Rr=/\)\s*$/,Vr=/\)\s*\|/g,Ur=/\|\s*([$\w]+)/g,Wr=/"\s*\["/g,qr=/"\s*\(/g;avalon.parseExprProxy=at;var zr=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),Xr={};zr.replace(_t,function(e){Xr[e.toLowerCase()]=e});var Yr={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},Gr=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");Gr.replace(_t,function(e){Yr[e.toLowerCase()]=e});var Jr=/(?:[\s\S]+?)<\/noscript>/gim,Zr=/([\s\S]+?)<\/noscript>/im,Qr=function(){return new(e.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")},Kr=avalon.templateCache={};Jt.attr=function(e,t){var n=e.value.trim(),r=!0;if(n.indexOf(fn)>-1&&n.indexOf(pn)>2&&(r=!1,dn.test(n)&&""===RegExp.rightContext&&""===RegExp.leftContext&&(r=!0,n=RegExp.$1)),"include"===e.type){var a=e.element;e.includeRendered=qn(a,"data-include-rendered",t),e.includeLoaded=qn(a,"data-include-loaded",t);var i=e.includeReplace=!!avalon(a).data("includeReplace");avalon(a).data("includeCache")&&(e.templateCache={}),e.startInclude=$t.createComment("ms-include"),e.endInclude=$t.createComment("ms-include-end"),i?(e.element=e.startInclude,a.parentNode.insertBefore(e.startInclude,a),a.parentNode.insertBefore(e.endInclude,a.nextSibling)):(a.insertBefore(e.startInclude,a.firstChild),a.appendChild(e.endInclude))}e.handlerName="attr",at(n,t,e,r?0:q(e.value))},Zt.attr=function(t,n,r){var a=r.type,i=r.param;if("css"===a)avalon(n).css(i,t);else if("attr"===a){var o=t===!1||null===t||void 0===t;if(!It&&Yr[i]&&(i=Yr[i]),o)return n.removeAttribute(i);if(Xr[i]){var l=Xr[i];if("boolean"==typeof n[l])return n[l]=!!t}var s=St.test(n)?!1:$t.namespaces&&L(n)?!0:i in n.cloneNode(!1);s?n[i]=t:n.setAttribute(i,t)}else if("include"===a&&t){var c=r.vmodels,u=r.includeRendered,f=r.includeLoaded,p=r.includeReplace,d=p?n.parentNode:n,v=function(e){if(f){var n=f.apply(d,[e].concat(c));"string"==typeof n&&(e=n)}u&&H(d,function(){u.call(d)},0/0);var a=r.includeLastID;if(r.templateCache&&a&&a!==t){var i=r.templateCache[a];i||(i=r.templateCache[a]=$t.createElement("div"),Ct.appendChild(i))}for(r.includeLastID=t;;){var o=r.startInclude.nextSibling;if(!o||o===r.endInclude)break;d.removeChild(o),i&&i.appendChild(o)}var l=it(r,t,e),s=avalon.slice(l.childNodes);d.insertBefore(l,r.endInclude),R(s,c)};if("src"===r.param)if(Kr[t])avalon.nextTick(function(){v(Kr[t])});else{var h=Qr();h.onreadystatechange=function(){if(4===h.readyState){var e=h.status;(e>=200&&300>e||304===e||1223===e)&&v(Kr[t]=h.responseText)}},h.open("GET",t,!0),"withCredentials"in h&&(h.withCredentials=!0),h.setRequestHeader("X-Requested-With","XMLHttpRequest"),h.send(null)}else{var m=t&&1===t.nodeType?t:$t.getElementById(t);if(m){if("NOSCRIPT"===m.tagName&&!m.innerHTML&&!m.fixIE78){h=Qr(),h.open("GET",location,!1),h.send(null);for(var g=$t.getElementsByTagName("noscript"),y=(h.responseText||"").match(Jr)||[],b=y.length,x=0;b>x;x++){var $=g[x];$&&($.style.display="none",$.fixIE78=(y[x].match(Zr)||[""," "])[1])}}avalon.nextTick(function(){v(m.fixIE78||m.value||m.innerText||m.innerHTML)})}}}else if(Rt.hasAttribute||"string"!=typeof t||"src"!==a&&"href"!==a||(t=t.replace(/&/g,"&")),n[a]=t,e.chrome&&"EMBED"===n.tagName){var w=n.parentNode,C=document.createComment("ms-src");w.replaceChild(C,n),w.replaceChild(n,C)}},"title,alt,src,value,css,include,href".replace(_t,function(e){Jt[e]=Jt.attr}),Jt["class"]=function(e,t){var r,a=e.param,i=e.value;if(e.handlerName="class",!a||isFinite(a)){e.param="";var o=i.replace(vn,function(e){return e.replace(/./g,"0")}),l=o.indexOf(":");if(-1===l)var s=i;else{if(s=i.slice(0,l),r=i.slice(l+1),rt(r,t,e),!e.evaluator)return n("debug: ms-class '"+(r||"").trim()+"' 不存在于VM中"),!1;e._evaluator=e.evaluator,e._args=e.args}var c=dn.test(s);c||(e.immobileClass=s),at("",t,e,c?q(s):0)}else e.immobileClass=e.oldStyle=e.param,at(i,t,e)},Zt["class"]=function(e,t,n){var r=avalon(t),a=n.type;if("class"===a&&n.oldStyle)r.toggleClass(n.oldStyle,!!e);else switch(n.toggleClass=n._evaluator?!!n._evaluator.apply(t,n._args):!0,n.newClass=n.immobileClass||e,n.oldClass&&n.newClass!==n.oldClass&&r.removeClass(n.oldClass),n.oldClass=n.newClass,a){case"class":r.toggleClass(n.newClass,n.toggleClass);break;case"hover":case"active":if(!n.hasBindEvent){var i="mouseenter",o="mouseleave";if("active"===a){t.tabIndex=t.tabIndex||-1,i="mousedown",o="mouseup";var l=r.bind("mouseleave",function(){n.toggleClass&&r.removeClass(n.newClass)})}var s=r.bind(i,function(){n.toggleClass&&r.addClass(n.newClass)}),c=r.bind(o,function(){n.toggleClass&&r.removeClass(n.newClass)});n.rollback=function(){r.unbind("mouseleave",l),r.unbind(i,s),r.unbind(o,c)},n.hasBindEvent=!0}}},"hover,active".replace(_t,function(e){Jt[e]=Jt["class"]}),Zt.data=function(e,t,n){var r="data-"+n.param;e&&"object"==typeof e?t[r]=e:t.setAttribute(r,String(e))};var ea=Jt.duplex=function(e,t){var a,o=e.element;if(at(e.value,t,e,0,1),e.changed=qn(o,"data-duplex-changed",t)||r,e.evaluator&&e.args){var l=[],s=i("string,number,boolean,checked");"radio"===o.type&&""===e.param&&(e.param="checked"),o.msData&&(o.msData["ms-duplex"]=e.value),e.param.replace(/\w+/g,function(t){/^(checkbox|radio)$/.test(o.type)&&/^(radio|checked)$/.test(t)&&("radio"===t&&n("ms-duplex-radio已经更名为ms-duplex-checked"),t="checked",e.isChecked=!0),"bool"===t?(t="boolean",n("ms-duplex-bool已经更名为ms-duplex-boolean")):"text"===t&&(t="string",n("ms-duplex-text已经更名为ms-duplex-string")),s[t]&&(a=!0),avalon.Array.ensure(l,t)}),a||l.push("string"),e.param=l.join("-"),e.bound=function(t,n){o.addEventListener?o.addEventListener(t,n,!1):o.attachEvent("on"+t,n);var r=e.rollback;e.rollback=function(){o.avalonSetter=null,avalon.unbind(o,t,n),r&&r()}};for(var c in avalon.vmodels){var u=avalon.vmodels[c];u.$fire("avalon-ms-duplex-init",e)}var f=e.pipe||(e.pipe=lt);f(null,e,"init");var p=o.tagName;ea[p]&&ea[p](o,e.evaluator.apply(null,e.args),e)}};avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:ot},"boolean":{get:function(e){return"true"===e},set:ot},number:{get:function(e,t){var n=parseFloat(e);if(-e===-n)return n;var r=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(r[0]){case"strong":return 0;case"medium":return""===e?"":0;case"weak":return e}},set:ot}};var ta,na=[];avalon.tick=function(e){1===na.push(e)&&(ta=setInterval(st,60))};var ra=r,aa=/text|password|hidden/;!new function(){function e(e){if(avalon.contains(Rt,this)){if(t[this.tagName].call(this,e),!aa.test(this.type))return;!this.msFocus&&this.avalonSetter&&this.avalonSetter()}}try{var t={},n=HTMLInputElement.prototype,r=HTMLTextAreaElement.prototype,a=HTMLInputElement.prototype;Object.getOwnPropertyNames(a),t.INPUT=Object.getOwnPropertyDescriptor(n,"value").set,Object.defineProperty(n,"value",{set:e}),t.TEXTAREA=Object.getOwnPropertyDescriptor(r,"value").set,Object.defineProperty(r,"value",{set:e})}catch(i){ra=avalon.tick}},zt&&avalon.bind($t,"selectionchange",function(){var e=$t.activeElement;e&&"function"==typeof e.avalonSetter&&e.avalonSetter()}),ea.INPUT=function(e,t,r){function a(e){r.changed.call(this,e,r)}function i(){f=!0}function o(){f=!1}function l(e){setTimeout(function(){p(e)})}var s=e.type,c=r.bound,u=avalon(e),f=!1,p=function(){if(!f){var n=e.oldValue=e.value,i=r.pipe(n,r,"get");u.data("duplex-observe")!==!1&&(t(i),a.call(e,i),u.data("duplex-focus")&&avalon.nextTick(function(){e.focus()}))}};if(r.handler=function(){var n=r.pipe(t(),r,"set")+"";n!==e.oldValue&&(e.value=n)},r.isChecked||"radio"===s){var d=6===zt;p=function(){if(u.data("duplex-observe")!==!1){var n=r.pipe(e.value,r,"get");t(n),a.call(e,n)}},r.handler=function(){var n=t(),a=r.isChecked?!!n:n+""===e.value;e.oldValue=a,d?setTimeout(function(){e.defaultChecked=a,e.checked=a},31):e.checked=a},c("click",p)}else if("checkbox"===s)p=function(){if(u.data("duplex-observe")!==!1){var i=e.checked?"ensure":"remove",o=t();Array.isArray(o)||(n("ms-duplex应用于checkbox上要对应一个数组"),o=[o]),avalon.Array[i](o,r.pipe(e.value,r,"get")),a.call(e,o)}},r.handler=function(){var n=[].concat(t());e.checked=n.indexOf(r.pipe(e.value,r,"get"))>-1},c(It?"change":"click",p);else{var v=e.getAttribute("data-duplex-event")||"input";e.attributes["data-event"]&&n("data-event指令已经废弃,请改用data-duplex-event"),v.replace(_t,function(e){switch(e){case"input":zt?(zt>8?c("input",p):c("propertychange",function(e){"value"===e.propertyName&&p()}),c("dragend",l)):(c("input",p),c("compositionstart",i),c("compositionend",o),c("DOMAutoComplete",p));break;default:c(e,p)}}),c("focus",function(){e.msFocus=!0}),c("blur",function(){e.msFocus=!1}),aa.test(s)&&ra(function(){if(Rt.contains(e))e.msFocus||e.oldValue===e.value||p();else if(!e.msRetain)return!1}),e.avalonSetter=p}e.oldValue=e.value,A(r),a.call(e,e.value)},ea.TEXTAREA=ea.INPUT,ea.SELECT=function(e,t,r){function a(){if(i.data("duplex-observe")!==!1){var n=i.val();n=Array.isArray(n)?n.map(function(e){return r.pipe(e,r,"get")}):r.pipe(n,r,"get"),n+""!==e.oldValue&&t(n),r.changed.call(e,n,r)}}var i=avalon(e);r.handler=function(){var r=t();r=r&&r.$model||r,Array.isArray(r)?e.multiple||n("ms-duplex在不能对应一个数组"),r=Array.isArray(r)?r.map(String):r+"",r+""!==e.oldValue&&(i.val(r),e.oldValue=r+"")},r.bound("change",a),H(e,function(){A(r),r.changed.call(e,t(),r)},0/0)},Zt.html=function(e,t,n){e=null==e?"":e;var r="group"in n,a=r?t.parentNode:t;if(a){if(11===e.nodeType)var i=e;else if(1===e.nodeType||e.item){var o=1===e.nodeType?e.childNodes:e.item?e:[];for(i=Vt.cloneNode(!0);o[0];)i.appendChild(o[0])}else i=avalon.parseHTML(e);var l=$t.createComment("ms-html");if(r){a.insertBefore(l,t);for(var s=n.group,c=1;s>c;){var u=t.nextSibling;u&&(a.removeChild(u),c++)}a.removeChild(t),n.element=l}else avalon.clearHTML(a).appendChild(l);r&&(n.group=i.childNodes.length||1),o=avalon.slice(i.childNodes),o[0]&&(l.parentNode&&l.parentNode.replaceChild(i,l),r&&(n.element=o[0])),R(o,n.vmodels)}},Jt["if"]=Jt.data=Jt.text=Jt.html=function(e,t){at(e.value,t,e)},Zt["if"]=function(e,t,n){if(e)8===t.nodeType&&(t.parentNode.replaceChild(n.template,t),t=n.element=n.template),t.getAttribute(n.name)&&(t.removeAttribute(n.name),B(t,n.vmodels)),n.rollback=null;else if(1===t.nodeType){var r=n.element=$t.createComment("ms-if");t.parentNode.replaceChild(r,t),n.template=t,Ct.appendChild(t),n.rollback=function(){t.parentNode===Ct&&Ct.removeChild(t)}}};var ia=/\(([^)]*)\)/;Jt.on=function(e,t){var n=e.value;e.type="on";var r=e.param.replace(/-\d+$/,"");if("function"==typeof Jt.on[r+"Hook"]&&Jt.on[r+"Hook"](e),n.indexOf("(")>0&&n.indexOf(")")>-1){var a=(n.match(ia)||["",""])[1].trim();(""===a||"$event"===a)&&(n=n.replace(ia,""))}at(n,t,e)},Zt.on=function(e,t,n){e=function(e){var t=n.evaluator||r;return t.apply(this,n.args.concat(e))};var a=n.param.replace(/-\d+$/,"");if("scan"===a)e.call(t,{type:a});else if("function"==typeof n.specialBind)n.specialBind(t,e);else var i=avalon.bind(t,a,e);n.rollback=function(){"function"==typeof n.specialUnbind?n.specialUnbind():avalon.unbind(t,a,i)}},Jt.repeat=function(e,t){var n=e.type;at(e.value,t,e,0,1),e.proxies=[];var r=!1;try{var a=e.$repeat=e.evaluator.apply(0,e.args||[]),i=avalon.type(a);"object"!==i&&"array"!==i&&(r=!0,avalon.log("warning:"+e.value+"只能是对象或数组"))}catch(o){r=!0}var l=e.value.split(".")||[];if(l.length>1){l.pop();for(var s,c=l[0],u=0;s=t[u++];)if(s&&s.hasOwnProperty(c)){var f=s[c].$events||{};f[At]=f[At]||[],f[At].push(e);break}}var p=e.element;p.removeAttribute(e.name),e.sortedCallback=qn(p,"data-with-sorted",t),e.renderedCallback=qn(p,"data-"+n+"-rendered",t);var d=qt(n),v=e.element=$t.createComment(d+":end");if(e.clone=$t.createComment(d),Vt.appendChild(v),"each"===n||"with"===n?(e.template=p.innerHTML.trim(),avalon.clearHTML(p).appendChild(v)):(e.template=p.outerHTML.trim(),p.parentNode.replaceChild(v,p)),e.template=avalon.parseHTML(e.template),e.rollback=function(){var t=e.element;if(t){Zt.repeat.call(e,"clear");var n=t.parentNode,r=e.template,a=r.firstChild;n.replaceChild(r,t);var i=e.$stamp;i&&i.parentNode&&i.parentNode.removeChild(i),a=e.element="repeat"===e.type?a:n}},!r){e.handler=Zt.repeat,e.$outer={};var h="$key",m="$val";for(Array.isArray(a)&&(h="$first",m="$last"),u=0;s=t[u++];)if(s.hasOwnProperty(h)&&s.hasOwnProperty(m)){e.$outer=s;break}var g=a.$events,y=(g||{})[At];if(y&&avalon.Array.ensure(y,e)&&M(e,y),"object"===i){e.$with=!0;var b=g?g.$withProxyPool||(g.$withProxyPool={}):{};e.handler("append",a,b)}else a.length&&e.handler("add",0,a.length)}},Zt.repeat=function(e,t,n){if(e){var a=this,i=a.element,o=i.parentNode,l=a.proxies,s=Vt.cloneNode(!1);switch(e){case"add":for(var c,u=t+n,f=a.$repeat,p=f.length-1,d=[],v=ut(a,t),h=t;u>h;h++){var m=dt(h,a);l.splice(h,0,m),ct(a,s,m,d)}for(o.insertBefore(s,v),h=0;c=d[h++];)R(c.nodes,c.vmodels),c.nodes=c.vmodels=null;break;case"del":v=l[t].$stamp,i=ut(a,t+n),ft(v,i);var g=l.splice(t,n);mt(g,"each");break;case"clear":var y=a.$stamp||l[0];y&&(v=y.$stamp||y,ft(v,i)),mt(l,"each");break;case"move":v=l[0].$stamp;var b,x=v.nodeValue,$=[],w=[];for(ft(v,i,function(){w.unshift(this),this.nodeValue===x&&($.unshift(w),w=[])}),E(l,t),E($,t);w=$.shift();)for(;b=w.shift();)s.appendChild(b);o.insertBefore(s,i);break;case"index":for(p=l.length-1;n=l[t];t++)n.$index=t,n.$first=0===t,n.$last=t===p;return;case"set":return m=l[t],void(m&&S(m.$events.$index));case"append":var C=n,T=[];d=[];for(var A in t)t.hasOwnProperty(A)&&"hasOwnProperty"!==A&&T.push(A);if(a.sortedCallback){var k=a.sortedCallback.call(o,T);k&&Array.isArray(k)&&k.length&&(T=k)}for(h=0;A=T[h++];)"hasOwnProperty"!==A&&(C[A]||(C[A]=ht(A,a)),ct(a,s,C[A],d));var M=a.$stamp=a.clone;for(o.insertBefore(M,i),o.insertBefore(s,i),h=0;c=d[h++];)R(c.nodes,c.vmodels),c.nodes=c.vmodels=null}"clear"===e&&(e="del");var O=a.renderedCallback||r,_=arguments;H(o,function(){O.apply(o,_),o.oldValue&&"SELECT"===o.tagName&&avalon(o).val(o.oldValue.split(","))},0/0)}},"with,each".replace(_t,function(e){Jt[e]=Jt.repeat});var oa=[],la=[];Zt.text=function(e,t){if(e=null==e?"":e,3===t.nodeType)try{t.data=e}catch(n){}else"textContent"in t?t.textContent=e:t.innerText=e},avalon.parseDisplay=gt,Jt.visible=function(e,t){var n=avalon(e.element),r=n.css("display");if("none"===r){var a=n[0].style,i=/visibility/i.test(a.cssText),o=n.css("visibility");a.display="",a.visibility="hidden",r=n.css("display"),"none"===r&&(r=gt(n[0].nodeName)),a.visibility=i?o:""}e.display=r,at(e.value,t,e)},Zt.visible=function(e,t,n){t.style.display=e?n.display:"none"},Jt.widget=function(t,n){var a=t.value.match(_t),i=t.element,o=a[0],l=a[1];l&&"$"!==l||(l=qt(o));var s=a[2]||o,c=avalon.ui[o];if("function"==typeof c){n=i.vmodels||n;for(var u,f=0;u=n[f++];)if(u.hasOwnProperty(s)&&"object"==typeof u[s]){var p=u[s];p=p.$model||p;break}if(p){var d=p[o+"Id"];"string"==typeof d&&(l=d)}var v=avalon.getWidgetData(i,o);t.value=[o,l,s].join(","),t[o+"Id"]=l,t.evaluator=r,i.msData["ms-widget-id"]=l;var h=t[o+"Options"]=avalon.mix({},c.defaults,p||{},v);i.removeAttribute("ms-widget");var m=c(i,t,n)||{};m.$id?(avalon.vmodels[l]=m,P(i,m),m.hasOwnProperty("$init")&&m.$init(function(){avalon.scan(i,[m].concat(n)),"function"==typeof h.onInit&&h.onInit.call(i,m,h,n)}),t.rollback=function(){try{m.widgetElement=null,m.$remove()}catch(e){}i.msData={},delete avalon.vmodels[m.$id]},M(t,sa),e.chrome&&i.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(N)})):avalon.scan(i,n)}else n.length&&(i.vmodels=n)};var sa=[],ca=/]*>([\S\s]*?)<\/script\s*>/gim,ua=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,fa=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,pa={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},da=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,va=/([^\#-~| |!])/g,ha=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n=void 0===n?"...":n,e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;n>t;t++){var r=arguments[t],a=avalon.filters[r.shift()];if("function"==typeof a){var i=[e].concat(r);e=a.apply(null,i)}}return e},camelize:Y,sanitize:function(e){return e.replace(ca,"").replace(fa,function(e){var t=e.toLowerCase().match(/<(\w+)\s/);if(t){var n=pa[t[1]];n&&(e=e.replace(n,function(e,t,n){var r=n.charAt(0);return t+"="+r+"javascript:void(0)"+r}))}return e.replace(ua," ").replace(/\s+/g," ")})},escape:function(e){return String(e).replace(/&/g,"&").replace(da,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(va,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")},currency:function(e,t,n){return(t||"¥")+yt(e,isFinite(n)?n:2)},number:yt};!new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var r="";for(0>e&&(r="-",e=-e),e=""+e;e.length0||o>-r)&&(o+=r),0===o&&-12===r&&(o=12),t(o,n,a)}}function r(e,t){return function(n,r){var a=n["get"+e](),i=(t?"SHORT"+e:e).toUpperCase();return r[i][a]}}function a(e){var n=-1*e.getTimezoneOffset(),r=n>=0?"+":"";return r+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2)}function i(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:r("Month"),MMM:r("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:r("Day"),EEE:r("Day",!0),a:i,Z:a},l=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,s=/^\/Date\((\d+)\)\/$/;ha.date=function(t,n){var r,a,i=ha.date.locate,c="",u=[];if(n=n||"mediumDate",n=i[n]||n,"string"==typeof t)if(/^\d+$/.test(t))t=e(t);else if(s.test(t))t=+RegExp.$1;else{var f=t.trim(),p=[0,0,0,0,0,0,0],d=new Date(0);f=f.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,r,a){var i=4===a.length?[a,n,r]:[n,r,a];return p[0]=e(i[0]),p[1]=e(i[1])-1,p[2]=e(i[2]),""});var v=d.setFullYear,h=d.setHours;f=f.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,r,a,i){return p[3]=e(n),p[4]=e(r),p[5]=e(a),i&&(p[6]=Math.round(1e3*parseFloat("0."+i))),""});var m=0,g=0;f=f.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,r,a){return v=d.setUTCFullYear,h=d.setUTCHours,n&&(m=e(n+r),g=e(n+a)),""}),p[3]-=m,p[4]-=g,v.apply(d,p.slice(0,3)),h.apply(d,p.slice(3)),t=d}if("number"==typeof t&&(t=new Date(t)),"date"===avalon.type(t)){for(;n;)a=l.exec(n),a?(u=u.concat(a.slice(1)),n=u.pop()):(u.push(n),n=null);return u.forEach(function(e){r=o[e],c+=r?r(t,i):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}};var c={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"}; c.SHORTMONTH=c.MONTH,ha.date.locate=c};var ma=avalon.modules={"domReady!":{exports:avalon,state:3},avalon:{exports:avalon,state:4}};ma.exports=ma.avalon,new function(){function t(e,t){var r="js";e=e.replace(/^(\w+)\!/,function(e,t){return r=t,""}),"ready"===r&&(n("debug: ready!已经被废弃,请使用domReady!"),r="domReady");var a="";e=e.replace(P,function(e){return a=e,""});var i="."+r,o=/js|css/.test(i)?i:"";e=e.replace(/\.[a-z0-9]+$/g,function(e){return e===i?(o=e,""):e});var l=avalon.mix({query:a,ext:o,res:r,name:e,toUrl:m},t);return l.toUrl(e),l}function i(e){var t=e.name,n=e.res,r=ma[t],a=t&&e.urlNoQuery;if(r&&r.state>=1)return t;if(r=ma[a],r&&r.state>=3)return Tt(r.deps||[],r.factory,a),a;if(t&&!r){r=ma[a]={id:a,state:1};var i=function(a){H[n]=a,a.load(t,e,function(e){arguments.length&&void 0!==e&&(r.exports=e),r.state=4,s()})};H[n]?i(H[n]):Tt([n],i)}return t?a:n+"!"}function o(e,t){for(var n,r=0;n=e[r++];)if(4!==ma[n].state&&(n===t||o(ma[n].deps,t)))return!0}function l(e,t,r){var a=u(e.src);return e.onload=e.onreadystatechange=e.onerror=null,t||r&&ma[a]&&!ma[a].state?(setTimeout(function(){wt.removeChild(e),e=null}),void n("debug: 加载 "+a+" 失败"+t+" "+!ma[a].state)):!0}function s(){e:for(var e,t=E.length;e=E[--t];){var n=ma[e],r=n.deps;if(r){for(var a,i=0;a=r[i];i++)if(4!==Object(ma[a]).state)continue e;4!==n.state&&(E.splice(t,1),v(n.id,n.deps,n.factory),s())}}}function c(e,t,r){function a(){if(!"1"[0]&&!o)return o=setTimeout(a,150);if(c||j.test(i.readyState)){clearTimeout(o);var u=A.pop();u&&u.require(t),r&&r(),l(i,!1,!c)&&(n("debug: 已成功加载 "+e),t&&E.push(t),s())}}var i=$t.createElement("script");i.className=At;var o,c="onload"in i,u=c?"onload":"onreadystatechange";i[u]=a,i.onerror=function(){l(i,!0)},wt.insertBefore(i,wt.firstChild),i.src=e,n("debug: 正准备加载 "+e)}function u(e){return(e||"").replace(P,"")}function f(e){return/^(?:[a-z]+:)?\/\//i.test(String(e))}function p(e,t){return"1"[0]?e[t]:e.getAttribute(t,4)}function d(){var t;try{a.b.c()}catch(n){t=n.stack,!t&&e.opera&&(t=(String(n).match(/of linked script \S+/g)||[]).join(" "))}if(t)return t=t.split(/[@ ]/g).pop(),t="("===t[0]?t.slice(1,-1):t.replace(/\s/,""),u(t.replace(/(:\d+)?:\d+$/i,""));for(var r,i=wt.getElementsByTagName("script"),o=i.length;r=i[--o];)if(r.className===At&&"interactive"===r.readyState){var l=p(r,"src");return r.className=u(l)}}function v(t,r,a){var i=Object(ma[t]);i.state=4;for(var o,l=0,s=[];o=r[l++];)if("exports"===o){var c=i.exports||(i.exports={});s.push(c)}else s.push(ma[o].exports);try{var u=a.apply(e,s)}catch(f){n("执行["+t+"]模块的factory抛错: "+f)}return void 0!==u&&(i.exports=u),D.test(t)&&delete ma[t],delete i.factory,u}function m(e){0===e.indexOf(this.res+"!")&&(e=e.slice(this.res.length+1));var t=e,n=0,r=this.baseUrl,a=this.parentUrl||r;$(e,h.paths,function(e,r){t=t.replace(r,e),n=1}),n||$(e,h.packages,function(e,n,r){t=t.replace(r.name,r.location)}),this.mapUrl&&$(this.mapUrl,h.map,function(e){$(t,e,function(e,n){t=t.replace(n,e),a=r})});var i=this.ext;i&&n&&t.slice(-i.length)===i&&(t=t.slice(0,-i.length)),f(t)||(a=this.built||/^\w/.test(t)?r:a,t=C(a,t));var o=t+i;return t=o+this.query,$(e,h.urlArgs,function(e){t+=(-1===t.indexOf("?")?"?":"&")+e}),this.url=t,this.urlNoQuery=o}function g(e,t,n){var r=x(e,t,n);return r.sort(w),r}function y(e){return new RegExp("^"+e+"(/|$)")}function b(t){return function(){var n;return t.init&&(n=t.init.apply(e,arguments)),n||t.exports&&T(t.exports)}}function x(e,t,n){var r=[];for(var a in e)if(Ht.call(e,a)){var i={name:a,val:e[a]};r.push(i),i.reg="*"===a&&t?/^/:y(a),n&&"*"!==a&&(i.reg=new RegExp("/"+a.replace(/^\//,"")+"(/|$)"))}return r}function $(e,t,n){t=t||[];for(var r,a=0;r=t[a++];)if(r.reg.test(e))return n(r.val,r.name,r),!1}function w(e,t){var n=e.name,r=t.name;return"*"===r?-1:"*"===n?1:r.length-n.length}function C(e,t){if("/"!==e.charAt(e.length-1)&&(e+="/"),"./"===t.slice(0,2))return e+t.slice(2);if(".."===t.slice(0,2)){for(e+=t;F.test(e);)e=e.replace(F,"");return e}return"/"===t.slice(0,1)?e+t.slice(1):e+t}function T(t){if(!t)return t;var n=e;return t.split(".").forEach(function(e){n=n[e]}),n}var E=[],A=[],k=/\.js$/i,M=[],O=!1;Tt=avalon.require=function(e,n,a,o){if(O){Array.isArray(e)||avalon.error("require方法的第一个参数应为数组 "+e);var l=[],c={},u=a||"callback"+setTimeout("1");o=o||{},o.baseUrl=h.baseUrl;var f=!!o.built;if(a&&(o.parentUrl=a.substr(0,a.lastIndexOf("/")),o.mapUrl=a.replace(k,"")),f){var p=t(o.defineName,o);u=p.urlNoQuery}else e.forEach(function(e){var n=t(e,o),r=i(n);r&&(c[r]||(l.push(r),c[r]="司徒正美"))});var d=ma[u];d&&4===d.state||(ma[u]={id:u,deps:f?e.concat():l,factory:n||r,state:3}),d||E.push(u),s()}else if(M.push(avalon.slice(arguments)),arguments.length<=2){O=!0;for(var v,m=M.splice(0,M.length);v=m.shift();)Tt.apply(null,v)}},Tt.define=function(e,t,n){"string"!=typeof e&&(n=t,t=e,e="anonymous"),Array.isArray(t)||(n=t,t=[]);var r={built:!O,defineName:e},a=[t,n,r];n.require=function(e){if(a.splice(2,0,e),ma[e]){ma[e].state=3;var t=!1;try{t=o(ma[e].deps,e)}catch(r){}t&&avalon.error(e+"模块与之前的模块存在循环依赖,请不要直接用script标签引入"+e+"模块")}delete n.require,Tt.apply(null,a)};var i=r.built?"unknown":d();if(i){var l=ma[i];l&&(l.state=2),n.require(i)}else A.push(n)},Tt.config=h,Tt.define.amd=ma;var _=h["orig.paths"]={},N=h["orig.map"]={},S=h.packages=[],L=h["orig.args"]={};avalon.mix(gn,{paths:function(e){avalon.mix(_,e),h.paths=g(_)},map:function(e){avalon.mix(N,e);var t=g(N,1,1);avalon.each(t,function(e,t){t.val=g(t.val)}),h.map=t},packages:function(e){e=e.concat(S);for(var t,n={},r=[],a=0;t=e[a++];){t="string"==typeof t?{name:t}:t;var i=t.name;if(!n[i]){var o=t.location?t.location:C(i,t.main||"main");o=o.replace(k,""),r.push(t),n[i]=t.location=o,t.reg=y(i)}}h.packages=r.sort()},urlArgs:function(e){"string"==typeof e&&(e={"*":e}),avalon.mix(L,e),h.urlArgs=g(L,1)},baseUrl:function(e){if(!f(e)){var t=wt.getElementsByTagName("base")[0];t&&wt.removeChild(t);var n=$t.createElement("a");n.href=e,e=p(n,"href"),t&&wt.insertBefore(t,wt.firstChild)}e.length>3&&(h.baseUrl=e)},shim:function(e){for(var t in e){var n=e[t];Array.isArray(n)&&(n=e[t]={deps:n}),n.exportsFn||!n.exports&&!n.init||(n.exportsFn=b(n))}h.shim=e}});var j=$t.documentMode>=8?/loaded/:/complete|loaded/,H=Tt.plugins={ready:{load:r},js:{load:function(e,t,n){var r=t.url,a=t.urlNoQuery,i=h.shim[e.replace(k,"")];i?Tt(i.deps||[],function(){var e=avalon.slice(arguments);c(r,a,function(){n(i.exportsFn?i.exportsFn.apply(0,e):void 0)})}):c(r,a)}},css:{load:function(e,t,r){var a=t.url,i=$t.createElement("link");i.rel="stylesheet",i.href=a,wt.insertBefore(i,wt.firstChild),n("debug: 已成功加载 "+a),r()}},text:{load:function(e,t,r){var a=t.url,i=Qr();i.onreadystatechange=function(){if(4===i.readyState){var e=i.status;e>399&&600>e?avalon.error(a+" 对应资源不存在或没有开启 CORS"):(n("debug: 已成功加载 "+a),r(i.responseText))}},i.open("GET",a,!0),"withCredentials"in i&&(i.withCredentials=!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),n("debug: 正准备加载 "+a)}}};Tt.checkDeps=s;var P=/(\?[^#]*)$/,D=/^callback\d+$/,F=/\/\w+\/\.\./,B=$t.scripts[$t.scripts.length-1],I=B.getAttribute("data-main");if(I){gn.baseUrl(I);var R=h.baseUrl;h.baseUrl=R.slice(0,R.lastIndexOf("/")+1),c(R.replace(k,"")+".js")}else{var V=u(p(B,"src"));h.baseUrl=V.slice(0,V.lastIndexOf("/")+1)}};var ga,ya=[],ba=function(e){for(ga=!0,Tt&&(ma["domReady!"].state=4,Tt.checkDeps());e=ya.shift();)e(avalon)};if("complete"===$t.readyState)setTimeout(ba);else if(It)$t.addEventListener("DOMContentLoaded",ba);else{$t.attachEvent("onreadystatechange",function(){"complete"===$t.readyState&&ba()});try{var xa=null===e.frameElement}catch(kn){}Rt.doScroll&&xa&&e.external&&bt()}avalon.bind(e,"load",ba),avalon.ready=function(e){ga?e(avalon):ya.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan($t.body)}),"function"==typeof define&&define.amd&&define("avalon",[],function(){return avalon});var $a=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=$a),avalon},void 0===t&&(e.avalon=avalon),avalon});