444&&typeof e[0]==="object"){tt()}var t=$.call(arguments,1);for(var r=e.length,a;a=e[--r];){var n=a.element;if(n&&n.parentNode){if(a.$repeat){a.handler.apply(a,t)}else if(a.type!=="on"){var i=a.evaluator||N;a.handler(i.apply(0,a.args||[]),n,a)}}}}}var Ge=0;var Je=avalon.$$subscribers=[];var Ze=new Date;var Qe={};function Ke(e){return e.uniqueNumber||(e.uniqueNumber=++Ge)}function et(e,t){var r=e.element;if(!e.uuid){if(r.nodeType!==1){e.uuid=e.type+(e.pos||0)+"-"+Ke(r.parentNode)}else{e.uuid=e.name+"-"+Ke(r)}}var a=e.lists||(e.lists=[]);avalon.Array.ensure(a,t);t.$uuid=t.$uuid||M();if(!Je[e.uuid]){Je[e.uuid]=1;Je.push(e)}}function tt(e){var t=Je.length;var r=t;var a=[];var n={};var i={};while(e=Je[--t]){var o=e.type;if(i[o]){i[o]++}else{i[o]=1;a.push(o)}}var l=false;a.forEach(function(e){if(Qe[e]!==i[e]){n[e]=1;l=true}});t=r;if(l){while(e=Je[--t]){if(!e.element)continue;if(n[e.type]&&at(e.element)){Je.splice(t,1);delete Je[e.uuid];var s=e.lists;for(var u=0,f;f=s[u++];){avalon.Array.remove(s,f);avalon.Array.remove(f,e)}rt(e)}}}Qe=i;Ze=new Date}function rt(e){e.element=null;e.rollback&&e.rollback();for(var t in e){e[t]=null}}function at(e){try{if(!e.parentNode){return true}}catch(t){return true}return e.msRetain?0:e.nodeType===1?!E.contains(e):!avalon.contains(E,e)}var nt={area:[1,""],param:[1,""],col:[2,""],legend:[1,""],option:[1,""],thead:[1,""],tr:[2,""],td:[3,""],g:[1,'"],_default:T?[0,"",""]:[1,"X","
"]};nt.th=nt.td;nt.optgroup=nt.option;nt.tbody=nt.tfoot=nt.colgroup=nt.caption=nt.thead;String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(d,function(e){nt[e]=nt.g});var it=/<([\w:]+)/;var ot=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;var lt=T?/[^\d\D]/:/(<(?:script|link|style|meta|noscript))/gi;var st=O(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]);var ut=/<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/;var ft=n.createElement("script");var ct=/<|?\w+;/;avalon.parseHTML=function(e){var t=k.cloneNode(false);if(typeof e!=="string"){return t}if(!ct.test(e)){t.appendChild(n.createTextNode(e));return t}e=e.replace(ot,"<$1>$2>").trim();var r=(it.exec(e)||["",""])[1].toLowerCase(),a=nt[r]||nt._default,i=_,o,l;if(!T){e=e.replace(lt,"
$1")}i.innerHTML=a[1]+e+a[2];var s=i.getElementsByTagName("script");if(s.length){for(var u=0,f;f=s[u++];){if(st[f.type]){l=ft.cloneNode(false);w.forEach.call(f.attributes,function(e){if(e&&e.specified){l[e.name]=e.value;l.setAttribute(e.name,e.value)}});l.text=f.text;f.parentNode.replaceChild(l,f)}}}if(!T){var c=a[1]==="X"?i.lastChild.firstChild:i.lastChild;if(c&&c.tagName==="TABLE"&&r!=="tbody"){for(s=c.childNodes,u=0;f=s[u++];){if(f.tagName==="TBODY"&&!f.innerHTML){c.removeChild(f);break}}}s=i.getElementsByTagName("br");var v=s.length;while(f=s[--v]){if(f.className==="msNoScope"){f.parentNode.removeChild(f)}}for(s=i.all,u=0;f=s[u++];){if(vt(f)){pt(f)}}}for(u=a[0];u--;i=i.lastChild){}while(o=i.firstChild){t.appendChild(o)}return t};function vt(e){var t=e.nodeName;return t.toLowerCase()===t&&e.scopeName&&e.outerText===""}function pt(e){if(e.currentStyle.behavior!=="url(#default#VML)"){e.style.behavior="url(#default#VML)";e.style.display="inline-block";e.style.zoom=1}}avalon.innerHTML=function(e,t){if(!T&&(!lt.test(t)&&!ut.test(t))){try{e.innerHTML=t;return}catch(r){}}var a=this.parseHTML(t);this.clearHTML(e).appendChild(a)};avalon.clearHTML=function(e){e.textContent="";while(e.firstChild){e.removeChild(e.firstChild)}return e};function dt(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function ht(e){if(!e||e.indexOf("-")<0&&e.indexOf("_")<0){return e}return e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}var mt={_toString:function(){var e=this.node;var t=e.className;var r=typeof t==="string"?t:t.baseVal;return r.split(/\s+/).join(" ")},_contains:function(e){return(" "+this+" ").indexOf(" "+e+" ")>-1},_add:function(e){if(!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;if(m.test(t)){t.setAttribute("class",e)}else{t.className=e}}};function gt(e){if(!("classList"in e)){e.classList={node:e};for(var t in mt){e.classList[t.slice(1)]=mt[t]}}return e.classList}"add,remove".replace(d,function(e){avalon.fn[e+"Class"]=function(t){var r=this[0];if(t&&typeof t==="string"&&r&&r.nodeType===1){t.replace(/\S+/g,function(t){gt(r)[e](t)})}return this}});avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return t.nodeType===1&>(t).contains(e)},toggleClass:function(e,t){var r,a=0;var n=String(e).split(/\s+/);var i=typeof t==="boolean";while(r=n[a++]){var o=i?t:!this.hasClass(r);this[o?"addClass":"removeClass"](r)}return this},attr:function(e,t){if(arguments.length===2){this[0].setAttribute(e,t);return this}else{return this[0].getAttribute(e)}},data:function(e,t){e="data-"+dt(e||"");switch(arguments.length){case 2:this.attr(e,t);return this;case 1:var r=this.attr(e);return yt(r);case 0:var a={};w.forEach.call(this[0].attributes,function(t){if(t){e=t.name;if(!e.indexOf("data-")){e=ht(e.slice(5));a[e]=yt(t.value)}}});return a}},removeData:function(e){e="data-"+dt(e);this[0].removeAttribute(e);return this},css:function(e,t){if(avalon.isPlainObject(e)){for(var r in e){avalon.css(this,r,e[r])}}else{var a=avalon.css(this,e,t)}return a!==void 0?a:this},position:function(){var e,t,r=this[0],a={top:0,left:0};if(!r){return}if(this.css("position")==="fixed"){t=r.getBoundingClientRect()}else{e=this.offsetParent();t=this.offset();if(e[0].tagName!=="HTML"){a=e.offset()}a.top+=avalon.css(e[0],"borderTopWidth",true);a.left+=avalon.css(e[0],"borderLeftWidth",true);a.top-=e.scrollTop();a.left-=e.scrollLeft()}return{top:t.top-a.top-avalon.css(r,"marginTop",true),left:t.left-a.left-avalon.css(r,"marginLeft",true)}},offsetParent:function(){var e=this[0].offsetParent;while(e&&avalon.css(e,"position")==="static"){e=e.offsetParent}return avalon(e||E)},bind:function(e,t,r){if(this[0]){return avalon.bind(this[0],e,t,r)}},unbind:function(e,t,r){if(this[0]){avalon.unbind(this[0],e,t,r)}return this},val:function(e){var t=this[0];if(t&&t.nodeType===1){var r=arguments.length===0;var a=r?":get":":set";var n=Bt[Pt(t)+a];if(n){var i=n(t,e)}else if(r){return(t.value||"").replace(/\r/g,"")}else{t.value=e}}return r?i:this}});function yt(e){try{if(typeof e==="object")return e;e=e==="true"?true:e==="false"?false:e==="null"?null:+e+""===e?+e:bt.test(e)?avalon.parseJSON(e):e}catch(t){}return e}var bt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,xt=/^[\],:{}\s]*$/,wt=/(?:^|:|,)(?:\s*\[)+/g,$t=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,Ct=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;avalon.parseJSON=e.JSON?JSON.parse:function(e){if(typeof e==="string"){e=e.trim();if(e){if(xt.test(e.replace($t,"@").replace(Ct,"]").replace(wt,""))){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(r){var a=this[0]||{},n=Tt(a),i=e==="scrollTop";if(!arguments.length){return n?t in n?n[t]:E[e]:a[e]}else{if(n){n.scrollTo(!i?r:avalon(n).scrollLeft(),i?r:avalon(n).scrollTop())}else{a[e]=r}}}});function Tt(e){return e.window&&e.document?e:e.nodeType===9?e.defaultView||e.parentWindow:false}var Et=avalon.cssHooks={};var kt=["","-webkit-","-o-","-moz-","-ms-"];var _t={"float":T?"cssFloat":"styleFloat"};avalon.cssNumber=O("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom");avalon.cssName=function(e,t,r){if(_t[e]){return _t[e]}t=t||E.style;for(var a=0,n=kt.length;a]+))?)*\s+value[\s=]/i;var Bt={"option:get":j?function(e){return Ft.test(e.outerHTML)?e.value:e.text.trim()}:function(e){return e.value},"select:get":function(e,t){var r,a=e.options,n=e.selectedIndex,i=Bt["option:get"],o=e.type==="select-one"||n<0,l=o?null:[],s=o?n+1:a.length,u=n<0?s:o?n:0;for(;u-1){r=true}}if(!r){e.selectedIndex=-1}}};var It={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var Rt=e.JSON&&JSON.stringify||function(e){return'"'+e.replace(/[\\\"\x00-\x1f]/g,function(e){var t=It[e];return typeof t==="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"'};var Vt=["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(",");var Ut=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g;var qt=/[^\w$]+/g;var Wt=new RegExp(["\\b"+Vt.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g");var zt=/\b\d[^,]*/g;var Xt=/^,+|,+$/g;var Yt=new V(512);var Gt=function(e){var t=","+e.trim();var r=Yt.get(t);if(r){return r}var a=e.replace(Ut,"").replace(qt,",").replace(Wt,"").replace(zt,"").replace(Xt,"").split(/^$|,+/);return Yt.put(t,Zt(a))};function Jt(e,t,r,a){var n=[],i=" = "+r+".";var o=/\$proxy\$each/.test(t.$id);for(var l=e.length,s;s=e[--l];){var u=o&&t.$map[s]?"el":s;if(t.hasOwnProperty(u)){n.push(s+i+u);a.vars.push(s);if(a.type==="duplex"){e.get=r+"."+u}e.splice(l,1)}}return n}function Zt(e){var t=[],r={};for(var a=0;a-1||e.indexOf("&&")>-1)){a.vars.forEach(function(t){var r=new RegExp("\\b"+t+"(?:\\.\\w+|\\[\\w+\\])+","ig");e=e.replace(r,function(r){var a=r.charAt(t.length);var n=j?e.slice(arguments[1]+r.length):RegExp.rightContext;var i=/^\s*\(/.test(n);if(a==="."||a==="["||i){var o="var"+String(Math.random()).replace(/^0\./,"");if(i){var l=r.split(".");if(l.length>2){var s=l.pop();u.push(o+" = "+l.join("."));return o+"."+s}else{return r}}u.push(o+" = "+r);return o}else{return r}})})}a.args=c;delete a.vars;var m=Qt.get(o);if(m){a.evaluator=m;return}v=u.join(", ");if(v){v="var "+v}if(/\S/.test(i)){if(!/text|html/.test(a.type)){throw Error("ms-"+a.type+"不支持过滤器")}e="\nvar ret"+r+" = "+e+";\r\n";e+=or("ret"+r,i)}else if(n==="duplex"){var g="'use strict';\nreturn function(vvv){\n "+v+";\n if(!arguments.length){\n return "+e+"\n }\n "+(!Kt.test(e)?l.get:e)+"= vvv;\n} ";try{m=Function.apply(N,f.concat(g));a.evaluator=Qt.put(o,m)}catch(y){s("debug: parse error,"+y.message)}return}else if(n==="on"){if(e.indexOf("(")===-1){e+=".call(this, $event)"}else{e=e.replace("(",".call(this,")}f.push("$event");e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn");var x=e.slice(0,b);var w=e.slice(b);e=x+"\n"+w}else{e="\nreturn "+e+";"}try{m=Function.apply(N,f.concat("'use strict';\n"+v+e));a.evaluator=Qt.put(o,m)}catch(y){s("debug: parse error,"+y.message)}finally{l=u=f=null}}function sr(e,t,r,a,n){if(Array.isArray(a)){e=a.map(function(e){return e.expr?"("+e.value+")":Rt(e.value)}).join(" + ")}lr(e,t,r);if(r.evaluator&&!n){r.handler=I[r.handlerName||r.type];avalon.injectBinding(r)}}avalon.parseExprProxy=sr;avalon.scan=function(e,t){e=e||E;var r=t?[].concat(t):[];Sr(e,r)};var ur=O("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase());function fr(e,t,r){var a=setTimeout(function(){var n=e.innerHTML;clearTimeout(a);if(n===r){t()}else{fr(e,t,n)}})}function cr(e,t){var r=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",r);t.$events.expr=e.tagName+'[avalonctrl="'+r+'"]'}var vr=function(e,t,r){var a=e.getAttribute(t);if(a){for(var n=0,i;i=r[n++];){if(i.hasOwnProperty(a)&&typeof i[a]==="function"){return i[a]}}}};function pr(e,t){for(var r=0,a;a=e[r++];){a.vmodels=t;B[a.type](a,t);if(a.evaluator&&a.element&&a.element.nodeType===1){a.element.removeAttribute(a.name)}}e.length=0}var dr=j&&e.MutationObserver?function(e){var t=e.firstChild,r;while(t){var a=t.nextSibling;if(t.nodeType===3){if(r){r.nodeValue+=t.nodeValue;e.removeChild(t)}else{r=t}}else{r=null}t=a}}:0;var hr=/ms-(\w+)-?(.*)/;var mr={"if":10,repeat:90,data:100,widget:110,each:1400,"with":1500,duplex:2e3,on:3e3};var gr=O("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit");var yr=O("value,title,alt,checked,selected,disabled,readonly,enabled");function br(e,t){return e.priority-t.priority}function xr(e,t,r){var a=true;if(t.length){var n=Ar?Ar(e):e.attributes;var i=[];var o=[];var l={};for(var u=0,f;f=n[u++];){if(f.specified){if(r=f.name.match(hr)){var c=r[1];var v=r[2]||"";var p=f.value;var d=f.name;if(gr[c]){v=c;c="on"}else if(yr[c]){if(c==="enabled"){s("warning!ms-enabled或ms-attr-enabled已经被废弃");c="disabled";p="!("+p+")"}v=c;c="attr";d="ms-"+c+"-"+v;o.push([f.name,d,p])}l[d]=p;if(typeof B[c]==="function"){var h={type:c,param:v,element:e,name:d,value:p,priority:(mr[c]||c.charCodeAt(0)*10)+(Number(v.replace(/\D/g,""))||0)};if(c==="html"||c==="text"){var m=Fr(p);avalon.mix(h,m);h.filters=h.filters.replace(jr,function(){h.type="html";h.group=1;return""})}else if(c==="duplex"){var g=d}else if(d==="ms-if-loop"){h.priority+=100}i.push(h);if(c==="widget"){e.msData=e.msData||l}}}}}if(i.length){i.sort(br);o.forEach(function(t){s("warning!请改用"+t[1]+"代替"+t[0]+"!");e.removeAttribute(t[0]);e.setAttribute(t[1],t[2])});if(g){if(l["ms-attr-checked"]){s("warning!一个控件不能同时定义ms-attr-checked与"+g)}if(l["ms-attr-value"]){s("warning!一个控件不能同时定义ms-attr-value与"+g)}}for(u=0;h=i[u];u++){c=h.type;if(wr.test(c)){return pr(i.slice(0,u+1),t)}else if(a){a=!$r.test(c)}}pr(i,t)}}if(a&&!ur[e.tagName]&&fe.test(e.innerHTML.replace(Hr,"<").replace(Dr,">"))){dr&&dr(e);Nr(e,t)}}var wr=/^if|widget|repeat$/;var $r=/^each|with|html|include$/;if(!"1"[0]){var Cr=new V(512);var Tr=/\s+(ms-[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Er=/^['"]/,kr=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i,_r=/&/g;var Ar=function(e){var t=e.outerHTML;if(t.slice(0,2)===""||!t.trim()){return[]}var r=t.match(kr)[0];var a=[],n,i,o;var l=Cr.get(r);if(l){return l}while(i=Tr.exec(r)){o=i[2];if(o){o=(Er.test(o)?o.slice(1,-1):o).replace(_r,"&")}var s=i[1].toLowerCase();n=s.match(hr);var u={name:s,specified:true,value:o||""};a.push(u)}return Cr.put(r,a)}}function Nr(e,t){var r=avalon.slice(e.childNodes);Or(r,t)}function Or(e,t){for(var r=0,a;a=e[r++];){Mr(a,a.nodeType,t)}}function Mr(e,t,r){if(t===1){Sr(e,r);if(e.msCallback){e.msCallback();e.msCallback=void 0}}else if(t===3&&se.test(e.data)){Ir(e,r)}else if(ie.commentInterpolate&&t===8&&!se.test(e.nodeValue)){Ir(e,r)}}function Sr(e,t,r){var a=e.getAttribute("ms-skip");if(!e.getAttributeNode){return s("warning "+e.tagName+" no getAttributeNode method")}var n=e.getAttributeNode("ms-important");var i=e.getAttributeNode("ms-controller");if(typeof a==="string"){return}else if(r=n||i){var o=avalon.vmodels[r.value];if(!o){return}t=r===n?[o]:[o].concat(t);var l=r.name;e.removeAttribute(l);avalon(e).removeClass(l);cr(e,o)}xr(e,t)}var jr=/\|\s*html\s*/,Lr=/\|\|/g,Hr=/</g,Dr=/>/g,Pr=/(['"])(\\\1|.)+?\1/g;function Fr(e,t){if(e.indexOf("|")>0){var r=e.replace(Pr,function(e){return Array(e.length+1).join("1")});var a=r.replace(Lr,"ᄢ㍄").indexOf("|");if(a>-1){return{filters:e.slice(a),value:e.slice(0,a),pos:t||0,expr:true}}}return{value:e,filters:"",expr:true}}function Br(e){var t=[],r,a=0,n;do{n=e.indexOf(oe,a);if(n===-1){break}r=e.slice(a,n);if(r){t.push({value:r,filters:"",expr:false})}a=n+oe.length;n=e.indexOf(le,a);if(n===-1){break}r=e.slice(a,n);if(r){t.push(Fr(r,a))}a=n+le.length}while(1);r=e.slice(a);if(r){t.push({value:r,expr:false,filters:""})}return t}function Ir(e,t){var r=[];if(e.nodeType===8){var a=Fr(e.nodeValue);var i=[a]}else{i=Br(e.data)}if(i.length){for(var o=0;a=i[o++];){var l=n.createTextNode(a.value);if(a.expr){a.type="text";a.element=l;a.filters=a.filters.replace(jr,function(){a.type="html";return""});r.push(a)}k.appendChild(l)}e.parentNode.replaceChild(k,e);if(r.length)pr(r,t)}}var Rr=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(",");var Vr={};Rr.replace(d,function(e){Vr[e.toLowerCase()]=e});var Ur={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"};var qr=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");qr.replace(d,function(e){Ur[e.toLowerCase()]=e});var Wr=/(?:[\s\S]+?)<\/noscript>/gim;var zr=/([\s\S]+?)<\/noscript>/im;var Xr=function(){return new(e.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")};var Yr=avalon.templateCache={};B.attr=function(e,t){var r=e.value.trim(),a=true;if(r.indexOf(oe)>-1&&r.indexOf(le)>2){a=false;if(se.test(r)&&RegExp.rightContext===""&&RegExp.leftContext===""){a=true;r=RegExp.$1}}if(e.type==="include"){var i=e.element;e.includeRendered=vr(i,"data-include-rendered",t);e.includeLoaded=vr(i,"data-include-loaded",t);var o=e.includeReplace=!!avalon(i).data("includeReplace");if(avalon(i).data("includeCache")){e.templateCache={}}e.startInclude=n.createComment("ms-include");e.endInclude=n.createComment("ms-include-end");if(o){e.element=e.startInclude;i.parentNode.insertBefore(e.startInclude,i);i.parentNode.insertBefore(e.endInclude,i.nextSibling)}else{i.insertBefore(e.startInclude,i.firstChild);i.appendChild(e.endInclude)}}e.handlerName="attr";sr(r,t,e,a?0:Br(e.value))};I.attr=function(t,r,a){var i=a.type,l=a.param;if(i==="css"){avalon(r).css(l,t)}else if(i==="attr"){var s=t===false||t===null||t===void 0;if(!T&&Ur[l]){l=Ur[l]}var u=Vr[l];if(typeof r[u]==="boolean"){r[u]=!!t;if(!t){s=true}}if(s){return r.removeAttribute(l)}var f=m.test(r)?false:n.namespaces&&vt(r)?true:l in r.cloneNode(false);if(f){r[l]=t}else{r.setAttribute(l,t)}}else if(i==="include"&&t){var c=a.vmodels;var v=a.includeRendered;var p=a.includeLoaded;var d=a.includeReplace;var h=d?r.parentNode:r;var g=function(e){if(p){var r=p.apply(h,[e].concat(c));if(typeof r==="string")e=r}if(v){fr(h,function(){v.call(h)},NaN)}var i=a.includeLastID;if(a.templateCache&&i&&i!==t){var l=a.templateCache[i];if(!l){l=a.templateCache[i]=n.createElement("div");o.appendChild(l)}}a.includeLastID=t;while(true){var s=a.startInclude.nextSibling;if(s&&s!==a.endInclude){h.removeChild(s);if(l)l.appendChild(s)}else{break}}var u=Gr(a,t,e);var f=avalon.slice(u.childNodes);h.insertBefore(u,a.endInclude);Or(f,c)};if(a.param==="src"){if(typeof Yr[t]==="string"){avalon.nextTick(function(){g(Yr[t])})}else if(Array.isArray(Yr[t])){Yr[t].push(g)}else{var y=Xr();y.onreadystatechange=function(){if(y.readyState===4){var e=y.status;if(e>=200&&e<300||e===304||e===1223){var r=y.responseText;for(var a=0,n;n=Yr[t][a++];){n(r)}Yr[t]=r}}};Yr[t]=[g];y.open("GET",t,true);if("withCredentials"in y){y.withCredentials=true}y.setRequestHeader("X-Requested-With","XMLHttpRequest");y.send(null)}}else{var b=t&&t.nodeType===1?t:n.getElementById(t);if(b){if(b.tagName==="NOSCRIPT"&&!(b.innerHTML||b.fixIE78)){y=Xr();y.open("GET",location,false);y.send(null);var x=n.getElementsByTagName("noscript");var w=(y.responseText||"").match(Wr)||[];var $=w.length;for(var C=0;C<$;C++){var k=x[C];if(k){k.style.display="none";k.fixIE78=(w[C].match(zr)||[""," "])[1]}}}avalon.nextTick(function(){g(b.fixIE78||b.value||b.innerText||b.innerHTML)})}}}else{if(!E.hasAttribute&&typeof t==="string"&&(i==="src"||i==="href")){t=t.replace(/&/g,"&")}r[i]=t;if(e.chrome&&r.tagName==="EMBED"){var _=r.parentNode;var A=document.createComment("ms-src");_.replaceChild(A,r);_.replaceChild(r,A)}}};function Gr(e,t,r){var a=e.templateCache&&e.templateCache[t];if(a){var i=n.createDocumentFragment(),o;while(o=a.firstChild){i.appendChild(o)}return i}return avalon.parseHTML(r)}"title,alt,src,value,css,include,href".replace(d,function(e){B[e]=B.attr});B["class"]=function(e,t){var r=e.param,a=e.value,n;e.handlerName="class";if(!r||isFinite(r)){e.param="";var i=a.replace(ue,function(e){return e.replace(/./g,"0")});var o=i.indexOf(":");if(o===-1){var l=a}else{l=a.slice(0,o);n=a.slice(o+1);lr(n,t,e);if(!e.evaluator){s("debug: ms-class '"+(n||"").trim()+"' 不存在于VM中");return false}else{e._evaluator=e.evaluator;e._args=e.args}}var u=se.test(l);if(!u){e.immobileClass=l}sr("",t,e,u?Br(l):0)}else{e.immobileClass=e.oldStyle=e.param;sr(a,t,e)}};I["class"]=function(e,t,r){var a=avalon(t),n=r.type;if(n==="class"&&r.oldStyle){a.toggleClass(r.oldStyle,!!e)}else{r.toggleClass=r._evaluator?!!r._evaluator.apply(t,r._args):true;r.newClass=r.immobileClass||e;if(r.oldClass&&r.newClass!==r.oldClass){a.removeClass(r.oldClass)}r.oldClass=r.newClass;switch(n){case"class":a.toggleClass(r.newClass,r.toggleClass);break;case"hover":case"active":if(!r.hasBindEvent){var i="mouseenter";var o="mouseleave";if(n==="active"){t.tabIndex=t.tabIndex||-1;i="mousedown";o="mouseup";var l=a.bind("mouseleave",function(){r.toggleClass&&a.removeClass(r.newClass)})}var s=a.bind(i,function(){r.toggleClass&&a.addClass(r.newClass)});var u=a.bind(o,function(){r.toggleClass&&a.removeClass(r.newClass)});r.rollback=function(){a.unbind("mouseleave",l);a.unbind(i,s);a.unbind(o,u)};r.hasBindEvent=true}break}}};"hover,active".replace(d,function(e){B[e]=B["class"]});I.data=function(e,t,r){var a="data-"+r.param;if(e&&typeof e==="object"){t[a]=e}else{t.setAttribute(a,String(e))}};var Jr=B.duplex=function(e,t){var r=e.element,a;sr(e.value,t,e,0,1);e.changed=vr(r,"data-duplex-changed",t)||N;if(e.evaluator&&e.args){var n=[];var i=O("string,number,boolean,checked");if(r.type==="radio"&&e.param===""){e.param="checked"}if(r.msData){r.msData["ms-duplex"]=e.value}e.param.replace(/\w+/g,function(t){if(/^(checkbox|radio)$/.test(r.type)&&/^(radio|checked)$/.test(t)){if(t==="radio")s("ms-duplex-radio已经更名为ms-duplex-checked");t="checked";e.isChecked=true}if(t==="bool"){t="boolean";s("ms-duplex-bool已经更名为ms-duplex-boolean")}else if(t==="text"){t="string";s("ms-duplex-text已经更名为ms-duplex-string")}if(i[t]){a=true}avalon.Array.ensure(n,t)});if(!a){n.push("string")}e.param=n.join("-");e.bound=function(t,a){if(r.addEventListener){r.addEventListener(t,a,false)}else{r.attachEvent("on"+t,a)}var n=e.rollback;e.rollback=function(){r.avalonSetter=null;avalon.unbind(r,t,a);n&&n()}};for(var o in avalon.vmodels){var l=avalon.vmodels[o];l.$fire("avalon-ms-duplex-init",e)}var u=e.pipe||(e.pipe=Qr);u(null,e,"init");var f=r.tagName;Jr[f]&&Jr[f](r,e.evaluator.apply(null,e.args),e)}};function Zr(e){return e==null?"":e}avalon.duplexHooks={checked:{get:function(e,t){return!t.element.oldValue}},string:{get:function(e){return e},set:Zr},"boolean":{get:function(e){return e==="true"},set:Zr},number:{get:function(e,t){var r=parseFloat(e);if(-e===-r){return r}var a=/strong|medium|weak/.exec(t.element.getAttribute("data-duplex-number"))||["medium"];switch(a[0]){case"strong":return 0;case"medium":return e===""?"":0;case"weak":return e}},set:Zr}};function Qr(e,t,r,a){t.param.replace(/\w+/g,function(a){var n=avalon.duplexHooks[a];if(n&&typeof n[r]==="function"){e=n[r](e,t)}});return e}var Kr,ea=[];avalon.tick=function(e){if(ea.push(e)===1){Kr=setInterval(ta,60)}};function ta(){for(var e=ea.length-1;e>=0;e--){var t=ea[e];if(t()===false){ea.splice(e,1)}}if(!ea.length){clearInterval(Kr)}}var ra=N;var aa=/text|password|hidden/;new function(){try{var e={};var t=HTMLInputElement.prototype;var r=HTMLTextAreaElement.prototype;function a(t){if(avalon.contains(E,this)){e[this.tagName].call(this,t);if(!aa.test(this.type))return;if(!this.msFocus&&this.avalonSetter){this.avalonSetter()}}}var n=HTMLInputElement.prototype;Object.getOwnPropertyNames(n);e["INPUT"]=Object.getOwnPropertyDescriptor(t,"value").set;Object.defineProperty(t,"value",{set:a});e["TEXTAREA"]=Object.getOwnPropertyDescriptor(r,"value").set;Object.defineProperty(r,"value",{set:a})}catch(i){ra=avalon.tick}};if(j){avalon.bind(n,"selectionchange",function(e){var t=n.activeElement;if(t&&typeof t.avalonSetter==="function"){t.avalonSetter()}})}Jr.INPUT=function(e,t,r){var a=e.type,n=r.bound,i=avalon(e),o=false;function l(e){r.changed.call(this,e,r)}function u(){o=true}function f(){o=false}var c=function(){if(o)return;var a=e.oldValue=e.value;var n=r.pipe(a,r,"get");if(i.data("duplexObserve")!==false){t(n);l.call(e,n);if(i.data("duplex-focus")){avalon.nextTick(function(){e.focus()})}}};r.handler=function(){var a=r.pipe(t(),r,"set")+"";if(a!==e.oldValue){e.value=a}};if(r.isChecked||a==="radio"){var v=j===6;c=function(){if(i.data("duplexObserve")!==false){var a=r.pipe(e.value,r,"get");t(a);l.call(e,a)}};r.handler=function(){var a=t();var n=r.isChecked?!!a:a+""===e.value;e.oldValue=n;if(v){setTimeout(function(){e.defaultChecked=n;e.checked=n},31)}else{e.checked=n}};n("click",c)}else if(a==="checkbox"){c=function(){if(i.data("duplexObserve")!==false){var a=e.checked?"ensure":"remove";var n=t();if(!Array.isArray(n)){s("ms-duplex应用于checkbox上要对应一个数组");n=[n]}avalon.Array[a](n,r.pipe(e.value,r,"get"));l.call(e,n)}};r.handler=function(){var a=[].concat(t());e.checked=a.indexOf(r.pipe(e.value,r,"get"))>-1};n(T?"change":"click",c)}else{var p=e.getAttribute("data-duplex-event")||"input";if(e.attributes["data-event"]){s("data-event指令已经废弃,请改用data-duplex-event")}function h(e){setTimeout(function(){c(e)})}p.replace(d,function(e){switch(e){case"input":if(!j){n("input",c);n("compositionstart",u);n("compositionend",f);n("DOMAutoComplete",c)}else{if(j>8){n("input",c)}else{n("propertychange",function(e){if(e.propertyName==="value"){c()}})}n("dragend",h)}break;default:n(e,c);break}});n("focus",function(){e.msFocus=true});n("blur",function(){e.msFocus=false});if(aa.test(a)){ra(function(){if(E.contains(e)){if(!e.msFocus&&e.oldValue!==e.value){c()}}else if(!e.msRetain){return false}})}e.avalonSetter=c}e.oldValue=e.value;avalon.injectBinding(r);l.call(e,e.value)};Jr.TEXTAREA=Jr.INPUT;Jr.SELECT=function(e,t,r){var a=avalon(e);function n(){if(a.data("duplexObserve")!==false){var n=a.val();if(Array.isArray(n)){n=n.map(function(e){return r.pipe(e,r,"get")})}else{n=r.pipe(n,r,"get")}if(n+""!==e.oldValue){t(n)}r.changed.call(e,n,r)}}r.handler=function(){var r=t();r=r&&r.$model||r;if(Array.isArray(r)){if(!e.multiple){s("ms-duplex在