forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
avalon.min.js
126 lines (126 loc) · 63.6 KB
/
avalon.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
(function(p){function y(){}function v(){r.console&&avalon.config.debug&&Function.apply.call(console.log,console,arguments)}function M(b,c){"string"===typeof b&&(b=b.match(z)||[]);for(var d={},e=void 0!==c?c:1,f=0,g=b.length;f<g;f++)d[b[f]]=e;return d}function ha(){return"avalon"+Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ya(b){return Vb.test(ia.call(b))}function ra(b,c){b=Math.floor(b)||0;return 0>b?Math.max(c+b,0):Math.min(b,c)}function Wb(b,c,
d){if(V(c)||c&&c.nodeType||-1!==d.indexOf(b)||-1!==sa.indexOf(b))return!1;c=d.$special;return b&&"$"===b.charAt(0)&&!c[b]?!1:!0}function N(b,c,d){if(Array.isArray(b)){var e=b.concat();b.length=0;c=Xb(b);c.pushArray(e);return c}if("number"===typeof b.nodeType||b.$id&&b.$model&&b.$events)return b;Array.isArray(b.$skipArray)||(b.$skipArray=[]);b.$skipArray.$special=c||{};var f={};d=d||{};var g={},h={},l=[];for(e in b)(function(c,e){d[c]=e;if(Wb(c,e,b.$skipArray)){var k,t=avalon.type(e);g[c]=[];if("object"===
t&&V(e.get)&&2>=Object.keys(e).length){var H=e.set,F=e.get;k=function(b){var e=f.$events,g=d[c];if(arguments.length){if(ja)return;if(V(H)){var h=e[c];e[c]=[];H.call(f,b);e[c]=h}}else avalon.openComputedCollect&&ka(e[c]);b=d[c]=F.call(f);if(!la(g,b)){if(ma&&(h=W[f.$id])&&h[c])h[c].$val=b;ua(e[c]);f.$events&&R.$fire.call(f,c,b,g)}return b};l.push(function(){Y[A]={evaluator:k,element:J,type:"computed::"+c,handler:y,args:[]};k();ka(g[c]);delete Y[A]})}else va.test(t)?(k=function(b){var e=k.child,h=d[c];
if(arguments.length)!ja&&!la(h,b)&&(e=k.child=Yb(f,c,b,t),b=d[c]=e.$model,(e=wa[e.$id])&&e(),f.$events&&R.$fire.call(f,c,b,h));else return ka(g[c]),e},(k.child=N(e,0,d[c])).$events[G]=g[c]):k=function(b){var e=d[c];if(arguments.length){if(!la(e,b)){d[c]=b;if(ma){var h=W[f.$id];h&&h[c]&&(h[c].$val=b)}ua(g[c]);f.$events&&R.$fire.call(f,c,b,e)}}else return ka(g[c]),e};h[c]=k}})(e,b[e]);sa.forEach(function(c){delete b[c];delete d[c]});var f=na(f,Zb(h),b),k;for(k in b)h[k]||(f[k]=b[k]);f.$id=ha();f.$model=
d;f.$events=g;for(e in R)c=R[e],w||(c=c.bind(f)),f[e]=c;f.hasOwnProperty=function(b){return b in f.$model};l.forEach(function(b){b()});return f}function Yb(b,c,d,e){var f=b[c];if("array"===e){if(!Array.isArray(d)||f===d)return f;f.clear();f.pushArray(d.concat());return f}var g=b.$events[c];W[f.$id]&&(ma--,delete W[f.$id]);var h=N(d);h.$events[G]=g;wa[h.$id]=function(b){for(;b=g.shift();)(function(b){b.type&&avalon.nextTick(function(){b.rollback&&b.rollback();C[b.type](b,b.vmodels)})})(b);delete wa[h.$id]};
return h}function Z(b,c,d){b="for(var "+b+"i=0,n = this.length; i < n; i++){"+c.replace("_","((i in this) && fn.call(scope,this[i],i,this))")+"}"+d;return Function("fn,scope",b)}function Za(b,c){try{for(;c=c.parentNode;)if(c===b)return!0;return!1}catch(d){return!1}}function $a(){return(new XMLSerializer).serializeToString(this)}function u(b){for(var c in b)if(O.call(b,c)){var d=b[c];if("function"===typeof u.plugins[c])u.plugins[c](d);else"object"===typeof u[c]?avalon.mix(u[c],d):u[c]=d}return this}
function ab(b){return b.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function oa(b){return 0>b.indexOf("-")&&0>b.indexOf("_")?b:b.replace(/[-_][^-_]/g,function(b){return b.charAt(1).toUpperCase()})}function bb(b){if(!("classList"in b)){b.classList={node:b};for(var c in cb)b.classList[c.slice(1)]=cb[c]}return b.classList}function db(b){try{b="true"===b?!0:"false"===b?!1:"null"===b?null:+b+""===b?+b:$b.test(b)?avalon.parseJSON(b):b}catch(c){}return b}function eb(b,c){if(0>=b.offsetWidth){if(ac.test(x["@:get"](b,
"display"))){var d={node:b},e;for(e in fb)d[e]=b.style[e],b.style[e]=fb[e];c.push(d)}(d=b.parentNode)&&1===d.nodeType&&eb(d,c)}}function gb(b){var c=b.nodeName;return c.toLowerCase()===c&&b.scopeName&&""===b.outerText}function bc(b){"url(#default#VML)"!==b.currentStyle.behavior&&(b.style.behavior="url(#default#VML)",b.style.display="inline-block",b.style.zoom=1)}function xa(b){Y[A]=b;avalon.openComputedCollect=!0;var c=b.evaluator;if(c)try{var d=cc.test(b.type)?b:c.apply(0,b.args);b.handler(d,b.element,
b)}catch(e){v("warning:exception throwed in [registerSubscriber] "+e),delete b.evaluator,c=b.element,3===c.nodeType&&(d=c.parentNode,u.commentInterpolate?d.replaceChild(p.createComment(b.value),c):c.data=P+b.value+Q)}avalon.openComputedCollect=!1;delete Y[A]}function ka(b){var c=Y[A];b&&(c&&avalon.Array.ensure(b,c)&&c.element)&&hb(c,b)}function hb(b,c){b.$uuid=b.$uuid||ha();c.$uuid=c.$uuid||ha();var d={data:b,list:c,toString:function(){return b.$uuid+" "+c.$uuid}};S[d]||(S[d]=1,S.push(d))}function ib(){for(var b=
ya,c=ya+dc;b<c;b++){var d=S[b];if(!d)break;var e=d.data,f=e.element;if(null===f||(1===f.nodeType?"number"===typeof f.sourceIndex?0===f.sourceIndex:!B.contains(f):!avalon.contains(B,f))){S.splice(b,1);delete S[d];avalon.Array.remove(d.list,e);"if"===e.type&&(e.template&&e.template.parentNode===pa)&&pa.removeChild(e.template);for(var g in e)e[g]=null;d.data=d.list=null;b--;c--}}ya=(d=S[b])?c:0;jb=new Date}function ua(b){clearTimeout(kb);444<new Date-jb?ib():kb=setTimeout(ib,444);if(b&&b.length)for(var c=
$.call(arguments,1),d=b.length,e;e=b[--d];){var f=e.element;f&&f.parentNode&&(e.$repeat?e.handler.apply(e,c):"on"!==e.type&&e.handler((e.evaluator||y).apply(0,e.args||[]),f,e))}}function qa(b,c,d){var e=setTimeout(function(){var f=b.innerHTML;clearTimeout(e);f===d?c():qa(b,c,f)})}function lb(b,c,d){var e=b.getAttribute("ms-skip");if(!b.getAttributeNode)return v("warning "+b.tagName+" no getAttributeNode method");var f=b.getAttributeNode("ms-important");d=b.getAttributeNode("ms-controller");if("string"!==
typeof e){if(d=f||d){e=za[d.value];if(!e)return;var g=c.cb;c=d===f?[e]:[e].concat(c);c.cb=g;f=d.name;b.removeAttribute(f);mb(b,e);avalon(b).removeClass(f)}nb(b,c)}}function mb(b,c){var d=b.getAttribute("avalonctrl")||c.$id;b.setAttribute("avalonctrl",d);c.$events.expr=b.tagName+'[avalonctrl="'+d+'"]'}function ob(b,c){for(var d=b.firstChild;d;){var e=d.nextSibling;pb(d,d.nodeType,c);d=e}}function Aa(b,c){for(var d=0,e;e=b[d++];)pb(e,e.nodeType,c)}function pb(b,c,d){1===c?lb(b,d):3===c&&aa.test(b.data)?
qb(b,d):u.commentInterpolate&&(8===c&&!aa.test(b.nodeValue))&&qb(b,d)}function qb(b,c){var d=[];if(8===b.nodeType){var e=[],f={expr:!0,value:rb(b.nodeValue,e)};e.length&&(f.filters=e);e=[f]}else e=Ba(b.data);if(e.length){for(var g=0;f=e[g++];){var h=p.createTextNode(f.value);if(f.expr){var l=f.filters,f={type:"text",element:h,value:f.value,filters:l};l&&-1!==l.indexOf("html")&&(avalon.Array.remove(l,"html"),f.type="html",f.group=1,l.length||delete d.filters);d.push(f)}I.appendChild(h)}b.parentNode.replaceChild(I,
b);d.length&&Ca(d,c)}}function ec(b,c){return b.priority-c.priority}function nb(b,c){for(var d=sb?sb(b):avalon.slice(b.attributes),e=[],f={},g,h=0,l;l=d[h++];)if(l.specified&&(g=l.name.match(tb))){var k=g[1],m=g[2]||"",n=l.value;l=l.name;f[l]=n;fc[k]?(m=k,k="on"):gc[k]&&(v("ms-"+k+"\u5df2\u7ecf\u88ab\u5e9f\u5f03,\u8bf7\u4f7f\u7528ms-attr-*\u4ee3\u66ff"),"enabled"===k&&(k="disabled",n="!("+n+")"),m=k,k="attr",b.removeAttribute(l),l="ms-attr-"+m,b.setAttribute(l,n),g=[l],f[l]=n);"function"===typeof C[k]&&
(n={type:k,param:m,element:b,name:g[0],value:n,priority:k in ub?ub[k]:10*k.charCodeAt(0)+(Number(m)||0)},"if"===k&&-1<m.indexOf("loop")&&(n.priority+=100),c.length&&(e.push(n),"widget"===k&&(b.msData=b.msData||f)))}e.sort(ec);f["ms-attr-checked"]&&f["ms-duplex"]&&v("warning!\u4e00\u4e2a\u5143\u7d20\u4e0a\u4e0d\u80fd\u540c\u65f6\u5b9a\u4e49ms-attr-checked\u4e0ems-duplex");d=e[0]||{};switch(d.type){case "if":case "repeat":case "widget":Ca([d],c);break;default:Ca(e,c),!hc[b.tagName]&&vb.test(b.innerHTML.replace(ic,
"<").replace(jc,">"))&&ob(b,c)}}function Ca(b,c){b.length&&c.cb(b.length);for(var d=0,e;e=b[d++];)e.vmodels=c,C[e.type](e,c),e.evaluator&&(e.element&&1===e.element.nodeType)&&e.element.removeAttribute(e.name);b.length=0}function rb(b,c){0<b.indexOf("|")&&(b=b.replace(kc,"U2hvcnRDaXJjdWl0"),b=b.replace(lc,function(b,e,f){c.push(e+(f||""));return""}),b=b.replace(mc,"||"));return b}function Ba(b){var c=[],d;d=0;var e;do{e=b.indexOf(P,d);if(-1===e)break;(d=b.slice(d,e))&&c.push({value:d,expr:!1});d=e+
P.length;e=b.indexOf(Q,d);if(-1===e)break;if(d=b.slice(d,e)){var f=[];d=rb(d,f);c.push({value:d,expr:!0,filters:f.length?f:void 0})}d=e+Q.length}while(1);(d=b.slice(d))&&c.push({value:d,expr:!1});return c}function nc(b,c,d,e){for(var f=[],g=" = "+d+".",h=b.length,l;l=b[--h];)c.hasOwnProperty(l)&&(f.push(l+g+l),e.vars.push(l),"duplex"===e.type&&(b.get=d+"."+l),b.splice(h,1));return f}function wb(b){for(var c=[],d={},e=0;e<b.length;e++){var f=b[e],g=f&&"string"===typeof f.$id?f.$id:f;d[g]||(d[g]=c.push(f))}return c}
function Da(b){function c(e,f){d.push(e)>b&&delete c[d.shift()];return c[e]=f}var d=[];return c}function xb(b,c,d){var e=d.type,f=d.filters?d.filters.join(""):"",g=c.map(function(b){return String(b.$id).replace(oc,"$1")})+b+e+f,h=pc(b).concat(),l=[],k=[],m=[],n="";c=wb(c);d.vars=[];for(var q=0,n=c.length;q<n;q++)if(h.length){var t="vm"+A+"_"+q;k.push(t);m.push(c[q]);l.push.apply(l,nc(h,c[q],t,d))}if(l.length||"duplex"!==e)if("duplex"!==e&&(-1<b.indexOf("||")||-1<b.indexOf("&&"))&&d.vars.forEach(function(c){b=
b.replace(RegExp("\\b"+c+"(?:\\.\\w+|\\[\\w+\\])+","ig"),function(b){var d=b.charAt(c.length),e=/^\s*\(/.test(RegExp.rightContext);if("."===d||"["===d||e){d="var"+String(Math.random()).replace(/^0\./,"");if(e)return e=b.split("."),2<e.length?(b=e.pop(),l.push(d+" = "+e.join(".")),d+"."+b):b;l.push(d+" = "+b);return d}return b})}),f&&m.push(avalon.filters),d.args=m,c=Ea[g])d.evaluator=c;else{(n=l.join(", "))&&(n="var "+n);if(f){b="\nvar ret"+A+" = "+b;e=[];e.push(b,"\r\n");for(q=0;h=d.filters[q++];)m=
h.indexOf("("),-1!==m?(f=h.slice(m+1,h.lastIndexOf(")")).trim(),f=","+f,h=h.slice(0,m).trim()):f="",e.push(" if(filters",A,".",h,"){\n\ttry{\nret",A," = filters",A,".",h,"(ret",A,f,")\n\t}catch(e){} \n}\n");b=e.join("");b+="\nreturn ret"+A;k.push("filters"+A)}else{if("duplex"===e){n="'use strict';\nreturn function(vvv){\n\t"+n+";\n\tif(!arguments.length){\n\t\treturn "+b+"\n\t}\n\t"+(!qc.test(b)?h.get:b)+"= vvv;\n} ";try{c=Function.apply(y,k.concat(n)),d.evaluator=Ea(g,c)}catch(H){v("debug: parse error,"+
H.message)}return}"on"===e?(b=-1===b.indexOf("(")?b+".call(this, $event)":b.replace("(",".call(this,"),k.push("$event"),b="\nreturn "+b+";",e=b.lastIndexOf("\nreturn"),q=b.slice(0,e),e=b.slice(e),b=q+"\n"+e):b="\nreturn "+b+";"}try{c=Function.apply(y,k.concat("'use strict';\n"+n+b)),d.evaluator=Ea(g,c)}catch(F){v("debug: parse error,"+F.message)}finally{h=e=k=null}}}function K(b,c,d,e,f){c.cb(-1);Array.isArray(e)&&(b=e.map(function(b){return b.expr?"("+b.value+")":rc(b.value)}).join(" + "));xb(b,
c,d);d.evaluator&&!f&&(d.handler=Fa[d.handlerName||d.type],xa(d))}function ba(b,c){var d="_"+b;if(!ba[d]){var e=p.createElement(b);B.appendChild(e);c=w?getComputedStyle(e,null).display:e.currentStyle.display;B.removeChild(e);ba[d]=c}return ba[d]}function Ga(b){return null==b?"":b}function sc(b,c,d,e){c.param.replace(/\w+/g,function(e){(e=avalon.duplexHooks[e])&&"function"===typeof e[d]&&(b=e[d](b,c))});return b}function yb(b){var c=arguments.length?b:this.value;if(!this.disabled&&this.oldValue!==
c)if(c=this.getAttribute("data-duplex-event")||"input",c=c.match(z).shift(),w){var d=p.createEvent("Events");d.initEvent(c,!0,!0);d.isTrusted=!1;this.dispatchEvent(d)}else try{this.fireEvent("on"+c)}catch(e){}}function tc(){for(var b=ca.length-1;0<=b;b--)!1===(0,ca[b])()&&ca.splice(b,1);ca.length||clearInterval(zb)}function uc(b){vc.call(this,b);yb.call(this,b)}function wc(b){var c={},d;for(d in b)c[d]=b[d];d=c.target=b.srcElement;0===b.type.indexOf("key")?c.which=null!=b.charCode?b.charCode:b.keyCode:
/mouse|click/.test(b.type)&&(d=d.ownerDocument||p,d="BackCompat"===d.compatMode?d.body:d.documentElement,c.pageX=b.clientX+(d.scrollLeft>>0)-(d.clientLeft>>0),c.pageY=b.clientY+(d.scrollTop>>0)-(d.clientTop>>0),c.wheelDeltaY=c.wheelDelta,c.wheelDeltaX=0);c.timeStamp=new Date-0;c.originalEvent=b;c.preventDefault=function(){b.returnValue=!1};c.stopPropagation=function(){b.cancelBubble=!0};return c}function Xb(b){var c=[];c.$id=ha();c.$model=b;c.$events={};c.$events[G]=[];c._=N({length:b.length});c._.$watch("length",
function(b,d){c.$fire("length",b,d)});for(var d in R)c[d]=R[d];avalon.mix(c,Ab);return c}function Bb(b,c,d,e){var f=avalon.parseHTML(b.template),g=avalon.slice(f.childNodes);c.appendChild(f);d.$outer=b.$outer;b=b.vmodels;d=[d].concat(b);d.cb=b.cb;e.push({nodes:g,vmodels:d})}function Ha(b,c){var d=b.endRepeat,e=[],f=b.element.nextSibling;if(f!==d){do if(f!==d)e.push(f);else break;while(f=f.nextSibling)}return e[b.group*c]||d}function Cb(b,c,d){c*=d||1;d=[b];for(var e=1,f=I;e<c;)(b=b.nextSibling)&&
(d[e++]=b);for(e=0;b=d[e++];)f.appendChild(b);return f}function Db(b){isFinite(b.group)||(b.group=(b.element.parentNode.childNodes.length-2)/("proxySize"in b?b.proxySize:b.proxies.length))}function xc(b,c,d){b=N({$key:b,$outer:d,$val:c},{$val:1,$key:1});b.$id=("$proxy$with"+Math.random()).replace(/0\./,"");return b}function yc(b,c,d,e){var f=d.param||"el",g;b={$remove:function(){return d.$repeat.removeAt(g.$index)},$itemName:f,$index:b,$outer:d.$outer,$first:0===b,$last:b===e};b[f]=c;e=0;for(var h=
da.length;e<h;e++)if(g=da[e],g.hasOwnProperty(f)&&avalon.type(g[f])===avalon.type(c)){for(var l in b)g[l]=b[l];da.splice(e,1);g.$watch(f,function(b){d.$repeat.set(g.$index,b)});return g}va.test(avalon.type(c))&&(b.$skipArray=[f]);g=N(b,zc);g.$watch(f,function(b){d.$repeat.set(g.$index,b)});g.$id=("$proxy$"+d.type+Math.random()).replace(/0\./,"");return g}function Eb(b){for(var c=0,d;d=b[c++];){var e=void 0;for(e in d.$events)Array.isArray(d.$events[e])&&(d.$events[e].length=0);da.unshift(d)>u.maxRepeatSize&&
da.pop()}b.length=0}function T(){p.body&&(D?(s["ready!"].state=2,D.checkDeps()):Fb.forEach(function(b){b(avalon)}),T=y)}function Gb(){try{B.doScroll("left"),T()}catch(b){setTimeout(Gb)}}var A=new Date-0,G="$"+A,r=Function("return this")(),Ac=r.require,Bc=r.define,ja=!1,z=/[^, ]+/g,Hb=/\[native code\]/,va=/^(?:object|array)$/,Ib=/^\[object SVG\w*Element\]$/,Vb=/^\[object (?:Window|DOMWindow|global)\]$/,Ia=Object.prototype,O=Ia.hasOwnProperty,ia=Ia.toString,L=Array.prototype,$=L.slice,Y={},w=r.dispatchEvent,
B=p.documentElement,J=p.getElementsByTagName("head")[0],I=p.createDocumentFragment(),ea=p.createElement("div"),Jb={};"Boolean Number String Function Array Date RegExp Object Error".replace(z,function(b){Jb["[object "+b+"]"]=b.toLowerCase()});avalon=function(b){return new avalon.init(b)};avalon.init=function(b){this[0]=this.element=b};avalon.fn=avalon.prototype=avalon.init.prototype;avalon.type=function(b){return null==b?String(b):"object"===typeof b||"function"===typeof b?Jb[ia.call(b)]||"object":
typeof b};var V="object"===typeof alert?function(b){try{return/^\s*\bfunction\b/.test(b+"")}catch(c){return!1}}:function(b){return"[object Function]"==ia.call(b)};avalon.isFunction=V;avalon.isWindow=function(b){return!b?!1:b==b.document&&b.document!=b};Ya(r)&&(avalon.isWindow=Ya);for(var Cc in avalon({}))break;var Dc="0"!==Cc;avalon.isPlainObject=function(b,c){if(!b||"object"!==avalon.type(b)||b.nodeType||avalon.isWindow(b))return!1;try{if(b.constructor&&!O.call(b,"constructor")&&!O.call(b.constructor.prototype,
"isPrototypeOf"))return!1}catch(d){return!1}if(Dc)for(c in b)return O.call(b,c);for(c in b);return void 0===c||O.call(b,c)};Hb.test(Object.getPrototypeOf)&&(avalon.isPlainObject=function(b){return!!b&&"object"===typeof b&&Object.getPrototypeOf(b)===Ia});avalon.mix=avalon.fn.mix=function(){var b,c,d,e,f,g=arguments[0]||{},h=1,l=arguments.length,k=!1;"boolean"===typeof g&&(k=g,g=arguments[1]||{},h++);"object"!==typeof g&&"function"!==avalon.type(g)&&(g={});h===l&&(g=this,h--);for(;h<l;h++)if(null!=
(b=arguments[h]))for(c in b){d=g[c];try{e=b[c]}catch(m){continue}g!==e&&(k&&e&&(avalon.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,d=d&&Array.isArray(d)?d:[]):d=d&&avalon.isPlainObject(d)?d:{},g[c]=avalon.mix(k,d,e)):void 0!==e&&(g[c]=e))}return g};avalon.mix({rword:z,subscribers:G,version:1.36,ui:{},log:v,slice:w?function(b,c,d){return $.call(b,c,d)}:function(b,c,d){var e=[],f=b.length;void 0===d&&(d=f);if("number"===typeof d&&isFinite(d)){c=ra(c,f);d=ra(d,f);for(f=c;f<d;++f)e[f-c]=b[f]}return e},
noop:y,error:function(b,c){throw new (c||Error)(b);},oneObject:M,range:function(b,c,d){d||(d=1);null==c&&(c=b||0,b=0);var e=-1;c=Math.max(0,Math.ceil((c-b)/d));for(var f=Array(c);++e<c;)f[e]=b,b+=d;return f},eventHooks:{},bind:function(b,c,d,e){var f=avalon.eventHooks[c];"object"===typeof f&&(c=f.type,f.deel&&(d=f.deel(b,d)));f=w?d:function(c){d.call(b,wc(c))};w?b.addEventListener(c,f,!!e):b.attachEvent("on"+c,f);return f},unbind:function(b,c,d,e){var f=avalon.eventHooks[c];d=d||y;"object"===typeof f&&
(c=f.type);w?b.removeEventListener(c,d,!!e):b.detachEvent("on"+c,d)},css:function(b,c,d){b instanceof avalon&&(b=b[0]);var e=/[_-]/.test(c)?oa(c):c;c=avalon.cssName(e)||e;if(void 0===d||"boolean"===typeof d)return e=x[e+":get"]||x["@:get"],"background"===c&&(c="backgroundColor"),b=e(b,c),!0===d?parseFloat(b)||0:b;""===d?b.style[c]="":null==d||d!==d||(isFinite(d)&&!avalon.cssNumber[e]&&(d+="px"),e=x[e+":set"]||x["@:set"],e(b,c,d))},each:function(b,c){if(b){var d=0,e;a:{if(b&&"object"===typeof b&&!avalon.isWindow(b)){var f=
b.length;if(+f===f&&!(f%1)&&0<=f)try{e=!1==={}.propertyIsEnumerable.call(b,"length")?Array.isArray(b)||/^\s?function/.test(b.item||b.callee):!0;break a}catch(g){e=!0;break a}}e=!1}if(e)for(e=b.length;d<e;d++)c(d,b[d]);else for(d in b)b.hasOwnProperty(d)&&c(d,b[d])}},getWidgetData:function(b,c){var d=avalon(b).data(),e={},f;for(f in d)0===f.indexOf(c)&&(e[f.replace(c,"").replace(/\w/,function(b){return b.toLowerCase()})]=d[f]);return e},Array:{ensure:function(b,c){if(-1===b.indexOf(c))return b.push(c)},
removeAt:function(b,c){return!!b.splice(c,1).length},remove:function(b,c){var d=b.indexOf(c);return~d?avalon.Array.removeAt(b,d):!1}}});avalon.nextTick=r.setImmediate?setImmediate.bind(r):function(b){setTimeout(b,0)};var za=avalon.vmodels={};avalon.define=function(b,c){var d=b.$id||b;d||v("warning: vm\u5fc5\u987b\u6307\u5b9a$id");za[d]&&v("warning: "+d+" \u5df2\u7ecf\u5b58\u5728\u4e8eavalon.vmodels\u4e2d");if("object"===typeof b)var e=N(b);else e={$watch:y},c(e),e=N(e),ja=!0,c(e),ja=!1;e.$id=d;return za[d]=
e};var sa="$id,$watch,$unwatch,$fire,$events,$model,$skipArray".match(z),la=Object.is||function(b,c){return 0===b&&0===c?1/b===1/c:b!==b?c!==c:b===c},Zb=w?function(b){var c={},d;for(d in b)c[d]={get:b[d],set:b[d],enumerable:!0,configurable:!0};return c}:function(b){return b},W={},ma=0,wa={},Ja=Object.defineProperty;try{Ja({},"_",{value:"x"});var na=Object.defineProperties}catch(pd){"__defineGetter__"in avalon&&(Ja=function(b,c,d){"value"in d&&(b[c]=d.value);"get"in d&&b.__defineGetter__(c,d.get);
"set"in d&&b.__defineSetter__(c,d.set);return b},na=function(b,c){for(var d in c)c.hasOwnProperty(d)&&Ja(b,d,c[d]);return b})}if(!na&&r.VBArray){r.execScript('Function parseVB(code)\n\tExecuteGlobal(code)\nEnd Function\nDim VBClassBodies\nSet VBClassBodies=CreateObject("Scripting.Dictionary")\nFunction findOrDefineVBClass(name,body)\n\tDim found\n\tfound=""\n\tFor Each key in VBClassBodies\n\t\tIf body=VBClassBodies.Item(key) Then\n\t\t\tfound=key\n\t\t\tExit For\n\t\tEnd If\n\tnext\n\tIf found="" Then\n\t\tparseVB("Class " + name + body)\n\t\tVBClassBodies.Add name, body\n\t\tfound=name\n\tEnd If\n\tfindOrDefineVBClass=found\nEnd Function',
"VBScript");var Ec=function(b,c,d){var e=b[c];if("function"===typeof e)if(3===arguments.length)e(d);else return e()},na=function(b,c,d){var e="VBClass"+setTimeout("1"),f=[];f.push("\r\n\tPrivate [__data__], [__proxy__]","\tPublic Default Function [__const__](d, p)","\t\tSet [__data__] = d: set [__proxy__] = p","\t\tSet [__const__] = Me","\tEnd Function");for(b in d)c.hasOwnProperty(b)||f.push("\tPublic ["+b+"]");sa.forEach(function(b){c.hasOwnProperty(b)||f.push("\tPublic ["+b+"]")});f.push("\tPublic [hasOwnProperty]");
for(b in c)f.push("\tPublic Property Let ["+b+"](val"+A+")",'\t\tCall [__proxy__]([__data__], "'+b+'", val'+A+")","\tEnd Property","\tPublic Property Set ["+b+"](val"+A+")",'\t\tCall [__proxy__]([__data__], "'+b+'", val'+A+")","\tEnd Property","\tPublic Property Get ["+b+"]","\tOn Error Resume Next","\t\tSet["+b+'] = [__proxy__]([__data__],"'+b+'")',"\tIf Err.Number <> 0 Then","\t\t["+b+'] = [__proxy__]([__data__],"'+b+'")',"\tEnd If","\tOn Error Goto 0","\tEnd Property");f.push("End Class");b=f.join("\r\n");
b=r.findOrDefineVBClass(e,b);b===e&&r.parseVB(["Function "+e+"Factory(a, b)","\tDim o","\tSet o = (New "+e+")(a, b)","\tSet "+e+"Factory = o","End Function"].join("\r\n"));return r[b+"Factory"](c,Ec)}}if(!"\u53f8\u5f92\u6b63\u7f8e".trim){var Fc=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim=function(){return this.replace(Fc,"")}}var Gc=!{toString:null}.propertyIsEnumerable("toString"),Hc=function(){}.propertyIsEnumerable("prototype"),Kb="toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),
Ic=Kb.length;Object.keys||(Object.keys=function(b){var c=[],d=Hc&&"function"===typeof b;if("string"===typeof b||b&&b.callee)for(d=0;d<b.length;++d)c.push(String(d));else for(var e in b)!(d&&"prototype"===e)&&O.call(b,e)&&c.push(String(e));if(Gc){d=(d=b.constructor)&&d.prototype===b;for(e=0;e<Ic;e++){var f=Kb[e];!(d&&"constructor"===f)&&O.call(b,f)&&c.push(f)}}return c});Array.isArray||(Array.isArray=function(b){return"[object Array]"===ia.call(b)});y.bind||(Function.prototype.bind=function(b){if(2>
arguments.length&&void 0===b)return this;var c=this,d=arguments;return function(){var e=[],f;for(f=1;f<d.length;f++)e.push(d[f]);for(f=0;f<arguments.length;f++)e.push(arguments[f]);return c.apply(b,e)}});Hb.test([].map)||avalon.mix(L,{indexOf:function(b,c){var d=this.length,e=~~c;for(0>e&&(e+=d);e<d;e++)if(this[e]===b)return e;return-1},lastIndexOf:function(b,c){var d=this.length,e=null==c?d-1:c;for(0>e&&(e=Math.max(0,d+e));0<=e;e--)if(this[e]===b)return e;return-1},forEach:Z("","_",""),filter:Z("r=[],j=0,",
"if(_)r[j++]=this[i]","return r"),map:Z("r=[],","r[i]=_","return r"),some:Z("","if(_)return true","return false"),every:Z("","if(!_)return false","return true")});B.contains||(Node.prototype.contains=function(b){return!!(this.compareDocumentPosition(b)&16)});p.contains||(p.contains=function(b){return Za(p,b)});if(r.SVGElement){var Lb=p.createElementNS("http://www.w3.org/2000/svg","svg");Lb.innerHTML='<circle cx="50" cy="50" r="40" fill="red" />';if(!Ib.test(Lb.firstChild)){var Ka=function(b,c){if(b&&
b.childNodes)for(var d=b.childNodes,e=0,f;f=d[e++];)if(f.tagName){var g=p.createElementNS("http://www.w3.org/2000/svg",f.tagName.toLowerCase());L.forEach.call(f.attributes,function(b){g.setAttribute(b.name,b.value)});Ka(f,g);c.appendChild(g)}};Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:$a,set:function(b){var c=this.tagName.toLowerCase(),d=this.parentNode;b=avalon.parseHTML(b);"svg"===c?d.insertBefore(b,this):(c=p.createDocumentFragment(),Ka(b,c),d.insertBefore(c,
this));d.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var b=RegExp("</"+this.nodeName+">$","i");return this.outerHTML.replace(RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),"").replace(b,"")},set:function(b){avalon.clearHTML&&(avalon.clearHTML(this),b=avalon.parseHTML(b),Ka(b,this))}}})}}!B.outerHTML&&r.HTMLElement&&HTMLElement.prototype.__defineGetter__("outerHTML",$a);var P,Q,aa,Mb,vb,Nb=/[-.*+?^${}()|[\]\/\\]/g,D=y,U={loader:function(b){r.define=
b?D.define:Bc;r.require=b?D:Ac},interpolate:function(b){P=b[0];Q=b[1];if(P===Q)throw new SyntaxError("openTag!==closeTag");if("\x3c!--,--\x3e"===b+"")u.commentInterpolate=!0;else{b=P+"test"+Q;ea.innerHTML=b;if(ea.innerHTML!==b&&0<=ea.innerHTML.indexOf("<"))throw new SyntaxError("\u6b64\u5b9a\u754c\u7b26\u4e0d\u5408\u6cd5");ea.innerHTML=""}b=(P+"").replace(Nb,"\\$&");var c=(Q+"").replace(Nb,"\\$&");aa=RegExp(b+"(.*?)"+c);Mb=RegExp(b+"(.*?)"+c,"g");vb=RegExp(b+".*?"+c+"|\\sms-")}};u.debug=!0;u.plugins=
U;u.plugins.interpolate(["{{","}}"]);u.paths={};u.shim={};u.maxRepeatSize=100;avalon.config=u;var cb={_toString:function(){var b=this.node.className;return("string"===typeof b?b:b.baseVal).split(/\s+/).join(" ")},_contains:function(b){return-1<(" "+this+" ").indexOf(" "+b+" ")},_add:function(b){this.contains(b)||this._set(this+" "+b)},_remove:function(b){this._set((" "+this+" ").replace(" "+b+" "," "))},__set:function(b){b=b.trim();var c=this.node;"string"===typeof c.className?c.className=b:c.setAttribute("class",
b)}};"add,remove".replace(z,function(b){avalon.fn[b+"Class"]=function(c){var d=this[0];c&&("string"===typeof c&&d&&1===d.nodeType)&&c.replace(/\S+/g,function(c){bb(d)[b](c)});return this}});avalon.fn.mix({hasClass:function(b){var c=this[0]||{};return 1===c.nodeType&&bb(c).contains(b)},toggleClass:function(b,c){for(var d,e=0,f=b.split(/\s+/),g="boolean"===typeof c;d=f[e++];)this[(g?c:!this.hasClass(d))?"addClass":"removeClass"](d);return this},attr:function(b,c){return 2===arguments.length?(this[0].setAttribute(b,
c),this):this[0].getAttribute(b)},data:function(b,c){b="data-"+ab(b||"");switch(arguments.length){case 2:return this.attr(b,c),this;case 1:var d=this.attr(b);return db(d);case 0:var e={};L.forEach.call(this[0].attributes,function(c){c&&(b=c.name,b.indexOf("data-")||(b=oa(b.slice(5)),e[b]=db(c.value)))});return e}},removeData:function(b){b="data-"+ab(b);this[0].removeAttribute(b);return this},css:function(b,c){if(avalon.isPlainObject(b))for(var d in b)avalon.css(this,d,b[d]);else var e=avalon.css(this,
b,c);return void 0!==e?e:this},position:function(){var b,c,d=this[0],e={top:0,left:0};if(d)return"fixed"===this.css("position")?c=d.getBoundingClientRect():(b=this.offsetParent(),c=this.offset(),"HTML"!==b[0].tagName&&(e=b.offset()),e.top+=avalon.css(b[0],"borderTopWidth",!0),e.left+=avalon.css(b[0],"borderLeftWidth",!0)),{top:c.top-e.top-avalon.css(d,"marginTop",!0),left:c.left-e.left-avalon.css(d,"marginLeft",!0)}},offsetParent:function(){for(var b=this[0].offsetParent||B;b&&"HTML"!==b.tagName&&
"static"===avalon.css(b,"position");)b=b.offsetParent;return avalon(b||B)},bind:function(b,c,d){if(this[0])return avalon.bind(this[0],b,c,d)},unbind:function(b,c,d){this[0]&&avalon.unbind(this[0],b,c,d);return this},val:function(b){var c=this[0];if(c&&1===c.nodeType){var d=0===arguments.length,e=d?":get":":set",f=La,g;g=c.tagName.toLowerCase();g="input"===g&&/checkbox|radio/.test(c.type)?"checked":g;if(e=f[g+e])var h=e(c,b);else{if(d)return(c.value||"").replace(/\r/g,"");c.value=b}}return d?h:this}});
var $b=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Jc=/^[\],:{}\s]*$/,Kc=/(?:^|:|,)(?:\s*\[)+/g,Lc=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,Mc=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;avalon.parseJSON=r.JSON?JSON.parse:function(b){if("string"===typeof b){if((b=b.trim())&&Jc.test(b.replace(Lc,"@").replace(Mc,"]").replace(Kc,"")))return(new Function("return "+b))();avalon.error("Invalid JSON: "+b)}};avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){avalon.fn[b]=function(d){var e=
this[0]||{},f=e.window&&e.document?e:9===e.nodeType?e.defaultView||e.parentWindow:!1,g="scrollTop"===b;if(arguments.length)f?f.scrollTo(!g?d:avalon(f).scrollLeft(),g?d:avalon(f).scrollTop()):e[b]=d;else return f?c in f?f[c]:B[b]:e[b]}});var x=avalon.cssHooks={},Ob=["","-webkit-","-o-","-moz-","-ms-"],Ma={"float":"cssFloat"};avalon.cssNumber=M("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom");avalon.cssName=function(b,c,d){if(Ma[b])return Ma[b];c=c||B.style;
for(var e=0,f=Ob.length;e<f;e++)if(d=oa(Ob[e]+b),d in c)return Ma[b]=d;return null};x["@:set"]=function(b,c,d){try{b.style[c]=d}catch(e){}};if(r.getComputedStyle)x["@:get"]=function(b,c){if(!b||!b.style)throw Error("getComputedStyle\u8981\u6c42\u4f20\u5165\u4e00\u4e2a\u8282\u70b9 "+b);var d,e=getComputedStyle(b,null);e&&(d="filter"===c?e.getPropertyValue(c):e[c],""===d&&(d=b.style[c]));return d},x["opacity:get"]=function(b){b=x["@:get"](b,"opacity");return""===b?"1":b};else{var Nc=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
Oc=/^(top|right|bottom|left)$/,Pb=/alpha\([^)]*\)/i,Na=!!r.XDomainRequest,Pc={thin:Na?"1px":"2px",medium:Na?"3px":"4px",thick:Na?"5px":"6px"};x["@:get"]=function(b,c){var d=b.currentStyle,e=d[c];if(Nc.test(e)&&!Oc.test(e)){var f=b.style,g=f.left,h=b.runtimeStyle.left;b.runtimeStyle.left=d.left;f.left="fontSize"===c?"1em":e||0;e=f.pixelLeft+"px";f.left=g;b.runtimeStyle.left=h}"medium"===e&&(c=c.replace("Width","Style"),"none"===d[c]&&(e="0px"));return""===e?"auto":Pc[e]||e};x["opacity:set"]=function(b,
c,d){b=b.style;d=isFinite(d)&&1>=d?"alpha(opacity="+100*d+")":"";c=b.filter||"";b.zoom=1;b.filter=(Pb.test(c)?c.replace(Pb,d):c+" "+d).trim();b.filter||b.removeAttribute("filter")};x["opacity:get"]=function(b){b=b.filters.alpha||b.filters["DXImageTransform.Microsoft.Alpha"];return(b&&b.enabled?b.opacity:100)/100+""}}"top,left".replace(z,function(b){x[b+":get"]=function(c){var d=x["@:get"](c,b);return/px$/.test(d)?d:avalon(c).position()[b]+"px"}});var fb={position:"absolute",visibility:"hidden",display:"block"},
ac=/^(none|table(?!-c[ea]).+)/;"Width,Height".replace(z,function(b){var c=b.toLowerCase(),d="client"+b,e="scroll"+b,f="offset"+b;x[c+":get"]=function(c,d,e){var k=-4;"number"===typeof e&&(k=e);d="Width"===b?["Left","Right"]:["Top","Bottom"];e=c[f];if(2===k)return e+avalon.css(c,"margin"+d[0],!0)+avalon.css(c,"margin"+d[1],!0);0>k&&(e=e-avalon.css(c,"border"+d[0]+"Width",!0)-avalon.css(c,"border"+d[1]+"Width",!0));-4===k&&(e=e-avalon.css(c,"padding"+d[0],!0)-avalon.css(c,"padding"+d[1],!0));return e};
x[c+"&get"]=function(b){var d=[];eb(b,d);for(var e=x[c+":get"](b),f=0,m;m=d[f++];){b=m.node;for(var n in m)"string"===typeof m[n]&&(b.style[n]=m[n])}return e};avalon.fn[c]=function(g){var h=this[0];if(0===arguments.length){if(h.setTimeout)return h["inner"+b]||h.document.documentElement[d];if(9===h.nodeType){var l=h.documentElement;return Math.max(h.body[e],l[e],h.body[f],l[f],l[d])}return x[c+"&get"](h)}return this.css(c,g)};avalon.fn["inner"+b]=function(){return x[c+":get"](this[0],void 0,-2)};avalon.fn["outer"+
b]=function(b){return x[c+":get"](this[0],void 0,!0===b?2:0)}});avalon.fn.offset=function(){var b=this[0],c={left:0,top:0};if(!b||!b.tagName||!b.ownerDocument)return c;var d=b.ownerDocument,e=d.body,f=d.documentElement,d=d.defaultView||d.parentWindow;if(!avalon.contains(f,b))return c;b.getBoundingClientRect&&(c=b.getBoundingClientRect());var b=f.clientTop||e.clientTop,g=f.clientLeft||e.clientLeft,h=Math.max(d.pageYOffset||0,f.scrollTop,e.scrollTop),e=Math.max(d.pageXOffset||0,f.scrollLeft,e.scrollLeft);
return{top:c.top+h-b,left:c.left+e-g}};var Qc=/^<option(?:\s+\w+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s+value[\s=]/i,La={"option:get":r.VBArray?function(b){return Qc.test(b.outerHTML)?b.value:b.text.trim()}:function(b){return b.value},"select:get":function(b,c){for(var d,e=b.options,f=b.selectedIndex,g=La["option:get"],h="select-one"===b.type||0>f,l=h?null:[],k=h?f+1:e.length,m=0>f?k:h?f:0;m<k;m++)if(d=e[m],(d.selected||m===f)&&!d.disabled){c=g(d);if(h)return c;l.push(c)}return l},"select:set":function(b,
c,d){c=[].concat(c);for(var e=La["option:get"],f=0,g;g=b.options[f++];)if(g.selected=0<=c.indexOf(e(g)))d=!0;d||(b.selectedIndex=-1)}},E={area:[1,"<map>"],param:[1,"<object>"],col:[2,"<table><tbody></tbody><colgroup>","</table>"],legend:[1,"<fieldset>"],option:[1,"<select multiple='multiple'>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>"],g:[1,'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">',
"</svg>"],_default:w?[0,""]:[1,"X<div>"]};E.optgroup=E.option;E.tbody=E.tfoot=E.colgroup=E.caption=E.thead;E.th=E.td;"circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use".replace(z,function(b){E[b]=E.g});var Rc=/<([\w:]+)/,Sc=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Qb=w?/[^\d\D]/:/(<(?:script|link|style|meta|noscript))/ig,Tc=M(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),Uc=/<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/,
Vc=p.createElement("script");avalon.parseHTML=function(b){"string"!==typeof b&&(b+="");b=b.replace(Sc,"<$1></$2>").trim();var c=(Rc.exec(b)||["",""])[1].toLowerCase(),d=E[c]||E._default,c=I.cloneNode(!1),e=ea,f;w||(b=b.replace(Qb,"<br class=msNoScope>$1"));e.innerHTML=d[1]+b+(d[2]||"");b=e.getElementsByTagName("script");if(b.length)for(var g=0,h;h=b[g++];)Tc[h.type]&&(f=Vc.cloneNode(!1),L.forEach.call(h.attributes,function(b){b&&b.specified&&(f[b.name]=b.value,f.setAttribute(b.name,b.value))}),f.text=
h.text,h.parentNode.replaceChild(f,h));for(g=d[0];g--;e=e.lastChild);if(!w){b=e.getElementsByTagName("br");for(g=0;h=b[g++];)h.className&&"msNoScope"===h.className&&(h.parentNode.removeChild(h),g--);b=e.all;for(g=0;h=b[g++];)gb(h)&&bc(h)}for(;d=e.firstChild;)c.appendChild(d);return c};avalon.innerHTML=function(b,c){if(!w&&!Qb.test(c)&&!Uc.test(c))try{b.innerHTML=c;return}catch(d){}var e=this.parseHTML(c);this.clearHTML(b).appendChild(e)};avalon.clearHTML=function(b){for(b.textContent="";b.firstChild;)b.removeChild(b.firstChild);
return b};var R={$watch:function(b,c){if("function"===typeof c){var d=this.$events[b];d?d.push(c):this.$events[b]=[c]}else this.$events=this.$watch.backup;return this},$unwatch:function(b,c){var d=arguments.length;if(0===d)this.$watch.backup=this.$events,this.$events={};else if(1===d)this.$events[b]=[];else for(var d=this.$events[b]||[],e=d.length;0>~--e;)if(d[e]===c)return d.splice(e,1);return this},$fire:function(b){var c;/^(\w+)!(\S+)$/.test(b)&&(c=RegExp.$1,b=RegExp.$2);var d=this.$events,e=$.call(arguments,
1),f=[b].concat(e);if("all"===c)for(var g in avalon.vmodels){var h=avalon.vmodels[g];h!==this&&h.$fire.apply(h,f)}else if("up"===c||"down"===c){var l=d.expr&&Rb(d.expr);if(0!==l.length){for(g in avalon.vmodels)h=avalon.vmodels[g],h!==this&&h.$events.expr&&(e=Rb(h.$events.expr),0!==e.length&&avalon.each(e,function(b,d){avalon.each(l,function(b,e){if("down"===c?e.contains(d):d.contains(e))d._avalon=h})}));g=p.getElementsByTagName("*");var k=[];Array.prototype.forEach.call(g,function(b){b._avalon&&(k.push(b._avalon),
b._avalon="",b.removeAttribute("_avalon"))});"up"===c&&k.reverse();for(g=0;(e=k[g++])&&!1!==e.$fire.apply(e,f););}}else{f=d[b]||[];d=d.$all||[];g=0;for(var m;m=f[g++];)V(m)&&m.apply(this,e);for(g=0;m=d[g++];)V(m)&&m.apply(this,arguments)}}},Wc=/(\w+)\[(avalonctrl)="(\S+)"\]/,Rb=p.querySelectorAll?function(b){return p.querySelectorAll(b)}:function(b){b=b.match(Wc);for(var c=p.getElementsByTagName(b[1]),d=[],e=0,f;f=c[e++];)f.getAttribute(b[2])===b[3]&&d.push(f);return d},cc=/^(duplex|on)$/,S=[],ya=
0,dc=200,jb=new Date,kb,Oa={};avalon.scanCallback=function(b,c){c=c||"$all";(Oa[c]||(Oa[c]=[])).push(b)};avalon.scan=function(b,c,d){b=b||B;var e=Oa[d||"$all"]||[];c=c?[].concat(c):[];var f=0,g=!1,h,l=!1;c.cb=function(b){f+=b;l=!0;setTimeout(function(){if(0>=f&&!g)for(g=!0;h=e.shift();)h()})};lb(b,c);if(!l)for(;h=e.shift();)h()};var hc=M("AREA,BASE,BASEFONT,BR,COL,COMMAND,EMBED,HR,IMG,INPUT,LINK,META,PARAM,SOURCE,TRACK,WBR,NOSCRIPT,SCRIPT,STYLE,TEXTAREA"),tb=/ms-(\w+)-?(.*)/,ub={"if":10,repeat:90,
data:100,widget:110,each:1400,"with":1500,duplex:2E3,on:3E3},fc=M("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),gc=M("value,title,alt,checked,selected,disabled,readonly,enabled");if(!"1"[0])var Pa=Da(512),Xc=/\s+(ms-[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Yc=/^['"]/,Zc=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i,$c=/&/g,sb=function(b){b=b.outerHTML;if("</"===b.slice(0,2)||!b.trim())return[];
b=b.match(Zc)[0];var c=[],d,e;if(Pa[b])return Pa[b];for(;d=Xc.exec(b);)(e=d[2])&&(e=(Yc.test(e)?e.slice(1,-1):e).replace($c,"&")),d=d[1].toLowerCase(),d.match(tb),c.push({name:d,specified:!0,value:e||""});return Pa(b,c)};var lc=/\|\s*(\w+)\s*(\([^)]*\))?/g,kc=/\|\|/g,mc=/U2hvcnRDaXJjdWl0/g,ic=/</g,jc=/>/g,ad=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g,bd=/[^\w$]+/g,cd=RegExp(""+("\\b"+"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".replace(/,/g,
"\\b|\\b")+"\\b"),"g"),dd=/\b\d[^,]*/g,ed=/^,+|,+$/g,Qa=Da(512),pc=function(b){var c=","+b.trim();if(Qa[c])return Qa[c];b=b.replace(ad,"").replace(bd,",").replace(cd,"").replace(dd,"").replace(ed,"").split(/^$|,+/);return Qa(c,wb(b))},Ea=Da(128),qc=/\w\[.*\]|\w\.\w/,oc=/(\$proxy\$[a-z]+)\d+$/,fd={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rc=r.JSON&&JSON.stringify||function(b){return'"'+b.replace(/[\\\"\x00-\x1f]/g,function(b){var d=fd[b];return"string"===typeof d?
d:"\\u"+("0000"+b.charCodeAt(0).toString(16)).slice(-4)})+'"'};avalon.parseExprProxy=K;var Ra={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"};"accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan,dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight,rowSpan,tabIndex,useMap,vSpace,valueType,vAlign".replace(z,function(b){Ra[b.toLowerCase()]=b});var pa=J.insertBefore(document.createElement("avalon"),
J.firstChild);pa.innerHTML="X<style id='avalonStyle'>.avalonHide{ display: none!important }</style>";var gd=/<noscript.*?>(?:[\s\S]+?)<\/noscript>/img,hd=/<noscript.*?>([\s\S]+?)<\/noscript>/im,Sa=function(){return new (r.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")},fa=function(b,c,d){if(b=b.getAttribute(c)){c=0;for(var e;e=d[c++];)if(e.hasOwnProperty(b)&&"function"===typeof e[b])return e[b]}},Ta=avalon.templateCache={};avalon.contains=Za;var Ua={};"autofocus,autoplay,async,allowTransparency,checked,controls,declare,disabled,defer,defaultChecked,defaultSelectedcontentEditable,isMap,loop,multiple,noHref,noResize,noShade,open,readOnly,selected".replace(z,
function(b){Ua[b.toLowerCase()]=b});var Fa=avalon.bindingExecutors={attr:function(b,c,d){var e=d.type,f=d.param;if("css"===e)avalon(c).css(f,b);else if("attr"===e){if(Ua[f]&&(e=Ua[f],"boolean"===typeof c[e]))return c[e]=!!b;!w&&Ra[f]&&(f=Ra[f]);if(!1===b||null===b||void 0===b)return c.removeAttribute(f);(Ib.test(c)?0:p.namespaces&&gb(c)||f in c.cloneNode(!1))?c[f]=b:c.setAttribute(f,b)}else if("include"===e&&b){var g=d.vmodels,h=d.includeRendered,l=d.includeLoaded,k=d.includeReplaced?c.parentNode:
c;g.cb(1);var m=function(b){l&&(b=l.apply(k,[b].concat(g)));for(h&&qa(k,function(){h.call(k)},NaN);;){var c=d.startInclude.nextSibling;if(c&&c!==d.endInclude)k.removeChild(c);else break}b=avalon.parseHTML(b);c=avalon.slice(b.childNodes);k.insertBefore(b,d.endInclude);Aa(c,g);g.cb(-1)};if("src"===d.param)if(Ta[b])avalon.nextTick(function(){m(Ta[b])});else{var n=Sa();n.onreadystatechange=function(){if(4===n.readyState){var c=n.status;if(200<=c&&300>c||304===c||1223===c)m(Ta[b]=n.responseText)}};n.open("GET",
b,!0);"withCredentials"in n&&(n.withCredentials=!0);n.setRequestHeader("X-Requested-With","XMLHttpRequest");n.send(null)}else{var q=b&&1===b.nodeType?b:p.getElementById(b);if(q){if("NOSCRIPT"===q.tagName&&!q.innerHTML&&!q.fixIE78){n=Sa();n.open("GET",location,!1);n.send(null);c=p.getElementsByTagName("noscript");for(var f=(n.responseText||"").match(gd)||[],e=f.length,t=0;t<e;t++){var H=c[t];H&&(H.style.display="none",H.fixIE78=(f[t].match(hd)||[""," "])[1])}}avalon.nextTick(function(){m(q.fixIE78||
q.value||q.innerText||q.innerHTML)})}}}else{if(!B.hasAttribute&&"string"===typeof b&&("src"===e||"href"===e))b=b.replace(/&/g,"&");c[e]=b;r.chrome&&"EMBED"===c.tagName&&(f=c.parentNode,e=document.createComment("ms-src"),f.replaceChild(e,c),f.replaceChild(c,e))}},"class":function(b,c,d){var e=avalon(c),f=d.type;if("class"===f&&d.oldStyle)e.toggleClass(d.oldStyle,!!b);else switch(d.toggleClass=d._evaluator?!!d._evaluator.apply(c,d._args):!0,d.newClass=d.immobileClass||b,d.oldClass&&d.newClass!==
d.oldClass&&e.removeClass(d.oldClass),d.oldClass=d.newClass,f){case "class":e.toggleClass(d.newClass,d.toggleClass);break;case "hover":case "active":if(!d.hasBindEvent){b="mouseenter";var g="mouseleave";"active"===f&&(c.tabIndex=c.tabIndex||-1,b="mousedown",g="mouseup",e.bind("mouseleave",function(){d.toggleClass&&e.removeClass(d.newClass)}));e.bind(b,function(){d.toggleClass&&e.addClass(d.newClass)});e.bind(g,function(){d.toggleClass&&e.removeClass(d.newClass)});d.hasBindEvent=!0}}},data:function(b,
c,d){d="data-"+d.param;b&&"object"===typeof b?c[d]=b:c.setAttribute(d,String(b))},repeat:function(b,c,d){if(b){var e=this.element.parentNode,f=this.proxies,g=I.cloneNode(!1);if("del"===b||"move"===b)var h=Ha(this,c);var l=this.group;switch(b){case "add":for(var k=d,m=this.$repeat.length-1,l=[],h=0,n=k.length;h<n;h++){var q=h+c,t=yc(q,k[h],this,m);f.splice(q,0,t);Bb(this,g,t,l)}h=Ha(this,c);e.insertBefore(g,h);for(h=0;g=l[h++];)Aa(g.nodes,g.vmodels),g.nodes=g.vmodels=null;Db(this);break;case "del":f=
f.splice(c,d);g=Cb(h,l,d);avalon.clearHTML(g);Eb(f);break;case "index":for(m=f.length-1;d=f[c];c++)d.$index=c,d.$first=0===c,d.$last=c===m;break;case "clear":for(;;)if((g=this.element.nextSibling)&&g!==this.endRepeat)e.removeChild(g);else break;Eb(f);break;case "move":if(g=f.splice(c,1)[0])f.splice(d,0,g),g=Cb(h,l),h=Ha(this,d),e.insertBefore(g,h);break;case "set":(t=f[c])&&(t[t.$itemName]=d);break;case "append":f=d;m=[];l=[];for(k in c)c.hasOwnProperty(k)&&"hasOwnProperty"!==k&&m.push(k);this.sortedCallback&&
(h=this.sortedCallback.call(e,m))&&(Array.isArray(h)&&h.length)&&(m=h);for(h=0;k=m[h++];)"hasOwnProperty"!==k&&Bb(this,g,f[k],l);this.proxySize=m.length;e.insertBefore(g,this.element.nextSibling);for(h=0;g=l[h++];)Aa(g.nodes,g.vmodels),g.nodes=g.vmodels=null;Db(this)}var H=this.renderedCallback||y,F=arguments;qa(e,function(){H.apply(e,F);e.oldValue&&("SELECT"===e.tagName&&"index"===b)&&avalon(e).val(e.oldValue.split(","))},NaN)}},html:function(b,c,d){b=null==b?"":b;var e="group"in d?c.parentNode:
c;if("group"in d){var f;if(11===b.nodeType)f=b;else if(1===b.nodeType||b.item){b=1===b.nodeType?b.childNodes:b.item?b:[];for(f=I.cloneNode(!0);b[0];)f.appendChild(b[0])}else f=avalon.parseHTML(b);b=avalon.slice(f.childNodes);0===b.length&&(b=p.createComment("ms-html"),f.appendChild(b),b=[b]);e.insertBefore(f,c);for(f=d.group;c;){var g=c.nextSibling;e.removeChild(c);f--;if(0===f||null===g)break;c=g}d.element=b[0];d.group=b.length}else avalon.innerHTML(e,b);d.vmodels.cb(1);avalon.nextTick(function(){ob(e,
d.vmodels);d.vmodels.cb(-1)})},"if":function(b,c,d){b?(8===c.nodeType&&(c.parentNode.replaceChild(d.template,c),c=d.element=d.template),c.getAttribute(d.name)&&(c.removeAttribute(d.name),nb(c,d.vmodels))):1===c.nodeType&&(b=d.element=p.createComment("ms-if"),c.parentNode.replaceChild(b,c),d.template=c,pa.appendChild(c))},on:function(b,c,d){d.type="on";b=function(b){return(d.evaluator||y).apply(this,d.args.concat(b))};var e=d.param.replace(/-\d+$/,"");if("scan"===e)b.call(c,{type:e});else if("function"===
typeof d.specialBind)d.specialBind(c,b);else var f=avalon.bind(c,e,b);d.rollback=function(){"function"===typeof d.specialUnbind?d.specialUnbind():avalon.unbind(c,e,f)}},text:function(b,c){b=null==b?"":b;if(3===c.nodeType)try{c.data=b}catch(d){}else"textContent"in c?c.textContent=b:c.innerText=b},visible:function(b,c,d){c.style.display=b?d.display:"none"},widget:y},Sb=/\(([^)]*)\)/;avalon.parseDisplay=ba;var C=avalon.bindingHandlers={attr:function(b,c){var d=b.value.trim(),e=!0;-1<d.indexOf(P)&&2<
d.indexOf(Q)&&(e=!1,aa.test(d)&&(""===RegExp.rightContext&&""===RegExp.leftContext)&&(e=!0,d=RegExp.$1));if("include"===b.type){var f=b.element;b.includeRendered=fa(f,"data-include-rendered",c);b.includeLoaded=fa(f,"data-include-loaded",c);var g=b.includeReplaced=!!avalon(f).data("includeReplace");b.startInclude=p.createComment("ms-include");b.endInclude=p.createComment("ms-include-end");g?(b.element=b.startInclude,f.parentNode.insertBefore(b.startInclude,f),f.parentNode.insertBefore(b.endInclude,
f.nextSibling)):(f.insertBefore(b.startInclude,f.firstChild),f.appendChild(b.endInclude))}b.handlerName="attr";K(d,c,b,e?0:Ba(b.value))},"class":function(b,c){var d=b.param,e=b.value;b.handlerName="class";if(!d||isFinite(d)){b.param="";var f=e.replace(Mb,function(b){return Math.pow(10,b.length-1)}).indexOf(":");if(-1===f)d=e;else if(d=e.slice(0,f),e=e.slice(f+1),xb(e,c,b),b.evaluator)b._evaluator=b.evaluator,b._args=b.args;else return v("debug: ms-class '"+(e||"").trim()+"' \u4e0d\u5b58\u5728\u4e8eVM\u4e2d"),
!1;e=aa.test(d);e||(b.immobileClass=d);K("",c,b,e?Ba(d):0)}else b.immobileClass=b.oldStyle=b.param,K(e,c,b)},duplex:function(b,c){var d=b.element,e;K(b.value,c,b,0,1);b.changed=fa(d,"data-duplex-changed",c)||y;if(b.evaluator&&b.args){var f=[],g=M("string,number,boolean,checked");"radio"===d.type&&""===b.param&&(b.param="checked");d.msData&&(d.msData["ms-duplex"]=b.value);b.param.replace(/\w+/g,function(c){/^(checkbox|radio)$/.test(d.type)&&/^(radio|checked)$/.test(c)&&("radio"===c&&v("ms-duplex-radio\u5df2\u7ecf\u66f4\u540d\u4e3ams-duplex-checked"),
c="checked",b.isChecked=!0);"bool"===c?(c="boolean",v("ms-duplex-bool\u5df2\u7ecf\u66f4\u540d\u4e3ams-duplex-boolean")):"text"===c&&(c="string",v("ms-duplex-text\u5df2\u7ecf\u66f4\u540d\u4e3ams-duplex-string"));g[c]&&(e=!0);avalon.Array.ensure(f,c)});e||f.push("string");b.param=f.join("-");b.bound=function(c,e){d.addEventListener?d.addEventListener(c,e,!1):d.attachEvent("on"+c,e);var f=b.rollback;b.rollback=function(){avalon.unbind(d,c,e);f&&f()}};for(var h in avalon.vmodels)avalon.vmodels[h].$fire("avalon-ms-duplex-init",
b);(b.pipe||(b.pipe=sc))(null,b,"init");h=d.tagName;X[h]&&X[h](d,b.evaluator.apply(null,b.args),b)}},repeat:function(b,c){var d=b.type;K(b.value,c,b,0,1);b.proxies=[];var e=!1;c.cb(-1);try{var f=b.$repeat=b.evaluator.apply(0,b.args||[]),g=avalon.type(f);"object"!==g&&"array"!==g&&(e=!0,avalon.log("warning:"+b.value+"\u5bf9\u5e94\u7c7b\u578b\u4e0d\u6b63\u786e"))}catch(h){e=!0,avalon.log("warning:"+b.value+"\u7f16\u8bd1\u51fa\u9519")}g=b.element;g.removeAttribute(b.name);b.sortedCallback=fa(g,"data-with-sorted",
c);b.renderedCallback=fa(g,"data-"+d+"-rendered",c);var l=b.element=p.createComment("ms-repeat"),k=b.endRepeat=p.createComment("ms-repeat-end");I.appendChild(l);I.appendChild(k);"each"===d||"with"===d?(b.template=g.innerHTML.trim(),avalon.clearHTML(g).appendChild(I)):(b.template=g.outerHTML.trim(),g.parentNode.replaceChild(I,g),b.group=1);b.rollback=function(){Fa.repeat.call(b,"clear");var c=b.element,d=c.parentNode,e=avalon.parseHTML(b.template),f=e.firstChild;d.replaceChild(e,c);d.removeChild(b.endRepeat);
f=b.element="repeat"===b.type?f:d;b.group=f.setAttribute(b.name,b.value)};g=b.value.split(".")||[];if(1<g.length){g.pop();l=g[0];for(g=0;k=c[g++];)if(k&&k.hasOwnProperty(l)){g=k[l].$events;g[G]=g[G]||[];g[G].push(b);break}}if(!e){b.handler=Fa.repeat;b.$outer={};e="$key";l="$val";Array.isArray(f)&&(e="$first",l="$last");for(g=0;k=c[g++];)if(k.hasOwnProperty(e)&&k.hasOwnProperty(l)){b.$outer=k;break}(e=(f.$events||{})[G])&&avalon.Array.ensure(e,b)&&hb(b,e);if(!Array.isArray(f)&&"each"!==d){var m=W[f.$id];
if(!m){ma++;var m=W[f.$id]={},n;for(n in f)f.hasOwnProperty(n)&&"hasOwnProperty"!==n&&function(b,c){m[b]=xc(b,c,{});m[b].$watch("$val",function(c){f[b]=c})}(n,f[n])}b.handler("append",f,m)}else b.handler("add",0,f)}},html:function(b,c){K(b.value,c,b)},on:function(b,c){var d=b.value,e=b.param.replace(/-\d+$/,"");if("function"===typeof C.on[e+"Hook"])C.on[e+"Hook"](b);if(0<d.indexOf("(")&&-1<d.indexOf(")")&&(e=(d.match(Sb)||["",""])[1].trim(),""===e||"$event"===e))d=d.replace(Sb,"");K(d,c,b)},visible:function(b,
c){var d=avalon(b.element),e=d.css("display");if("none"===e){var f=d[0].style,g=/visibility/i.test(f.cssText),h=d.css("visibility");f.display="";f.visibility="hidden";e=d.css("display");"none"===e&&(e=ba(d[0].nodeName));f.visibility=g?h:""}b.display=e;K(b.value,c,b)},widget:function(b,c){var d=b.value.match(z),e=b.element,f=d[0],g=d[1];if(!g||"$"===g)g=f+setTimeout("1");d=d[2]||f;c.cb(-1);var h=avalon.ui[f];if("function"===typeof h){c=e.vmodels||c;for(var l=0,k;k=c[l++];)if(k.hasOwnProperty(d)&&"object"===
typeof k[d]){var m=k[d],m=m.$model||m;break}m&&(l=m[f+"Id"],"string"===typeof l&&(g=l));l=avalon.getWidgetData(e,f);b.value=[f,g,d].join();b[f+"Id"]=g;b.evaluator=y;e.msData["ms-widget-id"]=g;var n=b[f+"Options"]=avalon.mix({},h.defaults,m||{},l);e.removeAttribute("ms-widget");var q=h(e,b,c)||{};if(q.$id){if(avalon.vmodels[g]=q,mb(e,q),q.hasOwnProperty("$init")&&q.$init(function(){var b=[q].concat(c);b.cb=c.cb;avalon.scan(e,b);"function"===typeof n.onInit&&n.onInit.call(e,q,n,c)}),q.hasOwnProperty("$remove")){var p=
function(){if(!e.msRetain&&!B.contains(e))return q.$remove(),e.msData={},delete avalon.vmodels[q.$id],!1};r.chrome?e.addEventListener("DOMNodeRemovedFromDocument",function(){setTimeout(p)}):avalon.tick(p)}}else avalon.scan(e,c)}else c.length&&(e.vmodels=c)}};"hover,active".replace(z,function(b){C[b]=C["class"]});"with,each".replace(z,function(b){C[b]=C.repeat});C["if"]=C.data=C.text=C.html;"title,alt,src,value,css,include,href".replace(z,function(b){C[b]=C.attr});var X=C.duplex;avalon.duplexHooks=
{checked:{get:function(b,c){return!c.element.oldValue}},string:{get:function(b){return b},set:Ga},"boolean":{get:function(b){return"true"===b},set:Ga},number:{get:function(b){return isFinite(b)?parseFloat(b)||0:b},set:Ga}};X.INPUT=function(b,c,d){function e(b){d.changed.call(this,b,d)}function f(){n=!0}function g(){n=!1}function h(){if(!n){var f=b.oldValue=b.value,f=d.pipe(f,d,"get");!1!==m.data("duplex-observe")&&(c(f),e.call(b,f),m.data("duplex-focus")&&avalon.nextTick(function(){b.focus()}))}}
var l=b.type,k=d.bound,m=avalon(b),n=!1;d.handler=function(){var e=d.pipe(c(),d,"set");e!==b.value&&(b.value=e)};if(d.isChecked||"radio"===b.type){var q=!r.XMLHttpRequest,h=function(){if(!1!==m.data("duplex-observe")){var f=d.pipe(b.value,d,"get");c(f);e.call(b,f)}};d.handler=function(){var e=c(),f=d.isChecked?!!e:e+""===b.value;b.oldValue=f;q?setTimeout(function(){b.defaultChecked=f;b.checked=f},100):b.checked=f};k(q?"mouseup":"click",h)}else if("checkbox"===l)h=function(){if(!1!==m.data("duplex-observe")){var f=
b.checked?"ensure":"remove",g=c();Array.isArray(g)||(v("ms-duplex\u5e94\u7528\u4e8echeckbox\u4e0a\u8981\u5bf9\u5e94\u4e00\u4e2a\u6570\u7ec4"),g=[g]);avalon.Array[f](g,d.pipe(b.value,d,"get"));e.call(b,g)}},d.handler=function(){var e=[].concat(c());b.checked=0<=e.indexOf(d.pipe(b.value,d,"get"))},k(w?"change":"click",h);else{l=b.getAttribute("data-duplex-event")||b.getAttribute("data-event")||"input";b.attributes["data-event"]&&v("data-event\u6307\u4ee4\u5df2\u7ecf\u5e9f\u5f03\uff0c\u8bf7\u6539\u7528data-duplex-event");
var t=function(b){setTimeout(function(){h(b)})};l.replace(z,function(b){switch(b){case "input":w?(k("input",h),k("compositionstart",f),k("compositionend",g),9===p.documentMode&&(k("paste",t),k("cut",t))):k("propertychange",function(b){"value"===b.propertyName&&h()});break;default:k(b,h)}})}b.oldValue=b.value;Tb(function(){if(avalon.contains(B,b))yb.call(b);else if(!b.msRetain)return!1});xa(d);e.call(b,b.value)};var zb,ca=[],Tb=y;avalon.tick=function(b){1===ca.push(b)&&(zb=setInterval(tc,60))};try{var Va=
HTMLInputElement.prototype;Object.getOwnPropertyNames(Va);var vc=Object.getOwnPropertyDescriptor(Va,"value").set;Object.defineProperty(Va,"value",{set:uc})}catch(qd){Tb=avalon.tick}X.SELECT=function(b,c,d){var e=avalon(b);d.handler=function(){var d=c(),d=d&&d.$model||d;Array.isArray(d)?b.multiple||v("ms-duplex\u5728<select multiple=true>\u4e0a\u8981\u6c42\u5bf9\u5e94\u4e00\u4e2a\u6570\u7ec4"):b.multiple&&v("ms-duplex\u5728<select multiple=false>\u4e0d\u80fd\u5bf9\u5e94\u4e00\u4e2a\u6570\u7ec4");d=
Array.isArray(d)?d.map(String):d+"";d+""!==b.oldValue&&(e.val(d),b.oldValue=d+"")};d.bound("change",function(){if(!1!==e.data("duplex-observe")){var f=e.val(),f=Array.isArray(f)?f.map(function(b){return d.pipe(b,d,"get")}):d.pipe(f,d,"get");f+""!==b.oldValue&&c(f);d.changed.call(b,f,d)}});qa(b,function(){xa(d);d.changed.call(b,c(),d)},NaN)};X.TEXTAREA=X.INPUT;var ga=avalon.eventHooks;"onmouseenter"in B||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(b,c){ga[b]={type:c,deel:function(c,
e){return function(f){var g=f.relatedTarget;if(!g||g!==c&&!(c.compareDocumentPosition(g)&16))return delete f.type,f.type=b,e.call(c,f)}}}});avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(b,c){r[b]&&!ga.animationend&&(ga.animationend={type:c})});"oninput"in p.createElement("input")||(ga.input={type:"propertychange",deel:function(b,c){return function(d){if("value"===d.propertyName)return d.type="input",c.call(b,d)}}});if(void 0===p.onmousewheel){var Ub=
void 0!==p.onwheel?"wheel":"DOMMouseScroll",id="wheel"===Ub?"deltaY":"detail";ga.mousewheel={type:Ub,deel:function(b,c){return function(d){d.wheelDeltaY=d.wheelDelta=0<d[id]?-120:120;d.wheelDeltaX=0;Object.defineProperty&&Object.defineProperty(d,"type",{value:"mousewheel"});c.call(b,d)}}}}var Wa=L.splice,Ab={_splice:Wa,_fire:function(b,c,d){ua(this.$events[G],b,c,d)},_add:function(b,c){var d=this.length;c="number"===typeof c?c:d;for(var d=[],e=0,f=b.length;e<f;e++){var g=d,h=e,l=b[e],k=this.$model[c+
e];va.test(avalon.type(l))&&(l=l.$id?l:N(l,0,k));g[h]=l}Wa.apply(this,[c,0].concat(d));this._fire("add",c,d);if(!this._stopFireLength)return this._.length=this.length},_del:function(b,c){var d=this._splice(b,c);d.length&&(this._fire("del",b,c),this._stopFireLength||(this._.length=this.length));return d},push:function(){L.push.apply(this.$model,arguments);var b=this._add(arguments);this._fire("index",2<b?b-2:0);return b},size:function(){return this._.length},pushArray:function(b){return this.push.apply(this,
b)},unshift:function(){L.unshift.apply(this.$model,arguments);this._add(arguments,0);this._fire("index",arguments.length);return this.$model.length},shift:function(){var b=this.$model.shift();this._del(0,1);this._fire("index",0);return b},pop:function(){var b=this.$model.pop();this._del(this.length-1,1);return b},splice:function(b,c){b=ra(b,this.length);var d=Wa.apply(this.$model,arguments),e=[],f;this._stopFireLength=!0;d.length&&(e=this._del(b,d.length),f=!0);2<arguments.length&&(this._add($.call(arguments,
2),b),f=!0);this._stopFireLength=!1;this._.length=this.length;f&&this._fire("index",0);return e},contains:function(b){return-1!==this.indexOf(b)},remove:function(b){return this.removeAt(this.indexOf(b))},removeAt:function(b){return 0<=b?this.splice(b,1):[]},clear:function(){this.$model.length=this.length=this._.length=0;this._fire("clear",0);return this},removeAll:function(b){if(Array.isArray(b))b.forEach(function(b){this.remove(b)},this);else if("function"===typeof b)for(var c=this.length-1;0<=c;c--)b(this[c],
c)&&this.splice(c,1);else this.clear()},ensure:function(b){this.contains(b)||this.push(b);return this},set:function(b,c){if(0<=b){var d=avalon.type(c);c&&c.$model&&(c=c.$model);var e=this[b];if("object"===d)for(var f in c)e.hasOwnProperty(f)&&(e[f]=c[f]);else"array"===d?e.clear().push.apply(e,c):e!==c&&(this[b]=c,this.$model[b]=c,this._fire("set",b,c))}return this}};"sort,reverse".replace(z,function(b){Ab[b]=function(){var c=this.$model,d=c.slice(0),e=!1;L[b].apply(c,arguments);for(var f=0,g=d.length;f<
g;f++){var h=c[f];if(!la(h,d[f])){var e=!0,h=d.indexOf(h,f),l=this._splice(h,1)[0],k=d.splice(h,1)[0];this._splice(f,0,l);d.splice(f,0,k);this._fire("move",h,f)}}e&&this._fire("index",0);return this}});var zc=M("$index,$first,$last"),da=[],jd=/<script[^>]*>([\S\s]*?)<\/script\s*>/gim,kd=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,ld=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/ig,md={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/ig,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/ig,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/ig},
nd=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,od=/([^\#-~| |!])/g,Xa=avalon.filters={uppercase:function(b){return b.toUpperCase()},lowercase:function(b){return b.toLowerCase()},truncate:function(b,c,d){c=c||30;d=void 0===d?"...":d;return b.length>c?b.slice(0,c-d.length)+d:String(b)},camelize:oa,sanitize:function(b){return b.replace(jd,"").replace(ld,function(b,d){var e=b.toLowerCase().match(/<(\w+)\s/);e&&(e=md[e[1]])&&(b=b.replace(e,function(b,c,d){b=d.charAt(0);return c+"="+b+"javascript:void(0)"+b}));return b.replace(kd,
" ").replace(/\s+/g," ")})},escape:function(b){return String(b).replace(/&/g,"&").replace(nd,function(b){var d=b.charCodeAt(0);b=b.charCodeAt(1);return"&#"+(1024*(d-55296)+(b-56320)+65536)+";"}).replace(od,function(b){return"&#"+b.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")},currency:function(b,c){return(c||"\uffe5")+avalon.filters.number(b)},number:function(b,c,d,e){b=(b+"").replace(/[^0-9+\-Ee.]/g,"");b=!isFinite(+b)?0:+b;c=!isFinite(+c)?0:Math.abs(c);e=e||",";d=d||".";var f=
"",f=function(b,c){var d=Math.pow(10,c);return""+Math.round(b*d)/d},f=(c?f(b,c):""+Math.round(b)).split(".");3<f[0].length&&(f[0]=f[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,e));if((f[1]||"").length<c)f[1]=f[1]||"",f[1]+=Array(c-f[1].length+1).join("0");return f.join(d)}};new function(){function b(b,c,d){var e="";0>b&&(e="-",b=-b);for(b=""+b;b.length<c;)b="0"+b;d&&(b=b.substr(b.length-c));return e+b}function c(c,d,e,f){return function(g){g=g["get"+c]();if(0<e||g>-e)g+=e;0===g&&-12===e&&(g=12);return b(g,
d,f)}}function d(b,c){return function(d,e){var f=d["get"+b](),g=(c?"SHORT"+b:b).toUpperCase();return e[g][f]}}function e(b){var c;if(c=b.match(l)){b=new Date(0);var d=0,e=0,f=c[8]?b.setUTCFullYear:b.setFullYear,g=c[8]?b.setUTCHours:b.setHours;c[9]&&(d=parseInt(c[9]+c[10],10),e=parseInt(c[9]+c[11],10));f.call(b,parseInt(c[1],10),parseInt(c[2],10)-1,parseInt(c[3],10));d=parseInt(c[4]||0,10)-d;e=parseInt(c[5]||0,10)-e;f=parseInt(c[6]||0,10);c=Math.round(1E3*parseFloat("0."+(c[7]||0)));g.call(b,d,e,f,
c)}return b}var f={yyyy:c("FullYear",4),yy:c("FullYear",2,0,!0),y:c("FullYear",1),MMMM:d("Month"),MMM:d("Month",!0),MM:c("Month",2,1),M:c("Month",1,1),dd:c("Date",2),d:c("Date",1),HH:c("Hours",2),H:c("Hours",1),hh:c("Hours",2,-12),h:c("Hours",1,-12),mm:c("Minutes",2),m:c("Minutes",1),ss:c("Seconds",2),s:c("Seconds",1),sss:c("Milliseconds",3),EEEE:d("Day"),EEE:d("Day",!0),a:function(b,c){return 12>b.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(c){c=-1*c.getTimezoneOffset();return c=(0<=c?"+":"")+(b(Math[0<
c?"floor":"ceil"](c/60),2)+b(Math.abs(c%60),2))}},g=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,h=/^\d+$/,l=/^(\d{4})-?(\d+)-?(\d+)(?:T(\d+)(?::?(\d+)(?::?(\d+)(?:\.(\d+))?)?)?(Z|([+-])(\d+):?(\d+))?)?$/,k=/^(\d+)\D(\d+)\D(\d+)/;Xa.date=function(b,c){var d=Xa.date.locate,l="",F=[],ta,m;c=c||"mediumDate";c=d[c]||c;"string"===typeof b&&(h.test(b)?b=parseInt(b,10):(b=b.trim().replace(k,function(b,c,d,e){return(4===e.length?[e,c,d]:[c,d,e]).join("-")}),b=e(b)),b=new Date(b));
"number"===typeof b&&(b=new Date(b));if("date"===avalon.type(b)){for(;c;)(m=g.exec(c))?(F=F.concat(m.slice(1)),c=F.pop()):(F.push(c),c=null);F.forEach(function(c){ta=f[c];l+=ta?ta(b,d):c.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return l}};var m={AMPMS:{"0":"\u4e0a\u5348",1:"\u4e0b\u5348"},DAY:{"0":"\u661f\u671f\u65e5",1:"\u661f\u671f\u4e00",2:"\u661f\u671f\u4e8c",3:"\u661f\u671f\u4e09",4:"\u661f\u671f\u56db",5:"\u661f\u671f\u4e94",6:"\u661f\u671f\u516d"},MONTH:{"0":"1\u6708",1:"2\u6708",2:"3\u6708",
3:"4\u6708",4:"5\u6708",5:"6\u6708",6:"7\u6708",7:"8\u6708",8:"9\u6708",9:"10\u6708",10:"11\u6708",11:"12\u6708"},SHORTDAY:{"0":"\u5468\u65e5",1:"\u5468\u4e00",2:"\u5468\u4e8c",3:"\u5468\u4e09",4:"\u5468\u56db",5:"\u5468\u4e94",6:"\u5468\u516d"},fullDate:"y\u5e74M\u6708d\u65e5EEEE",longDate:"y\u5e74M\u6708d\u65e5",medium:"yyyy-M-d ah:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"ah:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};m.SHORTMONTH=m.MONTH;Xa.date.locate=m};var s=avalon.modules=
{"ready!":{exports:avalon},avalon:{exports:avalon,state:2}};new function(){function b(b){return(b||"").replace(/[?#].*/,"")}function c(b){var c;try{a.b.c()}catch(d){c=d.stack,!c&&r.opera&&(c=(String(d).match(/of linked script \S+/g)||[]).join(" "))}if(c)return c=c.split(/[@ ]/g).pop(),c="("===c[0]?c.slice(1,-1):c.replace(/\s/,""),c.replace(/(:\d+)?:\d+$/i,"");c=(b?p:J).getElementsByTagName("script");for(var e=c.length,f;f=c[--e];)if((b||f.className===G)&&"interactive"===f.readyState)return f.className=
f.src}function d(b,c){for(var e in b)if("\u53f8\u5f92\u6b63\u7f8e"===b[e]&&2!==s[e].state&&(e===c||d(s[e].deps,c)))return!0}function e(){var b=k.length,c;a:for(;c=k[--b];){c=s[c];var d=c.deps,f;for(f in d)if(O.call(d,f)&&2!==s[f].state)continue a;2!==c.state&&(k.splice(b,1),l(c.id,c.args,c.factory),e())}}function f(c,d,e){var f=b(c.src);c.onload=c.onreadystatechange=c.onerror=null;if(d||e&&!s[f].state)setTimeout(function(){J.removeChild(c);c=null}),v("debug: \u52a0\u8f7d "+f+" \u5931\u8d25"+d+" "+
!s[f].state);else return!0}function g(c,d,e,f){if("ready!"===c||s[c]&&2===s[c].state)return c;var g;c=c.replace(/^\w+!/,function(b){g=b.slice(0,-1);return""});g=g||"js";g=U[g]||y;"object"===typeof u.shim[c]&&(f=u.shim[c]);u.paths[c]&&(c=u.paths[c]);if(/^(\w+)(\d)?:.*/.test(c))e=c;else{d=d.substr(0,d.lastIndexOf("/"));var h=c.charAt(0);if("."!==h&&"/"!==h)e=n+c;else if("./"===c.slice(0,2))e=d+c.slice(1);else if(".."===c.slice(0,2))for(e=d+"/"+c;t.test(e);)e=e.replace(t,"");else"/"===h?e=c:avalon.error("\u4e0d\u7b26\u5408\u6a21\u5757\u6807\u8bc6\u89c4\u5219: "+
c)}c=b(e);(d=g.ext)&&c.slice(0-d.length)!==d&&(e+=d);u.nocache&&(e+=(-1===e.indexOf("?")?"?":"&")+(new Date-0));return g(e,f)}function h(b,c,d){var e=p.createElement("script");e.className=G;e[w?"onload":"onreadystatechange"]=function(){if(w||/loaded|complete/i.test(e.readyState)){var g=m.pop();g&&g.delay(c);d&&d();f(e,!1,!w)&&v("debug: \u5df2\u6210\u529f\u52a0\u8f7d "+b)}};e.onerror=function(){f(e,!0)};e.src=b;J.insertBefore(e,J.firstChild);v("debug: \u6b63\u51c6\u5907\u52a0\u8f7d "+b)}function l(b,
c,d){for(var e=0,f=[],g;g=c[e++];)f.push(s[g].exports);c=Object(s[b]);d=d.apply(r,f);c.state=2;void 0!==d&&(s[b].exports=d);return d}var k=[],m=[],n;U.js=function(c,d){var e=b(c);s[e]||(s[e]={id:e,exports:{}},d?D(d.deps||"",function(){h(c,e,function(){s[e].state=2;d.exports&&(s[e].exports="function"===typeof d.exports?d.exports():r[d.exports]);D.checkDeps()})}):h(c,e));return e};U.css=function(b){var c=b.replace(/(#.+|\W)/g,"");if(!p.getElementById(c)){var d=p.createElement("link");d.rel="stylesheet";
d.href=b;d.id=c;J.insertBefore(d,J.firstChild)}};U.css.ext=".css";U.js.ext=".js";U.text=function(b){var c=Sa(),d=b.replace(/[?#].*/,"");s[d]={};c.onreadystatechange=function(){if(4===c.readyState){var e=c.status;399<e&&600>e?avalon.error(b+" \u5bf9\u5e94\u8d44\u6e90\u4e0d\u5b58\u5728\u6216\u6ca1\u6709\u5f00\u542f CORS"):(s[d].state=2,s[d].exports=c.responseText,D.checkDeps())}};c.open("GET",b,!0);"withCredentials"in c&&(c.withCredentials=!0);c.setRequestHeader("X-Requested-With","XMLHttpRequest");
c.send();return d};var q=c(!0);q||(q=avalon.slice(p.scripts).pop().src);q=b(q);n=u.base=q.slice(0,q.lastIndexOf("/")+1);var t=/\/\w+\/\.\./;D=avalon.require=function(b,c,d){var f={},h=[],m=0,p=0,q=d||"callback"+setTimeout("1");d=d||n;String(b).replace(z,function(b){if(b=g(b,d))m++,s[b]&&2===s[b].state&&p++,f[b]||(h.push(b),f[b]="\u53f8\u5f92\u6b63\u7f8e")});s[q]={id:q,factory:c,deps:f,args:h,state:1};m===p?l(q,h,c):k.unshift(q);e()};D.define=function(e,f,g){var h=$.call(arguments);if("string"===typeof e)var k=
h.shift();"function"===typeof h[0]&&h.unshift([]);var l=s[k]&&1<=s[k].state?k:b(c());!s[l]&&k&&(s[l]={id:l,factory:g,state:1});g=h[1];g.id=k;g.delay=function(b){h.push(b);var c=!0;try{c=d(s[b].deps,b)}catch(e){}c&&avalon.error(b+"\u6a21\u5757\u4e0e\u4e4b\u524d\u7684\u6a21\u5757\u5b58\u5728\u5faa\u73af\u4f9d\u8d56\uff0c\u8bf7\u4e0d\u8981\u76f4\u63a5\u7528script\u6807\u7b7e\u5f15\u5165"+b+"\u6a21\u5757");delete g.delay;D.apply(null,h)};l?g.delay(l,h):m.push(g)};D.define.amd=s;D.config=u;D.checkDeps=
e};var Fb=[];"complete"===p.readyState?setTimeout(T):w?p.addEventListener("DOMContentLoaded",T):(p.attachEvent("onreadystatechange",function(){"complete"===p.readyState&&T()}),B.doScroll&&Gb());avalon.bind(r,"load",T);avalon.ready=function(b){D?D("ready!",b):T===y?b(avalon):Fb.push(b)};avalon.config({loader:!0});avalon.ready(function(){avalon.scan(p.body)})})(document);